@sasjs/cli 3.16.2 → 3.18.0

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 (39) hide show
  1. package/build/commands/build/build.js +42 -40
  2. package/build/commands/build/spec/build.spec.js +51 -0
  3. package/build/commands/build/spec/{cb.spec.server.d.ts → cb.spec.server.viya.d.ts} +0 -0
  4. package/build/commands/build/spec/{cb.spec.server.js → cb.spec.server.viya.js} +1 -1
  5. package/build/commands/compile/internal/compileFile.js +6 -3
  6. package/build/commands/compile/internal/loadDependencies.js +29 -21
  7. package/build/commands/deploy/spec/cbd.spec.js +24 -19
  8. package/build/commands/deploy/spec/{cbd.spec.server.d.ts → cbd.spec.server.viya.d.ts} +0 -0
  9. package/build/commands/deploy/spec/cbd.spec.server.viya.js +334 -0
  10. package/build/commands/flow/spec/{flow.spec.server.d.ts → flow.spec.server.viya.d.ts} +0 -0
  11. package/build/commands/flow/spec/{flow.spec.server.js → flow.spec.server.viya.js} +39 -55
  12. package/build/commands/folder/spec/{folder.spec.server.d.ts → folder.spec.server.viya.d.ts} +0 -0
  13. package/build/commands/folder/spec/{folder.spec.server.js → folder.spec.server.viya.js} +17 -23
  14. package/build/commands/init/init.js +7 -10
  15. package/build/commands/init/spec/{init.spec.server.d.ts → init.spec.d.ts} +0 -0
  16. package/build/commands/init/spec/{init.spec.server.js → init.spec.js} +0 -0
  17. package/build/commands/job/spec/{job.spec.server.d.ts → job.spec.server.viya.d.ts} +0 -0
  18. package/build/commands/job/spec/{job.spec.server.js → job.spec.server.viya.js} +45 -56
  19. package/build/commands/request/request.js +3 -2
  20. package/build/commands/request/spec/{request.spec.server.d.ts → request.spec.server.sas9.d.ts} +0 -0
  21. package/build/commands/request/spec/request.spec.server.sas9.js +283 -0
  22. package/build/commands/{run/spec/run.spec.server.d.ts → request/spec/request.spec.server.viya.d.ts} +0 -0
  23. package/build/commands/request/spec/request.spec.server.viya.js +460 -0
  24. package/build/commands/request/spec/utils.d.ts +23 -0
  25. package/build/commands/request/spec/utils.js +87 -0
  26. package/build/commands/{servicepack/spec/servicepack.spec.server.d.ts → run/spec/run.spec.server.sas9.d.ts} +0 -0
  27. package/build/commands/run/spec/run.spec.server.sas9.js +115 -0
  28. package/build/commands/run/spec/run.spec.server.viya.d.ts +1 -0
  29. package/build/commands/run/spec/{run.spec.server.js → run.spec.server.viya.js} +32 -101
  30. package/build/commands/servicepack/spec/servicepack.spec.server.viya.d.ts +1 -0
  31. package/build/commands/servicepack/spec/{servicepack.spec.server.js → servicepack.spec.server.viya.js} +1 -1
  32. package/build/utils/test.js +4 -2
  33. package/build/utils/utils.d.ts +0 -7
  34. package/build/utils/utils.js +92 -114
  35. package/package.json +6 -5
  36. package/build/commands/deploy/spec/cbd.spec.server.js +0 -331
  37. package/build/commands/request/spec/request.spec.server.js +0 -709
  38. package/build/utils/spec/removeComments.spec.d.ts +0 -1
  39. package/build/utils/spec/removeComments.spec.js +0 -47
@@ -1 +0,0 @@
1
- export declare const sampleSasProgram: string;
@@ -1,47 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.sampleSasProgram = void 0;
4
- var utils_1 = require("../utils");
5
- var utils_2 = require("@sasjs/utils");
6
- describe('removeComments', function () {
7
- test('should remove block comment', function () {
8
- var text = "/* test\n123\n456\n789 */";
9
- expect((0, utils_1.removeComments)(text)).toEqual('');
10
- });
11
- test('should not remove single line block comment', function () {
12
- var text = "/* test */";
13
- expect((0, utils_1.removeComments)(text)).toEqual(text);
14
- });
15
- test('should remove all comments from the provided SAS file', function () {
16
- var expected = "%macro mv_createfolder(path=\n ,access_token_var=ACCESS_TOKEN\n ,grant_type=authorization_code\n);";
17
- expect((0, utils_1.removeComments)(exports.sampleSasProgram)).toEqual(expected);
18
- });
19
- test('should keep inline comments intact when they start a line', function () {
20
- var text = '/* Some Comment */ CODE HERE;';
21
- expect((0, utils_1.removeComments)(text)).toEqual(text);
22
- });
23
- test('should keep inline comments intact when they are within a line', function () {
24
- var text = 'CODE HERE /* Some Comment */';
25
- expect((0, utils_1.removeComments)(text)).toEqual(text);
26
- });
27
- test('should handle CRLF line endings', function () {
28
- var text = 'CODE HERE\r\n\r\nMORE CODE';
29
- var expectedText = 'CODE HERE\nMORE CODE';
30
- expect((0, utils_1.removeComments)(text)).toEqual(expectedText);
31
- });
32
- test('should handle a mix of CRLF and LF line endings', function () {
33
- var text = 'CODE HERE\r\n\r\nMORE CODE\nEVEN MORE CODE';
34
- var expectedText = 'CODE HERE\nMORE CODE\nEVEN MORE CODE';
35
- expect((0, utils_1.removeComments)(text)).toEqual(expectedText);
36
- });
37
- test('should return an empty string when the input is falsy', function () {
38
- expect((0, utils_1.removeComments)(null)).toEqual('');
39
- expect((0, utils_1.removeComments)(undefined)).toEqual('');
40
- expect((0, utils_1.removeComments)('')).toEqual('');
41
- });
42
- test('should preserve formatting when removing comments', function () {
43
- var text = "if (this === 'code') {\n console.log('Pigs can fly.')\n }";
44
- expect((0, utils_1.removeComments)(text)).toEqual(text);
45
- });
46
- });
47
- 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 ".concat(utils_2.DependencyHeader.Macro, "\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);");