zotero-plugin 1.4.14 → 1.4.16
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/debug-log.js +8 -10
- package/package.json +9 -7
package/debug-log.js
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DebugLog = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const
|
|
5
|
+
const tar_js_1 = tslib_1.__importDefault(require("tar-js"));
|
|
6
|
+
const pako_1 = require("pako");
|
|
6
7
|
class DebugLogSender {
|
|
7
8
|
constructor() {
|
|
8
9
|
this.enabled = false;
|
|
@@ -53,7 +54,8 @@ class DebugLogSender {
|
|
|
53
54
|
async sendAsync() {
|
|
54
55
|
await Zotero.Schema.schemaUpdatePromise;
|
|
55
56
|
const plugin = this.select();
|
|
56
|
-
const
|
|
57
|
+
const tape = new tar_js_1.default;
|
|
58
|
+
let out;
|
|
57
59
|
const key = Zotero.Utilities.generateObjectKey();
|
|
58
60
|
const log = [
|
|
59
61
|
await this.info(plugin),
|
|
@@ -61,17 +63,13 @@ class DebugLogSender {
|
|
|
61
63
|
Zotero.getErrors(true).join('\n\n'),
|
|
62
64
|
Zotero.Debug.getConsoleViewerOutput().slice(-250000).join('\n'), // eslint-disable-line no-magic-numbers
|
|
63
65
|
].filter((txt) => txt).join('\n\n').trim();
|
|
64
|
-
|
|
66
|
+
out = tape.append(`${key}/${key}.txt`, log);
|
|
65
67
|
const rdf = await this.rdf();
|
|
66
68
|
if (rdf)
|
|
67
|
-
|
|
68
|
-
const
|
|
69
|
-
type: 'blob',
|
|
70
|
-
compression: 'DEFLATE',
|
|
71
|
-
compressionOptions: { level: 9 },
|
|
72
|
-
});
|
|
69
|
+
out = tape.append(`${key}/${key}.rdf`, rdf);
|
|
70
|
+
const blob = new Blob([(0, pako_1.gzip)(out)], { type: 'application/zip' });
|
|
73
71
|
const formData = new FormData();
|
|
74
|
-
formData.append('file',
|
|
72
|
+
formData.append('file', blob, `${key}.tgz`);
|
|
75
73
|
const response = await this.post('https://file.io', formData);
|
|
76
74
|
this.alert(`Debug log ID for ${plugin}`, `${response.key}-${key}`);
|
|
77
75
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zotero-plugin",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.16",
|
|
4
4
|
"description": "Zotero plugin builder",
|
|
5
5
|
"homepage": "https://github.com/retorquere/zotero-plugin/wiki",
|
|
6
6
|
"bin": {
|
|
@@ -20,7 +20,6 @@
|
|
|
20
20
|
"test": "eslint . --ext .ts && npm run build",
|
|
21
21
|
"build": "tsc && chmod +x bin/*.js",
|
|
22
22
|
"prepublishOnly": "npm install && npm run build",
|
|
23
|
-
"go": "npm run build && npm version patch && npm publish",
|
|
24
23
|
"ncu": "ncu -u && npm i && git add package.json package-lock.json && git commit -m ncu"
|
|
25
24
|
},
|
|
26
25
|
"directories": {
|
|
@@ -29,9 +28,11 @@
|
|
|
29
28
|
"dependencies": {
|
|
30
29
|
"@octokit/rest": "^19.0.7",
|
|
31
30
|
"@rgrove/parse-xml": "^4.1.0",
|
|
32
|
-
"@types/node": "^18.15.
|
|
33
|
-
"@
|
|
34
|
-
"@
|
|
31
|
+
"@types/node": "^18.15.3",
|
|
32
|
+
"@types/pako": "^2.0.0",
|
|
33
|
+
"@types/tar-js": "^0.3.2",
|
|
34
|
+
"@typescript-eslint/eslint-plugin": "^5.55.0",
|
|
35
|
+
"@typescript-eslint/parser": "^5.55.0",
|
|
35
36
|
"@xmldom/xmldom": "^0.8.6",
|
|
36
37
|
"ajv": "^8.12.0",
|
|
37
38
|
"ajv-keywords": "^5.1.0",
|
|
@@ -43,11 +44,11 @@
|
|
|
43
44
|
"eslint": "^8.36.0",
|
|
44
45
|
"eslint-plugin-import": "^2.27.5",
|
|
45
46
|
"eslint-plugin-prefer-arrow": "^1.2.3",
|
|
46
|
-
"glob": "^9.
|
|
47
|
+
"glob": "^9.3.0",
|
|
47
48
|
"jsesc": "^3.0.2",
|
|
48
|
-
"jszip": "^3.10.1",
|
|
49
49
|
"lodash": "^4.17.21",
|
|
50
50
|
"moment": "^2.29.4",
|
|
51
|
+
"pako": "^2.1.0",
|
|
51
52
|
"peggy": "^3.0.1",
|
|
52
53
|
"properties-reader": "^2.2.0",
|
|
53
54
|
"pug": "^3.0.2",
|
|
@@ -55,6 +56,7 @@
|
|
|
55
56
|
"shell-quote": "^1.8.0",
|
|
56
57
|
"shelljs": "^0.8.5",
|
|
57
58
|
"string-to-arraybuffer": "^1.0.2",
|
|
59
|
+
"tar-js": "^0.3.0",
|
|
58
60
|
"ts-node": "^10.9.1",
|
|
59
61
|
"tslib": "^2.5.0",
|
|
60
62
|
"typescript": "^4.9.5",
|