@squiz/component-cli-lib 1.35.1-alpha.21 → 1.35.1-alpha.23

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.
@@ -4,6 +4,7 @@ interface Config {
4
4
  managementServiceUrl: string;
5
5
  renderServiceUrl: string;
6
6
  contentServiceUrl: string;
7
+ tenantId: string;
7
8
  ci_buildVersion: string;
8
9
  ci_buildBranch: string;
9
10
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@squiz/component-cli-lib",
3
- "version": "1.35.1-alpha.21",
3
+ "version": "1.35.1-alpha.23",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {
@@ -13,12 +13,12 @@
13
13
  "author": "",
14
14
  "license": "ISC",
15
15
  "devDependencies": {
16
- "@squiz/component-lib": "1.35.1-alpha.21",
17
- "@squiz/component-web-api-lib": "1.35.1-alpha.21",
18
- "@squiz/dx-common-lib": "1.35.1-alpha.21",
19
- "@squiz/dx-json-schema-lib": "1.35.1-alpha.21",
20
- "@squiz/dx-logger-lib": "1.35.1-alpha.21",
21
- "@squiz/virus-scanner-lib": "1.35.1-alpha.21",
16
+ "@squiz/component-lib": "1.35.1-alpha.23",
17
+ "@squiz/component-web-api-lib": "1.35.1-alpha.23",
18
+ "@squiz/dx-common-lib": "1.35.1-alpha.23",
19
+ "@squiz/dx-json-schema-lib": "1.35.1-alpha.23",
20
+ "@squiz/dx-logger-lib": "1.35.1-alpha.23",
21
+ "@squiz/virus-scanner-lib": "1.35.1-alpha.23",
22
22
  "@types/cli-color": "2.0.2",
23
23
  "@types/express": "4.17.17",
24
24
  "@types/jest": "28.1.8",
@@ -32,12 +32,12 @@
32
32
  "typescript": "4.9.4"
33
33
  },
34
34
  "dependencies": {
35
- "@squiz/render-runtime-lib": "1.35.1-alpha.21",
35
+ "@squiz/render-runtime-lib": "1.35.1-alpha.23",
36
36
  "archiver": "5.3.1",
37
37
  "axios": "1.3.2",
38
38
  "cli-color": "^2.0.2",
39
39
  "open": "^8.4.0",
40
40
  "supertest": "^6.2.3"
41
41
  },
42
- "gitHead": "d2b4803d61cfb55aad8d3876df8cecc369c54bd4"
42
+ "gitHead": "7e411a71ade1ea015c322ca6e67852d63c7a99ba"
43
43
  }
@@ -16,6 +16,7 @@ interface Config {
16
16
  managementServiceUrl: string;
17
17
  renderServiceUrl: string;
18
18
  contentServiceUrl: string;
19
+ tenantId: string;
19
20
  ci_buildVersion: string;
20
21
  ci_buildBranch: string;
21
22
  }
@@ -24,6 +25,7 @@ const configObj: Config = {
24
25
  managementServiceUrl: parseEnvVarForVar('COMPONENT_MANAGEMENT_SERVICE_URL').replace(/\/+$/, ''),
25
26
  renderServiceUrl: parseEnvVarForVar('COMPONENT_RENDER_SERVICE_URL').replace(/\/+$/, ''),
26
27
  contentServiceUrl: parseEnvVarForVar('CONTENT_API_URL').replace(/\/+$/, ''),
28
+ tenantId: parseEnvVarForVar('TENANT_ID'),
27
29
  ci_buildVersion: parseEnvVarForVar('CI_COMMIT_SHORT_SHA'),
28
30
  ci_buildBranch: parseEnvVarForVar('CI_COMMIT_REF_NAME'),
29
31
  };
@@ -38,40 +40,41 @@ if (!configObj.ci_buildBranch) {
38
40
 
39
41
  export default configObj;
40
42
 
41
- const DXP_SERVICE_NAME = 'dxpComponents';
42
- const ALL_PERMISSIONS_ROLE = {
43
- privileges: [
44
- 'COMPONENT_DEPLOY',
45
- 'COMPONENT_DELETE',
46
- 'COMPONENT_READ',
47
- 'COMPONENT_SET_RULES_READ',
48
- 'COMPONENT_SET_RULES_WRITE',
49
-
50
- 'COMPONENT_SET_READ',
51
- 'COMPONENT_SET_WRITE',
52
-
53
- 'COMPONENT_SET_ENVIRONMENT_READ',
54
- 'COMPONENT_SET_ENVIRONMENT_WRITE',
55
-
56
- 'CONTENT_SCHEMA_READ',
57
- 'CONTENT_SCHEMA_WRITE',
58
- 'CONTENT_ITEM_READ',
59
- 'CONTENT_ITEM_WRITE',
60
- 'SETTINGS_READ',
61
- 'SETTINGS_WRITE',
62
- ],
63
- };
43
+ const DXP_COMPONENTS_SERVICE_NAME = 'dxpComponents';
44
+ const DXP_CONTENT_STORE_SERVICE_NAME = 'dxpContentStore';
64
45
 
65
46
  const validToken = {
66
47
  organisationId: 'aa',
67
48
  permission: '',
68
- tenant: 'zz',
49
+ tenant: configObj.tenantId,
69
50
  tenantId: 'zz',
70
51
  userId: 'zz',
71
52
 
72
53
  service: {
73
- [DXP_SERVICE_NAME]: {
74
- privileges: ALL_PERMISSIONS_ROLE.privileges,
54
+ [DXP_COMPONENTS_SERVICE_NAME]: {
55
+ privileges: [
56
+ 'COMPONENT_DEPLOY',
57
+ 'COMPONENT_DELETE',
58
+ 'COMPONENT_READ',
59
+ 'COMPONENT_SET_RULES_READ',
60
+ 'COMPONENT_SET_RULES_WRITE',
61
+
62
+ 'COMPONENT_SET_READ',
63
+ 'COMPONENT_SET_WRITE',
64
+
65
+ 'COMPONENT_SET_ENVIRONMENT_READ',
66
+ 'COMPONENT_SET_ENVIRONMENT_WRITE',
67
+ ],
68
+ },
69
+ [DXP_CONTENT_STORE_SERVICE_NAME]: {
70
+ privileges: [
71
+ 'CONTENT_SCHEMA_READ',
72
+ 'CONTENT_SCHEMA_WRITE',
73
+ 'CONTENT_ITEM_READ',
74
+ 'CONTENT_ITEM_WRITE',
75
+ 'SETTINGS_READ',
76
+ 'SETTINGS_WRITE',
77
+ ],
75
78
  },
76
79
  },
77
80
  };