zotero-plugin 2.0.8 → 2.0.10

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.
Files changed (2) hide show
  1. package/debug-log.js +7 -10
  2. package/package.json +10 -13
package/debug-log.js CHANGED
@@ -2,9 +2,7 @@
2
2
  /* eslint-disable no-magic-numbers */
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.DebugLog = void 0;
5
- const tslib_1 = require("tslib");
6
- const tar_js_1 = tslib_1.__importDefault(require("tar-js"));
7
- const pako_1 = require("pako");
5
+ const fflate_1 = require("fflate");
8
6
  class DebugLogSender {
9
7
  constructor() {
10
8
  this.id = {
@@ -12,7 +10,7 @@ class DebugLogSender {
12
10
  menupopup: 'debug-log-sender-menupopup',
13
11
  menuitem: 'debug-log-sender',
14
12
  };
15
- this.debugEnabledAtStart = (Zotero.Prefs.get('debug.store') || (Zotero === null || Zotero === void 0 ? void 0 : Zotero.Debug.enabled));
13
+ this.debugEnabledAtStart = Zotero ? (Zotero.Prefs.get('debug.store') || Zotero.Debug.enabled) : null;
16
14
  }
17
15
  convertLegacy() {
18
16
  var _a;
@@ -79,21 +77,20 @@ class DebugLogSender {
79
77
  }
80
78
  async sendAsync(plugin, preferences) {
81
79
  await Zotero.Schema.schemaUpdatePromise;
82
- const tape = new tar_js_1.default;
83
- let out;
80
+ const contents = {};
84
81
  const key = Zotero.Utilities.generateObjectKey();
85
82
  const log = [
86
83
  await this.info(preferences),
87
84
  Zotero.getErrors(true).join('\n\n'),
88
85
  Zotero.Debug.getConsoleViewerOutput().slice(-250000).join('\n'), // eslint-disable-line no-magic-numbers
89
86
  ].filter((txt) => txt).join('\n\n').trim();
90
- out = tape.append(`${key}/debug.txt`, log);
87
+ contents[`${key}/debug.txt`] = (0, fflate_1.strToU8)(log);
91
88
  const rdf = await this.rdf();
92
89
  if (rdf)
93
- out = tape.append(`${key}/items.rdf`, rdf);
94
- const blob = new Blob([(0, pako_1.gzip)(out)], { type: 'application/zip' });
90
+ contents[`${key}/items.rdf`] = (0, fflate_1.strToU8)(rdf);
91
+ const blob = new Blob([(0, fflate_1.zipSync)(contents)], { type: 'application/zip' });
95
92
  const formData = new FormData();
96
- formData.append('file', blob, `${key}.tgz`);
93
+ formData.append('file', blob, `${key}.zip`);
97
94
  const response = await this.post('https://file.io', formData);
98
95
  this.alert(`Debug log ID for ${plugin}`, `${key}-${response.key}`);
99
96
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zotero-plugin",
3
- "version": "2.0.8",
3
+ "version": "2.0.10",
4
4
  "description": "Zotero plugin builder",
5
5
  "homepage": "https://github.com/retorquere/zotero-plugin/wiki",
6
6
  "bin": {
@@ -27,13 +27,11 @@
27
27
  "test": "test"
28
28
  },
29
29
  "dependencies": {
30
- "@octokit/rest": "^20.0.1",
30
+ "@octokit/rest": "^20.0.2",
31
31
  "@rgrove/parse-xml": "^4.1.0",
32
- "@types/node": "^20.6.0",
33
- "@types/pako": "^2.0.0",
34
- "@types/tar-js": "^0.3.2",
35
- "@typescript-eslint/eslint-plugin": "^6.7.0",
36
- "@typescript-eslint/parser": "^6.7.0",
32
+ "@types/node": "^20.8.7",
33
+ "@typescript-eslint/eslint-plugin": "^6.8.0",
34
+ "@typescript-eslint/parser": "^6.8.0",
37
35
  "@xmldom/xmldom": "^0.8.10",
38
36
  "ajv": "^8.12.0",
39
37
  "ajv-keywords": "^5.1.0",
@@ -42,23 +40,22 @@
42
40
  "current-git-branch": "^1.1.0",
43
41
  "dotenv": "^16.3.1",
44
42
  "ejs": "^3.1.9",
45
- "eslint": "^8.49.0",
46
- "eslint-plugin-import": "^2.28.1",
43
+ "eslint": "^8.52.0",
44
+ "eslint-plugin-import": "^2.29.0",
47
45
  "eslint-plugin-prefer-arrow": "^1.2.3",
46
+ "fflate": "^0.8.1",
48
47
  "fs-extra": "^11.1.1",
49
- "glob": "^10.3.4",
48
+ "glob": "^10.3.10",
50
49
  "jsesc": "^3.0.2",
51
50
  "lodash": "^4.17.21",
52
51
  "moment": "^2.29.4",
53
- "pako": "^2.1.0",
54
52
  "peggy": "^3.0.2",
55
53
  "properties-reader": "^2.3.0",
56
54
  "pug": "^3.0.2",
57
- "rimraf": "^5.0.1",
55
+ "rimraf": "^5.0.5",
58
56
  "shell-quote": "^1.8.1",
59
57
  "shelljs": "^0.8.5",
60
58
  "string-to-arraybuffer": "^1.0.2",
61
- "tar-js": "^0.3.0",
62
59
  "ts-node": "^10.9.1",
63
60
  "tslib": "^2.6.2",
64
61
  "typescript": "^5.2.2",