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 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
@@ -11,7 +11,7 @@ import { Entry as KeyRingEntry } from "@napi-rs/keyring";
11
11
  import prompts from "prompts";
12
12
 
13
13
  // package.json
14
- var version = "6.3.3";
14
+ var version = "6.4.0";
15
15
 
16
16
  // bin/crypto.ts
17
17
  import crypto from "crypto";
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.replace(/^zotero-/, "")}@${pkg.author.email.replace(/.*@/, "")}`.toLowerCase();
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
@@ -7,6 +7,7 @@ export declare class Bundler {
7
7
  get zip(): ArrayBuffer;
8
8
  get name(): string;
9
9
  id(remote: string): string;
10
+ formData(expire?: number): FormData;
10
11
  }
11
12
  declare class DebugLogSender {
12
13
  id: {
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
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zotero-plugin",
3
- "version": "6.3.3",
3
+ "version": "6.4.0",
4
4
  "description": "Zotero plugin builder",
5
5
  "homepage": "https://github.com/retorquere/zotero-plugin/wiki",
6
6
  "bin": {