@ampsec/platform-client 12.2.0 → 13.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/enums/agent.role.d.ts +4 -0
- package/build/src/dto/enums/agent.role.js +13 -5
- package/build/src/dto/enums/agent.role.js.map +1 -1
- package/build/src/dto/findings.dto.d.ts +2 -0
- package/package.json +1 -1
- package/src/dto/enums/agent.role.ts +13 -5
- package/src/dto/findings.dto.ts +2 -0
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export declare enum AgentRole {
|
|
2
|
+
/** Agent can only read data. */
|
|
3
|
+
REPORT_VIEWER = "REPORT_VIEWER",
|
|
2
4
|
/** Agent can only read data. */
|
|
3
5
|
VIEWER = "VIEWER",
|
|
4
6
|
/** Agent can read and write data. */
|
|
@@ -7,6 +9,8 @@ export declare enum AgentRole {
|
|
|
7
9
|
ADMIN = "ADMIN",
|
|
8
10
|
/** Agent owns organization. */
|
|
9
11
|
OWNER = "OWNER",
|
|
12
|
+
/** Token belongs to an operator. */
|
|
13
|
+
OPERATOR = "OPERATOR",
|
|
10
14
|
/** Token belongs to a service account. */
|
|
11
15
|
SERVICE_ACCOUNT = "SERVICE_ACCOUNT",
|
|
12
16
|
/** Unknown role. Used for validation */
|
|
@@ -4,6 +4,8 @@ exports.lookupAgentRoleOrdinal = exports.lookupAgentRole = exports.AgentRole = v
|
|
|
4
4
|
/* eslint-disable no-unused-vars */
|
|
5
5
|
var AgentRole;
|
|
6
6
|
(function (AgentRole) {
|
|
7
|
+
/** Agent can only read data. */
|
|
8
|
+
AgentRole["REPORT_VIEWER"] = "REPORT_VIEWER";
|
|
7
9
|
/** Agent can only read data. */
|
|
8
10
|
AgentRole["VIEWER"] = "VIEWER";
|
|
9
11
|
/** Agent can read and write data. */
|
|
@@ -12,16 +14,20 @@ var AgentRole;
|
|
|
12
14
|
AgentRole["ADMIN"] = "ADMIN";
|
|
13
15
|
/** Agent owns organization. */
|
|
14
16
|
AgentRole["OWNER"] = "OWNER";
|
|
17
|
+
/** Token belongs to an operator. */
|
|
18
|
+
AgentRole["OPERATOR"] = "OPERATOR";
|
|
15
19
|
/** Token belongs to a service account. */
|
|
16
20
|
AgentRole["SERVICE_ACCOUNT"] = "SERVICE_ACCOUNT";
|
|
17
21
|
/** Unknown role. Used for validation */
|
|
18
22
|
AgentRole["UNKNOWN"] = "UNKNOWN";
|
|
19
23
|
})(AgentRole = exports.AgentRole || (exports.AgentRole = {}));
|
|
20
24
|
const agentRoleLookupMap = {
|
|
25
|
+
REPORT_VIEWER: AgentRole.REPORT_VIEWER,
|
|
21
26
|
VIEWER: AgentRole.VIEWER,
|
|
22
27
|
AGENT: AgentRole.AGENT,
|
|
23
28
|
ADMIN: AgentRole.ADMIN,
|
|
24
29
|
OWNER: AgentRole.OWNER,
|
|
30
|
+
OPERATOR: AgentRole.OPERATOR,
|
|
25
31
|
SERVICE_ACCOUNT: AgentRole.SERVICE_ACCOUNT,
|
|
26
32
|
};
|
|
27
33
|
function lookupAgentRole(role) {
|
|
@@ -30,11 +36,13 @@ function lookupAgentRole(role) {
|
|
|
30
36
|
exports.lookupAgentRole = lookupAgentRole;
|
|
31
37
|
const UNKNOWN_ORDINAL = -99;
|
|
32
38
|
const agentRoleOrdinalMap = new Map([
|
|
33
|
-
[AgentRole.
|
|
34
|
-
[AgentRole.
|
|
35
|
-
[AgentRole.
|
|
36
|
-
[AgentRole.
|
|
37
|
-
[AgentRole.
|
|
39
|
+
[AgentRole.REPORT_VIEWER, 0],
|
|
40
|
+
[AgentRole.VIEWER, 1],
|
|
41
|
+
[AgentRole.AGENT, 2],
|
|
42
|
+
[AgentRole.ADMIN, 3],
|
|
43
|
+
[AgentRole.OWNER, 4],
|
|
44
|
+
[AgentRole.OPERATOR, 5],
|
|
45
|
+
[AgentRole.SERVICE_ACCOUNT, 6],
|
|
38
46
|
[AgentRole.UNKNOWN, UNKNOWN_ORDINAL],
|
|
39
47
|
]);
|
|
40
48
|
function lookupAgentRoleOrdinal(role) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.role.js","sourceRoot":"","sources":["../../../../src/dto/enums/agent.role.ts"],"names":[],"mappings":";;;AAAA,mCAAmC;AACnC,IAAY,
|
|
1
|
+
{"version":3,"file":"agent.role.js","sourceRoot":"","sources":["../../../../src/dto/enums/agent.role.ts"],"names":[],"mappings":";;;AAAA,mCAAmC;AACnC,IAAY,SAiBX;AAjBD,WAAY,SAAS;IACnB,gCAAgC;IAChC,4CAA+B,CAAA;IAC/B,gCAAgC;IAChC,8BAAiB,CAAA;IACjB,qCAAqC;IACrC,4BAAe,CAAA;IACf,6DAA6D;IAC7D,4BAAe,CAAA;IACf,+BAA+B;IAC/B,4BAAe,CAAA;IACf,oCAAoC;IACpC,kCAAqB,CAAA;IACrB,0CAA0C;IAC1C,gDAAmC,CAAA;IACnC,wCAAwC;IACxC,gCAAmB,CAAA;AACrB,CAAC,EAjBW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAiBpB;AAED,MAAM,kBAAkB,GAA+B;IACrD,aAAa,EAAE,SAAS,CAAC,aAAa;IACtC,MAAM,EAAE,SAAS,CAAC,MAAM;IACxB,KAAK,EAAE,SAAS,CAAC,KAAK;IACtB,KAAK,EAAE,SAAS,CAAC,KAAK;IACtB,KAAK,EAAE,SAAS,CAAC,KAAK;IACtB,QAAQ,EAAE,SAAS,CAAC,QAAQ;IAC5B,eAAe,EAAE,SAAS,CAAC,eAAe;CAC3C,CAAC;AAEF,SAAgB,eAAe,CAAC,IAAY;IAC1C,OAAO,kBAAkB,CAAC,IAAI,CAAC,IAAI,SAAS,CAAC,OAAO,CAAC;AACvD,CAAC;AAFD,0CAEC;AAED,MAAM,eAAe,GAAG,CAAC,EAAE,CAAC;AAC5B,MAAM,mBAAmB,GAA2B,IAAI,GAAG,CAAC;IAC1D,CAAC,SAAS,CAAC,aAAa,EAAE,CAAC,CAAC;IAC5B,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC,CAAC;IACrB,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC,CAAC;IACpB,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC,CAAC;IACpB,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC,CAAC;IACpB,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC,CAAC;IACvB,CAAC,SAAS,CAAC,eAAe,EAAE,CAAC,CAAC;IAC9B,CAAC,SAAS,CAAC,OAAO,EAAE,eAAe,CAAC;CACrC,CAAC,CAAC;AAEH,SAAgB,sBAAsB,CAAC,IAAY;IACjD,OAAO,mBAAmB,CAAC,GAAG,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,IAAI,eAAe,CAAC;AAC3E,CAAC;AAFD,wDAEC"}
|
|
@@ -4,6 +4,8 @@ import { FindingStatus } from './enums/finding.status';
|
|
|
4
4
|
export type FindingUpsertDto = BaseUpsertDto & {
|
|
5
5
|
/** Date the finding was closed */
|
|
6
6
|
closedAt?: string;
|
|
7
|
+
/** Category of finding */
|
|
8
|
+
category: string;
|
|
7
9
|
/** Type of finding */
|
|
8
10
|
kind: string;
|
|
9
11
|
/** Status of the finding, e.g. OPEN */
|
package/package.json
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/* eslint-disable no-unused-vars */
|
|
2
2
|
export enum AgentRole {
|
|
3
|
+
/** Agent can only read data. */
|
|
4
|
+
REPORT_VIEWER = 'REPORT_VIEWER',
|
|
3
5
|
/** Agent can only read data. */
|
|
4
6
|
VIEWER = 'VIEWER',
|
|
5
7
|
/** Agent can read and write data. */
|
|
@@ -8,6 +10,8 @@ export enum AgentRole {
|
|
|
8
10
|
ADMIN = 'ADMIN',
|
|
9
11
|
/** Agent owns organization. */
|
|
10
12
|
OWNER = 'OWNER',
|
|
13
|
+
/** Token belongs to an operator. */
|
|
14
|
+
OPERATOR = 'OPERATOR',
|
|
11
15
|
/** Token belongs to a service account. */
|
|
12
16
|
SERVICE_ACCOUNT = 'SERVICE_ACCOUNT',
|
|
13
17
|
/** Unknown role. Used for validation */
|
|
@@ -15,10 +19,12 @@ export enum AgentRole {
|
|
|
15
19
|
}
|
|
16
20
|
|
|
17
21
|
const agentRoleLookupMap: {[key: string]: AgentRole} = {
|
|
22
|
+
REPORT_VIEWER: AgentRole.REPORT_VIEWER,
|
|
18
23
|
VIEWER: AgentRole.VIEWER,
|
|
19
24
|
AGENT: AgentRole.AGENT,
|
|
20
25
|
ADMIN: AgentRole.ADMIN,
|
|
21
26
|
OWNER: AgentRole.OWNER,
|
|
27
|
+
OPERATOR: AgentRole.OPERATOR,
|
|
22
28
|
SERVICE_ACCOUNT: AgentRole.SERVICE_ACCOUNT,
|
|
23
29
|
};
|
|
24
30
|
|
|
@@ -28,11 +34,13 @@ export function lookupAgentRole(role: string): AgentRole {
|
|
|
28
34
|
|
|
29
35
|
const UNKNOWN_ORDINAL = -99;
|
|
30
36
|
const agentRoleOrdinalMap: Map<AgentRole, number> = new Map([
|
|
31
|
-
[AgentRole.
|
|
32
|
-
[AgentRole.
|
|
33
|
-
[AgentRole.
|
|
34
|
-
[AgentRole.
|
|
35
|
-
[AgentRole.
|
|
37
|
+
[AgentRole.REPORT_VIEWER, 0],
|
|
38
|
+
[AgentRole.VIEWER, 1],
|
|
39
|
+
[AgentRole.AGENT, 2],
|
|
40
|
+
[AgentRole.ADMIN, 3],
|
|
41
|
+
[AgentRole.OWNER, 4],
|
|
42
|
+
[AgentRole.OPERATOR, 5],
|
|
43
|
+
[AgentRole.SERVICE_ACCOUNT, 6],
|
|
36
44
|
[AgentRole.UNKNOWN, UNKNOWN_ORDINAL],
|
|
37
45
|
]);
|
|
38
46
|
|
package/src/dto/findings.dto.ts
CHANGED
|
@@ -5,6 +5,8 @@ import {FindingStatus} from './enums/finding.status';
|
|
|
5
5
|
export type FindingUpsertDto = BaseUpsertDto & {
|
|
6
6
|
/** Date the finding was closed */
|
|
7
7
|
closedAt?: string;
|
|
8
|
+
/** Category of finding */
|
|
9
|
+
category: string;
|
|
8
10
|
/** Type of finding */
|
|
9
11
|
kind: string;
|
|
10
12
|
/** Status of the finding, e.g. OPEN */
|