@ampsec/platform-client 33.0.1 → 34.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/src/dto/enums/notification.type.d.ts +5 -0
- package/build/src/dto/enums/notification.type.js +11 -0
- package/build/src/dto/enums/notification.type.js.map +1 -0
- package/build/src/dto/notification.dto.d.ts +14 -4
- package/build/src/dto/workflow.dto.d.ts +3 -2
- package/package.json +1 -1
- package/src/dto/enums/notification.type.ts +6 -0
- package/src/dto/notification.dto.ts +17 -4
- package/src/dto/workflow.dto.ts +3 -2
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NotificationType = void 0;
|
|
4
|
+
/* eslint-disable no-unused-vars */
|
|
5
|
+
var NotificationType;
|
|
6
|
+
(function (NotificationType) {
|
|
7
|
+
NotificationType["LLM"] = "LLM";
|
|
8
|
+
NotificationType["RAW"] = "RAW";
|
|
9
|
+
NotificationType["TEMPLATE"] = "TEMPLATE";
|
|
10
|
+
})(NotificationType || (exports.NotificationType = NotificationType = {}));
|
|
11
|
+
//# sourceMappingURL=notification.type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notification.type.js","sourceRoot":"","sources":["../../../../src/dto/enums/notification.type.ts"],"names":[],"mappings":";;;AAAA,mCAAmC;AACnC,IAAY,gBAIX;AAJD,WAAY,gBAAgB;IAC1B,+BAAW,CAAA;IACX,+BAAW,CAAA;IACX,yCAAqB,CAAA;AACvB,CAAC,EAJW,gBAAgB,gCAAhB,gBAAgB,QAI3B"}
|
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
import { BaseDto, BaseUpsertDto } from './base.dto';
|
|
2
2
|
import { NotificationStatus } from './enums';
|
|
3
|
+
import { NotificationType } from './enums/notification.type';
|
|
3
4
|
import { NotificationStepData, TrainingNotificationStepData } from './workflow.dto';
|
|
5
|
+
export type NotificationSchema = {
|
|
6
|
+
type: NotificationType;
|
|
7
|
+
};
|
|
8
|
+
export type TemplateNotificationSchema = NotificationSchema & {
|
|
9
|
+
/** ID of the template to be used for the notification */
|
|
10
|
+
templateId: string;
|
|
11
|
+
};
|
|
12
|
+
export type RawNotificationSchema = NotificationSchema & {
|
|
13
|
+
/** Optional user provided notification message */
|
|
14
|
+
rawContent: string;
|
|
15
|
+
};
|
|
4
16
|
export type NotificationAddress = {
|
|
5
17
|
/** Connector ID for the notification channel */
|
|
6
18
|
cid: string;
|
|
@@ -18,8 +30,6 @@ export type NotificationUpsertDto = BaseUpsertDto & {
|
|
|
18
30
|
fid?: string;
|
|
19
31
|
/** Recipient address to which the notification is being sent */
|
|
20
32
|
to: NotificationAddress;
|
|
21
|
-
/** ID of the template to use for the notification */
|
|
22
|
-
templateId: string;
|
|
23
33
|
/** ID of the user to which the notification is being sent */
|
|
24
34
|
uid?: string;
|
|
25
35
|
/** Step number in the workflow for which the notification is being created */
|
|
@@ -28,7 +38,7 @@ export type NotificationUpsertDto = BaseUpsertDto & {
|
|
|
28
38
|
status: NotificationStatus;
|
|
29
39
|
/** Data to be used for the notification */
|
|
30
40
|
data: NotificationStepData | TrainingNotificationStepData;
|
|
31
|
-
/**
|
|
32
|
-
|
|
41
|
+
/** Schema for the notification */
|
|
42
|
+
schema: NotificationSchema | RawNotificationSchema | TemplateNotificationSchema;
|
|
33
43
|
};
|
|
34
44
|
export type NotificationDto = NotificationUpsertDto & BaseDto;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { BaseDto } from './base.dto';
|
|
2
2
|
import { WorkflowStepType } from './enums/workflowStep.type';
|
|
3
3
|
import { WorkflowTriggerType } from './enums/workflowTrigger.type';
|
|
4
|
+
import { NotificationSchema, TemplateNotificationSchema, RawNotificationSchema } from './notification.dto';
|
|
4
5
|
export type NotificationStepData = {
|
|
5
6
|
/** Name of the device to which the notification of finding applies */
|
|
6
7
|
deviceName: string | null;
|
|
@@ -24,8 +25,8 @@ export type PauseStepData = {
|
|
|
24
25
|
export type WorkflowStep = {
|
|
25
26
|
/** Type of the notification step, either NOTIFICATION or PAUSE */
|
|
26
27
|
type: WorkflowStepType;
|
|
27
|
-
/**
|
|
28
|
-
|
|
28
|
+
/** Schema for the notification step */
|
|
29
|
+
schema?: NotificationSchema | TemplateNotificationSchema | RawNotificationSchema;
|
|
29
30
|
/** Data associated with the notification step */
|
|
30
31
|
data: NotificationStepData | TrainingNotificationStepData | PauseStepData;
|
|
31
32
|
/** Step number to transition the workflow to on success */
|
package/package.json
CHANGED
|
@@ -1,7 +1,22 @@
|
|
|
1
1
|
import {BaseDto, BaseUpsertDto} from './base.dto';
|
|
2
2
|
import {NotificationStatus} from './enums';
|
|
3
|
+
import {NotificationType} from './enums/notification.type';
|
|
3
4
|
import {NotificationStepData, TrainingNotificationStepData} from './workflow.dto';
|
|
4
5
|
|
|
6
|
+
export type NotificationSchema = {
|
|
7
|
+
type: NotificationType;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export type TemplateNotificationSchema = NotificationSchema & {
|
|
11
|
+
/** ID of the template to be used for the notification */
|
|
12
|
+
templateId: string;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export type RawNotificationSchema = NotificationSchema & {
|
|
16
|
+
/** Optional user provided notification message */
|
|
17
|
+
rawContent: string;
|
|
18
|
+
};
|
|
19
|
+
|
|
5
20
|
export type NotificationAddress = {
|
|
6
21
|
/** Connector ID for the notification channel */
|
|
7
22
|
cid: string;
|
|
@@ -20,8 +35,6 @@ export type NotificationUpsertDto = BaseUpsertDto & {
|
|
|
20
35
|
fid?: string;
|
|
21
36
|
/** Recipient address to which the notification is being sent */
|
|
22
37
|
to: NotificationAddress;
|
|
23
|
-
/** ID of the template to use for the notification */
|
|
24
|
-
templateId: string;
|
|
25
38
|
/** ID of the user to which the notification is being sent */
|
|
26
39
|
uid?: string;
|
|
27
40
|
/** Step number in the workflow for which the notification is being created */
|
|
@@ -30,8 +43,8 @@ export type NotificationUpsertDto = BaseUpsertDto & {
|
|
|
30
43
|
status: NotificationStatus;
|
|
31
44
|
/** Data to be used for the notification */
|
|
32
45
|
data: NotificationStepData | TrainingNotificationStepData;
|
|
33
|
-
/**
|
|
34
|
-
|
|
46
|
+
/** Schema for the notification */
|
|
47
|
+
schema: NotificationSchema | RawNotificationSchema | TemplateNotificationSchema;
|
|
35
48
|
};
|
|
36
49
|
|
|
37
50
|
export type NotificationDto = NotificationUpsertDto & BaseDto;
|
package/src/dto/workflow.dto.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {BaseDto} from './base.dto';
|
|
2
2
|
import {WorkflowStepType} from './enums/workflowStep.type';
|
|
3
3
|
import {WorkflowTriggerType} from './enums/workflowTrigger.type';
|
|
4
|
+
import {NotificationSchema, TemplateNotificationSchema, RawNotificationSchema} from './notification.dto';
|
|
4
5
|
|
|
5
6
|
export type NotificationStepData = {
|
|
6
7
|
/** Name of the device to which the notification of finding applies */
|
|
@@ -28,8 +29,8 @@ export type PauseStepData = {
|
|
|
28
29
|
export type WorkflowStep = {
|
|
29
30
|
/** Type of the notification step, either NOTIFICATION or PAUSE */
|
|
30
31
|
type: WorkflowStepType;
|
|
31
|
-
/**
|
|
32
|
-
|
|
32
|
+
/** Schema for the notification step */
|
|
33
|
+
schema?: NotificationSchema | TemplateNotificationSchema | RawNotificationSchema;
|
|
33
34
|
/** Data associated with the notification step */
|
|
34
35
|
data: NotificationStepData | TrainingNotificationStepData | PauseStepData;
|
|
35
36
|
/** Step number to transition the workflow to on success */
|