@sasjs/cli 2.39.0 → 3.0.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.
- 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.js +11 -11
- package/build/commands/build/internal/config.d.ts +1 -1
- package/build/commands/build/internal/config.js +5 -6
- package/build/commands/compile/compile.js +4 -4
- package/build/commands/compile/compileCommand.js +2 -1
- package/build/commands/compile/compileSingleFile.d.ts +1 -1
- package/build/commands/compile/compileSingleFile.js +6 -7
- package/build/commands/compile/internal/compareFolders.js +1 -2
- package/build/commands/compile/internal/compileJobFile.js +1 -1
- package/build/commands/compile/internal/compileServiceFile.js +1 -1
- package/build/commands/compile/internal/compileTestFile.d.ts +0 -2
- package/build/commands/compile/internal/compileTestFile.js +11 -15
- package/build/commands/compile/internal/getAllJobFolders.js +1 -1
- package/build/commands/compile/internal/getAllServiceFolders.js +1 -1
- package/build/commands/compile/internal/loadDependencies.d.ts +2 -3
- package/build/commands/compile/internal/loadDependencies.js +43 -230
- package/build/commands/compile/internal/spec/compileTestFile.spec.js +24 -12
- package/build/commands/compile/spec/compile.spec.js +30 -0
- package/build/commands/compile/spec/compileJobFile.spec.js +3 -3
- package/build/commands/compile/spec/compileServiceFile.spec.js +3 -3
- package/build/commands/compile/spec/loadDependencies.spec.js +37 -37
- package/build/commands/context/contextCommand.js +5 -5
- package/build/commands/deploy/deploy.js +3 -3
- package/build/commands/docs/generateDocs.js +4 -5
- package/build/commands/docs/internal/getFileInputs.d.ts +1 -1
- package/build/commands/docs/internal/getFileInputs.js +2 -2
- package/build/commands/docs/internal/getFileOutputs.d.ts +1 -1
- package/build/commands/docs/internal/getFileOutputs.js +2 -2
- package/build/commands/docs/internal/getFoldersForDocs.d.ts +1 -1
- package/build/commands/docs/internal/getFoldersForDocs.js +1 -1
- 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/jobCommand.js +1 -1
- package/build/commands/job/spec/job.spec.server.js +2 -2
- package/build/commands/request/request.js +3 -3
- package/build/commands/run/run.js +3 -3
- package/build/commands/servicepack/deploy.js +1 -1
- 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/commands/web/internal/getWebServiceContent.js +1 -2
- package/build/commands/web/web.js +12 -13
- package/build/config.json +3 -1
- package/build/utils/config.d.ts +1 -2
- package/build/utils/config.js +106 -66
- package/build/utils/file.d.ts +0 -6
- package/build/utils/file.js +1 -43
- package/build/utils/setConstants.js +1 -1
- package/build/utils/spec/utils.spec.js +31 -5
- package/build/utils/test.js +1 -1
- package/build/utils/utils.d.ts +0 -2
- package/build/utils/utils.js +2 -17
- package/package.json +5 -5
- package/CHANGELOG.md +0 -30
- package/build/commands/compile/internal/config.d.ts +0 -25
- package/build/commands/compile/internal/config.js +0 -259
- package/build/commands/compile/spec/getDependencyPaths.spec.d.ts +0 -1
- package/build/commands/compile/spec/getDependencyPaths.spec.js +0 -263
- package/build/commands/compile/spec/getProgramDependencies.spec.d.ts +0 -1
- package/build/commands/compile/spec/getProgramDependencies.spec.js +0 -403
- package/build/commands/shared/dependencies.d.ts +0 -12
- package/build/commands/shared/dependencies.js +0 -332
- package/build/utils/spec/utils.spec.server.d.ts +0 -1
- package/build/utils/spec/utils.spec.server.js +0 -72
|
@@ -71,7 +71,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
71
71
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
72
72
|
var path_1 = __importDefault(require("path"));
|
|
73
73
|
var utils_1 = require("@sasjs/utils");
|
|
74
|
-
var internalModule = __importStar(require("
|
|
74
|
+
var internalModule = __importStar(require("@sasjs/utils/sasjsCli/getInitTerm"));
|
|
75
75
|
var test_1 = require("../../../utils/test");
|
|
76
76
|
var loadDependencies_1 = require("../internal/loadDependencies");
|
|
77
77
|
var fakeInit = "/**\n @file serviceinit.sas\n @brief this file is called with every service\n @details This file is included in *every* service, *after* the macros and *before* the service code.\n\n <h4> SAS Macros </h4>\n @li mf_abort.sas\n\n**/\n\noptions\n DATASTMTCHK=ALLKEYWORDS /* some sites have this enabled */\n PS=MAX /* reduce log size slightly */\n;\n%put service is starting!!;";
|
|
@@ -162,19 +162,19 @@ describe('loadDependencies', function () {
|
|
|
162
162
|
return __generator(this, function (_a) {
|
|
163
163
|
switch (_a.label) {
|
|
164
164
|
case 0:
|
|
165
|
-
jest.spyOn(internalModule, '
|
|
165
|
+
jest.spyOn(internalModule, 'getInit').mockImplementation(function () {
|
|
166
166
|
return Promise.resolve({
|
|
167
167
|
content: "\n* ServiceInit start;\n" + fakeInit + "\n* ServiceInit end;",
|
|
168
168
|
filePath: ''
|
|
169
169
|
});
|
|
170
170
|
});
|
|
171
|
-
jest.spyOn(internalModule, '
|
|
171
|
+
jest.spyOn(internalModule, 'getTerm').mockImplementation(function () {
|
|
172
172
|
return Promise.resolve({
|
|
173
173
|
content: "\n* ServiceTerm start;\n" + fakeTerm + "\n* ServiceTerm end;",
|
|
174
174
|
filePath: ''
|
|
175
175
|
});
|
|
176
176
|
});
|
|
177
|
-
return [4 /*yield*/, loadDependencies_1.loadDependencies(target, path_1.default.join(__dirname, './service.sas'), [], [],
|
|
177
|
+
return [4 /*yield*/, loadDependencies_1.loadDependencies(target, path_1.default.join(__dirname, './service.sas'), [], [], utils_1.SASJsFileType.service)];
|
|
178
178
|
case 1:
|
|
179
179
|
dependencies = _a.sent();
|
|
180
180
|
expect(dependencies).toStartWith(compiledVars('Service'));
|
|
@@ -193,19 +193,19 @@ describe('loadDependencies', function () {
|
|
|
193
193
|
return __generator(this, function (_a) {
|
|
194
194
|
switch (_a.label) {
|
|
195
195
|
case 0:
|
|
196
|
-
jest.spyOn(internalModule, '
|
|
196
|
+
jest.spyOn(internalModule, 'getInit').mockImplementation(function () {
|
|
197
197
|
return Promise.resolve({
|
|
198
198
|
content: "\n* JobInit start;\n" + fakeInit + "\n* JobInit end;",
|
|
199
199
|
filePath: ''
|
|
200
200
|
});
|
|
201
201
|
});
|
|
202
|
-
jest.spyOn(internalModule, '
|
|
202
|
+
jest.spyOn(internalModule, 'getTerm').mockImplementation(function () {
|
|
203
203
|
return Promise.resolve({
|
|
204
204
|
content: "\n* JobTerm start;\n" + fakeTerm + "\n* JobTerm end;",
|
|
205
205
|
filePath: ''
|
|
206
206
|
});
|
|
207
207
|
});
|
|
208
|
-
return [4 /*yield*/, loadDependencies_1.loadDependencies(target, path_1.default.join(__dirname, './service.sas'), [], [],
|
|
208
|
+
return [4 /*yield*/, loadDependencies_1.loadDependencies(target, path_1.default.join(__dirname, './service.sas'), [], [], utils_1.SASJsFileType.job)];
|
|
209
209
|
case 1:
|
|
210
210
|
dependencies = _a.sent();
|
|
211
211
|
expect(dependencies).toStartWith(compiledVars('Job'));
|
|
@@ -224,19 +224,19 @@ describe('loadDependencies', function () {
|
|
|
224
224
|
return __generator(this, function (_a) {
|
|
225
225
|
switch (_a.label) {
|
|
226
226
|
case 0:
|
|
227
|
-
jest.spyOn(internalModule, '
|
|
227
|
+
jest.spyOn(internalModule, 'getInit').mockImplementation(function () {
|
|
228
228
|
return Promise.resolve({
|
|
229
229
|
content: "\n* ServiceInit start;\n" + fakeInit2 + "\n* ServiceInit end;",
|
|
230
230
|
filePath: ''
|
|
231
231
|
});
|
|
232
232
|
});
|
|
233
|
-
jest.spyOn(internalModule, '
|
|
233
|
+
jest.spyOn(internalModule, 'getTerm').mockImplementation(function () {
|
|
234
234
|
return Promise.resolve({
|
|
235
235
|
content: "\n* ServiceTerm start;\n" + fakeTerm2 + "\n* ServiceTerm end;",
|
|
236
236
|
filePath: ''
|
|
237
237
|
});
|
|
238
238
|
});
|
|
239
|
-
return [4 /*yield*/, loadDependencies_1.loadDependencies(target, path_1.default.join(__dirname, './service.sas'), [], [],
|
|
239
|
+
return [4 /*yield*/, loadDependencies_1.loadDependencies(target, path_1.default.join(__dirname, './service.sas'), [], [], utils_1.SASJsFileType.service)];
|
|
240
240
|
case 1:
|
|
241
241
|
dependencies = _a.sent();
|
|
242
242
|
expect(dependencies).toStartWith(compiledVars('Service'));
|
|
@@ -255,19 +255,19 @@ describe('loadDependencies', function () {
|
|
|
255
255
|
return __generator(this, function (_a) {
|
|
256
256
|
switch (_a.label) {
|
|
257
257
|
case 0:
|
|
258
|
-
jest.spyOn(internalModule, '
|
|
258
|
+
jest.spyOn(internalModule, 'getInit').mockImplementation(function () {
|
|
259
259
|
return Promise.resolve({
|
|
260
260
|
content: "\n* JobInit start;\n" + fakeInit2 + "\n* JobInit end;",
|
|
261
261
|
filePath: ''
|
|
262
262
|
});
|
|
263
263
|
});
|
|
264
|
-
jest.spyOn(internalModule, '
|
|
264
|
+
jest.spyOn(internalModule, 'getTerm').mockImplementation(function () {
|
|
265
265
|
return Promise.resolve({
|
|
266
266
|
content: "\n* JobTerm start;\n" + fakeTerm2 + "\n* JobTerm end;",
|
|
267
267
|
filePath: ''
|
|
268
268
|
});
|
|
269
269
|
});
|
|
270
|
-
return [4 /*yield*/, loadDependencies_1.loadDependencies(target, path_1.default.join(__dirname, './service.sas'), [], [],
|
|
270
|
+
return [4 /*yield*/, loadDependencies_1.loadDependencies(target, path_1.default.join(__dirname, './service.sas'), [], [], utils_1.SASJsFileType.job)];
|
|
271
271
|
case 1:
|
|
272
272
|
dependencies = _a.sent();
|
|
273
273
|
expect(dependencies).toStartWith(compiledVars('Job'));
|
|
@@ -286,19 +286,19 @@ describe('loadDependencies', function () {
|
|
|
286
286
|
return __generator(this, function (_a) {
|
|
287
287
|
switch (_a.label) {
|
|
288
288
|
case 0:
|
|
289
|
-
jest.spyOn(internalModule, '
|
|
289
|
+
jest.spyOn(internalModule, 'getInit').mockImplementation(function () {
|
|
290
290
|
return Promise.resolve({
|
|
291
291
|
content: "\n* ServiceInit start;\n" + fakeJobInit + "\n* ServiceInit end;",
|
|
292
292
|
filePath: ''
|
|
293
293
|
});
|
|
294
294
|
});
|
|
295
|
-
jest.spyOn(internalModule, '
|
|
295
|
+
jest.spyOn(internalModule, 'getTerm').mockImplementation(function () {
|
|
296
296
|
return Promise.resolve({
|
|
297
297
|
content: "\n* ServiceTerm start;\n" + fakeTerm + "\n* ServiceTerm end;",
|
|
298
298
|
filePath: ''
|
|
299
299
|
});
|
|
300
300
|
});
|
|
301
|
-
return [4 /*yield*/, loadDependencies_1.loadDependencies(target, path_1.default.join(__dirname, './service.sas'), [path_1.default.join(__dirname, './macros')], [path_1.default.join(__dirname, './'), path_1.default.join(__dirname, './services')],
|
|
301
|
+
return [4 /*yield*/, loadDependencies_1.loadDependencies(target, path_1.default.join(__dirname, './service.sas'), [path_1.default.join(__dirname, './macros')], [path_1.default.join(__dirname, './'), path_1.default.join(__dirname, './services')], utils_1.SASJsFileType.service)];
|
|
302
302
|
case 1:
|
|
303
303
|
dependencies = _a.sent();
|
|
304
304
|
expect(dependencies).toStartWith(compiledVars('Service'));
|
|
@@ -317,19 +317,19 @@ describe('loadDependencies', function () {
|
|
|
317
317
|
return __generator(this, function (_a) {
|
|
318
318
|
switch (_a.label) {
|
|
319
319
|
case 0:
|
|
320
|
-
jest.spyOn(internalModule, '
|
|
320
|
+
jest.spyOn(internalModule, 'getInit').mockImplementation(function () {
|
|
321
321
|
return Promise.resolve({
|
|
322
322
|
content: "\n* JobInit start;\n" + fakeJobInit + "\n* JobInit end;",
|
|
323
323
|
filePath: ''
|
|
324
324
|
});
|
|
325
325
|
});
|
|
326
|
-
jest.spyOn(internalModule, '
|
|
326
|
+
jest.spyOn(internalModule, 'getTerm').mockImplementation(function () {
|
|
327
327
|
return Promise.resolve({
|
|
328
328
|
content: "\n* JobTerm start;\n" + fakeTerm + "\n* JobTerm end;",
|
|
329
329
|
filePath: ''
|
|
330
330
|
});
|
|
331
331
|
});
|
|
332
|
-
return [4 /*yield*/, loadDependencies_1.loadDependencies(target, path_1.default.join(__dirname, './service.sas'), [path_1.default.join(__dirname, './macros')], [path_1.default.join(__dirname, './'), path_1.default.join(__dirname, './services')],
|
|
332
|
+
return [4 /*yield*/, loadDependencies_1.loadDependencies(target, path_1.default.join(__dirname, './service.sas'), [path_1.default.join(__dirname, './macros')], [path_1.default.join(__dirname, './'), path_1.default.join(__dirname, './services')], utils_1.SASJsFileType.job)];
|
|
333
333
|
case 1:
|
|
334
334
|
dependencies = _a.sent();
|
|
335
335
|
expect(dependencies).toStartWith(compiledVars('Job'));
|
|
@@ -348,19 +348,19 @@ describe('loadDependencies', function () {
|
|
|
348
348
|
return __generator(this, function (_a) {
|
|
349
349
|
switch (_a.label) {
|
|
350
350
|
case 0:
|
|
351
|
-
jest.spyOn(internalModule, '
|
|
351
|
+
jest.spyOn(internalModule, 'getInit').mockImplementation(function () {
|
|
352
352
|
return Promise.resolve({
|
|
353
353
|
content: "\n* ServiceInit start;\n" + fakeJobInit2 + "\n* ServiceInit end;",
|
|
354
354
|
filePath: ''
|
|
355
355
|
});
|
|
356
356
|
});
|
|
357
|
-
jest.spyOn(internalModule, '
|
|
357
|
+
jest.spyOn(internalModule, 'getTerm').mockImplementation(function () {
|
|
358
358
|
return Promise.resolve({
|
|
359
359
|
content: "\n* ServiceTerm start;\n" + fakeTerm2 + "\n* ServiceTerm end;",
|
|
360
360
|
filePath: ''
|
|
361
361
|
});
|
|
362
362
|
});
|
|
363
|
-
return [4 /*yield*/, loadDependencies_1.loadDependencies(target, path_1.default.join(__dirname, './service.sas'), [path_1.default.join(__dirname, './macros')], [path_1.default.join(__dirname, './'), path_1.default.join(__dirname, './services')],
|
|
363
|
+
return [4 /*yield*/, loadDependencies_1.loadDependencies(target, path_1.default.join(__dirname, './service.sas'), [path_1.default.join(__dirname, './macros')], [path_1.default.join(__dirname, './'), path_1.default.join(__dirname, './services')], utils_1.SASJsFileType.service)];
|
|
364
364
|
case 1:
|
|
365
365
|
dependencies = _a.sent();
|
|
366
366
|
expect(dependencies).toStartWith(compiledVars('Service'));
|
|
@@ -379,19 +379,19 @@ describe('loadDependencies', function () {
|
|
|
379
379
|
return __generator(this, function (_a) {
|
|
380
380
|
switch (_a.label) {
|
|
381
381
|
case 0:
|
|
382
|
-
jest.spyOn(internalModule, '
|
|
382
|
+
jest.spyOn(internalModule, 'getInit').mockImplementation(function () {
|
|
383
383
|
return Promise.resolve({
|
|
384
384
|
content: "\n* JobInit start;\n" + fakeJobInit2 + "\n* JobInit end;",
|
|
385
385
|
filePath: ''
|
|
386
386
|
});
|
|
387
387
|
});
|
|
388
|
-
jest.spyOn(internalModule, '
|
|
388
|
+
jest.spyOn(internalModule, 'getTerm').mockImplementation(function () {
|
|
389
389
|
return Promise.resolve({
|
|
390
390
|
content: "\n* JobTerm start;\n" + fakeTerm2 + "\n* JobTerm end;",
|
|
391
391
|
filePath: ''
|
|
392
392
|
});
|
|
393
393
|
});
|
|
394
|
-
return [4 /*yield*/, loadDependencies_1.loadDependencies(target, path_1.default.join(__dirname, './service.sas'), [path_1.default.join(__dirname, './macros')], [path_1.default.join(__dirname, './'), path_1.default.join(__dirname, './services')],
|
|
394
|
+
return [4 /*yield*/, loadDependencies_1.loadDependencies(target, path_1.default.join(__dirname, './service.sas'), [path_1.default.join(__dirname, './macros')], [path_1.default.join(__dirname, './'), path_1.default.join(__dirname, './services')], utils_1.SASJsFileType.job)];
|
|
395
395
|
case 1:
|
|
396
396
|
dependencies = _a.sent();
|
|
397
397
|
expect(dependencies).toStartWith(compiledVars('Job'));
|
|
@@ -410,19 +410,19 @@ describe('loadDependencies', function () {
|
|
|
410
410
|
return __generator(this, function (_a) {
|
|
411
411
|
switch (_a.label) {
|
|
412
412
|
case 0:
|
|
413
|
-
jest.spyOn(internalModule, '
|
|
413
|
+
jest.spyOn(internalModule, 'getInit').mockImplementation(function () {
|
|
414
414
|
return Promise.resolve({
|
|
415
415
|
content: "\n* JobInit start;\n" + fakeJobInit + "\n* JobInit end;",
|
|
416
416
|
filePath: ''
|
|
417
417
|
});
|
|
418
418
|
});
|
|
419
|
-
jest.spyOn(internalModule, '
|
|
419
|
+
jest.spyOn(internalModule, 'getTerm').mockImplementation(function () {
|
|
420
420
|
return Promise.resolve({
|
|
421
421
|
content: "\n* JobTerm start;\n" + fakeTerm2 + "\n* JobTerm end;",
|
|
422
422
|
filePath: ''
|
|
423
423
|
});
|
|
424
424
|
});
|
|
425
|
-
return [4 /*yield*/, loadDependencies_1.loadDependencies(target, path_1.default.join(__dirname, './service.sas'), [path_1.default.join(__dirname, './macros')], [path_1.default.join(__dirname, './'), path_1.default.join(__dirname, './services')],
|
|
425
|
+
return [4 /*yield*/, loadDependencies_1.loadDependencies(target, path_1.default.join(__dirname, './service.sas'), [path_1.default.join(__dirname, './macros')], [path_1.default.join(__dirname, './'), path_1.default.join(__dirname, './services')], utils_1.SASJsFileType.job)];
|
|
426
426
|
case 1:
|
|
427
427
|
dependencies = _a.sent();
|
|
428
428
|
expect(dependencies).toStartWith(compiledVars('Job'));
|
|
@@ -444,19 +444,19 @@ describe('loadDependencies', function () {
|
|
|
444
444
|
return __generator(this, function (_a) {
|
|
445
445
|
switch (_a.label) {
|
|
446
446
|
case 0:
|
|
447
|
-
jest.spyOn(internalModule, '
|
|
447
|
+
jest.spyOn(internalModule, 'getInit').mockImplementation(function () {
|
|
448
448
|
return Promise.resolve({
|
|
449
449
|
content: "\n* JobInit start;\n" + fakeInit2 + "\n* JobInit end;",
|
|
450
450
|
filePath: ''
|
|
451
451
|
});
|
|
452
452
|
});
|
|
453
|
-
jest.spyOn(internalModule, '
|
|
453
|
+
jest.spyOn(internalModule, 'getTerm').mockImplementation(function () {
|
|
454
454
|
return Promise.resolve({
|
|
455
455
|
content: "\n* JobTerm start;\n" + fakeJobInit + "\n* JobTerm end;",
|
|
456
456
|
filePath: ''
|
|
457
457
|
});
|
|
458
458
|
});
|
|
459
|
-
return [4 /*yield*/, loadDependencies_1.loadDependencies(target, path_1.default.join(__dirname, './service.sas'), [path_1.default.join(__dirname, './macros')], [path_1.default.join(__dirname, './'), path_1.default.join(__dirname, './services')],
|
|
459
|
+
return [4 /*yield*/, loadDependencies_1.loadDependencies(target, path_1.default.join(__dirname, './service.sas'), [path_1.default.join(__dirname, './macros')], [path_1.default.join(__dirname, './'), path_1.default.join(__dirname, './services')], utils_1.SASJsFileType.job)];
|
|
460
460
|
case 1:
|
|
461
461
|
dependencies = _a.sent();
|
|
462
462
|
expect(dependencies).toStartWith(compiledVars('Job'));
|
|
@@ -477,19 +477,19 @@ describe('loadDependencies', function () {
|
|
|
477
477
|
return __generator(this, function (_a) {
|
|
478
478
|
switch (_a.label) {
|
|
479
479
|
case 0:
|
|
480
|
-
jest.spyOn(internalModule, '
|
|
480
|
+
jest.spyOn(internalModule, 'getInit').mockImplementation(function () {
|
|
481
481
|
return Promise.resolve({
|
|
482
482
|
content: "\n* ServiceInit start;\n" + fakeJobInit + "\n* ServiceInit end;",
|
|
483
483
|
filePath: ''
|
|
484
484
|
});
|
|
485
485
|
});
|
|
486
|
-
jest.spyOn(internalModule, '
|
|
486
|
+
jest.spyOn(internalModule, 'getTerm').mockImplementation(function () {
|
|
487
487
|
return Promise.resolve({
|
|
488
488
|
content: "\n* ServiceTerm start;\n" + fakeTerm2 + "\n* ServiceTerm end;",
|
|
489
489
|
filePath: ''
|
|
490
490
|
});
|
|
491
491
|
});
|
|
492
|
-
return [4 /*yield*/, loadDependencies_1.loadDependencies(target, path_1.default.join(__dirname, './service.sas'), [path_1.default.join(__dirname, './macros')], [path_1.default.join(__dirname, './'), path_1.default.join(__dirname, './services')],
|
|
492
|
+
return [4 /*yield*/, loadDependencies_1.loadDependencies(target, path_1.default.join(__dirname, './service.sas'), [path_1.default.join(__dirname, './macros')], [path_1.default.join(__dirname, './'), path_1.default.join(__dirname, './services')], utils_1.SASJsFileType.service)];
|
|
493
493
|
case 1:
|
|
494
494
|
dependencies = _a.sent();
|
|
495
495
|
expect(dependencies).toStartWith(compiledVars('Service'));
|
|
@@ -511,19 +511,19 @@ describe('loadDependencies', function () {
|
|
|
511
511
|
return __generator(this, function (_a) {
|
|
512
512
|
switch (_a.label) {
|
|
513
513
|
case 0:
|
|
514
|
-
jest.spyOn(internalModule, '
|
|
514
|
+
jest.spyOn(internalModule, 'getInit').mockImplementation(function () {
|
|
515
515
|
return Promise.resolve({
|
|
516
516
|
content: "\n* ServiceInit start;\n" + fakeInit2 + "\n* ServiceInit end;",
|
|
517
517
|
filePath: ''
|
|
518
518
|
});
|
|
519
519
|
});
|
|
520
|
-
jest.spyOn(internalModule, '
|
|
520
|
+
jest.spyOn(internalModule, 'getTerm').mockImplementation(function () {
|
|
521
521
|
return Promise.resolve({
|
|
522
522
|
content: "\n* ServiceTerm start;\n" + fakeJobInit + "\n* ServiceTerm end;",
|
|
523
523
|
filePath: ''
|
|
524
524
|
});
|
|
525
525
|
});
|
|
526
|
-
return [4 /*yield*/, loadDependencies_1.loadDependencies(target, path_1.default.join(__dirname, './service.sas'), [path_1.default.join(__dirname, './macros')], [path_1.default.join(__dirname, './'), path_1.default.join(__dirname, './services')],
|
|
526
|
+
return [4 /*yield*/, loadDependencies_1.loadDependencies(target, path_1.default.join(__dirname, './service.sas'), [path_1.default.join(__dirname, './macros')], [path_1.default.join(__dirname, './'), path_1.default.join(__dirname, './services')], utils_1.SASJsFileType.service)];
|
|
527
527
|
case 1:
|
|
528
528
|
dependencies = _a.sent();
|
|
529
529
|
expect(dependencies).toStartWith(compiledVars('Service'));
|
|
@@ -221,7 +221,7 @@ var ContextCommand = /** @class */ (function (_super) {
|
|
|
221
221
|
target = (_a.sent()).target;
|
|
222
222
|
sasjs = new node_1.default({
|
|
223
223
|
serverUrl: target.serverUrl,
|
|
224
|
-
|
|
224
|
+
httpsAgentOptions: target.httpsAgentOptions,
|
|
225
225
|
appLoc: target.appLoc,
|
|
226
226
|
serverType: target.serverType
|
|
227
227
|
});
|
|
@@ -269,7 +269,7 @@ var ContextCommand = /** @class */ (function (_super) {
|
|
|
269
269
|
target = (_a.sent()).target;
|
|
270
270
|
sasjs = new node_1.default({
|
|
271
271
|
serverUrl: target.serverUrl,
|
|
272
|
-
|
|
272
|
+
httpsAgentOptions: target.httpsAgentOptions,
|
|
273
273
|
appLoc: target.appLoc,
|
|
274
274
|
serverType: target.serverType
|
|
275
275
|
});
|
|
@@ -308,7 +308,7 @@ var ContextCommand = /** @class */ (function (_super) {
|
|
|
308
308
|
target = (_a.sent()).target;
|
|
309
309
|
sasjs = new node_1.default({
|
|
310
310
|
serverUrl: target.serverUrl,
|
|
311
|
-
|
|
311
|
+
httpsAgentOptions: target.httpsAgentOptions,
|
|
312
312
|
appLoc: target.appLoc,
|
|
313
313
|
serverType: target.serverType
|
|
314
314
|
});
|
|
@@ -356,7 +356,7 @@ var ContextCommand = /** @class */ (function (_super) {
|
|
|
356
356
|
target = (_a.sent()).target;
|
|
357
357
|
sasjs = new node_1.default({
|
|
358
358
|
serverUrl: target.serverUrl,
|
|
359
|
-
|
|
359
|
+
httpsAgentOptions: target.httpsAgentOptions,
|
|
360
360
|
appLoc: target.appLoc,
|
|
361
361
|
serverType: target.serverType
|
|
362
362
|
});
|
|
@@ -399,7 +399,7 @@ var ContextCommand = /** @class */ (function (_super) {
|
|
|
399
399
|
}
|
|
400
400
|
sasjs = new node_1.default({
|
|
401
401
|
serverUrl: target.serverUrl,
|
|
402
|
-
|
|
402
|
+
httpsAgentOptions: target.httpsAgentOptions,
|
|
403
403
|
appLoc: target.appLoc,
|
|
404
404
|
serverType: target.serverType
|
|
405
405
|
});
|
|
@@ -93,7 +93,7 @@ function deploy(target, isLocal, sasjs) {
|
|
|
93
93
|
return __generator(this, function (_d) {
|
|
94
94
|
switch (_d.label) {
|
|
95
95
|
case 0:
|
|
96
|
-
deployScriptPath =
|
|
96
|
+
deployScriptPath = utils_2.getAbsolutePath(deployScript, process.projectDir);
|
|
97
97
|
if (!file_1.isSasFile(deployScript)) return [3 /*break*/, 7];
|
|
98
98
|
(_a = process.logger) === null || _a === void 0 ? void 0 : _a.info("Processing SAS file " + path_1.default.basename(deployScript) + " ...");
|
|
99
99
|
return [4 /*yield*/, utils_2.readFile(deployScriptPath)
|
|
@@ -149,7 +149,7 @@ function getSASjsAndAuthConfig(target, isLocal) {
|
|
|
149
149
|
serverUrl: target.serverUrl,
|
|
150
150
|
appLoc: target.appLoc,
|
|
151
151
|
serverType: target.serverType,
|
|
152
|
-
|
|
152
|
+
httpsAgentOptions: target.httpsAgentOptions,
|
|
153
153
|
debug: true,
|
|
154
154
|
useComputeApi: true
|
|
155
155
|
});
|
|
@@ -241,7 +241,7 @@ function deployToSas9(deployScript, target, linesToExecute, logFilePath, streamC
|
|
|
241
241
|
password = utils_2.decodeFromBase64(password);
|
|
242
242
|
sasjs = new node_1.default({
|
|
243
243
|
serverUrl: target.serverUrl,
|
|
244
|
-
|
|
244
|
+
httpsAgentOptions: target.httpsAgentOptions,
|
|
245
245
|
appLoc: target.appLoc,
|
|
246
246
|
serverType: target.serverType
|
|
247
247
|
});
|
|
@@ -80,7 +80,6 @@ var utils_1 = require("@sasjs/utils");
|
|
|
80
80
|
var getFoldersForDocs_1 = require("./internal/getFoldersForDocs");
|
|
81
81
|
var createDotFiles_1 = require("./internal/createDotFiles");
|
|
82
82
|
var getDocConfig_1 = require("./internal/getDocConfig");
|
|
83
|
-
var logger_1 = require("@sasjs/utils/logger");
|
|
84
83
|
var utils_2 = require("../../utils");
|
|
85
84
|
/**
|
|
86
85
|
* Generates documentation(Doxygen)
|
|
@@ -129,7 +128,7 @@ function generateDocs(target, config, outDirectory) {
|
|
|
129
128
|
case 4:
|
|
130
129
|
doxyContent = __assign({ favIcon: 'favicon.ico', footer: 'new_footer.html', header: 'new_header.html', layout: 'DoxygenLayout.xml', logo: 'logo.png', readMe: '../../README.md', stylesheet: 'new_stylesheet.css', path: path_1.default.join(process.projectDir, 'sasjs', 'doxy') }, doxyContentFromConfig);
|
|
131
130
|
if (doxyContentFromConfig === null || doxyContentFromConfig === void 0 ? void 0 : doxyContentFromConfig.path)
|
|
132
|
-
doxyContent.path =
|
|
131
|
+
doxyContent.path = utils_1.getAbsolutePath(doxyContentFromConfig.path, process.projectDir);
|
|
133
132
|
doxyParams = setVariableCmd({
|
|
134
133
|
DOXY_HTML_OUTPUT: newOutDirectory,
|
|
135
134
|
DOXY_INPUT: "\"" + path_1.default.join(doxyContent.path, doxyContent.readMe) + "\" " + combinedFolders,
|
|
@@ -147,7 +146,7 @@ function generateDocs(target, config, outDirectory) {
|
|
|
147
146
|
doxyConfigPath = _f.sent();
|
|
148
147
|
(_b = process.logger) === null || _b === void 0 ? void 0 : _b.info("Using " + doxyConfigPath + " as Doxygen Configuration.");
|
|
149
148
|
spinner = ora_1.default(chalk_1.default.greenBright('Generating docs', chalk_1.default.cyanBright(newOutDirectory)));
|
|
150
|
-
if (process.env.LOG_LEVEL !==
|
|
149
|
+
if (process.env.LOG_LEVEL !== utils_1.LogLevel.Debug)
|
|
151
150
|
spinner.start();
|
|
152
151
|
return [4 /*yield*/, utils_1.fileExists(newOutDirectory)];
|
|
153
152
|
case 6:
|
|
@@ -161,9 +160,9 @@ function generateDocs(target, config, outDirectory) {
|
|
|
161
160
|
case 9:
|
|
162
161
|
_f.sent();
|
|
163
162
|
_e = shelljs_1.default.exec(doxyParams + " doxygen \"" + doxyConfigPath + "\"", {
|
|
164
|
-
silent: process.env.LOG_LEVEL !==
|
|
163
|
+
silent: process.env.LOG_LEVEL !== utils_1.LogLevel.Debug
|
|
165
164
|
}), stderr = _e.stderr, code = _e.code;
|
|
166
|
-
if (process.env.LOG_LEVEL !==
|
|
165
|
+
if (process.env.LOG_LEVEL !== utils_1.LogLevel.Debug)
|
|
167
166
|
spinner.stop();
|
|
168
167
|
if (code !== 0) {
|
|
169
168
|
if (stderr.startsWith('error: ')) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getFileInputs = void 0;
|
|
4
|
-
var
|
|
4
|
+
var utils_1 = require("@sasjs/utils");
|
|
5
5
|
/**
|
|
6
6
|
* Returns list of Inputs and populates Map of Nodes
|
|
7
7
|
* @param {string} fileName- Name of the file from which Inputs need to extract
|
|
@@ -9,7 +9,7 @@ var file_1 = require("../../../utils/file");
|
|
|
9
9
|
* @param {Map} paramNodes- Map for params(Inputs/Outputs)
|
|
10
10
|
*/
|
|
11
11
|
function getFileInputs(fileName, fileContent, paramNodes) {
|
|
12
|
-
var fileInputs =
|
|
12
|
+
var fileInputs = utils_1.getList('<h4> Data Inputs </h4>', fileContent)
|
|
13
13
|
.map(function (input) { return input.toUpperCase(); })
|
|
14
14
|
.filter(function (input) { return !input.endsWith('.DLL'); });
|
|
15
15
|
fileInputs.forEach(function (inputParam) {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getFileOutputs = void 0;
|
|
4
|
-
var
|
|
4
|
+
var utils_1 = require("@sasjs/utils");
|
|
5
5
|
/**
|
|
6
6
|
* Returns list of Outputs and populates Map of Nodes
|
|
7
7
|
* @param {string} fileContent- Contents of the file from which Outputs need to extract
|
|
8
8
|
* @param {Map} paramNodes- Map for params(Inputs/Outputs)
|
|
9
9
|
*/
|
|
10
10
|
function getFileOutputs(fileContent, paramNodes) {
|
|
11
|
-
var fileOutputs =
|
|
11
|
+
var fileOutputs = utils_1.getList('<h4> Data Outputs </h4>', fileContent)
|
|
12
12
|
.map(function (output) { return output.toUpperCase(); })
|
|
13
13
|
.filter(function (output) { return !output.endsWith('.DLL'); });
|
|
14
14
|
fileOutputs.forEach(function (outputParam) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getFoldersForDocs = void 0;
|
|
4
|
-
var utils_1 = require("
|
|
4
|
+
var utils_1 = require("@sasjs/utils");
|
|
5
5
|
/**
|
|
6
6
|
* Returns list of folders for documentation( macroCore / macros / SAS programs/ services / jobs )
|
|
7
7
|
* @param {Target} target- target for docs.
|
|
@@ -125,7 +125,7 @@ var FlowCommand = /** @class */ (function (_super) {
|
|
|
125
125
|
target = (_b.sent()).target;
|
|
126
126
|
sasjs = new node_1.default({
|
|
127
127
|
serverUrl: target.serverUrl,
|
|
128
|
-
|
|
128
|
+
httpsAgentOptions: target.httpsAgentOptions,
|
|
129
129
|
appLoc: target.appLoc,
|
|
130
130
|
serverType: target.serverType
|
|
131
131
|
});
|
|
@@ -54,7 +54,7 @@ describe('sasjs flow', function () {
|
|
|
54
54
|
var target = generateTarget();
|
|
55
55
|
var sasjs = new node_1.default({
|
|
56
56
|
serverUrl: target.serverUrl,
|
|
57
|
-
|
|
57
|
+
httpsAgentOptions: target.httpsAgentOptions,
|
|
58
58
|
appLoc: target.appLoc,
|
|
59
59
|
serverType: target.serverType
|
|
60
60
|
});
|
|
@@ -132,7 +132,7 @@ var FolderCommand = /** @class */ (function (_super) {
|
|
|
132
132
|
}
|
|
133
133
|
sasjs = new node_1.default({
|
|
134
134
|
serverUrl: target.serverUrl,
|
|
135
|
-
|
|
135
|
+
httpsAgentOptions: target.httpsAgentOptions,
|
|
136
136
|
appLoc: target.appLoc,
|
|
137
137
|
serverType: target.serverType
|
|
138
138
|
});
|
|
@@ -259,7 +259,7 @@ var FolderCommand = /** @class */ (function (_super) {
|
|
|
259
259
|
}
|
|
260
260
|
sasjs = new node_1.default({
|
|
261
261
|
serverUrl: target.serverUrl,
|
|
262
|
-
|
|
262
|
+
httpsAgentOptions: target.httpsAgentOptions,
|
|
263
263
|
appLoc: target.appLoc,
|
|
264
264
|
serverType: target.serverType
|
|
265
265
|
});
|
|
@@ -52,7 +52,7 @@ describe('sasjs folder operations', function () {
|
|
|
52
52
|
var target = generateTarget();
|
|
53
53
|
var sasjs = new node_1.default({
|
|
54
54
|
serverUrl: target.serverUrl,
|
|
55
|
-
|
|
55
|
+
httpsAgentOptions: target.httpsAgentOptions,
|
|
56
56
|
appLoc: target.appLoc,
|
|
57
57
|
serverType: target.serverType
|
|
58
58
|
});
|
|
@@ -152,7 +152,7 @@ var JobCommand = /** @class */ (function (_super) {
|
|
|
152
152
|
case 2:
|
|
153
153
|
sasjs = new node_1.default({
|
|
154
154
|
serverUrl: target.serverUrl,
|
|
155
|
-
|
|
155
|
+
httpsAgentOptions: target.httpsAgentOptions,
|
|
156
156
|
appLoc: target.appLoc,
|
|
157
157
|
serverType: target.serverType,
|
|
158
158
|
debug: true
|
|
@@ -92,7 +92,7 @@ describe('sasjs job execute', function () {
|
|
|
92
92
|
_a.sent();
|
|
93
93
|
sasjs = new node_1.default({
|
|
94
94
|
serverUrl: target.serverUrl,
|
|
95
|
-
|
|
95
|
+
httpsAgentOptions: target.httpsAgentOptions,
|
|
96
96
|
appLoc: target.appLoc,
|
|
97
97
|
serverType: target.serverType,
|
|
98
98
|
debug: true
|
|
@@ -530,7 +530,7 @@ describe('sasjs job execute', function () {
|
|
|
530
530
|
case 0:
|
|
531
531
|
adapter = new node_1.default({
|
|
532
532
|
serverUrl: target.serverUrl,
|
|
533
|
-
|
|
533
|
+
httpsAgentOptions: target.httpsAgentOptions,
|
|
534
534
|
appLoc: target.appLoc,
|
|
535
535
|
serverType: target.serverType
|
|
536
536
|
});
|
|
@@ -59,7 +59,7 @@ function runSasJob(target, isLocal, sasJobLocation, dataFilePath, configFilePath
|
|
|
59
59
|
if (dataFilePath.split('.').slice(-1)[0] !== 'json') {
|
|
60
60
|
throw new Error('Provided data file must be valid json.');
|
|
61
61
|
}
|
|
62
|
-
return [4 /*yield*/, utils_1.readFile(
|
|
62
|
+
return [4 /*yield*/, utils_1.readFile(utils_1.getAbsolutePath(dataFilePath, process.projectDir))];
|
|
63
63
|
case 1:
|
|
64
64
|
dataFile = _a.sent();
|
|
65
65
|
try {
|
|
@@ -74,7 +74,7 @@ function runSasJob(target, isLocal, sasJobLocation, dataFilePath, configFilePath
|
|
|
74
74
|
if (configFilePath.split('.').slice(-1)[0] !== 'json') {
|
|
75
75
|
throw new Error('Provided config file must be valid json.');
|
|
76
76
|
}
|
|
77
|
-
return [4 /*yield*/, utils_1.readFile(
|
|
77
|
+
return [4 /*yield*/, utils_1.readFile(utils_1.getAbsolutePath(configFilePath, process.projectDir))];
|
|
78
78
|
case 3:
|
|
79
79
|
configFile = _a.sent();
|
|
80
80
|
try {
|
|
@@ -102,7 +102,7 @@ function runSasJob(target, isLocal, sasJobLocation, dataFilePath, configFilePath
|
|
|
102
102
|
}
|
|
103
103
|
sasjs = new node_1.default({
|
|
104
104
|
serverUrl: target.serverUrl,
|
|
105
|
-
|
|
105
|
+
httpsAgentOptions: target.httpsAgentOptions,
|
|
106
106
|
appLoc: target.appLoc,
|
|
107
107
|
serverType: target.serverType,
|
|
108
108
|
contextName: target.contextName,
|
|
@@ -113,7 +113,7 @@ function runSasCode(target, filePath, compile) {
|
|
|
113
113
|
(_a = process.logger) === null || _a === void 0 ? void 0 : _a.success("File Compiled and placed at: " + filePath + " .");
|
|
114
114
|
_b.label = 4;
|
|
115
115
|
case 4:
|
|
116
|
-
sasFilePath =
|
|
116
|
+
sasFilePath = utils_1.getAbsolutePath(filePath, process.currentDir);
|
|
117
117
|
return [4 /*yield*/, utils_1.readFile(sasFilePath)];
|
|
118
118
|
case 5:
|
|
119
119
|
sasFileContent = _b.sent();
|
|
@@ -139,7 +139,7 @@ function executeOnSasViya(filePath, isTempFile, target, linesToExecute) {
|
|
|
139
139
|
(_a = process.logger) === null || _a === void 0 ? void 0 : _a.info("Sending " + path_1.default.basename(filePath) + " to SAS server for execution.");
|
|
140
140
|
sasjs = new node_1.default({
|
|
141
141
|
serverUrl: target.serverUrl,
|
|
142
|
-
|
|
142
|
+
httpsAgentOptions: target.httpsAgentOptions,
|
|
143
143
|
appLoc: target.appLoc,
|
|
144
144
|
serverType: target.serverType,
|
|
145
145
|
debug: true,
|
|
@@ -225,7 +225,7 @@ function executeOnSas9(filePath, isTempFile, target, linesToExecute) {
|
|
|
225
225
|
password = utils_1.decodeFromBase64(password);
|
|
226
226
|
sasjs = new node_1.default({
|
|
227
227
|
serverUrl: target.serverUrl,
|
|
228
|
-
|
|
228
|
+
httpsAgentOptions: target.httpsAgentOptions,
|
|
229
229
|
appLoc: target.appLoc,
|
|
230
230
|
serverType: target.serverType,
|
|
231
231
|
debug: true
|
|
@@ -42,7 +42,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
42
42
|
exports.servicePackDeploy = void 0;
|
|
43
43
|
var path_1 = __importDefault(require("path"));
|
|
44
44
|
var displayResult_1 = require("../../utils/displayResult");
|
|
45
|
-
var utils_1 = require("
|
|
45
|
+
var utils_1 = require("@sasjs/utils");
|
|
46
46
|
var deployToSasViyaWithServicePack_1 = require("../shared/deployToSasViyaWithServicePack");
|
|
47
47
|
function servicePackDeploy(target, isLocal, jsonFilePath, isForced) {
|
|
48
48
|
var _a;
|
|
@@ -61,7 +61,6 @@ describe('sasjs servicepack', function () {
|
|
|
61
61
|
name: targetName,
|
|
62
62
|
serverType: utils_1.ServerType.SasViya,
|
|
63
63
|
serverUrl: process.env.VIYA_SERVER_URL,
|
|
64
|
-
allowInsecureRequests: false,
|
|
65
64
|
appLoc: "/Public/app/cli-tests/" + targetName,
|
|
66
65
|
contextName: utils_2.contextName,
|
|
67
66
|
authConfig: {
|