@sasjs/cli 2.38.8 → 3.0.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.
- package/build/commands/add/addCredential.d.ts +2 -2
- package/build/commands/add/addCredential.js +26 -28
- package/build/commands/add/internal/input.js +15 -2
- package/build/commands/build/build.d.ts +1 -1
- package/build/commands/build/build.js +41 -19
- package/build/commands/build/internal/getLaunchPageCode.js +2 -1
- package/build/commands/compile/internal/compileServiceFile.js +11 -7
- package/build/commands/compile/internal/compileTestFile.js +1 -1
- package/build/commands/compile/internal/spec/compileTestFile.spec.js +16 -4
- package/build/commands/compile/spec/compile.spec.js +30 -0
- package/build/commands/compile/spec/loadDependencies.spec.js +3 -3
- package/build/commands/context/contextCommand.js +5 -5
- package/build/commands/deploy/deploy.d.ts +2 -1
- package/build/commands/deploy/deploy.js +92 -46
- package/build/commands/deploy/spec/cbd.spec.d.ts +1 -0
- package/build/commands/deploy/spec/cbd.spec.js +141 -0
- package/build/commands/deploy/spec/cbd.spec.server.js +6 -57
- package/build/commands/deploy/spec/utils.d.ts +6 -0
- package/build/commands/deploy/spec/utils.js +242 -0
- package/build/commands/flow/flowCommand.js +1 -1
- package/build/commands/flow/spec/flow.spec.server.js +1 -1
- package/build/commands/folder/folderCommand.js +2 -2
- package/build/commands/folder/spec/folder.spec.server.js +1 -1
- package/build/commands/job/internal/execute/index.d.ts +2 -0
- package/build/commands/job/internal/execute/index.js +14 -0
- package/build/commands/job/internal/execute/sasjs.d.ts +8 -0
- package/build/commands/job/internal/execute/sasjs.js +69 -0
- package/build/commands/job/{execute.d.ts → internal/execute/viya.d.ts} +1 -1
- package/build/commands/job/{execute.js → internal/execute/viya.js} +29 -68
- package/build/commands/job/internal/utils.d.ts +1 -0
- package/build/commands/job/internal/utils.js +81 -0
- package/build/commands/job/jobCommand.d.ts +2 -1
- package/build/commands/job/jobCommand.js +65 -23
- package/build/commands/job/spec/execute.spec.js +41 -21
- package/build/commands/job/spec/getContextName.spec.js +1 -1
- package/build/commands/job/spec/job.spec.server.js +4 -4
- package/build/commands/job/spec/jobCommand.spec.js +10 -10
- package/build/commands/request/request.js +1 -1
- package/build/commands/run/run.js +2 -2
- package/build/commands/servicepack/spec/servicepack.spec.server.js +0 -1
- package/build/commands/shared/deployToSasViyaWithServicePack.js +1 -1
- package/build/commands/testing/test.js +1 -1
- package/build/config.json +3 -1
- package/build/utils/config.js +104 -64
- package/build/utils/file.d.ts +1 -1
- package/build/utils/file.js +1 -1
- package/build/utils/spec/removeComments.spec.d.ts +1 -1
- package/build/utils/spec/removeComments.spec.js +1 -1
- package/build/utils/test.js +1 -1
- package/build/utils/utils.d.ts +1 -0
- package/build/utils/utils.js +8 -2
- package/package.json +13 -13
package/build/utils/config.js
CHANGED
|
@@ -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 (
|
|
239
|
-
switch (
|
|
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 =
|
|
243
|
-
if (localConfig === null || localConfig === void 0 ? void 0 : localConfig.targets)
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
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
|
-
|
|
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 (
|
|
266
|
-
switch (
|
|
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 =
|
|
270
|
-
if (!(localConfig === null || localConfig === void 0 ? void 0 : localConfig.targets)) return [3 /*break*/,
|
|
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*/,
|
|
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
|
-
|
|
283
|
-
|
|
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.
|
|
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
|
|
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 (
|
|
298
|
-
switch (
|
|
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 =
|
|
302
|
-
if (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.targets)
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
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
|
-
|
|
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 (
|
|
325
|
-
switch (
|
|
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 = (
|
|
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
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
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
|
-
|
|
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
|
});
|
|
@@ -798,7 +808,7 @@ function getAuthConfig(target) {
|
|
|
798
808
|
if (!auth_1.isAccessTokenExpiring(access_token)) return [3 /*break*/, 7];
|
|
799
809
|
sasjs = new node_1.default({
|
|
800
810
|
serverUrl: target.serverUrl,
|
|
801
|
-
|
|
811
|
+
httpsAgentOptions: target.httpsAgentOptions,
|
|
802
812
|
serverType: target.serverType
|
|
803
813
|
});
|
|
804
814
|
if (!auth_1.isRefreshTokenExpiring(refresh_token)) return [3 /*break*/, 4];
|
|
@@ -866,7 +876,7 @@ function getAccessToken(target, checkIfExpiring) {
|
|
|
866
876
|
if (!(checkIfExpiring && auth_1.isAccessTokenExpiring(accessToken))) return [3 /*break*/, 7];
|
|
867
877
|
sasjs = new node_1.default({
|
|
868
878
|
serverUrl: target.serverUrl,
|
|
869
|
-
|
|
879
|
+
httpsAgentOptions: target.httpsAgentOptions,
|
|
870
880
|
serverType: target.serverType
|
|
871
881
|
});
|
|
872
882
|
client = target.authConfig && target.authConfig.client
|
|
@@ -947,9 +957,39 @@ var overrideEnvVariables = function (targetName) { return __awaiter(void 0, void
|
|
|
947
957
|
});
|
|
948
958
|
}); };
|
|
949
959
|
exports.overrideEnvVariables = overrideEnvVariables;
|
|
950
|
-
var
|
|
951
|
-
var _a;
|
|
952
|
-
return (
|
|
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;
|
|
953
993
|
};
|
|
954
994
|
var getTestSetUp = function (target) { return __awaiter(void 0, void 0, void 0, function () {
|
|
955
995
|
var projectRoot, localConfig;
|
package/build/utils/file.d.ts
CHANGED
|
@@ -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>
|
|
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[];
|
package/build/utils/file.js
CHANGED
|
@@ -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>
|
|
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>
|
|
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>
|
|
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);";
|
package/build/utils/test.js
CHANGED
|
@@ -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
|
-
|
|
150
|
+
httpsAgentOptions: target.httpsAgentOptions,
|
|
151
151
|
appLoc: target.appLoc,
|
|
152
152
|
serverType: target.serverType
|
|
153
153
|
});
|
package/build/utils/utils.d.ts
CHANGED
|
@@ -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;
|
package/build/utils/utils.js
CHANGED
|
@@ -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
|
-
|
|
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": "
|
|
56
|
+
"@sasjs/adapter": "3.0.0",
|
|
57
57
|
"@sasjs/core": "2.45.2",
|
|
58
58
|
"@sasjs/lint": "1.11.2",
|
|
59
|
-
"@sasjs/utils": "2.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
91
|
+
"babel-jest": "27.2.4",
|
|
92
92
|
"copyfiles": "2.4.1",
|
|
93
93
|
"ghooks": "2.0.4",
|
|
94
|
-
"jest": "27.
|
|
95
|
-
"jest-cli": "27.2.
|
|
96
|
-
"jest-extended": "
|
|
97
|
-
"nodemon": "2.0.
|
|
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": "
|
|
104
|
+
"validate-commit-msg": "1.1.3"
|
|
105
105
|
},
|
|
106
|
-
"version": "
|
|
106
|
+
"version": "3.0.2"
|
|
107
107
|
}
|