@appland/appmap 3.76.0 → 3.77.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/CHANGELOG.md +10 -0
- package/built/cli.js +4 -179
- package/built/cli.js.map +1 -1
- package/built/cmds/openapi.js +4 -23
- package/built/cmds/openapi.js.map +1 -1
- package/built/cmds/prune/prune.js +8 -7
- package/built/cmds/prune/prune.js.map +1 -1
- package/built/cmds/prune/pruneAppMap.js +13 -48
- package/built/cmds/prune/pruneAppMap.js.map +1 -1
- package/built/depends.js +1 -1
- package/built/depends.js.map +1 -1
- package/built/fingerprint/canonicalize.js +0 -3
- package/built/fingerprint/canonicalize.js.map +1 -1
- package/built/fingerprint/fingerprintDirectoryCommand.js +2 -1
- package/built/fingerprint/fingerprintDirectoryCommand.js.map +1 -1
- package/built/fingerprint/fingerprintQueue.js +2 -2
- package/built/fingerprint/fingerprintQueue.js.map +1 -1
- package/built/fingerprint/fingerprinter.js +18 -29
- package/built/fingerprint/fingerprinter.js.map +1 -1
- package/built/html/appmap.js +83 -80
- package/built/html/appmap.js.map +4 -4
- package/built/html/sequenceDiagram.js +83 -80
- package/built/html/sequenceDiagram.js.map +4 -4
- package/built/lib/fileSizeFilter.js +26 -0
- package/built/lib/fileSizeFilter.js.map +1 -0
- package/built/lib/filterAppMap.js +2 -5
- package/built/lib/filterAppMap.js.map +1 -1
- package/built/lib/flattenMetadata.js +1 -1
- package/built/lib/sqlErrorLog.js +24 -0
- package/built/lib/sqlErrorLog.js.map +1 -0
- package/package.json +1 -1
- package/built/fingerprint/canonicalize/info.js +0 -48
- package/built/fingerprint/canonicalize/info.js.map +0 -1
- package/built/fingerprint/canonicalize/trace.js +0 -51
- package/built/fingerprint/canonicalize/trace.js.map +0 -1
- package/built/fingerprint/canonicalize/update.js +0 -67
- package/built/fingerprint/canonicalize/update.js.map +0 -1
- package/built/lib/deserializeFilter.js +0 -16
- package/built/lib/deserializeFilter.js.map +0 -1
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
6
|
+
exports.VERSION = void 0;
|
|
7
7
|
const path_1 = require("path");
|
|
8
8
|
const graceful_fs_1 = __importDefault(require("graceful-fs"));
|
|
9
9
|
const util_1 = require("util");
|
|
@@ -18,9 +18,14 @@ const renameFile = (0, util_1.promisify)(graceful_fs_1.default.rename);
|
|
|
18
18
|
/**
|
|
19
19
|
* CHANGELOG
|
|
20
20
|
*
|
|
21
|
+
* # 1.2.0
|
|
22
|
+
*
|
|
23
|
+
* * Drop fingerprint fields, as these are no longer used by downstream tools.
|
|
24
|
+
* Canonicalization via sequence diagram is now the preferred mechanism.
|
|
25
|
+
*
|
|
21
26
|
* # 1.1.4
|
|
22
27
|
*
|
|
23
|
-
* Add missing status_code to normalized AppMaps.
|
|
28
|
+
* * Add missing status_code to normalized AppMaps.
|
|
24
29
|
*
|
|
25
30
|
* # 1.1.3
|
|
26
31
|
*
|
|
@@ -42,14 +47,13 @@ const renameFile = (0, util_1.promisify)(graceful_fs_1.default.rename);
|
|
|
42
47
|
* * Fix handling of parent assignment in normalization.
|
|
43
48
|
* * sql can contain the analysis (action, tables, columns), and/or the normalized query string.
|
|
44
49
|
*/
|
|
45
|
-
|
|
50
|
+
exports.VERSION = '1.2.0';
|
|
46
51
|
const MAX_APPMAP_SIZE = 50 * 1000 * 1000;
|
|
47
52
|
class Fingerprinter extends events_1.default {
|
|
48
|
-
constructor(
|
|
49
|
-
super();
|
|
50
|
-
this.printCanonicalAppMaps = printCanonicalAppMaps;
|
|
53
|
+
constructor() {
|
|
54
|
+
super(...arguments);
|
|
51
55
|
/**
|
|
52
|
-
* Whether to check if the version of existing
|
|
56
|
+
* Whether to check if the version of the existing index is up to date.
|
|
53
57
|
* When watching files for changes, it can be set to false after the initial
|
|
54
58
|
* pass to avoid re-reading the same 'version' files over and over.
|
|
55
59
|
*/
|
|
@@ -57,21 +61,21 @@ class Fingerprinter extends events_1.default {
|
|
|
57
61
|
}
|
|
58
62
|
async fingerprint(appMapFileName) {
|
|
59
63
|
if ((0, utils_1.verbose)()) {
|
|
60
|
-
console.log(`
|
|
64
|
+
console.log(`Indexing ${appMapFileName}`);
|
|
61
65
|
}
|
|
62
66
|
const index = new appmapIndex_1.default(appMapFileName);
|
|
63
67
|
if (!(await index.initialize())) {
|
|
64
68
|
return;
|
|
65
69
|
}
|
|
66
|
-
if ((!this.checkVersion || (await index.versionUpToDate(VERSION))) &&
|
|
70
|
+
if ((!this.checkVersion || (await index.versionUpToDate(exports.VERSION))) &&
|
|
67
71
|
(await index.indexUpToDate())) {
|
|
68
72
|
if ((0, utils_1.verbose)()) {
|
|
69
|
-
console.log('
|
|
73
|
+
console.log('Index is up to date. Skipping...');
|
|
70
74
|
}
|
|
71
75
|
return;
|
|
72
76
|
}
|
|
73
|
-
if (
|
|
74
|
-
throw new fileTooLargeError_1.default(appMapFileName,
|
|
77
|
+
if (index.appmapFileSize() > MAX_APPMAP_SIZE)
|
|
78
|
+
throw new fileTooLargeError_1.default(appMapFileName, index.appmapFileSize(), MAX_APPMAP_SIZE);
|
|
75
79
|
const appmapData = await index.loadAppMapData();
|
|
76
80
|
if (!appmapData)
|
|
77
81
|
return;
|
|
@@ -79,34 +83,19 @@ class Fingerprinter extends events_1.default {
|
|
|
79
83
|
if (!appmapDataWithoutMetadata)
|
|
80
84
|
return;
|
|
81
85
|
delete appmapDataWithoutMetadata.metadata;
|
|
82
|
-
const appmapDigest = (0, crypto_1.createHash)('sha256')
|
|
83
|
-
.update(JSON.stringify(appmapDataWithoutMetadata, null, 2))
|
|
84
|
-
.digest('hex');
|
|
85
|
-
const fingerprints = [];
|
|
86
|
-
appmapData.metadata.fingerprints = fingerprints;
|
|
87
86
|
const appmap = (0, models_1.buildAppMap)(appmapData).normalize().build();
|
|
88
87
|
await index.mkdir_p();
|
|
89
88
|
await Promise.all(Object.keys(canonicalize_1.algorithms).map(async (algorithmName) => {
|
|
90
89
|
const canonicalForm = (0, canonicalize_1.canonicalize)(algorithmName, appmap);
|
|
91
90
|
const canonicalJSON = JSON.stringify(canonicalForm, null, 2);
|
|
92
|
-
|
|
93
|
-
await index.writeFileAtomic(`canonical.${algorithmName}.json`, canonicalJSON);
|
|
94
|
-
}
|
|
95
|
-
const fingerprintDigest = (0, crypto_1.createHash)('sha256').update(canonicalJSON).digest('hex');
|
|
96
|
-
fingerprints.push({
|
|
97
|
-
appmap_digest: appmapDigest,
|
|
98
|
-
canonicalization_algorithm: algorithmName,
|
|
99
|
-
digest: fingerprintDigest,
|
|
100
|
-
fingerprint_algorithm: 'sha256',
|
|
101
|
-
});
|
|
91
|
+
await index.writeFileAtomic(`canonical.${algorithmName}.json`, canonicalJSON);
|
|
102
92
|
}));
|
|
103
|
-
appmapData.metadata.fingerprints.sort((a, b) => a.canonicalization_algorithm.localeCompare(b.canonicalization_algorithm));
|
|
104
93
|
const tempAppMapFileName = (0, path_1.join)(index.indexDir, 'appmap.tmp');
|
|
105
94
|
await index.writeFileAtomic((0, path_1.basename)(tempAppMapFileName), JSON.stringify(appmap, null, 2));
|
|
106
95
|
const appMapIndexedAt = await (0, utils_1.mtime)(tempAppMapFileName);
|
|
107
96
|
(0, assert_1.default)(appMapIndexedAt, `${tempAppMapFileName} should always exist and be a readable file`);
|
|
108
97
|
await Promise.all([
|
|
109
|
-
index.writeFileAtomic('version', VERSION),
|
|
98
|
+
index.writeFileAtomic('version', exports.VERSION),
|
|
110
99
|
index.writeFileAtomic('classMap.json', JSON.stringify(appmap.classMap, null, 2)),
|
|
111
100
|
index.writeFileAtomic('metadata.json', JSON.stringify(appmap.metadata, null, 2)),
|
|
112
101
|
index.writeFileAtomic('mtime', `${appMapIndexedAt}`),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fingerprinter.js","sourceRoot":"","sources":["../../src/fingerprint/fingerprinter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fingerprinter.js","sourceRoot":"","sources":["../../src/fingerprint/fingerprinter.ts"],"names":[],"mappings":";;;;;;AACA,+BAAkD;AAClD,8DAAqC;AACrC,+BAAiC;AACjC,4CAAwD;AACxD,oDAA4B;AAC5B,4EAAoD;AAEpD,oCAA0C;AAC1C,iDAA0D;AAC1D,gEAAwC;AACxC,oDAAkC;AAElC,MAAM,UAAU,GAAG,IAAA,gBAAS,EAAC,qBAAU,CAAC,MAAM,CAAC,CAAC;AAEhD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACU,QAAA,OAAO,GAAG,OAAO,CAAC;AAE/B,MAAM,eAAe,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC;AASzC,MAAM,aAAc,SAAQ,gBAAY;IAAxC;;QACE;;;;WAIG;QACI,iBAAY,GAAG,IAAI,CAAC;IAiE7B,CAAC;IA/DC,KAAK,CAAC,WAAW,CAAC,cAAsB;QACtC,IAAI,IAAA,eAAO,GAAE,EAAE;YACb,OAAO,CAAC,GAAG,CAAC,YAAY,cAAc,EAAE,CAAC,CAAC;SAC3C;QAED,MAAM,KAAK,GAAG,IAAI,qBAAW,CAAC,cAAc,CAAC,CAAC;QAC9C,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,UAAU,EAAE,CAAC,EAAE;YAC/B,OAAO;SACR;QAED,IACE,CAAC,CAAC,IAAI,CAAC,YAAY,IAAI,CAAC,MAAM,KAAK,CAAC,eAAe,CAAC,eAAO,CAAC,CAAC,CAAC;YAC9D,CAAC,MAAM,KAAK,CAAC,aAAa,EAAE,CAAC,EAC7B;YACA,IAAI,IAAA,eAAO,GAAE,EAAE;gBACb,OAAO,CAAC,GAAG,CAAC,kCAAkC,CAAC,CAAC;aACjD;YACD,OAAO;SACR;QAED,IAAI,KAAK,CAAC,cAAc,EAAE,GAAG,eAAe;YAC1C,MAAM,IAAI,2B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