@ampsec/platform-client 43.0.0 → 44.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.
@@ -0,0 +1,10 @@
1
+ export type EmailDto = {
2
+ /** Email address of the recipient */
3
+ to: string;
4
+ /** Email subject */
5
+ subject: string;
6
+ /** Email body */
7
+ text: string;
8
+ /** Optional HTML body */
9
+ html?: string;
10
+ };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=email.dto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"email.dto.js","sourceRoot":"","sources":["../../../src/dto/email.dto.ts"],"names":[],"mappings":""}
@@ -4,6 +4,7 @@ export * from './assetKeys';
4
4
  export * from './base.dto';
5
5
  export * from './connectors.dto';
6
6
  export * from './constants';
7
+ export * from './email.dto';
7
8
  export * from './enum.dto';
8
9
  export * from './enums';
9
10
  export * from './extKeyMap.dto';
@@ -20,6 +20,7 @@ __exportStar(require("./assetKeys"), exports);
20
20
  __exportStar(require("./base.dto"), exports);
21
21
  __exportStar(require("./connectors.dto"), exports);
22
22
  __exportStar(require("./constants"), exports);
23
+ __exportStar(require("./email.dto"), exports);
23
24
  __exportStar(require("./enum.dto"), exports);
24
25
  __exportStar(require("./enums"), exports);
25
26
  __exportStar(require("./extKeyMap.dto"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/dto/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B;AAC7B,+CAA6B;AAC7B,8CAA4B;AAC5B,6CAA2B;AAC3B,mDAAiC;AACjC,8CAA4B;AAC5B,6CAA2B;AAC3B,0CAAwB;AACxB,kDAAgC;AAChC,iDAA+B;AAC/B,wCAAsB;AACtB,gDAA8B;AAC9B,qDAAmC;AACnC,6CAA2B;AAC3B,6CAA2B;AAC3B,kDAAgC;AAChC,sDAAoC;AACpC,yDAAuC;AACvC,mDAAiC;AACjC,uDAAqC;AACrC,kDAAgC;AAChC,mDAAiC;AACjC,gDAA8B;AAC9B,8CAA4B;AAC5B,iDAA+B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/dto/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B;AAC7B,+CAA6B;AAC7B,8CAA4B;AAC5B,6CAA2B;AAC3B,mDAAiC;AACjC,8CAA4B;AAC5B,8CAA4B;AAC5B,6CAA2B;AAC3B,0CAAwB;AACxB,kDAAgC;AAChC,iDAA+B;AAC/B,wCAAsB;AACtB,gDAA8B;AAC9B,qDAAmC;AACnC,6CAA2B;AAC3B,6CAA2B;AAC3B,kDAAgC;AAChC,sDAAoC;AACpC,yDAAuC;AACvC,mDAAiC;AACjC,uDAAqC;AACrC,kDAAgC;AAChC,mDAAiC;AACjC,gDAA8B;AAC9B,8CAA4B;AAC5B,iDAA+B"}
@@ -22,6 +22,15 @@ export type FindingNotificationContext = {
22
22
  category: Category;
23
23
  /** Kind of the finding */
24
24
  kind: FindingKind;
25
+ action: 'remediate' | 'awareness' | 'educate';
26
+ };
27
+ export type VulnerabilityNotificationContext = {
28
+ /** Summary of the vulnerability. */
29
+ description: string;
30
+ /** Summary of the remediation action. */
31
+ solution?: string;
32
+ /** CVSS score of the vulnerability. */
33
+ cvss?: number;
25
34
  };
26
35
  export type TrainingNotificationContext = {
27
36
  /** Title of the training */
@@ -53,14 +62,11 @@ export type NotificationContext = {
53
62
  provider?: ProviderNotificationContext;
54
63
  training?: TrainingNotificationContext;
55
64
  user?: UserNotificationContext;
65
+ vulnerability?: VulnerabilityNotificationContext;
56
66
  };
57
67
  export type ContentStrategySpecification = {
58
68
  /** Kind of the content strategy */
59
69
  kind: ContentStrategyKind;
60
- /** Data to be used for the notification */
61
- data?: {
62
- [propName: string]: string | number | boolean;
63
- };
64
70
  };
65
71
  export type TemplateContentStrategySpec = ContentStrategySpecification & {
66
72
  /** ID of the template to be used for the notification */
@@ -75,6 +81,10 @@ export type RawContentStrategySpec = ContentStrategySpecification & {
75
81
  export type LlmContentStrategySpec = ContentStrategySpecification & {
76
82
  /** Context for the notification */
77
83
  context: NotificationContext;
84
+ history?: {
85
+ role: 'user' | 'system' | 'assistant';
86
+ content: string;
87
+ }[];
78
88
  };
79
89
  export type DeliveryStrategySpec = {
80
90
  /** Channel type that should be used for sending the notificaiton */
@@ -82,6 +92,9 @@ export type DeliveryStrategySpec = {
82
92
  /** Recipient address to which the notification is being sent */
83
93
  to: NotificationAddress;
84
94
  };
95
+ export type EmailDeliveryStrategySpec = DeliveryStrategySpec & {
96
+ subject: string;
97
+ };
85
98
  export type NotificationUpsertDto = BaseUpsertDto & {
86
99
  /** Workflow ID for which the notification is being created */
87
100
  wfid: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ampsec/platform-client",
3
- "version": "43.0.0",
3
+ "version": "44.0.0",
4
4
  "description": "",
5
5
  "main": "build/src/index.js",
6
6
  "runkitExampleFilename": "example/main.js",
@@ -0,0 +1,10 @@
1
+ export type EmailDto = {
2
+ /** Email address of the recipient */
3
+ to: string;
4
+ /** Email subject */
5
+ subject: string;
6
+ /** Email body */
7
+ text: string;
8
+ /** Optional HTML body */
9
+ html?: string;
10
+ };
package/src/dto/index.ts CHANGED
@@ -4,6 +4,7 @@ export * from './assetKeys';
4
4
  export * from './base.dto';
5
5
  export * from './connectors.dto';
6
6
  export * from './constants';
7
+ export * from './email.dto';
7
8
  export * from './enum.dto';
8
9
  export * from './enums';
9
10
  export * from './extKeyMap.dto';
@@ -25,6 +25,16 @@ export type FindingNotificationContext = {
25
25
  category: Category;
26
26
  /** Kind of the finding */
27
27
  kind: FindingKind;
28
+ action: 'remediate' | 'awareness' | 'educate';
29
+ };
30
+
31
+ export type VulnerabilityNotificationContext = {
32
+ /** Summary of the vulnerability. */
33
+ description: string;
34
+ /** Summary of the remediation action. */
35
+ solution?: string;
36
+ /** CVSS score of the vulnerability. */
37
+ cvss?: number;
28
38
  };
29
39
 
30
40
  export type TrainingNotificationContext = {
@@ -53,8 +63,6 @@ export type ProviderNotificationContext = {
53
63
  };
54
64
 
55
65
  export type NotificationContext = {
56
- // TODO: determine what this should be
57
- // component?: ComponentNotificationContext;
58
66
  /** Estimated completion time for the remediation described by the notification */
59
67
  estimatedCompletionTime: number;
60
68
  asset?: AssetNotificationContext;
@@ -62,15 +70,12 @@ export type NotificationContext = {
62
70
  provider?: ProviderNotificationContext;
63
71
  training?: TrainingNotificationContext;
64
72
  user?: UserNotificationContext;
73
+ vulnerability?: VulnerabilityNotificationContext;
65
74
  };
66
75
 
67
76
  export type ContentStrategySpecification = {
68
77
  /** Kind of the content strategy */
69
78
  kind: ContentStrategyKind;
70
- /** Data to be used for the notification */
71
- data?: {
72
- [propName: string]: string | number | boolean;
73
- };
74
79
  };
75
80
 
76
81
  export type TemplateContentStrategySpec = ContentStrategySpecification & {
@@ -88,6 +93,7 @@ export type RawContentStrategySpec = ContentStrategySpecification & {
88
93
  export type LlmContentStrategySpec = ContentStrategySpecification & {
89
94
  /** Context for the notification */
90
95
  context: NotificationContext;
96
+ history?: {role: 'user' | 'system' | 'assistant'; content: string}[];
91
97
  };
92
98
 
93
99
  export type DeliveryStrategySpec = {
@@ -97,6 +103,10 @@ export type DeliveryStrategySpec = {
97
103
  to: NotificationAddress;
98
104
  };
99
105
 
106
+ export type EmailDeliveryStrategySpec = DeliveryStrategySpec & {
107
+ subject: string;
108
+ };
109
+
100
110
  export type NotificationUpsertDto = BaseUpsertDto & {
101
111
  /** Workflow ID for which the notification is being created */
102
112
  wfid: string;