diff --git a/.eslintrc.json b/.eslintrc.json index 40ac80b..752b01f 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -6,288 +6,302 @@ "node": true }, "extends": [ - "eslint:recommended", - "plugin:@typescript-eslint/recommended", - "plugin:@typescript-eslint/eslint-recommended", - "plugin:@typescript-eslint/recommended-requiring-type-checking" + // "airbnb-base", + // "airbnb-typescript/base" + "eslint:recommended" + // "plugin:@typescript-eslint/recommended", + // "plugin:@typescript-eslint/eslint-recommended", + // "plugin:@typescript-eslint/recommended-requiring-type-checking" ], "parser": "@typescript-eslint/parser", - "parserOptions": { - "project": "tsconfig.json", - "sourceType": "module" - }, "plugins": [ "eslint-plugin-import", - "eslint-plugin-prefer-arrow", - "@typescript-eslint", - "@typescript-eslint/eslint-plugin" + "eslint-plugin-prefer-arrow" + // "@typescript-eslint", + // "@typescript-eslint/eslint-plugin" ], - "rules": { - "@typescript-eslint/adjacent-overload-signatures": "error", - "@typescript-eslint/array-type": [ - "error", - { - "default": "array" - } - ], - "@typescript-eslint/await-thenable": "error", - "@typescript-eslint/ban-ts-comment": "warn", - "@typescript-eslint/ban-types": [ - "warn", - { - "types": { - "Object": { - "message": "Avoid using the `Object` type. Did you mean `object`?" - }, - "Function": { - "message": "Avoid using the `Function` type. Prefer a specific function type, like `() => void`." - }, - "Boolean": { - "message": "Avoid using the `Boolean` type. Did you mean `boolean`?" - }, - "Number": { - "message": "Avoid using the `Number` type. Did you mean `number`?" - }, - "String": { - "message": "Avoid using the `String` type. Did you mean `string`?" - }, - "Symbol": { - "message": "Avoid using the `Symbol` type. Did you mean `symbol`?" + "overrides": [ + { + "files": ["*.ts", "*.tsx"], + "extends": [ + "plugin:@typescript-eslint/recommended", + "plugin:@typescript-eslint/eslint-recommended", + "plugin:@typescript-eslint/recommended-requiring-type-checking" + ], + "plugins": ["@typescript-eslint", "@typescript-eslint/eslint-plugin"], + "parserOptions": { + "project": "tsconfig.json", + "sourceType": "module" + }, + "rules": { + "@typescript-eslint/no-explicit-any": "off", + "@typescript-eslint/no-unsafe-argument": "off", + "@typescript-eslint/no-unsafe-assignment": "off", + "@typescript-eslint/no-unsafe-call": "off", + "@typescript-eslint/no-unsafe-member-access": "off", + "@typescript-eslint/no-unsafe-return": "off", + "@typescript-eslint/no-unused-expressions": "off", + "@typescript-eslint/no-unused-vars": [ + "off", + { + "argsIgnorePattern": "^_" } - } - } - ], - "@typescript-eslint/consistent-type-assertions": "error", - "@typescript-eslint/dot-notation": "error", - "@typescript-eslint/explicit-module-boundary-types": "warn", - "@typescript-eslint/indent": [ - "error", - 2 - ], - "@typescript-eslint/member-delimiter-style": [ - "error", - { - "multiline": { - "delimiter": "none", - "requireLast": false - }, - "singleline": { - "delimiter": "comma", - "requireLast": false - } - } - ], - "@typescript-eslint/member-ordering": "off", - "@typescript-eslint/naming-convention": "off", - "@typescript-eslint/no-array-constructor": "error", - "@typescript-eslint/no-empty-function": "error", - "@typescript-eslint/no-empty-interface": "error", - "@typescript-eslint/no-explicit-any": "off", - "@typescript-eslint/no-extra-non-null-assertion": "error", - "@typescript-eslint/no-extra-semi": "error", - "@typescript-eslint/no-floating-promises": "error", - "@typescript-eslint/no-for-in-array": "error", - "@typescript-eslint/no-implied-eval": "off", - "@typescript-eslint/no-inferrable-types": "error", - "@typescript-eslint/no-misused-new": "error", - "@typescript-eslint/no-misused-promises": "error", - "@typescript-eslint/no-namespace": "error", - "@typescript-eslint/no-non-null-asserted-optional-chain": "error", - "@typescript-eslint/no-non-null-assertion": "warn", - "@typescript-eslint/no-parameter-properties": "off", - "@typescript-eslint/no-shadow": [ - "error", - { - "hoist": "all" - } - ], - "@typescript-eslint/no-this-alias": "error", - "@typescript-eslint/no-unnecessary-type-assertion": "error", - "@typescript-eslint/no-unsafe-assignment": "off", - "@typescript-eslint/no-unsafe-call": "off", - "@typescript-eslint/no-unsafe-member-access": "off", - "@typescript-eslint/no-unsafe-return": "error", - "@typescript-eslint/no-unused-expressions": "error", - "@typescript-eslint/no-unused-vars": [ - "error", - { - "argsIgnorePattern": "^_" - } - ], - "@typescript-eslint/no-use-before-define": "off", - "@typescript-eslint/no-var-requires": "off", - "@typescript-eslint/prefer-as-const": "error", - "@typescript-eslint/prefer-for-of": "error", - "@typescript-eslint/prefer-function-type": "error", - "@typescript-eslint/prefer-namespace-keyword": "error", - "@typescript-eslint/prefer-regexp-exec": "off", - "@typescript-eslint/quotes": [ - "error", - "single", - { - "avoidEscape": true - } - ], - "@typescript-eslint/require-await": "error", - "@typescript-eslint/restrict-plus-operands": "error", - "@typescript-eslint/restrict-template-expressions": "off", - "@typescript-eslint/semi": [ - "error", - "never" - ], - "@typescript-eslint/triple-slash-reference": [ - "error", - { - "path": "always", - "types": "prefer-import", - "lib": "always" - } - ], - "@typescript-eslint/unbound-method": "error", - "@typescript-eslint/unified-signatures": "error", - "arrow-body-style": "error", - "arrow-parens": [ - "error", - "as-needed" - ], - "brace-style": [ - "error", - "stroustrup", - { - "allowSingleLine": true - } - ], - "comma-dangle": [ - "error", - { - "objects": "always-multiline", - "arrays": "always-multiline", - "functions": "never" + ], + "@typescript-eslint/require-await": "off", + "@typescript-eslint/restrict-template-expressions": "warn", + "@typescript-eslint/unbound-method": "warn" } - ], - "complexity": "off", - "constructor-super": "error", - "curly": [ - "error", - "multi-line" - ], - "eol-last": "error", - "eqeqeq": [ - "error", - "smart" - ], - "guard-for-in": "error", - "id-blacklist": [ - "error", - "any", - "Number", - "number", - "String", - "string", - "Boolean", - "boolean", - "Undefined", - "undefined" - ], - "id-match": "error", - "import/order": "off", - "linebreak-style": [ - "error", - "unix" - ], - "max-classes-per-file": "off", - "max-len": [ - "warn", - { - "code": 240 - } - ], - "new-parens": "off", - "no-array-constructor": "off", - "no-bitwise": "error", - "no-caller": "error", - "no-cond-assign": "off", - "no-console": "error", - "no-debugger": "error", - "no-empty": [ - "error", - { - "allowEmptyCatch": true - } - ], - "no-empty-function": "off", - "no-eval": "error", - "no-extra-semi": "off", - "no-fallthrough": "off", - "no-implied-eval": "off", - "no-invalid-this": "off", - "no-irregular-whitespace": "error", - "no-magic-numbers": "off", - "@typescript-eslint/no-magic-numbers": "off", - "no-new-wrappers": "error", - "no-redeclare": "error", - "no-throw-literal": "error", - "no-trailing-spaces": "error", - "no-undef-init": "error", - "no-underscore-dangle": [ - "error", - { - "allowAfterThis": true - } - ], - "no-unsafe-finally": "error", - "no-unused-labels": "error", - "no-unused-vars": "off", - "no-var": "error", - "object-shorthand": "error", - "one-var": [ - "off", - "never" - ], - "prefer-arrow/prefer-arrow-functions": [ - "error", - { - "allowStandaloneDeclarations": true - } - ], - "prefer-const": [ - "error", - { - "destructuring": "all" - } - ], - "prefer-object-spread": "error", - "prefer-template": "error", - "quote-props": [ - "error", - "as-needed" - ], - "radix": "off", - "require-await": "off", - "space-before-function-paren": [ - "error", - { - "anonymous": "never", - "named": "never", - "asyncArrow": "always" - } - ], - "spaced-comment": [ - "error", - "always", - { - "markers": [ - "/" - ] - } - ], - "use-isnan": "error", - "valid-typeof": "off", - "yoda": "error", - "@typescript-eslint/consistent-type-definitions": "off", - "no-new-func": "off" + }, + { + "files": ["*.js", "*.jsx"], + "rules": {} + } + ], + "rules": { + // "@typescript-eslint/adjacent-overload-signatures": "error", + // "@typescript-eslint/array-type": [ + // "error", + // { + // "default": "array" + // } + // ], + // "@typescript-eslint/await-thenable": "error", + // "@typescript-eslint/ban-ts-comment": "warn", + // "@typescript-eslint/ban-types": [ + // "warn", + // { + // "types": { + // "Object": { + // "message": "Avoid using the `Object` type. Did you mean `object`?" + // }, + // "Function": { + // "message": "Avoid using the `Function` type. Prefer a specific function type, like `() => void`." + // }, + // "Boolean": { + // "message": "Avoid using the `Boolean` type. Did you mean `boolean`?" + // }, + // "Number": { + // "message": "Avoid using the `Number` type. Did you mean `number`?" + // }, + // "String": { + // "message": "Avoid using the `String` type. Did you mean `string`?" + // }, + // "Symbol": { + // "message": "Avoid using the `Symbol` type. Did you mean `symbol`?" + // } + // } + // } + // ], + // "@typescript-eslint/consistent-type-assertions": "error", + // "@typescript-eslint/dot-notation": "error", + // "@typescript-eslint/explicit-module-boundary-types": "warn", + // "@typescript-eslint/indent": ["warn", 2], + // "@typescript-eslint/member-delimiter-style": [ + // "error", + // { + // "multiline": { + // "delimiter": "none", + // "requireLast": false + // }, + // "singleline": { + // "delimiter": "comma", + // "requireLast": false + // } + // } + // ], + // "@typescript-eslint/member-ordering": "off", + // "@typescript-eslint/naming-convention": "off", + // "@typescript-eslint/no-array-constructor": "error", + // "@typescript-eslint/no-empty-function": "error", + // "@typescript-eslint/no-empty-interface": "error", + // "@typescript-eslint/no-explicit-any": "warn", + // "@typescript-eslint/no-extra-non-null-assertion": "error", + // "@typescript-eslint/no-extra-semi": "error", + // "@typescript-eslint/no-floating-promises": "error", + // "@typescript-eslint/no-for-in-array": "error", + // "@typescript-eslint/no-implied-eval": "off", + // "@typescript-eslint/no-inferrable-types": "error", + // "@typescript-eslint/no-misused-new": "error", + // "@typescript-eslint/no-misused-promises": "error", + // "@typescript-eslint/no-namespace": "error", + // "@typescript-eslint/no-non-null-asserted-optional-chain": "error", + // "@typescript-eslint/no-non-null-assertion": "warn", + // "@typescript-eslint/no-parameter-properties": "off", + // "@typescript-eslint/no-shadow": [ + // "error", + // { + // "hoist": "all" + // } + // ], + // "@typescript-eslint/no-this-alias": "error", + // "@typescript-eslint/no-unsafe-argument": "warn", + // "@typescript-eslint/no-unnecessary-type-assertion": "error", + // "@typescript-eslint/no-unsafe-assignment": "warn", + // "@typescript-eslint/no-unsafe-call": "warn", + // "@typescript-eslint/no-unsafe-member-access": "warn", + // "@typescript-eslint/no-unsafe-return": "warn", + // "@typescript-eslint/no-unused-expressions": "warn", + // "@typescript-eslint/no-unused-vars": [ + // "warn", + // { + // "argsIgnorePattern": "^_" + // } + // ], + // "@typescript-eslint/no-use-before-define": "off", + // "@typescript-eslint/no-var-requires": "off", + // "@typescript-eslint/prefer-as-const": "error", + // "@typescript-eslint/prefer-for-of": "error", + // "@typescript-eslint/prefer-function-type": "error", + // "@typescript-eslint/prefer-namespace-keyword": "error", + // "@typescript-eslint/prefer-regexp-exec": "off", + // "@typescript-eslint/quotes": [ + // "warn", + // "double", + // { + // "avoidEscape": true + // } + // ], + // "@typescript-eslint/require-await": "warn", + // "@typescript-eslint/restrict-plus-operands": "error", + // "@typescript-eslint/restrict-template-expressions": "warn", + // "@typescript-eslint/semi": ["error", "always"], + // "@typescript-eslint/triple-slash-reference": [ + // "error", + // { + // "path": "always", + // "types": "prefer-import", + // "lib": "always" + // } + // ], + // "@typescript-eslint/unbound-method": "warn", + // "@typescript-eslint/unified-signatures": "error", + // "arrow-body-style": "error", + // "arrow-parens": ["error", "as-needed"], + // "brace-style": [ + // "warn", + // "stroustrup", + // { + // "allowSingleLine": true + // } + // ], + // "comma-dangle": [ + // "error", + // { + // "objects": "always-multiline", + // "arrays": "always-multiline", + // "functions": "never" + // } + // ], + // "complexity": "off", + // "constructor-super": "error", + // "curly": ["error", "multi-line"], + // "eol-last": "error", + // "eqeqeq": ["error", "smart"], + // "guard-for-in": "error", + // "id-blacklist": [ + // "error", + // "any", + // "Number", + // "number", + // "String", + // "string", + // "Boolean", + // "boolean", + // "Undefined", + // "undefined" + // ], + // "id-match": "error", + // "import/order": "off", + // "linebreak-style": ["error", "unix"], + // "max-classes-per-file": "off", + // "max-len": [ + // "warn", + // { + // "code": 240 + // } + // ], + // "new-parens": "off", + // "no-array-constructor": "off", + // "no-bitwise": "error", + // "no-caller": "error", + // "no-cond-assign": "off", + // "no-console": "error", + // "no-debugger": "error", + // "no-empty": [ + // "error", + // { + // "allowEmptyCatch": true + // } + // ], + // "no-empty-function": "off", + // "no-eval": "error", + // "no-extra-semi": "off", + // "no-fallthrough": "off", + // "no-implied-eval": "off", + // "no-invalid-this": "off", + // "no-irregular-whitespace": "error", + // "no-magic-numbers": "off", + // "@typescript-eslint/no-magic-numbers": "off", + // "no-new-wrappers": "error", + // "no-redeclare": "error", + // "no-throw-literal": "error", + // "no-trailing-spaces": "error", + "no-undef": "warn", + // "no-undef-init": "error", + // "no-underscore-dangle": [ + // "error", + // { + // "allowAfterThis": true + // } + // ], + // "no-unsafe-finally": "error", + // "no-unused-labels": "error", + // "no-unused-vars": "off", + "no-useless-escape": "warn" + // "no-var": "error", + // "object-shorthand": "error", + // "one-var": ["off", "never"], + // "prefer-arrow/prefer-arrow-functions": [ + // "error", + // { + // "allowStandaloneDeclarations": true + // } + // ], + // "prefer-const": [ + // "error", + // { + // "destructuring": "all" + // } + // ], + // "prefer-object-spread": "error", + // "prefer-template": "error", + // "quote-props": ["error", "as-needed"], + // "radix": "off", + // "require-await": "off", + // "space-before-function-paren": [ + // "error", + // { + // "anonymous": "never", + // "named": "never", + // "asyncArrow": "always" + // } + // ], + // "spaced-comment": [ + // "error", + // "always", + // { + // "markers": ["/"] + // } + // ], + // "use-isnan": "error", + // "valid-typeof": "off", + // "yoda": "error", + // "@typescript-eslint/consistent-type-definitions": "off", + // "no-new-func": "off" }, "ignorePatterns": [ + "eslintrc.json", + "esbuild.js", "webpack.config.ts", "util/*.ts", "minitests/*.ts", diff --git a/.gitignore b/.gitignore index 7347baa..5f9f475 100644 --- a/.gitignore +++ b/.gitignore @@ -162,7 +162,136 @@ cython_debug/ /data # javascript -node_modules -.cache* gen xpi + +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* +.pnpm-debug.log* + +# Diagnostic reports (https://nodejs.org/api/report.html) +report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage +*.lcov + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# Snowpack dependency directory (https://snowpack.dev/) +web_modules/ + +# TypeScript cache +*.tsbuildinfo + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Optional stylelint cache +.stylelintcache + +# Microbundle cache +.rpt2_cache/ +.rts2_cache_cjs/ +.rts2_cache_es/ +.rts2_cache_umd/ + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variable files +.env +.env.development.local +.env.test.local +.env.production.local +.env.local + +# parcel-bundler cache (https://parceljs.org/) +.cache +.parcel-cache + +# Next.js build output +.next +out + +# Nuxt.js build / generate output +.nuxt +dist + +# Gatsby files +.cache/ +# Comment in the public line in if your project uses Gatsby and not Next.js +# https://nextjs.org/blog/next-9-1#public-directory-support +# public + +# vuepress build output +.vuepress/dist + +# vuepress v2.x temp and cache directory +.temp +.cache + +# Docusaurus cache and generated files +.docusaurus + +# Serverless directories +.serverless/ + +# FuseBox cache +.fusebox/ + +# DynamoDB Local files +.dynamodb/ + +# TernJS port file +.tern-port + +# Stores VSCode versions used for testing VSCode extensions +.vscode-test + +# yarn v2 +.yarn/cache +.yarn/unplugged +.yarn/build-state.yml +.yarn/install-state.gz +.pnp.* diff --git a/TODO.md b/TODO.md index 3be4c59..ad0b82c 100644 --- a/TODO.md +++ b/TODO.md @@ -1,19 +1,27 @@ # DB Schema - graph - - source - - type - - target - - data_source - - id + - id INTEGER PRIMARY KEY AUTOINCREMENT + - source TEXT + - type TEXT + - target TEXT + - data_source TEXT + - items - - itemID - - updated_datetime + - itemID INTEGER PRIMARY KEY + - updated_datetime DATETIME + - authors - - creatorID - - ORCID - - name -- author-item link table + - creatorID INTEGER PRIMARY KEY + - ORCID TEXT + - name TEXT + +- author_item_link + - creatorID INTEGER + - itemID INTEGER + - FOREIGN KEY(creatorID) REFERENCES authors(creatorID) + - FOREIGN KEY(itemID) REFERENCES items(itemID) + - PRIMARY KEY (creatorID, itemID) # TODOs diff --git a/docs/plugin/dev.md b/docs/plugin/dev.md index 43faa61..948a97e 100644 --- a/docs/plugin/dev.md +++ b/docs/plugin/dev.md @@ -2,12 +2,21 @@ Following: https://www.zotero.org/support/dev/client_coding/plugin_development -- set the location of the plugin in the `reference-network@example.com` file to `{repo}/build/` +- set the location of the plugin in the `weaver@example.com` file to `{repo}/build/` - (do the rest of the stuff in the above guide) - watch and rebuild the plugin with `npm run start` - you have to restart zotero between each change i think +To run zotero with the plugin in debug mode, run the following command: + +```sh +./zotero -purgecaches -zoteroDebugText +``` Weird things: -- the build step was generating the extension id as `reference-network@gmail.com` because [`zotero-plugin/rdf` just does that for some reason](https://github.com/retorquere/zotero-plugin/blob/ab40ae4ba59d2b6a3fcce3222d415d9b5d72b14b/rdf.ts#L16) +- the build step was generating the extension id as `weaver@gmail.com` because [`zotero-plugin/rdf` just does that for some reason](https://github.com/retorquere/zotero-plugin/blob/ab40ae4ba59d2b6a3fcce3222d415d9b5d72b14b/rdf.ts#L16) so the extension ID has to be updated in both the `package.json` file as well as the actual `manifest.json` file + + +Official API Documentation: +https://www.zotero.org/support/dev/client_coding/javascript_api \ No newline at end of file diff --git a/esbuild.js b/esbuild.js index 3a8f39e..da87e9d 100644 --- a/esbuild.js +++ b/esbuild.js @@ -1,77 +1,144 @@ -const path = require('path') -const fs = require('fs') -const esbuild = require('esbuild') -const rmrf = require('rimraf') -rmrf.sync('gen') - -require('zotero-plugin/copy-assets') -require('zotero-plugin/rdf') -require('zotero-plugin/version') - -function js(src) { - return src.replace(/[.]ts$/, '.js') +const path = require("path"); +const fs = require("fs"); +const esbuild = require("esbuild"); +const rmrf = require("rimraf"); + +// Clear the 'gen' directory synchronously +rmrf.sync("gen"); + +// Load Zotero plugin tasks +require("zotero-plugin/copy-assets"); +require("zotero-plugin/rdf"); +require("zotero-plugin/version"); + +// Helper function to replace TypeScript file extension with JavaScript +function replaceExtToJs(src) { + return src.replace(/[.]ts$/, ".js"); +} + +async function copyFile(source, destination) { + await fs.promises.mkdir(path.dirname(destination), { recursive: true }); + await fs.promises.copyFile(source, destination); +} + +async function copyDirectory(source, destination) { + // Ensure the destination directory exists + await fs.promises.mkdir(destination, { recursive: true }); + + // Read all items in the source directory + const items = await fs.promises.readdir(source, { withFileTypes: true }); + + // Iterate through each item in the source directory + for (const item of items) { + const sourcePath = path.join(source, item.name); + const destinationPath = path.join(destination, item.name); + + if (item.isDirectory()) { + // If it's a directory, recursively copy it + await copyDirectory(sourcePath, destinationPath); + } else { + // If it's a file, copy the file + await copyFile(sourcePath, destinationPath); + } + } } +// Bundles the files with the provided configuration async function bundle(config) { + // Default configuration enhanced with custom settings config = { bundle: true, - format: 'iife', - target: ['firefox60'], + format: "iife", + target: ["firefox60"], inject: [], treeShaking: true, keepNames: true, ...config, - } + }; - let target - if (config.outfile) { - target = config.outfile + let target = determineTarget(config); + + const exportGlobals = config.exportGlobals; + delete config.exportGlobals; + + if (exportGlobals) { + await handleExportGlobals(config); } - else if (config.entryPoints.length === 1 && config.outdir) { - target = path.join(config.outdir, js(path.basename(config.entryPoints[0]))) + + console.log("* bundling", target); + await esbuild.build(config); + + if (exportGlobals) { + await rewriteGlobals(target, config); } - else { - target = `${config.outdir} [${config.entryPoints.map(js).join(', ')}]` +} + +// Determine the target file or directory for output +function determineTarget(config) { + if (config.outfile) { + return config.outfile; + } else if (config.entryPoints.length === 1 && config.outdir) { + return path.join( + config.outdir, + replaceExtToJs(path.basename(config.entryPoints[0])) + ); + } else { + return `${config.outdir} [${config.entryPoints + .map(replaceExtToJs) + .join(", ")}]`; } +} - const exportGlobals = config.exportGlobals - delete config.exportGlobals - if (exportGlobals) { - const esm = await esbuild.build({ ...config, logLevel: 'silent', format: 'esm', metafile: true, write: false }) - if (Object.values(esm.metafile.outputs).length !== 1) throw new Error('exportGlobals not supported for multiple outputs') - for (const output of Object.values(esm.metafile.outputs)) { - if (output.entryPoint) { - config.globalName = escape(`{ ${output.exports.sort().join(', ')} }`).replace(/%/g, '$') - // make these var, not const, so they get hoisted and are available in the global scope. - } +// Handle export of globals when required +async function handleExportGlobals(config) { + const esm = await esbuild.build({ + ...config, + logLevel: "silent", + format: "esm", + metafile: true, + write: false, + }); + if (Object.values(esm.metafile.outputs).length !== 1) { + throw new Error("exportGlobals not supported for multiple outputs"); + } + for (const output of Object.values(esm.metafile.outputs)) { + if (output.entryPoint) { + config.globalName = escape( + `{ ${output.exports.sort().join(", ")} }` + ).replace(/%/g, "$"); } } +} - console.log('* bundling', target) - await esbuild.build(config) - if (exportGlobals) { - await fs.promises.writeFile( - target, - (await fs.promises.readFile(target, 'utf-8')).replace(config.globalName, unescape(config.globalName.replace(/[$]/g, '%'))) - ) - } +// Rewrite global variable names in the output files +async function rewriteGlobals(target, config) { + const originalContent = await fs.promises.readFile(target, "utf-8"); + const modifiedContent = originalContent.replace( + config.globalName, + unescape(config.globalName.replace(/[$]/g, "%")) + ); + await fs.promises.writeFile(target, modifiedContent); } +// Main build function async function build() { await bundle({ exportGlobals: true, - entryPoints: [ 'src/reference_network/bootstrap.ts' ], - outdir: 'build', - banner: { js: 'var Zotero;\n' }, - }) + entryPoints: ["src/bootstrap.ts"], + outdir: "build", + }); await bundle({ - entryPoints: [ 'src/reference_network/lib.ts' ], - outdir: 'build', - }) + entryPoints: ["src/weaver.ts", "src/prefs/prefs.ts"], + outdir: "build", + }); + + await copyFile("src/prefs/prefs.xhtml", "build/prefs/prefs.xhtml"); + await copyDirectory("src/locale/", "build/locale/"); } -build().catch(err => { - console.log(err) - process.exit(1) -}) +// Run build and handle any errors +build().catch((err) => { + console.log(err); + process.exit(1); +}); diff --git a/package-lock.json b/package-lock.json index 55f10d5..24a709c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,15 +1,14 @@ { - "name": "reference-network", + "name": "weaver", "version": "0.0.1", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "reference-network", + "name": "weaver", "version": "0.0.1", "dependencies": { - "@typescript-eslint/eslint-plugin": "^5.59.9", - "@typescript-eslint/parser": "^5.59.9", + "dexie": "^4.0.7", "esbuild": "^0.18.1", "eslint": "^8.42.0", "eslint-plugin-import": "^2.27.5", @@ -17,11 +16,22 @@ "eslint-plugin-prefer-arrow": "^1.2.3", "mkdirp": "^3.0.1", "npm-run-all": "^4.1.5", + "reflect-metadata": "^0.2.2", "rimraf": "^5.0.1", + "sqlite": "^5.1.1", + "sqlite3": "^5.1.7", "ts-node": "^10.9.1", + "tslib": "^2.6.2", + "typeorm": "^0.3.20", "typescript": "^5.1.3", "zotero-plugin": "^1.4.22", "zotero-types": "^1.0.15" + }, + "devDependencies": { + "@types/node": "^20.12.7", + "@typescript-eslint/eslint-plugin": "^7.10.0", + "@typescript-eslint/parser": "^7.10.0", + "eslint-config-airbnb-typescript": "^18.0.0" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -478,6 +488,12 @@ "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, + "node_modules/@gar/promisify": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@gar/promisify/-/promisify-1.1.3.tgz", + "integrity": "sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw==", + "optional": true + }, "node_modules/@humanwhocodes/config-array": { "version": "0.11.14", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz", @@ -658,6 +674,77 @@ "node": ">= 8" } }, + "node_modules/@npmcli/fs": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@npmcli/fs/-/fs-1.1.1.tgz", + "integrity": "sha512-8KG5RD0GVP4ydEzRn/I4BNDuxDtqVbOdm8675T49OIG/NGhaK0pjPX7ZcDlvKYbA+ulvVK3ztfcF4uBdOxuJbQ==", + "optional": true, + "dependencies": { + "@gar/promisify": "^1.0.1", + "semver": "^7.3.5" + } + }, + "node_modules/@npmcli/move-file": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@npmcli/move-file/-/move-file-1.1.2.tgz", + "integrity": "sha512-1SUf/Cg2GzGDyaf15aR9St9TWlb+XvbZXWpDx8YKs7MLzMH/BCeopv+y9vzrzgkfykCGuWOlSu3mZhj2+FQcrg==", + "deprecated": "This functionality has been moved to @npmcli/fs", + "optional": true, + "dependencies": { + "mkdirp": "^1.0.4", + "rimraf": "^3.0.2" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@npmcli/move-file/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "optional": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@npmcli/move-file/node_modules/mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "optional": true, + "bin": { + "mkdirp": "bin/cmd.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@npmcli/move-file/node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "optional": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/@octokit/auth-token": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-4.0.0.tgz", @@ -818,6 +905,20 @@ "node": ">=14.0.0" } }, + "node_modules/@sqltools/formatter": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/@sqltools/formatter/-/formatter-1.2.5.tgz", + "integrity": "sha512-Uy0+khmZqUrUGm5dmMqVlnvufZRSK0FbYzVgp0UMstm+F5+W2/jnEEQyc9vo1ZR/E5ZI/B1WjjoTqBqwJL6Krw==" + }, + "node_modules/@tootallnate/once": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", + "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==", + "optional": true, + "engines": { + "node": ">= 6" + } + }, "node_modules/@tsconfig/node10": { "version": "1.0.9", "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz", @@ -863,9 +964,9 @@ } }, "node_modules/@types/node": { - "version": "20.11.30", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.30.tgz", - "integrity": "sha512-dHM6ZxwlmuZaRmUPfv1p+KrdD1Dci04FbdEm/9wEMouFqxYoFl5aMkt0VMAUtYRQDyYvD41WJLukhq/ha3YuTw==", + "version": "20.12.7", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.12.7.tgz", + "integrity": "sha512-wq0cICSkRLVaf3UGLMGItu/PtdY7oaXaI/RVU+xliKVOtRna3PRY57ZDfztpDL0n11vfymMUnXv8QwYCO7L1wg==", "dependencies": { "undici-types": "~5.26.4" } @@ -900,31 +1001,31 @@ "integrity": "sha512-resGa1LAQLXI1tKDWnggDn7+o6fL4dZo7a8FcQKctBzC937UYp9iogiQonLElYduhzBarUUsMe/ntx/++xYgAA==" }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.62.0.tgz", - "integrity": "sha512-TiZzBSJja/LbhNPvk6yc0JrX9XqhQ0hdh6M2svYfsHGejaKFIAGd9MQ+ERIMzLGlN/kZoYIgdxFV0PuljTKXag==", - "dependencies": { - "@eslint-community/regexpp": "^4.4.0", - "@typescript-eslint/scope-manager": "5.62.0", - "@typescript-eslint/type-utils": "5.62.0", - "@typescript-eslint/utils": "5.62.0", - "debug": "^4.3.4", + "version": "7.10.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.10.0.tgz", + "integrity": "sha512-PzCr+a/KAef5ZawX7nbyNwBDtM1HdLIT53aSA2DDlxmxMngZ43O8SIePOeX8H5S+FHXeI6t97mTt/dDdzY4Fyw==", + "dev": true, + "dependencies": { + "@eslint-community/regexpp": "^4.10.0", + "@typescript-eslint/scope-manager": "7.10.0", + "@typescript-eslint/type-utils": "7.10.0", + "@typescript-eslint/utils": "7.10.0", + "@typescript-eslint/visitor-keys": "7.10.0", "graphemer": "^1.4.0", - "ignore": "^5.2.0", - "natural-compare-lite": "^1.4.0", - "semver": "^7.3.7", - "tsutils": "^3.21.0" + "ignore": "^5.3.1", + "natural-compare": "^1.4.0", + "ts-api-utils": "^1.3.0" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "@typescript-eslint/parser": "^5.0.0", - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + "@typescript-eslint/parser": "^7.0.0", + "eslint": "^8.56.0" }, "peerDependenciesMeta": { "typescript": { @@ -933,24 +1034,26 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.62.0.tgz", - "integrity": "sha512-VlJEV0fOQ7BExOsHYAGrgbEiZoi8D+Bl2+f6V2RrXerRSylnp+ZBHmPvaIa8cz0Ajx7WO7Z5RqfgYg7ED1nRhA==", - "dependencies": { - "@typescript-eslint/scope-manager": "5.62.0", - "@typescript-eslint/types": "5.62.0", - "@typescript-eslint/typescript-estree": "5.62.0", + "version": "7.10.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.10.0.tgz", + "integrity": "sha512-2EjZMA0LUW5V5tGQiaa2Gys+nKdfrn2xiTIBLR4fxmPmVSvgPcKNW+AE/ln9k0A4zDUti0J/GZXMDupQoI+e1w==", + "dev": true, + "dependencies": { + "@typescript-eslint/scope-manager": "7.10.0", + "@typescript-eslint/types": "7.10.0", + "@typescript-eslint/typescript-estree": "7.10.0", + "@typescript-eslint/visitor-keys": "7.10.0", "debug": "^4.3.4" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + "eslint": "^8.56.0" }, "peerDependenciesMeta": { "typescript": { @@ -959,15 +1062,16 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.62.0.tgz", - "integrity": "sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w==", + "version": "7.10.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.10.0.tgz", + "integrity": "sha512-7L01/K8W/VGl7noe2mgH0K7BE29Sq6KAbVmxurj8GGaPDZXPr8EEQ2seOeAS+mEV9DnzxBQB6ax6qQQ5C6P4xg==", + "dev": true, "dependencies": { - "@typescript-eslint/types": "5.62.0", - "@typescript-eslint/visitor-keys": "5.62.0" + "@typescript-eslint/types": "7.10.0", + "@typescript-eslint/visitor-keys": "7.10.0" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", @@ -975,24 +1079,25 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.62.0.tgz", - "integrity": "sha512-xsSQreu+VnfbqQpW5vnCJdq1Z3Q0U31qiWmRhr98ONQmcp/yhiPJFPq8MXiJVLiksmOKSjIldZzkebzHuCGzew==", + "version": "7.10.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.10.0.tgz", + "integrity": "sha512-D7tS4WDkJWrVkuzgm90qYw9RdgBcrWmbbRkrLA4d7Pg3w0ttVGDsvYGV19SH8gPR5L7OtcN5J1hTtyenO9xE9g==", + "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "5.62.0", - "@typescript-eslint/utils": "5.62.0", + "@typescript-eslint/typescript-estree": "7.10.0", + "@typescript-eslint/utils": "7.10.0", "debug": "^4.3.4", - "tsutils": "^3.21.0" + "ts-api-utils": "^1.3.0" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "*" + "eslint": "^8.56.0" }, "peerDependenciesMeta": { "typescript": { @@ -1001,11 +1106,12 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.62.0.tgz", - "integrity": "sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==", + "version": "7.10.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.10.0.tgz", + "integrity": "sha512-7fNj+Ya35aNyhuqrA1E/VayQX9Elwr8NKZ4WueClR3KwJ7Xx9jcCdOrLW04h51de/+gNbyFMs+IDxh5xIwfbNg==", + "dev": true, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", @@ -1013,20 +1119,22 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.62.0.tgz", - "integrity": "sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==", + "version": "7.10.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.10.0.tgz", + "integrity": "sha512-LXFnQJjL9XIcxeVfqmNj60YhatpRLt6UhdlFwAkjNc6jSUlK8zQOl1oktAP8PlWFzPQC1jny/8Bai3/HPuvN5g==", + "dev": true, "dependencies": { - "@typescript-eslint/types": "5.62.0", - "@typescript-eslint/visitor-keys": "5.62.0", + "@typescript-eslint/types": "7.10.0", + "@typescript-eslint/visitor-keys": "7.10.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", - "semver": "^7.3.7", - "tsutils": "^3.21.0" + "minimatch": "^9.0.4", + "semver": "^7.6.0", + "ts-api-utils": "^1.3.0" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", @@ -1038,41 +1146,63 @@ } } }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": { + "version": "9.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.4.tgz", + "integrity": "sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/@typescript-eslint/utils": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.62.0.tgz", - "integrity": "sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==", + "version": "7.10.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.10.0.tgz", + "integrity": "sha512-olzif1Fuo8R8m/qKkzJqT7qwy16CzPRWBvERS0uvyc+DHd8AKbO4Jb7kpAvVzMmZm8TrHnI7hvjN4I05zow+tg==", + "dev": true, "dependencies": { - "@eslint-community/eslint-utils": "^4.2.0", - "@types/json-schema": "^7.0.9", - "@types/semver": "^7.3.12", - "@typescript-eslint/scope-manager": "5.62.0", - "@typescript-eslint/types": "5.62.0", - "@typescript-eslint/typescript-estree": "5.62.0", - "eslint-scope": "^5.1.1", - "semver": "^7.3.7" + "@eslint-community/eslint-utils": "^4.4.0", + "@typescript-eslint/scope-manager": "7.10.0", + "@typescript-eslint/types": "7.10.0", + "@typescript-eslint/typescript-estree": "7.10.0" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + "eslint": "^8.56.0" } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.62.0.tgz", - "integrity": "sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==", + "version": "7.10.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.10.0.tgz", + "integrity": "sha512-9ntIVgsi6gg6FIq9xjEO4VQJvwOqA3jaBFQJ/6TK5AvEup2+cECI6Fh7QiBxmfMHXU0V0J4RyPeOU1VDNzl9cg==", + "dev": true, "dependencies": { - "@typescript-eslint/types": "5.62.0", - "eslint-visitor-keys": "^3.3.0" + "@typescript-eslint/types": "7.10.0", + "eslint-visitor-keys": "^3.4.3" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", @@ -1137,6 +1267,31 @@ "node": ">= 6.0.0" } }, + "node_modules/agentkeepalive": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-4.5.0.tgz", + "integrity": "sha512-5GG/5IbQQpC9FpkRGsSvZI5QYeSCzlJHdpBQntCsuTOxhKD8lqKhrleg2Yi7yvMIf82Ycmmqln9U8V9qwEiJew==", + "optional": true, + "dependencies": { + "humanize-ms": "^1.2.1" + }, + "engines": { + "node": ">= 8.0.0" + } + }, + "node_modules/aggregate-error": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", + "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", + "optional": true, + "dependencies": { + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/ajv": { "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", @@ -1174,6 +1329,19 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, + "node_modules/any-promise": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", + "integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==" + }, + "node_modules/app-root-path": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/app-root-path/-/app-root-path-3.1.0.tgz", + "integrity": "sha512-biN3PwB2gUtjaYy/isrU3aNWI5w+fAfvHkSvCKeQGxhmYpwKFUxudR3Yya+KqVRHBmEDYh+/lTozYCFbmzX4nA==", + "engines": { + "node": ">= 6.0.0" + } + }, "node_modules/aproba": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz", @@ -1494,6 +1662,14 @@ "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.3.tgz", "integrity": "sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ==" }, + "node_modules/bindings": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", + "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", + "dependencies": { + "file-uri-to-path": "1.0.0" + } + }, "node_modules/bl": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", @@ -1566,6 +1742,106 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/cacache": { + "version": "15.3.0", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-15.3.0.tgz", + "integrity": "sha512-VVdYzXEn+cnbXpFgWs5hTT7OScegHVmLhJIR8Ufqk3iFD6A6j5iSX1KuBTfNEv4tdJWE2PzA6IVFtcLC7fN9wQ==", + "optional": true, + "dependencies": { + "@npmcli/fs": "^1.0.0", + "@npmcli/move-file": "^1.0.1", + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "glob": "^7.1.4", + "infer-owner": "^1.0.4", + "lru-cache": "^6.0.0", + "minipass": "^3.1.1", + "minipass-collect": "^1.0.2", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.2", + "mkdirp": "^1.0.3", + "p-map": "^4.0.0", + "promise-inflight": "^1.0.1", + "rimraf": "^3.0.2", + "ssri": "^8.0.1", + "tar": "^6.0.2", + "unique-filename": "^1.1.1" + }, + "engines": { + "node": ">= 10" + } + }, + "node_modules/cacache/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "optional": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/cacache/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "optional": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/cacache/node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "optional": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cacache/node_modules/mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "optional": true, + "bin": { + "mkdirp": "bin/cmd.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/cacache/node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "optional": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/call-bind": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", @@ -1634,49 +1910,193 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", - "optional": true, "engines": { "node": ">=10" } }, - "node_modules/clp": { - "version": "4.0.12", - "resolved": "https://registry.npmjs.org/clp/-/clp-4.0.12.tgz", - "integrity": "sha512-DOQX14xsm4mM06JVzB/5nTk+tBdst+mFffz1OK4TWPa6++M/J7TJWuciXVwCRxTFzY2f+FRQARUu8+uqgQBpUQ==", - "dependencies": { - "is-number": "^2.1.0", - "last-char": "^1.3.1", - "match-it": "^1.0.0" + "node_modules/clean-stack": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", + "optional": true, + "engines": { + "node": ">=6" } }, - "node_modules/clp/node_modules/is-number": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", - "integrity": "sha512-QUzH43Gfb9+5yckcrSA0VBDwEtDUchrk4F6tfJZQuNzDJbEDB9cZNzSfXGQ1jqmdDY/kl41lUOWM9syA8z8jlg==", + "node_modules/cli-highlight": { + "version": "2.1.11", + "resolved": "https://registry.npmjs.org/cli-highlight/-/cli-highlight-2.1.11.tgz", + "integrity": "sha512-9KDcoEVwyUXrjcJNvHD0NFc/hiwe/WPVYIleQh2O1N2Zro5gWJZ/K+3DGn8w8P/F6FxOgzyC5bxDyHIgCSPhGg==", "dependencies": { - "kind-of": "^3.0.2" + "chalk": "^4.0.0", + "highlight.js": "^10.7.1", + "mz": "^2.4.0", + "parse5": "^5.1.1", + "parse5-htmlparser2-tree-adapter": "^6.0.0", + "yargs": "^16.0.0" + }, + "bin": { + "highlight": "bin/highlight" }, "engines": { - "node": ">=0.10.0" + "node": ">=8.0.0", + "npm": ">=5.0.0" } }, - "node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "node_modules/cli-highlight/node_modules/cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", "dependencies": { - "color-name": "~1.1.4" + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "node_modules/cli-highlight/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, + "node_modules/cli-highlight/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" }, "engines": { - "node": ">=7.0.0" + "node": ">=8" } }, - "node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" - }, - "node_modules/color-support": { + "node_modules/cli-highlight/node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/cli-highlight/node_modules/yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "dependencies": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/cli-highlight/node_modules/yargs-parser": { + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "engines": { + "node": ">=10" + } + }, + "node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/cliui/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, + "node_modules/cliui/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui/node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/clp": { + "version": "4.0.12", + "resolved": "https://registry.npmjs.org/clp/-/clp-4.0.12.tgz", + "integrity": "sha512-DOQX14xsm4mM06JVzB/5nTk+tBdst+mFffz1OK4TWPa6++M/J7TJWuciXVwCRxTFzY2f+FRQARUu8+uqgQBpUQ==", + "dependencies": { + "is-number": "^2.1.0", + "last-char": "^1.3.1", + "match-it": "^1.0.0" + } + }, + "node_modules/clp/node_modules/is-number": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", + "integrity": "sha512-QUzH43Gfb9+5yckcrSA0VBDwEtDUchrk4F6tfJZQuNzDJbEDB9cZNzSfXGQ1jqmdDY/kl41lUOWM9syA8z8jlg==", + "dependencies": { + "kind-of": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "node_modules/color-support": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==", @@ -1720,6 +2140,12 @@ "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" }, + "node_modules/confusing-browser-globals": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/confusing-browser-globals/-/confusing-browser-globals-1.0.11.tgz", + "integrity": "sha512-JsPKdmh8ZkmnHxDk55FZ1TqVLvEQTvoByJZRN9jzI0UjxK/QgAmsphz7PGtqgPieQZ/CQcHWXCR7ATDNhGe+YA==", + "dev": true + }, "node_modules/console-control-strings": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", @@ -1866,6 +2292,11 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/dayjs": { + "version": "1.11.10", + "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.10.tgz", + "integrity": "sha512-vjAczensTgRcqDERK0SR2XMwsF/tSvnvlv6VcF2GIhg6Sx4yOIt/irsr1RDJsKiIyBzJDpCoXiWWq28MqH2cnQ==" + }, "node_modules/debug": { "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", @@ -1894,6 +2325,14 @@ "node": ">=8" } }, + "node_modules/deep-extend": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", + "engines": { + "node": ">=4.0.0" + } + }, "node_modules/deep-is": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", @@ -1946,11 +2385,15 @@ "version": "2.0.3", "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.3.tgz", "integrity": "sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==", - "optional": true, "engines": { "node": ">=8" } }, + "node_modules/dexie": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/dexie/-/dexie-4.0.7.tgz", + "integrity": "sha512-M+Lo6rk4pekIfrc2T0o2tvVJwL6EAAM/B78DNfb8aaxFVoI1f8/rz5KTxuAnApkwqTSuxx7T5t0RKH7qprapGg==" + }, "node_modules/diff": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", @@ -2003,9 +2446,9 @@ "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==" }, "node_modules/ejs": { - "version": "3.1.9", - "resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.9.tgz", - "integrity": "sha512-rC+QVNMJWv+MtPgkt0y+0rVEIdbtxVADApW9JXrUVlzHetgcyczP/E7DJmWJ4fJCZF2cPcBk0laWO9ZHMG3DmQ==", + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.10.tgz", + "integrity": "sha512-UeJmFfOrAQS8OJWPZ4qtgHyWExa088/MtK5UEyoJGFH67cDEXkZSviOiKRCZ4Xij0zxI3JECgYs3oKx+AizQBA==", "dependencies": { "jake": "^10.8.5" }, @@ -2021,6 +2464,15 @@ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==" }, + "node_modules/encoding": { + "version": "0.1.13", + "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz", + "integrity": "sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==", + "optional": true, + "dependencies": { + "iconv-lite": "^0.6.2" + } + }, "node_modules/end-of-stream": { "version": "1.4.4", "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", @@ -2029,6 +2481,15 @@ "once": "^1.4.0" } }, + "node_modules/env-paths": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", + "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==", + "optional": true, + "engines": { + "node": ">=6" + } + }, "node_modules/epubjs": { "version": "0.3.93", "resolved": "https://registry.npmjs.org/epubjs/-/epubjs-0.3.93.tgz", @@ -2053,6 +2514,12 @@ "node": ">=10.0.0" } }, + "node_modules/err-code": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/err-code/-/err-code-2.0.3.tgz", + "integrity": "sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA==", + "optional": true + }, "node_modules/error-ex": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", @@ -2260,6 +2727,14 @@ "@esbuild/win32-x64": "0.18.20" } }, + "node_modules/escalade": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz", + "integrity": "sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==", + "engines": { + "node": ">=6" + } + }, "node_modules/escape-string-regexp": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", @@ -2325,6 +2800,48 @@ "url": "https://opencollective.com/eslint" } }, + "node_modules/eslint-config-airbnb-base": { + "version": "15.0.0", + "resolved": "https://registry.npmjs.org/eslint-config-airbnb-base/-/eslint-config-airbnb-base-15.0.0.tgz", + "integrity": "sha512-xaX3z4ZZIcFLvh2oUNvcX5oEofXda7giYmuplVxoOg5A7EXJMrUyqRgR+mhDhPK8LZ4PttFOBvCYDbX3sUoUig==", + "dev": true, + "dependencies": { + "confusing-browser-globals": "^1.0.10", + "object.assign": "^4.1.2", + "object.entries": "^1.1.5", + "semver": "^6.3.0" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + }, + "peerDependencies": { + "eslint": "^7.32.0 || ^8.2.0", + "eslint-plugin-import": "^2.25.2" + } + }, + "node_modules/eslint-config-airbnb-base/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/eslint-config-airbnb-typescript": { + "version": "18.0.0", + "resolved": "https://registry.npmjs.org/eslint-config-airbnb-typescript/-/eslint-config-airbnb-typescript-18.0.0.tgz", + "integrity": "sha512-oc+Lxzgzsu8FQyFVa4QFaVKiitTYiiW3frB9KYW5OWdPrqFc7FzxgB20hP4cHMlr+MBzGcLl3jnCOVOydL9mIg==", + "dev": true, + "dependencies": { + "eslint-config-airbnb-base": "^15.0.0" + }, + "peerDependencies": { + "@typescript-eslint/eslint-plugin": "^7.0.0", + "@typescript-eslint/parser": "^7.0.0", + "eslint": "^8.56.0" + } + }, "node_modules/eslint-import-resolver-node": { "version": "0.3.9", "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.9.tgz", @@ -2454,18 +2971,6 @@ "eslint": ">=2.0.0" } }, - "node_modules/eslint-scope": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", - "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", - "dependencies": { - "esrecurse": "^4.3.0", - "estraverse": "^4.1.1" - }, - "engines": { - "node": ">=8.0.0" - } - }, "node_modules/eslint-visitor-keys": { "version": "3.4.3", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", @@ -2568,14 +3073,6 @@ "node": ">=4.0" } }, - "node_modules/estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "engines": { - "node": ">=4.0" - } - }, "node_modules/esutils": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", @@ -2669,6 +3166,14 @@ "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", "integrity": "sha512-ncTzHV7NvsQZkYe1DW7cbDLm0YpzHmZF5r/iyP3ZnQtMiJ+pjzisCiMNI+Sj+xQF5pXhSHxSB3uDbsBTzY/c2A==" }, + "node_modules/expand-template": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz", + "integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==", + "engines": { + "node": ">=6" + } + }, "node_modules/ext": { "version": "1.7.0", "resolved": "https://registry.npmjs.org/ext/-/ext-1.7.0.tgz", @@ -2737,6 +3242,11 @@ "node": "^10.12.0 || >=12.0.0" } }, + "node_modules/file-uri-to-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==" + }, "node_modules/filelist": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/filelist/-/filelist-1.0.4.tgz", @@ -2886,7 +3396,6 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", - "optional": true, "dependencies": { "minipass": "^3.0.0" }, @@ -2898,7 +3407,6 @@ "version": "3.3.6", "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", - "optional": true, "dependencies": { "yallist": "^4.0.0" }, @@ -2990,6 +3498,14 @@ "node": ">=8" } }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, "node_modules/get-intrinsic": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", @@ -3032,6 +3548,11 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/github-from-package": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz", + "integrity": "sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==" + }, "node_modules/glob": { "version": "10.3.10", "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.10.tgz", @@ -3234,11 +3755,39 @@ "node": ">= 0.4" } }, + "node_modules/highlight.js": { + "version": "10.7.3", + "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-10.7.3.tgz", + "integrity": "sha512-tzcUFauisWKNHaRkN4Wjl/ZA07gENAjFl3J/c480dprkGTg5EQstgaNFqBfUqCq54kZRIEcreTsAgF/m2quD7A==", + "engines": { + "node": "*" + } + }, "node_modules/hosted-git-info": { "version": "2.8.9", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==" }, + "node_modules/http-cache-semantics": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz", + "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==", + "optional": true + }, + "node_modules/http-proxy-agent": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz", + "integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==", + "optional": true, + "dependencies": { + "@tootallnate/once": "1", + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/https-proxy-agent": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", @@ -3252,6 +3801,27 @@ "node": ">= 6" } }, + "node_modules/humanize-ms": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz", + "integrity": "sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==", + "optional": true, + "dependencies": { + "ms": "^2.0.0" + } + }, + "node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "optional": true, + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/ieee754": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", @@ -3307,6 +3877,21 @@ "node": ">=0.8.19" } }, + "node_modules/indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "optional": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/infer-owner": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/infer-owner/-/infer-owner-1.0.4.tgz", + "integrity": "sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A==", + "optional": true + }, "node_modules/inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", @@ -3321,6 +3906,11 @@ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, + "node_modules/ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" + }, "node_modules/internal-slot": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.7.tgz", @@ -3342,6 +3932,19 @@ "node": ">= 0.10" } }, + "node_modules/ip-address": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-9.0.5.tgz", + "integrity": "sha512-zHtQzGojZXTwZTHQqra+ETKd4Sn3vgi7uBmlPoXVWZqYvuKmtI0l/VZTjqGmJY9x88GGOaZ9+G9ES8hC4T4X8g==", + "optional": true, + "dependencies": { + "jsbn": "1.1.0", + "sprintf-js": "^1.1.3" + }, + "engines": { + "node": ">= 12" + } + }, "node_modules/is-array-buffer": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.4.tgz", @@ -3518,6 +4121,12 @@ "node": ">=0.10.0" } }, + "node_modules/is-lambda": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-lambda/-/is-lambda-1.0.1.tgz", + "integrity": "sha512-z7CMFGNrENq5iFB9Bqo64Xk6Y9sg+epq1myIcdHaGnbMTYOxvzsEtdYqQUylB7LxfkvgrrjP32T6Ywciio9UIQ==", + "optional": true + }, "node_modules/is-negative-zero": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.3.tgz", @@ -3714,6 +4323,12 @@ "js-yaml": "bin/js-yaml.js" } }, + "node_modules/jsbn": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-1.1.0.tgz", + "integrity": "sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A==", + "optional": true + }, "node_modules/jsdoc-type-pratt-parser": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/jsdoc-type-pratt-parser/-/jsdoc-type-pratt-parser-4.0.0.tgz", @@ -4035,6 +4650,57 @@ "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==" }, + "node_modules/make-fetch-happen": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-9.1.0.tgz", + "integrity": "sha512-+zopwDy7DNknmwPQplem5lAZX/eCOzSvSNNcSKm5eVwTkOBzoktEfXsa9L23J/GIRhxRsaxzkPEhrJEpE2F4Gg==", + "optional": true, + "dependencies": { + "agentkeepalive": "^4.1.3", + "cacache": "^15.2.0", + "http-cache-semantics": "^4.1.0", + "http-proxy-agent": "^4.0.1", + "https-proxy-agent": "^5.0.0", + "is-lambda": "^1.0.1", + "lru-cache": "^6.0.0", + "minipass": "^3.1.3", + "minipass-collect": "^1.0.2", + "minipass-fetch": "^1.3.2", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "negotiator": "^0.6.2", + "promise-retry": "^2.0.1", + "socks-proxy-agent": "^6.0.0", + "ssri": "^8.0.0" + }, + "engines": { + "node": ">= 10" + } + }, + "node_modules/make-fetch-happen/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "optional": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/make-fetch-happen/node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "optional": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/marks-pane": { "version": "1.0.9", "resolved": "https://registry.npmjs.org/marks-pane/-/marks-pane-1.0.9.tgz", @@ -4112,11 +4778,135 @@ "node": ">=16 || 14 >=14.17" } }, - "node_modules/minizlib": { - "version": "2.1.2", + "node_modules/minipass-collect": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/minipass-collect/-/minipass-collect-1.0.2.tgz", + "integrity": "sha512-6T6lH0H8OG9kITm/Jm6tdooIbogG9e0tLgpY6mphXSm/A9u8Nq1ryBG+Qspiub9LjWlBPsPS3tWQ/Botq4FdxA==", + "optional": true, + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/minipass-collect/node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "optional": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minipass-fetch": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-1.4.1.tgz", + "integrity": "sha512-CGH1eblLq26Y15+Azk7ey4xh0J/XfJfrCox5LDJiKqI2Q2iwOLOKrlmIaODiSQS8d18jalF6y2K2ePUm0CmShw==", + "optional": true, + "dependencies": { + "minipass": "^3.1.0", + "minipass-sized": "^1.0.3", + "minizlib": "^2.0.0" + }, + "engines": { + "node": ">=8" + }, + "optionalDependencies": { + "encoding": "^0.1.12" + } + }, + "node_modules/minipass-fetch/node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "optional": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minipass-flush": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/minipass-flush/-/minipass-flush-1.0.5.tgz", + "integrity": "sha512-JmQSYYpPUqX5Jyn1mXaRwOda1uQ8HP5KAT/oDSLCzt1BYRhQU0/hDtsB1ufZfEEzMZ9aAVmsBw8+FWsIXlClWw==", + "optional": true, + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/minipass-flush/node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "optional": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minipass-pipeline": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/minipass-pipeline/-/minipass-pipeline-1.2.4.tgz", + "integrity": "sha512-xuIq7cIOt09RPRJ19gdi4b+RiNvDFYe5JH+ggNvBqGqpQXcru3PcRmOZuHBKWK1Txf9+cQ+HMVN4d6z46LZP7A==", + "optional": true, + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minipass-pipeline/node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "optional": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minipass-sized": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/minipass-sized/-/minipass-sized-1.0.3.tgz", + "integrity": "sha512-MbkQQ2CTiBMlA2Dm/5cY+9SWFEN8pzzOXi6rlM5Xxq0Yqbda5ZQy9sU75a673FE9ZK0Zsbr6Y5iP6u9nktfg2g==", + "optional": true, + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minipass-sized/node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "optional": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minizlib": { + "version": "2.1.2", "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", - "optional": true, "dependencies": { "minipass": "^3.0.0", "yallist": "^4.0.0" @@ -4129,7 +4919,6 @@ "version": "3.3.6", "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", - "optional": true, "dependencies": { "yallist": "^4.0.0" }, @@ -4151,6 +4940,11 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/mkdirp-classic": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz", + "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==" + }, "node_modules/moment": { "version": "2.30.1", "resolved": "https://registry.npmjs.org/moment/-/moment-2.30.1.tgz", @@ -4164,21 +4958,40 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, + "node_modules/mz": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", + "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", + "dependencies": { + "any-promise": "^1.0.0", + "object-assign": "^4.0.1", + "thenify-all": "^1.0.0" + } + }, "node_modules/nan": { "version": "2.19.0", "resolved": "https://registry.npmjs.org/nan/-/nan-2.19.0.tgz", "integrity": "sha512-nO1xXxfh/RWNxfd/XPfbIfFk5vgLsAxUR9y5O0cHMJu/AW9U95JLXqthYHjEp+8gQ5p96K9jUp8nbVOxCdRbtw==", "optional": true }, + "node_modules/napi-build-utils": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.2.tgz", + "integrity": "sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg==" + }, "node_modules/natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==" }, - "node_modules/natural-compare-lite": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz", - "integrity": "sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==" + "node_modules/negotiator": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", + "optional": true, + "engines": { + "node": ">= 0.6" + } }, "node_modules/next-tick": { "version": "1.1.0", @@ -4190,6 +5003,25 @@ "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==" }, + "node_modules/node-abi": { + "version": "3.62.0", + "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.62.0.tgz", + "integrity": "sha512-CPMcGa+y33xuL1E0TcNIu4YyaZCxnnvkVaEXrsosR3FxN+fV8xvb7Mzpb7IgKler10qeMkE6+Dp8qJhpzdq35g==", + "dependencies": { + "semver": "^7.3.5" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/node-addon-api": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-7.1.0.tgz", + "integrity": "sha512-mNcltoe1R8o7STTegSOHdnJNN7s5EUvhoS7ShnTHDyOSd+8H+UdWODq6qSv67PjC8Zc5JRT8+oLAMCr0SIXw7g==", + "engines": { + "node": "^16 || ^18 || >= 20" + } + }, "node_modules/node-fetch": { "version": "2.7.0", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", @@ -4210,6 +5042,138 @@ } } }, + "node_modules/node-gyp": { + "version": "8.4.1", + "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-8.4.1.tgz", + "integrity": "sha512-olTJRgUtAb/hOXG0E93wZDs5YiJlgbXxTwQAFHyNlRsXQnYzUaF2aGgujZbw+hR8aF4ZG/rST57bWMWD16jr9w==", + "optional": true, + "dependencies": { + "env-paths": "^2.2.0", + "glob": "^7.1.4", + "graceful-fs": "^4.2.6", + "make-fetch-happen": "^9.1.0", + "nopt": "^5.0.0", + "npmlog": "^6.0.0", + "rimraf": "^3.0.2", + "semver": "^7.3.5", + "tar": "^6.1.2", + "which": "^2.0.2" + }, + "bin": { + "node-gyp": "bin/node-gyp.js" + }, + "engines": { + "node": ">= 10.12.0" + } + }, + "node_modules/node-gyp/node_modules/are-we-there-yet": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-3.0.1.tgz", + "integrity": "sha512-QZW4EDmGwlYur0Yyf/b2uGucHQMa8aFUP7eu9ddR73vvhFyt4V0Vl3QHPcTNJ8l6qYOBdxgXdnBXQrHilfRQBg==", + "optional": true, + "dependencies": { + "delegates": "^1.0.0", + "readable-stream": "^3.6.0" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/node-gyp/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "optional": true + }, + "node_modules/node-gyp/node_modules/gauge": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-4.0.4.tgz", + "integrity": "sha512-f9m+BEN5jkg6a0fZjleidjN51VE1X+mPFQ2DJ0uv1V39oCLCbsGe6yjbBnp7eK7z/+GAon99a3nHuqbuuthyPg==", + "optional": true, + "dependencies": { + "aproba": "^1.0.3 || ^2.0.0", + "color-support": "^1.1.3", + "console-control-strings": "^1.1.0", + "has-unicode": "^2.0.1", + "signal-exit": "^3.0.7", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1", + "wide-align": "^1.1.5" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/node-gyp/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "optional": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/node-gyp/node_modules/npmlog": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-6.0.2.tgz", + "integrity": "sha512-/vBvz5Jfr9dT/aFWd0FIRf+T/Q2WBsLENygUaFUqstqsycmZAP/t5BvFJTK0viFmSUxiUKTUplWy5vt+rvKIxg==", + "optional": true, + "dependencies": { + "are-we-there-yet": "^3.0.0", + "console-control-strings": "^1.1.0", + "gauge": "^4.0.3", + "set-blocking": "^2.0.0" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/node-gyp/node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "optional": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/node-gyp/node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "optional": true + }, + "node_modules/node-gyp/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "optional": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/nopt": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", @@ -4473,6 +5437,20 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/object.entries": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.1.8.tgz", + "integrity": "sha512-cmopxi8VwRIAw/fkijJohSfpef5PdN0pMQJN6VC/ZKvn0LIknWD8KtgY6KlQdEc4tIjcQ3HxSMmnvtzIscdaYQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/object.fromentries": { "version": "2.0.8", "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.8.tgz", @@ -4579,6 +5557,21 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/p-map": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", + "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==", + "optional": true, + "dependencies": { + "aggregate-error": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/pako": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/pako/-/pako-2.1.0.tgz", @@ -4607,6 +5600,24 @@ "node": ">=4" } }, + "node_modules/parse5": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-5.1.1.tgz", + "integrity": "sha512-ugq4DFI0Ptb+WWjAdOK16+u/nHfiIrcE+sh8kZMaM0WllQKLI9rOUq6c2b7cwPkXdzfQESqvoqK6ug7U/Yyzug==" + }, + "node_modules/parse5-htmlparser2-tree-adapter": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-6.0.1.tgz", + "integrity": "sha512-qPuWvbLgvDGilKc5BoicRovlT4MtYT6JfJyBOMDsKoiT+GiuP5qyrPCnR9HcPECIJJmZh5jRndyNThnhhb/vlA==", + "dependencies": { + "parse5": "^6.0.1" + } + }, + "node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz", + "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==" + }, "node_modules/path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", @@ -4750,6 +5761,80 @@ "node": ">= 0.4" } }, + "node_modules/prebuild-install": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.1.2.tgz", + "integrity": "sha512-UnNke3IQb6sgarcZIDU3gbMeTp/9SSU1DAIkil7PrqG1vZlBtY5msYccSKSHDqa3hNg436IXK+SNImReuA1wEQ==", + "dependencies": { + "detect-libc": "^2.0.0", + "expand-template": "^2.0.3", + "github-from-package": "0.0.0", + "minimist": "^1.2.3", + "mkdirp-classic": "^0.5.3", + "napi-build-utils": "^1.0.1", + "node-abi": "^3.3.0", + "pump": "^3.0.0", + "rc": "^1.2.7", + "simple-get": "^4.0.0", + "tar-fs": "^2.0.0", + "tunnel-agent": "^0.6.0" + }, + "bin": { + "prebuild-install": "bin.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/prebuild-install/node_modules/decompress-response": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", + "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==", + "dependencies": { + "mimic-response": "^3.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/prebuild-install/node_modules/mimic-response": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz", + "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/prebuild-install/node_modules/simple-get": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-4.0.1.tgz", + "integrity": "sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "decompress-response": "^6.0.0", + "once": "^1.3.1", + "simple-concat": "^1.0.0" + } + }, "node_modules/prelude-ls": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", @@ -4771,6 +5856,25 @@ "asap": "~2.0.3" } }, + "node_modules/promise-inflight": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", + "integrity": "sha512-6zWPyEOFaQBJYcGMHBKTKJ3u6TBsnMFOIZSa6ce1e/ZrrsOlnHRHbabMjLiBYKp+n44X9eUI6VUPaukCXHuG4g==", + "optional": true + }, + "node_modules/promise-retry": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/promise-retry/-/promise-retry-2.0.1.tgz", + "integrity": "sha512-y+WKFlBR8BGXnsNlIHFGPZmyDf3DFMoLhaflAnyZgV6rG6xu+JwesTo2Q9R6XwYmtmwAFCkAk3e35jEdoeh/3g==", + "optional": true, + "dependencies": { + "err-code": "^2.0.2", + "retry": "^0.12.0" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/properties-reader": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/properties-reader/-/properties-reader-2.3.0.tgz", @@ -4914,6 +6018,15 @@ "resolved": "https://registry.npmjs.org/pug-walk/-/pug-walk-2.0.0.tgz", "integrity": "sha512-yYELe9Q5q9IQhuvqsZNwA5hfPkMJ8u92bQLIMcsMxf/VADjNtEYptU+inlufAFYcWdHlwNfZOEnOOQrZrcyJCQ==" }, + "node_modules/pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, "node_modules/punycode": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", @@ -4941,6 +6054,28 @@ } ] }, + "node_modules/rc": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", + "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", + "dependencies": { + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + }, + "bin": { + "rc": "cli.js" + } + }, + "node_modules/rc/node_modules/strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/read-pkg": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", @@ -5016,6 +6151,11 @@ "node": ">= 0.10" } }, + "node_modules/reflect-metadata": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.2.2.tgz", + "integrity": "sha512-urBwgfrvVP/eAyXx4hluJivBKzuEbSQs9rKWCrCkbSxNv8mxPcUZKeuoF3Uy4mJl3Lwprp6yy5/39VWigZ4K6Q==" + }, "node_modules/regexp.prototype.flags": { "version": "1.5.2", "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.2.tgz", @@ -5033,6 +6173,14 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/require-from-string": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", @@ -5065,6 +6213,15 @@ "node": ">=4" } }, + "node_modules/retry": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz", + "integrity": "sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==", + "optional": true, + "engines": { + "node": ">= 4" + } + }, "node_modules/reusify": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", @@ -5165,6 +6322,12 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "optional": true + }, "node_modules/semver": { "version": "7.6.0", "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", @@ -5231,6 +6394,18 @@ "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", "integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==" }, + "node_modules/sha.js": { + "version": "2.4.11", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", + "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", + "dependencies": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + }, + "bin": { + "sha.js": "bin.js" + } + }, "node_modules/shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -5338,8 +6513,7 @@ "type": "consulting", "url": "https://feross.org/support" } - ], - "optional": true + ] }, "node_modules/simple-get": { "version": "3.1.1", @@ -5360,6 +6534,44 @@ "node": ">=8" } }, + "node_modules/smart-buffer": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", + "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==", + "optional": true, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + } + }, + "node_modules/socks": { + "version": "2.8.3", + "resolved": "https://registry.npmjs.org/socks/-/socks-2.8.3.tgz", + "integrity": "sha512-l5x7VUUWbjVFbafGLxPWkYsHIhEvmF85tbIeFZWc8ZPtoMyybuEhL7Jye/ooC4/d48FgOjSJXgsF/AJPYCW8Zw==", + "optional": true, + "dependencies": { + "ip-address": "^9.0.5", + "smart-buffer": "^4.2.0" + }, + "engines": { + "node": ">= 10.0.0", + "npm": ">= 3.0.0" + } + }, + "node_modules/socks-proxy-agent": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-6.2.1.tgz", + "integrity": "sha512-a6KW9G+6B3nWZ1yB8G7pJwL3ggLy1uTzKAgCb7ttblwqdz9fMGJUuTy3uFzEP48FAs9FLILlmzDlE2JJhVQaXQ==", + "optional": true, + "dependencies": { + "agent-base": "^6.0.2", + "debug": "^4.3.3", + "socks": "^2.6.2" + }, + "engines": { + "node": ">= 10" + } + }, "node_modules/source-map-generator": { "version": "0.8.0", "resolved": "https://registry.npmjs.org/source-map-generator/-/source-map-generator-0.8.0.tgz", @@ -5405,6 +6617,64 @@ "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.17.tgz", "integrity": "sha512-sh8PWc/ftMqAAdFiBu6Fy6JUOYjqDJBJvIhpfDMyHrr0Rbp5liZqd4TjtQ/RgfLjKFZb+LMx5hpml5qOWy0qvg==" }, + "node_modules/sprintf-js": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.3.tgz", + "integrity": "sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==", + "optional": true + }, + "node_modules/sqlite": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/sqlite/-/sqlite-5.1.1.tgz", + "integrity": "sha512-oBkezXa2hnkfuJwUo44Hl9hS3er+YFtueifoajrgidvqsJRQFpc5fKoAkAor1O5ZnLoa28GBScfHXs8j0K358Q==" + }, + "node_modules/sqlite3": { + "version": "5.1.7", + "resolved": "https://registry.npmjs.org/sqlite3/-/sqlite3-5.1.7.tgz", + "integrity": "sha512-GGIyOiFaG+TUra3JIfkI/zGP8yZYLPQ0pl1bH+ODjiX57sPhrLU5sQJn1y9bDKZUFYkX1crlrPfSYt0BKKdkog==", + "hasInstallScript": true, + "dependencies": { + "bindings": "^1.5.0", + "node-addon-api": "^7.0.0", + "prebuild-install": "^7.1.1", + "tar": "^6.1.11" + }, + "optionalDependencies": { + "node-gyp": "8.x" + }, + "peerDependencies": { + "node-gyp": "8.x" + }, + "peerDependenciesMeta": { + "node-gyp": { + "optional": true + } + } + }, + "node_modules/ssri": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-8.0.1.tgz", + "integrity": "sha512-97qShzy1AiyxvPNIkLWoGua7xoQzzPjQ0HAH4B0rWKo7SZ6USuPcrUiAFrws0UH8RrbWmgq3LMTObhPIHbbBeQ==", + "optional": true, + "dependencies": { + "minipass": "^3.1.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/ssri/node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "optional": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/string_decoder": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", @@ -5621,7 +6891,6 @@ "version": "6.2.1", "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.1.tgz", "integrity": "sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==", - "optional": true, "dependencies": { "chownr": "^2.0.0", "fs-minipass": "^2.0.0", @@ -5634,6 +6903,22 @@ "node": ">=10" } }, + "node_modules/tar-fs": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.1.tgz", + "integrity": "sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng==", + "dependencies": { + "chownr": "^1.1.1", + "mkdirp-classic": "^0.5.2", + "pump": "^3.0.0", + "tar-stream": "^2.1.4" + } + }, + "node_modules/tar-fs/node_modules/chownr": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", + "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==" + }, "node_modules/tar-js": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/tar-js/-/tar-js-0.3.0.tgz", @@ -5661,7 +6946,6 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", - "optional": true, "engines": { "node": ">=8" } @@ -5670,7 +6954,6 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", - "optional": true, "bin": { "mkdirp": "bin/cmd.js" }, @@ -5683,6 +6966,25 @@ "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==" }, + "node_modules/thenify": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", + "integrity": "sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==", + "dependencies": { + "any-promise": "^1.0.0" + } + }, + "node_modules/thenify-all": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz", + "integrity": "sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==", + "dependencies": { + "thenify": ">= 3.1.0 < 4" + }, + "engines": { + "node": ">=0.8" + } + }, "node_modules/to-fast-properties": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", @@ -5778,22 +7080,19 @@ } }, "node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" }, - "node_modules/tsutils": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", - "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", + "node_modules/tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==", "dependencies": { - "tslib": "^1.8.1" + "safe-buffer": "^5.0.1" }, "engines": { - "node": ">= 6" - }, - "peerDependencies": { - "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" + "node": "*" } }, "node_modules/type": { @@ -5892,6 +7191,148 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/typeorm": { + "version": "0.3.20", + "resolved": "https://registry.npmjs.org/typeorm/-/typeorm-0.3.20.tgz", + "integrity": "sha512-sJ0T08dV5eoZroaq9uPKBoNcGslHBR4E4y+EBHs//SiGbblGe7IeduP/IH4ddCcj0qp3PHwDwGnuvqEAnKlq/Q==", + "dependencies": { + "@sqltools/formatter": "^1.2.5", + "app-root-path": "^3.1.0", + "buffer": "^6.0.3", + "chalk": "^4.1.2", + "cli-highlight": "^2.1.11", + "dayjs": "^1.11.9", + "debug": "^4.3.4", + "dotenv": "^16.0.3", + "glob": "^10.3.10", + "mkdirp": "^2.1.3", + "reflect-metadata": "^0.2.1", + "sha.js": "^2.4.11", + "tslib": "^2.5.0", + "uuid": "^9.0.0", + "yargs": "^17.6.2" + }, + "bin": { + "typeorm": "cli.js", + "typeorm-ts-node-commonjs": "cli-ts-node-commonjs.js", + "typeorm-ts-node-esm": "cli-ts-node-esm.js" + }, + "engines": { + "node": ">=16.13.0" + }, + "funding": { + "url": "https://opencollective.com/typeorm" + }, + "peerDependencies": { + "@google-cloud/spanner": "^5.18.0", + "@sap/hana-client": "^2.12.25", + "better-sqlite3": "^7.1.2 || ^8.0.0 || ^9.0.0", + "hdb-pool": "^0.1.6", + "ioredis": "^5.0.4", + "mongodb": "^5.8.0", + "mssql": "^9.1.1 || ^10.0.1", + "mysql2": "^2.2.5 || ^3.0.1", + "oracledb": "^6.3.0", + "pg": "^8.5.1", + "pg-native": "^3.0.0", + "pg-query-stream": "^4.0.0", + "redis": "^3.1.1 || ^4.0.0", + "sql.js": "^1.4.0", + "sqlite3": "^5.0.3", + "ts-node": "^10.7.0", + "typeorm-aurora-data-api-driver": "^2.0.0" + }, + "peerDependenciesMeta": { + "@google-cloud/spanner": { + "optional": true + }, + "@sap/hana-client": { + "optional": true + }, + "better-sqlite3": { + "optional": true + }, + "hdb-pool": { + "optional": true + }, + "ioredis": { + "optional": true + }, + "mongodb": { + "optional": true + }, + "mssql": { + "optional": true + }, + "mysql2": { + "optional": true + }, + "oracledb": { + "optional": true + }, + "pg": { + "optional": true + }, + "pg-native": { + "optional": true + }, + "pg-query-stream": { + "optional": true + }, + "redis": { + "optional": true + }, + "sql.js": { + "optional": true + }, + "sqlite3": { + "optional": true + }, + "ts-node": { + "optional": true + }, + "typeorm-aurora-data-api-driver": { + "optional": true + } + } + }, + "node_modules/typeorm/node_modules/buffer": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + }, + "node_modules/typeorm/node_modules/mkdirp": { + "version": "2.1.6", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-2.1.6.tgz", + "integrity": "sha512-+hEnITedc8LAtIP9u3HJDFIdcLV2vXP33sqLLIzkv1Db1zO/1OxbvYf0Y1OC/S/Qo5dxHXepofhmxL02PsKe+A==", + "bin": { + "mkdirp": "dist/cjs/src/bin.js" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/typescript": { "version": "5.4.3", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.3.tgz", @@ -5923,6 +7364,24 @@ "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==" }, + "node_modules/unique-filename": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz", + "integrity": "sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ==", + "optional": true, + "dependencies": { + "unique-slug": "^2.0.0" + } + }, + "node_modules/unique-slug": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.2.tgz", + "integrity": "sha512-zoWr9ObaxALD3DOPfjPSqxt4fnZiWblxHIgeWqW8x7UqDzEtHEQLzji2cuJYQFCU6KmoJikOYAZlrTHHebjx2w==", + "optional": true, + "dependencies": { + "imurmurhash": "^0.1.4" + } + }, "node_modules/universal-user-agent": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.1.tgz", @@ -5954,6 +7413,18 @@ "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" }, + "node_modules/uuid": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "bin": { + "uuid": "dist/bin/uuid" + } + }, "node_modules/v8-compile-cache-lib": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", @@ -6212,11 +7683,62 @@ "node": ">=0.6.0" } }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "engines": { + "node": ">=10" + } + }, "node_modules/yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" }, + "node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, + "node_modules/yargs/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/yn": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", @@ -6575,11 +8097,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/zotero-plugin/node_modules/tslib": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", - "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" - }, "node_modules/zotero-types": { "version": "1.3.20", "resolved": "https://registry.npmjs.org/zotero-types/-/zotero-types-1.3.20.tgz", diff --git a/package.json b/package.json index 399cf28..eb46b11 100644 --- a/package.json +++ b/package.json @@ -1,32 +1,31 @@ { - "name": "reference-network", - "id": "reference-network@example.com", + "name": "weaver", + "id": "weaver@example.com", "version": "0.0.1", - "description": "Reference Network", + "description": "Weaver", "scripts": { "lint": "eslint . --ext .ts --cache --cache-location .eslintcache/", "prebuild": "npm run lint", "build": "tsc --noEmit && node esbuild.js", "start": "tsc --noEmit && node --watch-path=./src esbuild.js", - "postbuild": "zotero-plugin-zipup build reference-network", + "postbuild": "zotero-plugin-zipup build weaver", "release": "zotero-plugin-release", "postversion": "git push --follow-tags" }, "repository": { "type": "git", - "url": "https://github.com/RaymondWJang/reference-network.git" + "url": "https://github.com/RaymondWJang/weaver.git" }, "author": { "name": "Raymond W. Chang", "email": "raymond.w.jang@gmail.com" }, "bugs": { - "url": "https://github.com/RaymondWJang/reference-network/issues" + "url": "https://github.com/RaymondWJang/weaver/issues" }, - "homepage": "https://github.com/RaymondWJang/reference-network", + "homepage": "https://github.com/RaymondWJang/weaver", "dependencies": { - "@typescript-eslint/eslint-plugin": "^5.59.9", - "@typescript-eslint/parser": "^5.59.9", + "dexie": "^4.0.7", "esbuild": "^0.18.1", "eslint": "^8.42.0", "eslint-plugin-import": "^2.27.5", @@ -34,16 +33,27 @@ "eslint-plugin-prefer-arrow": "^1.2.3", "mkdirp": "^3.0.1", "npm-run-all": "^4.1.5", + "reflect-metadata": "^0.2.2", "rimraf": "^5.0.1", + "sqlite": "^5.1.1", + "sqlite3": "^5.1.7", "ts-node": "^10.9.1", + "tslib": "^2.6.2", + "typeorm": "^0.3.20", "typescript": "^5.1.3", "zotero-plugin": "^1.4.22", "zotero-types": "^1.0.15" }, "xpi": { - "name": "Reference Network for Zotero", - "updateLink": "https://github.com/RaymondWJang/reference-network/releases/download/v{version}/reference-network-{version}.xpi", - "releaseURL": "https://github.com/RaymondWJang/reference-network/releases/download/release/", + "name": "Weaver", + "updateLink": "https://github.com/RaymondWJang/weaver/releases/download/v{version}/weaver-{version}.xpi", + "releaseURL": "https://github.com/RaymondWJang/weaver/releases/download/release/", "bootstrapped": true + }, + "devDependencies": { + "@types/node": "^20.12.7", + "@typescript-eslint/eslint-plugin": "^7.10.0", + "@typescript-eslint/parser": "^7.10.0", + "eslint-config-airbnb-typescript": "^18.0.0" } } diff --git a/src/bootstrap.ts b/src/bootstrap.ts new file mode 100644 index 0000000..64a5ad3 --- /dev/null +++ b/src/bootstrap.ts @@ -0,0 +1,79 @@ +import { weaver } from "./weaver.js"; + +function log(msg: string): void { + Zotero.log(msg, "warning", "Weaver: bootstrap.ts"); +} + +function logError(msg: string, error): void { + Zotero.log(`${msg} ${error}: ${error.stack}`, "error"); +} + +export async function install(): Promise { + Zotero.Weaver = weaver; + + try { + await weaver.install(); + log("Installed Weaver"); + } catch (error) { + logError("Error during installation", error); + } +} + +export async function startup({ + id, + version, + resourceURI, + rootURI = resourceURI.spec, +}) { + await Promise.all([ + Zotero.initializationPromise, + Zotero.unlockPromise, + Zotero.uiReadyPromise, + ]); + + log(`ID: ${id}`); + log(`Version: ${version}`); + // log(`Resource URI: ${resourceURI}`); + log(`Root URI: ${rootURI}`); + + if (typeof Zotero.Weaver !== "undefined") { + Zotero.Weaver = weaver; + } + + log(`Bootstrap startup`); + try { + await Zotero.PreferencePanes.register({ + // Generates a pane in Preference + pluginID: "weaver@example.com", + src: `${rootURI}prefs/prefs.xhtml`, + scripts: [`${rootURI}prefs/prefs.js`], + // defaultXUL: false, + }); + log("Registered preference pane"); + } catch (error) { + logError("Error registering preference pane", error); + } + + try { + await weaver.init({ id, version, rootURI }); + log("Initialized Weaver"); + } catch (error) { + log("Error during startup: " + error.stack); + } + + try { + weaver.addToAllWindows(); + log("UI test complete!"); + } catch (error) { + logError("Error during a UI Test!", error); + } +} + +export function shutdown() { + log("Weaver: Shutdown"); + Zotero.Weaver = undefined; +} + +export function uninstall() { + log("Weaver: Uninstalled"); +} diff --git a/src/database/apiManager.ts b/src/database/apiManager.ts new file mode 100644 index 0000000..6ff51ad --- /dev/null +++ b/src/database/apiManager.ts @@ -0,0 +1,80 @@ +export class ApiManager { + private apiUrl: string = "https://api.openalex.org/"; + private userAgent: string; + private headers: Record; + + constructor(apiUrl: string, userAgent: string) { + this.apiUrl = apiUrl; + this.userAgent = userAgent; + this.headers = { + "User-Agent": this.userAgent, + }; + } + + private log(msg: string): void { + Zotero.log(msg, "warning", "Weaver: apiManager.ts"); + } + + private logError(error: Error): void { + Zotero.logError(error); + } + + async fetchPublication(doi: string): Promise { + const url = + this.apiUrl + `works/https://doi.org/${encodeURIComponent(doi)}`; + try { + const response = await Zotero.HTTP.request("GET", url, { + headers: this.headers, + }); + const data = JSON.parse(response.responseText); + return data; + } catch (error) { + Zotero.logError(error); + throw error; // Re-throw to handle it in the calling function + } + } + + async fetchPublications( + dois: string[], + batchSize: number = 25 + ): Promise { + const data = []; + let index = 0; + + while (index < dois.length) { + const batchDOIs = dois.slice(index, index + batchSize); + const url = this.apiUrl + `works?filter=doi:${batchDOIs.join("|")}`; + this.log(`Fetching batch of DOIs: ${url}`); + try { + const response = await Zotero.HTTP.request("GET", url, { + headers: this.headers, + }); + const dataBatch = JSON.parse(response.responseText); + data.push(dataBatch); // Store the batch data + } catch (error) { + this.logError(error); + throw error; // Re-throw the error after logging it + } + + index += batchSize; // Move the index forward by batchSize + } + + return data; + } + + public async fetchCitedBy(openAlexID: string, url?: string): Promise { + if (!url) { + url = `https://api.openalex.org/works?filter=cites:${openAlexID}`; + } + try { + const response = await Zotero.HTTP.request("GET", url, { + headers: this.headers, + }); + const data = JSON.parse(response.responseText); + return data; + } catch (error) { + Zotero.logError(error); + throw error; // Re-throw to handle it in the calling function + } + } +} diff --git a/src/database/databaseManager.ts b/src/database/databaseManager.ts new file mode 100644 index 0000000..6d24110 --- /dev/null +++ b/src/database/databaseManager.ts @@ -0,0 +1,122 @@ +import { + DATABASE_NAMES, + TABLE_NAMES, + DDL_QUERIES, + CRUD, + DatabaseNameKey, + TableNameKey, +} from "./entities"; +import { Shim } from "../environment/os"; + +export class DatabaseManager { + private dir: string; + private dbPath: string; + + constructor(private rootDir: string) { + this.dir = Shim.Path.join(Zotero.DataDirectory.dir, "weaver"); + this.dbPath = Shim.Path.join(this.dir, "weaver.sqlite"); + } + + private log(msg: string): void { + Zotero.log(msg, "warning", "Weaver: databaseManager.ts"); + } + + async initializeDatabase(): Promise { + // Ensure directory exists + Shim.File.makeDir(this.dir, { ignoreExisting: true }); + this.log(`Directory created at ${this.dir}`); + + // Attach database + await Zotero.DB.queryAsync( + `ATTACH DATABASE ? AS ${DATABASE_NAMES.WEAVER}`, + [this.dbPath] + ); + this.log(`Database attached from ${this.dbPath}`); + + // Check for existing tables and create if necessary + for (const tableName of Object.values(TABLE_NAMES)) { + await this.createTable(DATABASE_NAMES.WEAVER, tableName); + } + } + + private async checkTableExists( + databaseName: string, + tableName: string + ): Promise { + return await Zotero.DB.valueQueryAsync( + `SELECT COUNT(*) FROM ${databaseName}.sqlite_master WHERE type='table' AND name='${tableName}'` + ); + } + + private async dropTable( + databaseName: string, + tableName: string + ): Promise { + this.log(`Dropping ${tableName} table...`); + await Zotero.DB.queryAsync(`DROP TABLE ${databaseName}.${tableName};`); + } + + private async createTable( + databaseName: string, + tableName: string + ): Promise { + if (await this.checkTableExists(databaseName, tableName)) { + this.log(`${tableName} table already exists`); + return; + } + + this.log(`Creating ${tableName} table...`); + await Zotero.DB.queryAsync(DDL_QUERIES[tableName]); + this.log(`${tableName} created`); + } + + async insert( + tableName: TableNameKey, + columns: string, + values: string + ): Promise { + await Zotero.DB.queryAsync(CRUD.INSERT(tableName, columns, values)); + } + + async select( + tableName: TableNameKey, + columns: string, + condition: string + ): Promise { + return await Zotero.DB.queryAsync( + CRUD.SELECT(tableName, columns, condition) + ); + } + + async update( + tableName: TableNameKey, + columnValuePairs: string, + condition?: string + ): Promise { + await Zotero.DB.queryAsync( + CRUD.UPDATE(tableName, columnValuePairs, condition) + ); + } + + async delete(tableName: TableNameKey, condition: string): Promise { + await Zotero.DB.queryAsync(CRUD.DELETE(tableName, condition)); + } + + async upsert( + tableName: TableNameKey, + columns: string, + values: string, + condition: string + ): Promise { + const rows = await this.select(tableName, columns, condition); + if (rows.length === 0) { + await this.insert(tableName, columns, values); + } else { + const columnValuePairs = columns + .split(", ") + .map((column, i) => `${column} = ${values.split(", ")[i]}`) + .join(", "); + await this.update(tableName, columnValuePairs, condition); + } + } +} diff --git a/src/database/entities.ts b/src/database/entities.ts new file mode 100644 index 0000000..1fd102a --- /dev/null +++ b/src/database/entities.ts @@ -0,0 +1,51 @@ +export const DATABASE_NAMES = { + WEAVER: "weaver", +} as const; + +export const TABLE_NAMES = { + GRAPHS: `graphs`, + ITEMS: `items`, +} as const; + +export type DatabaseNameKey = keyof typeof DATABASE_NAMES; +export type TableNameKey = keyof typeof TABLE_NAMES; + +export const DDL_QUERIES = { + [TABLE_NAMES.ITEMS]: `CREATE TABLE IF NOT EXISTS ${DATABASE_NAMES.WEAVER}.${TABLE_NAMES.ITEMS} ( + id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, + zotero_item_id TEXT, + openalex_id TEXT, + doi TEXT, + created_at TEXT DEFAULT CURRENT_TIMESTAMP, + updated_at TEXT DEFAULT CURRENT_TIMESTAMP + );`, + [TABLE_NAMES.GRAPHS]: `CREATE TABLE IF NOT EXISTS ${DATABASE_NAMES.WEAVER}.${TABLE_NAMES.GRAPHS} ( + id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, + source TEXT NOT NULL, + target TEXT NOT NULL, + type TEXT check(type = "related_to" or type = "cites") NOT NULL, + data_source TEXT, + created_at TEXT DEFAULT CURRENT_TIMESTAMP, + updated_at TEXT DEFAULT CURRENT_TIMESTAMP + );`, +}; + +export const CRUD = { + INSERT: (tableName: TableNameKey, columns: string, values: string) => + `INSERT INTO ${DATABASE_NAMES.WEAVER}.${TABLE_NAMES[tableName]} (${columns}) VALUES (${values});`, + SELECT: (tableName: TableNameKey, columns: string, condition?: string) => { + if (condition) { + `SELECT ${columns} FROM ${DATABASE_NAMES.WEAVER}.${TABLE_NAMES[tableName]} WHERE ${condition};`; + } else { + `SELECT ${columns} FROM ${DATABASE_NAMES.WEAVER}.${TABLE_NAMES[tableName]}`; + } + }, + UPDATE: ( + tableName: TableNameKey, + columnValuePairs: string, + condition?: string + ) => + `UPDATE ${DATABASE_NAMES.WEAVER}.${TABLE_NAMES[tableName]} SET ${columnValuePairs} WHERE ${condition};`, + DELETE: (tableName: TableNameKey, condition: string) => + `DELETE FROM ${DATABASE_NAMES.WEAVER}.${TABLE_NAMES[tableName]} WHERE ${condition};`, +}; diff --git a/src/database/queries.ts b/src/database/queries.ts new file mode 100644 index 0000000..bf3b10b --- /dev/null +++ b/src/database/queries.ts @@ -0,0 +1,11 @@ +export const queries = { + getDOIs: ( + libraryID: number + ) => `SELECT value as doi, iD.itemID -- iDV.valueID, fieldName + FROM itemDataValues AS iDV + LEFT JOIN itemData AS iD ON iDV.valueID = iD.valueID + LEFT JOIN fields AS f ON iD.fieldID = f.fieldID + LEFT JOIN items AS i ON iD.itemID = i.itemID + WHERE fieldName = 'DOI' + AND libraryID = ${libraryID};`, +}; diff --git a/src/environment/client.ts b/src/environment/client.ts new file mode 100644 index 0000000..743619e --- /dev/null +++ b/src/environment/client.ts @@ -0,0 +1,47 @@ +declare const Zotero: any; +declare const location: any; + +const worker = typeof location !== "undefined" && location.search; // this is false +export const is7 = worker + ? new URLSearchParams(location.search).get("is7") === "true" // location is chrome://zotero/content/zoteroPane.xhtml + : Zotero.platformMajorVersion >= 102; // 115 on mine, May 20, 2024 --> is7 is true + +function clientname(): string { + if (typeof location !== "undefined" && location.search) { + return new URLSearchParams(location.search).get("clientName"); + } + // if (process.versions.node) return 'Zotero' // testing + if (Zotero.clientName) return Zotero.clientName as string; + if (Zotero.Weaver?.clientName) { + return Zotero.Weaver.clientName as string; + } + throw new Error("Unable to detect clientName"); +} + +export const platform = { + name: "", + windows: false, + mac: false, + linux: false, +}; + +if (worker) { + platform.name = new URLSearchParams(location.search).get("platform"); + platform.windows = platform.name === "win"; + platform.mac = platform.name === "mac"; + platform.linux = platform.name === "lin"; +} else { + platform.name = Zotero.isWin + ? "win" + : Zotero.isMac + ? "mac" + : Zotero.isLinux + ? "lin" + : "unk"; + platform.windows = Zotero.isWin; + platform.mac = Zotero.isMac; + platform.linux = Zotero.isLinux; +} + +export const clientName = clientname(); +export const client = clientName.toLowerCase().replace("-", ""); diff --git a/src/environment/os.ts b/src/environment/os.ts new file mode 100644 index 0000000..8a26f78 --- /dev/null +++ b/src/environment/os.ts @@ -0,0 +1,17 @@ +import { is7, platform } from "./client"; + +import { OS as $OS } from "./osfile"; + +export const Shim: any = is7 ? $OS : undefined; + +if (Shim) { + // no idea why it was decided the shim should not accept relative paths + const Path = platform.windows + ? { start: /.*\\/, end: /\\$/ } + : { start: /.*\//, end: /\/$/ }; + Shim.Path.basename = (path: string) => + path && + (Shim.Path.normalize(path) as string) + .replace(Path.end, "") + .replace(Path.start, ""); +} diff --git a/src/environment/osfile.js b/src/environment/osfile.js new file mode 100644 index 0000000..5af7d7c --- /dev/null +++ b/src/environment/osfile.js @@ -0,0 +1,406 @@ +// +// Compatibility shims from the Mozilla codebase +// +export const OS = { + Constants: { + Path: { + get homeDir() { + return FileUtils.getDir("Home", []).path; + }, + + get libDir() { + return FileUtils.getDir("GreBinD", []).path; + }, + + get profileDir() { + return FileUtils.getDir("ProfD", []).path; + }, + + get tmpDir() { + return FileUtils.getDir("TmpD", []).path; + }, + }, + }, + + File: { + DirectoryIterator(path) { + let initialized = false; + const paths = []; + + async function init() { + paths.push(...(await IOUtils.getChildren(path))); + initialized = true; + } + + async function getEntry(path) { + const info = await IOUtils.stat(path); + return { + name: PathUtils.filename(path), + path, + isDir: info.type == "directory", + }; + } + + this.nextBatch = async function (num) { + if (!initialized) { + await init(); + } + const entries = []; + while (paths.length && num > 0) { + entries.push(await getEntry(paths.shift())); + num--; + } + return entries; + }; + + this.forEach = async function (func) { + if (!initialized) { + await init(); + } + let i = 0; + while (paths.length) { + const entry = await getEntry(paths.shift()); + await func(entry, i++, this); + } + }; + + this.close = function () {}; + }, + + Error(msg) { + this.message = msg; + this.stack = new Error().stack; + }, + + copy: wrapWrite(async (src, dest) => IOUtils.copy(src, dest)), + + async exists(path) { + try { + return await IOUtils.exists(path); + } catch (e) { + if (e.message.includes("NS_ERROR_FILE_UNRECOGNIZED_PATH")) { + dump(`${e.message}\n\n${e.stack}\n\n`); + Components.utils.reportError(e); + return false; + } + } + }, + + makeDir: wrapWrite(async (path, options = {}) => { + try { + return await IOUtils.makeDirectory(path, { + ignoreExisting: options.ignoreExisting !== false, + createAncestors: !!options.from, + permissions: options.unixMode, + }); + } catch (e) { + // Broken symlink + if (e.name == "InvalidAccessError") { + if ( + /Could not create directory because the target file(.+) exists and is not a directory/.test( + e.message + ) + ) { + const osFileError = new OS.File.Error(e.message); + osFileError.becauseExists = true; + throw osFileError; + } + } + } + }), + + move: wrapWrite(async (src, dest, options = {}) => { + if (options.noCopy) { + throw new Error("noCopy is no longer supported"); + } + + // Check noOverwrite + let destFileInfo = null; + try { + destFileInfo = await IOUtils.stat(dest); + } catch (e) { + if (e.name != "NotFoundError") { + throw e; + } + } + if (destFileInfo) { + if (destFileInfo.type == "directory") { + throw new Error( + "OS.File.move() destination cannot be a directory -- use IOUtils.move()" + ); + } + if (options.noOverwrite) { + const e = new OS.File.Error(); + e.becauseExists = true; + throw e; + } + } + + return IOUtils.move(src, dest, options); + }), + + async read(path, options = {}) { + if (options.encoding) { + if (!/^utf\-?8$/i.test(options.encoding)) { + throw new Error("Can only read UTF-8"); + } + return IOUtils.readUTF8(path); + } + return IOUtils.read(path, { + maxBytes: options.bytes, + }); + }, + + async remove(path, options = {}) { + return IOUtils.remove(path, options); + }, + + async removeDir(path, options = {}) { + return IOUtils.remove(path, { + recursive: true, + // OS.File.removeDir defaulted to ignoreAbsent: true + ignoreAbsent: options.ignoreAbsent !== false, + }); + }, + + async removeEmptyDir(path) { + return IOUtils.remove(path); + }, + + async setDates(path, atime, mtime) { + if (atime) { + await IOUtils.setAccessTime(path, atime.valueOf()); + } + return IOUtils.setModificationTime( + path, + mtime ? mtime.valueOf() : undefined + ); + }, + + async setPermissions(path, { unixMode, winAttributes } = {}) { + await IOUtils.setPermissions(path, unixMode); + if (winAttributes && Zotero.isWin) { + const { readOnly, hidden, system } = winAttributes; + await IOUtils.setWindowsAttributes(path, { readOnly, hidden, system }); + } + }, + + stat: async function stat(path) { + let info; + try { + info = await IOUtils.stat(path); + } catch (e) { + if (e.name == "NotFoundError") { + const osFileError = new this.Error("File not found"); + osFileError.becauseNoSuchFile = true; + throw osFileError; + } + throw e; + } + return { + isDir: info.type == "directory", + isSymLink: true, // Supposedly was broken in Firefox + size: info.size, + lastAccessDate: new Date(info.lastAccessed), + lastModificationDate: new Date(info.lastModified), + }; + }, + + async unixSymLink(pathTarget, pathCreate) { + if (await IOUtils.exists(pathCreate)) { + const osFileError = new this.Error(`${pathCreate} already exists`); + osFileError.becauseExists = true; + throw osFileError; + } + + // Copy of Zotero.File.createSymlink + const { ctypes } = ChromeUtils.importESModule( + "resource://gre/modules/ctypes.sys.mjs" + ); + + try { + if (Services.appinfo.OS === "Darwin") { + const libc = ctypes.open( + Services.appinfo.OS === "Darwin" ? "libSystem.B.dylib" : "libc.so" + ); + + const symlink = libc.declare( + "symlink", + ctypes.default_abi, + ctypes.int, // return value + ctypes.char.ptr, // target + ctypes.char.ptr // linkpath + ); + + if (symlink(pathTarget, pathCreate)) { + throw new Error(`Failed to create symlink at ${pathCreate}`); + } + } + // The above is failing with "invalid ELF header" for libc.so on GitHub Actions, so + // just use ln -s on non-macOS systems + else { + const ln = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsIFile); + ln.initWithPath("/bin/ln"); + const process = Cc["@mozilla.org/process/util;1"].createInstance( + Ci.nsIProcess + ); + process.init(ln); + const args = ["-s", pathTarget, pathCreate]; + process.run(true, args, args.length); + } + } catch (e) { + dump(`${e.message}\n\n`); + throw new Error(`Failed to create symlink at ${pathCreate}`); + } + }, + + async writeAtomic(path, bytes, options = {}) { + if (options.backupTo) { + options.backupFile = options.backupTo; + } + if (options.noOverwrite) { + options.mode = "create"; + } + if (options.encoding == "utf-8") { + return IOUtils.writeUTF8(path, bytes, options); + } + return IOUtils.write(path, bytes, options); + }, + }, + + Path: { + basename(path) { + return PathUtils.filename(path); + }, + + dirname(path) { + return PathUtils.parent(path); + }, + + fromFileURI(uri) { + const url = new URL(uri); + if (url.protocol != "file:") { + throw new Error("fromFileURI expects a file URI"); + } + const path = this.normalize(decodeURIComponent(url.pathname)); + return path; + }, + + join(path, ...args) { + const platformSlash = Services.appinfo.OS == "WINNT" ? "\\" : "/"; + try { + if (args.length == 0) { + return path; + } + if (args.length == 1 && args[0].includes(platformSlash)) { + return PathUtils.joinRelative(path, ...args); + } + return PathUtils.join(path, ...args); + } catch (e) { + if (e.message.includes("NS_ERROR_FILE_UNRECOGNIZED_PATH")) { + Cu.reportError(`WARNING: ${e.message} -- update for IOUtils`); + return [path, ...args].join(platformSlash); + } + throw e; + } + }, + + // From Firefox 102 + normalize(path) { + const stack = []; + let absolute; + if (path.length >= 0 && path[0] == "/") { + absolute = true; + } else { + absolute = false; + } + path.split("/").forEach((v) => { + switch (v) { + case "": + case ".": // fallthrough + break; + case "..": + if (!stack.length) { + if (absolute) { + throw new Error( + "Path is ill-formed: attempting to go past root" + ); + } else { + stack.push(".."); + } + } else if (stack[stack.length - 1] == "..") { + stack.push(".."); + } else { + stack.pop(); + } + break; + default: + stack.push(v); + } + }); + const string = stack.join("/"); + return absolute ? `/${string}` : string; + }, + + split(path) { + if (Services.appinfo.OS == "WINNT") { + // winIsAbsolute() + const index = path.indexOf(":"); + const absolute = path.length > index + 1 && path[index + 1] == "\\"; + + return { + absolute, + winDrive: winGetDrive(path), + components: path.split("\\"), + }; + } + + return { + absolute: path.length && path[0] == "/", + components: path.split("/"), + }; + }, + + toFileURI(path) { + return PathUtils.toFileURI(path); + }, + }, +}; + +// From Fx60 ospath_win.jsm +var winGetDrive = function (path) { + if (path == null) { + throw new TypeError("path is invalid"); + } + + if (path.startsWith("\\\\")) { + // UNC path + if (path.length == 2) { + return null; + } + const index = path.indexOf("\\", 2); + if (index == -1) { + return path; + } + return path.slice(0, index); + } + // Non-UNC path + const index = path.indexOf(":"); + if (index <= 0) return null; + return path.slice(0, index + 1); +}; + +function wrapWrite(func) { + return async function () { + try { + return await func(...arguments); + } catch (e) { + if (DOMException.isInstance(e)) { + if (e.name == "NoModificationAllowedError") { + e.becauseExists = true; + } + } + throw e; + } + }; +} diff --git a/src/locale/en-US/weaver.ftl b/src/locale/en-US/weaver.ftl new file mode 100644 index 0000000..4389d37 --- /dev/null +++ b/src/locale/en-US/weaver.ftl @@ -0,0 +1,2 @@ +weaver-test = + .label = !!Weaver Test!! diff --git a/src/manifest.json b/src/manifest.json new file mode 100644 index 0000000..1cb6ce1 --- /dev/null +++ b/src/manifest.json @@ -0,0 +1,15 @@ +{ + "manifest_version": 2, + "name": "Weaver", + "version": "0.0.1", + "description": "Weaver", + "homepage_url": "https://github.com/RaymondWJang/weaver", + "applications": { + "zotero": { + "id": "weaver@example.com", + "update_url": "https://github.com/RaymondWJang/weaver/releases/download/release/update.rdf", + "strict_min_version": "6.999", + "strict_max_version": "7.0.*" + } + } +} diff --git a/src/prefs/prefs.ts b/src/prefs/prefs.ts new file mode 100644 index 0000000..37fecc5 --- /dev/null +++ b/src/prefs/prefs.ts @@ -0,0 +1,26 @@ +// Default Preferences + +// In Zotero 6, default preferences could be set by creating .js files in your plugin's defaults/preferences/ folder: +// pref("extensions.make-it-red.intensity", 100); +// These default preferences are loaded automatically at startup. While this works fine for overlay plugins, +// which require a restart, bootstrapped plugins can be installed or enabled at any time, and their default +// preferences are not read until Zotero is restarted. +// In Zotero 7, default preferences should be placed in a prefs.js file in the plugin root, following the same +// format as above. These preferences will be read when plugins are installed or enabled and then on every startup. + +// Ensure the DOM is fully loaded before executing the script +document.addEventListener("DOMContentLoaded", () => { + const checkbox = document.getElementById("example-pref") as HTMLInputElement; + + // Load the saved checkbox state from localStorage and apply it + const savedCheckboxState = localStorage.getItem("examplePrefChecked"); + if (savedCheckboxState) { + checkbox.checked = savedCheckboxState === "true"; + } + + // Add an event listener for changes to the checkbox + checkbox.addEventListener("change", () => { + // Save the new state of the checkbox to localStorage + localStorage.setItem("examplePrefChecked", checkbox.checked.toString()); + }); +}); diff --git a/src/prefs/prefs.xhtml b/src/prefs/prefs.xhtml new file mode 100644 index 0000000..df430fe --- /dev/null +++ b/src/prefs/prefs.xhtml @@ -0,0 +1,41 @@ + + + + + + + + + + + Zotero Preferences Pane + + diff --git a/src/reference_network/bootstrap.ts b/src/reference_network/bootstrap.ts deleted file mode 100644 index 46d35b8..0000000 --- a/src/reference_network/bootstrap.ts +++ /dev/null @@ -1,147 +0,0 @@ -/* eslint-disable prefer-arrow/prefer-arrow-functions, no-var, @typescript-eslint/no-unused-vars, no-caller, @typescript-eslint/explicit-module-boundary-types */ - -declare const dump: (msg: string) => void -declare const Components: any -declare const ChromeUtils: any -declare var Services: any -const { - interfaces: Ci, - results: Cr, - utils: Cu, - Constructor: CC, -} = Components - -var stylesheetID = 'reference-network-stylesheet' -var ftlID = 'reference-network-ftl' -var menuitemID = 'make-it-green-instead' -var addedElementIDs = [stylesheetID, ftlID, menuitemID] - -if (typeof Zotero == 'undefined') { - var Zotero -} - -function log(msg) { - Zotero.debug(`Reference Network: ${ msg}`) -} - -// In Zotero 6, bootstrap methods are called before Zotero is initialized, and using include.js -// to get the Zotero XPCOM service would risk breaking Zotero startup. Instead, wait for the main -// Zotero window to open and get the Zotero object from there. -// -// In Zotero 7, bootstrap methods are not called until Zotero is initialized, and the 'Zotero' is -// automatically made available. -async function waitForZotero() { - if (typeof Zotero != 'undefined') { - await Zotero.initializationPromise - return - } - - // eslint-disable-next-line @typescript-eslint/no-shadow - var { Services } = ChromeUtils.import('resource://gre/modules/Services.jsm') - var windows = Services.wm.getEnumerator('navigator:browser') - var found = false - while (windows.hasMoreElements()) { - const win = windows.getNext() - if (win.Zotero) { - Zotero = win.Zotero - found = true - break - } - } - if (!found) { - await new Promise(resolve => { - var listener = { - onOpenWindow(aWindow) { - // Wait for the window to finish loading - const domWindow = aWindow.QueryInterface(Ci.nsIInterfaceRequestor) - .getInterface(Ci.nsIDOMWindowInternal || Ci.nsIDOMWindow) - domWindow.addEventListener('load', function() { - domWindow.removeEventListener('load', arguments.callee, false) - if (domWindow.Zotero) { - Services.wm.removeListener(listener) - Zotero = domWindow.Zotero - resolve(undefined) - } - }, false) - }, - } - Services.wm.addListener(listener) - }) - } - await Zotero.initializationPromise -} - - -// Loads default preferences from prefs.js in Zotero 6 -function setDefaultPrefs(rootURI) { - var branch = Services.prefs.getDefaultBranch('') - var obj = { - pref(pref, value) { - switch (typeof value) { - case 'boolean': - branch.setBoolPref(pref, value) - break - case 'string': - branch.setStringPref(pref, value) - break - case 'number': - branch.setIntPref(pref, value) - break - default: - Zotero.logError(`Invalid type '${typeof(value)}' for pref '${pref}'`) - } - }, - } - Services.scriptloader.loadSubScript(`${rootURI }prefs.js`, obj) -} - - -export async function install() { - await waitForZotero() - - log('Installed') -} - -export async function startup({ id, version, resourceURI, rootURI = resourceURI.spec }) { - await waitForZotero() - - log('Starting') - - // 'Services' may not be available in Zotero 6 - if (typeof Services == 'undefined') { - // eslint-disable-next-line @typescript-eslint/no-shadow - var { Services } = ChromeUtils.import('resource://gre/modules/Services.jsm') - } - - // Read prefs from prefs.js when the plugin in Zotero 6 - if (Zotero.platformMajorVersion < 102) { - setDefaultPrefs(rootURI) - } - - Services.scriptloader.loadSubScript(`${rootURI }lib.js`) - Zotero.ReferenceNetwork.foo() -} - -export async function onMainWindowLoad(window) { - Zotero.ReferenceNetwork.initUI(window) -} - -export function shutdown() { - log('Shutting down') - - // Remove stylesheet - var zp = Zotero.getActiveZoteroPane() - Zotero.ReferenceNetwork.destroyUI(zp); - - Zotero.ReferenceNetwork = undefined -} - -export function uninstall() { - // `Zotero` object isn't available in `uninstall()` in Zotero 6, so log manually - if (typeof Zotero == 'undefined') { - dump('Reference Network: Uninstalled\n\n') - return - } - - log('Uninstalled') -} diff --git a/src/reference_network/chrome/locale/en-US/reference-network.properties b/src/reference_network/chrome/locale/en-US/reference-network.properties deleted file mode 100644 index 98f2112..0000000 --- a/src/reference_network/chrome/locale/en-US/reference-network.properties +++ /dev/null @@ -1 +0,0 @@ -makeItGreenInstead.label = Make It Green Instead diff --git a/src/reference_network/install.rdf b/src/reference_network/install.rdf deleted file mode 100644 index 7d0764c..0000000 --- a/src/reference_network/install.rdf +++ /dev/null @@ -1,34 +0,0 @@ - - - - - .reference-network@example.com. - Reference Network - 1.2 - true - https://zotero-download.s3.amazonaws.com/tmp/reference-network/updates-1.1.json - https://github.com/RaymondWJang/reference-network - - - en-US - Reference Network - Reference Network - - - - Raymond W. Chang - 2 - chrome://reference-network/skin/icon.png - chrome://reference-network/skin/icon64.png - true - - - - zotero@chnm.gmu.edu - 6.0 - * - - - - diff --git a/src/reference_network/lib.ts b/src/reference_network/lib.ts deleted file mode 100644 index 4ef3e21..0000000 --- a/src/reference_network/lib.ts +++ /dev/null @@ -1,49 +0,0 @@ -import { initUI, destroyUI } from "./ui/ui"; - -declare const Zotero: any -declare const Components: any -const { - // classes: Cc, - // interfaces: Ci, - utils: Cu, -} = Components - -if (Zotero.platformMajorVersion < 102) { - Cu.importGlobalProperties(['URL']) -} - -Zotero.ReferenceNetwork = new class { - log(msg) { - Zotero.debug(`Reference Network: ${ msg}`) - } - - foo() { - // Global properties are imported above in Zotero 6 and included automatically in - // Zotero 7 - const host = new URL('https://foo.com/path').host - this.log(`Host is ${host}`) - - this.log(`Intensity is ${Zotero.Prefs.get('extensions.reference-network.intensity', true)}`) - - this.log(Zotero.getMainWindow().speechSynthesis) - } - - toggleGreen(enabled) { - const docElem = Zotero.getMainWindow().document.documentElement - // Element#toggleAttribute() is not supported in Zotero 6 - if (enabled) { - docElem.setAttribute('data-green-instead', 'true') - } - else { - docElem.removeAttribute('data-green-instead') - } - } - - initUI(){ - initUI(); - } - - destroyUI(zp){ - destroyUI(zp); - } -} diff --git a/src/reference_network/locale/en-US/reference-network.ftl b/src/reference_network/locale/en-US/reference-network.ftl deleted file mode 100644 index b1506a0..0000000 --- a/src/reference_network/locale/en-US/reference-network.ftl +++ /dev/null @@ -1,2 +0,0 @@ -make-it-green-instead = - .label = Make It Green Instead diff --git a/src/reference_network/manifest.json b/src/reference_network/manifest.json deleted file mode 100644 index a25ad32..0000000 --- a/src/reference_network/manifest.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "manifest_version": 2, - "name": "Reference Network", - "version": "0.0.1", - "description": "Reference Network", - "applications": { - "zotero": { - "id": "reference-network@example.com", - "update_url": "https://github.com/RaymondWJang/reference-network/releases/download/release/update.rdf", - "strict_min_version": "6.999", - "strict_max_version": "7.0.*" - } - } -} diff --git a/src/reference_network/prefs.js b/src/reference_network/prefs.js deleted file mode 100644 index c39c553..0000000 --- a/src/reference_network/prefs.js +++ /dev/null @@ -1 +0,0 @@ -pref("extensions.reference-network.intensity", 100); diff --git a/src/reference_network/style.css b/src/reference_network/style.css deleted file mode 100644 index 57e6e0a..0000000 --- a/src/reference_network/style.css +++ /dev/null @@ -1,7 +0,0 @@ -.row { - color: red; -} - -window[data-green-instead] .row { - color: green; -} diff --git a/src/reference_network/ui/ui.ts b/src/reference_network/ui/ui.ts deleted file mode 100644 index 0bc7db5..0000000 --- a/src/reference_network/ui/ui.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { addContextMenu } from "./menus"; - -export const initUI = (window) => { - addContextMenu(window); -} - -// Remove any added items from the DOM -export const destroyUI = (zp) => { - // if (zp) { - // for (const id of addedElementIDs) { - // // ?. (null coalescing operator) not available in Zotero 6 - // const elem = zp.document.getElementById(id) - // if (elem) elem.remove() - // } - // } -} diff --git a/src/types/global.d.ts b/src/types/global.d.ts new file mode 100644 index 0000000..1e097f4 --- /dev/null +++ b/src/types/global.d.ts @@ -0,0 +1,18 @@ +import "zotero-types"; + +declare const Zotero: _ZoteroTypes.Zotero; +// declare const rootURI: string; +declare global { + interface Window { + ZoteroPane?: _ZoteroTypes.ZoteroPane; + MozXULElement?: any; + } + interface Document { + createXULElement( + tagName: T + ): HTMLElementTagNameMap[T]; + } + interface HTMLElementTagNameMap { + menuitem: HTMLElement; + } +} diff --git a/src/reference_network/ui/menus.ts b/src/ui/menus.ts similarity index 100% rename from src/reference_network/ui/menus.ts rename to src/ui/menus.ts diff --git a/src/ui/ui.ts b/src/ui/ui.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/weaver.ts b/src/weaver.ts new file mode 100644 index 0000000..cd14c31 --- /dev/null +++ b/src/weaver.ts @@ -0,0 +1,219 @@ +import { DatabaseManager } from "./database/databaseManager"; +import { ApiManager } from "./database/apiManager"; +import { queries } from "./database/queries"; + +// Define an interface for initialization options +interface InitOptions { + id: string; + version: string; + rootURI: string; +} + +export class Weaver { + // I guess this is the .h of the __init__ method in Python 😭 + private id: string | null = null; + private version: string | null = null; + private rootURI: string | null = null; + private initialized: boolean = false; + private dbManager: DatabaseManager; + private apiManager: ApiManager; + + constructor() { + // I guess this is the .c of the __init__ method in Python 😭 + this.dbManager = new DatabaseManager(Zotero.DataDirectory.dir); + this.apiManager = new ApiManager( + "https://api.openalex.org/", + "raymond.w.jang@gmail.com" + ); + } + + private log(msg: string): void { + Zotero.log(msg, "warning", "Weaver: weaver.ts"); + } + + private error(msg: string, e: Error): void { + Zotero.logError(e); + } + + async install(): Promise { + await this.dbManager.initializeDatabase(); + } + + async init(options: InitOptions): Promise { + this.log("Loading Weaver: starting..."); + if (this.initialized) { + throw new Error("Weaver is already running"); + } + this.id = options.id; + this.version = options.version; + this.rootURI = options.rootURI; + + // from here, it must be initiated by a user action + try { + const libraryID = 1; + this.log("point 1"); + const ZoteroIdDoi = await this.grabAllDOIs(libraryID); + this.log("point 2"); + + const dois = ZoteroIdDoi.map((row) => row.doi); + const data = await this.fetchAndParseCitations(dois); + // cited = await fetchCitedBy(fetchCitedBy); + data["idDoiPair"] = ZoteroIdDoi; + this.log("point 3"); + + await this.populateItemsTable(data); + } catch (error) { + this.error("Failed to grab all DOIs", error); + } + + this.initialized = true; + } + + private async populateItemsTable(data: object): Promise { + // upsert into items table + const referencesDOIs = this.getUniqueElements(data["referencedWorks"]); + const relatedDOIs = this.getUniqueElements(data["realatedWorks"]); + + // combine the sets + const allDOIs = new Set([...referencesDOIs, ...relatedDOIs]); + + for (const doi of allDOIs) { + await this.dbManager.upsert( + "ITEMS", + `zotero_item_id, openalex_id, doi`, + `${null}, ${null}, ${doi}`, + `doi = ${doi}` + ); + } + for (const idDoiPair of data["idDoiPair"]) { + await this.dbManager.upsert( + "ITEMS", + `zotero_item_id, openalex_id, doi`, + `${idDoiPair.itemID}, ${null}, ${idDoiPair.doi}`, + `doi = ${idDoiPair.doi}` + ); + } + } + + private getUniqueElements(record: Record): Set { + // Extract keys + const keys = Object.keys(record); + + // Flatten values + const values = Object.values(record).flat(); + + // Combine keys and values + const combined = keys.concat(values); + + // Create a Set to automatically remove duplicates + return new Set(combined); + } + + private async grabAllDOIs(libraryID: number = 1): Promise { + this.log("Grabbing all DOI's from Zotero..."); + const query = queries.getDOIs(libraryID); + try { + const idDOI = await Zotero.DB.queryAsync(query); + this.log( + `DOI's grabbed: ${idDOI.length}\nexamples: ${idDOI.slice(0, 5)}` + ); + return idDOI; + } catch (e) { + this.error(`Failed to grab DOIs: `, e); + throw e; + } + } + + private async fetchAndParseCitations(dois: string[]): Promise { + this.log("Fetching and parsing citations..."); + const referencedWorks: Record = {}; + const relatedWorks: Record = {}; + const citedByURL: Record = {}; + + try { + // test mode + const testDOIs = dois.slice(0, 5); + const fetchedData = await this.apiManager.fetchPublications(testDOIs, 25); + for (const batch of fetchedData) { + batch.results.forEach((result: any) => { + const id = this.getLastSlashComponent(result.id); + referencedWorks[id] = result.referenced_works.map((url: string) => + this.getLastSlashComponent(url) + ); + relatedWorks[id] = result.related_works.map((url: string) => + this.getLastSlashComponent(url) + ); + citedByURL[id] = result.cited_by_api_url; + }); + } + this.log(`References: ${JSON.stringify(referencedWorks)}`); + } catch (e) { + this.error("Failed to fetch DOIs", e); + } + return { + referencedWorks: referencedWorks, + relatedWorks: relatedWorks, + citedByURL: citedByURL, + }; + } + + private async fetchCitedBy(citedByURL: string[]): Promise { + const citedBy: Record = {}; + try { + for (const [id, url] of Object.entries(citedByURL)) { + const response = await this.apiManager.fetchCitedBy(id, url); + citedBy[id] = response.results.map((result: { id: string }) => + this.getLastSlashComponent(result.id) + ); + } + this.log(`Cited by: ${JSON.stringify(citedBy)}`); + } catch (e) { + this.error("Failed to fetch cited by", e); + } + } + + private getLastSlashComponent(url: string): string { + return url.substring(url.lastIndexOf("/") + 1); + } + + public addToWindow(window: Window) { + const doc = window.document; + + // Use Fluent for localization + window.MozXULElement.insertFTLIfNeeded( + this.rootURI + "locale/en-US/weaver.ftl" + ); + this.log(this.rootURI + "locale/en-US/weaver.ftl"); + + // Add menu option + if (window.MozXULElement && "createXULElement" in window.document) { + const menuitem = doc.createXULElement("menuitem"); + menuitem.id = "weaver-test-id"; + menuitem.setAttribute("type", "checkbox"); + menuitem.setAttribute("data-l10n-id", "weaver-test"); + menuitem.addEventListener("command", () => { + const inputElement = menuitem as HTMLInputElement; + this.menuToggleTest(window, inputElement.checked); + }); + const menuViewPopup = doc.getElementById("menu_viewPopup"); + if (menuViewPopup) { + menuViewPopup.appendChild(menuitem); + } + // this.storeAddedElement(menuitem); + } + } + + private menuToggleTest(a, b) { + Zotero.log("Menu has been checked!"); + } + + public addToAllWindows(): void { + const windows: Window[] = Zotero.getMainWindows(); + for (const win of windows) { + if (!win.ZoteroPane) continue; + this.addToWindow(win); + } + } +} + +export const weaver = new Weaver(); diff --git a/tsconfig.json b/tsconfig.json index 96dc175..414cd1c 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -10,20 +10,17 @@ "preserveConstEnums": false, "sourceMap": false, "downlevelIteration": true, - "lib": [ "es2017", "dom" ], - "typeRoots": [ - "./typings", - "./node_modules/@types" - ] + "lib": ["es2017", "dom"], + "typeRoots": ["./node_modules/@types"], + "emitDecoratorMetadata": true, + "experimentalDecorators": true }, - "include": [ "*.ts", "chrome/content", "typing", "node_modules/zotero-types", - "src/reference_network/bootstrap.ts", - "src/reference_network/lib.ts", - "src/**/*.ts" + // "lib": ["es6"], // TypeORM: You may also need to enable es6 in the lib section of compiler options, or install es6-shim from @types. + "include": [ + "*.ts", + "node_modules/zotero-types", + "src/**/*.ts", + "src/types/global.d.ts" ], - "exclude": [ - "node_modules", - "**/*.spec.ts", - "typings" - ] + "exclude": ["node_modules", "**/*.spec.ts"] }