zotero-plugin 8.0.12 → 8.0.14

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.
@@ -7,9 +7,9 @@ var __getProtoOf = Object.getPrototypeOf;
7
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
8
  var __copyProps = (to, from, except, desc) => {
9
9
  if (from && typeof from === "object" || typeof from === "function") {
10
- for (let key of __getOwnPropNames(from))
11
- if (!__hasOwnProp.call(to, key) && key !== except)
12
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
10
+ for (let key2 of __getOwnPropNames(from))
11
+ if (!__hasOwnProp.call(to, key2) && key2 !== except)
12
+ __defProp(to, key2, { get: () => from[key2], enumerable: !(desc = __getOwnPropDesc(from, key2)) || desc.enumerable });
13
13
  }
14
14
  return to;
15
15
  };
@@ -71,18 +71,19 @@ program.description("A script to fetch debug logs.").option("-p, --private <path
71
71
  var options = program.opts();
72
72
  var args = program.args;
73
73
  if (!args.length) oops("No log ID");
74
- var m = args[0].match(/^(?<key>[a-z0-9]+)-(?<host>[^-]+)-(?<remote>[^.]+)(?<tags>.*)$/i);
74
+ var m = args[0].match(/^(?<key>[a-z0-9]+)-(?<host>[^-]+)(?<tags>.*)$/i);
75
75
  if (!m) oops(args[0], "is not a valid log ID");
76
- if (m.groups.host !== "0x0") oops("Unexpected debug log host", m.groups.host);
77
- options.encrypted = m.groups.tags.split(".").includes("enc");
78
- options.zip = import_path.default.join("logs", `${m.groups.key}.zip`);
79
- options.url = `https://0x0.st/${m.groups.remote}.zip`;
76
+ var { host, key, tags } = m.groups;
77
+ if (host !== "fbin") oops("Unexpected debug log host", host);
78
+ options.encrypted = tags.split(".").includes("enc");
79
+ options.zip = import_path.default.join("logs", `${key}.zip`);
80
+ options.url = `https://filebin.net/${key}/${key}.zip`;
80
81
  if (options.encrypted) {
81
82
  if (!options.private) oops("No private key provided");
82
83
  if (!import_fs.default.existsSync(options.private)) oops("Private key", options.private, "does not exist");
83
84
  if (!import_fs.default.existsSync("package.json")) oops("package.json does not exist in the current directory");
84
85
  }
85
- var logs = import_path.default.join("logs", m.groups.key);
86
+ var logs = import_path.default.join("logs", key);
86
87
  console.log(options.url, "=>", logs);
87
88
  if (!import_fs.default.existsSync(logs)) {
88
89
  import_fs.default.mkdirSync(logs, { recursive: true });
@@ -108,14 +109,15 @@ async function main() {
108
109
  const response = await fetch(options.url, {
109
110
  method: "GET",
110
111
  headers: {
111
- "User-Agent": `Zotero plugin log fetcher ${pkg.version}`,
112
+ "User-Agent": "curl/7.81.0",
113
+ // filebin does not seem to accept custom user agents
114
+ "Accept-Encoding": "identity",
112
115
  Accept: "*/*"
113
116
  }
114
117
  });
115
118
  if (!response.ok) oops(`Failed to download: ${response.statusText}`);
116
- const readable = import_node_stream.Readable.fromWeb(response.body);
117
119
  const download = import_fs.default.createWriteStream(options.zip);
118
- await (0, import_promises.finished)(readable.pipe(download));
120
+ await (0, import_promises.finished)(import_node_stream.Readable.fromWeb(response.body).pipe(download));
119
121
  const zipfile = new import_node_stream_zip.default.async({ file: options.zip });
120
122
  const entries = Object.values(await zipfile.entries()).filter((entry) => !entry.isDirectory);
121
123
  const privateKey = await getPrivateKey();
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../bin/fetch-log.ts","../../../crypto.ts","../../../bin/find-root.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport { Command } from 'commander'\nimport crypto, { webcrypto } from 'crypto'\nimport fs from 'fs'\nimport * as jose from 'jose'\nimport StreamZip from 'node-stream-zip'\nimport { Readable } from 'node:stream'\nimport { finished } from 'node:stream/promises'\nimport path from 'path'\n\nimport { Entry as KeyRingEntry } from '@napi-rs/keyring'\nimport prompts from 'prompts'\n\nimport { KEY_WRAPPING_ALG } from '../crypto'\nimport { pkg } from './find-root'\n\nasync function getPassphrase(): Promise<string> {\n const service = `${pkg.name} Zotero plugin`\n const account = `${pkg.name}-debug-log`\n const entry = new KeyRingEntry(service, account)\n let passphrase = entry.getPassword()\n if (!passphrase) {\n const response = await prompts({\n type: 'password',\n name: 'passphrase',\n message: `Enter a passphrase to decrypt your private key for ${service} ${account}:`,\n })\n entry.setPassword(passphrase = response.passphrase)\n }\n return passphrase\n}\n\nconst oops = (...args) => {\n console.error(...args)\n process.exit(1)\n}\n\nconst program = new Command()\nprogram\n .description('A script to fetch debug logs.')\n .option('-p, --private <path>', 'Path for the encrypted private key .pem file', 'private.pem')\n .option('-k, --keep', 'Keep the downloaded zip', false)\n .argument('<debug log id>', 'debug log ID to fetch')\n .parse(process.argv)\nconst options = program.opts()\nconst args = program.args\n\nif (!args.length) oops('No log ID')\n\nlet m = args[0].match(/^(?<key>[a-z0-9]+)-(?<host>[^-]+)-(?<remote>[^.]+)(?<tags>.*)$/i)\nif (!m) oops(args[0], 'is not a valid log ID')\n\nif (m.groups.host !== '0x0') oops('Unexpected debug log host', m.groups.host)\n\noptions.encrypted = m.groups.tags.split('.').includes('enc')\noptions.zip = path.join('logs', `${m.groups.key}.zip`)\noptions.url = `https://0x0.st/${m.groups.remote}.zip`\n\nif (options.encrypted) {\n if (!options.private) oops('No private key provided')\n if (!fs.existsSync(options.private)) oops('Private key', options.private, 'does not exist')\n if (!fs.existsSync('package.json')) oops('package.json does not exist in the current directory')\n}\n\nconst logs = path.join('logs', m.groups!.key)\nconsole.log(options.url, '=>', logs)\nif (!fs.existsSync(logs)) {\n fs.mkdirSync(logs, { recursive: true })\n}\n\nasync function getPrivateKey(): Promise<webcrypto.CryptoKey> {\n if (!options.encrypted) return undefined\n\n const privateKeyObject = crypto.createPrivateKey({\n key: fs.readFileSync(options.private, 'utf-8'),\n format: 'pem',\n passphrase: await getPassphrase(),\n })\n const unencryptedKeyPEM = privateKeyObject.export({\n type: 'pkcs8',\n format: 'pem',\n }).toString()\n return await jose.importPKCS8(\n unencryptedKeyPEM,\n KEY_WRAPPING_ALG,\n )\n}\nasync function main() {\n try {\n const response = await fetch(options.url, {\n method: 'GET',\n headers: {\n 'User-Agent': `Zotero plugin log fetcher ${pkg.version}`,\n Accept: '*/*',\n },\n })\n if (!response.ok) oops(`Failed to download: ${response.statusText}`)\n\n const readable = Readable.fromWeb(response.body as any)\n const download = fs.createWriteStream(options.zip)\n await finished(readable.pipe(download))\n\n const zipfile = new StreamZip.async({ file: options.zip })\n const entries = Object.values(await zipfile.entries()).filter(entry => !entry.isDirectory)\n\n const privateKey = await getPrivateKey()\n\n for (const entry of entries) {\n const m = entry.name.match(/(?<filename>.+)\\.(?<type>jwe)$/i)\n const filename = m?.groups!.filename || entry.name\n const type = (m?.groups!.type || '').toLowerCase()\n const target = path.join('logs', filename)\n\n if (options.encrypted && !type) oops('Unexpected unencrypted contents', entry.name)\n if (type && !options.encrypted) oops('Unexpected encrypted contents', entry.name)\n switch (type) {\n case '':\n fs.writeFileSync(target, await zipfile.entryData(entry.name))\n break\n case 'jwe': {\n const { plaintext } = await jose.compactDecrypt((await zipfile.entryData(entry.name)).toString('utf8'), privateKey)\n fs.writeFileSync(target, plaintext)\n break\n }\n default:\n oops('Unexpected log entry', entry.name)\n break\n }\n }\n }\n finally {\n if (!options.keep && fs.existsSync(options.zip)) fs.unlinkSync(options.zip)\n }\n}\n\nmain().catch(err => {\n oops(err.message)\n})\n","export const KEYTYPE = 'RSA'\nexport const KEY_WRAPPING_ALG = 'RSA-OAEP-256'\nexport const CONTENT_ENCRYPTION_ALG = 'A256GCM'\nexport const RSA_HASH = 'SHA-256'\nexport const RSA_ALGORITHM = 'RSA-OAEP'\nexport const CIPHER_ALGORITHM = 'aes256'\nexport const AES_KEY_LENGTH = 256\n// export const AES_KEY_BYTES = 32\n\n// export const AES_ALGORITHM = 'AES-GCM'\n// export const IV_LENGTH = 12\n","import fs from 'node:fs'\nimport path from 'node:path'\n\nconst folders = process.cwd().split(path.sep)\nconst rootIndex = folders.findIndex((folder: string, i: number) => fs.existsSync(path.join(folders.slice(0, i + 1).join(path.sep), 'package.json')))\nexport const root = (rootIndex > 0 ? folders.slice(0, rootIndex + 1) : folders).join(path.sep)\nconsole.log('project directory:', root)\n\nexport const pkg = JSON.parse(fs.readFileSync(path.join(root, 'package.json'), 'utf-8'))\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAEA,uBAAwB;AACxB,oBAAkC;AAClC,gBAAe;AACf,WAAsB;AACtB,6BAAsB;AACtB,yBAAyB;AACzB,sBAAyB;AACzB,kBAAiB;AAEjB,qBAAsC;AACtC,qBAAoB;;;ACXb,IAAM,mBAAmB;;;ACDhC,qBAAe;AACf,uBAAiB;AAEjB,IAAM,UAAU,QAAQ,IAAI,EAAE,MAAM,iBAAAA,QAAK,GAAG;AAC5C,IAAM,YAAY,QAAQ,UAAU,CAAC,QAAgB,MAAc,eAAAC,QAAG,WAAW,iBAAAD,QAAK,KAAK,QAAQ,MAAM,GAAG,IAAI,CAAC,EAAE,KAAK,iBAAAA,QAAK,GAAG,GAAG,cAAc,CAAC,CAAC;AAC5I,IAAM,QAAQ,YAAY,IAAI,QAAQ,MAAM,GAAG,YAAY,CAAC,IAAI,SAAS,KAAK,iBAAAA,QAAK,GAAG;AAC7F,QAAQ,IAAI,sBAAsB,IAAI;AAE/B,IAAM,MAAM,KAAK,MAAM,eAAAC,QAAG,aAAa,iBAAAD,QAAK,KAAK,MAAM,cAAc,GAAG,OAAO,CAAC;;;AFSvF,eAAe,gBAAiC;AAC9C,QAAM,UAAU,GAAG,IAAI,IAAI;AAC3B,QAAM,UAAU,GAAG,IAAI,IAAI;AAC3B,QAAM,QAAQ,IAAI,eAAAE,MAAa,SAAS,OAAO;AAC/C,MAAI,aAAa,MAAM,YAAY;AACnC,MAAI,CAAC,YAAY;AACf,UAAM,WAAW,UAAM,eAAAC,SAAQ;AAAA,MAC7B,MAAM;AAAA,MACN,MAAM;AAAA,MACN,SAAS,sDAAsD,OAAO,IAAI,OAAO;AAAA,IACnF,CAAC;AACD,UAAM,YAAY,aAAa,SAAS,UAAU;AAAA,EACpD;AACA,SAA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MAAM,IAAI;AAClF,UAAI,QAAQ,CAAC,QAAQ,UAAW,MAAK,iCAAiC,MAAM,IAAI;AAChF,cAAQ,MAAM;AAAA,QACZ,KAAK;AACH,oBAAAC,QAAG,cAAc,QAAQ,MAAM,QAAQ,UAAU,MAAM,IAAI,CAAC;AAC5D;AAAA,QACF,KAAK,OAAO;AACV,gBAAM,EAAE,UAAU,IAAI,MAAW,qBAAgB,MAAM,QAAQ,UAAU,MAAM,IAAI,GAAG,SAAS,MAAM,GAAG,UAAU;AAClH,oBAAAA,QAAG,cAAc,QAAQ,SAAS;AAClC;AAAA,QACF;AAAA,QACA;AACE,eAAK,wBAAwB,MAAM,IAAI;AACvC;AAAA,MACJ;AAAA,IACF;AAAA,EACF,UACA;AACE,QAAI,CAAC,QAAQ,QAAQ,UAAAA,QAAG,WAAW,QAAQ,GAAG,EAAG,WAAAA,QAAG,WAAW,QAAQ,GAAG;AAAA,EAC5E;AACF;AAEA,KAAK,EAAE,MAAM,SAAO;AAClB,OAAK,IAAI,OAAO;AAClB,CAAC;","names":["path","fs","KeyRingEntry","prompts","args","path","fs","crypto","StreamZip","m"]}
1
+ {"version":3,"sources":["../../../bin/fetch-log.ts","../../../crypto.ts","../../../bin/find-root.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport { Command } from 'commander'\nimport crypto, { webcrypto } from 'crypto'\nimport fs from 'fs'\nimport * as jose from 'jose'\nimport StreamZip from 'node-stream-zip'\nimport { Readable } from 'node:stream'\nimport { finished } from 'node:stream/promises'\nimport path from 'path'\n\nimport { Entry as KeyRingEntry } from '@napi-rs/keyring'\nimport prompts from 'prompts'\n\nimport { KEY_WRAPPING_ALG } from '../crypto'\nimport { pkg } from './find-root'\n\nasync function getPassphrase(): Promise<string> {\n const service = `${pkg.name} Zotero plugin`\n const account = `${pkg.name}-debug-log`\n const entry = new KeyRingEntry(service, account)\n let passphrase = entry.getPassword()\n if (!passphrase) {\n const response = await prompts({\n type: 'password',\n name: 'passphrase',\n message: `Enter a passphrase to decrypt your private key for ${service} ${account}:`,\n })\n entry.setPassword(passphrase = response.passphrase)\n }\n return passphrase\n}\n\nconst oops = (...args) => {\n console.error(...args)\n process.exit(1)\n}\n\nconst program = new Command()\nprogram\n .description('A script to fetch debug logs.')\n .option('-p, --private <path>', 'Path for the encrypted private key .pem file', 'private.pem')\n .option('-k, --keep', 'Keep the downloaded zip', false)\n .argument('<debug log id>', 'debug log ID to fetch')\n .parse(process.argv)\nconst options = program.opts()\nconst args = program.args\n\nif (!args.length) oops('No log ID')\n\nlet m = args[0].match(/^(?<key>[a-z0-9]+)-(?<host>[^-]+)(?<tags>.*)$/i)\nif (!m) oops(args[0], 'is not a valid log ID')\n\nconst { host, key, tags } = m.groups\nif (host !== 'fbin') oops('Unexpected debug log host', host)\n\noptions.encrypted = tags.split('.').includes('enc')\noptions.zip = path.join('logs', `${key}.zip`)\noptions.url = `https://filebin.net/${key}/${key}.zip`\n\nif (options.encrypted) {\n if (!options.private) oops('No private key provided')\n if (!fs.existsSync(options.private)) oops('Private key', options.private, 'does not exist')\n if (!fs.existsSync('package.json')) oops('package.json does not exist in the current directory')\n}\n\nconst logs = path.join('logs', key)\nconsole.log(options.url, '=>', logs)\nif (!fs.existsSync(logs)) {\n fs.mkdirSync(logs, { recursive: true })\n}\n\nasync function getPrivateKey(): Promise<webcrypto.CryptoKey> {\n if (!options.encrypted) return undefined\n\n const privateKeyObject = crypto.createPrivateKey({\n key: fs.readFileSync(options.private, 'utf-8'),\n format: 'pem',\n passphrase: await getPassphrase(),\n })\n const unencryptedKeyPEM = privateKeyObject.export({\n type: 'pkcs8',\n format: 'pem',\n }).toString()\n return await jose.importPKCS8(\n unencryptedKeyPEM,\n KEY_WRAPPING_ALG,\n )\n}\nasync function main() {\n try {\n const response = await fetch(options.url, {\n method: 'GET',\n headers: {\n 'User-Agent': 'curl/7.81.0', // filebin does not seem to accept custom user agents\n 'Accept-Encoding': 'identity',\n Accept: '*/*',\n },\n })\n if (!response.ok) oops(`Failed to download: ${response.statusText}`)\n\n const download = fs.createWriteStream(options.zip)\n await finished(Readable.fromWeb(response.body as any).pipe(download))\n\n const zipfile = new StreamZip.async({ file: options.zip })\n const entries = Object.values(await zipfile.entries()).filter(entry => !entry.isDirectory)\n\n const privateKey = await getPrivateKey()\n\n for (const entry of entries) {\n const m = entry.name.match(/(?<filename>.+)\\.(?<type>jwe)$/i)\n const filename = m?.groups!.filename || entry.name\n const type = (m?.groups!.type || '').toLowerCase()\n const target = path.join('logs', filename)\n\n if (options.encrypted && !type) oops('Unexpected unencrypted contents', entry.name)\n if (type && !options.encrypted) oops('Unexpected encrypted contents', entry.name)\n switch (type) {\n case '':\n fs.writeFileSync(target, await zipfile.entryData(entry.name))\n break\n case 'jwe': {\n const { plaintext } = await jose.compactDecrypt((await zipfile.entryData(entry.name)).toString('utf8'), privateKey)\n fs.writeFileSync(target, plaintext)\n break\n }\n default:\n oops('Unexpected log entry', entry.name)\n break\n }\n }\n }\n finally {\n if (!options.keep && fs.existsSync(options.zip)) fs.unlinkSync(options.zip)\n }\n}\n\nmain().catch(err => {\n oops(err.message)\n})\n","export const KEYTYPE = 'RSA'\nexport const KEY_WRAPPING_ALG = 'RSA-OAEP-256'\nexport const CONTENT_ENCRYPTION_ALG = 'A256GCM'\nexport const RSA_HASH = 'SHA-256'\nexport const RSA_ALGORITHM = 'RSA-OAEP'\nexport const CIPHER_ALGORITHM = 'aes256'\nexport const AES_KEY_LENGTH = 256\n// export const AES_KEY_BYTES = 32\n\n// export const AES_ALGORITHM = 'AES-GCM'\n// export const IV_LENGTH = 12\n","import fs from 'node:fs'\nimport path from 'node:path'\n\nconst folders = process.cwd().split(path.sep)\nconst rootIndex = folders.findIndex((folder: string, i: number) => fs.existsSync(path.join(folders.slice(0, i + 1).join(path.sep), 'package.json')))\nexport const root = (rootIndex > 0 ? folders.slice(0, rootIndex + 1) : folders).join(path.sep)\nconsole.log('project directory:', root)\n\nexport const pkg = JSON.parse(fs.readFileSync(path.join(root, 'package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AAG,cAAc,QAAQ,MAAM,QAAQ,UAAU,MAAM,IAAI,CAAC;AAC5D;AAAA,QACF,KAAK,OAAO;AACV,gBAAM,EAAE,UAAU,IAAI,MAAW,qBAAgB,MAAM,QAAQ,UAAU,MAAM,IAAI,GAAG,SAAS,MAAM,GAAG,UAAU;AAClH,oBAAAA,QAAG,cAAc,QAAQ,SAAS;AAClC;AAAA,QACF;AAAA,QACA;AACE,eAAK,wBAAwB,MAAM,IAAI;AACvC;AAAA,MACJ;AAAA,IACF;AAAA,EACF,UACA;AACE,QAAI,CAAC,QAAQ,QAAQ,UAAAA,QAAG,WAAW,QAAQ,GAAG,EAAG,WAAAA,QAAG,WAAW,QAAQ,GAAG;AAAA,EAC5E;AACF;AAEA,KAAK,EAAE,MAAM,SAAO;AAClB,OAAK,IAAI,OAAO;AAClB,CAAC;","names":["path","fs","KeyRingEntry","prompts","args","path","fs","crypto","StreamZip","m"]}
@@ -46,7 +46,7 @@ var UZip = __toESM(require("uzip"), 1);
46
46
  // package.json
47
47
  var package_default = {
48
48
  "name": "zotero-plugin",
49
- "version": "8.0.12",
49
+ "version": "8.0.14",
50
50
  "description": "Zotero plugin builder",
51
51
  "homepage": "https://github.com/retorquere/zotero-plugin/wiki",
52
52
  "type": "module",
@@ -222,28 +222,19 @@ var Bundler = class {
222
222
  get name() {
223
223
  return `${this.key}.zip`;
224
224
  }
225
- id(remote) {
226
- return `${this.key}-${remote}${this.#refs ? ".refs" : ""}${this.#pubKey ? ".enc" : ""}`;
225
+ id(host) {
226
+ return `${this.key}-${host}${this.#refs ? ".refs" : ""}${this.#pubKey ? ".enc" : ""}`;
227
227
  }
228
- formData(expire = 30) {
229
- const blob = new Blob([this.zip], { type: "application/zip" });
230
- const formData = new FormData();
231
- formData.append("file", blob, this.name);
232
- formData.append("expire", `${expire * 24}`);
233
- return formData;
234
- }
235
- async send(useragent, expire = 30) {
236
- const response = await fetch("https://0x0.st", {
228
+ async send() {
229
+ const response = await fetch(`https://filebin.net/${this.key}/${this.name}`, {
237
230
  method: "POST",
238
- body: this.formData(expire),
239
231
  headers: {
240
- "User-Agent": useragent
241
- }
232
+ "Content-Type": "application/zip"
233
+ },
234
+ body: new Blob([this.zip], { type: "application/zip" })
242
235
  });
243
- const body = await response.text();
244
- const id = body.match(/https:\/\/0x0.st\/([A-Z0-9]+)\.zip/i);
245
- if (!id) throw new Error(body);
246
- return this.id(`0x0-${id[1]}`);
236
+ if (response.ok) return this.id("fbin");
237
+ throw new Error(await response.text());
247
238
  }
248
239
  };
249
240
  var zotero_prefs_root = "extensions.zotero.";
@@ -295,7 +286,7 @@ var DebugLogSender = class {
295
286
  await bundler.add("debug.txt", log);
296
287
  let rdf = await this.rdf();
297
288
  if (rdf) await bundler.add("items.rdf", rdf, true);
298
- const logid = await bundler.send(`Zotero-plugin/${package_default.version}`);
289
+ const logid = await bundler.send();
299
290
  Services.prompt.alert(null, `Debug log ID for ${plugin}`, logid);
300
291
  } catch (err) {
301
292
  Services.prompt.alert(null, `Could not post debug log for ${plugin}`, err.message);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../debug-log.ts","../../crypto.ts","../../package.json"],"sourcesContent":["/* eslint-disable no-magic-numbers */\n\nComponents.utils.importGlobalProperties(['FormData'])\nimport { CONTENT_ENCRYPTION_ALG, KEY_WRAPPING_ALG, KEYTYPE } from './crypto'\n\nimport * as jose from 'jose'\nimport * as UZip from 'uzip'\nimport pkg from './package.json'\n\nexport class Bundler {\n public key: string\n\n #refs = false\n\n #pk?: JsonWebKey\n #pubKey?: CryptoKey\n\n #files: Record<string, Uint8Array> = {}\n #encoder = new TextEncoder()\n\n constructor(pk?: JsonWebKey) {\n this.key = Zotero.Utilities.generateObjectKey()\n\n if (pk && pk.kty === KEYTYPE) this.#pk = pk\n }\n\n async add(path: string, data: string, refs = false): Promise<void> {\n this.#refs = this.#refs || refs\n\n const encoded = this.#encoder.encode(data)\n\n if (this.#pk) {\n if (!this.#pubKey) this.#pubKey = (await jose.importJWK(this.#pk, KEY_WRAPPING_ALG)) as CryptoKey\n const jwe = await (new jose.CompactEncrypt(encoded))\n .setProtectedHeader({\n alg: KEY_WRAPPING_ALG,\n enc: CONTENT_ENCRYPTION_ALG,\n })\n .encrypt(this.#pubKey)\n\n this.#files[`${this.key}/${path}.jwe`] = this.#encoder.encode(jwe)\n }\n else {\n this.#files[`${this.key}/${path}`] = encoded\n }\n }\n\n public get zip(): ArrayBuffer {\n return UZip.encode(this.#files) as ArrayBuffer\n }\n\n public get name(): string {\n return `${this.key}.zip`\n }\n\n public id(remote: string): string {\n return `${this.key}-${remote}${this.#refs ? '.refs' : ''}${this.#pubKey ? '.enc' : ''}`\n }\n\n public formData(expire = 30): FormData {\n const blob = new Blob([this.zip], { type: 'application/zip' })\n const formData = new FormData()\n formData.append('file', blob, this.name)\n formData.append('expire', `${expire * 24}`)\n return formData\n }\n\n public async send(useragent, expire = 30): Promise<string> {\n const response = await fetch('https://0x0.st', {\n method: 'POST',\n body: this.formData(expire),\n headers: {\n 'User-Agent': useragent,\n },\n })\n const body = await response.text()\n const id = body.match(/https:\\/\\/0x0.st\\/([A-Z0-9]+)\\.zip/i)\n if (!id) throw new Error(body)\n return this.id(`0x0-${id[1]}`)\n }\n}\n\ndeclare var Services: any // eslint-disable-line no-var\ndeclare const Components: any\ndeclare const ChromeUtils: any\n\ntype ExportTranslator = {\n setHandler: (phase: string, handler: (obj: { string: string }, success: boolean) => void) => void // eslint-disable-line id-blacklist\n setTranslator: (id: string) => void\n setItems: (items: any[]) => void\n translate: () => void\n}\n\nconst zotero_prefs_root = 'extensions.zotero.'\n\ntype Plugin = {\n plugin: string\n preferences: string[]\n pubKey?: JsonWebKey\n}\n\nclass DebugLogSender {\n version = pkg.version\n #menu: string | false\n #plugins: Plugin[] = []\n\n public debugEnabledAtStart: boolean = typeof Zotero !== 'undefined'\n ? (Zotero.Prefs.get('debug.store') || Zotero.Debug.enabled) as unknown as boolean\n : null\n\n public register(plugin: string, preferences: string[] = [], pubKey?: JsonWebKey): void {\n this.#menu ??= Zotero.MenuManager.registerMenu({\n menuID: 'debug-log-sender',\n pluginID: 'debug-log-sender',\n target: 'main/menubar/help',\n menus: [\n {\n menuType: 'submenu',\n onShowing: (event, context) => {\n context.setVisible(!!this.#plugins.length)\n context.menuElem?.setAttribute('label', 'Send plugin debug log')\n },\n menus: Array.from({ length: 20 }, (v, i) => ({\n menuType: 'menuitem',\n onShowing: (event: Event, context: _ZoteroTypes.MenuManager.MenuContext) => {\n context.setVisible(this.#plugins.length > i)\n context.menuElem?.setAttribute('label', this.#plugins[i]?.plugin || '')\n },\n onCommand: (event: Event, context: _ZoteroTypes.MenuManager.MenuContext) => {\n void this.send(this.#plugins[i])\n },\n })),\n },\n ],\n })\n\n this.#plugins.push({ plugin, preferences, pubKey })\n }\n\n public unregister(plugin: string) {\n this.#plugins = this.#plugins.filter(p => p.plugin !== plugin)\n }\n\n private async send({ plugin, preferences, pubKey }: Plugin): Promise<void> {\n try {\n await Zotero.Schema.schemaUpdatePromise\n\n const bundler = new Bundler(pubKey || undefined)\n\n let log = [\n await this.info(preferences),\n Zotero.getErrors(true).join('\\n\\n'),\n Zotero.Debug.getConsoleViewerOutput().slice(-250000).join('\\n'), // eslint-disable-line no-magic-numbers\n ].filter((txt: string) => txt).join('\\n\\n').trim()\n await bundler.add('debug.txt', log)\n\n let rdf = await this.rdf()\n if (rdf) await bundler.add('items.rdf', rdf, true)\n\n const logid = await bundler.send(`Zotero-plugin/${pkg.version}`)\n Services.prompt.alert(null, `Debug log ID for ${plugin}`, logid)\n }\n catch (err) {\n Services.prompt.alert(null, `Could not post debug log for ${plugin}`, err.message)\n }\n }\n\n private preferences(preferences: string[]): Record<string, string | number | boolean> {\n const prefs: Record<string, string | number | boolean> = {}\n\n const names: string[] = []\n for (let pref of preferences) {\n if (pref[0] === ':') {\n pref = pref.substring(1)\n }\n else if (!pref.startsWith(zotero_prefs_root)) {\n pref = zotero_prefs_root + pref\n }\n if (pref.endsWith('.')) {\n const childkeys: string[] = Services.prefs.getBranch(pref).getChildList('', {})\n for (const key of childkeys) {\n names.push(pref + key)\n }\n }\n else {\n names.push(pref)\n }\n }\n\n for (const pref of names.sort()) {\n prefs[pref] = Zotero.Prefs.get(pref, true)\n }\n\n return prefs\n }\n\n // general state of Zotero\n private async info(preferences: string[]): Promise<string> {\n let info = ''\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-assignment\n const appInfo: { name: string; version: string } = Components.classes['@mozilla.org/xre/app-info;1'].getService(Components.interfaces.nsIXULAppInfo)\n info += `Application: ${appInfo.name} ${appInfo.version} ${Zotero.locale}\\n`\n\n const platform = ['Win', 'Mac', 'Linux'].find(p => Zotero[`is${p}`]) || 'Unknown'\n info += `Platform: ${platform}\\n`\n\n const addons: string[] = await Zotero.getInstalledExtensions()\n if (addons.length) {\n info += 'Addons:\\n' + addons.map((addon: string) => ` ${addon}\\n`).join('') // eslint-disable-line prefer-template\n }\n info += `Debug logging on at Zotero start: ${this.debugEnabledAtStart}\\n`\n info += `Debug logging on at log submit: ${Zotero.Prefs.get('debug.store') || Zotero.Debug.enabled}\\n`\n\n for (const [pref, value] of Object.entries(this.preferences(preferences))) {\n info += `${pref} = ${JSON.stringify(value)}\\n`\n }\n\n return info\n }\n\n private rdf(): Promise<string> {\n return new Promise((resolve, reject) => {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-assignment\n const items: any[] = Zotero.getActiveZoteroPane().getSelectedItems()\n if (items.length === 0) return resolve('')\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call\n const translation: ExportTranslator = new Zotero.Translate.Export() as ExportTranslator\n translation.setItems(items)\n translation.setTranslator('14763d24-8ba0-45df-8f52-b8d1108e7ac9') // rdf\n\n translation.setHandler('done', (obj, success) => {\n if (success) {\n resolve(obj ? obj.string : undefined)\n }\n else {\n reject(new Error('translation failed'))\n }\n })\n\n translation.translate() // eslint-disable-line @typescript-eslint/no-unsafe-call\n })\n }\n}\n\ndeclare global {\n interface Zotero {\n DebugLogSender?: DebugLogSender\n }\n namespace Zotero {\n var DebugLogSender: DebugLogSender | undefined\n }\n}\n\nfunction upgrade(installed?: string) {\n if (!installed) return true\n return installed.localeCompare(pkg.version, undefined, { numeric: true }) < 0\n}\n\nif (upgrade(Zotero.DebugLogSender?.version)) Zotero.DebugLogSender = new DebugLogSender()\nexport const DebugLog = Zotero.DebugLogSender\n","export const KEYTYPE = 'RSA'\nexport const KEY_WRAPPING_ALG = 'RSA-OAEP-256'\nexport const CONTENT_ENCRYPTION_ALG = 'A256GCM'\nexport const RSA_HASH = 'SHA-256'\nexport const RSA_ALGORITHM = 'RSA-OAEP'\nexport const CIPHER_ALGORITHM = 'aes256'\nexport const AES_KEY_LENGTH = 256\n// export const AES_KEY_BYTES = 32\n\n// export const AES_ALGORITHM = 'AES-GCM'\n// export const IV_LENGTH = 12\n","export default {\n \"name\": \"zotero-plugin\",\n \"version\": \"8.0.12\",\n \"description\": \"Zotero plugin builder\",\n \"homepage\": \"https://github.com/retorquere/zotero-plugin/wiki\",\n \"type\": \"module\",\n \"main\": \"./dist/cjs/index.js\",\n \"module\": \"./dist/esm/index.js\",\n \"exports\": {\n \".\": {\n \"import\": \"./dist/esm/index.js\",\n \"require\": \"./dist/cjs/index.cjs\"\n },\n \"./debug-log\": {\n \"import\": \"./dist/esm/debug-log.js\",\n \"require\": \"./dist/cjs/debug-log.cjs\"\n },\n \"./logger\": {\n \"import\": \"./dist/esm/logger.js\",\n \"require\": \"./dist/cjs/logger.cjs\"\n },\n \".loader/json\": {\n \"import\": \"./dist/esm/loader/json.js\",\n \"require\": \"./dist/cjs/loader/json.cjs\"\n },\n \".loader/peggy\": {\n \"import\": \"./dist/esm/loader/peggy.js\",\n \"require\": \"./dist/cjs/loader/peggy.cjs\"\n },\n \".loader/pem\": {\n \"import\": \"./dist/esm/loader/pem.js\",\n \"require\": \"./dist/cjs/loader/pem.cjs\"\n },\n \"./copy-assets\": {\n \"import\": \"./dist/esm/bin/copy-assets.js\",\n \"require\": \"./dist/cjs/bin/copy-assets.cjs\"\n },\n \"./make-dirs\": {\n \"import\": \"./dist/esm/bin/make-dirs.js\",\n \"require\": \"./dist/cjs/bin/make-dirs.cjs\"\n },\n \"./make-manifest\": {\n \"import\": \"./dist/esm/bin/make-manifest.js\",\n \"require\": \"./dist/cjs/bin/make-manifest.cjs\"\n },\n \"./make-version\": {\n \"import\": \"./dist/esm/bin/version.js\",\n \"require\": \"./dist/cjs/bin/version.cjs\"\n }\n },\n \"author\": {\n \"name\": \"Emiliano Heyns\",\n \"email\": \"Emiliano.Heyns@iris-advies.com\"\n },\n \"scripts\": {\n \"preversion\": \"npm test\",\n \"postversion\": \"git push --follow-tags\",\n \"test\": \"dprint fmt *.ts */*.ts && dprint check *.ts */*.ts && npm run build\",\n \"prebuild\": \"rm -rf dist\",\n \"build\": \"tsup\",\n \"check\": \"tsc --noEmit\",\n \"start\": \"concurrently --raw --group 'npm run check' 'npm run build'\",\n \"pack\": \"npm test && npm pack\",\n \"prepublishOnly\": \"npm install && npm run build\",\n \"ncu\": \"ncu -u && npm i && git add package.json package-lock.json && git commit -m ncu\"\n },\n \"directories\": {\n \"test\": \"test\"\n },\n \"dependencies\": {\n \"@fluent/syntax\": \"^0.19.0\",\n \"@napi-rs/keyring\": \"^1.2.0\",\n \"@octokit/rest\": \"^22.0.1\",\n \"@rgrove/parse-xml\": \"^4.2.0\",\n \"@types/node\": \"^25.3.0\",\n \"@xmldom/xmldom\": \"^0.9.8\",\n \"ajv\": \"^8.18.0\",\n \"ajv-keywords\": \"^5.1.0\",\n \"archiver\": \"^7.0.1\",\n \"clp\": \"^4.0.13\",\n \"commander\": \"^14.0.3\",\n \"dotenv\": \"^17.3.1\",\n \"ejs\": \"^4.0.1\",\n \"fs-extra\": \"^11.3.3\",\n \"glob\": \"^13.0.6\",\n \"ini\": \"^6.0.0\",\n \"jose\": \"^6.1.3\",\n \"jsesc\": \"^3.1.0\",\n \"lodash\": \"^4.17.23\",\n \"moment\": \"^2.30.1\",\n \"node-forge\": \"^1.3.3\",\n \"node-stream-zip\": \"^1.15.0\",\n \"openpgp\": \"^6.3.0\",\n \"peggy\": \"^5.0.6\",\n \"prompts\": \"^2.4.2\",\n \"pug\": \"^3.0.3\",\n \"rimraf\": \"^6.1.3\",\n \"shell-quote\": \"^1.8.3\",\n \"shelljs\": \"^0.10.0\",\n \"string-to-arraybuffer\": \"^1.0.2\",\n \"ts-node\": \"^10.9.2\",\n \"tslib\": \"^2.8.1\",\n \"typescript\": \"^5.9.3\",\n \"uri-templates\": \"^0.2.0\",\n \"url-template\": \"^3.1.1\",\n \"uzip\": \"^0.20201231.0\",\n \"xml-parser\": \"^1.2.1\",\n \"xpath\": \"^0.0.34\",\n \"zotero-types\": \"^4.1.1\"\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/retorquere/zotero-plugin.git\"\n },\n \"license\": \"ISC\",\n \"files\": [\n \"package.json\",\n \"README.md\",\n \"dist\"\n ],\n \"bin\": {\n \"zp-release\": \"dist/cjs/bin/release.cjs\",\n \"zp-zipup\": \"dist/cjs/bin/zipup.cjs\",\n \"zp-link\": \"dist/cjs/bin/link.cjs\",\n \"issue-branches\": \"dist/cjs/bin/branches.cjs\",\n \"zotero-start\": \"dist/cjs/bin/start.cjs\",\n \"zp-fetch-log\": \"dist/cjs/bin/fetch-log.cjs\",\n \"zp-keypair\": \"dist/cjs/bin/keypair.cjs\",\n \"zp-copy-assets\": \"dist/cjs/copy-assets.cjs\",\n \"zp-make-dirs\": \"dist/cjs/make-dirs.cjs\",\n \"zp-manifest\": \"dist/cjs/make-manifest.cjs\",\n \"zp-version\": \"dist/cjs/version.cjs\"\n },\n \"bugs\": {\n \"url\": \"https://github.com/retorquere/zotero-plugin/issues\"\n },\n \"devDependencies\": {\n \"@openpgp/web-stream-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AAK,KAAK;AAAA,CAAI,EAAE,KAAK,EAAE;AAAA,IAC7E;AACA,YAAQ,qCAAqC,KAAK,mBAAmB;AAAA;AACrE,YAAQ,mCAAmC,OAAO,MAAM,IAAI,aAAa,KAAK,OAAO,MAAM,OAAO;AAAA;AAElG,eAAW,CAAC,MAAM,KAAK,KAAK,OAAO,QAAQ,KAAK,YAAY,WAAW,CAAC,GAAG;AACzE,cAAQ,GAAG,IAAI,MAAM,KAAK,UAAU,KAAK,CAAC;AAAA;AAAA,IAC5C;AAEA,WAAO;AAAA,EACT;AAAA,EAEQ,MAAuB;AAC7B,WAAO,IAAI,QAAQ,CAAC,SAAS,WAAW;AAEtC,YAAM,QAAe,OAAO,oBAAoB,EAAE,iBAAiB;AACnE,UAAI,MAAM,WAAW,EAAG,QAAO,QAAQ,EAAE;AAGzC,YAAM,cAAgC,IAAI,OAAO,UAAU,OAAO;AAClE,kBAAY,SAAS,KAAK;AAC1B,kBAAY,cAAc,sCAAsC;AAEhE,kBAAY,WAAW,QAAQ,CAAC,KAAK,YAAY;AAC/C,YAAI,SAAS;AACX,kBAAQ,MAAM,IAAI,SAAS,MAAS;AAAA,QACtC,OACK;AACH,iBAAO,IAAI,MAAM,oBAAoB,CAAC;AAAA,QACxC;AAAA,MACF,CAAC;AAED,kBAAY,UAAU;AAAA,IACxB,CAAC;AAAA,EACH;AACF;AAWA,SAAS,QAAQ,WAAoB;AACnC,MAAI,CAAC,UAAW,QAAO;AACvB,SAAO,UAAU,cAAc,gBAAI,SAAS,QAAW,EAAE,SAAS,KAAK,CAAC,IAAI;AAC9E;AAEA,IAAI,QAAQ,OAAO,gBAAgB,OAAO,EAAG,QAAO,iBAAiB,IAAI,eAAe;AACjF,IAAM,WAAW,OAAO;","names":[]}
1
+ {"version":3,"sources":["../../debug-log.ts","../../crypto.ts","../../package.json"],"sourcesContent":["/* eslint-disable no-magic-numbers */\n\nComponents.utils.importGlobalProperties(['FormData'])\nimport { CONTENT_ENCRYPTION_ALG, KEY_WRAPPING_ALG, KEYTYPE } from './crypto'\n\nimport * as jose from 'jose'\nimport * as UZip from 'uzip'\nimport pkg from './package.json'\n\nexport class Bundler {\n public key: string\n\n #refs = false\n\n #pk?: JsonWebKey\n #pubKey?: CryptoKey\n\n #files: Record<string, Uint8Array> = {}\n #encoder = new TextEncoder()\n\n constructor(pk?: JsonWebKey) {\n this.key = Zotero.Utilities.generateObjectKey()\n\n if (pk && pk.kty === KEYTYPE) this.#pk = pk\n }\n\n async add(path: string, data: string, refs = false): Promise<void> {\n this.#refs = this.#refs || refs\n\n const encoded = this.#encoder.encode(data)\n\n if (this.#pk) {\n if (!this.#pubKey) this.#pubKey = (await jose.importJWK(this.#pk, KEY_WRAPPING_ALG)) as CryptoKey\n const jwe = await (new jose.CompactEncrypt(encoded))\n .setProtectedHeader({\n alg: KEY_WRAPPING_ALG,\n enc: CONTENT_ENCRYPTION_ALG,\n })\n .encrypt(this.#pubKey)\n\n this.#files[`${this.key}/${path}.jwe`] = this.#encoder.encode(jwe)\n }\n else {\n this.#files[`${this.key}/${path}`] = encoded\n }\n }\n\n public get zip(): ArrayBuffer {\n return UZip.encode(this.#files) as ArrayBuffer\n }\n\n public get name(): string {\n return `${this.key}.zip`\n }\n\n public id(host: string): string {\n return `${this.key}-${host}${this.#refs ? '.refs' : ''}${this.#pubKey ? '.enc' : ''}`\n }\n\n public async send(): Promise<string> {\n const response = await fetch(`https://filebin.net/${this.key}/${this.name}`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/zip',\n },\n body: new Blob([this.zip], { type: 'application/zip' }),\n })\n\n if (response.ok) return this.id('fbin')\n throw new Error(await response.text())\n }\n}\n\ndeclare var Services: any // eslint-disable-line no-var\ndeclare const Components: any\ndeclare const ChromeUtils: any\n\ntype ExportTranslator = {\n setHandler: (phase: string, handler: (obj: { string: string }, success: boolean) => void) => void // eslint-disable-line id-blacklist\n setTranslator: (id: string) => void\n setItems: (items: any[]) => void\n translate: () => void\n}\n\nconst zotero_prefs_root = 'extensions.zotero.'\n\ntype Plugin = {\n plugin: string\n preferences: string[]\n pubKey?: JsonWebKey\n}\n\nclass DebugLogSender {\n version = pkg.version\n #menu: string | false\n #plugins: Plugin[] = []\n\n public debugEnabledAtStart: boolean = typeof Zotero !== 'undefined'\n ? (Zotero.Prefs.get('debug.store') || Zotero.Debug.enabled) as unknown as boolean\n : null\n\n public register(plugin: string, preferences: string[] = [], pubKey?: JsonWebKey): void {\n this.#menu ??= Zotero.MenuManager.registerMenu({\n menuID: 'debug-log-sender',\n pluginID: 'debug-log-sender',\n target: 'main/menubar/help',\n menus: [\n {\n menuType: 'submenu',\n onShowing: (event, context) => {\n context.setVisible(!!this.#plugins.length)\n context.menuElem?.setAttribute('label', 'Send plugin debug log')\n },\n menus: Array.from({ length: 20 }, (v, i) => ({\n menuType: 'menuitem',\n onShowing: (event: Event, context: _ZoteroTypes.MenuManager.MenuContext) => {\n context.setVisible(this.#plugins.length > i)\n context.menuElem?.setAttribute('label', this.#plugins[i]?.plugin || '')\n },\n onCommand: (event: Event, context: _ZoteroTypes.MenuManager.MenuContext) => {\n void this.send(this.#plugins[i])\n },\n })),\n },\n ],\n })\n\n this.#plugins.push({ plugin, preferences, pubKey })\n }\n\n public unregister(plugin: string) {\n this.#plugins = this.#plugins.filter(p => p.plugin !== plugin)\n }\n\n private async send({ plugin, preferences, pubKey }: Plugin): Promise<void> {\n try {\n await Zotero.Schema.schemaUpdatePromise\n\n const bundler = new Bundler(pubKey || undefined)\n\n let log = [\n await this.info(preferences),\n Zotero.getErrors(true).join('\\n\\n'),\n Zotero.Debug.getConsoleViewerOutput().slice(-250000).join('\\n'), // eslint-disable-line no-magic-numbers\n ].filter((txt: string) => txt).join('\\n\\n').trim()\n await bundler.add('debug.txt', log)\n\n let rdf = await this.rdf()\n if (rdf) await bundler.add('items.rdf', rdf, true)\n\n const logid = await bundler.send()\n Services.prompt.alert(null, `Debug log ID for ${plugin}`, logid)\n }\n catch (err) {\n Services.prompt.alert(null, `Could not post debug log for ${plugin}`, err.message)\n }\n }\n\n private preferences(preferences: string[]): Record<string, string | number | boolean> {\n const prefs: Record<string, string | number | boolean> = {}\n\n const names: string[] = []\n for (let pref of preferences) {\n if (pref[0] === ':') {\n pref = pref.substring(1)\n }\n else if (!pref.startsWith(zotero_prefs_root)) {\n pref = zotero_prefs_root + pref\n }\n if (pref.endsWith('.')) {\n const childkeys: string[] = Services.prefs.getBranch(pref).getChildList('', {})\n for (const key of childkeys) {\n names.push(pref + key)\n }\n }\n else {\n names.push(pref)\n }\n }\n\n for (const pref of names.sort()) {\n prefs[pref] = Zotero.Prefs.get(pref, true)\n }\n\n return prefs\n }\n\n // general state of Zotero\n private async info(preferences: string[]): Promise<string> {\n let info = ''\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-assignment\n const appInfo: { name: string; version: string } = Components.classes['@mozilla.org/xre/app-info;1'].getService(Components.interfaces.nsIXULAppInfo)\n info += `Application: ${appInfo.name} ${appInfo.version} ${Zotero.locale}\\n`\n\n const platform = ['Win', 'Mac', 'Linux'].find(p => Zotero[`is${p}`]) || 'Unknown'\n info += `Platform: ${platform}\\n`\n\n const addons: string[] = await Zotero.getInstalledExtensions()\n if (addons.length) {\n info += 'Addons:\\n' + addons.map((addon: string) => ` ${addon}\\n`).join('') // eslint-disable-line prefer-template\n }\n info += `Debug logging on at Zotero start: ${this.debugEnabledAtStart}\\n`\n info += `Debug logging on at log submit: ${Zotero.Prefs.get('debug.store') || Zotero.Debug.enabled}\\n`\n\n for (const [pref, value] of Object.entries(this.preferences(preferences))) {\n info += `${pref} = ${JSON.stringify(value)}\\n`\n }\n\n return info\n }\n\n private rdf(): Promise<string> {\n return new Promise((resolve, reject) => {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-assignment\n const items: any[] = Zotero.getActiveZoteroPane().getSelectedItems()\n if (items.length === 0) return resolve('')\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call\n const translation: ExportTranslator = new Zotero.Translate.Export() as ExportTranslator\n translation.setItems(items)\n translation.setTranslator('14763d24-8ba0-45df-8f52-b8d1108e7ac9') // rdf\n\n translation.setHandler('done', (obj, success) => {\n if (success) {\n resolve(obj ? obj.string : undefined)\n }\n else {\n reject(new Error('translation failed'))\n }\n })\n\n translation.translate() // eslint-disable-line @typescript-eslint/no-unsafe-call\n })\n }\n}\n\ndeclare global {\n interface Zotero {\n DebugLogSender?: DebugLogSender\n }\n namespace Zotero {\n var DebugLogSender: DebugLogSender | undefined\n }\n}\n\nfunction upgrade(installed?: string) {\n if (!installed) return true\n return installed.localeCompare(pkg.version, undefined, { numeric: true }) < 0\n}\n\nif (upgrade(Zotero.DebugLogSender?.version)) Zotero.DebugLogSender = new DebugLogSender()\nexport const DebugLog = Zotero.DebugLogSender\n","export const KEYTYPE = 'RSA'\nexport const KEY_WRAPPING_ALG = 'RSA-OAEP-256'\nexport const CONTENT_ENCRYPTION_ALG = 'A256GCM'\nexport const RSA_HASH = 'SHA-256'\nexport const RSA_ALGORITHM = 'RSA-OAEP'\nexport const CIPHER_ALGORITHM = 'aes256'\nexport const AES_KEY_LENGTH = 256\n// export const AES_KEY_BYTES = 32\n\n// export const AES_ALGORITHM = 'AES-GCM'\n// export const IV_LENGTH = 12\n","export default {\n \"name\": \"zotero-plugin\",\n \"version\": \"8.0.14\",\n \"description\": \"Zotero plugin builder\",\n \"homepage\": \"https://github.com/retorquere/zotero-plugin/wiki\",\n \"type\": \"module\",\n \"main\": \"./dist/cjs/index.js\",\n \"module\": \"./dist/esm/index.js\",\n \"exports\": {\n \".\": {\n \"import\": \"./dist/esm/index.js\",\n \"require\": \"./dist/cjs/index.cjs\"\n },\n \"./debug-log\": {\n \"import\": \"./dist/esm/debug-log.js\",\n \"require\": \"./dist/cjs/debug-log.cjs\"\n },\n \"./logger\": {\n \"import\": \"./dist/esm/logger.js\",\n \"require\": \"./dist/cjs/logger.cjs\"\n },\n \".loader/json\": {\n \"import\": \"./dist/esm/loader/json.js\",\n \"require\": \"./dist/cjs/loader/json.cjs\"\n },\n \".loader/peggy\": {\n \"import\": \"./dist/esm/loader/peggy.js\",\n \"require\": \"./dist/cjs/loader/peggy.cjs\"\n },\n \".loader/pem\": {\n \"import\": \"./dist/esm/loader/pem.js\",\n \"require\": \"./dist/cjs/loader/pem.cjs\"\n },\n \"./copy-assets\": {\n \"import\": \"./dist/esm/bin/copy-assets.js\",\n \"require\": \"./dist/cjs/bin/copy-assets.cjs\"\n },\n \"./make-dirs\": {\n \"import\": \"./dist/esm/bin/make-dirs.js\",\n \"require\": \"./dist/cjs/bin/make-dirs.cjs\"\n },\n \"./make-manifest\": {\n \"import\": \"./dist/esm/bin/make-manifest.js\",\n \"require\": \"./dist/cjs/bin/make-manifest.cjs\"\n },\n \"./make-version\": {\n \"import\": \"./dist/esm/bin/version.js\",\n \"require\": \"./dist/cjs/bin/version.cjs\"\n }\n },\n \"author\": {\n \"name\": \"Emiliano Heyns\",\n \"email\": \"Emiliano.Heyns@iris-advies.com\"\n },\n \"scripts\": {\n \"preversion\": \"npm test\",\n \"postversion\": \"git push --follow-tags\",\n \"test\": \"dprint fmt *.ts */*.ts && dprint check *.ts */*.ts && npm run build\",\n \"prebuild\": \"rm -rf dist\",\n \"build\": \"tsup\",\n \"check\": \"tsc --noEmit\",\n \"start\": \"concurrently --raw --group 'npm run check' 'npm run build'\",\n \"pack\": \"npm test && npm pack\",\n \"prepublishOnly\": \"npm install && npm run build\",\n \"ncu\": \"ncu -u && npm i && git add package.json package-lock.json && git commit -m ncu\"\n },\n \"directories\": {\n \"test\": \"test\"\n },\n \"dependencies\": {\n \"@fluent/syntax\": \"^0.19.0\",\n \"@napi-rs/keyring\": \"^1.2.0\",\n \"@octokit/rest\": \"^22.0.1\",\n \"@rgrove/parse-xml\": \"^4.2.0\",\n \"@types/node\": \"^25.3.0\",\n \"@xmldom/xmldom\": \"^0.9.8\",\n \"ajv\": \"^8.18.0\",\n \"ajv-keywords\": \"^5.1.0\",\n \"archiver\": \"^7.0.1\",\n \"clp\": \"^4.0.13\",\n \"commander\": \"^14.0.3\",\n \"dotenv\": \"^17.3.1\",\n \"ejs\": \"^4.0.1\",\n \"fs-extra\": \"^11.3.3\",\n \"glob\": \"^13.0.6\",\n \"ini\": \"^6.0.0\",\n \"jose\": \"^6.1.3\",\n \"jsesc\": \"^3.1.0\",\n \"lodash\": \"^4.17.23\",\n \"moment\": \"^2.30.1\",\n \"node-forge\": \"^1.3.3\",\n \"node-stream-zip\": \"^1.15.0\",\n \"openpgp\": \"^6.3.0\",\n \"peggy\": \"^5.0.6\",\n \"prompts\": \"^2.4.2\",\n \"pug\": \"^3.0.3\",\n \"rimraf\": \"^6.1.3\",\n \"shell-quote\": \"^1.8.3\",\n \"shelljs\": \"^0.10.0\",\n \"string-to-arraybuffer\": \"^1.0.2\",\n \"ts-node\": \"^10.9.2\",\n \"tslib\": \"^2.8.1\",\n \"typescript\": \"^5.9.3\",\n \"uri-templates\": \"^0.2.0\",\n \"url-template\": \"^3.1.1\",\n \"uzip\": \"^0.20201231.0\",\n \"xml-parser\": \"^1.2.1\",\n \"xpath\": \"^0.0.34\",\n \"zotero-types\": \"^4.1.1\"\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/retorquere/zotero-plugin.git\"\n },\n \"license\": \"ISC\",\n \"files\": [\n \"package.json\",\n \"README.md\",\n \"dist\"\n ],\n \"bin\": {\n \"zp-release\": \"dist/cjs/bin/release.cjs\",\n \"zp-zipup\": \"dist/cjs/bin/zipup.cjs\",\n \"zp-link\": \"dist/cjs/bin/link.cjs\",\n \"issue-branches\": \"dist/cjs/bin/branches.cjs\",\n \"zotero-start\": \"dist/cjs/bin/start.cjs\",\n \"zp-fetch-log\": \"dist/cjs/bin/fetch-log.cjs\",\n \"zp-keypair\": \"dist/cjs/bin/keypair.cjs\",\n \"zp-copy-assets\": \"dist/cjs/copy-assets.cjs\",\n \"zp-make-dirs\": \"dist/cjs/make-dirs.cjs\",\n \"zp-manifest\": \"dist/cjs/make-manifest.cjs\",\n \"zp-version\": \"dist/cjs/version.cjs\"\n },\n \"bugs\": {\n \"url\": \"https://github.com/retorquere/zotero-plugin/issues\"\n },\n \"devDependencies\": {\n \"@openpgp/web-stream-tools\": \"^0.3.0\",\n \"concurrently\": \"^9.2.1\",\n \"dprint\": \"^0.51.1\",\n \"esbuild\": \"^0.27.3\",\n \"tsup\": \"^8.5.1\"\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAO,IAAM,UAAU;AAChB,IAAM,mBAAmB;AACzB,IAAM,yBAAyB;;;ADGtC,WAAsB;AACtB,WAAsB;;;AENtB,IAAO,kBAAQ;AAAA,EACb,QAAQ;AAAA,EACR,WAAW;AAAA,EACX,eAAe;AAAA,EACf,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,WAAW;AAAA,IACT,KAAK;AAAA,MACH,UAAU;AAAA,MACV,WAAW;AAAA,IACb;AAAA,IACA,eAAe;AAAA,MACb,UAAU;AAAA,MACV,WAAW;AAAA,IACb;AAAA,IACA,YAAY;AAAA,MACV,UAAU;AAAA,MACV,WAAW;AAAA,IACb;AAAA,IACA,gBAAgB;AAAA,MACd,UAAU;AAAA,MACV,WAAW;AAAA,IACb;AAAA,IACA,iBAAiB;AAAA,MACf,UAAU;AAAA,MACV,WAAW;AAAA,IACb;AAAA,IACA,eAAe;AAAA,MACb,UAAU;AAAA,MACV,WAAW;AAAA,IACb;AAAA,IACA,iBAAiB;AAAA,MACf,UAAU;AAAA,MACV,WAAW;AAAA,IACb;AAAA,IACA,eAAe;AAAA,MACb,UAAU;AAAA,MACV,WAAW;AAAA,IACb;AAAA,IACA,mBAAmB;AAAA,MACjB,UAAU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Q,qCAAqC,KAAK,mBAAmB;AAAA;AACrE,YAAQ,mCAAmC,OAAO,MAAM,IAAI,aAAa,KAAK,OAAO,MAAM,OAAO;AAAA;AAElG,eAAW,CAAC,MAAM,KAAK,KAAK,OAAO,QAAQ,KAAK,YAAY,WAAW,CAAC,GAAG;AACzE,cAAQ,GAAG,IAAI,MAAM,KAAK,UAAU,KAAK,CAAC;AAAA;AAAA,IAC5C;AAEA,WAAO;AAAA,EACT;AAAA,EAEQ,MAAuB;AAC7B,WAAO,IAAI,QAAQ,CAAC,SAAS,WAAW;AAEtC,YAAM,QAAe,OAAO,oBAAoB,EAAE,iBAAiB;AACnE,UAAI,MAAM,WAAW,EAAG,QAAO,QAAQ,EAAE;AAGzC,YAAM,cAAgC,IAAI,OAAO,UAAU,OAAO;AAClE,kBAAY,SAAS,KAAK;AAC1B,kBAAY,cAAc,sCAAsC;AAEhE,kBAAY,WAAW,QAAQ,CAAC,KAAK,YAAY;AAC/C,YAAI,SAAS;AACX,kBAAQ,MAAM,IAAI,SAAS,MAAS;AAAA,QACtC,OACK;AACH,iBAAO,IAAI,MAAM,oBAAoB,CAAC;AAAA,QACxC;AAAA,MACF,CAAC;AAED,kBAAY,UAAU;AAAA,IACxB,CAAC;AAAA,EACH;AACF;AAWA,SAAS,QAAQ,WAAoB;AACnC,MAAI,CAAC,UAAW,QAAO;AACvB,SAAO,UAAU,cAAc,gBAAI,SAAS,QAAW,EAAE,SAAS,KAAK,CAAC,IAAI;AAC9E;AAEA,IAAI,QAAQ,OAAO,gBAAgB,OAAO,EAAG,QAAO,iBAAiB,IAAI,eAAe;AACjF,IAAM,WAAW,OAAO;","names":[]}
@@ -5,9 +5,8 @@ declare class Bundler {
5
5
  add(path: string, data: string, refs?: boolean): Promise<void>;
6
6
  get zip(): ArrayBuffer;
7
7
  get name(): string;
8
- id(remote: string): string;
9
- formData(expire?: number): FormData;
10
- send(useragent: any, expire?: number): Promise<string>;
8
+ id(host: string): string;
9
+ send(): Promise<string>;
11
10
  }
12
11
  declare class DebugLogSender {
13
12
  #private;
@@ -49,18 +49,19 @@ program.description("A script to fetch debug logs.").option("-p, --private <path
49
49
  var options = program.opts();
50
50
  var args = program.args;
51
51
  if (!args.length) oops("No log ID");
52
- var m = args[0].match(/^(?<key>[a-z0-9]+)-(?<host>[^-]+)-(?<remote>[^.]+)(?<tags>.*)$/i);
52
+ var m = args[0].match(/^(?<key>[a-z0-9]+)-(?<host>[^-]+)(?<tags>.*)$/i);
53
53
  if (!m) oops(args[0], "is not a valid log ID");
54
- if (m.groups.host !== "0x0") oops("Unexpected debug log host", m.groups.host);
55
- options.encrypted = m.groups.tags.split(".").includes("enc");
56
- options.zip = path2.join("logs", `${m.groups.key}.zip`);
57
- options.url = `https://0x0.st/${m.groups.remote}.zip`;
54
+ var { host, key, tags } = m.groups;
55
+ if (host !== "fbin") oops("Unexpected debug log host", host);
56
+ options.encrypted = tags.split(".").includes("enc");
57
+ options.zip = path2.join("logs", `${key}.zip`);
58
+ options.url = `https://filebin.net/${key}/${key}.zip`;
58
59
  if (options.encrypted) {
59
60
  if (!options.private) oops("No private key provided");
60
61
  if (!fs2.existsSync(options.private)) oops("Private key", options.private, "does not exist");
61
62
  if (!fs2.existsSync("package.json")) oops("package.json does not exist in the current directory");
62
63
  }
63
- var logs = path2.join("logs", m.groups.key);
64
+ var logs = path2.join("logs", key);
64
65
  console.log(options.url, "=>", logs);
65
66
  if (!fs2.existsSync(logs)) {
66
67
  fs2.mkdirSync(logs, { recursive: true });
@@ -86,14 +87,15 @@ async function main() {
86
87
  const response = await fetch(options.url, {
87
88
  method: "GET",
88
89
  headers: {
89
- "User-Agent": `Zotero plugin log fetcher ${pkg.version}`,
90
+ "User-Agent": "curl/7.81.0",
91
+ // filebin does not seem to accept custom user agents
92
+ "Accept-Encoding": "identity",
90
93
  Accept: "*/*"
91
94
  }
92
95
  });
93
96
  if (!response.ok) oops(`Failed to download: ${response.statusText}`);
94
- const readable = Readable.fromWeb(response.body);
95
97
  const download = fs2.createWriteStream(options.zip);
96
- await finished(readable.pipe(download));
98
+ await finished(Readable.fromWeb(response.body).pipe(download));
97
99
  const zipfile = new StreamZip.async({ file: options.zip });
98
100
  const entries = Object.values(await zipfile.entries()).filter((entry) => !entry.isDirectory);
99
101
  const privateKey = await getPrivateKey();
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../bin/fetch-log.ts","../../../crypto.ts","../../../bin/find-root.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport { Command } from 'commander'\nimport crypto, { webcrypto } from 'crypto'\nimport fs from 'fs'\nimport * as jose from 'jose'\nimport StreamZip from 'node-stream-zip'\nimport { Readable } from 'node:stream'\nimport { finished } from 'node:stream/promises'\nimport path from 'path'\n\nimport { Entry as KeyRingEntry } from '@napi-rs/keyring'\nimport prompts from 'prompts'\n\nimport { KEY_WRAPPING_ALG } from '../crypto'\nimport { pkg } from './find-root'\n\nasync function getPassphrase(): Promise<string> {\n const service = `${pkg.name} Zotero plugin`\n const account = `${pkg.name}-debug-log`\n const entry = new KeyRingEntry(service, account)\n let passphrase = entry.getPassword()\n if (!passphrase) {\n const response = await prompts({\n type: 'password',\n name: 'passphrase',\n message: `Enter a passphrase to decrypt your private key for ${service} ${account}:`,\n })\n entry.setPassword(passphrase = response.passphrase)\n }\n return passphrase\n}\n\nconst oops = (...args) => {\n console.error(...args)\n process.exit(1)\n}\n\nconst program = new Command()\nprogram\n .description('A script to fetch debug logs.')\n .option('-p, --private <path>', 'Path for the encrypted private key .pem file', 'private.pem')\n .option('-k, --keep', 'Keep the downloaded zip', false)\n .argument('<debug log id>', 'debug log ID to fetch')\n .parse(process.argv)\nconst options = program.opts()\nconst args = program.args\n\nif (!args.length) oops('No log ID')\n\nlet m = args[0].match(/^(?<key>[a-z0-9]+)-(?<host>[^-]+)-(?<remote>[^.]+)(?<tags>.*)$/i)\nif (!m) oops(args[0], 'is not a valid log ID')\n\nif (m.groups.host !== '0x0') oops('Unexpected debug log host', m.groups.host)\n\noptions.encrypted = m.groups.tags.split('.').includes('enc')\noptions.zip = path.join('logs', `${m.groups.key}.zip`)\noptions.url = `https://0x0.st/${m.groups.remote}.zip`\n\nif (options.encrypted) {\n if (!options.private) oops('No private key provided')\n if (!fs.existsSync(options.private)) oops('Private key', options.private, 'does not exist')\n if (!fs.existsSync('package.json')) oops('package.json does not exist in the current directory')\n}\n\nconst logs = path.join('logs', m.groups!.key)\nconsole.log(options.url, '=>', logs)\nif (!fs.existsSync(logs)) {\n fs.mkdirSync(logs, { recursive: true })\n}\n\nasync function getPrivateKey(): Promise<webcrypto.CryptoKey> {\n if (!options.encrypted) return undefined\n\n const privateKeyObject = crypto.createPrivateKey({\n key: fs.readFileSync(options.private, 'utf-8'),\n format: 'pem',\n passphrase: await getPassphrase(),\n })\n const unencryptedKeyPEM = privateKeyObject.export({\n type: 'pkcs8',\n format: 'pem',\n }).toString()\n return await jose.importPKCS8(\n unencryptedKeyPEM,\n KEY_WRAPPING_ALG,\n )\n}\nasync function main() {\n try {\n const response = await fetch(options.url, {\n method: 'GET',\n headers: {\n 'User-Agent': `Zotero plugin log fetcher ${pkg.version}`,\n Accept: '*/*',\n },\n })\n if (!response.ok) oops(`Failed to download: ${response.statusText}`)\n\n const readable = Readable.fromWeb(response.body as any)\n const download = fs.createWriteStream(options.zip)\n await finished(readable.pipe(download))\n\n const zipfile = new StreamZip.async({ file: options.zip })\n const entries = Object.values(await zipfile.entries()).filter(entry => !entry.isDirectory)\n\n const privateKey = await getPrivateKey()\n\n for (const entry of entries) {\n const m = entry.name.match(/(?<filename>.+)\\.(?<type>jwe)$/i)\n const filename = m?.groups!.filename || entry.name\n const type = (m?.groups!.type || '').toLowerCase()\n const target = path.join('logs', filename)\n\n if (options.encrypted && !type) oops('Unexpected unencrypted contents', entry.name)\n if (type && !options.encrypted) oops('Unexpected encrypted contents', entry.name)\n switch (type) {\n case '':\n fs.writeFileSync(target, await zipfile.entryData(entry.name))\n break\n case 'jwe': {\n const { plaintext } = await jose.compactDecrypt((await zipfile.entryData(entry.name)).toString('utf8'), privateKey)\n fs.writeFileSync(target, plaintext)\n break\n }\n default:\n oops('Unexpected log entry', entry.name)\n break\n }\n }\n }\n finally {\n if (!options.keep && fs.existsSync(options.zip)) fs.unlinkSync(options.zip)\n }\n}\n\nmain().catch(err => {\n oops(err.message)\n})\n","export const KEYTYPE = 'RSA'\nexport const KEY_WRAPPING_ALG = 'RSA-OAEP-256'\nexport const CONTENT_ENCRYPTION_ALG = 'A256GCM'\nexport const RSA_HASH = 'SHA-256'\nexport const RSA_ALGORITHM = 'RSA-OAEP'\nexport const CIPHER_ALGORITHM = 'aes256'\nexport const AES_KEY_LENGTH = 256\n// export const AES_KEY_BYTES = 32\n\n// export const AES_ALGORITHM = 'AES-GCM'\n// export const IV_LENGTH = 12\n","import fs from 'node:fs'\nimport path from 'node:path'\n\nconst folders = process.cwd().split(path.sep)\nconst rootIndex = folders.findIndex((folder: string, i: number) => fs.existsSync(path.join(folders.slice(0, i + 1).join(path.sep), 'package.json')))\nexport const root = (rootIndex > 0 ? folders.slice(0, rootIndex + 1) : folders).join(path.sep)\nconsole.log('project directory:', root)\n\nexport const pkg = JSON.parse(fs.readFileSync(path.join(root, 'package.json'), 'utf-8'))\n"],"mappings":";;;AAEA,SAAS,eAAe;AACxB,OAAO,YAA2B;AAClC,OAAOA,SAAQ;AACf,YAAY,UAAU;AACtB,OAAO,eAAe;AACtB,SAAS,gBAAgB;AACzB,SAAS,gBAAgB;AACzB,OAAOC,WAAU;AAEjB,SAAS,SAAS,oBAAoB;AACtC,OAAO,aAAa;;;ACXb,IAAM,mBAAmB;;;ACDhC,OAAO,QAAQ;AACf,OAAO,UAAU;AAEjB,IAAM,UAAU,QAAQ,IAAI,EAAE,MAAM,KAAK,GAAG;AAC5C,IAAM,YAAY,QAAQ,UAAU,CAAC,QAAgB,MAAc,GAAG,WAAW,KAAK,KAAK,QAAQ,MAAM,GAAG,IAAI,CAAC,EAAE,KAAK,KAAK,GAAG,GAAG,cAAc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.ts","../../../crypto.ts","../../../bin/find-root.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport { Command } from 'commander'\nimport crypto, { webcrypto } from 'crypto'\nimport fs from 'fs'\nimport * as jose from 'jose'\nimport StreamZip from 'node-stream-zip'\nimport { Readable } from 'node:stream'\nimport { finished } from 'node:stream/promises'\nimport path from 'path'\n\nimport { Entry as KeyRingEntry } from '@napi-rs/keyring'\nimport prompts from 'prompts'\n\nimport { KEY_WRAPPING_ALG } from '../crypto'\nimport { pkg } from './find-root'\n\nasync function getPassphrase(): Promise<string> {\n const service = `${pkg.name} Zotero plugin`\n const account = `${pkg.name}-debug-log`\n const entry = new KeyRingEntry(service, account)\n let passphrase = entry.getPassword()\n if (!passphrase) {\n const response = await prompts({\n type: 'password',\n name: 'passphrase',\n message: `Enter a passphrase to decrypt your private key for ${service} ${account}:`,\n })\n entry.setPassword(passphrase = response.passphrase)\n }\n return passphrase\n}\n\nconst oops = (...args) => {\n console.error(...args)\n process.exit(1)\n}\n\nconst program = new Command()\nprogram\n .description('A script to fetch debug logs.')\n .option('-p, --private <path>', 'Path for the encrypted private key .pem file', 'private.pem')\n .option('-k, --keep', 'Keep the downloaded zip', false)\n .argument('<debug log id>', 'debug log ID to fetch')\n .parse(process.argv)\nconst options = program.opts()\nconst args = program.args\n\nif (!args.length) oops('No log ID')\n\nlet m = args[0].match(/^(?<key>[a-z0-9]+)-(?<host>[^-]+)(?<tags>.*)$/i)\nif (!m) oops(args[0], 'is not a valid log ID')\n\nconst { host, key, tags } = m.groups\nif (host !== 'fbin') oops('Unexpected debug log host', host)\n\noptions.encrypted = tags.split('.').includes('enc')\noptions.zip = path.join('logs', `${key}.zip`)\noptions.url = `https://filebin.net/${key}/${key}.zip`\n\nif (options.encrypted) {\n if (!options.private) oops('No private key provided')\n if (!fs.existsSync(options.private)) oops('Private key', options.private, 'does not exist')\n if (!fs.existsSync('package.json')) oops('package.json does not exist in the current directory')\n}\n\nconst logs = path.join('logs', key)\nconsole.log(options.url, '=>', logs)\nif (!fs.existsSync(logs)) {\n fs.mkdirSync(logs, { recursive: true })\n}\n\nasync function getPrivateKey(): Promise<webcrypto.CryptoKey> {\n if (!options.encrypted) return undefined\n\n const privateKeyObject = crypto.createPrivateKey({\n key: fs.readFileSync(options.private, 'utf-8'),\n format: 'pem',\n passphrase: await getPassphrase(),\n })\n const unencryptedKeyPEM = privateKeyObject.export({\n type: 'pkcs8',\n format: 'pem',\n }).toString()\n return await jose.importPKCS8(\n unencryptedKeyPEM,\n KEY_WRAPPING_ALG,\n )\n}\nasync function main() {\n try {\n const response = await fetch(options.url, {\n method: 'GET',\n headers: {\n 'User-Agent': 'curl/7.81.0', // filebin does not seem to accept custom user agents\n 'Accept-Encoding': 'identity',\n Accept: '*/*',\n },\n })\n if (!response.ok) oops(`Failed to download: ${response.statusText}`)\n\n const download = fs.createWriteStream(options.zip)\n await finished(Readable.fromWeb(response.body as any).pipe(download))\n\n const zipfile = new StreamZip.async({ file: options.zip })\n const entries = Object.values(await zipfile.entries()).filter(entry => !entry.isDirectory)\n\n const privateKey = await getPrivateKey()\n\n for (const entry of entries) {\n const m = entry.name.match(/(?<filename>.+)\\.(?<type>jwe)$/i)\n const filename = m?.groups!.filename || entry.name\n const type = (m?.groups!.type || '').toLowerCase()\n const target = path.join('logs', filename)\n\n if (options.encrypted && !type) oops('Unexpected unencrypted contents', entry.name)\n if (type && !options.encrypted) oops('Unexpected encrypted contents', entry.name)\n switch (type) {\n case '':\n fs.writeFileSync(target, await zipfile.entryData(entry.name))\n break\n case 'jwe': {\n const { plaintext } = await jose.compactDecrypt((await zipfile.entryData(entry.name)).toString('utf8'), privateKey)\n fs.writeFileSync(target, plaintext)\n break\n }\n default:\n oops('Unexpected log entry', entry.name)\n break\n }\n }\n }\n finally {\n if (!options.keep && fs.existsSync(options.zip)) fs.unlinkSync(options.zip)\n }\n}\n\nmain().catch(err => {\n oops(err.message)\n})\n","export const KEYTYPE = 'RSA'\nexport const KEY_WRAPPING_ALG = 'RSA-OAEP-256'\nexport const CONTENT_ENCRYPTION_ALG = 'A256GCM'\nexport const RSA_HASH = 'SHA-256'\nexport const RSA_ALGORITHM = 'RSA-OAEP'\nexport const CIPHER_ALGORITHM = 'aes256'\nexport const AES_KEY_LENGTH = 256\n// export const AES_KEY_BYTES = 32\n\n// export const AES_ALGORITHM = 'AES-GCM'\n// export const IV_LENGTH = 12\n","import fs from 'node:fs'\nimport path from 'node:path'\n\nconst folders = process.cwd().split(path.sep)\nconst rootIndex = folders.findIndex((folder: string, i: number) => fs.existsSync(path.join(folders.slice(0, i + 1).join(path.sep), 'package.json')))\nexport const root = (rootIndex > 0 ? folders.slice(0, rootIndex + 1) : folders).join(path.sep)\nconsole.log('project directory:', root)\n\nexport const pkg = JSON.parse(fs.readFileSync(path.join(root, 'package.json'), 'utf-8'))\n"],"mappings":";;;AAEA,SAAS,eAAe;AACxB,OAAO,YAA2B;AAClC,OAAOA,SAAQ;AACf,YAAY,UAAU;AACtB,OAAO,eAAe;AACtB,SAAS,gBAAgB;AACzB,SAAS,gBAAgB;AACzB,OAAOC,WAAU;AAEjB,SAAS,SAAS,oBAAoB;AACtC,OAAO,aAAa;;;ACXb,IAAM,mBAAmB;;;ACDhC,OAAO,QAAQ;AACf,OAAO,UAAU;AAEjB,IAAM,UAAU,QAAQ,IAAI,EAAE,MAAM,KAAK,GAAG;AAC5C,IAAM,YAAY,QAAQ,UAAU,CAAC,QAAgB,MAAc,GAAG,WAAW,KAAK,KAAK,QAAQ,MAAM,GAAG,IAAI,CAAC,EAAE,KAAK,KAAK,GAAG,GAAG,cAAc,CAAC,CAAC;AAC5I,IAAM,QAAQ,YAAY,IAAI,QAAQ,MAAM,GAAG,YAAY,CAAC,IAAI,SAAS,KAAK,KAAK,GAAG;AAC7F,QAAQ,IAAI,sBAAsB,IAAI;AAE/B,IAAM,MAAM,KAAK,MAAM,GAAG,aAAa,KAAK,KAAK,MAAM,cAAc,GAAG,OAAO,CAAC;;;AFSvF,eAAe,gB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vC,eAAW,SAAS,SAAS;AAC3B,YAAMC,KAAI,MAAM,KAAK,MAAM,iCAAiC;AAC5D,YAAM,WAAWA,IAAG,OAAQ,YAAY,MAAM;AAC9C,YAAM,QAAQA,IAAG,OAAQ,QAAQ,IAAI,YAAY;AACjD,YAAM,SAASF,MAAK,KAAK,QAAQ,QAAQ;AAEzC,UAAI,QAAQ,aAAa,CAAC,KAAM,MAAK,mCAAmC,MAAM,IAAI;AAClF,UAAI,QAAQ,CAAC,QAAQ,UAAW,MAAK,iCAAiC,MAAM,IAAI;AAChF,cAAQ,MAAM;AAAA,QACZ,KAAK;AACH,UAAAC,IAAG,cAAc,QAAQ,MAAM,QAAQ,UAAU,MAAM,IAAI,CAAC;AAC5D;AAAA,QACF,KAAK,OAAO;AACV,gBAAM,EAAE,UAAU,IAAI,MAAW,qBAAgB,MAAM,QAAQ,UAAU,MAAM,IAAI,GAAG,SAAS,MAAM,GAAG,UAAU;AAClH,UAAAA,IAAG,cAAc,QAAQ,SAAS;AAClC;AAAA,QACF;AAAA,QACA;AACE,eAAK,wBAAwB,MAAM,IAAI;AACvC;AAAA,MACJ;AAAA,IACF;AAAA,EACF,UACA;AACE,QAAI,CAAC,QAAQ,QAAQA,IAAG,WAAW,QAAQ,GAAG,EAAG,CAAAA,IAAG,WAAW,QAAQ,GAAG;AAAA,EAC5E;AACF;AAEA,KAAK,EAAE,MAAM,SAAO;AAClB,OAAK,IAAI,OAAO;AAClB,CAAC;","names":["fs","path","args","path","fs","m"]}
@@ -5,9 +5,8 @@ declare class Bundler {
5
5
  add(path: string, data: string, refs?: boolean): Promise<void>;
6
6
  get zip(): ArrayBuffer;
7
7
  get name(): string;
8
- id(remote: string): string;
9
- formData(expire?: number): FormData;
10
- send(useragent: any, expire?: number): Promise<string>;
8
+ id(host: string): string;
9
+ send(): Promise<string>;
11
10
  }
12
11
  declare class DebugLogSender {
13
12
  #private;
@@ -10,7 +10,7 @@ import * as UZip from "uzip";
10
10
  // package.json
11
11
  var package_default = {
12
12
  "name": "zotero-plugin",
13
- "version": "8.0.12",
13
+ "version": "8.0.14",
14
14
  "description": "Zotero plugin builder",
15
15
  "homepage": "https://github.com/retorquere/zotero-plugin/wiki",
16
16
  "type": "module",
@@ -186,28 +186,19 @@ var Bundler = class {
186
186
  get name() {
187
187
  return `${this.key}.zip`;
188
188
  }
189
- id(remote) {
190
- return `${this.key}-${remote}${this.#refs ? ".refs" : ""}${this.#pubKey ? ".enc" : ""}`;
189
+ id(host) {
190
+ return `${this.key}-${host}${this.#refs ? ".refs" : ""}${this.#pubKey ? ".enc" : ""}`;
191
191
  }
192
- formData(expire = 30) {
193
- const blob = new Blob([this.zip], { type: "application/zip" });
194
- const formData = new FormData();
195
- formData.append("file", blob, this.name);
196
- formData.append("expire", `${expire * 24}`);
197
- return formData;
198
- }
199
- async send(useragent, expire = 30) {
200
- const response = await fetch("https://0x0.st", {
192
+ async send() {
193
+ const response = await fetch(`https://filebin.net/${this.key}/${this.name}`, {
201
194
  method: "POST",
202
- body: this.formData(expire),
203
195
  headers: {
204
- "User-Agent": useragent
205
- }
196
+ "Content-Type": "application/zip"
197
+ },
198
+ body: new Blob([this.zip], { type: "application/zip" })
206
199
  });
207
- const body = await response.text();
208
- const id = body.match(/https:\/\/0x0.st\/([A-Z0-9]+)\.zip/i);
209
- if (!id) throw new Error(body);
210
- return this.id(`0x0-${id[1]}`);
200
+ if (response.ok) return this.id("fbin");
201
+ throw new Error(await response.text());
211
202
  }
212
203
  };
213
204
  var zotero_prefs_root = "extensions.zotero.";
@@ -259,7 +250,7 @@ var DebugLogSender = class {
259
250
  await bundler.add("debug.txt", log);
260
251
  let rdf = await this.rdf();
261
252
  if (rdf) await bundler.add("items.rdf", rdf, true);
262
- const logid = await bundler.send(`Zotero-plugin/${package_default.version}`);
253
+ const logid = await bundler.send();
263
254
  Services.prompt.alert(null, `Debug log ID for ${plugin}`, logid);
264
255
  } catch (err) {
265
256
  Services.prompt.alert(null, `Could not post debug log for ${plugin}`, err.message);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../crypto.ts","../../debug-log.ts","../../package.json"],"sourcesContent":["export const KEYTYPE = 'RSA'\nexport const KEY_WRAPPING_ALG = 'RSA-OAEP-256'\nexport const CONTENT_ENCRYPTION_ALG = 'A256GCM'\nexport const RSA_HASH = 'SHA-256'\nexport const RSA_ALGORITHM = 'RSA-OAEP'\nexport const CIPHER_ALGORITHM = 'aes256'\nexport const AES_KEY_LENGTH = 256\n// export const AES_KEY_BYTES = 32\n\n// export const AES_ALGORITHM = 'AES-GCM'\n// export const IV_LENGTH = 12\n","/* eslint-disable no-magic-numbers */\n\nComponents.utils.importGlobalProperties(['FormData'])\nimport { CONTENT_ENCRYPTION_ALG, KEY_WRAPPING_ALG, KEYTYPE } from './crypto'\n\nimport * as jose from 'jose'\nimport * as UZip from 'uzip'\nimport pkg from './package.json'\n\nexport class Bundler {\n public key: string\n\n #refs = false\n\n #pk?: JsonWebKey\n #pubKey?: CryptoKey\n\n #files: Record<string, Uint8Array> = {}\n #encoder = new TextEncoder()\n\n constructor(pk?: JsonWebKey) {\n this.key = Zotero.Utilities.generateObjectKey()\n\n if (pk && pk.kty === KEYTYPE) this.#pk = pk\n }\n\n async add(path: string, data: string, refs = false): Promise<void> {\n this.#refs = this.#refs || refs\n\n const encoded = this.#encoder.encode(data)\n\n if (this.#pk) {\n if (!this.#pubKey) this.#pubKey = (await jose.importJWK(this.#pk, KEY_WRAPPING_ALG)) as CryptoKey\n const jwe = await (new jose.CompactEncrypt(encoded))\n .setProtectedHeader({\n alg: KEY_WRAPPING_ALG,\n enc: CONTENT_ENCRYPTION_ALG,\n })\n .encrypt(this.#pubKey)\n\n this.#files[`${this.key}/${path}.jwe`] = this.#encoder.encode(jwe)\n }\n else {\n this.#files[`${this.key}/${path}`] = encoded\n }\n }\n\n public get zip(): ArrayBuffer {\n return UZip.encode(this.#files) as ArrayBuffer\n }\n\n public get name(): string {\n return `${this.key}.zip`\n }\n\n public id(remote: string): string {\n return `${this.key}-${remote}${this.#refs ? '.refs' : ''}${this.#pubKey ? '.enc' : ''}`\n }\n\n public formData(expire = 30): FormData {\n const blob = new Blob([this.zip], { type: 'application/zip' })\n const formData = new FormData()\n formData.append('file', blob, this.name)\n formData.append('expire', `${expire * 24}`)\n return formData\n }\n\n public async send(useragent, expire = 30): Promise<string> {\n const response = await fetch('https://0x0.st', {\n method: 'POST',\n body: this.formData(expire),\n headers: {\n 'User-Agent': useragent,\n },\n })\n const body = await response.text()\n const id = body.match(/https:\\/\\/0x0.st\\/([A-Z0-9]+)\\.zip/i)\n if (!id) throw new Error(body)\n return this.id(`0x0-${id[1]}`)\n }\n}\n\ndeclare var Services: any // eslint-disable-line no-var\ndeclare const Components: any\ndeclare const ChromeUtils: any\n\ntype ExportTranslator = {\n setHandler: (phase: string, handler: (obj: { string: string }, success: boolean) => void) => void // eslint-disable-line id-blacklist\n setTranslator: (id: string) => void\n setItems: (items: any[]) => void\n translate: () => void\n}\n\nconst zotero_prefs_root = 'extensions.zotero.'\n\ntype Plugin = {\n plugin: string\n preferences: string[]\n pubKey?: JsonWebKey\n}\n\nclass DebugLogSender {\n version = pkg.version\n #menu: string | false\n #plugins: Plugin[] = []\n\n public debugEnabledAtStart: boolean = typeof Zotero !== 'undefined'\n ? (Zotero.Prefs.get('debug.store') || Zotero.Debug.enabled) as unknown as boolean\n : null\n\n public register(plugin: string, preferences: string[] = [], pubKey?: JsonWebKey): void {\n this.#menu ??= Zotero.MenuManager.registerMenu({\n menuID: 'debug-log-sender',\n pluginID: 'debug-log-sender',\n target: 'main/menubar/help',\n menus: [\n {\n menuType: 'submenu',\n onShowing: (event, context) => {\n context.setVisible(!!this.#plugins.length)\n context.menuElem?.setAttribute('label', 'Send plugin debug log')\n },\n menus: Array.from({ length: 20 }, (v, i) => ({\n menuType: 'menuitem',\n onShowing: (event: Event, context: _ZoteroTypes.MenuManager.MenuContext) => {\n context.setVisible(this.#plugins.length > i)\n context.menuElem?.setAttribute('label', this.#plugins[i]?.plugin || '')\n },\n onCommand: (event: Event, context: _ZoteroTypes.MenuManager.MenuContext) => {\n void this.send(this.#plugins[i])\n },\n })),\n },\n ],\n })\n\n this.#plugins.push({ plugin, preferences, pubKey })\n }\n\n public unregister(plugin: string) {\n this.#plugins = this.#plugins.filter(p => p.plugin !== plugin)\n }\n\n private async send({ plugin, preferences, pubKey }: Plugin): Promise<void> {\n try {\n await Zotero.Schema.schemaUpdatePromise\n\n const bundler = new Bundler(pubKey || undefined)\n\n let log = [\n await this.info(preferences),\n Zotero.getErrors(true).join('\\n\\n'),\n Zotero.Debug.getConsoleViewerOutput().slice(-250000).join('\\n'), // eslint-disable-line no-magic-numbers\n ].filter((txt: string) => txt).join('\\n\\n').trim()\n await bundler.add('debug.txt', log)\n\n let rdf = await this.rdf()\n if (rdf) await bundler.add('items.rdf', rdf, true)\n\n const logid = await bundler.send(`Zotero-plugin/${pkg.version}`)\n Services.prompt.alert(null, `Debug log ID for ${plugin}`, logid)\n }\n catch (err) {\n Services.prompt.alert(null, `Could not post debug log for ${plugin}`, err.message)\n }\n }\n\n private preferences(preferences: string[]): Record<string, string | number | boolean> {\n const prefs: Record<string, string | number | boolean> = {}\n\n const names: string[] = []\n for (let pref of preferences) {\n if (pref[0] === ':') {\n pref = pref.substring(1)\n }\n else if (!pref.startsWith(zotero_prefs_root)) {\n pref = zotero_prefs_root + pref\n }\n if (pref.endsWith('.')) {\n const childkeys: string[] = Services.prefs.getBranch(pref).getChildList('', {})\n for (const key of childkeys) {\n names.push(pref + key)\n }\n }\n else {\n names.push(pref)\n }\n }\n\n for (const pref of names.sort()) {\n prefs[pref] = Zotero.Prefs.get(pref, true)\n }\n\n return prefs\n }\n\n // general state of Zotero\n private async info(preferences: string[]): Promise<string> {\n let info = ''\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-assignment\n const appInfo: { name: string; version: string } = Components.classes['@mozilla.org/xre/app-info;1'].getService(Components.interfaces.nsIXULAppInfo)\n info += `Application: ${appInfo.name} ${appInfo.version} ${Zotero.locale}\\n`\n\n const platform = ['Win', 'Mac', 'Linux'].find(p => Zotero[`is${p}`]) || 'Unknown'\n info += `Platform: ${platform}\\n`\n\n const addons: string[] = await Zotero.getInstalledExtensions()\n if (addons.length) {\n info += 'Addons:\\n' + addons.map((addon: string) => ` ${addon}\\n`).join('') // eslint-disable-line prefer-template\n }\n info += `Debug logging on at Zotero start: ${this.debugEnabledAtStart}\\n`\n info += `Debug logging on at log submit: ${Zotero.Prefs.get('debug.store') || Zotero.Debug.enabled}\\n`\n\n for (const [pref, value] of Object.entries(this.preferences(preferences))) {\n info += `${pref} = ${JSON.stringify(value)}\\n`\n }\n\n return info\n }\n\n private rdf(): Promise<string> {\n return new Promise((resolve, reject) => {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-assignment\n const items: any[] = Zotero.getActiveZoteroPane().getSelectedItems()\n if (items.length === 0) return resolve('')\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call\n const translation: ExportTranslator = new Zotero.Translate.Export() as ExportTranslator\n translation.setItems(items)\n translation.setTranslator('14763d24-8ba0-45df-8f52-b8d1108e7ac9') // rdf\n\n translation.setHandler('done', (obj, success) => {\n if (success) {\n resolve(obj ? obj.string : undefined)\n }\n else {\n reject(new Error('translation failed'))\n }\n })\n\n translation.translate() // eslint-disable-line @typescript-eslint/no-unsafe-call\n })\n }\n}\n\ndeclare global {\n interface Zotero {\n DebugLogSender?: DebugLogSender\n }\n namespace Zotero {\n var DebugLogSender: DebugLogSender | undefined\n }\n}\n\nfunction upgrade(installed?: string) {\n if (!installed) return true\n return installed.localeCompare(pkg.version, undefined, { numeric: true }) < 0\n}\n\nif (upgrade(Zotero.DebugLogSender?.version)) Zotero.DebugLogSender = new DebugLogSender()\nexport const DebugLog = Zotero.DebugLogSender\n","export default {\n \"name\": \"zotero-plugin\",\n \"version\": \"8.0.12\",\n \"description\": \"Zotero plugin builder\",\n \"homepage\": \"https://github.com/retorquere/zotero-plugin/wiki\",\n \"type\": \"module\",\n \"main\": \"./dist/cjs/index.js\",\n \"module\": \"./dist/esm/index.js\",\n \"exports\": {\n \".\": {\n \"import\": \"./dist/esm/index.js\",\n \"require\": \"./dist/cjs/index.cjs\"\n },\n \"./debug-log\": {\n \"import\": \"./dist/esm/debug-log.js\",\n \"require\": \"./dist/cjs/debug-log.cjs\"\n },\n \"./logger\": {\n \"import\": \"./dist/esm/logger.js\",\n \"require\": \"./dist/cjs/logger.cjs\"\n },\n \".loader/json\": {\n \"import\": \"./dist/esm/loader/json.js\",\n \"require\": \"./dist/cjs/loader/json.cjs\"\n },\n \".loader/peggy\": {\n \"import\": \"./dist/esm/loader/peggy.js\",\n \"require\": \"./dist/cjs/loader/peggy.cjs\"\n },\n \".loader/pem\": {\n \"import\": \"./dist/esm/loader/pem.js\",\n \"require\": \"./dist/cjs/loader/pem.cjs\"\n },\n \"./copy-assets\": {\n \"import\": \"./dist/esm/bin/copy-assets.js\",\n \"require\": \"./dist/cjs/bin/copy-assets.cjs\"\n },\n \"./make-dirs\": {\n \"import\": \"./dist/esm/bin/make-dirs.js\",\n \"require\": \"./dist/cjs/bin/make-dirs.cjs\"\n },\n \"./make-manifest\": {\n \"import\": \"./dist/esm/bin/make-manifest.js\",\n \"require\": \"./dist/cjs/bin/make-manifest.cjs\"\n },\n \"./make-version\": {\n \"import\": \"./dist/esm/bin/version.js\",\n \"require\": \"./dist/cjs/bin/version.cjs\"\n }\n },\n \"author\": {\n \"name\": \"Emiliano Heyns\",\n \"email\": \"Emiliano.Heyns@iris-advies.com\"\n },\n \"scripts\": {\n \"preversion\": \"npm test\",\n \"postversion\": \"git push --follow-tags\",\n \"test\": \"dprint fmt *.ts */*.ts && dprint check *.ts */*.ts && npm run build\",\n \"prebuild\": \"rm -rf dist\",\n \"build\": \"tsup\",\n \"check\": \"tsc --noEmit\",\n \"start\": \"concurrently --raw --group 'npm run check' 'npm run build'\",\n \"pack\": \"npm test && npm pack\",\n \"prepublishOnly\": \"npm install && npm run build\",\n \"ncu\": \"ncu -u && npm i && git add package.json package-lock.json && git commit -m ncu\"\n },\n \"directories\": {\n \"test\": \"test\"\n },\n \"dependencies\": {\n \"@fluent/syntax\": \"^0.19.0\",\n \"@napi-rs/keyring\": \"^1.2.0\",\n \"@octokit/rest\": \"^22.0.1\",\n \"@rgrove/parse-xml\": \"^4.2.0\",\n \"@types/node\": \"^25.3.0\",\n \"@xmldom/xmldom\": \"^0.9.8\",\n \"ajv\": \"^8.18.0\",\n \"ajv-keywords\": \"^5.1.0\",\n \"archiver\": \"^7.0.1\",\n \"clp\": \"^4.0.13\",\n \"commander\": \"^14.0.3\",\n \"dotenv\": \"^17.3.1\",\n \"ejs\": \"^4.0.1\",\n \"fs-extra\": \"^11.3.3\",\n \"glob\": \"^13.0.6\",\n \"ini\": \"^6.0.0\",\n \"jose\": \"^6.1.3\",\n \"jsesc\": \"^3.1.0\",\n \"lodash\": \"^4.17.23\",\n \"moment\": \"^2.30.1\",\n \"node-forge\": \"^1.3.3\",\n \"node-stream-zip\": \"^1.15.0\",\n \"openpgp\": \"^6.3.0\",\n \"peggy\": \"^5.0.6\",\n \"prompts\": \"^2.4.2\",\n \"pug\": \"^3.0.3\",\n \"rimraf\": \"^6.1.3\",\n \"shell-quote\": \"^1.8.3\",\n \"shelljs\": \"^0.10.0\",\n \"string-to-arraybuffer\": \"^1.0.2\",\n \"ts-node\": \"^10.9.2\",\n \"tslib\": \"^2.8.1\",\n \"typescript\": \"^5.9.3\",\n \"uri-templates\": \"^0.2.0\",\n \"url-template\": \"^3.1.1\",\n \"uzip\": \"^0.20201231.0\",\n \"xml-parser\": \"^1.2.1\",\n \"xpath\": \"^0.0.34\",\n \"zotero-types\": \"^4.1.1\"\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/retorquere/zotero-plugin.git\"\n },\n \"license\": \"ISC\",\n \"files\": [\n \"package.json\",\n \"README.md\",\n \"dist\"\n ],\n \"bin\": {\n \"zp-release\": \"dist/cjs/bin/release.cjs\",\n \"zp-zipup\": \"dist/cjs/bin/zipup.cjs\",\n \"zp-link\": \"dist/cjs/bin/link.cjs\",\n \"issue-branches\": \"dist/cjs/bin/branches.cjs\",\n \"zotero-start\": \"dist/cjs/bin/start.cjs\",\n \"zp-fetch-log\": \"dist/cjs/bin/fetch-log.cjs\",\n \"zp-keypair\": \"dist/cjs/bin/keypair.cjs\",\n \"zp-copy-assets\": \"dist/cjs/copy-assets.cjs\",\n \"zp-make-dirs\": \"dist/cjs/make-dirs.cjs\",\n \"zp-manifest\": \"dist/cjs/make-manifest.cjs\",\n \"zp-version\": \"dist/cjs/version.cjs\"\n },\n \"bugs\": {\n \"url\": \"https://github.com/retorquere/zotero-plugin/issues\"\n },\n \"devDependencies\": {\n \"@openpgp/web-stream-tools\": \"^0.3.0\",\n \"concurrently\": \"^9.2.1\",\n \"dprint\": \"^0.51.1\",\n \"esbuild\": \"^0.27.3\",\n \"tsup\": \"^8.5.1\"\n }\n}\n"],"mappings":";AAAO,IAAM,UAAU;AAChB,IAAM,mBAAmB;AACzB,IAAM,yBAAyB;;;ACGtC,YAAY,UAAU;AACtB,YAAY,UAAU;;;ACNtB,IAAO,kBAAQ;AAAA,EACb,QAAQ;AAAA,EACR,WAAW;AAAA,EACX,eAAe;AAAA,EACf,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,WAAW;AAAA,IACT,KAAK;AAAA,MACH,UAAU;AAAA,MACV,WAAW;AAAA,IACb;AAAA,IACA,eAAe;AAAA,MACb,UAAU;AAAA,MACV,WAAW;AAAA,IACb;AAAA,IACA,YAAY;AAAA,MACV,UAAU;AAAA,MACV,WAAW;AAAA,IACb;AAAA,IACA,gBAAgB;AAAA,MACd,UAAU;AAAA,MACV,WAAW;AAAA,IACb;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AS,MAAS;AAAA,QACtC,OACK;AACH,iBAAO,IAAI,MAAM,oBAAoB,CAAC;AAAA,QACxC;AAAA,MACF,CAAC;AAED,kBAAY,UAAU;AAAA,IACxB,CAAC;AAAA,EACH;AACF;AAWA,SAAS,QAAQ,WAAoB;AACnC,MAAI,CAAC,UAAW,QAAO;AACvB,SAAO,UAAU,cAAc,gBAAI,SAAS,QAAW,EAAE,SAAS,KAAK,CAAC,IAAI;AAC9E;AAEA,IAAI,QAAQ,OAAO,gBAAgB,OAAO,EAAG,QAAO,iBAAiB,IAAI,eAAe;AACjF,IAAM,WAAW,OAAO;","names":[]}
1
+ {"version":3,"sources":["../../crypto.ts","../../debug-log.ts","../../package.json"],"sourcesContent":["export const KEYTYPE = 'RSA'\nexport const KEY_WRAPPING_ALG = 'RSA-OAEP-256'\nexport const CONTENT_ENCRYPTION_ALG = 'A256GCM'\nexport const RSA_HASH = 'SHA-256'\nexport const RSA_ALGORITHM = 'RSA-OAEP'\nexport const CIPHER_ALGORITHM = 'aes256'\nexport const AES_KEY_LENGTH = 256\n// export const AES_KEY_BYTES = 32\n\n// export const AES_ALGORITHM = 'AES-GCM'\n// export const IV_LENGTH = 12\n","/* eslint-disable no-magic-numbers */\n\nComponents.utils.importGlobalProperties(['FormData'])\nimport { CONTENT_ENCRYPTION_ALG, KEY_WRAPPING_ALG, KEYTYPE } from './crypto'\n\nimport * as jose from 'jose'\nimport * as UZip from 'uzip'\nimport pkg from './package.json'\n\nexport class Bundler {\n public key: string\n\n #refs = false\n\n #pk?: JsonWebKey\n #pubKey?: CryptoKey\n\n #files: Record<string, Uint8Array> = {}\n #encoder = new TextEncoder()\n\n constructor(pk?: JsonWebKey) {\n this.key = Zotero.Utilities.generateObjectKey()\n\n if (pk && pk.kty === KEYTYPE) this.#pk = pk\n }\n\n async add(path: string, data: string, refs = false): Promise<void> {\n this.#refs = this.#refs || refs\n\n const encoded = this.#encoder.encode(data)\n\n if (this.#pk) {\n if (!this.#pubKey) this.#pubKey = (await jose.importJWK(this.#pk, KEY_WRAPPING_ALG)) as CryptoKey\n const jwe = await (new jose.CompactEncrypt(encoded))\n .setProtectedHeader({\n alg: KEY_WRAPPING_ALG,\n enc: CONTENT_ENCRYPTION_ALG,\n })\n .encrypt(this.#pubKey)\n\n this.#files[`${this.key}/${path}.jwe`] = this.#encoder.encode(jwe)\n }\n else {\n this.#files[`${this.key}/${path}`] = encoded\n }\n }\n\n public get zip(): ArrayBuffer {\n return UZip.encode(this.#files) as ArrayBuffer\n }\n\n public get name(): string {\n return `${this.key}.zip`\n }\n\n public id(host: string): string {\n return `${this.key}-${host}${this.#refs ? '.refs' : ''}${this.#pubKey ? '.enc' : ''}`\n }\n\n public async send(): Promise<string> {\n const response = await fetch(`https://filebin.net/${this.key}/${this.name}`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/zip',\n },\n body: new Blob([this.zip], { type: 'application/zip' }),\n })\n\n if (response.ok) return this.id('fbin')\n throw new Error(await response.text())\n }\n}\n\ndeclare var Services: any // eslint-disable-line no-var\ndeclare const Components: any\ndeclare const ChromeUtils: any\n\ntype ExportTranslator = {\n setHandler: (phase: string, handler: (obj: { string: string }, success: boolean) => void) => void // eslint-disable-line id-blacklist\n setTranslator: (id: string) => void\n setItems: (items: any[]) => void\n translate: () => void\n}\n\nconst zotero_prefs_root = 'extensions.zotero.'\n\ntype Plugin = {\n plugin: string\n preferences: string[]\n pubKey?: JsonWebKey\n}\n\nclass DebugLogSender {\n version = pkg.version\n #menu: string | false\n #plugins: Plugin[] = []\n\n public debugEnabledAtStart: boolean = typeof Zotero !== 'undefined'\n ? (Zotero.Prefs.get('debug.store') || Zotero.Debug.enabled) as unknown as boolean\n : null\n\n public register(plugin: string, preferences: string[] = [], pubKey?: JsonWebKey): void {\n this.#menu ??= Zotero.MenuManager.registerMenu({\n menuID: 'debug-log-sender',\n pluginID: 'debug-log-sender',\n target: 'main/menubar/help',\n menus: [\n {\n menuType: 'submenu',\n onShowing: (event, context) => {\n context.setVisible(!!this.#plugins.length)\n context.menuElem?.setAttribute('label', 'Send plugin debug log')\n },\n menus: Array.from({ length: 20 }, (v, i) => ({\n menuType: 'menuitem',\n onShowing: (event: Event, context: _ZoteroTypes.MenuManager.MenuContext) => {\n context.setVisible(this.#plugins.length > i)\n context.menuElem?.setAttribute('label', this.#plugins[i]?.plugin || '')\n },\n onCommand: (event: Event, context: _ZoteroTypes.MenuManager.MenuContext) => {\n void this.send(this.#plugins[i])\n },\n })),\n },\n ],\n })\n\n this.#plugins.push({ plugin, preferences, pubKey })\n }\n\n public unregister(plugin: string) {\n this.#plugins = this.#plugins.filter(p => p.plugin !== plugin)\n }\n\n private async send({ plugin, preferences, pubKey }: Plugin): Promise<void> {\n try {\n await Zotero.Schema.schemaUpdatePromise\n\n const bundler = new Bundler(pubKey || undefined)\n\n let log = [\n await this.info(preferences),\n Zotero.getErrors(true).join('\\n\\n'),\n Zotero.Debug.getConsoleViewerOutput().slice(-250000).join('\\n'), // eslint-disable-line no-magic-numbers\n ].filter((txt: string) => txt).join('\\n\\n').trim()\n await bundler.add('debug.txt', log)\n\n let rdf = await this.rdf()\n if (rdf) await bundler.add('items.rdf', rdf, true)\n\n const logid = await bundler.send()\n Services.prompt.alert(null, `Debug log ID for ${plugin}`, logid)\n }\n catch (err) {\n Services.prompt.alert(null, `Could not post debug log for ${plugin}`, err.message)\n }\n }\n\n private preferences(preferences: string[]): Record<string, string | number | boolean> {\n const prefs: Record<string, string | number | boolean> = {}\n\n const names: string[] = []\n for (let pref of preferences) {\n if (pref[0] === ':') {\n pref = pref.substring(1)\n }\n else if (!pref.startsWith(zotero_prefs_root)) {\n pref = zotero_prefs_root + pref\n }\n if (pref.endsWith('.')) {\n const childkeys: string[] = Services.prefs.getBranch(pref).getChildList('', {})\n for (const key of childkeys) {\n names.push(pref + key)\n }\n }\n else {\n names.push(pref)\n }\n }\n\n for (const pref of names.sort()) {\n prefs[pref] = Zotero.Prefs.get(pref, true)\n }\n\n return prefs\n }\n\n // general state of Zotero\n private async info(preferences: string[]): Promise<string> {\n let info = ''\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-assignment\n const appInfo: { name: string; version: string } = Components.classes['@mozilla.org/xre/app-info;1'].getService(Components.interfaces.nsIXULAppInfo)\n info += `Application: ${appInfo.name} ${appInfo.version} ${Zotero.locale}\\n`\n\n const platform = ['Win', 'Mac', 'Linux'].find(p => Zotero[`is${p}`]) || 'Unknown'\n info += `Platform: ${platform}\\n`\n\n const addons: string[] = await Zotero.getInstalledExtensions()\n if (addons.length) {\n info += 'Addons:\\n' + addons.map((addon: string) => ` ${addon}\\n`).join('') // eslint-disable-line prefer-template\n }\n info += `Debug logging on at Zotero start: ${this.debugEnabledAtStart}\\n`\n info += `Debug logging on at log submit: ${Zotero.Prefs.get('debug.store') || Zotero.Debug.enabled}\\n`\n\n for (const [pref, value] of Object.entries(this.preferences(preferences))) {\n info += `${pref} = ${JSON.stringify(value)}\\n`\n }\n\n return info\n }\n\n private rdf(): Promise<string> {\n return new Promise((resolve, reject) => {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-assignment\n const items: any[] = Zotero.getActiveZoteroPane().getSelectedItems()\n if (items.length === 0) return resolve('')\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call\n const translation: ExportTranslator = new Zotero.Translate.Export() as ExportTranslator\n translation.setItems(items)\n translation.setTranslator('14763d24-8ba0-45df-8f52-b8d1108e7ac9') // rdf\n\n translation.setHandler('done', (obj, success) => {\n if (success) {\n resolve(obj ? obj.string : undefined)\n }\n else {\n reject(new Error('translation failed'))\n }\n })\n\n translation.translate() // eslint-disable-line @typescript-eslint/no-unsafe-call\n })\n }\n}\n\ndeclare global {\n interface Zotero {\n DebugLogSender?: DebugLogSender\n }\n namespace Zotero {\n var DebugLogSender: DebugLogSender | undefined\n }\n}\n\nfunction upgrade(installed?: string) {\n if (!installed) return true\n return installed.localeCompare(pkg.version, undefined, { numeric: true }) < 0\n}\n\nif (upgrade(Zotero.DebugLogSender?.version)) Zotero.DebugLogSender = new DebugLogSender()\nexport const DebugLog = Zotero.DebugLogSender\n","export default {\n \"name\": \"zotero-plugin\",\n \"version\": \"8.0.14\",\n \"description\": \"Zotero plugin builder\",\n \"homepage\": \"https://github.com/retorquere/zotero-plugin/wiki\",\n \"type\": \"module\",\n \"main\": \"./dist/cjs/index.js\",\n \"module\": \"./dist/esm/index.js\",\n \"exports\": {\n \".\": {\n \"import\": \"./dist/esm/index.js\",\n \"require\": \"./dist/cjs/index.cjs\"\n },\n \"./debug-log\": {\n \"import\": \"./dist/esm/debug-log.js\",\n \"require\": \"./dist/cjs/debug-log.cjs\"\n },\n \"./logger\": {\n \"import\": \"./dist/esm/logger.js\",\n \"require\": \"./dist/cjs/logger.cjs\"\n },\n \".loader/json\": {\n \"import\": \"./dist/esm/loader/json.js\",\n \"require\": \"./dist/cjs/loader/json.cjs\"\n },\n \".loader/peggy\": {\n \"import\": \"./dist/esm/loader/peggy.js\",\n \"require\": \"./dist/cjs/loader/peggy.cjs\"\n },\n \".loader/pem\": {\n \"import\": \"./dist/esm/loader/pem.js\",\n \"require\": \"./dist/cjs/loader/pem.cjs\"\n },\n \"./copy-assets\": {\n \"import\": \"./dist/esm/bin/copy-assets.js\",\n \"require\": \"./dist/cjs/bin/copy-assets.cjs\"\n },\n \"./make-dirs\": {\n \"import\": \"./dist/esm/bin/make-dirs.js\",\n \"require\": \"./dist/cjs/bin/make-dirs.cjs\"\n },\n \"./make-manifest\": {\n \"import\": \"./dist/esm/bin/make-manifest.js\",\n \"require\": \"./dist/cjs/bin/make-manifest.cjs\"\n },\n \"./make-version\": {\n \"import\": \"./dist/esm/bin/version.js\",\n \"require\": \"./dist/cjs/bin/version.cjs\"\n }\n },\n \"author\": {\n \"name\": \"Emiliano Heyns\",\n \"email\": \"Emiliano.Heyns@iris-advies.com\"\n },\n \"scripts\": {\n \"preversion\": \"npm test\",\n \"postversion\": \"git push --follow-tags\",\n \"test\": \"dprint fmt *.ts */*.ts && dprint check *.ts */*.ts && npm run build\",\n \"prebuild\": \"rm -rf dist\",\n \"build\": \"tsup\",\n \"check\": \"tsc --noEmit\",\n \"start\": \"concurrently --raw --group 'npm run check' 'npm run build'\",\n \"pack\": \"npm test && npm pack\",\n \"prepublishOnly\": \"npm install && npm run build\",\n \"ncu\": \"ncu -u && npm i && git add package.json package-lock.json && git commit -m ncu\"\n },\n \"directories\": {\n \"test\": \"test\"\n },\n \"dependencies\": {\n \"@fluent/syntax\": \"^0.19.0\",\n \"@napi-rs/keyring\": \"^1.2.0\",\n \"@octokit/rest\": \"^22.0.1\",\n \"@rgrove/parse-xml\": \"^4.2.0\",\n \"@types/node\": \"^25.3.0\",\n \"@xmldom/xmldom\": \"^0.9.8\",\n \"ajv\": \"^8.18.0\",\n \"ajv-keywords\": \"^5.1.0\",\n \"archiver\": \"^7.0.1\",\n \"clp\": \"^4.0.13\",\n \"commander\": \"^14.0.3\",\n \"dotenv\": \"^17.3.1\",\n \"ejs\": \"^4.0.1\",\n \"fs-extra\": \"^11.3.3\",\n \"glob\": \"^13.0.6\",\n \"ini\": \"^6.0.0\",\n \"jose\": \"^6.1.3\",\n \"jsesc\": \"^3.1.0\",\n \"lodash\": \"^4.17.23\",\n \"moment\": \"^2.30.1\",\n \"node-forge\": \"^1.3.3\",\n \"node-stream-zip\": \"^1.15.0\",\n \"openpgp\": \"^6.3.0\",\n \"peggy\": \"^5.0.6\",\n \"prompts\": \"^2.4.2\",\n \"pug\": \"^3.0.3\",\n \"rimraf\": \"^6.1.3\",\n \"shell-quote\": \"^1.8.3\",\n \"shelljs\": \"^0.10.0\",\n \"string-to-arraybuffer\": \"^1.0.2\",\n \"ts-node\": \"^10.9.2\",\n \"tslib\": \"^2.8.1\",\n \"typescript\": \"^5.9.3\",\n \"uri-templates\": \"^0.2.0\",\n \"url-template\": \"^3.1.1\",\n \"uzip\": \"^0.20201231.0\",\n \"xml-parser\": \"^1.2.1\",\n \"xpath\": \"^0.0.34\",\n \"zotero-types\": \"^4.1.1\"\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/retorquere/zotero-plugin.git\"\n },\n \"license\": \"ISC\",\n \"files\": [\n \"package.json\",\n \"README.md\",\n \"dist\"\n ],\n \"bin\": {\n \"zp-release\": \"dist/cjs/bin/release.cjs\",\n \"zp-zipup\": \"dist/cjs/bin/zipup.cjs\",\n \"zp-link\": \"dist/cjs/bin/link.cjs\",\n \"issue-branches\": \"dist/cjs/bin/branches.cjs\",\n \"zotero-start\": \"dist/cjs/bin/start.cjs\",\n \"zp-fetch-log\": \"dist/cjs/bin/fetch-log.cjs\",\n \"zp-keypair\": \"dist/cjs/bin/keypair.cjs\",\n \"zp-copy-assets\": \"dist/cjs/copy-assets.cjs\",\n \"zp-make-dirs\": \"dist/cjs/make-dirs.cjs\",\n \"zp-manifest\": \"dist/cjs/make-manifest.cjs\",\n \"zp-version\": \"dist/cjs/version.cjs\"\n },\n \"bugs\": {\n \"url\": \"https://github.com/retorquere/zotero-plugin/issues\"\n },\n \"devDependencies\": {\n \"@openpgp/web-stream-tools\": \"^0.3.0\",\n \"concurrently\": \"^9.2.1\",\n \"dprint\": \"^0.51.1\",\n \"esbuild\": \"^0.27.3\",\n \"tsup\": \"^8.5.1\"\n }\n}\n"],"mappings":";AAAO,IAAM,UAAU;AAChB,IAAM,mBAAmB;AACzB,IAAM,yBAAyB;;;ACGtC,YAAY,UAAU;AACtB,YAAY,UAAU;;;ACNtB,IAAO,kBAAQ;AAAA,EACb,QAAQ;AAAA,EACR,WAAW;AAAA,EACX,eAAe;AAAA,EACf,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,WAAW;AAAA,IACT,KAAK;AAAA,MACH,UAAU;AAAA,MACV,WAAW;AAAA,IACb;AAA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CAAC;AAAA,EACH;AACF;AAWA,SAAS,QAAQ,WAAoB;AACnC,MAAI,CAAC,UAAW,QAAO;AACvB,SAAO,UAAU,cAAc,gBAAI,SAAS,QAAW,EAAE,SAAS,KAAK,CAAC,IAAI;AAC9E;AAEA,IAAI,QAAQ,OAAO,gBAAgB,OAAO,EAAG,QAAO,iBAAiB,IAAI,eAAe;AACjF,IAAM,WAAW,OAAO;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zotero-plugin",
3
- "version": "8.0.12",
3
+ "version": "8.0.14",
4
4
  "description": "Zotero plugin builder",
5
5
  "homepage": "https://github.com/retorquere/zotero-plugin/wiki",
6
6
  "type": "module",