@sasjs/cli 3.6.2 → 3.6.3
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 -4
- package/build/cli.spec.js +6 -6
- package/build/commands/add/addCommand.js +2 -2
- package/build/commands/add/addCredential.js +27 -27
- package/build/commands/add/addTarget.js +10 -10
- package/build/commands/add/internal/input.js +30 -30
- package/build/commands/add/internal/saveConfig.js +2 -2
- package/build/commands/add/spec/addCommand.spec.js +24 -20
- package/build/commands/add/spec/addCredential.spec.js +14 -14
- package/build/commands/add/spec/addTarget.spec.js +22 -22
- package/build/commands/build/build.js +81 -77
- package/build/commands/build/buildCommand.js +3 -3
- package/build/commands/build/compileBuildCommand.js +4 -4
- package/build/commands/build/internal/config.js +8 -8
- package/build/commands/build/internal/getLaunchPageCode.js +2 -2
- package/build/commands/build/spec/build.spec.js +10 -10
- package/build/commands/build/spec/buildCommand.spec.js +16 -12
- package/build/commands/build/spec/cb.spec.server.js +18 -18
- package/build/commands/build/spec/compileBuildCommand.spec.js +17 -13
- package/build/commands/compile/compile.js +61 -61
- package/build/commands/compile/compileCommand.js +10 -10
- package/build/commands/compile/compileSingleFile.js +17 -17
- package/build/commands/compile/internal/checkCompileStatus.js +11 -11
- package/build/commands/compile/internal/compareFolders.js +11 -11
- package/build/commands/compile/internal/compileJobFile.js +3 -3
- package/build/commands/compile/internal/compileServiceFile.js +14 -14
- package/build/commands/compile/internal/compileTestFile.js +41 -37
- package/build/commands/compile/internal/getAllJobFolders.js +13 -9
- package/build/commands/compile/internal/getAllServiceFolders.js +13 -9
- package/build/commands/compile/internal/getServerType.js +1 -1
- package/build/commands/compile/internal/identifySasFile.js +2 -2
- package/build/commands/compile/internal/loadDependencies.js +5 -5
- package/build/commands/compile/internal/spec/compileTestFile.spec.js +40 -40
- package/build/commands/compile/spec/compareFolders.spec.js +27 -27
- package/build/commands/compile/spec/compile.spec.js +93 -93
- package/build/commands/compile/spec/compileCommand.spec.js +37 -33
- package/build/commands/compile/spec/compileJobFile.spec.js +11 -11
- package/build/commands/compile/spec/compileServiceFile.spec.js +11 -11
- package/build/commands/compile/spec/copyFilesToBuildFolder.spec.js +7 -7
- package/build/commands/compile/spec/loadDependencies.spec.js +30 -30
- package/build/commands/context/contextCommand.js +16 -16
- package/build/commands/context/create.js +1 -1
- package/build/commands/context/delete.js +2 -2
- package/build/commands/context/edit.js +1 -1
- package/build/commands/context/export.js +5 -5
- package/build/commands/context/internal/validateConfigPath.js +1 -1
- package/build/commands/context/list.js +4 -4
- package/build/commands/context/spec/contextCommand.spec.js +80 -76
- package/build/commands/context/spec/create.spec.js +3 -3
- package/build/commands/context/spec/delete.spec.js +3 -3
- package/build/commands/context/spec/edit.spec.js +3 -3
- package/build/commands/context/spec/export.spec.js +8 -8
- package/build/commands/context/spec/list.spec.js +5 -5
- package/build/commands/create/create.js +12 -12
- package/build/commands/create/createCommand.js +2 -2
- package/build/commands/create/internal/createReadme.js +2 -2
- package/build/commands/create/spec/create.spec.js +39 -39
- package/build/commands/create/spec/createCommand.spec.js +14 -10
- package/build/commands/db/db.js +22 -22
- package/build/commands/db/dbCommand.js +1 -1
- package/build/commands/db/spec/db.spec.js +8 -8
- package/build/commands/db/spec/dbCommand.spec.js +11 -7
- package/build/commands/deploy/compileBuildDeployCommand.js +6 -6
- package/build/commands/deploy/deploy.js +39 -39
- package/build/commands/deploy/deployCommand.js +2 -2
- package/build/commands/deploy/internal/getDeployScripts.js +14 -10
- package/build/commands/deploy/spec/cbd.spec.js +14 -14
- package/build/commands/deploy/spec/cbd.spec.server.js +40 -40
- package/build/commands/deploy/spec/compileBuildDeployCommand.spec.js +18 -14
- package/build/commands/deploy/spec/deployCommand.spec.js +15 -11
- package/build/commands/deploy/spec/getDeployScripts.spec.js +8 -8
- package/build/commands/deploy/spec/utils.js +17 -17
- package/build/commands/docs/docsCommand.js +7 -7
- package/build/commands/docs/generateDocs.js +33 -29
- package/build/commands/docs/generateDot.js +12 -8
- package/build/commands/docs/initDocs.js +1 -1
- package/build/commands/docs/internal/createDotFiles.js +6 -6
- package/build/commands/docs/internal/getDotFileContent.js +17 -17
- package/build/commands/docs/internal/getFileInputs.js +1 -1
- package/build/commands/docs/internal/getFileOutputs.js +1 -1
- package/build/commands/docs/internal/getFoldersForDocs.js +4 -4
- package/build/commands/docs/internal/populateNodeDictionary.js +1 -1
- package/build/commands/docs/spec/docsCommand.spec.js +25 -21
- package/build/commands/docs/spec/generateDocs.spec.js +60 -60
- package/build/commands/docs/spec/generateDot.spec.js +23 -23
- package/build/commands/docs/spec/getDocConfig.spec.js +2 -2
- package/build/commands/docs/spec/initDocs.spec.js +7 -7
- package/build/commands/flow/execute.js +8 -8
- package/build/commands/flow/flowCommand.js +5 -5
- package/build/commands/flow/internal/checkPredecessorDeadlock.js +11 -7
- package/build/commands/flow/internal/executeFlow.js +23 -23
- package/build/commands/flow/internal/failAllSuccessors.js +1 -1
- package/build/commands/flow/internal/generateFileName.js +2 -2
- package/build/commands/flow/internal/normalizeFilePath.js +1 -1
- package/build/commands/flow/internal/parseJobDetails.js +3 -3
- package/build/commands/flow/internal/printError.js +1 -1
- package/build/commands/flow/internal/saveLog.js +8 -8
- package/build/commands/flow/internal/saveToCsv.js +2 -2
- package/build/commands/flow/internal/spec/allFlowsCompleted.spec.js +4 -4
- package/build/commands/flow/internal/spec/checkPredecessorDeadlock.spec.js +4 -4
- package/build/commands/flow/internal/spec/executeFlow.spec.js +10 -10
- package/build/commands/flow/internal/spec/failAllSuccessors.spec.js +1 -1
- package/build/commands/flow/internal/spec/saveToCsv.spec.js +16 -16
- package/build/commands/flow/internal/spec/validateParams.spec.js +33 -33
- package/build/commands/flow/internal/validateParams.js +17 -17
- package/build/commands/flow/spec/flow.spec.js +1 -1
- package/build/commands/flow/spec/flow.spec.server.js +60 -60
- package/build/commands/flow/spec/flowCommand.spec.js +16 -12
- package/build/commands/folder/create.js +2 -2
- package/build/commands/folder/delete.js +2 -2
- package/build/commands/folder/folderCommand.js +11 -11
- package/build/commands/folder/move.js +2 -2
- package/build/commands/folder/spec/folder.spec.server.js +35 -35
- package/build/commands/folder/spec/folderCommand.spec.js +23 -19
- package/build/commands/help/help.js +46 -46
- package/build/commands/help/helpCommand.js +1 -1
- package/build/commands/help/spec/help.spec.js +8 -8
- package/build/commands/help/spec/helpCommand.spec.js +11 -7
- package/build/commands/init/init.js +7 -7
- package/build/commands/init/initCommand.js +1 -1
- package/build/commands/init/spec/init.spec.server.js +17 -17
- package/build/commands/init/spec/initCommand.spec.js +11 -7
- package/build/commands/job/internal/execute/sasjs.js +1 -1
- package/build/commands/job/internal/execute/viya.js +35 -35
- package/build/commands/job/internal/utils.js +6 -6
- package/build/commands/job/jobCommand.js +6 -6
- package/build/commands/job/spec/execute.spec.js +6 -6
- package/build/commands/job/spec/getContextName.spec.js +2 -2
- package/build/commands/job/spec/job.spec.server.js +53 -53
- package/build/commands/job/spec/jobCommand.spec.js +17 -13
- package/build/commands/lint/initLint.js +2 -2
- package/build/commands/lint/lintCommand.js +10 -10
- package/build/commands/lint/processLint.js +5 -5
- package/build/commands/lint/spec/lintCommand.spec.js +19 -15
- package/build/commands/request/request.js +16 -16
- package/build/commands/request/requestCommand.js +5 -5
- package/build/commands/request/spec/request.spec.server.js +71 -71
- package/build/commands/request/spec/requestCommand.spec.js +17 -13
- package/build/commands/run/run.js +23 -23
- package/build/commands/run/runCommand.js +2 -2
- package/build/commands/run/spec/run.spec.server.js +51 -51
- package/build/commands/run/spec/runCommand.spec.js +10 -6
- package/build/commands/servicepack/deploy.js +6 -6
- package/build/commands/servicepack/servicePackCommand.js +3 -3
- package/build/commands/servicepack/spec/servicepack.spec.server.js +6 -6
- package/build/commands/servicepack/spec/servicepackCommand.spec.js +10 -6
- package/build/commands/shared/createConfigFile.js +2 -2
- package/build/commands/shared/createFileStructure.js +6 -6
- package/build/commands/shared/createLintConfigFile.js +1 -1
- package/build/commands/shared/deployToSasViyaWithServicePack.js +4 -4
- package/build/commands/shared/fetchLogFileContent.js +10 -6
- package/build/commands/testing/internal/saveOutput.js +38 -34
- package/build/commands/testing/spec/testCommand.spec.js +17 -13
- package/build/commands/testing/spec/testing.spec.server.js +38 -38
- package/build/commands/testing/test.js +45 -41
- package/build/commands/testing/testCommand.js +2 -2
- package/build/commands/version/spec/version.spec.js +1 -1
- package/build/commands/version/spec/versionCommand.spec.js +11 -7
- package/build/commands/version/version.js +3 -3
- package/build/commands/version/versionCommand.js +2 -2
- package/build/commands/web/internal/createAssetServices.js +28 -24
- package/build/commands/web/internal/getWebServiceContent.js +6 -6
- package/build/commands/web/internal/sasjsout.d.ts +1 -1
- package/build/commands/web/internal/sasjsout.js +1 -1
- package/build/commands/web/internal/spec/updateLinkTag.spec.js +2 -2
- package/build/commands/web/internal/spec/updateScriptTag.spec.js +10 -10
- package/build/commands/web/internal/updateAllTags.js +19 -15
- package/build/commands/web/internal/updateLinkTag.js +2 -2
- package/build/commands/web/internal/updateScriptTag.js +6 -6
- package/build/commands/web/spec/web.spec.js +23 -23
- package/build/commands/web/spec/webCommand.spec.js +16 -12
- package/build/commands/web/web.js +25 -25
- package/build/commands/web/webCommand.js +3 -3
- package/build/types/command/commandBase.js +19 -15
- package/build/types/command/parse.js +1 -1
- package/build/types/command/spec/commandBase.spec.js +16 -12
- package/build/types/command/targetCommand.js +4 -4
- package/build/types/command/unalias.js +9 -5
- package/build/utils/auth.js +7 -7
- package/build/utils/config.js +53 -49
- package/build/utils/displayResult.js +4 -4
- package/build/utils/file.js +11 -11
- package/build/utils/fileStructures/builtFiles.js +2 -2
- package/build/utils/fileStructures/builtFilesCustom1.js +2 -2
- package/build/utils/getLogFilePath.js +1 -1
- package/build/utils/loadEnvVariables.js +3 -3
- package/build/utils/prefixAppLoc.js +1 -1
- package/build/utils/saveLog.js +7 -7
- package/build/utils/setConstants.js +4 -4
- package/build/utils/setProjectDir.js +2 -2
- package/build/utils/spec/config.spec.js +80 -80
- package/build/utils/spec/displayResult.spec.js +7 -7
- package/build/utils/spec/file.spec.js +15 -15
- package/build/utils/spec/removeComments.spec.js +11 -11
- package/build/utils/spec/setConstants.spec.js +3 -3
- package/build/utils/spec/utils.spec.js +55 -55
- package/build/utils/test.js +59 -59
- package/build/utils/utils.js +47 -43
- package/package.json +10 -10
|
@@ -80,7 +80,7 @@ var DbCommand = /** @class */ (function (_super) {
|
|
|
80
80
|
return __awaiter(this, void 0, void 0, function () {
|
|
81
81
|
return __generator(this, function (_a) {
|
|
82
82
|
switch (_a.label) {
|
|
83
|
-
case 0: return [4 /*yield*/, db_1.buildDB()
|
|
83
|
+
case 0: return [4 /*yield*/, (0, db_1.buildDB)()
|
|
84
84
|
.then(function () {
|
|
85
85
|
var _a;
|
|
86
86
|
(_a = process.logger) === null || _a === void 0 ? void 0 : _a.success('DB build completed!');
|
|
@@ -44,12 +44,12 @@ var test_1 = require("../../../utils/test");
|
|
|
44
44
|
var utils_1 = require("@sasjs/utils");
|
|
45
45
|
var db_1 = require("../db");
|
|
46
46
|
describe("sasjs db", function () {
|
|
47
|
-
var timestamp = utils_1.generateTimestamp();
|
|
48
|
-
var appName = "test-app-DB-"
|
|
47
|
+
var timestamp = (0, utils_1.generateTimestamp)();
|
|
48
|
+
var appName = "test-app-DB-".concat(timestamp);
|
|
49
49
|
beforeAll(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
50
50
|
return __generator(this, function (_a) {
|
|
51
51
|
switch (_a.label) {
|
|
52
|
-
case 0: return [4 /*yield*/, test_1.createTestApp(__dirname, appName)];
|
|
52
|
+
case 0: return [4 /*yield*/, (0, test_1.createTestApp)(__dirname, appName)];
|
|
53
53
|
case 1:
|
|
54
54
|
_a.sent();
|
|
55
55
|
return [2 /*return*/];
|
|
@@ -59,7 +59,7 @@ describe("sasjs db", function () {
|
|
|
59
59
|
afterAll(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
60
60
|
return __generator(this, function (_a) {
|
|
61
61
|
switch (_a.label) {
|
|
62
|
-
case 0: return [4 /*yield*/, test_1.removeTestApp(__dirname, appName)];
|
|
62
|
+
case 0: return [4 /*yield*/, (0, test_1.removeTestApp)(__dirname, appName)];
|
|
63
63
|
case 1:
|
|
64
64
|
_a.sent();
|
|
65
65
|
return [2 /*return*/];
|
|
@@ -69,10 +69,10 @@ describe("sasjs db", function () {
|
|
|
69
69
|
it("should create db folder", function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
70
70
|
return __generator(this, function (_a) {
|
|
71
71
|
switch (_a.label) {
|
|
72
|
-
case 0: return [4 /*yield*/, expect(db_1.buildDB()).toResolve()];
|
|
72
|
+
case 0: return [4 /*yield*/, expect((0, db_1.buildDB)()).toResolve()];
|
|
73
73
|
case 1:
|
|
74
74
|
_a.sent();
|
|
75
|
-
return [4 /*yield*/, test_1.verifyStep('db')];
|
|
75
|
+
return [4 /*yield*/, (0, test_1.verifyStep)('db')];
|
|
76
76
|
case 2:
|
|
77
77
|
_a.sent();
|
|
78
78
|
return [2 /*return*/];
|
|
@@ -82,10 +82,10 @@ describe("sasjs db", function () {
|
|
|
82
82
|
it("should throw an error when the db folder does not exist", function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
83
83
|
return __generator(this, function (_a) {
|
|
84
84
|
switch (_a.label) {
|
|
85
|
-
case 0: return [4 /*yield*/, utils_1.deleteFolder(path_1.default.join(__dirname, appName, 'sasjs', 'db'))];
|
|
85
|
+
case 0: return [4 /*yield*/, (0, utils_1.deleteFolder)(path_1.default.join(__dirname, appName, 'sasjs', 'db'))];
|
|
86
86
|
case 1:
|
|
87
87
|
_a.sent();
|
|
88
|
-
return [4 /*yield*/, expect(db_1.buildDB()).rejects.toThrow('no such file or directory')];
|
|
88
|
+
return [4 /*yield*/, expect((0, db_1.buildDB)()).rejects.toThrow('no such file or directory')];
|
|
89
89
|
case 2:
|
|
90
90
|
_a.sent();
|
|
91
91
|
return [2 /*return*/];
|
|
@@ -70,10 +70,14 @@ var __read = (this && this.__read) || function (o, n) {
|
|
|
70
70
|
}
|
|
71
71
|
return ar;
|
|
72
72
|
};
|
|
73
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
|
|
74
|
-
for (var i = 0,
|
|
75
|
-
|
|
76
|
-
|
|
73
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
74
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
75
|
+
if (ar || !(i in from)) {
|
|
76
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
77
|
+
ar[i] = from[i];
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
77
81
|
};
|
|
78
82
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
79
83
|
var logger_1 = require("@sasjs/utils/logger");
|
|
@@ -86,7 +90,7 @@ describe('DbCommand', function () {
|
|
|
86
90
|
setupMocks();
|
|
87
91
|
});
|
|
88
92
|
it('should parse a sasjs db command', function () {
|
|
89
|
-
var args = __spreadArray(__spreadArray([], __read(defaultArgs)), ['db']);
|
|
93
|
+
var args = __spreadArray(__spreadArray([], __read(defaultArgs), false), ['db'], false);
|
|
90
94
|
var command = new dbCommand_1.DbCommand(args);
|
|
91
95
|
expect(command.name).toEqual('db');
|
|
92
96
|
});
|
|
@@ -95,7 +99,7 @@ describe('DbCommand', function () {
|
|
|
95
99
|
return __generator(this, function (_a) {
|
|
96
100
|
switch (_a.label) {
|
|
97
101
|
case 0:
|
|
98
|
-
args = __spreadArray(__spreadArray([], __read(defaultArgs)), ['db']);
|
|
102
|
+
args = __spreadArray(__spreadArray([], __read(defaultArgs), false), ['db'], false);
|
|
99
103
|
command = new dbCommand_1.DbCommand(args);
|
|
100
104
|
return [4 /*yield*/, command.execute()];
|
|
101
105
|
case 1:
|
|
@@ -112,7 +116,7 @@ describe('DbCommand', function () {
|
|
|
112
116
|
return __generator(this, function (_a) {
|
|
113
117
|
switch (_a.label) {
|
|
114
118
|
case 0:
|
|
115
|
-
args = __spreadArray(__spreadArray([], __read(defaultArgs)), ['db']);
|
|
119
|
+
args = __spreadArray(__spreadArray([], __read(defaultArgs), false), ['db'], false);
|
|
116
120
|
jest
|
|
117
121
|
.spyOn(dbModule, 'buildDB')
|
|
118
122
|
.mockImplementation(function () { return Promise.reject(new Error('Test Error')); });
|
|
@@ -85,7 +85,7 @@ var CompileBuildDeployCommand = /** @class */ (function (_super) {
|
|
|
85
85
|
case 0: return [4 /*yield*/, this.getTargetInfo()];
|
|
86
86
|
case 1:
|
|
87
87
|
_d = _e.sent(), target = _d.target, isLocal = _d.isLocal;
|
|
88
|
-
return [4 /*yield*/, compile_1.compile(target, true)
|
|
88
|
+
return [4 /*yield*/, (0, compile_1.compile)(target, true)
|
|
89
89
|
.then(function () { return command_1.ReturnCode.Success; })
|
|
90
90
|
.catch(function (err) {
|
|
91
91
|
var _a;
|
|
@@ -98,8 +98,8 @@ var CompileBuildDeployCommand = /** @class */ (function (_super) {
|
|
|
98
98
|
return [2 /*return*/, returnCode];
|
|
99
99
|
}
|
|
100
100
|
buildDestinationFolder = process.sasjsConstants.buildDestinationFolder;
|
|
101
|
-
(_a = process.logger) === null || _a === void 0 ? void 0 : _a.success("Services have been successfully compiled!\nThe compile output is located in the "
|
|
102
|
-
return [4 /*yield*/, build_1.build(target)
|
|
101
|
+
(_a = process.logger) === null || _a === void 0 ? void 0 : _a.success("Services have been successfully compiled!\nThe compile output is located in the ".concat(buildDestinationFolder, " directory."));
|
|
102
|
+
return [4 /*yield*/, (0, build_1.build)(target)
|
|
103
103
|
.then(function () { return command_1.ReturnCode.Success; })
|
|
104
104
|
.catch(function (err) {
|
|
105
105
|
var _a;
|
|
@@ -111,8 +111,8 @@ var CompileBuildDeployCommand = /** @class */ (function (_super) {
|
|
|
111
111
|
if (returnCode === command_1.ReturnCode.InternalError) {
|
|
112
112
|
return [2 /*return*/, returnCode];
|
|
113
113
|
}
|
|
114
|
-
(_b = process.logger) === null || _b === void 0 ? void 0 : _b.success("Services have been successfully built!\nThe build output is located in the "
|
|
115
|
-
return [4 /*yield*/, deploy_1.deploy(target, isLocal)
|
|
114
|
+
(_b = process.logger) === null || _b === void 0 ? void 0 : _b.success("Services have been successfully built!\nThe build output is located in the ".concat(buildDestinationFolder, " directory."));
|
|
115
|
+
return [4 /*yield*/, (0, deploy_1.deploy)(target, isLocal)
|
|
116
116
|
.then(function () { return command_1.ReturnCode.Success; })
|
|
117
117
|
.catch(function (err) {
|
|
118
118
|
var _a;
|
|
@@ -124,7 +124,7 @@ var CompileBuildDeployCommand = /** @class */ (function (_super) {
|
|
|
124
124
|
if (returnCode === command_1.ReturnCode.InternalError) {
|
|
125
125
|
return [2 /*return*/, returnCode];
|
|
126
126
|
}
|
|
127
|
-
(_c = process.logger) === null || _c === void 0 ? void 0 : _c.success("Services have been successfully deployed to "
|
|
127
|
+
(_c = process.logger) === null || _c === void 0 ? void 0 : _c.success("Services have been successfully deployed to ".concat(target.serverUrl));
|
|
128
128
|
return [2 /*return*/, returnCode];
|
|
129
129
|
}
|
|
130
130
|
});
|
|
@@ -60,10 +60,10 @@ function deploy(target, isLocal, sasjs) {
|
|
|
60
60
|
if (!(target.serverType === utils_2.ServerType.SasViya &&
|
|
61
61
|
((_a = target.deployConfig) === null || _a === void 0 ? void 0 : _a.deployServicePack))) return [3 /*break*/, 2];
|
|
62
62
|
appLoc = target.appLoc.replace(/\ /g, '%20');
|
|
63
|
-
(_b = process.logger) === null || _b === void 0 ? void 0 : _b.info("Deploying service pack to "
|
|
63
|
+
(_b = process.logger) === null || _b === void 0 ? void 0 : _b.info("Deploying service pack to ".concat(target.serverUrl, " at location ").concat(appLoc, " ."));
|
|
64
64
|
buildDestinationFolder_1 = process.sasjsConstants.buildDestinationFolder;
|
|
65
|
-
finalFilePathJSON = path_1.default.join(buildDestinationFolder_1, target.name
|
|
66
|
-
return [4 /*yield*/, deployToSasViyaWithServicePack_1.deployToSasViyaWithServicePack(finalFilePathJSON, target, isLocal, true)];
|
|
65
|
+
finalFilePathJSON = path_1.default.join(buildDestinationFolder_1, "".concat(target.name, ".json"));
|
|
66
|
+
return [4 /*yield*/, (0, deployToSasViyaWithServicePack_1.deployToSasViyaWithServicePack)(finalFilePathJSON, target, isLocal, true)];
|
|
67
67
|
case 1:
|
|
68
68
|
jsonObject = _k.sent();
|
|
69
69
|
webIndexFileName = (_f = (_e = (_d = (_c = jsonObject === null || jsonObject === void 0 ? void 0 : jsonObject.members.find(function (member) {
|
|
@@ -71,10 +71,10 @@ function deploy(target, isLocal, sasjs) {
|
|
|
71
71
|
})) === null || _c === void 0 ? void 0 : _c.members) === null || _d === void 0 ? void 0 : _d.find(function (member) { return (member === null || member === void 0 ? void 0 : member.type) === 'file'; })) === null || _e === void 0 ? void 0 : _e.name) !== null && _f !== void 0 ? _f : '';
|
|
72
72
|
(_g = process.logger) === null || _g === void 0 ? void 0 : _g.success('Build pack has been successfully deployed.');
|
|
73
73
|
(_h = process.logger) === null || _h === void 0 ? void 0 : _h.success(target.serverType === utils_2.ServerType.SasViya && webIndexFileName
|
|
74
|
-
? target.serverUrl
|
|
75
|
-
: target.serverUrl
|
|
74
|
+
? "".concat(target.serverUrl, "/SASJobExecution?_file=").concat(appLoc, "/services/").concat(webIndexFileName, "&_debug=2")
|
|
75
|
+
: "".concat(target.serverUrl, "/SASJobExecution?_folder=").concat(appLoc));
|
|
76
76
|
_k.label = 2;
|
|
77
|
-
case 2: return [4 /*yield*/, getDeployScripts_1.getDeployScripts(target)];
|
|
77
|
+
case 2: return [4 /*yield*/, (0, getDeployScripts_1.getDeployScripts)(target)];
|
|
78
78
|
case 3:
|
|
79
79
|
deployScripts = _k.sent();
|
|
80
80
|
if (deployScripts.length === 0 && !((_j = target.deployConfig) === null || _j === void 0 ? void 0 : _j.deployServicePack)) {
|
|
@@ -87,16 +87,16 @@ function deploy(target, isLocal, sasjs) {
|
|
|
87
87
|
case 4:
|
|
88
88
|
_k.sent();
|
|
89
89
|
return [3 /*break*/, 7];
|
|
90
|
-
case 5: return [4 /*yield*/, utils_2.asyncForEach(deployScripts, function (deployScript) { return __awaiter(_this, void 0, void 0, function () {
|
|
90
|
+
case 5: return [4 /*yield*/, (0, utils_2.asyncForEach)(deployScripts, function (deployScript) { return __awaiter(_this, void 0, void 0, function () {
|
|
91
91
|
var deployScriptPath, deployScriptFile, linesToExecute, streamConfig, logPath;
|
|
92
92
|
var _a, _b, _c;
|
|
93
93
|
return __generator(this, function (_d) {
|
|
94
94
|
switch (_d.label) {
|
|
95
95
|
case 0:
|
|
96
|
-
deployScriptPath = utils_2.getAbsolutePath(deployScript, process.projectDir);
|
|
97
|
-
if (!file_1.isSasFile(deployScript)) return [3 /*break*/, 7];
|
|
98
|
-
(_a = process.logger) === null || _a === void 0 ? void 0 : _a.info("Processing SAS file "
|
|
99
|
-
return [4 /*yield*/, utils_2.readFile(deployScriptPath)
|
|
96
|
+
deployScriptPath = (0, utils_2.getAbsolutePath)(deployScript, process.projectDir);
|
|
97
|
+
if (!(0, file_1.isSasFile)(deployScript)) return [3 /*break*/, 7];
|
|
98
|
+
(_a = process.logger) === null || _a === void 0 ? void 0 : _a.info("Processing SAS file ".concat(path_1.default.basename(deployScript), " ..."));
|
|
99
|
+
return [4 /*yield*/, (0, utils_2.readFile)(deployScriptPath)
|
|
100
100
|
// split into lines
|
|
101
101
|
];
|
|
102
102
|
case 1:
|
|
@@ -104,7 +104,7 @@ function deploy(target, isLocal, sasjs) {
|
|
|
104
104
|
linesToExecute = deployScriptFile
|
|
105
105
|
.replace(/\r\n/g, '\n')
|
|
106
106
|
.split('\n');
|
|
107
|
-
return [4 /*yield*/, config_1.getStreamConfig(target)];
|
|
107
|
+
return [4 /*yield*/, (0, config_1.getStreamConfig)(target)];
|
|
108
108
|
case 2:
|
|
109
109
|
streamConfig = _d.sent();
|
|
110
110
|
if (!(target.serverType === utils_2.ServerType.SasViya)) return [3 /*break*/, 4];
|
|
@@ -118,13 +118,13 @@ function deploy(target, isLocal, sasjs) {
|
|
|
118
118
|
_d.label = 6;
|
|
119
119
|
case 6: return [3 /*break*/, 9];
|
|
120
120
|
case 7:
|
|
121
|
-
if (!file_1.isShellScript(deployScript)) return [3 /*break*/, 9];
|
|
122
|
-
(_b = process.logger) === null || _b === void 0 ? void 0 : _b.info("Executing shell script "
|
|
123
|
-
logPath = path_1.default.join(process.projectDir, 'sasjsbuild', path_1.default.basename(deployScript).replace('.sh', '')
|
|
124
|
-
return [4 /*yield*/, utils_1.executeShellScript(deployScriptPath, logPath)];
|
|
121
|
+
if (!(0, file_1.isShellScript)(deployScript)) return [3 /*break*/, 9];
|
|
122
|
+
(_b = process.logger) === null || _b === void 0 ? void 0 : _b.info("Executing shell script ".concat(deployScript, " ..."));
|
|
123
|
+
logPath = path_1.default.join(process.projectDir, 'sasjsbuild', "".concat(path_1.default.basename(deployScript).replace('.sh', ''), ".log"));
|
|
124
|
+
return [4 /*yield*/, (0, utils_1.executeShellScript)(deployScriptPath, logPath)];
|
|
125
125
|
case 8:
|
|
126
126
|
_d.sent();
|
|
127
|
-
(_c = process.logger) === null || _c === void 0 ? void 0 : _c.success("Shell script execution completed! Log is here: "
|
|
127
|
+
(_c = process.logger) === null || _c === void 0 ? void 0 : _c.success("Shell script execution completed! Log is here: ".concat(logPath));
|
|
128
128
|
_d.label = 9;
|
|
129
129
|
case 9: return [2 /*return*/];
|
|
130
130
|
}
|
|
@@ -156,13 +156,13 @@ function getSASjsAndAuthConfig(target, isLocal) {
|
|
|
156
156
|
_a.label = 1;
|
|
157
157
|
case 1:
|
|
158
158
|
_a.trys.push([1, 3, , 4]);
|
|
159
|
-
return [4 /*yield*/, config_1.getAuthConfig(target)];
|
|
159
|
+
return [4 /*yield*/, (0, config_1.getAuthConfig)(target)];
|
|
160
160
|
case 2:
|
|
161
161
|
authConfig = _a.sent();
|
|
162
162
|
return [3 /*break*/, 4];
|
|
163
163
|
case 3:
|
|
164
164
|
e_1 = _a.sent();
|
|
165
|
-
throw new Error("Deployment failed. Request is not authenticated.\nPlease add the following variables to your .env"
|
|
165
|
+
throw new Error("Deployment failed. Request is not authenticated.\nPlease add the following variables to your .env".concat(isLocal ? ".".concat(target.name) : '', " file:\nCLIENT, SECRET, ACCESS_TOKEN, REFRESH_TOKEN"));
|
|
166
166
|
case 4: return [2 /*return*/, {
|
|
167
167
|
sasjs: sasjs,
|
|
168
168
|
authConfig: authConfig
|
|
@@ -178,7 +178,7 @@ function deployToSasViya(deployScript, target, isLocal, linesToExecute, logFileP
|
|
|
178
178
|
return __generator(this, function (_g) {
|
|
179
179
|
switch (_g.label) {
|
|
180
180
|
case 0:
|
|
181
|
-
(_a = process.logger) === null || _a === void 0 ? void 0 : _a.info("Sending "
|
|
181
|
+
(_a = process.logger) === null || _a === void 0 ? void 0 : _a.info("Sending ".concat(path_1.default.basename(deployScript), " to SAS server for execution."));
|
|
182
182
|
contextName = target.contextName;
|
|
183
183
|
if (!contextName) {
|
|
184
184
|
throw new Error('Compute Context Name is required for SAS Viya deployments.\n Please ensure that `contextName` is present in your build target configuration or in your .env file, and try again.\n');
|
|
@@ -197,18 +197,18 @@ function deployToSasViya(deployScript, target, isLocal, linesToExecute, logFileP
|
|
|
197
197
|
: JSON.stringify(executionResult.log).replace(/\\n/g, os_1.default.EOL);
|
|
198
198
|
}
|
|
199
199
|
catch (e) {
|
|
200
|
-
(_b = process.logger) === null || _b === void 0 ? void 0 : _b.error("An error occurred when parsing the execution response: "
|
|
200
|
+
(_b = process.logger) === null || _b === void 0 ? void 0 : _b.error("An error occurred when parsing the execution response: ".concat(e.message));
|
|
201
201
|
log = executionResult;
|
|
202
202
|
}
|
|
203
203
|
if (!logFilePath) return [3 /*break*/, 4];
|
|
204
|
-
return [4 /*yield*/, utils_2.createFile(path_1.default.join(logFilePath, path_1.default.basename(deployScript).replace('.sas', '')
|
|
204
|
+
return [4 /*yield*/, (0, utils_2.createFile)(path_1.default.join(logFilePath, "".concat(path_1.default.basename(deployScript).replace('.sas', ''), ".log")), log)];
|
|
205
205
|
case 3:
|
|
206
206
|
_g.sent();
|
|
207
|
-
(_c = process.logger) === null || _c === void 0 ? void 0 : _c.success("Deployment completed! Log is available at "
|
|
207
|
+
(_c = process.logger) === null || _c === void 0 ? void 0 : _c.success("Deployment completed! Log is available at ".concat(path_1.default.join(logFilePath, "".concat(path_1.default.basename(deployScript).replace('.sas', ''), ".log"))));
|
|
208
208
|
if (streamConfig === null || streamConfig === void 0 ? void 0 : streamConfig.streamWeb) {
|
|
209
209
|
appLoc = target.appLoc.replace(/\ /g, '%20');
|
|
210
|
-
webAppStreamUrl = target.serverUrl
|
|
211
|
-
(_d = process.logger) === null || _d === void 0 ? void 0 : _d.info("Web app is available at "
|
|
210
|
+
webAppStreamUrl = "".concat(target.serverUrl, "/SASJobExecution?_FILE=").concat(appLoc, "/services/").concat(streamConfig.streamServiceName, ".html&_debug=2");
|
|
211
|
+
(_d = process.logger) === null || _d === void 0 ? void 0 : _d.info("Web app is available at ".concat(webAppStreamUrl));
|
|
212
212
|
}
|
|
213
213
|
return [3 /*break*/, 5];
|
|
214
214
|
case 4:
|
|
@@ -238,7 +238,7 @@ function deployToSas9(deployScript, target, linesToExecute, logFilePath, streamC
|
|
|
238
238
|
sas9CredentialsError = process.sasjsConstants.sas9CredentialsError;
|
|
239
239
|
throw new Error(sas9CredentialsError);
|
|
240
240
|
}
|
|
241
|
-
password = utils_2.decodeFromBase64(password);
|
|
241
|
+
password = (0, utils_2.decodeFromBase64)(password);
|
|
242
242
|
sasjs = new node_1.default({
|
|
243
243
|
serverUrl: target.serverUrl,
|
|
244
244
|
httpsAgentOptions: target.httpsAgentOptions,
|
|
@@ -251,7 +251,7 @@ function deployToSas9(deployScript, target, linesToExecute, logFilePath, streamC
|
|
|
251
251
|
var _a;
|
|
252
252
|
(_a = process.logger) === null || _a === void 0 ? void 0 : _a.log(formatErrorString(err));
|
|
253
253
|
if (err && err.errorCode === 404) {
|
|
254
|
-
utils_1.displaySasjsRunnerError(username);
|
|
254
|
+
(0, utils_1.displaySasjsRunnerError)(username);
|
|
255
255
|
}
|
|
256
256
|
})];
|
|
257
257
|
case 1:
|
|
@@ -261,14 +261,14 @@ function deployToSas9(deployScript, target, linesToExecute, logFilePath, streamC
|
|
|
261
261
|
return [3 /*break*/, 5];
|
|
262
262
|
case 2:
|
|
263
263
|
if (!logFilePath) return [3 /*break*/, 4];
|
|
264
|
-
return [4 /*yield*/, utils_2.createFile(path_1.default.join(logFilePath, path_1.default.basename(deployScript).replace('.sas', '')
|
|
264
|
+
return [4 /*yield*/, (0, utils_2.createFile)(path_1.default.join(logFilePath, "".concat(path_1.default.basename(deployScript).replace('.sas', ''), ".log")), executionResult !== null && executionResult !== void 0 ? executionResult : '')];
|
|
265
265
|
case 3:
|
|
266
266
|
_e.sent();
|
|
267
|
-
(_b = process.logger) === null || _b === void 0 ? void 0 : _b.success("Deployment completed! Log is available at "
|
|
267
|
+
(_b = process.logger) === null || _b === void 0 ? void 0 : _b.success("Deployment completed! Log is available at ".concat(path_1.default.join(logFilePath, "".concat(path_1.default.basename(deployScript).replace('.sas', ''), ".log"))));
|
|
268
268
|
if (streamConfig === null || streamConfig === void 0 ? void 0 : streamConfig.streamWeb) {
|
|
269
269
|
appLoc = target.appLoc.replace(/\ /g, '%20');
|
|
270
|
-
webAppStreamUrl = target.serverUrl
|
|
271
|
-
(_c = process.logger) === null || _c === void 0 ? void 0 : _c.info("Web app is available at "
|
|
270
|
+
webAppStreamUrl = "".concat(target.serverUrl, "/SASStoredProcess/?_PROGRAM=").concat(appLoc, "/services/").concat(streamConfig.streamServiceName);
|
|
271
|
+
(_c = process.logger) === null || _c === void 0 ? void 0 : _c.info("Web app is available at ".concat(webAppStreamUrl));
|
|
272
272
|
}
|
|
273
273
|
return [3 /*break*/, 5];
|
|
274
274
|
case 4:
|
|
@@ -287,8 +287,8 @@ function deployToSasjs(target, sasjs) {
|
|
|
287
287
|
switch (_c.label) {
|
|
288
288
|
case 0:
|
|
289
289
|
buildDestinationFolder = process.sasjsConstants.buildDestinationFolder;
|
|
290
|
-
finalFilePathJSON = path_1.default.join(buildDestinationFolder, target.name
|
|
291
|
-
return [4 /*yield*/, utils_2.readFile(finalFilePathJSON)];
|
|
290
|
+
finalFilePathJSON = path_1.default.join(buildDestinationFolder, "".concat(target.name, ".json"));
|
|
291
|
+
return [4 /*yield*/, (0, utils_2.readFile)(finalFilePathJSON)];
|
|
292
292
|
case 1:
|
|
293
293
|
jsonContent = _c.sent();
|
|
294
294
|
payload = JSON.parse(jsonContent);
|
|
@@ -308,7 +308,7 @@ function deployToSasjs(target, sasjs) {
|
|
|
308
308
|
if ((result === null || result === void 0 ? void 0 : result.status) === 'failure') {
|
|
309
309
|
(_a = process.logger) === null || _a === void 0 ? void 0 : _a.error(result.message);
|
|
310
310
|
if (result.example) {
|
|
311
|
-
(_b = process.logger) === null || _b === void 0 ? void 0 : _b.info("Payload example:\n"
|
|
311
|
+
(_b = process.logger) === null || _b === void 0 ? void 0 : _b.info("Payload example:\n".concat(JSON.stringify(result.example, null, 2)));
|
|
312
312
|
}
|
|
313
313
|
}
|
|
314
314
|
return [2 /*return*/];
|
|
@@ -324,11 +324,11 @@ function deployToSasjs(target, sasjs) {
|
|
|
324
324
|
function formatErrorString(error) {
|
|
325
325
|
var _a, _b, _c, _d;
|
|
326
326
|
var err = '';
|
|
327
|
-
err += error.stack
|
|
328
|
-
err += "url: "
|
|
329
|
-
err += "method: "
|
|
330
|
-
err += "headers: "
|
|
331
|
-
err += "data: "
|
|
327
|
+
err += "".concat(error.stack, "\n");
|
|
328
|
+
err += "url: ".concat(((_a = error.config) === null || _a === void 0 ? void 0 : _a.url) ? removePasswordFromUrl(error.config.url) : '', "\n");
|
|
329
|
+
err += "method: ".concat(((_b = error.config) === null || _b === void 0 ? void 0 : _b.method) ? error.config.method : '', "\n");
|
|
330
|
+
err += "headers: ".concat(((_c = error.config) === null || _c === void 0 ? void 0 : _c.headers) ? error.config.headers : '', "\n");
|
|
331
|
+
err += "data: ".concat(((_d = error.response) === null || _d === void 0 ? void 0 : _d.data) ? error.response.data : '');
|
|
332
332
|
return err;
|
|
333
333
|
}
|
|
334
334
|
/**
|
|
@@ -82,10 +82,10 @@ var DeployCommand = /** @class */ (function (_super) {
|
|
|
82
82
|
case 0: return [4 /*yield*/, this.getTargetInfo()];
|
|
83
83
|
case 1:
|
|
84
84
|
_a = _b.sent(), target = _a.target, isLocal = _a.isLocal;
|
|
85
|
-
return [4 /*yield*/, deploy_1.deploy(target, isLocal)
|
|
85
|
+
return [4 /*yield*/, (0, deploy_1.deploy)(target, isLocal)
|
|
86
86
|
.then(function () {
|
|
87
87
|
var _a;
|
|
88
|
-
(_a = process.logger) === null || _a === void 0 ? void 0 : _a.success("Services have been successfully deployed to "
|
|
88
|
+
(_a = process.logger) === null || _a === void 0 ? void 0 : _a.success("Services have been successfully deployed to ".concat(target.serverUrl, "."));
|
|
89
89
|
return command_1.ReturnCode.Success;
|
|
90
90
|
})
|
|
91
91
|
.catch(function (err) {
|
|
@@ -51,10 +51,14 @@ var __read = (this && this.__read) || function (o, n) {
|
|
|
51
51
|
}
|
|
52
52
|
return ar;
|
|
53
53
|
};
|
|
54
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
|
|
55
|
-
for (var i = 0,
|
|
56
|
-
|
|
57
|
-
|
|
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));
|
|
58
62
|
};
|
|
59
63
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
60
64
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
@@ -72,19 +76,19 @@ function getDeployScripts(target) {
|
|
|
72
76
|
switch (_f.label) {
|
|
73
77
|
case 0:
|
|
74
78
|
_e = process.sasjsConstants, buildSourceFolder = _e.buildSourceFolder, buildDestinationFolder = _e.buildDestinationFolder;
|
|
75
|
-
return [4 /*yield*/, config_1.getConfiguration(path_1.default.join(buildSourceFolder, 'sasjs', 'sasjsconfig.json'))];
|
|
79
|
+
return [4 /*yield*/, (0, config_1.getConfiguration)(path_1.default.join(buildSourceFolder, 'sasjs', 'sasjsconfig.json'))];
|
|
76
80
|
case 1:
|
|
77
81
|
configuration = _f.sent();
|
|
78
|
-
allDeployScripts = __spreadArray([], __read((((_a = configuration === null || configuration === void 0 ? void 0 : configuration.deployConfig) === null || _a === void 0 ? void 0 : _a.deployScripts) || [])));
|
|
79
|
-
allDeployScripts = __spreadArray(__spreadArray([], __read(allDeployScripts)), __read((((_b = target.deployConfig) === null || _b === void 0 ? void 0 : _b.deployScripts) || [])));
|
|
82
|
+
allDeployScripts = __spreadArray([], __read((((_a = configuration === null || configuration === void 0 ? void 0 : configuration.deployConfig) === null || _a === void 0 ? void 0 : _a.deployScripts) || [])), false);
|
|
83
|
+
allDeployScripts = __spreadArray(__spreadArray([], __read(allDeployScripts), false), __read((((_b = target.deployConfig) === null || _b === void 0 ? void 0 : _b.deployScripts) || [])), false);
|
|
80
84
|
if (!!((_c = target.deployConfig) === null || _c === void 0 ? void 0 : _c.deployServicePack) &&
|
|
81
85
|
target.serverType === utils_1.ServerType.Sas9) {
|
|
82
|
-
buildOutputFileName = ((_d = target.buildConfig) === null || _d === void 0 ? void 0 : _d.buildOutputFileName) || target.name
|
|
86
|
+
buildOutputFileName = ((_d = target.buildConfig) === null || _d === void 0 ? void 0 : _d.buildOutputFileName) || "".concat(target.name, ".sas");
|
|
83
87
|
deployScriptPath = path_1.default.join(buildDestinationFolder, buildOutputFileName);
|
|
84
|
-
allDeployScripts = __spreadArray(__spreadArray([], __read(allDeployScripts)), [deployScriptPath]);
|
|
88
|
+
allDeployScripts = __spreadArray(__spreadArray([], __read(allDeployScripts), false), [deployScriptPath], false);
|
|
85
89
|
}
|
|
86
90
|
allDeployScripts = allDeployScripts.filter(function (d) { return !!d; });
|
|
87
|
-
return [2 /*return*/, __spreadArray([], __read(new Set(allDeployScripts)))];
|
|
91
|
+
return [2 /*return*/, __spreadArray([], __read(new Set(allDeployScripts)), false)];
|
|
88
92
|
}
|
|
89
93
|
});
|
|
90
94
|
});
|
|
@@ -55,11 +55,11 @@ describe('sasjs cbd with server type SASJS', function () {
|
|
|
55
55
|
return __generator(this, function (_a) {
|
|
56
56
|
switch (_a.label) {
|
|
57
57
|
case 0:
|
|
58
|
-
appName = "cli-tests-cbd-sasjs-server-"
|
|
59
|
-
return [4 /*yield*/, test_1.createTestMinimalApp(__dirname, appName)];
|
|
58
|
+
appName = "cli-tests-cbd-sasjs-server-".concat((0, utils_1.generateTimestamp)());
|
|
59
|
+
return [4 /*yield*/, (0, test_1.createTestMinimalApp)(__dirname, appName)];
|
|
60
60
|
case 1:
|
|
61
61
|
_a.sent();
|
|
62
|
-
return [4 /*yield*/, utils_2.createLocalTarget(utils_1.ServerType.Sasjs)];
|
|
62
|
+
return [4 /*yield*/, (0, utils_2.createLocalTarget)(utils_1.ServerType.Sasjs)];
|
|
63
63
|
case 2:
|
|
64
64
|
target = _a.sent();
|
|
65
65
|
return [2 /*return*/];
|
|
@@ -69,7 +69,7 @@ describe('sasjs cbd with server type SASJS', function () {
|
|
|
69
69
|
afterEach(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
70
70
|
return __generator(this, function (_a) {
|
|
71
71
|
switch (_a.label) {
|
|
72
|
-
case 0: return [4 /*yield*/, test_1.removeTestApp(__dirname, appName)];
|
|
72
|
+
case 0: return [4 /*yield*/, (0, test_1.removeTestApp)(__dirname, appName)];
|
|
73
73
|
case 1:
|
|
74
74
|
_a.sent();
|
|
75
75
|
jest.resetAllMocks();
|
|
@@ -90,33 +90,33 @@ describe('sasjs cbd with server type SASJS', function () {
|
|
|
90
90
|
message: 'message'
|
|
91
91
|
});
|
|
92
92
|
});
|
|
93
|
-
return [4 /*yield*/, utils_2.updateLocalTarget(target.name, {
|
|
93
|
+
return [4 /*yield*/, (0, utils_2.updateLocalTarget)(target.name, {
|
|
94
94
|
jobConfig: undefined,
|
|
95
95
|
serviceConfig: undefined,
|
|
96
96
|
deployConfig: {
|
|
97
97
|
deployServicePack: false,
|
|
98
|
-
deployScripts: ["sasjsbuild/"
|
|
98
|
+
deployScripts: ["sasjsbuild/".concat(target.name, ".sas")]
|
|
99
99
|
}
|
|
100
100
|
})];
|
|
101
101
|
case 1:
|
|
102
102
|
_a.sent();
|
|
103
|
-
return [4 /*yield*/, config_1.findTargetInConfiguration(target.name, types_1.TargetScope.Local)];
|
|
103
|
+
return [4 /*yield*/, (0, config_1.findTargetInConfiguration)(target.name, types_1.TargetScope.Local)];
|
|
104
104
|
case 2:
|
|
105
105
|
customTarget = (_a.sent()).target;
|
|
106
|
-
return [4 /*yield*/, expect(build_1.build(customTarget)).toResolve()];
|
|
106
|
+
return [4 /*yield*/, expect((0, build_1.build)(customTarget)).toResolve()];
|
|
107
107
|
case 3:
|
|
108
108
|
_a.sent();
|
|
109
|
-
return [4 /*yield*/, deploy_1.deploy(customTarget, true, sasjs)];
|
|
109
|
+
return [4 /*yield*/, (0, deploy_1.deploy)(customTarget, true, sasjs)];
|
|
110
110
|
case 4:
|
|
111
111
|
_a.sent();
|
|
112
112
|
macroCorePath = process.sasjsConstants.macroCorePath;
|
|
113
|
-
return [4 /*yield*/, utils_1.readFile(macroCorePath
|
|
113
|
+
return [4 /*yield*/, (0, utils_1.readFile)("".concat(macroCorePath, "/base/mf_getuser.sas"))];
|
|
114
114
|
case 5:
|
|
115
115
|
mf_getuser = _a.sent();
|
|
116
|
-
return [4 /*yield*/, utils_1.readFile(macroCorePath
|
|
116
|
+
return [4 /*yield*/, (0, utils_1.readFile)("".concat(macroCorePath, "/base/mp_jsonout.sas"))];
|
|
117
117
|
case 6:
|
|
118
118
|
mp_jsonout = _a.sent();
|
|
119
|
-
return [4 /*yield*/, utils_1.readFile(macroCorePath
|
|
119
|
+
return [4 /*yield*/, (0, utils_1.readFile)("".concat(macroCorePath, "/server/ms_webout.sas"))];
|
|
120
120
|
case 7:
|
|
121
121
|
ms_webout = _a.sent();
|
|
122
122
|
webout = ' %macro webout(action,ds,dslabel=,fmt=,missing=NULL,showmeta=NO);\n' +
|
|
@@ -138,13 +138,13 @@ describe('sasjs cbd with server type SASJS', function () {
|
|
|
138
138
|
{
|
|
139
139
|
name: 'appinit',
|
|
140
140
|
type: 'service',
|
|
141
|
-
code: utils_3.removeComments(""
|
|
141
|
+
code: (0, utils_3.removeComments)("".concat(mf_getuser).concat(mp_jsonout).concat(ms_webout).concat(webout) +
|
|
142
142
|
'/* provide additional debug info */\n%global _program;\n%put &=syscc;\n%put user=%mf_getuser();\n%put pgm=&_program;\n%put timestamp=%sysfunc(datetime(),datetime19.);\n* Service Variables start;\n* Service Variables end;\n* SAS Macros start;\n* SAS Macros end;\n* SAS Includes start;\n* SAS Includes end;\n* Binary Files start;\n* Binary Files end;\n* Service start;\nproc sql;\ncreate table areas as select distinct area\n from sashelp.springs;\n%webout(OPEN)\n%webout(OBJ,areas)\n%webout(CLOSE)\n* Service end;')
|
|
143
143
|
},
|
|
144
144
|
{
|
|
145
145
|
name: 'getdata',
|
|
146
146
|
type: 'service',
|
|
147
|
-
code: utils_3.removeComments(""
|
|
147
|
+
code: (0, utils_3.removeComments)("".concat(mf_getuser).concat(mp_jsonout).concat(ms_webout).concat(webout) +
|
|
148
148
|
'/* provide additional debug info */\n%global _program;\n%put &=syscc;\n%put user=%mf_getuser();\n%put pgm=&_program;\n%put timestamp=%sysfunc(datetime(),datetime19.);\n* Service Variables start;\n* Service Variables end;\n* SAS Macros start;\n* SAS Macros end;\n* SAS Includes start;\n* SAS Includes end;\n* Binary Files start;\n* Binary Files end;\n* Service start;\n%webout(FETCH)\nproc sql;\ncreate table springs as select * from sashelp.springs\n where area in (select area from work.areas);\n%webout(OPEN)\n%webout(OBJ,springs)\n%webout(CLOSE)\n* Service end;')
|
|
149
149
|
}
|
|
150
150
|
]
|