zotero-plugin 6.3.3 → 6.4.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 +2 -0
- package/bin/fetch-log.mjs +1 -1
- package/bin/link.mjs +1 -1
- package/debug-log.d.ts +1 -0
- package/debug-log.js +8 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -171,3 +171,5 @@ DebugLog.register('<your plugin name>', ['your-plugin.', 'fileHandler.pdf'], req
|
|
|
171
171
|
```
|
|
172
172
|
|
|
173
173
|
Logs are sent to/retrieved from 0x0.st
|
|
174
|
+
|
|
175
|
+
The preferences you list will be included in the log; if a preference ends with a period (`.`), all preferences under it will be included
|
package/bin/fetch-log.mjs
CHANGED
package/bin/link.mjs
CHANGED
|
@@ -15,7 +15,7 @@ var root_default = process.cwd();
|
|
|
15
15
|
|
|
16
16
|
// bin/link.ts
|
|
17
17
|
var pkg = { ...__require(path.join(root_default, "package.json")) };
|
|
18
|
-
if (!pkg.id) pkg.id = `${pkg.name
|
|
18
|
+
if (!pkg.id) pkg.id = `${pkg.name}@${pkg.author.email.replace(/.*@/, "")}`.toLowerCase();
|
|
19
19
|
if (pkg.xpi) Object.assign(pkg, pkg.xpi);
|
|
20
20
|
var build = path.join(root_default, "build");
|
|
21
21
|
var zotero = process.argv[2];
|
package/debug-log.d.ts
CHANGED
package/debug-log.js
CHANGED
|
@@ -55,6 +55,13 @@ class Bundler {
|
|
|
55
55
|
id(remote) {
|
|
56
56
|
return `${this.key}-${remote}${this.#refs ? '.refs' : ''}${this.#pubkey ? '.enc' : ''}`;
|
|
57
57
|
}
|
|
58
|
+
formData(expire = 7) {
|
|
59
|
+
const blob = new Blob([this.zip], { type: 'application/zip' });
|
|
60
|
+
const formData = new FormData();
|
|
61
|
+
formData.append('file', blob, this.name);
|
|
62
|
+
formData.append('expire', `${expire * 24}`);
|
|
63
|
+
return formData;
|
|
64
|
+
}
|
|
58
65
|
}
|
|
59
66
|
exports.Bundler = Bundler;
|
|
60
67
|
const zotero_prefs_root = 'extensions.zotero.';
|
|
@@ -129,14 +136,10 @@ class DebugLogSender {
|
|
|
129
136
|
let rdf = await this.rdf();
|
|
130
137
|
if (rdf)
|
|
131
138
|
await bundler.add('items.rdf', rdf, true);
|
|
132
|
-
const blob = new Blob([bundler.zip], { type: 'application/zip' });
|
|
133
|
-
const formData = new FormData();
|
|
134
|
-
formData.append('file', blob, bundler.name);
|
|
135
|
-
formData.append('expire', `${7 * 24}`);
|
|
136
139
|
try {
|
|
137
140
|
const response = await fetch('https://0x0.st', {
|
|
138
141
|
method: 'POST',
|
|
139
|
-
body: formData,
|
|
142
|
+
body: bundler.formData(),
|
|
140
143
|
headers: {
|
|
141
144
|
'User-Agent': `Zotero-plugin/${pkg.version}`,
|
|
142
145
|
},
|