@speedkit/cli 2.31.1 → 2.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/README.md +1 -1
- package/dist/helpers/file-helper.d.ts +6 -0
- package/dist/helpers/file-helper.js +6 -0
- package/dist/helpers/race.d.ts +1 -1
- package/dist/helpers/race.js +8 -9
- package/dist/helpers/safe.js +2 -2
- package/dist/models/cli-parameters.js +4 -3
- package/dist/services/athena/athena-service.js +3 -2
- package/dist/services/athena/error/athena-query-error.d.ts +4 -0
- package/dist/services/athena/error/athena-query-error.js +9 -0
- package/dist/services/athena/error/fetch-credentials-error.d.ts +5 -1
- package/dist/services/athena/error/fetch-credentials-error.js +9 -1
- package/dist/services/bundler/bundle-service.js +5 -3
- package/dist/services/bundler/error/bundle-fetch-error.d.ts +3 -0
- package/dist/services/bundler/error/bundle-fetch-error.js +8 -0
- package/dist/services/bundler/error/bundle-resolve-error.d.ts +3 -0
- package/dist/services/bundler/error/bundle-resolve-error.js +8 -0
- package/dist/services/config-api/client.d.ts +1 -1
- package/dist/services/config-api/client.js +29 -7
- package/dist/services/config-api/error/json-response-error.d.ts +3 -1
- package/dist/services/config-api/error/json-response-error.js +4 -1
- package/dist/services/config-api/error/login-error.d.ts +3 -3
- package/dist/services/config-api/error/login-error.js +3 -4
- package/dist/services/config-api/factory/config-api-service-factory.js +2 -1
- package/dist/services/config-api-service.d.ts +3 -0
- package/dist/services/config-api-service.js +3 -0
- package/dist/services/customer-config/customer-config-service-model.d.ts +2 -0
- package/dist/services/customer-config/customer-config-service.js +10 -2
- package/dist/services/customer-config/templates/config_SpeedKit.js.hbs +35 -1
- package/dist/services/customer-config/templates/config_documentHandler.js.hbs +112 -112
- package/dist/services/customer-config/templates/config_dynamicBlocks.es6.hbs +290 -108
- package/dist/services/customer-config/templates/config_dynamicStyles.css.hbs +8 -8
- package/dist/services/customer-config/templates/config_loadHandler.js.hbs +61 -0
- package/dist/services/deploy/error/file-handler-error.d.ts +4 -0
- package/dist/services/deploy/error/file-handler-error.js +9 -0
- package/dist/services/diff-service.d.ts +3 -0
- package/dist/services/diff-service.js +3 -0
- package/dist/services/document-handler-runtime/document-handler-server.js +2 -4
- package/dist/services/error-handling/error/application-error.d.ts +18 -0
- package/dist/services/error-handling/error/application-error.js +28 -0
- package/dist/services/error-handling/error/config-file-error.d.ts +4 -0
- package/dist/services/error-handling/error/config-file-error.js +9 -0
- package/dist/services/error-handling/error/connection-error.d.ts +4 -0
- package/dist/services/error-handling/error/connection-error.js +9 -0
- package/dist/services/integration-api/error/customer-config-error.d.ts +2 -1
- package/dist/services/integration-api/error/customer-config-error.js +2 -1
- package/dist/services/integration-api/error/customer-config-legacy-error.d.ts +3 -1
- package/dist/services/integration-api/error/customer-config-legacy-error.js +4 -1
- package/dist/services/integration-api/error/mandatory-file-missing-error.d.ts +3 -2
- package/dist/services/integration-api/error/mandatory-file-missing-error.js +4 -4
- package/dist/services/integration-api/error/origin-error.d.ts +2 -1
- package/dist/services/integration-api/error/origin-error.js +2 -1
- package/dist/services/integration-api/error/read-files-error.d.ts +5 -0
- package/dist/services/integration-api/error/read-files-error.js +10 -0
- package/dist/services/integration-api/external/external-file-reader.js +8 -2
- package/dist/services/integration-api/file-reader.js +12 -4
- package/dist/services/integration-api/handler/customer-config-handler.d.ts +1 -0
- package/dist/services/integration-api/handler/customer-config-handler.js +22 -5
- package/dist/services/integration-api/handler/install-resource-handler.js +2 -1
- package/dist/services/integration-api/integration-api-service.js +2 -1
- package/dist/services/integration-api/spec/mandatory-files-validator.spec.js +4 -3
- package/dist/services/integration-api/validator/customer-config-validator.js +1 -1
- package/dist/services/integration-api/validator/mandatory-files-validator.js +6 -2
- package/dist/services/onboarding/error/vm-error.d.ts +3 -1
- package/dist/services/onboarding/error/vm-error.js +4 -1
- package/dist/services/onboarding/fetch-event-handler.js +1 -1
- package/dist/services/onboarding/todo-collector.d.ts +1 -1
- package/dist/services/onboarding/todo-collector.js +2 -2
- package/dist/services/prewarm/csv-reader.js +1 -3
- package/dist/services/prewarm/error/invalid-origin-error.d.ts +2 -1
- package/dist/services/prewarm/error/invalid-origin-error.js +3 -1
- package/dist/services/prewarm/error/read-csv-error.d.ts +4 -5
- package/dist/services/prewarm/error/read-csv-error.js +5 -8
- package/oclif.manifest.json +7 -1
- package/package.json +1 -1
- package/dist/helpers/get-chrome-path.d.ts +0 -7
- package/dist/helpers/get-chrome-path.js +0 -31
- package/dist/helpers/is-executable.d.ts +0 -1
- package/dist/helpers/is-executable.js +0 -15
- package/dist/helpers/watch-files.d.ts +0 -1
- package/dist/helpers/watch-files.js +0 -20
- package/dist/services/deploy/error/create-find-temporary-directory-error.d.ts +0 -4
- package/dist/services/deploy/error/create-find-temporary-directory-error.js +0 -10
- package/dist/services/deploy/error/deploy-app-error.d.ts +0 -2
- package/dist/services/deploy/error/deploy-app-error.js +0 -5
- package/dist/services/deploy/error/no-active-installation-error.d.ts +0 -4
- package/dist/services/deploy/error/no-active-installation-error.js +0 -10
- package/dist/services/integration-api/error/handler/customer-config-legacy-handler.d.ts +0 -5
- package/dist/services/integration-api/error/handler/customer-config-legacy-handler.js +0 -24
- package/dist/services/integration-api/error/handler/origin-handler.d.ts +0 -5
- package/dist/services/integration-api/error/handler/origin-handler.js +0 -22
- package/dist/services/integration-api/error/load-customer-error.d.ts +0 -4
- package/dist/services/integration-api/error/load-customer-error.js +0 -10
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ConfigFileError = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const application_error_1 = tslib_1.__importDefault(require("./application-error"));
|
|
6
|
+
class ConfigFileError extends application_error_1.default {
|
|
7
|
+
code = "CONFIG_FILE_ERROR";
|
|
8
|
+
}
|
|
9
|
+
exports.ConfigFileError = ConfigFileError;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ConnectionError = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const application_error_1 = tslib_1.__importDefault(require("../../error-handling/error/application-error"));
|
|
6
|
+
class ConnectionError extends application_error_1.default {
|
|
7
|
+
code = "CONNECTION_ERROR";
|
|
8
|
+
}
|
|
9
|
+
exports.ConnectionError = ConnectionError;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
3
|
+
const config_file_error_1 = require("../../error-handling/error/config-file-error");
|
|
4
|
+
class CustomerConfigError extends config_file_error_1.ConfigFileError {
|
|
4
5
|
}
|
|
5
6
|
exports.default = CustomerConfigError;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const application_error_1 = tslib_1.__importDefault(require("../../error-handling/error/application-error"));
|
|
5
|
+
class CustomerConfigLegacyError extends application_error_1.default {
|
|
6
|
+
code = "INVALID_CONFIG_CUSTOMER";
|
|
4
7
|
}
|
|
5
8
|
exports.default = CustomerConfigLegacyError;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import ApplicationError from "../../error-handling/error/application-error";
|
|
2
|
+
export default class MandatoryFileMissingError extends ApplicationError {
|
|
3
|
+
readonly code = "MANDATORY_CONFIG_FILE_IS_MISSING";
|
|
3
4
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const application_error_1 = tslib_1.__importDefault(require("../../error-handling/error/application-error"));
|
|
5
|
+
class MandatoryFileMissingError extends application_error_1.default {
|
|
6
|
+
code = "MANDATORY_CONFIG_FILE_IS_MISSING";
|
|
7
7
|
}
|
|
8
8
|
exports.default = MandatoryFileMissingError;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
3
|
+
const config_file_error_1 = require("../../error-handling/error/config-file-error");
|
|
4
|
+
class OriginError extends config_file_error_1.ConfigFileError {
|
|
4
5
|
}
|
|
5
6
|
exports.default = OriginError;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ReadFilesError = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const application_error_1 = tslib_1.__importDefault(require("../../error-handling/error/application-error"));
|
|
6
|
+
class ReadFilesError extends application_error_1.default {
|
|
7
|
+
code = "READ_FILES_ERROR";
|
|
8
|
+
suggestions = ["check if argument filePath is correct"];
|
|
9
|
+
}
|
|
10
|
+
exports.ReadFilesError = ReadFilesError;
|
|
@@ -4,11 +4,17 @@ exports.ExternalFileReader = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const node_fetch_1 = tslib_1.__importDefault(require("node-fetch"));
|
|
6
6
|
const ro_file_1 = require("../struct/ro-file");
|
|
7
|
+
const safe_1 = require("../../../helpers/safe");
|
|
8
|
+
const connection_error_1 = require("../../error-handling/error/connection-error");
|
|
7
9
|
class ExternalFileReader {
|
|
8
10
|
async load(assetName) {
|
|
9
|
-
const
|
|
11
|
+
const fetchResponse = await (0, safe_1.safe)((0, node_fetch_1.default)(assetName));
|
|
12
|
+
if (fetchResponse.success !== true) {
|
|
13
|
+
throw new connection_error_1.ConnectionError(`Unable to fetch file from ${assetName}`);
|
|
14
|
+
}
|
|
15
|
+
const response = fetchResponse.data;
|
|
10
16
|
if (!response.ok) {
|
|
11
|
-
throw new
|
|
17
|
+
throw new connection_error_1.ConnectionError(`Could not retrieve asset "${assetName}". Server respond with ${response.status} ${response.statusText}`);
|
|
12
18
|
}
|
|
13
19
|
const [fileName] = assetName.split("/").pop().split(".");
|
|
14
20
|
return new ro_file_1.RoFile(fileName, assetName, await response.text());
|
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const node_path_1 = tslib_1.__importDefault(require("node:path"));
|
|
5
|
-
const
|
|
5
|
+
const safe_1 = require("../../helpers/safe");
|
|
6
|
+
const read_files_error_1 = require("./error/read-files-error");
|
|
7
|
+
const files_1 = require("../../models/files");
|
|
6
8
|
const DEFAULT_ENV = "production";
|
|
7
9
|
class FileReader {
|
|
8
10
|
fileSystem;
|
|
@@ -20,9 +22,15 @@ class FileReader {
|
|
|
20
22
|
}
|
|
21
23
|
getFileList(basePath = this.basePath) {
|
|
22
24
|
let files = [];
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
+
const itemsResult = (0, safe_1.safe)(() => {
|
|
26
|
+
return this.fileSystem.readdirSync(basePath, {
|
|
27
|
+
withFileTypes: true,
|
|
28
|
+
});
|
|
25
29
|
});
|
|
30
|
+
if (itemsResult.success !== true) {
|
|
31
|
+
throw new read_files_error_1.ReadFilesError(`can not read files in path "${this.basePath}"`);
|
|
32
|
+
}
|
|
33
|
+
const items = itemsResult.data;
|
|
26
34
|
for (const item of items) {
|
|
27
35
|
if (item.isDirectory()) {
|
|
28
36
|
if (this.isAllowedFolder(item.name)) {
|
|
@@ -60,7 +68,7 @@ class FileReader {
|
|
|
60
68
|
return true;
|
|
61
69
|
}
|
|
62
70
|
// customer_config is always whitelisted
|
|
63
|
-
if (fileName.includes(
|
|
71
|
+
if (fileName.includes(files_1.INTEGRATION_FILES.CONFIG.CUSTOMER)) {
|
|
64
72
|
return true;
|
|
65
73
|
}
|
|
66
74
|
return this.whiteList.some((entry) => {
|
|
@@ -7,6 +7,8 @@ const customer_config_legacy_error_1 = tslib_1.__importDefault(require("../error
|
|
|
7
7
|
const customer_config_1 = require("../struct/customer-config");
|
|
8
8
|
const customer_config_file_1 = require("../struct/customer-config-file");
|
|
9
9
|
const file_handler_1 = tslib_1.__importDefault(require("./file-handler"));
|
|
10
|
+
const application_error_1 = tslib_1.__importDefault(require("../../error-handling/error/application-error"));
|
|
11
|
+
const safe_1 = require("../../../helpers/safe");
|
|
10
12
|
class CustomerConfigHandler extends file_handler_1.default {
|
|
11
13
|
cli;
|
|
12
14
|
validator;
|
|
@@ -32,7 +34,7 @@ class CustomerConfigHandler extends file_handler_1.default {
|
|
|
32
34
|
async loadConfig(fileContent, filePath) {
|
|
33
35
|
if ((fileContent.includes("process.env.TEST_APP") && this.testApp === null) ||
|
|
34
36
|
this.testApp.length === 0) {
|
|
35
|
-
throw new
|
|
37
|
+
throw new application_error_1.default("please specify env TEST_APP in your .env or configFile file");
|
|
36
38
|
}
|
|
37
39
|
const customerConfigContext = {
|
|
38
40
|
module: { exports: {} }, // make TEST_APP available for vm
|
|
@@ -49,14 +51,29 @@ class CustomerConfigHandler extends file_handler_1.default {
|
|
|
49
51
|
typeof configs === "string" ||
|
|
50
52
|
"origins" in configs ||
|
|
51
53
|
"name" in configs) {
|
|
52
|
-
throw new customer_config_legacy_error_1.default(this.configName
|
|
54
|
+
throw new customer_config_legacy_error_1.default(`Config "${this.configName}" not found`, [
|
|
55
|
+
`Check file ${filePath}`,
|
|
56
|
+
`module.exports must be an array of customerConfigObjects`,
|
|
57
|
+
]);
|
|
53
58
|
}
|
|
54
59
|
if (this.configName in configs) {
|
|
55
|
-
return
|
|
60
|
+
return this.createCustomerConfigFromSelected(configs, this.configName, filePath);
|
|
56
61
|
}
|
|
57
62
|
this.cli.writeWarning(`config: ${this.configName} does not exist.`);
|
|
58
|
-
const selectedConfig = await this.cli.select("
|
|
59
|
-
return
|
|
63
|
+
const selectedConfig = await this.cli.select("Please select config: ", Object.keys(configs).map((option) => ({ name: option, value: option })));
|
|
64
|
+
return this.createCustomerConfigFromSelected(configs, selectedConfig, filePath);
|
|
65
|
+
}
|
|
66
|
+
createCustomerConfigFromSelected(configs, selectedConfig, filePath) {
|
|
67
|
+
const configResponse = (0, safe_1.safe)(() => {
|
|
68
|
+
return customer_config_1.CustomerConfig.createFrom(configs[selectedConfig], selectedConfig);
|
|
69
|
+
});
|
|
70
|
+
if (configResponse.success === true) {
|
|
71
|
+
return configResponse.data;
|
|
72
|
+
}
|
|
73
|
+
throw new customer_config_error_1.default(configResponse.error, [
|
|
74
|
+
`Check file ${filePath}`,
|
|
75
|
+
`Validate config: ${selectedConfig}`,
|
|
76
|
+
]);
|
|
60
77
|
}
|
|
61
78
|
}
|
|
62
79
|
exports.default = CustomerConfigHandler;
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const file_handler_1 = tslib_1.__importDefault(require("./file-handler"));
|
|
5
5
|
const integration_api_model_1 = require("../integration-api-model");
|
|
6
|
+
const application_error_1 = tslib_1.__importDefault(require("../../error-handling/error/application-error"));
|
|
6
7
|
const PREDICTIVE_PRELOADING = "predictive-preloading";
|
|
7
8
|
class InstallResourceHandler extends file_handler_1.default {
|
|
8
9
|
allowedFiles = [
|
|
@@ -36,7 +37,7 @@ class InstallResourceHandler extends file_handler_1.default {
|
|
|
36
37
|
}
|
|
37
38
|
getRemoteKey(fileName) {
|
|
38
39
|
if (!this.remoteKeyMapping[fileName]) {
|
|
39
|
-
throw new
|
|
40
|
+
throw new application_error_1.default(`unknown fileName ${fileName}`);
|
|
40
41
|
}
|
|
41
42
|
return this.remoteKeyMapping[fileName];
|
|
42
43
|
}
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.IntegrationApiService = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const file_list_1 = tslib_1.__importDefault(require("./file-list"));
|
|
6
|
+
const file_handler_error_1 = require("../deploy/error/file-handler-error");
|
|
6
7
|
class IntegrationApiService {
|
|
7
8
|
fileReader;
|
|
8
9
|
virtualFileHandler;
|
|
@@ -52,7 +53,7 @@ class IntegrationApiService {
|
|
|
52
53
|
return await handler.handle(file);
|
|
53
54
|
}
|
|
54
55
|
}
|
|
55
|
-
throw new
|
|
56
|
+
throw new file_handler_error_1.FileHandlerError(`No handler found for file: ${file}`);
|
|
56
57
|
}
|
|
57
58
|
}
|
|
58
59
|
exports.IntegrationApiService = IntegrationApiService;
|
|
@@ -8,6 +8,7 @@ const file_list_1 = tslib_1.__importDefault(require("../file-list"));
|
|
|
8
8
|
const customer_config_file_1 = require("../struct/customer-config-file");
|
|
9
9
|
const install_resource_file_1 = require("../struct/install-resource-file");
|
|
10
10
|
const files_1 = require("../../../models/files");
|
|
11
|
+
const mandatory_file_missing_error_1 = tslib_1.__importDefault(require("../error/mandatory-file-missing-error"));
|
|
11
12
|
function addFileCustomerConfig(fileList) {
|
|
12
13
|
fileList.addFile(new customer_config_file_1.CustomerConfigFile(files_1.INTEGRATION_FILES.CONFIG.CUSTOMER, "", "", {}, "test"));
|
|
13
14
|
}
|
|
@@ -78,7 +79,7 @@ function addFileDocumentHandler(fileList) {
|
|
|
78
79
|
addFileSpeedKit(fileList);
|
|
79
80
|
(0, chai_1.expect)(() => {
|
|
80
81
|
validator.validate(fileList);
|
|
81
|
-
}).to.throw(
|
|
82
|
+
}).to.throw(mandatory_file_missing_error_1.default);
|
|
82
83
|
});
|
|
83
84
|
(0, mocha_1.it)("throw error -> dynamicBlocks are missing", () => {
|
|
84
85
|
const validator = new mandatory_files_validator_1.default();
|
|
@@ -89,7 +90,7 @@ function addFileDocumentHandler(fileList) {
|
|
|
89
90
|
addFileSpeedKit(fileList);
|
|
90
91
|
(0, chai_1.expect)(() => {
|
|
91
92
|
validator.validate(fileList);
|
|
92
|
-
}).to.throw(
|
|
93
|
+
}).to.throw(mandatory_file_missing_error_1.default);
|
|
93
94
|
});
|
|
94
95
|
(0, mocha_1.it)("throw error -> documentHandler is missing", () => {
|
|
95
96
|
const validator = new mandatory_files_validator_1.default();
|
|
@@ -100,6 +101,6 @@ function addFileDocumentHandler(fileList) {
|
|
|
100
101
|
addFileSpeedKit(fileList);
|
|
101
102
|
(0, chai_1.expect)(() => {
|
|
102
103
|
validator.validate(fileList);
|
|
103
|
-
}).to.throw(
|
|
104
|
+
}).to.throw(mandatory_file_missing_error_1.default);
|
|
104
105
|
});
|
|
105
106
|
});
|
|
@@ -5,7 +5,7 @@ const origin_error_1 = tslib_1.__importDefault(require("../error/origin-error"))
|
|
|
5
5
|
class CustomerConfigValidator {
|
|
6
6
|
validate(config) {
|
|
7
7
|
if (this.checkAppNameStartsWithNumber(config)) {
|
|
8
|
-
throw new
|
|
8
|
+
throw new origin_error_1.default("appName can't start with a number");
|
|
9
9
|
}
|
|
10
10
|
this.validateOrigins(config);
|
|
11
11
|
}
|
|
@@ -17,7 +17,7 @@ class MandatoryFilesValidator {
|
|
|
17
17
|
validate(files) {
|
|
18
18
|
for (const fileName of this.mandatoryFilesConfig.required) {
|
|
19
19
|
if (!files.hasFile(fileName)) {
|
|
20
|
-
throw new mandatory_file_missing_error_1.default(fileName);
|
|
20
|
+
throw new mandatory_file_missing_error_1.default(`Mandatory file "${fileName}" is missing`, [`Add file ${fileName} to config`]);
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
this.validateConditionally(files);
|
|
@@ -37,7 +37,11 @@ class MandatoryFilesValidator {
|
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
if (!hasRequiredFiles && !hasConditionallyRequiredFiles) {
|
|
40
|
-
throw new
|
|
40
|
+
throw new mandatory_file_missing_error_1.default(`Mandatory files are missing`, [
|
|
41
|
+
`Implement ${this.mandatoryFilesConfig.conditionallyRequired.this.join(", ")}`,
|
|
42
|
+
"or",
|
|
43
|
+
`${this.mandatoryFilesConfig.conditionallyRequired.or.join(", ")}`,
|
|
44
|
+
]);
|
|
41
45
|
}
|
|
42
46
|
}
|
|
43
47
|
}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.VmError = void 0;
|
|
4
|
-
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const application_error_1 = tslib_1.__importDefault(require("../../error-handling/error/application-error"));
|
|
6
|
+
class VmError extends application_error_1.default {
|
|
7
|
+
code = "VM_FILE_ERROR";
|
|
5
8
|
}
|
|
6
9
|
exports.VmError = VmError;
|
|
@@ -146,7 +146,7 @@ class FetchEventHandler {
|
|
|
146
146
|
return;
|
|
147
147
|
}
|
|
148
148
|
if (serverConfigResponse.errorObj instanceof login_error_1.default) {
|
|
149
|
-
this.cli.writeError(`could not login to app ${
|
|
149
|
+
this.cli.writeError(`could not login to app ${this.customerConfig.app} to gather credentials. Try run sk login`);
|
|
150
150
|
await this.sendDefaultAuthBehaviour(browserClient, event.requestId);
|
|
151
151
|
return;
|
|
152
152
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TodoCollector = void 0;
|
|
4
|
-
const
|
|
4
|
+
const integration_api_1 = require("../integration-api");
|
|
5
5
|
const TODO_MATCH = /(todo[^\n\r()|]*)((?:(?:\r\n|\r|\n)[^\n\r()|]*){3})/i;
|
|
6
6
|
/**
|
|
7
7
|
* Represents a TodoCollector class that collects open tasks from files.
|
|
@@ -14,7 +14,7 @@ class TodoCollector {
|
|
|
14
14
|
}
|
|
15
15
|
getOpenTasks() {
|
|
16
16
|
const configFiles = this.files.filter((file) => {
|
|
17
|
-
return !(file.type ===
|
|
17
|
+
return !(file.type === integration_api_1.FILE_TYPE.VIRTUAL_FILE);
|
|
18
18
|
});
|
|
19
19
|
const tasks = [];
|
|
20
20
|
for (const configFile of configFiles) {
|
|
@@ -14,9 +14,7 @@ class CsvReader {
|
|
|
14
14
|
return this.cleanUpEntries(entries);
|
|
15
15
|
}
|
|
16
16
|
catch (error) {
|
|
17
|
-
throw new read_csv_error_1.ReadCsvError(error.message
|
|
18
|
-
"check arguments for correct filePath",
|
|
19
|
-
]);
|
|
17
|
+
throw new read_csv_error_1.ReadCsvError(error.message);
|
|
20
18
|
}
|
|
21
19
|
}
|
|
22
20
|
cleanUpEntries(entries) {
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.InvalidOriginError = void 0;
|
|
4
|
-
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const customer_config_error_1 = tslib_1.__importDefault(require("../../integration-api/error/customer-config-error"));
|
|
6
|
+
class InvalidOriginError extends customer_config_error_1.default {
|
|
5
7
|
}
|
|
6
8
|
exports.InvalidOriginError = InvalidOriginError;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
export declare class ReadCsvError extends
|
|
1
|
+
import ApplicationError from "../../error-handling/error/application-error";
|
|
2
|
+
export declare class ReadCsvError extends ApplicationError {
|
|
3
3
|
readonly message: string;
|
|
4
|
-
readonly suggestions?: string[];
|
|
5
|
-
readonly ref?: string;
|
|
6
4
|
readonly code = "SK_CLI_CSV_READ";
|
|
7
|
-
|
|
5
|
+
readonly suggestions: string[];
|
|
6
|
+
constructor(message: string);
|
|
8
7
|
}
|
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ReadCsvError = void 0;
|
|
4
|
-
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const application_error_1 = tslib_1.__importDefault(require("../../error-handling/error/application-error"));
|
|
6
|
+
class ReadCsvError extends application_error_1.default {
|
|
5
7
|
message;
|
|
6
|
-
suggestions;
|
|
7
|
-
ref;
|
|
8
8
|
code = "SK_CLI_CSV_READ";
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
ref) {
|
|
9
|
+
suggestions = ["check arguments for correct filePath"];
|
|
10
|
+
constructor(message) {
|
|
12
11
|
super(message);
|
|
13
12
|
this.message = message;
|
|
14
|
-
this.suggestions = suggestions;
|
|
15
|
-
this.ref = ref;
|
|
16
13
|
}
|
|
17
14
|
}
|
|
18
15
|
exports.ReadCsvError = ReadCsvError;
|
package/oclif.manifest.json
CHANGED
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
"char": "c",
|
|
20
20
|
"description": "The costumer config name",
|
|
21
21
|
"name": "configName",
|
|
22
|
+
"required": false,
|
|
22
23
|
"default": "production",
|
|
23
24
|
"hasDynamicHelp": false,
|
|
24
25
|
"multiple": false,
|
|
@@ -59,6 +60,7 @@
|
|
|
59
60
|
"char": "c",
|
|
60
61
|
"description": "The costumer config name",
|
|
61
62
|
"name": "configName",
|
|
63
|
+
"required": false,
|
|
62
64
|
"default": "production",
|
|
63
65
|
"hasDynamicHelp": false,
|
|
64
66
|
"multiple": false,
|
|
@@ -99,6 +101,7 @@
|
|
|
99
101
|
"char": "c",
|
|
100
102
|
"description": "The costumer config name",
|
|
101
103
|
"name": "configName",
|
|
104
|
+
"required": false,
|
|
102
105
|
"default": "production",
|
|
103
106
|
"hasDynamicHelp": false,
|
|
104
107
|
"multiple": false,
|
|
@@ -203,6 +206,7 @@
|
|
|
203
206
|
"char": "c",
|
|
204
207
|
"description": "The costumer config name",
|
|
205
208
|
"name": "configName",
|
|
209
|
+
"required": false,
|
|
206
210
|
"default": "production",
|
|
207
211
|
"hasDynamicHelp": false,
|
|
208
212
|
"multiple": false,
|
|
@@ -441,6 +445,7 @@
|
|
|
441
445
|
"char": "c",
|
|
442
446
|
"description": "The costumer config name",
|
|
443
447
|
"name": "configName",
|
|
448
|
+
"required": false,
|
|
444
449
|
"default": "production",
|
|
445
450
|
"hasDynamicHelp": false,
|
|
446
451
|
"multiple": false,
|
|
@@ -594,6 +599,7 @@
|
|
|
594
599
|
"char": "c",
|
|
595
600
|
"description": "The costumer config name",
|
|
596
601
|
"name": "configName",
|
|
602
|
+
"required": false,
|
|
597
603
|
"default": "production",
|
|
598
604
|
"hasDynamicHelp": false,
|
|
599
605
|
"multiple": false,
|
|
@@ -675,5 +681,5 @@
|
|
|
675
681
|
]
|
|
676
682
|
}
|
|
677
683
|
},
|
|
678
|
-
"version": "2.
|
|
684
|
+
"version": "2.32.0"
|
|
679
685
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Gets chrome-path of .env file in skonboarding project.
|
|
3
|
-
* If path is not set or falsy, uses default chrome-path.
|
|
4
|
-
*
|
|
5
|
-
* @param customerPath - Path to customer in skonboarding-project.
|
|
6
|
-
*/
|
|
7
|
-
export declare function getChromePath(customerPath: string): Promise<string>;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getChromePath = void 0;
|
|
4
|
-
const customer_config_1 = require("./customer-config");
|
|
5
|
-
const is_file_1 = require("./is-file");
|
|
6
|
-
const CHROME_PATHS = {
|
|
7
|
-
darwin: "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome",
|
|
8
|
-
win32: "C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe",
|
|
9
|
-
linux: "/usr/bin/google-chrome",
|
|
10
|
-
};
|
|
11
|
-
const ENV_CHROME_REGEX = new RegExp(/^\s*CHROME_PATH=(.*)$/mu);
|
|
12
|
-
/**
|
|
13
|
-
* Gets chrome-path of .env file in skonboarding project.
|
|
14
|
-
* If path is not set or falsy, uses default chrome-path.
|
|
15
|
-
*
|
|
16
|
-
* @param customerPath - Path to customer in skonboarding-project.
|
|
17
|
-
*/
|
|
18
|
-
async function getChromePath(customerPath) {
|
|
19
|
-
const environmentFile = await customer_config_1.ConfigFile.loadFile(customerPath, "../../.env");
|
|
20
|
-
if (!environmentFile) {
|
|
21
|
-
return CHROME_PATHS[process.platform];
|
|
22
|
-
}
|
|
23
|
-
const environmentContent = await environmentFile.readContent();
|
|
24
|
-
const chromePath = ENV_CHROME_REGEX.test(environmentContent)
|
|
25
|
-
? environmentContent.match(ENV_CHROME_REGEX)[1]
|
|
26
|
-
: "";
|
|
27
|
-
return (await (0, is_file_1.isFile)(chromePath))
|
|
28
|
-
? chromePath
|
|
29
|
-
: CHROME_PATHS[process.platform];
|
|
30
|
-
}
|
|
31
|
-
exports.getChromePath = getChromePath;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function isExecutable(filename: string): Promise<boolean>;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isExecutable = void 0;
|
|
4
|
-
const promises_1 = require("node:fs/promises");
|
|
5
|
-
const node_fs_1 = require("node:fs");
|
|
6
|
-
async function isExecutable(filename) {
|
|
7
|
-
try {
|
|
8
|
-
await (0, promises_1.access)(filename, node_fs_1.constants.X_OK);
|
|
9
|
-
return true;
|
|
10
|
-
}
|
|
11
|
-
catch {
|
|
12
|
-
return false;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
exports.isExecutable = isExecutable;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function watchFiles(filenames: (string | undefined)[], listener: () => Promise<void>): void;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.watchFiles = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
6
|
-
const node_fs_1 = tslib_1.__importDefault(require("node:fs"));
|
|
7
|
-
function watchFiles(filenames, listener) {
|
|
8
|
-
for (const filename of filenames) {
|
|
9
|
-
if (!filename) {
|
|
10
|
-
// asset comes not from the local filesystem
|
|
11
|
-
continue;
|
|
12
|
-
}
|
|
13
|
-
node_fs_1.default.watchFile(filename, async () => {
|
|
14
|
-
console.info((0, chalk_1.default) `Updated {bold ${filename}}`);
|
|
15
|
-
await listener();
|
|
16
|
-
});
|
|
17
|
-
console.info((0, chalk_1.default) `Listening for changes on {bold ${filename}}`);
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
exports.watchFiles = watchFiles;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
const deploy_app_error_1 = tslib_1.__importDefault(require("./deploy-app-error"));
|
|
5
|
-
class CreateFindTemporaryDirectoryError extends deploy_app_error_1.default {
|
|
6
|
-
constructor() {
|
|
7
|
-
super(`No temporary Directory found and unable to create a new temporary Directory`);
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
exports.default = CreateFindTemporaryDirectoryError;
|