@hahnpro/hpc-api 2026.2.6 → 2026.2.7
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 +4 -0
- package/package.json +1 -1
- package/src/index.d.ts +3 -2
- package/src/index.js +3 -2
- package/src/lib/interfaces/ai.interface.d.ts +72 -8
- package/src/lib/interfaces/ai.interface.js +69 -1
- package/src/lib/interfaces/asset.interface.d.ts +1 -0
- package/src/lib/interfaces/content.interface.d.ts +2 -1
- package/src/lib/interfaces/content.interface.js +1 -0
- package/src/lib/interfaces/endpoint.interface.d.ts +2 -3
- package/src/lib/interfaces/index.d.ts +2 -2
- package/src/lib/interfaces/index.js +6 -1
- package/src/lib/interfaces/reference.interface.d.ts +2 -1
- package/src/lib/interfaces/reference.interface.js +1 -0
- package/src/lib/mock/api.mock.js +2 -3
- package/src/lib/mock/asset.mock.service.d.ts +4 -1
- package/src/lib/mock/asset.mock.service.js +3 -0
- package/src/lib/mock/content.mock.service.d.ts +7 -6
- package/src/lib/mock/content.mock.service.js +4 -1
- package/src/lib/mock/object-reference.mock.service.d.ts +3 -3
- package/src/lib/mock/object-reference.mock.service.js +6 -1
- package/src/lib/services/ai.service.d.ts +7 -7
- package/src/lib/services/ai.service.js +1 -1
- package/src/lib/services/asset.service.d.ts +4 -1
- package/src/lib/services/asset.service.js +3 -0
- package/src/lib/services/content.service.d.ts +1 -0
- package/src/lib/services/content.service.js +2 -0
- package/src/lib/services/http-client.service.d.ts +1 -0
- package/src/lib/services/http-client.service.js +10 -0
- package/src/lib/services/index.d.ts +1 -1
- package/src/lib/services/index.js +2 -2
- package/src/lib/services/{reference.service.d.ts → object-reference.service.d.ts} +2 -2
- /package/src/lib/services/{reference.service.js → object-reference.service.js} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
# @hahnpro/hpc-api
|
|
2
2
|
|
|
3
|
+
# 2026.2.7
|
|
4
|
+
- Added enums: AgentId, AiAssistantId and Type ToolNameType with enums ToolName, ReturnToReferrerTool and HandOffTool
|
|
5
|
+
|
|
3
6
|
# 2026.2.6
|
|
7
|
+
|
|
4
8
|
- Updated Search-Interface: SearchResult -> SearchMatchReason -> SearchMatchReasonContentPart
|
|
5
9
|
- Updated search-service search method
|
|
6
10
|
- Update AI-Interface: added ResourceSelectionRejected interface
|
package/package.json
CHANGED
package/src/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
export * from './lib/interfaces';
|
|
2
|
-
export * from './lib/services';
|
|
3
1
|
export * from './lib/api';
|
|
4
2
|
export * from './lib/constants';
|
|
3
|
+
export * from './lib/interfaces';
|
|
5
4
|
export * from './lib/mock';
|
|
5
|
+
export * from './lib/services';
|
|
6
|
+
export * from './lib/token-set';
|
|
6
7
|
export * from './lib/utils';
|
package/src/index.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
tslib_1.__exportStar(require("./lib/interfaces"), exports);
|
|
5
|
-
tslib_1.__exportStar(require("./lib/services"), exports);
|
|
6
4
|
tslib_1.__exportStar(require("./lib/api"), exports);
|
|
7
5
|
tslib_1.__exportStar(require("./lib/constants"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./lib/interfaces"), exports);
|
|
8
7
|
tslib_1.__exportStar(require("./lib/mock"), exports);
|
|
8
|
+
tslib_1.__exportStar(require("./lib/services"), exports);
|
|
9
|
+
tslib_1.__exportStar(require("./lib/token-set"), exports);
|
|
9
10
|
tslib_1.__exportStar(require("./lib/utils"), exports);
|
|
@@ -47,9 +47,73 @@ export declare enum ReferenceType {
|
|
|
47
47
|
TASK = "task",
|
|
48
48
|
WEB_SOURCE = "web-source"
|
|
49
49
|
}
|
|
50
|
+
export declare enum AgentId {
|
|
51
|
+
ASSET = "asset-agent",
|
|
52
|
+
ASSET_IDENTIFIER = "asset-identifier-agent",
|
|
53
|
+
ASSET_MULTI_IDENTIFIER = "asset-multi-identifier-agent",
|
|
54
|
+
ASSET_WEB = "asset-web-agent",
|
|
55
|
+
MESSAGE = "message-agent",
|
|
56
|
+
STATUS = "status-agent",
|
|
57
|
+
REPORT = "report-agent",
|
|
58
|
+
DEEP_RESEARCH = "deep-research-agent",
|
|
59
|
+
RESEARCH_GOAL_CLARIFIER = "research-goal-clarifier-agent",
|
|
60
|
+
RESEARCH_INSTRUCTION_BUILDER = "research-instruction-builder-agent",
|
|
61
|
+
AXALTA_ASSET_IDENTIFIER = "axalta-asset-identifier-agent",
|
|
62
|
+
AXALTA_MESSAGE = "axalta-message-agent",
|
|
63
|
+
TRIAGE = "triage-agent"
|
|
64
|
+
}
|
|
65
|
+
export declare enum ToolName {
|
|
66
|
+
SWITCH_ASSISTANT = "switchAssistant",
|
|
67
|
+
FIND_TASKS_BY_ASSET = "findTasksByAsset",
|
|
68
|
+
CREATE_REPORT = "createReport",
|
|
69
|
+
CREATE_JSON_REPORT = "createJSONReport",
|
|
70
|
+
GET_REPORT_TEMPLATE = "getReportTemplate",
|
|
71
|
+
GET_ADDITIONAL_DATA_TEMPLATE = "getAdditionalDataTemplate",
|
|
72
|
+
GET_INCIDENT_TEMPLATE = "getIncidentTemplate",
|
|
73
|
+
GET_ASSET_STATUS = "getAssetStatus",
|
|
74
|
+
FIND_TASK_BY_NAME = "findTaskByName",
|
|
75
|
+
GET_TASK_LOGBOOK_ENTRIES = "getTaskLogbookEntries",
|
|
76
|
+
CREATE_EVENT = "createEvent",
|
|
77
|
+
GET_ASSET_DATA = "getAssetData",
|
|
78
|
+
ASSET_SELECTION = "assetSelection",
|
|
79
|
+
SEARCH_FOR_ASSETS_BY_ID_NAME_TYPE = "searchForAssetsByIdNameType",
|
|
80
|
+
SEARCH_ASSET_TYPES = "searchAssetTypes",
|
|
81
|
+
SEARCH_FOR_EVENTS = "searchForEvents",
|
|
82
|
+
SEARCH_FOR_ASSET_AXALTA = "searchForAssetAxalta",
|
|
83
|
+
SEARCH_FOR_ASSET_WITH_ID = "searchForAssetWithId",
|
|
84
|
+
CREATE_AXALTA_EVENT = "createAxaltaEvent",
|
|
85
|
+
RESOURCE_SELECTION = "resourceSelection",
|
|
86
|
+
SEARCH_ASSETS = "searchAssets",
|
|
87
|
+
UPDATE_TASK_LOGBOOK_ENTRY = "updateTaskLogbookEntry",
|
|
88
|
+
SEARCH_FOR_DOCUMENTS = "searchForDocuments",
|
|
89
|
+
ADD_TASK_LOGBOOK_ENTRY = "addTaskLogbookEntry",
|
|
90
|
+
WEB_SEARCH = "web_search"
|
|
91
|
+
}
|
|
92
|
+
export declare enum ReturnToReferrerTool {
|
|
93
|
+
ASSET_IDENTIFIER = "returnToReferrer_asset-identifier-agent",
|
|
94
|
+
ASSET_MULTI_IDENTIFIER = "returnToReferrer_asset-multi-identifier-agent",
|
|
95
|
+
AXALTA_ASSET_IDENTIFIER = "returnToReferrer_axalta-asset-identifier-agent"
|
|
96
|
+
}
|
|
97
|
+
export declare enum HandOffTool {
|
|
98
|
+
ASSET_IDENTIFIER = "handoff_to_asset-identifier-agent",
|
|
99
|
+
ASSET_MULTI_IDENTIFIER = "handoff_to_asset-multi-identifier-agent",
|
|
100
|
+
AXALTA_ASSET_IDENTIFIER = "handoff_to_axalta-asset-identifier-agent",
|
|
101
|
+
DEEP_RESEARCH = "handoff_to_deep-research-agent",
|
|
102
|
+
RESEARCH_GOAL_CLARIFIER = "handoff_to_research-goal-clarifier-agent",
|
|
103
|
+
RESEARCH_INSTRUCTION_BUILDER = "handoff_to_research-instruction-builder-agent",
|
|
104
|
+
TRIAGE = "handoff_to_triage-agent"
|
|
105
|
+
}
|
|
106
|
+
export declare enum AiAssistantId {
|
|
107
|
+
ASSET = "asset-assistant",
|
|
108
|
+
ASSET_WEB = "asset-web-assistant",
|
|
109
|
+
INCIDENT = "incident-assistant",
|
|
110
|
+
REPORT = "report-assistant",
|
|
111
|
+
AXALTA_INCIDENT = "axalta-incident-assistant"
|
|
112
|
+
}
|
|
113
|
+
export type ToolNameType = ToolName | HandOffTool | ReturnToReferrerTool;
|
|
50
114
|
export interface AiAssistant {
|
|
51
|
-
id:
|
|
52
|
-
agent
|
|
115
|
+
id: AiAssistantId;
|
|
116
|
+
agent: AgentId;
|
|
53
117
|
pipeline?: string[];
|
|
54
118
|
i18n: Record<AvailableLanguages, AssistantLabels>;
|
|
55
119
|
icon?: string;
|
|
@@ -81,18 +145,18 @@ export interface AssistantMessage extends BaseMessage {
|
|
|
81
145
|
responseId?: string;
|
|
82
146
|
role: Role.ASSISTANT;
|
|
83
147
|
content?: string;
|
|
84
|
-
agentStack?:
|
|
148
|
+
agentStack?: AgentId[];
|
|
85
149
|
status?: AssistantMessageStatus;
|
|
86
150
|
toolCalls?: {
|
|
87
151
|
type: 'tool-call';
|
|
88
152
|
toolCallId: string;
|
|
89
|
-
toolName:
|
|
153
|
+
toolName: ToolNameType;
|
|
90
154
|
args: any;
|
|
91
155
|
}[];
|
|
92
156
|
toolResults?: {
|
|
93
157
|
type: 'tool-result';
|
|
94
158
|
toolCallId: string;
|
|
95
|
-
toolName:
|
|
159
|
+
toolName: ToolNameType;
|
|
96
160
|
args: any;
|
|
97
161
|
result: any;
|
|
98
162
|
}[];
|
|
@@ -110,9 +174,9 @@ export interface SystemMessage extends BaseMessage {
|
|
|
110
174
|
export interface ToolMessage extends BaseMessage {
|
|
111
175
|
role: Role.TOOL;
|
|
112
176
|
toolCallId?: string;
|
|
113
|
-
toolName?:
|
|
177
|
+
toolName?: ToolNameType;
|
|
114
178
|
toolType?: ToolType;
|
|
115
|
-
agentStack?:
|
|
179
|
+
agentStack?: AgentId[];
|
|
116
180
|
status?: ToolMessageStatus;
|
|
117
181
|
result?: any;
|
|
118
182
|
args?: SelectionMessage | any;
|
|
@@ -131,7 +195,7 @@ export interface SpeechToken {
|
|
|
131
195
|
}
|
|
132
196
|
export interface Thread {
|
|
133
197
|
id: string;
|
|
134
|
-
assistantId:
|
|
198
|
+
assistantId: AiAssistantId;
|
|
135
199
|
owner: Owner;
|
|
136
200
|
messages: string[] | Message[];
|
|
137
201
|
isEphemeral: boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ReferenceType = exports.ToolType = exports.Role = exports.AvailableLanguages = exports.FinishReason = exports.ToolMessageStatus = exports.AssistantMessageStatus = void 0;
|
|
3
|
+
exports.AiAssistantId = exports.HandOffTool = exports.ReturnToReferrerTool = exports.ToolName = exports.AgentId = exports.ReferenceType = exports.ToolType = exports.Role = exports.AvailableLanguages = exports.FinishReason = exports.ToolMessageStatus = exports.AssistantMessageStatus = void 0;
|
|
4
4
|
var AssistantMessageStatus;
|
|
5
5
|
(function (AssistantMessageStatus) {
|
|
6
6
|
AssistantMessageStatus["ABORTING"] = "aborting";
|
|
@@ -56,3 +56,71 @@ var ReferenceType;
|
|
|
56
56
|
ReferenceType["TASK"] = "task";
|
|
57
57
|
ReferenceType["WEB_SOURCE"] = "web-source";
|
|
58
58
|
})(ReferenceType || (exports.ReferenceType = ReferenceType = {}));
|
|
59
|
+
var AgentId;
|
|
60
|
+
(function (AgentId) {
|
|
61
|
+
AgentId["ASSET"] = "asset-agent";
|
|
62
|
+
AgentId["ASSET_IDENTIFIER"] = "asset-identifier-agent";
|
|
63
|
+
AgentId["ASSET_MULTI_IDENTIFIER"] = "asset-multi-identifier-agent";
|
|
64
|
+
AgentId["ASSET_WEB"] = "asset-web-agent";
|
|
65
|
+
AgentId["MESSAGE"] = "message-agent";
|
|
66
|
+
AgentId["STATUS"] = "status-agent";
|
|
67
|
+
AgentId["REPORT"] = "report-agent";
|
|
68
|
+
AgentId["DEEP_RESEARCH"] = "deep-research-agent";
|
|
69
|
+
AgentId["RESEARCH_GOAL_CLARIFIER"] = "research-goal-clarifier-agent";
|
|
70
|
+
AgentId["RESEARCH_INSTRUCTION_BUILDER"] = "research-instruction-builder-agent";
|
|
71
|
+
AgentId["AXALTA_ASSET_IDENTIFIER"] = "axalta-asset-identifier-agent";
|
|
72
|
+
AgentId["AXALTA_MESSAGE"] = "axalta-message-agent";
|
|
73
|
+
AgentId["TRIAGE"] = "triage-agent";
|
|
74
|
+
})(AgentId || (exports.AgentId = AgentId = {}));
|
|
75
|
+
var ToolName;
|
|
76
|
+
(function (ToolName) {
|
|
77
|
+
ToolName["SWITCH_ASSISTANT"] = "switchAssistant";
|
|
78
|
+
ToolName["FIND_TASKS_BY_ASSET"] = "findTasksByAsset";
|
|
79
|
+
ToolName["CREATE_REPORT"] = "createReport";
|
|
80
|
+
ToolName["CREATE_JSON_REPORT"] = "createJSONReport";
|
|
81
|
+
ToolName["GET_REPORT_TEMPLATE"] = "getReportTemplate";
|
|
82
|
+
ToolName["GET_ADDITIONAL_DATA_TEMPLATE"] = "getAdditionalDataTemplate";
|
|
83
|
+
ToolName["GET_INCIDENT_TEMPLATE"] = "getIncidentTemplate";
|
|
84
|
+
ToolName["GET_ASSET_STATUS"] = "getAssetStatus";
|
|
85
|
+
ToolName["FIND_TASK_BY_NAME"] = "findTaskByName";
|
|
86
|
+
ToolName["GET_TASK_LOGBOOK_ENTRIES"] = "getTaskLogbookEntries";
|
|
87
|
+
ToolName["CREATE_EVENT"] = "createEvent";
|
|
88
|
+
ToolName["GET_ASSET_DATA"] = "getAssetData";
|
|
89
|
+
ToolName["ASSET_SELECTION"] = "assetSelection";
|
|
90
|
+
ToolName["SEARCH_FOR_ASSETS_BY_ID_NAME_TYPE"] = "searchForAssetsByIdNameType";
|
|
91
|
+
ToolName["SEARCH_ASSET_TYPES"] = "searchAssetTypes";
|
|
92
|
+
ToolName["SEARCH_FOR_EVENTS"] = "searchForEvents";
|
|
93
|
+
ToolName["SEARCH_FOR_ASSET_AXALTA"] = "searchForAssetAxalta";
|
|
94
|
+
ToolName["SEARCH_FOR_ASSET_WITH_ID"] = "searchForAssetWithId";
|
|
95
|
+
ToolName["CREATE_AXALTA_EVENT"] = "createAxaltaEvent";
|
|
96
|
+
ToolName["RESOURCE_SELECTION"] = "resourceSelection";
|
|
97
|
+
ToolName["SEARCH_ASSETS"] = "searchAssets";
|
|
98
|
+
ToolName["UPDATE_TASK_LOGBOOK_ENTRY"] = "updateTaskLogbookEntry";
|
|
99
|
+
ToolName["SEARCH_FOR_DOCUMENTS"] = "searchForDocuments";
|
|
100
|
+
ToolName["ADD_TASK_LOGBOOK_ENTRY"] = "addTaskLogbookEntry";
|
|
101
|
+
ToolName["WEB_SEARCH"] = "web_search";
|
|
102
|
+
})(ToolName || (exports.ToolName = ToolName = {}));
|
|
103
|
+
var ReturnToReferrerTool;
|
|
104
|
+
(function (ReturnToReferrerTool) {
|
|
105
|
+
ReturnToReferrerTool["ASSET_IDENTIFIER"] = "returnToReferrer_asset-identifier-agent";
|
|
106
|
+
ReturnToReferrerTool["ASSET_MULTI_IDENTIFIER"] = "returnToReferrer_asset-multi-identifier-agent";
|
|
107
|
+
ReturnToReferrerTool["AXALTA_ASSET_IDENTIFIER"] = "returnToReferrer_axalta-asset-identifier-agent";
|
|
108
|
+
})(ReturnToReferrerTool || (exports.ReturnToReferrerTool = ReturnToReferrerTool = {}));
|
|
109
|
+
var HandOffTool;
|
|
110
|
+
(function (HandOffTool) {
|
|
111
|
+
HandOffTool["ASSET_IDENTIFIER"] = "handoff_to_asset-identifier-agent";
|
|
112
|
+
HandOffTool["ASSET_MULTI_IDENTIFIER"] = "handoff_to_asset-multi-identifier-agent";
|
|
113
|
+
HandOffTool["AXALTA_ASSET_IDENTIFIER"] = "handoff_to_axalta-asset-identifier-agent";
|
|
114
|
+
HandOffTool["DEEP_RESEARCH"] = "handoff_to_deep-research-agent";
|
|
115
|
+
HandOffTool["RESEARCH_GOAL_CLARIFIER"] = "handoff_to_research-goal-clarifier-agent";
|
|
116
|
+
HandOffTool["RESEARCH_INSTRUCTION_BUILDER"] = "handoff_to_research-instruction-builder-agent";
|
|
117
|
+
HandOffTool["TRIAGE"] = "handoff_to_triage-agent";
|
|
118
|
+
})(HandOffTool || (exports.HandOffTool = HandOffTool = {}));
|
|
119
|
+
var AiAssistantId;
|
|
120
|
+
(function (AiAssistantId) {
|
|
121
|
+
AiAssistantId["ASSET"] = "asset-assistant";
|
|
122
|
+
AiAssistantId["ASSET_WEB"] = "asset-web-assistant";
|
|
123
|
+
AiAssistantId["INCIDENT"] = "incident-assistant";
|
|
124
|
+
AiAssistantId["REPORT"] = "report-assistant";
|
|
125
|
+
AiAssistantId["AXALTA_INCIDENT"] = "axalta-incident-assistant";
|
|
126
|
+
})(AiAssistantId || (exports.AiAssistantId = AiAssistantId = {}));
|
|
@@ -11,4 +11,5 @@ var ReturnType;
|
|
|
11
11
|
ReturnType[ReturnType["NODEBUFFER"] = 2] = "NODEBUFFER";
|
|
12
12
|
ReturnType[ReturnType["BLOB"] = 3] = "BLOB";
|
|
13
13
|
ReturnType[ReturnType["ARRAYBUFFER"] = 4] = "ARRAYBUFFER";
|
|
14
|
+
ReturnType[ReturnType["STREAM"] = 5] = "STREAM";
|
|
14
15
|
})(ReturnType || (exports.ReturnType = ReturnType = {}));
|
|
@@ -11,9 +11,8 @@ export interface Endpoint {
|
|
|
11
11
|
authToken: string;
|
|
12
12
|
recipients?: string[];
|
|
13
13
|
};
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
nbOfNotificationsBetweenPauseInterval: number;
|
|
14
|
+
spamProtection?: string;
|
|
15
|
+
pauseInterval?: number;
|
|
17
16
|
readPermissions: string[];
|
|
18
17
|
readWritePermissions: string[];
|
|
19
18
|
owner?: Owner;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type { AiAssistant, AssetResourceSelectionOption, AssistantMessage, DocumentResourceSelectionOption, GenericResourceSelectionOption, LogbookEntryResourceSelectionOption, Message, ResourceSelectionOption, ResourceSelectionRejected, 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, ToolNameType, 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';
|
|
@@ -34,7 +34,7 @@ export type { Assignee, LogbookEntry, LogbookEntryDto, Task } from './task.inter
|
|
|
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';
|
|
37
|
-
export { AssistantMessageStatus, AvailableLanguages, FinishReason, ReferenceType, Role, ToolMessageStatus, ToolType } from './ai.interface';
|
|
37
|
+
export { AgentId, AiAssistantId, AssistantMessageStatus, AvailableLanguages, FinishReason, HandOffTool, ReferenceType, ReturnToReferrerTool, Role, ToolMessageStatus, ToolName, ToolType, } from './ai.interface';
|
|
38
38
|
export { AlertLevel, AlertType } from './alert.interface';
|
|
39
39
|
export { ReturnType } from './content.interface';
|
|
40
40
|
export { instanceOfTimePeriod } from './data.interface';
|
|
@@ -1,15 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
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;
|
|
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.ToolName = exports.ToolMessageStatus = exports.Role = exports.ReturnToReferrerTool = exports.ReferenceType = exports.HandOffTool = exports.FinishReason = exports.AvailableLanguages = exports.AssistantMessageStatus = exports.AiAssistantId = exports.AgentId = 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");
|
|
7
|
+
Object.defineProperty(exports, "AgentId", { enumerable: true, get: function () { return ai_interface_1.AgentId; } });
|
|
8
|
+
Object.defineProperty(exports, "AiAssistantId", { enumerable: true, get: function () { return ai_interface_1.AiAssistantId; } });
|
|
7
9
|
Object.defineProperty(exports, "AssistantMessageStatus", { enumerable: true, get: function () { return ai_interface_1.AssistantMessageStatus; } });
|
|
8
10
|
Object.defineProperty(exports, "AvailableLanguages", { enumerable: true, get: function () { return ai_interface_1.AvailableLanguages; } });
|
|
9
11
|
Object.defineProperty(exports, "FinishReason", { enumerable: true, get: function () { return ai_interface_1.FinishReason; } });
|
|
12
|
+
Object.defineProperty(exports, "HandOffTool", { enumerable: true, get: function () { return ai_interface_1.HandOffTool; } });
|
|
10
13
|
Object.defineProperty(exports, "ReferenceType", { enumerable: true, get: function () { return ai_interface_1.ReferenceType; } });
|
|
14
|
+
Object.defineProperty(exports, "ReturnToReferrerTool", { enumerable: true, get: function () { return ai_interface_1.ReturnToReferrerTool; } });
|
|
11
15
|
Object.defineProperty(exports, "Role", { enumerable: true, get: function () { return ai_interface_1.Role; } });
|
|
12
16
|
Object.defineProperty(exports, "ToolMessageStatus", { enumerable: true, get: function () { return ai_interface_1.ToolMessageStatus; } });
|
|
17
|
+
Object.defineProperty(exports, "ToolName", { enumerable: true, get: function () { return ai_interface_1.ToolName; } });
|
|
13
18
|
Object.defineProperty(exports, "ToolType", { enumerable: true, get: function () { return ai_interface_1.ToolType; } });
|
|
14
19
|
var alert_interface_1 = require("./alert.interface");
|
|
15
20
|
Object.defineProperty(exports, "AlertLevel", { enumerable: true, get: function () { return alert_interface_1.AlertLevel; } });
|
|
@@ -17,7 +17,8 @@ export declare enum ObjectReferenceType {
|
|
|
17
17
|
* Marks an Object as being part of the 'Weber Engineering Flange Skill Check Application' to link examinees to an
|
|
18
18
|
* examination, in which they participate.
|
|
19
19
|
*/
|
|
20
|
-
FLANGE_SKILL_CHECK_APPLICATION_EXAMINATION_EXAMINEE = "flange_skill_check_application_examination_examinee"
|
|
20
|
+
FLANGE_SKILL_CHECK_APPLICATION_EXAMINATION_EXAMINEE = "flange_skill_check_application_examination_examinee",
|
|
21
|
+
FLANGE_SKILL_CHECK_APPLICATION_EXAMINATION_EXAMINER = "flange_skill_check_application_examination_examiner"
|
|
21
22
|
}
|
|
22
23
|
export interface ObjectReference {
|
|
23
24
|
id: number;
|
|
@@ -22,4 +22,5 @@ var ObjectReferenceType;
|
|
|
22
22
|
* examination, in which they participate.
|
|
23
23
|
*/
|
|
24
24
|
ObjectReferenceType["FLANGE_SKILL_CHECK_APPLICATION_EXAMINATION_EXAMINEE"] = "flange_skill_check_application_examination_examinee";
|
|
25
|
+
ObjectReferenceType["FLANGE_SKILL_CHECK_APPLICATION_EXAMINATION_EXAMINER"] = "flange_skill_check_application_examination_examiner";
|
|
25
26
|
})(ObjectReferenceType || (exports.ObjectReferenceType = ObjectReferenceType = {}));
|
package/src/lib/mock/api.mock.js
CHANGED
|
@@ -64,9 +64,8 @@ class MockAPI {
|
|
|
64
64
|
...v,
|
|
65
65
|
status: v.status,
|
|
66
66
|
config: v.config,
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
nbOfNotificationsBetweenPauseInterval: v.nbOfNotificationsBetweenPauseInterval,
|
|
67
|
+
spamProtection: v.spamProtection,
|
|
68
|
+
pauseInterval: v.pauseInterval,
|
|
70
69
|
readPermissions: v.readPermissions ?? [],
|
|
71
70
|
readWritePermissions: v.readWritePermissions ?? [],
|
|
72
71
|
}));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { APIBaseMock, DataMockService, MockAPI, TrashMockService } from '.';
|
|
2
|
-
import { AddToProperty, Asset, AssetRevision, Attachment, DeleteQuery, EventCause, EventLevelOverride, Filter, Paginated, RemoveFromProperty, RequestParameter, TokenOption } from '../interfaces';
|
|
2
|
+
import { AddToProperty, Asset, AssetRevision, Attachment, DeleteQuery, EventCause, EventLevelOverride, Filter, Paginated, RemoveFromProperty, RequestParameter, TokenOption, type SearchResult } from '../interfaces';
|
|
3
3
|
import { AssetService } from '../services';
|
|
4
4
|
import { CrossPlatformFormData } from '../utils';
|
|
5
5
|
import { ShareMockService } from './share.mock.service';
|
|
@@ -33,5 +33,8 @@ export declare class AssetMockService extends BaseService implements AssetServic
|
|
|
33
33
|
link(id: string, elementId: string, targetProperty: string, options?: TokenOption & {
|
|
34
34
|
[key: string]: any;
|
|
35
35
|
}): Promise<void>;
|
|
36
|
+
search(query: string, params?: RequestParameter, options?: TokenOption & {
|
|
37
|
+
[key: string]: any;
|
|
38
|
+
}): Promise<SearchResult[]>;
|
|
36
39
|
}
|
|
37
40
|
export {};
|
|
@@ -135,5 +135,8 @@ class AssetMockService extends BaseService {
|
|
|
135
135
|
link(id, elementId, targetProperty, options = {}) {
|
|
136
136
|
throw new Error('Method not implemented.');
|
|
137
137
|
}
|
|
138
|
+
search(query, params = {}, options = {}) {
|
|
139
|
+
throw new Error('Method not implemented.');
|
|
140
|
+
}
|
|
138
141
|
}
|
|
139
142
|
exports.AssetMockService = AssetMockService;
|
|
@@ -10,12 +10,13 @@ declare class BaseService extends APIBaseMock<Content> {
|
|
|
10
10
|
export declare class ContentMockService extends BaseService implements ContentService {
|
|
11
11
|
private contentData;
|
|
12
12
|
constructor(contents: Content[], contentData: any[]);
|
|
13
|
-
download(id: string, raw?: boolean): Promise<Blob | ArrayBuffer>;
|
|
14
|
-
download(id: string, returnType: ReturnType.TEXT): Promise<string>;
|
|
15
|
-
download(id: string, returnType: ReturnType.JSON): Promise<Record<string, unknown>>;
|
|
16
|
-
download(id: string, returnType: ReturnType.NODEBUFFER): Promise<Buffer>;
|
|
17
|
-
download(id: string, returnType: ReturnType.BLOB): Promise<Blob>;
|
|
18
|
-
download(id: string, returnType: ReturnType.ARRAYBUFFER): Promise<ArrayBuffer>;
|
|
13
|
+
download(id: string, raw?: boolean, options?: any): Promise<Blob | ArrayBuffer>;
|
|
14
|
+
download(id: string, returnType: ReturnType.TEXT, options?: any): Promise<string>;
|
|
15
|
+
download(id: string, returnType: ReturnType.JSON, options?: any): Promise<Record<string, unknown>>;
|
|
16
|
+
download(id: string, returnType: ReturnType.NODEBUFFER, options?: any): Promise<Buffer>;
|
|
17
|
+
download(id: string, returnType: ReturnType.BLOB, options?: any): Promise<Blob>;
|
|
18
|
+
download(id: string, returnType: ReturnType.ARRAYBUFFER, options?: any): Promise<ArrayBuffer>;
|
|
19
|
+
download(id: string, returnType: ReturnType.STREAM, options?: any): Promise<any>;
|
|
19
20
|
deleteOne(contentId: string, deleteQuery?: DeleteQuery): Promise<Content>;
|
|
20
21
|
getMany(params?: RequestParameter): Promise<Paginated<Content>>;
|
|
21
22
|
upload(form: CrossPlatformFormData): Promise<Content>;
|
|
@@ -20,7 +20,7 @@ class ContentMockService extends BaseService {
|
|
|
20
20
|
this.contentData.set(contents[i].id, contentData[i]);
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
-
download(id, second) {
|
|
23
|
+
download(id, second, options = {}) {
|
|
24
24
|
let returnType;
|
|
25
25
|
if (typeof second === 'boolean' || second == null) {
|
|
26
26
|
returnType = second ? interfaces_1.ReturnType.ARRAYBUFFER : interfaces_1.ReturnType.BLOB;
|
|
@@ -60,6 +60,9 @@ class ContentMockService extends BaseService {
|
|
|
60
60
|
}
|
|
61
61
|
case interfaces_1.ReturnType.ARRAYBUFFER:
|
|
62
62
|
return Promise.resolve(Buffer.from(this.contentData.get(id)).buffer);
|
|
63
|
+
case interfaces_1.ReturnType.STREAM: // explicitly not supported in mock to stay browser compatible
|
|
64
|
+
default:
|
|
65
|
+
return Promise.reject(new Error(`ReturnType ${returnType} not supported in mock`));
|
|
63
66
|
}
|
|
64
67
|
}
|
|
65
68
|
deleteOne(contentId, deleteQuery = {}) {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { DataMockService } from '.';
|
|
2
|
-
import { CreateReferenceDto, ObjectReference, ObjectReferenceType, ReferencesQuery, TokenOption } from '../interfaces';
|
|
3
|
-
import { ObjectReferenceService } from '../services/reference.service';
|
|
2
|
+
import { CreateReferenceDto, ObjectReference, ObjectReferenceType, Paginated, ReferencesQuery, TokenOption } from '../interfaces';
|
|
3
|
+
import { ObjectReferenceService } from '../services/object-reference.service';
|
|
4
4
|
export declare class ObjectReferenceMockService extends DataMockService<ObjectReference> implements ObjectReferenceService {
|
|
5
5
|
constructor(initialData: ObjectReference[]);
|
|
6
|
-
find(query: ReferencesQuery, _options?: TokenOption): Promise<ObjectReference
|
|
6
|
+
find(query: ReferencesQuery, _options?: TokenOption): Promise<Paginated<ObjectReference>>;
|
|
7
7
|
findAll(objId: string, _options?: TokenOption): Promise<ObjectReference[]>;
|
|
8
8
|
create(dto: CreateReferenceDto, _options?: TokenOption): Promise<ObjectReference>;
|
|
9
9
|
update(referenceId: number, updateData: Partial<Omit<ObjectReference, 'id' | 'createdAt'>>, _options?: TokenOption): Promise<ObjectReference>;
|
|
@@ -8,7 +8,7 @@ class ObjectReferenceMockService extends _1.DataMockService {
|
|
|
8
8
|
this.data = initialData;
|
|
9
9
|
}
|
|
10
10
|
async find(query, _options = {}) {
|
|
11
|
-
|
|
11
|
+
const docs = this.data.filter((ref) => {
|
|
12
12
|
const matchObjId = ref.src === query.objId || ref.tgt === query.objId;
|
|
13
13
|
if (!matchObjId) {
|
|
14
14
|
return false;
|
|
@@ -25,6 +25,11 @@ class ObjectReferenceMockService extends _1.DataMockService {
|
|
|
25
25
|
// Note: connectedObjType filter logic could be added here if needed
|
|
26
26
|
return true;
|
|
27
27
|
});
|
|
28
|
+
return {
|
|
29
|
+
docs,
|
|
30
|
+
total: docs.length,
|
|
31
|
+
limit: docs.length,
|
|
32
|
+
};
|
|
28
33
|
}
|
|
29
34
|
async findAll(objId, _options = {}) {
|
|
30
35
|
return this.data.filter((ref) => ref.src === objId || ref.tgt === objId);
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { HttpClientService } from '.';
|
|
2
2
|
import { APIBase } from '../api-base';
|
|
3
|
-
import { AiAssistant, Message, Paginated, SpeechToken, Thread, ThreadPopulated, TokenOption } from '../interfaces';
|
|
3
|
+
import { AiAssistant, AiAssistantId, Message, Paginated, SpeechToken, Thread, ThreadPopulated, TokenOption } from '../interfaces';
|
|
4
4
|
export declare class AiService extends APIBase {
|
|
5
5
|
constructor(httpClient: HttpClientService);
|
|
6
|
-
addMessage(message: string, threadId?: string, assistantId?:
|
|
7
|
-
createThread(assistantId:
|
|
8
|
-
getLatestAssistantThread(assistantId:
|
|
9
|
-
listAssistantThreads(assistantId:
|
|
10
|
-
getAssistant(assistantId:
|
|
6
|
+
addMessage(message: string, threadId?: string, assistantId?: AiAssistantId, context?: Record<string, unknown>): Promise<Message>;
|
|
7
|
+
createThread(assistantId: AiAssistantId, isEphemeral?: boolean): Promise<ThreadPopulated>;
|
|
8
|
+
getLatestAssistantThread(assistantId: AiAssistantId): Promise<ThreadPopulated>;
|
|
9
|
+
listAssistantThreads(assistantId: AiAssistantId): Promise<ThreadPopulated[]>;
|
|
10
|
+
getAssistant(assistantId: AiAssistantId): Promise<AiAssistant>;
|
|
11
11
|
getAssistants(options?: TokenOption): Promise<AiAssistant[]>;
|
|
12
12
|
getSpeechToken(): Promise<SpeechToken>;
|
|
13
13
|
getThreadMessages(threadId: string): Promise<Paginated<Message>>;
|
|
14
14
|
getThread(threadId: string): Promise<ThreadPopulated>;
|
|
15
15
|
getLatestThread(): Promise<ThreadPopulated>;
|
|
16
|
-
listThreads(assistantIds?:
|
|
16
|
+
listThreads(assistantIds?: AiAssistantId[], params?: {}, options?: TokenOption): Promise<ThreadPopulated[]>;
|
|
17
17
|
provideFeedback(traceId: string, value: number, comment?: string): Promise<void>;
|
|
18
18
|
deleteThread(threadId: string, options?: TokenOption): Promise<Thread>;
|
|
19
19
|
}
|
|
@@ -37,7 +37,7 @@ class AiService extends api_base_1.APIBase {
|
|
|
37
37
|
return this.httpClient.get(`${this.basePath}/threads/latest`);
|
|
38
38
|
}
|
|
39
39
|
listThreads(assistantIds, params = {}, options = {}) {
|
|
40
|
-
if (assistantIds
|
|
40
|
+
if (assistantIds?.length) {
|
|
41
41
|
params = { ...params, assistantIds: assistantIds?.join(',') };
|
|
42
42
|
}
|
|
43
43
|
return this.httpClient.get(`${this.basePath}/threads`, { params, ...options });
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DataService, HttpClientService, TrashService } from '.';
|
|
2
2
|
import { APIBase } from '../api-base';
|
|
3
|
-
import { AddToProperty, Asset, AssetRevision, Attachment, DeleteAssetQuery, EventCause, EventLevelOverride, Filter, Paginated, RemoveFromProperty, RequestParameter, TokenOption } from '../interfaces';
|
|
3
|
+
import { AddToProperty, Asset, AssetRevision, Attachment, DeleteAssetQuery, EventCause, EventLevelOverride, Filter, Paginated, RemoveFromProperty, RequestParameter, TokenOption, type SearchResult } from '../interfaces';
|
|
4
4
|
import { CrossPlatformFormData } from '../utils';
|
|
5
5
|
import { ShareService } from './share.service';
|
|
6
6
|
interface BaseService extends DataService<Asset>, ShareService, TrashService<Asset> {
|
|
@@ -27,5 +27,8 @@ export declare class AssetService extends BaseService {
|
|
|
27
27
|
link(id: string, elementId: string, targetProperty: string, options?: TokenOption & {
|
|
28
28
|
[key: string]: any;
|
|
29
29
|
}): Promise<void>;
|
|
30
|
+
search(query: string, params?: RequestParameter, options?: TokenOption & {
|
|
31
|
+
[key: string]: any;
|
|
32
|
+
}): Promise<SearchResult[]>;
|
|
30
33
|
}
|
|
31
34
|
export {};
|
|
@@ -74,5 +74,8 @@ class AssetService extends BaseService {
|
|
|
74
74
|
targetProperty,
|
|
75
75
|
}, options);
|
|
76
76
|
}
|
|
77
|
+
search(query, params = {}, options = {}) {
|
|
78
|
+
return this.httpClient.get(`${this.basePath}/search`, { params: { ...params, query }, ...options });
|
|
79
|
+
}
|
|
77
80
|
}
|
|
78
81
|
exports.AssetService = AssetService;
|
|
@@ -16,5 +16,6 @@ export declare class ContentService extends BaseService {
|
|
|
16
16
|
download(id: string, returnType: ReturnType.NODEBUFFER, options?: TokenOption): Promise<Buffer>;
|
|
17
17
|
download(id: string, returnType: ReturnType.BLOB, options?: TokenOption): Promise<Blob>;
|
|
18
18
|
download(id: string, returnType: ReturnType.ARRAYBUFFER, options?: TokenOption): Promise<ArrayBuffer>;
|
|
19
|
+
download(id: string, returnType: ReturnType.STREAM, options?: TokenOption): Promise<any>;
|
|
19
20
|
}
|
|
20
21
|
export {};
|
|
@@ -47,6 +47,8 @@ class ContentService extends BaseService {
|
|
|
47
47
|
return this.httpClient.get(url, { responseType: 'blob', ...options });
|
|
48
48
|
case interfaces_1.ReturnType.ARRAYBUFFER:
|
|
49
49
|
return this.httpClient.get(url, { responseType: 'arraybuffer', ...options });
|
|
50
|
+
case interfaces_1.ReturnType.STREAM:
|
|
51
|
+
return this.httpClient.get(url, { responseType: 'stream', ...options });
|
|
50
52
|
}
|
|
51
53
|
}
|
|
52
54
|
}
|
|
@@ -62,6 +62,7 @@ export declare class HttpClientService {
|
|
|
62
62
|
protected discoverIssuer(uri: string): Promise<Issuer>;
|
|
63
63
|
protected requestAccessToken(additionalOpts?: {}): Promise<TokenSet>;
|
|
64
64
|
protected exchangeAccessToken(accessToken: string): Promise<TokenSet>;
|
|
65
|
+
exchangeExternalToken(token: string, subjectIssuer: string): Promise<TokenSet>;
|
|
65
66
|
provideExternalToken(token: string): Promise<void>;
|
|
66
67
|
private requestPromise;
|
|
67
68
|
}
|
|
@@ -258,6 +258,16 @@ class HttpClientService {
|
|
|
258
258
|
};
|
|
259
259
|
return this.requestAccessToken(opts);
|
|
260
260
|
}
|
|
261
|
+
async exchangeExternalToken(token, subjectIssuer) {
|
|
262
|
+
return this.requestAccessToken({
|
|
263
|
+
grant_type: 'urn:ietf:params:oauth:grant-type:token-exchange',
|
|
264
|
+
subject_token: token,
|
|
265
|
+
subject_token_type: 'urn:ietf:params:oauth:token-type:access_token',
|
|
266
|
+
subject_issuer: subjectIssuer,
|
|
267
|
+
requested_token_type: 'urn:ietf:params:oauth:token-type:access_token',
|
|
268
|
+
audience: this.clientId,
|
|
269
|
+
});
|
|
270
|
+
}
|
|
261
271
|
async provideExternalToken(token) {
|
|
262
272
|
const issuer = await this.discoverIssuer(`${this.authBaseURL}/realms/${this.realm}`);
|
|
263
273
|
const { iss: providedIssuer, exp } = (0, jose_1.decodeJwt)(token);
|
|
@@ -19,7 +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
|
+
export { ObjectReferenceService } from './object-reference.service';
|
|
23
23
|
export { SearchService } from './search.service';
|
|
24
24
|
export { ShareService } from './share.service';
|
|
25
25
|
export { TaskService } from './task.service';
|
|
@@ -43,8 +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
|
|
47
|
-
Object.defineProperty(exports, "ObjectReferenceService", { enumerable: true, get: function () { return
|
|
46
|
+
var object_reference_service_1 = require("./object-reference.service");
|
|
47
|
+
Object.defineProperty(exports, "ObjectReferenceService", { enumerable: true, get: function () { return object_reference_service_1.ObjectReferenceService; } });
|
|
48
48
|
var search_service_1 = require("./search.service");
|
|
49
49
|
Object.defineProperty(exports, "SearchService", { enumerable: true, get: function () { return search_service_1.SearchService; } });
|
|
50
50
|
var share_service_1 = require("./share.service");
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { CreateReferenceDto, ObjectReference, ObjectReferenceType, ReferencesQuery, TokenOption } from '../interfaces';
|
|
1
|
+
import { CreateReferenceDto, ObjectReference, ObjectReferenceType, Paginated, ReferencesQuery, TokenOption } from '../interfaces';
|
|
2
2
|
import { DataService } from './data.service';
|
|
3
3
|
import { HttpClientService } from './http-client.service';
|
|
4
4
|
export declare class ObjectReferenceService extends DataService<ObjectReference> {
|
|
5
5
|
constructor(httpClient: HttpClientService);
|
|
6
|
-
find(query: ReferencesQuery, options?: TokenOption): Promise<ObjectReference
|
|
6
|
+
find(query: ReferencesQuery, options?: TokenOption): Promise<Paginated<ObjectReference>>;
|
|
7
7
|
findAll(objId: string, options?: TokenOption): Promise<ObjectReference[]>;
|
|
8
8
|
create(dto: CreateReferenceDto, options?: TokenOption): Promise<ObjectReference>;
|
|
9
9
|
update(referenceId: number, updateData: Partial<Omit<ObjectReference, 'id' | 'createdAt'>>, options?: TokenOption): Promise<ObjectReference>;
|
|
File without changes
|