@sasjs/cli 3.6.1 → 3.6.5
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/README.md +0 -3
- 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 +12 -22
- package/build/commands/compile/spec/compileServiceFile.spec.js +12 -22
- package/build/commands/compile/spec/copyFilesToBuildFolder.spec.js +7 -7
- package/build/commands/compile/spec/loadDependencies.spec.js +31 -162
- 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 +50 -48
- 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 +11 -11
|
@@ -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
|
{
|
|
@@ -217,12 +217,14 @@ function printHelpText() {
|
|
|
217
217
|
},
|
|
218
218
|
{
|
|
219
219
|
name: 'request',
|
|
220
|
-
title: 'request <sasProgramPath> -d <path/to/datafile> -c <path/to/configfile> -t <targetName>',
|
|
220
|
+
title: 'request <sasProgramPath> -d <path/to/datafile> -c <path/to/configfile> -t <targetName> -l <path/to/log> -o <path/to/output>',
|
|
221
221
|
description: [
|
|
222
222
|
"lets",
|
|
223
223
|
"the user run a SAS job against a specified target.",
|
|
224
224
|
"The target can exist either in the local project configuration or in the global .sasjsrc file.",
|
|
225
|
-
"<sasProgramPath> - if this has a leading slash (eg /Public/app/folder/servicename) then it must be the full path. If it is a relative path (eg path/servicename) then it will be pre-pended with the appLoc - which must then be defined in the sasjs config."
|
|
225
|
+
"<sasProgramPath> - if this has a leading slash (eg /Public/app/folder/servicename) then it must be the full path. If it is a relative path (eg path/servicename) then it will be pre-pended with the appLoc - which must then be defined in the sasjs config.",
|
|
226
|
+
"<path/to/log> - Location in which to store the log file. If not provided AND an error occurs, the log will be stored in the execution path.",
|
|
227
|
+
"<path/to/output> - Location to store the output file. If not provided, a file named output.json will be saved in the execution path."
|
|
226
228
|
]
|
|
227
229
|
},
|
|
228
230
|
{
|
|
@@ -230,15 +232,15 @@ function printHelpText() {
|
|
|
230
232
|
title: 'folder <command>',
|
|
231
233
|
description: [
|
|
232
234
|
"performs operations on folders.",
|
|
233
|
-
"* "
|
|
235
|
+
"* ".concat(chalk_1.default.cyanBright('create'), " - creates new folder."),
|
|
234
236
|
"[2spaces]command example: sasjs folder create /Public/folder -t targetName -f",
|
|
235
237
|
"",
|
|
236
238
|
"[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
239
|
"",
|
|
238
|
-
"* "
|
|
240
|
+
"* ".concat(chalk_1.default.cyanBright('delete'), " - deletes folder."),
|
|
239
241
|
"[2spaces]command example: sasjs folder delete /Public/folder --target targetName",
|
|
240
242
|
"",
|
|
241
|
-
"* "
|
|
243
|
+
"* ".concat(chalk_1.default.cyanBright('move'), " - moves folder to a new location"),
|
|
242
244
|
"[2spaces]command example: sasjs folder move /Public/sourceFolder /Public/targetFolder --target targetName"
|
|
243
245
|
]
|
|
244
246
|
},
|
|
@@ -247,7 +249,7 @@ function printHelpText() {
|
|
|
247
249
|
title: 'job <command>',
|
|
248
250
|
description: [
|
|
249
251
|
"performs operations on jobs.",
|
|
250
|
-
"[2spaces]* "
|
|
252
|
+
"[2spaces]* ".concat(chalk_1.default.cyanBright('execute'), " - triggers job for execution."),
|
|
251
253
|
"[2spaces]command example: sasjs job execute /Public/job -t targetName --output ./outputFolder/output.json --returnStatusOnly --ignoreWarnings",
|
|
252
254
|
"[2spaces]command example: sasjs job execute /Public/job -t targetName --wait --log ./logFolder/log.json -r -i",
|
|
253
255
|
"",
|
|
@@ -263,7 +265,7 @@ function printHelpText() {
|
|
|
263
265
|
title: 'flow <command>',
|
|
264
266
|
description: [
|
|
265
267
|
"Performs operations on flows of jobs.",
|
|
266
|
-
"[2spaces]* "
|
|
268
|
+
"[2spaces]* ".concat(chalk_1.default.cyanBright('execute'), " - triggers flow for execution."),
|
|
267
269
|
"[2spaces]command example: sasjs flow execute --source /local/flow.json --logFolder /local/log/folder --csvFile /local/some.csv"
|
|
268
270
|
]
|
|
269
271
|
},
|
|
@@ -274,13 +276,13 @@ function printHelpText() {
|
|
|
274
276
|
"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
277
|
"[2spaces]command example: sasjs doc -t <targetName> --outDirectory <sasFilePath>",
|
|
276
278
|
"",
|
|
277
|
-
"[2spaces]* "
|
|
279
|
+
"[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
280
|
"[2spaces]command example: sasjs doc lineage -t <targetName> --outDirectory <sasFilePath>",
|
|
279
281
|
"",
|
|
280
282
|
"[2spaces]NOTE: Providing outDirectory flag is optional. If not present, CLI will generate docs in the sasjsbuild/docs directory.",
|
|
281
283
|
"The target can exist either in the local project configuration or in the global .sasjsrc file.",
|
|
282
284
|
"",
|
|
283
|
-
"[2spaces]* "
|
|
285
|
+
"[2spaces]* ".concat(chalk_1.default.cyanBright('init'), " - Initialize/reset doxy folder (having content files + configuration) for docs"),
|
|
284
286
|
"[2spaces]command example: sasjs doc init"
|
|
285
287
|
]
|
|
286
288
|
},
|
|
@@ -319,21 +321,21 @@ function printHelpText() {
|
|
|
319
321
|
{ name: 'version', aliases: ['v'] },
|
|
320
322
|
{ name: 'web', aliases: ['w'] }
|
|
321
323
|
];
|
|
322
|
-
outputCommands = ""
|
|
324
|
+
outputCommands = "".concat(commands
|
|
323
325
|
.sort(function (a, b) { return (a.name < b.name ? -1 : 1); })
|
|
324
326
|
.map(function (command) {
|
|
325
|
-
return "* "
|
|
327
|
+
return "* ".concat(chalk_1.default.greenBright(limitLineLength(command.title)), " - ").concat(command.description
|
|
326
328
|
.map(function (line) { return limitLineLength(line); })
|
|
327
|
-
.join("\n\t");
|
|
328
|
-
}).join("\n ");
|
|
329
|
-
outputAliases = ""
|
|
329
|
+
.join("\n\t"));
|
|
330
|
+
}).join("\n "));
|
|
331
|
+
outputAliases = "".concat(aliases
|
|
330
332
|
.sort(function (a, b) { return (a.name < b.name ? -1 : 1); })
|
|
331
333
|
.map(function (alias) {
|
|
332
|
-
return "* "
|
|
334
|
+
return "* ".concat(chalk_1.default.greenBright(alias.name), " : ").concat(alias.aliases
|
|
333
335
|
.sort(function (a, b) { return (a > b ? -1 : 1); })
|
|
334
|
-
.join(', ');
|
|
335
|
-
}).join("\n ");
|
|
336
|
-
console.log("\n "
|
|
336
|
+
.join(', '));
|
|
337
|
+
}).join("\n "));
|
|
338
|
+
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
339
|
return [2 /*return*/, { outputCommands: outputCommands, outputAliases: outputAliases }];
|
|
338
340
|
});
|
|
339
341
|
});
|
|
@@ -356,7 +358,7 @@ var limitLineLength = function (str, maxLength) {
|
|
|
356
358
|
spaces = word.match(/\[\dspaces\]/)[0].match(/\d/)[0];
|
|
357
359
|
}
|
|
358
360
|
word = spaces
|
|
359
|
-
? ' '.repeat(spaces.length) + word.split("["
|
|
361
|
+
? ' '.repeat(spaces.length) + word.split("[".concat(spaces, "spaces]")).join('')
|
|
360
362
|
: word;
|
|
361
363
|
line += line.length ? ' ' + word : word;
|
|
362
364
|
}
|
|
@@ -78,7 +78,7 @@ var HelpCommand = /** @class */ (function (_super) {
|
|
|
78
78
|
return __awaiter(this, void 0, void 0, function () {
|
|
79
79
|
return __generator(this, function (_a) {
|
|
80
80
|
switch (_a.label) {
|
|
81
|
-
case 0: return [4 /*yield*/, help_1.printHelpText()
|
|
81
|
+
case 0: return [4 /*yield*/, (0, help_1.printHelpText)()
|
|
82
82
|
.then(function () {
|
|
83
83
|
return command_1.ReturnCode.Success;
|
|
84
84
|
})
|
|
@@ -59,15 +59,15 @@ describe('sasjs help', function () {
|
|
|
59
59
|
return __generator(this, function (_b) {
|
|
60
60
|
switch (_b.label) {
|
|
61
61
|
case 0:
|
|
62
|
-
supportedCommands = commandFactory_1.getAllSupportedCommands();
|
|
63
|
-
return [4 /*yield*/, help_1.printHelpText()];
|
|
62
|
+
supportedCommands = (0, commandFactory_1.getAllSupportedCommands)();
|
|
63
|
+
return [4 /*yield*/, (0, help_1.printHelpText)()];
|
|
64
64
|
case 1:
|
|
65
65
|
outputCommands = (_b.sent()).outputCommands;
|
|
66
|
-
outputCommands = formatter_1.sanitizeSpecialChars(outputCommands);
|
|
66
|
+
outputCommands = (0, formatter_1.sanitizeSpecialChars)(outputCommands);
|
|
67
67
|
try {
|
|
68
68
|
for (supportedCommands_1 = __values(supportedCommands), supportedCommands_1_1 = supportedCommands_1.next(); !supportedCommands_1_1.done; supportedCommands_1_1 = supportedCommands_1.next()) {
|
|
69
69
|
command = supportedCommands_1_1.value;
|
|
70
|
-
expect(outputCommands.includes("* "
|
|
70
|
+
expect(outputCommands.includes("* ".concat(command))).toEqual(true);
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
@@ -87,15 +87,15 @@ describe('sasjs help', function () {
|
|
|
87
87
|
return __generator(this, function (_b) {
|
|
88
88
|
switch (_b.label) {
|
|
89
89
|
case 0:
|
|
90
|
-
supportedAliases = commandAliases_1.getAllSupportedAliases();
|
|
91
|
-
return [4 /*yield*/, help_1.printHelpText()];
|
|
90
|
+
supportedAliases = (0, commandAliases_1.getAllSupportedAliases)();
|
|
91
|
+
return [4 /*yield*/, (0, help_1.printHelpText)()];
|
|
92
92
|
case 1:
|
|
93
93
|
outputAliases = (_b.sent()).outputAliases;
|
|
94
|
-
outputAliases = formatter_1.sanitizeSpecialChars(outputAliases);
|
|
94
|
+
outputAliases = (0, formatter_1.sanitizeSpecialChars)(outputAliases);
|
|
95
95
|
try {
|
|
96
96
|
for (supportedAliases_1 = __values(supportedAliases), supportedAliases_1_1 = supportedAliases_1.next(); !supportedAliases_1_1.done; supportedAliases_1_1 = supportedAliases_1.next()) {
|
|
97
97
|
command = supportedAliases_1_1.value;
|
|
98
|
-
expect(outputAliases.includes("* "
|
|
98
|
+
expect(outputAliases.includes("* ".concat(command))).toEqual(true);
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
101
|
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
@@ -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 helpModule = __importStar(require("../help"));
|
|
@@ -86,7 +90,7 @@ describe('HelpCommand', function () {
|
|
|
86
90
|
setupMocks();
|
|
87
91
|
});
|
|
88
92
|
it('should parse a simple sasjs help command', function () {
|
|
89
|
-
var args = __spreadArray(__spreadArray([], __read(defaultArgs)), ['help']);
|
|
93
|
+
var args = __spreadArray(__spreadArray([], __read(defaultArgs), false), ['help'], false);
|
|
90
94
|
var command = new helpCommand_1.HelpCommand(args);
|
|
91
95
|
expect(command.name).toEqual('help');
|
|
92
96
|
expect(command.subCommand).toEqual('');
|
|
@@ -96,7 +100,7 @@ describe('HelpCommand', function () {
|
|
|
96
100
|
return __generator(this, function (_a) {
|
|
97
101
|
switch (_a.label) {
|
|
98
102
|
case 0:
|
|
99
|
-
args = __spreadArray(__spreadArray([], __read(defaultArgs)), ['help']);
|
|
103
|
+
args = __spreadArray(__spreadArray([], __read(defaultArgs), false), ['help'], false);
|
|
100
104
|
command = new helpCommand_1.HelpCommand(args);
|
|
101
105
|
return [4 /*yield*/, command.execute()];
|
|
102
106
|
case 1:
|
|
@@ -111,7 +115,7 @@ describe('HelpCommand', function () {
|
|
|
111
115
|
return __generator(this, function (_a) {
|
|
112
116
|
switch (_a.label) {
|
|
113
117
|
case 0:
|
|
114
|
-
args = __spreadArray(__spreadArray([], __read(defaultArgs)), ['help']);
|
|
118
|
+
args = __spreadArray(__spreadArray([], __read(defaultArgs), false), ['help'], false);
|
|
115
119
|
jest
|
|
116
120
|
.spyOn(helpModule, 'printHelpText')
|
|
117
121
|
.mockImplementation(function () { return Promise.reject(new Error('Test Error')); });
|
|
@@ -54,26 +54,26 @@ function init() {
|
|
|
54
54
|
case 0:
|
|
55
55
|
(_a = process.logger) === null || _a === void 0 ? void 0 : _a.info('Initialising SASjs...');
|
|
56
56
|
parentFolderName = '.';
|
|
57
|
-
return [4 /*yield*/, utils_1.setupNpmProject(parentFolderName)];
|
|
57
|
+
return [4 /*yield*/, (0, utils_1.setupNpmProject)(parentFolderName)];
|
|
58
58
|
case 1:
|
|
59
59
|
_b.sent();
|
|
60
|
-
return [4 /*yield*/, utils_1.setupGitIgnore(parentFolderName)];
|
|
60
|
+
return [4 /*yield*/, (0, utils_1.setupGitIgnore)(parentFolderName)];
|
|
61
61
|
case 2:
|
|
62
62
|
_b.sent();
|
|
63
|
-
return [4 /*yield*/, utils_1.setupGhooks(parentFolderName)];
|
|
63
|
+
return [4 /*yield*/, (0, utils_1.setupGhooks)(parentFolderName)];
|
|
64
64
|
case 3:
|
|
65
65
|
_b.sent();
|
|
66
|
-
return [4 /*yield*/, utils_1.setupDoxygen(parentFolderName)];
|
|
66
|
+
return [4 /*yield*/, (0, utils_1.setupDoxygen)(parentFolderName)];
|
|
67
67
|
case 4:
|
|
68
68
|
_b.sent();
|
|
69
|
-
return [4 /*yield*/, createConfigFile_1.createConfigFile(parentFolderName)];
|
|
69
|
+
return [4 /*yield*/, (0, createConfigFile_1.createConfigFile)(parentFolderName)];
|
|
70
70
|
case 5:
|
|
71
71
|
_b.sent();
|
|
72
72
|
lintConfigPath = path_1.default.join(process.projectDir, parentFolderName, '.sasjslint');
|
|
73
|
-
return [4 /*yield*/, utils_2.fileExists(lintConfigPath)];
|
|
73
|
+
return [4 /*yield*/, (0, utils_2.fileExists)(lintConfigPath)];
|
|
74
74
|
case 6:
|
|
75
75
|
if (!!(_b.sent())) return [3 /*break*/, 8];
|
|
76
|
-
return [4 /*yield*/, createLintConfigFile_1.createLintConfigFile(parentFolderName)];
|
|
76
|
+
return [4 /*yield*/, (0, createLintConfigFile_1.createLintConfigFile)(parentFolderName)];
|
|
77
77
|
case 7:
|
|
78
78
|
_b.sent();
|
|
79
79
|
_b.label = 8;
|
|
@@ -78,7 +78,7 @@ var InitCommand = /** @class */ (function (_super) {
|
|
|
78
78
|
return __awaiter(this, void 0, void 0, function () {
|
|
79
79
|
return __generator(this, function (_a) {
|
|
80
80
|
switch (_a.label) {
|
|
81
|
-
case 0: return [4 /*yield*/, init_1.init()
|
|
81
|
+
case 0: return [4 /*yield*/, (0, init_1.init)()
|
|
82
82
|
.then(function () {
|
|
83
83
|
var _a;
|
|
84
84
|
(_a = process.logger) === null || _a === void 0 ? void 0 : _a.success('This project is now powered by SASjs!\nYou can use any sasjs command within the project.\n\nFor more information, type `sasjs help` or visit https://cli.sasjs.io/');
|
|
@@ -54,7 +54,7 @@ describe('sasjs init', function () {
|
|
|
54
54
|
afterEach(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
55
55
|
return __generator(this, function (_a) {
|
|
56
56
|
switch (_a.label) {
|
|
57
|
-
case 0: return [4 /*yield*/, utils_1.deleteFolder(path_1.default.join(__dirname, 'test-app-init-*'))];
|
|
57
|
+
case 0: return [4 /*yield*/, (0, utils_1.deleteFolder)(path_1.default.join(__dirname, 'test-app-init-*'))];
|
|
58
58
|
case 1:
|
|
59
59
|
_a.sent();
|
|
60
60
|
return [2 /*return*/];
|
|
@@ -66,18 +66,18 @@ describe('sasjs init', function () {
|
|
|
66
66
|
return __generator(this, function (_a) {
|
|
67
67
|
switch (_a.label) {
|
|
68
68
|
case 0:
|
|
69
|
-
appName = "test-app-init-"
|
|
69
|
+
appName = "test-app-init-".concat((0, utils_1.generateTimestamp)());
|
|
70
70
|
process.projectDir = path_1.default.join(__dirname, appName);
|
|
71
|
-
return [4 /*yield*/, utils_2.setConstants()];
|
|
71
|
+
return [4 /*yield*/, (0, utils_2.setConstants)()];
|
|
72
72
|
case 1:
|
|
73
73
|
_a.sent();
|
|
74
|
-
return [4 /*yield*/, utils_1.createFolder(process.projectDir)];
|
|
74
|
+
return [4 /*yield*/, (0, utils_1.createFolder)(process.projectDir)];
|
|
75
75
|
case 2:
|
|
76
76
|
_a.sent();
|
|
77
|
-
return [4 /*yield*/, expect(create_1.create('.', '')).toResolve()];
|
|
77
|
+
return [4 /*yield*/, expect((0, create_1.create)('.', '')).toResolve()];
|
|
78
78
|
case 3:
|
|
79
79
|
_a.sent();
|
|
80
|
-
return [4 /*yield*/, expect(init_1.init()).toResolve()];
|
|
80
|
+
return [4 /*yield*/, expect((0, init_1.init)()).toResolve()];
|
|
81
81
|
case 4:
|
|
82
82
|
_a.sent();
|
|
83
83
|
return [4 /*yield*/, verifyInit()];
|
|
@@ -92,18 +92,18 @@ describe('sasjs init', function () {
|
|
|
92
92
|
return __generator(this, function (_a) {
|
|
93
93
|
switch (_a.label) {
|
|
94
94
|
case 0:
|
|
95
|
-
appName = "test-app-init-sasonly-"
|
|
95
|
+
appName = "test-app-init-sasonly-".concat((0, utils_1.generateTimestamp)());
|
|
96
96
|
process.projectDir = path_1.default.join(__dirname, appName);
|
|
97
|
-
return [4 /*yield*/, utils_2.setConstants()];
|
|
97
|
+
return [4 /*yield*/, (0, utils_2.setConstants)()];
|
|
98
98
|
case 1:
|
|
99
99
|
_a.sent();
|
|
100
|
-
return [4 /*yield*/, utils_1.createFolder(process.projectDir)];
|
|
100
|
+
return [4 /*yield*/, (0, utils_1.createFolder)(process.projectDir)];
|
|
101
101
|
case 2:
|
|
102
102
|
_a.sent();
|
|
103
|
-
return [4 /*yield*/, expect(create_1.create('.', 'sasonly')).toResolve()];
|
|
103
|
+
return [4 /*yield*/, expect((0, create_1.create)('.', 'sasonly')).toResolve()];
|
|
104
104
|
case 3:
|
|
105
105
|
_a.sent();
|
|
106
|
-
return [4 /*yield*/, expect(init_1.init()).toResolve()];
|
|
106
|
+
return [4 /*yield*/, expect((0, init_1.init)()).toResolve()];
|
|
107
107
|
case 4:
|
|
108
108
|
_a.sent();
|
|
109
109
|
return [4 /*yield*/, verifyInit()];
|
|
@@ -118,15 +118,15 @@ describe('sasjs init', function () {
|
|
|
118
118
|
return __generator(this, function (_a) {
|
|
119
119
|
switch (_a.label) {
|
|
120
120
|
case 0:
|
|
121
|
-
appName = "test-app-init-.-"
|
|
121
|
+
appName = "test-app-init-.-".concat((0, utils_1.generateTimestamp)());
|
|
122
122
|
process.projectDir = path_1.default.join(__dirname, appName);
|
|
123
|
-
return [4 /*yield*/, utils_2.setConstants()];
|
|
123
|
+
return [4 /*yield*/, (0, utils_2.setConstants)()];
|
|
124
124
|
case 1:
|
|
125
125
|
_a.sent();
|
|
126
|
-
return [4 /*yield*/, utils_1.createFolder(process.projectDir)];
|
|
126
|
+
return [4 /*yield*/, (0, utils_1.createFolder)(process.projectDir)];
|
|
127
127
|
case 2:
|
|
128
128
|
_a.sent();
|
|
129
|
-
return [4 /*yield*/, expect(init_1.init()).toResolve()];
|
|
129
|
+
return [4 /*yield*/, expect((0, init_1.init)()).toResolve()];
|
|
130
130
|
case 3:
|
|
131
131
|
_a.sent();
|
|
132
132
|
return [4 /*yield*/, verifyInit()];
|
|
@@ -141,11 +141,11 @@ var verifyInit = function () { return __awaiter(void 0, void 0, void 0, function
|
|
|
141
141
|
var gitIgnoreFilePath, gitIgnoreContent;
|
|
142
142
|
return __generator(this, function (_a) {
|
|
143
143
|
switch (_a.label) {
|
|
144
|
-
case 0: return [4 /*yield*/, test_1.verifyFolder(initFiles_1.initFiles)];
|
|
144
|
+
case 0: return [4 /*yield*/, (0, test_1.verifyFolder)(initFiles_1.initFiles)];
|
|
145
145
|
case 1:
|
|
146
146
|
_a.sent();
|
|
147
147
|
gitIgnoreFilePath = path_1.default.join(process.projectDir, '.gitignore');
|
|
148
|
-
return [4 /*yield*/, utils_1.readFile(gitIgnoreFilePath)];
|
|
148
|
+
return [4 /*yield*/, (0, utils_1.readFile)(gitIgnoreFilePath)];
|
|
149
149
|
case 2:
|
|
150
150
|
gitIgnoreContent = _a.sent();
|
|
151
151
|
expect(gitIgnoreContent.match(/^sasjsbuild\//gm).length).toEqual(1);
|
|
@@ -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('InitCommand', function () {
|
|
|
86
90
|
setupMocks();
|
|
87
91
|
});
|
|
88
92
|
it('should parse a simple sasjs init command', function () {
|
|
89
|
-
var args = __spreadArray(__spreadArray([], __read(defaultArgs)), ['init']);
|
|
93
|
+
var args = __spreadArray(__spreadArray([], __read(defaultArgs), false), ['init'], false);
|
|
90
94
|
var command = new initCommand_1.InitCommand(args);
|
|
91
95
|
expect(command.name).toEqual('init');
|
|
92
96
|
expect(command.value).toEqual('');
|
|
@@ -96,7 +100,7 @@ describe('InitCommand', function () {
|
|
|
96
100
|
return __generator(this, function (_a) {
|
|
97
101
|
switch (_a.label) {
|
|
98
102
|
case 0:
|
|
99
|
-
args = __spreadArray(__spreadArray([], __read(defaultArgs)), ['init']);
|
|
103
|
+
args = __spreadArray(__spreadArray([], __read(defaultArgs), false), ['init'], false);
|
|
100
104
|
command = new initCommand_1.InitCommand(args);
|
|
101
105
|
return [4 /*yield*/, command.execute()];
|
|
102
106
|
case 1:
|
|
@@ -113,7 +117,7 @@ describe('InitCommand', function () {
|
|
|
113
117
|
return __generator(this, function (_a) {
|
|
114
118
|
switch (_a.label) {
|
|
115
119
|
case 0:
|
|
116
|
-
args = __spreadArray(__spreadArray([], __read(defaultArgs)), ['init']);
|
|
120
|
+
args = __spreadArray(__spreadArray([], __read(defaultArgs), false), ['init'], false);
|
|
117
121
|
jest
|
|
118
122
|
.spyOn(initModule, 'init')
|
|
119
123
|
.mockImplementation(function () { return Promise.reject(new Error('Test Error')); });
|
|
@@ -52,7 +52,7 @@ function executeJobSasjs(sasjs, jobPath, logFile) {
|
|
|
52
52
|
if (!(result.status === 'success')) return [3 /*break*/, 4];
|
|
53
53
|
process.logger.success('Job executed successfully!');
|
|
54
54
|
if (!(logFile && result.log)) return [3 /*break*/, 3];
|
|
55
|
-
return [4 /*yield*/, utils_1.saveLog(result.log, logFile, jobPath, false)];
|
|
55
|
+
return [4 /*yield*/, (0, utils_1.saveLog)(result.log, logFile, jobPath, false)];
|
|
56
56
|
case 2:
|
|
57
57
|
_a.sent();
|
|
58
58
|
_a.label = 3;
|