@sasjs/cli 3.21.1 → 3.21.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.
@@ -14,6 +14,17 @@ var __extends = (this && this.__extends) || (function () {
14
14
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
15
  };
16
16
  })();
17
+ var __assign = (this && this.__assign) || function () {
18
+ __assign = Object.assign || function(t) {
19
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
20
+ s = arguments[i];
21
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
22
+ t[p] = s[p];
23
+ }
24
+ return t;
25
+ };
26
+ return __assign.apply(this, arguments);
27
+ };
17
28
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
18
29
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
19
30
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -66,6 +77,26 @@ var __read = (this && this.__read) || function (o, n) {
66
77
  }
67
78
  return ar;
68
79
  };
80
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
81
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
82
+ if (ar || !(i in from)) {
83
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
84
+ ar[i] = from[i];
85
+ }
86
+ }
87
+ return to.concat(ar || Array.prototype.slice.call(from));
88
+ };
89
+ var __values = (this && this.__values) || function(o) {
90
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
91
+ if (m) return m.call(o);
92
+ if (o && typeof o.length === "number") return {
93
+ next: function () {
94
+ if (o && i >= o.length) o = void 0;
95
+ return { value: o && o[i++], done: !o };
96
+ }
97
+ };
98
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
99
+ };
69
100
  var __importDefault = (this && this.__importDefault) || function (mod) {
70
101
  return (mod && mod.__esModule) ? mod : { "default": mod };
71
102
  };
@@ -85,10 +116,12 @@ var FsSubCommand;
85
116
  })(FsSubCommand || (FsSubCommand = {}));
86
117
  var syntax = 'fs <subCommand> [options]';
87
118
  var usage = 'Usage: sasjs fs <subCommand> [options]';
88
- // TODO: update
89
119
  var description = 'Handles operations around file system synchronisation';
120
+ var parseOptions = {
121
+ output: { type: 'string', alias: 'o' }
122
+ };
90
123
  var compileCommandSyntax = 'fs <subCommand> <localFolder> [options]';
91
- var compileCommandUsage = 'Usage: sasjs fs compile <localFolder> [options]';
124
+ var compileCommandUsage = 'sasjs fs compile <localFolder> [options]';
92
125
  var compileCommandDescription = 'Compiles a SAS program with the contents of a local directory';
93
126
  var compileCommandExamples = [
94
127
  {
@@ -96,18 +129,24 @@ var compileCommandExamples = [
96
129
  description: 'Compiles a SAS program with the contents of a local directory'
97
130
  }
98
131
  ];
99
- var syncCommandSyntax = 'fs <subCommand> <localFolder> <remoteFolder>';
100
- var syncCommandUsage = 'Usage: sasjs fs sync <localFolder> <remoteFolder>';
132
+ var syncCommandSyntax = 'fs <subCommand> [options]';
133
+ var syncCommandUsage = 'sasjs fs sync';
101
134
  var syncCommandDescription = 'Synchronise the remote SAS file system with the local project folder according to the target `syncDirectories` array';
102
135
  var syncCommandExamples = [
103
136
  {
104
- command: 'sasjs fs sync <path/of/folder> <path/of/remote/folder>',
105
- description: 'Synchronise the remote SAS file system with the local project folder according to the target `syncDirectories` array'
137
+ command: 'sasjs fs sync --local <path/of/folder> --remote <path/of/remote/folder>',
138
+ description: ''
139
+ },
140
+ {
141
+ command: 'sasjs fs sync --local <path/of/folder> --remote <path/of/remote/folder> --target <target-name>',
142
+ description: ''
143
+ },
144
+ {
145
+ command: 'sasjs fs sync -l <path/of/folder> -r <path/of/remote/folder> -t <target-name>',
146
+ description: ''
106
147
  }
107
148
  ];
108
- var parseOptions = {
109
- output: { type: 'string', alias: 'o' }
110
- };
149
+ var syncCommandParseOptions = __assign(__assign({}, parseOptions), { local: { type: 'string', alias: 'l' }, remote: { type: 'string', alias: 'r' } });
111
150
  var FSCommand = /** @class */ (function (_super) {
112
151
  __extends(FSCommand, _super);
113
152
  function FSCommand(args) {
@@ -131,6 +170,7 @@ var FSCommand = /** @class */ (function (_super) {
131
170
  commandOptions.usage = syncCommandUsage;
132
171
  commandOptions.description = syncCommandDescription;
133
172
  commandOptions.examples = syncCommandExamples;
173
+ commandOptions.parseOptions = syncCommandParseOptions;
134
174
  break;
135
175
  }
136
176
  _this = _super.call(this, args, commandOptions) || this;
@@ -138,7 +178,8 @@ var FSCommand = /** @class */ (function (_super) {
138
178
  }
139
179
  Object.defineProperty(FSCommand.prototype, "localFolder", {
140
180
  get: function () {
141
- var sourcePath = this.parsed.localFolder;
181
+ var _a;
182
+ var sourcePath = (_a = this.parsed.local) !== null && _a !== void 0 ? _a : '';
142
183
  var currentDirPath = path_1.default.isAbsolute(sourcePath) ? '' : process.projectDir;
143
184
  return path_1.default.join(currentDirPath, sourcePath);
144
185
  },
@@ -147,7 +188,8 @@ var FSCommand = /** @class */ (function (_super) {
147
188
  });
148
189
  Object.defineProperty(FSCommand.prototype, "remoteFolder", {
149
190
  get: function () {
150
- var remotePath = this.parsed.remoteFolder;
191
+ var _a;
192
+ var remotePath = (_a = this.parsed.remote) !== null && _a !== void 0 ? _a : '';
151
193
  return remotePath.endsWith(path_1.default.sep) ? remotePath.slice(0, -1) : remotePath;
152
194
  },
153
195
  enumerable: false,
@@ -169,11 +211,12 @@ var FSCommand = /** @class */ (function (_super) {
169
211
  }
170
212
  }
171
213
  if (!outputPath) {
172
- return [2 /*return*/, path_1.default.join(process.sasjsConstants.buildDestinationResultsFolder, 'fs', (0, utils_2.generateTimestamp)())];
214
+ return [2 /*return*/, path_1.default.join(process.sasjsConstants.buildDestinationResultsFolder, 'fs-sync', (0, utils_2.generateTimestamp)())];
173
215
  }
174
- if (path_1.default.isAbsolute(outputPath))
175
- return [2 /*return*/, outputPath];
176
- return [2 /*return*/, path_1.default.join(process.cwd(), outputPath)];
216
+ if (path_1.default.isAbsolute(outputPath)) {
217
+ return [2 /*return*/, path_1.default.join(outputPath, (0, utils_2.generateTimestamp)())];
218
+ }
219
+ return [2 /*return*/, path_1.default.join(process.cwd(), outputPath, (0, utils_2.generateTimestamp)())];
177
220
  });
178
221
  });
179
222
  };
@@ -223,95 +266,150 @@ var FSCommand = /** @class */ (function (_super) {
223
266
  });
224
267
  };
225
268
  FSCommand.prototype.sync = function () {
226
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
269
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
227
270
  return __awaiter(this, void 0, void 0, function () {
228
- var target, remoteFolderPath, localFolderPath, outputFolder, program, log, remoteHashes, localHash, remoteHashMap, hashedDiff, syncProgram, syncLog, syncedHash, syncedHashMap, syncedResources, resourcesNotPresentLocally;
229
- return __generator(this, function (_l) {
230
- switch (_l.label) {
271
+ var _m, target, isLocal, remoteFolderPath, localFolderPath, syncDirectories, _o, _p, _q, _r, _loop_1, this_1, syncDirectories_1, syncDirectories_1_1, obj, state_1, e_1_1;
272
+ var e_1, _s;
273
+ return __generator(this, function (_t) {
274
+ switch (_t.label) {
231
275
  case 0: return [4 /*yield*/, this.getTargetInfo()];
232
276
  case 1:
233
- target = (_l.sent()).target;
277
+ _m = _t.sent(), target = _m.target, isLocal = _m.isLocal;
234
278
  remoteFolderPath = this.remoteFolder;
235
279
  localFolderPath = this.localFolder;
236
- return [4 /*yield*/, this.getOutputPath()];
280
+ syncDirectories = [];
281
+ if (!(remoteFolderPath && localFolderPath)) return [3 /*break*/, 2];
282
+ syncDirectories.push({ remote: remoteFolderPath, local: localFolderPath });
283
+ return [3 /*break*/, 4];
237
284
  case 2:
238
- outputFolder = _l.sent();
239
- (_a = process.logger) === null || _a === void 0 ? void 0 : _a.info('generating program to get remote hash');
240
- return [4 /*yield*/, (0, utils_2.generateProgramToGetRemoteHash)(remoteFolderPath)];
285
+ _p = (_o = syncDirectories.push).apply;
286
+ _q = [syncDirectories];
287
+ _r = [[]];
288
+ return [4 /*yield*/, (0, utils_1.getSyncDirectories)(target, isLocal)];
241
289
  case 3:
242
- program = _l.sent();
243
- (_b = process.logger) === null || _b === void 0 ? void 0 : _b.info('executing program to get remote hash');
244
- return [4 /*yield*/, (0, executeCode_1.executeCode)(target, program)];
290
+ _p.apply(_o, _q.concat([__spreadArray.apply(void 0, _r.concat([__read.apply(void 0, [(_t.sent())]), false]))]));
291
+ _t.label = 4;
245
292
  case 4:
246
- log = (_l.sent()).log;
247
- return [4 /*yield*/, (0, utils_1.saveLog)(log, path_1.default.join(outputFolder, 'getRemoteHash.log'), '', false)];
293
+ if (!syncDirectories.length) {
294
+ (_a = process.logger) === null || _a === void 0 ? void 0 : _a.info('There are no directories to sync.');
295
+ return [2 /*return*/, command_1.ReturnCode.Success];
296
+ }
297
+ _loop_1 = function (obj) {
298
+ var outputFolder, program, log, remoteHashes, localHash, remoteHashMap, hashedDiff, syncProgram, syncLog, syncedHash, syncedHashMap, syncedResources, resourcesNotPresentLocally;
299
+ return __generator(this, function (_u) {
300
+ switch (_u.label) {
301
+ case 0: return [4 /*yield*/, this_1.getOutputPath()];
302
+ case 1:
303
+ outputFolder = _u.sent();
304
+ (_b = process.logger) === null || _b === void 0 ? void 0 : _b.info('generating program to get remote hash');
305
+ return [4 /*yield*/, (0, utils_2.generateProgramToGetRemoteHash)(obj.remote)];
306
+ case 2:
307
+ program = _u.sent();
308
+ (_c = process.logger) === null || _c === void 0 ? void 0 : _c.info('executing program to get remote hash');
309
+ return [4 /*yield*/, (0, executeCode_1.executeCode)(target, program)];
310
+ case 3:
311
+ log = (_u.sent()).log;
312
+ return [4 /*yield*/, (0, utils_1.saveLog)(log, path_1.default.join(outputFolder, 'getRemoteHash.log'), '', false)];
313
+ case 4:
314
+ _u.sent();
315
+ (_d = process.logger) === null || _d === void 0 ? void 0 : _d.info('extracting hashes from log');
316
+ remoteHashes = (0, extractHashArray_1.extractHashArray)(log);
317
+ return [4 /*yield*/, createHashFile(JSON.stringify(remoteHashes, null, 2), path_1.default.join(outputFolder, 'hashesBeforeSync.json'))];
318
+ case 5:
319
+ _u.sent();
320
+ (_e = process.logger) === null || _e === void 0 ? void 0 : _e.info('creating the hash of local folder');
321
+ return [4 /*yield*/, (0, utils_2.getHash)(obj.local)];
322
+ case 6:
323
+ localHash = _u.sent();
324
+ remoteHashMap = remoteHashes.reduce(function (map, item) {
325
+ var relativePath = (0, utils_2.getRelativePath)(obj.remote, item.FILE_PATH);
326
+ map[relativePath] = item.FILE_HASH;
327
+ return map;
328
+ }, {});
329
+ if (remoteHashMap[localHash.relativePath] === localHash.hash) {
330
+ (_f = process.logger) === null || _f === void 0 ? void 0 : _f.info('There are no differences between Remote and Local directory. Already synced.');
331
+ return [2 /*return*/, { value: command_1.ReturnCode.Success }];
332
+ }
333
+ (_g = process.logger) === null || _g === void 0 ? void 0 : _g.info('Extract differences from local and remote hash');
334
+ hashedDiff = (0, utils_2.compareHashes)(localHash, remoteHashMap);
335
+ return [4 /*yield*/, createHashFile(JSON.stringify(hashedDiff, null, 2), path_1.default.join(outputFolder, 'hashesDiff.json'))];
336
+ case 7:
337
+ _u.sent();
338
+ (_h = process.logger) === null || _h === void 0 ? void 0 : _h.info('generating program to sync differences');
339
+ return [4 /*yield*/, (0, utils_2.generateProgramToSyncHashDiff)(hashedDiff, obj.remote)];
340
+ case 8:
341
+ syncProgram = _u.sent();
342
+ (_j = process.logger) === null || _j === void 0 ? void 0 : _j.info('executing program to sync differences');
343
+ return [4 /*yield*/, (0, executeCode_1.executeCode)(target, syncProgram)];
344
+ case 9:
345
+ syncLog = (_u.sent()).log;
346
+ return [4 /*yield*/, (0, utils_1.saveLog)(syncLog, path_1.default.join(outputFolder, 'sync.log'), '', false)];
347
+ case 10:
348
+ _u.sent();
349
+ syncedHash = (0, extractHashArray_1.extractHashArray)(syncLog);
350
+ return [4 /*yield*/, createHashFile(JSON.stringify(syncedHash, null, 2), path_1.default.join(outputFolder, 'hashesAfterSync.json'))];
351
+ case 11:
352
+ _u.sent();
353
+ syncedHashMap = syncedHash.reduce(function (map, item) {
354
+ var relativePath = (0, utils_2.getRelativePath)(obj.remote, item.FILE_PATH);
355
+ map[relativePath] = item.FILE_HASH;
356
+ return map;
357
+ }, {});
358
+ syncedResources = [];
359
+ Object.entries(syncedHashMap).forEach(function (_a) {
360
+ var _b = __read(_a, 2), key = _b[0], value = _b[1];
361
+ if (remoteHashMap[key] !== value)
362
+ syncedResources.push(key);
363
+ });
364
+ if (syncedResources.length) {
365
+ (_k = process.logger) === null || _k === void 0 ? void 0 : _k.log('The following resources were synced:');
366
+ syncedResources.forEach(function (item) {
367
+ var _a;
368
+ (_a = process.logger) === null || _a === void 0 ? void 0 : _a.log("* ".concat(item));
369
+ });
370
+ }
371
+ resourcesNotPresentLocally = (0, utils_2.findResourcesNotPresentLocally)(localHash, syncedHashMap);
372
+ if (resourcesNotPresentLocally.length) {
373
+ (_l = process.logger) === null || _l === void 0 ? void 0 : _l.log('The following resources are present in remote directory but not in local:');
374
+ resourcesNotPresentLocally.forEach(function (item) {
375
+ var _a;
376
+ (_a = process.logger) === null || _a === void 0 ? void 0 : _a.log("* ".concat(item));
377
+ });
378
+ }
379
+ return [2 /*return*/];
380
+ }
381
+ });
382
+ };
383
+ this_1 = this;
384
+ _t.label = 5;
248
385
  case 5:
249
- _l.sent();
250
- (_c = process.logger) === null || _c === void 0 ? void 0 : _c.info('extracting hashes from log');
251
- remoteHashes = (0, extractHashArray_1.extractHashArray)(log);
252
- return [4 /*yield*/, createHashFile(JSON.stringify(remoteHashes, null, 2), path_1.default.join(outputFolder, 'hashesBeforeSync.json'))];
386
+ _t.trys.push([5, 10, 11, 12]);
387
+ syncDirectories_1 = __values(syncDirectories), syncDirectories_1_1 = syncDirectories_1.next();
388
+ _t.label = 6;
253
389
  case 6:
254
- _l.sent();
255
- (_d = process.logger) === null || _d === void 0 ? void 0 : _d.info('creating the hash of local folder');
256
- return [4 /*yield*/, (0, utils_2.getHash)(localFolderPath)];
390
+ if (!!syncDirectories_1_1.done) return [3 /*break*/, 9];
391
+ obj = syncDirectories_1_1.value;
392
+ return [5 /*yield**/, _loop_1(obj)];
257
393
  case 7:
258
- localHash = _l.sent();
259
- remoteHashMap = remoteHashes.reduce(function (map, item) {
260
- var relativePath = (0, utils_2.getRelativePath)(remoteFolderPath, item.FILE_PATH);
261
- map[relativePath] = item.FILE_HASH;
262
- return map;
263
- }, {});
264
- if (remoteHashMap[localHash.relativePath] === localHash.hash) {
265
- (_e = process.logger) === null || _e === void 0 ? void 0 : _e.info('There are no differences between Remote and Local directory. Already synced.');
266
- return [2 /*return*/, command_1.ReturnCode.Success];
267
- }
268
- (_f = process.logger) === null || _f === void 0 ? void 0 : _f.info('Extract differences from local and remote hash');
269
- hashedDiff = (0, utils_2.compareHashes)(localHash, remoteHashMap);
270
- return [4 /*yield*/, createHashFile(JSON.stringify(hashedDiff, null, 2), path_1.default.join(outputFolder, 'hashesDiff.json'))];
394
+ state_1 = _t.sent();
395
+ if (typeof state_1 === "object")
396
+ return [2 /*return*/, state_1.value];
397
+ _t.label = 8;
271
398
  case 8:
272
- _l.sent();
273
- (_g = process.logger) === null || _g === void 0 ? void 0 : _g.info('generating program to sync differences');
274
- return [4 /*yield*/, (0, utils_2.generateProgramToSyncHashDiff)(hashedDiff, remoteFolderPath)];
275
- case 9:
276
- syncProgram = _l.sent();
277
- (_h = process.logger) === null || _h === void 0 ? void 0 : _h.info('executing program to sync differences');
278
- return [4 /*yield*/, (0, executeCode_1.executeCode)(target, syncProgram)];
399
+ syncDirectories_1_1 = syncDirectories_1.next();
400
+ return [3 /*break*/, 6];
401
+ case 9: return [3 /*break*/, 12];
279
402
  case 10:
280
- syncLog = (_l.sent()).log;
281
- return [4 /*yield*/, (0, utils_1.saveLog)(syncLog, path_1.default.join(outputFolder, 'sync.log'), '', false)];
403
+ e_1_1 = _t.sent();
404
+ e_1 = { error: e_1_1 };
405
+ return [3 /*break*/, 12];
282
406
  case 11:
283
- _l.sent();
284
- syncedHash = (0, extractHashArray_1.extractHashArray)(syncLog);
285
- return [4 /*yield*/, createHashFile(JSON.stringify(syncedHash, null, 2), path_1.default.join(outputFolder, 'hashesAfterSync.json'))];
286
- case 12:
287
- _l.sent();
288
- syncedHashMap = syncedHash.reduce(function (map, item) {
289
- var relativePath = (0, utils_2.getRelativePath)(remoteFolderPath, item.FILE_PATH);
290
- map[relativePath] = item.FILE_HASH;
291
- return map;
292
- }, {});
293
- syncedResources = [];
294
- Object.entries(syncedHashMap).forEach(function (_a) {
295
- var _b = __read(_a, 2), key = _b[0], value = _b[1];
296
- if (remoteHashMap[key] !== value)
297
- syncedResources.push(key);
298
- });
299
- if (syncedResources.length) {
300
- (_j = process.logger) === null || _j === void 0 ? void 0 : _j.log('The following resources were synced:');
301
- syncedResources.forEach(function (item) {
302
- var _a;
303
- (_a = process.logger) === null || _a === void 0 ? void 0 : _a.log("* ".concat(item));
304
- });
305
- }
306
- resourcesNotPresentLocally = (0, utils_2.findResourcesNotPresentLocally)(localHash, syncedHashMap);
307
- if (resourcesNotPresentLocally.length) {
308
- (_k = process.logger) === null || _k === void 0 ? void 0 : _k.log('The following resources are present in remote directory but not in local:');
309
- resourcesNotPresentLocally.forEach(function (item) {
310
- var _a;
311
- (_a = process.logger) === null || _a === void 0 ? void 0 : _a.log("* ".concat(item));
312
- });
407
+ try {
408
+ if (syncDirectories_1_1 && !syncDirectories_1_1.done && (_s = syncDirectories_1.return)) _s.call(syncDirectories_1);
313
409
  }
314
- return [2 /*return*/, command_1.ReturnCode.Success];
410
+ finally { if (e_1) throw e_1.error; }
411
+ return [7 /*endfinally*/];
412
+ case 12: return [2 /*return*/, command_1.ReturnCode.Success];
315
413
  }
316
414
  });
317
415
  });
@@ -215,7 +215,9 @@ describe('FSCommand', function () {
215
215
  ]; });
216
216
  return [4 /*yield*/, executeCommandWrapper([
217
217
  'sync',
218
+ '-l',
218
219
  'localFolder',
220
+ '-r',
219
221
  'remoteFolder'
220
222
  ])];
221
223
  case 1:
@@ -256,7 +258,9 @@ describe('FSCommand', function () {
256
258
  });
257
259
  return [4 /*yield*/, executeCommandWrapper([
258
260
  'sync',
261
+ '-l',
259
262
  'localFolder',
263
+ '-r',
260
264
  'remoteFolder'
261
265
  ])];
262
266
  case 1:
@@ -1,5 +1,5 @@
1
1
  import SASjs from '@sasjs/adapter/node';
2
- import { Configuration, Target, AuthConfig, StreamConfig, AuthConfigSas9 } from '@sasjs/utils';
2
+ import { Configuration, Target, AuthConfig, StreamConfig, AuthConfigSas9, SyncDirectoryMap } from '@sasjs/utils';
3
3
  import { TargetScope } from '../types/targetScope';
4
4
  /**
5
5
  * Returns an object that represents the SASjs CLI configuration in a given file.
@@ -31,6 +31,7 @@ export declare function getLocalOrGlobalConfig(): Promise<{
31
31
  configuration: Configuration;
32
32
  isLocal: boolean;
33
33
  }>;
34
+ export declare function getSyncDirectories(target: Target, isLocal: boolean): Promise<SyncDirectoryMap[]>;
34
35
  export declare function saveLocalConfigFile(content: string): Promise<string>;
35
36
  export declare function saveToLocalConfig(target: Target, isDefault?: boolean, saveWithDefaultValues?: boolean): Promise<string>;
36
37
  export declare function getFolders(): Promise<any>;
@@ -75,7 +75,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
75
75
  return (mod && mod.__esModule) ? mod : { "default": mod };
76
76
  };
77
77
  Object.defineProperty(exports, "__esModule", { value: true });
78
- exports.getSASjsAndAuthConfig = exports.getSASjs = exports.getTestTearDown = exports.getTestSetUp = exports.overrideEnvVariables = exports.getAccessToken = exports.getAuthConfigSAS9 = exports.getAuthConfig = exports.getProjectRoot = exports.sanitizeAppLoc = exports.getStreamConfig = exports.getMacroFolders = exports.getBinaryFolders = exports.getProgramFolders = exports.getFolders = exports.saveToLocalConfig = exports.saveLocalConfigFile = exports.getLocalOrGlobalConfig = exports.getLocalConfig = exports.removeFromLocalConfig = exports.removeFromGlobalConfig = exports.saveToGlobalConfig = exports.saveGlobalRcFile = exports.getLocalRcFile = exports.getGlobalRcFile = exports.findTargetInConfiguration = exports.getConfiguration = void 0;
78
+ exports.getSASjsAndAuthConfig = exports.getSASjs = exports.getTestTearDown = exports.getTestSetUp = exports.overrideEnvVariables = exports.getAccessToken = exports.getAuthConfigSAS9 = exports.getAuthConfig = exports.getProjectRoot = exports.sanitizeAppLoc = exports.getStreamConfig = exports.getMacroFolders = exports.getBinaryFolders = exports.getProgramFolders = exports.getFolders = exports.saveToLocalConfig = exports.saveLocalConfigFile = exports.getSyncDirectories = exports.getLocalOrGlobalConfig = exports.getLocalConfig = exports.removeFromLocalConfig = exports.removeFromGlobalConfig = exports.saveToGlobalConfig = exports.saveGlobalRcFile = exports.getLocalRcFile = exports.getGlobalRcFile = exports.findTargetInConfiguration = exports.getConfiguration = void 0;
79
79
  var node_1 = __importDefault(require("@sasjs/adapter/node"));
80
80
  var utils_1 = require("@sasjs/utils");
81
81
  var auth_1 = require("./auth");
@@ -538,6 +538,31 @@ function getLocalOrGlobalConfig() {
538
538
  });
539
539
  }
540
540
  exports.getLocalOrGlobalConfig = getLocalOrGlobalConfig;
541
+ function getSyncDirectories(target, isLocal) {
542
+ return __awaiter(this, void 0, void 0, function () {
543
+ var config, _a, rootLevelSyncDirectories, targetLevelSyncDirectories;
544
+ return __generator(this, function (_b) {
545
+ switch (_b.label) {
546
+ case 0:
547
+ if (!isLocal) return [3 /*break*/, 2];
548
+ return [4 /*yield*/, getLocalConfig()];
549
+ case 1:
550
+ _a = _b.sent();
551
+ return [3 /*break*/, 4];
552
+ case 2: return [4 /*yield*/, getGlobalRcFile()];
553
+ case 3:
554
+ _a = _b.sent();
555
+ _b.label = 4;
556
+ case 4:
557
+ config = _a;
558
+ rootLevelSyncDirectories = config.syncDirectories || [];
559
+ targetLevelSyncDirectories = target.syncDirectories || [];
560
+ return [2 /*return*/, __spreadArray(__spreadArray([], __read(rootLevelSyncDirectories), false), __read(targetLevelSyncDirectories), false)];
561
+ }
562
+ });
563
+ });
564
+ }
565
+ exports.getSyncDirectories = getSyncDirectories;
541
566
  function saveLocalConfigFile(content) {
542
567
  return __awaiter(this, void 0, void 0, function () {
543
568
  var configPath;
package/package.json CHANGED
@@ -52,8 +52,8 @@
52
52
  "dependencies": {
53
53
  "@sasjs/adapter": "4.0.1",
54
54
  "@sasjs/core": "4.43.1",
55
- "@sasjs/lint": "1.13.0",
56
- "@sasjs/utils": "2.51.0",
55
+ "@sasjs/lint": "1.15.0",
56
+ "@sasjs/utils": "2.51.1",
57
57
  "adm-zip": "0.5.9",
58
58
  "chalk": "4.1.2",
59
59
  "csv-stringify": "5.6.5",
@@ -101,5 +101,5 @@
101
101
  "typescript": "4.5.4",
102
102
  "util": "0.12.4"
103
103
  },
104
- "version": "3.21.1"
104
+ "version": "3.21.3"
105
105
  }