@sasjs/utils 4.1.1 → 4.2.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.
package/README.md CHANGED
@@ -20,6 +20,7 @@ import { ServerType } from '@sasjs/utils/types'
20
20
  import { prefixMessage } from '@sasjs/utils/error'
21
21
  import { isSpecialMissing } from '@sasjs/utils/input/validators'
22
22
  import { bytesToSize } from '@sasjs/utils/utils'
23
+ import { parseLog } from '@sasjs/utils/logs'
23
24
  ```
24
25
 
25
26
  The hash and sync helpers - `getHash`, `compareHashes`, `extractHashArray`,
@@ -29,6 +30,20 @@ folders on disk, so they are Node-only, and the barrel does not re-export them:
29
30
  bundle that imports the barrel for anything else no longer reaches `crypto`, which used to
30
31
  arrive with the whole AES/RSA/ECDSA polyfill suite behind it.
31
32
 
33
+ `@sasjs/utils/logs` parses a SAS log: `parseLog(text)` returns every `ERROR`,
34
+ `WARNING` and notable `NOTE` as an issue addressed by line and column, and
35
+ `nextIssue(issues, line, direction)` walks that list for a next/previous problem
36
+ control. It is a pair of pure functions with no imports at all, so it runs
37
+ unchanged in Node, in a browser bundle and in an editor extension, and it lives
38
+ on a subpath so a browser never reaches the barrel's Node dependencies.
39
+
40
+ Only the notes the log-checking literature chases are reported - an
41
+ uninitialized variable, invalid data, a W.D format too small, values converted to
42
+ another type, repeats of BY values - because a log carries thousands of ordinary
43
+ notes and none of them is what a reader is looking for. The list is
44
+ `NOTE_KEYWORDS` in `src/logs/sasLog.ts`, and adding a keyword is how the scope
45
+ grows.
46
+
32
47
  ## Contributors ✨
33
48
 
34
49
  Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
package/file/file.d.ts CHANGED
@@ -7,8 +7,20 @@ export declare function folderExists(folderPath: string): Promise<boolean>;
7
7
  * Returns the paths of every file named `fileName` at or below `folder`.
8
8
  * Node's own fs covers this now, so it replaces the unmaintained `find`
9
9
  * package. Unreadable folders are skipped rather than throwing.
10
+ *
11
+ * The first lookup in a folder indexes it; later lookups are answered from that
12
+ * index. `clearFileSearchIndex` forgets them, which is what a caller that adds
13
+ * or removes files after a lookup has to do.
10
14
  */
11
15
  export declare function findFilesByName(fileName: string, folder: string): string[];
16
+ /**
17
+ * Forgets every indexed folder.
18
+ *
19
+ * Anything that creates, renames or deletes files and then looks them up in the
20
+ * same process has to call this first, or the lookup answers from the tree as
21
+ * it was when the folder was first searched.
22
+ */
23
+ export declare const clearFileSearchIndex: () => void;
12
24
  export declare function isFolder(inputPath: string): Promise<boolean>;
13
25
  export declare function readFile(fileName: string, encoding?: BufferEncoding): Promise<string>;
14
26
  export declare function readFileBinary(fileName: string): Promise<Buffer>;
package/file/file.js CHANGED
@@ -31,7 +31,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
31
31
  return (mod && mod.__esModule) ? mod : { "default": mod };
32
32
  };
33
33
  Object.defineProperty(exports, "__esModule", { value: true });
34
- exports.getLineEnding = exports.isTestFile = exports.testFileRegExp = exports.createReadStream = exports.createWriteStream = exports.getRealPath = exports.base64EncodeFile = exports.base64EncodeImageFile = exports.pathSepEscaped = exports.copy = exports.moveFile = exports.getRelativePath = exports.unifyFilePath = exports.deleteFolder = exports.deleteFile = exports.createFile = exports.createFolder = exports.listFilesAndSubFoldersInFolder = exports.listSubFoldersInFolder = exports.listSasFilesInFolder = exports.listIniFilesInFolder = exports.listFilesInFolder = exports.readFileBinary = exports.readFile = exports.isFolder = exports.findFilesByName = exports.folderExists = exports.fileExists = void 0;
34
+ exports.getLineEnding = exports.isTestFile = exports.testFileRegExp = exports.createReadStream = exports.createWriteStream = exports.getRealPath = exports.base64EncodeFile = exports.base64EncodeImageFile = exports.pathSepEscaped = exports.copy = exports.moveFile = exports.getRelativePath = exports.unifyFilePath = exports.deleteFolder = exports.deleteFile = exports.createFile = exports.createFolder = exports.listFilesAndSubFoldersInFolder = exports.listSubFoldersInFolder = exports.listSasFilesInFolder = exports.listIniFilesInFolder = exports.listFilesInFolder = exports.readFileBinary = exports.readFile = exports.isFolder = exports.clearFileSearchIndex = exports.findFilesByName = exports.folderExists = exports.fileExists = void 0;
35
35
  const fs_extra_1 = __importDefault(require("fs-extra"));
36
36
  const path_1 = __importDefault(require("path"));
37
37
  const utils_1 = require("../utils");
@@ -55,13 +55,62 @@ function folderExists(folderPath) {
55
55
  });
56
56
  }
57
57
  exports.folderExists = folderExists;
58
+ /**
59
+ * Folders already walked, keyed by resolved path.
60
+ *
61
+ * A caller asks for one file name at a time across the whole search path, and
62
+ * asks thousands of times over the same handful of folders - a compile resolves
63
+ * every declared macro of every file against the project's macro folders and
64
+ * @sasjs/core. The walk is the expensive part (one `readdir` per directory, per
65
+ * name), and what it finds does not change while a command runs, so each folder
66
+ * is walked once.
67
+ */
68
+ const folderIndex = new Map();
58
69
  /**
59
70
  * Returns the paths of every file named `fileName` at or below `folder`.
60
71
  * Node's own fs covers this now, so it replaces the unmaintained `find`
61
72
  * package. Unreadable folders are skipped rather than throwing.
73
+ *
74
+ * The first lookup in a folder indexes it; later lookups are answered from that
75
+ * index. `clearFileSearchIndex` forgets them, which is what a caller that adds
76
+ * or removes files after a lookup has to do.
62
77
  */
63
78
  function findFilesByName(fileName, folder) {
64
- const matches = [];
79
+ const key = path_1.default.resolve(folder);
80
+ let index = folderIndex.get(key);
81
+ if (!index) {
82
+ index = indexFolder(folder);
83
+ // A folder that cannot be read is not remembered: it can be created later
84
+ // in the same process, and a cached empty result would hide its files.
85
+ if (index)
86
+ folderIndex.set(key, index);
87
+ }
88
+ // A copy, so a caller adding to the result cannot change the index.
89
+ return index ? [...(index.get(fileName) || [])] : [];
90
+ }
91
+ exports.findFilesByName = findFilesByName;
92
+ /**
93
+ * Forgets every indexed folder.
94
+ *
95
+ * Anything that creates, renames or deletes files and then looks them up in the
96
+ * same process has to call this first, or the lookup answers from the tree as
97
+ * it was when the folder was first searched.
98
+ */
99
+ const clearFileSearchIndex = () => folderIndex.clear();
100
+ exports.clearFileSearchIndex = clearFileSearchIndex;
101
+ /**
102
+ * Walks a folder once, collecting every file path by name. Returns undefined
103
+ * when the folder itself cannot be read; unreadable subfolders are skipped, as
104
+ * they always have been.
105
+ */
106
+ const indexFolder = (folder) => {
107
+ try {
108
+ fs_extra_1.default.readdirSync(folder, { withFileTypes: true });
109
+ }
110
+ catch (_) {
111
+ return undefined;
112
+ }
113
+ const index = new Map();
65
114
  const walk = (dir) => {
66
115
  let entries;
67
116
  try {
@@ -72,16 +121,20 @@ function findFilesByName(fileName, folder) {
72
121
  }
73
122
  for (const entry of entries) {
74
123
  const entryPath = path_1.default.join(dir, entry.name);
75
- if (entry.isDirectory())
124
+ if (entry.isDirectory()) {
76
125
  walk(entryPath);
77
- else if (entry.name === fileName)
78
- matches.push(entryPath);
126
+ continue;
127
+ }
128
+ const paths = index.get(entry.name);
129
+ if (paths)
130
+ paths.push(entryPath);
131
+ else
132
+ index.set(entry.name, [entryPath]);
79
133
  }
80
134
  };
81
135
  walk(folder);
82
- return matches;
83
- }
84
- exports.findFilesByName = findFilesByName;
136
+ return index;
137
+ };
85
138
  function isFolder(inputPath) {
86
139
  return __awaiter(this, void 0, void 0, function* () {
87
140
  return fs_extra_1.default.promises
package/file/file.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"file.js","sourceRoot":"","sources":["../../src/file/file.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wDAAyB;AACzB,gDAAuB;AACvB,oCAAuC;AACvC,wCAAyB;AACzB,oCAAsC;AAEtC,SAAsB,UAAU,CAAC,QAAgB;;QAC/C,OAAO,kBAAE,CAAC,QAAQ;aACf,MAAM,CAAC,QAAQ,EAAE,kBAAE,CAAC,SAAS,CAAC,IAAI,CAAC;aACnC,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC;aAChB,KAAK,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,CAAA;IACvB,CAAC;CAAA;AALD,gCAKC;AAED,SAAsB,YAAY,CAAC,UAAk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aAAa,iBACsD"}
package/file/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- export { fileExists, folderExists, findFilesByName, isFolder, readFile, readFileBinary, listFilesInFolder, listIniFilesInFolder, listSasFilesInFolder, listSubFoldersInFolder, listFilesAndSubFoldersInFolder, createFile, createFolder, createReadStream, createWriteStream, deleteFile, deleteFolder, getRelativePath, unifyFilePath, moveFile, pathSepEscaped, copy, base64EncodeImageFile, base64EncodeFile, getRealPath, isTestFile, testFileRegExp, getLineEnding } from './file';
1
+ export { fileExists, folderExists, findFilesByName, clearFileSearchIndex, isFolder, readFile, readFileBinary, listFilesInFolder, listIniFilesInFolder, listSasFilesInFolder, listSubFoldersInFolder, listFilesAndSubFoldersInFolder, createFile, createFolder, createReadStream, createWriteStream, deleteFile, deleteFolder, getRelativePath, unifyFilePath, moveFile, pathSepEscaped, copy, base64EncodeImageFile, base64EncodeFile, getRealPath, isTestFile, testFileRegExp, getLineEnding } from './file';
2
2
  export { updateCsv, createCsv, readCsv } from './csvFile';
3
3
  export * from './getAbsolutePath';
package/file/index.js CHANGED
@@ -10,11 +10,12 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
10
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
11
  };
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
- exports.readCsv = exports.createCsv = exports.updateCsv = exports.getLineEnding = exports.testFileRegExp = exports.isTestFile = exports.getRealPath = exports.base64EncodeFile = exports.base64EncodeImageFile = exports.copy = exports.pathSepEscaped = exports.moveFile = exports.unifyFilePath = exports.getRelativePath = exports.deleteFolder = exports.deleteFile = exports.createWriteStream = exports.createReadStream = exports.createFolder = exports.createFile = exports.listFilesAndSubFoldersInFolder = exports.listSubFoldersInFolder = exports.listSasFilesInFolder = exports.listIniFilesInFolder = exports.listFilesInFolder = exports.readFileBinary = exports.readFile = exports.isFolder = exports.findFilesByName = exports.folderExists = exports.fileExists = void 0;
13
+ exports.readCsv = exports.createCsv = exports.updateCsv = exports.getLineEnding = exports.testFileRegExp = exports.isTestFile = exports.getRealPath = exports.base64EncodeFile = exports.base64EncodeImageFile = exports.copy = exports.pathSepEscaped = exports.moveFile = exports.unifyFilePath = exports.getRelativePath = exports.deleteFolder = exports.deleteFile = exports.createWriteStream = exports.createReadStream = exports.createFolder = exports.createFile = exports.listFilesAndSubFoldersInFolder = exports.listSubFoldersInFolder = exports.listSasFilesInFolder = exports.listIniFilesInFolder = exports.listFilesInFolder = exports.readFileBinary = exports.readFile = exports.isFolder = exports.clearFileSearchIndex = exports.findFilesByName = exports.folderExists = exports.fileExists = void 0;
14
14
  var file_1 = require("./file");
15
15
  Object.defineProperty(exports, "fileExists", { enumerable: true, get: function () { return file_1.fileExists; } });
16
16
  Object.defineProperty(exports, "folderExists", { enumerable: true, get: function () { return file_1.folderExists; } });
17
17
  Object.defineProperty(exports, "findFilesByName", { enumerable: true, get: function () { return file_1.findFilesByName; } });
18
+ Object.defineProperty(exports, "clearFileSearchIndex", { enumerable: true, get: function () { return file_1.clearFileSearchIndex; } });
18
19
  Object.defineProperty(exports, "isFolder", { enumerable: true, get: function () { return file_1.isFolder; } });
19
20
  Object.defineProperty(exports, "readFile", { enumerable: true, get: function () { return file_1.readFile; } });
20
21
  Object.defineProperty(exports, "readFileBinary", { enumerable: true, get: function () { return file_1.readFileBinary; } });
package/file/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/file/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,+BA6Be;AA5Bb,kGAAA,UAAU,OAAA;AACV,oGAAA,YAAY,OAAA;AACZ,uGAAA,eAAe,OAAA;AACf,gGAAA,QAAQ,OAAA;AACR,gGAAA,QAAQ,OAAA;AACR,sGAAA,cAAc,OAAA;AACd,yGAAA,iBAAiB,OAAA;AACjB,4GAAA,oBAAoB,OAAA;AACpB,4GAAA,oBAAoB,OAAA;AACpB,8GAAA,sBAAs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,OAAA;AACd,4FAAA,IAAI,OAAA;AACJ,6GAAA,qBAAqB,OAAA;AACrB,wGAAA,gBAAgB,OAAA;AAChB,mGAAA,WAAW,OAAA;AACX,kGAAA,UAAU,OAAA;AACV,sGAAA,cAAc,OAAA;AACd,qGAAA,aAAa,OAAA;AAGf,qCAAyD;AAAhD,oGAAA,SAAS,OAAA;AAAE,oGAAA,SAAS,OAAA;AAAE,kGAAA,OAAO,OAAA;AACtC,oDAAiC"}
package/index.d.ts CHANGED
@@ -3,6 +3,7 @@ export * from './file';
3
3
  export * from './formatter';
4
4
  export * from './input';
5
5
  export * from './logger';
6
+ export * from './logs';
6
7
  export * from './sasjsCli';
7
8
  export * from './time';
8
9
  export * from './types';
package/index.js CHANGED
@@ -15,6 +15,7 @@ __exportStar(require("./file"), exports);
15
15
  __exportStar(require("./formatter"), exports);
16
16
  __exportStar(require("./input"), exports);
17
17
  __exportStar(require("./logger"), exports);
18
+ __exportStar(require("./logs"), exports);
18
19
  __exportStar(require("./sasjsCli"), exports);
19
20
  __exportStar(require("./time"), exports);
20
21
  __exportStar(require("./types"), exports);
package/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yCAAsB;AACtB,yCAAsB;AACtB,8CAA2B;AAC3B,0CAAuB;AACvB,2CAAwB;AACxB,6CAA0B;AAC1B,yCAAsB;AACtB,0CAAuB;AACvB,0CAAuB;AACvB,gDAA6B;AAC7B,yEAAyE;AACzE,6EAA6E;AAC7E,6EAA6E;AAC7E,6EAA6E;AAC7E,4EAA4E;AAC5E,uBAAuB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yCAAsB;AACtB,yCAAsB;AACtB,8CAA2B;AAC3B,0CAAuB;AACvB,2CAAwB;AACxB,yCAAsB;AACtB,6CAA0B;AAC1B,yCAAsB;AACtB,0CAAuB;AACvB,0CAAuB;AACvB,gDAA6B;AAC7B,yEAAyE;AACzE,6EAA6E;AAC7E,6EAA6E;AAC7E,6EAA6E;AAC7E,4EAA4E;AAC5E,uBAAuB"}
@@ -0,0 +1 @@
1
+ export * from './sasLog';
package/logs/index.js ADDED
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
+ };
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ __exportStar(require("./sasLog"), exports);
14
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/logs/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAAwB"}
@@ -0,0 +1,87 @@
1
+ /**
2
+ * SAS log parsing.
3
+ *
4
+ * A SAS log is a stream of statements and messages, and only the messages
5
+ * matter to a reader looking for trouble: everything SAS prints at the start of
6
+ * a line as `ERROR:`, `WARNING:` or `NOTE:`. This module finds those messages
7
+ * and reports where they are, as line and column indexes into the text it was
8
+ * given, so a host can underline them without re-scanning the log and without
9
+ * rewriting it.
10
+ *
11
+ * What is recognised:
12
+ *
13
+ * ERROR: Libref X is not assigned.
14
+ * ERROR 22-322: Syntax error, expecting one of the following: ;, CANCEL,
15
+ * RUN, QUIT.
16
+ * WARNING 1-322: Assuming the symbol Y was misspelled.
17
+ * NOTE: Variable x is uninitialized.
18
+ *
19
+ * The numeric code between the marker and the colon is SAS's own message
20
+ * identifier and is reported separately, so a host can group by it.
21
+ *
22
+ * NOTES are reported only when they are the ones the log-checking literature
23
+ * flags - see NOTE_KEYWORDS. A log carries thousands of ordinary notes and none
24
+ * of them is what a reader is looking for, so the vocabulary is a closed list
25
+ * rather than "any NOTE". INFO lines are not reported at all.
26
+ *
27
+ * Lines SAS wrapped are folded into the message they belong to, so one problem
28
+ * is one issue rather than one issue per wrapped line, and the keyword search
29
+ * runs on the folded message - a note whose keyword lands on the second line is
30
+ * still found. Lines that merely contain the word ERROR are not matched: the
31
+ * marker has to start the line, which keeps a print of a data set, or a message
32
+ * quoting another log, out of the results.
33
+ *
34
+ * ODS HTML logs wrap every line in markup. A tag sequence before the marker is
35
+ * skipped and tags are stripped from the reported message, so the same parse
36
+ * serves a plain log and an HTML one. The line and column indexes stay those of
37
+ * the text as supplied, because they are what the caller needs to address.
38
+ *
39
+ * Nothing here touches the log: the caller renders from the issue list, which is
40
+ * what lets one log be shown in an editor, in a browser panel and in a report
41
+ * from the same parse.
42
+ */
43
+ /**
44
+ * The severities a log issue can carry. `note` is only ever a notable note - see
45
+ * NOTE_KEYWORDS - never an ordinary one.
46
+ */
47
+ export declare type LogSeverity = 'error' | 'warning' | 'note';
48
+ /** One ERROR, WARNING or notable NOTE in a SAS log, addressed in the text it was parsed from. */
49
+ export interface LogIssue {
50
+ /** Zero-based index of the line carrying the marker. */
51
+ line: number;
52
+ /** Zero-based index of the last line SAS wrapped into this message. */
53
+ endLine: number;
54
+ /** Zero-based column where the marker starts on `line`. */
55
+ column: number;
56
+ /** Zero-based column one past the end of `line`, for underlining it. */
57
+ endColumn: number;
58
+ /** The marker that introduced the issue. */
59
+ severity: LogSeverity;
60
+ /** SAS's message identifier, e.g. `22-322` for `ERROR 22-322:`. */
61
+ code?: string;
62
+ /** The message text, with wrapped lines joined and markup stripped. */
63
+ message: string;
64
+ }
65
+ /** Direction of travel for {@link nextIssue}. */
66
+ export declare type IssueDirection = 'next' | 'previous';
67
+ /** Whether a note's message is one of the notable ones. */
68
+ export declare const isNotableNote: (message: string) => boolean;
69
+ /**
70
+ * Finds every ERROR and WARNING in a SAS log, and every notable note.
71
+ *
72
+ * The issue list is in log order. `line` and `column` address the text as
73
+ * supplied, so a caller can offset a decoration or a diagnostic by them
74
+ * directly. A host that wants errors only filters on `severity`; nothing is
75
+ * behind an option, because a notable note is worth reporting wherever the log
76
+ * is shown.
77
+ */
78
+ export declare const parseLog: (text: string) => LogIssue[];
79
+ /**
80
+ * The issue after (or before) a given line, wrapping around, which is the
81
+ * behaviour both a "next problem" button and a "previous problem" button need.
82
+ *
83
+ * A line of -1 starts at the beginning, and a line past the end starts again
84
+ * from the beginning, so a caller does not have to special-case either end.
85
+ * Returns undefined only when the log holds no issues.
86
+ */
87
+ export declare const nextIssue: (issues: LogIssue[], line: number, direction?: IssueDirection) => LogIssue | undefined;
package/logs/sasLog.js ADDED
@@ -0,0 +1,186 @@
1
+ "use strict";
2
+ /**
3
+ * SAS log parsing.
4
+ *
5
+ * A SAS log is a stream of statements and messages, and only the messages
6
+ * matter to a reader looking for trouble: everything SAS prints at the start of
7
+ * a line as `ERROR:`, `WARNING:` or `NOTE:`. This module finds those messages
8
+ * and reports where they are, as line and column indexes into the text it was
9
+ * given, so a host can underline them without re-scanning the log and without
10
+ * rewriting it.
11
+ *
12
+ * What is recognised:
13
+ *
14
+ * ERROR: Libref X is not assigned.
15
+ * ERROR 22-322: Syntax error, expecting one of the following: ;, CANCEL,
16
+ * RUN, QUIT.
17
+ * WARNING 1-322: Assuming the symbol Y was misspelled.
18
+ * NOTE: Variable x is uninitialized.
19
+ *
20
+ * The numeric code between the marker and the colon is SAS's own message
21
+ * identifier and is reported separately, so a host can group by it.
22
+ *
23
+ * NOTES are reported only when they are the ones the log-checking literature
24
+ * flags - see NOTE_KEYWORDS. A log carries thousands of ordinary notes and none
25
+ * of them is what a reader is looking for, so the vocabulary is a closed list
26
+ * rather than "any NOTE". INFO lines are not reported at all.
27
+ *
28
+ * Lines SAS wrapped are folded into the message they belong to, so one problem
29
+ * is one issue rather than one issue per wrapped line, and the keyword search
30
+ * runs on the folded message - a note whose keyword lands on the second line is
31
+ * still found. Lines that merely contain the word ERROR are not matched: the
32
+ * marker has to start the line, which keeps a print of a data set, or a message
33
+ * quoting another log, out of the results.
34
+ *
35
+ * ODS HTML logs wrap every line in markup. A tag sequence before the marker is
36
+ * skipped and tags are stripped from the reported message, so the same parse
37
+ * serves a plain log and an HTML one. The line and column indexes stay those of
38
+ * the text as supplied, because they are what the caller needs to address.
39
+ *
40
+ * Nothing here touches the log: the caller renders from the issue list, which is
41
+ * what lets one log be shown in an editor, in a browser panel and in a report
42
+ * from the same parse.
43
+ */
44
+ Object.defineProperty(exports, "__esModule", { value: true });
45
+ exports.nextIssue = exports.parseLog = exports.isNotableNote = void 0;
46
+ /**
47
+ * `ERROR`, `WARNING` or `NOTE` at the start of a line, optionally preceded by
48
+ * the tags of an HTML log, optionally followed by SAS's message identifier,
49
+ * then a colon. The prefix is captured so the marker's column is exact even when
50
+ * tags lead it.
51
+ */
52
+ const MARKER = /^((?:<[^>]*>)*\s*)(ERROR|WARNING|NOTE)(?:\s+(\d+-\d+))?:[ \t]?(.*)$/i;
53
+ /**
54
+ * The notes worth reporting, matched case-insensitively against the folded
55
+ * message. Each is a message SAS prints when something has gone wrong quietly -
56
+ * a variable never set, a row that failed input, a value silently converted, a
57
+ * format too small to hold a number - and each is chased by the log checkers
58
+ * published in the SAS user-group papers: "Log Checks Made Easy" (SAS Global
59
+ * Forum 2012, 042-2012), "Check Please: An Automated Approach to Log Checking"
60
+ * (MWSUG 2017, TT02), "You've Got E-Mail: Automatic Log Checking via E-Mail
61
+ * Notification" (SUGI 31, 128-31) and the note table behind SASLogChecker.
62
+ *
63
+ * Adding a keyword widens what every host reports, so the list is deliberately
64
+ * short: a message belongs here when a reviewer would want to see it even though
65
+ * SAS called it a note.
66
+ */
67
+ const NOTE_KEYWORDS = [
68
+ 'is uninitialized',
69
+ 'Missing values were generated',
70
+ 'Division by zero',
71
+ 'Mathematical operations could not be performed',
72
+ 'Invalid data',
73
+ 'Invalid argument',
74
+ 'Invalid third argument',
75
+ 'have been converted to',
76
+ 'The meaning of an identifier',
77
+ 'too small for',
78
+ 'Unreferenced label',
79
+ 'WHERE clause has been replaced',
80
+ 'stopped due to looping',
81
+ 'will be overwritten by data set',
82
+ 'repeats of BY values',
83
+ 'was not found',
84
+ 'reached past the end of a line',
85
+ 'LOST CARD',
86
+ 'NOEXEC',
87
+ 'A CASE expression has no ELSE clause',
88
+ 'have been thinned',
89
+ 'discarded because neither',
90
+ 'Processing on disk occurred during summarization',
91
+ 'log axis cannot support',
92
+ 'lines were truncated',
93
+ 'outside the axis range',
94
+ 'infinite likelihood',
95
+ 'not positive definite',
96
+ 'The SAS System stopped processing this step because of errors'
97
+ ];
98
+ const NOTABLE_NOTE_KEYWORDS = NOTE_KEYWORDS.map((keyword) => keyword.toLowerCase());
99
+ /** How many wrapped lines one message may absorb, so a malformed log cannot run away. */
100
+ const MAX_WRAPPED_LINES = 10;
101
+ /** Whether a note's message is one of the notable ones. */
102
+ const isNotableNote = (message) => {
103
+ const lower = message.toLowerCase();
104
+ return NOTABLE_NOTE_KEYWORDS.some((keyword) => lower.includes(keyword));
105
+ };
106
+ exports.isNotableNote = isNotableNote;
107
+ /** A line SAS wrapped: indented, and not one of the pointer lines it prints under source. */
108
+ const isWrappedLine = (line) => /^\s+\S/.test(line) &&
109
+ !/^\s*[-_]+\s*$/.test(line) &&
110
+ !/^\s*\d+\s*$/.test(line);
111
+ /** Removes markup and collapses the whitespace a wrapped message carries. */
112
+ const clean = (text) => text
113
+ .replace(/<[^>]*>/g, '')
114
+ .replace(/\s+/g, ' ')
115
+ .trim();
116
+ /**
117
+ * Finds every ERROR and WARNING in a SAS log, and every notable note.
118
+ *
119
+ * The issue list is in log order. `line` and `column` address the text as
120
+ * supplied, so a caller can offset a decoration or a diagnostic by them
121
+ * directly. A host that wants errors only filters on `severity`; nothing is
122
+ * behind an option, because a notable note is worth reporting wherever the log
123
+ * is shown.
124
+ */
125
+ const parseLog = (text) => {
126
+ var _a;
127
+ if (!text) {
128
+ return [];
129
+ }
130
+ const lines = text.split(/\r?\n/);
131
+ const issues = [];
132
+ for (let line = 0; line < lines.length; line++) {
133
+ const match = MARKER.exec(lines[line]);
134
+ if (!match) {
135
+ continue;
136
+ }
137
+ const markerLine = line;
138
+ const parts = [clean((_a = match[4]) !== null && _a !== void 0 ? _a : '')];
139
+ let endLine = markerLine;
140
+ let wrapped = 0;
141
+ while (wrapped < MAX_WRAPPED_LINES &&
142
+ endLine + 1 < lines.length &&
143
+ isWrappedLine(lines[endLine + 1])) {
144
+ endLine++;
145
+ wrapped++;
146
+ parts.push(clean(lines[endLine]));
147
+ }
148
+ const severity = match[2].toLowerCase();
149
+ const message = parts.filter((part) => part !== '').join(' ');
150
+ // The wrapped lines belong to this message whether or not it is reported, so
151
+ // the scan resumes after them either way.
152
+ line = endLine;
153
+ if (severity === 'note' && !(0, exports.isNotableNote)(message)) {
154
+ continue;
155
+ }
156
+ const code = match[3];
157
+ issues.push(Object.assign(Object.assign({ line: markerLine, endLine, column: match[1].length, endColumn: lines[markerLine].length, severity }, (code ? { code } : {})), { message }));
158
+ }
159
+ return issues;
160
+ };
161
+ exports.parseLog = parseLog;
162
+ /**
163
+ * The issue after (or before) a given line, wrapping around, which is the
164
+ * behaviour both a "next problem" button and a "previous problem" button need.
165
+ *
166
+ * A line of -1 starts at the beginning, and a line past the end starts again
167
+ * from the beginning, so a caller does not have to special-case either end.
168
+ * Returns undefined only when the log holds no issues.
169
+ */
170
+ const nextIssue = (issues, line, direction = 'next') => {
171
+ var _a;
172
+ if (issues.length === 0) {
173
+ return undefined;
174
+ }
175
+ if (direction === 'next') {
176
+ return (_a = issues.find((issue) => issue.line > line)) !== null && _a !== void 0 ? _a : issues[0];
177
+ }
178
+ for (let index = issues.length - 1; index >= 0; index--) {
179
+ if (issues[index].line < line) {
180
+ return issues[index];
181
+ }
182
+ }
183
+ return issues[issues.length - 1];
184
+ };
185
+ exports.nextIssue = nextIssue;
186
+ //# sourceMappingURL=sasLog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sasLog.js","sourceRoot":"","sources":["../../src/logs/sasLog.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;;;AA6BH;;;;;GAKG;AACH,MAAM,MAAM,GACV,sEAAsE,CAAA;AAExE;;;;;;;;;;;;;GAaG;AACH,MAAM,aAAa,GAAG;IACpB,kBAAkB;IAClB,+BAA+B;IAC/B,kBAAkB;IAClB,gDAAgD;IAChD,cAAc;IACd,kBAAkB;IAClB,wBAAwB;IACxB,wBAAwB;IACxB,8BAA8B;IAC9B,eAAe;IACf,oBAAoB;IACpB,gCAAgC;IAChC,wBAAwB;IACxB,iCAAiC;IACjC,sBAAsB;IACtB,eAAe;IACf,gCAAgC;IAChC,WAAW;IACX,QAAQ;IACR,sCAAsC;IACtC,mBAAmB;IACnB,2BAA2B;IAC3B,kDAAkD;IAClD,yBAAyB;IACzB,sBAAsB;IACtB,wBAAwB;IACxB,qBAAqB;IACrB,uBAAuB;IACvB,+DAA+D;CAChE,CAAA;AAED,MAAM,qBAAqB,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAC1D,OAAO,CAAC,WAAW,EAAE,CACtB,CAAA;AAED,yFAAyF;AACzF,MAAM,iBAAiB,GAAG,EAAE,CAAA;AAE5B,2DAA2D;AACpD,MAAM,aAAa,GAAG,CAAC,OAAe,EAAW,EAAE;IACxD,MAAM,KAAK,GAAG,OAAO,CAAC,WAAW,EAAE,CAAA;IAEnC,OAAO,qBAAqB,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAA;AACzE,CAAC,CAAA;AAJY,QAAA,aAAa,iBAIzB;AAED,6FAA6F;AAC7F,MAAM,aAAa,GAAG,CAAC,IAAY,EAAW,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GAAG,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE,KAAK,EAAE,EAAE;QACvD,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,GAAG,IAAI,EAAE;YAC7B,OAAO,MAAM,CAAC,KAAK,CAAC,CAAA;SACrB;KACF;IAED,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAA;AAClC,CAAC,CAAA;AApBY,QAAA,SAAS,aAoBrB"}
package/package.json CHANGED
@@ -46,6 +46,7 @@
46
46
  "fs/**",
47
47
  "input/**",
48
48
  "logger/**",
49
+ "logs/**",
49
50
  "macros/**",
50
51
  "sasjsCli/**",
51
52
  "time/**",
@@ -95,5 +96,5 @@
95
96
  "jwt-decode": "4.0.0",
96
97
  "prompts": "2.4.2"
97
98
  },
98
- "version": "4.1.1"
99
+ "version": "4.2.0"
99
100
  }