@ampsec/platform-client 37.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.
@@ -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"}
@@ -3,6 +3,7 @@ export * from './assets.dto';
3
3
  export * from './assetKeys';
4
4
  export * from './base.dto';
5
5
  export * from './connectors.dto';
6
+ export * from './constants';
6
7
  export * from './enum.dto';
7
8
  export * from './enums';
8
9
  export * from './extKeyMap.dto';
@@ -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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ampsec/platform-client",
3
- "version": "37.0.0",
3
+ "version": "37.1.0",
4
4
  "description": "",
5
5
  "main": "build/src/index.js",
6
6
  "runkitExampleFilename": "example/main.js",
@@ -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/index.ts CHANGED
@@ -3,6 +3,7 @@ export * from './assets.dto';
3
3
  export * from './assetKeys';
4
4
  export * from './base.dto';
5
5
  export * from './connectors.dto';
6
+ export * from './constants';
6
7
  export * from './enum.dto';
7
8
  export * from './enums';
8
9
  export * from './extKeyMap.dto';