@hahnpro/hpc-api 2025.2.4 → 2025.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/package.json +2 -2
- package/src/index.d.ts +0 -4
- package/src/index.js +0 -4
- package/src/lib/alert.interface.d.ts +43 -0
- package/src/lib/alert.interface.js +17 -0
- package/src/lib/alert.service.d.ts +6 -0
- package/src/lib/alert.service.js +10 -0
- package/src/lib/api.d.ts +6 -6
- package/src/lib/api.js +8 -8
- package/src/lib/content.interface.d.ts +4 -0
- package/src/lib/flow-deployment.interface.d.ts +1 -1
- package/src/lib/flow-deployment.service.d.ts +1 -1
- package/src/lib/flow.interface.d.ts +1 -1
- package/src/lib/interfaces/ai.interface.d.ts +78 -0
- package/src/lib/{asset.interface.d.ts → interfaces/asset.interface.d.ts} +13 -1
- package/src/lib/interfaces/event.interface.d.ts +21 -0
- package/src/lib/interfaces/index.d.ts +5 -1
- package/src/lib/{resource.interface.d.ts → interfaces/resource.interface.d.ts} +21 -19
- package/src/lib/interfaces/resource.interface.js +8 -0
- package/src/lib/mock/ai.mock.service.d.ts +13 -1
- package/src/lib/mock/ai.mock.service.js +34 -1
- package/src/lib/mock/api.mock.d.ts +8 -6
- package/src/lib/mock/api.mock.js +5 -7
- package/src/lib/mock/asset.mock.service.d.ts +2 -2
- package/src/lib/mock/assetTypes.mock.service.d.ts +3 -2
- package/src/lib/mock/assetTypes.mock.service.js +5 -2
- package/src/lib/mock/event.mock.service.d.ts +8 -0
- package/src/lib/mock/{events.mock.service.js → event.mock.service.js} +6 -3
- package/src/lib/mock/flow-deployment.mock.service.d.ts +1 -1
- package/src/lib/mock/flow-deployment.mock.service.js +4 -4
- package/src/lib/mock/flow-functions.mock.service.js +2 -2
- package/src/lib/mock/flow.mock.service.js +2 -2
- package/src/lib/mock/index.d.ts +1 -1
- package/src/lib/mock/index.js +1 -1
- package/src/lib/mock/timeseries.mock.service.d.ts +3 -2
- package/src/lib/mock/timeseries.mock.service.js +3 -0
- package/src/lib/mock/utils.d.ts +1 -0
- package/src/lib/mock/utils.js +10 -0
- package/src/lib/notification-rule.interface.d.ts +28 -0
- package/src/lib/notification-rule.service.d.ts +6 -0
- package/src/lib/notification-rule.service.js +10 -0
- package/src/lib/organization.interface.d.ts +2 -1
- package/src/lib/services/ai.service.d.ts +14 -2
- package/src/lib/services/ai.service.js +36 -2
- package/src/lib/{asset.service.d.ts → services/asset.service.d.ts} +6 -6
- package/src/lib/{asset.service.js → services/asset.service.js} +3 -3
- package/src/lib/{assettypes.service.d.ts → services/assettypes.service.d.ts} +7 -6
- package/src/lib/{assettypes.service.js → services/assettypes.service.js} +6 -3
- package/src/lib/services/event.service.d.ts +8 -0
- package/src/lib/services/event.service.js +17 -0
- package/src/lib/services/index.d.ts +4 -0
- package/src/lib/services/index.js +9 -1
- package/src/lib/{timeseries.service.d.ts → services/timeseries.service.d.ts} +7 -6
- package/src/lib/{timeseries.service.js → services/timeseries.service.js} +7 -3
- package/src/lib/user-settings.interface.d.ts +1 -0
- package/src/lib/events.interface.d.ts +0 -18
- package/src/lib/events.service.d.ts +0 -7
- package/src/lib/events.service.js +0 -13
- package/src/lib/mock/events.mock.service.d.ts +0 -7
- /package/src/lib/{asset.interface.js → interfaces/asset.interface.js} +0 -0
- /package/src/lib/{events.interface.js → interfaces/event.interface.js} +0 -0
- /package/src/lib/{timeseries.interface.d.ts → interfaces/timeseries.interface.d.ts} +0 -0
- /package/src/lib/{timeseries.interface.js → interfaces/timeseries.interface.js} +0 -0
- /package/src/lib/{resource.interface.js → notification-rule.interface.js} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hahnpro/hpc-api",
|
|
3
|
-
"version": "2025.2.
|
|
3
|
+
"version": "2025.2.6",
|
|
4
4
|
"description": "Module for easy access to the HahnPRO Cloud API",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"url": "https://hahnpro.com"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"axios": "1.8.
|
|
11
|
+
"axios": "1.8.4",
|
|
12
12
|
"eventsource": "3.0.5",
|
|
13
13
|
"form-data": "4.0.2",
|
|
14
14
|
"jose": "5.10.0",
|
package/src/index.d.ts
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
export * from './lib/api';
|
|
2
2
|
export type * from './lib/interfaces';
|
|
3
|
-
export * from './lib/asset.interface';
|
|
4
3
|
export * from './lib/content.interface';
|
|
5
4
|
export * from './lib/data.interface';
|
|
6
5
|
export * from './lib/data.service';
|
|
7
6
|
export * from './lib/endpoint.interface';
|
|
8
|
-
export * from './lib/events.interface';
|
|
9
7
|
export * from './lib/flow.interface';
|
|
10
8
|
export * from './lib/flow-deployment.interface';
|
|
11
9
|
export * from './lib/flow-function.interface';
|
|
@@ -13,9 +11,7 @@ export * from './lib/http.service';
|
|
|
13
11
|
export * from './lib/label.interface';
|
|
14
12
|
export * from './lib/mock';
|
|
15
13
|
export * from './lib/notification.interface';
|
|
16
|
-
export * from './lib/resource.interface';
|
|
17
14
|
export * from './lib/schema.interface';
|
|
18
15
|
export * from './lib/secret.interface';
|
|
19
16
|
export * from './lib/task.interface';
|
|
20
|
-
export * from './lib/timeseries.interface';
|
|
21
17
|
export * from './lib/vault.interface';
|
package/src/index.js
CHANGED
|
@@ -2,12 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
tslib_1.__exportStar(require("./lib/api"), exports);
|
|
5
|
-
tslib_1.__exportStar(require("./lib/asset.interface"), exports);
|
|
6
5
|
tslib_1.__exportStar(require("./lib/content.interface"), exports);
|
|
7
6
|
tslib_1.__exportStar(require("./lib/data.interface"), exports);
|
|
8
7
|
tslib_1.__exportStar(require("./lib/data.service"), exports);
|
|
9
8
|
tslib_1.__exportStar(require("./lib/endpoint.interface"), exports);
|
|
10
|
-
tslib_1.__exportStar(require("./lib/events.interface"), exports);
|
|
11
9
|
tslib_1.__exportStar(require("./lib/flow.interface"), exports);
|
|
12
10
|
tslib_1.__exportStar(require("./lib/flow-deployment.interface"), exports);
|
|
13
11
|
tslib_1.__exportStar(require("./lib/flow-function.interface"), exports);
|
|
@@ -15,9 +13,7 @@ tslib_1.__exportStar(require("./lib/http.service"), exports);
|
|
|
15
13
|
tslib_1.__exportStar(require("./lib/label.interface"), exports);
|
|
16
14
|
tslib_1.__exportStar(require("./lib/mock"), exports);
|
|
17
15
|
tslib_1.__exportStar(require("./lib/notification.interface"), exports);
|
|
18
|
-
tslib_1.__exportStar(require("./lib/resource.interface"), exports);
|
|
19
16
|
tslib_1.__exportStar(require("./lib/schema.interface"), exports);
|
|
20
17
|
tslib_1.__exportStar(require("./lib/secret.interface"), exports);
|
|
21
18
|
tslib_1.__exportStar(require("./lib/task.interface"), exports);
|
|
22
|
-
tslib_1.__exportStar(require("./lib/timeseries.interface"), exports);
|
|
23
19
|
tslib_1.__exportStar(require("./lib/vault.interface"), exports);
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Author, Owner } from './interfaces';
|
|
2
|
+
export interface Alert {
|
|
3
|
+
id?: string;
|
|
4
|
+
name: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
tsRefs: TimeSeriesReference[];
|
|
7
|
+
status: string;
|
|
8
|
+
condition: AlertCondition;
|
|
9
|
+
messageTmpl?: string;
|
|
10
|
+
tags?: string[];
|
|
11
|
+
readPermissions: string[];
|
|
12
|
+
readWritePermissions: string[];
|
|
13
|
+
createdBy?: Author;
|
|
14
|
+
updatedBy?: Author;
|
|
15
|
+
owner?: Owner;
|
|
16
|
+
}
|
|
17
|
+
export interface AlertCondition {
|
|
18
|
+
type: AlertType;
|
|
19
|
+
level: AlertLevel;
|
|
20
|
+
operator?: string;
|
|
21
|
+
range?: number[];
|
|
22
|
+
value?: number;
|
|
23
|
+
change?: string;
|
|
24
|
+
period?: string;
|
|
25
|
+
stopPeriod?: string;
|
|
26
|
+
}
|
|
27
|
+
export interface TimeSeriesReference {
|
|
28
|
+
alias?: string;
|
|
29
|
+
id: string;
|
|
30
|
+
field: string;
|
|
31
|
+
}
|
|
32
|
+
export declare enum AlertType {
|
|
33
|
+
Threshold = "threshold",
|
|
34
|
+
Relative = "relative",
|
|
35
|
+
Deadman = "deadman"
|
|
36
|
+
}
|
|
37
|
+
export declare enum AlertLevel {
|
|
38
|
+
CRITICAL = "CRITICAL",
|
|
39
|
+
WARNING = "WARNING",
|
|
40
|
+
INFO = "INFO",
|
|
41
|
+
OK = "OK",
|
|
42
|
+
ANY = "ANY"
|
|
43
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AlertLevel = exports.AlertType = void 0;
|
|
4
|
+
var AlertType;
|
|
5
|
+
(function (AlertType) {
|
|
6
|
+
AlertType["Threshold"] = "threshold";
|
|
7
|
+
AlertType["Relative"] = "relative";
|
|
8
|
+
AlertType["Deadman"] = "deadman";
|
|
9
|
+
})(AlertType || (exports.AlertType = AlertType = {}));
|
|
10
|
+
var AlertLevel;
|
|
11
|
+
(function (AlertLevel) {
|
|
12
|
+
AlertLevel["CRITICAL"] = "CRITICAL";
|
|
13
|
+
AlertLevel["WARNING"] = "WARNING";
|
|
14
|
+
AlertLevel["INFO"] = "INFO";
|
|
15
|
+
AlertLevel["OK"] = "OK";
|
|
16
|
+
AlertLevel["ANY"] = "ANY";
|
|
17
|
+
})(AlertLevel || (exports.AlertLevel = AlertLevel = {}));
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AlertService = void 0;
|
|
4
|
+
const data_service_1 = require("./data.service");
|
|
5
|
+
class AlertService extends data_service_1.DataService {
|
|
6
|
+
constructor(httpClient) {
|
|
7
|
+
super(httpClient, '/alerts');
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.AlertService = AlertService;
|
package/src/lib/api.d.ts
CHANGED
|
@@ -1,31 +1,30 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { AssetTypesService } from './assettypes.service';
|
|
1
|
+
import { AlertService } from './alert.service';
|
|
3
2
|
import { ContentService } from './content.service';
|
|
4
3
|
import { EndpointService } from './endpoint.service';
|
|
5
|
-
import { EventsService } from './events.service';
|
|
6
4
|
import { FlowDeploymentService } from './flow-deployment.service';
|
|
7
5
|
import { FlowFunctionService } from './flow-function.service';
|
|
8
6
|
import { FlowModuleService } from './flow-module.service';
|
|
9
7
|
import { FlowService } from './flow.service';
|
|
10
8
|
import { HttpClient } from './http.service';
|
|
11
9
|
import { LabelService } from './label.service';
|
|
10
|
+
import { NotificationRuleService } from './notification-rule.service';
|
|
12
11
|
import { NotificationService } from './notification.service';
|
|
13
12
|
import { OrganizationService } from './organization.service';
|
|
14
13
|
import { ProxyService } from './proxy.service';
|
|
15
14
|
import { SecretService } from './secret.service';
|
|
16
|
-
import { AiService } from './services';
|
|
15
|
+
import { AiService, AssetService, AssetTypesService, EventService, TimeSeriesService } from './services';
|
|
17
16
|
import { TaskService } from './task.service';
|
|
18
|
-
import { TimeSeriesService } from './timeseries.service';
|
|
19
17
|
import { UserService } from './user.service';
|
|
20
18
|
import { VaultService } from './vault.service';
|
|
21
19
|
export declare class API {
|
|
22
20
|
readonly httpClient?: HttpClient;
|
|
23
21
|
ai: AiService;
|
|
22
|
+
alerts: AlertService;
|
|
24
23
|
assets: AssetService;
|
|
25
24
|
assetTypes: AssetTypesService;
|
|
26
25
|
contents: ContentService;
|
|
27
26
|
endpoints: EndpointService;
|
|
28
|
-
events:
|
|
27
|
+
events: EventService;
|
|
29
28
|
flows: FlowService;
|
|
30
29
|
flowDeployments: FlowDeploymentService;
|
|
31
30
|
flowFunctions: FlowFunctionService;
|
|
@@ -39,6 +38,7 @@ export declare class API {
|
|
|
39
38
|
users: UserService;
|
|
40
39
|
vault: VaultService;
|
|
41
40
|
notifications: NotificationService;
|
|
41
|
+
notificationRules: NotificationRuleService;
|
|
42
42
|
constructor(httpClient?: HttpClient, context?: {
|
|
43
43
|
tokenSubject?: string;
|
|
44
44
|
});
|
package/src/lib/api.js
CHANGED
|
@@ -1,24 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.API = void 0;
|
|
4
|
-
const
|
|
5
|
-
const assettypes_service_1 = require("./assettypes.service");
|
|
4
|
+
const alert_service_1 = require("./alert.service");
|
|
6
5
|
const content_service_1 = require("./content.service");
|
|
7
6
|
const endpoint_service_1 = require("./endpoint.service");
|
|
8
|
-
const events_service_1 = require("./events.service");
|
|
9
7
|
const flow_deployment_service_1 = require("./flow-deployment.service");
|
|
10
8
|
const flow_function_service_1 = require("./flow-function.service");
|
|
11
9
|
const flow_module_service_1 = require("./flow-module.service");
|
|
12
10
|
const flow_service_1 = require("./flow.service");
|
|
13
11
|
const http_service_1 = require("./http.service");
|
|
14
12
|
const label_service_1 = require("./label.service");
|
|
13
|
+
const notification_rule_service_1 = require("./notification-rule.service");
|
|
15
14
|
const notification_service_1 = require("./notification.service");
|
|
16
15
|
const organization_service_1 = require("./organization.service");
|
|
17
16
|
const proxy_service_1 = require("./proxy.service");
|
|
18
17
|
const secret_service_1 = require("./secret.service");
|
|
19
18
|
const services_1 = require("./services");
|
|
20
19
|
const task_service_1 = require("./task.service");
|
|
21
|
-
const timeseries_service_1 = require("./timeseries.service");
|
|
22
20
|
const user_service_1 = require("./user.service");
|
|
23
21
|
const vault_service_1 = require("./vault.service");
|
|
24
22
|
class API {
|
|
@@ -45,11 +43,12 @@ class API {
|
|
|
45
43
|
this.httpClient = new http_service_1.HttpClient(apiUrl, authUrl, realm, client, secret, context?.tokenSubject);
|
|
46
44
|
}
|
|
47
45
|
this.ai = new services_1.AiService(this.httpClient);
|
|
48
|
-
this.
|
|
49
|
-
this.
|
|
46
|
+
this.alerts = new alert_service_1.AlertService(this.httpClient);
|
|
47
|
+
this.assets = new services_1.AssetService(this.httpClient);
|
|
48
|
+
this.assetTypes = new services_1.AssetTypesService(this.httpClient);
|
|
50
49
|
this.contents = new content_service_1.ContentService(this.httpClient);
|
|
51
50
|
this.endpoints = new endpoint_service_1.EndpointService(this.httpClient);
|
|
52
|
-
this.events = new
|
|
51
|
+
this.events = new services_1.EventService(this.httpClient);
|
|
53
52
|
this.flows = new flow_service_1.FlowService(this.httpClient);
|
|
54
53
|
this.flowDeployments = new flow_deployment_service_1.FlowDeploymentService(this.httpClient);
|
|
55
54
|
this.flowFunctions = new flow_function_service_1.FlowFunctionService(this.httpClient);
|
|
@@ -59,10 +58,11 @@ class API {
|
|
|
59
58
|
this.proxy = new proxy_service_1.ProxyService(this.httpClient);
|
|
60
59
|
this.secrets = new secret_service_1.SecretService(this.httpClient);
|
|
61
60
|
this.tasks = new task_service_1.TaskService(this.httpClient);
|
|
62
|
-
this.timeSeries = new
|
|
61
|
+
this.timeSeries = new services_1.TimeSeriesService(this.httpClient);
|
|
63
62
|
this.users = new user_service_1.UserService(this.httpClient);
|
|
64
63
|
this.vault = new vault_service_1.VaultService(this.httpClient);
|
|
65
64
|
this.notifications = new notification_service_1.NotificationService(this.httpClient);
|
|
65
|
+
this.notificationRules = new notification_rule_service_1.NotificationRuleService(this.httpClient);
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
exports.API = API;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Author, Owner } from './interfaces';
|
|
1
2
|
import { Storage } from './storage.interface';
|
|
2
3
|
export interface Content {
|
|
3
4
|
id?: string;
|
|
@@ -10,6 +11,9 @@ export interface Content {
|
|
|
10
11
|
tags?: string[];
|
|
11
12
|
assets?: string[];
|
|
12
13
|
files?: Storage[];
|
|
14
|
+
owner?: Owner;
|
|
15
|
+
createdBy?: Author;
|
|
16
|
+
updatedBy?: Author;
|
|
13
17
|
createdAt?: string;
|
|
14
18
|
updatedAt?: string;
|
|
15
19
|
deletedAt?: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FlowDiagram, FlowDto } from './flow.interface';
|
|
2
|
-
import { Resource } from './
|
|
2
|
+
import { Resource } from './interfaces';
|
|
3
3
|
import { Storage } from './storage.interface';
|
|
4
4
|
export interface FlowDeployment extends Resource {
|
|
5
5
|
flow: string | FlowDto;
|
|
@@ -2,7 +2,7 @@ import { APIBase } from './api-base';
|
|
|
2
2
|
import { DataService } from './data.service';
|
|
3
3
|
import { FlowDeployment, FlowDeploymentMetrics, FlowDeploymentStatistic, FlowLog } from './flow-deployment.interface';
|
|
4
4
|
import { HttpClient, TokenOption } from './http.service';
|
|
5
|
-
import { ResourceReference } from './
|
|
5
|
+
import { ResourceReference } from './interfaces';
|
|
6
6
|
import { TrashService } from './trash.service';
|
|
7
7
|
interface BaseService extends DataService<FlowDeployment>, TrashService<FlowDeployment> {
|
|
8
8
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FlowDeployment } from './flow-deployment.interface';
|
|
2
|
-
import { Resource } from './
|
|
2
|
+
import { Resource } from './interfaces';
|
|
3
3
|
import { JsonSchemaForm } from './schema.interface';
|
|
4
4
|
export interface FlowDto extends Resource {
|
|
5
5
|
diagram: string | FlowDiagram;
|
|
@@ -1,4 +1,82 @@
|
|
|
1
|
+
import { Owner } from './resource.interface';
|
|
2
|
+
export interface AiAssistant {
|
|
3
|
+
id: string;
|
|
4
|
+
agent?: string;
|
|
5
|
+
pipeline?: string[];
|
|
6
|
+
i18n: Record<AvailableLanguages, AssistantLabels>;
|
|
7
|
+
icon?: string;
|
|
8
|
+
readPermissions?: string[];
|
|
9
|
+
}
|
|
10
|
+
type AvailableLanguages = 'de' | 'en';
|
|
11
|
+
interface AssistantLabels {
|
|
12
|
+
name: string;
|
|
13
|
+
description?: string;
|
|
14
|
+
welcomeMessage?: string;
|
|
15
|
+
}
|
|
16
|
+
interface BaseMessage {
|
|
17
|
+
id?: string;
|
|
18
|
+
thread: string;
|
|
19
|
+
createdAt?: string;
|
|
20
|
+
updatedAt?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface AssistantMessage extends BaseMessage {
|
|
23
|
+
role: 'assistant';
|
|
24
|
+
content?: string;
|
|
25
|
+
agentStack?: string[];
|
|
26
|
+
status?: 'pending' | 'processing' | 'completed' | 'failed';
|
|
27
|
+
toolCalls?: {
|
|
28
|
+
type: 'tool-call';
|
|
29
|
+
toolCallId: string;
|
|
30
|
+
toolName: string;
|
|
31
|
+
args: any;
|
|
32
|
+
}[];
|
|
33
|
+
toolResults?: {
|
|
34
|
+
type: 'tool-result';
|
|
35
|
+
toolCallId: string;
|
|
36
|
+
toolName: string;
|
|
37
|
+
args: any;
|
|
38
|
+
result: any;
|
|
39
|
+
}[];
|
|
40
|
+
contextVariables?: Record<string, unknown>;
|
|
41
|
+
finishReason?: 'stop' | 'length' | 'content-filter' | 'tool-calls' | 'error' | 'other' | 'unknown';
|
|
42
|
+
}
|
|
43
|
+
export interface SystemMessage extends BaseMessage {
|
|
44
|
+
role: 'system';
|
|
45
|
+
}
|
|
46
|
+
export interface ToolMessage extends BaseMessage {
|
|
47
|
+
role: 'user';
|
|
48
|
+
toolCallId?: string;
|
|
49
|
+
toolName?: string;
|
|
50
|
+
toolType?: 'handoff' | 'choice' | 'action';
|
|
51
|
+
agentStack?: string[];
|
|
52
|
+
status?: 'pending' | 'processing' | 'completed' | 'failed';
|
|
53
|
+
result?: any;
|
|
54
|
+
args?: any;
|
|
55
|
+
contextVariables?: Record<string, unknown>;
|
|
56
|
+
}
|
|
57
|
+
export interface UserMessage extends BaseMessage {
|
|
58
|
+
role: 'user';
|
|
59
|
+
content?: string;
|
|
60
|
+
hidden?: boolean;
|
|
61
|
+
}
|
|
62
|
+
export type Message = AssistantMessage | SystemMessage | ToolMessage | UserMessage;
|
|
1
63
|
export interface SpeechToken {
|
|
2
64
|
token: string;
|
|
3
65
|
region: string;
|
|
4
66
|
}
|
|
67
|
+
export interface Thread {
|
|
68
|
+
id: string;
|
|
69
|
+
assistantId: string;
|
|
70
|
+
owner: Owner;
|
|
71
|
+
messages: string[] | Message[];
|
|
72
|
+
isEphemeral: boolean;
|
|
73
|
+
firstMessage?: string | Message;
|
|
74
|
+
lastMessage?: string | Message;
|
|
75
|
+
createdAt: string;
|
|
76
|
+
updatedAt: string;
|
|
77
|
+
}
|
|
78
|
+
export interface ThreadPopulated extends Thread {
|
|
79
|
+
firstMessage?: Message;
|
|
80
|
+
lastMessage?: Message;
|
|
81
|
+
}
|
|
82
|
+
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { Content } from '
|
|
1
|
+
import { Content } from '../content.interface';
|
|
2
|
+
import { Author, Owner } from './resource.interface';
|
|
2
3
|
export interface AssetType {
|
|
3
4
|
id?: string;
|
|
4
5
|
name: string;
|
|
@@ -14,6 +15,9 @@ export interface AssetType {
|
|
|
14
15
|
actions?: string[];
|
|
15
16
|
author?: string;
|
|
16
17
|
revision?: number;
|
|
18
|
+
owner?: Owner;
|
|
19
|
+
createdBy?: Author;
|
|
20
|
+
updatedBy?: Author;
|
|
17
21
|
createdAt?: string;
|
|
18
22
|
updatedAt?: string;
|
|
19
23
|
deletedAt?: string;
|
|
@@ -40,6 +44,9 @@ export interface Asset {
|
|
|
40
44
|
actions?: string[];
|
|
41
45
|
author?: string;
|
|
42
46
|
revision?: number;
|
|
47
|
+
owner?: Owner;
|
|
48
|
+
createdBy?: Author;
|
|
49
|
+
updatedBy?: Author;
|
|
43
50
|
createdAt?: string;
|
|
44
51
|
updatedAt?: string;
|
|
45
52
|
deletedAt?: string;
|
|
@@ -76,3 +83,8 @@ export interface EventLevelOverride {
|
|
|
76
83
|
[eventCause: string]: string;
|
|
77
84
|
};
|
|
78
85
|
}
|
|
86
|
+
export interface Template {
|
|
87
|
+
id: string;
|
|
88
|
+
name: string;
|
|
89
|
+
template: Record<string, any>;
|
|
90
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Author, Owner, Resource } from './resource.interface';
|
|
2
|
+
export interface Event extends Resource {
|
|
3
|
+
data?: {
|
|
4
|
+
tsField: string;
|
|
5
|
+
timestamp: string;
|
|
6
|
+
value: number;
|
|
7
|
+
};
|
|
8
|
+
assetRef?: string;
|
|
9
|
+
assetRef$name?: string;
|
|
10
|
+
alertRef?: string;
|
|
11
|
+
tsRef?: string;
|
|
12
|
+
eventRef?: string;
|
|
13
|
+
cause: string;
|
|
14
|
+
level: EventLevel;
|
|
15
|
+
group?: string;
|
|
16
|
+
owner?: Owner;
|
|
17
|
+
createdBy?: Author;
|
|
18
|
+
updatedBy?: Author;
|
|
19
|
+
}
|
|
20
|
+
export type EventLevel = 'INFO' | 'OK' | 'WARNING' | 'CRITICAL';
|
|
21
|
+
export type CreateEventDto = Omit<Event, 'id' | 'assetRef$name' | 'createdAt' | 'updatedAt'>;
|
|
@@ -1 +1,5 @@
|
|
|
1
|
-
export type {
|
|
1
|
+
export type { Resource, ResourceReference, Owner, OwnerType, Author } from './resource.interface';
|
|
2
|
+
export type { AiAssistant, AssistantMessage, Message, SpeechToken, SystemMessage, Thread, ThreadPopulated, ToolMessage, UserMessage, } from './ai.interface';
|
|
3
|
+
export type { Action, ActionRevision, Asset, AssetRevision, AssetType, AssetTypeRevision, Attachment, EventCause, EventLevelOverride, Template, } from './asset.interface';
|
|
4
|
+
export type { Event, EventLevel, CreateEventDto } from './event.interface';
|
|
5
|
+
export type { TimeSeries, TimeSeriesBucket, TimeSeriesCondition, TimeSeriesValue, TS_GROUPS } from './timeseries.interface';
|
|
@@ -1,32 +1,34 @@
|
|
|
1
|
-
export interface ResourceReference {
|
|
2
|
-
id: string;
|
|
3
|
-
resourceType: string;
|
|
4
|
-
dependent?: boolean;
|
|
5
|
-
}
|
|
6
1
|
export interface Resource {
|
|
7
|
-
id
|
|
8
|
-
owner?: Owner;
|
|
2
|
+
id?: string;
|
|
9
3
|
name: string;
|
|
10
|
-
readPermissions: string[];
|
|
11
|
-
readWritePermissions: string[];
|
|
12
4
|
description?: string;
|
|
13
|
-
author?: string;
|
|
14
5
|
tags?: string[];
|
|
15
6
|
refs?: ResourceReference[];
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
7
|
+
readPermissions: string[];
|
|
8
|
+
readWritePermissions: string[];
|
|
9
|
+
owner?: Owner;
|
|
10
|
+
createdAt?: string;
|
|
20
11
|
createdBy?: Author;
|
|
12
|
+
updatedAt?: string;
|
|
21
13
|
updatedBy?: Author;
|
|
14
|
+
deletedAt?: string;
|
|
22
15
|
}
|
|
23
|
-
export interface
|
|
16
|
+
export interface ResourceReference {
|
|
24
17
|
id: string;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
impersonatorUsername?: string;
|
|
18
|
+
resourceType: string;
|
|
19
|
+
dependent?: boolean;
|
|
28
20
|
}
|
|
29
21
|
export interface Owner {
|
|
30
22
|
id: string;
|
|
31
|
-
type:
|
|
23
|
+
type: OwnerType;
|
|
24
|
+
}
|
|
25
|
+
export declare enum OwnerType {
|
|
26
|
+
ORG = "org",
|
|
27
|
+
USER = "user"
|
|
28
|
+
}
|
|
29
|
+
export interface Author {
|
|
30
|
+
id: string;
|
|
31
|
+
username?: string;
|
|
32
|
+
impersonatorId?: string;
|
|
33
|
+
impersonatorUsername?: string;
|
|
32
34
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OwnerType = void 0;
|
|
4
|
+
var OwnerType;
|
|
5
|
+
(function (OwnerType) {
|
|
6
|
+
OwnerType["ORG"] = "org";
|
|
7
|
+
OwnerType["USER"] = "user";
|
|
8
|
+
})(OwnerType || (exports.OwnerType = OwnerType = {}));
|
|
@@ -1,9 +1,21 @@
|
|
|
1
1
|
import { APIBase } from '../api-base';
|
|
2
|
+
import { Paginated } from '../data.interface';
|
|
2
3
|
import { HttpClient } from '../http.service';
|
|
3
|
-
import { SpeechToken } from '../interfaces';
|
|
4
|
+
import { AiAssistant, Message, SpeechToken, Thread, ThreadPopulated } from '../interfaces';
|
|
4
5
|
import { AiService } from '../services';
|
|
5
6
|
export declare class AiMockService extends APIBase implements AiService {
|
|
6
7
|
httpClient: HttpClient;
|
|
7
8
|
basePath: string;
|
|
9
|
+
message(message: string, threadId?: string, assistantId?: string): Promise<Message>;
|
|
10
|
+
createThread(assistantId: string): Promise<ThreadPopulated>;
|
|
11
|
+
getLatestAssistantThread(assistantId: string): Promise<ThreadPopulated>;
|
|
12
|
+
getAssistant(assistantId: string): Promise<AiAssistant>;
|
|
13
|
+
getAssistants(): Promise<AiAssistant[]>;
|
|
8
14
|
getSpeechToken(): Promise<SpeechToken>;
|
|
15
|
+
getThreadMessages(threadId: string): Promise<Paginated<Message[]>>;
|
|
16
|
+
getThread(threadId: string): Promise<ThreadPopulated>;
|
|
17
|
+
getLatestThread(): Promise<ThreadPopulated>;
|
|
18
|
+
listThreads(): Promise<ThreadPopulated[]>;
|
|
19
|
+
listAssistantThreads(assistantId: string): Promise<ThreadPopulated[]>;
|
|
20
|
+
deleteThread(threadId: string): Promise<Thread>;
|
|
9
21
|
}
|
|
@@ -3,7 +3,40 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.AiMockService = void 0;
|
|
4
4
|
const api_base_1 = require("../api-base");
|
|
5
5
|
class AiMockService extends api_base_1.APIBase {
|
|
6
|
-
|
|
6
|
+
message(message, threadId, assistantId) {
|
|
7
|
+
throw new Error('Method not implemented.');
|
|
8
|
+
}
|
|
9
|
+
createThread(assistantId) {
|
|
10
|
+
throw new Error('Method not implemented.');
|
|
11
|
+
}
|
|
12
|
+
getLatestAssistantThread(assistantId) {
|
|
13
|
+
throw new Error('Method not implemented.');
|
|
14
|
+
}
|
|
15
|
+
getAssistant(assistantId) {
|
|
16
|
+
throw new Error('Method not implemented.');
|
|
17
|
+
}
|
|
18
|
+
getAssistants() {
|
|
19
|
+
throw new Error('Method not implemented.');
|
|
20
|
+
}
|
|
21
|
+
getSpeechToken() {
|
|
22
|
+
throw new Error('Method not implemented.');
|
|
23
|
+
}
|
|
24
|
+
getThreadMessages(threadId) {
|
|
25
|
+
throw new Error('Method not implemented.');
|
|
26
|
+
}
|
|
27
|
+
getThread(threadId) {
|
|
28
|
+
throw new Error('Method not implemented.');
|
|
29
|
+
}
|
|
30
|
+
getLatestThread() {
|
|
31
|
+
throw new Error('Method not implemented.');
|
|
32
|
+
}
|
|
33
|
+
listThreads() {
|
|
34
|
+
throw new Error('Method not implemented.');
|
|
35
|
+
}
|
|
36
|
+
listAssistantThreads(assistantId) {
|
|
37
|
+
throw new Error('Method not implemented.');
|
|
38
|
+
}
|
|
39
|
+
deleteThread(threadId) {
|
|
7
40
|
throw new Error('Method not implemented.');
|
|
8
41
|
}
|
|
9
42
|
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
+
import { AlertService } from '../alert.service';
|
|
1
2
|
import { API } from '../api';
|
|
2
|
-
import { Asset, AssetRevision, AssetType } from '../asset.interface';
|
|
3
3
|
import { Content } from '../content.interface';
|
|
4
4
|
import { Endpoint } from '../endpoint.interface';
|
|
5
|
-
import { Event } from '../events.interface';
|
|
6
5
|
import { FlowDeployment } from '../flow-deployment.interface';
|
|
7
6
|
import { FlowDeploymentService } from '../flow-deployment.service';
|
|
8
7
|
import { FlowFunctionDto, FlowFunctionRevision } from '../flow-function.interface';
|
|
@@ -11,20 +10,21 @@ import { FlowModule } from '../flow-module.interface';
|
|
|
11
10
|
import { FlowModuleService } from '../flow-module.service';
|
|
12
11
|
import { FlowDiagram, FlowDto, FlowRevision } from '../flow.interface';
|
|
13
12
|
import { FlowService } from '../flow.service';
|
|
13
|
+
import { Asset, AssetRevision, AssetType, Event, TimeSeries, TimeSeriesValue } from '../interfaces';
|
|
14
14
|
import { Label } from '../label.interface';
|
|
15
|
+
import { NotificationRuleService } from '../notification-rule.service';
|
|
15
16
|
import { Notification } from '../notification.interface';
|
|
16
17
|
import { Organization } from '../organization.interface';
|
|
17
18
|
import { Secret } from '../secret.interface';
|
|
18
19
|
import { AiService } from '../services';
|
|
19
20
|
import { Artifact } from '../storage.interface';
|
|
20
21
|
import { Task } from '../task.interface';
|
|
21
|
-
import { TimeSeries, TimeSeriesValue } from '../timeseries.interface';
|
|
22
22
|
import { VaultSecret } from '../vault.interface';
|
|
23
23
|
import { AssetMockService } from './asset.mock.service';
|
|
24
24
|
import { AssetTypesMockService } from './assetTypes.mock.service';
|
|
25
25
|
import { ContentMockService } from './content.mock.service';
|
|
26
26
|
import { EndpointMockService } from './endpoint.mock.service';
|
|
27
|
-
import {
|
|
27
|
+
import { EventMockService } from './event.mock.service';
|
|
28
28
|
import { HttpMockService } from './http.mock.service';
|
|
29
29
|
import { LabelMockService } from './label.mock.service';
|
|
30
30
|
import { NotificationMockService } from './notification.mock.service';
|
|
@@ -57,18 +57,20 @@ export interface MockAPIInitData {
|
|
|
57
57
|
organizations?: OrganizationInit[];
|
|
58
58
|
}
|
|
59
59
|
export declare class MockAPI implements API {
|
|
60
|
-
ai: AiService;
|
|
61
60
|
httpClient: HttpMockService;
|
|
61
|
+
ai: AiService;
|
|
62
|
+
alerts: AlertService;
|
|
62
63
|
assets: AssetMockService;
|
|
63
64
|
assetTypes: AssetTypesMockService;
|
|
64
65
|
contents: ContentMockService;
|
|
65
66
|
endpoints: EndpointMockService;
|
|
66
|
-
events:
|
|
67
|
+
events: EventMockService;
|
|
67
68
|
flows: FlowService;
|
|
68
69
|
flowDeployments: FlowDeploymentService;
|
|
69
70
|
flowFunctions: FlowFunctionService;
|
|
70
71
|
flowModules: FlowModuleService;
|
|
71
72
|
labels: LabelMockService;
|
|
73
|
+
notificationRules: NotificationRuleService;
|
|
72
74
|
proxy: any;
|
|
73
75
|
secrets: SecretMockService;
|
|
74
76
|
tasks: TaskMockService;
|