@sasjs/cli 4.20.0 → 4.20.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cli.js +4 -5
- package/build/cli.spec.js +19 -9
- package/build/commands/add/addCommand.js +2 -2
- package/build/commands/add/addCredential.js +2 -2
- package/build/commands/add/addTarget.js +13 -14
- package/build/commands/add/internal/input.js +14 -14
- package/build/commands/add/internal/saveConfig.js +3 -4
- package/build/commands/add/spec/addCommand.spec.js +19 -9
- package/build/commands/add/spec/addCredential.spec.js +19 -9
- package/build/commands/add/spec/addTarget.spec.js +19 -9
- package/build/commands/auth/authCommand.js +8 -8
- package/build/commands/auth/login.js +40 -14
- package/build/commands/auth/spec/authCommand.spec.js +19 -9
- package/build/commands/auth/spec/login.spec.js +19 -9
- package/build/commands/build/build.js +25 -26
- package/build/commands/build/buildCommand.js +2 -2
- package/build/commands/build/compileBuildCommand.js +3 -3
- package/build/commands/build/internal/config.js +2 -2
- package/build/commands/build/spec/build.spec.js +2 -2
- package/build/commands/build/spec/buildCommand.spec.js +19 -9
- package/build/commands/build/spec/cb.spec.server.viya.js +2 -2
- package/build/commands/build/spec/compileBuildCommand.spec.js +19 -9
- package/build/commands/compile/compile.js +29 -20
- package/build/commands/compile/compileCommand.js +2 -2
- package/build/commands/compile/compileSingleFile.js +15 -15
- package/build/commands/compile/internal/checkCompileStatus.js +3 -4
- package/build/commands/compile/internal/compareFolders.js +2 -2
- package/build/commands/compile/internal/compileFile.js +6 -7
- package/build/commands/compile/internal/compileTestFile.js +17 -13
- package/build/commands/compile/internal/copySyncFolder.js +2 -2
- package/build/commands/compile/internal/getAllFolders.js +3 -3
- package/build/commands/compile/internal/identifySasFile.js +2 -2
- package/build/commands/compile/internal/loadDependencies.js +10 -10
- package/build/commands/compile/internal/spec/compileTestFile.spec.js +2 -2
- package/build/commands/compile/internal/spec/getAllFolders.spec.js +19 -9
- package/build/commands/compile/spec/compareFolders.spec.js +3 -3
- package/build/commands/compile/spec/compile.spec.js +19 -9
- package/build/commands/compile/spec/compileCommand.spec.js +19 -9
- package/build/commands/compile/spec/compileFile.spec.js +19 -9
- package/build/commands/compile/spec/compileSingleFile.spec.js +19 -9
- package/build/commands/compile/spec/copyFilesToBuildFolder.spec.js +20 -10
- package/build/commands/compile/spec/loadDependencies.spec.js +19 -9
- package/build/commands/context/contextCommand.js +3 -3
- package/build/commands/context/create.js +4 -5
- package/build/commands/context/delete.js +4 -5
- package/build/commands/context/edit.js +4 -5
- package/build/commands/context/export.js +4 -5
- package/build/commands/context/internal/parseConfig.js +1 -2
- package/build/commands/context/internal/validateConfigPath.js +3 -4
- package/build/commands/context/list.js +4 -5
- package/build/commands/context/spec/contextCommand.spec.js +19 -9
- package/build/commands/context/spec/create.spec.js +2 -2
- package/build/commands/context/spec/delete.spec.js +2 -2
- package/build/commands/context/spec/edit.spec.js +2 -2
- package/build/commands/context/spec/export.spec.js +19 -9
- package/build/commands/context/spec/list.spec.js +2 -2
- package/build/commands/create/create.js +4 -5
- package/build/commands/create/createCommand.js +2 -2
- package/build/commands/create/createTemplate.js +1 -1
- package/build/commands/create/internal/createReadme.js +3 -4
- package/build/commands/create/spec/create.spec.js +2 -2
- package/build/commands/create/spec/createCommand.spec.js +19 -9
- package/build/commands/db/db.js +8 -9
- package/build/commands/db/dbCommand.js +2 -2
- package/build/commands/db/spec/db.spec.js +2 -2
- package/build/commands/db/spec/dbCommand.spec.js +19 -9
- package/build/commands/deploy/compileBuildDeployCommand.js +8 -8
- package/build/commands/deploy/deploy.js +4 -5
- package/build/commands/deploy/deployCommand.js +2 -2
- package/build/commands/deploy/internal/deployToSASJSWithServicePack.js +11 -12
- package/build/commands/deploy/internal/executeDeployScript.js +3 -4
- package/build/commands/deploy/internal/executeDeployScriptSas9.js +10 -11
- package/build/commands/deploy/internal/executeDeployScriptSasViya.js +11 -12
- package/build/commands/deploy/internal/executeDeployScriptSasjs.js +12 -13
- package/build/commands/deploy/internal/executeNonSasScript.js +4 -5
- package/build/commands/deploy/internal/executeSasScript.js +5 -6
- package/build/commands/deploy/internal/getDeployScripts.js +4 -5
- package/build/commands/deploy/spec/cbd.spec.js +19 -9
- package/build/commands/deploy/spec/cbd.spec.server.viya.js +19 -9
- package/build/commands/deploy/spec/compileBuildDeployCommand.spec.js +19 -9
- package/build/commands/deploy/spec/deploy.spec.js +19 -9
- package/build/commands/deploy/spec/deployCommand.spec.js +19 -9
- package/build/commands/deploy/spec/getDeployScripts.spec.js +2 -2
- package/build/commands/deploy/spec/utils.js +41 -8
- package/build/commands/docs/docsCommand.js +2 -2
- package/build/commands/docs/generateDocs.js +11 -12
- package/build/commands/docs/generateDot.js +3 -4
- package/build/commands/docs/initDocs.js +3 -4
- package/build/commands/docs/internal/createDotFiles.js +4 -5
- package/build/commands/docs/internal/getDocConfig.d.ts +8 -8
- package/build/commands/docs/internal/getDocConfig.js +1 -2
- package/build/commands/docs/internal/getDotFileContent.js +3 -4
- package/build/commands/docs/internal/getFileInputs.js +1 -2
- package/build/commands/docs/internal/getFileOutputs.js +1 -2
- package/build/commands/docs/internal/getFoldersForDocs.js +1 -2
- package/build/commands/docs/internal/populateNodeDictionary.js +1 -2
- package/build/commands/docs/internal/populateParamNodeTypes.js +21 -22
- package/build/commands/docs/spec/docsCommand.spec.js +19 -9
- package/build/commands/docs/spec/generateDocs.spec.js +2 -2
- package/build/commands/docs/spec/generateDot.spec.js +2 -2
- package/build/commands/docs/spec/getDocConfig.spec.js +2 -2
- package/build/commands/docs/spec/initDocs.spec.js +2 -2
- package/build/commands/flow/execute.js +6 -7
- package/build/commands/flow/flowCommand.js +2 -2
- package/build/commands/flow/internal/executeFlow.js +3 -3
- package/build/commands/flow/internal/saveLog.js +34 -5
- package/build/commands/flow/internal/saveToCsv.js +2 -2
- package/build/commands/flow/internal/spec/executeFlow.spec.js +19 -9
- package/build/commands/flow/internal/spec/saveToCsv.spec.js +2 -2
- package/build/commands/flow/internal/spec/validateParams.spec.js +19 -9
- package/build/commands/flow/internal/validateParams.d.ts +4 -4
- package/build/commands/flow/internal/validateParams.js +2 -2
- package/build/commands/flow/spec/flow.spec.js +19 -9
- package/build/commands/flow/spec/flow.spec.server.viya.js +2 -2
- package/build/commands/flow/spec/flowCommand.spec.js +19 -9
- package/build/commands/folder/create.js +2 -2
- package/build/commands/folder/delete.js +2 -2
- package/build/commands/folder/folderCommand.js +13 -13
- package/build/commands/folder/list.js +2 -2
- package/build/commands/folder/move.js +2 -2
- package/build/commands/folder/spec/folder.spec.server.viya.js +2 -2
- package/build/commands/folder/spec/folderCommand.spec.js +19 -9
- package/build/commands/fs/fsCommand.js +34 -36
- package/build/commands/fs/internal/executeCode.js +2 -2
- package/build/commands/fs/spec/executeCode.spec.js +19 -9
- package/build/commands/fs/spec/fsCommand.spec.js +19 -9
- package/build/commands/help/help.js +3 -4
- package/build/commands/help/helpCommand.js +2 -2
- package/build/commands/help/spec/help.spec.js +2 -2
- package/build/commands/help/spec/helpCommand.spec.js +19 -9
- package/build/commands/index.js +1 -1
- package/build/commands/init/init.js +5 -5
- package/build/commands/init/initCommand.js +2 -2
- package/build/commands/init/spec/init.spec.js +2 -2
- package/build/commands/init/spec/initCommand.spec.js +19 -9
- package/build/commands/job/internal/execute/sas9.js +3 -4
- package/build/commands/job/internal/execute/sasjs.js +4 -5
- package/build/commands/job/internal/execute/viya.js +10 -11
- package/build/commands/job/internal/utils.js +2 -2
- package/build/commands/job/jobCommand.js +19 -19
- package/build/commands/job/spec/execute.spec.js +43 -11
- package/build/commands/job/spec/getContextName.spec.js +2 -2
- package/build/commands/job/spec/job.spec.server.viya.js +24 -16
- package/build/commands/job/spec/jobCommand.spec.js +19 -9
- package/build/commands/lint/initLint.js +3 -4
- package/build/commands/lint/lintCommand.js +2 -2
- package/build/commands/lint/processLint.js +13 -14
- package/build/commands/lint/spec/lintCommand.spec.js +19 -9
- package/build/commands/request/request.js +3 -4
- package/build/commands/request/requestCommand.js +2 -2
- package/build/commands/request/spec/request.spec.server.sas9.js +19 -9
- package/build/commands/request/spec/request.spec.server.viya.js +19 -9
- package/build/commands/request/spec/requestCommand.spec.js +19 -9
- package/build/commands/request/spec/utils.js +2 -2
- package/build/commands/run/run.js +29 -30
- package/build/commands/run/runCommand.js +2 -2
- package/build/commands/run/spec/run.spec.js +19 -9
- package/build/commands/run/spec/run.spec.server.sas9.js +2 -2
- package/build/commands/run/spec/run.spec.server.sasjs.js +2 -2
- package/build/commands/run/spec/run.spec.server.viya.js +4 -4
- package/build/commands/run/spec/runCommand.spec.js +19 -9
- package/build/commands/servicepack/deploy.js +7 -8
- package/build/commands/servicepack/servicePackCommand.js +7 -7
- package/build/commands/servicepack/spec/servicepack.spec.server.viya.js +2 -2
- package/build/commands/servicepack/spec/servicepackCommand.spec.js +19 -9
- package/build/commands/shared/createConfigFile.js +2 -2
- package/build/commands/shared/createFileStructure.js +2 -2
- package/build/commands/shared/createLintConfigFile.js +2 -2
- package/build/commands/shared/deployToSasViyaWithServicePack.js +6 -7
- package/build/commands/shared/fetchLogFileContent.js +2 -2
- package/build/commands/shared/spec/deployToSasViyaWithServicePack.spec.js +19 -9
- package/build/commands/snippets/snippets.js +3 -4
- package/build/commands/snippets/snippetsCommand.js +2 -2
- package/build/commands/snippets/spec/snippets.spec.js +2 -2
- package/build/commands/snippets/spec/snippetsCommand.spec.js +19 -9
- package/build/commands/testing/internal/saveOutput.js +23 -15
- package/build/commands/testing/spec/testCommand.spec.js +19 -9
- package/build/commands/testing/spec/testing.spec.js +19 -9
- package/build/commands/testing/test.js +14 -14
- package/build/commands/testing/testCommand.js +2 -2
- package/build/commands/version/spec/version.spec.js +2 -2
- package/build/commands/version/spec/versionCommand.spec.js +19 -9
- package/build/commands/version/version.js +4 -5
- package/build/commands/version/versionCommand.js +2 -2
- package/build/commands/web/internal/createAssetServices.js +39 -41
- package/build/commands/web/internal/sas9/createClickMeService.js +2 -2
- package/build/commands/web/internal/sas9/generateAssetService.js +2 -2
- package/build/commands/web/internal/sas9/getWebServiceContent.js +34 -5
- package/build/commands/web/internal/sasViya/createClickMeFile.js +2 -2
- package/build/commands/web/internal/spec/updateSasjstag.spec.js +2 -2
- package/build/commands/web/internal/spec/updateScriptTag.spec.js +2 -2
- package/build/commands/web/internal/spec/updateStyleTag.spec.js +2 -2
- package/build/commands/web/internal/updateAllTags.js +86 -88
- package/build/commands/web/internal/updateLinkTag.d.ts +1 -1
- package/build/commands/web/internal/updateScriptTag.js +2 -2
- package/build/commands/web/internal/updateStyleTag.js +2 -2
- package/build/commands/web/spec/web.spec.js +2 -2
- package/build/commands/web/spec/webCommand.spec.js +19 -9
- package/build/commands/web/web.js +10 -11
- package/build/commands/web/webCommand.js +2 -2
- package/build/types/command/commandAliases.d.ts +1 -1
- package/build/types/command/commandBase.js +2 -2
- package/build/types/command/commandFactory.d.ts +1 -1
- package/build/types/command/returnCode.js +1 -1
- package/build/types/command/spec/commandBase.spec.js +2 -2
- package/build/types/command/spec/targetCommand.spec.js +19 -9
- package/build/types/command/targetCommand.js +2 -2
- package/build/types/flow.js +1 -1
- package/build/types/targetScope.js +1 -1
- package/build/types/testing.js +3 -3
- package/build/utils/auth.js +8 -8
- package/build/utils/compressAndSave.js +2 -2
- package/build/utils/config.js +82 -84
- package/build/utils/displayResult.js +2 -3
- package/build/utils/file.js +13 -13
- package/build/utils/loadEnvVariables.js +4 -5
- package/build/utils/parseSourceFile.js +3 -4
- package/build/utils/saveLog.js +34 -5
- package/build/utils/setConstants.js +34 -5
- package/build/utils/setProjectDir.js +2 -2
- package/build/utils/spec/auth.spec.js +2 -2
- package/build/utils/spec/config.spec.js +19 -9
- package/build/utils/spec/file.spec.js +2 -2
- package/build/utils/spec/saveLog.spec.js +2 -2
- package/build/utils/spec/setConstants.spec.js +20 -10
- package/build/utils/spec/utils.spec.js +2 -2
- package/build/utils/test.d.ts +2 -3
- package/build/utils/test.js +103 -40
- package/build/utils/utils.js +22 -22
- package/package.json +32 -32
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.displaySuccess = displaySuccess;
|
|
4
|
+
exports.displayError = displayError;
|
|
4
5
|
var utils_1 = require("@sasjs/utils");
|
|
5
6
|
function displaySuccess(message) {
|
|
6
7
|
var _a;
|
|
7
8
|
(_a = process.logger) === null || _a === void 0 ? void 0 : _a.success(message);
|
|
8
9
|
}
|
|
9
|
-
exports.displaySuccess = displaySuccess;
|
|
10
10
|
function displayError(err, errorMessage) {
|
|
11
11
|
var _a, _b, _c, _d;
|
|
12
12
|
if (errorMessage === void 0) { errorMessage = ''; }
|
|
@@ -52,4 +52,3 @@ function displayError(err, errorMessage) {
|
|
|
52
52
|
(_d = process.logger) === null || _d === void 0 ? void 0 : _d.error(errorMessage);
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
|
-
exports.displayError = displayError;
|
package/build/utils/file.js
CHANGED
|
@@ -9,8 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
-
return g =
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
13
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
@@ -39,16 +39,23 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
39
39
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
40
|
};
|
|
41
41
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
-
exports.sasFileRegExp = exports.
|
|
42
|
+
exports.sasFileRegExp = exports.sanitizeFileName = void 0;
|
|
43
|
+
exports.createFolderStructure = createFolderStructure;
|
|
44
|
+
exports.isSasFile = isSasFile;
|
|
45
|
+
exports.isJsonFile = isJsonFile;
|
|
46
|
+
exports.isCsvFile = isCsvFile;
|
|
47
|
+
exports.isShellScript = isShellScript;
|
|
48
|
+
exports.isPowerShellScript = isPowerShellScript;
|
|
49
|
+
exports.getBrief = getBrief;
|
|
43
50
|
var path_1 = __importDefault(require("path"));
|
|
44
51
|
var chalk_1 = __importDefault(require("chalk"));
|
|
45
52
|
var utils_1 = require("@sasjs/utils");
|
|
46
53
|
var displayResult_1 = require("./displayResult");
|
|
47
|
-
function createFolderStructure(
|
|
48
|
-
|
|
49
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
54
|
+
function createFolderStructure(folder_1) {
|
|
55
|
+
return __awaiter(this, arguments, void 0, function (folder, parentFolderName) {
|
|
50
56
|
var folderPath;
|
|
51
57
|
var _this = this;
|
|
58
|
+
if (parentFolderName === void 0) { parentFolderName = '.'; }
|
|
52
59
|
return __generator(this, function (_a) {
|
|
53
60
|
switch (_a.label) {
|
|
54
61
|
case 0:
|
|
@@ -96,27 +103,21 @@ function createFolderStructure(folder, parentFolderName) {
|
|
|
96
103
|
});
|
|
97
104
|
});
|
|
98
105
|
}
|
|
99
|
-
exports.createFolderStructure = createFolderStructure;
|
|
100
106
|
function isSasFile(filePath) {
|
|
101
107
|
return path_1.default.extname(filePath) === '.sas';
|
|
102
108
|
}
|
|
103
|
-
exports.isSasFile = isSasFile;
|
|
104
109
|
function isJsonFile(filePath) {
|
|
105
110
|
return path_1.default.extname(filePath) === '.json';
|
|
106
111
|
}
|
|
107
|
-
exports.isJsonFile = isJsonFile;
|
|
108
112
|
function isCsvFile(filePath) {
|
|
109
113
|
return path_1.default.extname(filePath) === '.csv';
|
|
110
114
|
}
|
|
111
|
-
exports.isCsvFile = isCsvFile;
|
|
112
115
|
function isShellScript(filePath) {
|
|
113
116
|
return path_1.default.extname(filePath) === '.sh' || path_1.default.extname(filePath) === '.bat';
|
|
114
117
|
}
|
|
115
|
-
exports.isShellScript = isShellScript;
|
|
116
118
|
function isPowerShellScript(filePath) {
|
|
117
119
|
return path_1.default.extname(filePath) === '.ps1';
|
|
118
120
|
}
|
|
119
|
-
exports.isPowerShellScript = isPowerShellScript;
|
|
120
121
|
var sanitizeFileName = function (fileName) {
|
|
121
122
|
return fileName.replace(/[^a-z0-9]/gi, '_');
|
|
122
123
|
};
|
|
@@ -136,5 +137,4 @@ function getBrief(fileContent) {
|
|
|
136
137
|
(0, displayResult_1.displayError)(e, chalk_1.default.redBright('File header parse error.\nPlease make sure your file header is in the correct format.'));
|
|
137
138
|
}
|
|
138
139
|
}
|
|
139
|
-
exports.getBrief = getBrief;
|
|
140
140
|
exports.sasFileRegExp = /.sas$/i;
|
|
@@ -9,8 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
-
return g =
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
13
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
@@ -39,7 +39,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
39
39
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
40
|
};
|
|
41
41
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
-
exports.
|
|
42
|
+
exports.loadProjectEnvVariables = loadProjectEnvVariables;
|
|
43
|
+
exports.loadTargetEnvVariables = loadTargetEnvVariables;
|
|
43
44
|
var path_1 = __importDefault(require("path"));
|
|
44
45
|
var dotenv_1 = __importDefault(require("dotenv"));
|
|
45
46
|
var file_1 = require("@sasjs/utils/file");
|
|
@@ -55,7 +56,6 @@ function loadProjectEnvVariables() {
|
|
|
55
56
|
});
|
|
56
57
|
});
|
|
57
58
|
}
|
|
58
|
-
exports.loadProjectEnvVariables = loadProjectEnvVariables;
|
|
59
59
|
function loadTargetEnvVariables(targetName) {
|
|
60
60
|
return __awaiter(this, void 0, void 0, function () {
|
|
61
61
|
return __generator(this, function (_a) {
|
|
@@ -68,7 +68,6 @@ function loadTargetEnvVariables(targetName) {
|
|
|
68
68
|
});
|
|
69
69
|
});
|
|
70
70
|
}
|
|
71
|
-
exports.loadTargetEnvVariables = loadTargetEnvVariables;
|
|
72
71
|
function loadEnvVariables(fileName) {
|
|
73
72
|
return __awaiter(this, void 0, void 0, function () {
|
|
74
73
|
var envFileExistsInCurrentPath, envFileExistsInParentPath, envFilePath;
|
|
@@ -9,8 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
-
return g =
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
13
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
@@ -39,7 +39,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
39
39
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
40
|
};
|
|
41
41
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
-
exports.parseSourceFile =
|
|
42
|
+
exports.parseSourceFile = parseSourceFile;
|
|
43
43
|
var utils_1 = require("@sasjs/utils");
|
|
44
44
|
var path_1 = __importDefault(require("path"));
|
|
45
45
|
var file_1 = require("./file");
|
|
@@ -72,4 +72,3 @@ function parseSourceFile(source) {
|
|
|
72
72
|
});
|
|
73
73
|
});
|
|
74
74
|
}
|
|
75
|
-
exports.parseSourceFile = parseSourceFile;
|
package/build/utils/saveLog.js
CHANGED
|
@@ -9,8 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
-
return g =
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
13
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
@@ -35,6 +35,31 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
35
35
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
39
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
40
|
+
if (!m) return o;
|
|
41
|
+
var i = m.call(o), r, ar = [], e;
|
|
42
|
+
try {
|
|
43
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
44
|
+
}
|
|
45
|
+
catch (error) { e = { error: error }; }
|
|
46
|
+
finally {
|
|
47
|
+
try {
|
|
48
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
49
|
+
}
|
|
50
|
+
finally { if (e) throw e.error; }
|
|
51
|
+
}
|
|
52
|
+
return ar;
|
|
53
|
+
};
|
|
54
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
55
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
56
|
+
if (ar || !(i in from)) {
|
|
57
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
58
|
+
ar[i] = from[i];
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
62
|
+
};
|
|
38
63
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
39
64
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
65
|
};
|
|
@@ -50,11 +75,15 @@ var _1 = require(".");
|
|
|
50
75
|
* @param jobPath - file path to job, job name will be used as a fallback name for log file.
|
|
51
76
|
* @param silent - boolean indicating if additional info should be logged.
|
|
52
77
|
*/
|
|
53
|
-
var saveLog = function (
|
|
54
|
-
|
|
55
|
-
|
|
78
|
+
var saveLog = function (logData_1, logFile_1, jobPath_1) {
|
|
79
|
+
var args_1 = [];
|
|
80
|
+
for (var _i = 3; _i < arguments.length; _i++) {
|
|
81
|
+
args_1[_i - 3] = arguments[_i];
|
|
82
|
+
}
|
|
83
|
+
return __awaiter(void 0, __spreadArray([logData_1, logFile_1, jobPath_1], __read(args_1), false), void 0, function (logData, logFile, jobPath, silent) {
|
|
56
84
|
var error, logPath, folderPath, parentFolderPath, logLines;
|
|
57
85
|
var _a;
|
|
86
|
+
if (silent === void 0) { silent = false; }
|
|
58
87
|
return __generator(this, function (_b) {
|
|
59
88
|
switch (_b.label) {
|
|
60
89
|
case 0:
|
|
@@ -9,8 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
-
return g =
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
13
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
@@ -35,6 +35,31 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
35
35
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
39
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
40
|
+
if (!m) return o;
|
|
41
|
+
var i = m.call(o), r, ar = [], e;
|
|
42
|
+
try {
|
|
43
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
44
|
+
}
|
|
45
|
+
catch (error) { e = { error: error }; }
|
|
46
|
+
finally {
|
|
47
|
+
try {
|
|
48
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
49
|
+
}
|
|
50
|
+
finally { if (e) throw e.error; }
|
|
51
|
+
}
|
|
52
|
+
return ar;
|
|
53
|
+
};
|
|
54
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
55
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
56
|
+
if (ar || !(i in from)) {
|
|
57
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
58
|
+
ar[i] = from[i];
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
62
|
+
};
|
|
38
63
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
39
64
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
65
|
};
|
|
@@ -44,11 +69,15 @@ var path_1 = __importDefault(require("path"));
|
|
|
44
69
|
var utils_1 = require("./utils");
|
|
45
70
|
var utils_2 = require("@sasjs/utils");
|
|
46
71
|
exports.contextName = 'sasjs cli compute context';
|
|
47
|
-
var setConstants = function (
|
|
48
|
-
|
|
49
|
-
|
|
72
|
+
var setConstants = function () {
|
|
73
|
+
var args_1 = [];
|
|
74
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
75
|
+
args_1[_i] = arguments[_i];
|
|
76
|
+
}
|
|
77
|
+
return __awaiter(void 0, __spreadArray([], __read(args_1), false), void 0, function (isLocal, target, configuration) {
|
|
50
78
|
var buildOutputFolder, buildResultsFolder, homeDir, buildSourceFolder, buildSourceDbFolder, buildDestinationFolder, buildDestinationServicesFolder, buildDestinationTestFolder, buildDestinationJobsFolder, buildDestinationDbFolder, buildDestinationDocsFolder, macroCorePath, buildDestinationResultsFolder, buildDestinationResultsLogsFolder, sas9CredentialsError, invalidSasError, sas9GUID;
|
|
51
79
|
var _a;
|
|
80
|
+
if (isLocal === void 0) { isLocal = true; }
|
|
52
81
|
return __generator(this, function (_b) {
|
|
53
82
|
switch (_b.label) {
|
|
54
83
|
case 0:
|
|
@@ -9,8 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
-
return g =
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
13
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
@@ -20,8 +20,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
20
20
|
});
|
|
21
21
|
};
|
|
22
22
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
23
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
24
|
-
return g =
|
|
23
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
24
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
25
25
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
26
|
function step(op) {
|
|
27
27
|
if (f) throw new TypeError("Generator is already executing.");
|
|
@@ -26,13 +26,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
26
26
|
}) : function(o, v) {
|
|
27
27
|
o["default"] = v;
|
|
28
28
|
});
|
|
29
|
-
var __importStar = (this && this.__importStar) || function (
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
};
|
|
29
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
30
|
+
var ownKeys = function(o) {
|
|
31
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
32
|
+
var ar = [];
|
|
33
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
34
|
+
return ar;
|
|
35
|
+
};
|
|
36
|
+
return ownKeys(o);
|
|
37
|
+
};
|
|
38
|
+
return function (mod) {
|
|
39
|
+
if (mod && mod.__esModule) return mod;
|
|
40
|
+
var result = {};
|
|
41
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
42
|
+
__setModuleDefault(result, mod);
|
|
43
|
+
return result;
|
|
44
|
+
};
|
|
45
|
+
})();
|
|
36
46
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
37
47
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
38
48
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -43,8 +53,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
43
53
|
});
|
|
44
54
|
};
|
|
45
55
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
46
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
47
|
-
return g =
|
|
56
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
57
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
48
58
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
49
59
|
function step(op) {
|
|
50
60
|
if (f) throw new TypeError("Generator is already executing.");
|
|
@@ -9,8 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
-
return g =
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
13
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
@@ -9,8 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
-
return g =
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
13
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
@@ -26,13 +26,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
26
26
|
}) : function(o, v) {
|
|
27
27
|
o["default"] = v;
|
|
28
28
|
});
|
|
29
|
-
var __importStar = (this && this.__importStar) || function (
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
};
|
|
29
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
30
|
+
var ownKeys = function(o) {
|
|
31
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
32
|
+
var ar = [];
|
|
33
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
34
|
+
return ar;
|
|
35
|
+
};
|
|
36
|
+
return ownKeys(o);
|
|
37
|
+
};
|
|
38
|
+
return function (mod) {
|
|
39
|
+
if (mod && mod.__esModule) return mod;
|
|
40
|
+
var result = {};
|
|
41
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
42
|
+
__setModuleDefault(result, mod);
|
|
43
|
+
return result;
|
|
44
|
+
};
|
|
45
|
+
})();
|
|
36
46
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
37
47
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
38
48
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -43,8 +53,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
43
53
|
});
|
|
44
54
|
};
|
|
45
55
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
46
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
47
|
-
return g =
|
|
56
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
57
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
48
58
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
49
59
|
function step(op) {
|
|
50
60
|
if (f) throw new TypeError("Generator is already executing.");
|
|
@@ -235,7 +245,7 @@ describe('setConstants', function () {
|
|
|
235
245
|
return [4 /*yield*/, (0, setConstants_1.setConstants)()];
|
|
236
246
|
case 1:
|
|
237
247
|
_a.sent();
|
|
238
|
-
expect(getNodeModulePathSpy).
|
|
248
|
+
expect(getNodeModulePathSpy).toHaveBeenCalledTimes(0);
|
|
239
249
|
return [2 /*return*/];
|
|
240
250
|
}
|
|
241
251
|
});
|
|
@@ -20,8 +20,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
20
20
|
});
|
|
21
21
|
};
|
|
22
22
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
23
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
24
|
-
return g =
|
|
23
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
24
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
25
25
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
26
|
function step(op) {
|
|
27
27
|
if (f) throw new TypeError("Generator is already executing.");
|
package/build/utils/test.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="jest" />
|
|
2
1
|
import { ServerType, Target, TargetJson, Configuration } from '@sasjs/utils/types';
|
|
3
2
|
import { Folder } from '../types';
|
|
4
3
|
import { ServiceConfig, JobConfig } from '@sasjs/utils/types/config';
|
|
@@ -9,8 +8,8 @@ export declare const removeTestApp: (parentFolder: string, appName: string) => P
|
|
|
9
8
|
export declare const removeTestServerFolder: (folderPath: string, target: Target) => Promise<void>;
|
|
10
9
|
export declare const generateTestTarget: (targetName: string, appLoc: string, serviceConfig?: ServiceConfig, serverType?: ServerType, jobConfig?: JobConfig) => Target;
|
|
11
10
|
export declare const createTestGlobalTarget: (targetName: string, appLoc: string, serviceConfig?: ServiceConfig, serverType?: ServerType) => Promise<Target>;
|
|
12
|
-
export declare const verifyStep: (step?:
|
|
13
|
-
export declare const mockProcessExit: () => jest.SpyInstance<never, [code?: number | undefined], any>;
|
|
11
|
+
export declare const verifyStep: (step?: "db" | "compile" | "build", buildFileName?: string, customFiles?: "custom" | "no") => Promise<void>;
|
|
12
|
+
export declare const mockProcessExit: () => jest.SpyInstance<never, [code?: string | number | null | undefined], any>;
|
|
14
13
|
export declare const verifyFolder: (folder: Folder, parentFolderName?: string) => Promise<boolean>;
|
|
15
14
|
export declare const verifyPackageJsonContent: (parentFolderName?: string) => Promise<void>;
|
|
16
15
|
export declare const removeAllTargetsFromConfigs: () => Promise<void>;
|