@squiz/component-cli-lib 1.2.1-alpha.89 → 1.2.1-alpha.91

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.
Files changed (37) hide show
  1. package/.gitlab-ci.yml +1 -1
  2. package/CHANGELOG.md +16 -0
  3. package/lib/component-dev.d.ts +14 -0
  4. package/lib/component-dev.js +38 -0
  5. package/lib/component-dev.js.map +1 -0
  6. package/lib/component-dev.spec.d.ts +1 -0
  7. package/lib/component-dev.spec.js +91 -0
  8. package/lib/component-dev.spec.js.map +1 -0
  9. package/lib/index.d.ts +2 -0
  10. package/lib/index.js +8 -0
  11. package/lib/index.js.map +1 -0
  12. package/lib/integration-tests/__components__/big-package/manifest.json +32 -0
  13. package/lib/integration-tests/__components__/cmp-static-file-test/manifest.json +36 -0
  14. package/lib/integration-tests/__components__/invalid-manifest/manifest.json +24 -0
  15. package/lib/integration-tests/helper.d.ts +15 -0
  16. package/lib/integration-tests/helper.js +52 -0
  17. package/lib/integration-tests/helper.js.map +1 -0
  18. package/lib/integration-tests/service-deployment.spec.d.ts +1 -0
  19. package/lib/integration-tests/service-deployment.spec.js +16 -0
  20. package/lib/integration-tests/service-deployment.spec.js.map +1 -0
  21. package/lib/integration-tests/test-setup.d.ts +0 -0
  22. package/lib/integration-tests/test-setup.js +3 -0
  23. package/lib/integration-tests/test-setup.js.map +1 -0
  24. package/lib/integration-tests/upload-and-render-component.spec.d.ts +1 -0
  25. package/lib/integration-tests/upload-and-render-component.spec.js +121 -0
  26. package/lib/integration-tests/upload-and-render-component.spec.js.map +1 -0
  27. package/lib/upload-component-folder.d.ts +1 -0
  28. package/lib/upload-component-folder.js +125 -0
  29. package/lib/upload-component-folder.js.map +1 -0
  30. package/package.json +5 -5
  31. package/src/integration-tests/helper.ts +25 -5
  32. package/src/integration-tests/upload-and-render-component.spec.ts +7 -8
  33. package/src/upload-component-folder.ts +11 -8
  34. package/tsconfig.tsbuildinfo +1 -0
  35. package/.env +0 -10
  36. package/src/config.ts +0 -20
  37. package/src/test.ts +0 -24
package/.gitlab-ci.yml CHANGED
@@ -59,7 +59,7 @@
59
59
 
60
60
  .smoke-test:
61
61
  stage: smoke-test
62
- tags:
62
+ tags:
63
63
  - access/aws-dx-nonprod
64
64
  script:
65
65
  - export
package/CHANGELOG.md CHANGED
@@ -3,6 +3,22 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [1.2.1-alpha.91](https://gitlab.squiz.net/developer-experience/cmp/compare/v1.2.1-alpha.90...v1.2.1-alpha.91) (2022-08-05)
7
+
8
+ **Note:** Version bump only for package @squiz/component-cli-lib
9
+
10
+
11
+
12
+
13
+
14
+ ## [1.2.1-alpha.90](https://gitlab.squiz.net/developer-experience/cmp/compare/v1.2.1-alpha.89...v1.2.1-alpha.90) (2022-08-05)
15
+
16
+ **Note:** Version bump only for package @squiz/component-cli-lib
17
+
18
+
19
+
20
+
21
+
6
22
  ## [1.2.1-alpha.89](https://gitlab.squiz.net/developer-experience/cmp/compare/v1.2.1-alpha.88...v1.2.1-alpha.89) (2022-08-05)
7
23
 
8
24
  **Note:** Version bump only for package @squiz/component-cli-lib
@@ -0,0 +1,14 @@
1
+ /**
2
+ * startDevelopmentRender starts a dev-mode render stack for any
3
+ * local directory. This should start an express server on a random unused port
4
+ * which can be accessed for viewing the component in development.
5
+ * As the render stack outputs log using `bunyan`, the CLI command that runs
6
+ * this function should be piped into `npx bunyan`.
7
+ * @param {string} componentPath - The directory with the component to be rendered
8
+ * @param {object} options - Additional configuration for the dev stack
9
+ * @returns a function to stop the render stack
10
+ */
11
+ export declare function startDevelopmentRender(componentPath: string, options: {
12
+ port: number;
13
+ previewFile?: string;
14
+ }): Promise<() => Promise<void>>;
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.startDevelopmentRender = void 0;
7
+ const render_runtime_lib_1 = require("@squiz/render-runtime-lib");
8
+ const path_1 = __importDefault(require("path"));
9
+ /**
10
+ * startDevelopmentRender starts a dev-mode render stack for any
11
+ * local directory. This should start an express server on a random unused port
12
+ * which can be accessed for viewing the component in development.
13
+ * As the render stack outputs log using `bunyan`, the CLI command that runs
14
+ * this function should be piped into `npx bunyan`.
15
+ * @param {string} componentPath - The directory with the component to be rendered
16
+ * @param {object} options - Additional configuration for the dev stack
17
+ * @returns a function to stop the render stack
18
+ */
19
+ async function startDevelopmentRender(componentPath, options) {
20
+ await (0, render_runtime_lib_1.startRenderStack)({
21
+ webserver: {
22
+ port: options.port,
23
+ rootUrl: `http://localhost:${options.port}`,
24
+ shouldRunMigrations: false,
25
+ },
26
+ componentRunner: {
27
+ // Considering the component path will be passed in from CLI
28
+ // We need to generate the path from the calling directory
29
+ dataMountPoint: path_1.default.resolve(process.cwd(), componentPath),
30
+ localDevMode: true,
31
+ previewFile: options.previewFile,
32
+ workerTimeout: 20000,
33
+ },
34
+ });
35
+ return () => (0, render_runtime_lib_1.stopRenderStack)();
36
+ }
37
+ exports.startDevelopmentRender = startDevelopmentRender;
38
+ //# sourceMappingURL=component-dev.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component-dev.js","sourceRoot":"","sources":["../src/component-dev.ts"],"names":[],"mappings":";;;;;;AAAA,kEAA8E;AAC9E,gDAAwB;AAExB;;;;;;;;;GASG;AACI,KAAK,UAAU,sBAAsB,CAAC,aAAqB,EAAE,OAA+C;IACjH,MAAM,IAAA,qCAAgB,EAAC;QACrB,SAAS,EAAE;YACT,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,OAAO,EAAE,oBAAoB,OAAO,CAAC,IAAI,EAAE;YAC3C,mBAAmB,EAAE,KAAK;SAC3B;QACD,eAAe,EAAE;YACf,4DAA4D;YAC5D,0DAA0D;YAC1D,cAAc,EAAE,cAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,aAAa,CAAC;YAC1D,YAAY,EAAE,IAAI;YAClB,WAAW,EAAE,OAAO,CAAC,WAAW;YAChC,aAAa,EAAE,KAAM;SACtB;KACF,CAAC,CAAC;IAEH,OAAO,GAAG,EAAE,CAAC,IAAA,oCAAe,GAAE,CAAC;AACjC,CAAC;AAlBD,wDAkBC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,91 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const path_1 = __importDefault(require("path"));
7
+ const promises_1 = __importDefault(require("fs/promises"));
8
+ const render_runtime_lib_1 = require("@squiz/render-runtime-lib");
9
+ const component_dev_1 = require("./component-dev");
10
+ const supertest_1 = __importDefault(require("supertest"));
11
+ jest.setTimeout(20000);
12
+ describe('component-dev', () => {
13
+ describe('production style folder structure', () => {
14
+ let doStopStack;
15
+ beforeAll(async () => {
16
+ doStopStack = await (0, component_dev_1.startDevelopmentRender)(path_1.default.join(__dirname, '../../../test-components'), { port: 0 });
17
+ });
18
+ afterAll(async () => {
19
+ await doStopStack();
20
+ });
21
+ it('should find the component', async () => {
22
+ const testServer = render_runtime_lib_1.TestHelpers.getTestServer();
23
+ const response = await testServer.get(`/r/set/test-component/1.0.0?something=hello`);
24
+ expect(response.text).toEqual('<h1>hello</h1>');
25
+ });
26
+ });
27
+ describe('local developer style folders', () => {
28
+ let doStopStack;
29
+ let version;
30
+ let componentName;
31
+ let fixtureDirectory;
32
+ beforeAll(async () => {
33
+ const { fixtureDirectory: ceratedFixtureDirectory, version: createdVersion, componentName: createdName, } = await render_runtime_lib_1.TestHelpers.ComponentFixture.setupFullComponentDirectory('<h1>Hello World</h1>');
34
+ version = createdVersion;
35
+ fixtureDirectory = ceratedFixtureDirectory;
36
+ componentName = createdName;
37
+ doStopStack = await (0, component_dev_1.startDevelopmentRender)(fixtureDirectory, { port: 0 });
38
+ });
39
+ afterAll(async () => {
40
+ await doStopStack();
41
+ await promises_1.default.rm(path_1.default.join(fixtureDirectory, componentName), { force: true, recursive: true });
42
+ });
43
+ it('should handle recursing folders to find the component', async () => {
44
+ const testServer = render_runtime_lib_1.TestHelpers.getTestServer();
45
+ const response = await testServer.get(`/r/set/${componentName}/${version}/`);
46
+ expect(response.text).toEqual('<h1>Hello World</h1>');
47
+ });
48
+ it('should handle serving static files from single component directory', async () => {
49
+ const testServer = render_runtime_lib_1.TestHelpers.getTestServer();
50
+ const response = await testServer.get(`/s/${componentName}/${version}/static.txt`);
51
+ expect(response.text).toEqual('hello');
52
+ });
53
+ });
54
+ describe('accessing local dev routes', () => {
55
+ let stopServer;
56
+ const port = 3006;
57
+ const url = `http://localhost:${port}`;
58
+ const request = (0, supertest_1.default)(url);
59
+ beforeAll(async () => {
60
+ const compDir = path_1.default.join(__dirname, '../', '../../test-components');
61
+ stopServer = await (0, component_dev_1.startDevelopmentRender)(compDir, {
62
+ port: port,
63
+ });
64
+ });
65
+ afterAll(async () => {
66
+ await stopServer();
67
+ });
68
+ describe('definition routes', () => {
69
+ render_runtime_lib_1.routeTests.definition(url, url);
70
+ });
71
+ describe('static routes', () => {
72
+ render_runtime_lib_1.routeTests.static(url);
73
+ });
74
+ describe('render routes', () => {
75
+ render_runtime_lib_1.routeTests.render(url, url);
76
+ });
77
+ describe('GET /r/set/test-component/1.0.1', () => {
78
+ //
79
+ // this scenario is different to the 'production' tests
80
+ // this is should 500 in prod and 404 locally
81
+ it('should fail validation if trying to render a component with an invalid schema', async () => {
82
+ const response = await request.get('/r/set/test-component/1.0.1?something=not-used');
83
+ expect(response.statusCode).toEqual(404);
84
+ expect(response.body).toEqual({
85
+ message: 'manifest could not be found',
86
+ });
87
+ });
88
+ });
89
+ });
90
+ });
91
+ //# sourceMappingURL=component-dev.spec.js.map
@@ -0,0 +1 @@
1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AO,CAAC;oBAC5B,OAAO,EAAE,6BAA6B;iBACvC,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
package/lib/index.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export { uploadComponentFolder } from './upload-component-folder';
2
+ export { startDevelopmentRender } from './component-dev';
package/lib/index.js ADDED
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.startDevelopmentRender = exports.uploadComponentFolder = void 0;
4
+ var upload_component_folder_1 = require("./upload-component-folder");
5
+ Object.defineProperty(exports, "uploadComponentFolder", { enumerable: true, get: function () { return upload_component_folder_1.uploadComponentFolder; } });
6
+ var component_dev_1 = require("./component-dev");
7
+ Object.defineProperty(exports, "startDevelopmentRender", { enumerable: true, get: function () { return component_dev_1.startDevelopmentRender; } });
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,qEAAkE;AAAzD,gIAAA,qBAAqB,OAAA;AAC9B,iDAAyD;AAAhD,uHAAA,sBAAsB,OAAA"}
@@ -0,0 +1,32 @@
1
+ {
2
+ "$schema": "http://localhost:3000/schemas/v1.json#",
3
+ "name": "big-package",
4
+ "version": "1.0.2",
5
+ "main-function": "render-json",
6
+ "functions": [
7
+ {
8
+ "name": "render-json",
9
+ "entry": "render-json.js",
10
+ "input": {
11
+ "type": "object",
12
+ "properties": {
13
+ "something": {
14
+ "type": "string"
15
+ }
16
+ },
17
+ "required": ["something"]
18
+ },
19
+ "output": {
20
+ "response-type": "json",
21
+ "definition": {
22
+ "properties": {
23
+ "my-prop": {
24
+ "type": "string"
25
+ }
26
+ },
27
+ "required": ["my-prop"]
28
+ }
29
+ }
30
+ }
31
+ ]
32
+ }
@@ -0,0 +1,36 @@
1
+ {
2
+ "$schema": "http://localhost:3000/schemas/v1.json#",
3
+ "name": "cmp-static-file-test",
4
+ "version": "1.0.0",
5
+ "main-function": "main",
6
+ "functions": [
7
+ {
8
+ "entry": "main.js",
9
+ "name": "main",
10
+ "input": {
11
+ "type": "object",
12
+ "properties": {
13
+ "something": {
14
+ "type": "string"
15
+ }
16
+ },
17
+ "required": ["something"]
18
+ },
19
+ "output": {
20
+ "response-type": "html",
21
+ "static-files": [
22
+ {
23
+ "location": "header",
24
+ "file": {
25
+ "filepath": "static-library-file.js",
26
+ "type": "js"
27
+ }
28
+ }
29
+ ]
30
+ }
31
+ }
32
+ ],
33
+ "static-files": {
34
+ "location-root": "public"
35
+ }
36
+ }
@@ -0,0 +1,24 @@
1
+ {
2
+ "$schema": "http://localhost:3000/schemas/v1.json#",
3
+ "name": "invalid-manifes@t",
4
+ "version": "1.0.0",
5
+ "main-function": "main",
6
+ "functions": [
7
+ {
8
+ "entry": "main.js",
9
+ "name": "main",
10
+ "input": {
11
+ "type": "object",
12
+ "properties": {
13
+ "something": {
14
+ "type": "string"
15
+ }
16
+ },
17
+ "required": ["something"]
18
+ },
19
+ "output": {
20
+ "response-type": "html"
21
+ }
22
+ }
23
+ ]
24
+ }
@@ -0,0 +1,15 @@
1
+ interface Config {
2
+ managementServiceUrl: string;
3
+ renderServiceUrl: string;
4
+ ci_buildVersion: string;
5
+ ci_buildBranch: string;
6
+ }
7
+ declare const configObj: Config;
8
+ export default configObj;
9
+ export declare const managementService: import("axios").AxiosInstance;
10
+ export declare const renderService: import("axios").AxiosInstance;
11
+ export declare const ci_buildVersion: string;
12
+ export declare const ci_buildBranch: string;
13
+ export declare function getTestComponents(): string[];
14
+ export declare function createFile(filePath: string, sizeInMB: number): Promise<void>;
15
+ export declare function removeFile(filePath: string): void;
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.removeFile = exports.createFile = exports.getTestComponents = exports.ci_buildBranch = exports.ci_buildVersion = exports.renderService = exports.managementService = void 0;
7
+ const axios_1 = __importDefault(require("axios"));
8
+ const fs_1 = __importDefault(require("fs"));
9
+ const path_1 = __importDefault(require("path"));
10
+ const promises_1 = __importDefault(require("fs/promises"));
11
+ const crypto_1 = require("crypto");
12
+ const component_lib_1 = require("@squiz/component-lib");
13
+ const dotenv_1 = require("dotenv");
14
+ (0, dotenv_1.config)();
15
+ const configObj = {
16
+ managementServiceUrl: (0, component_lib_1.parseEnvVarForVar)('COMPONENT_MANAGEMENT_SERVICE_URL').replace(/\/+$/, ''),
17
+ renderServiceUrl: (0, component_lib_1.parseEnvVarForVar)('COMPONENT_RENDER_SERVICE_URL').replace(/\/+$/, ''),
18
+ ci_buildVersion: (0, component_lib_1.parseEnvVarForVar)('CI_COMMIT_SHORT_SHA'),
19
+ ci_buildBranch: (0, component_lib_1.parseEnvVarForVar)('CI_COMMIT_REF_NAME'),
20
+ };
21
+ exports.default = configObj;
22
+ exports.managementService = axios_1.default.create({
23
+ baseURL: configObj.managementServiceUrl,
24
+ });
25
+ exports.renderService = axios_1.default.create({
26
+ baseURL: configObj.renderServiceUrl,
27
+ });
28
+ exports.ci_buildVersion = configObj.ci_buildVersion;
29
+ exports.ci_buildBranch = configObj.ci_buildBranch;
30
+ function getTestComponents() {
31
+ const componets = [];
32
+ const componentsDir = path_1.default.join(__dirname, '/__components__/');
33
+ const files = fs_1.default.readdirSync(componentsDir);
34
+ for (const file of files) {
35
+ const stat = fs_1.default.statSync(path_1.default.join(componentsDir, file));
36
+ if (stat.isDirectory() && file.substring(0, 4) === 'cmp-') {
37
+ componets.push(file);
38
+ }
39
+ }
40
+ return componets;
41
+ }
42
+ exports.getTestComponents = getTestComponents;
43
+ async function createFile(filePath, sizeInMB) {
44
+ const content = (0, crypto_1.randomBytes)(sizeInMB * 1000000);
45
+ await promises_1.default.writeFile(`${filePath}`, content);
46
+ }
47
+ exports.createFile = createFile;
48
+ function removeFile(filePath) {
49
+ promises_1.default.unlink(filePath);
50
+ }
51
+ exports.removeFile = removeFile;
52
+ //# sourceMappingURL=helper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helper.js","sourceRoot":"","sources":["../../src/integration-tests/helper.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,4CAAoB;AACpB,gDAAwB;AAExB,2DAA8B;AAC9B,mCAAqC;AACrC,wDAAyD;AACzD,mCAAgC;AAEhC,IAAA,eAAM,GAAE,CAAC;AAST,MAAM,SAAS,GAAW;IACxB,oBAAoB,EAAE,IAAA,iCAAiB,EAAC,kCAAkC,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC;IAC/F,gBAAgB,EAAE,IAAA,iCAAiB,EAAC,8BAA8B,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC;IACvF,eAAe,EAAE,IAAA,iCAAiB,EAAC,qBAAqB,CAAC;IACzD,cAAc,EAAE,IAAA,iCAAiB,EAAC,oBAAoB,CAAC;CACxD,CAAC;AAEF,kBAAe,SAAS,CAAC;AAEZ,QAAA,iBAAiB,GAAG,eAAK,CAAC,MAAM,CAAC;IAC5C,OAAO,EAAE,SAAS,CAAC,oBAAoB;CACxC,CAAC,CAAC;AAEU,QAAA,aAAa,GAAG,eAAK,CAAC,MAAM,CAAC;IACxC,OAAO,EAAE,SAAS,CAAC,gBAAgB;CACpC,CAAC,CAAC;AAEU,QAAA,eAAe,GAAG,SAAS,CAAC,eAAe,CAAC;AAC5C,QAAA,cAAc,GAAG,SAAS,CAAC,cAAc,CAAC;AAEvD,SAAgB,iBAAiB;IAC/B,MAAM,SAAS,GAAG,EAAE,CAAC;IACrB,MAAM,aAAa,GAAG,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,kBAAkB,CAAC,CAAC;IAC/D,MAAM,KAAK,GAAG,YAAE,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC;IAC5C,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;QACxB,MAAM,IAAI,GAAG,YAAE,CAAC,QAAQ,CAAC,cAAI,CAAC,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC,CAAC;QACzD,IAAI,IAAI,CAAC,WAAW,EAAE,IAAI,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,MAAM,EAAE;YACzD,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;SACtB;KACF;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAXD,8CAWC;AACM,KAAK,UAAU,UAAU,CAAC,QAAgB,EAAE,QAAgB;IACjE,MAAM,OAAO,GAAG,IAAA,oBAAW,EAAC,QAAQ,GAAG,OAAO,CAAC,CAAC;IAChD,MAAM,kBAAG,CAAC,SAAS,CAAC,GAAG,QAAQ,EAAE,EAAE,OAAO,CAAC,CAAC;AAC9C,CAAC;AAHD,gCAGC;AAED,SAAgB,UAAU,CAAC,QAAgB;IACzC,kBAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;AACvB,CAAC;AAFD,gCAEC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const helper_1 = require("./helper");
4
+ describe('Verify latest services deployments', () => {
5
+ it('Should have latest Management API service', async () => {
6
+ const response = (await helper_1.managementService.get('/health')).data;
7
+ expect(response.buildVersion).toBe(helper_1.ci_buildVersion);
8
+ expect(response.buildBranch).toBe(helper_1.ci_buildBranch);
9
+ });
10
+ it('Should have latest Render Runtime service', async () => {
11
+ const response = (await helper_1.renderService.get('/health')).data;
12
+ expect(response.buildVersion).toBe(helper_1.ci_buildVersion);
13
+ expect(response.buildBranch).toBe(helper_1.ci_buildBranch);
14
+ });
15
+ });
16
+ //# sourceMappingURL=service-deployment.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"service-deployment.spec.js","sourceRoot":"","sources":["../../src/integration-tests/service-deployment.spec.ts"],"names":[],"mappings":";;AAAA,qCAA6F;AAQ7F,QAAQ,CAAC,oCAAoC,EAAE,GAAG,EAAE;IAClD,EAAE,CAAC,2CAA2C,EAAE,KAAK,IAAI,EAAE;QACzD,MAAM,QAAQ,GAAe,CAAC,MAAM,0BAAiB,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC;QAC3E,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,wBAAe,CAAC,CAAC;QACpD,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,uBAAc,CAAC,CAAC;IACpD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,2CAA2C,EAAE,KAAK,IAAI,EAAE;QACzD,MAAM,QAAQ,GAAe,CAAC,MAAM,sBAAa,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC;QACvE,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,wBAAe,CAAC,CAAC;QACpD,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,uBAAc,CAAC,CAAC;IACpD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
File without changes
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ jest.setTimeout(60000);
3
+ //# sourceMappingURL=test-setup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-setup.js","sourceRoot":"","sources":["../../src/integration-tests/test-setup.ts"],"names":[],"mappings":";AAAA,IAAI,CAAC,UAAU,CAAC,KAAM,CAAC,CAAC"}
@@ -0,0 +1,121 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ const index_1 = require("../index");
30
+ const helper_1 = __importStar(require("./helper"));
31
+ const cli_color_1 = __importDefault(require("cli-color"));
32
+ const path_1 = __importDefault(require("path"));
33
+ const supertest_1 = __importDefault(require("supertest"));
34
+ const mockConsoleError = jest.fn();
35
+ const mockConsoleLog = jest.fn();
36
+ const orgConsoleError = console.error;
37
+ afterAll(async () => {
38
+ // clean up the component added by the test
39
+ (0, helper_1.getTestComponents)().forEach(async (componentName) => {
40
+ try {
41
+ await helper_1.managementService.delete(`/component/${componentName}`);
42
+ }
43
+ catch {
44
+ // no op
45
+ }
46
+ });
47
+ });
48
+ describe('Test isolated test cases', () => {
49
+ beforeEach(() => {
50
+ console.error = mockConsoleError;
51
+ console.log = mockConsoleLog;
52
+ });
53
+ afterEach(() => {
54
+ console.error = orgConsoleError;
55
+ });
56
+ it('Should fail uploading a component without manifest.json', async () => {
57
+ mockConsoleError.mockClear();
58
+ const componentPath = path_1.default.join(__dirname, '/__components__/invalid-upload');
59
+ await (0, index_1.uploadComponentFolder)(componentPath, helper_1.default.managementServiceUrl, helper_1.default.renderServiceUrl);
60
+ expect(mockConsoleError.mock.calls[0][0]).toEqual(cli_color_1.default.red('manifest could not be found'));
61
+ });
62
+ it('Should fail uploading a component that has invalid manifest.json', async () => {
63
+ mockConsoleError.mockClear();
64
+ const componentPath = path_1.default.join(__dirname, '/__components__/invalid-manifest');
65
+ await (0, index_1.uploadComponentFolder)(componentPath, helper_1.default.managementServiceUrl, helper_1.default.renderServiceUrl);
66
+ expect(mockConsoleError.mock.calls[0][0]).toEqual(cli_color_1.default.red('/name: pattern must match pattern "^[a-zA-Z0-9_\\-]+$"'));
67
+ });
68
+ it('Should fail uploading the component that has size more than 100MB', async () => {
69
+ mockConsoleError.mockClear();
70
+ const componentPath = path_1.default.join(__dirname, '/__components__/big-package');
71
+ const filePath = `${componentPath}/105mb-file`;
72
+ await (0, helper_1.createFile)(filePath, 105); // Higher limit has been used because compression reduces the size if you use closer to 100MB
73
+ await (0, index_1.uploadComponentFolder)(componentPath, helper_1.default.managementServiceUrl, helper_1.default.renderServiceUrl);
74
+ expect(mockConsoleError.mock.calls[0][0]).toEqual(cli_color_1.default.red(['File size exceeds the maximum limit of 100MB'].join('')));
75
+ (0, helper_1.removeFile)(filePath);
76
+ });
77
+ });
78
+ describe('Deploy basic component having a static file', () => {
79
+ // component to deploy for this test
80
+ const componentPath = path_1.default.join(__dirname, '/__components__/cmp-static-file-test');
81
+ beforeAll(async () => {
82
+ try {
83
+ await helper_1.managementService.delete(`/component/cmp-static-file-test`);
84
+ }
85
+ catch {
86
+ // no op
87
+ }
88
+ });
89
+ beforeEach(() => {
90
+ console.error = mockConsoleError;
91
+ console.log = mockConsoleLog;
92
+ });
93
+ afterEach(() => {
94
+ console.error = orgConsoleError;
95
+ });
96
+ it('Should upload the component and return a valid url to preview', async () => {
97
+ var _a, _b;
98
+ mockConsoleLog.mockClear();
99
+ await (0, index_1.uploadComponentFolder)(componentPath, helper_1.default.managementServiceUrl, helper_1.default.renderServiceUrl);
100
+ const url = ((_a = /uploaded location: (.*)/.exec(mockConsoleLog.mock.lastCall)) === null || _a === void 0 ? void 0 : _a[1]) || '';
101
+ const uploadedComponent = '<a href="/r/set/cmp-static-file-test/1.0.0">1.0.0</a>';
102
+ const get = await (0, supertest_1.default)(url).get('/');
103
+ expect(get.status).toEqual(200);
104
+ expect((_b = get === null || get === void 0 ? void 0 : get.res) === null || _b === void 0 ? void 0 : _b.text).toContain(uploadedComponent);
105
+ });
106
+ it('Should fail upload the component with same version', async () => {
107
+ mockConsoleError.mockClear();
108
+ await (0, index_1.uploadComponentFolder)(componentPath, helper_1.default.managementServiceUrl, helper_1.default.renderServiceUrl);
109
+ expect(mockConsoleError.mock.calls[0][0]).toEqual(cli_color_1.default.red('Cannot upload component version, cmp-static-file-test 1.0.0 already exists'));
110
+ });
111
+ it('Should render component', async () => {
112
+ const response = await helper_1.renderService.get('/r/set/cmp-static-file-test/1.0.0/?something=hello');
113
+ expect(response.status).toEqual(200);
114
+ expect(response.data).toEqual([
115
+ '<div>Input: hello</div>',
116
+ '<div>cmp-static-file-test 1.0.0 ',
117
+ `${helper_1.default.renderServiceUrl}/s/cmp-static-file-test/1.0.0/birthday-cake.png</div>`,
118
+ ].join(''));
119
+ });
120
+ });
121
+ //# sourceMappingURL=upload-and-render-component.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upload-and-render-component.spec.js","sourceRoot":"","sources":["../../src/integration-tests/upload-and-render-component.spec.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oCAAiD;AACjD,mDAAkH;AAClH,0DAA8B;AAC9B,gDAAwB;AACxB,0DAAkC;AAElC,MAAM,gBAAgB,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;AACnC,MAAM,cAAc,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;AAEjC,MAAM,eAAe,GAAG,OAAO,CAAC,KAAK,CAAC;AAEtC,QAAQ,CAAC,KAAK,IAAI,EAAE;I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AC,CAAC,OAAO,CAC/C,mBAAK,CAAC,GAAG,CAAC,4EAA4E,CAAC,CACxF,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,yBAAyB,EAAE,KAAK,IAAI,EAAE;QACvC,MAAM,QAAQ,GAAG,MAAM,sBAAa,CAAC,GAAG,CAAC,oDAAoD,CAAC,CAAC;QAC/F,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QACrC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,CAC3B;YACE,yBAAyB;YACzB,kCAAkC;YAClC,GAAG,gBAAS,CAAC,gBAAgB,uDAAuD;SACrF,CAAC,IAAI,CAAC,EAAE,CAAC,CACX,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1 @@
1
+ export declare function uploadComponentFolder(folderPath: string, componentServiceManagementUrl: string, componentRenderServiceUrl: string): Promise<void>;
@@ -0,0 +1,125 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.uploadComponentFolder = void 0;
7
+ const virus_scanner_lib_1 = require("@squiz/virus-scanner-lib");
8
+ const component_lib_1 = require("@squiz/component-lib");
9
+ const promises_1 = __importDefault(require("fs/promises"));
10
+ const path_1 = __importDefault(require("path"));
11
+ const axios_1 = __importDefault(require("axios"));
12
+ const cli_color_1 = __importDefault(require("cli-color"));
13
+ async function uploadComponentFolder(folderPath, componentServiceManagementUrl, componentRenderServiceUrl) {
14
+ const tmpDir = path_1.default.resolve(await promises_1.default.mkdtemp('cmp-upload'));
15
+ try {
16
+ const axiosInstance = axios_1.default.create({
17
+ baseURL: componentServiceManagementUrl,
18
+ headers: {
19
+ 'content-type': 'application/json',
20
+ },
21
+ });
22
+ await preUploadChecks(folderPath, componentRenderServiceUrl);
23
+ console.log('Initial scanning');
24
+ const zip = await (0, component_lib_1.zipDirectory)(folderPath, tmpDir);
25
+ const initialUpload = await handleResponse(axiosInstance.post('upload-component'));
26
+ console.log(`deployment id: ${initialUpload.id} status: transferring`);
27
+ await (0, virus_scanner_lib_1.uploadFile)(initialUpload, zip);
28
+ await watchAndWaitForUploadAndScanComplete(initialUpload.id, axiosInstance);
29
+ console.log(`deployment id: ${initialUpload.id} status: deploying component folder`);
30
+ const result = await handleResponse(axiosInstance.post(`upload-component/next/${initialUpload.id}`));
31
+ await promises_1.default.rm(tmpDir, { force: true, recursive: true });
32
+ if (result.status === 'successful') {
33
+ console.log(`deployment id: ${initialUpload.id} status: ${cli_color_1.default.green('success')}`);
34
+ console.log(`uploaded location: ${result.accessLink}`);
35
+ }
36
+ else {
37
+ console.error('failed for an unknown reason', cli_color_1.default.red(result));
38
+ }
39
+ }
40
+ catch (e) {
41
+ await promises_1.default.rm(tmpDir, { force: true, recursive: true });
42
+ if (e instanceof Error) {
43
+ console.error(cli_color_1.default.red(e.message));
44
+ }
45
+ else {
46
+ throw e;
47
+ }
48
+ }
49
+ }
50
+ exports.uploadComponentFolder = uploadComponentFolder;
51
+ async function preUploadChecks(folderPath, renderService) {
52
+ const result = await (0, component_lib_1.loadManifest)(path_1.default.join(folderPath, `manifest.json`));
53
+ if (await checkIfVersionExists(result, renderService)) {
54
+ throw new Error(`Cannot upload component version, ${result.name} ${result.version} already exists`);
55
+ }
56
+ }
57
+ async function checkIfVersionExists(inputManifest, renderService) {
58
+ const axiosInstance = axios_1.default.create({
59
+ baseURL: renderService,
60
+ });
61
+ try {
62
+ const response = await axiosInstance.get(`d/${inputManifest.name}/${inputManifest.version}/manifest.json`);
63
+ if (response.status === 200) {
64
+ return true;
65
+ }
66
+ throw new Error(`Unexpected response code ${response.status}`);
67
+ }
68
+ catch (error) {
69
+ if (isAxiosError(error)) {
70
+ const { response } = error;
71
+ if ((response === null || response === void 0 ? void 0 : response.status) === 404) {
72
+ return false;
73
+ }
74
+ }
75
+ throw error;
76
+ }
77
+ }
78
+ async function watchAndWaitForUploadAndScanComplete(id, axiosInstance) {
79
+ const poll = () => handleResponse(axiosInstance.get('upload-component/status/' + id));
80
+ return new Promise((resolve, reject) => {
81
+ const recurse = () => poll().then(async (req) => {
82
+ if (req.status == 'Success') {
83
+ resolve();
84
+ }
85
+ else if (req.status == 'Flagged') {
86
+ reject(new Error('upload has been flagged as a virus'));
87
+ }
88
+ else if (req.status == 'Error') {
89
+ reject(new Error('there has been an error'));
90
+ }
91
+ else {
92
+ setTimeout(async () => {
93
+ await recurse();
94
+ }, 1000);
95
+ }
96
+ });
97
+ recurse();
98
+ });
99
+ }
100
+ async function handleResponse(axiosInstance) {
101
+ try {
102
+ const response = await axiosInstance;
103
+ return response.data;
104
+ }
105
+ catch (error) {
106
+ throw handleError(error);
107
+ }
108
+ }
109
+ function handleError(error) {
110
+ const { response } = error;
111
+ if (!response || !isAxiosError(error)) {
112
+ return error;
113
+ }
114
+ const message = response.data.message;
115
+ if (message) {
116
+ return new Error(`Unexpected response code ${response.status}. message: ${message}`);
117
+ }
118
+ else {
119
+ return new Error(`Unexpected response code ${response.status}.`);
120
+ }
121
+ }
122
+ function isAxiosError(error) {
123
+ return error && error.isAxiosError === true;
124
+ }
125
+ //# sourceMappingURL=upload-component-folder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upload-component-folder.js","sourceRoot":"","sources":["../src/upload-component-folder.ts"],"names":[],"mappings":";;;;;;AAAA,gEAAkE;AAClE,wDAAkE;AAElE,2DAA8B;AAC9B,gDAAwB;AACxB,kDAAwE;AACxE,0DAA8B;AAEvB,KAAK,UAAU,qBAAqB,CACzC,UAAkB,EAClB,6BAAqC,EACrC,yBAAiC;IAEjC,MAAM,MAAM,GAAG,cAAI,CAAC,OAAO,CAAC,MAAM,kBAAG,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC;IAE7D,IAAI;QACF,MAAM,aAAa,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AAW,CAAC,KAAK,CAAC,CAAC;KAC1B;AACH,CAAC;AAED,SAAS,WAAW,CAAC,KAAU;IAC7B,MAAM,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IAC3B,IAAI,CAAC,QAAQ,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE;QACrC,OAAO,KAAK,CAAC;KACd;IACD,MAAM,OAAO,GAAI,QAAQ,CAAC,IAAY,CAAC,OAAO,CAAC;IAC/C,IAAI,OAAO,EAAE;QACX,OAAO,IAAI,KAAK,CAAC,4BAA4B,QAAQ,CAAC,MAAM,cAAc,OAAO,EAAE,CAAC,CAAC;KACtF;SAAM;QACL,OAAO,IAAI,KAAK,CAAC,4BAA4B,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC;KAClE;AACH,CAAC;AAED,SAAS,YAAY,CAAC,KAAU;IAC9B,OAAO,KAAK,IAAI,KAAK,CAAC,YAAY,KAAK,IAAI,CAAC;AAC9C,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@squiz/component-cli-lib",
3
- "version": "1.2.1-alpha.89",
3
+ "version": "1.2.1-alpha.91",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {
@@ -28,13 +28,13 @@
28
28
  "typescript": "4.7.4"
29
29
  },
30
30
  "dependencies": {
31
- "@squiz/component-lib": "^1.2.1-alpha.89",
32
- "@squiz/render-runtime-lib": "^1.2.1-alpha.89",
33
- "@squiz/virus-scanner-lib": "^1.2.1-alpha.89",
31
+ "@squiz/component-lib": "^1.2.1-alpha.90",
32
+ "@squiz/render-runtime-lib": "^1.2.1-alpha.90",
33
+ "@squiz/virus-scanner-lib": "^1.2.1-alpha.90",
34
34
  "archiver": "5.3.1",
35
35
  "axios": "0.27.2",
36
36
  "cli-color": "^2.0.2",
37
37
  "supertest": "^6.2.3"
38
38
  },
39
- "gitHead": "d42ff3393c6e336ee05519872dbb58112ef045d1"
39
+ "gitHead": "69ee5eb2a6fbdee079abd80fa3d3241233071cea"
40
40
  }
@@ -1,20 +1,40 @@
1
1
  import axios from 'axios';
2
2
  import fs from 'fs';
3
3
  import path from 'path';
4
- import configVars from '../config';
4
+
5
5
  import fsp from 'fs/promises';
6
6
  import { randomBytes } from 'crypto';
7
+ import { parseEnvVarForVar } from '@squiz/component-lib';
8
+ import { config } from 'dotenv';
9
+
10
+ config();
11
+
12
+ interface Config {
13
+ managementServiceUrl: string;
14
+ renderServiceUrl: string;
15
+ ci_buildVersion: string;
16
+ ci_buildBranch: string;
17
+ }
18
+
19
+ const configObj: Config = {
20
+ managementServiceUrl: parseEnvVarForVar('COMPONENT_MANAGEMENT_SERVICE_URL').replace(/\/+$/, ''),
21
+ renderServiceUrl: parseEnvVarForVar('COMPONENT_RENDER_SERVICE_URL').replace(/\/+$/, ''),
22
+ ci_buildVersion: parseEnvVarForVar('CI_COMMIT_SHORT_SHA'),
23
+ ci_buildBranch: parseEnvVarForVar('CI_COMMIT_REF_NAME'),
24
+ };
25
+
26
+ export default configObj;
7
27
 
8
28
  export const managementService = axios.create({
9
- baseURL: configVars.managementServiceUrl,
29
+ baseURL: configObj.managementServiceUrl,
10
30
  });
11
31
 
12
32
  export const renderService = axios.create({
13
- baseURL: configVars.renderServiceUrl,
33
+ baseURL: configObj.renderServiceUrl,
14
34
  });
15
35
 
16
- export const ci_buildVersion = configVars.ci_buildVersion;
17
- export const ci_buildBranch = configVars.ci_buildBranch;
36
+ export const ci_buildVersion = configObj.ci_buildVersion;
37
+ export const ci_buildBranch = configObj.ci_buildBranch;
18
38
 
19
39
  export function getTestComponents(): string[] {
20
40
  const componets = [];
@@ -1,6 +1,5 @@
1
1
  import { uploadComponentFolder } from '../index';
2
- import { renderService, managementService, getTestComponents, createFile, removeFile } from './helper';
3
- import configVars from '../config';
2
+ import configObj, { renderService, managementService, getTestComponents, createFile, removeFile } from './helper';
4
3
  import color from 'cli-color';
5
4
  import path from 'path';
6
5
  import supertest from 'supertest';
@@ -34,14 +33,14 @@ describe('Test isolated test cases', () => {
34
33
  it('Should fail uploading a component without manifest.json', async () => {
35
34
  mockConsoleError.mockClear();
36
35
  const componentPath = path.join(__dirname, '/__components__/invalid-upload');
37
- await uploadComponentFolder(componentPath, configVars.managementServiceUrl);
36
+ await uploadComponentFolder(componentPath, configObj.managementServiceUrl, configObj.renderServiceUrl);
38
37
  expect(mockConsoleError.mock.calls[0][0]).toEqual(color.red('manifest could not be found'));
39
38
  });
40
39
 
41
40
  it('Should fail uploading a component that has invalid manifest.json', async () => {
42
41
  mockConsoleError.mockClear();
43
42
  const componentPath = path.join(__dirname, '/__components__/invalid-manifest');
44
- await uploadComponentFolder(componentPath, configVars.managementServiceUrl);
43
+ await uploadComponentFolder(componentPath, configObj.managementServiceUrl, configObj.renderServiceUrl);
45
44
  expect(mockConsoleError.mock.calls[0][0]).toEqual(
46
45
  color.red('/name: pattern must match pattern "^[a-zA-Z0-9_\\-]+$"'),
47
46
  );
@@ -52,7 +51,7 @@ describe('Test isolated test cases', () => {
52
51
  const componentPath = path.join(__dirname, '/__components__/big-package');
53
52
  const filePath = `${componentPath}/105mb-file`;
54
53
  await createFile(filePath, 105); // Higher limit has been used because compression reduces the size if you use closer to 100MB
55
- await uploadComponentFolder(componentPath, configVars.managementServiceUrl);
54
+ await uploadComponentFolder(componentPath, configObj.managementServiceUrl, configObj.renderServiceUrl);
56
55
  expect(mockConsoleError.mock.calls[0][0]).toEqual(
57
56
  color.red(['File size exceeds the maximum limit of 100MB'].join('')),
58
57
  );
@@ -83,7 +82,7 @@ describe('Deploy basic component having a static file', () => {
83
82
 
84
83
  it('Should upload the component and return a valid url to preview', async () => {
85
84
  mockConsoleLog.mockClear();
86
- await uploadComponentFolder(componentPath, configVars.managementServiceUrl);
85
+ await uploadComponentFolder(componentPath, configObj.managementServiceUrl, configObj.renderServiceUrl);
87
86
 
88
87
  const url = /uploaded location: (.*)/.exec(mockConsoleLog.mock.lastCall)?.[1] || '';
89
88
  const uploadedComponent = '<a href="/r/set/cmp-static-file-test/1.0.0">1.0.0</a>';
@@ -95,7 +94,7 @@ describe('Deploy basic component having a static file', () => {
95
94
 
96
95
  it('Should fail upload the component with same version', async () => {
97
96
  mockConsoleError.mockClear();
98
- await uploadComponentFolder(componentPath, configVars.managementServiceUrl);
97
+ await uploadComponentFolder(componentPath, configObj.managementServiceUrl, configObj.renderServiceUrl);
99
98
  expect(mockConsoleError.mock.calls[0][0]).toEqual(
100
99
  color.red('Cannot upload component version, cmp-static-file-test 1.0.0 already exists'),
101
100
  );
@@ -108,7 +107,7 @@ describe('Deploy basic component having a static file', () => {
108
107
  [
109
108
  '<div>Input: hello</div>',
110
109
  '<div>cmp-static-file-test 1.0.0 ',
111
- `${configVars.renderServiceUrl}/s/cmp-static-file-test/1.0.0/birthday-cake.png</div>`,
110
+ `${configObj.renderServiceUrl}/s/cmp-static-file-test/1.0.0/birthday-cake.png</div>`,
112
111
  ].join(''),
113
112
  );
114
113
  });
@@ -1,13 +1,16 @@
1
1
  import { ScanStatus, uploadFile } from '@squiz/virus-scanner-lib';
2
2
  import { loadManifest, zipDirectory } from '@squiz/component-lib';
3
+ import { V1 } from '@squiz/component-lib';
3
4
  import fsp from 'fs/promises';
4
5
  import path from 'path';
5
6
  import axios, { AxiosResponse, AxiosError, AxiosInstance } from 'axios';
6
7
  import color from 'cli-color';
7
- import configObj from './config';
8
- import { V1 } from '@squiz/component-lib';
9
8
 
10
- export async function uploadComponentFolder(folderPath: string, componentServiceManagementUrl: string): Promise<void> {
9
+ export async function uploadComponentFolder(
10
+ folderPath: string,
11
+ componentServiceManagementUrl: string,
12
+ componentRenderServiceUrl: string,
13
+ ): Promise<void> {
11
14
  const tmpDir = path.resolve(await fsp.mkdtemp('cmp-upload'));
12
15
 
13
16
  try {
@@ -18,7 +21,7 @@ export async function uploadComponentFolder(folderPath: string, componentService
18
21
  },
19
22
  });
20
23
 
21
- await preUploadChecks(folderPath);
24
+ await preUploadChecks(folderPath, componentRenderServiceUrl);
22
25
  console.log('Initial scanning');
23
26
  const zip = await zipDirectory(folderPath, tmpDir);
24
27
 
@@ -51,16 +54,16 @@ export async function uploadComponentFolder(folderPath: string, componentService
51
54
  }
52
55
  }
53
56
 
54
- async function preUploadChecks(folderPath: string) {
57
+ async function preUploadChecks(folderPath: string, renderService: string) {
55
58
  const result = await loadManifest(path.join(folderPath, `manifest.json`));
56
- if (await checkIfVersionExists(result)) {
59
+ if (await checkIfVersionExists(result, renderService)) {
57
60
  throw new Error(`Cannot upload component version, ${result.name} ${result.version} already exists`);
58
61
  }
59
62
  }
60
63
 
61
- async function checkIfVersionExists(inputManifest: V1) {
64
+ async function checkIfVersionExists(inputManifest: V1, renderService: string) {
62
65
  const axiosInstance = axios.create({
63
- baseURL: configObj.renderServiceUrl,
66
+ baseURL: renderService,
64
67
  });
65
68
 
66
69
  try {
@@ -0,0 +1 @@
1
+ {"program":{"fileNames":["./node_modules/typescript/lib/lib.es5.d.ts","./node_modules/typescript/lib/lib.es2015.d.ts","./node_modules/typescript/lib/lib.es2016.d.ts","./node_modules/typescript/lib/lib.es2017.d.ts","./node_modules/typescript/lib/lib.es2018.d.ts","./node_modules/typescript/lib/lib.es2019.d.ts","./node_modules/typescript/lib/lib.es2020.d.ts","./node_modules/typescript/lib/lib.dom.d.ts","./node_modules/typescript/lib/lib.dom.iterable.d.ts","./node_modules/typescript/lib/lib.webworker.importscripts.d.ts","./node_modules/typescript/lib/lib.scripthost.d.ts","./node_modules/typescript/lib/lib.es2015.core.d.ts","./node_modules/typescript/lib/lib.es2015.collection.d.ts","./node_modules/typescript/lib/lib.es2015.generator.d.ts","./node_modules/typescript/lib/lib.es2015.iterable.d.ts","./node_modules/typescript/lib/lib.es2015.promise.d.ts","./node_modules/typescript/lib/lib.es2015.proxy.d.ts","./node_modules/typescript/lib/lib.es2015.reflect.d.ts","./node_modules/typescript/lib/lib.es2015.symbol.d.ts","./node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","./node_modules/typescript/lib/lib.es2016.array.include.d.ts","./node_modules/typescript/lib/lib.es2017.object.d.ts","./node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","./node_modules/typescript/lib/lib.es2017.string.d.ts","./node_modules/typescript/lib/lib.es2017.intl.d.ts","./node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","./node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","./node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","./node_modules/typescript/lib/lib.es2018.intl.d.ts","./node_modules/typescript/lib/lib.es2018.promise.d.ts","./node_modules/typescript/lib/lib.es2018.regexp.d.ts","./node_modules/typescript/lib/lib.es2019.array.d.ts","./node_modules/typescript/lib/lib.es2019.object.d.ts","./node_modules/typescript/lib/lib.es2019.string.d.ts","./node_modules/typescript/lib/lib.es2019.symbol.d.ts","./node_modules/typescript/lib/lib.es2020.bigint.d.ts","./node_modules/typescript/lib/lib.es2020.date.d.ts","./node_modules/typescript/lib/lib.es2020.promise.d.ts","./node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","./node_modules/typescript/lib/lib.es2020.string.d.ts","./node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","./node_modules/typescript/lib/lib.es2020.intl.d.ts","./node_modules/typescript/lib/lib.es2020.number.d.ts","./node_modules/typescript/lib/lib.esnext.intl.d.ts","./node_modules/typescript/lib/lib.es2019.full.d.ts","../component-lib/lib/manifest-schemas/v1.d.ts","../component-lib/lib/Manifest.d.ts","../component-lib/node_modules/uri-js/dist/es5/uri.all.d.ts","../component-lib/node_modules/ajv/dist/compile/codegen/code.d.ts","../component-lib/node_modules/ajv/dist/compile/codegen/scope.d.ts","../component-lib/node_modules/ajv/dist/compile/codegen/index.d.ts","../component-lib/node_modules/ajv/dist/compile/rules.d.ts","../component-lib/node_modules/ajv/dist/compile/util.d.ts","../component-lib/node_modules/ajv/dist/compile/validate/subschema.d.ts","../component-lib/node_modules/ajv/dist/compile/errors.d.ts","../component-lib/node_modules/ajv/dist/compile/validate/index.d.ts","../component-lib/node_modules/ajv/dist/compile/validate/dataType.d.ts","../component-lib/node_modules/ajv/dist/vocabularies/applicator/additionalItems.d.ts","../component-lib/node_modules/ajv/dist/vocabularies/applicator/items2020.d.ts","../component-lib/node_modules/ajv/dist/vocabularies/applicator/contains.d.ts","../component-lib/node_modules/ajv/dist/vocabularies/applicator/dependencies.d.ts","../component-lib/node_modules/ajv/dist/vocabularies/applicator/propertyNames.d.ts","../component-lib/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.d.ts","../component-lib/node_modules/ajv/dist/vocabularies/applicator/not.d.ts","../component-lib/node_modules/ajv/dist/vocabularies/applicator/anyOf.d.ts","../component-lib/node_modules/ajv/dist/vocabularies/applicator/oneOf.d.ts","../component-lib/node_modules/ajv/dist/vocabularies/applicator/if.d.ts","../component-lib/node_modules/ajv/dist/vocabularies/applicator/index.d.ts","../component-lib/node_modules/ajv/dist/vocabularies/validation/limitNumber.d.ts","../component-lib/node_modules/ajv/dist/vocabularies/validation/multipleOf.d.ts","../component-lib/node_modules/ajv/dist/vocabularies/validation/pattern.d.ts","../component-lib/node_modules/ajv/dist/vocabularies/validation/required.d.ts","../component-lib/node_modules/ajv/dist/vocabularies/validation/uniqueItems.d.ts","../component-lib/node_modules/ajv/dist/vocabularies/validation/const.d.ts","../component-lib/node_modules/ajv/dist/vocabularies/validation/enum.d.ts","../component-lib/node_modules/ajv/dist/vocabularies/validation/index.d.ts","../component-lib/node_modules/ajv/dist/vocabularies/format/format.d.ts","../component-lib/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.d.ts","../component-lib/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.d.ts","../component-lib/node_modules/ajv/dist/vocabularies/validation/dependentRequired.d.ts","../component-lib/node_modules/ajv/dist/vocabularies/discriminator/types.d.ts","../component-lib/node_modules/ajv/dist/vocabularies/discriminator/index.d.ts","../component-lib/node_modules/ajv/dist/vocabularies/errors.d.ts","../component-lib/node_modules/ajv/dist/types/json-schema.d.ts","../component-lib/node_modules/ajv/dist/types/jtd-schema.d.ts","../component-lib/node_modules/ajv/dist/runtime/validation_error.d.ts","../component-lib/node_modules/ajv/dist/compile/ref_error.d.ts","../component-lib/node_modules/ajv/dist/core.d.ts","../component-lib/node_modules/ajv/dist/compile/resolve.d.ts","../component-lib/node_modules/ajv/dist/compile/index.d.ts","../component-lib/node_modules/ajv/dist/types/index.d.ts","../component-lib/node_modules/ajv/dist/ajv.d.ts","../component-lib/lib/validator/schemas.d.ts","../component-lib/lib/validator/ValidationFailure.d.ts","../component-lib/lib/validator/ValidationSuccess.d.ts","../component-lib/lib/validator/validateManifest.d.ts","../component-lib/lib/validator/isValidationFailure.d.ts","../component-lib/lib/component-sets/loadComponentSet.d.ts","../component-lib/lib/loaders/LoadedComponent.d.ts","../component-lib/lib/loaders/loadComponent.d.ts","../component-lib/lib/loaders/loadManifest.d.ts","./node_modules/@types/node/assert.d.ts","./node_modules/@types/node/assert/strict.d.ts","./node_modules/@types/node/globals.d.ts","./node_modules/@types/node/async_hooks.d.ts","./node_modules/@types/node/buffer.d.ts","./node_modules/@types/node/child_process.d.ts","./node_modules/@types/node/cluster.d.ts","./node_modules/@types/node/console.d.ts","./node_modules/@types/node/constants.d.ts","./node_modules/@types/node/crypto.d.ts","./node_modules/@types/node/dgram.d.ts","./node_modules/@types/node/diagnostics_channel.d.ts","./node_modules/@types/node/dns.d.ts","./node_modules/@types/node/dns/promises.d.ts","./node_modules/@types/node/domain.d.ts","./node_modules/@types/node/events.d.ts","./node_modules/@types/node/fs.d.ts","./node_modules/@types/node/fs/promises.d.ts","./node_modules/@types/node/http.d.ts","./node_modules/@types/node/http2.d.ts","./node_modules/@types/node/https.d.ts","./node_modules/@types/node/inspector.d.ts","./node_modules/@types/node/module.d.ts","./node_modules/@types/node/net.d.ts","./node_modules/@types/node/os.d.ts","./node_modules/@types/node/path.d.ts","./node_modules/@types/node/perf_hooks.d.ts","./node_modules/@types/node/process.d.ts","./node_modules/@types/node/punycode.d.ts","./node_modules/@types/node/querystring.d.ts","./node_modules/@types/node/readline.d.ts","./node_modules/@types/node/repl.d.ts","./node_modules/@types/node/stream.d.ts","./node_modules/@types/node/stream/promises.d.ts","./node_modules/@types/node/stream/consumers.d.ts","./node_modules/@types/node/stream/web.d.ts","./node_modules/@types/node/string_decoder.d.ts","./node_modules/@types/node/timers.d.ts","./node_modules/@types/node/timers/promises.d.ts","./node_modules/@types/node/tls.d.ts","./node_modules/@types/node/trace_events.d.ts","./node_modules/@types/node/tty.d.ts","./node_modules/@types/node/url.d.ts","./node_modules/@types/node/util.d.ts","./node_modules/@types/node/v8.d.ts","./node_modules/@types/node/vm.d.ts","./node_modules/@types/node/wasi.d.ts","./node_modules/@types/node/worker_threads.d.ts","./node_modules/@types/node/zlib.d.ts","./node_modules/@types/node/globals.global.d.ts","./node_modules/@types/node/index.d.ts","./node_modules/@types/range-parser/index.d.ts","./node_modules/@types/qs/index.d.ts","./node_modules/@types/express-serve-static-core/index.d.ts","./node_modules/@types/mime/Mime.d.ts","./node_modules/@types/mime/index.d.ts","./node_modules/@types/serve-static/index.d.ts","../component-lib/node_modules/@types/connect/index.d.ts","../component-lib/node_modules/@types/body-parser/index.d.ts","../component-lib/node_modules/@types/serve-static/index.d.ts","../component-lib/node_modules/@types/express-serve-static-core/index.d.ts","../component-lib/node_modules/@types/qs/index.d.ts","../component-lib/node_modules/@types/express/index.d.ts","../component-lib/lib/server-utils/errorMiddleware.d.ts","../component-lib/lib/server-utils/requestLogger.d.ts","../component-lib/lib/zip/zipDirectory.d.ts","../component-lib/lib/error/ErrorWithHttpStatusCode.d.ts","../component-lib/lib/error/BadRequestError.d.ts","../component-lib/lib/error/InternalServerError.d.ts","../component-lib/lib/error/ResourceNotFoundError.d.ts","../component-lib/lib/error/TimeoutError.d.ts","../component-lib/lib/error/ComponentError.d.ts","../component-lib/lib/error/index.d.ts","../component-lib/lib/component-context/createComponentContext.d.ts","../component-lib/lib/util/joinAbsoluteUrlPath.d.ts","../component-lib/lib/util/parseEnvVarForVar.d.ts","../component-lib/lib/util/getNodeEnv.d.ts","../component-lib/lib/util/isPathTryingToAccessOutsideOfRoot.d.ts","../db-lib/node_modules/pg-types/index.d.ts","../db-lib/node_modules/pg-protocol/dist/messages.d.ts","../db-lib/node_modules/pg-protocol/dist/serializer.d.ts","../db-lib/node_modules/pg-protocol/dist/parser.d.ts","../db-lib/node_modules/pg-protocol/dist/index.d.ts","../db-lib/node_modules/@types/pg/index.d.ts","../db-lib/lib/Repositories.d.ts","../db-lib/lib/AbstractRepository.d.ts","../db-lib/lib/ConnectionManager.d.ts","../db-lib/lib/Migrator.d.ts","../db-lib/lib/getConnectionInfo.d.ts","../db-lib/lib/index.d.ts","../component-db-lib/node_modules/@types/pg/index.d.ts","../component-db-lib/lib/domains/component/models/Component.d.ts","../component-db-lib/lib/domains/component/repositories/ComponentRepository.d.ts","../component-db-lib/lib/domains/component/models/ComponentVersion.d.ts","../component-db-lib/lib/domains/component/repositories/ComponentVersionRepository.d.ts","../component-db-lib/lib/domains/component/models/ComponentSet.d.ts","../component-db-lib/lib/domains/component/repositories/ComponentSetRepository.d.ts","../component-db-lib/lib/domains/component/models/ComponentSetComponentVersion.d.ts","../component-db-lib/lib/domains/component/repositories/ComponentSetComponentVersionRepository.d.ts","../component-db-lib/lib/ComponentRepositories.d.ts","../component-db-lib/lib/ComponentConnectionManager.d.ts","../component-db-lib/lib/createConnectionManager.d.ts","../component-db-lib/lib/index.d.ts","../component-lib/lib/component-service/services/ComponentService.d.ts","../component-lib/lib/component-service/models/ComponentSet.d.ts","../component-lib/lib/component-service/services/ComponentSetService.d.ts","../component-lib/lib/component-service/services/index.d.ts","../component-lib/lib/component-service/models/ComponentSetComponentVersion.d.ts","../component-lib/lib/component-service/models/index.d.ts","../component-lib/lib/index.d.ts","../render-runtime-lib/lib/component-runner/index.d.ts","../render-runtime-lib/lib/webserver/index.d.ts","../render-runtime-lib/lib/test/helpers/fixtures.d.ts","../render-runtime-lib/node_modules/@types/cookiejar/index.d.ts","../render-runtime-lib/node_modules/@types/superagent/index.d.ts","../render-runtime-lib/node_modules/@types/supertest/index.d.ts","../render-runtime-lib/lib/test/helpers/stack.d.ts","../render-runtime-lib/lib/test/index.d.ts","../render-runtime-lib/lib/webserver/controllers/test/definition-route-tests.d.ts","../render-runtime-lib/lib/webserver/controllers/test/static-route-tests.d.ts","../render-runtime-lib/lib/webserver/controllers/test/render-route-tests.d.ts","../render-runtime-lib/lib/index.d.ts","./src/component-dev.ts","./node_modules/@types/supertest/index.d.ts","./src/component-dev.spec.ts","../virus-scanner-lib/node_modules/axios/index.d.ts","../virus-scanner-lib/lib/generated/models/InitialScan.d.ts","../virus-scanner-lib/lib/generated/models/ScanStatus.d.ts","../virus-scanner-lib/lib/generated/schemas/$InitialScan.d.ts","../virus-scanner-lib/lib/generated/schemas/$ScanStatus.d.ts","../virus-scanner-lib/lib/generated/index.d.ts","../virus-scanner-lib/lib/VirusScanner.d.ts","../virus-scanner-lib/lib/uploadFile.d.ts","../virus-scanner-lib/lib/index.d.ts","./node_modules/axios/index.d.ts","./node_modules/@types/cli-color/art.d.ts","./node_modules/@types/cli-color/bare.d.ts","./node_modules/@types/cli-color/beep.d.ts","./node_modules/@types/cli-color/columns.d.ts","./node_modules/@types/cli-color/erase.d.ts","./node_modules/@types/cli-color/move.d.ts","./node_modules/@types/cli-color/get-stripped-length.d.ts","./node_modules/@types/cli-color/slice.d.ts","./node_modules/@types/cli-color/strip.d.ts","./node_modules/@types/cli-color/throbber.d.ts","./node_modules/@types/cli-color/reset.d.ts","./node_modules/@types/cli-color/window-size.d.ts","./node_modules/@types/cli-color/index.d.ts","./src/upload-component-folder.ts","./src/index.ts","./node_modules/dotenv/lib/main.d.ts","./src/integration-tests/helper.ts","./src/integration-tests/service-deployment.spec.ts","./src/integration-tests/test-setup.ts","./src/integration-tests/upload-and-render-component.spec.ts","./src/integration-tests/__components__/big-package/manifest.json","./src/integration-tests/__components__/cmp-static-file-test/manifest.json","./src/integration-tests/__components__/invalid-manifest/manifest.json","./node_modules/chalk/index.d.ts","./node_modules/@sinclair/typebox/typebox.d.ts","./node_modules/@jest/schemas/build/index.d.ts","./node_modules/pretty-format/build/index.d.ts","./node_modules/jest-diff/build/index.d.ts","./node_modules/jest-matcher-utils/build/index.d.ts","./node_modules/@types/jest/index.d.ts","../render-runtime-lib/node_modules/@types/node/index.d.ts"],"fileInfos":[{"version":"f5c28122bee592cfaf5c72ed7bcc47f453b79778ffa6e301f45d21a0970719d4","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","e6b724280c694a9f588847f754198fb96c43d805f065c3a5b28bbc9594541c84","1fc5ab7a764205c68fa10d381b08417795fc73111d6dd16b5b1ed36badb743d9",{"version":"3f149f903dd20dfeb7c80e228b659f0e436532de772469980dbd00702cc05cc1","affectsGlobalScope":true},{"version":"1272277fe7daa738e555eb6cc45ded42cc2d0f76c07294142283145d49e96186","affectsGlobalScope":true},{"version":"7fac8cb5fc820bc2a59ae11ef1c5b38d3832c6d0dfaec5acdb5569137d09a481","affectsGlobalScope":true},{"version":"097a57355ded99c68e6df1b738990448e0bf170e606707df5a7c0481ff2427cd","affectsGlobalScope":true},{"version":"adb996790133eb33b33aadb9c09f15c2c575e71fb57a62de8bf74dbf59ec7dfb","affectsGlobalScope":true},{"version":"43fb1d932e4966a39a41b464a12a81899d9ae5f2c829063f5571b6b87e6d2f9c","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"c5c05907c02476e4bde6b7e76a79ffcd948aedd14b6a8f56e4674221b0417398","affectsGlobalScope":true},{"version":"0d5f52b3174bee6edb81260ebcd792692c32c81fd55499d69531496f3f2b25e7","affectsGlobalScope":true},{"version":"810627a82ac06fb5166da5ada4159c4ec11978dfbb0805fe804c86406dab8357","affectsGlobalScope":true},{"version":"181f1784c6c10b751631b24ce60c7f78b20665db4550b335be179217bacc0d5f","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"75ec0bdd727d887f1b79ed6619412ea72ba3c81d92d0787ccb64bab18d261f14","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"12a310447c5d23c7d0d5ca2af606e3bd08afda69100166730ab92c62999ebb9d","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"d154ea5bb7f7f9001ed9153e876b2d5b8f5c2bb9ec02b3ae0d239ec769f1f2ae","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"6e7997ef61de3132e4d4b2250e75343f487903ddf5370e7ce33cf1b9db9a63ed","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"09aa50414b80c023553090e2f53827f007a301bc34b0495bfb2c3c08ab9ad1eb","affectsGlobalScope":true},{"version":"d7f680a43f8cd12a6b6122c07c54ba40952b0c8aa140dcfcf32eb9e6cb028596","affectsGlobalScope":true},{"version":"3787b83e297de7c315d55d4a7c546ae28e5f6c0a361b7a1dcec1f1f50a54ef11","affectsGlobalScope":true},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true},{"version":"cd483c056da900716879771893a3c9772b66c3c88f8943b4205aec738a94b1d0","affectsGlobalScope":true},{"version":"b248e32ca52e8f5571390a4142558ae4f203ae2f94d5bac38a3084d529ef4e58","affectsGlobalScope":true},{"version":"c37f8a49593a0030eecb51bbfa270e709bec9d79a6cc3bb851ef348d4e6b26f8","affectsGlobalScope":true},"1f03b495671c3a1bd24510f38b8947f0991dfd6bf0278c68eca14af15b306e1f","5e723070f090b6dc5210efbca97c13d4f18102fc8edcf9359c03d203c9c9db6b","3f28cb39b92af8c1fa0577f97f78649dd1088f7034bad4c2447eb247973d33a0","9f3c5498245c38c9016a369795ec5ef1768d09db63643c8dba9656e5ab294825","44a8d350600656882fd7462774e32e8d13788313ba2e36d2e8d5437ac91b98df","60bb0e47502bf8716d1230288b4e6387c1d34cded12752ab5338108e2e662e67","b8870b5155d11a273c75718a4f19026da49f91c548703858cd3400d06c3bd3b8","b3ae4ded82f27cabba780b9af9647f6e08c9a4cabe8fbb7a0cca69c7add9ef4b","8d26ae32e5c9c080e44aee4a67e5ef02b5fda0604e6fecbb7b753c537e5282d9","05c4e792dae38912ba333725cdf8c42d242337d006c0d887f4ce5a7787871a95","cd44995ee13d5d23df17a10213fed7b483fabfd5ea08f267ab52c07ce0b6b4da","58ce1486f851942bd2d3056b399079bc9cb978ec933fe9833ea417e33eab676e","1a23b521db8d7ec9e2b96c6fbd4c7e96d12f408b1e03661b3b9f7da7291103e6","d3d0d11d30c9878ada3356b9c36a2754b8c7b6204a41c86bfb1488c08ce263b0","a6493f1f479637ed89a3ebec03f6dc117e3b1851d7e938ac4c8501396b8639a8","ae0951e44973e928fe2e999b11960493835d094b16adac0b085a79cff181bcb9","9d00e3a59eff68fa8c40e89953083eeaad1c5b2580ed7da2304424b249ecb237","1609ad4d488c356ee91eba7d7aa87cc6fb59bc8ac05c1a8f08665285ba3b71ad","8add088f72326098d68d622ddb024c00ae56a912383efe96b03f0481db88f7c9","dd17fe6332567b8f13e33dd3ff8926553cdcea2ad32d4350ce0063a2addaa764","4091d56a4622480549350b8811ec64c7826cd41a70ce5d9c1cc20384bb144049","353c0125b9e50c2a71e18394d46be5ccb37161cc0f0e7c69216aa6932c8cdafb","9c5d5f167e86b6ddf7142559a17d13fd39c34e868ae947c40381db866eed6609","4430dea494b0ee77bf823d9a7c4850a539e1060d5d865316bb23fb393e4f01d7","aae698ceead4edad0695b9ea87e43f274e698bdb302c8cb5fd2cab4dc496ccf0","51631e9a0c041e12479ab01f5801d8a237327d19e9ee37d5f1f66be912631425","c9d5d8adb1455f49182751ce885745dcc5f9697e9c260388bc3ae9d1860d5d10","f64289e3fa8d5719eaf5ba1bb02dd32dbbf7c603dda75c16770a6bc6e9c6b6d9","b1aa0e2e3511a8d10990f35866405c64c9e576258ef99eeb9ebafed980fd7506","2d255a5287f2fb5295688cb25bd18e1cd59866179f795f3f1fd6b71b7f0edf8f","43c1dbb78d5277a5fdd8fddce8b257f84ffa2b4253f58b95c04a310710d19e97","6c669d7e080344c1574aa276a89e57c3b9f0e97fab96a09427e7dfb19ca261bf","b71ac126853867d8e64c910f47d46d05c5ea797987d2604f63d401507dc43b6d","9a37238558d28b7ee06d08599e92eab30b90704541cc85e6448009d6d55fffa9","120b14d66a061910309ff97e7b06b5c6c09444218178b80b687a92af4d22d5dc","3de958065e3a44cbe0bfa667813bc59c63e63c9ce522af8dc1b64714910fa9ba","66e655f7c43558bae6703242cbd6c0551a94d0a97204bd4c4bbf7e77f24d1f85","72f7b32e023814078046c036ed4b7ad92414be0aebb63e805c682e14103ae38a","a89d8e67966d085ff971c9900cfa1abdd9732bab66d9c1914ecc15befdf8623d","7dfd0308261bb91b058eb91802690fe3f09192b263e070a19df4d629df29e265","608eb9d411ac76e93a10e05f8aae92b3a5cefc87594219b737df7c8737ba2bd7","cde493e09daad4bb29922fe633f760be9f0e8e2f39cdca999cce3b8690b5e13a","3d7f9eb12aface876f7b535cc89dcd416daf77f0b3573333f16ec0a70bcf902a","93ba4ac36f570c70a12d588e21c10dda9f351fad3e77d416952acddb27bff01d","8750f9dc1e277ffff7446c95571bae61aca0984e8f99e40fc1e8cb7161ae0642","66408d81ba8962282b1a55da34c6bd767105141f54d0ba14dca330efe0c8f552","7481b9d93ca44eb1f689e0b939545ff00dead7bdb9daba401dfb74292d83f831","821e64ddbdfa10fac5f0aed1c1d4e1f275840400caa96357ddfd15d02e5afba1","53152d1fc53a5283097f9a3e2c35f338bcbf4ed7c236e2418d4e54ae03dc84b9","bf2b9e09ab805a9dfd942bce104f9b08c4aca6acd6d2bc51c1558269f7d6dbf8","c5c02cf97dd48e47f77dc973fa082b4610ea30964f8d92a83e6366ac944380d0","42bf40a061bfd8d72f0b2590bd437cffe189c19cd44e3bf5e7a0b7c6d76862d2","5b312a14de195172d56bee9129237403eca227b03c214af351196bd91cf94fe0","e6d30c042473d086896f5d16cd4fe9ab080196fe83c71fc488f10aaaf23213e3","8bd667551d33b0fed3004cff0996269c57eecf52d5c9289686a3326a248891f1","fc6c5f80278a557771c3e05a7b7165e564d596cfd182e767918720281ef3fc9a","01e3ba30dc29ed4ce3c1b499540ab47cd8aebd1422e2a9f9035bab2b3319105e","0cba3a5d7b81356222594442753cf90dd2892e5ccfe1d262aaca6896ba6c1380","a69c09dbea52352f479d3e7ac949fde3d17b195abe90b045d619f747b38d6d1a",{"version":"c2ab70bbc7a24c42a790890739dd8a0ba9d2e15038b40dff8163a97a5d148c00","affectsGlobalScope":true},"422dbb183fdced59425ca072c8bd09efaa77ce4e2ab928ec0d8a1ce062d2a45a",{"version":"fcdcb42da18dd98dc286b1876dd425791772036012ae61263c011a76b13a190f","affectsGlobalScope":true},"1dab5ab6bcf11de47ab9db295df8c4f1d92ffa750e8f095e88c71ce4c3299628","f71f46ccd5a90566f0a37b25b23bc4684381ab2180bdf6733f4e6624474e1894",{"version":"54e65985a3ee3cec182e6a555e20974ea936fc8b8d1738c14e8ed8a42bd921d4","affectsGlobalScope":true},"82408ed3e959ddc60d3e9904481b5a8dc16469928257af22a3f7d1a3bc7fd8c4","918a76828d88a73924bb26fef58040a6eb8a9adb7e407ea7264175520dda9450","34e5de87d983bc6aefef8b17658556e3157003e8d9555d3cb098c6bef0b5fbc8","cc0b61316c4f37393f1f9595e93b673f4184e9d07f4c127165a490ec4a928668","f27371653aded82b2b160f7a7033fb4a5b1534b6f6081ef7be1468f0f15327d3","c762cd6754b13a461c54b59d0ae0ab7aeef3c292c6cf889873f786ee4d8e75c9","f4ea7d5df644785bd9fbf419930cbaec118f0d8b4160037d2339b8e23c059e79",{"version":"bfea28e6162ed21a0aeed181b623dcf250aa79abf49e24a6b7e012655af36d81","affectsGlobalScope":true},"b8aca9d0c81abb02bec9b7621983ae65bde71da6727580070602bd2500a9ce2a","ae97e20f2e10dbeec193d6a2f9cd9a367a1e293e7d6b33b68bacea166afd7792","10d4796a130577d57003a77b95d8723530bbec84718e364aa2129fa8ffba0378","063f53ff674228c190efa19dd9448bcbd540acdbb48a928f4cf3a1b9f9478e43","bf73c576885408d4a176f44a9035d798827cc5020d58284cb18d7573430d9022","7ae078ca42a670445ae0c6a97c029cb83d143d62abd1730efb33f68f0b2c0e82",{"version":"e8b18c6385ff784228a6f369694fcf1a6b475355ba89090a88de13587a9391d5","affectsGlobalScope":true},"287b21dc1d1b9701c92e15e7dd673dfe6044b15812956377adffb6f08825b1bc","12eea70b5e11e924bb0543aea5eadc16ced318aa26001b453b0d561c2fd0bd1e","08777cd9318d294646b121838574e1dd7acbb22c21a03df84e1f2c87b1ad47f2","08a90bcdc717df3d50a2ce178d966a8c353fd23e5c392fd3594a6e39d9bb6304",{"version":"4cd4cff679c9b3d9239fd7bf70293ca4594583767526916af8e5d5a47d0219c7","affectsGlobalScope":true},"2a12d2da5ac4c4979401a3f6eaafa874747a37c365e4bc18aa2b171ae134d21b","002b837927b53f3714308ecd96f72ee8a053b8aeb28213d8ec6de23ed1608b66","1dc9c847473bb47279e398b22c740c83ea37a5c88bf66629666e3cf4c5b9f99c","a9e4a5a24bf2c44de4c98274975a1a705a0abbaad04df3557c2d3cd8b1727949","00fa7ce8bc8acc560dc341bbfdf37840a8c59e6a67c9bfa3fa5f36254df35db2","1b952304137851e45bc009785de89ada562d9376177c97e37702e39e60c2f1ff",{"version":"806ef4cac3b3d9fa4a48d849c8e084d7c72fcd7b16d76e06049a9ed742ff79c0","affectsGlobalScope":true},"44b8b584a338b190a59f4f6929d072431950c7bd92ec2694821c11bce180c8a5","5f0ed51db151c2cdc4fa3bb0f44ce6066912ad001b607a34e65a96c52eb76248",{"version":"3345c276cab0e76dda86c0fb79104ff915a4580ba0f3e440870e183b1baec476","affectsGlobalScope":true},"664d8f2d59164f2e08c543981453893bc7e003e4dfd29651ce09db13e9457980","103d70bfbeb3cd3a3f26d1705bf986322d8738c2c143f38ebb743b1e228d7444","f52fbf64c7e480271a9096763c4882d356b05cab05bf56a64e68a95313cd2ce2","59bdb65f28d7ce52ccfc906e9aaf422f8b8534b2d21c32a27d7819be5ad81df7",{"version":"3a2da34079a2567161c1359316a32e712404b56566c45332ac9dcee015ecce9f","affectsGlobalScope":true},"28a2e7383fd898c386ffdcacedf0ec0845e5d1a86b5a43f25b86bc315f556b79","3aff9c8c36192e46a84afe7b926136d520487155154ab9ba982a8b544ea8fc95","a880cf8d85af2e4189c709b0fea613741649c0e40fffb4360ec70762563d5de0","85bbf436a15bbeda4db888be3062d47f99c66fd05d7c50f0f6473a9151b6a070","9f9c49c95ecd25e0cb2587751925976cf64fd184714cb11e213749c80cf0f927","f0c75c08a71f9212c93a719a25fb0320d53f2e50ca89a812640e08f8ad8c408c",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"9cafe917bf667f1027b2bb62e2de454ecd2119c80873ad76fc41d941089753b8","16d51f964ec125ad2024cf03f0af444b3bc3ec3614d9345cc54d09bab45c9a4c","ba601641fac98c229ccd4a303f747de376d761babb33229bb7153bed9356c9cc",{"version":"ae3fe461989bbd951344efc1f1fe932360ce7392e6126bdb225a82a1bbaf15ee","affectsGlobalScope":true},"5b9ecf7da4d71cf3832dbb8336150fa924631811f488ad4690c2dfec2b4fb1d7","951c85f75aac041dddbedfedf565886a7b494e29ec1532e2a9b4a6180560b50e","f47887b61c6cf2f48746980390d6cb5b8013518951d912cfb37fe748071942be","6d829824ead8999f87b6df21200df3c6150391b894b4e80662caa462bd48d073","afc559c1b93df37c25aef6b3dfa2d64325b0e112e887ee18bf7e6f4ec383fc90","f47887b61c6cf2f48746980390d6cb5b8013518951d912cfb37fe748071942be",{"version":"ae3fe461989bbd951344efc1f1fe932360ce7392e6126bdb225a82a1bbaf15ee","affectsGlobalScope":true},"ba601641fac98c229ccd4a303f747de376d761babb33229bb7153bed9356c9cc","15c88bfd1b8dc7231ff828ae8df5d955bae5ebca4cf2bcb417af5821e52299ae","1c26b05af1ecc2d8a9d2e682931ec21658c842a792ced4dcf18ea5a49f1a695e","580304f233b87c918b6ee81c358b2efe818284fe19584e28e5a26026d8a355cf","558e0d1c797f78421be23db3c79a93db5b6c26a42a1e2b55a3efba037f26ab48","048c8482f35a0f3abd2ec8c86ba7b3c86af4906ebb7a12e4fbdc8d6896eb19dc","69c97795fcaf5bf566a1efcc24e5a5bf2d8c261ad1851239b0504c9c4a9e9cc0","9dfc364342a667c968f9be3ff7865abaf477df206a936b578b2a98eeaff0e318","56d6e24f71ed721db5a196fc6ab8523f0f469f7ae01b663ddea59981e0d82423","0bccccdd597d8a14213654d62b6ec25f37925bcd9bf6b9470006867478d7f612","b089e61130588931583bb35fa3de8fbf8695ed2b84de63d6623cdc935f6da676","9acbadd311ff3c3befca95fffdebbb1e703c437f708ff22c1324243c8f1c8d19","8671015544c781db69e1812986381ebc2b6dd303dfdf57b5c4ad45ed4c471deb","4889ae7c801238c611fcc96216b4b0bcdf39f0da707c77ca19fe561371029d11","e5e691ae3d8407aace8fba0029a6092c58eabaeeacc1325fa9c26e44f2776d53","87307be8e09e256fef6f626127e27cb03b10a9a488ebbaa0ec6ee748e9b14b78","02d39a917634d874c61968720d803fc08c236a5e5e22dfa910a8582a58d8f772","f60e3e3060207ac982da13363181fd7ee4beecc19a7c569f0d6bb034331066c2","17230b34bb564a3a2e36f9d3985372ccab4ad1722df2c43f7c5c2b553f68e5db","87ed0f84f0691d5c724b23159db96342e6b04ac69201b02c65936f4281ce1fbe","13868c5792808236b17dfe2803eafce911ea4d09d3b2fda95391891a494f988f","0dfe35191a04e8f9dc7caeb9f52f2ee07402736563d12cbccd15fb5f31ac877f","fa5c2d3fcd8e227e180815df0a0903ed4b116400452af8a75ac5b68e5e1de9da","38fe7497e80119c5beed36c7996f97964aea1975f19b9aa88fbd1e0972056bbf","2cd5befa33a9840f3d81fd45ddd5248437577a6f5982d8fca6489a731ad3501a","6a56ce54933ae2df87c81831a23e2da646c4e0fa84c69002c0a107234f5061e2","a63b55afd087ce84938e789a456e490b089ad12a2d50fe3fea66510cf80af002","016b1d5159ee90e7dc54361629b64fe3c4950705b68b431035447a0c4e33f39a","4be24031f6c5dbf4723fa0b0af3475fe7d500b8aa608c29e0e855d95fb4fd92b","fa5c2d3fcd8e227e180815df0a0903ed4b116400452af8a75ac5b68e5e1de9da","52d7bb5404c05f86c6b97365ec0a40a07ab8e809dd33a642f56b017232d546e6","4492560b6e4e1e512e47848f5b8f89df4d062eb590c08c951f3fddbb159b35fe","2c79bdadf3bca2286ef11e176b4dc832c8e3722744dc686bdde0b93dece3e5f7","d028760668055f3f238c075741ad7899b153cd34b4e90fe6d749499928554a9d","11eaaa936aa6bda15f6c29abe702e05ef8fe5a8476202b184416cfdd1caa3b91","219712a32dc57733b1d26fda15a00ca22eea92bd79518ccadafcd97a89be28b5","cddc319d62dbf2846274e3e5843c0b81528d4d633842388fd3d2666190468870","d510da3951ae86e734073b8e7825f01b3c6f63590b07b04e995d70410cb4b84b","48da6cbe78f7a59530a92ed9cbe28215fe8d9c2d70554b21b83096159af70d8d","0ce62dc8ce5e95c432ac56f1a923bd40ba36e45388429f7500ffa8b7fa703936","4ac676982840f89f64ef36c6a7efa3ff96090ea877aab1b27f105127cc3174c9","243d435f739d92379487bf3d57c115e25cf8f5fb253b05ace14a633aad5d0ebe","3e27a45e25071cca79591066da0b81e15ba793f8efe2228b930904b86c5869d1","27760aa74d9a21a71e3ca88c01b6fc637ab763a70eb9fe7e3f015d884cc07bc8","426e244ae33c547810aebd75a2d1ab965a0cb2561cfd49d9daea1b6533426daa","e58f5cdb301a37d37d13dbb184849a295c5221a8c5560f632f8c12b0d0afa284","9e2a475d65d2f09449160c6d1e3277bcf26f684a56ac607212bca7a69767dd7a","503d168e6f2d1d554a45bbaeef0358459ea9b0a8118d51d6b7aaede0f63b48e0","68de44e5425e1044a64ce355024b1e1cbf19526c3db5ba5e8c808753cb0076c2","ea075c9c3ced22ce617dfe01b075bba84570b3324d984ffe0150beb2004fdf1f","29af0ec0c0aff97435147afb200b9d2dac8e51a6a7efd65d291a8033dd791713","92a5f5f848269cadd55e46460445947804a49bf80d6f36043ad6b9ff8cda815a","8d48b8f8a377ade8dd1f000625bc276eea067f2529cc9cafdf082d17142107d6","31c502014e5ba046d5cb060136929b73fd53f0f989aa37b2b0424644cb0d93ef","76232dbb982272b182a76ad8745a9b02724dc9896e2328ce360e2c56c64c9778","06ecf824b4dfc90230aa004c346ed18b0ea3f55c364ac91c31c24beb877c0777","bb5077aa8b1acaed1d5ef6c20c4efa82b74465be99b3e83137d4a50a1b48aa4a","29868a2e889c5bb3f6c00c9513f5678a5b0b86f03c6bdae433ae285ed6289ddf","fb707ce406246f61190384489204eaa70de40e9aa4dedb3fbc9eacfc2a4ee890","fce50162c435aa1421f2b095060b38691e4b34b1a25b66b41916aa0031c56a52","8750c48a3f5e9159bc7cae33f7ac334d6a81d873bb48e4261145eed5587fc21f",{"version":"66c4f777379d3b0edbb24867b73fba7dda6f4c85aae52f71a8d332b7d06f8ae3","signature":"dc4d4c50f0a28026c274a57b8a56db457ed85f5138d41489c8401de03ae09d85"},"76232dbb982272b182a76ad8745a9b02724dc9896e2328ce360e2c56c64c9778",{"version":"1f254358a2b8f3a01ccb9f5984bc2d037269f9b0987cf97a45eb173d2be580fa","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"d88dc05fd345b7a4e1816bbfd2dd087eefa9b9e36096818c2348f5b246971125","ca9ebc5b0d02b1a6417aa85f7c8c685a8ed1b71e496367f21fa80b5884e648c7","4dd414d700d383f51e95de06a3dd767ecfc6e884207df2ab6bbf0a5ee2947197","dd1376343798071eca045504b679ce66db19e716df789de32a34e6cd4117e56e","d6916856643459f6295b01a3c2bb1a91885d50a13bb2a675b4c760947c881938","b1f03c33978d580e40b089312d9b86c827af12db5939d001e2b6ddeed864f216","4aa198370b45595ab2b079184272dacdd1d3a6e185b5a8bc25b6c57822eb301d","fb6ea4754383178e666a5839222f181c5cc28e0b07e3324dcd19dbd61062d844","37ce3e0b120cdeb2028f060b8c0e4ef399647bba65812e376b65721ac4256421","d88dc05fd345b7a4e1816bbfd2dd087eefa9b9e36096818c2348f5b246971125","a7b9533447378e7f34fa432e26be9102173e79bceb65b20d258d61c4042e90ad","d71ffe64592c4e61c6b431d8fbaff58735cd659738d788a4c8423a27f78f01b7","b869f848bec826c9d3645d10a183b905672a4675747f41700fd30e1b7e0d0308","62cc84c2971b16cc82e1f7cb1dac7d8c70b589d492fbc2f6efbcbfc53b61d514","67729b7b26e1ecf2afeb2f4a0a8c3ba16712918ef22d23bb615f033169ebe0f3","903da09dbdfea0af66cb6b7b25950e42e350f1f3cc87f3516baa553cc4de882f","e237aa7b157ebfb2699d2e3bbf07c65a8cea0382201dc44c9da006f0f730de67","05e8a403b04248dbe9eebd2025d58e95495de303f37b39f13e7562f5f414087a","a56bf5dce7c05192e4c2d95eb1527feda15f9225afea8c5ad67034a79992ebb6","fcb510be50b0756cb770f8caf321dba38ae074665efbea090584f8a8d3e6b8f4","d4c9c56a2f4ecedcc224a495dfbaee88072c8e99679504fb32ef1d0629f843a1","5ec537948044f7c0280d6175729bf7aa13deae28fe0f6346628a8cf15569aefa","94998ffb6165ce44d492327169a7f7cb0e1e11a967f068fbda6796029a4a40dd",{"version":"ef3ef28267745e19cb4557d8d7e5e0115113acacd76b4f5fe7c7eaf2d323c7cf","signature":"c3d431fd9e0c84911b5da16688425b08aac4c88d581414faf07ce4ca1c99b5da"},"5a4f366f85908cc58de4dbfd113c950375333a7ba742579f34fb4ebd773558af","cfdd927a5eae7a7e623b9745722ef3f2b7a2997fddc5d32b7e3dcaeeb15ff4a3",{"version":"fb09fd53bf4dcafa1c8ae53eb33ec224cb08b315831294373d7039a75e4d4009","signature":"0ec7a826af26985112b2d5254e901cdac8bee845e96f6806957d036c471abb77"},{"version":"cff3473b09c017b5f62f2c120d826916a0d81dc4f0d613e80850245f46582e08","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"6cbf5df81765e05550be69f69e84ba04271846b1772ae48ba76024a40fd1da34","signature":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","affectsGlobalScope":true},{"version":"7744e955dcb3365e09f560953f5f46ee6d01cb819df1e7906f4a79ea107d87ec","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"c86701cdbbe77e01aada879efb3cd8c00d03bf734fef6e95e71b1c2ab4594ebd","d508d8a2559371285a7ff8dd209d14623fc5093a91c3ac357c57db2658544b23","d7ed81a187f487d40e1214f95ae045bd50b470cd5bccb025bfa6ed2c30aaca66","0d14fa22c41fdc7277e6f71473b20ebc07f40f00e38875142335d5b63cdfc9d2","d982cdd2610155b3cbcbfa62ccabcf2d2b739f821518ef113348d160ef0010d9","ffcc5500e77223169833fc6eb59b3a507944a1f89574e0a1276b0ea7fc22c4a4","22f13de9e2fe5f0f4724797abd3d34a1cdd6e47ef81fc4933fea3b8bf4ad524b","e3ba509d3dce019b3190ceb2f3fc88e2610ab717122dabd91a9efaa37804040d","cda0cb09b995489b7f4c57f168cd31b83dcbaa7aad49612734fb3c9c73f6e4f2",{"version":"1de1ad6a1929317171d8cfcd55bb2732257680c1bf89bcd53e1d46a4d8dbda22","affectsGlobalScope":true}],"options":{"composite":true,"declaration":true,"esModuleInterop":true,"module":1,"outDir":"./lib","rootDir":"./src","skipLibCheck":true,"sourceMap":true,"strict":true,"target":6},"fileIdsList":[[145,261],[145],[145,237,238,239,240,241,242,243,244,245,246,247,248],[117,120,145,152,153,154],[145,263,265],[145,157],[145,156],[102,145],[105,145],[106,111,145],[107,117,118,125,134,144,145],[107,108,117,125,145],[109,145],[110,111,118,126,145],[111,134,141,145],[112,114,117,125,145],[113,145],[114,115,145],[116,117,145],[117,145],[117,118,119,134,144,145],[117,118,119,134,145],[120,125,134,144,145],[117,118,120,121,125,134,141,144,145],[120,122,134,141,144,145],[102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151],[117,123,145],[124,144,145],[114,117,125,134,145],[126,145],[127,145],[105,128,145],[129,143,145,149],[130,145],[131,145],[117,132,145],[132,133,145,147],[117,134,135,136,145],[134,136,145],[134,135,145],[137,145],[138,145],[117,139,140,145],[139,140,145],[111,125,134,141,145],[142,145],[125,143,145],[106,120,131,144,145],[111,145],[134,145,146],[145,147],[145,148],[106,111,117,119,128,134,144,145,147,149],[134,145,150],[120,145,152,157],[145,216],[145,152],[145,263],[145,260,264],[145,262],[119,127,145,217,223,224],[127,145,223],[145,224,250],[111,118,119,127,145,211,227,252],[145,253],[127,145,217,249,251,253],[119,127,145,211,227,235,249],[145,191,201],[145,191,194,196,198,200],[145,191,202],[145,185,191,193,201],[145,185,191,199,201],[145,185,191,197,201],[145,185,191,195,201],[145,191,201,202,203],[117,134,141,145,152,180,181,184,185],[46,145],[98,145],[145,206],[145,206,209],[47,145,204,211],[145,204,206],[145,205,207],[145,168],[145,168,169,170,171,172,173],[46,47,93,94,95,96,97,98,99,100,101,145,165,166,167,174,175,176,177,178,179,208,210],[47,98,145,211],[99,145],[47,145],[145,164],[94,145],[92,145],[47,93,94,95,145],[120,145,152,159],[120,145,152],[145,154,155,158,160],[51,52,56,83,84,88,90,91,145],[49,50,145],[49,145],[51,91,145],[51,52,88,89,91,145],[91,145],[48,91,92,145],[51,52,90,91,145],[51,52,54,55,90,91,145],[51,52,53,90,91,145],[51,52,56,83,84,85,86,87,90,91,145],[48,51,52,56,88,90,145],[56,91,145],[58,59,60,61,62,63,64,65,66,67,91,145],[81,91,145],[57,68,76,77,78,79,80,82,145],[61,91,145],[69,70,71,72,73,74,75,91,145],[145,185,186],[145,185],[145,187],[145,188],[145,186,187,188,189,190],[145,152,181,182,183],[134,145,152,181],[145,211],[145,212,213,219,220,221,222],[145,217,223],[145,214,218],[120,145,204,267],[106,118,120,134,145,152,215],[145,227,232],[145,228,229,230,231],[145,232,233,234],[227]],"referencedMap":[[262,1],[261,2],[237,2],[238,2],[239,2],[240,2],[241,2],[243,2],[249,3],[242,2],[247,2],[244,2],[245,2],[246,2],[248,2],[155,4],[266,5],[156,6],[157,7],[102,8],[103,8],[105,9],[106,10],[107,11],[108,12],[109,13],[110,14],[111,15],[112,16],[113,17],[114,18],[115,18],[116,19],[117,20],[118,21],[119,22],[104,2],[151,2],[120,23],[121,24],[122,25],[152,26],[123,27],[124,28],[125,29],[126,30],[127,31],[128,32],[129,33],[130,34],[131,35],[132,36],[133,37],[134,38],[136,39],[135,40],[137,41],[138,42],[139,43],[140,44],[141,45],[142,46],[143,47],[144,48],[145,49],[146,50],[147,51],[148,52],[149,53],[150,54],[154,2],[153,2],[158,55],[225,56],[236,2],[260,2],[252,57],[264,58],[265,59],[263,60],[8,2],[9,2],[13,2],[12,2],[2,2],[14,2],[15,2],[16,2],[17,2],[18,2],[19,2],[20,2],[21,2],[3,2],[4,2],[25,2],[22,2],[23,2],[24,2],[26,2],[27,2],[28,2],[5,2],[29,2],[30,2],[31,2],[32,2],[6,2],[45,2],[33,2],[34,2],[35,2],[36,2],[7,2],[37,2],[42,2],[43,2],[38,2],[39,2],[40,2],[41,2],[1,2],[44,2],[11,2],[10,2],[226,61],[224,62],[251,63],[257,2],[258,2],[259,2],[253,64],[254,65],[255,2],[256,66],[250,67],[202,68],[201,69],[203,70],[193,2],[197,2],[199,2],[195,2],[194,71],[200,72],[198,73],[196,74],[204,75],[192,76],[47,77],[175,78],[206,2],[209,79],[210,80],[205,81],[207,82],[208,83],[98,2],[169,84],[173,84],[168,2],[170,84],[171,84],[172,84],[174,85],[211,86],[99,87],[100,88],[101,89],[46,2],[165,90],[166,90],[178,2],[179,2],[176,2],[177,2],[94,2],[95,2],[97,91],[93,92],[96,93],[167,2],[160,94],[159,95],[162,4],[164,96],[163,2],[161,55],[92,97],[49,2],[51,98],[50,99],[55,100],[90,101],[87,102],[89,103],[52,102],[53,104],[57,104],[56,105],[54,106],[88,107],[86,102],[91,108],[84,2],[85,2],[58,109],[63,102],[65,102],[60,102],[61,109],[67,102],[68,110],[59,102],[64,102],[66,102],[62,102],[82,111],[81,102],[83,112],[77,102],[79,102],[78,102],[74,102],[80,113],[75,102],[76,114],[69,102],[70,102],[71,102],[72,102],[73,102],[48,2],[187,115],[188,115],[189,116],[186,117],[190,118],[191,119],[185,76],[184,120],[181,57],[183,121],[182,57],[180,2],[212,122],[223,123],[214,122],[218,124],[219,125],[220,2],[222,2],[221,2],[213,126],[215,2],[216,127],[217,56],[233,128],[232,129],[228,2],[229,2],[230,2],[231,2],[235,130],[234,128],[227,2]],"exportedModulesMap":[[262,1],[261,2],[237,2],[238,2],[239,2],[240,2],[241,2],[243,2],[249,3],[242,2],[247,2],[244,2],[245,2],[246,2],[248,2],[155,4],[266,5],[156,6],[157,7],[102,8],[103,8],[105,9],[106,10],[107,11],[108,12],[109,13],[110,14],[111,15],[112,16],[113,17],[114,18],[115,18],[116,19],[117,20],[118,21],[119,22],[104,2],[151,2],[120,23],[121,24],[122,25],[152,26],[123,27],[124,28],[125,29],[126,30],[127,31],[128,32],[129,33],[130,34],[131,35],[132,36],[133,37],[134,38],[136,39],[135,40],[137,41],[138,42],[139,43],[140,44],[141,45],[142,46],[143,47],[144,48],[145,49],[146,50],[147,51],[148,52],[149,53],[150,54],[154,2],[153,2],[158,55],[225,56],[236,2],[260,2],[252,57],[264,58],[265,59],[263,60],[8,2],[9,2],[13,2],[12,2],[2,2],[14,2],[15,2],[16,2],[17,2],[18,2],[19,2],[20,2],[21,2],[3,2],[4,2],[25,2],[22,2],[23,2],[24,2],[26,2],[27,2],[28,2],[5,2],[29,2],[30,2],[31,2],[32,2],[6,2],[45,2],[33,2],[34,2],[35,2],[36,2],[7,2],[37,2],[42,2],[43,2],[38,2],[39,2],[40,2],[41,2],[1,2],[44,2],[11,2],[10,2],[251,63],[257,2],[258,2],[259,2],[253,131],[202,68],[201,69],[203,70],[193,2],[197,2],[199,2],[195,2],[194,71],[200,72],[198,73],[196,74],[204,75],[192,76],[47,77],[175,78],[206,2],[209,79],[210,80],[205,81],[207,82],[208,83],[98,2],[169,84],[173,84],[168,2],[170,84],[171,84],[172,84],[174,85],[211,86],[99,87],[100,88],[101,89],[46,2],[165,90],[166,90],[178,2],[179,2],[176,2],[177,2],[94,2],[95,2],[97,91],[93,92],[96,93],[167,2],[160,94],[159,95],[162,4],[164,96],[163,2],[161,55],[92,97],[49,2],[51,98],[50,99],[55,100],[90,101],[87,102],[89,103],[52,102],[53,104],[57,104],[56,105],[54,106],[88,107],[86,102],[91,108],[84,2],[85,2],[58,109],[63,102],[65,102],[60,102],[61,109],[67,102],[68,110],[59,102],[64,102],[66,102],[62,102],[82,111],[81,102],[83,112],[77,102],[79,102],[78,102],[74,102],[80,113],[75,102],[76,114],[69,102],[70,102],[71,102],[72,102],[73,102],[48,2],[187,115],[188,115],[189,116],[186,117],[190,118],[191,119],[185,76],[184,120],[181,57],[183,121],[182,57],[180,2],[212,122],[223,123],[214,122],[218,124],[219,125],[220,2],[222,2],[221,2],[213,126],[215,2],[216,127],[217,56],[233,128],[232,129],[228,2],[229,2],[230,2],[231,2],[235,130],[234,128],[227,2]],"semanticDiagnosticsPerFile":[262,261,237,238,239,240,241,243,249,242,247,244,245,246,248,155,266,156,157,102,103,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,104,151,120,121,122,152,123,124,125,126,127,128,129,130,131,132,133,134,136,135,137,138,139,140,141,142,143,144,145,146,147,148,149,150,154,153,158,225,236,260,252,264,265,263,8,9,13,12,2,14,15,16,17,18,19,20,21,3,4,25,22,23,24,26,27,28,5,29,30,31,32,6,45,33,34,35,36,7,37,42,43,38,39,40,41,1,44,11,10,226,224,251,257,258,259,253,254,255,256,250,202,201,203,193,197,199,195,194,200,198,196,204,192,47,175,206,209,210,205,207,208,98,169,173,168,170,171,172,174,211,99,100,101,46,165,166,178,179,176,177,94,95,97,93,96,167,160,159,162,164,163,161,92,49,51,50,55,90,87,89,52,53,57,56,54,88,86,91,84,85,58,63,65,60,61,67,68,59,64,66,62,82,81,83,77,79,78,74,80,75,76,69,70,71,72,73,48,187,188,189,186,190,191,185,184,181,183,182,180,212,223,214,218,219,220,222,221,213,215,216,217,233,232,228,229,230,231,235,234,227]},"version":"4.7.4"}
package/.env DELETED
@@ -1,10 +0,0 @@
1
- # COMPONENT_MANAGEMENT_SERVICE_URL=https://management.devx-512.components.dev.dx.squiz.cloud
2
-
3
- # COMPONENT_RENDER_SERVICE_URL=https://render.devx-512.components.dev.dx.squiz.cloud
4
-
5
- CI_COMMIT_SHORT_SHA=undefined
6
- CI_COMMIT_REF_NAME=undefined
7
-
8
- COMPONENT_MANAGEMENT_SERVICE_URL=http://localhost:3010
9
-
10
- COMPONENT_RENDER_SERVICE_URL=http://localhost:3000
package/src/config.ts DELETED
@@ -1,20 +0,0 @@
1
- import { parseEnvVarForVar } from '@squiz/component-lib';
2
- import { config } from 'dotenv';
3
-
4
- config();
5
-
6
- interface Config {
7
- managementServiceUrl: string;
8
- renderServiceUrl: string;
9
- ci_buildVersion: string;
10
- ci_buildBranch: string;
11
- }
12
-
13
- const configObj: Config = {
14
- managementServiceUrl: parseEnvVarForVar('COMPONENT_MANAGEMENT_SERVICE_URL').replace(/\/+$/, ''),
15
- renderServiceUrl: parseEnvVarForVar('COMPONENT_RENDER_SERVICE_URL').replace(/\/+$/, ''),
16
- ci_buildVersion: parseEnvVarForVar('CI_COMMIT_SHORT_SHA'),
17
- ci_buildBranch: parseEnvVarForVar('CI_COMMIT_REF_NAME'),
18
- };
19
-
20
- export default configObj;
package/src/test.ts DELETED
@@ -1,24 +0,0 @@
1
- import { config } from 'dotenv';
2
-
3
- config();
4
- import { startDevelopmentRender } from './component-dev';
5
- import { uploadComponentFolder } from './upload-component-folder';
6
-
7
- // Commands test for CMP
8
-
9
- const command = process.argv[2];
10
- console.log('command', command);
11
- if (command === 'dev') {
12
- const dataMountPoint = process.env.DATA_MOUNT_POINT || '/Users/wfagerstrom/Code/component-service/test-components';
13
- const port = process.env.PORT || '3000';
14
-
15
- const previewFile = process.argv[3];
16
- startDevelopmentRender(dataMountPoint, { port: parseInt(port), previewFile }).then(() => {
17
- console.log('starting');
18
- });
19
- }
20
- if (command === 'upload') {
21
- const pathToUploadTo = process.argv[3];
22
- const componentServiceUrl = process.env.COMPONENT_MANAGEMENT_SERVICE_URL || process.argv[4];
23
- uploadComponentFolder(pathToUploadTo, componentServiceUrl);
24
- }