@ampsec/platform-client 36.0.0 → 37.1.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/constants.d.ts +65 -0
- package/build/src/dto/constants.js +69 -0
- package/build/src/dto/constants.js.map +1 -0
- package/build/src/dto/enums/index.d.ts +1 -1
- package/build/src/dto/enums/index.js +1 -1
- package/build/src/dto/enums/index.js.map +1 -1
- package/build/src/dto/enums/{notification.strategy.d.ts → notification.kind.d.ts} +1 -1
- package/build/src/dto/enums/notification.kind.js +11 -0
- package/build/src/dto/enums/notification.kind.js.map +1 -0
- package/build/src/dto/index.d.ts +1 -0
- package/build/src/dto/index.js +1 -0
- package/build/src/dto/index.js.map +1 -1
- package/build/src/dto/notification.dto.d.ts +6 -7
- package/build/src/dto/workflow.dto.d.ts +5 -2
- package/package.json +1 -1
- package/src/dto/constants.ts +71 -0
- package/src/dto/enums/index.ts +1 -1
- package/src/dto/enums/{notification.strategy.ts → notification.kind.ts} +1 -1
- package/src/dto/index.ts +1 -0
- package/src/dto/notification.dto.ts +6 -8
- package/src/dto/workflow.dto.ts +5 -2
- package/build/src/dto/enums/notification.strategy.js +0 -11
- package/build/src/dto/enums/notification.strategy.js.map +0 -1
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { AuthRole } from './enums';
|
|
2
|
+
/**
|
|
3
|
+
** /=====================\
|
|
4
|
+
** |== AGENT API ROLES ==|
|
|
5
|
+
** \=====================/
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* This is the set of roles that can be used to manage user access for a tenant in the agent API.
|
|
9
|
+
*
|
|
10
|
+
* Includes: [{@link AuthRole.OWNER}]
|
|
11
|
+
* @type {Set<AuthRole>}
|
|
12
|
+
*/
|
|
13
|
+
export declare const AGENT_OWNER_ROLES: Set<AuthRole>;
|
|
14
|
+
/**
|
|
15
|
+
* This is the set of roles that can be used to administer a tenant in the agent API.
|
|
16
|
+
*
|
|
17
|
+
* Includes: [{@link AuthRole.ADMIN} {@link AuthRole.OWNER}]
|
|
18
|
+
* @type {Set<AuthRole>}
|
|
19
|
+
*/
|
|
20
|
+
export declare const AGENT_ADMIN_ROLES: Set<AuthRole>;
|
|
21
|
+
/**
|
|
22
|
+
* This is the set of roles that can be used to view tenant data in the agent API.
|
|
23
|
+
*
|
|
24
|
+
* Includes: [{@link AuthRole.VIEWER}, {@link AuthRole.AGENT}, {@link AuthRole.ADMIN}, {@link AuthRole.OWNER}]
|
|
25
|
+
* @type {Set<AuthRole>}
|
|
26
|
+
*/
|
|
27
|
+
export declare const AGENT_VIEWER_ROLES: Set<AuthRole>;
|
|
28
|
+
/**
|
|
29
|
+
* This is the set of roles that can be used to view tenant data summaries in the agent API.
|
|
30
|
+
*
|
|
31
|
+
* Includes: [{@link AuthRole.REPORT_VIEWER}, {@link AuthRole.VIEWER}, {@link AuthRole.AGENT}, {@link AuthRole.ADMIN}, {@link AuthRole.OWNER}]
|
|
32
|
+
* @type {Set<AuthRole>}
|
|
33
|
+
*/
|
|
34
|
+
export declare const AGENT_REPORT_VIEWER_ROLES: Set<AuthRole>;
|
|
35
|
+
/**
|
|
36
|
+
** /==========================\
|
|
37
|
+
** |== ENGAGEMENT API ROLES ==|
|
|
38
|
+
** \==========================/
|
|
39
|
+
*/
|
|
40
|
+
/**
|
|
41
|
+
* This is the set of roles that can be used by an end user in the engagement API.
|
|
42
|
+
*
|
|
43
|
+
* Includes: [{@link AuthRole.USER}]
|
|
44
|
+
* @type {Set<AuthRole>}
|
|
45
|
+
*/
|
|
46
|
+
export declare const ENGAGEMENT_END_USER_ROLES: Set<AuthRole>;
|
|
47
|
+
/**
|
|
48
|
+
** /========================\
|
|
49
|
+
** |== PLATFORM API ROLES ==|
|
|
50
|
+
** \========================/
|
|
51
|
+
*/
|
|
52
|
+
/**
|
|
53
|
+
* This is the set of roles that can be used by Amplifier Employees to view data in the Platform API.
|
|
54
|
+
*
|
|
55
|
+
* Includes: [{@link AuthRole.CUSTOMER_SUCCESS}, {@link AuthRole.SUPPORT}, {@link AuthRole.OPERATOR}, {@link AuthRole.SERVICE_ACCOUNT}]
|
|
56
|
+
* @type {Set<AuthRole>}
|
|
57
|
+
*/
|
|
58
|
+
export declare const PLATFORM_READ_ONLY_ROLES: Set<AuthRole>;
|
|
59
|
+
/**
|
|
60
|
+
* This is the set of roles that can be used by Amplifier Employees to view data in the Platform API.
|
|
61
|
+
*
|
|
62
|
+
* Includes: [{@link AuthRole.CUSTOMER_SUCCESS}, {@link AuthRole.SUPPORT}, {@link AuthRole.OPERATOR}, {@link AuthRole.SERVICE_ACCOUNT}]
|
|
63
|
+
* @type {Set<AuthRole>}
|
|
64
|
+
*/
|
|
65
|
+
export declare const PLATFORM_READ_WRITE_ROLES: Set<AuthRole>;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PLATFORM_READ_WRITE_ROLES = exports.PLATFORM_READ_ONLY_ROLES = exports.ENGAGEMENT_END_USER_ROLES = exports.AGENT_REPORT_VIEWER_ROLES = exports.AGENT_VIEWER_ROLES = exports.AGENT_ADMIN_ROLES = exports.AGENT_OWNER_ROLES = void 0;
|
|
4
|
+
const enums_1 = require("./enums");
|
|
5
|
+
/**
|
|
6
|
+
** /=====================\
|
|
7
|
+
** |== AGENT API ROLES ==|
|
|
8
|
+
** \=====================/
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* This is the set of roles that can be used to manage user access for a tenant in the agent API.
|
|
12
|
+
*
|
|
13
|
+
* Includes: [{@link AuthRole.OWNER}]
|
|
14
|
+
* @type {Set<AuthRole>}
|
|
15
|
+
*/
|
|
16
|
+
exports.AGENT_OWNER_ROLES = new Set([enums_1.AuthRole.OWNER]);
|
|
17
|
+
/**
|
|
18
|
+
* This is the set of roles that can be used to administer a tenant in the agent API.
|
|
19
|
+
*
|
|
20
|
+
* Includes: [{@link AuthRole.ADMIN} {@link AuthRole.OWNER}]
|
|
21
|
+
* @type {Set<AuthRole>}
|
|
22
|
+
*/
|
|
23
|
+
exports.AGENT_ADMIN_ROLES = new Set([enums_1.AuthRole.ADMIN, enums_1.AuthRole.OWNER]);
|
|
24
|
+
/**
|
|
25
|
+
* This is the set of roles that can be used to view tenant data in the agent API.
|
|
26
|
+
*
|
|
27
|
+
* Includes: [{@link AuthRole.VIEWER}, {@link AuthRole.AGENT}, {@link AuthRole.ADMIN}, {@link AuthRole.OWNER}]
|
|
28
|
+
* @type {Set<AuthRole>}
|
|
29
|
+
*/
|
|
30
|
+
exports.AGENT_VIEWER_ROLES = new Set([enums_1.AuthRole.VIEWER, enums_1.AuthRole.AGENT, enums_1.AuthRole.ADMIN, enums_1.AuthRole.OWNER]);
|
|
31
|
+
/**
|
|
32
|
+
* This is the set of roles that can be used to view tenant data summaries in the agent API.
|
|
33
|
+
*
|
|
34
|
+
* Includes: [{@link AuthRole.REPORT_VIEWER}, {@link AuthRole.VIEWER}, {@link AuthRole.AGENT}, {@link AuthRole.ADMIN}, {@link AuthRole.OWNER}]
|
|
35
|
+
* @type {Set<AuthRole>}
|
|
36
|
+
*/
|
|
37
|
+
exports.AGENT_REPORT_VIEWER_ROLES = new Set([enums_1.AuthRole.REPORT_VIEWER, enums_1.AuthRole.VIEWER, enums_1.AuthRole.AGENT, enums_1.AuthRole.ADMIN, enums_1.AuthRole.OWNER]);
|
|
38
|
+
/**
|
|
39
|
+
** /==========================\
|
|
40
|
+
** |== ENGAGEMENT API ROLES ==|
|
|
41
|
+
** \==========================/
|
|
42
|
+
*/
|
|
43
|
+
/**
|
|
44
|
+
* This is the set of roles that can be used by an end user in the engagement API.
|
|
45
|
+
*
|
|
46
|
+
* Includes: [{@link AuthRole.USER}]
|
|
47
|
+
* @type {Set<AuthRole>}
|
|
48
|
+
*/
|
|
49
|
+
exports.ENGAGEMENT_END_USER_ROLES = new Set([enums_1.AuthRole.USER]);
|
|
50
|
+
/**
|
|
51
|
+
** /========================\
|
|
52
|
+
** |== PLATFORM API ROLES ==|
|
|
53
|
+
** \========================/
|
|
54
|
+
*/
|
|
55
|
+
/**
|
|
56
|
+
* This is the set of roles that can be used by Amplifier Employees to view data in the Platform API.
|
|
57
|
+
*
|
|
58
|
+
* Includes: [{@link AuthRole.CUSTOMER_SUCCESS}, {@link AuthRole.SUPPORT}, {@link AuthRole.OPERATOR}, {@link AuthRole.SERVICE_ACCOUNT}]
|
|
59
|
+
* @type {Set<AuthRole>}
|
|
60
|
+
*/
|
|
61
|
+
exports.PLATFORM_READ_ONLY_ROLES = new Set([enums_1.AuthRole.CUSTOMER_SUCCESS, enums_1.AuthRole.SUPPORT, enums_1.AuthRole.OPERATOR, enums_1.AuthRole.SERVICE_ACCOUNT]);
|
|
62
|
+
/**
|
|
63
|
+
* This is the set of roles that can be used by Amplifier Employees to view data in the Platform API.
|
|
64
|
+
*
|
|
65
|
+
* Includes: [{@link AuthRole.CUSTOMER_SUCCESS}, {@link AuthRole.SUPPORT}, {@link AuthRole.OPERATOR}, {@link AuthRole.SERVICE_ACCOUNT}]
|
|
66
|
+
* @type {Set<AuthRole>}
|
|
67
|
+
*/
|
|
68
|
+
exports.PLATFORM_READ_WRITE_ROLES = new Set([enums_1.AuthRole.OPERATOR, enums_1.AuthRole.SERVICE_ACCOUNT]);
|
|
69
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/dto/constants.ts"],"names":[],"mappings":";;;AAAA,mCAAiC;AAEjC;;;;GAIG;AAEH;;;;;GAKG;AACU,QAAA,iBAAiB,GAAG,IAAI,GAAG,CAAW,CAAC,gBAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;AACrE;;;;;GAKG;AACU,QAAA,iBAAiB,GAAG,IAAI,GAAG,CAAW,CAAC,gBAAQ,CAAC,KAAK,EAAE,gBAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;AACrF;;;;;GAKG;AACU,QAAA,kBAAkB,GAAG,IAAI,GAAG,CAAW,CAAC,gBAAQ,CAAC,MAAM,EAAE,gBAAQ,CAAC,KAAK,EAAE,gBAAQ,CAAC,KAAK,EAAE,gBAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;AACvH;;;;;GAKG;AACU,QAAA,yBAAyB,GAAG,IAAI,GAAG,CAAW,CAAC,gBAAQ,CAAC,aAAa,EAAE,gBAAQ,CAAC,MAAM,EAAE,gBAAQ,CAAC,KAAK,EAAE,gBAAQ,CAAC,KAAK,EAAE,gBAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;AAEtJ;;;;GAIG;AAEH;;;;;GAKG;AACU,QAAA,yBAAyB,GAAG,IAAI,GAAG,CAAW,CAAC,gBAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;AAE5E;;;;GAIG;AAEH;;;;;GAKG;AACU,QAAA,wBAAwB,GAAG,IAAI,GAAG,CAAW,CAAC,gBAAQ,CAAC,gBAAgB,EAAE,gBAAQ,CAAC,OAAO,EAAE,gBAAQ,CAAC,QAAQ,EAAE,gBAAQ,CAAC,eAAe,CAAC,CAAC,CAAC;AACtJ;;;;;GAKG;AACU,QAAA,yBAAyB,GAAG,IAAI,GAAG,CAAW,CAAC,gBAAQ,CAAC,QAAQ,EAAE,gBAAQ,CAAC,eAAe,CAAC,CAAC,CAAC"}
|
|
@@ -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.
|
|
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,
|
|
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"}
|
|
@@ -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"}
|
package/build/src/dto/index.d.ts
CHANGED
package/build/src/dto/index.js
CHANGED
|
@@ -19,6 +19,7 @@ __exportStar(require("./assets.dto"), exports);
|
|
|
19
19
|
__exportStar(require("./assetKeys"), exports);
|
|
20
20
|
__exportStar(require("./base.dto"), exports);
|
|
21
21
|
__exportStar(require("./connectors.dto"), exports);
|
|
22
|
+
__exportStar(require("./constants"), exports);
|
|
22
23
|
__exportStar(require("./enum.dto"), exports);
|
|
23
24
|
__exportStar(require("./enums"), exports);
|
|
24
25
|
__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,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,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,15 +1,12 @@
|
|
|
1
1
|
import { BaseDto, BaseUpsertDto } from './base.dto';
|
|
2
2
|
import { NotificationStatus } from './enums';
|
|
3
|
-
import {
|
|
3
|
+
import { NotificationKind } from './enums/notification.kind';
|
|
4
4
|
import { NotificationStepData, TrainingNotificationStepData } from './workflow.dto';
|
|
5
|
-
export type
|
|
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 =
|
|
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
|
|
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 {
|
|
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?:
|
|
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
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import {AuthRole} from './enums';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
** /=====================\
|
|
5
|
+
** |== AGENT API ROLES ==|
|
|
6
|
+
** \=====================/
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* This is the set of roles that can be used to manage user access for a tenant in the agent API.
|
|
11
|
+
*
|
|
12
|
+
* Includes: [{@link AuthRole.OWNER}]
|
|
13
|
+
* @type {Set<AuthRole>}
|
|
14
|
+
*/
|
|
15
|
+
export const AGENT_OWNER_ROLES = new Set<AuthRole>([AuthRole.OWNER]);
|
|
16
|
+
/**
|
|
17
|
+
* This is the set of roles that can be used to administer a tenant in the agent API.
|
|
18
|
+
*
|
|
19
|
+
* Includes: [{@link AuthRole.ADMIN} {@link AuthRole.OWNER}]
|
|
20
|
+
* @type {Set<AuthRole>}
|
|
21
|
+
*/
|
|
22
|
+
export const AGENT_ADMIN_ROLES = new Set<AuthRole>([AuthRole.ADMIN, AuthRole.OWNER]);
|
|
23
|
+
/**
|
|
24
|
+
* This is the set of roles that can be used to view tenant data in the agent API.
|
|
25
|
+
*
|
|
26
|
+
* Includes: [{@link AuthRole.VIEWER}, {@link AuthRole.AGENT}, {@link AuthRole.ADMIN}, {@link AuthRole.OWNER}]
|
|
27
|
+
* @type {Set<AuthRole>}
|
|
28
|
+
*/
|
|
29
|
+
export const AGENT_VIEWER_ROLES = new Set<AuthRole>([AuthRole.VIEWER, AuthRole.AGENT, AuthRole.ADMIN, AuthRole.OWNER]);
|
|
30
|
+
/**
|
|
31
|
+
* This is the set of roles that can be used to view tenant data summaries in the agent API.
|
|
32
|
+
*
|
|
33
|
+
* Includes: [{@link AuthRole.REPORT_VIEWER}, {@link AuthRole.VIEWER}, {@link AuthRole.AGENT}, {@link AuthRole.ADMIN}, {@link AuthRole.OWNER}]
|
|
34
|
+
* @type {Set<AuthRole>}
|
|
35
|
+
*/
|
|
36
|
+
export const AGENT_REPORT_VIEWER_ROLES = new Set<AuthRole>([AuthRole.REPORT_VIEWER, AuthRole.VIEWER, AuthRole.AGENT, AuthRole.ADMIN, AuthRole.OWNER]);
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
** /==========================\
|
|
40
|
+
** |== ENGAGEMENT API ROLES ==|
|
|
41
|
+
** \==========================/
|
|
42
|
+
*/
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* This is the set of roles that can be used by an end user in the engagement API.
|
|
46
|
+
*
|
|
47
|
+
* Includes: [{@link AuthRole.USER}]
|
|
48
|
+
* @type {Set<AuthRole>}
|
|
49
|
+
*/
|
|
50
|
+
export const ENGAGEMENT_END_USER_ROLES = new Set<AuthRole>([AuthRole.USER]);
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
** /========================\
|
|
54
|
+
** |== PLATFORM API ROLES ==|
|
|
55
|
+
** \========================/
|
|
56
|
+
*/
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* This is the set of roles that can be used by Amplifier Employees to view data in the Platform API.
|
|
60
|
+
*
|
|
61
|
+
* Includes: [{@link AuthRole.CUSTOMER_SUCCESS}, {@link AuthRole.SUPPORT}, {@link AuthRole.OPERATOR}, {@link AuthRole.SERVICE_ACCOUNT}]
|
|
62
|
+
* @type {Set<AuthRole>}
|
|
63
|
+
*/
|
|
64
|
+
export const PLATFORM_READ_ONLY_ROLES = new Set<AuthRole>([AuthRole.CUSTOMER_SUCCESS, AuthRole.SUPPORT, AuthRole.OPERATOR, AuthRole.SERVICE_ACCOUNT]);
|
|
65
|
+
/**
|
|
66
|
+
* This is the set of roles that can be used by Amplifier Employees to view data in the Platform API.
|
|
67
|
+
*
|
|
68
|
+
* Includes: [{@link AuthRole.CUSTOMER_SUCCESS}, {@link AuthRole.SUPPORT}, {@link AuthRole.OPERATOR}, {@link AuthRole.SERVICE_ACCOUNT}]
|
|
69
|
+
* @type {Set<AuthRole>}
|
|
70
|
+
*/
|
|
71
|
+
export const PLATFORM_READ_WRITE_ROLES = new Set<AuthRole>([AuthRole.OPERATOR, AuthRole.SERVICE_ACCOUNT]);
|
package/src/dto/enums/index.ts
CHANGED
package/src/dto/index.ts
CHANGED
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
import {BaseDto, BaseUpsertDto} from './base.dto';
|
|
2
2
|
import {NotificationStatus} from './enums';
|
|
3
|
-
import {
|
|
3
|
+
import {NotificationKind} from './enums/notification.kind';
|
|
4
4
|
import {NotificationStepData, TrainingNotificationStepData} from './workflow.dto';
|
|
5
5
|
|
|
6
|
-
export type
|
|
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 =
|
|
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
|
|
45
|
+
schema?: RawNotificationSchema | TemplateNotificationSchema;
|
|
48
46
|
};
|
|
49
47
|
|
|
50
48
|
export type NotificationDto = NotificationUpsertDto & BaseDto;
|
package/src/dto/workflow.dto.ts
CHANGED
|
@@ -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 {
|
|
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?:
|
|
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"}
|