@squiz/component-cli-lib 1.35.1-alpha.5 → 1.38.0-alpha.2

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.5",
3
+ "version": "1.38.0-alpha.2",
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.5",
17
- "@squiz/component-web-api-lib": "1.35.1-alpha.5",
18
- "@squiz/dx-common-lib": "1.35.1-alpha.5",
19
- "@squiz/dx-json-schema-lib": "1.35.1-alpha.5",
20
- "@squiz/dx-logger-lib": "1.35.1-alpha.5",
21
- "@squiz/virus-scanner-lib": "1.35.1-alpha.5",
16
+ "@squiz/component-lib": "1.38.0-alpha.2",
17
+ "@squiz/component-web-api-lib": "1.38.0-alpha.2",
18
+ "@squiz/dx-common-lib": "1.38.0-alpha.2",
19
+ "@squiz/dx-json-schema-lib": "1.38.0-alpha.2",
20
+ "@squiz/dx-logger-lib": "1.38.0-alpha.2",
21
+ "@squiz/virus-scanner-lib": "1.38.0-alpha.2",
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.5",
35
+ "@squiz/render-runtime-lib": "1.38.0-alpha.2",
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": "6c976023e77f7cceab962b5563fcaf669aedaa6d"
42
+ "gitHead": "9c2f775a7d6607a73e5b25577d82be939d74ffec"
43
43
  }
@@ -41,6 +41,7 @@ export function startDevelopmentRender(
41
41
 
42
42
  const rootUrl = `http://localhost:${options.port}`;
43
43
 
44
+ const apiKeyService = new DevelopmentApiKeyService();
44
45
  const componentRunnerService = new ComponentRunnerServiceWithWorkers(
45
46
  {
46
47
  dataMountPoint,
@@ -57,6 +58,7 @@ export function startDevelopmentRender(
57
58
  const manifestService = new ManifestServiceForDev(dataMountPoint, logger);
58
59
  const contentItemService = undefined;
59
60
  const renderInputService = new RenderInputService(
61
+ apiKeyService,
60
62
  componentSetService,
61
63
  manifestService,
62
64
  componentFunctionService,
@@ -71,7 +73,7 @@ export function startDevelopmentRender(
71
73
  componentSetService,
72
74
  manifestService,
73
75
  renderInputService,
74
- apiKeyService: new DevelopmentApiKeyService(),
76
+ apiKeyService,
75
77
  });
76
78
 
77
79
  const server = webServer.listen(options.port, () => {
@@ -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
  };