@sasjs/utils 2.34.1 → 2.36.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/dependabot.yml +1 -1
- package/.github/reviewer-lottery.yml +0 -2
- package/.github/workflows/run-tests.yml +3 -0
- package/auth/auth.js +2 -2
- package/auth/auth.js.map +1 -1
- package/error/serverTypeError.js +10 -6
- package/error/serverTypeError.js.map +1 -1
- package/file/csvFile.js +14 -10
- package/file/csvFile.js.map +1 -1
- package/file/file.d.ts +1 -1
- package/file/file.js +20 -15
- package/file/file.js.map +1 -1
- package/formatter/index.d.ts +1 -1
- package/formatter/index.js +2 -1
- package/formatter/index.js.map +1 -1
- package/formatter/number.js +1 -1
- package/formatter/number.js.map +1 -1
- package/formatter/string.d.ts +1 -0
- package/formatter/string.js +5 -1
- package/formatter/string.js.map +1 -1
- package/input/readAndValidateInput.js +7 -7
- package/input/readAndValidateInput.js.map +1 -1
- package/logger/logger.js +21 -17
- package/logger/logger.js.map +1 -1
- package/package.json +23 -27
- package/sasjsCli/getDependencies.d.ts +6 -0
- package/sasjsCli/getDependencies.js +260 -0
- package/sasjsCli/getDependencies.js.map +1 -0
- package/sasjsCli/getDependencyPaths.js +29 -23
- package/sasjsCli/getDependencyPaths.js.map +1 -1
- package/sasjsCli/getInitTerm.d.ts +10 -13
- package/sasjsCli/getInitTerm.js +64 -65
- package/sasjsCli/getInitTerm.js.map +1 -1
- package/sasjsCli/getList.js +1 -2
- package/sasjsCli/getList.js.map +1 -1
- package/sasjsCli/index.d.ts +1 -4
- package/sasjsCli/index.js +1 -4
- package/sasjsCli/index.js.map +1 -1
- package/sasjsCli/loadDependenciesFile.d.ts +2 -1
- package/sasjsCli/loadDependenciesFile.js +29 -22
- package/sasjsCli/loadDependenciesFile.js.map +1 -1
- package/sasjsCli/prioritiseDependencyOverrides.js +10 -6
- package/sasjsCli/prioritiseDependencyOverrides.js.map +1 -1
- package/time/timestamp.js +6 -6
- package/time/timestamp.js.map +1 -1
- package/types/configuration.d.ts +1 -0
- package/types/httpsAgentOptions.d.ts +1 -1
- package/types/target.d.ts +3 -0
- package/types/target.js +31 -19
- package/types/target.js.map +1 -1
- package/types/targetValidators.js +2 -2
- package/types/targetValidators.js.map +1 -1
- package/updateCli +3 -0
- package/updateServer +3 -0
- package/utils/diff.js +9 -5
- package/utils/diff.js.map +1 -1
- package/utils/index.d.ts +1 -1
- package/utils/index.js +12 -4
- package/utils/index.js.map +1 -1
- package/utils/utils.d.ts +1 -0
- package/utils/utils.js +3 -1
- package/utils/utils.js.map +1 -1
- package/sasjsCli/getProgramDependencies.d.ts +0 -1
- package/sasjsCli/getProgramDependencies.js +0 -144
- package/sasjsCli/getProgramDependencies.js.map +0 -1
- package/sasjsCli/getProgramList.d.ts +0 -4
- package/sasjsCli/getProgramList.js +0 -45
- package/sasjsCli/getProgramList.js.map +0 -1
- package/sasjsCli/validateProgramsList.d.ts +0 -4
- package/sasjsCli/validateProgramsList.js +0 -59
- package/sasjsCli/validateProgramsList.js.map +0 -1
package/package.json
CHANGED
|
@@ -33,36 +33,32 @@
|
|
|
33
33
|
},
|
|
34
34
|
"homepage": "https://github.com/sasjs/utils#readme",
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@sasjs/core": "
|
|
37
|
-
"@types/cli-table": "
|
|
36
|
+
"@sasjs/core": "3.10.0",
|
|
37
|
+
"@types/cli-table": "0.3.0",
|
|
38
38
|
"@types/find": "0.2.1",
|
|
39
|
-
"@types/jest": "27.0
|
|
40
|
-
"@types/
|
|
41
|
-
"@types/
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"jest": "27.
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"ts-loader": "^9.2.3",
|
|
49
|
-
"typescript": "4.3.5"
|
|
39
|
+
"@types/jest": "27.4.0",
|
|
40
|
+
"@types/rimraf": "3.0.1",
|
|
41
|
+
"@types/valid-url": "1.0.3",
|
|
42
|
+
"babel-jest": "27.4.6",
|
|
43
|
+
"jest": "27.4.7",
|
|
44
|
+
"jest-extended": "1.1.0",
|
|
45
|
+
"ts-jest": "27.1.3",
|
|
46
|
+
"ts-loader": "9.2.6",
|
|
47
|
+
"typescript": "4.5.4"
|
|
50
48
|
},
|
|
51
49
|
"dependencies": {
|
|
52
|
-
"@types/fs-extra": "
|
|
53
|
-
"@types/prompts": "
|
|
54
|
-
"chalk": "
|
|
55
|
-
"cli-table": "
|
|
56
|
-
"consola": "
|
|
57
|
-
"csv-stringify": "
|
|
50
|
+
"@types/fs-extra": "9.0.13",
|
|
51
|
+
"@types/prompts": "2.0.13",
|
|
52
|
+
"chalk": "4.1.1",
|
|
53
|
+
"cli-table": "0.3.6",
|
|
54
|
+
"consola": "2.15.0",
|
|
55
|
+
"csv-stringify": "5.6.5",
|
|
58
56
|
"find": "0.3.0",
|
|
59
|
-
"fs-extra": "
|
|
60
|
-
"jwt-decode": "
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"rimraf": "^3.0.2",
|
|
65
|
-
"valid-url": "^1.0.9"
|
|
57
|
+
"fs-extra": "10.0.0",
|
|
58
|
+
"jwt-decode": "3.1.2",
|
|
59
|
+
"prompts": "2.4.1",
|
|
60
|
+
"rimraf": "3.0.2",
|
|
61
|
+
"valid-url": "1.0.9"
|
|
66
62
|
},
|
|
67
|
-
"version": "2.
|
|
63
|
+
"version": "2.36.1"
|
|
68
64
|
}
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (_) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
39
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
40
|
+
if (!m) return o;
|
|
41
|
+
var i = m.call(o), r, ar = [], e;
|
|
42
|
+
try {
|
|
43
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
44
|
+
}
|
|
45
|
+
catch (error) { e = { error: error }; }
|
|
46
|
+
finally {
|
|
47
|
+
try {
|
|
48
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
49
|
+
}
|
|
50
|
+
finally { if (e) throw e.error; }
|
|
51
|
+
}
|
|
52
|
+
return ar;
|
|
53
|
+
};
|
|
54
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
55
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
56
|
+
};
|
|
57
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
58
|
+
exports.getDependencies = exports.DependencyType = void 0;
|
|
59
|
+
var utils_1 = require("../utils");
|
|
60
|
+
var _1 = require("./");
|
|
61
|
+
var utils_2 = require("../utils");
|
|
62
|
+
var find_1 = __importDefault(require("find"));
|
|
63
|
+
var file_1 = require("../file");
|
|
64
|
+
var formatter_1 = require("../formatter");
|
|
65
|
+
// REFACTOR: move logic supporting SAS Macros dependencies to this file
|
|
66
|
+
var DependencyType;
|
|
67
|
+
(function (DependencyType) {
|
|
68
|
+
DependencyType["Macro"] = "Macro";
|
|
69
|
+
DependencyType["Include"] = "Include";
|
|
70
|
+
DependencyType["Binary"] = "Binary";
|
|
71
|
+
})(DependencyType = exports.DependencyType || (exports.DependencyType = {}));
|
|
72
|
+
var getDepInfo = function (depType, fileContent) {
|
|
73
|
+
var header = '';
|
|
74
|
+
switch (depType) {
|
|
75
|
+
case DependencyType.Binary:
|
|
76
|
+
header = 'Binary Files';
|
|
77
|
+
break;
|
|
78
|
+
case DependencyType.Include:
|
|
79
|
+
header = fileContent.includes('<h4> SAS Includes </h4>')
|
|
80
|
+
? 'SAS Includes'
|
|
81
|
+
: 'SAS Programs';
|
|
82
|
+
break;
|
|
83
|
+
default:
|
|
84
|
+
break;
|
|
85
|
+
}
|
|
86
|
+
var depInfo = {
|
|
87
|
+
name: header,
|
|
88
|
+
header: "<h4> ".concat(header, " </h4>"),
|
|
89
|
+
config: "".concat((depType === DependencyType.Include
|
|
90
|
+
? 'Program'
|
|
91
|
+
: depType).toLowerCase(), "Folders"),
|
|
92
|
+
type: depType
|
|
93
|
+
};
|
|
94
|
+
return depInfo;
|
|
95
|
+
};
|
|
96
|
+
var getDependencies = function (fileName, fileContent, folders, depType) { return __awaiter(void 0, void 0, void 0, function () {
|
|
97
|
+
var depInfo, deps, uniqDeps, foundDeps_1, foundDepsNames_1, notFoundDeps, depFolder;
|
|
98
|
+
return __generator(this, function (_a) {
|
|
99
|
+
switch (_a.label) {
|
|
100
|
+
case 0:
|
|
101
|
+
folders = (0, utils_1.uniqArray)(folders);
|
|
102
|
+
depInfo = getDepInfo(depType, fileContent);
|
|
103
|
+
deps = deconstructDependency((0, _1.getList)(depInfo.header, fileContent), depInfo);
|
|
104
|
+
uniqDeps = [];
|
|
105
|
+
deps.forEach(function (dep) {
|
|
106
|
+
return uniqDeps.find(function (d) { return dep.fileName === d.fileName; }) || uniqDeps.push(dep);
|
|
107
|
+
});
|
|
108
|
+
if (!uniqDeps.length) return [3 /*break*/, 2];
|
|
109
|
+
foundDeps_1 = [];
|
|
110
|
+
foundDepsNames_1 = [];
|
|
111
|
+
return [4 /*yield*/, (0, utils_2.asyncForEach)(folders, function (folder) { return __awaiter(void 0, void 0, void 0, function () {
|
|
112
|
+
return __generator(this, function (_a) {
|
|
113
|
+
switch (_a.label) {
|
|
114
|
+
case 0: return [4 /*yield*/, (0, utils_2.asyncForEach)(uniqDeps, function (dep) { return __awaiter(void 0, void 0, void 0, function () {
|
|
115
|
+
var filePaths, encodedFileContent, depContent;
|
|
116
|
+
return __generator(this, function (_a) {
|
|
117
|
+
switch (_a.label) {
|
|
118
|
+
case 0:
|
|
119
|
+
filePaths = find_1.default.fileSync(dep.fileName, folder);
|
|
120
|
+
if (!filePaths.length) return [3 /*break*/, 2];
|
|
121
|
+
return [4 /*yield*/, (0, file_1.readFile)(filePaths[0], depType === DependencyType.Binary ? 'base64' : undefined)];
|
|
122
|
+
case 1:
|
|
123
|
+
encodedFileContent = _a.sent();
|
|
124
|
+
depContent = compileDep(depType, encodedFileContent, dep.fileRef);
|
|
125
|
+
foundDeps_1.push(depContent);
|
|
126
|
+
foundDepsNames_1.push(dep.fileName);
|
|
127
|
+
_a.label = 2;
|
|
128
|
+
case 2: return [2 /*return*/];
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
}); })];
|
|
132
|
+
case 1:
|
|
133
|
+
_a.sent();
|
|
134
|
+
return [2 /*return*/];
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
}); })];
|
|
138
|
+
case 1:
|
|
139
|
+
_a.sent();
|
|
140
|
+
notFoundDeps = deps
|
|
141
|
+
.filter(function (dep) { return !foundDepsNames_1.includes(dep.fileName); })
|
|
142
|
+
.map(function (dep, i) { return "".concat(i + 1, ". '").concat(dep.fileName, "' with fileRef '").concat(dep.fileRef, "'"); })
|
|
143
|
+
.join('\n');
|
|
144
|
+
if (notFoundDeps.length) {
|
|
145
|
+
depFolder = depInfo.config.replace(/([A-Z]+)/g, ' $1');
|
|
146
|
+
depFolder = (0, formatter_1.capitalizeFirstChar)(depFolder);
|
|
147
|
+
throw new Error("Unable to load dependencies for: ".concat(fileName || '', "\n") +
|
|
148
|
+
"The following files were listed under ".concat(depInfo.name, " but could not be found:\n") +
|
|
149
|
+
"".concat(notFoundDeps, "\n") +
|
|
150
|
+
"Please check that they exist in the folder(s) listed in the `".concat(depInfo.config, "` array in your sasjsconfig.json file.\n") +
|
|
151
|
+
"".concat(depFolder, ":\n") +
|
|
152
|
+
folders.map(function (folder) { return "- ".concat(folder); }).join('\n'));
|
|
153
|
+
}
|
|
154
|
+
return [2 /*return*/, foundDeps_1.join('\n')];
|
|
155
|
+
case 2: return [2 /*return*/, ''];
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
}); };
|
|
159
|
+
exports.getDependencies = getDependencies;
|
|
160
|
+
var deconstructDependency = function (deps, depInfo) {
|
|
161
|
+
return deps.map(function (dep) {
|
|
162
|
+
var _a = __read(dep.split(' ').filter(function (f) { return !!f; }), 2), fileName = _a[0], fileRef = _a[1];
|
|
163
|
+
if (!fileName) {
|
|
164
|
+
throw new Error("".concat(depInfo.name, " entry is empty. Please specify ").concat(depInfo.name, " dependencies in the format: @li <filename> <fileref>"));
|
|
165
|
+
}
|
|
166
|
+
if (!fileRef && depInfo.type !== DependencyType.Macro) {
|
|
167
|
+
throw new Error("".concat(depInfo.name, " ").concat(fileName, " is missing fileref. Please specify ").concat(depInfo.name, " dependencies in the format: @li <filename> <fileref>"));
|
|
168
|
+
}
|
|
169
|
+
if (depInfo.type !== DependencyType.Macro)
|
|
170
|
+
(0, _1.validateFileRef)(fileRef);
|
|
171
|
+
return { fileName: fileName, fileRef: fileRef };
|
|
172
|
+
});
|
|
173
|
+
};
|
|
174
|
+
var compileDep = function (depType, fileContent, fileRef) {
|
|
175
|
+
var output = '';
|
|
176
|
+
if (depType === DependencyType.Binary) {
|
|
177
|
+
output = [
|
|
178
|
+
"filename _sjstmp \"%sysfunc(pathname(work))/base64_".concat(fileRef, "\" recfm=n;"),
|
|
179
|
+
"data _null_;",
|
|
180
|
+
"file _sjstmp;\n"
|
|
181
|
+
].join("\n");
|
|
182
|
+
var sourceLines = fileContent
|
|
183
|
+
.replace(/\r\n/g, '\n')
|
|
184
|
+
.split('\n')
|
|
185
|
+
.filter(function (l) { return !!l; });
|
|
186
|
+
sourceLines.forEach(function (line) {
|
|
187
|
+
var chunkedLines = (0, utils_2.chunk)(line);
|
|
188
|
+
if (chunkedLines.length === 1) {
|
|
189
|
+
output += "put '".concat(chunkedLines[0].split("'").join("''"), "';\n");
|
|
190
|
+
}
|
|
191
|
+
else {
|
|
192
|
+
var combinedLines_1 = '';
|
|
193
|
+
chunkedLines.forEach(function (chunkedLine, index) {
|
|
194
|
+
var text = "put '".concat(chunkedLine.split("'").join("''"), "'");
|
|
195
|
+
if (index !== chunkedLines.length - 1) {
|
|
196
|
+
text += '@;\n';
|
|
197
|
+
}
|
|
198
|
+
else {
|
|
199
|
+
text += ';\n';
|
|
200
|
+
}
|
|
201
|
+
combinedLines_1 += text;
|
|
202
|
+
});
|
|
203
|
+
output += combinedLines_1;
|
|
204
|
+
}
|
|
205
|
+
});
|
|
206
|
+
output += "run;\n";
|
|
207
|
+
var sasCodeToDecodeBase64 = [
|
|
208
|
+
"filename ".concat(fileRef, " \"%sysfunc(pathname(work))/sasjs_").concat(fileRef, "\";"),
|
|
209
|
+
"data _null_;",
|
|
210
|
+
"length filein 8 fileout 8;",
|
|
211
|
+
"filein = fopen(\"_sjstmp\",'I',4,'B');",
|
|
212
|
+
"fileout = fopen(\"".concat(fileRef, "\",'O',3,'B');"),
|
|
213
|
+
"char= '20'x;",
|
|
214
|
+
"do while(fread(filein)=0);",
|
|
215
|
+
"length raw $4;",
|
|
216
|
+
"do i=1 to 4;",
|
|
217
|
+
"rc=fget(filein,char,1);",
|
|
218
|
+
"substr(raw,i,1)=char;",
|
|
219
|
+
"end;",
|
|
220
|
+
"rc = fput(fileout,input(raw,$base64X4.));",
|
|
221
|
+
"rc = fwrite(fileout);",
|
|
222
|
+
"end;",
|
|
223
|
+
"rc = fclose(filein);",
|
|
224
|
+
"rc = fclose(fileout);",
|
|
225
|
+
"run;",
|
|
226
|
+
"filename _sjstmp clear;"
|
|
227
|
+
];
|
|
228
|
+
output += sasCodeToDecodeBase64.join("\n");
|
|
229
|
+
}
|
|
230
|
+
else if (depType === DependencyType.Include) {
|
|
231
|
+
output = "filename ".concat(fileRef, " temp;\ndata _null_;\nfile ").concat(fileRef, " lrecl=32767;\n");
|
|
232
|
+
var sourceLines = fileContent
|
|
233
|
+
.replace(/\r\n/g, '\n')
|
|
234
|
+
.split('\n')
|
|
235
|
+
.filter(function (l) { return !!l; });
|
|
236
|
+
sourceLines.forEach(function (line) {
|
|
237
|
+
var chunkedLines = (0, utils_2.chunk)(line);
|
|
238
|
+
if (chunkedLines.length === 1) {
|
|
239
|
+
output += "put '".concat(chunkedLines[0].split("'").join("''"), "';\n");
|
|
240
|
+
}
|
|
241
|
+
else {
|
|
242
|
+
var combinedLines_2 = '';
|
|
243
|
+
chunkedLines.forEach(function (chunkedLine, index) {
|
|
244
|
+
var text = "put '".concat(chunkedLine.split("'").join("''"), "'");
|
|
245
|
+
if (index !== chunkedLines.length - 1) {
|
|
246
|
+
text += '@;\n';
|
|
247
|
+
}
|
|
248
|
+
else {
|
|
249
|
+
text += ';\n';
|
|
250
|
+
}
|
|
251
|
+
combinedLines_2 += text;
|
|
252
|
+
});
|
|
253
|
+
output += combinedLines_2;
|
|
254
|
+
}
|
|
255
|
+
});
|
|
256
|
+
output += 'run;';
|
|
257
|
+
}
|
|
258
|
+
return output;
|
|
259
|
+
};
|
|
260
|
+
//# sourceMappingURL=getDependencies.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getDependencies.js","sourceRoot":"","sources":["../../src/sasjsCli/getDependencies.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kCAAoC;AACpC,uBAA6C;AAC7C,kCAA8C;AAC9C,8CAAuB;AACvB,gCAAkC;AAClC,0CAAkD;AAElD,uEAAuE;AAEvE,IAAY,cAIX;AAJD,WAAY,cAAc;IACxB,iCAAe,CAAA;IACf,qCAAmB,CAAA;IACnB,mCAAiB,CAAA;AACnB,CAAC,EAJW,cAAc,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EAAE,CAAA;gBACtB,YAAY,CAAC,OAAO,CAAC,UAAC,WAAW,EAAE,KAAK;oBACtC,IAAI,IAAI,GAAG,eAAQ,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,MAAG,CAAA;oBACvD,IAAI,KAAK,KAAK,YAAY,CAAC,MAAM,GAAG,CAAC,EAAE;wBACrC,IAAI,IAAI,MAAM,CAAA;qBACf;yBAAM;wBACL,IAAI,IAAI,KAAK,CAAA;qBACd;oBACD,eAAa,IAAI,IAAI,CAAA;gBACvB,CAAC,CAAC,CAAA;gBACF,MAAM,IAAI,eAAa,CAAA;aACxB;QACH,CAAC,CAAC,CAAA;QAEF,MAAM,IAAI,MAAM,CAAA;KACjB;IAED,OAAO,MAAM,CAAA;AACf,CAAC,CAAA"}
|
|
@@ -51,10 +51,14 @@ var __read = (this && this.__read) || function (o, n) {
|
|
|
51
51
|
}
|
|
52
52
|
return ar;
|
|
53
53
|
};
|
|
54
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
|
|
55
|
-
for (var i = 0,
|
|
56
|
-
|
|
57
|
-
|
|
54
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
55
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
56
|
+
if (ar || !(i in from)) {
|
|
57
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
58
|
+
ar[i] = from[i];
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
58
62
|
};
|
|
59
63
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
60
64
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
@@ -67,36 +71,36 @@ var utils_1 = require("../utils");
|
|
|
67
71
|
var _1 = require("./");
|
|
68
72
|
function getDependencyPaths(fileContent, macroFolders, macroCorePath) {
|
|
69
73
|
return __awaiter(this, void 0, void 0, function () {
|
|
70
|
-
var
|
|
74
|
+
var dependencyPaths, foundDependencies, sourcePaths, dependenciesHeader, dependencies, notFoundDependencies;
|
|
71
75
|
var _this = this;
|
|
72
76
|
return __generator(this, function (_a) {
|
|
73
77
|
switch (_a.label) {
|
|
74
78
|
case 0:
|
|
75
|
-
|
|
79
|
+
dependencyPaths = [];
|
|
80
|
+
foundDependencies = [];
|
|
81
|
+
sourcePaths = __spreadArray(__spreadArray([], __read(macroFolders), false), [macroCorePath], false);
|
|
76
82
|
dependenciesHeader = fileContent.includes('<h4> SAS Macros </h4>')
|
|
77
83
|
? '<h4> SAS Macros </h4>'
|
|
78
84
|
: '<h4> Dependencies </h4>';
|
|
79
|
-
dependencies = _1.getList(dependenciesHeader, fileContent).filter(function (d) {
|
|
85
|
+
dependencies = (0, _1.getList)(dependenciesHeader, fileContent).filter(function (d) {
|
|
80
86
|
return d.endsWith('.sas');
|
|
81
87
|
});
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
return [4 /*yield*/, utils_1.asyncForEach(sourcePaths, function (sourcePath) { return __awaiter(_this, void 0, void 0, function () {
|
|
85
|
-
var errorMessage;
|
|
88
|
+
// Search dependencies recursively starting from macroFolders and ending in macroCorePath
|
|
89
|
+
return [4 /*yield*/, (0, utils_1.asyncForEach)(sourcePaths, function (sourcePath) { return __awaiter(_this, void 0, void 0, function () {
|
|
86
90
|
var _this = this;
|
|
87
91
|
return __generator(this, function (_a) {
|
|
88
92
|
switch (_a.label) {
|
|
89
|
-
case 0: return [4 /*yield*/, file_1.folderExists(sourcePath)];
|
|
93
|
+
case 0: return [4 /*yield*/, (0, file_1.folderExists)(sourcePath)];
|
|
90
94
|
case 1:
|
|
91
95
|
if (!_a.sent()) return [3 /*break*/, 3];
|
|
92
|
-
return [4 /*yield*/, utils_1.asyncForEach(dependencies, function (dep) { return __awaiter(_this, void 0, void 0, function () {
|
|
96
|
+
return [4 /*yield*/, (0, utils_1.asyncForEach)(dependencies, function (dep) { return __awaiter(_this, void 0, void 0, function () {
|
|
93
97
|
var filePaths, fileContent_1, _a, _b, _c, _d;
|
|
94
98
|
return __generator(this, function (_e) {
|
|
95
99
|
switch (_e.label) {
|
|
96
100
|
case 0:
|
|
97
101
|
filePaths = find_1.default.fileSync(dep, sourcePath);
|
|
98
102
|
if (!filePaths.length) return [3 /*break*/, 3];
|
|
99
|
-
return [4 /*yield*/, file_1.readFile(filePaths[0])];
|
|
103
|
+
return [4 /*yield*/, (0, file_1.readFile)(filePaths[0])];
|
|
100
104
|
case 1:
|
|
101
105
|
fileContent_1 = _e.sent();
|
|
102
106
|
foundDependencies.push(dep);
|
|
@@ -105,10 +109,10 @@ function getDependencyPaths(fileContent, macroFolders, macroCorePath) {
|
|
|
105
109
|
_d = [[]];
|
|
106
110
|
return [4 /*yield*/, getDependencyPaths(fileContent_1, macroFolders, macroCorePath)];
|
|
107
111
|
case 2:
|
|
108
|
-
_b.apply(_a, _c.concat([__spreadArray.apply(void 0, _d.concat([__read.apply(void 0, [(_e.sent())])]))]));
|
|
112
|
+
_b.apply(_a, _c.concat([__spreadArray.apply(void 0, _d.concat([__read.apply(void 0, [(_e.sent())]), false]))]));
|
|
109
113
|
_e.label = 3;
|
|
110
114
|
case 3:
|
|
111
|
-
dependencyPaths.push.apply(dependencyPaths, __spreadArray([], __read(filePaths)));
|
|
115
|
+
dependencyPaths.push.apply(dependencyPaths, __spreadArray([], __read(filePaths), false));
|
|
112
116
|
return [2 /*return*/];
|
|
113
117
|
}
|
|
114
118
|
});
|
|
@@ -117,21 +121,23 @@ function getDependencyPaths(fileContent, macroFolders, macroCorePath) {
|
|
|
117
121
|
_a.sent();
|
|
118
122
|
return [3 /*break*/, 4];
|
|
119
123
|
case 3:
|
|
120
|
-
|
|
121
|
-
|
|
124
|
+
if (macroFolders.includes(sourcePath)) {
|
|
125
|
+
throw "Error listing dependency paths: Source path ".concat(sourcePath, " does not exist.");
|
|
126
|
+
}
|
|
127
|
+
_a.label = 4;
|
|
122
128
|
case 4: return [2 /*return*/];
|
|
123
129
|
}
|
|
124
130
|
});
|
|
125
131
|
}); })];
|
|
126
132
|
case 1:
|
|
133
|
+
// Search dependencies recursively starting from macroFolders and ending in macroCorePath
|
|
127
134
|
_a.sent();
|
|
128
|
-
notFoundDependencies = utils_1.diff(dependencies, foundDependencies);
|
|
135
|
+
notFoundDependencies = (0, utils_1.diff)(dependencies, foundDependencies);
|
|
129
136
|
if (notFoundDependencies.length) {
|
|
130
|
-
|
|
131
|
-
throw errorMessage;
|
|
137
|
+
throw 'Unable to locate dependencies: ' + notFoundDependencies.join(', ');
|
|
132
138
|
}
|
|
133
|
-
dependencyPaths = _1.prioritiseDependencyOverrides(dependencies, dependencyPaths, macroFolders);
|
|
134
|
-
return [2 /*return*/, __spreadArray([], __read(new Set(dependencyPaths)))];
|
|
139
|
+
dependencyPaths = (0, _1.prioritiseDependencyOverrides)(dependencies, dependencyPaths, macroFolders);
|
|
140
|
+
return [2 /*return*/, __spreadArray([], __read(new Set(dependencyPaths)), false)];
|
|
135
141
|
}
|
|
136
142
|
});
|
|
137
143
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getDependencyPaths.js","sourceRoot":"","sources":["../../src/sasjsCli/getDependencyPaths.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"getDependencyPaths.js","sourceRoot":"","sources":["../../src/sasjsCli/getDependencyPaths.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8CAAuB;AACvB,gCAAgD;AAChD,kCAA6C;AAC7C,uBAA2D;AAE3D,SAAsB,kBAAkB,CACtC,WAAmB,EACnB,YAAsB,EACtB,aAAqB;;;;;;;oBAEjB,eAAe,GAAa,EAAE,CAAA;oBAC5B,iBAAiB,GAAa,EAAE,CAAA;oBAChC,WAAW,0CAAO,YAAY,YAAE,aAAa,SAAC,CAAA;oBAE9C,kBAAkB,GA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AI,EAAC,YAAY,EAAE,iBAAiB,CAAC,CAAA;oBAElE,IAAI,oBAAoB,CAAC,MAAM,EAAE;wBAC/B,MAAM,iCAAiC,GAAG,oBAAoB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;qBAC1E;oBAED,eAAe,GAAG,IAAA,gCAA6B,EAC7C,YAAY,EACZ,eAAe,EACf,YAAY,CACb,CAAA;oBAED,+CAAW,IAAI,GAAG,CAAC,eAAe,CAAC,WAAC;;;;CACrC;AAvDD,gDAuDC"}
|
|
@@ -1,29 +1,26 @@
|
|
|
1
1
|
import { Configuration, SASJsFileType, Target } from '../types';
|
|
2
|
+
export declare enum ProgramType {
|
|
3
|
+
Init = "init",
|
|
4
|
+
Term = "term"
|
|
5
|
+
}
|
|
2
6
|
interface getInitTermParams {
|
|
3
7
|
configuration?: Configuration;
|
|
4
8
|
target?: Target;
|
|
5
|
-
|
|
9
|
+
fileType: SASJsFileType;
|
|
6
10
|
buildSourceFolder: string;
|
|
7
11
|
}
|
|
8
|
-
export declare const getInitTerm: ({ configuration, target,
|
|
12
|
+
export declare const getInitTerm: ({ configuration, target, fileType, buildSourceFolder }: getInitTermParams) => Promise<{
|
|
9
13
|
init: string;
|
|
10
14
|
initPath: string;
|
|
11
15
|
term: string;
|
|
12
16
|
termPath: string;
|
|
13
17
|
startUpVars: string;
|
|
14
18
|
}>;
|
|
15
|
-
|
|
16
|
-
configuration?: Configuration;
|
|
17
|
-
target?: Target;
|
|
18
|
-
buildSourceFolder: string;
|
|
19
|
-
type: SASJsFileType;
|
|
20
|
-
}
|
|
21
|
-
export declare const getInit: ({ target, configuration, buildSourceFolder, type }: getInitTermParam) => Promise<{
|
|
22
|
-
content: string;
|
|
23
|
-
filePath: string;
|
|
24
|
-
}>;
|
|
25
|
-
export declare const getTerm: ({ target, configuration, buildSourceFolder, type }: getInitTermParam) => Promise<{
|
|
19
|
+
export declare const getProgram: ({ target, configuration, buildSourceFolder, fileType }: getInitTermParams, programType: ProgramType) => Promise<{
|
|
26
20
|
content: string;
|
|
27
21
|
filePath: string;
|
|
28
22
|
}>;
|
|
23
|
+
export declare const mockGetProgram: (module: {
|
|
24
|
+
getProgram: (param: getInitTermParams, programType: ProgramType) => {};
|
|
25
|
+
}, fakeInit: string, fakeTerm: string) => void;
|
|
29
26
|
export {};
|