@ampsec/platform-client 43.1.0 → 45.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/finding.outcome.d.ts +5 -0
- package/build/src/dto/enums/finding.outcome.js +11 -0
- package/build/src/dto/enums/finding.outcome.js.map +1 -0
- package/build/src/dto/findings.dto.d.ts +3 -0
- package/build/src/dto/notification.dto.d.ts +19 -4
- package/package.json +1 -1
- package/src/dto/enums/finding.outcome.ts +6 -0
- package/src/dto/findings.dto.ts +3 -0
- package/src/dto/notification.dto.ts +18 -6
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FindingOutcome = void 0;
|
|
4
|
+
/* eslint-disable no-unused-vars */
|
|
5
|
+
var FindingOutcome;
|
|
6
|
+
(function (FindingOutcome) {
|
|
7
|
+
FindingOutcome["REMEDIATION"] = "remediation";
|
|
8
|
+
FindingOutcome["AWARENESS"] = "awareness";
|
|
9
|
+
FindingOutcome["EDUCATION"] = "education";
|
|
10
|
+
})(FindingOutcome || (exports.FindingOutcome = FindingOutcome = {}));
|
|
11
|
+
//# sourceMappingURL=finding.outcome.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"finding.outcome.js","sourceRoot":"","sources":["../../../../src/dto/enums/finding.outcome.ts"],"names":[],"mappings":";;;AAAA,mCAAmC;AACnC,IAAY,cAIX;AAJD,WAAY,cAAc;IACxB,6CAA2B,CAAA;IAC3B,yCAAuB,CAAA;IACvB,yCAAuB,CAAA;AACzB,CAAC,EAJW,cAAc,8BAAd,cAAc,QAIzB"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BaseDto, BaseUpsertDto } from './base.dto';
|
|
2
2
|
import { Category, FindingKind } from './enums';
|
|
3
|
+
import { FindingOutcome } from './enums/finding.outcome';
|
|
3
4
|
import { FindingSeverity } from './enums/finding.severity';
|
|
4
5
|
import { FindingStatus } from './enums/finding.status';
|
|
5
6
|
import { SimpleProviderDto } from './providers.dto';
|
|
@@ -21,6 +22,8 @@ export type FindingUpsertDto = BaseUpsertDto & {
|
|
|
21
22
|
status: FindingStatus;
|
|
22
23
|
/** Severity of the finding, e.g. CRITICAL, HIGH, etc... */
|
|
23
24
|
severity: FindingSeverity;
|
|
25
|
+
/** Desired outcome by surfacing the finding. */
|
|
26
|
+
outcome?: FindingOutcome;
|
|
24
27
|
/** Number of times the user has been engaged to resolve the finding */
|
|
25
28
|
numberOfEngagements: number;
|
|
26
29
|
/** Human readable name of the finding */
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { BaseDto, BaseUpsertDto } from './base.dto';
|
|
2
2
|
import { Category, DeliveryStrategyKind, FindingKind, FindingSeverity, NotificationStatus } from './enums';
|
|
3
3
|
import { ContentStrategyKind } from './enums/contentStrategy.kind';
|
|
4
|
+
import { FindingOutcome } from './enums/finding.outcome';
|
|
4
5
|
export type NotificationAddress = {
|
|
5
6
|
/** Connector ID for the notification channel */
|
|
6
7
|
cid?: string;
|
|
@@ -22,6 +23,16 @@ export type FindingNotificationContext = {
|
|
|
22
23
|
category: Category;
|
|
23
24
|
/** Kind of the finding */
|
|
24
25
|
kind: FindingKind;
|
|
26
|
+
/** Desired outcome of surfacing the finding */
|
|
27
|
+
outcome: FindingOutcome;
|
|
28
|
+
};
|
|
29
|
+
export type VulnerabilityNotificationContext = {
|
|
30
|
+
/** Summary of the vulnerability. */
|
|
31
|
+
description: string;
|
|
32
|
+
/** Summary of the remediation action. */
|
|
33
|
+
solution?: string;
|
|
34
|
+
/** CVSS score of the vulnerability. */
|
|
35
|
+
cvss?: number;
|
|
25
36
|
};
|
|
26
37
|
export type TrainingNotificationContext = {
|
|
27
38
|
/** Title of the training */
|
|
@@ -53,14 +64,11 @@ export type NotificationContext = {
|
|
|
53
64
|
provider?: ProviderNotificationContext;
|
|
54
65
|
training?: TrainingNotificationContext;
|
|
55
66
|
user?: UserNotificationContext;
|
|
67
|
+
vulnerability?: VulnerabilityNotificationContext;
|
|
56
68
|
};
|
|
57
69
|
export type ContentStrategySpecification = {
|
|
58
70
|
/** Kind of the content strategy */
|
|
59
71
|
kind: ContentStrategyKind;
|
|
60
|
-
/** Data to be used for the notification */
|
|
61
|
-
data?: {
|
|
62
|
-
[propName: string]: string | number | boolean;
|
|
63
|
-
};
|
|
64
72
|
};
|
|
65
73
|
export type TemplateContentStrategySpec = ContentStrategySpecification & {
|
|
66
74
|
/** ID of the template to be used for the notification */
|
|
@@ -75,6 +83,10 @@ export type RawContentStrategySpec = ContentStrategySpecification & {
|
|
|
75
83
|
export type LlmContentStrategySpec = ContentStrategySpecification & {
|
|
76
84
|
/** Context for the notification */
|
|
77
85
|
context: NotificationContext;
|
|
86
|
+
history?: {
|
|
87
|
+
role: 'user' | 'system' | 'assistant';
|
|
88
|
+
content: string;
|
|
89
|
+
}[];
|
|
78
90
|
};
|
|
79
91
|
export type DeliveryStrategySpec = {
|
|
80
92
|
/** Channel type that should be used for sending the notificaiton */
|
|
@@ -82,6 +94,9 @@ export type DeliveryStrategySpec = {
|
|
|
82
94
|
/** Recipient address to which the notification is being sent */
|
|
83
95
|
to: NotificationAddress;
|
|
84
96
|
};
|
|
97
|
+
export type EmailDeliveryStrategySpec = DeliveryStrategySpec & {
|
|
98
|
+
subject: string;
|
|
99
|
+
};
|
|
85
100
|
export type NotificationUpsertDto = BaseUpsertDto & {
|
|
86
101
|
/** Workflow ID for which the notification is being created */
|
|
87
102
|
wfid: string;
|
package/package.json
CHANGED
package/src/dto/findings.dto.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {BaseDto, BaseUpsertDto} from './base.dto';
|
|
2
2
|
import {Category, FindingKind} from './enums';
|
|
3
|
+
import {FindingOutcome} from './enums/finding.outcome';
|
|
3
4
|
import {FindingSeverity} from './enums/finding.severity';
|
|
4
5
|
import {FindingStatus} from './enums/finding.status';
|
|
5
6
|
import {SimpleProviderDto} from './providers.dto';
|
|
@@ -23,6 +24,8 @@ export type FindingUpsertDto = BaseUpsertDto & {
|
|
|
23
24
|
status: FindingStatus;
|
|
24
25
|
/** Severity of the finding, e.g. CRITICAL, HIGH, etc... */
|
|
25
26
|
severity: FindingSeverity;
|
|
27
|
+
/** Desired outcome by surfacing the finding. */
|
|
28
|
+
outcome?: FindingOutcome;
|
|
26
29
|
/** Number of times the user has been engaged to resolve the finding */
|
|
27
30
|
numberOfEngagements: number;
|
|
28
31
|
/** Human readable name of the finding */
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {BaseDto, BaseUpsertDto} from './base.dto';
|
|
2
2
|
import {Category, DeliveryStrategyKind, FindingKind, FindingSeverity, NotificationStatus} from './enums';
|
|
3
3
|
import {ContentStrategyKind} from './enums/contentStrategy.kind';
|
|
4
|
+
import {FindingOutcome} from './enums/finding.outcome';
|
|
4
5
|
|
|
5
6
|
export type NotificationAddress = {
|
|
6
7
|
/** Connector ID for the notification channel */
|
|
@@ -25,6 +26,17 @@ export type FindingNotificationContext = {
|
|
|
25
26
|
category: Category;
|
|
26
27
|
/** Kind of the finding */
|
|
27
28
|
kind: FindingKind;
|
|
29
|
+
/** Desired outcome of surfacing the finding */
|
|
30
|
+
outcome: FindingOutcome;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export type VulnerabilityNotificationContext = {
|
|
34
|
+
/** Summary of the vulnerability. */
|
|
35
|
+
description: string;
|
|
36
|
+
/** Summary of the remediation action. */
|
|
37
|
+
solution?: string;
|
|
38
|
+
/** CVSS score of the vulnerability. */
|
|
39
|
+
cvss?: number;
|
|
28
40
|
};
|
|
29
41
|
|
|
30
42
|
export type TrainingNotificationContext = {
|
|
@@ -53,8 +65,6 @@ export type ProviderNotificationContext = {
|
|
|
53
65
|
};
|
|
54
66
|
|
|
55
67
|
export type NotificationContext = {
|
|
56
|
-
// TODO: determine what this should be
|
|
57
|
-
// component?: ComponentNotificationContext;
|
|
58
68
|
/** Estimated completion time for the remediation described by the notification */
|
|
59
69
|
estimatedCompletionTime: number;
|
|
60
70
|
asset?: AssetNotificationContext;
|
|
@@ -62,15 +72,12 @@ export type NotificationContext = {
|
|
|
62
72
|
provider?: ProviderNotificationContext;
|
|
63
73
|
training?: TrainingNotificationContext;
|
|
64
74
|
user?: UserNotificationContext;
|
|
75
|
+
vulnerability?: VulnerabilityNotificationContext;
|
|
65
76
|
};
|
|
66
77
|
|
|
67
78
|
export type ContentStrategySpecification = {
|
|
68
79
|
/** Kind of the content strategy */
|
|
69
80
|
kind: ContentStrategyKind;
|
|
70
|
-
/** Data to be used for the notification */
|
|
71
|
-
data?: {
|
|
72
|
-
[propName: string]: string | number | boolean;
|
|
73
|
-
};
|
|
74
81
|
};
|
|
75
82
|
|
|
76
83
|
export type TemplateContentStrategySpec = ContentStrategySpecification & {
|
|
@@ -88,6 +95,7 @@ export type RawContentStrategySpec = ContentStrategySpecification & {
|
|
|
88
95
|
export type LlmContentStrategySpec = ContentStrategySpecification & {
|
|
89
96
|
/** Context for the notification */
|
|
90
97
|
context: NotificationContext;
|
|
98
|
+
history?: {role: 'user' | 'system' | 'assistant'; content: string}[];
|
|
91
99
|
};
|
|
92
100
|
|
|
93
101
|
export type DeliveryStrategySpec = {
|
|
@@ -97,6 +105,10 @@ export type DeliveryStrategySpec = {
|
|
|
97
105
|
to: NotificationAddress;
|
|
98
106
|
};
|
|
99
107
|
|
|
108
|
+
export type EmailDeliveryStrategySpec = DeliveryStrategySpec & {
|
|
109
|
+
subject: string;
|
|
110
|
+
};
|
|
111
|
+
|
|
100
112
|
export type NotificationUpsertDto = BaseUpsertDto & {
|
|
101
113
|
/** Workflow ID for which the notification is being created */
|
|
102
114
|
wfid: string;
|