@ampsec/platform-client 37.0.0 → 38.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/constants.d.ts +66 -0
- package/build/src/dto/constants.js +70 -0
- package/build/src/dto/constants.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/package.json +2 -1
- package/src/dto/constants.ts +72 -0
- package/src/dto/index.ts +1 -0
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { Set } from 'immutable';
|
|
2
|
+
import { AuthRole } from './enums';
|
|
3
|
+
/**
|
|
4
|
+
** /=====================\
|
|
5
|
+
** |== AGENT API ROLES ==|
|
|
6
|
+
** \=====================/
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* This is the set of roles that can be used to manage user access for a tenant in the agent API.
|
|
10
|
+
*
|
|
11
|
+
* Includes: [{@link AuthRole.OWNER}]
|
|
12
|
+
* @type {Set<AuthRole>}
|
|
13
|
+
*/
|
|
14
|
+
export declare const AGENT_OWNER_ROLES: Set<AuthRole>;
|
|
15
|
+
/**
|
|
16
|
+
* This is the set of roles that can be used to administer a tenant in the agent API.
|
|
17
|
+
*
|
|
18
|
+
* Includes: [{@link AuthRole.ADMIN} {@link AuthRole.OWNER}]
|
|
19
|
+
* @type {Set<AuthRole>}
|
|
20
|
+
*/
|
|
21
|
+
export declare const AGENT_ADMIN_ROLES: Set<AuthRole>;
|
|
22
|
+
/**
|
|
23
|
+
* This is the set of roles that can be used to view tenant data in the agent API.
|
|
24
|
+
*
|
|
25
|
+
* Includes: [{@link AuthRole.VIEWER}, {@link AuthRole.AGENT}, {@link AuthRole.ADMIN}, {@link AuthRole.OWNER}]
|
|
26
|
+
* @type {Set<AuthRole>}
|
|
27
|
+
*/
|
|
28
|
+
export declare const AGENT_VIEWER_ROLES: Set<AuthRole>;
|
|
29
|
+
/**
|
|
30
|
+
* This is the set of roles that can be used to view tenant data summaries in the agent API.
|
|
31
|
+
*
|
|
32
|
+
* Includes: [{@link AuthRole.REPORT_VIEWER}, {@link AuthRole.VIEWER}, {@link AuthRole.AGENT}, {@link AuthRole.ADMIN}, {@link AuthRole.OWNER}]
|
|
33
|
+
* @type {Set<AuthRole>}
|
|
34
|
+
*/
|
|
35
|
+
export declare const AGENT_REPORT_VIEWER_ROLES: Set<AuthRole>;
|
|
36
|
+
/**
|
|
37
|
+
** /==========================\
|
|
38
|
+
** |== ENGAGEMENT API ROLES ==|
|
|
39
|
+
** \==========================/
|
|
40
|
+
*/
|
|
41
|
+
/**
|
|
42
|
+
* This is the set of roles that can be used by an end user in the engagement API.
|
|
43
|
+
*
|
|
44
|
+
* Includes: [{@link AuthRole.USER}]
|
|
45
|
+
* @type {Set<AuthRole>}
|
|
46
|
+
*/
|
|
47
|
+
export declare const ENGAGEMENT_END_USER_ROLES: Set<AuthRole>;
|
|
48
|
+
/**
|
|
49
|
+
** /========================\
|
|
50
|
+
** |== PLATFORM API ROLES ==|
|
|
51
|
+
** \========================/
|
|
52
|
+
*/
|
|
53
|
+
/**
|
|
54
|
+
* This is the set of roles that can be used by Amplifier Employees to view data in the Platform API.
|
|
55
|
+
*
|
|
56
|
+
* Includes: [{@link AuthRole.CUSTOMER_SUCCESS}, {@link AuthRole.SUPPORT}, {@link AuthRole.OPERATOR}, {@link AuthRole.SERVICE_ACCOUNT}]
|
|
57
|
+
* @type {Set<AuthRole>}
|
|
58
|
+
*/
|
|
59
|
+
export declare const PLATFORM_READ_ONLY_ROLES: Set<AuthRole>;
|
|
60
|
+
/**
|
|
61
|
+
* This is the set of roles that can be used by Amplifier Employees to view data in the Platform API.
|
|
62
|
+
*
|
|
63
|
+
* Includes: [{@link AuthRole.CUSTOMER_SUCCESS}, {@link AuthRole.SUPPORT}, {@link AuthRole.OPERATOR}, {@link AuthRole.SERVICE_ACCOUNT}]
|
|
64
|
+
* @type {Set<AuthRole>}
|
|
65
|
+
*/
|
|
66
|
+
export declare const PLATFORM_READ_WRITE_ROLES: Set<AuthRole>;
|
|
@@ -0,0 +1,70 @@
|
|
|
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 immutable_1 = require("immutable");
|
|
5
|
+
const enums_1 = require("./enums");
|
|
6
|
+
/**
|
|
7
|
+
** /=====================\
|
|
8
|
+
** |== AGENT API ROLES ==|
|
|
9
|
+
** \=====================/
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* This is the set of roles that can be used to manage user access for a tenant in the agent API.
|
|
13
|
+
*
|
|
14
|
+
* Includes: [{@link AuthRole.OWNER}]
|
|
15
|
+
* @type {Set<AuthRole>}
|
|
16
|
+
*/
|
|
17
|
+
exports.AGENT_OWNER_ROLES = (0, immutable_1.Set)().add(enums_1.AuthRole.OWNER);
|
|
18
|
+
/**
|
|
19
|
+
* This is the set of roles that can be used to administer a tenant in the agent API.
|
|
20
|
+
*
|
|
21
|
+
* Includes: [{@link AuthRole.ADMIN} {@link AuthRole.OWNER}]
|
|
22
|
+
* @type {Set<AuthRole>}
|
|
23
|
+
*/
|
|
24
|
+
exports.AGENT_ADMIN_ROLES = (0, immutable_1.Set)().add(enums_1.AuthRole.ADMIN).add(enums_1.AuthRole.OWNER);
|
|
25
|
+
/**
|
|
26
|
+
* This is the set of roles that can be used to view tenant data in the agent API.
|
|
27
|
+
*
|
|
28
|
+
* Includes: [{@link AuthRole.VIEWER}, {@link AuthRole.AGENT}, {@link AuthRole.ADMIN}, {@link AuthRole.OWNER}]
|
|
29
|
+
* @type {Set<AuthRole>}
|
|
30
|
+
*/
|
|
31
|
+
exports.AGENT_VIEWER_ROLES = (0, immutable_1.Set)().add(enums_1.AuthRole.VIEWER).add(enums_1.AuthRole.AGENT).add(enums_1.AuthRole.ADMIN).add(enums_1.AuthRole.OWNER);
|
|
32
|
+
/**
|
|
33
|
+
* This is the set of roles that can be used to view tenant data summaries in the agent API.
|
|
34
|
+
*
|
|
35
|
+
* Includes: [{@link AuthRole.REPORT_VIEWER}, {@link AuthRole.VIEWER}, {@link AuthRole.AGENT}, {@link AuthRole.ADMIN}, {@link AuthRole.OWNER}]
|
|
36
|
+
* @type {Set<AuthRole>}
|
|
37
|
+
*/
|
|
38
|
+
exports.AGENT_REPORT_VIEWER_ROLES = (0, immutable_1.Set)().add(enums_1.AuthRole.REPORT_VIEWER).add(enums_1.AuthRole.VIEWER).add(enums_1.AuthRole.AGENT).add(enums_1.AuthRole.ADMIN).add(enums_1.AuthRole.OWNER);
|
|
39
|
+
/**
|
|
40
|
+
** /==========================\
|
|
41
|
+
** |== ENGAGEMENT API ROLES ==|
|
|
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
|
+
exports.ENGAGEMENT_END_USER_ROLES = (0, immutable_1.Set)().add(enums_1.AuthRole.USER);
|
|
51
|
+
/**
|
|
52
|
+
** /========================\
|
|
53
|
+
** |== PLATFORM API ROLES ==|
|
|
54
|
+
** \========================/
|
|
55
|
+
*/
|
|
56
|
+
/**
|
|
57
|
+
* This is the set of roles that can be used by Amplifier Employees to view data in the Platform API.
|
|
58
|
+
*
|
|
59
|
+
* Includes: [{@link AuthRole.CUSTOMER_SUCCESS}, {@link AuthRole.SUPPORT}, {@link AuthRole.OPERATOR}, {@link AuthRole.SERVICE_ACCOUNT}]
|
|
60
|
+
* @type {Set<AuthRole>}
|
|
61
|
+
*/
|
|
62
|
+
exports.PLATFORM_READ_ONLY_ROLES = (0, immutable_1.Set)().add(enums_1.AuthRole.CUSTOMER_SUCCESS).add(enums_1.AuthRole.SUPPORT).add(enums_1.AuthRole.OPERATOR).add(enums_1.AuthRole.SERVICE_ACCOUNT);
|
|
63
|
+
/**
|
|
64
|
+
* This is the set of roles that can be used by Amplifier Employees to view data in the Platform API.
|
|
65
|
+
*
|
|
66
|
+
* Includes: [{@link AuthRole.CUSTOMER_SUCCESS}, {@link AuthRole.SUPPORT}, {@link AuthRole.OPERATOR}, {@link AuthRole.SERVICE_ACCOUNT}]
|
|
67
|
+
* @type {Set<AuthRole>}
|
|
68
|
+
*/
|
|
69
|
+
exports.PLATFORM_READ_WRITE_ROLES = (0, immutable_1.Set)().add(enums_1.AuthRole.OPERATOR).add(enums_1.AuthRole.SERVICE_ACCOUNT);
|
|
70
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/dto/constants.ts"],"names":[],"mappings":";;;AAAA,yCAA8B;AAC9B,mCAAiC;AAEjC;;;;GAIG;AAEH;;;;;GAKG;AACU,QAAA,iBAAiB,GAAG,IAAA,eAAG,GAAY,CAAC,GAAG,CAAC,gBAAQ,CAAC,KAAK,CAAC,CAAC;AACrE;;;;;GAKG;AACU,QAAA,iBAAiB,GAAG,IAAA,eAAG,GAAY,CAAC,GAAG,CAAC,gBAAQ,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,gBAAQ,CAAC,KAAK,CAAC,CAAC;AACzF;;;;;GAKG;AACU,QAAA,kBAAkB,GAAG,IAAA,eAAG,GAAY,CAAC,GAAG,CAAC,gBAAQ,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,gBAAQ,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,gBAAQ,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,gBAAQ,CAAC,KAAK,CAAC,CAAC;AACnI;;;;;GAKG;AACU,QAAA,yBAAyB,GAAG,IAAA,eAAG,GAAY,CAAC,GAAG,CAAC,gBAAQ,CAAC,aAAa,CAAC,CAAC,GAAG,CAAC,gBAAQ,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,gBAAQ,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,gBAAQ,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,gBAAQ,CAAC,KAAK,CAAC,CAAC;AAEtK;;;;GAIG;AAEH;;;;;GAKG;AACU,QAAA,yBAAyB,GAAG,IAAA,eAAG,GAAY,CAAC,GAAG,CAAC,gBAAQ,CAAC,IAAI,CAAC,CAAC;AAE5E;;;;GAIG;AAEH;;;;;GAKG;AACU,QAAA,wBAAwB,GAAG,IAAA,eAAG,GAAY,CAAC,GAAG,CAAC,gBAAQ,CAAC,gBAAgB,CAAC,CAAC,GAAG,CAAC,gBAAQ,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,gBAAQ,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,gBAAQ,CAAC,eAAe,CAAC,CAAC;AAClK;;;;;GAKG;AACU,QAAA,yBAAyB,GAAG,IAAA,eAAG,GAAY,CAAC,GAAG,CAAC,gBAAQ,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,gBAAQ,CAAC,eAAe,CAAC,CAAC"}
|
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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ampsec/platform-client",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "38.0.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "build/src/index.js",
|
|
6
6
|
"runkitExampleFilename": "example/main.js",
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"axios": "^1.4.0",
|
|
26
26
|
"blueimp-md5": "^2.19.0",
|
|
27
|
+
"immutable": "^5.0.0-beta.4",
|
|
27
28
|
"lodash": "^4.17.21",
|
|
28
29
|
"lodash.omit": "^4.5.0",
|
|
29
30
|
"qs": "^6.11.2"
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import {Set} from 'immutable';
|
|
2
|
+
import {AuthRole} from './enums';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
** /=====================\
|
|
6
|
+
** |== AGENT API ROLES ==|
|
|
7
|
+
** \=====================/
|
|
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
|
+
export const AGENT_OWNER_ROLES = Set<AuthRole>().add(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
|
+
export const AGENT_ADMIN_ROLES = Set<AuthRole>().add(AuthRole.ADMIN).add(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
|
+
export const AGENT_VIEWER_ROLES = Set<AuthRole>().add(AuthRole.VIEWER).add(AuthRole.AGENT).add(AuthRole.ADMIN).add(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
|
+
export const AGENT_REPORT_VIEWER_ROLES = Set<AuthRole>().add(AuthRole.REPORT_VIEWER).add(AuthRole.VIEWER).add(AuthRole.AGENT).add(AuthRole.ADMIN).add(AuthRole.OWNER);
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
** /==========================\
|
|
41
|
+
** |== ENGAGEMENT API ROLES ==|
|
|
42
|
+
** \==========================/
|
|
43
|
+
*/
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* This is the set of roles that can be used by an end user in the engagement API.
|
|
47
|
+
*
|
|
48
|
+
* Includes: [{@link AuthRole.USER}]
|
|
49
|
+
* @type {Set<AuthRole>}
|
|
50
|
+
*/
|
|
51
|
+
export const ENGAGEMENT_END_USER_ROLES = Set<AuthRole>().add(AuthRole.USER);
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
** /========================\
|
|
55
|
+
** |== PLATFORM API ROLES ==|
|
|
56
|
+
** \========================/
|
|
57
|
+
*/
|
|
58
|
+
|
|
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 const PLATFORM_READ_ONLY_ROLES = Set<AuthRole>().add(AuthRole.CUSTOMER_SUCCESS).add(AuthRole.SUPPORT).add(AuthRole.OPERATOR).add(AuthRole.SERVICE_ACCOUNT);
|
|
66
|
+
/**
|
|
67
|
+
* This is the set of roles that can be used by Amplifier Employees to view data in the Platform API.
|
|
68
|
+
*
|
|
69
|
+
* Includes: [{@link AuthRole.CUSTOMER_SUCCESS}, {@link AuthRole.SUPPORT}, {@link AuthRole.OPERATOR}, {@link AuthRole.SERVICE_ACCOUNT}]
|
|
70
|
+
* @type {Set<AuthRole>}
|
|
71
|
+
*/
|
|
72
|
+
export const PLATFORM_READ_WRITE_ROLES = Set<AuthRole>().add(AuthRole.OPERATOR).add(AuthRole.SERVICE_ACCOUNT);
|
package/src/dto/index.ts
CHANGED