@sasjs/cli 4.20.1 → 4.20.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (230) hide show
  1. package/build/cli.js +4 -5
  2. package/build/cli.spec.js +19 -9
  3. package/build/commands/add/addCommand.js +2 -2
  4. package/build/commands/add/addCredential.js +2 -2
  5. package/build/commands/add/addTarget.js +13 -14
  6. package/build/commands/add/internal/input.js +14 -14
  7. package/build/commands/add/internal/saveConfig.js +3 -4
  8. package/build/commands/add/spec/addCommand.spec.js +19 -9
  9. package/build/commands/add/spec/addCredential.spec.js +19 -9
  10. package/build/commands/add/spec/addTarget.spec.js +19 -9
  11. package/build/commands/auth/authCommand.js +8 -8
  12. package/build/commands/auth/login.js +40 -14
  13. package/build/commands/auth/spec/authCommand.spec.js +19 -9
  14. package/build/commands/auth/spec/login.spec.js +19 -9
  15. package/build/commands/build/build.js +25 -26
  16. package/build/commands/build/buildCommand.js +2 -2
  17. package/build/commands/build/compileBuildCommand.js +3 -3
  18. package/build/commands/build/internal/config.js +2 -2
  19. package/build/commands/build/spec/build.spec.js +2 -2
  20. package/build/commands/build/spec/buildCommand.spec.js +19 -9
  21. package/build/commands/build/spec/cb.spec.server.viya.js +2 -2
  22. package/build/commands/build/spec/compileBuildCommand.spec.js +19 -9
  23. package/build/commands/compile/compile.js +29 -20
  24. package/build/commands/compile/compileCommand.js +2 -2
  25. package/build/commands/compile/compileSingleFile.js +15 -15
  26. package/build/commands/compile/internal/checkCompileStatus.js +3 -4
  27. package/build/commands/compile/internal/compareFolders.js +2 -2
  28. package/build/commands/compile/internal/compileFile.js +6 -7
  29. package/build/commands/compile/internal/compileTestFile.js +17 -13
  30. package/build/commands/compile/internal/copySyncFolder.js +2 -2
  31. package/build/commands/compile/internal/getAllFolders.js +3 -3
  32. package/build/commands/compile/internal/identifySasFile.js +2 -2
  33. package/build/commands/compile/internal/loadDependencies.js +10 -10
  34. package/build/commands/compile/internal/spec/compileTestFile.spec.js +2 -2
  35. package/build/commands/compile/internal/spec/getAllFolders.spec.js +19 -9
  36. package/build/commands/compile/spec/compareFolders.spec.js +3 -3
  37. package/build/commands/compile/spec/compile.spec.js +19 -9
  38. package/build/commands/compile/spec/compileCommand.spec.js +19 -9
  39. package/build/commands/compile/spec/compileFile.spec.js +19 -9
  40. package/build/commands/compile/spec/compileSingleFile.spec.js +19 -9
  41. package/build/commands/compile/spec/copyFilesToBuildFolder.spec.js +20 -10
  42. package/build/commands/compile/spec/loadDependencies.spec.js +19 -9
  43. package/build/commands/context/contextCommand.js +3 -3
  44. package/build/commands/context/create.js +4 -5
  45. package/build/commands/context/delete.js +4 -5
  46. package/build/commands/context/edit.js +4 -5
  47. package/build/commands/context/export.js +4 -5
  48. package/build/commands/context/internal/parseConfig.js +1 -2
  49. package/build/commands/context/internal/validateConfigPath.js +3 -4
  50. package/build/commands/context/list.js +4 -5
  51. package/build/commands/context/spec/contextCommand.spec.js +19 -9
  52. package/build/commands/context/spec/create.spec.js +2 -2
  53. package/build/commands/context/spec/delete.spec.js +2 -2
  54. package/build/commands/context/spec/edit.spec.js +2 -2
  55. package/build/commands/context/spec/export.spec.js +19 -9
  56. package/build/commands/context/spec/list.spec.js +2 -2
  57. package/build/commands/create/create.js +4 -5
  58. package/build/commands/create/createCommand.js +2 -2
  59. package/build/commands/create/createTemplate.js +1 -1
  60. package/build/commands/create/internal/createReadme.js +3 -4
  61. package/build/commands/create/spec/create.spec.js +2 -2
  62. package/build/commands/create/spec/createCommand.spec.js +19 -9
  63. package/build/commands/db/db.js +8 -9
  64. package/build/commands/db/dbCommand.js +2 -2
  65. package/build/commands/db/spec/db.spec.js +2 -2
  66. package/build/commands/db/spec/dbCommand.spec.js +19 -9
  67. package/build/commands/deploy/compileBuildDeployCommand.js +8 -8
  68. package/build/commands/deploy/deploy.js +4 -5
  69. package/build/commands/deploy/deployCommand.js +2 -2
  70. package/build/commands/deploy/internal/deployToSASJSWithServicePack.js +11 -12
  71. package/build/commands/deploy/internal/executeDeployScript.js +3 -4
  72. package/build/commands/deploy/internal/executeDeployScriptSas9.js +10 -11
  73. package/build/commands/deploy/internal/executeDeployScriptSasViya.js +11 -12
  74. package/build/commands/deploy/internal/executeDeployScriptSasjs.js +12 -13
  75. package/build/commands/deploy/internal/executeNonSasScript.js +4 -5
  76. package/build/commands/deploy/internal/executeSasScript.js +5 -6
  77. package/build/commands/deploy/internal/getDeployScripts.js +4 -5
  78. package/build/commands/deploy/spec/cbd.spec.js +19 -9
  79. package/build/commands/deploy/spec/cbd.spec.server.viya.js +19 -9
  80. package/build/commands/deploy/spec/compileBuildDeployCommand.spec.js +19 -9
  81. package/build/commands/deploy/spec/deploy.spec.js +19 -9
  82. package/build/commands/deploy/spec/deployCommand.spec.js +19 -9
  83. package/build/commands/deploy/spec/getDeployScripts.spec.js +2 -2
  84. package/build/commands/deploy/spec/utils.js +41 -8
  85. package/build/commands/docs/docsCommand.js +2 -2
  86. package/build/commands/docs/generateDocs.js +11 -12
  87. package/build/commands/docs/generateDot.js +3 -4
  88. package/build/commands/docs/initDocs.js +3 -4
  89. package/build/commands/docs/internal/createDotFiles.js +4 -5
  90. package/build/commands/docs/internal/getDocConfig.d.ts +8 -8
  91. package/build/commands/docs/internal/getDocConfig.js +1 -2
  92. package/build/commands/docs/internal/getDotFileContent.js +3 -4
  93. package/build/commands/docs/internal/getFileInputs.js +1 -2
  94. package/build/commands/docs/internal/getFileOutputs.js +1 -2
  95. package/build/commands/docs/internal/getFoldersForDocs.js +1 -2
  96. package/build/commands/docs/internal/populateNodeDictionary.js +1 -2
  97. package/build/commands/docs/internal/populateParamNodeTypes.js +21 -22
  98. package/build/commands/docs/spec/docsCommand.spec.js +19 -9
  99. package/build/commands/docs/spec/generateDocs.spec.js +2 -2
  100. package/build/commands/docs/spec/generateDot.spec.js +2 -2
  101. package/build/commands/docs/spec/getDocConfig.spec.js +2 -2
  102. package/build/commands/docs/spec/initDocs.spec.js +2 -2
  103. package/build/commands/flow/execute.js +6 -7
  104. package/build/commands/flow/flowCommand.js +2 -2
  105. package/build/commands/flow/internal/executeFlow.js +2 -2
  106. package/build/commands/flow/internal/saveLog.js +34 -5
  107. package/build/commands/flow/internal/saveToCsv.js +2 -2
  108. package/build/commands/flow/internal/spec/executeFlow.spec.js +19 -9
  109. package/build/commands/flow/internal/spec/saveToCsv.spec.js +2 -2
  110. package/build/commands/flow/internal/spec/validateParams.spec.js +19 -9
  111. package/build/commands/flow/internal/validateParams.d.ts +4 -4
  112. package/build/commands/flow/internal/validateParams.js +2 -2
  113. package/build/commands/flow/spec/flow.spec.js +19 -9
  114. package/build/commands/flow/spec/flow.spec.server.viya.js +2 -2
  115. package/build/commands/flow/spec/flowCommand.spec.js +19 -9
  116. package/build/commands/folder/create.js +2 -2
  117. package/build/commands/folder/delete.js +2 -2
  118. package/build/commands/folder/folderCommand.js +13 -13
  119. package/build/commands/folder/list.js +2 -2
  120. package/build/commands/folder/move.js +2 -2
  121. package/build/commands/folder/spec/folder.spec.server.viya.js +2 -2
  122. package/build/commands/folder/spec/folderCommand.spec.js +19 -9
  123. package/build/commands/fs/fsCommand.js +34 -36
  124. package/build/commands/fs/internal/executeCode.js +2 -2
  125. package/build/commands/fs/spec/executeCode.spec.js +19 -9
  126. package/build/commands/fs/spec/fsCommand.spec.js +19 -9
  127. package/build/commands/help/help.js +3 -4
  128. package/build/commands/help/helpCommand.js +2 -2
  129. package/build/commands/help/spec/help.spec.js +2 -2
  130. package/build/commands/help/spec/helpCommand.spec.js +19 -9
  131. package/build/commands/index.js +1 -1
  132. package/build/commands/init/init.js +5 -5
  133. package/build/commands/init/initCommand.js +2 -2
  134. package/build/commands/init/spec/init.spec.js +2 -2
  135. package/build/commands/init/spec/initCommand.spec.js +19 -9
  136. package/build/commands/job/internal/execute/sas9.js +3 -4
  137. package/build/commands/job/internal/execute/sasjs.js +4 -5
  138. package/build/commands/job/internal/execute/viya.js +9 -10
  139. package/build/commands/job/internal/utils.js +2 -2
  140. package/build/commands/job/jobCommand.js +19 -19
  141. package/build/commands/job/spec/execute.spec.js +19 -9
  142. package/build/commands/job/spec/getContextName.spec.js +2 -2
  143. package/build/commands/job/spec/job.spec.server.viya.js +24 -16
  144. package/build/commands/job/spec/jobCommand.spec.js +19 -9
  145. package/build/commands/lint/initLint.js +3 -4
  146. package/build/commands/lint/lintCommand.js +2 -2
  147. package/build/commands/lint/processLint.js +13 -14
  148. package/build/commands/lint/spec/lintCommand.spec.js +19 -9
  149. package/build/commands/request/request.js +3 -4
  150. package/build/commands/request/requestCommand.js +2 -2
  151. package/build/commands/request/spec/request.spec.server.sas9.js +19 -9
  152. package/build/commands/request/spec/request.spec.server.viya.js +19 -9
  153. package/build/commands/request/spec/requestCommand.spec.js +19 -9
  154. package/build/commands/request/spec/utils.js +2 -2
  155. package/build/commands/run/run.js +29 -30
  156. package/build/commands/run/runCommand.js +2 -2
  157. package/build/commands/run/spec/run.spec.js +19 -9
  158. package/build/commands/run/spec/run.spec.server.sas9.js +2 -2
  159. package/build/commands/run/spec/run.spec.server.sasjs.js +2 -2
  160. package/build/commands/run/spec/run.spec.server.viya.js +4 -4
  161. package/build/commands/run/spec/runCommand.spec.js +19 -9
  162. package/build/commands/servicepack/deploy.js +7 -8
  163. package/build/commands/servicepack/servicePackCommand.js +7 -7
  164. package/build/commands/servicepack/spec/servicepack.spec.server.viya.js +2 -2
  165. package/build/commands/servicepack/spec/servicepackCommand.spec.js +19 -9
  166. package/build/commands/shared/createConfigFile.js +2 -2
  167. package/build/commands/shared/createFileStructure.js +2 -2
  168. package/build/commands/shared/createLintConfigFile.js +2 -2
  169. package/build/commands/shared/deployToSasViyaWithServicePack.js +6 -7
  170. package/build/commands/shared/fetchLogFileContent.js +2 -2
  171. package/build/commands/shared/spec/deployToSasViyaWithServicePack.spec.js +19 -9
  172. package/build/commands/snippets/snippets.js +3 -4
  173. package/build/commands/snippets/snippetsCommand.js +2 -2
  174. package/build/commands/snippets/spec/snippets.spec.js +2 -2
  175. package/build/commands/snippets/spec/snippetsCommand.spec.js +19 -9
  176. package/build/commands/testing/internal/saveOutput.js +23 -15
  177. package/build/commands/testing/spec/testCommand.spec.js +19 -9
  178. package/build/commands/testing/spec/testing.spec.js +19 -9
  179. package/build/commands/testing/test.js +14 -14
  180. package/build/commands/testing/testCommand.js +2 -2
  181. package/build/commands/version/spec/version.spec.js +2 -2
  182. package/build/commands/version/spec/versionCommand.spec.js +19 -9
  183. package/build/commands/version/version.js +4 -5
  184. package/build/commands/version/versionCommand.js +2 -2
  185. package/build/commands/web/internal/createAssetServices.js +39 -41
  186. package/build/commands/web/internal/sas9/createClickMeService.js +2 -2
  187. package/build/commands/web/internal/sas9/generateAssetService.js +2 -2
  188. package/build/commands/web/internal/sas9/getWebServiceContent.js +34 -5
  189. package/build/commands/web/internal/sasViya/createClickMeFile.js +2 -2
  190. package/build/commands/web/internal/spec/updateSasjstag.spec.js +2 -2
  191. package/build/commands/web/internal/spec/updateScriptTag.spec.js +2 -2
  192. package/build/commands/web/internal/spec/updateStyleTag.spec.js +2 -2
  193. package/build/commands/web/internal/updateAllTags.js +86 -88
  194. package/build/commands/web/internal/updateLinkTag.d.ts +1 -1
  195. package/build/commands/web/internal/updateScriptTag.js +2 -2
  196. package/build/commands/web/internal/updateStyleTag.js +2 -2
  197. package/build/commands/web/spec/web.spec.js +2 -2
  198. package/build/commands/web/spec/webCommand.spec.js +19 -9
  199. package/build/commands/web/web.js +10 -11
  200. package/build/commands/web/webCommand.js +2 -2
  201. package/build/types/command/commandAliases.d.ts +1 -1
  202. package/build/types/command/commandBase.js +2 -2
  203. package/build/types/command/commandFactory.d.ts +1 -1
  204. package/build/types/command/returnCode.js +1 -1
  205. package/build/types/command/spec/commandBase.spec.js +2 -2
  206. package/build/types/command/spec/targetCommand.spec.js +19 -9
  207. package/build/types/command/targetCommand.js +2 -2
  208. package/build/types/flow.js +1 -1
  209. package/build/types/targetScope.js +1 -1
  210. package/build/types/testing.js +3 -3
  211. package/build/utils/auth.js +8 -8
  212. package/build/utils/compressAndSave.js +2 -2
  213. package/build/utils/config.js +82 -84
  214. package/build/utils/displayResult.js +2 -3
  215. package/build/utils/file.js +13 -13
  216. package/build/utils/loadEnvVariables.js +4 -5
  217. package/build/utils/parseSourceFile.js +3 -4
  218. package/build/utils/saveLog.js +34 -5
  219. package/build/utils/setConstants.js +34 -5
  220. package/build/utils/setProjectDir.js +2 -2
  221. package/build/utils/spec/auth.spec.js +2 -2
  222. package/build/utils/spec/config.spec.js +19 -9
  223. package/build/utils/spec/file.spec.js +2 -2
  224. package/build/utils/spec/saveLog.spec.js +2 -2
  225. package/build/utils/spec/setConstants.spec.js +20 -10
  226. package/build/utils/spec/utils.spec.js +2 -2
  227. package/build/utils/test.d.ts +2 -3
  228. package/build/utils/test.js +103 -40
  229. package/build/utils/utils.js +22 -22
  230. package/package.json +32 -32
@@ -1,2 +1,2 @@
1
1
  export declare const commandFactory: Map<string, Function>;
2
- export declare const getAllSupportedCommands: () => IterableIterator<string>;
2
+ export declare const getAllSupportedCommands: () => MapIterator<string>;
@@ -7,4 +7,4 @@ var ReturnCode;
7
7
  ReturnCode[ReturnCode["InvalidCommand"] = 1] = "InvalidCommand";
8
8
  ReturnCode[ReturnCode["InternalError"] = 2] = "InternalError";
9
9
  ReturnCode[ReturnCode["LintError"] = 3] = "LintError";
10
- })(ReturnCode = exports.ReturnCode || (exports.ReturnCode = {}));
10
+ })(ReturnCode || (exports.ReturnCode = ReturnCode = {}));
@@ -9,8 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
13
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
36
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
37
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -32,8 +42,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
32
42
  });
33
43
  };
34
44
  var __generator = (this && this.__generator) || function (thisArg, body) {
35
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
36
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
45
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
46
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
37
47
  function verb(n) { return function (v) { return step([n, v]); }; }
38
48
  function step(op) {
39
49
  if (f) throw new TypeError("Generator is already executing.");
@@ -35,8 +35,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
35
35
  });
36
36
  };
37
37
  var __generator = (this && this.__generator) || function (thisArg, body) {
38
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
39
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
38
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
39
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
40
40
  function verb(n) { return function (v) { return step([n, v]); }; }
41
41
  function step(op) {
42
42
  if (f) throw new TypeError("Generator is already executing.");
@@ -6,4 +6,4 @@ var FlowWaveJobStatus;
6
6
  FlowWaveJobStatus["Runnning"] = "running";
7
7
  FlowWaveJobStatus["Success"] = "success";
8
8
  FlowWaveJobStatus["Failure"] = "failure";
9
- })(FlowWaveJobStatus = exports.FlowWaveJobStatus || (exports.FlowWaveJobStatus = {}));
9
+ })(FlowWaveJobStatus || (exports.FlowWaveJobStatus = FlowWaveJobStatus = {}));
@@ -5,4 +5,4 @@ var TargetScope;
5
5
  (function (TargetScope) {
6
6
  TargetScope["Global"] = "Global";
7
7
  TargetScope["Local"] = "Local";
8
- })(TargetScope = exports.TargetScope || (exports.TargetScope = {}));
8
+ })(TargetScope || (exports.TargetScope = TargetScope = {}));
@@ -7,15 +7,15 @@ var CoverageType;
7
7
  CoverageType["job"] = "job";
8
8
  CoverageType["macro"] = "macro";
9
9
  CoverageType["test"] = "test";
10
- })(CoverageType = exports.CoverageType || (exports.CoverageType = {}));
10
+ })(CoverageType || (exports.CoverageType = CoverageType = {}));
11
11
  var CoverageState;
12
12
  (function (CoverageState) {
13
13
  CoverageState["notCovered"] = "not covered";
14
14
  CoverageState["standalone"] = "standalone";
15
- })(CoverageState = exports.CoverageState || (exports.CoverageState = {}));
15
+ })(CoverageState || (exports.CoverageState = CoverageState = {}));
16
16
  var TestResultStatus;
17
17
  (function (TestResultStatus) {
18
18
  TestResultStatus["pass"] = "PASS";
19
19
  TestResultStatus["fail"] = "FAIL";
20
20
  TestResultStatus["notProvided"] = "not provided";
21
- })(TestResultStatus = exports.TestResultStatus || (exports.TestResultStatus = {}));
21
+ })(TestResultStatus || (exports.TestResultStatus = TestResultStatus = {}));
@@ -9,8 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
13
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
@@ -36,7 +36,12 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
36
36
  }
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.getNewAccessToken = exports.fetchLoggedInUser = exports.getTokensWithPasswordGrant = exports.SAS_CLI_CLIENT_ID = exports.refreshTokens = exports.getAuthCode = exports.getAuthUrl = void 0;
39
+ exports.SAS_CLI_CLIENT_ID = exports.getAuthUrl = void 0;
40
+ exports.getAuthCode = getAuthCode;
41
+ exports.refreshTokens = refreshTokens;
42
+ exports.getTokensWithPasswordGrant = getTokensWithPasswordGrant;
43
+ exports.fetchLoggedInUser = fetchLoggedInUser;
44
+ exports.getNewAccessToken = getNewAccessToken;
40
45
  var utils_1 = require("@sasjs/utils");
41
46
  var node_1 = require("@sasjs/adapter/node");
42
47
  var getAuthUrl = function (serverType, serverUrl, clientId) {
@@ -64,7 +69,6 @@ function getAuthCode(authUrl) {
64
69
  });
65
70
  });
66
71
  }
67
- exports.getAuthCode = getAuthCode;
68
72
  /**
69
73
  * Exchanges a refresh token for a new access/refresh token pair.
70
74
  * SAS Viya's refresh tokens are single-use and rotate on every call: the
@@ -86,7 +90,6 @@ function refreshTokens(sasjsInstance, clientId, clientSecret, refreshToken) {
86
90
  });
87
91
  });
88
92
  }
89
- exports.refreshTokens = refreshTokens;
90
93
  /**
91
94
  * The pre-registered, secret-less OAuth client that ships with every SAS Viya
92
95
  * deployment (used by the official SAS Viya CLI). Allows authenticating with a
@@ -151,7 +154,6 @@ function getTokensWithPasswordGrant(target, user, pass) {
151
154
  });
152
155
  });
153
156
  }
154
- exports.getTokensWithPasswordGrant = getTokensWithPasswordGrant;
155
157
  /**
156
158
  * Verifies an access token by fetching the identity it belongs to.
157
159
  * @param {Target} target - the SASVIYA target the token was minted for.
@@ -182,7 +184,6 @@ function fetchLoggedInUser(target, accessToken) {
182
184
  });
183
185
  });
184
186
  }
185
- exports.fetchLoggedInUser = fetchLoggedInUser;
186
187
  function getNewAccessToken(sasjsInstance, clientId, clientSecret, target) {
187
188
  return __awaiter(this, void 0, void 0, function () {
188
189
  var authUrl, authCode, _a, access_token, refresh_token;
@@ -210,4 +211,3 @@ function getNewAccessToken(sasjsInstance, clientId, clientSecret, target) {
210
211
  });
211
212
  });
212
213
  }
213
- exports.getNewAccessToken = getNewAccessToken;
@@ -9,8 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
13
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
@@ -20,8 +20,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
20
20
  });
21
21
  };
22
22
  var __generator = (this && this.__generator) || function (thisArg, body) {
23
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
24
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
23
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
24
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
25
25
  function verb(n) { return function (v) { return step([n, v]); }; }
26
26
  function step(op) {
27
27
  if (f) throw new TypeError("Generator is already executing.");
@@ -75,7 +75,32 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
75
75
  return (mod && mod.__esModule) ? mod : { "default": mod };
76
76
  };
77
77
  Object.defineProperty(exports, "__esModule", { value: true });
78
- exports.getSASjsAndAuthConfig = exports.getSASjs = exports.getTestTearDown = exports.getTestSetUp = exports.overrideEnvVariables = exports.getAccessToken = exports.getAuthConfigSAS9 = exports.persistTokensRefreshedByAdapter = exports.saveTokens = exports.getAuthConfig = exports.getProjectRoot = exports.sanitizeAppLoc = exports.getStreamConfig = exports.getMacroFolders = exports.getBinaryFolders = exports.getProgramFolders = exports.getFolders = exports.saveToLocalConfig = exports.saveLocalConfigFile = exports.getSyncDirectories = exports.getLocalOrGlobalConfig = exports.getLocalConfig = exports.removeFromLocalConfig = exports.removeFromGlobalConfig = exports.saveToGlobalConfig = exports.saveGlobalRcFile = exports.getLocalRcFile = exports.getGlobalRcFile = exports.findTargetInConfiguration = exports.getConfiguration = void 0;
78
+ exports.getTestTearDown = exports.getTestSetUp = exports.overrideEnvVariables = exports.persistTokensRefreshedByAdapter = exports.saveTokens = void 0;
79
+ exports.getConfiguration = getConfiguration;
80
+ exports.findTargetInConfiguration = findTargetInConfiguration;
81
+ exports.getGlobalRcFile = getGlobalRcFile;
82
+ exports.getLocalRcFile = getLocalRcFile;
83
+ exports.saveGlobalRcFile = saveGlobalRcFile;
84
+ exports.saveToGlobalConfig = saveToGlobalConfig;
85
+ exports.removeFromGlobalConfig = removeFromGlobalConfig;
86
+ exports.removeFromLocalConfig = removeFromLocalConfig;
87
+ exports.getLocalConfig = getLocalConfig;
88
+ exports.getLocalOrGlobalConfig = getLocalOrGlobalConfig;
89
+ exports.getSyncDirectories = getSyncDirectories;
90
+ exports.saveLocalConfigFile = saveLocalConfigFile;
91
+ exports.saveToLocalConfig = saveToLocalConfig;
92
+ exports.getFolders = getFolders;
93
+ exports.getProgramFolders = getProgramFolders;
94
+ exports.getBinaryFolders = getBinaryFolders;
95
+ exports.getMacroFolders = getMacroFolders;
96
+ exports.getStreamConfig = getStreamConfig;
97
+ exports.sanitizeAppLoc = sanitizeAppLoc;
98
+ exports.getProjectRoot = getProjectRoot;
99
+ exports.getAuthConfig = getAuthConfig;
100
+ exports.getAuthConfigSAS9 = getAuthConfigSAS9;
101
+ exports.getAccessToken = getAccessToken;
102
+ exports.getSASjs = getSASjs;
103
+ exports.getSASjsAndAuthConfig = getSASjsAndAuthConfig;
79
104
  var node_1 = __importDefault(require("@sasjs/adapter/node"));
80
105
  var utils_1 = require("@sasjs/utils");
81
106
  var auth_1 = require("./auth");
@@ -126,7 +151,6 @@ function getConfiguration(pathToFile) {
126
151
  });
127
152
  });
128
153
  }
129
- exports.getConfiguration = getConfiguration;
130
154
  /**
131
155
  * Returns the target with the given name.
132
156
  * If the target is not found in the local configuration,
@@ -247,11 +271,10 @@ function findTargetInConfiguration(targetName, targetScope) {
247
271
  });
248
272
  });
249
273
  }
250
- exports.findTargetInConfiguration = findTargetInConfiguration;
251
274
  function getLocalTarget(targetName) {
252
- var _a;
253
275
  return __awaiter(this, void 0, void 0, function () {
254
- var localConfig, targetJson, _b;
276
+ var localConfig, targetJson, _a;
277
+ var _b;
255
278
  return __generator(this, function (_c) {
256
279
  switch (_c.label) {
257
280
  case 0: return [4 /*yield*/, getConfiguration(path_1.default.join(process.projectDir, 'sasjs', 'sasjsconfig.json')).catch(function () { return null; })];
@@ -260,16 +283,16 @@ function getLocalTarget(targetName) {
260
283
  if (!(localConfig === null || localConfig === void 0 ? void 0 : localConfig.targets)) return [3 /*break*/, 3];
261
284
  targetJson = localConfig.targets.find(function (t) { return t.name === targetName; });
262
285
  if (!targetJson) return [3 /*break*/, 3];
263
- (_a = process.logger) === null || _a === void 0 ? void 0 : _a.info("Target ".concat(targetName, " was found in your local sasjsconfig.json file."));
286
+ (_b = process.logger) === null || _b === void 0 ? void 0 : _b.info("Target ".concat(targetName, " was found in your local sasjsconfig.json file."));
264
287
  targetJson.appLoc = sanitizeAppLoc(targetJson.appLoc);
265
288
  if (!targetJson.hasOwnProperty('serverUrl')) {
266
289
  targetJson.serverUrl = '';
267
290
  }
268
291
  targetJson.serverUrl = (0, utils_1.urlOrigin)(targetJson.serverUrl);
269
- _b = targetJson;
292
+ _a = targetJson;
270
293
  return [4 /*yield*/, getPrecedenceOfHttpsAgentOptionsAndContent(localConfig, targetJson)];
271
294
  case 2:
272
- _b.httpsAgentOptions =
295
+ _a.httpsAgentOptions =
273
296
  _c.sent();
274
297
  return [2 /*return*/, new utils_1.Target(targetJson, localConfig)];
275
298
  case 3: throw new Error(ERROR_MESSAGE(targetName).NOT_FOUND_TARGET_NAME);
@@ -278,9 +301,9 @@ function getLocalTarget(targetName) {
278
301
  });
279
302
  }
280
303
  function getLocalFallbackTarget() {
281
- var _a, _b;
282
304
  return __awaiter(this, void 0, void 0, function () {
283
- var localConfig, fallBackTargetJson, defaultTargetName_1, _c;
305
+ var localConfig, fallBackTargetJson, defaultTargetName_1, _a;
306
+ var _b, _c;
284
307
  return __generator(this, function (_d) {
285
308
  switch (_d.label) {
286
309
  case 0: return [4 /*yield*/, getConfiguration(path_1.default.join(process.projectDir, 'sasjs', 'sasjsconfig.json')).catch(function () { return null; })];
@@ -289,19 +312,19 @@ function getLocalFallbackTarget() {
289
312
  if (!(localConfig === null || localConfig === void 0 ? void 0 : localConfig.targets)) return [3 /*break*/, 4];
290
313
  defaultTargetName_1 = localConfig === null || localConfig === void 0 ? void 0 : localConfig.defaultTarget;
291
314
  if (defaultTargetName_1) {
292
- fallBackTargetJson = (_a = localConfig === null || localConfig === void 0 ? void 0 : localConfig.targets) === null || _a === void 0 ? void 0 : _a.find(function (t) { return t.name === defaultTargetName_1; });
315
+ fallBackTargetJson = (_b = localConfig === null || localConfig === void 0 ? void 0 : localConfig.targets) === null || _b === void 0 ? void 0 : _b.find(function (t) { return t.name === defaultTargetName_1; });
293
316
  }
294
317
  if (!fallBackTargetJson) return [3 /*break*/, 4];
295
- (_b = process.logger) === null || _b === void 0 ? void 0 : _b.info("No target was specified. Falling back to default target '".concat(fallBackTargetJson.name, "' from your local sasjsconfig.json file."));
318
+ (_c = process.logger) === null || _c === void 0 ? void 0 : _c.info("No target was specified. Falling back to default target '".concat(fallBackTargetJson.name, "' from your local sasjsconfig.json file."));
296
319
  fallBackTargetJson.appLoc = sanitizeAppLoc(fallBackTargetJson.appLoc);
297
320
  if (!fallBackTargetJson.hasOwnProperty('serverUrl')) {
298
321
  fallBackTargetJson.serverUrl = '';
299
322
  }
300
323
  fallBackTargetJson.serverUrl = (0, utils_1.urlOrigin)(fallBackTargetJson.serverUrl);
301
- _c = fallBackTargetJson;
324
+ _a = fallBackTargetJson;
302
325
  return [4 /*yield*/, getPrecedenceOfHttpsAgentOptionsAndContent(localConfig, fallBackTargetJson)];
303
326
  case 2:
304
- _c.httpsAgentOptions =
327
+ _a.httpsAgentOptions =
305
328
  _d.sent();
306
329
  return [4 /*yield*/, (0, utils_2.loadEnvVariables)(".env.".concat(fallBackTargetJson.name))];
307
330
  case 3:
@@ -313,9 +336,9 @@ function getLocalFallbackTarget() {
313
336
  });
314
337
  }
315
338
  function getGlobalTarget(targetName) {
316
- var _a;
317
339
  return __awaiter(this, void 0, void 0, function () {
318
- var globalConfig, targetJson, _b;
340
+ var globalConfig, targetJson, _a;
341
+ var _b;
319
342
  return __generator(this, function (_c) {
320
343
  switch (_c.label) {
321
344
  case 0: return [4 /*yield*/, getGlobalRcFile()];
@@ -324,16 +347,16 @@ function getGlobalTarget(targetName) {
324
347
  if (!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.targets)) return [3 /*break*/, 3];
325
348
  targetJson = globalConfig.targets.find(function (t) { return t.name === targetName; });
326
349
  if (!targetJson) return [3 /*break*/, 3];
327
- (_a = process.logger) === null || _a === void 0 ? void 0 : _a.info("Target ".concat(targetName, " was found in your global .sasjsrc file."));
350
+ (_b = process.logger) === null || _b === void 0 ? void 0 : _b.info("Target ".concat(targetName, " was found in your global .sasjsrc file."));
328
351
  targetJson.appLoc = sanitizeAppLoc(targetJson.appLoc);
329
352
  if (!targetJson.hasOwnProperty('serverUrl')) {
330
353
  targetJson.serverUrl = '';
331
354
  }
332
355
  targetJson.serverUrl = (0, utils_1.urlOrigin)(targetJson.serverUrl);
333
- _b = targetJson;
356
+ _a = targetJson;
334
357
  return [4 /*yield*/, getPrecedenceOfHttpsAgentOptionsAndContent(globalConfig, targetJson)];
335
358
  case 2:
336
- _b.httpsAgentOptions =
359
+ _a.httpsAgentOptions =
337
360
  _c.sent();
338
361
  return [2 /*return*/, new utils_1.Target(targetJson, globalConfig)];
339
362
  case 3: throw new Error(ERROR_MESSAGE(targetName).NOT_FOUND_TARGET_NAME);
@@ -342,9 +365,9 @@ function getGlobalTarget(targetName) {
342
365
  });
343
366
  }
344
367
  function getGlobalFallbackTarget() {
345
- var _a, _b;
346
368
  return __awaiter(this, void 0, void 0, function () {
347
- var globalConfig, fallBackTargetJson, defaultTargetName, _c;
369
+ var globalConfig, fallBackTargetJson, defaultTargetName, _a;
370
+ var _b, _c;
348
371
  return __generator(this, function (_d) {
349
372
  switch (_d.label) {
350
373
  case 0: return [4 /*yield*/, getGlobalRcFile()];
@@ -352,19 +375,19 @@ function getGlobalFallbackTarget() {
352
375
  globalConfig = (_d.sent());
353
376
  defaultTargetName = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.defaultTarget;
354
377
  if (defaultTargetName) {
355
- fallBackTargetJson = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.targets) === null || _a === void 0 ? void 0 : _a.find(function (t) { return t.name === defaultTargetName; });
378
+ fallBackTargetJson = (_b = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.targets) === null || _b === void 0 ? void 0 : _b.find(function (t) { return t.name === defaultTargetName; });
356
379
  }
357
380
  if (!fallBackTargetJson) return [3 /*break*/, 3];
358
- (_b = process.logger) === null || _b === void 0 ? void 0 : _b.info("No target was specified. Falling back to default target '".concat(fallBackTargetJson.name, "' from your global .sasjsrc file."));
381
+ (_c = process.logger) === null || _c === void 0 ? void 0 : _c.info("No target was specified. Falling back to default target '".concat(fallBackTargetJson.name, "' from your global .sasjsrc file."));
359
382
  fallBackTargetJson.appLoc = sanitizeAppLoc(fallBackTargetJson.appLoc);
360
383
  if (!fallBackTargetJson.hasOwnProperty('serverUrl')) {
361
384
  fallBackTargetJson.serverUrl = '';
362
385
  }
363
386
  fallBackTargetJson.serverUrl = (0, utils_1.urlOrigin)(fallBackTargetJson.serverUrl);
364
- _c = fallBackTargetJson;
387
+ _a = fallBackTargetJson;
365
388
  return [4 /*yield*/, getPrecedenceOfHttpsAgentOptionsAndContent(globalConfig, fallBackTargetJson)];
366
389
  case 2:
367
- _c.httpsAgentOptions =
390
+ _a.httpsAgentOptions =
368
391
  _d.sent();
369
392
  return [2 /*return*/, new utils_1.Target(fallBackTargetJson, globalConfig)];
370
393
  case 3: throw new Error(ERROR_MESSAGE().NOT_FOUND_FALLBACK);
@@ -389,7 +412,6 @@ function getGlobalRcFile() {
389
412
  });
390
413
  });
391
414
  }
392
- exports.getGlobalRcFile = getGlobalRcFile;
393
415
  function getLocalRcFile() {
394
416
  return __awaiter(this, void 0, void 0, function () {
395
417
  var projectRoot, config;
@@ -409,7 +431,6 @@ function getLocalRcFile() {
409
431
  });
410
432
  });
411
433
  }
412
- exports.getLocalRcFile = getLocalRcFile;
413
434
  function saveGlobalRcFile(content) {
414
435
  return __awaiter(this, void 0, void 0, function () {
415
436
  var homeDir, rcFilePath;
@@ -426,13 +447,12 @@ function saveGlobalRcFile(content) {
426
447
  });
427
448
  });
428
449
  }
429
- exports.saveGlobalRcFile = saveGlobalRcFile;
430
- function saveToGlobalConfig(target, isDefault, saveWithDefaultValues) {
431
- var _a;
432
- if (isDefault === void 0) { isDefault = false; }
433
- if (saveWithDefaultValues === void 0) { saveWithDefaultValues = true; }
434
- return __awaiter(this, void 0, void 0, function () {
450
+ function saveToGlobalConfig(target_1) {
451
+ return __awaiter(this, arguments, void 0, function (target, isDefault, saveWithDefaultValues) {
435
452
  var globalConfig, targetJson, existingTargetIndex;
453
+ var _a;
454
+ if (isDefault === void 0) { isDefault = false; }
455
+ if (saveWithDefaultValues === void 0) { saveWithDefaultValues = true; }
436
456
  return __generator(this, function (_b) {
437
457
  switch (_b.label) {
438
458
  case 0: return [4 /*yield*/, getGlobalRcFile()];
@@ -468,7 +488,6 @@ function saveToGlobalConfig(target, isDefault, saveWithDefaultValues) {
468
488
  });
469
489
  });
470
490
  }
471
- exports.saveToGlobalConfig = saveToGlobalConfig;
472
491
  function removeFromGlobalConfig(targetName) {
473
492
  return __awaiter(this, void 0, void 0, function () {
474
493
  var globalConfig, targets;
@@ -491,7 +510,6 @@ function removeFromGlobalConfig(targetName) {
491
510
  });
492
511
  });
493
512
  }
494
- exports.removeFromGlobalConfig = removeFromGlobalConfig;
495
513
  function removeFromLocalConfig(targetName) {
496
514
  return __awaiter(this, void 0, void 0, function () {
497
515
  var config, targets, configPath;
@@ -515,7 +533,6 @@ function removeFromLocalConfig(targetName) {
515
533
  });
516
534
  });
517
535
  }
518
- exports.removeFromLocalConfig = removeFromLocalConfig;
519
536
  function getLocalConfig() {
520
537
  return __awaiter(this, void 0, void 0, function () {
521
538
  var config;
@@ -529,7 +546,6 @@ function getLocalConfig() {
529
546
  });
530
547
  });
531
548
  }
532
- exports.getLocalConfig = getLocalConfig;
533
549
  function getLocalOrGlobalConfig() {
534
550
  return __awaiter(this, void 0, void 0, function () {
535
551
  var e_5;
@@ -551,7 +567,6 @@ function getLocalOrGlobalConfig() {
551
567
  });
552
568
  });
553
569
  }
554
- exports.getLocalOrGlobalConfig = getLocalOrGlobalConfig;
555
570
  function getSyncDirectories(target, isLocal) {
556
571
  return __awaiter(this, void 0, void 0, function () {
557
572
  var config, _a, rootLevelSyncDirectories, targetLevelSyncDirectories;
@@ -576,7 +591,6 @@ function getSyncDirectories(target, isLocal) {
576
591
  });
577
592
  });
578
593
  }
579
- exports.getSyncDirectories = getSyncDirectories;
580
594
  function saveLocalConfigFile(content) {
581
595
  return __awaiter(this, void 0, void 0, function () {
582
596
  var configPath;
@@ -592,13 +606,12 @@ function saveLocalConfigFile(content) {
592
606
  });
593
607
  });
594
608
  }
595
- exports.saveLocalConfigFile = saveLocalConfigFile;
596
- function saveToLocalConfig(target, isDefault, saveWithDefaultValues) {
597
- var _a, _b;
598
- if (isDefault === void 0) { isDefault = false; }
599
- if (saveWithDefaultValues === void 0) { saveWithDefaultValues = true; }
600
- return __awaiter(this, void 0, void 0, function () {
609
+ function saveToLocalConfig(target_1) {
610
+ return __awaiter(this, arguments, void 0, function (target, isDefault, saveWithDefaultValues) {
601
611
  var targetJson, config, existingTargetIndex, configPath;
612
+ var _a, _b;
613
+ if (isDefault === void 0) { isDefault = false; }
614
+ if (saveWithDefaultValues === void 0) { saveWithDefaultValues = true; }
602
615
  return __generator(this, function (_c) {
603
616
  switch (_c.label) {
604
617
  case 0:
@@ -638,7 +651,6 @@ function saveToLocalConfig(target, isDefault, saveWithDefaultValues) {
638
651
  });
639
652
  });
640
653
  }
641
- exports.saveToLocalConfig = saveToLocalConfig;
642
654
  function getFolders() {
643
655
  return __awaiter(this, void 0, void 0, function () {
644
656
  var configPath, config, configJson;
@@ -658,7 +670,6 @@ function getFolders() {
658
670
  });
659
671
  });
660
672
  }
661
- exports.getFolders = getFolders;
662
673
  /**
663
674
  * Returns SAS program folders from configuration.
664
675
  * This list includes both common and target-specific folders.
@@ -684,7 +695,6 @@ function getProgramFolders(target) {
684
695
  });
685
696
  });
686
697
  }
687
- exports.getProgramFolders = getProgramFolders;
688
698
  function getBinaryFolders(target) {
689
699
  return __awaiter(this, void 0, void 0, function () {
690
700
  var binaryFolders, configuration, buildSourceFolder, binaryFoldersWithAbsolutePath;
@@ -705,7 +715,6 @@ function getBinaryFolders(target) {
705
715
  });
706
716
  });
707
717
  }
708
- exports.getBinaryFolders = getBinaryFolders;
709
718
  /**
710
719
  * Returns SAS macro folders from configuration.
711
720
  * This list includes both common and target-specific folders.
@@ -730,7 +739,6 @@ function getMacroFolders(target) {
730
739
  });
731
740
  });
732
741
  }
733
- exports.getMacroFolders = getMacroFolders;
734
742
  /**
735
743
  * Returns StreamConfig from configuration.
736
744
  * This configuration includes both common and target-specific configuration.
@@ -745,7 +753,6 @@ function getStreamConfig(target) {
745
753
  });
746
754
  });
747
755
  }
748
- exports.getStreamConfig = getStreamConfig;
749
756
  /**
750
757
  * Sanitizes app location string.
751
758
  * @param {string} appLoc - app location
@@ -762,7 +769,6 @@ function sanitizeAppLoc(appLoc) {
762
769
  appLoc = appLoc.replace(/^\/{2,}/, '/');
763
770
  return appLoc;
764
771
  }
765
- exports.sanitizeAppLoc = sanitizeAppLoc;
766
772
  function getProjectRoot() {
767
773
  return __awaiter(this, void 0, void 0, function () {
768
774
  var root, rootFound, i, currentLocation, maxLevels, isRoot, _a;
@@ -802,7 +808,6 @@ function getProjectRoot() {
802
808
  });
803
809
  });
804
810
  }
805
- exports.getProjectRoot = getProjectRoot;
806
811
  /**
807
812
  * Gets the auth config for the specified target, refreshing the access token
808
813
  * (via the refresh token) if it is expiring.
@@ -820,9 +825,9 @@ exports.getProjectRoot = getProjectRoot;
820
825
  * @returns {AuthConfig} - an object containing an access token, refresh token, client ID and secret.
821
826
  */
822
827
  function getAuthConfig(target) {
823
- var _a, _b, _c, _d;
824
828
  return __awaiter(this, void 0, void 0, function () {
825
829
  var access_token, refresh_token, client, passwordGrantHint, secret, sasjs, tokens, sasjs, tokens;
830
+ var _a, _b, _c, _d;
826
831
  return __generator(this, function (_e) {
827
832
  switch (_e.label) {
828
833
  case 0:
@@ -925,7 +930,6 @@ function getAuthConfig(target) {
925
930
  });
926
931
  });
927
932
  }
928
- exports.getAuthConfig = getAuthConfig;
929
933
  /**
930
934
  * Persists an access/refresh token pair to wherever the target's credentials
931
935
  * live: `.env.{targetName}` for a local target, or `authConfig` in the global
@@ -990,26 +994,24 @@ exports.saveTokens = saveTokens;
990
994
  * {@link saveTokens} does not drop it from `.env.{target}`.
991
995
  */
992
996
  var persistTokensRefreshedByAdapter = function (target) {
993
- return function (_a) {
994
- var access_token = _a.access_token, refresh_token = _a.refresh_token;
995
- return __awaiter(void 0, void 0, void 0, function () {
996
- var rawClient, rawSecret, client, secret;
997
- var _b, _c;
998
- return __generator(this, function (_d) {
999
- switch (_d.label) {
1000
- case 0:
1001
- rawClient = ((_b = target.authConfig) === null || _b === void 0 ? void 0 : _b.client) || process.env.CLIENT;
1002
- rawSecret = ((_c = target.authConfig) === null || _c === void 0 ? void 0 : _c.secret) || process.env.SECRET;
1003
- client = sanitizeEnvValue(rawClient);
1004
- secret = sanitizeEnvValue(rawSecret);
1005
- return [4 /*yield*/, (0, exports.saveTokens)(target.name, access_token, refresh_token, client, secret)];
1006
- case 1:
1007
- _d.sent();
1008
- return [2 /*return*/];
1009
- }
1010
- });
997
+ return function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
998
+ var rawClient, rawSecret, client, secret;
999
+ var _c, _d;
1000
+ var access_token = _b.access_token, refresh_token = _b.refresh_token;
1001
+ return __generator(this, function (_e) {
1002
+ switch (_e.label) {
1003
+ case 0:
1004
+ rawClient = ((_c = target.authConfig) === null || _c === void 0 ? void 0 : _c.client) || process.env.CLIENT;
1005
+ rawSecret = ((_d = target.authConfig) === null || _d === void 0 ? void 0 : _d.secret) || process.env.SECRET;
1006
+ client = sanitizeEnvValue(rawClient);
1007
+ secret = sanitizeEnvValue(rawSecret);
1008
+ return [4 /*yield*/, (0, exports.saveTokens)(target.name, access_token, refresh_token, client, secret)];
1009
+ case 1:
1010
+ _e.sent();
1011
+ return [2 /*return*/];
1012
+ }
1011
1013
  });
1012
- };
1014
+ }); };
1013
1015
  };
1014
1016
  exports.persistTokensRefreshedByAdapter = persistTokensRefreshedByAdapter;
1015
1017
  /**
@@ -1036,7 +1038,6 @@ function getAuthConfigSAS9(target) {
1036
1038
  password: password
1037
1039
  };
1038
1040
  }
1039
- exports.getAuthConfigSAS9 = getAuthConfigSAS9;
1040
1041
  /**
1041
1042
  * Gets an access token for the specified target.
1042
1043
  * If the target is from the global `.sasjsrc` file,
@@ -1062,10 +1063,10 @@ exports.getAuthConfigSAS9 = getAuthConfigSAS9;
1062
1063
  * @param {string} checkIfExpiring - flag that indicates whether to do an expiry check.
1063
1064
  * @internal One-shot/test-only. User-facing commands must use {@link getAuthConfig}.
1064
1065
  */
1065
- function getAccessToken(target, checkIfExpiring) {
1066
- if (checkIfExpiring === void 0) { checkIfExpiring = true; }
1067
- return __awaiter(this, void 0, void 0, function () {
1066
+ function getAccessToken(target_1) {
1067
+ return __awaiter(this, arguments, void 0, function (target, checkIfExpiring) {
1068
1068
  var accessToken, sasjs, passwordGrantHint, client, secret, refreshToken, tokens;
1069
+ if (checkIfExpiring === void 0) { checkIfExpiring = true; }
1069
1070
  return __generator(this, function (_a) {
1070
1071
  switch (_a.label) {
1071
1072
  case 0:
@@ -1125,7 +1126,6 @@ function getAccessToken(target, checkIfExpiring) {
1125
1126
  });
1126
1127
  });
1127
1128
  }
1128
- exports.getAccessToken = getAccessToken;
1129
1129
  /**
1130
1130
  * Overrides environment variables with values from a target-specific env file if available.
1131
1131
  * Displays a warning if the file is unavailable.
@@ -1264,11 +1264,10 @@ function getSASjs(target) {
1264
1264
  contextName: target.contextName,
1265
1265
  httpsAgentOptions: target.httpsAgentOptions,
1266
1266
  debug: true,
1267
- useComputeApi: target.serverType === utils_1.ServerType.SasViya,
1267
+ useComputeApi: target.serverType === utils_1.ServerType.SasViya, // compute api is used only on Viya server
1268
1268
  verbose: verbose
1269
1269
  });
1270
1270
  }
1271
- exports.getSASjs = getSASjs;
1272
1271
  /**
1273
1272
  * Returns configuration object of SAS Adapter and authentication configuration
1274
1273
  * @param {Target} target - the target to get auth configuration from.
@@ -1323,4 +1322,3 @@ function getSASjsAndAuthConfig(target) {
1323
1322
  });
1324
1323
  });
1325
1324
  }
1326
- exports.getSASjsAndAuthConfig = getSASjsAndAuthConfig;