@squiz/component-cli-lib 1.52.1-alpha.3 → 1.52.1-alpha.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@squiz/component-cli-lib",
3
- "version": "1.52.1-alpha.3",
3
+ "version": "1.52.1-alpha.4",
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.52.1-alpha.3",
17
- "@squiz/component-web-api-lib": "1.52.1-alpha.3",
18
- "@squiz/dx-common-lib": "1.52.1-alpha.3",
19
- "@squiz/dx-json-schema-lib": "1.52.1-alpha.3",
20
- "@squiz/dx-logger-lib": "1.52.1-alpha.3",
21
- "@squiz/virus-scanner-lib": "1.52.1-alpha.3",
16
+ "@squiz/component-lib": "1.52.1-alpha.4",
17
+ "@squiz/component-web-api-lib": "1.52.1-alpha.4",
18
+ "@squiz/dx-common-lib": "1.52.1-alpha.4",
19
+ "@squiz/dx-json-schema-lib": "1.52.1-alpha.4",
20
+ "@squiz/dx-logger-lib": "1.52.1-alpha.4",
21
+ "@squiz/virus-scanner-lib": "1.52.1-alpha.4",
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.52.1-alpha.3",
35
+ "@squiz/render-runtime-lib": "1.52.1-alpha.4",
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": "db2e6a87a503d1d20be4f11355e19128abd73589"
42
+ "gitHead": "c1b365080d821e217d0afdb1216b07f17eddee92"
43
43
  }
@@ -84,42 +84,43 @@ const authToken =
84
84
  export const managementService = axios.create({
85
85
  baseURL: configObj.managementServiceUrl + '/v1',
86
86
  headers: {
87
- authorization: authToken,
87
+ Authorization: authToken,
88
88
  },
89
89
  });
90
90
 
91
91
  export const managementServiceRoot = axios.create({
92
92
  baseURL: configObj.managementServiceUrl,
93
93
  headers: {
94
- authorization: authToken,
94
+ Authorization: authToken,
95
95
  },
96
96
  });
97
97
 
98
98
  export const renderService = axios.create({
99
99
  baseURL: configObj.renderServiceUrl,
100
100
  headers: {
101
- authorization: authToken,
101
+ Authorization: authToken,
102
+ 'x-api-key': 'inter-service-api-key',
102
103
  },
103
104
  });
104
105
 
105
106
  export const contentService = axios.create({
106
107
  baseURL: configObj.contentServiceUrl,
107
108
  headers: {
108
- authorization: authToken,
109
+ Authorization: authToken,
109
110
  },
110
111
  });
111
112
 
112
113
  export const pageRenderService = axios.create({
113
114
  baseURL: configObj.pageRenderServiceUrl,
114
115
  headers: {
115
- authorization: authToken,
116
+ Authorization: authToken,
116
117
  },
117
118
  });
118
119
 
119
120
  export const jobService = axios.create({
120
121
  baseURL: configObj.jobServiceUrl,
121
122
  headers: {
122
- authorization: authToken,
123
+ Authorization: authToken,
123
124
  },
124
125
  });
125
126
 
@@ -19,6 +19,42 @@ import { logger } from '../upload-component-folder';
19
19
  import { ComponentSetWebModelForCreate } from '@squiz/component-lib';
20
20
  import fsp from 'fs/promises';
21
21
  import { randomUUID } from 'crypto';
22
+ import { buildDevelopmentJwt, DxpServiceId } from '@squiz/dxp-auth-lib';
23
+
24
+ const authToken =
25
+ 'Bearer ' +
26
+ buildDevelopmentJwt({
27
+ service: {
28
+ [DxpServiceId.contentStore]: {
29
+ privileges: [
30
+ 'CONTENT_SCHEMA_READ',
31
+ 'CONTENT_SCHEMA_WRITE',
32
+ 'CONTENT_ITEM_READ',
33
+ 'CONTENT_ITEM_WRITE',
34
+ 'SETTINGS_READ',
35
+ 'SETTINGS_WRITE',
36
+ 'PAGE_CONTENTS_WRITE',
37
+ 'PAGE_CONTENTS_READ',
38
+ ],
39
+ },
40
+ [DxpServiceId.components]: {
41
+ privileges: [
42
+ 'COMPONENT_READ',
43
+ 'COMPONENT_WRITE',
44
+ 'COMPONENT_DEPLOY',
45
+ 'COMPONENT_SET_WRITE',
46
+ 'COMPONENT_DELETE',
47
+ 'COMPONENT_SET_WRITE',
48
+ 'COMPONENT_SET_READ',
49
+ 'COMPONENT_SET_ENVIRONMENT_READ',
50
+ 'COMPONENT_SET_ENVIRONMENT_WRITE',
51
+ ],
52
+ },
53
+ [DxpServiceId.segmentation]: {
54
+ privileges: ['SEGMENT_READ'],
55
+ },
56
+ },
57
+ });
22
58
 
23
59
  const webPath = 'set-' + randomUUID();
24
60
  const contentItemId = randomUUID();
@@ -383,10 +419,10 @@ describe('uploading a component', () => {
383
419
  });
384
420
 
385
421
  it('Should preserve input field order when uploading schema to content store', async () => {
386
- const response = await supertest(configObj.contentServiceUrl).get(
387
- '/content-schema/smoke-test-components/cmp-property-order/1.0.0/main',
388
- );
389
-
422
+ const response = await supertest(configObj.contentServiceUrl)
423
+ .get('/content-schema/smoke-test-components/cmp-property-order/1.0.0/main')
424
+ .set('Authorization', authToken)
425
+ .send();
390
426
  // Relates to DEVX-891, property order is preserved so that we can reliably draw a UI from it.
391
427
  //
392
428
  // The sequence here is important and should follow the rules defined here:
@@ -414,7 +450,7 @@ describe('uploading a component', () => {
414
450
  '"null":{"type":"null","default":null}';
415
451
 
416
452
  expect(response.status).toEqual(200);
417
- expect(response.text).toEqual(
453
+ expect(response.text).toContain(
418
454
  `{"name":"smoke-test-components/cmp-property-order/1.0.0/main",` +
419
455
  `"schema":{"type":"object","properties":{${expectedProperties}},"required":[]},"contentSchemaType":"component"}`,
420
456
  );