@sasjs/cli 2.38.7 → 3.0.1

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 (78) hide show
  1. package/build/commands/add/addCredential.d.ts +2 -2
  2. package/build/commands/add/addCredential.js +26 -28
  3. package/build/commands/add/internal/input.js +15 -2
  4. package/build/commands/build/build.d.ts +1 -1
  5. package/build/commands/build/build.js +67 -56
  6. package/build/commands/build/internal/getLaunchPageCode.js +2 -1
  7. package/build/commands/compile/compile.js +18 -22
  8. package/build/commands/compile/internal/checkCompileStatus.js +6 -8
  9. package/build/commands/compile/internal/compileServiceFile.js +18 -16
  10. package/build/commands/compile/internal/spec/compileTestFile.spec.js +16 -4
  11. package/build/commands/compile/spec/loadDependencies.spec.js +3 -3
  12. package/build/commands/context/contextCommand.js +5 -5
  13. package/build/commands/deploy/deploy.d.ts +2 -1
  14. package/build/commands/deploy/deploy.js +92 -46
  15. package/build/commands/deploy/spec/cbd.spec.d.ts +1 -0
  16. package/build/commands/deploy/spec/cbd.spec.js +141 -0
  17. package/build/commands/deploy/spec/cbd.spec.server.js +6 -57
  18. package/build/commands/deploy/spec/utils.d.ts +6 -0
  19. package/build/commands/deploy/spec/utils.js +242 -0
  20. package/build/commands/docs/internal/getDocConfig.js +8 -3
  21. package/build/commands/docs/spec/generateDot.spec.js +0 -1
  22. package/build/commands/docs/spec/getDocConfig.spec.d.ts +1 -0
  23. package/build/commands/docs/spec/getDocConfig.spec.js +27 -0
  24. package/build/commands/flow/flowCommand.js +1 -1
  25. package/build/commands/flow/spec/flow.spec.server.js +1 -1
  26. package/build/commands/folder/folderCommand.js +2 -2
  27. package/build/commands/folder/spec/folder.spec.server.js +1 -1
  28. package/build/commands/job/internal/execute/index.d.ts +2 -0
  29. package/build/commands/job/internal/execute/index.js +14 -0
  30. package/build/commands/job/internal/execute/sasjs.d.ts +8 -0
  31. package/build/commands/job/internal/execute/sasjs.js +69 -0
  32. package/build/commands/job/{execute.d.ts → internal/execute/viya.d.ts} +1 -1
  33. package/build/commands/job/{execute.js → internal/execute/viya.js} +29 -68
  34. package/build/commands/job/internal/utils.d.ts +1 -0
  35. package/build/commands/job/internal/utils.js +81 -0
  36. package/build/commands/job/jobCommand.d.ts +2 -1
  37. package/build/commands/job/jobCommand.js +65 -23
  38. package/build/commands/job/spec/execute.spec.js +41 -21
  39. package/build/commands/job/spec/getContextName.spec.js +1 -1
  40. package/build/commands/job/spec/job.spec.server.js +4 -4
  41. package/build/commands/job/spec/jobCommand.spec.js +10 -10
  42. package/build/commands/request/request.js +1 -1
  43. package/build/commands/run/run.js +2 -2
  44. package/build/commands/servicepack/spec/servicepack.spec.server.js +0 -1
  45. package/build/commands/shared/dependencies.js +6 -9
  46. package/build/commands/shared/deployToSasViyaWithServicePack.js +1 -1
  47. package/build/commands/testing/test.js +1 -1
  48. package/build/commands/web/internal/createAssetServices.d.ts +5 -0
  49. package/build/commands/web/internal/createAssetServices.js +219 -0
  50. package/build/commands/web/internal/getTags.d.ts +4 -0
  51. package/build/commands/web/internal/getTags.js +21 -0
  52. package/build/commands/web/internal/getWebServiceContent.d.ts +2 -0
  53. package/build/commands/web/internal/getWebServiceContent.js +84 -0
  54. package/build/commands/web/{spec → internal/spec}/testFiles/script1.d.ts +0 -0
  55. package/build/commands/web/{spec → internal/spec}/testFiles/script1.js +0 -0
  56. package/build/commands/web/{spec → internal/spec}/testFiles/script2.d.ts +0 -0
  57. package/build/commands/web/{spec → internal/spec}/testFiles/script2.js +0 -0
  58. package/build/commands/web/{spec/updateTagSource.spec.d.ts → internal/spec/updateScriptTag.spec.d.ts} +0 -0
  59. package/build/commands/web/{spec/updateTagSource.spec.js → internal/spec/updateScriptTag.spec.js} +7 -7
  60. package/build/commands/web/internal/updateAllTags.d.ts +13 -0
  61. package/build/commands/web/internal/updateAllTags.js +94 -0
  62. package/build/commands/web/internal/updateLinkHref.d.ts +4 -0
  63. package/build/commands/web/internal/updateLinkHref.js +18 -0
  64. package/build/commands/web/internal/updateScriptTag.d.ts +5 -0
  65. package/build/commands/web/internal/updateScriptTag.js +85 -0
  66. package/build/commands/web/web.d.ts +0 -4
  67. package/build/commands/web/web.js +64 -378
  68. package/build/config.json +3 -1
  69. package/build/utils/config.d.ts +1 -1
  70. package/build/utils/config.js +106 -71
  71. package/build/utils/file.d.ts +1 -1
  72. package/build/utils/file.js +1 -1
  73. package/build/utils/spec/removeComments.spec.d.ts +1 -1
  74. package/build/utils/spec/removeComments.spec.js +1 -1
  75. package/build/utils/test.js +1 -1
  76. package/build/utils/utils.d.ts +1 -0
  77. package/build/utils/utils.js +8 -2
  78. package/package.json +13 -13
@@ -234,26 +234,28 @@ exports.findTargetInConfiguration = findTargetInConfiguration;
234
234
  function getLocalTarget(targetName) {
235
235
  var _a;
236
236
  return __awaiter(this, void 0, void 0, function () {
237
- var localConfig, targetJson;
238
- return __generator(this, function (_b) {
239
- switch (_b.label) {
237
+ var localConfig, targetJson, _b;
238
+ return __generator(this, function (_c) {
239
+ switch (_c.label) {
240
240
  case 0: return [4 /*yield*/, getConfiguration(path_1.default.join(process.projectDir, 'sasjs', 'sasjsconfig.json')).catch(function () { return null; })];
241
241
  case 1:
242
- localConfig = _b.sent();
243
- if (localConfig === null || localConfig === void 0 ? void 0 : localConfig.targets) {
244
- targetJson = localConfig.targets.find(function (t) { return t.name === targetName; });
245
- if (targetJson) {
246
- (_a = process.logger) === null || _a === void 0 ? void 0 : _a.info("Target " + targetName + " was found in your local sasjsconfig.json file.");
247
- targetJson.appLoc = sanitizeAppLoc(targetJson.appLoc);
248
- if (!targetJson.hasOwnProperty('serverUrl')) {
249
- targetJson.serverUrl = '';
250
- }
251
- targetJson.serverUrl = utils_1.urlOrigin(targetJson.serverUrl);
252
- targetJson.allowInsecureRequests = getPrecedenceOfInsecureRequests(localConfig, targetJson);
253
- return [2 /*return*/, new utils_1.Target(targetJson)];
254
- }
242
+ localConfig = _c.sent();
243
+ if (!(localConfig === null || localConfig === void 0 ? void 0 : localConfig.targets)) return [3 /*break*/, 3];
244
+ targetJson = localConfig.targets.find(function (t) { return t.name === targetName; });
245
+ if (!targetJson) return [3 /*break*/, 3];
246
+ (_a = process.logger) === null || _a === void 0 ? void 0 : _a.info("Target " + targetName + " was found in your local sasjsconfig.json file.");
247
+ targetJson.appLoc = sanitizeAppLoc(targetJson.appLoc);
248
+ if (!targetJson.hasOwnProperty('serverUrl')) {
249
+ targetJson.serverUrl = '';
255
250
  }
256
- throw new Error(ERROR_MESSAGE(targetName).NOT_FOUND_TARGET_NAME);
251
+ targetJson.serverUrl = utils_1.urlOrigin(targetJson.serverUrl);
252
+ _b = targetJson;
253
+ return [4 /*yield*/, getPrecedenceOfHttpsAgentOptionsAndContent(localConfig, targetJson)];
254
+ case 2:
255
+ _b.httpsAgentOptions =
256
+ _c.sent();
257
+ return [2 /*return*/, new utils_1.Target(targetJson)];
258
+ case 3: throw new Error(ERROR_MESSAGE(targetName).NOT_FOUND_TARGET_NAME);
257
259
  }
258
260
  });
259
261
  });
@@ -261,31 +263,34 @@ function getLocalTarget(targetName) {
261
263
  function getLocalFallbackTarget() {
262
264
  var _a, _b;
263
265
  return __awaiter(this, void 0, void 0, function () {
264
- var localConfig, fallBackTargetJson, defaultTargetName_1;
265
- return __generator(this, function (_c) {
266
- switch (_c.label) {
266
+ var localConfig, fallBackTargetJson, defaultTargetName_1, _c;
267
+ return __generator(this, function (_d) {
268
+ switch (_d.label) {
267
269
  case 0: return [4 /*yield*/, getConfiguration(path_1.default.join(process.projectDir, 'sasjs', 'sasjsconfig.json')).catch(function () { return null; })];
268
270
  case 1:
269
- localConfig = _c.sent();
270
- if (!(localConfig === null || localConfig === void 0 ? void 0 : localConfig.targets)) return [3 /*break*/, 3];
271
+ localConfig = _d.sent();
272
+ if (!(localConfig === null || localConfig === void 0 ? void 0 : localConfig.targets)) return [3 /*break*/, 4];
271
273
  defaultTargetName_1 = localConfig === null || localConfig === void 0 ? void 0 : localConfig.defaultTarget;
272
274
  if (defaultTargetName_1) {
273
275
  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; });
274
276
  }
275
- if (!fallBackTargetJson) return [3 /*break*/, 3];
277
+ if (!fallBackTargetJson) return [3 /*break*/, 4];
276
278
  (_b = process.logger) === null || _b === void 0 ? void 0 : _b.info("No target was specified. Falling back to default target '" + fallBackTargetJson.name + "' from your local sasjsconfig.json file.");
277
279
  fallBackTargetJson.appLoc = sanitizeAppLoc(fallBackTargetJson.appLoc);
278
280
  if (!fallBackTargetJson.hasOwnProperty('serverUrl')) {
279
281
  fallBackTargetJson.serverUrl = '';
280
282
  }
281
283
  fallBackTargetJson.serverUrl = utils_1.urlOrigin(fallBackTargetJson.serverUrl);
282
- fallBackTargetJson.allowInsecureRequests =
283
- getPrecedenceOfInsecureRequests(localConfig, fallBackTargetJson);
284
- return [4 /*yield*/, utils_2.loadEnvVariables(".env." + fallBackTargetJson.name)];
284
+ _c = fallBackTargetJson;
285
+ return [4 /*yield*/, getPrecedenceOfHttpsAgentOptionsAndContent(localConfig, fallBackTargetJson)];
285
286
  case 2:
286
- _c.sent();
287
+ _c.httpsAgentOptions =
288
+ _d.sent();
289
+ return [4 /*yield*/, utils_2.loadEnvVariables(".env." + fallBackTargetJson.name)];
290
+ case 3:
291
+ _d.sent();
287
292
  return [2 /*return*/, new utils_1.Target(fallBackTargetJson)];
288
- case 3: throw new Error(ERROR_MESSAGE().NOT_FOUND_FALLBACK);
293
+ case 4: throw new Error(ERROR_MESSAGE().NOT_FOUND_FALLBACK);
289
294
  }
290
295
  });
291
296
  });
@@ -293,26 +298,28 @@ function getLocalFallbackTarget() {
293
298
  function getGlobalTarget(targetName) {
294
299
  var _a;
295
300
  return __awaiter(this, void 0, void 0, function () {
296
- var globalConfig, targetJson;
297
- return __generator(this, function (_b) {
298
- switch (_b.label) {
301
+ var globalConfig, targetJson, _b;
302
+ return __generator(this, function (_c) {
303
+ switch (_c.label) {
299
304
  case 0: return [4 /*yield*/, getGlobalRcFile()];
300
305
  case 1:
301
- globalConfig = _b.sent();
302
- if (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.targets) {
303
- targetJson = globalConfig.targets.find(function (t) { return t.name === targetName; });
304
- if (targetJson) {
305
- (_a = process.logger) === null || _a === void 0 ? void 0 : _a.info("Target " + targetName + " was found in your global .sasjsrc file.");
306
- targetJson.appLoc = sanitizeAppLoc(targetJson.appLoc);
307
- if (!targetJson.hasOwnProperty('serverUrl')) {
308
- targetJson.serverUrl = '';
309
- }
310
- targetJson.serverUrl = utils_1.urlOrigin(targetJson.serverUrl);
311
- targetJson.allowInsecureRequests = getPrecedenceOfInsecureRequests(globalConfig, targetJson);
312
- return [2 /*return*/, new utils_1.Target(targetJson)];
313
- }
306
+ globalConfig = _c.sent();
307
+ if (!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.targets)) return [3 /*break*/, 3];
308
+ targetJson = globalConfig.targets.find(function (t) { return t.name === targetName; });
309
+ if (!targetJson) return [3 /*break*/, 3];
310
+ (_a = process.logger) === null || _a === void 0 ? void 0 : _a.info("Target " + targetName + " was found in your global .sasjsrc file.");
311
+ targetJson.appLoc = sanitizeAppLoc(targetJson.appLoc);
312
+ if (!targetJson.hasOwnProperty('serverUrl')) {
313
+ targetJson.serverUrl = '';
314
314
  }
315
- throw new Error(ERROR_MESSAGE(targetName).NOT_FOUND_TARGET_NAME);
315
+ targetJson.serverUrl = utils_1.urlOrigin(targetJson.serverUrl);
316
+ _b = targetJson;
317
+ return [4 /*yield*/, getPrecedenceOfHttpsAgentOptionsAndContent(globalConfig, targetJson)];
318
+ case 2:
319
+ _b.httpsAgentOptions =
320
+ _c.sent();
321
+ return [2 /*return*/, new utils_1.Target(targetJson)];
322
+ case 3: throw new Error(ERROR_MESSAGE(targetName).NOT_FOUND_TARGET_NAME);
316
323
  }
317
324
  });
318
325
  });
@@ -320,27 +327,30 @@ function getGlobalTarget(targetName) {
320
327
  function getGlobalFallbackTarget() {
321
328
  var _a, _b;
322
329
  return __awaiter(this, void 0, void 0, function () {
323
- var globalConfig, fallBackTargetJson, defaultTargetName;
324
- return __generator(this, function (_c) {
325
- switch (_c.label) {
330
+ var globalConfig, fallBackTargetJson, defaultTargetName, _c;
331
+ return __generator(this, function (_d) {
332
+ switch (_d.label) {
326
333
  case 0: return [4 /*yield*/, getGlobalRcFile()];
327
334
  case 1:
328
- globalConfig = (_c.sent());
335
+ globalConfig = (_d.sent());
329
336
  defaultTargetName = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.defaultTarget;
330
337
  if (defaultTargetName) {
331
338
  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; });
332
339
  }
333
- if (fallBackTargetJson) {
334
- (_b = process.logger) === null || _b === void 0 ? void 0 : _b.info("No target was specified. Falling back to default target '" + fallBackTargetJson.name + "' from your global .sasjsrc file.");
335
- fallBackTargetJson.appLoc = sanitizeAppLoc(fallBackTargetJson.appLoc);
336
- if (!fallBackTargetJson.hasOwnProperty('serverUrl')) {
337
- fallBackTargetJson.serverUrl = '';
338
- }
339
- fallBackTargetJson.serverUrl = utils_1.urlOrigin(fallBackTargetJson.serverUrl);
340
- fallBackTargetJson.allowInsecureRequests = getPrecedenceOfInsecureRequests(globalConfig, fallBackTargetJson);
341
- return [2 /*return*/, new utils_1.Target(fallBackTargetJson)];
340
+ if (!fallBackTargetJson) return [3 /*break*/, 3];
341
+ (_b = process.logger) === null || _b === void 0 ? void 0 : _b.info("No target was specified. Falling back to default target '" + fallBackTargetJson.name + "' from your global .sasjsrc file.");
342
+ fallBackTargetJson.appLoc = sanitizeAppLoc(fallBackTargetJson.appLoc);
343
+ if (!fallBackTargetJson.hasOwnProperty('serverUrl')) {
344
+ fallBackTargetJson.serverUrl = '';
342
345
  }
343
- throw new Error(ERROR_MESSAGE().NOT_FOUND_FALLBACK);
346
+ fallBackTargetJson.serverUrl = utils_1.urlOrigin(fallBackTargetJson.serverUrl);
347
+ _c = fallBackTargetJson;
348
+ return [4 /*yield*/, getPrecedenceOfHttpsAgentOptionsAndContent(globalConfig, fallBackTargetJson)];
349
+ case 2:
350
+ _c.httpsAgentOptions =
351
+ _d.sent();
352
+ return [2 /*return*/, new utils_1.Target(fallBackTargetJson)];
353
+ case 3: throw new Error(ERROR_MESSAGE().NOT_FOUND_FALLBACK);
344
354
  }
345
355
  });
346
356
  });
@@ -682,13 +692,8 @@ function getStreamConfig(target) {
682
692
  }
683
693
  exports.getStreamConfig = getStreamConfig;
684
694
  function getMacroCorePath() {
685
- return __awaiter(this, void 0, void 0, function () {
686
- var macroCorePath;
687
- return __generator(this, function (_a) {
688
- macroCorePath = process.sasjsConstants.macroCorePath;
689
- return [2 /*return*/, macroCorePath];
690
- });
691
- });
695
+ var macroCorePath = process.sasjsConstants.macroCorePath;
696
+ return macroCorePath;
692
697
  }
693
698
  exports.getMacroCorePath = getMacroCorePath;
694
699
  /**
@@ -803,7 +808,7 @@ function getAuthConfig(target) {
803
808
  if (!auth_1.isAccessTokenExpiring(access_token)) return [3 /*break*/, 7];
804
809
  sasjs = new node_1.default({
805
810
  serverUrl: target.serverUrl,
806
- allowInsecureRequests: target.allowInsecureRequests,
811
+ httpsAgentOptions: target.httpsAgentOptions,
807
812
  serverType: target.serverType
808
813
  });
809
814
  if (!auth_1.isRefreshTokenExpiring(refresh_token)) return [3 /*break*/, 4];
@@ -871,7 +876,7 @@ function getAccessToken(target, checkIfExpiring) {
871
876
  if (!(checkIfExpiring && auth_1.isAccessTokenExpiring(accessToken))) return [3 /*break*/, 7];
872
877
  sasjs = new node_1.default({
873
878
  serverUrl: target.serverUrl,
874
- allowInsecureRequests: target.allowInsecureRequests,
879
+ httpsAgentOptions: target.httpsAgentOptions,
875
880
  serverType: target.serverType
876
881
  });
877
882
  client = target.authConfig && target.authConfig.client
@@ -952,9 +957,39 @@ var overrideEnvVariables = function (targetName) { return __awaiter(void 0, void
952
957
  });
953
958
  }); };
954
959
  exports.overrideEnvVariables = overrideEnvVariables;
955
- var getPrecedenceOfInsecureRequests = function (config, target) {
956
- var _a;
957
- return (_a = target.allowInsecureRequests) !== null && _a !== void 0 ? _a : !!config.allowInsecureRequests;
960
+ var getPrecedenceOfHttpsAgentOptionsAndContent = function (config, target) { return __awaiter(void 0, void 0, void 0, function () {
961
+ var httpsAgentOptions, _a, _b, _c;
962
+ return __generator(this, function (_d) {
963
+ switch (_d.label) {
964
+ case 0:
965
+ httpsAgentOptions = getHttpsAgentOptionsForInsecure(__assign(__assign({ allowInsecureRequests: false }, config.httpsAgentOptions), target.httpsAgentOptions));
966
+ if (!httpsAgentOptions.caPath) return [3 /*break*/, 2];
967
+ _a = httpsAgentOptions;
968
+ return [4 /*yield*/, utils_1.readFile(httpsAgentOptions.caPath)];
969
+ case 1:
970
+ _a.ca = _d.sent();
971
+ _d.label = 2;
972
+ case 2:
973
+ if (!httpsAgentOptions.keyPath) return [3 /*break*/, 4];
974
+ _b = httpsAgentOptions;
975
+ return [4 /*yield*/, utils_1.readFile(httpsAgentOptions.keyPath)];
976
+ case 3:
977
+ _b.key = _d.sent();
978
+ _d.label = 4;
979
+ case 4:
980
+ if (!httpsAgentOptions.certPath) return [3 /*break*/, 6];
981
+ _c = httpsAgentOptions;
982
+ return [4 /*yield*/, utils_1.readFile(httpsAgentOptions.certPath)];
983
+ case 5:
984
+ _c.cert = _d.sent();
985
+ _d.label = 6;
986
+ case 6: return [2 /*return*/, httpsAgentOptions];
987
+ }
988
+ });
989
+ }); };
990
+ var getHttpsAgentOptionsForInsecure = function (options) {
991
+ return options.allowInsecureRequests
992
+ ? __assign({ rejectUnauthorized: false }, options) : options;
958
993
  };
959
994
  var getTestSetUp = function (target) { return __awaiter(void 0, void 0, void 0, function () {
960
995
  var projectRoot, localConfig;
@@ -6,7 +6,7 @@ export function isCsvFile(filePath: any): boolean;
6
6
  export function isShellScript(filePath: any): boolean;
7
7
  /**
8
8
  * Gets a list of @li items from the supplied file content with the specified header.
9
- * @param {string} listHeader - the header of the section to look for - e.g. <h4> Dependencies </h4>.
9
+ * @param {string} listHeader - the header of the section to look for - e.g. <h4> SAS Macros </h4>.
10
10
  * @param {string} fileContent - the text content of the file.
11
11
  */
12
12
  export function getList(listHeader: string, fileContent: string): any[];
@@ -131,7 +131,7 @@ var sanitizeFileName = function (fileName) {
131
131
  exports.sanitizeFileName = sanitizeFileName;
132
132
  /**
133
133
  * Gets a list of @li items from the supplied file content with the specified header.
134
- * @param {string} listHeader - the header of the section to look for - e.g. <h4> Dependencies </h4>.
134
+ * @param {string} listHeader - the header of the section to look for - e.g. <h4> SAS Macros </h4>.
135
135
  * @param {string} fileContent - the text content of the file.
136
136
  */
137
137
  function getList(listHeader, fileContent) {
@@ -1 +1 @@
1
- export declare const sampleSasProgram = "/**\n @file mv_createfolder.sas\n @brief Creates a viya folder if that foloder does not already exist\n @details Expects oauth token in a global macro variable (default\n ACCESS_TOKEN).\n\n options mprint;\n %mv_createfolder(path=/Public)\n\n\n @param path= The full path of the folder to be created\n @param access_token_var= The global macro variable to contain the access token\n @param grant_type= valid values are \"password\" or \"authorization_code\" (unquoted).\n The default is authorization_code.\n\n\n @version VIYA V.03.04\n @author Allan Bowe\n @source https://github.com/sasjs/core\n\n <h4> Dependencies </h4>\n @li mf_abort.sas\n @li mf_getuniquefileref.sas\n @li mf_getuniquelibref.sas\n @li mf_isblank.sas\n\n**/\n\n/* This is a comment\nthat spans\nmultiple lines */\n\n%macro mv_createfolder(path=\n ,access_token_var=ACCESS_TOKEN\n ,grant_type=authorization_code\n);";
1
+ export declare const sampleSasProgram = "/**\n @file mv_createfolder.sas\n @brief Creates a viya folder if that foloder does not already exist\n @details Expects oauth token in a global macro variable (default\n ACCESS_TOKEN).\n\n options mprint;\n %mv_createfolder(path=/Public)\n\n\n @param path= The full path of the folder to be created\n @param access_token_var= The global macro variable to contain the access token\n @param grant_type= valid values are \"password\" or \"authorization_code\" (unquoted).\n The default is authorization_code.\n\n\n @version VIYA V.03.04\n @author Allan Bowe\n @source https://github.com/sasjs/core\n\n <h4> SAS Macros </h4>\n @li mf_abort.sas\n @li mf_getuniquefileref.sas\n @li mf_getuniquelibref.sas\n @li mf_isblank.sas\n\n**/\n\n/* This is a comment\nthat spans\nmultiple lines */\n\n%macro mv_createfolder(path=\n ,access_token_var=ACCESS_TOKEN\n ,grant_type=authorization_code\n);";
@@ -43,4 +43,4 @@ describe('removeComments', function () {
43
43
  expect(utils_1.removeComments(text)).toEqual(text);
44
44
  });
45
45
  });
46
- exports.sampleSasProgram = "/**\n @file mv_createfolder.sas\n @brief Creates a viya folder if that foloder does not already exist\n @details Expects oauth token in a global macro variable (default\n ACCESS_TOKEN).\n\n options mprint;\n %mv_createfolder(path=/Public)\n\n\n @param path= The full path of the folder to be created\n @param access_token_var= The global macro variable to contain the access token\n @param grant_type= valid values are \"password\" or \"authorization_code\" (unquoted).\n The default is authorization_code.\n\n\n @version VIYA V.03.04\n @author Allan Bowe\n @source https://github.com/sasjs/core\n\n <h4> Dependencies </h4>\n @li mf_abort.sas\n @li mf_getuniquefileref.sas\n @li mf_getuniquelibref.sas\n @li mf_isblank.sas\n\n**/\n\n/* This is a comment\nthat spans\nmultiple lines */\n\n%macro mv_createfolder(path=\n ,access_token_var=ACCESS_TOKEN\n ,grant_type=authorization_code\n);";
46
+ exports.sampleSasProgram = "/**\n @file mv_createfolder.sas\n @brief Creates a viya folder if that foloder does not already exist\n @details Expects oauth token in a global macro variable (default\n ACCESS_TOKEN).\n\n options mprint;\n %mv_createfolder(path=/Public)\n\n\n @param path= The full path of the folder to be created\n @param access_token_var= The global macro variable to contain the access token\n @param grant_type= valid values are \"password\" or \"authorization_code\" (unquoted).\n The default is authorization_code.\n\n\n @version VIYA V.03.04\n @author Allan Bowe\n @source https://github.com/sasjs/core\n\n <h4> SAS Macros </h4>\n @li mf_abort.sas\n @li mf_getuniquefileref.sas\n @li mf_getuniquelibref.sas\n @li mf_isblank.sas\n\n**/\n\n/* This is a comment\nthat spans\nmultiple lines */\n\n%macro mv_createfolder(path=\n ,access_token_var=ACCESS_TOKEN\n ,grant_type=authorization_code\n);";
@@ -147,7 +147,7 @@ var removeTestServerFolder = function (folderPath, target) { return __awaiter(vo
147
147
  }
148
148
  sasjs = new node_1.default({
149
149
  serverUrl: target.serverUrl,
150
- allowInsecureRequests: target.allowInsecureRequests,
150
+ httpsAgentOptions: target.httpsAgentOptions,
151
151
  appLoc: target.appLoc,
152
152
  serverType: target.serverType
153
153
  });
@@ -37,3 +37,4 @@ export declare const getAbsolutePath: (providedPath: string, relativePath: strin
37
37
  export declare const loadEnvVariables: (fileName: string) => Promise<void>;
38
38
  export declare function prefixAppLoc(appLoc?: string, path?: string): string | null;
39
39
  export declare const isWindows: () => boolean;
40
+ export declare const terminateProcess: (status: number) => never;
@@ -82,7 +82,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
82
82
  return (mod && mod.__esModule) ? mod : { "default": mod };
83
83
  };
84
84
  Object.defineProperty(exports, "__esModule", { value: true });
85
- exports.isWindows = exports.prefixAppLoc = exports.loadEnvVariables = exports.getAbsolutePath = exports.displaySasjsRunnerError = exports.getAdapterInstance = exports.checkNodeVersion = exports.millisecondsToDdHhMmSs = exports.arrToObj = exports.parseLogLines = exports.chunk = exports.executeShellScript = exports.getUniqServicesObj = exports.removeComments = exports.setupDoxygen = exports.setupGhooks = exports.setupGitIgnore = exports.setupNpmProject = exports.createTemplateApp = exports.createMinimalApp = exports.createAngularApp = exports.createReactApp = exports.diff = exports.inExistingProject = void 0;
85
+ exports.terminateProcess = exports.isWindows = exports.prefixAppLoc = exports.loadEnvVariables = exports.getAbsolutePath = exports.displaySasjsRunnerError = exports.getAdapterInstance = exports.checkNodeVersion = exports.millisecondsToDdHhMmSs = exports.arrToObj = exports.parseLogLines = exports.chunk = exports.executeShellScript = exports.getUniqServicesObj = exports.removeComments = exports.setupDoxygen = exports.setupGhooks = exports.setupGitIgnore = exports.setupNpmProject = exports.createTemplateApp = exports.createMinimalApp = exports.createAngularApp = exports.createReactApp = exports.diff = exports.inExistingProject = void 0;
86
86
  var shelljs_1 = __importDefault(require("shelljs"));
87
87
  var path_1 = __importDefault(require("path"));
88
88
  var os_1 = __importDefault(require("os"));
@@ -510,7 +510,7 @@ function getAdapterInstance(target) {
510
510
  var sasjs = new node_1.default({
511
511
  serverUrl: target.serverUrl,
512
512
  serverType: target.serverType,
513
- allowInsecureRequests: target.allowInsecureRequests,
513
+ httpsAgentOptions: target.httpsAgentOptions,
514
514
  contextName: target.contextName,
515
515
  useComputeApi: true,
516
516
  debug: process.env.LOG_LEVEL === utils_1.LogLevel.Debug
@@ -572,3 +572,9 @@ function prefixAppLoc(appLoc, path) {
572
572
  exports.prefixAppLoc = prefixAppLoc;
573
573
  var isWindows = function () { return process.platform === 'win32'; };
574
574
  exports.isWindows = isWindows;
575
+ var terminateProcess = function (status) {
576
+ var _a;
577
+ (_a = process.logger) === null || _a === void 0 ? void 0 : _a.info("Process will be terminated with the status code " + status + ".");
578
+ process.exit(status);
579
+ };
580
+ exports.terminateProcess = terminateProcess;
package/package.json CHANGED
@@ -53,17 +53,17 @@
53
53
  }
54
54
  },
55
55
  "dependencies": {
56
- "@sasjs/adapter": "2.11.3",
56
+ "@sasjs/adapter": "3.0.0",
57
57
  "@sasjs/core": "2.45.2",
58
58
  "@sasjs/lint": "1.11.2",
59
- "@sasjs/utils": "2.31.0",
59
+ "@sasjs/utils": "2.33.1",
60
60
  "chalk": "4.1.2",
61
61
  "csv-stringify": "5.6.5",
62
62
  "dotenv": "10.0.0",
63
63
  "esm": "3.2.25",
64
64
  "find": "0.3.0",
65
65
  "get-installed-path": "4.0.8",
66
- "js-base64": "3.7.0",
66
+ "js-base64": "3.7.2",
67
67
  "jsdom": "17.0.0",
68
68
  "jwt-decode": "3.1.2",
69
69
  "lodash.groupby": "4.6.0",
@@ -73,35 +73,35 @@
73
73
  "rimraf": "3.0.2",
74
74
  "shelljs": "0.8.4",
75
75
  "xml": "1.0.1",
76
- "yargs": "17.1.1"
76
+ "yargs": "17.2.1"
77
77
  },
78
78
  "devDependencies": {
79
79
  "@babel/preset-env": "7.15.6",
80
80
  "@babel/preset-typescript": "7.15.0",
81
81
  "@types/find": "0.2.1",
82
82
  "@types/get-installed-path": "4.0.1",
83
- "@types/jest": "27.0.1",
83
+ "@types/jest": "27.0.2",
84
84
  "@types/jsdom": "16.2.13",
85
85
  "@types/lodash.groupby": "4.6.6",
86
86
  "@types/lodash.uniqby": "4.7.6",
87
- "@types/node": "16.9.1",
87
+ "@types/node": "16.10.2",
88
88
  "@types/shelljs": "0.8.9",
89
89
  "@types/url-parse": "1.4.4",
90
90
  "@types/xml": "1.0.6",
91
- "babel-jest": "27.2.0",
91
+ "babel-jest": "27.2.4",
92
92
  "copyfiles": "2.4.1",
93
93
  "ghooks": "2.0.4",
94
- "jest": "27.1.0",
95
- "jest-cli": "27.2.0",
96
- "jest-extended": "0.11.5",
97
- "nodemon": "2.0.12",
94
+ "jest": "27.2.4",
95
+ "jest-cli": "27.2.4",
96
+ "jest-extended": "1.1.0",
97
+ "nodemon": "2.0.13",
98
98
  "semantic-release": "17.4.7",
99
99
  "ts-jest": "27.0.5",
100
100
  "ts-node": "10.2.1",
101
101
  "tslib": "2.3.1",
102
102
  "typescript": "4.3.5",
103
103
  "util": "0.12.4",
104
- "validate-commit-msg": "2.14.0"
104
+ "validate-commit-msg": "1.1.3"
105
105
  },
106
- "version": "2.38.7"
106
+ "version": "3.0.1"
107
107
  }