@ampsec/platform-client 36.0.0 → 37.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.
@@ -11,4 +11,4 @@ export * from './notification.status';
11
11
  export * from './riskContributor.type';
12
12
  export * from './saasComponentKind';
13
13
  export * from './workflowStep.kind';
14
- export * from './notification.strategy';
14
+ export * from './notification.kind';
@@ -27,5 +27,5 @@ __exportStar(require("./notification.status"), exports);
27
27
  __exportStar(require("./riskContributor.type"), exports);
28
28
  __exportStar(require("./saasComponentKind"), exports);
29
29
  __exportStar(require("./workflowStep.kind"), exports);
30
- __exportStar(require("./notification.strategy"), exports);
30
+ __exportStar(require("./notification.kind"), exports);
31
31
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/dto/enums/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,iDAA+B;AAC/B,wDAAsC;AACtC,6CAA2B;AAC3B,qDAAmC;AACnC,gDAA8B;AAC9B,qDAAmC;AACnC,mDAAiC;AACjC,wDAAsC;AACtC,wDAAsC;AACtC,yDAAuC;AACvC,sDAAoC;AACpC,sDAAoC;AACpC,0DAAwC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/dto/enums/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,iDAA+B;AAC/B,wDAAsC;AACtC,6CAA2B;AAC3B,qDAAmC;AACnC,gDAA8B;AAC9B,qDAAmC;AACnC,mDAAiC;AACjC,wDAAsC;AACtC,wDAAsC;AACtC,yDAAuC;AACvC,sDAAoC;AACpC,sDAAoC;AACpC,sDAAoC"}
@@ -1,4 +1,4 @@
1
- export declare enum NotificationStrategy {
1
+ export declare enum NotificationKind {
2
2
  LLM = "LLM",
3
3
  RAW = "RAW",
4
4
  TEMPLATE = "TEMPLATE"
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NotificationKind = void 0;
4
+ /* eslint-disable no-unused-vars */
5
+ var NotificationKind;
6
+ (function (NotificationKind) {
7
+ NotificationKind["LLM"] = "LLM";
8
+ NotificationKind["RAW"] = "RAW";
9
+ NotificationKind["TEMPLATE"] = "TEMPLATE";
10
+ })(NotificationKind || (exports.NotificationKind = NotificationKind = {}));
11
+ //# sourceMappingURL=notification.kind.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notification.kind.js","sourceRoot":"","sources":["../../../../src/dto/enums/notification.kind.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,15 +1,12 @@
1
1
  import { BaseDto, BaseUpsertDto } from './base.dto';
2
2
  import { NotificationStatus } from './enums';
3
- import { NotificationStrategy } from './enums/notification.strategy';
3
+ import { NotificationKind } from './enums/notification.kind';
4
4
  import { NotificationStepData, TrainingNotificationStepData } from './workflow.dto';
5
- export type NotificationSchema = {
6
- strategy: NotificationStrategy;
7
- };
8
- export type TemplateNotificationSchema = NotificationSchema & {
5
+ export type TemplateNotificationSchema = {
9
6
  /** ID of the template to be used for the notification */
10
7
  templateId: string;
11
8
  };
12
- export type RawNotificationSchema = NotificationSchema & {
9
+ export type RawNotificationSchema = {
13
10
  /** Optional user provided notification message */
14
11
  rawContent: string;
15
12
  };
@@ -24,6 +21,8 @@ export type NotificationAddress = {
24
21
  webhooks?: string[];
25
22
  };
26
23
  export type NotificationUpsertDto = BaseUpsertDto & {
24
+ /** Kind of the notification */
25
+ kind: NotificationKind;
27
26
  /** Workflow ID for which the notification is being created */
28
27
  wfid: string;
29
28
  /** Finding ID for which the notification is being created */
@@ -39,6 +38,6 @@ export type NotificationUpsertDto = BaseUpsertDto & {
39
38
  /** Data to be used for the notification */
40
39
  data: NotificationStepData | TrainingNotificationStepData;
41
40
  /** Schema for the notification */
42
- schema: NotificationSchema | RawNotificationSchema | TemplateNotificationSchema;
41
+ schema?: RawNotificationSchema | TemplateNotificationSchema;
43
42
  };
44
43
  export type NotificationDto = NotificationUpsertDto & BaseDto;
@@ -1,7 +1,8 @@
1
1
  import { BaseDto } from './base.dto';
2
+ import { NotificationKind } from './enums';
2
3
  import { WorkflowStepKind } from './enums/workflowStep.kind';
3
4
  import { WorkflowTriggerKind } from './enums/workflowTrigger.kind';
4
- import { NotificationSchema, TemplateNotificationSchema, RawNotificationSchema } from './notification.dto';
5
+ import { TemplateNotificationSchema, RawNotificationSchema } from './notification.dto';
5
6
  export type NotificationStepData = {
6
7
  /** Name of the device to which the notification of finding applies */
7
8
  deviceName: string | null;
@@ -25,8 +26,10 @@ export type PauseStepData = {
25
26
  export type WorkflowStep = {
26
27
  /** Type of the notification step, either NOTIFICATION or PAUSE */
27
28
  kind: WorkflowStepKind;
29
+ /** Kind of the notification */
30
+ notificationKind?: NotificationKind;
28
31
  /** Schema for the notification step */
29
- schema?: NotificationSchema | TemplateNotificationSchema | RawNotificationSchema;
32
+ schema?: TemplateNotificationSchema | RawNotificationSchema;
30
33
  /** Data associated with the notification step */
31
34
  data: NotificationStepData | TrainingNotificationStepData | PauseStepData;
32
35
  /** Step number to transition the workflow to on success */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ampsec/platform-client",
3
- "version": "36.0.0",
3
+ "version": "37.0.0",
4
4
  "description": "",
5
5
  "main": "build/src/index.js",
6
6
  "runkitExampleFilename": "example/main.js",
@@ -11,4 +11,4 @@ export * from './notification.status';
11
11
  export * from './riskContributor.type';
12
12
  export * from './saasComponentKind';
13
13
  export * from './workflowStep.kind';
14
- export * from './notification.strategy';
14
+ export * from './notification.kind';
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable no-unused-vars */
2
- export enum NotificationStrategy {
2
+ export enum NotificationKind {
3
3
  LLM = 'LLM',
4
4
  RAW = 'RAW',
5
5
  TEMPLATE = 'TEMPLATE',
@@ -1,18 +1,14 @@
1
1
  import {BaseDto, BaseUpsertDto} from './base.dto';
2
2
  import {NotificationStatus} from './enums';
3
- import {NotificationStrategy} from './enums/notification.strategy';
3
+ import {NotificationKind} from './enums/notification.kind';
4
4
  import {NotificationStepData, TrainingNotificationStepData} from './workflow.dto';
5
5
 
6
- export type NotificationSchema = {
7
- strategy: NotificationStrategy;
8
- };
9
-
10
- export type TemplateNotificationSchema = NotificationSchema & {
6
+ export type TemplateNotificationSchema = {
11
7
  /** ID of the template to be used for the notification */
12
8
  templateId: string;
13
9
  };
14
10
 
15
- export type RawNotificationSchema = NotificationSchema & {
11
+ export type RawNotificationSchema = {
16
12
  /** Optional user provided notification message */
17
13
  rawContent: string;
18
14
  };
@@ -29,6 +25,8 @@ export type NotificationAddress = {
29
25
  };
30
26
 
31
27
  export type NotificationUpsertDto = BaseUpsertDto & {
28
+ /** Kind of the notification */
29
+ kind: NotificationKind;
32
30
  /** Workflow ID for which the notification is being created */
33
31
  wfid: string;
34
32
  /** Finding ID for which the notification is being created */
@@ -44,7 +42,7 @@ export type NotificationUpsertDto = BaseUpsertDto & {
44
42
  /** Data to be used for the notification */
45
43
  data: NotificationStepData | TrainingNotificationStepData;
46
44
  /** Schema for the notification */
47
- schema: NotificationSchema | RawNotificationSchema | TemplateNotificationSchema;
45
+ schema?: RawNotificationSchema | TemplateNotificationSchema;
48
46
  };
49
47
 
50
48
  export type NotificationDto = NotificationUpsertDto & BaseDto;
@@ -1,7 +1,8 @@
1
1
  import {BaseDto} from './base.dto';
2
+ import {NotificationKind} from './enums';
2
3
  import {WorkflowStepKind} from './enums/workflowStep.kind';
3
4
  import {WorkflowTriggerKind} from './enums/workflowTrigger.kind';
4
- import {NotificationSchema, TemplateNotificationSchema, RawNotificationSchema} from './notification.dto';
5
+ import {TemplateNotificationSchema, RawNotificationSchema} from './notification.dto';
5
6
 
6
7
  export type NotificationStepData = {
7
8
  /** Name of the device to which the notification of finding applies */
@@ -29,8 +30,10 @@ export type PauseStepData = {
29
30
  export type WorkflowStep = {
30
31
  /** Type of the notification step, either NOTIFICATION or PAUSE */
31
32
  kind: WorkflowStepKind;
33
+ /** Kind of the notification */
34
+ notificationKind?: NotificationKind;
32
35
  /** Schema for the notification step */
33
- schema?: NotificationSchema | TemplateNotificationSchema | RawNotificationSchema;
36
+ schema?: TemplateNotificationSchema | RawNotificationSchema;
34
37
  /** Data associated with the notification step */
35
38
  data: NotificationStepData | TrainingNotificationStepData | PauseStepData;
36
39
  /** Step number to transition the workflow to on success */
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.NotificationStrategy = void 0;
4
- /* eslint-disable no-unused-vars */
5
- var NotificationStrategy;
6
- (function (NotificationStrategy) {
7
- NotificationStrategy["LLM"] = "LLM";
8
- NotificationStrategy["RAW"] = "RAW";
9
- NotificationStrategy["TEMPLATE"] = "TEMPLATE";
10
- })(NotificationStrategy || (exports.NotificationStrategy = NotificationStrategy = {}));
11
- //# sourceMappingURL=notification.strategy.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"notification.strategy.js","sourceRoot":"","sources":["../../../../src/dto/enums/notification.strategy.ts"],"names":[],"mappings":";;;AAAA,mCAAmC;AACnC,IAAY,oBAIX;AAJD,WAAY,oBAAoB;IAC9B,mCAAW,CAAA;IACX,mCAAW,CAAA;IACX,6CAAqB,CAAA;AACvB,CAAC,EAJW,oBAAoB,oCAApB,oBAAoB,QAI/B"}