@ampsec/platform-client 28.1.0 → 29.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/workflowTrigger.type.d.ts +2 -1
- package/build/src/dto/enums/workflowTrigger.type.js +1 -0
- package/build/src/dto/enums/workflowTrigger.type.js.map +1 -1
- package/build/src/dto/notification.dto.d.ts +5 -2
- package/build/src/dto/saasComponents.dto.d.ts +6 -0
- package/build/src/dto/users.dto.d.ts +6 -0
- package/build/src/dto/workflow.dto.d.ts +17 -10
- package/build/src/services/constants.js +1 -1
- package/build/src/services/constants.js.map +1 -1
- package/package.json +1 -1
- package/src/dto/enums/workflowTrigger.type.ts +1 -0
- package/src/dto/notification.dto.ts +5 -2
- package/src/dto/saasComponents.dto.ts +6 -0
- package/src/dto/users.dto.ts +6 -0
- package/src/dto/workflow.dto.ts +19 -10
- package/src/services/constants.ts +1 -1
|
@@ -6,5 +6,6 @@ var WorkflowTriggerType;
|
|
|
6
6
|
(function (WorkflowTriggerType) {
|
|
7
7
|
WorkflowTriggerType["FINDING"] = "FINDING";
|
|
8
8
|
WorkflowTriggerType["USER"] = "USER";
|
|
9
|
+
WorkflowTriggerType["SAAS_COMPONENT"] = "SAAS_COMPONENT";
|
|
9
10
|
})(WorkflowTriggerType || (exports.WorkflowTriggerType = WorkflowTriggerType = {}));
|
|
10
11
|
//# sourceMappingURL=workflowTrigger.type.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflowTrigger.type.js","sourceRoot":"","sources":["../../../../src/dto/enums/workflowTrigger.type.ts"],"names":[],"mappings":";;;AAAA,mCAAmC;AACnC,IAAY,
|
|
1
|
+
{"version":3,"file":"workflowTrigger.type.js","sourceRoot":"","sources":["../../../../src/dto/enums/workflowTrigger.type.ts"],"names":[],"mappings":";;;AAAA,mCAAmC;AACnC,IAAY,mBAIX;AAJD,WAAY,mBAAmB;IAC7B,0CAAmB,CAAA;IACnB,oCAAa,CAAA;IACb,wDAAiC,CAAA;AACnC,CAAC,EAJW,mBAAmB,mCAAnB,mBAAmB,QAI9B"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BaseDto, BaseUpsertDto } from './base.dto';
|
|
2
2
|
import { NotificationStatus } from './enums';
|
|
3
|
+
import { NotificationStepData } from './workflow.dto';
|
|
3
4
|
export type NotificationAddress = {
|
|
4
5
|
/** Connector ID for the notification channel */
|
|
5
6
|
cid: string;
|
|
@@ -19,11 +20,13 @@ export type NotificationUpsertDto = BaseUpsertDto & {
|
|
|
19
20
|
to: NotificationAddress;
|
|
20
21
|
/** ID of the template to use for the notification */
|
|
21
22
|
templateId: string;
|
|
22
|
-
/** ID
|
|
23
|
-
uid
|
|
23
|
+
/** ID of the user to which the notification is being sent */
|
|
24
|
+
uid?: string;
|
|
24
25
|
/** Step number in the workflow for which the notification is being created */
|
|
25
26
|
stepNumber: number;
|
|
26
27
|
/** Status of the notification */
|
|
27
28
|
status: NotificationStatus;
|
|
29
|
+
/** Data to be used for the notification */
|
|
30
|
+
data: NotificationStepData;
|
|
28
31
|
};
|
|
29
32
|
export type NotificationDto = NotificationUpsertDto & BaseDto;
|
|
@@ -48,5 +48,11 @@ export type SaasComponentUpsertDto = ChangeAwareUpsertDto & {
|
|
|
48
48
|
extKey: string;
|
|
49
49
|
/** Component display value */
|
|
50
50
|
displayValue: string;
|
|
51
|
+
/**
|
|
52
|
+
* Used as the naive implementation of notification schedules inside Flows.
|
|
53
|
+
* "Resets" notifications schedule after pause or failed verification.
|
|
54
|
+
* Defaults to "NOW".
|
|
55
|
+
*/
|
|
56
|
+
nextNotificationAfter?: string;
|
|
51
57
|
};
|
|
52
58
|
export type SaasComponentDto = ChangeAwareDto & SaasComponentUpsertDto;
|
|
@@ -37,5 +37,11 @@ export type UserUpsertDto = ChangeAwareUpsertDto & {
|
|
|
37
37
|
riskContributors: RiskContributorUpsertDto[];
|
|
38
38
|
/** Health score associated with the user */
|
|
39
39
|
score?: number;
|
|
40
|
+
/**
|
|
41
|
+
* Used as the naive implementation of notification schedules inside Flows.
|
|
42
|
+
* "Resets" notifications schedule after pause or failed verification.
|
|
43
|
+
* Defaults to "NOW".
|
|
44
|
+
*/
|
|
45
|
+
nextNotificationAfter?: string;
|
|
40
46
|
};
|
|
41
47
|
export type UserDto = ChangeAwareDto & UserUpsertDto;
|
|
@@ -3,27 +3,31 @@ import { WorkflowStepType } from './enums/workflowStep.type';
|
|
|
3
3
|
import { WorkflowTriggerType } from './enums/workflowTrigger.type';
|
|
4
4
|
export type NotificationStepData = {
|
|
5
5
|
/** Name of the device to which the notification of finding applies */
|
|
6
|
-
deviceName
|
|
7
|
-
/**
|
|
8
|
-
|
|
9
|
-
/** Due date associated with the finding */
|
|
10
|
-
dueDate?: string;
|
|
6
|
+
deviceName: string;
|
|
7
|
+
/** Estimated time to remediate the finding, in minutes */
|
|
8
|
+
duration: number;
|
|
11
9
|
/** Name of the software to which the finding applies */
|
|
12
10
|
softwareName: string;
|
|
13
11
|
};
|
|
12
|
+
export type TrainingNotificationStepData = NotificationStepData & {
|
|
13
|
+
/** Name of the training module */
|
|
14
|
+
title: string;
|
|
15
|
+
/** Description of the training module */
|
|
16
|
+
description: string;
|
|
17
|
+
/** Due date associated with the training module */
|
|
18
|
+
dueDate: string;
|
|
19
|
+
};
|
|
14
20
|
export type PauseStepData = {
|
|
15
21
|
/** Estimated duration, in minutes, to resolve the finding */
|
|
16
22
|
duration: number;
|
|
17
23
|
};
|
|
18
24
|
export type WorkflowStep = {
|
|
19
|
-
/** Number of the step in the workflow */
|
|
20
|
-
stepNumber: number;
|
|
21
25
|
/** Type of the notification step, either NOTIFICATION or PAUSE */
|
|
22
26
|
type: WorkflowStepType;
|
|
23
27
|
/** ID of the template to be used for the notification */
|
|
24
28
|
templateId?: string;
|
|
25
29
|
/** Data associated with the notification step */
|
|
26
|
-
data: NotificationStepData | PauseStepData;
|
|
30
|
+
data: NotificationStepData | TrainingNotificationStepData | PauseStepData;
|
|
27
31
|
/** Step number to transition the workflow to on success */
|
|
28
32
|
successStepNumber: number | null;
|
|
29
33
|
/** Step number to transition the workflow to on failure */
|
|
@@ -31,6 +35,9 @@ export type WorkflowStep = {
|
|
|
31
35
|
/** Duration, in days, to wait before executing the next step in the workflow */
|
|
32
36
|
pauseDuration?: number | null;
|
|
33
37
|
};
|
|
38
|
+
export type WorkflowSteps = {
|
|
39
|
+
[propName: number]: WorkflowStep;
|
|
40
|
+
};
|
|
34
41
|
export type WorkflowTriggerRule = {
|
|
35
42
|
[propName: string]: string | number | boolean | null | {
|
|
36
43
|
[propName: string]: string | number | boolean | WorkflowTriggerRule;
|
|
@@ -50,7 +57,7 @@ export type WorkflowUpsertDto = {
|
|
|
50
57
|
/** Trigger that begins execution of the workflow */
|
|
51
58
|
trigger: WorkflowTrigger;
|
|
52
59
|
/** Steps in the workflow */
|
|
53
|
-
steps
|
|
60
|
+
steps: WorkflowSteps;
|
|
54
61
|
};
|
|
55
62
|
export type WorkflowDto = BaseDto & WorkflowUpsertDto;
|
|
56
63
|
export type WorkflowProgressUpsertDto = {
|
|
@@ -59,7 +66,7 @@ export type WorkflowProgressUpsertDto = {
|
|
|
59
66
|
/** ID of the finding for which the workflow is being executed */
|
|
60
67
|
fid?: string | null;
|
|
61
68
|
/** Step number to transition the workflow to next */
|
|
62
|
-
nextStep: number;
|
|
69
|
+
nextStep: number | null;
|
|
63
70
|
/** ID of the user for which the workflow is being executed */
|
|
64
71
|
uid: string;
|
|
65
72
|
/** whether or not this instance of the workflow has been completed */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/services/constants.ts"],"names":[],"mappings":";;;AAIa,QAAA,2BAA2B,GAAG,CAAC,CAAC;AAGhC,QAAA,mBAAmB,GAAc,UAAU,CAAC;AAC5C,QAAA,gBAAgB,GAAc,KAAK,CAAC;AACpC,QAAA,iBAAiB,GAAc,KAAK,CAAC;AAErC,QAAA,I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AmB;CACvC,CAAC;AAEW,QAAA,OAAO,GAAG;IACrB,YAAY,EAAE,cAAc;IAC5B,yBAAyB,EAAE,qCAAqC;IAChE,yBAAyB,EAAE,qCAAqC;IAChE,gBAAgB,EAAE,kBAAkB;IACpC,iBAAiB,EAAE,mBAAmB;IACtC,qBAAqB,EAAE,uBAAuB;IAC9C,2BAA2B,EAAE,6BAA6B;IAC1D,YAAY,EAAE,0BAA0B;IACxC,qBAAqB,EAAE,uBAAuB;IAC9C,gBAAgB,EAAE,kBAAkB;IACpC,WAAW,EAAE,aAAa;IAC1B,mBAAmB;IACnB,kBAAkB,EAAE,sBAAsB;CAC3C,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {BaseDto, BaseUpsertDto} from './base.dto';
|
|
2
2
|
import {NotificationStatus} from './enums';
|
|
3
|
+
import {NotificationStepData} from './workflow.dto';
|
|
3
4
|
|
|
4
5
|
export type NotificationAddress = {
|
|
5
6
|
/** Connector ID for the notification channel */
|
|
@@ -21,12 +22,14 @@ export type NotificationUpsertDto = BaseUpsertDto & {
|
|
|
21
22
|
to: NotificationAddress;
|
|
22
23
|
/** ID of the template to use for the notification */
|
|
23
24
|
templateId: string;
|
|
24
|
-
/** ID
|
|
25
|
-
uid
|
|
25
|
+
/** ID of the user to which the notification is being sent */
|
|
26
|
+
uid?: string;
|
|
26
27
|
/** Step number in the workflow for which the notification is being created */
|
|
27
28
|
stepNumber: number;
|
|
28
29
|
/** Status of the notification */
|
|
29
30
|
status: NotificationStatus;
|
|
31
|
+
/** Data to be used for the notification */
|
|
32
|
+
data: NotificationStepData;
|
|
30
33
|
};
|
|
31
34
|
|
|
32
35
|
export type NotificationDto = NotificationUpsertDto & BaseDto;
|
|
@@ -50,6 +50,12 @@ export type SaasComponentUpsertDto = ChangeAwareUpsertDto & {
|
|
|
50
50
|
extKey: string;
|
|
51
51
|
/** Component display value */
|
|
52
52
|
displayValue: string;
|
|
53
|
+
/**
|
|
54
|
+
* Used as the naive implementation of notification schedules inside Flows.
|
|
55
|
+
* "Resets" notifications schedule after pause or failed verification.
|
|
56
|
+
* Defaults to "NOW".
|
|
57
|
+
*/
|
|
58
|
+
nextNotificationAfter?: string;
|
|
53
59
|
};
|
|
54
60
|
|
|
55
61
|
export type SaasComponentDto = ChangeAwareDto & SaasComponentUpsertDto;
|
package/src/dto/users.dto.ts
CHANGED
|
@@ -39,6 +39,12 @@ export type UserUpsertDto = ChangeAwareUpsertDto & {
|
|
|
39
39
|
riskContributors: RiskContributorUpsertDto[];
|
|
40
40
|
/** Health score associated with the user */
|
|
41
41
|
score?: number;
|
|
42
|
+
/**
|
|
43
|
+
* Used as the naive implementation of notification schedules inside Flows.
|
|
44
|
+
* "Resets" notifications schedule after pause or failed verification.
|
|
45
|
+
* Defaults to "NOW".
|
|
46
|
+
*/
|
|
47
|
+
nextNotificationAfter?: string;
|
|
42
48
|
};
|
|
43
49
|
|
|
44
50
|
export type UserDto = ChangeAwareDto & UserUpsertDto;
|
package/src/dto/workflow.dto.ts
CHANGED
|
@@ -4,29 +4,34 @@ import {WorkflowTriggerType} from './enums/workflowTrigger.type';
|
|
|
4
4
|
|
|
5
5
|
export type NotificationStepData = {
|
|
6
6
|
/** Name of the device to which the notification of finding applies */
|
|
7
|
-
deviceName
|
|
8
|
-
/**
|
|
9
|
-
|
|
10
|
-
/** Due date associated with the finding */
|
|
11
|
-
dueDate?: string;
|
|
7
|
+
deviceName: string;
|
|
8
|
+
/** Estimated time to remediate the finding, in minutes */
|
|
9
|
+
duration: number;
|
|
12
10
|
/** Name of the software to which the finding applies */
|
|
13
11
|
softwareName: string;
|
|
14
12
|
};
|
|
15
13
|
|
|
14
|
+
export type TrainingNotificationStepData = NotificationStepData & {
|
|
15
|
+
/** Name of the training module */
|
|
16
|
+
title: string;
|
|
17
|
+
/** Description of the training module */
|
|
18
|
+
description: string;
|
|
19
|
+
/** Due date associated with the training module */
|
|
20
|
+
dueDate: string;
|
|
21
|
+
};
|
|
22
|
+
|
|
16
23
|
export type PauseStepData = {
|
|
17
24
|
/** Estimated duration, in minutes, to resolve the finding */
|
|
18
25
|
duration: number;
|
|
19
26
|
};
|
|
20
27
|
|
|
21
28
|
export type WorkflowStep = {
|
|
22
|
-
/** Number of the step in the workflow */
|
|
23
|
-
stepNumber: number;
|
|
24
29
|
/** Type of the notification step, either NOTIFICATION or PAUSE */
|
|
25
30
|
type: WorkflowStepType;
|
|
26
31
|
/** ID of the template to be used for the notification */
|
|
27
32
|
templateId?: string;
|
|
28
33
|
/** Data associated with the notification step */
|
|
29
|
-
data: NotificationStepData | PauseStepData;
|
|
34
|
+
data: NotificationStepData | TrainingNotificationStepData | PauseStepData;
|
|
30
35
|
/** Step number to transition the workflow to on success */
|
|
31
36
|
successStepNumber: number | null;
|
|
32
37
|
/** Step number to transition the workflow to on failure */
|
|
@@ -35,6 +40,10 @@ export type WorkflowStep = {
|
|
|
35
40
|
pauseDuration?: number | null;
|
|
36
41
|
};
|
|
37
42
|
|
|
43
|
+
export type WorkflowSteps = {
|
|
44
|
+
[propName: number]: WorkflowStep;
|
|
45
|
+
};
|
|
46
|
+
|
|
38
47
|
export type WorkflowTriggerRule = {
|
|
39
48
|
[propName: string]:
|
|
40
49
|
| string
|
|
@@ -62,7 +71,7 @@ export type WorkflowUpsertDto = {
|
|
|
62
71
|
/** Trigger that begins execution of the workflow */
|
|
63
72
|
trigger: WorkflowTrigger;
|
|
64
73
|
/** Steps in the workflow */
|
|
65
|
-
steps
|
|
74
|
+
steps: WorkflowSteps;
|
|
66
75
|
};
|
|
67
76
|
|
|
68
77
|
export type WorkflowDto = BaseDto & WorkflowUpsertDto;
|
|
@@ -73,7 +82,7 @@ export type WorkflowProgressUpsertDto = {
|
|
|
73
82
|
/** ID of the finding for which the workflow is being executed */
|
|
74
83
|
fid?: string | null;
|
|
75
84
|
/** Step number to transition the workflow to next */
|
|
76
|
-
nextStep: number;
|
|
85
|
+
nextStep: number | null;
|
|
77
86
|
/** ID of the user for which the workflow is being executed */
|
|
78
87
|
uid: string;
|
|
79
88
|
/** whether or not this instance of the workflow has been completed */
|