@hahnpro/hpc-api 2026.4.2 → 2026.4.4
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/lib/interfaces/alert.interface.d.ts +31 -1
- package/src/lib/interfaces/alert.interface.js +23 -1
- package/src/lib/interfaces/api.interface.d.ts +17 -0
- package/src/lib/interfaces/api.interface.js +7 -0
- package/src/lib/interfaces/asset.interface.d.ts +18 -3
- package/src/lib/interfaces/audit.interface.d.ts +19 -0
- package/src/lib/interfaces/audit.interface.js +2 -0
- package/src/lib/interfaces/billing.interface.d.ts +72 -0
- package/src/lib/interfaces/billing.interface.js +15 -0
- package/src/lib/interfaces/content.interface.d.ts +32 -1
- package/src/lib/interfaces/content.interface.js +9 -1
- package/src/lib/interfaces/edge-device.interface.d.ts +28 -0
- package/src/lib/interfaces/edge-device.interface.js +2 -0
- package/src/lib/interfaces/endpoint.interface.d.ts +47 -8
- package/src/lib/interfaces/endpoint.interface.js +19 -0
- package/src/lib/interfaces/event.interface.d.ts +16 -7
- package/src/lib/interfaces/event.interface.js +27 -8
- package/src/lib/interfaces/flow-deployment-status.interface.d.ts +32 -0
- package/src/lib/interfaces/flow-deployment-status.interface.js +58 -0
- package/src/lib/interfaces/flow-deployment.interface.d.ts +15 -11
- package/src/lib/interfaces/flow-deployment.interface.js +5 -0
- package/src/lib/interfaces/flow-executor.interface.d.ts +33 -0
- package/src/lib/interfaces/flow-executor.interface.js +2 -0
- package/src/lib/interfaces/flow-function.interface.d.ts +19 -22
- package/src/lib/interfaces/flow-module.interface.d.ts +7 -5
- package/src/lib/interfaces/flow.interface.d.ts +34 -5
- package/src/lib/interfaces/flow.interface.js +8 -0
- package/src/lib/interfaces/index.d.ts +42 -20
- package/src/lib/interfaces/index.js +68 -7
- package/src/lib/interfaces/label.interface.d.ts +4 -4
- package/src/lib/interfaces/marketplace.interface.d.ts +82 -0
- package/src/lib/interfaces/marketplace.interface.js +12 -0
- package/src/lib/interfaces/nats.interface.d.ts +57 -0
- package/src/lib/interfaces/nats.interface.js +60 -0
- package/src/lib/interfaces/notification-rule.interface.d.ts +5 -1
- package/src/lib/interfaces/notification-rule.interface.js +6 -0
- package/src/lib/interfaces/organization.interface.d.ts +1 -1
- package/src/lib/interfaces/resource.interface.d.ts +47 -4
- package/src/lib/interfaces/resource.interface.js +26 -1
- package/src/lib/interfaces/role.interface.d.ts +13 -0
- package/src/lib/interfaces/role.interface.js +2 -0
- package/src/lib/interfaces/schema.interface.d.ts +4 -0
- package/src/lib/interfaces/search.interface.d.ts +4 -0
- package/src/lib/interfaces/timeseries.interface.d.ts +33 -10
- package/src/lib/interfaces/timeseries.interface.js +2 -0
- package/src/lib/interfaces/translation.interface.d.ts +14 -0
- package/src/lib/interfaces/translation.interface.js +6 -0
- package/src/lib/interfaces/type-guards.d.ts +17 -0
- package/src/lib/interfaces/type-guards.js +203 -0
- package/src/lib/interfaces/user-settings.interface.d.ts +15 -10
- package/src/lib/interfaces/vault.interface.d.ts +11 -0
- package/src/lib/interfaces/vault.interface.js +6 -0
- package/src/lib/interfaces/websockets.interface.d.ts +11 -0
- package/src/lib/interfaces/websockets.interface.js +15 -0
- package/src/lib/mock/flow.mock.service.js +2 -2
- package/src/lib/mock/organizations-administration.mock.service.d.ts +1 -1
- package/src/lib/mock/organizations-administration.mock.service.js +1 -1
- package/src/lib/mock/organizations.mock.service.d.ts +2 -1
- package/src/lib/mock/organizations.mock.service.js +3 -0
- package/src/lib/services/flow.service.js +2 -2
- package/src/lib/services/object-reference.service.js +4 -4
- package/src/lib/services/organizations-administration.service.d.ts +2 -3
- package/src/lib/services/organizations-administration.service.js +9 -4
- package/src/lib/services/organizations.service.d.ts +2 -1
- package/src/lib/services/organizations.service.js +10 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hahnpro/hpc-api",
|
|
3
|
-
"version": "2026.4.
|
|
3
|
+
"version": "2026.4.4",
|
|
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.
|
|
12
|
+
"axios": "1.15.0",
|
|
13
13
|
"eventsource": "4.1.0",
|
|
14
14
|
"jose": "5.10.0",
|
|
15
15
|
"jwt-decode": "4.0.0",
|
|
@@ -4,7 +4,7 @@ export interface Alert {
|
|
|
4
4
|
name: string;
|
|
5
5
|
description?: string;
|
|
6
6
|
tsRefs: TimeSeriesReference[];
|
|
7
|
-
status:
|
|
7
|
+
status: AlertStatus;
|
|
8
8
|
condition: AlertCondition;
|
|
9
9
|
messageTmpl?: string;
|
|
10
10
|
tags?: string[];
|
|
@@ -24,11 +24,24 @@ export interface AlertCondition {
|
|
|
24
24
|
period?: string;
|
|
25
25
|
stopPeriod?: string;
|
|
26
26
|
}
|
|
27
|
+
export interface AlertMessageTemplate {
|
|
28
|
+
label: string;
|
|
29
|
+
text: string;
|
|
30
|
+
}
|
|
27
31
|
export interface TimeSeriesReference {
|
|
28
32
|
alias?: string;
|
|
29
33
|
id: string;
|
|
30
34
|
field: string;
|
|
31
35
|
}
|
|
36
|
+
export interface UpdatedField {
|
|
37
|
+
alias?: string;
|
|
38
|
+
field: string;
|
|
39
|
+
value: string | number;
|
|
40
|
+
}
|
|
41
|
+
export declare enum AlertStatus {
|
|
42
|
+
ACTIVE = "ACTIVE",
|
|
43
|
+
INACTIVE = "INACTIVE"
|
|
44
|
+
}
|
|
32
45
|
export declare enum AlertType {
|
|
33
46
|
Threshold = "threshold",
|
|
34
47
|
Relative = "relative",
|
|
@@ -41,3 +54,20 @@ export declare enum AlertLevel {
|
|
|
41
54
|
OK = "OK",
|
|
42
55
|
ANY = "ANY"
|
|
43
56
|
}
|
|
57
|
+
export declare const DEFAULT_THRESHOLD_CONDITION: {
|
|
58
|
+
level: AlertLevel;
|
|
59
|
+
range: number[];
|
|
60
|
+
operator: string;
|
|
61
|
+
};
|
|
62
|
+
export declare const DEFAULT_RELATIVE_CONDITION: {
|
|
63
|
+
level: AlertLevel;
|
|
64
|
+
operator: string;
|
|
65
|
+
change: string;
|
|
66
|
+
value: number;
|
|
67
|
+
period: string;
|
|
68
|
+
};
|
|
69
|
+
export declare const DEFAULT_DEADMAN_CONDITION: {
|
|
70
|
+
level: AlertLevel;
|
|
71
|
+
period: string;
|
|
72
|
+
stopPeriod: string;
|
|
73
|
+
};
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AlertLevel = exports.AlertType = void 0;
|
|
3
|
+
exports.DEFAULT_DEADMAN_CONDITION = exports.DEFAULT_RELATIVE_CONDITION = exports.DEFAULT_THRESHOLD_CONDITION = exports.AlertLevel = exports.AlertType = exports.AlertStatus = void 0;
|
|
4
|
+
var AlertStatus;
|
|
5
|
+
(function (AlertStatus) {
|
|
6
|
+
AlertStatus["ACTIVE"] = "ACTIVE";
|
|
7
|
+
AlertStatus["INACTIVE"] = "INACTIVE";
|
|
8
|
+
})(AlertStatus || (exports.AlertStatus = AlertStatus = {}));
|
|
4
9
|
var AlertType;
|
|
5
10
|
(function (AlertType) {
|
|
6
11
|
AlertType["Threshold"] = "threshold";
|
|
@@ -15,3 +20,20 @@ var AlertLevel;
|
|
|
15
20
|
AlertLevel["OK"] = "OK";
|
|
16
21
|
AlertLevel["ANY"] = "ANY";
|
|
17
22
|
})(AlertLevel || (exports.AlertLevel = AlertLevel = {}));
|
|
23
|
+
exports.DEFAULT_THRESHOLD_CONDITION = {
|
|
24
|
+
level: AlertLevel.CRITICAL,
|
|
25
|
+
range: [10],
|
|
26
|
+
operator: 'greater',
|
|
27
|
+
};
|
|
28
|
+
exports.DEFAULT_RELATIVE_CONDITION = {
|
|
29
|
+
level: AlertLevel.CRITICAL,
|
|
30
|
+
operator: 'greater',
|
|
31
|
+
change: 'absolute',
|
|
32
|
+
value: 10,
|
|
33
|
+
period: '1m',
|
|
34
|
+
};
|
|
35
|
+
exports.DEFAULT_DEADMAN_CONDITION = {
|
|
36
|
+
level: AlertLevel.CRITICAL,
|
|
37
|
+
period: '60s',
|
|
38
|
+
stopPeriod: '10m',
|
|
39
|
+
};
|
|
@@ -9,3 +9,20 @@ export interface Api {
|
|
|
9
9
|
updatedBy?: Author;
|
|
10
10
|
owner?: Owner;
|
|
11
11
|
}
|
|
12
|
+
export interface ObjectIdLike {
|
|
13
|
+
toString(): string;
|
|
14
|
+
}
|
|
15
|
+
export interface Change {
|
|
16
|
+
action: ChangeAction;
|
|
17
|
+
affectedObject: string;
|
|
18
|
+
subject: any;
|
|
19
|
+
value: any;
|
|
20
|
+
accepted: boolean;
|
|
21
|
+
priority: number;
|
|
22
|
+
}
|
|
23
|
+
export declare enum ChangeAction {
|
|
24
|
+
ADDED = 0,
|
|
25
|
+
REMOVED = 1,
|
|
26
|
+
CHANGED = 2
|
|
27
|
+
}
|
|
28
|
+
export type ChangeSubject = 'tags' | 'readPermissions' | 'readWritePermissions';
|
|
@@ -1,2 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ChangeAction = void 0;
|
|
4
|
+
var ChangeAction;
|
|
5
|
+
(function (ChangeAction) {
|
|
6
|
+
ChangeAction[ChangeAction["ADDED"] = 0] = "ADDED";
|
|
7
|
+
ChangeAction[ChangeAction["REMOVED"] = 1] = "REMOVED";
|
|
8
|
+
ChangeAction[ChangeAction["CHANGED"] = 2] = "CHANGED";
|
|
9
|
+
})(ChangeAction || (exports.ChangeAction = ChangeAction = {}));
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { Change, ChangeSubject } from './api.interface';
|
|
2
|
+
import type { Author } from './author.interface';
|
|
3
|
+
import type { Content } from './content.interface';
|
|
4
|
+
import type { EventLevel } from './event.interface';
|
|
5
|
+
import type { Owner } from './owner.interface';
|
|
6
|
+
import type { SearchResultItem } from './search.interface';
|
|
2
7
|
export interface AssetType {
|
|
3
8
|
id?: string;
|
|
4
9
|
name: string;
|
|
@@ -63,11 +68,11 @@ export type AssetRevision = Asset & {
|
|
|
63
68
|
export type Attachment = Content;
|
|
64
69
|
export interface EventCause {
|
|
65
70
|
cause: string;
|
|
66
|
-
level:
|
|
71
|
+
level: EventLevel;
|
|
67
72
|
}
|
|
68
73
|
export interface EventLevelOverride {
|
|
69
74
|
[assetId: string]: {
|
|
70
|
-
[eventCause: string]:
|
|
75
|
+
[eventCause: string]: EventLevel;
|
|
71
76
|
};
|
|
72
77
|
}
|
|
73
78
|
export interface Template {
|
|
@@ -87,3 +92,13 @@ export interface AssetTimeSeriesValue {
|
|
|
87
92
|
assetId: string;
|
|
88
93
|
timeSeriesValue: number;
|
|
89
94
|
}
|
|
95
|
+
export type AssetSubject = ChangeSubject | 'parent' | 'type';
|
|
96
|
+
export interface AssetChange extends Change {
|
|
97
|
+
subject: AssetSubject;
|
|
98
|
+
value: string;
|
|
99
|
+
}
|
|
100
|
+
export interface AssetTypeSearchResult extends SearchResultItem {
|
|
101
|
+
isSystemAssetType: boolean;
|
|
102
|
+
isGlobalAssetType: boolean;
|
|
103
|
+
owner?: Owner;
|
|
104
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Api } from './api.interface';
|
|
2
|
+
export interface Audit extends Api {
|
|
3
|
+
id: string;
|
|
4
|
+
date: string;
|
|
5
|
+
serviceId: string;
|
|
6
|
+
service: string;
|
|
7
|
+
userId: string;
|
|
8
|
+
user: string;
|
|
9
|
+
correlationId: string;
|
|
10
|
+
ip: string;
|
|
11
|
+
host: string;
|
|
12
|
+
url: string;
|
|
13
|
+
method: string;
|
|
14
|
+
controller: string;
|
|
15
|
+
action: string;
|
|
16
|
+
resourceId?: string;
|
|
17
|
+
resourceName?: string;
|
|
18
|
+
statusCode?: number;
|
|
19
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { OwnerType, type Owner } from './owner.interface';
|
|
2
|
+
import { EventType } from './resource.interface';
|
|
3
|
+
export interface Billing {
|
|
4
|
+
id: string;
|
|
5
|
+
type: OwnerType;
|
|
6
|
+
readPermissions: string[];
|
|
7
|
+
readWritePermissions: string[];
|
|
8
|
+
billedRegularly: RegularlyBilledResources;
|
|
9
|
+
billedOnce?: Record<string, OnceBilledResources>;
|
|
10
|
+
subscription?: BillingSubscription;
|
|
11
|
+
lastBilled?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface RegularlyBilledResources {
|
|
14
|
+
assets: Record<string, BillingResource>;
|
|
15
|
+
storage: Record<string, BillingResource>;
|
|
16
|
+
timeseries: Record<string, BillingResource>;
|
|
17
|
+
user: Record<string, BillingResource>;
|
|
18
|
+
}
|
|
19
|
+
export interface OnceBilledResources {
|
|
20
|
+
completion_tokens: number;
|
|
21
|
+
events: number;
|
|
22
|
+
flow_credits: number;
|
|
23
|
+
prompt_tokens: number;
|
|
24
|
+
tasks: number;
|
|
25
|
+
ts_values: number;
|
|
26
|
+
}
|
|
27
|
+
export interface BillingResource {
|
|
28
|
+
statuses: {
|
|
29
|
+
timestamp: string;
|
|
30
|
+
status: EventType;
|
|
31
|
+
}[];
|
|
32
|
+
size?: number;
|
|
33
|
+
}
|
|
34
|
+
export interface BillingSubscription {
|
|
35
|
+
azureId: string;
|
|
36
|
+
planId: string;
|
|
37
|
+
startDate: string;
|
|
38
|
+
isActive: boolean;
|
|
39
|
+
}
|
|
40
|
+
export interface BillingEvent {
|
|
41
|
+
owner: Owner;
|
|
42
|
+
sizes?: number[];
|
|
43
|
+
}
|
|
44
|
+
export type BillingValues = {
|
|
45
|
+
assets: number;
|
|
46
|
+
storage: number;
|
|
47
|
+
timeseries: number;
|
|
48
|
+
user: number;
|
|
49
|
+
} & OnceBilledResources;
|
|
50
|
+
export interface AzureBillingEvent {
|
|
51
|
+
resourceId: string;
|
|
52
|
+
quantity: number;
|
|
53
|
+
dimension: string;
|
|
54
|
+
effectiveStartTime: string;
|
|
55
|
+
planId: string;
|
|
56
|
+
status?: string;
|
|
57
|
+
}
|
|
58
|
+
export interface AzureBillingResult {
|
|
59
|
+
count: number;
|
|
60
|
+
result: AzureBillingEvent[];
|
|
61
|
+
}
|
|
62
|
+
export declare enum BillingResourceType {
|
|
63
|
+
AI_TOKENS = "ai_tokens",
|
|
64
|
+
ASSETS = "assets",
|
|
65
|
+
EVENTS = "events",
|
|
66
|
+
FLOW_CREDITS = "flow_credits",
|
|
67
|
+
STORAGE = "storage",
|
|
68
|
+
TASKS = "tasks",
|
|
69
|
+
TIMESERIES = "timeseries",
|
|
70
|
+
TS_VALUES = "ts_values",
|
|
71
|
+
USER = "user"
|
|
72
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BillingResourceType = void 0;
|
|
4
|
+
var BillingResourceType;
|
|
5
|
+
(function (BillingResourceType) {
|
|
6
|
+
BillingResourceType["AI_TOKENS"] = "ai_tokens";
|
|
7
|
+
BillingResourceType["ASSETS"] = "assets";
|
|
8
|
+
BillingResourceType["EVENTS"] = "events";
|
|
9
|
+
BillingResourceType["FLOW_CREDITS"] = "flow_credits";
|
|
10
|
+
BillingResourceType["STORAGE"] = "storage";
|
|
11
|
+
BillingResourceType["TASKS"] = "tasks";
|
|
12
|
+
BillingResourceType["TIMESERIES"] = "timeseries";
|
|
13
|
+
BillingResourceType["TS_VALUES"] = "ts_values";
|
|
14
|
+
BillingResourceType["USER"] = "user";
|
|
15
|
+
})(BillingResourceType || (exports.BillingResourceType = BillingResourceType = {}));
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { Change, ChangeSubject } from './api.interface';
|
|
2
|
+
import type { Author } from './author.interface';
|
|
3
|
+
import type { Owner } from './owner.interface';
|
|
4
|
+
import type { SearchResultItem } from './search.interface';
|
|
5
|
+
import type { Storage } from './storage.interface';
|
|
2
6
|
export interface Content {
|
|
3
7
|
id?: string;
|
|
4
8
|
fileId: string;
|
|
@@ -19,6 +23,10 @@ export interface Content {
|
|
|
19
23
|
deletedAt?: string;
|
|
20
24
|
analysis?: string | ContentAnalysis;
|
|
21
25
|
}
|
|
26
|
+
export interface ContentSearchResult extends SearchResultItem {
|
|
27
|
+
filename?: string;
|
|
28
|
+
description?: string;
|
|
29
|
+
}
|
|
22
30
|
export declare class ContentAnalysis {
|
|
23
31
|
id: string;
|
|
24
32
|
contentId: string;
|
|
@@ -30,6 +38,29 @@ export declare class ContentAnalysis {
|
|
|
30
38
|
text?: string;
|
|
31
39
|
}[];
|
|
32
40
|
}
|
|
41
|
+
export interface ContentChange extends Change {
|
|
42
|
+
subject: ChangeSubject;
|
|
43
|
+
value: string;
|
|
44
|
+
}
|
|
45
|
+
export declare enum IndexingStatus {
|
|
46
|
+
COMPLETED = "completed",
|
|
47
|
+
FAILED = "failed",
|
|
48
|
+
NOT_TRIGGERED = "notTriggered",
|
|
49
|
+
QUEUED = "queued",
|
|
50
|
+
PARTIALLY_FAILED = "partiallyFailed"
|
|
51
|
+
}
|
|
52
|
+
export interface IndexingStatusData {
|
|
53
|
+
id: string;
|
|
54
|
+
status: IndexingStatus;
|
|
55
|
+
}
|
|
56
|
+
export type ReindexStatusSsePayload = {
|
|
57
|
+
type: 'status';
|
|
58
|
+
content: IndexingStatusData[];
|
|
59
|
+
} | {
|
|
60
|
+
type: 'error';
|
|
61
|
+
message: string;
|
|
62
|
+
status?: number;
|
|
63
|
+
};
|
|
33
64
|
export declare enum ReturnType {
|
|
34
65
|
TEXT = 0,
|
|
35
66
|
JSON = 1,
|
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ReturnType = exports.ContentAnalysis = void 0;
|
|
3
|
+
exports.ReturnType = exports.IndexingStatus = exports.ContentAnalysis = void 0;
|
|
4
4
|
class ContentAnalysis {
|
|
5
5
|
}
|
|
6
6
|
exports.ContentAnalysis = ContentAnalysis;
|
|
7
|
+
var IndexingStatus;
|
|
8
|
+
(function (IndexingStatus) {
|
|
9
|
+
IndexingStatus["COMPLETED"] = "completed";
|
|
10
|
+
IndexingStatus["FAILED"] = "failed";
|
|
11
|
+
IndexingStatus["NOT_TRIGGERED"] = "notTriggered";
|
|
12
|
+
IndexingStatus["QUEUED"] = "queued";
|
|
13
|
+
IndexingStatus["PARTIALLY_FAILED"] = "partiallyFailed";
|
|
14
|
+
})(IndexingStatus || (exports.IndexingStatus = IndexingStatus = {}));
|
|
7
15
|
var ReturnType;
|
|
8
16
|
(function (ReturnType) {
|
|
9
17
|
ReturnType[ReturnType["TEXT"] = 0] = "TEXT";
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export interface EdgeDeviceResult {
|
|
2
|
+
xml?: {
|
|
3
|
+
wkadaten: {
|
|
4
|
+
element: {
|
|
5
|
+
value: string | number;
|
|
6
|
+
}[];
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
json?: Record<string, {
|
|
10
|
+
Wert: number;
|
|
11
|
+
}>;
|
|
12
|
+
webIO?: WebIOData;
|
|
13
|
+
}
|
|
14
|
+
export interface EdgeDeviceRequestResponse {
|
|
15
|
+
name: string;
|
|
16
|
+
}
|
|
17
|
+
export interface WebIOData {
|
|
18
|
+
iostate: {
|
|
19
|
+
input: {
|
|
20
|
+
number: number;
|
|
21
|
+
state: number;
|
|
22
|
+
}[];
|
|
23
|
+
output: {
|
|
24
|
+
number: number;
|
|
25
|
+
state: number;
|
|
26
|
+
}[];
|
|
27
|
+
};
|
|
28
|
+
}
|
|
@@ -4,13 +4,9 @@ export interface Endpoint {
|
|
|
4
4
|
id?: string;
|
|
5
5
|
name: string;
|
|
6
6
|
description?: string;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
url?: string;
|
|
11
|
-
authToken: string;
|
|
12
|
-
recipients?: string[];
|
|
13
|
-
};
|
|
7
|
+
tags?: string[];
|
|
8
|
+
status: NotificationEndpointStatus;
|
|
9
|
+
config: EndpointConfig;
|
|
14
10
|
spamProtection?: string;
|
|
15
11
|
pauseInterval?: number;
|
|
16
12
|
readPermissions: string[];
|
|
@@ -22,14 +18,24 @@ export interface Endpoint {
|
|
|
22
18
|
updatedAt?: string;
|
|
23
19
|
deletedAt?: string;
|
|
24
20
|
}
|
|
21
|
+
export interface EndpointConfig {
|
|
22
|
+
type: string;
|
|
23
|
+
url?: string;
|
|
24
|
+
authToken?: string;
|
|
25
|
+
recipients?: string[];
|
|
26
|
+
message?: string;
|
|
27
|
+
}
|
|
28
|
+
export type NotificationEndpoint = Endpoint;
|
|
29
|
+
export type NotificationLogType = 'info' | 'error';
|
|
25
30
|
export interface EndpointLog {
|
|
26
31
|
id?: string;
|
|
27
32
|
endpoint: string;
|
|
28
|
-
type?:
|
|
33
|
+
type?: NotificationLogType;
|
|
29
34
|
data?: string;
|
|
30
35
|
group?: string;
|
|
31
36
|
updatedAt?: string;
|
|
32
37
|
}
|
|
38
|
+
export type NotificationEndpointLog = EndpointLog;
|
|
33
39
|
export interface NotificationPayload {
|
|
34
40
|
subject: string;
|
|
35
41
|
message: string;
|
|
@@ -46,3 +52,36 @@ export interface NotificationPayload {
|
|
|
46
52
|
assetName?: string;
|
|
47
53
|
assetLink?: string;
|
|
48
54
|
}
|
|
55
|
+
interface PreviousNotification {
|
|
56
|
+
subject: string;
|
|
57
|
+
timestamp: string;
|
|
58
|
+
}
|
|
59
|
+
export interface AdditionalNotificationData {
|
|
60
|
+
level?: string;
|
|
61
|
+
group?: string;
|
|
62
|
+
trigger?: string;
|
|
63
|
+
timestamp?: string;
|
|
64
|
+
previousNotification?: PreviousNotification;
|
|
65
|
+
eventLink?: string;
|
|
66
|
+
assetLink?: string;
|
|
67
|
+
}
|
|
68
|
+
export interface SearchEndpointResult {
|
|
69
|
+
readonly id: string;
|
|
70
|
+
readonly name: string;
|
|
71
|
+
}
|
|
72
|
+
export declare enum NotificationEndpointStatus {
|
|
73
|
+
ACTIVE = "ACTIVE",
|
|
74
|
+
INACTIVE = "INACTIVE"
|
|
75
|
+
}
|
|
76
|
+
export declare enum NotificationEndpointType {
|
|
77
|
+
POST = "post",
|
|
78
|
+
FLOW = "flow",
|
|
79
|
+
EMAIL = "email",
|
|
80
|
+
TEAMS = "teams"
|
|
81
|
+
}
|
|
82
|
+
export declare enum NotificationEndpointSpamProtection {
|
|
83
|
+
NONE = "none",
|
|
84
|
+
ASSET = "asset",
|
|
85
|
+
MESSAGE = "message"
|
|
86
|
+
}
|
|
87
|
+
export {};
|
|
@@ -1,2 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NotificationEndpointSpamProtection = exports.NotificationEndpointType = exports.NotificationEndpointStatus = void 0;
|
|
4
|
+
var NotificationEndpointStatus;
|
|
5
|
+
(function (NotificationEndpointStatus) {
|
|
6
|
+
NotificationEndpointStatus["ACTIVE"] = "ACTIVE";
|
|
7
|
+
NotificationEndpointStatus["INACTIVE"] = "INACTIVE";
|
|
8
|
+
})(NotificationEndpointStatus || (exports.NotificationEndpointStatus = NotificationEndpointStatus = {}));
|
|
9
|
+
var NotificationEndpointType;
|
|
10
|
+
(function (NotificationEndpointType) {
|
|
11
|
+
NotificationEndpointType["POST"] = "post";
|
|
12
|
+
NotificationEndpointType["FLOW"] = "flow";
|
|
13
|
+
NotificationEndpointType["EMAIL"] = "email";
|
|
14
|
+
NotificationEndpointType["TEAMS"] = "teams";
|
|
15
|
+
})(NotificationEndpointType || (exports.NotificationEndpointType = NotificationEndpointType = {}));
|
|
16
|
+
var NotificationEndpointSpamProtection;
|
|
17
|
+
(function (NotificationEndpointSpamProtection) {
|
|
18
|
+
NotificationEndpointSpamProtection["NONE"] = "none";
|
|
19
|
+
NotificationEndpointSpamProtection["ASSET"] = "asset";
|
|
20
|
+
NotificationEndpointSpamProtection["MESSAGE"] = "message";
|
|
21
|
+
})(NotificationEndpointSpamProtection || (exports.NotificationEndpointSpamProtection = NotificationEndpointSpamProtection = {}));
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Author, Owner, Resource } from '.';
|
|
2
|
+
import type { EventLevelOverride } from './asset.interface';
|
|
2
3
|
export interface Event extends Resource {
|
|
3
4
|
data?: Record<string, any>;
|
|
4
5
|
assetRef?: string;
|
|
@@ -7,18 +8,20 @@ export interface Event extends Resource {
|
|
|
7
8
|
tsRef?: string;
|
|
8
9
|
eventRef?: string;
|
|
9
10
|
cause?: string;
|
|
10
|
-
level:
|
|
11
|
+
level: string;
|
|
11
12
|
group?: string;
|
|
12
13
|
owner?: Owner;
|
|
13
14
|
createdBy?: Author;
|
|
14
15
|
updatedBy?: Author;
|
|
15
16
|
}
|
|
16
|
-
export declare
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
Warning
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
export declare const eventLevels: readonly ["WARNING", "OK", "CRITICAL", "INFO"];
|
|
18
|
+
export type EventLevel = (typeof eventLevels)[number];
|
|
19
|
+
export declare const EventLevel: {
|
|
20
|
+
readonly Warning: "WARNING";
|
|
21
|
+
readonly OK: "OK";
|
|
22
|
+
readonly Critical: "CRITICAL";
|
|
23
|
+
readonly Info: "INFO";
|
|
24
|
+
};
|
|
22
25
|
export type CreateEventDto = Omit<Event, 'id' | 'assetRef$name' | 'createdAt' | 'updatedAt'>;
|
|
23
26
|
export interface EventCountByAsset {
|
|
24
27
|
id: string;
|
|
@@ -28,3 +31,9 @@ export interface EventCountByAsset {
|
|
|
28
31
|
eventId?: string;
|
|
29
32
|
eventName?: string;
|
|
30
33
|
}
|
|
34
|
+
export declare class EventLevelOverrideWrapper {
|
|
35
|
+
private readonly data;
|
|
36
|
+
constructor(data: EventLevelOverride);
|
|
37
|
+
setEventLevel(assetId: string, eventCause: string, level: EventLevel): void;
|
|
38
|
+
getEventLevel(assetId: string, eventCause?: string): EventLevel;
|
|
39
|
+
}
|
|
@@ -1,10 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.EventLevel = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
3
|
+
exports.EventLevelOverrideWrapper = exports.EventLevel = exports.eventLevels = void 0;
|
|
4
|
+
exports.eventLevels = ['WARNING', 'OK', 'CRITICAL', 'INFO'];
|
|
5
|
+
exports.EventLevel = {
|
|
6
|
+
Warning: 'WARNING',
|
|
7
|
+
OK: 'OK',
|
|
8
|
+
Critical: 'CRITICAL',
|
|
9
|
+
Info: 'INFO',
|
|
10
|
+
};
|
|
11
|
+
class EventLevelOverrideWrapper {
|
|
12
|
+
constructor(data) {
|
|
13
|
+
this.data = data ?? {};
|
|
14
|
+
}
|
|
15
|
+
setEventLevel(assetId, eventCause, level) {
|
|
16
|
+
if (!this.data[assetId]) {
|
|
17
|
+
this.data[assetId] = {};
|
|
18
|
+
}
|
|
19
|
+
this.data[assetId][eventCause] = level;
|
|
20
|
+
}
|
|
21
|
+
getEventLevel(assetId, eventCause) {
|
|
22
|
+
eventCause = eventCause?.replace(/\s+/g, ' ').trim();
|
|
23
|
+
if (this.data[assetId]?.[eventCause]) {
|
|
24
|
+
return this.data[assetId][eventCause];
|
|
25
|
+
}
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.EventLevelOverrideWrapper = EventLevelOverrideWrapper;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export declare enum FlowDeploymentStatus {
|
|
2
|
+
CREATED = "created",
|
|
3
|
+
DEPLOYED = "deployed",
|
|
4
|
+
DEPLOYING = "deploying",
|
|
5
|
+
DEPLOYMENT_FAILED = "deployment failed",
|
|
6
|
+
DEPLOYMENT_QUEUED = "deployment queued",
|
|
7
|
+
DELETED = "deleted",
|
|
8
|
+
DELETING = "deleting",
|
|
9
|
+
DELETING_FAILED = "deleting failed",
|
|
10
|
+
GENERATED = "generated",
|
|
11
|
+
GENERATING = "generating",
|
|
12
|
+
GENERATING_FAILED = "generating failed",
|
|
13
|
+
GENERATING_QUEUED = "generating queued",
|
|
14
|
+
INACTIVE = "inactive",
|
|
15
|
+
PAUSED = "paused",
|
|
16
|
+
RUNNING = "running",
|
|
17
|
+
STOPPED = "stopped",
|
|
18
|
+
STOPPING = "stopping",
|
|
19
|
+
TIMEOUT = "timeout",
|
|
20
|
+
UNKNOWN = "unknown",
|
|
21
|
+
UPDATED = "updated",
|
|
22
|
+
UPDATING = "updating",
|
|
23
|
+
UPDATING_FAILED = "updating failed",
|
|
24
|
+
UPGRADED = "upgraded",
|
|
25
|
+
UPGRADING = "upgrading",
|
|
26
|
+
UPGRADING_FAILED = "upgrading failed"
|
|
27
|
+
}
|
|
28
|
+
export declare const RUNNING_STATES: FlowDeploymentStatus[];
|
|
29
|
+
export declare const STOPPED_STATES: FlowDeploymentStatus[];
|
|
30
|
+
export declare const PROCESSING_STATES: FlowDeploymentStatus[];
|
|
31
|
+
export declare const ERROR_STATES: FlowDeploymentStatus[];
|
|
32
|
+
export declare const UNKOWN_STATES: FlowDeploymentStatus[];
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UNKOWN_STATES = exports.ERROR_STATES = exports.PROCESSING_STATES = exports.STOPPED_STATES = exports.RUNNING_STATES = exports.FlowDeploymentStatus = void 0;
|
|
4
|
+
var FlowDeploymentStatus;
|
|
5
|
+
(function (FlowDeploymentStatus) {
|
|
6
|
+
FlowDeploymentStatus["CREATED"] = "created";
|
|
7
|
+
FlowDeploymentStatus["DEPLOYED"] = "deployed";
|
|
8
|
+
FlowDeploymentStatus["DEPLOYING"] = "deploying";
|
|
9
|
+
FlowDeploymentStatus["DEPLOYMENT_FAILED"] = "deployment failed";
|
|
10
|
+
FlowDeploymentStatus["DEPLOYMENT_QUEUED"] = "deployment queued";
|
|
11
|
+
FlowDeploymentStatus["DELETED"] = "deleted";
|
|
12
|
+
FlowDeploymentStatus["DELETING"] = "deleting";
|
|
13
|
+
FlowDeploymentStatus["DELETING_FAILED"] = "deleting failed";
|
|
14
|
+
FlowDeploymentStatus["GENERATED"] = "generated";
|
|
15
|
+
FlowDeploymentStatus["GENERATING"] = "generating";
|
|
16
|
+
FlowDeploymentStatus["GENERATING_FAILED"] = "generating failed";
|
|
17
|
+
FlowDeploymentStatus["GENERATING_QUEUED"] = "generating queued";
|
|
18
|
+
FlowDeploymentStatus["INACTIVE"] = "inactive";
|
|
19
|
+
FlowDeploymentStatus["PAUSED"] = "paused";
|
|
20
|
+
FlowDeploymentStatus["RUNNING"] = "running";
|
|
21
|
+
FlowDeploymentStatus["STOPPED"] = "stopped";
|
|
22
|
+
FlowDeploymentStatus["STOPPING"] = "stopping";
|
|
23
|
+
FlowDeploymentStatus["TIMEOUT"] = "timeout";
|
|
24
|
+
FlowDeploymentStatus["UNKNOWN"] = "unknown";
|
|
25
|
+
FlowDeploymentStatus["UPDATED"] = "updated";
|
|
26
|
+
FlowDeploymentStatus["UPDATING"] = "updating";
|
|
27
|
+
FlowDeploymentStatus["UPDATING_FAILED"] = "updating failed";
|
|
28
|
+
FlowDeploymentStatus["UPGRADED"] = "upgraded";
|
|
29
|
+
FlowDeploymentStatus["UPGRADING"] = "upgrading";
|
|
30
|
+
FlowDeploymentStatus["UPGRADING_FAILED"] = "upgrading failed";
|
|
31
|
+
})(FlowDeploymentStatus || (exports.FlowDeploymentStatus = FlowDeploymentStatus = {}));
|
|
32
|
+
exports.RUNNING_STATES = [FlowDeploymentStatus.RUNNING];
|
|
33
|
+
exports.STOPPED_STATES = [FlowDeploymentStatus.STOPPED, FlowDeploymentStatus.PAUSED];
|
|
34
|
+
exports.PROCESSING_STATES = [
|
|
35
|
+
FlowDeploymentStatus.CREATED,
|
|
36
|
+
FlowDeploymentStatus.DEPLOYED,
|
|
37
|
+
FlowDeploymentStatus.DEPLOYING,
|
|
38
|
+
FlowDeploymentStatus.DEPLOYMENT_QUEUED,
|
|
39
|
+
FlowDeploymentStatus.DELETED,
|
|
40
|
+
FlowDeploymentStatus.DELETING,
|
|
41
|
+
FlowDeploymentStatus.GENERATED,
|
|
42
|
+
FlowDeploymentStatus.GENERATING,
|
|
43
|
+
FlowDeploymentStatus.GENERATING_QUEUED,
|
|
44
|
+
FlowDeploymentStatus.STOPPING,
|
|
45
|
+
FlowDeploymentStatus.UPDATED,
|
|
46
|
+
FlowDeploymentStatus.UPDATING,
|
|
47
|
+
FlowDeploymentStatus.UPGRADED,
|
|
48
|
+
FlowDeploymentStatus.UPGRADING,
|
|
49
|
+
];
|
|
50
|
+
exports.ERROR_STATES = [
|
|
51
|
+
FlowDeploymentStatus.DEPLOYMENT_FAILED,
|
|
52
|
+
FlowDeploymentStatus.DELETING_FAILED,
|
|
53
|
+
FlowDeploymentStatus.GENERATING_FAILED,
|
|
54
|
+
FlowDeploymentStatus.UPDATING_FAILED,
|
|
55
|
+
FlowDeploymentStatus.UPGRADING_FAILED,
|
|
56
|
+
FlowDeploymentStatus.TIMEOUT,
|
|
57
|
+
];
|
|
58
|
+
exports.UNKOWN_STATES = [FlowDeploymentStatus.INACTIVE, FlowDeploymentStatus.UNKNOWN];
|