@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
|
@@ -62,10 +62,10 @@ describe('sasjs folder operations', function () {
|
|
|
62
62
|
switch (_a.label) {
|
|
63
63
|
case 0:
|
|
64
64
|
process.projectDir = process.cwd();
|
|
65
|
-
return [4 /*yield*/, utils_2.setConstants()];
|
|
65
|
+
return [4 /*yield*/, (0, utils_2.setConstants)()];
|
|
66
66
|
case 1:
|
|
67
67
|
_a.sent();
|
|
68
|
-
return [4 /*yield*/, config_1.getAuthConfig(target)];
|
|
68
|
+
return [4 /*yield*/, (0, config_1.getAuthConfig)(target)];
|
|
69
69
|
case 2:
|
|
70
70
|
authConfig = _a.sent();
|
|
71
71
|
return [2 /*return*/];
|
|
@@ -77,15 +77,15 @@ describe('sasjs folder operations', function () {
|
|
|
77
77
|
return __generator(this, function (_a) {
|
|
78
78
|
switch (_a.label) {
|
|
79
79
|
case 0:
|
|
80
|
-
timestamp = utils_1.generateTimestamp();
|
|
81
|
-
testFolderPath = "/Public/app/cli-tests/cli-tests-folder-"
|
|
80
|
+
timestamp = (0, utils_1.generateTimestamp)();
|
|
81
|
+
testFolderPath = "/Public/app/cli-tests/cli-tests-folder-".concat(timestamp);
|
|
82
82
|
return [4 /*yield*/, createTestFolder(testFolderPath, sasjs, authConfig.access_token)];
|
|
83
83
|
case 1:
|
|
84
84
|
_a.sent();
|
|
85
|
-
return [4 /*yield*/, list_1.list('/Public/app/cli-tests', sasjs, authConfig.access_token)];
|
|
85
|
+
return [4 /*yield*/, (0, list_1.list)('/Public/app/cli-tests', sasjs, authConfig.access_token)];
|
|
86
86
|
case 2:
|
|
87
87
|
folderList = (_a.sent());
|
|
88
|
-
regex = new RegExp("(?<!S)cli-tests-folder-"
|
|
88
|
+
regex = new RegExp("(?<!S)cli-tests-folder-".concat(timestamp, "(?!S)"), 'gm');
|
|
89
89
|
expect(regex.test(folderList)).toBe(true);
|
|
90
90
|
return [4 /*yield*/, deleteTestFolder(testFolderPath, sasjs, authConfig.access_token)];
|
|
91
91
|
case 3:
|
|
@@ -99,33 +99,33 @@ describe('sasjs folder operations', function () {
|
|
|
99
99
|
return __generator(this, function (_a) {
|
|
100
100
|
switch (_a.label) {
|
|
101
101
|
case 0:
|
|
102
|
-
timestamp = utils_1.generateTimestamp();
|
|
103
|
-
testFolderPath = "/Public/app/cli-tests/cli-tests-folder-"
|
|
102
|
+
timestamp = (0, utils_1.generateTimestamp)();
|
|
103
|
+
testFolderPath = "/Public/app/cli-tests/cli-tests-folder-".concat(timestamp);
|
|
104
104
|
return [4 /*yield*/, createTestFolder(testFolderPath, sasjs, authConfig.access_token)];
|
|
105
105
|
case 1:
|
|
106
106
|
_a.sent();
|
|
107
|
-
return [4 /*yield*/, list_1.list('/Public/app/cli-tests', sasjs, authConfig.access_token)];
|
|
107
|
+
return [4 /*yield*/, (0, list_1.list)('/Public/app/cli-tests', sasjs, authConfig.access_token)];
|
|
108
108
|
case 2:
|
|
109
109
|
folderList = (_a.sent());
|
|
110
|
-
regex = new RegExp("(?<!S)cli-tests-folder-"
|
|
110
|
+
regex = new RegExp("(?<!S)cli-tests-folder-".concat(timestamp, "(?!S)"), 'gm');
|
|
111
111
|
expect(regex.test(folderList)).toBe(true);
|
|
112
|
-
return [4 /*yield*/, create_1.create(testFolderPath
|
|
112
|
+
return [4 /*yield*/, (0, create_1.create)("".concat(testFolderPath, "/temp/test"), sasjs, authConfig.access_token, false)];
|
|
113
113
|
case 3:
|
|
114
114
|
_a.sent();
|
|
115
|
-
return [4 /*yield*/, create_1.create(testFolderPath
|
|
115
|
+
return [4 /*yield*/, (0, create_1.create)("".concat(testFolderPath, "/test2"), sasjs, authConfig.access_token, false)];
|
|
116
116
|
case 4:
|
|
117
117
|
_a.sent();
|
|
118
|
-
return [4 /*yield*/, move_1.move(testFolderPath
|
|
118
|
+
return [4 /*yield*/, (0, move_1.move)("".concat(testFolderPath, "/temp"), "".concat(testFolderPath, "/test2"), sasjs, authConfig.access_token)
|
|
119
119
|
// Check if operations are executed correctly
|
|
120
120
|
];
|
|
121
121
|
case 5:
|
|
122
122
|
_a.sent();
|
|
123
|
-
return [4 /*yield*/, list_1.list(testFolderPath
|
|
123
|
+
return [4 /*yield*/, (0, list_1.list)("".concat(testFolderPath, "/test2"), sasjs, authConfig.access_token)];
|
|
124
124
|
case 6:
|
|
125
125
|
newFolderList = (_a.sent());
|
|
126
126
|
regex2 = new RegExp("(?<!S)temp(?!S)", 'gm');
|
|
127
127
|
expect(regex2.test(newFolderList)).toBe(true);
|
|
128
|
-
return [4 /*yield*/, list_1.list(testFolderPath
|
|
128
|
+
return [4 /*yield*/, (0, list_1.list)("".concat(testFolderPath, "/test2/temp"), sasjs, authConfig.access_token)];
|
|
129
129
|
case 7:
|
|
130
130
|
newSubfolderList = (_a.sent());
|
|
131
131
|
regex3 = new RegExp("(?<!S)test(?!S)", 'gm');
|
|
@@ -142,25 +142,25 @@ describe('sasjs folder operations', function () {
|
|
|
142
142
|
return __generator(this, function (_a) {
|
|
143
143
|
switch (_a.label) {
|
|
144
144
|
case 0:
|
|
145
|
-
timestamp = utils_1.generateTimestamp();
|
|
146
|
-
testFolderPath = "/Public/app/cli-tests/cli-tests-folder-"
|
|
145
|
+
timestamp = (0, utils_1.generateTimestamp)();
|
|
146
|
+
testFolderPath = "/Public/app/cli-tests/cli-tests-folder-".concat(timestamp);
|
|
147
147
|
return [4 /*yield*/, createTestFolder(testFolderPath, sasjs, authConfig.access_token)];
|
|
148
148
|
case 1:
|
|
149
149
|
_a.sent();
|
|
150
|
-
return [4 /*yield*/, list_1.list('/Public/app/cli-tests', sasjs, authConfig.access_token)];
|
|
150
|
+
return [4 /*yield*/, (0, list_1.list)('/Public/app/cli-tests', sasjs, authConfig.access_token)];
|
|
151
151
|
case 2:
|
|
152
152
|
folderList = (_a.sent());
|
|
153
|
-
regex = new RegExp("(?<!S)cli-tests-folder-"
|
|
153
|
+
regex = new RegExp("(?<!S)cli-tests-folder-".concat(timestamp, "(?!S)"), 'gm');
|
|
154
154
|
expect(regex.test(folderList)).toBe(true);
|
|
155
|
-
return [4 /*yield*/, create_1.create(testFolderPath
|
|
155
|
+
return [4 /*yield*/, (0, create_1.create)("".concat(testFolderPath, "/temp/test"), sasjs, authConfig.access_token, false)];
|
|
156
156
|
case 3:
|
|
157
157
|
_a.sent();
|
|
158
|
-
return [4 /*yield*/, move_1.move(testFolderPath
|
|
158
|
+
return [4 /*yield*/, (0, move_1.move)("".concat(testFolderPath, "/temp/test"), "".concat(testFolderPath, "/temp/test_renamed"), sasjs, authConfig.access_token)
|
|
159
159
|
// Check if operations are executed correctly
|
|
160
160
|
];
|
|
161
161
|
case 4:
|
|
162
162
|
_a.sent();
|
|
163
|
-
return [4 /*yield*/, list_1.list(testFolderPath
|
|
163
|
+
return [4 /*yield*/, (0, list_1.list)("".concat(testFolderPath, "/temp"), sasjs, authConfig.access_token)];
|
|
164
164
|
case 5:
|
|
165
165
|
newFolderList = (_a.sent());
|
|
166
166
|
regex2 = new RegExp("(?<!S)test_renamed(?!S)", 'gm');
|
|
@@ -177,12 +177,12 @@ describe('sasjs folder operations', function () {
|
|
|
177
177
|
return __generator(this, function (_a) {
|
|
178
178
|
switch (_a.label) {
|
|
179
179
|
case 0:
|
|
180
|
-
timestamp = utils_1.generateTimestamp();
|
|
181
|
-
testFolderPath = "/Public/app/cli-tests/cli-tests-folder-"
|
|
180
|
+
timestamp = (0, utils_1.generateTimestamp)();
|
|
181
|
+
testFolderPath = "/Public/app/cli-tests/cli-tests-folder-".concat(timestamp);
|
|
182
182
|
return [4 /*yield*/, createTestFolder(testFolderPath, sasjs, authConfig.access_token)];
|
|
183
183
|
case 1:
|
|
184
184
|
_a.sent();
|
|
185
|
-
return [4 /*yield*/, list_1.list('/Public/app/cli-tests', sasjs, authConfig.access_token)
|
|
185
|
+
return [4 /*yield*/, (0, list_1.list)('/Public/app/cli-tests', sasjs, authConfig.access_token)
|
|
186
186
|
/**
|
|
187
187
|
* This regex function will pass only if it matches the whole word.
|
|
188
188
|
* It will ignore whitespaces.
|
|
@@ -190,20 +190,20 @@ describe('sasjs folder operations', function () {
|
|
|
190
190
|
];
|
|
191
191
|
case 2:
|
|
192
192
|
folderList = _a.sent();
|
|
193
|
-
regex = new RegExp("(?<!S)cli-tests-folder-"
|
|
193
|
+
regex = new RegExp("(?<!S)cli-tests-folder-".concat(timestamp, "(?!S)"), 'gm');
|
|
194
194
|
expect(regex.test(folderList)).toBe(true);
|
|
195
|
-
return [4 /*yield*/, create_1.create(testFolderPath
|
|
195
|
+
return [4 /*yield*/, (0, create_1.create)("".concat(testFolderPath, "/temp/test"), sasjs, authConfig.access_token, false)];
|
|
196
196
|
case 3:
|
|
197
197
|
_a.sent();
|
|
198
|
-
return [4 /*yield*/, create_1.create(testFolderPath
|
|
198
|
+
return [4 /*yield*/, (0, create_1.create)("".concat(testFolderPath, "/test2"), sasjs, authConfig.access_token, false)];
|
|
199
199
|
case 4:
|
|
200
200
|
_a.sent();
|
|
201
|
-
return [4 /*yield*/, move_1.move(testFolderPath
|
|
201
|
+
return [4 /*yield*/, (0, move_1.move)("".concat(testFolderPath, "/temp"), "".concat(testFolderPath, "/test2/test_renamed"), sasjs, authConfig.access_token)
|
|
202
202
|
// Check if operations are executed correctly
|
|
203
203
|
];
|
|
204
204
|
case 5:
|
|
205
205
|
_a.sent();
|
|
206
|
-
return [4 /*yield*/, list_1.list(testFolderPath
|
|
206
|
+
return [4 /*yield*/, (0, list_1.list)("".concat(testFolderPath, "/test2"), sasjs, authConfig.access_token)
|
|
207
207
|
/**
|
|
208
208
|
* This regex function will pass only if it matches the whole word.
|
|
209
209
|
* It will ignore whitespaces.
|
|
@@ -224,11 +224,11 @@ describe('sasjs folder operations', function () {
|
|
|
224
224
|
function generateTarget(serverType) {
|
|
225
225
|
if (serverType === void 0) { serverType = utils_1.ServerType.SasViya; }
|
|
226
226
|
dotenv_1.default.config();
|
|
227
|
-
var timestamp = utils_1.generateTimestamp();
|
|
228
|
-
var targetName = "cli-tests-folder-"
|
|
227
|
+
var timestamp = (0, utils_1.generateTimestamp)();
|
|
228
|
+
var targetName = "cli-tests-folder-".concat(timestamp);
|
|
229
229
|
return new utils_1.Target({
|
|
230
230
|
name: targetName,
|
|
231
|
-
appLoc: "/Public/app/cli-tests/"
|
|
231
|
+
appLoc: "/Public/app/cli-tests/".concat(targetName),
|
|
232
232
|
serverType: serverType,
|
|
233
233
|
contextName: utils_2.contextName,
|
|
234
234
|
serverUrl: (serverType === utils_1.ServerType.SasViya
|
|
@@ -245,7 +245,7 @@ function generateTarget(serverType) {
|
|
|
245
245
|
var createTestFolder = function (testFolderPath, sasjs, accessToken) { return __awaiter(void 0, void 0, void 0, function () {
|
|
246
246
|
return __generator(this, function (_a) {
|
|
247
247
|
switch (_a.label) {
|
|
248
|
-
case 0: return [4 /*yield*/, create_1.create(testFolderPath, sasjs, accessToken, false)];
|
|
248
|
+
case 0: return [4 /*yield*/, (0, create_1.create)(testFolderPath, sasjs, accessToken, false)];
|
|
249
249
|
case 1:
|
|
250
250
|
_a.sent();
|
|
251
251
|
return [2 /*return*/];
|
|
@@ -255,7 +255,7 @@ var createTestFolder = function (testFolderPath, sasjs, accessToken) { return __
|
|
|
255
255
|
var deleteTestFolder = function (testFolderPath, sasjs, accessToken) { return __awaiter(void 0, void 0, void 0, function () {
|
|
256
256
|
return __generator(this, function (_a) {
|
|
257
257
|
switch (_a.label) {
|
|
258
|
-
case 0: return [4 /*yield*/, delete_1.deleteFolder(testFolderPath, sasjs, accessToken)];
|
|
258
|
+
case 0: return [4 /*yield*/, (0, delete_1.deleteFolder)(testFolderPath, sasjs, accessToken)];
|
|
259
259
|
case 1:
|
|
260
260
|
_a.sent();
|
|
261
261
|
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 folderCommand_1 = require("../folderCommand");
|
|
@@ -97,7 +101,7 @@ describe('FolderCommand - create', function () {
|
|
|
97
101
|
setupMocks();
|
|
98
102
|
});
|
|
99
103
|
it('should parse a simple sasjs folder create command', function () {
|
|
100
|
-
var args = __spreadArray(__spreadArray([], __read(defaultArgs)), ['folder', 'create', '/test']);
|
|
104
|
+
var args = __spreadArray(__spreadArray([], __read(defaultArgs), false), ['folder', 'create', '/test'], false);
|
|
101
105
|
var command = new folderCommand_1.FolderCommand(args);
|
|
102
106
|
expect(command.name).toEqual('folder');
|
|
103
107
|
expect(command.subCommand).toEqual('create');
|
|
@@ -107,7 +111,7 @@ describe('FolderCommand - create', function () {
|
|
|
107
111
|
return __generator(this, function (_a) {
|
|
108
112
|
switch (_a.label) {
|
|
109
113
|
case 0:
|
|
110
|
-
args = __spreadArray(__spreadArray([], __read(defaultArgs)), ['folder', 'create', '/test', '-t', 'test']);
|
|
114
|
+
args = __spreadArray(__spreadArray([], __read(defaultArgs), false), ['folder', 'create', '/test', '-t', 'test'], false);
|
|
111
115
|
command = new folderCommand_1.FolderCommand(args);
|
|
112
116
|
return [4 /*yield*/, command.getTargetInfo()];
|
|
113
117
|
case 1:
|
|
@@ -124,7 +128,7 @@ describe('FolderCommand - create', function () {
|
|
|
124
128
|
return __generator(this, function (_a) {
|
|
125
129
|
switch (_a.label) {
|
|
126
130
|
case 0:
|
|
127
|
-
args = __spreadArray(__spreadArray([], __read(defaultArgs)), ['folder', 'create', '/test', '-t', 'test']);
|
|
131
|
+
args = __spreadArray(__spreadArray([], __read(defaultArgs), false), ['folder', 'create', '/test', '-t', 'test'], false);
|
|
128
132
|
command = new folderCommand_1.FolderCommand(args);
|
|
129
133
|
return [4 /*yield*/, command.execute()];
|
|
130
134
|
case 1:
|
|
@@ -139,7 +143,7 @@ describe('FolderCommand - create', function () {
|
|
|
139
143
|
return __generator(this, function (_a) {
|
|
140
144
|
switch (_a.label) {
|
|
141
145
|
case 0:
|
|
142
|
-
args = __spreadArray(__spreadArray([], __read(defaultArgs)), ['folder', 'create', '/test', '-t', 'test']);
|
|
146
|
+
args = __spreadArray(__spreadArray([], __read(defaultArgs), false), ['folder', 'create', '/test', '-t', 'test'], false);
|
|
143
147
|
command = new folderCommand_1.FolderCommand(args);
|
|
144
148
|
return [4 /*yield*/, command.execute()];
|
|
145
149
|
case 1:
|
|
@@ -154,7 +158,7 @@ describe('FolderCommand - create', function () {
|
|
|
154
158
|
return __generator(this, function (_a) {
|
|
155
159
|
switch (_a.label) {
|
|
156
160
|
case 0:
|
|
157
|
-
args = __spreadArray(__spreadArray([], __read(defaultArgs)), ['folder', 'create', '/test', '-t', 'test']);
|
|
161
|
+
args = __spreadArray(__spreadArray([], __read(defaultArgs), false), ['folder', 'create', '/test', '-t', 'test'], false);
|
|
158
162
|
jest
|
|
159
163
|
.spyOn(createModule, 'create')
|
|
160
164
|
.mockImplementation(function () { return Promise.reject(); });
|
|
@@ -174,7 +178,7 @@ describe('FolderCommand - delete', function () {
|
|
|
174
178
|
setupMocks();
|
|
175
179
|
});
|
|
176
180
|
it('should parse a simple sasjs folder delete command', function () {
|
|
177
|
-
var args = __spreadArray(__spreadArray([], __read(defaultArgs)), ['folder', 'delete', '/test']);
|
|
181
|
+
var args = __spreadArray(__spreadArray([], __read(defaultArgs), false), ['folder', 'delete', '/test'], false);
|
|
178
182
|
var command = new folderCommand_1.FolderCommand(args);
|
|
179
183
|
expect(command.name).toEqual('folder');
|
|
180
184
|
expect(command.subCommand).toEqual('delete');
|
|
@@ -184,7 +188,7 @@ describe('FolderCommand - delete', function () {
|
|
|
184
188
|
return __generator(this, function (_a) {
|
|
185
189
|
switch (_a.label) {
|
|
186
190
|
case 0:
|
|
187
|
-
args = __spreadArray(__spreadArray([], __read(defaultArgs)), ['folder', 'delete', '/test', '-t', 'test']);
|
|
191
|
+
args = __spreadArray(__spreadArray([], __read(defaultArgs), false), ['folder', 'delete', '/test', '-t', 'test'], false);
|
|
188
192
|
command = new folderCommand_1.FolderCommand(args);
|
|
189
193
|
return [4 /*yield*/, command.getTargetInfo()];
|
|
190
194
|
case 1:
|
|
@@ -201,7 +205,7 @@ describe('FolderCommand - delete', function () {
|
|
|
201
205
|
return __generator(this, function (_a) {
|
|
202
206
|
switch (_a.label) {
|
|
203
207
|
case 0:
|
|
204
|
-
args = __spreadArray(__spreadArray([], __read(defaultArgs)), ['folder', 'delete', '/test', '-t', 'test']);
|
|
208
|
+
args = __spreadArray(__spreadArray([], __read(defaultArgs), false), ['folder', 'delete', '/test', '-t', 'test'], false);
|
|
205
209
|
command = new folderCommand_1.FolderCommand(args);
|
|
206
210
|
return [4 /*yield*/, command.execute()];
|
|
207
211
|
case 1:
|
|
@@ -216,7 +220,7 @@ describe('FolderCommand - delete', function () {
|
|
|
216
220
|
return __generator(this, function (_a) {
|
|
217
221
|
switch (_a.label) {
|
|
218
222
|
case 0:
|
|
219
|
-
args = __spreadArray(__spreadArray([], __read(defaultArgs)), ['folder', 'delete', '/test', '-t', 'test']);
|
|
223
|
+
args = __spreadArray(__spreadArray([], __read(defaultArgs), false), ['folder', 'delete', '/test', '-t', 'test'], false);
|
|
220
224
|
command = new folderCommand_1.FolderCommand(args);
|
|
221
225
|
return [4 /*yield*/, command.execute()];
|
|
222
226
|
case 1:
|
|
@@ -231,7 +235,7 @@ describe('FolderCommand - delete', function () {
|
|
|
231
235
|
return __generator(this, function (_a) {
|
|
232
236
|
switch (_a.label) {
|
|
233
237
|
case 0:
|
|
234
|
-
args = __spreadArray(__spreadArray([], __read(defaultArgs)), ['folder', 'delete', '/test', '-t', 'test']);
|
|
238
|
+
args = __spreadArray(__spreadArray([], __read(defaultArgs), false), ['folder', 'delete', '/test', '-t', 'test'], false);
|
|
235
239
|
jest
|
|
236
240
|
.spyOn(deleteModule, 'deleteFolder')
|
|
237
241
|
.mockImplementation(function () { return Promise.reject(); });
|
|
@@ -251,7 +255,7 @@ describe('FolderCommand - list', function () {
|
|
|
251
255
|
setupMocks();
|
|
252
256
|
});
|
|
253
257
|
it('should parse a simple sasjs folder list command', function () {
|
|
254
|
-
var args = __spreadArray(__spreadArray([], __read(defaultArgs)), ['folder', 'list', '/test']);
|
|
258
|
+
var args = __spreadArray(__spreadArray([], __read(defaultArgs), false), ['folder', 'list', '/test'], false);
|
|
255
259
|
var command = new folderCommand_1.FolderCommand(args);
|
|
256
260
|
expect(command.name).toEqual('folder');
|
|
257
261
|
expect(command.subCommand).toEqual('list');
|
|
@@ -261,7 +265,7 @@ describe('FolderCommand - list', function () {
|
|
|
261
265
|
return __generator(this, function (_a) {
|
|
262
266
|
switch (_a.label) {
|
|
263
267
|
case 0:
|
|
264
|
-
args = __spreadArray(__spreadArray([], __read(defaultArgs)), ['folder', 'list', '/test', '-t', 'test']);
|
|
268
|
+
args = __spreadArray(__spreadArray([], __read(defaultArgs), false), ['folder', 'list', '/test', '-t', 'test'], false);
|
|
265
269
|
command = new folderCommand_1.FolderCommand(args);
|
|
266
270
|
return [4 /*yield*/, command.getTargetInfo()];
|
|
267
271
|
case 1:
|
|
@@ -278,7 +282,7 @@ describe('FolderCommand - list', function () {
|
|
|
278
282
|
return __generator(this, function (_a) {
|
|
279
283
|
switch (_a.label) {
|
|
280
284
|
case 0:
|
|
281
|
-
args = __spreadArray(__spreadArray([], __read(defaultArgs)), ['folder', 'list', '/test', '-t', 'test']);
|
|
285
|
+
args = __spreadArray(__spreadArray([], __read(defaultArgs), false), ['folder', 'list', '/test', '-t', 'test'], false);
|
|
282
286
|
command = new folderCommand_1.FolderCommand(args);
|
|
283
287
|
return [4 /*yield*/, command.execute()];
|
|
284
288
|
case 1:
|
|
@@ -293,7 +297,7 @@ describe('FolderCommand - list', function () {
|
|
|
293
297
|
return __generator(this, function (_a) {
|
|
294
298
|
switch (_a.label) {
|
|
295
299
|
case 0:
|
|
296
|
-
args = __spreadArray(__spreadArray([], __read(defaultArgs)), ['folder', 'list', '/test', '-t', 'test']);
|
|
300
|
+
args = __spreadArray(__spreadArray([], __read(defaultArgs), false), ['folder', 'list', '/test', '-t', 'test'], false);
|
|
297
301
|
command = new folderCommand_1.FolderCommand(args);
|
|
298
302
|
return [4 /*yield*/, command.execute()];
|
|
299
303
|
case 1:
|
|
@@ -308,7 +312,7 @@ describe('FolderCommand - list', function () {
|
|
|
308
312
|
return __generator(this, function (_a) {
|
|
309
313
|
switch (_a.label) {
|
|
310
314
|
case 0:
|
|
311
|
-
args = __spreadArray(__spreadArray([], __read(defaultArgs)), ['folder', 'list', '/test', '-t', 'test']);
|
|
315
|
+
args = __spreadArray(__spreadArray([], __read(defaultArgs), false), ['folder', 'list', '/test', '-t', 'test'], false);
|
|
312
316
|
jest.spyOn(listModule, 'list').mockImplementation(function () { return Promise.reject(); });
|
|
313
317
|
command = new folderCommand_1.FolderCommand(args);
|
|
314
318
|
return [4 /*yield*/, command.execute()];
|
|
@@ -59,12 +59,12 @@ function printHelpText() {
|
|
|
59
59
|
name: 'create',
|
|
60
60
|
title: 'create <foldername>.',
|
|
61
61
|
description: [
|
|
62
|
-
"Creates the folder structure specified in config.json, inside the provided parent folder e.g. "
|
|
62
|
+
"Creates the folder structure specified in config.json, inside the provided parent folder e.g. ".concat(chalk_1.default.cyanBright('sasjs create my-sas-project'), "."),
|
|
63
63
|
"- if no foldername is specified, it creates the folder structure in the current working directory.",
|
|
64
64
|
"- If this is an existing NPM project, it will update package.json with the @sasjs/core dependency.",
|
|
65
|
-
"- An additional option can be specified to create a web app from a template. This supports creation of Angular, React and minimal web apps. There is also a sasonly option. e.g. "
|
|
65
|
+
"- An additional option can be specified to create a web app from a template. This supports creation of Angular, React and minimal web apps. There is also a sasonly option. e.g. ".concat(chalk_1.default.cyanBright('sasjs create my-sas-project --template react'), " and ").concat(chalk_1.default.cyanBright('sasjs create my-sas-project -t angular'))
|
|
66
66
|
],
|
|
67
|
-
syntax: "creates the folder structure specified in config.json, inside the provided parent folder\n e.g. sasjs create my-sas-project\n - if no foldername is specified, it creates the folder structure in the current working directory.\n - If this is an existing NPM project, it will update package.json with the @sasjs/core dependency.\n - An additional option can be specified to create a web app from a template.\n This supports creation of Angular, React and minimal web apps. There are also sasonly and jobs options.\n e.g. "
|
|
67
|
+
syntax: "creates the folder structure specified in config.json, inside the provided parent folder\n e.g. sasjs create my-sas-project\n - if no foldername is specified, it creates the folder structure in the current working directory.\n - If this is an existing NPM project, it will update package.json with the @sasjs/core dependency.\n - An additional option can be specified to create a web app from a template.\n This supports creation of Angular, React and minimal web apps. There are also sasonly and jobs options.\n e.g. ".concat(chalk_1.default.cyanBright('sasjs create my-sas-project --template react'), "\n ").concat(chalk_1.default.cyanBright('sasjs create my-sas-project -t angular'))
|
|
68
68
|
},
|
|
69
69
|
{
|
|
70
70
|
name: 'version',
|
|
@@ -80,21 +80,21 @@ function printHelpText() {
|
|
|
80
80
|
name: 'web',
|
|
81
81
|
title: 'web <targetName>',
|
|
82
82
|
description: [
|
|
83
|
-
"compiles the web app service and place at "
|
|
83
|
+
"compiles the web app service and place at ".concat(chalk_1.default.cyanBright('webSourcePath'), ".")
|
|
84
84
|
]
|
|
85
85
|
},
|
|
86
86
|
{
|
|
87
87
|
name: 'db',
|
|
88
88
|
title: 'db <targetName>',
|
|
89
89
|
description: [
|
|
90
|
-
"compiles the dbfiles specified in the "
|
|
90
|
+
"compiles the dbfiles specified in the ".concat(chalk_1.default.cyanBright('db'), " folder.")
|
|
91
91
|
]
|
|
92
92
|
},
|
|
93
93
|
{
|
|
94
94
|
name: 'compile',
|
|
95
95
|
title: 'compile <targetName>',
|
|
96
96
|
description: [
|
|
97
|
-
"compiles the services specified in the "
|
|
97
|
+
"compiles the services specified in the ".concat(chalk_1.default.cyanBright('serviceFolders'), " property of the 'serviceConfig' in your target and common configuration.")
|
|
98
98
|
]
|
|
99
99
|
},
|
|
100
100
|
{
|
|
@@ -105,41 +105,41 @@ function printHelpText() {
|
|
|
105
105
|
"in sasjsconfig.json.",
|
|
106
106
|
"First Build (macro) variables are inserted, then all of the buildinit / buildterm dependencies,then the buildinit (a good place to source the Viya app tokens), then all of the compiled services are added, and finally the buildterm script (where you might perform additional deployment actions such as database build).",
|
|
107
107
|
"This SAS file could be executed as part of a web service (executed by the Deploy command) or simply copy pasted into Enterprise Guide or SAS Studio.",
|
|
108
|
-
"It will also perform "
|
|
108
|
+
"It will also perform ".concat(chalk_1.default.greenBright('compile'), " command if services are not compiled.")
|
|
109
109
|
]
|
|
110
110
|
},
|
|
111
111
|
{
|
|
112
112
|
name: 'compilebuild',
|
|
113
113
|
title: 'compilebuild <targetName>',
|
|
114
114
|
description: [
|
|
115
|
-
"compiles the services specified in the "
|
|
116
|
-
"It will also perform "
|
|
115
|
+
"compiles the services specified in the ".concat(chalk_1.default.cyanBright('serviceFolders'), "in the 'serviceConfig' in your target and common configurations."),
|
|
116
|
+
"It will also perform ".concat(chalk_1.default.greenBright('build'), " command.")
|
|
117
117
|
]
|
|
118
118
|
},
|
|
119
119
|
{
|
|
120
120
|
name: 'deploy',
|
|
121
121
|
title: 'deploy <targetName>',
|
|
122
122
|
description: [
|
|
123
|
-
"triggers a shell command as specified in the "
|
|
123
|
+
"triggers a shell command as specified in the ".concat(chalk_1.default.cyanBright('deployScripts'), " property in your target's 'deployConfig' and the common 'deployConfig')."),
|
|
124
124
|
"This command would perform tasks such as executing the deployment script, exporting the SPK, triggering tests etc.",
|
|
125
|
-
"The "
|
|
125
|
+
"The ".concat(chalk_1.default.cyanBright('deployScripts'), " specified in each target's 'deployConfig' can include an array of scripts."),
|
|
126
126
|
"Each script can be a SAS file or a shell script.",
|
|
127
127
|
"If it is a shell script, it is executed locally and the output is displayed on the command line.",
|
|
128
128
|
"If it is a SAS file, it is sent to the SAS server for execution.",
|
|
129
129
|
"To facilitate this, some configuration needs to be provided.",
|
|
130
130
|
"This configuration is different for SAS VIYA and SAS9 servers:",
|
|
131
131
|
"For SAS VIYA servers, the following items are required:",
|
|
132
|
-
"[2spaces]* "
|
|
132
|
+
"[2spaces]* ".concat(chalk_1.default.cyanBright('ACCESS_TOKEN'), " - An access token for performing operations with the SAS VIYA API."),
|
|
133
133
|
"If the target has been specified in your project's local sasjsconfig.json file, this token needs to be present in a '.env' file corresponding to your target's name.",
|
|
134
134
|
"So if your target was called 'viya-test', your '.env' file must be called '.env.viya-test'.",
|
|
135
135
|
"You can automatically generate an access token and add it to the correct .env file using the sasjs add or sasjs add cred commands.",
|
|
136
|
-
"[2spaces]* "
|
|
136
|
+
"[2spaces]* ".concat(chalk_1.default.cyanBright('contextName'), " - The name of the compute context that must be used to execute SAS code, e.g. \"SharedCompute\". This needs to be specified as part of the target JSON as the 'contextName' property."),
|
|
137
137
|
"For SAS9 servers, the following items are required to be specified in the target JSON:",
|
|
138
|
-
"[2spaces]* "
|
|
139
|
-
"[2spaces]* "
|
|
138
|
+
"[2spaces]* ".concat(chalk_1.default.cyanBright('serverName'), " - The name of the server where SAS code will be executed, e.g. \"SASApp\"."),
|
|
139
|
+
"[2spaces]* ".concat(chalk_1.default.cyanBright('repositoryName'), " - The metadata repository, e.g. \"Foundation\"."),
|
|
140
140
|
"In addition the following variables must be set:",
|
|
141
|
-
"[2spaces]* "
|
|
142
|
-
"[2spaces]* "
|
|
141
|
+
"[2spaces]* ".concat(chalk_1.default.cyanBright('serverUrl'), " - The full path to the server (eg https://yourserver)"),
|
|
142
|
+
"[2spaces]* ".concat(chalk_1.default.cyanBright('serverType'), " - Eg SAS9 or SASVIYA"),
|
|
143
143
|
"NOTE: By default deploy will overwrite an existing deploy (force deploy)."
|
|
144
144
|
]
|
|
145
145
|
},
|
|
@@ -147,8 +147,8 @@ function printHelpText() {
|
|
|
147
147
|
name: 'compilebuilddeploy',
|
|
148
148
|
title: 'compilebuilddeploy <targetName>',
|
|
149
149
|
description: [
|
|
150
|
-
"executes script file specified in the "
|
|
151
|
-
"It will also perform "
|
|
150
|
+
"executes script file specified in the ".concat(chalk_1.default.cyanBright('deployScripts'), " property in the target and common 'deployConfig'"),
|
|
151
|
+
"It will also perform ".concat(chalk_1.default.greenBright('compilebuild'), " command."),
|
|
152
152
|
"",
|
|
153
153
|
"NOTE: If no target name is specified/matched, it will build the first target present in config.json.",
|
|
154
154
|
"NOTE: By default deploy will overwrite an existing deploy (force deploy)."
|
|
@@ -159,14 +159,14 @@ function printHelpText() {
|
|
|
159
159
|
title: 'servicepack <targetName>',
|
|
160
160
|
description: [
|
|
161
161
|
"performs operations on Service Packs (collections of jobs & folders).",
|
|
162
|
-
"* "
|
|
162
|
+
"* ".concat(chalk_1.default.cyanBright('deploy'), " - deploys service pack from json file."),
|
|
163
163
|
"[2spaces]command example: sasjs servicepack deploy --source ./path/services.json --target targetName",
|
|
164
164
|
"",
|
|
165
165
|
"[4spaces]You can force deploy (overwrite an existing deploy) by passing the (-f) flag.",
|
|
166
166
|
"[4spaces]Default target name will be used if target name was omitted.",
|
|
167
167
|
"",
|
|
168
168
|
"NOTE: The sasjs servicepack operation is only supported for SAS Viya build targets.",
|
|
169
|
-
"More information available in the online documentation: "
|
|
169
|
+
"More information available in the online documentation: ".concat(chalk_1.default.cyanBright('https://sasjs.io/sasjs-cli-servicepack'))
|
|
170
170
|
]
|
|
171
171
|
},
|
|
172
172
|
{
|
|
@@ -174,19 +174,19 @@ function printHelpText() {
|
|
|
174
174
|
title: 'context <targetName>',
|
|
175
175
|
description: [
|
|
176
176
|
"performs operations on contexts.",
|
|
177
|
-
"* "
|
|
177
|
+
"* ".concat(chalk_1.default.cyanBright('create'), " - creates new context."),
|
|
178
178
|
"[2spaces]command example: sasjs context create --source ../contextConfig.json --target targetName",
|
|
179
|
-
"* "
|
|
179
|
+
"* ".concat(chalk_1.default.cyanBright('edit'), " - edits existing context."),
|
|
180
180
|
"[2spaces]command example: sasjs context edit contextName --source ../contextConfig.json --target targetName",
|
|
181
|
-
"* "
|
|
181
|
+
"* ".concat(chalk_1.default.cyanBright('delete'), " - deletes existing context."),
|
|
182
182
|
"[2spaces]command example: sasjs context delete contextName --target targetName",
|
|
183
|
-
"* "
|
|
183
|
+
"* ".concat(chalk_1.default.cyanBright('list'), " - lists all accessible and inaccessible contexts."),
|
|
184
184
|
"[2spaces]command example: sasjs context list --target targetName",
|
|
185
|
-
"* "
|
|
185
|
+
"* ".concat(chalk_1.default.cyanBright('export'), " - exports context to contextName.json in the current folder."),
|
|
186
186
|
"[2spaces]command example: sasjs context export contextName --target targetName",
|
|
187
187
|
"[2spaces]exported context example:\n [4spaces]{\n [4spaces]\"createdBy\": \"admin\",\n [4spaces]\"links\": [...],\n [4spaces]\"id\": \"id...\",\n [4spaces]\"version\": 2,\n [4spaces]\"name\": \"Compute Context\"\n [4spaces]}",
|
|
188
188
|
"",
|
|
189
|
-
"NOTE: The sasjs context operation is only supported for SAS Viya build targets. More information available in the online documentation: "
|
|
189
|
+
"NOTE: The sasjs context operation is only supported for SAS Viya build targets. More information available in the online documentation: ".concat(chalk_1.default.cyanBright('https://sasjs.io/sasjs-cli-context'))
|
|
190
190
|
]
|
|
191
191
|
},
|
|
192
192
|
{
|
|
@@ -195,7 +195,7 @@ function printHelpText() {
|
|
|
195
195
|
description: [
|
|
196
196
|
"lets the user add a build target to either the local project configuration, or to the global .sasjsrc file.",
|
|
197
197
|
"",
|
|
198
|
-
"NOTE: This command requires the user to input all the required parameters. More information available in the online documentation: "
|
|
198
|
+
"NOTE: This command requires the user to input all the required parameters. More information available in the online documentation: ".concat(chalk_1.default.cyanBright('https://sasjs.io/sasjs-cli-add'))
|
|
199
199
|
]
|
|
200
200
|
},
|
|
201
201
|
{
|
|
@@ -204,7 +204,7 @@ function printHelpText() {
|
|
|
204
204
|
description: [
|
|
205
205
|
"lets the user add credentials for target to either the local project configuration, or to the global .sasjsrc file.",
|
|
206
206
|
"",
|
|
207
|
-
"NOTE: This command requires the user to input all the required parameters. More information available in the online documentation: "
|
|
207
|
+
"NOTE: This command requires the user to input all the required parameters. More information available in the online documentation: ".concat(chalk_1.default.cyanBright('https://cli.sasjs.io/auth/'))
|
|
208
208
|
]
|
|
209
209
|
},
|
|
210
210
|
{
|
|
@@ -230,15 +230,15 @@ function printHelpText() {
|
|
|
230
230
|
title: 'folder <command>',
|
|
231
231
|
description: [
|
|
232
232
|
"performs operations on folders.",
|
|
233
|
-
"* "
|
|
233
|
+
"* ".concat(chalk_1.default.cyanBright('create'), " - creates new folder."),
|
|
234
234
|
"[2spaces]command example: sasjs folder create /Public/folder -t targetName -f",
|
|
235
235
|
"",
|
|
236
236
|
"[2spaces]NOTE: Providing force flag (-f or --force) is optional. If provided and target folder already exists, its content and all subfolders will be deleted.",
|
|
237
237
|
"",
|
|
238
|
-
"* "
|
|
238
|
+
"* ".concat(chalk_1.default.cyanBright('delete'), " - deletes folder."),
|
|
239
239
|
"[2spaces]command example: sasjs folder delete /Public/folder --target targetName",
|
|
240
240
|
"",
|
|
241
|
-
"* "
|
|
241
|
+
"* ".concat(chalk_1.default.cyanBright('move'), " - moves folder to a new location"),
|
|
242
242
|
"[2spaces]command example: sasjs folder move /Public/sourceFolder /Public/targetFolder --target targetName"
|
|
243
243
|
]
|
|
244
244
|
},
|
|
@@ -247,7 +247,7 @@ function printHelpText() {
|
|
|
247
247
|
title: 'job <command>',
|
|
248
248
|
description: [
|
|
249
249
|
"performs operations on jobs.",
|
|
250
|
-
"[2spaces]* "
|
|
250
|
+
"[2spaces]* ".concat(chalk_1.default.cyanBright('execute'), " - triggers job for execution."),
|
|
251
251
|
"[2spaces]command example: sasjs job execute /Public/job -t targetName --output ./outputFolder/output.json --returnStatusOnly --ignoreWarnings",
|
|
252
252
|
"[2spaces]command example: sasjs job execute /Public/job -t targetName --wait --log ./logFolder/log.json -r -i",
|
|
253
253
|
"",
|
|
@@ -263,7 +263,7 @@ function printHelpText() {
|
|
|
263
263
|
title: 'flow <command>',
|
|
264
264
|
description: [
|
|
265
265
|
"Performs operations on flows of jobs.",
|
|
266
|
-
"[2spaces]* "
|
|
266
|
+
"[2spaces]* ".concat(chalk_1.default.cyanBright('execute'), " - triggers flow for execution."),
|
|
267
267
|
"[2spaces]command example: sasjs flow execute --source /local/flow.json --logFolder /local/log/folder --csvFile /local/some.csv"
|
|
268
268
|
]
|
|
269
269
|
},
|
|
@@ -274,13 +274,13 @@ function printHelpText() {
|
|
|
274
274
|
"Generates docs for SAS Programs / Macros / Jobs / Services listed in the sasjsconfig.json file by default and supplied Target. If target is not provided, it will pick first target present in config.json",
|
|
275
275
|
"[2spaces]command example: sasjs doc -t <targetName> --outDirectory <sasFilePath>",
|
|
276
276
|
"",
|
|
277
|
-
"[2spaces]* "
|
|
277
|
+
"[2spaces]* ".concat(chalk_1.default.cyanBright('lineage'), " - Generates dot files for all Jobs / Services listed in the sasjsconfig.json file by default and supplied Target."),
|
|
278
278
|
"[2spaces]command example: sasjs doc lineage -t <targetName> --outDirectory <sasFilePath>",
|
|
279
279
|
"",
|
|
280
280
|
"[2spaces]NOTE: Providing outDirectory flag is optional. If not present, CLI will generate docs in the sasjsbuild/docs directory.",
|
|
281
281
|
"The target can exist either in the local project configuration or in the global .sasjsrc file.",
|
|
282
282
|
"",
|
|
283
|
-
"[2spaces]* "
|
|
283
|
+
"[2spaces]* ".concat(chalk_1.default.cyanBright('init'), " - Initialize/reset doxy folder (having content files + configuration) for docs"),
|
|
284
284
|
"[2spaces]command example: sasjs doc init"
|
|
285
285
|
]
|
|
286
286
|
},
|
|
@@ -319,21 +319,21 @@ function printHelpText() {
|
|
|
319
319
|
{ name: 'version', aliases: ['v'] },
|
|
320
320
|
{ name: 'web', aliases: ['w'] }
|
|
321
321
|
];
|
|
322
|
-
outputCommands = ""
|
|
322
|
+
outputCommands = "".concat(commands
|
|
323
323
|
.sort(function (a, b) { return (a.name < b.name ? -1 : 1); })
|
|
324
324
|
.map(function (command) {
|
|
325
|
-
return "* "
|
|
325
|
+
return "* ".concat(chalk_1.default.greenBright(limitLineLength(command.title)), " - ").concat(command.description
|
|
326
326
|
.map(function (line) { return limitLineLength(line); })
|
|
327
|
-
.join("\n\t");
|
|
328
|
-
}).join("\n ");
|
|
329
|
-
outputAliases = ""
|
|
327
|
+
.join("\n\t"));
|
|
328
|
+
}).join("\n "));
|
|
329
|
+
outputAliases = "".concat(aliases
|
|
330
330
|
.sort(function (a, b) { return (a.name < b.name ? -1 : 1); })
|
|
331
331
|
.map(function (alias) {
|
|
332
|
-
return "* "
|
|
332
|
+
return "* ".concat(chalk_1.default.greenBright(alias.name), " : ").concat(alias.aliases
|
|
333
333
|
.sort(function (a, b) { return (a > b ? -1 : 1); })
|
|
334
|
-
.join(', ');
|
|
335
|
-
}).join("\n ");
|
|
336
|
-
console.log("\n "
|
|
334
|
+
.join(', '));
|
|
335
|
+
}).join("\n "));
|
|
336
|
+
console.log("\n ".concat(chalk_1.default.yellow.bold('Welcome to the Command Line Interface for SASjs!'), "\n\n ").concat(chalk_1.default.cyan('Here are the commands currently available:'), "\n ").concat(outputCommands, "\n\n\n ").concat(limitLineLength('GENERAL NOTE: Providing target name (--target targetName or -t targetName) is optional. [6spaces]Default target name will be used if target name was omitted.'), "\n\n ").concat(chalk_1.default.cyan('Alias commands:'), "\n ").concat(outputAliases, "\n "));
|
|
337
337
|
return [2 /*return*/, { outputCommands: outputCommands, outputAliases: outputAliases }];
|
|
338
338
|
});
|
|
339
339
|
});
|
|
@@ -356,7 +356,7 @@ var limitLineLength = function (str, maxLength) {
|
|
|
356
356
|
spaces = word.match(/\[\dspaces\]/)[0].match(/\d/)[0];
|
|
357
357
|
}
|
|
358
358
|
word = spaces
|
|
359
|
-
? ' '.repeat(spaces.length) + word.split("["
|
|
359
|
+
? ' '.repeat(spaces.length) + word.split("[".concat(spaces, "spaces]")).join('')
|
|
360
360
|
: word;
|
|
361
361
|
line += line.length ? ' ' + word : word;
|
|
362
362
|
}
|