@sasjs/cli 4.20.1 → 4.20.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (235) hide show
  1. package/README.md +11 -0
  2. package/build/cli.js +4 -5
  3. package/build/cli.spec.js +19 -9
  4. package/build/commands/add/addCommand.js +2 -2
  5. package/build/commands/add/addCredential.js +2 -2
  6. package/build/commands/add/addTarget.js +13 -14
  7. package/build/commands/add/internal/input.js +14 -14
  8. package/build/commands/add/internal/saveConfig.js +3 -4
  9. package/build/commands/add/spec/addCommand.spec.js +19 -9
  10. package/build/commands/add/spec/addCredential.spec.js +19 -9
  11. package/build/commands/add/spec/addTarget.spec.js +19 -9
  12. package/build/commands/auth/authCommand.js +8 -8
  13. package/build/commands/auth/login.js +40 -14
  14. package/build/commands/auth/spec/authCommand.spec.js +19 -9
  15. package/build/commands/auth/spec/login.spec.js +19 -9
  16. package/build/commands/build/build.js +25 -26
  17. package/build/commands/build/buildCommand.js +2 -2
  18. package/build/commands/build/compileBuildCommand.js +3 -3
  19. package/build/commands/build/internal/config.js +2 -2
  20. package/build/commands/build/spec/build.spec.js +2 -2
  21. package/build/commands/build/spec/buildCommand.spec.js +19 -9
  22. package/build/commands/build/spec/cb.spec.server.viya.js +2 -2
  23. package/build/commands/build/spec/compileBuildCommand.spec.js +19 -9
  24. package/build/commands/compile/compile.js +29 -20
  25. package/build/commands/compile/compileCommand.js +2 -2
  26. package/build/commands/compile/compileSingleFile.js +15 -15
  27. package/build/commands/compile/internal/checkCompileStatus.js +3 -4
  28. package/build/commands/compile/internal/compareFolders.js +2 -2
  29. package/build/commands/compile/internal/compileFile.js +6 -7
  30. package/build/commands/compile/internal/compileTestFile.js +17 -13
  31. package/build/commands/compile/internal/copySyncFolder.js +2 -2
  32. package/build/commands/compile/internal/getAllFolders.js +3 -3
  33. package/build/commands/compile/internal/identifySasFile.js +2 -2
  34. package/build/commands/compile/internal/loadDependencies.js +10 -10
  35. package/build/commands/compile/internal/spec/compileTestFile.spec.js +2 -2
  36. package/build/commands/compile/internal/spec/getAllFolders.spec.js +19 -9
  37. package/build/commands/compile/spec/compareFolders.spec.js +3 -3
  38. package/build/commands/compile/spec/compile.spec.js +19 -9
  39. package/build/commands/compile/spec/compileCommand.spec.js +19 -9
  40. package/build/commands/compile/spec/compileFile.spec.js +19 -9
  41. package/build/commands/compile/spec/compileSingleFile.spec.js +19 -9
  42. package/build/commands/compile/spec/copyFilesToBuildFolder.spec.js +20 -10
  43. package/build/commands/compile/spec/loadDependencies.spec.js +19 -9
  44. package/build/commands/context/contextCommand.js +3 -3
  45. package/build/commands/context/create.js +4 -5
  46. package/build/commands/context/delete.js +4 -5
  47. package/build/commands/context/edit.js +4 -5
  48. package/build/commands/context/export.js +4 -5
  49. package/build/commands/context/internal/parseConfig.js +1 -2
  50. package/build/commands/context/internal/validateConfigPath.js +3 -4
  51. package/build/commands/context/list.js +4 -5
  52. package/build/commands/context/spec/contextCommand.spec.js +19 -9
  53. package/build/commands/context/spec/create.spec.js +2 -2
  54. package/build/commands/context/spec/delete.spec.js +2 -2
  55. package/build/commands/context/spec/edit.spec.js +2 -2
  56. package/build/commands/context/spec/export.spec.js +19 -9
  57. package/build/commands/context/spec/list.spec.js +2 -2
  58. package/build/commands/create/create.js +4 -5
  59. package/build/commands/create/createCommand.js +2 -2
  60. package/build/commands/create/createTemplate.js +1 -1
  61. package/build/commands/create/internal/createReadme.js +3 -4
  62. package/build/commands/create/spec/create.spec.js +2 -2
  63. package/build/commands/create/spec/createCommand.spec.js +19 -9
  64. package/build/commands/db/db.js +8 -9
  65. package/build/commands/db/dbCommand.js +2 -2
  66. package/build/commands/db/spec/db.spec.js +2 -2
  67. package/build/commands/db/spec/dbCommand.spec.js +19 -9
  68. package/build/commands/deploy/compileBuildDeployCommand.js +8 -8
  69. package/build/commands/deploy/deploy.js +4 -5
  70. package/build/commands/deploy/deployCommand.js +2 -2
  71. package/build/commands/deploy/internal/deployToSASJSWithServicePack.js +11 -12
  72. package/build/commands/deploy/internal/executeDeployScript.js +3 -4
  73. package/build/commands/deploy/internal/executeDeployScriptSas9.js +10 -11
  74. package/build/commands/deploy/internal/executeDeployScriptSasViya.js +11 -12
  75. package/build/commands/deploy/internal/executeDeployScriptSasjs.js +12 -13
  76. package/build/commands/deploy/internal/executeNonSasScript.js +4 -5
  77. package/build/commands/deploy/internal/executeSasScript.js +5 -6
  78. package/build/commands/deploy/internal/getDeployScripts.js +4 -5
  79. package/build/commands/deploy/spec/cbd.spec.js +19 -9
  80. package/build/commands/deploy/spec/cbd.spec.server.viya.js +19 -9
  81. package/build/commands/deploy/spec/compileBuildDeployCommand.spec.js +19 -9
  82. package/build/commands/deploy/spec/deploy.spec.js +19 -9
  83. package/build/commands/deploy/spec/deployCommand.spec.js +19 -9
  84. package/build/commands/deploy/spec/getDeployScripts.spec.js +2 -2
  85. package/build/commands/deploy/spec/utils.js +41 -8
  86. package/build/commands/docs/docsCommand.js +2 -2
  87. package/build/commands/docs/generateDocs.js +11 -12
  88. package/build/commands/docs/generateDot.js +3 -4
  89. package/build/commands/docs/initDocs.js +3 -4
  90. package/build/commands/docs/internal/createDotFiles.js +4 -5
  91. package/build/commands/docs/internal/getDocConfig.d.ts +8 -8
  92. package/build/commands/docs/internal/getDocConfig.js +1 -2
  93. package/build/commands/docs/internal/getDotFileContent.js +3 -4
  94. package/build/commands/docs/internal/getFileInputs.js +1 -2
  95. package/build/commands/docs/internal/getFileOutputs.js +1 -2
  96. package/build/commands/docs/internal/getFoldersForDocs.js +1 -2
  97. package/build/commands/docs/internal/populateNodeDictionary.js +1 -2
  98. package/build/commands/docs/internal/populateParamNodeTypes.js +21 -22
  99. package/build/commands/docs/spec/docsCommand.spec.js +19 -9
  100. package/build/commands/docs/spec/generateDocs.spec.js +2 -2
  101. package/build/commands/docs/spec/generateDot.spec.js +2 -2
  102. package/build/commands/docs/spec/getDocConfig.spec.js +2 -2
  103. package/build/commands/docs/spec/initDocs.spec.js +2 -2
  104. package/build/commands/flow/execute.js +6 -7
  105. package/build/commands/flow/flowCommand.js +2 -2
  106. package/build/commands/flow/internal/executeFlow.js +2 -2
  107. package/build/commands/flow/internal/saveLog.js +34 -5
  108. package/build/commands/flow/internal/saveToCsv.js +2 -2
  109. package/build/commands/flow/internal/spec/executeFlow.spec.js +19 -9
  110. package/build/commands/flow/internal/spec/saveToCsv.spec.js +2 -2
  111. package/build/commands/flow/internal/spec/validateParams.spec.js +19 -9
  112. package/build/commands/flow/internal/validateParams.d.ts +4 -4
  113. package/build/commands/flow/internal/validateParams.js +2 -2
  114. package/build/commands/flow/spec/flow.spec.js +19 -9
  115. package/build/commands/flow/spec/flow.spec.server.viya.js +2 -2
  116. package/build/commands/flow/spec/flowCommand.spec.js +19 -9
  117. package/build/commands/folder/create.js +2 -2
  118. package/build/commands/folder/delete.js +2 -2
  119. package/build/commands/folder/folderCommand.js +13 -13
  120. package/build/commands/folder/list.js +2 -2
  121. package/build/commands/folder/move.js +2 -2
  122. package/build/commands/folder/spec/folder.spec.server.viya.js +2 -2
  123. package/build/commands/folder/spec/folderCommand.spec.js +19 -9
  124. package/build/commands/fs/fsCommand.js +34 -36
  125. package/build/commands/fs/internal/executeCode.js +2 -2
  126. package/build/commands/fs/spec/executeCode.spec.js +19 -9
  127. package/build/commands/fs/spec/fsCommand.spec.js +19 -9
  128. package/build/commands/help/help.js +3 -4
  129. package/build/commands/help/helpCommand.js +2 -2
  130. package/build/commands/help/spec/help.spec.js +2 -2
  131. package/build/commands/help/spec/helpCommand.spec.js +19 -9
  132. package/build/commands/index.js +1 -1
  133. package/build/commands/init/init.js +5 -5
  134. package/build/commands/init/initCommand.js +2 -2
  135. package/build/commands/init/spec/init.spec.js +2 -2
  136. package/build/commands/init/spec/initCommand.spec.js +19 -9
  137. package/build/commands/job/internal/execute/sas9.js +3 -4
  138. package/build/commands/job/internal/execute/sasjs.js +4 -5
  139. package/build/commands/job/internal/execute/viya.js +9 -10
  140. package/build/commands/job/internal/utils.js +2 -2
  141. package/build/commands/job/jobCommand.js +19 -19
  142. package/build/commands/job/spec/execute.spec.js +19 -9
  143. package/build/commands/job/spec/getContextName.spec.js +2 -2
  144. package/build/commands/job/spec/job.spec.server.viya.js +24 -16
  145. package/build/commands/job/spec/jobCommand.spec.js +19 -9
  146. package/build/commands/lint/initLint.js +3 -4
  147. package/build/commands/lint/lintCommand.js +2 -2
  148. package/build/commands/lint/processLint.js +13 -14
  149. package/build/commands/lint/spec/lintCommand.spec.js +19 -9
  150. package/build/commands/request/request.js +3 -4
  151. package/build/commands/request/requestCommand.js +2 -2
  152. package/build/commands/request/spec/request.spec.server.sas9.js +19 -9
  153. package/build/commands/request/spec/request.spec.server.viya.js +19 -9
  154. package/build/commands/request/spec/requestCommand.spec.js +19 -9
  155. package/build/commands/request/spec/utils.js +2 -2
  156. package/build/commands/run/run.js +29 -30
  157. package/build/commands/run/runCommand.js +2 -2
  158. package/build/commands/run/spec/run.spec.js +19 -9
  159. package/build/commands/run/spec/run.spec.server.sas9.js +2 -2
  160. package/build/commands/run/spec/run.spec.server.sasjs.js +2 -2
  161. package/build/commands/run/spec/run.spec.server.viya.js +4 -4
  162. package/build/commands/run/spec/runCommand.spec.js +19 -9
  163. package/build/commands/servicepack/deploy.js +7 -8
  164. package/build/commands/servicepack/servicePackCommand.js +7 -7
  165. package/build/commands/servicepack/spec/servicepack.spec.server.viya.js +2 -2
  166. package/build/commands/servicepack/spec/servicepackCommand.spec.js +19 -9
  167. package/build/commands/shared/createConfigFile.js +2 -2
  168. package/build/commands/shared/createFileStructure.js +2 -2
  169. package/build/commands/shared/createLintConfigFile.js +2 -2
  170. package/build/commands/shared/deployToSasViyaWithServicePack.js +6 -7
  171. package/build/commands/shared/fetchLogFileContent.js +2 -2
  172. package/build/commands/shared/spec/deployToSasViyaWithServicePack.spec.js +19 -9
  173. package/build/commands/snippets/snippets.js +3 -4
  174. package/build/commands/snippets/snippetsCommand.js +2 -2
  175. package/build/commands/snippets/spec/snippets.spec.js +2 -2
  176. package/build/commands/snippets/spec/snippetsCommand.spec.js +19 -9
  177. package/build/commands/testing/internal/saveOutput.js +23 -15
  178. package/build/commands/testing/spec/testCommand.spec.js +19 -9
  179. package/build/commands/testing/spec/testing.spec.js +19 -9
  180. package/build/commands/testing/test.js +14 -14
  181. package/build/commands/testing/testCommand.js +2 -2
  182. package/build/commands/version/spec/version.spec.js +2 -2
  183. package/build/commands/version/spec/versionCommand.spec.js +19 -9
  184. package/build/commands/version/version.js +4 -5
  185. package/build/commands/version/versionCommand.js +2 -2
  186. package/build/commands/web/internal/createAssetServices.js +39 -41
  187. package/build/commands/web/internal/sas9/createClickMeService.js +2 -2
  188. package/build/commands/web/internal/sas9/generateAssetService.js +2 -2
  189. package/build/commands/web/internal/sas9/getWebServiceContent.js +34 -5
  190. package/build/commands/web/internal/sasViya/createClickMeFile.js +2 -2
  191. package/build/commands/web/internal/spec/updateSasjstag.spec.js +2 -2
  192. package/build/commands/web/internal/spec/updateScriptTag.spec.js +2 -2
  193. package/build/commands/web/internal/spec/updateStyleTag.spec.js +2 -2
  194. package/build/commands/web/internal/updateAllTags.js +86 -88
  195. package/build/commands/web/internal/updateLinkTag.d.ts +1 -1
  196. package/build/commands/web/internal/updateScriptTag.js +2 -2
  197. package/build/commands/web/internal/updateStyleTag.js +2 -2
  198. package/build/commands/web/spec/web.spec.js +2 -2
  199. package/build/commands/web/spec/webCommand.spec.js +19 -9
  200. package/build/commands/web/web.js +10 -11
  201. package/build/commands/web/webCommand.js +2 -2
  202. package/build/types/command/commandAliases.d.ts +1 -1
  203. package/build/types/command/commandBase.js +2 -2
  204. package/build/types/command/commandFactory.d.ts +1 -1
  205. package/build/types/command/returnCode.js +1 -1
  206. package/build/types/command/spec/commandBase.spec.js +2 -2
  207. package/build/types/command/spec/targetCommand.spec.js +19 -9
  208. package/build/types/command/targetCommand.js +2 -2
  209. package/build/types/flow.js +1 -1
  210. package/build/types/targetScope.js +1 -1
  211. package/build/types/testing.js +3 -3
  212. package/build/utils/auth.js +8 -8
  213. package/build/utils/compressAndSave.js +11 -6
  214. package/build/utils/config.js +82 -84
  215. package/build/utils/displayResult.js +2 -3
  216. package/build/utils/file.js +13 -13
  217. package/build/utils/loadEnvVariables.js +4 -5
  218. package/build/utils/parseSourceFile.js +3 -4
  219. package/build/utils/saveLog.js +34 -5
  220. package/build/utils/setConstants.js +34 -5
  221. package/build/utils/setProjectDir.js +2 -2
  222. package/build/utils/spec/auth.spec.js +2 -2
  223. package/build/utils/spec/config.spec.js +19 -9
  224. package/build/utils/spec/file.spec.js +2 -2
  225. package/build/utils/spec/saveLog.spec.js +2 -2
  226. package/build/utils/spec/setConstants.spec.js +20 -10
  227. package/build/utils/spec/utils.spec.js +2 -2
  228. package/build/utils/spec/zip.spec.d.ts +1 -0
  229. package/build/utils/spec/zip.spec.js +282 -0
  230. package/build/utils/test.d.ts +2 -3
  231. package/build/utils/test.js +103 -40
  232. package/build/utils/utils.js +102 -78
  233. package/build/utils/zip.d.ts +20 -0
  234. package/build/utils/zip.js +277 -0
  235. package/package.json +37 -34
@@ -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.");
@@ -41,7 +41,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
41
41
  Object.defineProperty(exports, "__esModule", { value: true });
42
42
  exports.compressAndSave = void 0;
43
43
  var path_1 = __importDefault(require("path"));
44
- var adm_zip_1 = __importDefault(require("adm-zip"));
44
+ var fs_1 = __importDefault(require("fs"));
45
+ var yazl_1 = __importDefault(require("yazl"));
45
46
  /**
46
47
  * Creates a zip file.
47
48
  * Having single JSON file in it.
@@ -53,11 +54,15 @@ var compressAndSave = function (saveTo, contents) { return __awaiter(void 0, voi
53
54
  return __generator(this, function (_a) {
54
55
  switch (_a.label) {
55
56
  case 0:
56
- zip = new adm_zip_1.default();
57
+ zip = new yazl_1.default.ZipFile();
57
58
  filenameInZip = path_1.default.basename(saveTo, path_1.default.extname(saveTo));
58
59
  // add file directly
59
- zip.addFile(filenameInZip, Buffer.from(contents, 'utf8'), 'entry comment goes here');
60
- return [4 /*yield*/, zip.writeZipPromise(saveTo, { overwrite: true })];
60
+ zip.addBuffer(Buffer.from(contents, 'utf8'), filenameInZip);
61
+ return [4 /*yield*/, new Promise(function (resolve, reject) {
62
+ zip.outputStream.on('error', reject);
63
+ zip.outputStream.pipe(fs_1.default.createWriteStream(saveTo)).on('close', resolve);
64
+ zip.end();
65
+ })];
61
66
  case 1:
62
67
  _a.sent();
63
68
  return [2 /*return*/];