From a7dad708ac58fccc4bef70d0d09ba3f3b71c3d77 Mon Sep 17 00:00:00 2001 From: terwer Date: Fri, 15 Mar 2024 11:57:43 +0800 Subject: [PATCH 01/34] feat: add events support --- .../src/core/UniversalPicGo.ts | 18 +++++++++++--- .../Universal-PicGo-Core/src/types/index.d.ts | 24 +++++++++++++++++++ .../picgo-plugin-app/src/pages/PicGoIndex.vue | 2 ++ 3 files changed, 41 insertions(+), 3 deletions(-) create mode 100644 libs/Universal-PicGo-Core/src/types/index.d.ts diff --git a/libs/Universal-PicGo-Core/src/core/UniversalPicGo.ts b/libs/Universal-PicGo-Core/src/core/UniversalPicGo.ts index 7df1ef8..870bd55 100644 --- a/libs/Universal-PicGo-Core/src/core/UniversalPicGo.ts +++ b/libs/Universal-PicGo-Core/src/core/UniversalPicGo.ts @@ -9,19 +9,31 @@ import { simpleLogger } from "zhi-lib-base" import { EventEmitter } from "../utils/nodePolyfill" +import { IPicGo } from "../types" /* - * 思源笔记内部 PicGO 对象定义 + * 通用 PicGO 对象定义 * * @version 1.6.0 * @since 1.4.5 */ -class UniversalPicGo extends EventEmitter { +class UniversalPicGo extends EventEmitter implements IPicGo { private logger = simpleLogger("universal-picgo-api", "universal-picgo", false) + configPath: string + baseDir!: string - constructor() { + constructor(configPath = "") { super() + this.configPath = configPath this.logger.info("UniversalPicGo inited") + + this.on("testEvent", () => { + this.logger.info("testEvent triggered") + }) + } + + public test() { + this.emit("testEvent") } } diff --git a/libs/Universal-PicGo-Core/src/types/index.d.ts b/libs/Universal-PicGo-Core/src/types/index.d.ts new file mode 100644 index 0000000..e04f7f5 --- /dev/null +++ b/libs/Universal-PicGo-Core/src/types/index.d.ts @@ -0,0 +1,24 @@ +/* + * GNU GENERAL PUBLIC LICENSE + * Version 3, 29 June 2007 + * + * Copyright (C) 2024 Terwer, Inc. + * Everyone is permitted to copy and distribute verbatim copies + * of this license document, but changing it is not allowed. + */ + + +import { EventEmitter } from '../utils/nodePolyfill'; + +export interface IPicGo extends EventEmitter { + /** + * picgo configPath + * + * if do not provide, then it will use default configPath + */ + configPath: string + /** + * the picgo configPath's baseDir + */ + baseDir: string +} \ No newline at end of file diff --git a/packages/picgo-plugin-app/src/pages/PicGoIndex.vue b/packages/picgo-plugin-app/src/pages/PicGoIndex.vue index 17cdb05..37ae900 100644 --- a/packages/picgo-plugin-app/src/pages/PicGoIndex.vue +++ b/packages/picgo-plugin-app/src/pages/PicGoIndex.vue @@ -16,6 +16,8 @@ const logger = createAppLogger("picgo-index") const handleTest = () => { const picgo = new UniversalPicGo() logger.debug("picgo =>", picgo) + + picgo.test() } From f09fb4173d6060595ee3b0124cf7af58b3588428 Mon Sep 17 00:00:00 2001 From: terwer Date: Fri, 15 Mar 2024 16:23:09 +0800 Subject: [PATCH 02/34] feat: basic picgo flow --- libs/Universal-PicGo-Core/.eslintrc.cjs | 22 +- .../src/core/Lifecycle.ts | 17 + .../src/core/UniversalPicGo.ts | 186 ++++++++- .../src/lib/LifecyclePlugins.ts | 47 +++ .../src/lib/PluginHandler.ts | 38 ++ .../src/lib/PluginLoader.ts | 39 ++ .../Universal-PicGo-Core/src/types/index.d.ts | 391 +++++++++++++++++- libs/Universal-PicGo-Core/src/utils/enums.ts | 24 ++ .../src/utils/getClipboardImage.ts | 17 + .../src/utils/nodePolyfill.ts | 3 +- libs/Universal-PicGo-Core/tsconfig.json | 6 +- libs/Universal-PicGo-Core/vite.config.ts | 2 +- .../picgo-plugin-app/src/pages/PicGoIndex.vue | 2 +- 13 files changed, 775 insertions(+), 19 deletions(-) create mode 100644 libs/Universal-PicGo-Core/src/core/Lifecycle.ts create mode 100644 libs/Universal-PicGo-Core/src/lib/LifecyclePlugins.ts create mode 100644 libs/Universal-PicGo-Core/src/lib/PluginHandler.ts create mode 100644 libs/Universal-PicGo-Core/src/lib/PluginLoader.ts create mode 100644 libs/Universal-PicGo-Core/src/utils/enums.ts create mode 100644 libs/Universal-PicGo-Core/src/utils/getClipboardImage.ts diff --git a/libs/Universal-PicGo-Core/.eslintrc.cjs b/libs/Universal-PicGo-Core/.eslintrc.cjs index a1993b7..41f5589 100644 --- a/libs/Universal-PicGo-Core/.eslintrc.cjs +++ b/libs/Universal-PicGo-Core/.eslintrc.cjs @@ -1,4 +1,22 @@ module.exports = { - root: true, - extends: ["./node_modules/@terwer/eslint-config-custom/typescript/index.cjs"], + extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended", "turbo", "prettier"], + + parser: "@typescript-eslint/parser", + + plugins: ["@typescript-eslint", "prettier"], + + rules: { + // Note: you must disable the base rule as it can report incorrect errors + semi: "off", + quotes: "off", + "no-undef": "off", + "@typescript-eslint/no-var-requires": "off", + "@typescript-eslint/no-this-alias": "off", + "@typescript-eslint/no-non-null-assertion": "off", + "@typescript-eslint/no-unused-vars": "off", + "@typescript-eslint/no-explicit-any": "off", + "@typescript-eslint/no-empty-function": "off", + "turbo/no-undeclared-env-vars": "off", + "prettier/prettier": "error", + }, } diff --git a/libs/Universal-PicGo-Core/src/core/Lifecycle.ts b/libs/Universal-PicGo-Core/src/core/Lifecycle.ts new file mode 100644 index 0000000..ec5a3dc --- /dev/null +++ b/libs/Universal-PicGo-Core/src/core/Lifecycle.ts @@ -0,0 +1,17 @@ +/* + * GNU GENERAL PUBLIC LICENSE + * Version 3, 29 June 2007 + * + * Copyright (C) 2024 Terwer, Inc. + * Everyone is permitted to copy and distribute verbatim copies + * of this license document, but changing it is not allowed. + */ + +import { EventEmitter } from "../utils/nodePolyfill" +import { IPicGo } from "../types" + +export class Lifecycle extends EventEmitter { + async start(input: any[]): Promise { + throw new Error("Lifecycle.start is not implemented") + } +} diff --git a/libs/Universal-PicGo-Core/src/core/UniversalPicGo.ts b/libs/Universal-PicGo-Core/src/core/UniversalPicGo.ts index 870bd55..564debb 100644 --- a/libs/Universal-PicGo-Core/src/core/UniversalPicGo.ts +++ b/libs/Universal-PicGo-Core/src/core/UniversalPicGo.ts @@ -7,9 +7,26 @@ * of this license document, but changing it is not allowed. */ -import { simpleLogger } from "zhi-lib-base" +import { ILogger, simpleLogger } from "zhi-lib-base" import { EventEmitter } from "../utils/nodePolyfill" -import { IPicGo } from "../types" +import { + IConfig, + IHelper, + II18nManager, + IImgInfo, + IPicGo, + IPicGoPlugin, + IPicGoPluginInterface, + IPluginLoader, + IStringKeyMap, +} from "../types" +import { Lifecycle } from "./Lifecycle" +import { PluginLoader } from "../lib/PluginLoader" +import { LifecyclePlugins } from "../lib/LifecyclePlugins" +import { PluginHandler } from "../lib/PluginHandler" +import _ from "lodash-es" +import getClipboardImage from "../utils/getClipboardImage" +import { IBuildInEvent } from "../utils/enums" /* * 通用 PicGO 对象定义 @@ -18,23 +35,172 @@ import { IPicGo } from "../types" * @since 1.4.5 */ class UniversalPicGo extends EventEmitter implements IPicGo { - private logger = simpleLogger("universal-picgo-api", "universal-picgo", false) + private _config!: IConfig + private lifecycle!: Lifecycle + private _pluginLoader!: PluginLoader configPath: string baseDir!: string + helper!: IHelper + log: ILogger + // cmd: Commander + output: IImgInfo[] + input: any[] + pluginHandler: PluginHandler + i18n!: II18nManager + VERSION: string = process.env.PICGO_VERSION ?? "unknown" + // GUI_VERSION?: string - constructor(configPath = "") { + get pluginLoader(): IPluginLoader { + return this._pluginLoader + } + + constructor(configPath = "", isDev?: boolean) { super() + this.log = simpleLogger("universal-picgo-api", "universal-picgo", isDev ?? false) this.configPath = configPath - this.logger.info("UniversalPicGo inited") + this.output = [] + this.input = [] + this.helper = { + transformer: new LifecyclePlugins("transformer"), + uploader: new LifecyclePlugins("uploader"), + beforeTransformPlugins: new LifecyclePlugins("beforeTransformPlugins"), + beforeUploadPlugins: new LifecyclePlugins("beforeUploadPlugins"), + afterUploadPlugins: new LifecyclePlugins("afterUploadPlugins"), + } + this.initConfigPath() + // this.cmd = new Commander(this) + this.pluginHandler = new PluginHandler(this) + this.initConfig() + this.init() + + this.log.info("UniversalPicGo inited") + } + + /** + * easily mannually load a plugin + * if provide plugin name, will register plugin by name + * or just instantiate a plugin + */ + use(plugin: IPicGoPlugin, name?: string): IPicGoPluginInterface { + if (name) { + this.pluginLoader.registerPlugin(name, plugin) + return this.pluginLoader.getPlugin(name)! + } else { + const pluginInstance = plugin(this) + return pluginInstance + } + } + + // registerCommands(): void { + // if (this.configPath !== "") { + // this.cmd.init() + // this.cmd.loadCommands() + // } + // } - this.on("testEvent", () => { - this.logger.info("testEvent triggered") - }) + getConfig(name?: string): T { + if (!name) { + return this._config as unknown as T + } else { + return _.get(this._config, name) + } } - public test() { - this.emit("testEvent") + saveConfig(config: IStringKeyMap): void { + // if (!isInputConfigValid(config)) { + // this.log.warn("the format of config is invalid, please provide object") + // return + // } + // this.setConfig(config) + // this.db.saveConfig(config) } + + removeConfig(key: string, propName: string): void { + // if (!key || !propName) return + // if (isConfigKeyInBlackList(key)) { + // this.log.warn(`the config.${key} can't be removed`) + // return + // } + // this.unsetConfig(key, propName) + // this.db.unset(key, propName) + } + + setConfig(config: IStringKeyMap): void { + // if (!isInputConfigValid(config)) { + // this.log.warn("the format of config is invalid, please provide object") + // return + // } + // Object.keys(config).forEach((name: string) => { + // if (isConfigKeyInBlackList(name)) { + // this.log.warn(`the config.${name} can't be modified`) + // // eslint-disable-next-line @typescript-eslint/no-dynamic-delete + // delete config[name] + // } + // set(this._config, name, config[name]) + // eventBus.emit(IBusEvent.CONFIG_CHANGE, { + // configName: name, + // value: config[name], + // }) + // }) + } + + unsetConfig(key: string, propName: string): void { + // if (!key || !propName) return + // if (isConfigKeyInBlackList(key)) { + // this.log.warn(`the config.${key} can't be unset`) + // return + // } + // unset(this.getConfig(key), propName) + } + + async upload(input?: any[]): Promise { + if (this.configPath === "") { + this.log.error("The configuration file only supports JSON format.") + return [] + } + // upload from clipboard + if (input === undefined || input.length === 0) { + try { + const { imgPath, shouldKeepAfterUploading } = await getClipboardImage(this) + if (imgPath === "no image") { + throw new Error("image not found in clipboard") + } else { + this.once(IBuildInEvent.FAILED, () => { + if (!shouldKeepAfterUploading) { + // 删除 picgo 生成的图片文件,例如 `~/.picgo/20200621205720.png` + // fs.remove(imgPath).catch((e) => { + // this.log.error(e) + // }) + } + }) + this.once("finished", () => { + if (!shouldKeepAfterUploading) { + // fs.remove(imgPath).catch((e) => { + // this.log.error(e) + // }) + } + }) + const { output } = await this.lifecycle.start([imgPath]) + return output + } + } catch (e) { + this.emit(IBuildInEvent.FAILED, e) + throw e + } + } else { + // upload from path + const { output } = await this.lifecycle.start(input) + return output + } + } + + // =================================================================================================================== + + private initConfigPath(): void {} + + private initConfig(): void {} + + private init(): void {} } export { UniversalPicGo } diff --git a/libs/Universal-PicGo-Core/src/lib/LifecyclePlugins.ts b/libs/Universal-PicGo-Core/src/lib/LifecyclePlugins.ts new file mode 100644 index 0000000..7f999af --- /dev/null +++ b/libs/Universal-PicGo-Core/src/lib/LifecyclePlugins.ts @@ -0,0 +1,47 @@ +/* + * GNU GENERAL PUBLIC LICENSE + * Version 3, 29 June 2007 + * + * Copyright (C) 2024 Terwer, Inc. + * Everyone is permitted to copy and distribute verbatim copies + * of this license document, but changing it is not allowed. + */ + +import { ILifecyclePlugins, IPlugin } from "../types" + +export class LifecyclePlugins implements ILifecyclePlugins { + static currentPlugin: string | null + private readonly list: Map + private readonly pluginIdMap: Map + private readonly name: string + + constructor(name: string) { + this.name = name + this.list = new Map() + this.pluginIdMap = new Map() + } + + get(id: string): IPlugin | undefined { + return undefined + } + + getIdList(): string[] { + return [] + } + + getList(): IPlugin[] { + return [] + } + + getName(): string { + return "" + } + + register(id: string, plugin: IPlugin): void { + return + } + + unregister(id: string): void { + return + } +} diff --git a/libs/Universal-PicGo-Core/src/lib/PluginHandler.ts b/libs/Universal-PicGo-Core/src/lib/PluginHandler.ts new file mode 100644 index 0000000..2ebfb1d --- /dev/null +++ b/libs/Universal-PicGo-Core/src/lib/PluginHandler.ts @@ -0,0 +1,38 @@ +/* + * GNU GENERAL PUBLIC LICENSE + * Version 3, 29 June 2007 + * + * Copyright (C) 2024 Terwer, Inc. + * Everyone is permitted to copy and distribute verbatim copies + * of this license document, but changing it is not allowed. + */ + +import { IPicGo, IPluginHandler, IPluginHandlerOptions, IPluginHandlerResult, IProcessEnv } from "../types" + +export class PluginHandler implements IPluginHandler { + // Thanks to feflow -> https://github.com/feflow/feflow/blob/master/lib/internal/install/plugin.js + private readonly ctx: IPicGo + constructor(ctx: IPicGo) { + this.ctx = ctx + } + + install( + plugins: string[], + options: IPluginHandlerOptions, + env: IProcessEnv | undefined + ): Promise> { + throw new Error("Method not implemented") + } + + uninstall(plugins: string[]): Promise> { + throw new Error("Method not implemented") + } + + update( + plugins: string[], + options: IPluginHandlerOptions, + env: IProcessEnv | undefined + ): Promise> { + throw new Error("Method not implemented") + } +} diff --git a/libs/Universal-PicGo-Core/src/lib/PluginLoader.ts b/libs/Universal-PicGo-Core/src/lib/PluginLoader.ts new file mode 100644 index 0000000..628eb94 --- /dev/null +++ b/libs/Universal-PicGo-Core/src/lib/PluginLoader.ts @@ -0,0 +1,39 @@ +/* + * GNU GENERAL PUBLIC LICENSE + * Version 3, 29 June 2007 + * + * Copyright (C) 2024 Terwer, Inc. + * Everyone is permitted to copy and distribute verbatim copies + * of this license document, but changing it is not allowed. + */ + +import { IPicGoPlugin, IPicGoPluginInterface, IPluginLoader } from "../types" + +/** + * Local plugin loader, file system is required + */ +export class PluginLoader implements IPluginLoader { + getFullList(): string[] { + return [] + } + + getList(): string[] { + return [] + } + + getPlugin(name: string): IPicGoPluginInterface | undefined { + return undefined + } + + hasPlugin(name: string): boolean { + return false + } + + registerPlugin(name: string, plugin: IPicGoPlugin | undefined): void { + return + } + + unregisterPlugin(name: string): void { + return + } +} diff --git a/libs/Universal-PicGo-Core/src/types/index.d.ts b/libs/Universal-PicGo-Core/src/types/index.d.ts index e04f7f5..5b31763 100644 --- a/libs/Universal-PicGo-Core/src/types/index.d.ts +++ b/libs/Universal-PicGo-Core/src/types/index.d.ts @@ -8,7 +8,8 @@ */ -import { EventEmitter } from '../utils/nodePolyfill'; +import { EventEmitter, Buffer } from "../utils/nodePolyfill" +import { ILogger } from "zhi-lib-base" export interface IPicGo extends EventEmitter { /** @@ -21,4 +22,390 @@ export interface IPicGo extends EventEmitter { * the picgo configPath's baseDir */ baseDir: string -} \ No newline at end of file + /** + * picgo logger factory + */ + log: ILogger + /** + * picgo commander, for cli + */ + // cmd: ICommander + /** + * after transformer, the input will be output + */ + output: IImgInfo[] + /** + * the origin input + */ + input: any[] + /** + * register\unregister\get picgo's plugin + */ + pluginLoader: IPluginLoader + /** + * install\uninstall\update picgo's plugin via npm + */ + pluginHandler: IPluginHandler + /** + * plugin system core part transformer\uploader\beforeTransformPlugins... + */ + helper: IHelper + /** + * picgo-core version + */ + VERSION: string + /** + * electron picgo's version + */ + // GUI_VERSION?: string + i18n: II18nManager + + /** + * get picgo config + */ + getConfig: (name?: string) => T + /** + * save picgo config to configPath + */ + saveConfig: (config: IStringKeyMap) => void + /** + * remove some [propName] in config[key] && save config to configPath + */ + removeConfig: (key: string, propName: string) => void + /** + * set picgo config to ctx && will not save to configPath + */ + setConfig: (config: IStringKeyMap) => void + /** + * unset picgo config to ctx && will not save to configPath + */ + unsetConfig: (key: string, propName: string) => void + /** + * upload gogogo + */ + upload: (input?: any[]) => Promise +} + +export type Nullable = T | null +export type Undefinable = T | undefined + +export interface IStringKeyMap { + [key: string]: T extends T ? T : any +} + +/** SM.MS 图床配置项 */ +export interface ISmmsConfig { + token: string + backupDomain?: string +} +/** 七牛云图床配置项 */ +export interface IQiniuConfig { + accessKey: string + secretKey: string + /** 存储空间名 */ + bucket: string + /** 自定义域名 */ + url: string + /** 存储区域编号 */ + area: 'z0' | 'z1' | 'z2' | 'na0' | 'as0' | string + /** 网址后缀,比如使用 `?imageslim` 可进行[图片瘦身](https://developer.qiniu.com/dora/api/1271/image-thin-body-imageslim) */ + options: string + /** 自定义存储路径,比如 `img/` */ + path: string +} +/** 又拍云图床配置项 */ +export interface IUpyunConfig { + /** 存储空间名,及你的服务名 */ + bucket: string + /** 操作员 */ + operator: string + /** 密码 */ + password: string + /** 针对图片的一些后缀处理参数 */ + options: string + /** 自定义存储路径,比如 `img/` */ + path: string + /** 加速域名,注意要加 `http://` 或者 `https://` */ + url: string +} +/** 腾讯云图床配置项 */ +export interface ITcyunConfig { + secretId: string + secretKey: string + /** 存储桶名,v4 和 v5 版本不一样 */ + bucket: string + appId: string + /** 存储区域,例如 ap-beijing-1 */ + area: string + /** 请求的 ENDPOINT,设置后 `area` 字段会失效 */ + endpoint: string + /** 自定义存储路径,比如 img/ */ + path: string + /** 自定义域名,注意要加 `http://` 或者 `https://` */ + customUrl: string + /** COS 版本,v4 或者 v5 */ + version: 'v5' | 'v4' + /** 针对图片的一些后缀处理参数 PicGo 2.4.0+ PicGo-Core 1.5.0+ */ + options: string + /** 是否支持极智压缩 */ + slim: boolean +} +/** GitHub 图床配置项 */ +export interface IGithubConfig { + /** 仓库名,格式是 `username/reponame` */ + repo: string + /** github token */ + token: string + /** 自定义存储路径,比如 `img/` */ + path: string + /** 自定义域名,注意要加 `http://` 或者 `https://` */ + customUrl: string + /** 分支名,默认是 `main` */ + branch: string +} +/** 阿里云图床配置项 */ +export interface IAliyunConfig { + accessKeyId: string + accessKeySecret: string + /** 存储空间名 */ + bucket: string + /** 存储区域代号 */ + area: string + /** 自定义存储路径 */ + path: string + /** 自定义域名,注意要加 `http://` 或者 `https://` */ + customUrl: string + /** 针对图片的一些后缀处理参数 PicGo 2.2.0+ PicGo-Core 1.4.0+ */ + options: string +} +/** Imgur 图床配置项 */ +export interface IImgurConfig { + /** imgur 的 `clientId` */ + clientId: string + /** 代理地址,仅支持 http 代理 */ + proxy: string +} + +/** PicGo 配置文件类型定义 */ +export interface IConfig { + picBed: { + uploader: string + current?: string + smms?: ISmmsConfig + qiniu?: IQiniuConfig + upyun?: IUpyunConfig + tcyun?: ITcyunConfig + github?: IGithubConfig + aliyun?: IAliyunConfig + imgur?: IImgurConfig + transformer?: string + /** for uploader */ + proxy?: string + [others: string]: any + } + picgoPlugins: { + [pluginName: string]: boolean + } + debug?: boolean + silent?: boolean + settings?: { + logLevel?: string[] + logPath?: string + /** for npm */ + npmRegistry?: string + /** for npm */ + npmProxy?: string + [others: string]: any + } + [configOptions: string]: any +} + +export interface ILocale { + [key: string]: any +} + +/** + * for uploading image info + */ +export interface IImgInfo { + buffer?: Buffer + base64Image?: string + fileName?: string + width?: number + height?: number + extname?: string + imgUrl?: string + [propName: string]: any +} + +export interface IPluginLoader { + /** + * register [local plugin] or [provided plugin] + * + * if the second param (plugin) is provided + * + * then picgo will register this plugin and enable it by default + * + * but picgo won't write any config to config file + * + * you should use ctx.setConfig to change the config context + */ + registerPlugin: (name: string, plugin?: IPicGoPlugin) => void + unregisterPlugin: (name: string) => void + getPlugin: (name: string) => IPicGoPluginInterface | undefined + /** + * get enabled plugin list + */ + getList: () => string[] + /** + * get all plugin list (enabled or not) + */ + getFullList: () => string[] + hasPlugin: (name: string) => boolean +} + +/** + * for picgo npm plugins + */ +export type IPicGoPlugin = (ctx: IPicGo) => IPicGoPluginInterface + +/** + * interfaces for PicGo plugin + */ +export interface IPicGoPluginInterface { + /** + * since PicGo-Core v1.5, register will inject ctx + */ + register: (ctx: IPicGo) => void + /** + * this plugin's config + */ + config?: (ctx: IPicGo) => IPluginConfig[] + /** + * register uploader name + */ + uploader?: string + /** + * register transformer name + */ + transformer?: string + /** + * for picgo gui plugins + */ + // guiMenu?: (ctx: IPicGo) => IGuiMenuItem[] + + /** + * for picgo gui plugins + * short key -> command + */ + // commands?: (ctx: IPicGo) => ICommandItem[] + + [propName: string]: any +} + +/** + * for plugin config + */ +export interface IPluginConfig { + name: string + type: string + required: boolean + default?: any + alias?: string + message?: string + // prefix?: string // for cli options + [propName: string]: any +} + +export interface IPluginHandler { + install: (plugins: string[], options: IPluginHandlerOptions, env?: IProcessEnv) => Promise> + update: (plugins: string[], options: IPluginHandlerOptions, env?: IProcessEnv) => Promise> + uninstall: (plugins: string[]) => Promise> +} + +export interface IPluginHandlerResult { + success: T + body: T extends true ? string[] : string +} + +export interface IPluginHandlerOptions { + npmProxy?: string + npmRegistry?: string +} + +/** + * for clipboard image + */ +export interface IClipboardImage { + imgPath: string + /** + * if the path is generate by picgo -> false + * if the path is a real file path in system -> true + */ + shouldKeepAfterUploading: boolean +} + +/** + * for install command environment variable + */ +export interface IProcessEnv { + [propName: string]: Undefinable +} + +/** + * for an uploader/transformer/beforeTransformHandler/beforeUploadHandler/afterUploadHandler + */ +export interface IPlugin { + handle: ((ctx: IPicGo) => Promise) | ((ctx: IPicGo) => void) + /** The name of this handler */ + name?: string + /** The config of this handler */ + config?: (ctx: IPicGo) => IPluginConfig[] + [propName: string]: any +} + +/** + * for lifecycle plugins + */ +export interface ILifecyclePlugins { + register: (id: string, plugin: IPlugin) => void + unregister: (id: string) => void + getName: () => string + get: (id: string) => IPlugin | undefined + getList: () => IPlugin[] + getIdList: () => string[] +} + +export interface IHelper { + transformer: ILifecyclePlugins + uploader: ILifecyclePlugins + beforeTransformPlugins: ILifecyclePlugins + beforeUploadPlugins: ILifecyclePlugins + afterUploadPlugins: ILifecyclePlugins +} + +export interface II18nManager { + /** + * translate text + */ + translate: (key: T, args?: IStringKeyMap) => string + /** + * add locale to current i18n language + * default locale list + * - zh-CN + * - en + */ + addLocale: (language: string, locales: ILocale) => boolean + /** + * set current language + */ + setLanguage: (language: string) => void + /** + * dynamic add new language & locales + */ + addLanguage: (language: string, locales: ILocale) => boolean + /** + * get language list + */ + getLanguageList: () => string[] +} diff --git a/libs/Universal-PicGo-Core/src/utils/enums.ts b/libs/Universal-PicGo-Core/src/utils/enums.ts new file mode 100644 index 0000000..e979401 --- /dev/null +++ b/libs/Universal-PicGo-Core/src/utils/enums.ts @@ -0,0 +1,24 @@ +/* + * GNU GENERAL PUBLIC LICENSE + * Version 3, 29 June 2007 + * + * Copyright (C) 2024 Terwer, Inc. + * Everyone is permitted to copy and distribute verbatim copies + * of this license document, but changing it is not allowed. + */ + +/** + * these events will be catched by users + */ +export enum IBuildInEvent { + UPLOAD_PROGRESS = "uploadProgress", + FAILED = "failed", + BEFORE_TRANSFORM = "beforeTransform", + BEFORE_UPLOAD = "beforeUpload", + AFTER_UPLOAD = "afterUpload", + FINISHED = "finished", + INSTALL = "install", + UNINSTALL = "uninstall", + UPDATE = "update", + NOTIFICATION = "notification", +} diff --git a/libs/Universal-PicGo-Core/src/utils/getClipboardImage.ts b/libs/Universal-PicGo-Core/src/utils/getClipboardImage.ts new file mode 100644 index 0000000..807838f --- /dev/null +++ b/libs/Universal-PicGo-Core/src/utils/getClipboardImage.ts @@ -0,0 +1,17 @@ +/* + * GNU GENERAL PUBLIC LICENSE + * Version 3, 29 June 2007 + * + * Copyright (C) 2024 Terwer, Inc. + * Everyone is permitted to copy and distribute verbatim copies + * of this license document, but changing it is not allowed. + */ + +import { IClipboardImage, IPicGo } from "../types" + +// Thanks to vs-picgo: https://github.com/Spades-S/vs-picgo/blob/master/src/extension.ts +const getClipboardImage = async (ctx: IPicGo): Promise => { + throw new Error("Not Implemented") +} + +export default getClipboardImage diff --git a/libs/Universal-PicGo-Core/src/utils/nodePolyfill.ts b/libs/Universal-PicGo-Core/src/utils/nodePolyfill.ts index 7d659ff..ed83e74 100644 --- a/libs/Universal-PicGo-Core/src/utils/nodePolyfill.ts +++ b/libs/Universal-PicGo-Core/src/utils/nodePolyfill.ts @@ -7,5 +7,6 @@ * of this license document, but changing it is not allowed. */ import { EventEmitter } from "node:events" +import { Buffer } from "node:buffer" -export { EventEmitter } +export { EventEmitter, Buffer } diff --git a/libs/Universal-PicGo-Core/tsconfig.json b/libs/Universal-PicGo-Core/tsconfig.json index 08cfe0c..9c76f42 100644 --- a/libs/Universal-PicGo-Core/tsconfig.json +++ b/libs/Universal-PicGo-Core/tsconfig.json @@ -9,6 +9,7 @@ "DOM.Iterable" ], "skipLibCheck": true, + /* Bundler mode */ "moduleResolution": "Node", // "allowImportingTsExtensions": true, @@ -17,10 +18,11 @@ "isolatedModules": true, "noEmit": true, "jsx": "preserve", + /* Linting */ "strict": true, - "noUnusedLocals": true, - "noUnusedParameters": true, + "noUnusedLocals": false, + "noUnusedParameters": false, "noFallthroughCasesInSwitch": true, "types": [ "node", diff --git a/libs/Universal-PicGo-Core/vite.config.ts b/libs/Universal-PicGo-Core/vite.config.ts index ad7a188..0522d73 100644 --- a/libs/Universal-PicGo-Core/vite.config.ts +++ b/libs/Universal-PicGo-Core/vite.config.ts @@ -6,7 +6,7 @@ import { viteStaticCopy } from "vite-plugin-static-copy" import dts from "vite-plugin-dts" import minimist from "minimist" import livereload from "rollup-plugin-livereload" -import { nodePolyfills, PolyfillOptions } from "vite-plugin-node-polyfills" +import { nodePolyfills } from "vite-plugin-node-polyfills" const args = minimist(process.argv.slice(2)) const isWatch = args.watch || args.w || false diff --git a/packages/picgo-plugin-app/src/pages/PicGoIndex.vue b/packages/picgo-plugin-app/src/pages/PicGoIndex.vue index 37ae900..f5cc1c7 100644 --- a/packages/picgo-plugin-app/src/pages/PicGoIndex.vue +++ b/packages/picgo-plugin-app/src/pages/PicGoIndex.vue @@ -17,7 +17,7 @@ const handleTest = () => { const picgo = new UniversalPicGo() logger.debug("picgo =>", picgo) - picgo.test() + picgo.upload() } From 9e4a6bc403bedb77641a0894de14979b05c6ea31 Mon Sep 17 00:00:00 2001 From: terwer Date: Fri, 15 Mar 2024 16:30:10 +0800 Subject: [PATCH 03/34] feat: add universal picgo store --- libs/Universal-PicGo-Core/package.json | 2 +- libs/Universal-PicGo-Store/.eslintrc.cjs | 4 + libs/Universal-PicGo-Store/.gitignore | 2 + libs/Universal-PicGo-Store/.prettierignore | 11 + libs/Universal-PicGo-Store/.prettierrc.cjs | 30 + libs/Universal-PicGo-Store/README.md | 41 + libs/Universal-PicGo-Store/index.html | 12 + libs/Universal-PicGo-Store/package.json | 37 + libs/Universal-PicGo-Store/src/index.spec.ts | 7 + libs/Universal-PicGo-Store/src/index.ts | 13 + libs/Universal-PicGo-Store/tsconfig.json | 42 + libs/Universal-PicGo-Store/tsconfig.node.json | 10 + libs/Universal-PicGo-Store/vite.config.ts | 68 + pnpm-lock.yaml | 4278 +---------------- 14 files changed, 527 insertions(+), 4030 deletions(-) create mode 100644 libs/Universal-PicGo-Store/.eslintrc.cjs create mode 100644 libs/Universal-PicGo-Store/.gitignore create mode 100644 libs/Universal-PicGo-Store/.prettierignore create mode 100644 libs/Universal-PicGo-Store/.prettierrc.cjs create mode 100644 libs/Universal-PicGo-Store/README.md create mode 100644 libs/Universal-PicGo-Store/index.html create mode 100644 libs/Universal-PicGo-Store/package.json create mode 100644 libs/Universal-PicGo-Store/src/index.spec.ts create mode 100644 libs/Universal-PicGo-Store/src/index.ts create mode 100644 libs/Universal-PicGo-Store/tsconfig.json create mode 100644 libs/Universal-PicGo-Store/tsconfig.node.json create mode 100644 libs/Universal-PicGo-Store/vite.config.ts diff --git a/libs/Universal-PicGo-Core/package.json b/libs/Universal-PicGo-Core/package.json index 4074103..a81718c 100644 --- a/libs/Universal-PicGo-Core/package.json +++ b/libs/Universal-PicGo-Core/package.json @@ -1,6 +1,6 @@ { "name": "universal-picgo", - "version": "1.5.1", + "version": "1.5.6", "type": "module", "description": "picgo lib for node, browser and electron", "main": "./dist/index.js", diff --git a/libs/Universal-PicGo-Store/.eslintrc.cjs b/libs/Universal-PicGo-Store/.eslintrc.cjs new file mode 100644 index 0000000..a1993b7 --- /dev/null +++ b/libs/Universal-PicGo-Store/.eslintrc.cjs @@ -0,0 +1,4 @@ +module.exports = { + root: true, + extends: ["./node_modules/@terwer/eslint-config-custom/typescript/index.cjs"], +} diff --git a/libs/Universal-PicGo-Store/.gitignore b/libs/Universal-PicGo-Store/.gitignore new file mode 100644 index 0000000..1f1025f --- /dev/null +++ b/libs/Universal-PicGo-Store/.gitignore @@ -0,0 +1,2 @@ +.idea +.DS_Store \ No newline at end of file diff --git a/libs/Universal-PicGo-Store/.prettierignore b/libs/Universal-PicGo-Store/.prettierignore new file mode 100644 index 0000000..8f9d2df --- /dev/null +++ b/libs/Universal-PicGo-Store/.prettierignore @@ -0,0 +1,11 @@ +# platform + +# Ignore artifacts: +dist +node_modules + +# Ignore all dts files: +*.d.ts + +# lib +/pnpm-lock.yaml diff --git a/libs/Universal-PicGo-Store/.prettierrc.cjs b/libs/Universal-PicGo-Store/.prettierrc.cjs new file mode 100644 index 0000000..eec8622 --- /dev/null +++ b/libs/Universal-PicGo-Store/.prettierrc.cjs @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2023, Terwer . All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Terwer designates this + * particular file as subject to the "Classpath" exception as provided + * by Terwer in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Terwer, Shenzhen, Guangdong, China, youweics@163.com + * or visit www.terwer.space if you need additional information or have any + * questions. + */ + +module.exports = { + semi: false, + singleQuote: false, + printWidth: 120 +} diff --git a/libs/Universal-PicGo-Store/README.md b/libs/Universal-PicGo-Store/README.md new file mode 100644 index 0000000..df5eeb0 --- /dev/null +++ b/libs/Universal-PicGo-Store/README.md @@ -0,0 +1,41 @@ +# universal-picgo-store + +For PicGo projects to write & read data from browser, node or electron + +## Usage + +```js +// usage +``` + +## Deps + +``` +## Congregations! universal-picgo-store need no deps, it is just pure js code 🎉 +``` + +## Dev + +```bash +pnpm dev -F Universal-PicGo-Store +``` + +## Build + +```bash +pnpm build -F Universal-PicGo-Store +``` + +## Test + +Execute the unit tests via [vitest](https://vitest.dev) + +```bash +pnpm test -F Universal-PicGo-Store +``` + +## Publish + +```bash +pnpm publish -F Universal-PicGo-Store --tag latest +``` \ No newline at end of file diff --git a/libs/Universal-PicGo-Store/index.html b/libs/Universal-PicGo-Store/index.html new file mode 100644 index 0000000..f0d45f8 --- /dev/null +++ b/libs/Universal-PicGo-Store/index.html @@ -0,0 +1,12 @@ + + + + + + Vite + TS + + + This file is for lib hot load test only, see /src/index.ts + + + diff --git a/libs/Universal-PicGo-Store/package.json b/libs/Universal-PicGo-Store/package.json new file mode 100644 index 0000000..174bb42 --- /dev/null +++ b/libs/Universal-PicGo-Store/package.json @@ -0,0 +1,37 @@ +{ + "name": "universal-picgo-store", + "version": "1.5.6", + "type": "module", + "description": "For PicGo projects to write & read data from browser, node or electron", + "main": "./dist/index.js", + "typings": "./dist/index.d.ts", + "repository": "terwer/siyuan-plugin-picgo", + "homepage": "https://github.com/terwer/siyuan-plugin-picgo/tree/main/libs/Universal-PicGo-Store", + "author": "terwer", + "license": "MIT", + "files": [ + "dist", + "README.md" + ], + "keywords": [ + "zhi", + "lib" + ], + "scripts": { + "serve": "vite", + "dev": "vite build --watch", + "build": "vite build", + "start": "vite preview", + "test": "npx vitest --watch" + }, + "devDependencies": { + "@terwer/eslint-config-custom": "^1.3.6", + "@terwer/vite-config-custom": "^0.7.6" + }, + "dependencies": { + "zhi-lib-base": "^0.8.0" + }, + "publishConfig": { + "access": "public" + } +} diff --git a/libs/Universal-PicGo-Store/src/index.spec.ts b/libs/Universal-PicGo-Store/src/index.spec.ts new file mode 100644 index 0000000..1bbf6ed --- /dev/null +++ b/libs/Universal-PicGo-Store/src/index.spec.ts @@ -0,0 +1,7 @@ +import { describe, it } from "vitest" + +describe("index", () => { + it("test index", () => { + console.log("hello") + }) +}) \ No newline at end of file diff --git a/libs/Universal-PicGo-Store/src/index.ts b/libs/Universal-PicGo-Store/src/index.ts new file mode 100644 index 0000000..b40c067 --- /dev/null +++ b/libs/Universal-PicGo-Store/src/index.ts @@ -0,0 +1,13 @@ +import { simpleLogger, MainFunction } from "zhi-lib-base" + +/** + * 初始化入口 + * + * @param args + */ +const main: MainFunction = async (args: any[]) => { + const logger = simpleLogger("main", "zhi", false) + return "ok" +} + +export default main diff --git a/libs/Universal-PicGo-Store/tsconfig.json b/libs/Universal-PicGo-Store/tsconfig.json new file mode 100644 index 0000000..08cfe0c --- /dev/null +++ b/libs/Universal-PicGo-Store/tsconfig.json @@ -0,0 +1,42 @@ +{ + "compilerOptions": { + "target": "ES2020", + "useDefineForClassFields": true, + "module": "ESNext", + "lib": [ + "ES2020", + "DOM", + "DOM.Iterable" + ], + "skipLibCheck": true, + /* Bundler mode */ + "moduleResolution": "Node", + // "allowImportingTsExtensions": true, + "allowSyntheticDefaultImports": true, + "resolveJsonModule": true, + "isolatedModules": true, + "noEmit": true, + "jsx": "preserve", + /* Linting */ + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noFallthroughCasesInSwitch": true, + "types": [ + "node", + "vite/client" + ] + }, + "include": [ + "src/**/*.ts", + "src/**/*.d.ts", + "src/**/*.tsx", + "src/**/*.vue" + ], + "references": [ + { + "path": "./tsconfig.node.json" + } + ], + "root": "." +} diff --git a/libs/Universal-PicGo-Store/tsconfig.node.json b/libs/Universal-PicGo-Store/tsconfig.node.json new file mode 100644 index 0000000..7065ca9 --- /dev/null +++ b/libs/Universal-PicGo-Store/tsconfig.node.json @@ -0,0 +1,10 @@ +{ + "compilerOptions": { + "composite": true, + "skipLibCheck": true, + "module": "ESNext", + "moduleResolution": "Node", + "allowSyntheticDefaultImports": true + }, + "include": ["vite.config.ts"] +} diff --git a/libs/Universal-PicGo-Store/vite.config.ts b/libs/Universal-PicGo-Store/vite.config.ts new file mode 100644 index 0000000..7d92df1 --- /dev/null +++ b/libs/Universal-PicGo-Store/vite.config.ts @@ -0,0 +1,68 @@ +/// + +import { resolve } from "path" +import { defineConfig } from "vite" +import { viteStaticCopy } from "vite-plugin-static-copy" +import dts from "vite-plugin-dts" +import minimist from "minimist" +import livereload from "rollup-plugin-livereload" + +const args = minimist(process.argv.slice(2)) +const isWatch = args.watch || args.w || false +const devDistDir = "./dist" +const distDir = isWatch ? devDistDir : "./dist" +// const distDir = devDistDir + +console.log("isWatch=>", isWatch) +console.log("distDir=>", distDir) + +export default defineConfig({ + plugins: [ + dts(), + + viteStaticCopy({ + targets: [ + { + src: "README.md", + dest: "./", + }, + { + src: "package.json", + dest: "./", + }, + ], + }), + ], + + build: { + // 输出路径 + outDir: distDir, + emptyOutDir: false, + + // 构建后是否生成 source map 文件 + sourcemap: false, + + lib: { + // Could also be a dictionary or array of multiple entry points + entry: resolve(__dirname, "src/index.ts"), + // the proper extensions will be added + // fileName: "index", + formats: ["es"], + }, + rollupOptions: { + plugins: [...(isWatch ? [livereload(devDistDir)] : [])], + // make sure to externalize deps that shouldn't be bundled + // into your library + external: [], + output: { + entryFileNames: "[name].js", + }, + }, + }, + + test: { + globals: true, + environment: "jsdom", + include: ["src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}"], + }, +}) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9fd5242..3e4c6ea 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -18,208 +18,6 @@ importers: specifier: ^1.12.5 version: 1.12.5 - libs/PicGo-Core: - dependencies: - '@picgo/i18n': - specifier: ^1.0.0 - version: 1.0.0 - '@picgo/store': - specifier: ^2.0.2 - version: 2.1.0 - axios: - specifier: ^0.27.2 - version: 0.27.2 - chalk: - specifier: ^2.4.1 - version: 2.4.2 - commander: - specifier: ^8.1.0 - version: 8.3.0 - comment-json: - specifier: ^2.3.1 - version: 2.4.2 - cross-spawn: - specifier: ^6.0.5 - version: 6.0.5 - dayjs: - specifier: ^1.7.4 - version: 1.11.10 - download-git-repo: - specifier: ^3.0.2 - version: 3.0.2 - ejs: - specifier: ^2.6.1 - version: 2.7.4 - fs-extra: - specifier: ^6.0.1 - version: 6.0.1 - globby: - specifier: ^11.0.4 - version: 11.1.0 - image-size: - specifier: ^0.8.3 - version: 0.8.3 - inquirer: - specifier: ^6.0.0 - version: 6.5.2 - is-wsl: - specifier: ^2.2.0 - version: 2.2.0 - js-yaml: - specifier: ^4.1.0 - version: 4.1.0 - lodash: - specifier: ^4.17.21 - version: 4.17.21 - md5: - specifier: ^2.2.1 - version: 2.3.0 - mime-types: - specifier: 2.1.33 - version: 2.1.33 - minimatch: - specifier: ^3.0.4 - version: 3.1.2 - minimist: - specifier: ^1.2.5 - version: 1.2.8 - qiniu: - specifier: ^7.2.1 - version: 7.11.1 - resolve: - specifier: ^1.8.1 - version: 1.22.8 - rimraf: - specifier: ^3.0.2 - version: 3.0.2 - tunnel: - specifier: ^0.0.6 - version: 0.0.6 - devDependencies: - '@picgo/bump-version': - specifier: ^1.1.2 - version: 1.1.2(@types/node@16.11.7)(typescript@4.9.5) - '@rollup/plugin-commonjs': - specifier: ^21.0.0 - version: 21.1.0(rollup@2.79.1) - '@rollup/plugin-json': - specifier: ^4.1.0 - version: 4.1.0(rollup@2.79.1) - '@rollup/plugin-node-resolve': - specifier: ^13.0.5 - version: 13.3.0(rollup@2.79.1) - '@rollup/plugin-replace': - specifier: ^3.0.0 - version: 3.1.0(rollup@2.79.1) - '@types/cross-spawn': - specifier: ^6.0.0 - version: 6.0.6 - '@types/ejs': - specifier: ^3.0.5 - version: 3.1.5 - '@types/fs-extra': - specifier: ^5.0.4 - version: 5.1.0 - '@types/image-size': - specifier: ^0.0.29 - version: 0.0.29 - '@types/inquirer': - specifier: ^0.0.42 - version: 0.0.42 - '@types/js-yaml': - specifier: ^4.0.5 - version: 4.0.9 - '@types/lodash': - specifier: ^4.14.175 - version: 4.17.0 - '@types/md5': - specifier: ^2.1.32 - version: 2.3.5 - '@types/mime-types': - specifier: ^2.1.0 - version: 2.1.4 - '@types/minimatch': - specifier: ^3.0.3 - version: 3.0.5 - '@types/node': - specifier: 16.11.7 - version: 16.11.7 - '@types/resolve': - specifier: ^0.0.8 - version: 0.0.8 - '@types/rimraf': - specifier: ^3.0.0 - version: 3.0.2 - '@types/tunnel': - specifier: ^0.0.3 - version: 0.0.3 - '@typescript-eslint/eslint-plugin': - specifier: '3' - version: 3.10.1(@typescript-eslint/parser@3.10.1)(eslint@7.32.0)(typescript@4.9.5) - '@typescript-eslint/parser': - specifier: ^3.2.0 - version: 3.10.1(eslint@7.32.0)(typescript@4.9.5) - babel-eslint: - specifier: ^10.1.0 - version: 10.1.0(eslint@7.32.0) - builtins: - specifier: ^4.0.0 - version: 4.1.0 - conventional-changelog: - specifier: ^3.0.6 - version: 3.1.25 - copyfiles: - specifier: ^2.1.0 - version: 2.4.1 - cross-env: - specifier: ^7.0.3 - version: 7.0.3 - cz-customizable: - specifier: ^5.10.0 - version: 5.10.0 - eslint: - specifier: '7' - version: 7.32.0 - eslint-config-standard-with-typescript: - specifier: ^18.0.2 - version: 18.0.2(@typescript-eslint/eslint-plugin@3.10.1)(eslint-plugin-import@2.29.1)(eslint-plugin-node@11.1.0)(eslint-plugin-promise@4.3.1)(eslint-plugin-standard@4.1.0)(eslint@7.32.0)(typescript@4.9.5) - eslint-plugin-import: - specifier: '2' - version: 2.29.1(@typescript-eslint/parser@3.10.1)(eslint@7.32.0) - eslint-plugin-node: - specifier: '11' - version: 11.1.0(eslint@7.32.0) - eslint-plugin-promise: - specifier: '4' - version: 4.3.1 - eslint-plugin-standard: - specifier: '4' - version: 4.1.0(eslint@7.32.0) - execa: - specifier: ^5.1.1 - version: 5.1.1 - husky: - specifier: ^1.3.1 - version: 1.3.1 - pre-commit: - specifier: ^1.2.2 - version: 1.2.2 - rollup: - specifier: ^2.58.0 - version: 2.79.1 - rollup-plugin-string: - specifier: ^3.0.0 - version: 3.0.0 - rollup-plugin-terser: - specifier: ^7.0.2 - version: 7.0.2(rollup@2.79.1) - rollup-plugin-typescript2: - specifier: ^0.30.0 - version: 0.30.0(rollup@2.79.1)(typescript@4.9.5) - typescript: - specifier: ^4.8.2 - version: 4.9.5 - libs/Universal-PicGo-Core: dependencies: zhi-lib-base: @@ -236,6 +34,19 @@ importers: specifier: ^0.21.0 version: 0.21.0(vite@4.5.2) + libs/Universal-PicGo-Store: + dependencies: + zhi-lib-base: + specifier: ^0.8.0 + version: 0.8.0 + devDependencies: + '@terwer/eslint-config-custom': + specifier: ^1.3.6 + version: 1.3.6(@nuxt/eslint-config@0.1.1)(@typescript-eslint/eslint-plugin@5.62.0)(astro-eslint-parser@0.13.3)(eslint-config-prettier@8.10.0)(eslint-config-turbo@1.12.5)(eslint-plugin-prettier@4.2.1)(eslint-plugin-svelte@2.35.1)(eslint-plugin-vue@9.23.0)(eslint@8.57.0)(prettier-plugin-svelte@2.10.1)(prettier@2.8.8)(typescript@5.4.2) + '@terwer/vite-config-custom': + specifier: ^0.7.6 + version: 0.7.6(@types/minimist@1.2.2)(jsdom@22.1.0)(minimist@1.2.8)(rollup-plugin-livereload@2.0.5)(typescript@5.4.2)(vite-plugin-dts@2.3.0)(vite-plugin-node-polyfills@0.8.2)(vite-plugin-static-copy@0.15.0)(vite-tsconfig-paths@4.3.2)(vite@4.5.2)(vitest@0.31.4) + packages/picgo-plugin-app: dependencies: '@element-plus/icons-vue': @@ -397,12 +208,6 @@ packages: resolution: {integrity: sha512-o/ObKgtMzl8SlpIdzaxFnt7SATKPxu4oIP/1NL+HDJRzxfJcAkOTAb/ZKMRyULbz4q+1t2/DAebs2Z1QairkZw==} dev: true - /@babel/code-frame@7.12.11: - resolution: {integrity: sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==} - dependencies: - '@babel/highlight': 7.23.4 - dev: true - /@babel/code-frame@7.23.5: resolution: {integrity: sha512-CgH3s1a96LipHCmSUmYFPwY7MNx8C3avkq7i4Wl3cfa662ldtUe4VM1TPXX70pfmrlWTb6jLqTYrZyT2ZTJBgA==} engines: {node: '>=6.9.0'} @@ -411,43 +216,6 @@ packages: chalk: 2.4.2 dev: true - /@babel/generator@7.23.6: - resolution: {integrity: sha512-qrSfCYxYQB5owCmGLbl8XRpX1ytXlpueOb0N0UmQwA073KZxejgQTzAmJezxvpwQD9uGtK2shHdi55QT+MbjIw==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/types': 7.24.0 - '@jridgewell/gen-mapping': 0.3.5 - '@jridgewell/trace-mapping': 0.3.25 - jsesc: 2.5.2 - dev: true - - /@babel/helper-environment-visitor@7.22.20: - resolution: {integrity: sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==} - engines: {node: '>=6.9.0'} - dev: true - - /@babel/helper-function-name@7.23.0: - resolution: {integrity: sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/template': 7.24.0 - '@babel/types': 7.24.0 - dev: true - - /@babel/helper-hoist-variables@7.22.5: - resolution: {integrity: sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/types': 7.24.0 - dev: true - - /@babel/helper-split-export-declaration@7.22.6: - resolution: {integrity: sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/types': 7.24.0 - dev: true - /@babel/helper-string-parser@7.23.4: resolution: {integrity: sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ==} engines: {node: '>=6.9.0'} @@ -472,33 +240,6 @@ packages: dependencies: '@babel/types': 7.24.0 - /@babel/template@7.24.0: - resolution: {integrity: sha512-Bkf2q8lMB0AFpX0NFEqSbx1OkTHf0f+0j82mkw+ZpzBnkk7e9Ql0891vlfgi+kHwOk8tQjiQHpqh4LaSa0fKEA==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/code-frame': 7.23.5 - '@babel/parser': 7.24.0 - '@babel/types': 7.24.0 - dev: true - - /@babel/traverse@7.24.0: - resolution: {integrity: sha512-HfuJlI8qq3dEDmNU5ChzzpZRWq+oxCZQyMzIMEqLho+AQnhMnKQUzH6ydo3RBl/YjPCuk68Y6s0Gx0AeyULiWw==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/code-frame': 7.23.5 - '@babel/generator': 7.23.6 - '@babel/helper-environment-visitor': 7.22.20 - '@babel/helper-function-name': 7.23.0 - '@babel/helper-hoist-variables': 7.22.5 - '@babel/helper-split-export-declaration': 7.22.6 - '@babel/parser': 7.24.0 - '@babel/types': 7.24.0 - debug: 4.3.4 - globals: 11.12.0 - transitivePeerDependencies: - - supports-color - dev: true - /@babel/types@7.24.0: resolution: {integrity: sha512-+j7a5c253RfKh8iABBhywc8NSfP5LURe7Uh4qpsh6jc+aLJguvmIUBdjSdEMQv2bENrCR5MfRdjGo7vzS/ob7w==} engines: {node: '>=6.9.0'} @@ -527,24 +268,6 @@ packages: - '@swc/wasm' dev: true - /@commitlint/cli@7.6.1: - resolution: {integrity: sha512-HEJwQ/aK0AOcAwn77ZKbb/GZhlGxBSPhtVp07uoJFVqM12l2Ia2JHA+MTpfHCFdVahKyYGREZgxde6LyKyG8aQ==} - engines: {node: '>=4'} - hasBin: true - dependencies: - '@commitlint/format': 7.6.1 - '@commitlint/lint': 7.6.0 - '@commitlint/load': 7.6.2 - '@commitlint/read': 7.6.0 - babel-polyfill: 6.26.0 - chalk: 2.3.1 - get-stdin: 7.0.0 - lodash: 4.17.11 - meow: 5.0.0 - resolve-from: 5.0.0 - resolve-global: 1.0.0 - dev: true - /@commitlint/config-angular-type-enum@17.8.1: resolution: {integrity: sha512-vuIQ9rZckMPRM6I3mWzfWb7TfvE/yHJXNKaR2weuhf+lQEVSZSGQP3LwdXpMcT2QGKE9VAhU/jw0qIE0Z9EbHA==} engines: {node: '>=v14'} @@ -607,13 +330,6 @@ packages: lodash.upperfirst: 4.3.1 dev: true - /@commitlint/ensure@7.6.0: - resolution: {integrity: sha512-pSUrNud5L/8y+cLWo3LEa8Ce4bAAR33xMderFUhuNPHj7TwpNS7L4ROMnhL4ZlCYRazCRDlnPaJLPikMoWThfA==} - engines: {node: '>=4'} - dependencies: - lodash: 4.17.11 - dev: true - /@commitlint/execute-rule@17.8.1: resolution: {integrity: sha512-JHVupQeSdNI6xzA9SqMF+p/JjrHTcrJdI02PwesQIDCIGUrv04hicJgCcws5nzaoZbROapPs0s6zeVHoxpMwFQ==} engines: {node: '>=v14'} @@ -626,13 +342,6 @@ packages: dev: true optional: true - /@commitlint/execute-rule@7.6.0: - resolution: {integrity: sha512-0inGOIlLefPDtiDOaZ6WoE1p+GEZZIj2VwUftUozD3C71TiwP9UfKAVVtUDFPIeL6RgSqCkCf7zsy6NKNxwkBg==} - engines: {node: '>=4'} - dependencies: - babel-runtime: 6.26.0 - dev: true - /@commitlint/format@17.8.1: resolution: {integrity: sha512-f3oMTyZ84M9ht7fb93wbCKmWxO5/kKSbwuYvS867duVomoOsgrgljkGGIztmT/srZnaiGbaK8+Wf8Ik2tSr5eg==} engines: {node: '>=v14'} @@ -641,14 +350,6 @@ packages: chalk: 4.1.2 dev: true - /@commitlint/format@7.6.1: - resolution: {integrity: sha512-Ldzf5N2Sr9RQqvlYwaQn4vz1WOZ7byYinspC/WCrbfcETGy28j7QE4OueZU6nNB9TjwwEorKm13uy7tDWPR7dg==} - engines: {node: '>=4'} - dependencies: - babel-runtime: 6.26.0 - chalk: 2.4.2 - dev: true - /@commitlint/is-ignored@17.8.1: resolution: {integrity: sha512-UshMi4Ltb4ZlNn4F7WtSEugFDZmctzFpmbqvpyxD3la510J+PLcnyhf9chs7EryaRFJMdAKwsEKfNK0jL/QM4g==} engines: {node: '>=v14'} @@ -657,13 +358,6 @@ packages: semver: 7.5.4 dev: true - /@commitlint/is-ignored@7.6.0: - resolution: {integrity: sha512-By/mLNhz+6Rtix9+Kyof1gdKiELchAnQHpdeKIHIOe9sjbvd3HqDoFHh/mGMMRnGIPMZOX5TO8Fqy3A/2HqlTw==} - engines: {node: '>=4'} - dependencies: - semver: 6.0.0 - dev: true - /@commitlint/lint@17.8.1: resolution: {integrity: sha512-aQUlwIR1/VMv2D4GXSk7PfL5hIaFSfy6hSHV94O8Y27T5q+DlDEgd/cZ4KmVI+MWKzFfCTiTuWqjfRSfdRllCA==} engines: {node: '>=v14'} @@ -674,17 +368,6 @@ packages: '@commitlint/types': 17.8.1 dev: true - /@commitlint/lint@7.6.0: - resolution: {integrity: sha512-aUIFX0lPRZL7WmT8W8qzogJD4LmHk6JPG3XUAX+K0pOHGjC/0ALvSAytvoLXy4fvmSnGJkXmWhzSW7c0Spa14Q==} - engines: {node: '>=4'} - dependencies: - '@commitlint/is-ignored': 7.6.0 - '@commitlint/parse': 7.6.0 - '@commitlint/rules': 7.6.0 - babel-runtime: 6.26.0 - lodash: 4.17.11 - dev: true - /@commitlint/load@17.8.1: resolution: {integrity: sha512-iF4CL7KDFstP1kpVUkT8K2Wl17h2yx9VaR1ztTc8vzByWWcbO/WaKwxsnCOqow9tVAlzPfo1ywk9m2oJ9ucMqA==} engines: {node: '>=v14'} @@ -708,27 +391,6 @@ packages: - '@swc/wasm' dev: true - /@commitlint/load@19.1.0(@types/node@16.11.7)(typescript@4.9.5): - resolution: {integrity: sha512-rWqnvNDpeshX8JfUC/qjpDkQB78qF+4uHcJmIRJMwvlj6zWce08SP/TPKN3GlNKgXhAawwcAPxXL9qOTTdiOBA==} - engines: {node: '>=v18'} - requiresBuild: true - dependencies: - '@commitlint/config-validator': 19.0.3 - '@commitlint/execute-rule': 19.0.0 - '@commitlint/resolve-extends': 19.1.0 - '@commitlint/types': 19.0.3 - chalk: 5.3.0 - cosmiconfig: 8.3.6(typescript@4.9.5) - cosmiconfig-typescript-loader: 5.0.0(@types/node@16.11.7)(cosmiconfig@8.3.6)(typescript@4.9.5) - lodash.isplainobject: 4.0.6 - lodash.merge: 4.6.2 - lodash.uniq: 4.5.0 - transitivePeerDependencies: - - '@types/node' - - typescript - dev: true - optional: true - /@commitlint/load@19.1.0(@types/node@20.5.1)(typescript@5.4.2): resolution: {integrity: sha512-rWqnvNDpeshX8JfUC/qjpDkQB78qF+4uHcJmIRJMwvlj6zWce08SP/TPKN3GlNKgXhAawwcAPxXL9qOTTdiOBA==} engines: {node: '>=v18'} @@ -750,28 +412,11 @@ packages: dev: true optional: true - /@commitlint/load@7.6.2: - resolution: {integrity: sha512-I+xk+BkXAG1roXNrPsR1eOd5hEa+oLc6HLYnHAT/HLGKKB3E01IGg3O5SGlg7lpf1yiAaYI+wAnNTr3f3sIbWQ==} - engines: {node: '>=4'} - dependencies: - '@commitlint/execute-rule': 7.6.0 - '@commitlint/resolve-extends': 7.6.0 - babel-runtime: 6.26.0 - cosmiconfig: 5.2.1 - lodash: 4.17.11 - resolve-from: 5.0.0 - dev: true - /@commitlint/message@17.8.1: resolution: {integrity: sha512-6bYL1GUQsD6bLhTH3QQty8pVFoETfFQlMn2Nzmz3AOLqRVfNNtXBaSY0dhZ0dM6A2MEq4+2d7L/2LP8TjqGRkA==} engines: {node: '>=v14'} dev: true - /@commitlint/message@7.6.0: - resolution: {integrity: sha512-PtP4jhBYGXLaQQC5jel+RQczG2tS3Cy6rRxQioUfCUaEg/LV029ao/KcL1kHEBJ8hSW/SUmnvDaD9Y6nozLQMA==} - engines: {node: '>=4'} - dev: true - /@commitlint/parse@17.8.1: resolution: {integrity: sha512-/wLUickTo0rNpQgWwLPavTm7WbwkZoBy3X8PpkUmlSmQJyWQTj0m6bDjiykMaDt41qcUbfeFfaCvXfiR4EGnfw==} engines: {node: '>=v14'} @@ -781,15 +426,6 @@ packages: conventional-commits-parser: 4.0.0 dev: true - /@commitlint/parse@7.6.0: - resolution: {integrity: sha512-1x60kTqz2VBCjYE+8MV5BhE+ShPo7MgVlrMWSlxiiJDWP5CvWa+SBbUayDJ7rtOXimjTASZ9ZNZTuFPdJE/Y7A==} - engines: {node: '>=4'} - dependencies: - conventional-changelog-angular: 1.6.6 - conventional-commits-parser: 2.1.7 - lodash: 4.17.21 - dev: true - /@commitlint/prompt-cli@17.8.1: resolution: {integrity: sha512-dkjxr0ah2R9P/vsz/s128kNEar/5zjr3TN3LOvA8kBiSrrbfF560gnoxAh+KgQ5sAc8lMrG+z4dVYvzSkXyfDQ==} engines: {node: '>=v14'} @@ -828,16 +464,6 @@ packages: minimist: 1.2.8 dev: true - /@commitlint/read@7.6.0: - resolution: {integrity: sha512-OyligtK/e4xnQklrQqTcSMM27eNhq+LqXfoeVouuPx059oDEw9wZYNN4HGzyxs4Pb6GdMpzRHLdeMQ24M+AiYw==} - engines: {node: '>=4'} - dependencies: - '@commitlint/top-level': 7.6.0 - '@marionebl/sander': 0.6.1 - babel-runtime: 6.26.0 - git-raw-commits: 1.3.6 - dev: true - /@commitlint/resolve-extends@17.8.1: resolution: {integrity: sha512-W/ryRoQ0TSVXqJrx5SGkaYuAaE/BUontL1j1HsKckvM6e5ZaG0M9126zcwL6peKSuIetJi7E87PRQF8O86EW0Q==} engines: {node: '>=v14'} @@ -864,17 +490,6 @@ packages: dev: true optional: true - /@commitlint/resolve-extends@7.6.0: - resolution: {integrity: sha512-fk8KvNiEbRc+p8nPFuysVP2O95+sb8vlIDTjqtGVObqrzFINRfERXwqBmTBtcu556BoDAR2hwRVXmuwhns+Duw==} - engines: {node: '>=4'} - dependencies: - babel-runtime: 6.26.0 - import-fresh: 3.3.0 - lodash: 4.17.11 - resolve-from: 5.0.0 - resolve-global: 1.0.0 - dev: true - /@commitlint/rules@17.8.1: resolution: {integrity: sha512-2b7OdVbN7MTAt9U0vKOYKCDsOvESVXxQmrvuVUZ0rGFMCrCPJWWP1GJ7f0lAypbDAhaGb8zqtdOr47192LBrIA==} engines: {node: '>=v14'} @@ -886,26 +501,11 @@ packages: execa: 5.1.1 dev: true - /@commitlint/rules@7.6.0: - resolution: {integrity: sha512-shLJdMUwdVeE5UgOE8E+c+PFS7+0FFGfheMa3s6ZK+xX8pTUxseXZu9iCF4mwF+WWkVk518xPuNLvmYE96salQ==} - engines: {node: '>=4'} - dependencies: - '@commitlint/ensure': 7.6.0 - '@commitlint/message': 7.6.0 - '@commitlint/to-lines': 7.6.0 - babel-runtime: 6.26.0 - dev: true - /@commitlint/to-lines@17.8.1: resolution: {integrity: sha512-LE0jb8CuR/mj6xJyrIk8VLz03OEzXFgLdivBytoooKO5xLt5yalc8Ma5guTWobw998sbR3ogDd+2jed03CFmJA==} engines: {node: '>=v14'} dev: true - /@commitlint/to-lines@7.6.0: - resolution: {integrity: sha512-L/Vl5ThRuBHnSNZBtc+p2LCs2ayxWodC+I/X3NKUywSmr6kKpJJCFqHHHqPu+yXwGUPwqCMQhogIGLuv9TtWWw==} - engines: {node: '>=4'} - dev: true - /@commitlint/top-level@17.8.1: resolution: {integrity: sha512-l6+Z6rrNf5p333SHfEte6r+WkOxGlWK4bLuZKbtf/2TXRN+qhrvn1XE63VhD8Oe9oIHQ7F7W1nG2k/TJFhx2yA==} engines: {node: '>=v14'} @@ -913,13 +513,6 @@ packages: find-up: 5.0.0 dev: true - /@commitlint/top-level@7.6.0: - resolution: {integrity: sha512-R2RzJZDuT2TU2dZMrRd7olax5IDVcUB/O8k76d1LW13CQ9/2ArJi3TCFXSZIaGpCUnyAYA5KiCZ+c1opnyQuog==} - engines: {node: '>=4'} - dependencies: - find-up: 2.1.0 - dev: true - /@commitlint/types@17.8.1: resolution: {integrity: sha512-PXDQXkAmiMEG162Bqdh9ChML/GJZo6vU+7F03ALKDK8zYc6SuAr47LjG7hGYRqUOz+WK0dU7bQ0xzuqFMdxzeQ==} engines: {node: '>=v14'} @@ -937,18 +530,6 @@ packages: dev: true optional: true - /@commonify/lowdb@3.0.0: - resolution: {integrity: sha512-GwZq68zStvMENxEzN6EE8pacgY2Rlrs5L00BpvB6NvpDW96JUxIa8PJXd9T7qIdx07ro0ITBtw6HfSJw/qboGw==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - dependencies: - '@commonify/steno': 2.1.0 - dev: false - - /@commonify/steno@2.1.0: - resolution: {integrity: sha512-3W0LmYb84EU82Ky18M+D0tB33W66ccoC/Ot/8mm3uBQFuaTpiWaoxntQGBTL3+bIpV4e77ks53IE3sy9BRFBxA==} - engines: {node: ^14.13.1 || >=16.0.0} - dev: false - /@cspotcode/source-map-support@0.8.1: resolution: {integrity: sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==} engines: {node: '>=12'} @@ -1389,23 +970,6 @@ packages: engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} dev: true - /@eslint/eslintrc@0.4.3: - resolution: {integrity: sha512-J6KFFz5QCYUJq3pf0mjEcCJVERbzv71PUIDczuh9JkwGEzced6CO5ADLHB1rbf/+oPBtoPfMYNOpGDzCANlbXw==} - engines: {node: ^10.12.0 || >=12.0.0} - dependencies: - ajv: 6.12.6 - debug: 4.3.4 - espree: 7.3.1 - globals: 13.24.0 - ignore: 4.0.6 - import-fresh: 3.3.0 - js-yaml: 3.14.1 - minimatch: 3.1.2 - strip-json-comments: 3.1.1 - transitivePeerDependencies: - - supports-color - dev: true - /@eslint/eslintrc@2.1.4: resolution: {integrity: sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -1456,35 +1020,15 @@ packages: - supports-color dev: true - /@humanwhocodes/config-array@0.5.0: - resolution: {integrity: sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg==} - engines: {node: '>=10.10.0'} - dependencies: - '@humanwhocodes/object-schema': 1.2.1 - debug: 4.3.4 - minimatch: 3.1.2 - transitivePeerDependencies: - - supports-color - dev: true - /@humanwhocodes/module-importer@1.0.1: resolution: {integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==} engines: {node: '>=12.22'} dev: true - /@humanwhocodes/object-schema@1.2.1: - resolution: {integrity: sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==} - dev: true - /@humanwhocodes/object-schema@2.0.2: resolution: {integrity: sha512-6EwiSjwWYP7pTckG6I5eyFANjPhmPjUX9JRLUSfNPC7FX7zK9gyZAfUEaECL6ALTpGX5AjnBq3C9XmVWPitNpw==} dev: true - /@hutson/parse-repository-url@3.0.2: - resolution: {integrity: sha512-H9XAx3hc0BQHY6l+IFSWHDySypcXsvsuLhgYLUGywmJ5pswRVQJUHpOsobnLYp2ZUaUlKiKDrgWWhosOwAEM8Q==} - engines: {node: '>=6.9.0'} - dev: true - /@intlify/core-base@9.10.1: resolution: {integrity: sha512-0+Wtjj04GIyglh5KKiNjRwgjpHrhqqGZhaKY/QVjjogWKZq5WHROrTi84pNVsRN18QynyPmjtsVUWqFKPQ45xQ==} engines: {node: '>= 16'} @@ -1556,14 +1100,6 @@ packages: '@jridgewell/sourcemap-codec': 1.4.15 dev: true - /@marionebl/sander@0.6.1: - resolution: {integrity: sha512-7f3zZddAk92G1opoX/glbDO6YbrzmMAJAw0RJAcvunnV7sR4L9llyBUAABptKoF1Jf37UQ1QTJy5p2H4J4rBNA==} - dependencies: - graceful-fs: 4.2.11 - mkdirp: 0.5.6 - rimraf: 2.7.1 - dev: true - /@microsoft/api-extractor-model@7.28.13(@types/node@20.5.1): resolution: {integrity: sha512-39v/JyldX4MS9uzHcdfmjjfS6cYGAoXV+io8B5a338pkHiSt+gy2eXQ0Q7cGFJ7quSa1VqqlMdlPrB6sLR/cAw==} dependencies: @@ -1644,10 +1180,12 @@ packages: dependencies: '@nodelib/fs.stat': 2.0.5 run-parallel: 1.2.0 + dev: true /@nodelib/fs.stat@2.0.5: resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} engines: {node: '>= 8'} + dev: true /@nodelib/fs.walk@1.2.8: resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} @@ -1655,6 +1193,7 @@ packages: dependencies: '@nodelib/fs.scandir': 2.1.5 fastq: 1.17.1 + dev: true /@nuxt/eslint-config@0.1.1(eslint@8.57.0): resolution: {integrity: sha512-znm1xlbhldUubB2XGx6Ca5uarwlIieKf0o8CtxtF6eEauDbpa3T2p3JnTcdguMW2nj1YPneoGmhshANfOlghiQ==} @@ -1671,64 +1210,11 @@ packages: - supports-color dev: true - /@picgo/bump-version@1.1.2(@types/node@16.11.7)(typescript@4.9.5): - resolution: {integrity: sha512-zuJU8xYkpCjQTIx4NaDGcdQFORMNW4vK156hOBvCaDKX3UO5z71rvglLwdclXDG1qtVOyhZPdibfaZihm41fmA==} - hasBin: true - dependencies: - '@commitlint/cli': 7.6.1 - commitizen: 4.3.0(@types/node@16.11.7)(typescript@4.9.5) - conventional-changelog: 3.1.25 - cz-customizable: 5.10.0 - husky: 1.3.1 - ora: 3.4.0 - transitivePeerDependencies: - - '@types/node' - - typescript - dev: true - - /@picgo/i18n@1.0.0: - resolution: {integrity: sha512-D0fqwox9AZ1pnvgFqBKQe+16U08FkPLnUW1wQSBEdn+EvI48IC3jIWDTZd1MSQzXeODnh/w4eAiUyARrf2Hzig==} - dependencies: - chalk: 4.1.2 - tslib: 2.6.2 - dev: false - - /@picgo/store@2.1.0: - resolution: {integrity: sha512-oD/+4hGaioSVqWmaV5/LEXJ/xfpDrwUYPDGgJx3gEYoNPG2IdIZiO++asSZsafAc03TGPlvtR3L9eOTqPaKj9w==} - dependencies: - '@commonify/lowdb': 3.0.0 - '@commonify/steno': 2.1.0 - '@types/bson': 4.2.0 - '@types/graceful-fs': 4.1.9 - '@types/lodash': 4.17.0 - comment-json: 4.2.3 - fflate: 0.7.4 - lodash: 4.17.21 - lodash-id: 0.14.1 - write-file-atomic: 4.0.2 - dev: false - /@pkgr/core@0.1.1: resolution: {integrity: sha512-cq8o4cWH0ibXh9VGi5P20Tu9XF/0fFXl9EUinr9QfTM7a7p0oTA4iJRCQWppXR1Pg8dSM0UCItCkPwsk9qWWYA==} engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0} dev: true - /@rollup/plugin-commonjs@21.1.0(rollup@2.79.1): - resolution: {integrity: sha512-6ZtHx3VHIp2ReNNDxHjuUml6ur+WcQ28N1yHgCQwsbNkQg2suhxGMDQGJOn/KuDxKtd1xuZP5xSTwBA4GQ8hbA==} - engines: {node: '>= 8.0.0'} - peerDependencies: - rollup: ^2.38.3 - dependencies: - '@rollup/pluginutils': 3.1.0(rollup@2.79.1) - commondir: 1.0.1 - estree-walker: 2.0.2 - glob: 7.2.3 - is-reference: 1.2.1 - magic-string: 0.25.9 - resolve: 1.22.8 - rollup: 2.79.1 - dev: true - /@rollup/plugin-inject@5.0.5: resolution: {integrity: sha512-2+DEJbNBoPROPkgTDNe8/1YXWcqxbN5DTjASVIOx8HS+pITXushyNiBV56RB08zuptzz8gT3YfkqriTBVycepg==} engines: {node: '>=14.0.0'} @@ -1743,52 +1229,6 @@ packages: magic-string: 0.30.8 dev: true - /@rollup/plugin-json@4.1.0(rollup@2.79.1): - resolution: {integrity: sha512-yfLbTdNS6amI/2OpmbiBoW12vngr5NW2jCJVZSBEz+H5KfUJZ2M7sDjk0U6GOOdCWFVScShte29o9NezJ53TPw==} - peerDependencies: - rollup: ^1.20.0 || ^2.0.0 - dependencies: - '@rollup/pluginutils': 3.1.0(rollup@2.79.1) - rollup: 2.79.1 - dev: true - - /@rollup/plugin-node-resolve@13.3.0(rollup@2.79.1): - resolution: {integrity: sha512-Lus8rbUo1eEcnS4yTFKLZrVumLPY+YayBdWXgFSHYhTT2iJbMhoaaBL3xl5NCdeRytErGr8tZ0L71BMRmnlwSw==} - engines: {node: '>= 10.0.0'} - peerDependencies: - rollup: ^2.42.0 - dependencies: - '@rollup/pluginutils': 3.1.0(rollup@2.79.1) - '@types/resolve': 1.17.1 - deepmerge: 4.3.1 - is-builtin-module: 3.2.1 - is-module: 1.0.0 - resolve: 1.22.8 - rollup: 2.79.1 - dev: true - - /@rollup/plugin-replace@3.1.0(rollup@2.79.1): - resolution: {integrity: sha512-pA3XRUrSKybVYqmH5TqWNZpGxF+VV+1GrYchKgCNIj2vsSOX7CVm2RCtx8p2nrC7xvkziYyK+lSi74T93MU3YA==} - peerDependencies: - rollup: ^1.20.0 || ^2.0.0 - dependencies: - '@rollup/pluginutils': 3.1.0(rollup@2.79.1) - magic-string: 0.25.9 - rollup: 2.79.1 - dev: true - - /@rollup/pluginutils@3.1.0(rollup@2.79.1): - resolution: {integrity: sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==} - engines: {node: '>= 8.0.0'} - peerDependencies: - rollup: ^1.20.0||^2.0.0 - dependencies: - '@types/estree': 0.0.39 - estree-walker: 1.0.1 - picomatch: 2.3.1 - rollup: 2.79.1 - dev: true - /@rollup/pluginutils@4.2.1: resolution: {integrity: sha512-iKnFXr7NkdZAIHiIWE+BX5ULi/ucVFYWD6TbAV+rZctiRTY2PL6tsIKhoIOaoskiWAkgu+VsbXgUVDNLHf+InQ==} engines: {node: '>= 8.0.0'} @@ -2023,11 +1463,6 @@ packages: resolution: {integrity: sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==} dev: true - /@sindresorhus/is@0.7.0: - resolution: {integrity: sha512-ONhaKPIufzzrlNbqtWFFd+jlnemX6lJAgq9ZeiZtS7I1PIf/la7CW4m83rTXRnVnsMbW2k56pGYu7AUFJD9Pow==} - engines: {node: '>=4'} - dev: false - /@sveltejs/vite-plugin-svelte-inspector@2.0.0(@sveltejs/vite-plugin-svelte@3.0.2)(svelte@4.2.12)(vite@5.1.6): resolution: {integrity: sha512-gjr9ZFg1BSlIpfZ4PRewigrvYmHWbDrq2uvvPB1AmTWKuM+dI1JXQSUu2pIrYLb/QncyiIGkFDFKTwJ0XqQZZg==} engines: {node: ^18.0.0 || >=20} @@ -2148,21 +1583,49 @@ packages: vitest: 0.31.4(jsdom@22.1.0) dev: true - /@tootallnate/once@2.0.0: - resolution: {integrity: sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==} - engines: {node: '>= 10'} - dev: true - - /@ts-morph/common@0.19.0: - resolution: {integrity: sha512-Unz/WHmd4pGax91rdIKWi51wnVUW11QttMEPpBiBgIewnc9UQIX7UDLxr5vRlqeByXCwhkF6VabSsI0raWcyAQ==} - dependencies: - fast-glob: 3.3.2 - minimatch: 7.4.6 - mkdirp: 2.1.6 - path-browserify: 1.0.1 - dev: true - - /@tsconfig/node10@1.0.9: + /@terwer/vite-config-custom@0.7.6(@types/minimist@1.2.2)(jsdom@22.1.0)(minimist@1.2.8)(rollup-plugin-livereload@2.0.5)(typescript@5.4.2)(vite-plugin-dts@2.3.0)(vite-plugin-node-polyfills@0.8.2)(vite-plugin-static-copy@0.15.0)(vite-tsconfig-paths@4.3.2)(vite@4.5.2)(vitest@0.31.4): + resolution: {integrity: sha512-4IXVxedwwOiVYR8phrZ9tL1Qn3aVs0mdgqNEVOr6m6lw8jFPUyX+EpiJjPom7NOa9VuKbtOvvN0lOPycX0lr3g==} + peerDependencies: + '@types/minimist': 1.2.2 + jsdom: ^22.0.0 + minimist: ^1.2.8 + rollup-plugin-livereload: ^2.0.5 + typescript: ^5.0.4 + vite: ^4.3.5 + vite-plugin-dts: ^2.3.0 + vite-plugin-node-polyfills: ^0.8.2 + vite-plugin-static-copy: ^0.15.0 + vite-tsconfig-paths: ^4.2.0 + vitest: ^0.31.0 + dependencies: + '@types/minimist': 1.2.2 + jsdom: 22.1.0 + minimist: 1.2.8 + rollup-plugin-livereload: 2.0.5 + typescript: 5.4.2 + vite: 4.5.2(@types/node@20.5.1) + vite-plugin-dts: 2.3.0(@types/node@20.5.1)(vite@4.5.2) + vite-plugin-node-polyfills: 0.8.2(vite@4.5.2) + vite-plugin-static-copy: 0.15.0(vite@4.5.2) + vite-tsconfig-paths: 4.3.2(typescript@5.4.2)(vite@4.5.2) + vitest: 0.31.4(jsdom@22.1.0) + dev: true + + /@tootallnate/once@2.0.0: + resolution: {integrity: sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==} + engines: {node: '>= 10'} + dev: true + + /@ts-morph/common@0.19.0: + resolution: {integrity: sha512-Unz/WHmd4pGax91rdIKWi51wnVUW11QttMEPpBiBgIewnc9UQIX7UDLxr5vRlqeByXCwhkF6VabSsI0raWcyAQ==} + dependencies: + fast-glob: 3.3.2 + minimatch: 7.4.6 + mkdirp: 2.1.6 + path-browserify: 1.0.1 + dev: true + + /@tsconfig/node10@1.0.9: resolution: {integrity: sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==} dev: true @@ -2186,13 +1649,6 @@ packages: resolution: {integrity: sha512-ebDJ9b0e702Yr7pWgB0jzm+CX4Srzz8RcXtLJDJB+BSccqMa36uyH/zUsSYao5+BD1ytv3k3rPYCq4mAE1hsXA==} dev: true - /@types/bson@4.2.0: - resolution: {integrity: sha512-ELCPqAdroMdcuxqwMgUpifQyRoTpyYCNr1V9xKyF40VsBobsj+BbWNRvwGchMgBPGqkw655ypkjj2MEF5ywVwg==} - deprecated: This is a stub types definition. bson provides its own type definitions, so you do not need this installed. - dependencies: - bson: 6.5.0 - dev: false - /@types/chai-subset@1.3.5: resolution: {integrity: sha512-c2mPnw+xHtXDoHmdtcCXGwyLMiauiAyxWMzhGpqHC4nqI/Y5G2XhTampslK2rb59kpcuHon03UH8W6iYUzw88A==} dependencies: @@ -2207,82 +1663,18 @@ packages: resolution: {integrity: sha512-loB369iXNmAZglwWATL+WRe+CRMmmBPtpolYzIebFaX4YA3x+BEfLqhUAV9WanycKI3TG1IMr5bMJDajDKLlUQ==} requiresBuild: true dependencies: - '@types/node': 16.11.7 + '@types/node': 20.5.1 dev: true optional: true - /@types/cross-spawn@6.0.6: - resolution: {integrity: sha512-fXRhhUkG4H3TQk5dBhQ7m/JDdSNHKwR2BBia62lhwEIq9xGiQKLxd6LymNhn47SjXhsUEPmxi+PKw2OkW4LLjA==} - dependencies: - '@types/node': 16.11.7 - dev: true - - /@types/ejs@3.1.5: - resolution: {integrity: sha512-nv+GSx77ZtXiJzwKdsASqi+YQ5Z7vwHsTP0JY2SiQgjGckkBRKZnk8nIM+7oUZ1VCtuTz0+By4qVR7fqzp/Dfg==} - dev: true - - /@types/eslint-visitor-keys@1.0.0: - resolution: {integrity: sha512-OCutwjDZ4aFS6PB1UZ988C4YgwlBHJd6wCeQqaLdmadZ/7e+w79+hbMUFC1QXDNCmdyoRfAFdm0RypzwR+Qpag==} - dev: true - - /@types/estree@0.0.39: - resolution: {integrity: sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==} - dev: true - /@types/estree@1.0.5: resolution: {integrity: sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==} dev: true - /@types/fs-extra@5.1.0: - resolution: {integrity: sha512-AInn5+UBFIK9FK5xc9yP5e3TQSPNNgjHByqYcj9g5elVBnDQcQL7PlO1CIRy2gWlbwK7UPYqi7vRvFA44dCmYQ==} - dependencies: - '@types/node': 16.11.7 - dev: true - - /@types/glob@8.1.0: - resolution: {integrity: sha512-IO+MJPVhoqz+28h1qLAcBEH2+xHMK6MTyHJc7MTnnYb6wsoLR29POVGJ7LycmVXIqyy/4/2ShP5sUwTXuOwb/w==} - dependencies: - '@types/minimatch': 5.1.2 - '@types/node': 16.11.7 - dev: true - - /@types/graceful-fs@4.1.9: - resolution: {integrity: sha512-olP3sd1qOEe5dXTSaFvQG+02VdRXcdytWLAZsAq1PecU8uqQAhkrnbli7DagjtXKW/Bl7YJbUsa8MPcuc8LHEQ==} - dependencies: - '@types/node': 16.11.7 - dev: false - - /@types/image-size@0.0.29: - resolution: {integrity: sha512-d47SGzTnoUXSLRn3Kej43FZXLduZjHJqkb26BmxKp9fQveCvjfirtpk7a5iLCGkJ/rur9kxUf7DwD2eKlPxjMg==} - dependencies: - '@types/node': 16.11.7 - dev: true - - /@types/inquirer@0.0.42: - resolution: {integrity: sha512-flMaNWU2g9NrtZ4bIV+7SEY2W7OdWNNhmJ0rE1lWVxGrkp3TfFGMcFCxRIBmGWigI8e6n+2HqLjizTTfgcpHLg==} - dependencies: - '@types/rx': 4.1.4 - '@types/through': 0.0.33 - dev: true - - /@types/js-yaml@4.0.9: - resolution: {integrity: sha512-k4MGaQl5TGo/iipqb2UDG2UwjXziSWkh0uysQelTlJpX1qGlpUZYm8PnO4DxG1qBomtJUdYJ6qR6xdIah10JLg==} - dev: true - /@types/json-schema@7.0.15: resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} dev: true - /@types/json5@0.0.29: - resolution: {integrity: sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==} - dev: true - - /@types/keyv@3.1.4: - resolution: {integrity: sha512-BQ5aZNSCpj7D6K2ksrRCTmKRLEpnPvWDiLPfoGyhZ++8YtiK9d/3DBKPJgry359X/P1PfruyYwvnvwFjuEiEIg==} - dependencies: - '@types/node': 16.11.7 - dev: false - /@types/lodash-es@4.17.12: resolution: {integrity: sha512-0NgftHUcV4v34VhXm8QBSftKVXtbkBG3ViCjs6+eJ5a6y6Mi/jiFGPc1sC7QK+9BFhWrURE3EOggmWaSxL9OzQ==} dependencies: @@ -2291,22 +1683,7 @@ packages: /@types/lodash@4.17.0: resolution: {integrity: sha512-t7dhREVv6dbNj0q17X12j7yDG4bD/DHYX7o5/DbDxobP0HnGPgpRz2Ej77aL7TZT3DSw13fqUTj8J4mMnqa7WA==} - - /@types/md5@2.3.5: - resolution: {integrity: sha512-/i42wjYNgE6wf0j2bcTX6kuowmdL/6PE4IVitMpm2eYKBUuYCprdcWVK+xEF0gcV6ufMCRhtxmReGfc6hIK7Jw==} - dev: true - - /@types/mime-types@2.1.4: - resolution: {integrity: sha512-lfU4b34HOri+kAY5UheuFMWPDOI+OPceBSHZKp69gEyTL/mmJ4cnU6Y/rlme3UL3GyOn6Y42hyIEw0/q8sWx5w==} - dev: true - - /@types/minimatch@3.0.5: - resolution: {integrity: sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ==} - dev: true - - /@types/minimatch@5.1.2: - resolution: {integrity: sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA==} - dev: true + dev: false /@types/minimist@1.2.2: resolution: {integrity: sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==} @@ -2316,9 +1693,6 @@ packages: resolution: {integrity: sha512-hov8bUuiLiyFPGyFPE1lwWhmzYbirOXQNNo40+y3zow8aFVTeyn3VWL0VFFfdNddA8S4Vf0Tc062rzyNr7Paag==} dev: true - /@types/node@16.11.7: - resolution: {integrity: sha512-QB5D2sqfSjCmTuWcBWyJ+/44bcjO7VbjSbOE0ucoVbAsSNQc4Lt6QkgkVXkTDwkL4z/beecZNDvVX15D4P8Jbw==} - /@types/node@20.5.1: resolution: {integrity: sha512-4tT2UrL5LBqDwoed9wZ6N3umC4Yhz3W3FloMmiiG4JwmUJWpie0c7lcnUNd4gtMKuDEO4wRVS8B6Xa0uMRsMKg==} dev: true @@ -2327,135 +1701,10 @@ packages: resolution: {integrity: sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==} dev: true - /@types/resolve@0.0.8: - resolution: {integrity: sha512-auApPaJf3NPfe18hSoJkp8EbZzer2ISk7o8mCC3M9he/a04+gbMF97NkpD2S8riMGvm4BMRI59/SZQSaLTKpsQ==} - dependencies: - '@types/node': 16.11.7 - dev: true - - /@types/resolve@1.17.1: - resolution: {integrity: sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw==} - dependencies: - '@types/node': 16.11.7 - dev: true - - /@types/responselike@1.0.3: - resolution: {integrity: sha512-H/+L+UkTV33uf49PH5pCAUBVPNj2nDBXTN+qS1dOwyyg24l3CcicicCA7ca+HMvJBZcFgl5r8e+RR6elsb4Lyw==} - dependencies: - '@types/node': 16.11.7 - dev: false - - /@types/rimraf@3.0.2: - resolution: {integrity: sha512-F3OznnSLAUxFrCEu/L5PY8+ny8DtcFRjx7fZZ9bycvXRi3KPTRS9HOitGZwvPg0juRhXFWIeKX58cnX5YqLohQ==} - dependencies: - '@types/glob': 8.1.0 - '@types/node': 16.11.7 - dev: true - - /@types/rx-core-binding@4.0.7: - resolution: {integrity: sha512-Lj4YEEGLaQndB2CQ0s7rNJGud8fzg/S2WL1XU3RwJjk7mwLQd8CzU+Suvzsh4NyjlU9eTb4Zj4I0QZ3sfmGS7g==} - dependencies: - '@types/rx-core': 4.0.6 - dev: true - - /@types/rx-core@4.0.6: - resolution: {integrity: sha512-x4VqenExHPSDWLQLl0G8YE/KQWNzK3aXf2Twg7hoEjlFXUbOprX3aMl2jPdoLoOKl/gGEo0PLZ2K9Te5rN2lWw==} - dev: true - - /@types/rx-lite-aggregates@4.0.6: - resolution: {integrity: sha512-JaJpAxKNGhzFqgpeVfhjrd9/ig2FSJmJUnptsSXDxNELSoufnv4b3h43TjBeiC7coi0Xr/stT/Qk1R70FTUgog==} - dependencies: - '@types/rx-lite': 4.0.10 - dev: true - - /@types/rx-lite-async@4.0.5: - resolution: {integrity: sha512-OjSFuusAEZYX04g5xx85yIxXuE4Ray2mM7Riww2oZ25Kg9FtfieocrxIMWHgOR555QlLQySV0949HRdou02Lvw==} - dependencies: - '@types/rx-lite': 4.0.10 - dev: true - - /@types/rx-lite-backpressure@4.0.5: - resolution: {integrity: sha512-jIXkD5io4LqkXYxg01ldqWgSlS9qRi6fFZOUaLSA/Id0higxiwEZqFjxA2KTofCgENv5IJvyGK4RiAH5o/phsQ==} - dependencies: - '@types/rx-lite': 4.0.10 - dev: true - - /@types/rx-lite-coincidence@4.0.6: - resolution: {integrity: sha512-GLSu07SnRI2cZkgNFMO/adu3zFR9A0bTb3uP//66XrSlrygH91hVot5NQrFsmwxixfJ6pFU9WcWAEVCK6Sdi1A==} - dependencies: - '@types/rx-lite': 4.0.10 - dev: true - - /@types/rx-lite-experimental@4.0.4: - resolution: {integrity: sha512-7I99UJN8PtiiUDAXiuYPHtEKLEPw2KzUouf+b4xpN73hMa2uqpDUCCI4uuPzJH0M/g+ULJSTzb1V7Tmqy0oDVg==} - dependencies: - '@types/rx-lite': 4.0.10 - dev: true - - /@types/rx-lite-joinpatterns@4.0.4: - resolution: {integrity: sha512-9GHyCl/IROLg4BscYf8N/b0TiRmkXcQOefXCcsdXz1sJ0oWK5VZaoGlSaeC2uCZSU2cSq2HvGA5jv32d0HS+DQ==} - dependencies: - '@types/rx-lite': 4.0.10 - dev: true - - /@types/rx-lite-testing@4.0.4: - resolution: {integrity: sha512-zT9QpeNHQhekh0CTOurnH692ADSn7koCVYZoFqOL4RPuvJcG/M8DBAF2VTzOpQuDyLiu6sQafRw2oop10xKJRw==} - dependencies: - '@types/rx-lite-virtualtime': 4.0.6 - dev: true - - /@types/rx-lite-time@4.0.6: - resolution: {integrity: sha512-bEDm22LwRlW4RtMKn+ALz79Esc6Bur5nj8hVOf7PLd9xCZLu1xEbcgY9692luhDKry9r7A8GUecfYwm1U9FW1A==} - dependencies: - '@types/rx-lite': 4.0.10 - dev: true - - /@types/rx-lite-virtualtime@4.0.6: - resolution: {integrity: sha512-AAsV20sdLpusZN0SdN8tJld4iUQUGUrBWX99qIh6Gh7ke9EkbNaCo2O+8+fpYtHSN6THG2M6Zc+x2a9TMVvlhg==} - dependencies: - '@types/rx-lite': 4.0.10 - dev: true - - /@types/rx-lite@4.0.10: - resolution: {integrity: sha512-KAUn8LFfEMGwI8vSet+L0PyHT1gacz4/Pz1a3gmL7FtTKW+f12WJH1OocjAGJAos9cQ7SgVFV0E//RzZAkakYQ==} - dependencies: - '@types/rx-core': 4.0.6 - '@types/rx-core-binding': 4.0.7 - dev: true - - /@types/rx@4.1.4: - resolution: {integrity: sha512-lCvPzEJKD5MJsOvCRk0RciRmER+BLmk9Z/EKgpYBkj6imocWPTDQ9WRM988icVmbXzsJ3Ffw3fnyIz+6geogAg==} - dependencies: - '@types/rx-core': 4.0.6 - '@types/rx-core-binding': 4.0.7 - '@types/rx-lite': 4.0.10 - '@types/rx-lite-aggregates': 4.0.6 - '@types/rx-lite-async': 4.0.5 - '@types/rx-lite-backpressure': 4.0.5 - '@types/rx-lite-coincidence': 4.0.6 - '@types/rx-lite-experimental': 4.0.4 - '@types/rx-lite-joinpatterns': 4.0.4 - '@types/rx-lite-testing': 4.0.4 - '@types/rx-lite-time': 4.0.6 - '@types/rx-lite-virtualtime': 4.0.6 - dev: true - /@types/semver@7.5.8: resolution: {integrity: sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==} dev: true - /@types/through@0.0.33: - resolution: {integrity: sha512-HsJ+z3QuETzP3cswwtzt2vEIiHBk/dCcHGhbmG5X3ecnwFD/lPrMpliGXxSCg03L9AhrdwA4Oz/qfspkDW+xGQ==} - dependencies: - '@types/node': 16.11.7 - dev: true - - /@types/tunnel@0.0.3: - resolution: {integrity: sha512-sOUTGn6h1SfQ+gbgqC364jLFBw2lnFqkgF3q0WovEHRLMrVD1sd5aufqi/aJObLekJO+Aq5z646U4Oxy6shXMA==} - dependencies: - '@types/node': 16.11.7 - dev: true - /@types/web-bluetooth@0.0.16: resolution: {integrity: sha512-oh8q2Zc32S6gd/j50GowEjKLoOVOwHP/bWVjKJInBwQqdOYMdPrf1oVlelTlyfFK3CKxL1uahMDAr+vy8T7yMQ==} dev: false @@ -2463,30 +1712,6 @@ packages: /@types/web-bluetooth@0.0.20: resolution: {integrity: sha512-g9gZnnXVq7gM7v3tJCWV/qw7w+KeOlSHAhgF9RytFyifW6AF61hdT2ucrYhPq9hLs5JIryeupHV3qGk95dH9ow==} - /@typescript-eslint/eslint-plugin@3.10.1(@typescript-eslint/parser@3.10.1)(eslint@7.32.0)(typescript@4.9.5): - resolution: {integrity: sha512-PQg0emRtzZFWq6PxBcdxRH3QIQiyFO3WCVpRL3fgj5oQS3CDs3AeAKfv4DxNhzn8ITdNJGJ4D3Qw8eAJf3lXeQ==} - engines: {node: ^10.12.0 || >=12.0.0} - peerDependencies: - '@typescript-eslint/parser': ^3.0.0 - eslint: ^5.0.0 || ^6.0.0 || ^7.0.0 - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - dependencies: - '@typescript-eslint/experimental-utils': 3.10.1(eslint@7.32.0)(typescript@4.9.5) - '@typescript-eslint/parser': 3.10.1(eslint@7.32.0)(typescript@4.9.5) - debug: 4.3.4 - eslint: 7.32.0 - functional-red-black-tree: 1.0.1 - regexpp: 3.2.0 - semver: 7.6.0 - tsutils: 3.21.0(typescript@4.9.5) - typescript: 4.9.5 - transitivePeerDependencies: - - supports-color - dev: true - /@typescript-eslint/eslint-plugin@5.62.0(@typescript-eslint/parser@5.62.0)(eslint@8.57.0)(typescript@4.9.5): resolution: {integrity: sha512-TiZzBSJja/LbhNPvk6yc0JrX9XqhQ0hdh6M2svYfsHGejaKFIAGd9MQ+ERIMzLGlN/kZoYIgdxFV0PuljTKXag==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -2543,44 +1768,6 @@ packages: - supports-color dev: true - /@typescript-eslint/experimental-utils@3.10.1(eslint@7.32.0)(typescript@4.9.5): - resolution: {integrity: sha512-DewqIgscDzmAfd5nOGe4zm6Bl7PKtMG2Ad0KG8CUZAHlXfAKTF9Ol5PXhiMh39yRL2ChRH1cuuUGOcVyyrhQIw==} - engines: {node: ^10.12.0 || >=12.0.0} - peerDependencies: - eslint: '*' - dependencies: - '@types/json-schema': 7.0.15 - '@typescript-eslint/types': 3.10.1 - '@typescript-eslint/typescript-estree': 3.10.1(typescript@4.9.5) - eslint: 7.32.0 - eslint-scope: 5.1.1 - eslint-utils: 2.1.0 - transitivePeerDependencies: - - supports-color - - typescript - dev: true - - /@typescript-eslint/parser@3.10.1(eslint@7.32.0)(typescript@4.9.5): - resolution: {integrity: sha512-Ug1RcWcrJP02hmtaXVS3axPPTTPnZjupqhgj+NnZ6BCkwSImWk/283347+x9wN+lqOdK9Eo3vsyiyDHgsmiEJw==} - engines: {node: ^10.12.0 || >=12.0.0} - peerDependencies: - eslint: ^5.0.0 || ^6.0.0 || ^7.0.0 - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - dependencies: - '@types/eslint-visitor-keys': 1.0.0 - '@typescript-eslint/experimental-utils': 3.10.1(eslint@7.32.0)(typescript@4.9.5) - '@typescript-eslint/types': 3.10.1 - '@typescript-eslint/typescript-estree': 3.10.1(typescript@4.9.5) - eslint: 7.32.0 - eslint-visitor-keys: 1.3.0 - typescript: 4.9.5 - transitivePeerDependencies: - - supports-color - dev: true - /@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@4.9.5): resolution: {integrity: sha512-VlJEV0fOQ7BExOsHYAGrgbEiZoi8D+Bl2+f6V2RrXerRSylnp+ZBHmPvaIa8cz0Ajx7WO7Z5RqfgYg7ED1nRhA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -2669,38 +1856,11 @@ packages: - supports-color dev: true - /@typescript-eslint/types@3.10.1: - resolution: {integrity: sha512-+3+FCUJIahE9q0lDi1WleYzjCwJs5hIsbugIgnbB+dSCYUxl8L6PwmsyOPFZde2hc1DlTo/xnkOgiTLSyAbHiQ==} - engines: {node: ^8.10.0 || ^10.13.0 || >=11.10.1} - dev: true - /@typescript-eslint/types@5.62.0: resolution: {integrity: sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true - /@typescript-eslint/typescript-estree@3.10.1(typescript@4.9.5): - resolution: {integrity: sha512-QbcXOuq6WYvnB3XPsZpIwztBoquEYLXh2MtwVU+kO8jgYCiv4G5xrSP/1wg4tkvrEE+esZVquIPX/dxPlePk1w==} - engines: {node: ^10.12.0 || >=12.0.0} - peerDependencies: - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - dependencies: - '@typescript-eslint/types': 3.10.1 - '@typescript-eslint/visitor-keys': 3.10.1 - debug: 4.3.4 - glob: 7.2.3 - is-glob: 4.0.3 - lodash: 4.17.21 - semver: 7.6.0 - tsutils: 3.21.0(typescript@4.9.5) - typescript: 4.9.5 - transitivePeerDependencies: - - supports-color - dev: true - /@typescript-eslint/typescript-estree@5.62.0(typescript@4.9.5): resolution: {integrity: sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -2783,13 +1943,6 @@ packages: - typescript dev: true - /@typescript-eslint/visitor-keys@3.10.1: - resolution: {integrity: sha512-9JgC82AaQeglebjZMgYR5wgmfUdUc+EitGUUMW8u2nDckaeimzW+VsoLV6FoimPv2id3VQzfjwBxEMVz08ameQ==} - engines: {node: ^8.10.0 || ^10.13.0 || >=11.10.1} - dependencies: - eslint-visitor-keys: 1.3.0 - dev: true - /@typescript-eslint/visitor-keys@5.62.0: resolution: {integrity: sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -3095,14 +2248,6 @@ packages: deprecated: Use your platform's native atob() and btoa() methods instead dev: true - /acorn-jsx@5.3.2(acorn@7.4.1): - resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} - peerDependencies: - acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 - dependencies: - acorn: 7.4.1 - dev: true - /acorn-jsx@5.3.2(acorn@8.11.3): resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} peerDependencies: @@ -3116,22 +2261,12 @@ packages: engines: {node: '>=0.4.0'} dev: true - /acorn@7.4.1: - resolution: {integrity: sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==} - engines: {node: '>=0.4.0'} - hasBin: true - dev: true - /acorn@8.11.3: resolution: {integrity: sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==} engines: {node: '>=0.4.0'} hasBin: true dev: true - /add-stream@1.0.0: - resolution: {integrity: sha512-qQLMr+8o0WC4FZGQTcJiKBVC59JylcPSrTtk6usvmIDFUOCKegapy1VHQwRbFMOFyb/inzUVqHs+eMYKDM1YeQ==} - dev: true - /agent-base@6.0.2: resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==} engines: {node: '>= 6.0.0'} @@ -3150,13 +2285,6 @@ packages: - supports-color dev: true - /agentkeepalive@4.5.0: - resolution: {integrity: sha512-5GG/5IbQQpC9FpkRGsSvZI5QYeSCzlJHdpBQntCsuTOxhKD8lqKhrleg2Yi7yvMIf82Ycmmqln9U8V9qwEiJew==} - engines: {node: '>= 8.0.0'} - dependencies: - humanize-ms: 1.2.1 - dev: false - /ajv@6.12.6: resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==} dependencies: @@ -3175,14 +2303,10 @@ packages: uri-js: 4.4.1 dev: true - /ansi-colors@4.1.3: - resolution: {integrity: sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==} - engines: {node: '>=6'} - dev: true - /ansi-escapes@3.2.0: resolution: {integrity: sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ==} engines: {node: '>=4'} + dev: true /ansi-escapes@4.3.2: resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==} @@ -3194,10 +2318,12 @@ packages: /ansi-regex@3.0.1: resolution: {integrity: sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==} engines: {node: '>=4'} + dev: true /ansi-regex@4.1.1: resolution: {integrity: sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==} engines: {node: '>=6'} + dev: true /ansi-regex@5.0.1: resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} @@ -3208,6 +2334,7 @@ packages: engines: {node: '>=4'} dependencies: color-convert: 1.9.3 + dev: true /ansi-styles@4.3.0: resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} @@ -3220,10 +2347,6 @@ packages: engines: {node: '>=10'} dev: true - /any-promise@1.3.0: - resolution: {integrity: sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==} - dev: false - /anymatch@3.1.3: resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==} engines: {node: '>= 8'} @@ -3232,13 +2355,6 @@ packages: picomatch: 2.3.1 dev: true - /archive-type@4.0.0: - resolution: {integrity: sha512-zV4Ky0v1F8dBrdYElwTvQhweQ0P7Kwc1aluqJsYtOBP01jXcWCyW2IEfI1YiqsG+Iy7ZR+o5LF1N+PGECBxHWA==} - engines: {node: '>=4'} - dependencies: - file-type: 4.4.0 - dev: false - /arg@4.1.3: resolution: {integrity: sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==} dev: true @@ -3258,96 +2374,13 @@ packages: dequal: 2.0.3 dev: true - /array-buffer-byte-length@1.0.1: - resolution: {integrity: sha512-ahC5W1xgou+KTXix4sAO8Ki12Q+jf4i0+tmk3sC+zgcynshkHxzpXdImBehiUYKKKDwvfFiJl1tZt6ewscS1Mg==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.7 - is-array-buffer: 3.0.4 - dev: true - - /array-find-index@1.0.2: - resolution: {integrity: sha512-M1HQyIXcBGtVywBt8WVdim+lrNaK7VHp99Qt5pSNziXznKHViIBbXWtfRTpEFpF/c4FdfxNAsCCwPp5phBYJtw==} - engines: {node: '>=0.10.0'} - dev: true - /array-ify@1.0.0: resolution: {integrity: sha512-c5AMf34bKdvPhQ7tBGhqkgKNUzMr4WUs+WDtC2ZUGOUncbxKMTvqxYctiseW3+L4bA8ec+GcZ6/A/FW4m8ukng==} dev: true - /array-includes@3.1.7: - resolution: {integrity: sha512-dlcsNBIiWhPkHdOEEKnehA+RNUWDc4UqFtnIXU4uuYDPtA4LDkr7qip2p0VvFAEXNDr0yWZ9PJyIRiGjRLQzwQ==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.7 - define-properties: 1.2.1 - es-abstract: 1.22.5 - get-intrinsic: 1.2.4 - is-string: 1.0.7 - dev: true - - /array-timsort@1.0.3: - resolution: {integrity: sha512-/+3GRL7dDAGEfM6TseQk/U+mi18TU2Ms9I3UlLdUMhz2hbvGNTKdj9xniwXfUqgYhHxRx0+8UnKkvlNwVU+cWQ==} - dev: false - /array-union@2.1.0: resolution: {integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==} engines: {node: '>=8'} - - /array.prototype.filter@1.0.3: - resolution: {integrity: sha512-VizNcj/RGJiUyQBgzwxzE5oHdeuXY5hSbbmKMlphj1cy1Vl7Pn2asCGbSrru6hSQjmCzqTBPVWAF/whmEOVHbw==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.7 - define-properties: 1.2.1 - es-abstract: 1.22.5 - es-array-method-boxes-properly: 1.0.0 - is-string: 1.0.7 - dev: true - - /array.prototype.findlastindex@1.2.4: - resolution: {integrity: sha512-hzvSHUshSpCflDR1QMUBLHGHP1VIEBegT4pix9H/Z92Xw3ySoy6c2qh7lJWTJnRJ8JCZ9bJNCgTyYaJGcJu6xQ==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.7 - define-properties: 1.2.1 - es-abstract: 1.22.5 - es-errors: 1.3.0 - es-shim-unscopables: 1.0.2 - dev: true - - /array.prototype.flat@1.3.2: - resolution: {integrity: sha512-djYB+Zx2vLewY8RWlNCUdHjDXs2XOgm602S9E7P/UpHgfeHL00cRiIF+IN/G/aUJ7kGPb6yO/ErDI5V2s8iycA==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.7 - define-properties: 1.2.1 - es-abstract: 1.22.5 - es-shim-unscopables: 1.0.2 - dev: true - - /array.prototype.flatmap@1.3.2: - resolution: {integrity: sha512-Ewyx0c9PmpcsByhSW4r+9zDU7sGjFc86qf/kKtuSCRdhfbk0SNLLkaT5qvcHnRGgc5NP/ly/y+qkXkqONX54CQ==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.7 - define-properties: 1.2.1 - es-abstract: 1.22.5 - es-shim-unscopables: 1.0.2 - dev: true - - /arraybuffer.prototype.slice@1.0.3: - resolution: {integrity: sha512-bMxMKAjg13EBSVscxTaYA4mRc5t1UAXa2kXiGTNfZ079HIWXEkKmkgFrh/nJqamaLSrXO5H4WFFkPEaLJWbs3A==} - engines: {node: '>= 0.4'} - dependencies: - array-buffer-byte-length: 1.0.1 - call-bind: 1.0.7 - define-properties: 1.2.1 - es-abstract: 1.22.5 - es-errors: 1.3.0 - get-intrinsic: 1.2.4 - is-array-buffer: 3.0.4 - is-shared-array-buffer: 1.0.3 dev: true /arrify@1.0.1: @@ -3377,11 +2410,6 @@ packages: resolution: {integrity: sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==} dev: true - /astral-regex@2.0.0: - resolution: {integrity: sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==} - engines: {node: '>=8'} - dev: true - /astro-eslint-parser@0.13.3: resolution: {integrity: sha512-n+fb6O40SM6sD36lGwgVIE3zeVQUMdl6ZHaHEjRI4zdaBu658XaAV1YDztF7Iga5kmeOxJYB87mcQ+lUnQs0Nw==} engines: {node: ^14.18.0 || >=16.0.0} @@ -3418,6 +2446,7 @@ packages: /asynckit@0.4.0: resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} + dev: true /at-least-node@1.0.0: resolution: {integrity: sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==} @@ -3431,76 +2460,25 @@ packages: possible-typed-array-names: 1.0.0 dev: true - /axios@0.27.2: - resolution: {integrity: sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==} - dependencies: - follow-redirects: 1.15.5 - form-data: 4.0.0 - transitivePeerDependencies: - - debug - dev: false - /axobject-query@4.0.0: resolution: {integrity: sha512-+60uv1hiVFhHZeO+Lz0RYzsVHy5Wr1ayX0mwda9KPDVLNJgZ1T9Ny7VmFbLDzxsH0D87I86vgj3gFrjTJUYznw==} dependencies: dequal: 2.0.3 dev: true - /babel-eslint@10.1.0(eslint@7.32.0): - resolution: {integrity: sha512-ifWaTHQ0ce+448CYop8AdrQiBsGrnC+bMgfyKFdi6EsPLTAWG+QfyDeM6OH+FmWnKvEq5NnBMLvlBUPKQZoDSg==} - engines: {node: '>=6'} - deprecated: babel-eslint is now @babel/eslint-parser. This package will no longer receive updates. - peerDependencies: - eslint: '>= 4.12.1' - dependencies: - '@babel/code-frame': 7.23.5 - '@babel/parser': 7.24.0 - '@babel/traverse': 7.24.0 - '@babel/types': 7.24.0 - eslint: 7.32.0 - eslint-visitor-keys: 1.3.0 - resolve: 1.22.8 - transitivePeerDependencies: - - supports-color - dev: true - - /babel-polyfill@6.26.0: - resolution: {integrity: sha512-F2rZGQnAdaHWQ8YAoeRbukc7HS9QgdgeyJ0rQDd485v9opwuPvjpPFcOOT/WmkKTdgy9ESgSPXDcTNpzrGr6iQ==} - dependencies: - babel-runtime: 6.26.0 - core-js: 2.6.12 - regenerator-runtime: 0.10.5 - dev: true - - /babel-runtime@6.26.0: - resolution: {integrity: sha512-ITKNuq2wKlW1fJg9sSW52eepoYgZBggvOAHC0u/CYu/qxQ9EVzThCgR69BnSXLHjy2f7SY5zaQ4yt7H9ZVxY2g==} - dependencies: - core-js: 2.6.12 - regenerator-runtime: 0.11.1 - dev: true - /balanced-match@1.0.2: resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} + dev: true /base64-js@1.5.1: resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} - - /before@0.0.1: - resolution: {integrity: sha512-1J5SWbkoVJH9DTALN8igB4p+nPKZzPrJ/HomqBDLpfUvDXCdjdBmBUcH5McZfur0lftVssVU6BZug5NYh87zTw==} - dev: false + dev: true /binary-extensions@2.2.0: resolution: {integrity: sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==} engines: {node: '>=8'} dev: true - /bl@1.2.3: - resolution: {integrity: sha512-pvcNpa0UU69UT341rO6AYy4FVAIkUHuZXRIWbq+zHnsVcRzDDjIAhGuuYoi0d//cwIwtt4pkpKycWEfjdV+vww==} - dependencies: - readable-stream: 2.3.8 - safe-buffer: 5.2.1 - dev: false - /bl@4.1.0: resolution: {integrity: sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==} dependencies: @@ -3509,12 +2487,6 @@ packages: readable-stream: 3.6.2 dev: true - /block-stream2@2.1.0: - resolution: {integrity: sha512-suhjmLI57Ewpmq00qaygS8UgEq2ly2PCItenIyhMqVjo4t4pGzqMvfgJuX8iWTeSDdfSSqS6j38fL4ToNL7Pfg==} - dependencies: - readable-stream: 3.6.2 - dev: false - /blueimp-md5@2.19.0: resolution: {integrity: sha512-DRQrD6gJyy8FbiE4s+bDoXS9hiW3Vbx5uCdwvcCf3zLHL+Iv7LtGHLpr+GZV8rHG8tK766FGYBwRbu8pELTt+w==} dev: true @@ -3536,6 +2508,7 @@ packages: dependencies: balanced-match: 1.0.2 concat-map: 0.0.1 + dev: true /brace-expansion@2.0.1: resolution: {integrity: sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==} @@ -3548,6 +2521,7 @@ packages: engines: {node: '>=8'} dependencies: fill-range: 7.0.1 + dev: true /brorand@1.1.0: resolution: {integrity: sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==} @@ -3616,30 +2590,6 @@ packages: pako: 1.0.11 dev: true - /bson@6.5.0: - resolution: {integrity: sha512-DXf1BTAS8vKyR90BO4x5v3rKVarmkdkzwOrnYDFdjAY694ILNDkmA3uRh1xXJEl+C1DAh8XCvAQ+Gh3kzubtpg==} - engines: {node: '>=16.20.1'} - dev: false - - /buffer-alloc-unsafe@1.1.0: - resolution: {integrity: sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg==} - dev: false - - /buffer-alloc@1.2.0: - resolution: {integrity: sha512-CFsHQgjtW1UChdXgbyJGtnm+O/uLQeZdtbDo8mfUgYXCHSM1wgrVxXm6bSyrUuErEb+4sYVGCzASBRot7zyrow==} - dependencies: - buffer-alloc-unsafe: 1.1.0 - buffer-fill: 1.0.0 - dev: false - - /buffer-crc32@0.2.13: - resolution: {integrity: sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==} - dev: false - - /buffer-fill@1.0.0: - resolution: {integrity: sha512-T7zexNBwiiaCOGDg9xNX9PBmjrubblRkENuptryuI64URkXDFum9il/JGL8Lm8wYfAXpredVXXZz7eMHilimiQ==} - dev: false - /buffer-from@1.1.2: resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==} dev: true @@ -3653,39 +2603,17 @@ packages: dependencies: base64-js: 1.5.1 ieee754: 1.2.1 - - /builtin-modules@3.3.0: - resolution: {integrity: sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==} - engines: {node: '>=6'} dev: true /builtin-status-codes@3.0.0: resolution: {integrity: sha512-HpGFw18DgFWlncDfjTa2rcQ4W88O1mC8e8yZ2AvQY5KDaktSTwo+KRf6nHK6FRI5FyRyb/5T6+TSxfP7QyGsmQ==} dev: true - /builtins@4.1.0: - resolution: {integrity: sha512-1bPRZQtmKaO6h7qV1YHXNtr6nCK28k0Zo95KM4dXfILcZZwoHJBN1m3lfLv9LPkcOZlrSr+J1bzMaZFO98Yq0w==} - dependencies: - semver: 7.6.0 - dev: true - /cac@6.7.14: resolution: {integrity: sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==} engines: {node: '>=8'} dev: true - /cacheable-request@2.1.4: - resolution: {integrity: sha512-vag0O2LKZ/najSoUwDbVlnlCFvhBE/7mGTY2B5FgCBDcRD+oVV1HYTOwM6JZfMg/hIcM6IwnTZ1uQQL5/X3xIQ==} - dependencies: - clone-response: 1.0.2 - get-stream: 3.0.0 - http-cache-semantics: 3.8.1 - keyv: 3.0.0 - lowercase-keys: 1.0.0 - normalize-url: 2.0.1 - responselike: 1.0.2 - dev: false - /cachedir@2.3.0: resolution: {integrity: sha512-A+Fezp4zxnit6FanDmv9EqXNAi3vt9DWp51/71UEhXukb7QUuvtv9344h91dyAxuTLoSYJFU299qzR3tzwPAhw==} engines: {node: '>=6'} @@ -3700,24 +2628,6 @@ packages: function-bind: 1.1.2 get-intrinsic: 1.2.4 set-function-length: 1.2.2 - - /caller-callsite@2.0.0: - resolution: {integrity: sha512-JuG3qI4QOftFsZyOn1qq87fq5grLIyk1JYd5lJmdA+fG7aQ9pA/i3JIJGcO3q0MrRcHlOt1U+ZeHW8Dq9axALQ==} - engines: {node: '>=4'} - dependencies: - callsites: 2.0.0 - dev: true - - /caller-path@2.0.0: - resolution: {integrity: sha512-MCL3sf6nCSXOwCTzvPKhN18TU7AHTvdtam8DAogxcrJ8Rjfbbg7Lgng64H9Iy+vUV6VGFClN/TyxBkAebLRR4A==} - engines: {node: '>=4'} - dependencies: - caller-callsite: 2.0.0 - dev: true - - /callsites@2.0.0: - resolution: {integrity: sha512-ksWePWBloaWPxJYQ8TL0JHvtci6G5QTKwQ95RcWAa/lzoAKuAOflGdAK92hpHXjkwb8zLxoLNUoNYZgVsaJzvQ==} - engines: {node: '>=4'} dev: true /callsites@3.1.0: @@ -3732,15 +2642,6 @@ packages: tslib: 2.6.2 dev: true - /camelcase-keys@4.2.0: - resolution: {integrity: sha512-Ej37YKYbFUI8QiYlvj9YHb6/Z60dZyPJW0Cs8sFilMbd2lP0bw3ylAq9yJkK4lcTA2dID5fG8LjmJYbO7kWb7Q==} - engines: {node: '>=4'} - dependencies: - camelcase: 4.1.0 - map-obj: 2.0.0 - quick-lru: 1.1.0 - dev: true - /camelcase-keys@6.2.2: resolution: {integrity: sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg==} engines: {node: '>=8'} @@ -3750,26 +2651,11 @@ packages: quick-lru: 4.0.1 dev: true - /camelcase@4.1.0: - resolution: {integrity: sha512-FxAv7HpHrXbh3aPo4o2qxHay2lkLY3x5Mw3KeE4KQE8ysVfziWeRZDwcjauvwBSGEC/nXUPzZy8zeh4HokqOnw==} - engines: {node: '>=4'} - dev: true - /camelcase@5.3.1: resolution: {integrity: sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==} engines: {node: '>=6'} dev: true - /caw@2.0.1: - resolution: {integrity: sha512-Cg8/ZSBEa8ZVY9HspcGUYaK63d/bN7rqS3CYCzEGUxuYv6UlmcjzDUz2fCFFHyTvUW5Pk0I+3hkA3iXlIj6guA==} - engines: {node: '>=4'} - dependencies: - get-proxy: 2.1.0 - isurl: 1.0.0 - tunnel-agent: 0.6.0 - url-to-options: 1.0.1 - dev: false - /chai@4.4.1: resolution: {integrity: sha512-13sOfMv2+DWduEU+/xbun3LScLoqN17nBeTLUsmDfKdoiC1fr0n9PU4guu4AhRcOVFk/sW8LyZWHuhWtQZiF+g==} engines: {node: '>=4'} @@ -3783,15 +2669,6 @@ packages: type-detect: 4.0.8 dev: true - /chalk@2.3.1: - resolution: {integrity: sha512-QUU4ofkDoMIVO7hcx1iPTISs88wsO8jA92RQIm4JAwZvFGGAV2hSAA1NX7oVj2Ej2Q6NDTcRDjPTFrMCRZoJ6g==} - engines: {node: '>=4'} - dependencies: - ansi-styles: 3.2.1 - escape-string-regexp: 1.0.5 - supports-color: 5.5.0 - dev: true - /chalk@2.4.2: resolution: {integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==} engines: {node: '>=4'} @@ -3799,6 +2676,7 @@ packages: ansi-styles: 3.2.1 escape-string-regexp: 1.0.5 supports-color: 5.5.0 + dev: true /chalk@4.1.2: resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} @@ -3806,6 +2684,7 @@ packages: dependencies: ansi-styles: 4.3.0 supports-color: 7.2.0 + dev: true /chalk@5.3.0: resolution: {integrity: sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==} @@ -3816,10 +2695,7 @@ packages: /chardet@0.7.0: resolution: {integrity: sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==} - - /charenc@0.0.2: - resolution: {integrity: sha512-yrLQ/yVUFXkzg7EDQsPieE/53+0RlaWTs+wBrvW36cyilJ2SaDWfl4Yj7MtLTXleV9uEKefbAGUPv2/iWSooRA==} - dev: false + dev: true /check-error@1.0.3: resolution: {integrity: sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==} @@ -3842,10 +2718,6 @@ packages: fsevents: 2.3.3 dev: true - /ci-info@2.0.0: - resolution: {integrity: sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==} - dev: true - /ci-info@3.9.0: resolution: {integrity: sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==} engines: {node: '>=8'} @@ -3870,6 +2742,7 @@ packages: engines: {node: '>=4'} dependencies: restore-cursor: 2.0.0 + dev: true /cli-cursor@3.1.0: resolution: {integrity: sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==} @@ -3885,20 +2758,13 @@ packages: /cli-width@2.2.1: resolution: {integrity: sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw==} + dev: true /cli-width@3.0.0: resolution: {integrity: sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw==} engines: {node: '>= 10'} dev: true - /cliui@7.0.4: - resolution: {integrity: sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==} - dependencies: - string-width: 4.2.3 - strip-ansi: 6.0.1 - wrap-ansi: 7.0.0 - dev: true - /cliui@8.0.1: resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} engines: {node: '>=12'} @@ -3907,12 +2773,6 @@ packages: strip-ansi: 6.0.1 wrap-ansi: 7.0.0 - /clone-response@1.0.2: - resolution: {integrity: sha512-yjLXh88P599UOyPTFX0POsd7WxnbsVsGohcwzHOLspIhhpalPw1BcqED8NblyZLKcGrL8dTgMlcaZxV2jAD41Q==} - dependencies: - mimic-response: 1.0.1 - dev: false - /clone@1.0.4: resolution: {integrity: sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==} engines: {node: '>=0.8'} @@ -3936,6 +2796,7 @@ packages: resolution: {integrity: sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==} dependencies: color-name: 1.1.3 + dev: true /color-convert@2.0.1: resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} @@ -3945,6 +2806,7 @@ packages: /color-name@1.1.3: resolution: {integrity: sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==} + dev: true /color-name@1.1.4: resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} @@ -3963,13 +2825,16 @@ packages: engines: {node: '>= 0.8'} dependencies: delayed-stream: 1.0.0 + dev: true /commander@2.20.3: resolution: {integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==} + dev: true /commander@8.3.0: resolution: {integrity: sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==} engines: {node: '>= 12'} + dev: true /commander@9.5.0: resolution: {integrity: sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==} @@ -3978,51 +2843,6 @@ packages: dev: true optional: true - /comment-json@2.4.2: - resolution: {integrity: sha512-T+iXox779qsqneMYx/x5BZyz4xjCeQRmuNVzz8tko7qZUs3MlzpA3RAs+O1XsgcKToNBMIvfVzafGOeiU7RggA==} - engines: {node: '>= 6'} - dependencies: - core-util-is: 1.0.3 - esprima: 4.0.1 - has-own-prop: 2.0.0 - repeat-string: 1.6.1 - dev: false - - /comment-json@4.2.3: - resolution: {integrity: sha512-SsxdiOf064DWoZLH799Ata6u7iV658A11PlWtZATDlXPpKGJnbJZ5Z24ybixAi+LUUqJ/GKowAejtC5GFUG7Tw==} - engines: {node: '>= 6'} - dependencies: - array-timsort: 1.0.3 - core-util-is: 1.0.3 - esprima: 4.0.1 - has-own-prop: 2.0.0 - repeat-string: 1.6.1 - dev: false - - /commitizen@4.3.0(@types/node@16.11.7)(typescript@4.9.5): - resolution: {integrity: sha512-H0iNtClNEhT0fotHvGV3E9tDejDeS04sN1veIebsKYGMuGscFaswRoYJKmT3eW85eIJAs0F28bG2+a/9wCOfPw==} - engines: {node: '>= 12'} - hasBin: true - dependencies: - cachedir: 2.3.0 - cz-conventional-changelog: 3.3.0(@types/node@16.11.7)(typescript@4.9.5) - dedent: 0.7.0 - detect-indent: 6.1.0 - find-node-modules: 2.1.3 - find-root: 1.1.0 - fs-extra: 9.1.0 - glob: 7.2.3 - inquirer: 8.2.5 - is-utf8: 0.2.1 - lodash: 4.17.21 - minimist: 1.2.7 - strip-bom: 4.0.0 - strip-json-comments: 3.1.1 - transitivePeerDependencies: - - '@types/node' - - typescript - dev: true - /commitizen@4.3.0(@types/node@20.5.1)(typescript@5.4.2): resolution: {integrity: sha512-H0iNtClNEhT0fotHvGV3E9tDejDeS04sN1veIebsKYGMuGscFaswRoYJKmT3eW85eIJAs0F28bG2+a/9wCOfPw==} engines: {node: '>= 12'} @@ -4047,17 +2867,6 @@ packages: - typescript dev: true - /commondir@1.0.1: - resolution: {integrity: sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==} - dev: true - - /compare-func@1.3.4: - resolution: {integrity: sha512-sq2sWtrqKPkEXAC8tEJA1+BqAH9GbFkGBtUOqrUX57VSfwp8xyktctk+uLoRy5eccTdxzDcVIztlYDpKs3Jv1Q==} - dependencies: - array-ify: 1.0.0 - dot-prop: 3.0.0 - dev: true - /compare-func@2.0.0: resolution: {integrity: sha512-zHig5N+tPWARooBnb0Zx1MFcdfpyJrfTJ3Y5L+IFvUm8rM74hHz66z0gw0x4tijh5CorKkKUCnW82R2vmpeCRA==} dependencies: @@ -4071,15 +2880,6 @@ packages: /concat-map@0.0.1: resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} - - /concat-stream@1.6.2: - resolution: {integrity: sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==} - engines: {'0': node >= 0.8} - dependencies: - buffer-from: 1.1.2 - inherits: 2.0.4 - readable-stream: 2.3.8 - typedarray: 0.0.6 dev: true /concordance@5.0.4: @@ -4096,13 +2896,6 @@ packages: well-known-symbols: 2.0.0 dev: true - /config-chain@1.1.13: - resolution: {integrity: sha512-qj+f8APARXHrM0hraqXYb2/bOVSV4PvJQlNZ/DVj0QrmNM2q2euizkeuVckQ57J+W0mRH6Hvi+k50M4Jul2VRQ==} - dependencies: - ini: 1.3.8 - proto-list: 1.2.4 - dev: false - /connect-history-api-fallback@1.6.0: resolution: {integrity: sha512-e54B99q/OUoH64zYYRf3HBP5z24G38h5D3qXu23JGRoigpX5Ss4r9ZnDk3g0Z8uQC2x2lPaJ+UlWBc1ZWBWdLg==} engines: {node: '>=0.8'} @@ -4120,33 +2913,6 @@ packages: resolution: {integrity: sha512-xFxOwqIzR/e1k1gLiWEophSCMqXcwVHIH7akf7b/vxcUeGunlj3hvZaaqxwHsTgn+IndtkQJgSztIDWeumWJDQ==} dev: true - /content-disposition@0.5.4: - resolution: {integrity: sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==} - engines: {node: '>= 0.6'} - dependencies: - safe-buffer: 5.2.1 - dev: false - - /content-type@1.0.5: - resolution: {integrity: sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==} - engines: {node: '>= 0.6'} - dev: false - - /conventional-changelog-angular@1.6.6: - resolution: {integrity: sha512-suQnFSqCxRwyBxY68pYTsFkG0taIdinHLNEAX5ivtw8bCRnIgnpvcHmlR/yjUyZIrNPYAoXlY1WiEKWgSE4BNg==} - dependencies: - compare-func: 1.3.4 - q: 1.5.1 - dev: true - - /conventional-changelog-angular@5.0.13: - resolution: {integrity: sha512-i/gipMxs7s8L/QeuavPF2hLnJgH6pEZAttySB6aiQLWcX3puWDL3ACVmvBhJGxnAy52Qc15ua26BufY6KpmrVA==} - engines: {node: '>=10'} - dependencies: - compare-func: 2.0.0 - q: 1.5.1 - dev: true - /conventional-changelog-angular@6.0.0: resolution: {integrity: sha512-6qLgrBF4gueoC7AFVHu51nHL9pF9FRjXrH+ceVf7WmAfH3gs+gEYOkvxhjMPjZu57I4AGUGoNTY8V7Hrgf1uqg==} engines: {node: '>=14'} @@ -4154,271 +2920,55 @@ packages: compare-func: 2.0.0 dev: true - /conventional-changelog-atom@2.0.8: - resolution: {integrity: sha512-xo6v46icsFTK3bb7dY/8m2qvc8sZemRgdqLb/bjpBsH2UyOS8rKNTgcb5025Hri6IpANPApbXMg15QLb1LJpBw==} - engines: {node: '>=10'} - dependencies: - q: 1.5.1 - dev: true - - /conventional-changelog-codemirror@2.0.8: - resolution: {integrity: sha512-z5DAsn3uj1Vfp7po3gpt2Boc+Bdwmw2++ZHa5Ak9k0UKsYAO5mH1UBTN0qSCuJZREIhX6WU4E1p3IW2oRCNzQw==} - engines: {node: '>=10'} - dependencies: - q: 1.5.1 + /conventional-commit-types@3.0.0: + resolution: {integrity: sha512-SmmCYnOniSsAa9GqWOeLqc179lfr5TRu5b4QFDkbsrJ5TZjPJx85wtOr3zn+1dbeNiXDKGPbZ72IKbPhLXh/Lg==} dev: true - /conventional-changelog-conventionalcommits@4.6.3: - resolution: {integrity: sha512-LTTQV4fwOM4oLPad317V/QNQ1FY4Hju5qeBIM1uTHbrnCE+Eg4CdRZ3gO2pUeR+tzWdp80M2j3qFFEDWVqOV4g==} - engines: {node: '>=10'} + /conventional-commits-parser@4.0.0: + resolution: {integrity: sha512-WRv5j1FsVM5FISJkoYMR6tPk07fkKT0UodruX4je86V4owk451yjXAKzKAPOs9l7y59E2viHUS9eQ+dfUA9NSg==} + engines: {node: '>=14'} + hasBin: true dependencies: - compare-func: 2.0.0 - lodash: 4.17.21 - q: 1.5.1 + JSONStream: 1.3.5 + is-text-path: 1.0.1 + meow: 8.1.2 + split2: 3.2.2 dev: true - /conventional-changelog-core@4.2.4: - resolution: {integrity: sha512-gDVS+zVJHE2v4SLc6B0sLsPiloR0ygU7HaDW14aNJE1v4SlqJPILPl/aJC7YdtRE4CybBf8gDwObBvKha8Xlyg==} - engines: {node: '>=10'} - dependencies: - add-stream: 1.0.0 - conventional-changelog-writer: 5.0.1 - conventional-commits-parser: 3.2.4 - dateformat: 3.0.3 - get-pkg-repo: 4.2.1 - git-raw-commits: 2.0.11 - git-remote-origin-url: 2.0.0 - git-semver-tags: 4.1.1 - lodash: 4.17.21 - normalize-package-data: 3.0.3 - q: 1.5.1 - read-pkg: 3.0.0 - read-pkg-up: 3.0.0 - through2: 4.0.2 + /core-util-is@1.0.3: + resolution: {integrity: sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==} dev: true - /conventional-changelog-ember@2.0.9: - resolution: {integrity: sha512-ulzIReoZEvZCBDhcNYfDIsLTHzYHc7awh+eI44ZtV5cx6LVxLlVtEmcO+2/kGIHGtw+qVabJYjdI5cJOQgXh1A==} - engines: {node: '>=10'} + /cosmiconfig-typescript-loader@4.4.0(@types/node@20.5.1)(cosmiconfig@8.3.6)(ts-node@10.9.2)(typescript@5.4.2): + resolution: {integrity: sha512-BabizFdC3wBHhbI4kJh0VkQP9GkBfoHPydD0COMce1nJ1kJAB3F2TmJ/I7diULBKtmEWSwEbuN/KDtgnmUUVmw==} + engines: {node: '>=v14.21.3'} + peerDependencies: + '@types/node': '*' + cosmiconfig: '>=7' + ts-node: '>=10' + typescript: '>=4' dependencies: - q: 1.5.1 + '@types/node': 20.5.1 + cosmiconfig: 8.3.6(typescript@5.4.2) + ts-node: 10.9.2(@types/node@20.5.1)(typescript@5.4.2) + typescript: 5.4.2 dev: true - /conventional-changelog-eslint@3.0.9: - resolution: {integrity: sha512-6NpUCMgU8qmWmyAMSZO5NrRd7rTgErjrm4VASam2u5jrZS0n38V7Y9CzTtLT2qwz5xEChDR4BduoWIr8TfwvXA==} - engines: {node: '>=10'} + /cosmiconfig-typescript-loader@5.0.0(@types/node@20.5.1)(cosmiconfig@8.3.6)(typescript@5.4.2): + resolution: {integrity: sha512-+8cK7jRAReYkMwMiG+bxhcNKiHJDM6bR9FD/nGBXOWdMLuYawjF5cGrtLilJ+LGd3ZjCXnJjR5DkfWPoIVlqJA==} + engines: {node: '>=v16'} + requiresBuild: true + peerDependencies: + '@types/node': '*' + cosmiconfig: '>=8.2' + typescript: '>=4' dependencies: - q: 1.5.1 + '@types/node': 20.5.1 + cosmiconfig: 8.3.6(typescript@5.4.2) + jiti: 1.21.0 + typescript: 5.4.2 dev: true - - /conventional-changelog-express@2.0.6: - resolution: {integrity: sha512-SDez2f3iVJw6V563O3pRtNwXtQaSmEfTCaTBPCqn0oG0mfkq0rX4hHBq5P7De2MncoRixrALj3u3oQsNK+Q0pQ==} - engines: {node: '>=10'} - dependencies: - q: 1.5.1 - dev: true - - /conventional-changelog-jquery@3.0.11: - resolution: {integrity: sha512-x8AWz5/Td55F7+o/9LQ6cQIPwrCjfJQ5Zmfqi8thwUEKHstEn4kTIofXub7plf1xvFA2TqhZlq7fy5OmV6BOMw==} - engines: {node: '>=10'} - dependencies: - q: 1.5.1 - dev: true - - /conventional-changelog-jshint@2.0.9: - resolution: {integrity: sha512-wMLdaIzq6TNnMHMy31hql02OEQ8nCQfExw1SE0hYL5KvU+JCTuPaDO+7JiogGT2gJAxiUGATdtYYfh+nT+6riA==} - engines: {node: '>=10'} - dependencies: - compare-func: 2.0.0 - q: 1.5.1 - dev: true - - /conventional-changelog-preset-loader@2.3.4: - resolution: {integrity: sha512-GEKRWkrSAZeTq5+YjUZOYxdHq+ci4dNwHvpaBC3+ENalzFWuCWa9EZXSuZBpkr72sMdKB+1fyDV4takK1Lf58g==} - engines: {node: '>=10'} - dev: true - - /conventional-changelog-writer@5.0.1: - resolution: {integrity: sha512-5WsuKUfxW7suLblAbFnxAcrvf6r+0b7GvNaWUwUIk0bXMnENP/PEieGKVUQrjPqwPT4o3EPAASBXiY6iHooLOQ==} - engines: {node: '>=10'} - hasBin: true - dependencies: - conventional-commits-filter: 2.0.7 - dateformat: 3.0.3 - handlebars: 4.7.8 - json-stringify-safe: 5.0.1 - lodash: 4.17.21 - meow: 8.1.2 - semver: 6.3.1 - split: 1.0.1 - through2: 4.0.2 - dev: true - - /conventional-changelog@3.1.25: - resolution: {integrity: sha512-ryhi3fd1mKf3fSjbLXOfK2D06YwKNic1nC9mWqybBHdObPd8KJ2vjaXZfYj1U23t+V8T8n0d7gwnc9XbIdFbyQ==} - engines: {node: '>=10'} - dependencies: - conventional-changelog-angular: 5.0.13 - conventional-changelog-atom: 2.0.8 - conventional-changelog-codemirror: 2.0.8 - conventional-changelog-conventionalcommits: 4.6.3 - conventional-changelog-core: 4.2.4 - conventional-changelog-ember: 2.0.9 - conventional-changelog-eslint: 3.0.9 - conventional-changelog-express: 2.0.6 - conventional-changelog-jquery: 3.0.11 - conventional-changelog-jshint: 2.0.9 - conventional-changelog-preset-loader: 2.3.4 - dev: true - - /conventional-commit-types@3.0.0: - resolution: {integrity: sha512-SmmCYnOniSsAa9GqWOeLqc179lfr5TRu5b4QFDkbsrJ5TZjPJx85wtOr3zn+1dbeNiXDKGPbZ72IKbPhLXh/Lg==} - dev: true - - /conventional-commits-filter@2.0.7: - resolution: {integrity: sha512-ASS9SamOP4TbCClsRHxIHXRfcGCnIoQqkvAzCSbZzTFLfcTqJVugB0agRgsEELsqaeWgsXv513eS116wnlSSPA==} - engines: {node: '>=10'} - dependencies: - lodash.ismatch: 4.4.0 - modify-values: 1.0.1 - dev: true - - /conventional-commits-parser@2.1.7: - resolution: {integrity: sha512-BoMaddIEJ6B4QVMSDu9IkVImlGOSGA1I2BQyOZHeLQ6qVOJLcLKn97+fL6dGbzWEiqDzfH4OkcveULmeq2MHFQ==} - hasBin: true - dependencies: - JSONStream: 1.3.5 - is-text-path: 1.0.1 - lodash: 4.17.21 - meow: 4.0.1 - split2: 2.2.0 - through2: 2.0.5 - trim-off-newlines: 1.0.3 - dev: true - - /conventional-commits-parser@3.2.4: - resolution: {integrity: sha512-nK7sAtfi+QXbxHCYfhpZsfRtaitZLIA6889kFIouLvz6repszQDgxBu7wf2WbU+Dco7sAnNCJYERCwt54WPC2Q==} - engines: {node: '>=10'} - hasBin: true - dependencies: - JSONStream: 1.3.5 - is-text-path: 1.0.1 - lodash: 4.17.21 - meow: 8.1.2 - split2: 3.2.2 - through2: 4.0.2 - dev: true - - /conventional-commits-parser@4.0.0: - resolution: {integrity: sha512-WRv5j1FsVM5FISJkoYMR6tPk07fkKT0UodruX4je86V4owk451yjXAKzKAPOs9l7y59E2viHUS9eQ+dfUA9NSg==} - engines: {node: '>=14'} - hasBin: true - dependencies: - JSONStream: 1.3.5 - is-text-path: 1.0.1 - meow: 8.1.2 - split2: 3.2.2 - dev: true - - /copy-to@2.0.1: - resolution: {integrity: sha512-3DdaFaU/Zf1AnpLiFDeNCD4TOWe3Zl2RZaTzUvWiIk5ERzcCodOE20Vqq4fzCbNoHURFHT4/us/Lfq+S2zyY4w==} - dev: false - - /copyfiles@2.4.1: - resolution: {integrity: sha512-fereAvAvxDrQDOXybk3Qu3dPbOoKoysFMWtkY3mv5BsL8//OSZVL5DCLYqgRfY5cWirgRzlC+WSrxp6Bo3eNZg==} - hasBin: true - dependencies: - glob: 7.2.3 - minimatch: 3.1.2 - mkdirp: 1.0.4 - noms: 0.0.0 - through2: 2.0.5 - untildify: 4.0.0 - yargs: 16.2.0 - dev: true - - /core-js@2.6.12: - resolution: {integrity: sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==} - deprecated: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js. - requiresBuild: true - dev: true - - /core-util-is@1.0.3: - resolution: {integrity: sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==} - - /cosmiconfig-typescript-loader@4.4.0(@types/node@20.5.1)(cosmiconfig@8.3.6)(ts-node@10.9.2)(typescript@5.4.2): - resolution: {integrity: sha512-BabizFdC3wBHhbI4kJh0VkQP9GkBfoHPydD0COMce1nJ1kJAB3F2TmJ/I7diULBKtmEWSwEbuN/KDtgnmUUVmw==} - engines: {node: '>=v14.21.3'} - peerDependencies: - '@types/node': '*' - cosmiconfig: '>=7' - ts-node: '>=10' - typescript: '>=4' - dependencies: - '@types/node': 20.5.1 - cosmiconfig: 8.3.6(typescript@5.4.2) - ts-node: 10.9.2(@types/node@20.5.1)(typescript@5.4.2) - typescript: 5.4.2 - dev: true - - /cosmiconfig-typescript-loader@5.0.0(@types/node@16.11.7)(cosmiconfig@8.3.6)(typescript@4.9.5): - resolution: {integrity: sha512-+8cK7jRAReYkMwMiG+bxhcNKiHJDM6bR9FD/nGBXOWdMLuYawjF5cGrtLilJ+LGd3ZjCXnJjR5DkfWPoIVlqJA==} - engines: {node: '>=v16'} - requiresBuild: true - peerDependencies: - '@types/node': '*' - cosmiconfig: '>=8.2' - typescript: '>=4' - dependencies: - '@types/node': 16.11.7 - cosmiconfig: 8.3.6(typescript@4.9.5) - jiti: 1.21.0 - typescript: 4.9.5 - dev: true - optional: true - - /cosmiconfig-typescript-loader@5.0.0(@types/node@20.5.1)(cosmiconfig@8.3.6)(typescript@5.4.2): - resolution: {integrity: sha512-+8cK7jRAReYkMwMiG+bxhcNKiHJDM6bR9FD/nGBXOWdMLuYawjF5cGrtLilJ+LGd3ZjCXnJjR5DkfWPoIVlqJA==} - engines: {node: '>=v16'} - requiresBuild: true - peerDependencies: - '@types/node': '*' - cosmiconfig: '>=8.2' - typescript: '>=4' - dependencies: - '@types/node': 20.5.1 - cosmiconfig: 8.3.6(typescript@5.4.2) - jiti: 1.21.0 - typescript: 5.4.2 - dev: true - optional: true - - /cosmiconfig@5.2.1: - resolution: {integrity: sha512-H65gsXo1SKjf8zmrJ67eJk8aIRKV5ff2D4uKZIBZShbhGSpEmsQOPW/SKMKYhSTrqR7ufy6RP69rPogdaPh/kA==} - engines: {node: '>=4'} - dependencies: - import-fresh: 2.0.0 - is-directory: 0.3.1 - js-yaml: 3.14.1 - parse-json: 4.0.0 - dev: true - - /cosmiconfig@8.3.6(typescript@4.9.5): - resolution: {integrity: sha512-kcZ6+W5QzcJ3P1Mt+83OUv/oHFqZHIx8DuxG6eZ5RGMERoLqp4BuGjhHLYGK+Kf5XVkQvqBSmAy/nGWN3qDgEA==} - engines: {node: '>=14'} - peerDependencies: - typescript: '>=4.9.5' - peerDependenciesMeta: - typescript: - optional: true - dependencies: - import-fresh: 3.3.0 - js-yaml: 4.1.0 - parse-json: 5.2.0 - path-type: 4.0.0 - typescript: 4.9.5 - dev: true - optional: true + optional: true /cosmiconfig@8.3.6(typescript@5.4.2): resolution: {integrity: sha512-kcZ6+W5QzcJ3P1Mt+83OUv/oHFqZHIx8DuxG6eZ5RGMERoLqp4BuGjhHLYGK+Kf5XVkQvqBSmAy/nGWN3qDgEA==} @@ -4436,12 +2986,6 @@ packages: typescript: 5.4.2 dev: true - /crc32@0.2.2: - resolution: {integrity: sha512-PFZEGbDUeoNbL2GHIEpJRQGheXReDody/9axKTxhXtQqIL443wnNigtVZO9iuCIMPApKZRv7k2xr8euXHqNxQQ==} - engines: {node: '>= 0.4.0'} - hasBin: true - dev: false - /create-ecdh@4.0.4: resolution: {integrity: sha512-mf+TCx8wWc9VpuxfP2ht0iSISLZnt0JgWlrOKZiNqyUZWnjIaCIVNQArMHnCZKfEYRg6IM7A+NeJoN8gf/Ws0A==} dependencies: @@ -4474,32 +3018,6 @@ packages: resolution: {integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==} dev: true - /cross-env@7.0.3: - resolution: {integrity: sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==} - engines: {node: '>=10.14', npm: '>=6', yarn: '>=1'} - hasBin: true - dependencies: - cross-spawn: 7.0.3 - dev: true - - /cross-spawn@5.1.0: - resolution: {integrity: sha512-pTgQJ5KC0d2hcY8eyL1IzlBPYjTkyH72XRZPnLyKus2mBfNjQs3klqbJU2VILqZryAZUt9JOb3h/mWMy23/f5A==} - dependencies: - lru-cache: 4.1.5 - shebang-command: 1.2.0 - which: 1.3.1 - dev: true - - /cross-spawn@6.0.5: - resolution: {integrity: sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==} - engines: {node: '>=4.8'} - dependencies: - nice-try: 1.0.5 - path-key: 2.0.1 - semver: 5.7.2 - shebang-command: 1.2.0 - which: 1.3.1 - /cross-spawn@7.0.3: resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==} engines: {node: '>= 8'} @@ -4509,10 +3027,6 @@ packages: which: 2.0.2 dev: true - /crypt@0.0.2: - resolution: {integrity: sha512-mCxBlsHFYh9C+HVpiEacem8FEBnMXgU9gy4zmNC+SXAZNB/1idgp/aulFJ4FgCi7GPEVbfyng092GqL2k2rmow==} - dev: false - /crypto-browserify@3.12.0: resolution: {integrity: sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==} dependencies: @@ -4575,30 +3089,6 @@ packages: /csstype@3.1.3: resolution: {integrity: sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==} - /currently-unhandled@0.4.1: - resolution: {integrity: sha512-/fITjgjGU50vjQ4FH6eUoYu+iUoUKIXws2hL15JJpIR+BbTxaXQsMuuyjtNh2WqsSBS5nsaZHFsFecyw5CCAng==} - engines: {node: '>=0.10.0'} - dependencies: - array-find-index: 1.0.2 - dev: true - - /cz-conventional-changelog@3.3.0(@types/node@16.11.7)(typescript@4.9.5): - resolution: {integrity: sha512-U466fIzU5U22eES5lTNiNbZ+d8dfcHcssH4o7QsdWaCcRs/feIPCxKYSWkYBNs5mny7MvEfwpTLWjvbm94hecw==} - engines: {node: '>= 10'} - dependencies: - chalk: 2.4.2 - commitizen: 4.3.0(@types/node@16.11.7)(typescript@4.9.5) - conventional-commit-types: 3.0.0 - lodash.map: 4.6.0 - longest: 2.0.1 - word-wrap: 1.2.5 - optionalDependencies: - '@commitlint/load': 19.1.0(@types/node@16.11.7)(typescript@4.9.5) - transitivePeerDependencies: - - '@types/node' - - typescript - dev: true - /cz-conventional-changelog@3.3.0(@types/node@20.5.1)(typescript@5.4.2): resolution: {integrity: sha512-U466fIzU5U22eES5lTNiNbZ+d8dfcHcssH4o7QsdWaCcRs/feIPCxKYSWkYBNs5mny7MvEfwpTLWjvbm94hecw==} engines: {node: '>= 10'} @@ -4616,24 +3106,6 @@ packages: - typescript dev: true - /cz-customizable@5.10.0: - resolution: {integrity: sha512-8fzzmoXXAg3ydu5Uhx4g+XwgWNdjmvm/zycKzZejnhQn8Z+kvnqKwXhwm9thmFE67MIXDMS7n+A1wuMAEplddQ==} - dependencies: - editor: 1.0.0 - find-config: 1.0.0 - inquirer: 6.5.2 - lodash: 4.17.21 - temp: 0.9.4 - word-wrap: 1.2.5 - dev: true - - /dargs@4.1.0: - resolution: {integrity: sha512-jyweV/k0rbv2WK4r9KLayuBrSh2Py0tNmV7LBoSMH4hMQyrG8OPyIOWB2VEx4DJKXWmK4lopYMVvORlDt2S8Aw==} - engines: {node: '>=0.10.0'} - dependencies: - number-is-nan: 1.0.1 - dev: true - /dargs@7.0.0: resolution: {integrity: sha512-2iy1EkLdlBzQGvbweYRFxmFath8+K7+AKB0TlhHWkNuH+TmovaMH/Wp7V7R4u7f4SnX3OgLsU9t1NI9ioDnUpg==} engines: {node: '>=8'} @@ -4663,10 +3135,6 @@ packages: time-zone: 1.0.0 dev: true - /dateformat@3.0.3: - resolution: {integrity: sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q==} - dev: true - /dayjs@1.11.10: resolution: {integrity: sha512-vjAczensTgRcqDERK0SR2XMwsF/tSvnvlv6VcF2GIhg6Sx4yOIt/irsr1RDJsKiIyBzJDpCoXiWWq28MqH2cnQ==} dev: false @@ -4675,28 +3143,6 @@ packages: resolution: {integrity: sha512-e/1zu3xH5MQryN2zdVaF0OrdNLUbvWxzMbi+iNA6Bky7l1RoP8a2fIbRocyHclXt/arDrrR6lL3TqFD9pMQTsg==} dev: true - /debug@2.6.9: - resolution: {integrity: sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==} - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true - dependencies: - ms: 2.0.0 - dev: false - - /debug@3.2.7: - resolution: {integrity: sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==} - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true - dependencies: - ms: 2.1.2 - dev: true - /debug@4.3.4: resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} engines: {node: '>=6.0'} @@ -4726,71 +3172,6 @@ packages: resolution: {integrity: sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==} dev: true - /decode-uri-component@0.2.2: - resolution: {integrity: sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ==} - engines: {node: '>=0.10'} - dev: false - - /decompress-response@3.3.0: - resolution: {integrity: sha512-BzRPQuY1ip+qDonAOz42gRm/pg9F768C+npV/4JOsxRC2sq+Rlk+Q4ZCAsOhnIaMrgarILY+RMUIvMmmX1qAEA==} - engines: {node: '>=4'} - dependencies: - mimic-response: 1.0.1 - dev: false - - /decompress-tar@4.1.1: - resolution: {integrity: sha512-JdJMaCrGpB5fESVyxwpCx4Jdj2AagLmv3y58Qy4GE6HMVjWz1FeVQk1Ct4Kye7PftcdOo/7U7UKzYBJgqnGeUQ==} - engines: {node: '>=4'} - dependencies: - file-type: 5.2.0 - is-stream: 1.1.0 - tar-stream: 1.6.2 - dev: false - - /decompress-tarbz2@4.1.1: - resolution: {integrity: sha512-s88xLzf1r81ICXLAVQVzaN6ZmX4A6U4z2nMbOwobxkLoIIfjVMBg7TeguTUXkKeXni795B6y5rnvDw7rxhAq9A==} - engines: {node: '>=4'} - dependencies: - decompress-tar: 4.1.1 - file-type: 6.2.0 - is-stream: 1.1.0 - seek-bzip: 1.0.6 - unbzip2-stream: 1.4.3 - dev: false - - /decompress-targz@4.1.1: - resolution: {integrity: sha512-4z81Znfr6chWnRDNfFNqLwPvm4db3WuZkqV+UgXQzSngG3CEKdBkw5jrv3axjjL96glyiiKjsxJG3X6WBZwX3w==} - engines: {node: '>=4'} - dependencies: - decompress-tar: 4.1.1 - file-type: 5.2.0 - is-stream: 1.1.0 - dev: false - - /decompress-unzip@4.0.1: - resolution: {integrity: sha512-1fqeluvxgnn86MOh66u8FjbtJpAFv5wgCT9Iw8rcBqQcCo5tO8eiJw7NNTrvt9n4CRBVq7CstiS922oPgyGLrw==} - engines: {node: '>=4'} - dependencies: - file-type: 3.9.0 - get-stream: 2.3.1 - pify: 2.3.0 - yauzl: 2.10.0 - dev: false - - /decompress@4.2.1: - resolution: {integrity: sha512-e48kc2IjU+2Zw8cTb6VZcJQ3lgVbS4uuB1TfCHbiZIP/haNXm+SVyhu+87jts5/3ROpd82GSVCoNs/z8l4ZOaQ==} - engines: {node: '>=4'} - dependencies: - decompress-tar: 4.1.1 - decompress-tarbz2: 4.1.1 - decompress-targz: 4.1.1 - decompress-unzip: 4.0.1 - graceful-fs: 4.2.11 - make-dir: 1.3.0 - pify: 2.3.0 - strip-dirs: 2.1.0 - dev: false - /dedent@0.7.0: resolution: {integrity: sha512-Q6fKUPqnAHAyhiUgFU7BUzLiv0kd8saH9al7tnu5Q/okj6dnupxyTgFIBjVzJATdfIAm9NAsvXNzjaKa+bxVyA==} dev: true @@ -4811,13 +3192,6 @@ packages: engines: {node: '>=0.10.0'} dev: true - /default-user-agent@1.0.0: - resolution: {integrity: sha512-bDF7bg6OSNcSwFWPu4zYKpVkJZQYVrAANMYB8bc9Szem1D0yKdm4sa/rOCs2aC9+2GMqQ7KnwtZRvDhmLF0dXw==} - engines: {node: '>= 0.10.0'} - dependencies: - os-name: 1.0.3 - dev: false - /defaults@1.0.4: resolution: {integrity: sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==} dependencies: @@ -4831,6 +3205,7 @@ packages: es-define-property: 1.0.0 es-errors: 1.3.0 gopd: 1.0.1 + dev: true /define-properties@1.2.1: resolution: {integrity: sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==} @@ -4844,6 +3219,7 @@ packages: /delayed-stream@1.0.0: resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} engines: {node: '>=0.4.0'} + dev: true /dequal@2.0.3: resolution: {integrity: sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==} @@ -4857,11 +3233,6 @@ packages: minimalistic-assert: 1.0.1 dev: true - /destroy@1.2.0: - resolution: {integrity: sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==} - engines: {node: '>= 0.8', npm: 1.2.8000 || >= 1.4.16} - dev: false - /detect-file@1.0.0: resolution: {integrity: sha512-DtCOLG98P007x7wiiOmfI0fi3eIKyWiLTGJ2MDnVi/E04lWGbf+JzrRHMm0rgIIZJGtHpKpbVgLWHrv8xXpc3Q==} engines: {node: '>=0.10.0'} @@ -4890,22 +3261,11 @@ packages: randombytes: 2.1.0 dev: true - /digest-header@1.1.0: - resolution: {integrity: sha512-glXVh42vz40yZb9Cq2oMOt70FIoWiv+vxNvdKdU8CwjLad25qHM3trLxhl9bVjdr6WaslIXhWpn0NO8T/67Qjg==} - engines: {node: '>= 8.0.0'} - dev: false - /dir-glob@3.0.1: resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==} engines: {node: '>=8'} dependencies: path-type: 4.0.0 - - /doctrine@2.1.0: - resolution: {integrity: sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==} - engines: {node: '>=0.10.0'} - dependencies: - esutils: 2.0.3 dev: true /doctrine@3.0.0: @@ -4962,13 +3322,6 @@ packages: tslib: 2.6.2 dev: true - /dot-prop@3.0.0: - resolution: {integrity: sha512-k4ELWeEU3uCcwub7+dWydqQBRjAjkV9L33HjVRG5Xo2QybI6ja/v+4W73SRi8ubCqJz0l9XsTP1NbewfyqaSlw==} - engines: {node: '>=0.10.0'} - dependencies: - is-obj: 1.0.1 - dev: true - /dot-prop@5.3.0: resolution: {integrity: sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==} engines: {node: '>=8'} @@ -4986,50 +3339,6 @@ packages: engines: {node: '>=12'} dev: true - /download-git-repo@3.0.2: - resolution: {integrity: sha512-N8hWXD4hXqmEcNoR8TBYFntaOcYvEQ7Bz90mgm3bZRTuteGQqwT32VDMnTyD0KTEvb8BWrMc1tVmzuV9u/WrAg==} - dependencies: - download: 7.1.0 - git-clone: 0.1.0 - rimraf: 3.0.2 - dev: false - - /download@7.1.0: - resolution: {integrity: sha512-xqnBTVd/E+GxJVrX5/eUJiLYjCGPwMpdL+jGhGU57BvtcA7wwhtHVbXBeUk51kOpW3S7Jn3BQbN9Q1R1Km2qDQ==} - engines: {node: '>=6'} - dependencies: - archive-type: 4.0.0 - caw: 2.0.1 - content-disposition: 0.5.4 - decompress: 4.2.1 - ext-name: 5.0.0 - file-type: 8.1.0 - filenamify: 2.1.0 - get-stream: 3.0.0 - got: 8.3.2 - make-dir: 1.3.0 - p-event: 2.3.1 - pify: 3.0.0 - dev: false - - /duplexer3@0.1.5: - resolution: {integrity: sha512-1A8za6ws41LQgv9HrE/66jyC5yuSjQ3L/KOpFtoBilsAK2iA2wuS5rTt1OCzIvtS2V7nVmedsUU+DGRcjBmOYA==} - dev: false - - /editor@1.0.0: - resolution: {integrity: sha512-SoRmbGStwNYHgKfjOrX2L0mUvp9bUVv0uPppZSOMAntEbcFtoC3MKF5b3T6HQPXKIV+QGY3xPO3JK5it5lVkuw==} - dev: true - - /ee-first@1.1.1: - resolution: {integrity: sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==} - dev: false - - /ejs@2.7.4: - resolution: {integrity: sha512-7vmuyh5+kuUyJKePhQfRQBhXV5Ce+RnaeeQArKu1EAMpL3WbgMt5WG6uQZpEVvYSSsxMXRKOewtDk9RaTKXRlA==} - engines: {node: '>=0.10.0'} - requiresBuild: true - dev: false - /ejs@3.1.9: resolution: {integrity: sha512-rC+QVNMJWv+MtPgkt0y+0rVEIdbtxVADApW9JXrUVlzHetgcyczP/E7DJmWJ4fJCZF2cPcBk0laWO9ZHMG3DmQ==} engines: {node: '>=0.10.0'} @@ -5078,24 +3387,6 @@ packages: /emoji-regex@8.0.0: resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} - /encodeurl@1.0.2: - resolution: {integrity: sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==} - engines: {node: '>= 0.8'} - dev: false - - /end-of-stream@1.4.4: - resolution: {integrity: sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==} - dependencies: - once: 1.4.0 - - /enquirer@2.4.1: - resolution: {integrity: sha512-rRqJg/6gd538VHvR3PSrdRBb/1Vy2YfzHqzvbhGIQpDRKIa4FgV/54b5Q1xYSxOOwKvjXweS26E0Q+nAMwp2pQ==} - engines: {node: '>=8.6'} - dependencies: - ansi-colors: 4.1.3 - strip-ansi: 6.0.1 - dev: true - /entities@2.2.0: resolution: {integrity: sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A==} dev: true @@ -5110,89 +3401,16 @@ packages: is-arrayish: 0.2.1 dev: true - /es-abstract@1.22.5: - resolution: {integrity: sha512-oW69R+4q2wG+Hc3KZePPZxOiisRIqfKBVo/HLx94QcJeWGU/8sZhCvc829rd1kS366vlJbzBfXf9yWwf0+Ko7w==} - engines: {node: '>= 0.4'} - dependencies: - array-buffer-byte-length: 1.0.1 - arraybuffer.prototype.slice: 1.0.3 - available-typed-arrays: 1.0.7 - call-bind: 1.0.7 - es-define-property: 1.0.0 - es-errors: 1.3.0 - es-set-tostringtag: 2.0.3 - es-to-primitive: 1.2.1 - function.prototype.name: 1.1.6 - get-intrinsic: 1.2.4 - get-symbol-description: 1.0.2 - globalthis: 1.0.3 - gopd: 1.0.1 - has-property-descriptors: 1.0.2 - has-proto: 1.0.3 - has-symbols: 1.0.3 - hasown: 2.0.2 - internal-slot: 1.0.7 - is-array-buffer: 3.0.4 - is-callable: 1.2.7 - is-negative-zero: 2.0.3 - is-regex: 1.1.4 - is-shared-array-buffer: 1.0.3 - is-string: 1.0.7 - is-typed-array: 1.1.13 - is-weakref: 1.0.2 - object-inspect: 1.13.1 - object-keys: 1.1.1 - object.assign: 4.1.5 - regexp.prototype.flags: 1.5.2 - safe-array-concat: 1.1.2 - safe-regex-test: 1.0.3 - string.prototype.trim: 1.2.8 - string.prototype.trimend: 1.0.7 - string.prototype.trimstart: 1.0.7 - typed-array-buffer: 1.0.2 - typed-array-byte-length: 1.0.1 - typed-array-byte-offset: 1.0.2 - typed-array-length: 1.0.5 - unbox-primitive: 1.0.2 - which-typed-array: 1.1.15 - dev: true - - /es-array-method-boxes-properly@1.0.0: - resolution: {integrity: sha512-wd6JXUmyHmt8T5a2xreUwKcGPq6f1f+WwIJkijUqiGcJz1qqnZgP6XIK+QyIWU5lT7imeNxUll48bziG+TSYcA==} - dev: true - /es-define-property@1.0.0: resolution: {integrity: sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==} engines: {node: '>= 0.4'} dependencies: get-intrinsic: 1.2.4 + dev: true /es-errors@1.3.0: resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==} engines: {node: '>= 0.4'} - - /es-set-tostringtag@2.0.3: - resolution: {integrity: sha512-3T8uNMC3OQTHkFUsFq8r/BwAXLHvU/9O9mE0fBc/MY5iq/8H7ncvO947LmYA6ldWw9Uh8Yhf25zu6n7nML5QWQ==} - engines: {node: '>= 0.4'} - dependencies: - get-intrinsic: 1.2.4 - has-tostringtag: 1.0.2 - hasown: 2.0.2 - dev: true - - /es-shim-unscopables@1.0.2: - resolution: {integrity: sha512-J3yBRXCzDu4ULnQwxyToo/OjdMx6akgVC7K6few0a7F/0wLtmKKN7I73AH5T2836UuXRqN7Qg+IIUw/+YJksRw==} - dependencies: - hasown: 2.0.2 - dev: true - - /es-to-primitive@1.2.1: - resolution: {integrity: sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==} - engines: {node: '>= 0.4'} - dependencies: - is-callable: 1.2.7 - is-date-object: 1.0.5 - is-symbol: 1.0.4 dev: true /esbuild@0.18.20: @@ -5267,182 +3485,43 @@ packages: /escape-string-regexp@1.0.5: resolution: {integrity: sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==} engines: {node: '>=0.8.0'} - - /escape-string-regexp@4.0.0: - resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} - engines: {node: '>=10'} - dev: true - - /escape-string-regexp@5.0.0: - resolution: {integrity: sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==} - engines: {node: '>=12'} - dev: true - - /eslint-compat-utils@0.1.2(eslint@8.57.0): - resolution: {integrity: sha512-Jia4JDldWnFNIru1Ehx1H5s9/yxiRHY/TimCuUc0jNexew3cF1gI6CYZil1ociakfWO3rRqFjl1mskBblB3RYg==} - engines: {node: '>=12'} - peerDependencies: - eslint: '>=6.0.0' - dependencies: - eslint: 8.57.0 - dev: true - - /eslint-config-prettier@8.10.0(eslint@8.57.0): - resolution: {integrity: sha512-SM8AMJdeQqRYT9O9zguiruQZaN7+z+E4eAP9oiLNGKMtomwaB1E9dcgUD6ZAn/eQAb52USbvezbiljfZUhbJcg==} - hasBin: true - peerDependencies: - eslint: '>=7.0.0' - dependencies: - eslint: 8.57.0 - dev: true - - /eslint-config-standard-with-typescript@18.0.2(@typescript-eslint/eslint-plugin@3.10.1)(eslint-plugin-import@2.29.1)(eslint-plugin-node@11.1.0)(eslint-plugin-promise@4.3.1)(eslint-plugin-standard@4.1.0)(eslint@7.32.0)(typescript@4.9.5): - resolution: {integrity: sha512-6D++u/gifJgj2hQ13e+YRyNs+1v3oihkfsL36P6HjeQjiOBdhRC/0wq3PRqfOwFA0hMCkcWBvhfO0GXWtGW9bg==} - peerDependencies: - '@typescript-eslint/eslint-plugin': '>=3.0.1' - eslint: '>=6.2.2' - eslint-plugin-import: '>=2.18.0' - eslint-plugin-node: '>=9.1.0' - eslint-plugin-promise: '>=4.2.1' - eslint-plugin-standard: '>=4.0.0' - typescript: '>=3.9' - dependencies: - '@typescript-eslint/eslint-plugin': 3.10.1(@typescript-eslint/parser@3.10.1)(eslint@7.32.0)(typescript@4.9.5) - '@typescript-eslint/parser': 3.10.1(eslint@7.32.0)(typescript@4.9.5) - eslint: 7.32.0 - eslint-config-standard: 14.1.1(eslint-plugin-import@2.29.1)(eslint-plugin-node@11.1.0)(eslint-plugin-promise@4.3.1)(eslint-plugin-standard@4.1.0)(eslint@7.32.0) - eslint-plugin-import: 2.29.1(@typescript-eslint/parser@3.10.1)(eslint@7.32.0) - eslint-plugin-node: 11.1.0(eslint@7.32.0) - eslint-plugin-promise: 4.3.1 - eslint-plugin-standard: 4.1.0(eslint@7.32.0) - typescript: 4.9.5 - transitivePeerDependencies: - - supports-color - dev: true - - /eslint-config-standard@14.1.1(eslint-plugin-import@2.29.1)(eslint-plugin-node@11.1.0)(eslint-plugin-promise@4.3.1)(eslint-plugin-standard@4.1.0)(eslint@7.32.0): - resolution: {integrity: sha512-Z9B+VR+JIXRxz21udPTL9HpFMyoMUEeX1G251EQ6e05WD9aPVtVBn09XUmZ259wCMlCDmYDSZG62Hhm+ZTJcUg==} - peerDependencies: - eslint: '>=6.2.2' - eslint-plugin-import: '>=2.18.0' - eslint-plugin-node: '>=9.1.0' - eslint-plugin-promise: '>=4.2.1' - eslint-plugin-standard: '>=4.0.0' - dependencies: - eslint: 7.32.0 - eslint-plugin-import: 2.29.1(@typescript-eslint/parser@3.10.1)(eslint@7.32.0) - eslint-plugin-node: 11.1.0(eslint@7.32.0) - eslint-plugin-promise: 4.3.1 - eslint-plugin-standard: 4.1.0(eslint@7.32.0) dev: true - /eslint-config-turbo@1.12.5(eslint@8.57.0): - resolution: {integrity: sha512-wXytbX+vTzQ6rwgM6sIr447tjYJBlRj5V/eBFNGNXw5Xs1R715ppPYhbmxaFbkrWNQSGJsWRrYGAlyq0sT/OsQ==} - peerDependencies: - eslint: '>6.6.0' - dependencies: - eslint: 8.57.0 - eslint-plugin-turbo: 1.12.5(eslint@8.57.0) - dev: true - - /eslint-import-resolver-node@0.3.9: - resolution: {integrity: sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==} - dependencies: - debug: 3.2.7 - is-core-module: 2.13.1 - resolve: 1.22.8 - transitivePeerDependencies: - - supports-color + /escape-string-regexp@4.0.0: + resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} + engines: {node: '>=10'} dev: true - /eslint-module-utils@2.8.1(@typescript-eslint/parser@3.10.1)(eslint-import-resolver-node@0.3.9)(eslint@7.32.0): - resolution: {integrity: sha512-rXDXR3h7cs7dy9RNpUlQf80nX31XWJEyGq1tRMo+6GsO5VmTe4UTwtmonAD4ZkAsrfMVDA2wlGJ3790Ys+D49Q==} - engines: {node: '>=4'} - peerDependencies: - '@typescript-eslint/parser': '*' - eslint: '*' - eslint-import-resolver-node: '*' - eslint-import-resolver-typescript: '*' - eslint-import-resolver-webpack: '*' - peerDependenciesMeta: - '@typescript-eslint/parser': - optional: true - eslint: - optional: true - eslint-import-resolver-node: - optional: true - eslint-import-resolver-typescript: - optional: true - eslint-import-resolver-webpack: - optional: true - dependencies: - '@typescript-eslint/parser': 3.10.1(eslint@7.32.0)(typescript@4.9.5) - debug: 3.2.7 - eslint: 7.32.0 - eslint-import-resolver-node: 0.3.9 - transitivePeerDependencies: - - supports-color + /escape-string-regexp@5.0.0: + resolution: {integrity: sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==} + engines: {node: '>=12'} dev: true - /eslint-plugin-es@3.0.1(eslint@7.32.0): - resolution: {integrity: sha512-GUmAsJaN4Fc7Gbtl8uOBlayo2DqhwWvEzykMHSCZHU3XdJ+NSzzZcVhXh3VxX5icqQ+oQdIEawXX8xkR3mIFmQ==} - engines: {node: '>=8.10.0'} + /eslint-compat-utils@0.1.2(eslint@8.57.0): + resolution: {integrity: sha512-Jia4JDldWnFNIru1Ehx1H5s9/yxiRHY/TimCuUc0jNexew3cF1gI6CYZil1ociakfWO3rRqFjl1mskBblB3RYg==} + engines: {node: '>=12'} peerDependencies: - eslint: '>=4.19.1' + eslint: '>=6.0.0' dependencies: - eslint: 7.32.0 - eslint-utils: 2.1.0 - regexpp: 3.2.0 + eslint: 8.57.0 dev: true - /eslint-plugin-import@2.29.1(@typescript-eslint/parser@3.10.1)(eslint@7.32.0): - resolution: {integrity: sha512-BbPC0cuExzhiMo4Ff1BTVwHpjjv28C5R+btTOGaCRC7UEz801up0JadwkeSk5Ued6TG34uaczuVuH6qyy5YUxw==} - engines: {node: '>=4'} + /eslint-config-prettier@8.10.0(eslint@8.57.0): + resolution: {integrity: sha512-SM8AMJdeQqRYT9O9zguiruQZaN7+z+E4eAP9oiLNGKMtomwaB1E9dcgUD6ZAn/eQAb52USbvezbiljfZUhbJcg==} + hasBin: true peerDependencies: - '@typescript-eslint/parser': '*' - eslint: ^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8 - peerDependenciesMeta: - '@typescript-eslint/parser': - optional: true + eslint: '>=7.0.0' dependencies: - '@typescript-eslint/parser': 3.10.1(eslint@7.32.0)(typescript@4.9.5) - array-includes: 3.1.7 - array.prototype.findlastindex: 1.2.4 - array.prototype.flat: 1.3.2 - array.prototype.flatmap: 1.3.2 - debug: 3.2.7 - doctrine: 2.1.0 - eslint: 7.32.0 - eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.8.1(@typescript-eslint/parser@3.10.1)(eslint-import-resolver-node@0.3.9)(eslint@7.32.0) - hasown: 2.0.2 - is-core-module: 2.13.1 - is-glob: 4.0.3 - minimatch: 3.1.2 - object.fromentries: 2.0.7 - object.groupby: 1.0.2 - object.values: 1.1.7 - semver: 6.3.1 - tsconfig-paths: 3.15.0 - transitivePeerDependencies: - - eslint-import-resolver-typescript - - eslint-import-resolver-webpack - - supports-color + eslint: 8.57.0 dev: true - /eslint-plugin-node@11.1.0(eslint@7.32.0): - resolution: {integrity: sha512-oUwtPJ1W0SKD0Tr+wqu92c5xuCeQqB3hSCHasn/ZgjFdA9iDGNkNf2Zi9ztY7X+hNuMib23LNGRm6+uN+KLE3g==} - engines: {node: '>=8.10.0'} + /eslint-config-turbo@1.12.5(eslint@8.57.0): + resolution: {integrity: sha512-wXytbX+vTzQ6rwgM6sIr447tjYJBlRj5V/eBFNGNXw5Xs1R715ppPYhbmxaFbkrWNQSGJsWRrYGAlyq0sT/OsQ==} peerDependencies: - eslint: '>=5.16.0' + eslint: '>6.6.0' dependencies: - eslint: 7.32.0 - eslint-plugin-es: 3.0.1(eslint@7.32.0) - eslint-utils: 2.1.0 - ignore: 5.3.1 - minimatch: 3.1.2 - resolve: 1.22.8 - semver: 6.3.1 + eslint: 8.57.0 + eslint-plugin-turbo: 1.12.5(eslint@8.57.0) dev: true /eslint-plugin-prettier@4.2.1(eslint-config-prettier@8.10.0)(eslint@8.57.0)(prettier@2.8.8): @@ -5462,19 +3541,6 @@ packages: prettier-linter-helpers: 1.0.0 dev: true - /eslint-plugin-promise@4.3.1: - resolution: {integrity: sha512-bY2sGqyptzFBDLh/GMbAxfdJC+b0f23ME63FOE4+Jao0oZ3E1LEwFtWJX/1pGMJLiTtrSSern2CRM/g+dfc0eQ==} - engines: {node: '>=6'} - dev: true - - /eslint-plugin-standard@4.1.0(eslint@7.32.0): - resolution: {integrity: sha512-ZL7+QRixjTR6/528YNGyDotyffm5OQst/sGxKDwGb9Uqs4In5Egi4+jbobhqJoyoCM6/7v/1A5fhQ7ScMtDjaQ==} - peerDependencies: - eslint: '>=5.0.0' - dependencies: - eslint: 7.32.0 - dev: true - /eslint-plugin-svelte@2.35.1(eslint@8.57.0)(svelte@4.2.12)(ts-node@10.9.2): resolution: {integrity: sha512-IF8TpLnROSGy98Z3NrsKXWDSCbNY2ReHDcrYTuXZMbfX7VmESISR78TWgO9zdg4Dht1X8coub5jKwHzP0ExRug==} engines: {node: ^14.17.0 || >=16.0.0} @@ -5547,77 +3613,11 @@ packages: estraverse: 5.3.0 dev: true - /eslint-utils@2.1.0: - resolution: {integrity: sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==} - engines: {node: '>=6'} - dependencies: - eslint-visitor-keys: 1.3.0 - dev: true - - /eslint-visitor-keys@1.3.0: - resolution: {integrity: sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==} - engines: {node: '>=4'} - dev: true - - /eslint-visitor-keys@2.1.0: - resolution: {integrity: sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==} - engines: {node: '>=10'} - dev: true - /eslint-visitor-keys@3.4.3: resolution: {integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true - /eslint@7.32.0: - resolution: {integrity: sha512-VHZ8gX+EDfz+97jGcgyGCyRia/dPOd6Xh9yPv8Bl1+SoaIwD+a/vlrOmGRUyOYu7MwUhc7CxqeaDZU13S4+EpA==} - engines: {node: ^10.12.0 || >=12.0.0} - hasBin: true - dependencies: - '@babel/code-frame': 7.12.11 - '@eslint/eslintrc': 0.4.3 - '@humanwhocodes/config-array': 0.5.0 - ajv: 6.12.6 - chalk: 4.1.2 - cross-spawn: 7.0.3 - debug: 4.3.4 - doctrine: 3.0.0 - enquirer: 2.4.1 - escape-string-regexp: 4.0.0 - eslint-scope: 5.1.1 - eslint-utils: 2.1.0 - eslint-visitor-keys: 2.1.0 - espree: 7.3.1 - esquery: 1.5.0 - esutils: 2.0.3 - fast-deep-equal: 3.1.3 - file-entry-cache: 6.0.1 - functional-red-black-tree: 1.0.1 - glob-parent: 5.1.2 - globals: 13.24.0 - ignore: 4.0.6 - import-fresh: 3.3.0 - imurmurhash: 0.1.4 - is-glob: 4.0.3 - js-yaml: 3.14.1 - json-stable-stringify-without-jsonify: 1.0.1 - levn: 0.4.1 - lodash.merge: 4.6.2 - minimatch: 3.1.2 - natural-compare: 1.4.0 - optionator: 0.9.3 - progress: 2.0.3 - regexpp: 3.2.0 - semver: 7.6.0 - strip-ansi: 6.0.1 - strip-json-comments: 3.1.1 - table: 6.8.1 - text-table: 0.2.0 - v8-compile-cache: 2.4.0 - transitivePeerDependencies: - - supports-color - dev: true - /eslint@8.57.0: resolution: {integrity: sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -5665,15 +3665,6 @@ packages: - supports-color dev: true - /espree@7.3.1: - resolution: {integrity: sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==} - engines: {node: ^10.12.0 || >=12.0.0} - dependencies: - acorn: 7.4.1 - acorn-jsx: 5.3.2(acorn@7.4.1) - eslint-visitor-keys: 1.3.0 - dev: true - /espree@9.6.1: resolution: {integrity: sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -5683,11 +3674,6 @@ packages: eslint-visitor-keys: 3.4.3 dev: true - /esprima@4.0.1: - resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} - engines: {node: '>=4'} - hasBin: true - /esquery@1.5.0: resolution: {integrity: sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==} engines: {node: '>=0.10'} @@ -5712,14 +3698,6 @@ packages: engines: {node: '>=4.0'} dev: true - /estree-walker@0.6.1: - resolution: {integrity: sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w==} - dev: true - - /estree-walker@1.0.1: - resolution: {integrity: sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==} - dev: true - /estree-walker@2.0.2: resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} @@ -5746,19 +3724,6 @@ packages: safe-buffer: 5.2.1 dev: true - /execa@1.0.0: - resolution: {integrity: sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==} - engines: {node: '>=6'} - dependencies: - cross-spawn: 6.0.5 - get-stream: 4.1.0 - is-stream: 1.1.0 - npm-run-path: 2.0.2 - p-finally: 1.0.0 - signal-exit: 3.0.7 - strip-eof: 1.0.0 - dev: true - /execa@5.1.1: resolution: {integrity: sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==} engines: {node: '>=10'} @@ -5796,28 +3761,6 @@ packages: homedir-polyfill: 1.0.3 dev: true - /ext-list@2.2.2: - resolution: {integrity: sha512-u+SQgsubraE6zItfVA0tBuCBhfU9ogSRnsvygI7wht9TS510oLkBRXBsqopeUG/GBOIQyKZO9wjTqIu/sf5zFA==} - engines: {node: '>=0.10.0'} - dependencies: - mime-db: 1.52.0 - dev: false - - /ext-name@5.0.0: - resolution: {integrity: sha512-yblEwXAbGv1VQDmow7s38W77hzAgJAO50ztBLMcUyUBfxv1HC+LGwtiEN+Co6LtlqT/5uwVOxsD4TNIilWhwdQ==} - engines: {node: '>=4'} - dependencies: - ext-list: 2.2.2 - sort-keys-length: 1.0.1 - dev: false - - /extend-shallow@2.0.1: - resolution: {integrity: sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==} - engines: {node: '>=0.10.0'} - dependencies: - is-extendable: 0.1.1 - dev: false - /external-editor@3.1.0: resolution: {integrity: sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==} engines: {node: '>=4'} @@ -5825,6 +3768,7 @@ packages: chardet: 0.7.0 iconv-lite: 0.4.24 tmp: 0.0.33 + dev: true /fast-deep-equal@3.1.3: resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} @@ -5843,6 +3787,7 @@ packages: glob-parent: 5.1.2 merge2: 1.4.1 micromatch: 4.0.5 + dev: true /fast-json-stable-stringify@2.1.0: resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==} @@ -5856,22 +3801,14 @@ packages: resolution: {integrity: sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==} dependencies: reusify: 1.0.4 - - /fd-slicer@1.1.0: - resolution: {integrity: sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g==} - dependencies: - pend: 1.2.0 - dev: false - - /fflate@0.7.4: - resolution: {integrity: sha512-5u2V/CDW15QM1XbbgS+0DfPxVB+jUKhWEKuuFuHncbk3tEEqzmoXL+2KyOFuKGqOnmdIy0/davWF1CkuwtibCw==} - dev: false + dev: true /figures@2.0.0: resolution: {integrity: sha512-Oa2M9atig69ZkfwiApY8F2Yy+tzMbazyvqv21R0NsSC8floSOC09BbT1ITWAdoMGQvJ/aZnR1KMwdx9tvHnTNA==} engines: {node: '>=4'} dependencies: escape-string-regexp: 1.0.5 + dev: true /figures@3.2.0: resolution: {integrity: sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==} @@ -5887,71 +3824,17 @@ packages: flat-cache: 3.2.0 dev: true - /file-type@3.9.0: - resolution: {integrity: sha512-RLoqTXE8/vPmMuTI88DAzhMYC99I8BWv7zYP4A1puo5HIjEJ5EX48ighy4ZyKMG9EDXxBgW6e++cn7d1xuFghA==} - engines: {node: '>=0.10.0'} - dev: false - - /file-type@4.4.0: - resolution: {integrity: sha512-f2UbFQEk7LXgWpi5ntcO86OeA/cC80fuDDDaX/fZ2ZGel+AF7leRQqBBW1eJNiiQkrZlAoM6P+VYP5P6bOlDEQ==} - engines: {node: '>=4'} - dev: false - - /file-type@5.2.0: - resolution: {integrity: sha512-Iq1nJ6D2+yIO4c8HHg4fyVb8mAJieo1Oloy1mLLaB2PvezNedhBVm+QU7g0qM42aiMbRXTxKKwGD17rjKNJYVQ==} - engines: {node: '>=4'} - dev: false - - /file-type@6.2.0: - resolution: {integrity: sha512-YPcTBDV+2Tm0VqjybVd32MHdlEGAtuxS3VAYsumFokDSMG+ROT5wawGlnHDoz7bfMcMDt9hxuXvXwoKUx2fkOg==} - engines: {node: '>=4'} - dev: false - - /file-type@8.1.0: - resolution: {integrity: sha512-qyQ0pzAy78gVoJsmYeNgl8uH8yKhr1lVhW7JbzJmnlRi0I4R2eEDEJZVKG8agpDnLpacwNbDhLNG/LMdxHD2YQ==} - engines: {node: '>=6'} - dev: false - /filelist@1.0.4: resolution: {integrity: sha512-w1cEuf3S+DrLCQL7ET6kz+gmlJdbq9J7yXCSjK/OZCPA+qEN1WyF4ZAf0YYJa4/shHJra2t/d/r8SV4Ji+x+8Q==} dependencies: minimatch: 5.1.6 dev: true - /filename-reserved-regex@2.0.0: - resolution: {integrity: sha512-lc1bnsSr4L4Bdif8Xb/qrtokGbq5zlsms/CYH8PP+WtCkGNF65DPiQY8vG3SakEdRn8Dlnm+gW/qWKKjS5sZzQ==} - engines: {node: '>=4'} - dev: false - - /filenamify@2.1.0: - resolution: {integrity: sha512-ICw7NTT6RsDp2rnYKVd8Fu4cr6ITzGy3+u4vUujPkabyaz+03F24NWEX7fs5fp+kBonlaqPH8fAO2NM+SXt/JA==} - engines: {node: '>=4'} - dependencies: - filename-reserved-regex: 2.0.0 - strip-outer: 1.0.1 - trim-repeated: 1.0.0 - dev: false - /fill-range@7.0.1: resolution: {integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==} engines: {node: '>=8'} dependencies: to-regex-range: 5.0.1 - - /find-cache-dir@3.3.2: - resolution: {integrity: sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig==} - engines: {node: '>=8'} - dependencies: - commondir: 1.0.1 - make-dir: 3.1.0 - pkg-dir: 4.2.0 - dev: true - - /find-config@1.0.0: - resolution: {integrity: sha512-Z+suHH+7LSE40WfUeZPIxSxypCWvrzdVc60xAjUShZeT5eMWM0/FQUduq3HjluyfAHWvC/aOBkT1pTZktyF/jg==} - engines: {node: '>= 0.12'} - dependencies: - user-home: 2.0.0 dev: true /find-node-modules@2.1.3: @@ -5965,20 +3848,6 @@ packages: resolution: {integrity: sha512-NKfW6bec6GfKc0SGx1e07QZY9PE99u0Bft/0rzSD5k3sO/vwkVUpDUKVm5Gpp5Ue3YfShPFTX2070tDs5kB9Ng==} dev: true - /find-up@2.1.0: - resolution: {integrity: sha512-NWzkk0jSJtTt08+FBFMvXoeZnOJD+jTtsRmBYbAIzJdX6l7dLgR7CTubCM5/eDdPUBvLCeVasP1brfVR/9/EZQ==} - engines: {node: '>=4'} - dependencies: - locate-path: 2.0.0 - dev: true - - /find-up@3.0.0: - resolution: {integrity: sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==} - engines: {node: '>=6'} - dependencies: - locate-path: 3.0.0 - dev: true - /find-up@4.1.0: resolution: {integrity: sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==} engines: {node: '>=8'} @@ -6018,16 +3887,6 @@ packages: resolution: {integrity: sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==} dev: true - /follow-redirects@1.15.5: - resolution: {integrity: sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw==} - engines: {node: '>=4.0'} - peerDependencies: - debug: '*' - peerDependenciesMeta: - debug: - optional: true - dev: false - /for-each@0.3.3: resolution: {integrity: sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==} dependencies: @@ -6041,25 +3900,7 @@ packages: asynckit: 0.4.0 combined-stream: 1.0.8 mime-types: 2.1.33 - - /formstream@1.3.1: - resolution: {integrity: sha512-FkW++ub+VbE5dpwukJVDizNWhSgp8FhmhI65pF7BZSVStBqe6Wgxe2Z9/Vhsn7l7nXCPwP+G1cyYlX8VwWOf0g==} - dependencies: - destroy: 1.2.0 - mime: 2.6.0 - pause-stream: 0.0.11 - dev: false - - /from2@2.3.0: - resolution: {integrity: sha512-OMcX/4IC/uqEPVgGeyfN22LJk6AZrMkRZHxcHBMBvHScDGgwTm2GT2Wkgtocyd3JfZffjj2kYUDXXII0Fk9W0g==} - dependencies: - inherits: 2.0.4 - readable-stream: 2.3.8 - dev: false - - /fs-constants@1.0.0: - resolution: {integrity: sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==} - dev: false + dev: true /fs-extra@10.1.0: resolution: {integrity: sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==} @@ -6079,14 +3920,6 @@ packages: universalify: 2.0.1 dev: true - /fs-extra@6.0.1: - resolution: {integrity: sha512-GnyIkKhhzXZUWFCaJzvyDLEEgDkPfb4/TPvJCJVuS8MWZgoSsErf++QpiAlDnKFcqhRlm+tIOcencCjyJE6ZCA==} - dependencies: - graceful-fs: 4.2.11 - jsonfile: 4.0.0 - universalify: 0.1.2 - dev: false - /fs-extra@7.0.1: resolution: {integrity: sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==} engines: {node: '>=6 <7 || >=8'} @@ -6096,15 +3929,6 @@ packages: universalify: 0.1.2 dev: true - /fs-extra@8.1.0: - resolution: {integrity: sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==} - engines: {node: '>=6 <7 || >=8'} - dependencies: - graceful-fs: 4.2.11 - jsonfile: 4.0.0 - universalify: 0.1.2 - dev: true - /fs-extra@9.1.0: resolution: {integrity: sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==} engines: {node: '>=10'} @@ -6117,6 +3941,7 @@ packages: /fs.realpath@1.0.0: resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} + dev: true /fsevents@2.3.3: resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} @@ -6128,23 +3953,6 @@ packages: /function-bind@1.1.2: resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} - - /function.prototype.name@1.1.6: - resolution: {integrity: sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.7 - define-properties: 1.2.1 - es-abstract: 1.22.5 - functions-have-names: 1.2.3 - dev: true - - /functional-red-black-tree@1.0.1: - resolution: {integrity: sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==} - dev: true - - /functions-have-names@1.2.3: - resolution: {integrity: sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==} dev: true /get-caller-file@2.0.5: @@ -6162,89 +3970,18 @@ packages: es-errors: 1.3.0 function-bind: 1.1.2 has-proto: 1.0.3 - has-symbols: 1.0.3 - hasown: 2.0.2 - - /get-pkg-repo@4.2.1: - resolution: {integrity: sha512-2+QbHjFRfGB74v/pYWjd5OhU3TDIC2Gv/YKUTk/tCvAz0pkn/Mz6P3uByuBimLOcPvN2jYdScl3xGFSrx0jEcA==} - engines: {node: '>=6.9.0'} - hasBin: true - dependencies: - '@hutson/parse-repository-url': 3.0.2 - hosted-git-info: 4.1.0 - through2: 2.0.5 - yargs: 16.2.0 - dev: true - - /get-proxy@2.1.0: - resolution: {integrity: sha512-zmZIaQTWnNQb4R4fJUEp/FC51eZsc6EkErspy3xtIYStaq8EB/hDIWipxsal+E8rz0qD7f2sL/NA9Xee4RInJw==} - engines: {node: '>=4'} - dependencies: - npm-conf: 1.1.3 - dev: false - - /get-stdin@6.0.0: - resolution: {integrity: sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g==} - engines: {node: '>=4'} - dev: true - - /get-stdin@7.0.0: - resolution: {integrity: sha512-zRKcywvrXlXsA0v0i9Io4KDRaAw7+a1ZpjRwl9Wox8PFlVCCHra7E9c4kqXCoCM9nR5tBkaTTZRBoCm60bFqTQ==} - engines: {node: '>=8'} - dev: true - - /get-stream@2.3.1: - resolution: {integrity: sha512-AUGhbbemXxrZJRD5cDvKtQxLuYaIbNtDTK8YqupCI393Q2KSTreEsLUN3ZxAWFGiKTzL6nKuzfcIvieflUX9qA==} - engines: {node: '>=0.10.0'} - dependencies: - object-assign: 4.1.1 - pinkie-promise: 2.0.1 - dev: false - - /get-stream@3.0.0: - resolution: {integrity: sha512-GlhdIUuVakc8SJ6kK0zAFbiGzRFzNnY4jUuEbV9UROo4Y+0Ny4fjvcZFVTeDA4odpFyOQzaw6hXukJSq/f28sQ==} - engines: {node: '>=4'} - dev: false - - /get-stream@4.1.0: - resolution: {integrity: sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==} - engines: {node: '>=6'} - dependencies: - pump: 3.0.0 - dev: true - - /get-stream@6.0.1: - resolution: {integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==} - engines: {node: '>=10'} - dev: true - - /get-stream@8.0.1: - resolution: {integrity: sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==} - engines: {node: '>=16'} - dev: true - - /get-symbol-description@1.0.2: - resolution: {integrity: sha512-g0QYk1dZBxGwk+Ngc+ltRH2IBp2f7zBkBMBJZCDerh6EhlhSR6+9irMCuT/09zD6qkarHUSn529sK/yL4S27mg==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.7 - es-errors: 1.3.0 - get-intrinsic: 1.2.4 + has-symbols: 1.0.3 + hasown: 2.0.2 dev: true - /git-clone@0.1.0: - resolution: {integrity: sha512-zs9rlfa7HyaJAKG9o+V7C6qfMzyc+tb1IIXdUFcOBcR1U7siKy/uPdauLlrH1mc0vOgUwIv4BF+QxPiiTYz3Rw==} - dev: false + /get-stream@6.0.1: + resolution: {integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==} + engines: {node: '>=10'} + dev: true - /git-raw-commits@1.3.6: - resolution: {integrity: sha512-svsK26tQ8vEKnMshTDatSIQSMDdz8CxIIqKsvPqbtV23Etmw6VNaFAitu8zwZ0VrOne7FztwPyRLxK7/DIUTQg==} - hasBin: true - dependencies: - dargs: 4.1.0 - lodash.template: 4.5.0 - meow: 4.0.1 - split2: 2.2.0 - through2: 2.0.5 + /get-stream@8.0.1: + resolution: {integrity: sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==} + engines: {node: '>=16'} dev: true /git-raw-commits@2.0.11: @@ -6259,34 +3996,12 @@ packages: through2: 4.0.2 dev: true - /git-remote-origin-url@2.0.0: - resolution: {integrity: sha512-eU+GGrZgccNJcsDH5LkXR3PB9M958hxc7sbA8DFJjrv9j4L2P/eZfKhM+QD6wyzpiv+b1BpK0XrYCxkovtjSLw==} - engines: {node: '>=4'} - dependencies: - gitconfiglocal: 1.0.0 - pify: 2.3.0 - dev: true - - /git-semver-tags@4.1.1: - resolution: {integrity: sha512-OWyMt5zBe7xFs8vglMmhM9lRQzCWL3WjHtxNNfJTMngGym7pC1kh8sP6jevfydJ6LP3ZvGxfb6ABYgPUM0mtsA==} - engines: {node: '>=10'} - hasBin: true - dependencies: - meow: 8.1.2 - semver: 6.3.1 - dev: true - - /gitconfiglocal@1.0.0: - resolution: {integrity: sha512-spLUXeTAVHxDtKsJc8FkFVgFtMdEN9qPGpL23VfSHx4fP4+Ds097IXLvymbnDH8FnmxX5Nr9bPw3A+AQ6mWEaQ==} - dependencies: - ini: 1.3.8 - dev: true - /glob-parent@5.1.2: resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} engines: {node: '>= 6'} dependencies: is-glob: 4.0.3 + dev: true /glob-parent@6.0.2: resolution: {integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==} @@ -6304,6 +4019,7 @@ packages: minimatch: 3.1.2 once: 1.4.0 path-is-absolute: 1.0.1 + dev: true /global-directory@4.0.1: resolution: {integrity: sha512-wHTUcDUoZ1H5/0iVqEudYW4/kAlN5cZ3j/bXn0Dpbizl9iaUVeWSHqiOjsgk6OW2bkLclbBjzewBz6weQ1zA2Q==} @@ -6341,11 +4057,6 @@ packages: which: 1.3.1 dev: true - /globals@11.12.0: - resolution: {integrity: sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==} - engines: {node: '>=4'} - dev: true - /globals@13.24.0: resolution: {integrity: sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==} engines: {node: '>=8'} @@ -6353,13 +4064,6 @@ packages: type-fest: 0.20.2 dev: true - /globalthis@1.0.3: - resolution: {integrity: sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==} - engines: {node: '>= 0.4'} - dependencies: - define-properties: 1.2.1 - dev: true - /globby@11.1.0: resolution: {integrity: sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==} engines: {node: '>=10'} @@ -6370,6 +4074,7 @@ packages: ignore: 5.3.1 merge2: 1.4.1 slash: 3.0.0 + dev: true /globrex@0.1.2: resolution: {integrity: sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==} @@ -6379,96 +4084,46 @@ packages: resolution: {integrity: sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==} dependencies: get-intrinsic: 1.2.4 - - /got@8.3.2: - resolution: {integrity: sha512-qjUJ5U/hawxosMryILofZCkm3C84PLJS/0grRIpjAwu+Lkxxj5cxeCU25BG0/3mDSpXKTyZr8oh8wIgLaH0QCw==} - engines: {node: '>=4'} - dependencies: - '@sindresorhus/is': 0.7.0 - '@types/keyv': 3.1.4 - '@types/responselike': 1.0.3 - cacheable-request: 2.1.4 - decompress-response: 3.3.0 - duplexer3: 0.1.5 - get-stream: 3.0.0 - into-stream: 3.1.0 - is-retry-allowed: 1.2.0 - isurl: 1.0.0 - lowercase-keys: 1.0.1 - mimic-response: 1.0.1 - p-cancelable: 0.4.1 - p-timeout: 2.0.1 - pify: 3.0.0 - safe-buffer: 5.2.1 - timed-out: 4.0.1 - url-parse-lax: 3.0.0 - url-to-options: 1.0.1 - dev: false + dev: true /graceful-fs@4.2.11: resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} + dev: true /graphemer@1.4.0: resolution: {integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==} dev: true - /handlebars@4.7.8: - resolution: {integrity: sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==} - engines: {node: '>=0.4.7'} - hasBin: true - dependencies: - minimist: 1.2.8 - neo-async: 2.6.2 - source-map: 0.6.1 - wordwrap: 1.0.0 - optionalDependencies: - uglify-js: 3.17.4 - dev: true - /hard-rejection@2.1.0: resolution: {integrity: sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==} engines: {node: '>=6'} dev: true - /has-bigints@1.0.2: - resolution: {integrity: sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==} - dev: true - /has-flag@3.0.0: resolution: {integrity: sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==} engines: {node: '>=4'} + dev: true /has-flag@4.0.0: resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} engines: {node: '>=8'} - - /has-own-prop@2.0.0: - resolution: {integrity: sha512-Pq0h+hvsVm6dDEa8x82GnLSYHOzNDt7f0ddFa3FqcQlgzEiptPqL+XrOJNavjOzSYiYWIrgeVYYgGlLmnxwilQ==} - engines: {node: '>=8'} - dev: false + dev: true /has-property-descriptors@1.0.2: resolution: {integrity: sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==} dependencies: es-define-property: 1.0.0 + dev: true /has-proto@1.0.3: resolution: {integrity: sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==} engines: {node: '>= 0.4'} - - /has-symbol-support-x@1.4.2: - resolution: {integrity: sha512-3ToOva++HaW+eCpgqZrCfN51IPB+7bJNVT6CUATzueB5Heb8o6Nam0V3HG5dlDvZU1Gn5QLcbahiKw/XVk5JJw==} - dev: false + dev: true /has-symbols@1.0.3: resolution: {integrity: sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==} engines: {node: '>= 0.4'} - - /has-to-string-tag-x@1.4.1: - resolution: {integrity: sha512-vdbKfmw+3LoOYVr+mtxHaX5a96+0f3DljYd8JOqvOLsf5mw2Otda2qCDT9qRqLAhrjyQ0h7ual5nOiASpsGNFw==} - dependencies: - has-symbol-support-x: 1.4.2 - dev: false + dev: true /has-tostringtag@1.0.2: resolution: {integrity: sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==} @@ -6506,6 +4161,7 @@ packages: engines: {node: '>= 0.4'} dependencies: function-bind: 1.1.2 + dev: true /he@1.2.0: resolution: {integrity: sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==} @@ -6566,10 +4222,6 @@ packages: terser: 5.29.1 dev: true - /http-cache-semantics@3.8.1: - resolution: {integrity: sha512-5ai2iksyV8ZXmnZhHH4rWPoxxistEexSi5936zIQ1bnNTW5VnA85B6P/VpXiRM017IgRvb2kKo1a//y+0wSp3w==} - dev: false - /http-proxy-agent@5.0.0: resolution: {integrity: sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==} engines: {node: '>= 6'} @@ -6625,30 +4277,6 @@ packages: engines: {node: '>=16.17.0'} dev: true - /humanize-ms@1.2.1: - resolution: {integrity: sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==} - dependencies: - ms: 2.1.2 - dev: false - - /husky@1.3.1: - resolution: {integrity: sha512-86U6sVVVf4b5NYSZ0yvv88dRgBSSXXmHaiq5pP4KDj5JVzdwKgBjEtUPOm8hcoytezFwbU+7gotXNhpHdystlg==} - engines: {node: '>=6'} - hasBin: true - requiresBuild: true - dependencies: - cosmiconfig: 5.2.1 - execa: 1.0.0 - find-up: 3.0.0 - get-stdin: 6.0.0 - is-ci: 2.0.0 - pkg-dir: 3.0.0 - please-upgrade-node: 3.2.0 - read-pkg: 4.0.1 - run-node: 1.0.0 - slash: 2.0.0 - dev: true - /husky@8.0.3: resolution: {integrity: sha512-+dQSyqPh4x1hlO1swXBiNb2HzTDN1I2IGLQx1GrBuiqFJfoMrnZWwVmatvSiO+Iz8fBUnf+lekwNo4c2LlXItg==} engines: {node: '>=14'} @@ -6660,6 +4288,7 @@ packages: engines: {node: '>=0.10.0'} dependencies: safer-buffer: 2.1.2 + dev: true /iconv-lite@0.6.3: resolution: {integrity: sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==} @@ -6670,30 +4299,11 @@ packages: /ieee754@1.2.1: resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==} - - /ignore@4.0.6: - resolution: {integrity: sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==} - engines: {node: '>= 4'} dev: true /ignore@5.3.1: resolution: {integrity: sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==} engines: {node: '>= 4'} - - /image-size@0.8.3: - resolution: {integrity: sha512-SMtq1AJ+aqHB45c3FsB4ERK0UCiA2d3H1uq8s+8T0Pf8A3W4teyBQyaFaktH6xvZqh+npwlKU7i4fJo0r7TYTg==} - engines: {node: '>=6.9.0'} - hasBin: true - dependencies: - queue: 6.0.1 - dev: false - - /import-fresh@2.0.0: - resolution: {integrity: sha512-eZ5H8rcgYazHbKC3PG4ClHNykCSxtAhxSSEM+2mb+7evD2CKF5V7c0dNum7AdpDh0ZdICwZY9sRSn8f+KH96sg==} - engines: {node: '>=4'} - dependencies: - caller-path: 2.0.0 - resolve-from: 3.0.0 dev: true /import-fresh@3.3.0: @@ -6718,10 +4328,6 @@ packages: /imurmurhash@0.1.4: resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} engines: {node: '>=0.8.19'} - - /indent-string@3.2.0: - resolution: {integrity: sha512-BYqTHXTGUIvg7t1r4sJNKcbDZkL92nkXA8YtRpbjFHRHGDL/NtUeiBJMeE60kIFN/Mg8ESaWQvftaYMGJzQZCQ==} - engines: {node: '>=4'} dev: true /indent-string@4.0.0: @@ -6734,12 +4340,15 @@ packages: dependencies: once: 1.4.0 wrappy: 1.0.2 + dev: true /inherits@2.0.4: resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} + dev: true /ini@1.3.8: resolution: {integrity: sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==} + dev: true /ini@4.1.1: resolution: {integrity: sha512-QQnnxNyfvmHFIsj7gkPcYymR8Jdw/o7mp5ZFihxn6h8Ci6fh3Dx4E1gPjpQEpIuPo9XVNY/ZUwh4BPMjGyL01g==} @@ -6765,6 +4374,7 @@ packages: string-width: 2.1.1 strip-ansi: 5.2.0 through: 2.3.8 + dev: true /inquirer@8.2.5: resolution: {integrity: sha512-QAgPDQMEgrDssk1XiwwHoOGYF9BAbUcc1+j+FhEvaOt8/cKRqyLn0U5qA6F74fGhTMGxf92pOvPBeh29jQJDTQ==} @@ -6808,27 +4418,6 @@ packages: wrap-ansi: 6.2.0 dev: true - /internal-slot@1.0.7: - resolution: {integrity: sha512-NGnrKwXzSms2qUUih/ILZ5JBqNTSa1+ZmP6flaIp6KmSElgE9qdndzS3cqjrDovwFdmwsGsLdeFgB6suw+1e9g==} - engines: {node: '>= 0.4'} - dependencies: - es-errors: 1.3.0 - hasown: 2.0.2 - side-channel: 1.0.6 - dev: true - - /into-stream@3.1.0: - resolution: {integrity: sha512-TcdjPibTksa1NQximqep2r17ISRiNE9fwlfbg3F8ANdvP5/yrFTew86VcO//jk4QTaMlbjypPBq76HN2zaKfZQ==} - engines: {node: '>=4'} - dependencies: - from2: 2.3.0 - p-is-promise: 1.1.0 - dev: false - - /ip@1.1.9: - resolution: {integrity: sha512-cyRxvOEpNHNtchU3Ln9KC/auJgup87llfQpQ+t5ghoC/UhL16SWzbueiCsdTnWmqAWl7LadfuwhlqmtOaqMHdQ==} - dev: false - /is-arguments@1.1.1: resolution: {integrity: sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==} engines: {node: '>= 0.4'} @@ -6837,24 +4426,10 @@ packages: has-tostringtag: 1.0.2 dev: true - /is-array-buffer@3.0.4: - resolution: {integrity: sha512-wcjaerHw0ydZwfhiKbXJWLDY8A7yV7KhjQOpb83hGgGfId/aQa4TOvwyzn2PuswW2gPCYEL/nEAiSVpdOj1lXw==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.7 - get-intrinsic: 1.2.4 - dev: true - /is-arrayish@0.2.1: resolution: {integrity: sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==} dev: true - /is-bigint@1.0.4: - resolution: {integrity: sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==} - dependencies: - has-bigints: 1.0.2 - dev: true - /is-binary-path@2.1.0: resolution: {integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==} engines: {node: '>=8'} @@ -6862,37 +4437,11 @@ packages: binary-extensions: 2.2.0 dev: true - /is-boolean-object@1.1.2: - resolution: {integrity: sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.7 - has-tostringtag: 1.0.2 - dev: true - - /is-buffer@1.1.6: - resolution: {integrity: sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==} - dev: false - - /is-builtin-module@3.2.1: - resolution: {integrity: sha512-BSLE3HnV2syZ0FK0iMA/yUGplUeMmNz4AW5fnTunbCIqZi4vG3WjJT9FHMy5D69xmAYBHXQhJdALdpwVxV501A==} - engines: {node: '>=6'} - dependencies: - builtin-modules: 3.3.0 - dev: true - /is-callable@1.2.7: resolution: {integrity: sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==} engines: {node: '>= 0.4'} dev: true - /is-ci@2.0.0: - resolution: {integrity: sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==} - hasBin: true - dependencies: - ci-info: 2.0.0 - dev: true - /is-ci@3.0.1: resolution: {integrity: sha512-ZYvCgrefwqoQ6yTyYUbQu64HsITZ3NfKX1lzaEYdkTDcfKzzCI/wthRRYKkdjHKFVgNiXKAKm65Zo1pk2as/QQ==} hasBin: true @@ -6904,37 +4453,17 @@ packages: resolution: {integrity: sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==} dependencies: hasown: 2.0.2 - - /is-date-object@1.0.5: - resolution: {integrity: sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==} - engines: {node: '>= 0.4'} - dependencies: - has-tostringtag: 1.0.2 - dev: true - - /is-directory@0.3.1: - resolution: {integrity: sha512-yVChGzahRFvbkscn2MlwGismPO12i9+znNruC5gVEntG3qu0xQMzsGg/JFbrsqDOHtHFPci+V5aP5T9I+yeKqw==} - engines: {node: '>=0.10.0'} dev: true - /is-docker@2.2.1: - resolution: {integrity: sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==} - engines: {node: '>=8'} - hasBin: true - dev: false - - /is-extendable@0.1.1: - resolution: {integrity: sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==} - engines: {node: '>=0.10.0'} - dev: false - /is-extglob@2.1.1: resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} engines: {node: '>=0.10.0'} + dev: true /is-fullwidth-code-point@2.0.0: resolution: {integrity: sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==} engines: {node: '>=4'} + dev: true /is-fullwidth-code-point@3.0.0: resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} @@ -6952,16 +4481,13 @@ packages: engines: {node: '>=0.10.0'} dependencies: is-extglob: 2.1.1 + dev: true /is-interactive@1.0.0: resolution: {integrity: sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==} engines: {node: '>=8'} dev: true - /is-module@1.0.0: - resolution: {integrity: sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g==} - dev: true - /is-nan@1.3.2: resolution: {integrity: sha512-E+zBKpQ2t6MEo1VsonYmluk9NxGrbzpeeLC2xIViuO2EjU2xsXsBPwTr3Ykv9l08UYEVEdWeRZNouaZqF6RN0w==} engines: {node: '>= 0.4'} @@ -6970,29 +4496,9 @@ packages: define-properties: 1.2.1 dev: true - /is-natural-number@4.0.1: - resolution: {integrity: sha512-Y4LTamMe0DDQIIAlaer9eKebAlDSV6huy+TWhJVPlzZh2o4tRP5SQWFlLn5N0To4mDD22/qdOq+veo1cSISLgQ==} - dev: false - - /is-negative-zero@2.0.3: - resolution: {integrity: sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==} - engines: {node: '>= 0.4'} - dev: true - - /is-number-object@1.0.7: - resolution: {integrity: sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==} - engines: {node: '>= 0.4'} - dependencies: - has-tostringtag: 1.0.2 - dev: true - /is-number@7.0.0: resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} engines: {node: '>=0.12.0'} - - /is-obj@1.0.1: - resolution: {integrity: sha512-l4RyHgRqGN4Y3+9JHVrNqO+tN0rV5My76uW5/nuO4K1b6vw5G8d/cmFjP9tRfEsdhZNt0IFdZuK/c2Vr4Nb+Qg==} - engines: {node: '>=0.10.0'} dev: true /is-obj@2.0.0: @@ -7000,10 +4506,6 @@ packages: engines: {node: '>=8'} dev: true - /is-object@1.0.2: - resolution: {integrity: sha512-2rRIahhZr2UWb45fIOuvZGpFtz0TyOZLf32KxBbSoUCeZR495zCKlWUKKUByk3geS2eAs7ZAABt0Y/Rx0GiQGA==} - dev: false - /is-path-inside@3.0.3: resolution: {integrity: sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==} engines: {node: '>=8'} @@ -7012,47 +4514,18 @@ packages: /is-plain-obj@1.1.0: resolution: {integrity: sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==} engines: {node: '>=0.10.0'} + dev: true /is-potential-custom-element-name@1.0.1: resolution: {integrity: sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==} dev: true - /is-reference@1.2.1: - resolution: {integrity: sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==} - dependencies: - '@types/estree': 1.0.5 - dev: true - /is-reference@3.0.2: resolution: {integrity: sha512-v3rht/LgVcsdZa3O2Nqs+NMowLOxeOm7Ay9+/ARQ2F+qEoANRcqrjAZKGN0v8ymUetZGgkp26LTnGT7H0Qo9Pg==} dependencies: '@types/estree': 1.0.5 dev: true - /is-regex@1.1.4: - resolution: {integrity: sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.7 - has-tostringtag: 1.0.2 - dev: true - - /is-retry-allowed@1.2.0: - resolution: {integrity: sha512-RUbUeKwvm3XG2VYamhJL1xFktgjvPzL0Hq8C+6yrWIswDy3BIXGqCxhxkc30N9jqK311gVU137K8Ei55/zVJRg==} - engines: {node: '>=0.10.0'} - dev: false - - /is-shared-array-buffer@1.0.3: - resolution: {integrity: sha512-nA2hv5XIhLR3uVzDDfCIknerhx8XUKnstuOERPNNIinXG7v9u+ohXF67vxm4TPTEPU6lm61ZkwP3c9PCB97rhg==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.7 - dev: true - - /is-stream@1.1.0: - resolution: {integrity: sha512-uQPm8kcs47jx38atAcWTVxyltQYoPT68y9aWYdV6yWXSyW8mzSat0TL6CiWdZeCdF3KrAvpVtnHbTv4RN+rqdQ==} - engines: {node: '>=0.10.0'} - /is-stream@2.0.1: resolution: {integrity: sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==} engines: {node: '>=8'} @@ -7063,20 +4536,6 @@ packages: engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} dev: true - /is-string@1.0.7: - resolution: {integrity: sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==} - engines: {node: '>= 0.4'} - dependencies: - has-tostringtag: 1.0.2 - dev: true - - /is-symbol@1.0.4: - resolution: {integrity: sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==} - engines: {node: '>= 0.4'} - dependencies: - has-symbols: 1.0.3 - dev: true - /is-text-path@1.0.1: resolution: {integrity: sha512-xFuJpne9oFz5qDaodwmmG08e3CawH/2ZV8Qqza1Ko7Sk8POWbkRdwIoAWVhqvq0XeUzANEhKo2n0IXUGBm7A/w==} engines: {node: '>=0.10.0'} @@ -7100,51 +4559,24 @@ packages: resolution: {integrity: sha512-rMYPYvCzsXywIsldgLaSoPlw5PfoB/ssr7hY4pLfcodrA5M/eArza1a9VmTiNIBNMjOGr1Ow9mTyU2o69U6U9Q==} dev: true - /is-weakref@1.0.2: - resolution: {integrity: sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==} - dependencies: - call-bind: 1.0.7 - dev: true - /is-windows@1.0.2: resolution: {integrity: sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==} engines: {node: '>=0.10.0'} dev: true - /is-wsl@2.2.0: - resolution: {integrity: sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==} - engines: {node: '>=8'} - dependencies: - is-docker: 2.2.1 - dev: false - - /isarray@0.0.1: - resolution: {integrity: sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==} - dev: true - /isarray@1.0.0: resolution: {integrity: sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==} - - /isarray@2.0.5: - resolution: {integrity: sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==} dev: true /isexe@2.0.0: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} + dev: true /isomorphic-timers-promises@1.0.1: resolution: {integrity: sha512-u4sej9B1LPSxTGKB/HiuzvEQnXH0ECYkSVQU39koSwmFAxhlEAFl9RdTvLv4TOTQUgBS5O3O5fwUxk6byBZ+IQ==} engines: {node: '>=10'} dev: true - /isurl@1.0.0: - resolution: {integrity: sha512-1P/yWsxPlDtn7QeRD+ULKQPaIaN6yF368GZ2vDfv0AL0NwpStafjWCDDdn0k8wgFMWpVAqG7oJhxHnlud42i9w==} - engines: {node: '>= 4'} - dependencies: - has-to-string-tag-x: 1.4.1 - is-object: 1.0.2 - dev: false - /jake@10.8.7: resolution: {integrity: sha512-ZDi3aP+fG/LchyBzUM804VjddnwfSfsdeYkwt8NcbKRvo4rFkjhs456iLFn3k2ZUWvNe4i48WACDbza8fhq2+w==} engines: {node: '>=10'} @@ -7156,15 +4588,6 @@ packages: minimatch: 3.1.2 dev: true - /jest-worker@26.6.2: - resolution: {integrity: sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ==} - engines: {node: '>= 10.13.0'} - dependencies: - '@types/node': 16.11.7 - merge-stream: 2.0.0 - supports-color: 7.2.0 - dev: true - /jiti@1.21.0: resolution: {integrity: sha512-gFqAIbuKyyso/3G2qhiO2OM6shY6EPP/R0+mkDbyspxKazh8BXDC5FiFsUjlczgdNz/vfra0da2y+aHrusLG/Q==} hasBin: true @@ -7189,14 +4612,6 @@ packages: resolution: {integrity: sha512-UfJMcSJc+SEXEl9lH/VLHSZbThQyLpw1vLO1Lb+j4RWDvG3N2f7yj3PVQA3cmkTBNldJ9eFnM+xEXxHIXrYiJw==} dev: true - /js-yaml@3.14.1: - resolution: {integrity: sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==} - hasBin: true - dependencies: - argparse: 1.0.10 - esprima: 4.0.1 - dev: true - /js-yaml@4.1.0: resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} hasBin: true @@ -7277,24 +4692,10 @@ packages: - utf-8-validate dev: true - /jsesc@2.5.2: - resolution: {integrity: sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==} - engines: {node: '>=4'} - hasBin: true - dev: true - - /json-buffer@3.0.0: - resolution: {integrity: sha512-CuUqjv0FUZIdXkHPI8MezCnFCdaTAacej1TZYulLoAg1h/PhwkdXFN4V/gzY4g+fMBCOV2xF+rp7t2XD2ns/NQ==} - dev: false - /json-buffer@3.0.1: resolution: {integrity: sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==} dev: true - /json-parse-better-errors@1.0.2: - resolution: {integrity: sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==} - dev: true - /json-parse-even-better-errors@2.3.1: resolution: {integrity: sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==} requiresBuild: true @@ -7312,17 +4713,6 @@ packages: resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==} dev: true - /json-stringify-safe@5.0.1: - resolution: {integrity: sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==} - dev: true - - /json5@1.0.2: - resolution: {integrity: sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==} - hasBin: true - dependencies: - minimist: 1.2.8 - dev: true - /jsonc-parser@3.2.1: resolution: {integrity: sha512-AilxAyFOAcK5wA1+LeaySVBrHsGQvUFCDWXKpZjzaL0PqW+xfBOttn8GNtWKFWqneyMZj41MWF9Kl6iPWLwgOA==} dev: true @@ -7331,6 +4721,7 @@ packages: resolution: {integrity: sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==} optionalDependencies: graceful-fs: 4.2.11 + dev: true /jsonfile@6.1.0: resolution: {integrity: sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==} @@ -7345,12 +4736,6 @@ packages: engines: {'0': node >= 0.2.0} dev: true - /keyv@3.0.0: - resolution: {integrity: sha512-eguHnq22OE3uVoSYG0LVWNP+4ppamWr9+zWBe1bsNcovIMy6huUJFPgy4mGwCd/rnl3vOLGW1MTlu4c57CT1xA==} - dependencies: - json-buffer: 3.0.0 - dev: false - /keyv@4.5.4: resolution: {integrity: sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==} dependencies: @@ -7411,16 +4796,6 @@ packages: - utf-8-validate dev: true - /load-json-file@4.0.0: - resolution: {integrity: sha512-Kx8hMakjX03tiGTLAIdJ+lL0htKnXjEZN6hk/tozf/WOuYGdZBJrZ+rCJRbVCugsjB3jMLn9746NsQIf5VjBMw==} - engines: {node: '>=4'} - dependencies: - graceful-fs: 4.2.11 - parse-json: 4.0.0 - pify: 3.0.0 - strip-bom: 3.0.0 - dev: true - /local-pkg@0.4.3: resolution: {integrity: sha512-SFppqq5p42fe2qcZQqqEOiVRXl+WCP1MdT6k7BDEW1j++sp5fIY+/fdRQitvKgB5BrBcmrs5m/L0v2FrU5MY1g==} engines: {node: '>=14'} @@ -7434,24 +4809,8 @@ packages: pkg-types: 1.0.3 dev: true - /locate-character@3.0.0: - resolution: {integrity: sha512-SW13ws7BjaeJ6p7Q6CO2nchbYEc3X3J6WrmTTDto7yMPqVSZTUyY5Tjbid+Ab8gLnATtygYtiDIJGQRRn2ZOiA==} - dev: true - - /locate-path@2.0.0: - resolution: {integrity: sha512-NCI2kiDkyR7VeEKm27Kda/iQHyKJe1Bu0FlTbYp3CqJu+9IFe9bLyAjMxf5ZDDbEg+iMPzB5zYyUTSm8wVTKmA==} - engines: {node: '>=4'} - dependencies: - p-locate: 2.0.0 - path-exists: 3.0.0 - dev: true - - /locate-path@3.0.0: - resolution: {integrity: sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==} - engines: {node: '>=6'} - dependencies: - p-locate: 3.0.0 - path-exists: 3.0.0 + /locate-character@3.0.0: + resolution: {integrity: sha512-SW13ws7BjaeJ6p7Q6CO2nchbYEc3X3J6WrmTTDto7yMPqVSZTUyY5Tjbid+Ab8gLnATtygYtiDIJGQRRn2ZOiA==} dev: true /locate-path@5.0.0: @@ -7472,11 +4831,6 @@ packages: resolution: {integrity: sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==} dev: false - /lodash-id@0.14.1: - resolution: {integrity: sha512-ikQPBTiq/d5m6dfKQlFdIXFzvThPi2Be9/AHxktOnDSfSxE1j9ICbBT5Elk1ke7HSTgM38LHTpmJovo9/klnLg==} - engines: {node: '>= 4'} - dev: false - /lodash-unified@1.0.3(@types/lodash-es@4.17.12)(lodash-es@4.17.21)(lodash@4.17.21): resolution: {integrity: sha512-WK9qSozxXOD7ZJQlpSqOT+om2ZfcT4yO+03FuzAHD0wF6S0l0090LRPDx3vhTTLZ8cFKpBn+IOcVXK6qOcIlfQ==} peerDependencies: @@ -7489,10 +4843,6 @@ packages: lodash-es: 4.17.21 dev: false - /lodash._reinterpolate@3.0.0: - resolution: {integrity: sha512-xYHt68QRoYGjeeM/XOE1uJtvXQAgvszfBhjV4yvsQH0u2i9I6cI6c6/eG4Hh3UAOVn0y/xAXwmTzEay49Q//HA==} - dev: true - /lodash.camelcase@4.3.0: resolution: {integrity: sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==} dev: true @@ -7509,10 +4859,6 @@ packages: resolution: {integrity: sha512-AirXNj15uRIMMPihnkInB4i3NHeb4iBtNg9WRWuK2o31S+ePwwNmDPaTL3o7dTJ+VXNZim7rFs4rxN4YU1oUJw==} dev: true - /lodash.ismatch@4.4.0: - resolution: {integrity: sha512-fPMfXjGQEV9Xsq/8MTSgUf255gawYRbjwMyDbcvDhXgV7enSZA0hynz6vMPnpAb5iONEzBHBPsT+0zes5Z301g==} - dev: true - /lodash.isplainobject@4.0.6: resolution: {integrity: sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==} dev: true @@ -7541,23 +4887,6 @@ packages: resolution: {integrity: sha512-+WKqsK294HMSc2jEbNgpHpd0JfIBhp7rEV4aqXWqFr6AlXov+SlcgB1Fv01y2kGe3Gc8nMW7VA0SrGuSkRfIEg==} dev: true - /lodash.template@4.5.0: - resolution: {integrity: sha512-84vYFxIkmidUiFxidA/KjjH9pAycqW+h980j7Fuz5qxRtO9pgB7MDFTdys1N7A5mcucRiDyEq4fusljItR1T/A==} - dependencies: - lodash._reinterpolate: 3.0.0 - lodash.templatesettings: 4.2.0 - dev: true - - /lodash.templatesettings@4.2.0: - resolution: {integrity: sha512-stgLz+i3Aa9mZgnjr/O+v9ruKZsPsndy7qPZOchbqk2cnTU1ZaldKK+v7m54WoKIyxiuMZTKT2H81F8BeAc3ZQ==} - dependencies: - lodash._reinterpolate: 3.0.0 - dev: true - - /lodash.truncate@4.4.2: - resolution: {integrity: sha512-jttmRe7bRse52OsWIMDLaXxWqRAmtIUccAQ3garviCqJjafXOfNMO0yMfNpdD6zbGaTU0P5Nz7e7gAT6cKmJRw==} - dev: true - /lodash.uniq@4.5.0: resolution: {integrity: sha512-xfBaXQd9ryd9dlSDvnvI0lvxfLJlYAZzXomUYzLKtUeOQvOP5piqAWuGtrhWeqaXK9hhoM/iyJc5AV+XfsX3HQ==} dev: true @@ -7566,20 +4895,9 @@ packages: resolution: {integrity: sha512-sReKOYJIJf74dhJONhU4e0/shzi1trVbSWDOhKYE5XV2O+H7Sb2Dihwuc7xWxVl+DgFPyTqIN3zMfT9cq5iWDg==} dev: true - /lodash@4.17.11: - resolution: {integrity: sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==} - dev: true - /lodash@4.17.21: resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} - /log-symbols@2.2.0: - resolution: {integrity: sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg==} - engines: {node: '>=4'} - dependencies: - chalk: 2.4.2 - dev: true - /log-symbols@4.1.0: resolution: {integrity: sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==} engines: {node: '>=10'} @@ -7593,14 +4911,6 @@ packages: engines: {node: '>=0.10.0'} dev: true - /loud-rejection@1.6.0: - resolution: {integrity: sha512-RPNliZOFkqFumDhvYqOaNY4Uz9oJM2K9tC6JWsJJsNdhuONW4LQHRBpb0qf4pJApVffI5N39SwzWZJuEhfd7eQ==} - engines: {node: '>=0.10.0'} - dependencies: - currently-unhandled: 0.4.1 - signal-exit: 3.0.7 - dev: true - /loupe@2.3.7: resolution: {integrity: sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA==} dependencies: @@ -7613,23 +4923,6 @@ packages: tslib: 2.6.2 dev: true - /lowercase-keys@1.0.0: - resolution: {integrity: sha512-RPlX0+PHuvxVDZ7xX+EBVAp4RsVxP/TdDSN2mJYdiq1Lc4Hz7EUSjUI7RZrKKlmrIzVhf6Jo2stj7++gVarS0A==} - engines: {node: '>=0.10.0'} - dev: false - - /lowercase-keys@1.0.1: - resolution: {integrity: sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA==} - engines: {node: '>=0.10.0'} - dev: false - - /lru-cache@4.1.5: - resolution: {integrity: sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==} - dependencies: - pseudomap: 1.0.2 - yallist: 2.1.2 - dev: true - /lru-cache@6.0.0: resolution: {integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==} engines: {node: '>=10'} @@ -7637,12 +4930,6 @@ packages: yallist: 4.0.0 dev: true - /magic-string@0.25.9: - resolution: {integrity: sha512-RmF0AsMzgt25qzqqLc1+MbHmhdx0ojF2Fvs4XnOqz2ZOBXzzkEwc/dJQZCYHAn7v1jbVOjAZfK8msRn4BxO4VQ==} - dependencies: - sourcemap-codec: 1.4.8 - dev: true - /magic-string@0.29.0: resolution: {integrity: sha512-WcfidHrDjMY+eLjlU+8OvwREqHwpgCeKVBUpQ3OhYYuvfaYCUgcbuBzappNzZvg/v8onU3oQj+BYpkOJe9Iw4Q==} engines: {node: '>=12'} @@ -7656,20 +4943,6 @@ packages: dependencies: '@jridgewell/sourcemap-codec': 1.4.15 - /make-dir@1.3.0: - resolution: {integrity: sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==} - engines: {node: '>=4'} - dependencies: - pify: 3.0.0 - dev: false - - /make-dir@3.1.0: - resolution: {integrity: sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==} - engines: {node: '>=8'} - dependencies: - semver: 6.3.1 - dev: true - /make-error@1.3.6: resolution: {integrity: sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==} dev: true @@ -7679,11 +4952,6 @@ packages: engines: {node: '>=0.10.0'} dev: true - /map-obj@2.0.0: - resolution: {integrity: sha512-TzQSV2DiMYgoF5RycneKVUzIa9bQsj/B3tTgsE3dOGqlzHnGIDaC7XBE7grnA+8kZPnfqSGFe95VHc2oc0VFUQ==} - engines: {node: '>=4'} - dev: true - /map-obj@4.3.0: resolution: {integrity: sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ==} engines: {node: '>=8'} @@ -7704,14 +4972,6 @@ packages: safe-buffer: 5.2.1 dev: true - /md5@2.3.0: - resolution: {integrity: sha512-T1GITYmFaKuO91vxyoQMFETst+O71VUPEU3ze5GNzDm0OWdP8v1ziTaAEPUr/3kLsY3Sftgz242A1SetQiDL7g==} - dependencies: - charenc: 0.0.2 - crypt: 0.0.2 - is-buffer: 1.1.6 - dev: false - /mdn-data@2.0.30: resolution: {integrity: sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==} dev: true @@ -7720,36 +4980,6 @@ packages: resolution: {integrity: sha512-rkpe71W0N0c0Xz6QD0eJETuWAJGnJ9afsl1srmwPrI+yBCkge5EycXXbYRyvL29zZVUWQCY7InPRCv3GDXuZNw==} dev: false - /meow@4.0.1: - resolution: {integrity: sha512-xcSBHD5Z86zaOc+781KrupuHAzeGXSLtiAOmBsiLDiPSaYSB6hdew2ng9EBAnZ62jagG9MHAOdxpDi/lWBFJ/A==} - engines: {node: '>=4'} - dependencies: - camelcase-keys: 4.2.0 - decamelize-keys: 1.1.1 - loud-rejection: 1.6.0 - minimist: 1.2.8 - minimist-options: 3.0.2 - normalize-package-data: 2.5.0 - read-pkg-up: 3.0.0 - redent: 2.0.0 - trim-newlines: 2.0.0 - dev: true - - /meow@5.0.0: - resolution: {integrity: sha512-CbTqYU17ABaLefO8vCU153ZZlprKYWDljcndKKDCFcYQITzWCXZAVk4QMFZPgvzrnUQ3uItnIE/LoUOwrT15Ig==} - engines: {node: '>=6'} - dependencies: - camelcase-keys: 4.2.0 - decamelize-keys: 1.1.1 - loud-rejection: 1.6.0 - minimist-options: 3.0.2 - normalize-package-data: 2.5.0 - read-pkg-up: 3.0.0 - redent: 2.0.0 - trim-newlines: 2.0.0 - yargs-parser: 10.1.0 - dev: true - /meow@8.1.2: resolution: {integrity: sha512-r85E3NdZ+mpYk1C6RjPFEMSE+s1iZMuHtsHAqY0DT3jZczl0diWUZ8g6oU7h0M9cD2EL+PzaYghhCLzR0ZNn5Q==} engines: {node: '>=10'} @@ -7774,6 +5004,7 @@ packages: /merge2@1.4.1: resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} engines: {node: '>= 8'} + dev: true /merge@2.1.1: resolution: {integrity: sha512-jz+Cfrg9GWOZbQAnDQ4hlVnQky+341Yk5ru8bZSe6sIDTCIg8n9i/u7hSQGSVOF3C7lH6mGtqjkiT9G4wFLL0w==} @@ -7785,6 +5016,7 @@ packages: dependencies: braces: 3.0.2 picomatch: 2.3.1 + dev: true /miller-rabin@4.0.1: resolution: {integrity: sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==} @@ -7797,27 +5029,19 @@ packages: /mime-db@1.50.0: resolution: {integrity: sha512-9tMZCDlYHqeERXEHO9f/hKfNXhre5dK2eE/krIvUjZbS2KPcqGDfNShIWS1uW9XOTKQKqK6qbeOci18rbfW77A==} engines: {node: '>= 0.6'} - - /mime-db@1.52.0: - resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} - engines: {node: '>= 0.6'} - dev: false + dev: true /mime-types@2.1.33: resolution: {integrity: sha512-plLElXp7pRDd0bNZHw+nMd52vRYjLwQjygaNg7ddJ2uJtTlmnTCjWuPKxVu6//AdaRuME84SvLW91sIkBqGT0g==} engines: {node: '>= 0.6'} dependencies: mime-db: 1.50.0 - - /mime@2.6.0: - resolution: {integrity: sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg==} - engines: {node: '>=4.0.0'} - hasBin: true - dev: false + dev: true /mimic-fn@1.2.0: resolution: {integrity: sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==} engines: {node: '>=4'} + dev: true /mimic-fn@2.1.0: resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} @@ -7829,11 +5053,6 @@ packages: engines: {node: '>=12'} dev: true - /mimic-response@1.0.1: - resolution: {integrity: sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==} - engines: {node: '>=4'} - dev: false - /min-indent@1.0.1: resolution: {integrity: sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==} engines: {node: '>=4'} @@ -7857,6 +5076,7 @@ packages: resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} dependencies: brace-expansion: 1.1.11 + dev: true /minimatch@5.1.6: resolution: {integrity: sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==} @@ -7879,14 +5099,6 @@ packages: brace-expansion: 2.0.1 dev: true - /minimist-options@3.0.2: - resolution: {integrity: sha512-FyBrT/d0d4+uiZRbqznPXqw3IpZZG3gl3wKWiX784FycUKVwBt0uLBFkQrtE4tZOrgo78nZp2jnKz3L65T5LdQ==} - engines: {node: '>= 4'} - dependencies: - arrify: 1.0.1 - is-plain-obj: 1.1.0 - dev: true - /minimist-options@4.1.0: resolution: {integrity: sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A==} engines: {node: '>= 6'} @@ -7902,17 +5114,6 @@ packages: /minimist@1.2.8: resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==} - - /mkdirp@0.5.6: - resolution: {integrity: sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==} - hasBin: true - dependencies: - minimist: 1.2.8 - - /mkdirp@1.0.4: - resolution: {integrity: sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==} - engines: {node: '>=10'} - hasBin: true dev: true /mkdirp@2.1.6: @@ -7930,21 +5131,9 @@ packages: ufo: 1.4.0 dev: true - /mockdate@3.0.5: - resolution: {integrity: sha512-iniQP4rj1FhBdBYS/+eQv7j1tadJ9lJtdzgOpvsOHng/GbcDh2Fhdeq+ZRldrPYdXvCyfFUmFeEwEGXZB5I/AQ==} - dev: false - - /modify-values@1.0.1: - resolution: {integrity: sha512-xV2bxeN6F7oYjZWTe/YPAy6MN2M+sL4u/Rlm2AHCIVGfo2p1yGmBHQ6vHehl4bRTZBdHu3TSkWdYgkwpYzAGSw==} - engines: {node: '>=0.10.0'} - dev: true - - /ms@2.0.0: - resolution: {integrity: sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==} - dev: false - /ms@2.1.2: resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} + dev: true /muggle-string@0.3.1: resolution: {integrity: sha512-ckmWDJjphvd/FvZawgygcUeQCxzvohjFO5RxTjj4eq8kw359gFF3E1brjfI+viLMxss5JrHTDRHZvu2/tuy0Qg==} @@ -7956,19 +5145,12 @@ packages: /mute-stream@0.0.7: resolution: {integrity: sha512-r65nCZhrbXXb6dXOACihYApHw2Q6pV0M3V0PSxd74N0+D8nzAdEAITq2oAjA1jVnKI+tGvEBUpqiMh0+rW6zDQ==} + dev: true /mute-stream@0.0.8: resolution: {integrity: sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==} dev: true - /mz@2.7.0: - resolution: {integrity: sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==} - dependencies: - any-promise: 1.3.0 - object-assign: 4.1.1 - thenify-all: 1.6.0 - dev: false - /nanoid@3.3.7: resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} @@ -7982,13 +5164,6 @@ packages: resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} dev: true - /neo-async@2.6.2: - resolution: {integrity: sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==} - dev: true - - /nice-try@1.0.5: - resolution: {integrity: sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==} - /no-case@3.0.4: resolution: {integrity: sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==} dependencies: @@ -8036,13 +5211,6 @@ packages: vm-browserify: 1.1.2 dev: true - /noms@0.0.0: - resolution: {integrity: sha512-lNDU9VJaOPxUmXcLb+HQFeUgQQPtMI24Gt6hgfuMHRJgMRHMF/qZ4HJD3GDru4sSw9IQl2jPjAYnQrdIeLbwow==} - dependencies: - inherits: 2.0.4 - readable-stream: 1.0.34 - dev: true - /normalize-package-data@2.5.0: resolution: {integrity: sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==} dependencies: @@ -8067,34 +5235,10 @@ packages: engines: {node: '>=0.10.0'} dev: true - /normalize-url@2.0.1: - resolution: {integrity: sha512-D6MUW4K/VzoJ4rJ01JFKxDrtY1v9wrgzCX5f2qj/lzH1m/lW6MhUZFKerVsnyjOhOsYzI9Kqqak+10l4LvLpMw==} - engines: {node: '>=4'} - dependencies: - prepend-http: 2.0.0 - query-string: 5.1.1 - sort-keys: 2.0.0 - dev: false - /normalize-wheel-es@1.2.0: resolution: {integrity: sha512-Wj7+EJQ8mSuXr2iWfnujrimU35R2W4FAErEyTmJoJ7ucwTn2hOUSsRehMb5RSYkxXGTM7Y9QpvPmp++w5ftoJw==} dev: false - /npm-conf@1.1.3: - resolution: {integrity: sha512-Yic4bZHJOt9RCFbRP3GgpqhScOY4HH3V2P8yBj6CeYq118Qr+BLXqT2JvpJ00mryLESpgOxf5XlFv4ZjXxLScw==} - engines: {node: '>=4'} - dependencies: - config-chain: 1.1.13 - pify: 3.0.0 - dev: false - - /npm-run-path@2.0.2: - resolution: {integrity: sha512-lJxZYlT4DW/bRUtFh1MQIWqmLwQfAxnqWG4HhEdjMlkrJYnJn0Jrr2u3mgxqaWsdiBc76TYkTG/mhrnYTuzfHw==} - engines: {node: '>=4'} - dependencies: - path-key: 2.0.1 - dev: true - /npm-run-path@4.0.1: resolution: {integrity: sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==} engines: {node: '>=8'} @@ -8115,22 +5259,13 @@ packages: boolbase: 1.0.0 dev: true - /number-is-nan@1.0.1: - resolution: {integrity: sha512-4jbtZXNAsfZbAHiiqjLPBiCl16dES1zI4Hpzzxw61Tk+loF+sBDBKx1ICKKKwIqQ7M0mFn1TmkN7euSncWgHiQ==} - engines: {node: '>=0.10.0'} - dev: true - /nwsapi@2.2.7: resolution: {integrity: sha512-ub5E4+FBPKwAZx0UwIQOjYWGHTEq5sPqHQNRN8Z9e4A7u3Tj1weLJsL59yH9vmvqEtBHaOmT6cYQKIZOxp35FQ==} dev: true - /object-assign@4.1.1: - resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} - engines: {node: '>=0.10.0'} - dev: false - /object-inspect@1.13.1: resolution: {integrity: sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==} + dev: true /object-is@1.1.6: resolution: {integrity: sha512-F8cZ+KfGlSGi09lJT7/Nd6KJZ9ygtvYC0/UYYLI9nmQKLMnydpB9yvbv9K1uSkEu7FU9vYPmVwLg328tX+ot3Q==} @@ -8155,44 +5290,18 @@ packages: object-keys: 1.1.1 dev: true - /object.fromentries@2.0.7: - resolution: {integrity: sha512-UPbPHML6sL8PI/mOqPwsH4G6iyXcCGzLin8KvEPenOZN5lpCNBZZQ+V62vdjB1mQHrmqGQt5/OJzemUA+KJmEA==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.7 - define-properties: 1.2.1 - es-abstract: 1.22.5 - dev: true - - /object.groupby@1.0.2: - resolution: {integrity: sha512-bzBq58S+x+uo0VjurFT0UktpKHOZmv4/xePiOA1nbB9pMqpGK7rUPNgf+1YC+7mE+0HzhTMqNUuCqvKhj6FnBw==} - dependencies: - array.prototype.filter: 1.0.3 - call-bind: 1.0.7 - define-properties: 1.2.1 - es-abstract: 1.22.5 - es-errors: 1.3.0 - dev: true - - /object.values@1.1.7: - resolution: {integrity: sha512-aU6xnDFYT3x17e/f0IiiwlGPTy2jzMySGfUB4fq6z7CV8l85CWHDk5ErhyhpfDHhrOMwGFhSQkhMGHaIotA6Ng==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.7 - define-properties: 1.2.1 - es-abstract: 1.22.5 - dev: true - /once@1.4.0: resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} dependencies: wrappy: 1.0.2 + dev: true /onetime@2.0.1: resolution: {integrity: sha512-oyyPpiMaKARvvcgip+JV+7zci5L8D1W9RZIz2l1o08AM3pfspitVWnPt3mzHcBPp12oYMTy0pqrFs/C+m3EwsQ==} engines: {node: '>=4'} dependencies: mimic-fn: 1.2.0 + dev: true /onetime@5.1.2: resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==} @@ -8224,18 +5333,6 @@ packages: resolution: {integrity: sha512-k41FwbcLnlgnFh69f4qdUfvDQ+5vaSDnVPFI/y5XuhKRq97EnVVneO9F1ESVCdiVu4fCS2L8usX3mU331hB7pg==} dev: true - /ora@3.4.0: - resolution: {integrity: sha512-eNwHudNbO1folBP3JsZ19v9azXWtQZjICdr3Q0TDPIaeBQ3mXLrh54wM+er0+hSp+dWKf+Z8KM58CYzEyIYxYg==} - engines: {node: '>=6'} - dependencies: - chalk: 2.4.2 - cli-cursor: 2.1.0 - cli-spinners: 2.9.2 - log-symbols: 2.2.0 - strip-ansi: 5.2.0 - wcwidth: 1.0.1 - dev: true - /ora@5.4.1: resolution: {integrity: sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==} engines: {node: '>=10'} @@ -8255,63 +5352,9 @@ packages: resolution: {integrity: sha512-gjcpUc3clBf9+210TRaDWbf+rZZZEshZ+DlXMRCeAjp0xhTrnQsKHypIy1J3d5hKdUzj69t708EHtU8P6bUn0A==} dev: true - /os-homedir@1.0.2: - resolution: {integrity: sha512-B5JU3cabzk8c67mRRd3ECmROafjYMXbuzlwtqdM8IbS8ktlTix8aFGb2bAGKrSRIlnfKwovGUUr72JUPyOb6kQ==} - engines: {node: '>=0.10.0'} - dev: true - - /os-name@1.0.3: - resolution: {integrity: sha512-f5estLO2KN8vgtTRaILIgEGBoBrMnZ3JQ7W9TMZCnOIGwHe8TRGSpcagnWDo+Dfhd/z08k9Xe75hvciJJ8Qaew==} - engines: {node: '>=0.10.0'} - hasBin: true - dependencies: - osx-release: 1.1.0 - win-release: 1.1.1 - dev: false - - /os-shim@0.1.3: - resolution: {integrity: sha512-jd0cvB8qQ5uVt0lvCIexBaROw1KyKm5sbulg2fWOHjETisuCzWyt+eTZKEMs8v6HwzoGs8xik26jg7eCM6pS+A==} - engines: {node: '>= 0.4.0'} - dev: true - /os-tmpdir@1.0.2: resolution: {integrity: sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==} engines: {node: '>=0.10.0'} - - /osx-release@1.1.0: - resolution: {integrity: sha512-ixCMMwnVxyHFQLQnINhmIpWqXIfS2YOXchwQrk+OFzmo6nDjQ0E4KXAyyUh0T0MZgV4bUhkRrAbVqlE4yLVq4A==} - engines: {node: '>=0.10.0'} - hasBin: true - dependencies: - minimist: 1.2.8 - dev: false - - /p-cancelable@0.4.1: - resolution: {integrity: sha512-HNa1A8LvB1kie7cERyy21VNeHb2CWJJYqyyC2o3klWFfMGlFmWv2Z7sFgZH8ZiaYL95ydToKTFVXgMV/Os0bBQ==} - engines: {node: '>=4'} - dev: false - - /p-event@2.3.1: - resolution: {integrity: sha512-NQCqOFhbpVTMX4qMe8PF8lbGtzZ+LCiN7pcNrb/413Na7+TRoe1xkKUzuWa/YEJdGQ0FvKtj35EEbDoVPO2kbA==} - engines: {node: '>=6'} - dependencies: - p-timeout: 2.0.1 - dev: false - - /p-finally@1.0.0: - resolution: {integrity: sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow==} - engines: {node: '>=4'} - - /p-is-promise@1.1.0: - resolution: {integrity: sha512-zL7VE4JVS2IFSkR2GQKDSPEVxkoH43/p7oEnwpdCndKYJO0HVeRB7fA8TJwuLOTBREtK0ea8eHaxdwcpob5dmg==} - engines: {node: '>=4'} - dev: false - - /p-limit@1.3.0: - resolution: {integrity: sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==} - engines: {node: '>=4'} - dependencies: - p-try: 1.0.0 dev: true /p-limit@2.3.0: @@ -8342,20 +5385,6 @@ packages: yocto-queue: 1.0.0 dev: true - /p-locate@2.0.0: - resolution: {integrity: sha512-nQja7m7gSKuewoVRen45CtVfODR3crN3goVQ0DDZ9N3yHxgpkuBhZqsaiotSQRrADUrne346peY7kT3TSACykg==} - engines: {node: '>=4'} - dependencies: - p-limit: 1.3.0 - dev: true - - /p-locate@3.0.0: - resolution: {integrity: sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==} - engines: {node: '>=6'} - dependencies: - p-limit: 2.3.0 - dev: true - /p-locate@4.1.0: resolution: {integrity: sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==} engines: {node: '>=8'} @@ -8370,18 +5399,6 @@ packages: p-limit: 3.1.0 dev: true - /p-timeout@2.0.1: - resolution: {integrity: sha512-88em58dDVB/KzPEx1X0N3LwFfYZPyDc4B6eF38M1rk9VTZMbxXXgjugz8mmwpS9Ox4BDZ+t6t3QP5+/gazweIA==} - engines: {node: '>=4'} - dependencies: - p-finally: 1.0.0 - dev: false - - /p-try@1.0.0: - resolution: {integrity: sha512-U1etNYuMJoIz3ZXSrrySFjsXQTWOx2/jdi86L+2pRvph/qMKL6sbcCYdH23fqsbm8TH2Gn0OybpT4eSFlCVHww==} - engines: {node: '>=4'} - dev: true - /p-try@2.2.0: resolution: {integrity: sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==} engines: {node: '>=6'} @@ -8417,14 +5434,6 @@ packages: safe-buffer: 5.2.1 dev: true - /parse-json@4.0.0: - resolution: {integrity: sha512-aOIos8bujGN93/8Ox/jPLh7RwVnPEysynVFE+fQZyg6jKELEHwzgKdLRFHUgXJL6kylijVSBC4BvN9OmsB48Rw==} - engines: {node: '>=4'} - dependencies: - error-ex: 1.3.2 - json-parse-better-errors: 1.0.2 - dev: true - /parse-json@5.2.0: resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==} engines: {node: '>=8'} @@ -8457,11 +5466,6 @@ packages: resolution: {integrity: sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==} dev: true - /path-exists@3.0.0: - resolution: {integrity: sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==} - engines: {node: '>=4'} - dev: true - /path-exists@4.0.0: resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} engines: {node: '>=8'} @@ -8470,10 +5474,7 @@ packages: /path-is-absolute@1.0.1: resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} engines: {node: '>=0.10.0'} - - /path-key@2.0.1: - resolution: {integrity: sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw==} - engines: {node: '>=4'} + dev: true /path-key@3.1.1: resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} @@ -8487,17 +5488,12 @@ packages: /path-parse@1.0.7: resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} - - /path-type@3.0.0: - resolution: {integrity: sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==} - engines: {node: '>=4'} - dependencies: - pify: 3.0.0 dev: true /path-type@4.0.0: resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==} engines: {node: '>=8'} + dev: true /pathe@0.2.0: resolution: {integrity: sha512-sTitTPYnn23esFR3RlqYBWn4c45WGeLcsKzQiUpXJAyfcWkolvlYpV8FLo7JishK946oQwMFUCHXQ9AjGPKExw==} @@ -8511,12 +5507,6 @@ packages: resolution: {integrity: sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==} dev: true - /pause-stream@0.0.11: - resolution: {integrity: sha512-e3FBlXLmN/D1S+zHzanP4E/4Z60oFAa3O051qt1pxa7DEJWKAyil6upYVXCWadEnuoqa4Pkc9oUx9zsxYeRv8A==} - dependencies: - through: 2.3.8 - dev: false - /pbkdf2@3.1.2: resolution: {integrity: sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA==} engines: {node: '>=0.12'} @@ -8528,57 +5518,20 @@ packages: sha.js: 2.4.11 dev: true - /pend@1.2.0: - resolution: {integrity: sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg==} - dev: false - /periscopic@3.1.0: resolution: {integrity: sha512-vKiQ8RRtkl9P+r/+oefh25C3fhybptkHKCZSPlcXiJux2tJF55GnEj3BVn4A5gKfq9NWWXXrxkHBwVPUfH0opw==} dependencies: '@types/estree': 1.0.5 estree-walker: 3.0.3 - is-reference: 3.0.2 - dev: true - - /picocolors@1.0.0: - resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} - - /picomatch@2.3.1: - resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} - engines: {node: '>=8.6'} - - /pify@2.3.0: - resolution: {integrity: sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==} - engines: {node: '>=0.10.0'} - - /pify@3.0.0: - resolution: {integrity: sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==} - engines: {node: '>=4'} - - /pinkie-promise@2.0.1: - resolution: {integrity: sha512-0Gni6D4UcLTbv9c57DfxDGdr41XfgUjqWZu492f0cIGr16zDU06BWP/RAEvOuo7CQ0CNjHaLlM59YJJFm3NWlw==} - engines: {node: '>=0.10.0'} - dependencies: - pinkie: 2.0.4 - dev: false - - /pinkie@2.0.4: - resolution: {integrity: sha512-MnUuEycAemtSaeFSjXKW/aroV7akBbY+Sv+RkyqFjgAe73F+MR0TBWKBRDkmfWq/HiFmdavfZ1G7h4SPZXaCSg==} - engines: {node: '>=0.10.0'} - dev: false - - /pkg-dir@3.0.0: - resolution: {integrity: sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==} - engines: {node: '>=6'} - dependencies: - find-up: 3.0.0 + is-reference: 3.0.2 dev: true - /pkg-dir@4.2.0: - resolution: {integrity: sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==} - engines: {node: '>=8'} - dependencies: - find-up: 4.1.0 + /picocolors@1.0.0: + resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} + + /picomatch@2.3.1: + resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} + engines: {node: '>=8.6'} dev: true /pkg-dir@5.0.0: @@ -8596,12 +5549,6 @@ packages: pathe: 1.1.2 dev: true - /please-upgrade-node@3.2.0: - resolution: {integrity: sha512-gQR3WpIgNIKwBMVLkpMUeR3e1/E1y42bqDQZfql+kDeXd8COYfM8PQA4X6y7a8u9Ua9FHmsrrmirW2vHs45hWg==} - dependencies: - semver-compare: 1.0.0 - dev: true - /possible-typed-array-names@1.0.0: resolution: {integrity: sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==} engines: {node: '>= 0.4'} @@ -8659,25 +5606,11 @@ packages: picocolors: 1.0.0 source-map-js: 1.0.2 - /pre-commit@1.2.2: - resolution: {integrity: sha512-qokTiqxD6GjODy5ETAIgzsRgnBWWQHQH2ghy86PU7mIn/wuWeTwF3otyNQZxWBwVn8XNr8Tdzj/QfUXpH+gRZA==} - requiresBuild: true - dependencies: - cross-spawn: 5.1.0 - spawn-sync: 1.0.15 - which: 1.2.14 - dev: true - /prelude-ls@1.2.1: resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} engines: {node: '>= 0.8.0'} dev: true - /prepend-http@2.0.0: - resolution: {integrity: sha512-ravE6m9Atw9Z/jjttRUZ+clIXogdghyZAuWJ3qEzjT+jI/dL1ifAqhZeC5VHzQp1MSt1+jxKkFNemj/iO7tVUA==} - engines: {node: '>=4'} - dev: false - /prettier-linter-helpers@1.0.0: resolution: {integrity: sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==} engines: {node: '>=6.0.0'} @@ -8721,25 +5654,13 @@ packages: /process-nextick-args@2.0.1: resolution: {integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==} + dev: true /process@0.11.10: resolution: {integrity: sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==} engines: {node: '>= 0.6.0'} dev: true - /progress@2.0.3: - resolution: {integrity: sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==} - engines: {node: '>=0.4.0'} - dev: true - - /proto-list@1.2.4: - resolution: {integrity: sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==} - dev: false - - /pseudomap@1.0.2: - resolution: {integrity: sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ==} - dev: true - /psl@1.9.0: resolution: {integrity: sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==} dev: true @@ -8755,12 +5676,6 @@ packages: safe-buffer: 5.2.1 dev: true - /pump@3.0.0: - resolution: {integrity: sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==} - dependencies: - end-of-stream: 1.4.4 - once: 1.4.0 - /punycode@1.4.1: resolution: {integrity: sha512-jmYNElW7yvO7TV33CjSmvSiE2yco3bV2czu/OzDKdMNVZQWfxCblURLhf+47syQRBntjfLdd/H0egrzIG+oaFQ==} dev: true @@ -8770,45 +5685,12 @@ packages: engines: {node: '>=6'} dev: true - /q@1.5.1: - resolution: {integrity: sha512-kV/CThkXo6xyFEZUugw/+pIOywXcDbFYgSct5cT3gqlbkBE1SJdwy6UQoZvodiWF/ckQLZyDE/Bu1M6gVu5lVw==} - engines: {node: '>=0.6.0', teleport: '>=0.2.0'} - dev: true - - /qiniu@7.11.1: - resolution: {integrity: sha512-Y+/LQqXW0DrtiLLTL8CQEO0XD4w1vKR7eDp2dXvJj+4uVNKA++1LeVQHTPYLJTBitR4jFCd6pJGD7q6QDl9KQA==} - engines: {node: '>= 6'} - dependencies: - agentkeepalive: 4.5.0 - before: 0.0.1 - block-stream2: 2.1.0 - crc32: 0.2.2 - destroy: 1.2.0 - encodeurl: 1.0.2 - formstream: 1.3.1 - mime: 2.6.0 - mockdate: 3.0.5 - tunnel-agent: 0.6.0 - urllib: 2.41.0 - transitivePeerDependencies: - - proxy-agent - - supports-color - dev: false - /qs@6.12.0: resolution: {integrity: sha512-trVZiI6RMOkO476zLGaBIzszOdFPnCCXHPG9kn0yuS1uz6xdVxPfZdB3vUig9pxPFDM9BRAgz/YUIVQ1/vuiUg==} engines: {node: '>=0.6'} dependencies: side-channel: 1.0.6 - - /query-string@5.1.1: - resolution: {integrity: sha512-gjWOsm2SoGlgLEdAGt7a6slVOk9mGiXmPFMqrEhLQ68rhQuBnpfs3+EmlvqKyxnCo9/PPlF+9MtY02S1aFg+Jw==} - engines: {node: '>=0.10.0'} - dependencies: - decode-uri-component: 0.2.2 - object-assign: 4.1.1 - strict-uri-encode: 1.1.0 - dev: false + dev: true /querystring-es3@0.2.1: resolution: {integrity: sha512-773xhDQnZBMFobEiztv8LIl70ch5MSF/jUQVlhwFyBILqq96anmoctVIYz+ZRp0qbCKATTn6ev02M3r7Ga5vqA==} @@ -8821,16 +5703,6 @@ packages: /queue-microtask@1.2.3: resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} - - /queue@6.0.1: - resolution: {integrity: sha512-AJBQabRCCNr9ANq8v77RJEv73DPbn55cdTb+Giq4X0AVnNVZvMHlYp7XlQiN+1npCZj1DuSmaA2hYVUUDgxFDg==} - dependencies: - inherits: 2.0.4 - dev: false - - /quick-lru@1.1.0: - resolution: {integrity: sha512-tRS7sTgyxMXtLum8L65daJnHUhfDUgboRdcWW2bR9vBfrj2+O5HSMbQOJfJJjIVSPFqbBCF37FpwWXGitDc5tA==} - engines: {node: '>=4'} dev: true /quick-lru@4.0.1: @@ -8859,14 +5731,6 @@ packages: resolution: {integrity: sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==} dev: true - /read-pkg-up@3.0.0: - resolution: {integrity: sha512-YFzFrVvpC6frF1sz8psoHDBGF7fLPc+llq/8NB43oagqWkx8ar5zYtsTORtOjw9W2RHLpWP+zTWwBvf1bCmcSw==} - engines: {node: '>=4'} - dependencies: - find-up: 2.1.0 - read-pkg: 3.0.0 - dev: true - /read-pkg-up@7.0.1: resolution: {integrity: sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==} engines: {node: '>=8'} @@ -8876,24 +5740,6 @@ packages: type-fest: 0.8.1 dev: true - /read-pkg@3.0.0: - resolution: {integrity: sha512-BLq/cCO9two+lBgiTYNqD6GdtK8s4NpaWrl6/rCO9w0TUS8oJl7cmToOZfRYllKTISY6nt1U7jQ53brmKqY6BA==} - engines: {node: '>=4'} - dependencies: - load-json-file: 4.0.0 - normalize-package-data: 2.5.0 - path-type: 3.0.0 - dev: true - - /read-pkg@4.0.1: - resolution: {integrity: sha512-+UBirHHDm5J+3WDmLBZYSklRYg82nMlz+enn+GMZ22nSR2f4bzxmhso6rzQW/3mT2PVzpzDTiYIZahk8UmZ44w==} - engines: {node: '>=6'} - dependencies: - normalize-package-data: 2.5.0 - parse-json: 4.0.0 - pify: 3.0.0 - dev: true - /read-pkg@5.2.0: resolution: {integrity: sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==} engines: {node: '>=8'} @@ -8904,15 +5750,6 @@ packages: type-fest: 0.6.0 dev: true - /readable-stream@1.0.34: - resolution: {integrity: sha512-ok1qVCJuRkNmvebYikljxJA/UEsKwLl2nI1OmaqAu4/UE+h0wKCHok4XkL/gvi39OacXvw59RJUOFUkDib2rHg==} - dependencies: - core-util-is: 1.0.3 - inherits: 2.0.4 - isarray: 0.0.1 - string_decoder: 0.10.31 - dev: true - /readable-stream@2.3.8: resolution: {integrity: sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==} dependencies: @@ -8923,6 +5760,7 @@ packages: safe-buffer: 5.1.2 string_decoder: 1.1.1 util-deprecate: 1.0.2 + dev: true /readable-stream@3.6.2: resolution: {integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==} @@ -8931,6 +5769,7 @@ packages: inherits: 2.0.4 string_decoder: 1.3.0 util-deprecate: 1.0.2 + dev: true /readdirp@3.6.0: resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==} @@ -8939,14 +5778,6 @@ packages: picomatch: 2.3.1 dev: true - /redent@2.0.0: - resolution: {integrity: sha512-XNwrTx77JQCEMXTeb8movBKuK75MgH0RZkujNuDKCezemx/voapl9i2gCSi8WWm8+ox5ycJi1gxF22fR7c0Ciw==} - engines: {node: '>=4'} - dependencies: - indent-string: 3.2.0 - strip-indent: 2.0.0 - dev: true - /redent@3.0.0: resolution: {integrity: sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==} engines: {node: '>=8'} @@ -8955,39 +5786,11 @@ packages: strip-indent: 3.0.0 dev: true - /regenerator-runtime@0.10.5: - resolution: {integrity: sha512-02YopEIhAgiBHWeoTiA8aitHDt8z6w+rQqNuIftlM+ZtvSl/brTouaU7DW6GO/cHtvxJvS4Hwv2ibKdxIRi24w==} - dev: true - - /regenerator-runtime@0.11.1: - resolution: {integrity: sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==} - dev: true - - /regexp.prototype.flags@1.5.2: - resolution: {integrity: sha512-NcDiDkTLuPR+++OCKB0nWafEmhg/Da8aUPLPMQbK+bxKKCm1/S5he+AqYa4PlMCVBalb4/yxIRub6qkEx5yJbw==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.7 - define-properties: 1.2.1 - es-errors: 1.3.0 - set-function-name: 2.0.2 - dev: true - - /regexpp@3.2.0: - resolution: {integrity: sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==} - engines: {node: '>=8'} - dev: true - /relateurl@0.2.7: resolution: {integrity: sha512-G08Dxvm4iDN3MLM0EsP62EDV9IuhXPR6blNz6Utcp7zyV3tr4HVNINt6MpaRWbxoOHT3Q7YN2P+jaHX8vUbgog==} engines: {node: '>= 0.10'} dev: true - /repeat-string@1.6.1: - resolution: {integrity: sha512-PV0dzCYDNfRi1jCDbJzpW7jNNDRuCOG/jI5ctQcGKt/clZD+YcPS3yIlWuTJMmESC8aevCFmWJy5wjAFgNqN6w==} - engines: {node: '>=0.10'} - dev: false - /require-directory@2.1.1: resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} engines: {node: '>=0.10.0'} @@ -9009,11 +5812,6 @@ packages: global-modules: 1.0.0 dev: true - /resolve-from@3.0.0: - resolution: {integrity: sha512-GnlH6vxLymXJNMBo7XP1fJIzBFbdYt49CuTwmB/6N53t+kMPRMFKz783LlQ4tv28XoQfMWinAJX6WCGf2IlaIw==} - engines: {node: '>=4'} - dev: true - /resolve-from@4.0.0: resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==} engines: {node: '>=4'} @@ -9038,13 +5836,6 @@ packages: path-parse: 1.0.7 dev: true - /resolve@1.20.0: - resolution: {integrity: sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==} - dependencies: - is-core-module: 2.13.1 - path-parse: 1.0.7 - dev: true - /resolve@1.22.8: resolution: {integrity: sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==} hasBin: true @@ -9052,12 +5843,7 @@ packages: is-core-module: 2.13.1 path-parse: 1.0.7 supports-preserve-symlinks-flag: 1.0.0 - - /responselike@1.0.2: - resolution: {integrity: sha512-/Fpe5guzJk1gPqdJLJR5u7eG/gNY4nImjbRDaVWVMRhne55TCmj2i9Q+54PBRfatRC8v/rIiv9BN0pMd9OV5EQ==} - dependencies: - lowercase-keys: 1.0.1 - dev: false + dev: true /restore-cursor@2.0.0: resolution: {integrity: sha512-6IzJLuGi4+R14vwagDHX+JrXmPVtPpn4mffDJ1UdR7/Edm87fl6yi8mMBIVvFtJaNTUvjughmW4hwLhRG7gC1Q==} @@ -9065,6 +5851,7 @@ packages: dependencies: onetime: 2.0.1 signal-exit: 3.0.7 + dev: true /restore-cursor@3.1.0: resolution: {integrity: sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==} @@ -9077,19 +5864,6 @@ packages: /reusify@1.0.4: resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} engines: {iojs: '>=1.0.0', node: '>=0.10.0'} - - /rimraf@2.6.3: - resolution: {integrity: sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==} - hasBin: true - dependencies: - glob: 7.2.3 - dev: true - - /rimraf@2.7.1: - resolution: {integrity: sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==} - hasBin: true - dependencies: - glob: 7.2.3 dev: true /rimraf@3.0.2: @@ -9097,6 +5871,7 @@ packages: hasBin: true dependencies: glob: 7.2.3 + dev: true /ripemd160@2.0.2: resolution: {integrity: sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==} @@ -9115,54 +5890,6 @@ packages: - utf-8-validate dev: true - /rollup-plugin-string@3.0.0: - resolution: {integrity: sha512-vqyzgn9QefAgeKi+Y4A7jETeIAU1zQmS6VotH6bzm/zmUQEnYkpIGRaOBPY41oiWYV4JyBoGAaBjYMYuv+6wVw==} - dependencies: - rollup-pluginutils: 2.8.2 - dev: true - - /rollup-plugin-terser@7.0.2(rollup@2.79.1): - resolution: {integrity: sha512-w3iIaU4OxcF52UUXiZNsNeuXIMDvFrr+ZXK6bFZ0Q60qyVfq4uLptoS4bbq3paG3x216eQllFZX7zt6TIImguQ==} - deprecated: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-terser - peerDependencies: - rollup: ^2.0.0 - dependencies: - '@babel/code-frame': 7.23.5 - jest-worker: 26.6.2 - rollup: 2.79.1 - serialize-javascript: 4.0.0 - terser: 5.29.1 - dev: true - - /rollup-plugin-typescript2@0.30.0(rollup@2.79.1)(typescript@4.9.5): - resolution: {integrity: sha512-NUFszIQyhgDdhRS9ya/VEmsnpTe+GERDMmFo0Y+kf8ds51Xy57nPNGglJY+W6x1vcouA7Au7nsTgsLFj2I0PxQ==} - peerDependencies: - rollup: '>=1.26.3' - typescript: '>=2.4.0' - dependencies: - '@rollup/pluginutils': 4.2.1 - find-cache-dir: 3.3.2 - fs-extra: 8.1.0 - resolve: 1.20.0 - rollup: 2.79.1 - tslib: 2.1.0 - typescript: 4.9.5 - dev: true - - /rollup-pluginutils@2.8.2: - resolution: {integrity: sha512-EEp9NhnUkwY8aif6bxgovPHMoMoNr2FulJziTndpt5H9RdwC47GSGuII9XxpSdzVGM0GWrNPHV6ie1LTNJPaLQ==} - dependencies: - estree-walker: 0.6.1 - dev: true - - /rollup@2.79.1: - resolution: {integrity: sha512-uKxbd0IhMZOhjAiD5oAFp7BqvkA4Dv47qpOCtaNvng4HBwdbWtdOh8f5nZNuk2rp51PMGk3bzfWu5oayNEuYnw==} - engines: {node: '>=10.0.0'} - hasBin: true - optionalDependencies: - fsevents: 2.3.3 - dev: true - /rollup@3.29.4: resolution: {integrity: sha512-oWzmBZwvYrU0iJHtDmhsm662rC15FRXmcjCk1xD771dFDx5jJ02ufAQQTn0etB2emNk4J9EZg/yWKpsn9BWGRw==} engines: {node: '>=14.18.0', npm: '>=8.0.0'} @@ -9201,23 +5928,20 @@ packages: /run-async@2.4.1: resolution: {integrity: sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==} engines: {node: '>=0.12.0'} - - /run-node@1.0.0: - resolution: {integrity: sha512-kc120TBlQ3mih1LSzdAJXo4xn/GWS2ec0l3S+syHDXP9uRr0JAT8Qd3mdMuyjqCzeZktgP3try92cEgf9Nks8A==} - engines: {node: '>=4'} - hasBin: true dev: true /run-parallel@1.2.0: resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} dependencies: queue-microtask: 1.2.3 + dev: true /rxjs@6.6.7: resolution: {integrity: sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==} engines: {npm: '>=2.0.0'} dependencies: tslib: 1.14.1 + dev: true /rxjs@7.8.1: resolution: {integrity: sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==} @@ -9225,33 +5949,17 @@ packages: tslib: 2.6.2 dev: true - /safe-array-concat@1.1.2: - resolution: {integrity: sha512-vj6RsCsWBCf19jIeHEfkRMw8DPiBb+DMXklQ/1SGDHOMlHdPUkZXFQ2YdplS23zESTijAcurb1aSgJA3AgMu1Q==} - engines: {node: '>=0.4'} - dependencies: - call-bind: 1.0.7 - get-intrinsic: 1.2.4 - has-symbols: 1.0.3 - isarray: 2.0.5 - dev: true - /safe-buffer@5.1.2: resolution: {integrity: sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==} + dev: true /safe-buffer@5.2.1: resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} - - /safe-regex-test@1.0.3: - resolution: {integrity: sha512-CdASjNJPvRa7roO6Ra/gLYBTzYzzPyyBXxIMdGW3USQLyjWEls2RgW5UBTXaQVp+OrpeCK3bLem8smtmheoRuw==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.7 - es-errors: 1.3.0 - is-regex: 1.1.4 dev: true /safer-buffer@2.1.2: resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} + dev: true /sax@1.3.0: resolution: {integrity: sha512-0s+oAmw9zLl1V1cS9BtZN7JAd0cW5e0QH4W3LWEK6a4LaLEA2OTpGYWDY+6XasBLtz6wkm3u1xRw95mRuJ59WA==} @@ -9268,29 +5976,9 @@ packages: resolution: {integrity: sha512-6FtHJEvt+pVMIB9IBY+IcCJ6Z5f1iQnytgyfKMhDKgmzYG+TeH/wx1y3l27rshSbLiSanrR9ffZDrEsmjlQF2g==} dev: true - /seek-bzip@1.0.6: - resolution: {integrity: sha512-e1QtP3YL5tWww8uKaOCQ18UxIT2laNBXHjV/S2WYCiK4udiv8lkG89KRIoCjUagnAmCBurjF4zEVX2ByBbnCjQ==} - hasBin: true - dependencies: - commander: 2.20.3 - dev: false - - /semver-compare@1.0.0: - resolution: {integrity: sha512-YM3/ITh2MJ5MtzaM429anh+x2jiLVjqILF4m4oyQB18W7Ggea7BfqdH/wGMK7dDiMghv/6WG7znWMwUDzJiXow==} - dev: true - /semver@5.7.2: resolution: {integrity: sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==} hasBin: true - - /semver@6.0.0: - resolution: {integrity: sha512-0UewU+9rFapKFnlbirLi3byoOuhrSsli/z/ihNnvM24vgF+8sNBiI1LZPBSH9wJKUwaUbw+s3hToDLCXkrghrQ==} - hasBin: true - dev: true - - /semver@6.3.1: - resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} - hasBin: true dev: true /semver@7.5.4: @@ -9309,12 +5997,6 @@ packages: lru-cache: 6.0.0 dev: true - /serialize-javascript@4.0.0: - resolution: {integrity: sha512-GaNA54380uFefWghODBWEGisLZFj00nS5ACs6yHa9nLqlLpVLO8ChDGeKRjZnV4Nh4n0Qi7nhYZD/9fCPzEqkw==} - dependencies: - randombytes: 2.1.0 - dev: true - /set-function-length@1.2.2: resolution: {integrity: sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==} engines: {node: '>= 0.4'} @@ -9325,15 +6007,6 @@ packages: get-intrinsic: 1.2.4 gopd: 1.0.1 has-property-descriptors: 1.0.2 - - /set-function-name@2.0.2: - resolution: {integrity: sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==} - engines: {node: '>= 0.4'} - dependencies: - define-data-property: 1.1.4 - es-errors: 1.3.0 - functions-have-names: 1.2.3 - has-property-descriptors: 1.0.2 dev: true /setimmediate@1.0.5: @@ -9348,12 +6021,6 @@ packages: safe-buffer: 5.2.1 dev: true - /shebang-command@1.2.0: - resolution: {integrity: sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==} - engines: {node: '>=0.10.0'} - dependencies: - shebang-regex: 1.0.0 - /shebang-command@2.0.0: resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} engines: {node: '>=8'} @@ -9361,10 +6028,6 @@ packages: shebang-regex: 3.0.0 dev: true - /shebang-regex@1.0.0: - resolution: {integrity: sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==} - engines: {node: '>=0.10.0'} - /shebang-regex@3.0.0: resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} engines: {node: '>=8'} @@ -9382,6 +6045,7 @@ packages: es-errors: 1.3.0 get-intrinsic: 1.2.4 object-inspect: 1.13.1 + dev: true /siginfo@2.0.0: resolution: {integrity: sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==} @@ -9389,6 +6053,7 @@ packages: /signal-exit@3.0.7: resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} + dev: true /signal-exit@4.1.0: resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} @@ -9399,45 +6064,11 @@ packages: resolution: {integrity: sha512-txDJp+uSmnAoCz4aDw6a3lCz2h4eRhyx5wgInCmSglQx7aoOpMK57nU31N3FY1NVREQcNV0OG6fJZ0iJJOkrag==} dev: true - /slash@2.0.0: - resolution: {integrity: sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==} - engines: {node: '>=6'} - dev: true - /slash@3.0.0: resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} engines: {node: '>=8'} - - /slice-ansi@4.0.0: - resolution: {integrity: sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==} - engines: {node: '>=10'} - dependencies: - ansi-styles: 4.3.0 - astral-regex: 2.0.0 - is-fullwidth-code-point: 3.0.0 dev: true - /sort-keys-length@1.0.1: - resolution: {integrity: sha512-GRbEOUqCxemTAk/b32F2xa8wDTs+Z1QHOkbhJDQTvv/6G3ZkbJ+frYWsTcc7cBB3Fu4wy4XlLCuNtJuMn7Gsvw==} - engines: {node: '>=0.10.0'} - dependencies: - sort-keys: 1.1.2 - dev: false - - /sort-keys@1.1.2: - resolution: {integrity: sha512-vzn8aSqKgytVik0iwdBEi+zevbTYZogewTUM6dtpmGwEcdzbub/TX4bCzRhebDCRC3QzXgJsLRKB2V/Oof7HXg==} - engines: {node: '>=0.10.0'} - dependencies: - is-plain-obj: 1.1.0 - dev: false - - /sort-keys@2.0.0: - resolution: {integrity: sha512-/dPCrG1s3ePpWm6yBbxZq5Be1dXGLyLn9Z791chDC3NFrpkVbWGzkBwPN1knaciexFXgRJ7hzdnwZ4stHSDmjg==} - engines: {node: '>=4'} - dependencies: - is-plain-obj: 1.1.0 - dev: false - /source-map-js@1.0.2: resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==} engines: {node: '>=0.10.0'} @@ -9459,19 +6090,6 @@ packages: engines: {node: '>= 8'} dev: true - /sourcemap-codec@1.4.8: - resolution: {integrity: sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==} - deprecated: Please use @jridgewell/sourcemap-codec instead - dev: true - - /spawn-sync@1.0.15: - resolution: {integrity: sha512-9DWBgrgYZzNghseho0JOuh+5fg9u6QWhAWa51QC7+U5rCheZ/j1DrEZnyE0RBBRqZ9uEXGPgSSM0nky6burpVw==} - requiresBuild: true - dependencies: - concat-stream: 1.6.2 - os-shim: 0.1.3 - dev: true - /spdx-correct@3.2.0: resolution: {integrity: sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==} dependencies: @@ -9494,24 +6112,12 @@ packages: resolution: {integrity: sha512-sh8PWc/ftMqAAdFiBu6Fy6JUOYjqDJBJvIhpfDMyHrr0Rbp5liZqd4TjtQ/RgfLjKFZb+LMx5hpml5qOWy0qvg==} dev: true - /split2@2.2.0: - resolution: {integrity: sha512-RAb22TG39LhI31MbreBgIuKiIKhVsawfTgEGqKHTK87aG+ul/PB8Sqoi3I7kVdRWiCfrKxK3uo4/YUkpNvhPbw==} - dependencies: - through2: 2.0.5 - dev: true - /split2@3.2.2: resolution: {integrity: sha512-9NThjpgZnifTkJpzTZ7Eue85S49QwpNhZTq6GRJwObb6jnLFNGB7Qm73V5HewTROPyxD0C29xqmaI68bQtV+hg==} dependencies: readable-stream: 3.6.2 dev: true - /split@1.0.1: - resolution: {integrity: sha512-mTyOoPbrivtXnwnIxZRFYRrPNtEFKlpB2fvjSnCQUiAA6qAZzqwna5envK4uk6OIeP17CsdF3rSBGYVBsU0Tkg==} - dependencies: - through: 2.3.8 - dev: true - /sprintf-js@1.0.3: resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} dev: true @@ -9520,11 +6126,6 @@ packages: resolution: {integrity: sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==} dev: true - /statuses@1.5.0: - resolution: {integrity: sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==} - engines: {node: '>= 0.6'} - dev: false - /std-env@3.7.0: resolution: {integrity: sha512-JPbdCEQLj1w5GilpiHAx3qJvFndqybBysA3qUOnznweH4QbNYUsW/ea8QzSrnh0vNsezMMw5bcVool8lM0gwzg==} dev: true @@ -9545,11 +6146,6 @@ packages: xtend: 4.0.2 dev: true - /strict-uri-encode@1.1.0: - resolution: {integrity: sha512-R3f198pcvnB+5IpnBlRkphuE9n46WyVl8I39W/ZUTZLz4nqSP/oLYUrcnJrw462Ds8he4YKMov2efsTIw1BDGQ==} - engines: {node: '>=0.10.0'} - dev: false - /string-argv@0.3.2: resolution: {integrity: sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q==} engines: {node: '>=0.6.19'} @@ -9561,6 +6157,7 @@ packages: dependencies: is-fullwidth-code-point: 2.0.0 strip-ansi: 4.0.0 + dev: true /string-width@4.2.3: resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} @@ -9570,84 +6167,43 @@ packages: is-fullwidth-code-point: 3.0.0 strip-ansi: 6.0.1 - /string.prototype.trim@1.2.8: - resolution: {integrity: sha512-lfjY4HcixfQXOfaqCvcBuOIapyaroTXhbkfJN3gcB1OtyupngWK4sEET9Knd0cXd28kTUqu/kHoV4HKSJdnjiQ==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.7 - define-properties: 1.2.1 - es-abstract: 1.22.5 - dev: true - - /string.prototype.trimend@1.0.7: - resolution: {integrity: sha512-Ni79DqeB72ZFq1uH/L6zJ+DKZTkOtPIHovb3YZHQViE+HDouuU4mBrLOLDn5Dde3RF8qw5qVETEjhu9locMLvA==} - dependencies: - call-bind: 1.0.7 - define-properties: 1.2.1 - es-abstract: 1.22.5 - dev: true - - /string.prototype.trimstart@1.0.7: - resolution: {integrity: sha512-NGhtDFu3jCEm7B4Fy0DpLewdJQOZcQ0rGbwQ/+stjnrp2i+rlKeCvos9hOIeCmqwratM47OBxY7uFZzjxHXmrg==} - dependencies: - call-bind: 1.0.7 - define-properties: 1.2.1 - es-abstract: 1.22.5 - dev: true - - /string_decoder@0.10.31: - resolution: {integrity: sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ==} - dev: true - /string_decoder@1.1.1: resolution: {integrity: sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==} dependencies: safe-buffer: 5.1.2 + dev: true /string_decoder@1.3.0: resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==} dependencies: safe-buffer: 5.2.1 + dev: true /strip-ansi@4.0.0: resolution: {integrity: sha512-4XaJ2zQdCzROZDivEVIDPkcQn8LMFSa8kj8Gxb/Lnwzv9A8VctNZ+lfivC/sV3ivW8ElJTERXZoPBRrZKkNKow==} engines: {node: '>=4'} dependencies: ansi-regex: 3.0.1 + dev: true /strip-ansi@5.2.0: resolution: {integrity: sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==} engines: {node: '>=6'} dependencies: ansi-regex: 4.1.1 + dev: true /strip-ansi@6.0.1: resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} engines: {node: '>=8'} - dependencies: - ansi-regex: 5.0.1 - - /strip-bom@3.0.0: - resolution: {integrity: sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==} - engines: {node: '>=4'} - dev: true + dependencies: + ansi-regex: 5.0.1 /strip-bom@4.0.0: resolution: {integrity: sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==} engines: {node: '>=8'} dev: true - /strip-dirs@2.1.0: - resolution: {integrity: sha512-JOCxOeKLm2CAS73y/U4ZeZPTkE+gNVCzKt7Eox84Iej1LT/2pTWYpZKJuxwQpvX1LiZb1xokNR7RLfuBAa7T3g==} - dependencies: - is-natural-number: 4.0.1 - dev: false - - /strip-eof@1.0.0: - resolution: {integrity: sha512-7FCwGGmx8mD5xQd3RPUvnSpUXHM3BWuzjtpD4TXsfcZ9EL4azvVVUscFYwD9nx8Kh+uCBC00XBtAykoMHwTh8Q==} - engines: {node: '>=0.10.0'} - dev: true - /strip-final-newline@2.0.0: resolution: {integrity: sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==} engines: {node: '>=6'} @@ -9658,11 +6214,6 @@ packages: engines: {node: '>=12'} dev: true - /strip-indent@2.0.0: - resolution: {integrity: sha512-RsSNPLpq6YUL7QYy44RnPVTn/lcVZtb48Uof3X5JLbF4zD/Gs7ZFDv2HWol+leoQN2mT86LAzSshGfkTlSOpsA==} - engines: {node: '>=4'} - dev: true - /strip-indent@3.0.0: resolution: {integrity: sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==} engines: {node: '>=8'} @@ -9687,13 +6238,6 @@ packages: js-tokens: 8.0.3 dev: true - /strip-outer@1.0.1: - resolution: {integrity: sha512-k55yxKHwaXnpYGsOzg4Vl8+tDrWylxDEpknGjhTiZB8dFRU5rTo9CAzeycivxV3s+zlTKwrs6WxMxR95n26kwg==} - engines: {node: '>=0.10.0'} - dependencies: - escape-string-regexp: 1.0.5 - dev: false - /stylus@0.63.0: resolution: {integrity: sha512-OMlgrTCPzE/ibtRMoeLVhOY0RcNuNWh0rhAVqeKnk/QwcuUKQbnqhZ1kg2vzD8VU/6h3FoPTq4RJPHgLBvX6Bw==} hasBin: true @@ -9712,12 +6256,14 @@ packages: engines: {node: '>=4'} dependencies: has-flag: 3.0.0 + dev: true /supports-color@7.2.0: resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} engines: {node: '>=8'} dependencies: has-flag: 4.0.0 + dev: true /supports-color@8.1.1: resolution: {integrity: sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==} @@ -9729,6 +6275,7 @@ packages: /supports-preserve-symlinks-flag@1.0.0: resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} engines: {node: '>= 0.4'} + dev: true /svelte-eslint-parser@0.33.1(svelte@4.2.12): resolution: {integrity: sha512-vo7xPGTlKBGdLH8T5L64FipvTrqv3OQRx9d2z5X05KKZDlF4rQk8KViZO4flKERY+5BiVdOh7zZ7JGJWo5P0uA==} @@ -9788,38 +6335,6 @@ packages: tslib: 2.6.2 dev: true - /table@6.8.1: - resolution: {integrity: sha512-Y4X9zqrCftUhMeH2EptSSERdVKt/nEdijTOacGD/97EKjhQ/Qs8RTlEGABSJNNN8lac9kheH+af7yAkEWlgneA==} - engines: {node: '>=10.0.0'} - dependencies: - ajv: 8.12.0 - lodash.truncate: 4.4.2 - slice-ansi: 4.0.0 - string-width: 4.2.3 - strip-ansi: 6.0.1 - dev: true - - /tar-stream@1.6.2: - resolution: {integrity: sha512-rzS0heiNf8Xn7/mpdSVVSMAWAoy9bfb1WOTYC78Z0UQKeKa/CWS8FOq0lKGNa8DWKAn9gxjCvMLYc5PGXYlK2A==} - engines: {node: '>= 0.8.0'} - dependencies: - bl: 1.2.3 - buffer-alloc: 1.2.0 - end-of-stream: 1.4.4 - fs-constants: 1.0.0 - readable-stream: 2.3.8 - to-buffer: 1.1.1 - xtend: 4.0.2 - dev: false - - /temp@0.9.4: - resolution: {integrity: sha512-yYrrsWnrXMcdsnu/7YMYAofM1ktpL5By7vZhf15CrXijWWrEYZks5AXBudalfSWJLlnen/QUJUB5aoB0kqZUGA==} - engines: {node: '>=6.0.0'} - dependencies: - mkdirp: 0.5.6 - rimraf: 2.6.3 - dev: true - /terser@5.29.1: resolution: {integrity: sha512-lZQ/fyaIGxsbGxApKmoPTODIzELy3++mXhS5hOqaAWZjQtpq/hFHAc+rm29NND1rYRxRWKcjuARNwULNXa5RtQ==} engines: {node: '>=10'} @@ -9840,26 +6355,6 @@ packages: resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==} dev: true - /thenify-all@1.6.0: - resolution: {integrity: sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==} - engines: {node: '>=0.8'} - dependencies: - thenify: 3.3.1 - dev: false - - /thenify@3.3.1: - resolution: {integrity: sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==} - dependencies: - any-promise: 1.3.0 - dev: false - - /through2@2.0.5: - resolution: {integrity: sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==} - dependencies: - readable-stream: 2.3.8 - xtend: 4.0.2 - dev: true - /through2@4.0.2: resolution: {integrity: sha512-iOqSav00cVxEEICeD7TjLB1sueEL+81Wpzp2bY17uZjZN0pWZPuo4suZ/61VujxmqSGFfgOcNuTZ85QJwNZQpw==} dependencies: @@ -9868,17 +6363,13 @@ packages: /through@2.3.8: resolution: {integrity: sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==} + dev: true /time-zone@1.0.0: resolution: {integrity: sha512-TIsDdtKo6+XrPtiTm1ssmMngN1sAhyKnTO2kunQWqNPWIVvCm15Wmw4SWInwTVgJ5u/Tr04+8Ei9TNcw4x4ONA==} engines: {node: '>=4'} dev: true - /timed-out@4.0.1: - resolution: {integrity: sha512-G7r3AhovYtr5YKOWQkta8RKAPb+J9IsO4uVmzjl8AZwfhs8UcUwTiD6gcJYSgOtzyjvQKrKYn41syHbUWMkafA==} - engines: {node: '>=0.10.0'} - dev: false - /timers-browserify@2.0.12: resolution: {integrity: sha512-9phl76Cqm6FhSX9Xe1ZUAMLtm1BLkKj2Qd5ApyWkXzsMRaA7dgr81kf4wJmQf/hAvg8EEyJxDo3du/0KlhPiKQ==} engines: {node: '>=0.6.0'} @@ -9910,10 +6401,7 @@ packages: engines: {node: '>=0.6.0'} dependencies: os-tmpdir: 1.0.2 - - /to-buffer@1.1.1: - resolution: {integrity: sha512-lx9B5iv7msuFYE3dytT+KE5tap+rNYw+K4jVkb9R/asAb+pbBSM17jtunHplhBe6RRJdZx3Pn2Jph24O32mOVg==} - dev: false + dev: true /to-fast-properties@2.0.0: resolution: {integrity: sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==} @@ -9924,6 +6412,7 @@ packages: engines: {node: '>=8.0'} dependencies: is-number: 7.0.0 + dev: true /tough-cookie@4.1.3: resolution: {integrity: sha512-aX/y5pVRkfRnfmuX+OdbSdXvPe6ieKX/G2s7e98f4poJHnqH3281gDPm/metm6E/WRamfx7WC4HUqkWHfQHprw==} @@ -9957,28 +6446,11 @@ packages: yargs: 17.7.2 dev: false - /trim-newlines@2.0.0: - resolution: {integrity: sha512-MTBWv3jhVjTU7XR3IQHllbiJs8sc75a80OEhB6or/q7pLTWgQ0bMGQXXYQSrSuXe6WiKWDZ5txXY5P59a/coVA==} - engines: {node: '>=4'} - dev: true - /trim-newlines@3.0.1: resolution: {integrity: sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw==} engines: {node: '>=8'} dev: true - /trim-off-newlines@1.0.3: - resolution: {integrity: sha512-kh6Tu6GbeSNMGfrrZh6Bb/4ZEHV1QlB4xNDBeog8Y9/QwFlKTRyWvY3Fs9tRDAMZliVUwieMgEdIeL/FtqjkJg==} - engines: {node: '>=0.10.0'} - dev: true - - /trim-repeated@1.0.0: - resolution: {integrity: sha512-pkonvlKk8/ZuR0D5tLW8ljt5I8kmxp2XKymhepUeOdCEfKpZaktSArkLHZt76OB1ZvO9bssUsDty4SWhLvZpLg==} - engines: {node: '>=0.10.0'} - dependencies: - escape-string-regexp: 1.0.5 - dev: false - /ts-morph@18.0.0: resolution: {integrity: sha512-Kg5u0mk19PIIe4islUI/HWRvm9bC1lHejK4S0oh1zaZ77TMZAEmQC0sHQYiu2RgCQFZKXz1fMVi/7nOOeirznA==} dependencies: @@ -10030,24 +6502,13 @@ packages: typescript: 5.4.2 dev: true - /tsconfig-paths@3.15.0: - resolution: {integrity: sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==} - dependencies: - '@types/json5': 0.0.29 - json5: 1.0.2 - minimist: 1.2.8 - strip-bom: 3.0.0 - dev: true - /tslib@1.14.1: resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==} - - /tslib@2.1.0: - resolution: {integrity: sha512-hcVC3wYEziELGGmEEXue7D75zbwIIVUMWAVbHItGPx0ziyXxrOMQx4rQEVEV45Ut/1IotuEvwqPopzIOkDMf0A==} dev: true /tslib@2.6.2: resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} + dev: true /tsutils@3.21.0(typescript@4.9.5): resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} @@ -10073,17 +6534,6 @@ packages: resolution: {integrity: sha512-C3TaO7K81YvjCgQH9Q1S3R3P3BtN3RIM8n+OvX4il1K1zgE8ZhI0op7kClgkxtutIE8hQrcrHBXvIheqKUUCxw==} dev: true - /tunnel-agent@0.6.0: - resolution: {integrity: sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==} - dependencies: - safe-buffer: 5.2.1 - dev: false - - /tunnel@0.0.6: - resolution: {integrity: sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==} - engines: {node: '>=0.6.11 <=0.7.0 || >=0.7.3'} - dev: false - /turbo-darwin-64@1.12.5: resolution: {integrity: sha512-0GZ8reftwNQgIQLHkHjHEXTc/Z1NJm+YjsrBP+qhM/7yIZ3TEy9gJhuogDt2U0xIWwFgisTyzbtU7xNaQydtoA==} cpu: [x64] @@ -10181,54 +6631,6 @@ packages: engines: {node: '>=8'} dev: true - /typed-array-buffer@1.0.2: - resolution: {integrity: sha512-gEymJYKZtKXzzBzM4jqa9w6Q1Jjm7x2d+sh19AdsD4wqnMPDYyvwpsIc2Q/835kHuo3BEQ7CjelGhfTsoBb2MQ==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.7 - es-errors: 1.3.0 - is-typed-array: 1.1.13 - dev: true - - /typed-array-byte-length@1.0.1: - resolution: {integrity: sha512-3iMJ9q0ao7WE9tWcaYKIptkNBuOIcZCCT0d4MRvuuH88fEoEH62IuQe0OtraD3ebQEoTRk8XCBoknUNc1Y67pw==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.7 - for-each: 0.3.3 - gopd: 1.0.1 - has-proto: 1.0.3 - is-typed-array: 1.1.13 - dev: true - - /typed-array-byte-offset@1.0.2: - resolution: {integrity: sha512-Ous0vodHa56FviZucS2E63zkgtgrACj7omjwd/8lTEMEPFFyjfixMZ1ZXenpgCFBBt4EC1J2XsyVS2gkG0eTFA==} - engines: {node: '>= 0.4'} - dependencies: - available-typed-arrays: 1.0.7 - call-bind: 1.0.7 - for-each: 0.3.3 - gopd: 1.0.1 - has-proto: 1.0.3 - is-typed-array: 1.1.13 - dev: true - - /typed-array-length@1.0.5: - resolution: {integrity: sha512-yMi0PlwuznKHxKmcpoOdeLwxBoVPkqZxd7q2FgMkmD3bNwvF5VW0+UlUQ1k1vmktTu4Yu13Q0RIxEP8+B+wloA==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.7 - for-each: 0.3.3 - gopd: 1.0.1 - has-proto: 1.0.3 - is-typed-array: 1.1.13 - possible-typed-array-names: 1.0.0 - dev: true - - /typedarray@0.0.6: - resolution: {integrity: sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==} - dev: true - /typescript@4.9.5: resolution: {integrity: sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==} engines: {node: '>=4.2.0'} @@ -10250,37 +6652,6 @@ packages: resolution: {integrity: sha512-Hhy+BhRBleFjpJ2vchUNN40qgkh0366FWJGqVLYBHev0vpHTrXSA0ryT+74UiW6KWsldNurQMKGqCm1M2zBciQ==} dev: true - /uglify-js@3.17.4: - resolution: {integrity: sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g==} - engines: {node: '>=0.8.0'} - hasBin: true - requiresBuild: true - dev: true - optional: true - - /unbox-primitive@1.0.2: - resolution: {integrity: sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==} - dependencies: - call-bind: 1.0.7 - has-bigints: 1.0.2 - has-symbols: 1.0.3 - which-boxed-primitive: 1.0.2 - dev: true - - /unbzip2-stream@1.4.3: - resolution: {integrity: sha512-mlExGW4w71ebDJviH16lQLtZS32VKqsSfk80GCfUlwT/4/hNRFsoscrF/c++9xinkMzECL1uL9DDwXqFWkruPg==} - dependencies: - buffer: 5.7.1 - through: 2.3.8 - dev: false - - /unescape@1.0.1: - resolution: {integrity: sha512-O0+af1Gs50lyH1nUu3ZyYS1cRh01Q/kUKatTOkSs7jukXE6/NebucDVxyiDsA9AQ4JC1V1jUH9EO8JX2nMDgGQ==} - engines: {node: '>=0.10.0'} - dependencies: - extend-shallow: 2.0.1 - dev: false - /unimport@3.7.1: resolution: {integrity: sha512-V9HpXYfsZye5bPPYUgs0Otn3ODS1mDUciaBlXljI4C2fTwfFpvFZRywmlOu943puN9sncxROMZhsZCjNXEpzEQ==} dependencies: @@ -10304,6 +6675,7 @@ packages: /universalify@0.1.2: resolution: {integrity: sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==} engines: {node: '>= 4.0.0'} + dev: true /universalify@0.2.0: resolution: {integrity: sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==} @@ -10379,24 +6751,12 @@ packages: webpack-virtual-modules: 0.6.1 dev: true - /untildify@4.0.0: - resolution: {integrity: sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw==} - engines: {node: '>=8'} - dev: true - /uri-js@4.4.1: resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} dependencies: punycode: 2.3.1 dev: true - /url-parse-lax@3.0.0: - resolution: {integrity: sha512-NjFKA0DidqPa5ciFcSrXnAltTtzz84ogy+NebPvfEgAck0+TNg4UJ4IN+fB7zRZfbgUf0syOo9MDxFkDSMuFaQ==} - engines: {node: '>=4'} - dependencies: - prepend-http: 2.0.0 - dev: false - /url-parse@1.5.10: resolution: {integrity: sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==} dependencies: @@ -10404,11 +6764,6 @@ packages: requires-port: 1.0.0 dev: true - /url-to-options@1.0.1: - resolution: {integrity: sha512-0kQLIzG4fdk/G5NONku64rSH/x32NOA39LVQqlK8Le6lvTF6GGRJpqaQFGgU+CLwySIqBSMdwYM0sYcW9f6P4A==} - engines: {node: '>= 4'} - dev: false - /url@0.11.3: resolution: {integrity: sha512-6hxOLGfZASQK/cijlZnZJTq8OXAkt/3YGfQX45vvMYXpZoo8NdWZcY73K108Jf759lS1Bv/8wXnHDTSz17dSRw==} dependencies: @@ -10416,42 +6771,9 @@ packages: qs: 6.12.0 dev: true - /urllib@2.41.0: - resolution: {integrity: sha512-pNXdxEv52L67jahLT+/7QE+Fup1y2Gc6EdmrAhQ6OpQIC2rl14oWwv9hvk1GXOZqEnJNwRXHABuwgPOs1CtL7g==} - engines: {node: '>= 0.10.0'} - peerDependencies: - proxy-agent: ^5.0.0 - peerDependenciesMeta: - proxy-agent: - optional: true - dependencies: - any-promise: 1.3.0 - content-type: 1.0.5 - debug: 2.6.9 - default-user-agent: 1.0.0 - digest-header: 1.1.0 - ee-first: 1.1.1 - formstream: 1.3.1 - humanize-ms: 1.2.1 - iconv-lite: 0.4.24 - ip: 1.1.9 - pump: 3.0.0 - qs: 6.12.0 - statuses: 1.5.0 - utility: 1.18.0 - transitivePeerDependencies: - - supports-color - dev: false - - /user-home@2.0.0: - resolution: {integrity: sha512-KMWqdlOcjCYdtIJpicDSFBQ8nFwS2i9sslAd6f4+CBGcU4gist2REnr2fxj2YocvJFxSF3ZOHLYLVZnUxv4BZQ==} - engines: {node: '>=0.10.0'} - dependencies: - os-homedir: 1.0.2 - dev: true - /util-deprecate@1.0.2: resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} + dev: true /util@0.12.5: resolution: {integrity: sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA==} @@ -10463,25 +6785,10 @@ packages: which-typed-array: 1.1.15 dev: true - /utility@1.18.0: - resolution: {integrity: sha512-PYxZDA+6QtvRvm//++aGdmKG/cI07jNwbROz0Ql+VzFV1+Z0Dy55NI4zZ7RHc9KKpBePNFwoErqIuqQv/cjiTA==} - engines: {node: '>= 0.12.0'} - dependencies: - copy-to: 2.0.1 - escape-html: 1.0.3 - mkdirp: 0.5.6 - mz: 2.7.0 - unescape: 1.0.1 - dev: false - /v8-compile-cache-lib@3.0.1: resolution: {integrity: sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==} dev: true - /v8-compile-cache@2.4.0: - resolution: {integrity: sha512-ocyWc3bAHBB/guyqJQVI5o4BZkPhznPYUG2ea80Gond/BgNWpap8TOmLSeeQG7bnh2KMISxskdADG59j7zruhw==} - dev: true - /validate-npm-package-license@3.0.4: resolution: {integrity: sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==} dependencies: @@ -10494,7 +6801,7 @@ packages: engines: {node: '>= 0.10'} dev: true - /vite-node@0.31.4(@types/node@16.11.7): + /vite-node@0.31.4(@types/node@20.5.1): resolution: {integrity: sha512-uzL377GjJtTbuc5KQxVbDu2xfU/x0wVjUtXQR2ihS21q/NK6ROr4oG0rsSkBBddZUVCwzfx22in76/0ZZHXgkQ==} engines: {node: '>=v14.18.0'} hasBin: true @@ -10504,7 +6811,7 @@ packages: mlly: 1.6.1 pathe: 1.1.2 picocolors: 1.0.0 - vite: 4.5.2(@types/node@16.11.7) + vite: 4.5.2(@types/node@20.5.1) transitivePeerDependencies: - '@types/node' - less @@ -10628,6 +6935,18 @@ packages: - rollup dev: true + /vite-plugin-node-polyfills@0.8.2(vite@4.5.2): + resolution: {integrity: sha512-amOUVWwNvcuKxfWM9vpS8sAqvew28KXyR597OHO7BXWJFxr+QX4qB3XTDhWoRivj89TIZe4JTJTZwBHtIJ3ygQ==} + peerDependencies: + vite: ^2.0.0 || ^3.0.0 || ^4.0.0 + dependencies: + '@rollup/plugin-inject': 5.0.5 + node-stdlib-browser: 1.2.0 + vite: 4.5.2(@types/node@20.5.1) + transitivePeerDependencies: + - rollup + dev: true + /vite-plugin-static-copy@0.15.0(vite@4.5.2): resolution: {integrity: sha512-Ww+/Ug9guV45oIfIi/lA2z8v3K+lLHV9zCJqTVO4FTdqrJoZBj68VgGBSH1fi0N4q/EHW32RsL3ympi4Wlsq5w==} engines: {node: ^14.18.0 || >=16.0.0} @@ -10688,42 +7007,6 @@ packages: - typescript dev: true - /vite@4.5.2(@types/node@16.11.7): - resolution: {integrity: sha512-tBCZBNSBbHQkaGyhGCDUGqeo2ph8Fstyp6FMSvTtsXeZSPpSMGlviAOav2hxVTqFcx8Hj/twtWKsMJXNY0xI8w==} - engines: {node: ^14.18.0 || >=16.0.0} - hasBin: true - peerDependencies: - '@types/node': '>= 14' - less: '*' - lightningcss: ^1.21.0 - sass: '*' - stylus: '*' - sugarss: '*' - terser: ^5.4.0 - peerDependenciesMeta: - '@types/node': - optional: true - less: - optional: true - lightningcss: - optional: true - sass: - optional: true - stylus: - optional: true - sugarss: - optional: true - terser: - optional: true - dependencies: - '@types/node': 16.11.7 - esbuild: 0.18.20 - postcss: 8.4.35 - rollup: 3.29.4 - optionalDependencies: - fsevents: 2.3.3 - dev: true - /vite@4.5.2(@types/node@20.5.1): resolution: {integrity: sha512-tBCZBNSBbHQkaGyhGCDUGqeo2ph8Fstyp6FMSvTtsXeZSPpSMGlviAOav2hxVTqFcx8Hj/twtWKsMJXNY0xI8w==} engines: {node: ^14.18.0 || >=16.0.0} @@ -10841,7 +7124,7 @@ packages: dependencies: '@types/chai': 4.3.12 '@types/chai-subset': 1.3.5 - '@types/node': 16.11.7 + '@types/node': 20.5.1 '@vitest/expect': 0.31.4 '@vitest/runner': 0.31.4 '@vitest/snapshot': 0.31.4 @@ -10862,8 +7145,8 @@ packages: strip-literal: 1.3.0 tinybench: 2.6.0 tinypool: 0.5.0 - vite: 4.5.2(@types/node@16.11.7) - vite-node: 0.31.4(@types/node@16.11.7) + vite: 4.5.2(@types/node@20.5.1) + vite-node: 0.31.4(@types/node@20.5.1) why-is-node-running: 2.2.2 transitivePeerDependencies: - less @@ -11114,16 +7397,6 @@ packages: webidl-conversions: 7.0.0 dev: true - /which-boxed-primitive@1.0.2: - resolution: {integrity: sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==} - dependencies: - is-bigint: 1.0.4 - is-boolean-object: 1.1.2 - is-number-object: 1.0.7 - is-string: 1.0.7 - is-symbol: 1.0.4 - dev: true - /which-typed-array@1.1.15: resolution: {integrity: sha512-oV0jmFtUky6CXfkqehVvBP/LSWJ2sy4vWMioiENyJLePrBO/yKyV9OyJySfAKosh+RYkIl5zJCNZ8/4JncrpdA==} engines: {node: '>= 0.4'} @@ -11135,18 +7408,12 @@ packages: has-tostringtag: 1.0.2 dev: true - /which@1.2.14: - resolution: {integrity: sha512-16uPglFkRPzgiUXYMi1Jf8Z5EzN1iB4V0ZtMXcHZnwsBtQhhHeCqoWw7tsUY42hJGNDWtUsVLTjakIa5BgAxCw==} - hasBin: true - dependencies: - isexe: 2.0.0 - dev: true - /which@1.3.1: resolution: {integrity: sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==} hasBin: true dependencies: isexe: 2.0.0 + dev: true /which@2.0.2: resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} @@ -11165,22 +7432,11 @@ packages: stackback: 0.0.2 dev: true - /win-release@1.1.1: - resolution: {integrity: sha512-iCRnKVvGxOQdsKhcQId2PXV1vV3J/sDPXKA4Oe9+Eti2nb2ESEsYHRYls/UjoUW3bIc5ZDO8dTH50A/5iVN+bw==} - engines: {node: '>=0.10.0'} - dependencies: - semver: 5.7.2 - dev: false - /word-wrap@1.2.5: resolution: {integrity: sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==} engines: {node: '>=0.10.0'} dev: true - /wordwrap@1.0.0: - resolution: {integrity: sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==} - dev: true - /wrap-ansi@6.2.0: resolution: {integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==} engines: {node: '>=8'} @@ -11200,14 +7456,7 @@ packages: /wrappy@1.0.2: resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} - - /write-file-atomic@4.0.2: - resolution: {integrity: sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==} - engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} - dependencies: - imurmurhash: 0.1.4 - signal-exit: 3.0.7 - dev: false + dev: true /ws@7.5.9: resolution: {integrity: sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q==} @@ -11252,15 +7501,12 @@ packages: /xtend@4.0.2: resolution: {integrity: sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==} engines: {node: '>=0.4'} + dev: true /y18n@5.0.8: resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} engines: {node: '>=10'} - /yallist@2.1.2: - resolution: {integrity: sha512-ncTzHV7NvsQZkYe1DW7cbDLm0YpzHmZF5r/iyP3ZnQtMiJ+pjzisCiMNI+Sj+xQF5pXhSHxSB3uDbsBTzY/c2A==} - dev: true - /yallist@4.0.0: resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} dev: true @@ -11270,12 +7516,6 @@ packages: engines: {node: '>= 6'} dev: true - /yargs-parser@10.1.0: - resolution: {integrity: sha512-VCIyR1wJoEBZUqk5PA+oOBF6ypbwh5aNB3I50guxAL/quggdfs4TtNHQrSazFA3fYZ+tEqfs0zIGlv0c/rgjbQ==} - dependencies: - camelcase: 4.1.0 - dev: true - /yargs-parser@20.2.9: resolution: {integrity: sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==} engines: {node: '>=10'} @@ -11285,19 +7525,6 @@ packages: resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} engines: {node: '>=12'} - /yargs@16.2.0: - resolution: {integrity: sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==} - engines: {node: '>=10'} - dependencies: - cliui: 7.0.4 - escalade: 3.1.2 - get-caller-file: 2.0.5 - require-directory: 2.1.1 - string-width: 4.2.3 - y18n: 5.0.8 - yargs-parser: 20.2.9 - dev: true - /yargs@17.7.2: resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==} engines: {node: '>=12'} @@ -11310,13 +7537,6 @@ packages: y18n: 5.0.8 yargs-parser: 21.1.1 - /yauzl@2.10.0: - resolution: {integrity: sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g==} - dependencies: - buffer-crc32: 0.2.13 - fd-slicer: 1.1.0 - dev: false - /yn@3.1.1: resolution: {integrity: sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==} engines: {node: '>=6'} From 07cc413dd8975c40b3b924ba6732107ce6a12c9d Mon Sep 17 00:00:00 2001 From: terwer Date: Fri, 15 Mar 2024 18:10:58 +0800 Subject: [PATCH 04/34] feat: adapt universal picgo config path --- libs/Universal-PicGo-Core/package.json | 3 +- .../src/core/UniversalPicGo.ts | 37 +++++++++- libs/Universal-PicGo-Core/src/utils/db.ts | 70 +++++++++++++++++++ .../src/utils/nodeUtils.ts | 45 ++++++++++++ libs/Universal-PicGo-Store/.eslintrc.cjs | 22 +++++- libs/Universal-PicGo-Store/.gitignore | 3 +- libs/Universal-PicGo-Store/src/index.ts | 18 ++--- .../src/lib/JSONStore.ts | 40 +++++++++++ libs/Universal-PicGo-Store/src/lib/utils.ts | 13 ++++ .../src/types/index.d.ts | 12 ++++ libs/Universal-PicGo-Store/tsconfig.json | 6 +- libs/Universal-PicGo-Store/vite.config.ts | 8 ++- packages/picgo-plugin-app/scripts/dev.py | 3 - .../picgo-plugin-app/src/pages/PicGoIndex.vue | 12 +++- pnpm-lock.yaml | 3 + 15 files changed, 268 insertions(+), 27 deletions(-) create mode 100644 libs/Universal-PicGo-Core/src/utils/db.ts create mode 100644 libs/Universal-PicGo-Core/src/utils/nodeUtils.ts create mode 100644 libs/Universal-PicGo-Store/src/lib/JSONStore.ts create mode 100644 libs/Universal-PicGo-Store/src/lib/utils.ts create mode 100644 libs/Universal-PicGo-Store/src/types/index.d.ts diff --git a/libs/Universal-PicGo-Core/package.json b/libs/Universal-PicGo-Core/package.json index a81718c..9a73466 100644 --- a/libs/Universal-PicGo-Core/package.json +++ b/libs/Universal-PicGo-Core/package.json @@ -30,7 +30,8 @@ "vite-plugin-node-polyfills": "^0.21.0" }, "dependencies": { - "zhi-lib-base": "^0.8.0" + "zhi-lib-base": "^0.8.0", + "universal-picgo-store": "workspace:*" }, "publishConfig": { "access": "public" diff --git a/libs/Universal-PicGo-Core/src/core/UniversalPicGo.ts b/libs/Universal-PicGo-Core/src/core/UniversalPicGo.ts index 564debb..953aaca 100644 --- a/libs/Universal-PicGo-Core/src/core/UniversalPicGo.ts +++ b/libs/Universal-PicGo-Core/src/core/UniversalPicGo.ts @@ -27,6 +27,9 @@ import { PluginHandler } from "../lib/PluginHandler" import _ from "lodash-es" import getClipboardImage from "../utils/getClipboardImage" import { IBuildInEvent } from "../utils/enums" +import DB from "../utils/db" +import { hasNodeEnv, win } from "universal-picgo-store" +import { ensureFileSync, pathExistsSync } from "../utils/nodeUtils" /* * 通用 PicGO 对象定义 @@ -37,6 +40,7 @@ import { IBuildInEvent } from "../utils/enums" class UniversalPicGo extends EventEmitter implements IPicGo { private _config!: IConfig private lifecycle!: Lifecycle + private db!: DB private _pluginLoader!: PluginLoader configPath: string baseDir!: string @@ -48,6 +52,7 @@ class UniversalPicGo extends EventEmitter implements IPicGo { pluginHandler: PluginHandler i18n!: II18nManager VERSION: string = process.env.PICGO_VERSION ?? "unknown" + // GUI_VERSION?: string get pluginLoader(): IPluginLoader { @@ -196,9 +201,37 @@ class UniversalPicGo extends EventEmitter implements IPicGo { // =================================================================================================================== - private initConfigPath(): void {} + private initConfigPath(): void { + console.log("win =>", win) + console.log("hasNodeEnv =>", hasNodeEnv) + if (hasNodeEnv) { + const os = win.require("os") + const fs = win.fs + const path = win.require("path") + const { homedir } = os + if (this.configPath === "") { + this.configPath = homedir() + "/.picgo/config.json" + } + if (path.extname(this.configPath).toUpperCase() !== ".JSON") { + this.configPath = "" + throw Error("The configuration file only supports JSON format.") + } + this.baseDir = path.dirname(this.configPath) + const exist = pathExistsSync(fs, path, this.configPath) + if (!exist) { + ensureFileSync(fs, path, `${this.configPath}`) + } + } else { + if (this.configPath === "") { + this.configPath = `picgo-config-${this.VERSION}.json` + } + } + } - private initConfig(): void {} + private initConfig(): void { + // this.db = new DB(this) + // this._config = this.db.read(true) as IConfig + } private init(): void {} } diff --git a/libs/Universal-PicGo-Core/src/utils/db.ts b/libs/Universal-PicGo-Core/src/utils/db.ts new file mode 100644 index 0000000..b2b3e1c --- /dev/null +++ b/libs/Universal-PicGo-Core/src/utils/db.ts @@ -0,0 +1,70 @@ +import { IConfig, IPicGo } from "../types" +import { JSONStore } from "universal-picgo-store/src" +import { IJSON } from "universal-picgo-store" + +class DB { + private readonly ctx: IPicGo + private readonly db: JSONStore + constructor(ctx: IPicGo) { + this.ctx = ctx + this.db = new JSONStore(this.ctx.configPath) + + if (!this.db.has("picBed")) { + try { + this.db.set("picBed", { + uploader: "smms", + current: "smms", + }) + } catch (e: any) { + this.ctx.log.error(e) + throw e + } + } + if (!this.db.has("picgoPlugins")) { + try { + this.db.set("picgoPlugins", {}) + } catch (e: any) { + this.ctx.log.error(e) + throw e + } + } + } + + read(flush?: boolean): IJSON { + return this.db.read(flush) + } + + get(key: ""): any { + this.read(true) + return this.db.get(key) + } + + set(key: string, value: any): void { + this.read(true) + return this.db.set(key, value) + } + + has(key: string): boolean { + this.read(true) + return this.db.has(key) + } + + unset(key: string, value: any): boolean { + this.read(true) + return this.db.unset(key, value) + } + + saveConfig(config: Partial): void { + Object.keys(config).forEach((name: string) => { + this.set(name, config[name]) + }) + } + + removeConfig(config: IConfig): void { + Object.keys(config).forEach((name: string) => { + this.unset(name, config[name]) + }) + } +} + +export default DB diff --git a/libs/Universal-PicGo-Core/src/utils/nodeUtils.ts b/libs/Universal-PicGo-Core/src/utils/nodeUtils.ts new file mode 100644 index 0000000..46f699f --- /dev/null +++ b/libs/Universal-PicGo-Core/src/utils/nodeUtils.ts @@ -0,0 +1,45 @@ +/* + * GNU GENERAL PUBLIC LICENSE + * Version 3, 29 June 2007 + * + * Copyright (C) 2024 Terwer, Inc. + * Everyone is permitted to copy and distribute verbatim copies + * of this license document, but changing it is not allowed. + */ + +/** + * 实现 fs.pathExistsSync 函数 + * + * @param fs + * @param path + * @param filePath + */ +export const pathExistsSync = (fs: any, path: any, filePath: string) => { + try { + fs.accessSync(path.join(filePath), fs.constants.F_OK) + return true + } catch (err: any) { + if (err && err.code === "ENOENT") { + return false + } else { + throw err + } + } +} + +/** + * 实现 fs.ensureFileSync 函数 + * + * @param fs + * @param path + * @param filePath + */ +export const ensureFileSync = (fs: any, path: any, filePath: string) => { + const directory = path.dirname(filePath) + if (!fs.existsSync(directory)) { + fs.mkdirSync(directory, { recursive: true }) + } + if (!fs.existsSync(filePath)) { + fs.writeFileSync(filePath, "") + } +} diff --git a/libs/Universal-PicGo-Store/.eslintrc.cjs b/libs/Universal-PicGo-Store/.eslintrc.cjs index a1993b7..41f5589 100644 --- a/libs/Universal-PicGo-Store/.eslintrc.cjs +++ b/libs/Universal-PicGo-Store/.eslintrc.cjs @@ -1,4 +1,22 @@ module.exports = { - root: true, - extends: ["./node_modules/@terwer/eslint-config-custom/typescript/index.cjs"], + extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended", "turbo", "prettier"], + + parser: "@typescript-eslint/parser", + + plugins: ["@typescript-eslint", "prettier"], + + rules: { + // Note: you must disable the base rule as it can report incorrect errors + semi: "off", + quotes: "off", + "no-undef": "off", + "@typescript-eslint/no-var-requires": "off", + "@typescript-eslint/no-this-alias": "off", + "@typescript-eslint/no-non-null-assertion": "off", + "@typescript-eslint/no-unused-vars": "off", + "@typescript-eslint/no-explicit-any": "off", + "@typescript-eslint/no-empty-function": "off", + "turbo/no-undeclared-env-vars": "off", + "prettier/prettier": "error", + }, } diff --git a/libs/Universal-PicGo-Store/.gitignore b/libs/Universal-PicGo-Store/.gitignore index 1f1025f..dda5297 100644 --- a/libs/Universal-PicGo-Store/.gitignore +++ b/libs/Universal-PicGo-Store/.gitignore @@ -1,2 +1,3 @@ .idea -.DS_Store \ No newline at end of file +.DS_Store +dist \ No newline at end of file diff --git a/libs/Universal-PicGo-Store/src/index.ts b/libs/Universal-PicGo-Store/src/index.ts index b40c067..f8c14ce 100644 --- a/libs/Universal-PicGo-Store/src/index.ts +++ b/libs/Universal-PicGo-Store/src/index.ts @@ -1,13 +1,7 @@ -import { simpleLogger, MainFunction } from "zhi-lib-base" +import { JSONStore } from "./lib/JSONStore" +import { win, hasNodeEnv } from "./lib/utils" +import { IJSON } from "./types" -/** - * 初始化入口 - * - * @param args - */ -const main: MainFunction = async (args: any[]) => { - const logger = simpleLogger("main", "zhi", false) - return "ok" -} - -export default main +export { type IJSON } +export { JSONStore } +export { win, hasNodeEnv } diff --git a/libs/Universal-PicGo-Store/src/lib/JSONStore.ts b/libs/Universal-PicGo-Store/src/lib/JSONStore.ts new file mode 100644 index 0000000..e37af0d --- /dev/null +++ b/libs/Universal-PicGo-Store/src/lib/JSONStore.ts @@ -0,0 +1,40 @@ +/* + * GNU GENERAL PUBLIC LICENSE + * Version 3, 29 June 2007 + * + * Copyright (C) 2024 Terwer, Inc. + * Everyone is permitted to copy and distribute verbatim copies + * of this license document, but changing it is not allowed. + */ + +import { IJSON } from "../types" + +class JSONStore { + constructor(dbPath: string) { + if (!dbPath) { + throw Error("Please provide valid dbPath") + } + } + + read(flush = false): IJSON { + throw Error("Not Implemented") + } + + get(key = ""): any { + throw Error("get Not Implemented for json store") + } + + set(key: string, value: any): void { + throw Error("Not Implemented") + } + + has(key: string): boolean { + throw Error("Not Implemented") + } + + unset(key: string, value: any): boolean { + throw Error("Not Implemented") + } +} + +export { JSONStore } diff --git a/libs/Universal-PicGo-Store/src/lib/utils.ts b/libs/Universal-PicGo-Store/src/lib/utils.ts new file mode 100644 index 0000000..736e20a --- /dev/null +++ b/libs/Universal-PicGo-Store/src/lib/utils.ts @@ -0,0 +1,13 @@ +/* + * GNU GENERAL PUBLIC LICENSE + * Version 3, 29 June 2007 + * + * Copyright (C) 2024 Terwer, Inc. + * Everyone is permitted to copy and distribute verbatim copies + * of this license document, but changing it is not allowed. + */ + +const currentWin = (window || globalThis || undefined) as any +const parentWin = (window?.parent || window?.top || window?.self || undefined) as any +export const win = currentWin?.fs ? currentWin : parentWin?.fs ? parentWin : currentWin +export const hasNodeEnv = typeof win?.fs !== "undefined" diff --git a/libs/Universal-PicGo-Store/src/types/index.d.ts b/libs/Universal-PicGo-Store/src/types/index.d.ts new file mode 100644 index 0000000..d962e8b --- /dev/null +++ b/libs/Universal-PicGo-Store/src/types/index.d.ts @@ -0,0 +1,12 @@ +/* + * GNU GENERAL PUBLIC LICENSE + * Version 3, 29 June 2007 + * + * Copyright (C) 2024 Terwer, Inc. + * Everyone is permitted to copy and distribute verbatim copies + * of this license document, but changing it is not allowed. + */ + +export interface IJSON { + [propsName: string]: string | number | IJSON +} \ No newline at end of file diff --git a/libs/Universal-PicGo-Store/tsconfig.json b/libs/Universal-PicGo-Store/tsconfig.json index 08cfe0c..9c76f42 100644 --- a/libs/Universal-PicGo-Store/tsconfig.json +++ b/libs/Universal-PicGo-Store/tsconfig.json @@ -9,6 +9,7 @@ "DOM.Iterable" ], "skipLibCheck": true, + /* Bundler mode */ "moduleResolution": "Node", // "allowImportingTsExtensions": true, @@ -17,10 +18,11 @@ "isolatedModules": true, "noEmit": true, "jsx": "preserve", + /* Linting */ "strict": true, - "noUnusedLocals": true, - "noUnusedParameters": true, + "noUnusedLocals": false, + "noUnusedParameters": false, "noFallthroughCasesInSwitch": true, "types": [ "node", diff --git a/libs/Universal-PicGo-Store/vite.config.ts b/libs/Universal-PicGo-Store/vite.config.ts index 7d92df1..0522d73 100644 --- a/libs/Universal-PicGo-Store/vite.config.ts +++ b/libs/Universal-PicGo-Store/vite.config.ts @@ -6,6 +6,7 @@ import { viteStaticCopy } from "vite-plugin-static-copy" import dts from "vite-plugin-dts" import minimist from "minimist" import livereload from "rollup-plugin-livereload" +import { nodePolyfills } from "vite-plugin-node-polyfills" const args = minimist(process.argv.slice(2)) const isWatch = args.watch || args.w || false @@ -20,6 +21,11 @@ export default defineConfig({ plugins: [ dts(), + nodePolyfills({ + // Whether to polyfill `node:` protocol imports. + protocolImports: true, + }) as any, + viteStaticCopy({ targets: [ { @@ -50,7 +56,7 @@ export default defineConfig({ formats: ["es"], }, rollupOptions: { - plugins: [...(isWatch ? [livereload(devDistDir)] : [])], + plugins: [...(isWatch ? [livereload(devDistDir)] : [])] as any, // make sure to externalize deps that shouldn't be bundled // into your library external: [], diff --git a/packages/picgo-plugin-app/scripts/dev.py b/packages/picgo-plugin-app/scripts/dev.py index bf8d518..d835a4e 100644 --- a/packages/picgo-plugin-app/scripts/dev.py +++ b/packages/picgo-plugin-app/scripts/dev.py @@ -6,8 +6,5 @@ # Windows 必须添加此设置 sys.stdout.reconfigure(encoding="utf-8") -# siyuan-plugin-bootstrap -# os.system("") - # picgo-app os.system("vue-tsc && vite build --watch") \ No newline at end of file diff --git a/packages/picgo-plugin-app/src/pages/PicGoIndex.vue b/packages/picgo-plugin-app/src/pages/PicGoIndex.vue index f5cc1c7..4d538db 100644 --- a/packages/picgo-plugin-app/src/pages/PicGoIndex.vue +++ b/packages/picgo-plugin-app/src/pages/PicGoIndex.vue @@ -10,14 +10,20 @@ diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3e4c6ea..24ccaae 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -20,6 +20,9 @@ importers: libs/Universal-PicGo-Core: dependencies: + universal-picgo-store: + specifier: workspace:* + version: link:../Universal-PicGo-Store zhi-lib-base: specifier: ^0.8.0 version: 0.8.0 From 9c8115e492269562c17e8b82212df3ebe09c45e4 Mon Sep 17 00:00:00 2001 From: terwer Date: Fri, 15 Mar 2024 18:13:41 +0800 Subject: [PATCH 05/34] feat: adapt universal picgo config path --- libs/Universal-PicGo-Core/src/core/UniversalPicGo.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/Universal-PicGo-Core/src/core/UniversalPicGo.ts b/libs/Universal-PicGo-Core/src/core/UniversalPicGo.ts index 953aaca..fec37ec 100644 --- a/libs/Universal-PicGo-Core/src/core/UniversalPicGo.ts +++ b/libs/Universal-PicGo-Core/src/core/UniversalPicGo.ts @@ -202,8 +202,8 @@ class UniversalPicGo extends EventEmitter implements IPicGo { // =================================================================================================================== private initConfigPath(): void { - console.log("win =>", win) - console.log("hasNodeEnv =>", hasNodeEnv) + this.log.debug("win =>", win) + this.log.info("hasNodeEnv =>", hasNodeEnv) if (hasNodeEnv) { const os = win.require("os") const fs = win.fs From 23670234a1984b720a4c140c0b5292bb3cb7be64 Mon Sep 17 00:00:00 2001 From: terwer Date: Fri, 15 Mar 2024 18:15:45 +0800 Subject: [PATCH 06/34] feat: adapt universal picgo config path --- packages/picgo-plugin-app/src/pages/PicGoIndex.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/picgo-plugin-app/src/pages/PicGoIndex.vue b/packages/picgo-plugin-app/src/pages/PicGoIndex.vue index 4d538db..53521d5 100644 --- a/packages/picgo-plugin-app/src/pages/PicGoIndex.vue +++ b/packages/picgo-plugin-app/src/pages/PicGoIndex.vue @@ -11,12 +11,13 @@ import { UniversalPicGo } from "universal-picgo" import { createAppLogger } from "@/utils/appLogger.ts" import { ElMessage } from "element-plus" +import { isDev } from "@/utils/Constants.ts" const logger = createAppLogger("picgo-index") const handleTest = () => { try { - const picgo = new UniversalPicGo() + const picgo = new UniversalPicGo("", isDev) logger.debug("picgo =>", picgo) picgo.upload() From 066cd00eabaa002197541240ca0645953abba15d Mon Sep 17 00:00:00 2001 From: zhangyue Date: Sat, 16 Mar 2024 22:01:25 +0800 Subject: [PATCH 07/34] feat: add localForge support --- .../src/core/UniversalPicGo.ts | 4 ++-- libs/Universal-PicGo-Core/src/utils/db.ts | 4 ++-- libs/Universal-PicGo-Store/package.json | 1 + .../src/lib/JSONStore.ts | 8 ++++++++ pnpm-lock.yaml | 19 +++++++++++++++++++ 5 files changed, 32 insertions(+), 4 deletions(-) diff --git a/libs/Universal-PicGo-Core/src/core/UniversalPicGo.ts b/libs/Universal-PicGo-Core/src/core/UniversalPicGo.ts index fec37ec..e1a0f27 100644 --- a/libs/Universal-PicGo-Core/src/core/UniversalPicGo.ts +++ b/libs/Universal-PicGo-Core/src/core/UniversalPicGo.ts @@ -229,8 +229,8 @@ class UniversalPicGo extends EventEmitter implements IPicGo { } private initConfig(): void { - // this.db = new DB(this) - // this._config = this.db.read(true) as IConfig + this.db = new DB(this) + this._config = this.db.read(true) as IConfig } private init(): void {} diff --git a/libs/Universal-PicGo-Core/src/utils/db.ts b/libs/Universal-PicGo-Core/src/utils/db.ts index b2b3e1c..7943ad9 100644 --- a/libs/Universal-PicGo-Core/src/utils/db.ts +++ b/libs/Universal-PicGo-Core/src/utils/db.ts @@ -1,10 +1,10 @@ import { IConfig, IPicGo } from "../types" -import { JSONStore } from "universal-picgo-store/src" -import { IJSON } from "universal-picgo-store" +import { IJSON, JSONStore } from "universal-picgo-store" class DB { private readonly ctx: IPicGo private readonly db: JSONStore + constructor(ctx: IPicGo) { this.ctx = ctx this.db = new JSONStore(this.ctx.configPath) diff --git a/libs/Universal-PicGo-Store/package.json b/libs/Universal-PicGo-Store/package.json index 174bb42..a1018e4 100644 --- a/libs/Universal-PicGo-Store/package.json +++ b/libs/Universal-PicGo-Store/package.json @@ -29,6 +29,7 @@ "@terwer/vite-config-custom": "^0.7.6" }, "dependencies": { + "localforage": "^1.10.0", "zhi-lib-base": "^0.8.0" }, "publishConfig": { diff --git a/libs/Universal-PicGo-Store/src/lib/JSONStore.ts b/libs/Universal-PicGo-Store/src/lib/JSONStore.ts index e37af0d..46e3b7e 100644 --- a/libs/Universal-PicGo-Store/src/lib/JSONStore.ts +++ b/libs/Universal-PicGo-Store/src/lib/JSONStore.ts @@ -8,12 +8,20 @@ */ import { IJSON } from "../types" +import localForage from "localforage" +import { hasNodeEnv } from "./utils" class JSONStore { constructor(dbPath: string) { if (!dbPath) { throw Error("Please provide valid dbPath") } + + if (hasNodeEnv) { + + } else { + } + alert(1) } read(flush = false): IJSON { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 24ccaae..2d68c3f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -39,6 +39,9 @@ importers: libs/Universal-PicGo-Store: dependencies: + localforage: + specifier: ^1.10.0 + version: 1.10.0 zhi-lib-base: specifier: ^0.8.0 version: 0.8.0 @@ -4309,6 +4312,10 @@ packages: engines: {node: '>= 4'} dev: true + /immediate@3.0.6: + resolution: {integrity: sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ==} + dev: false + /import-fresh@3.3.0: resolution: {integrity: sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==} engines: {node: '>=6'} @@ -4771,6 +4778,12 @@ packages: type-check: 0.4.0 dev: true + /lie@3.1.1: + resolution: {integrity: sha512-RiNhHysUjhrDQntfYSfY4MU24coXXdEOgw9WGcKHNeEwffDYbF//u87M1EWaMGzuFoSbqW0C9C6lEEhDOAswfw==} + dependencies: + immediate: 3.0.6 + dev: false + /lilconfig@2.1.0: resolution: {integrity: sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==} engines: {node: '>=10'} @@ -4812,6 +4825,12 @@ packages: pkg-types: 1.0.3 dev: true + /localforage@1.10.0: + resolution: {integrity: sha512-14/H1aX7hzBBmmh7sGPd+AOMkkIrHM3Z1PAyGgZigA1H1p5O5ANnMyWzvpAETtG68/dC4pC0ncy3+PPGzXZHPg==} + dependencies: + lie: 3.1.1 + dev: false + /locate-character@3.0.0: resolution: {integrity: sha512-SW13ws7BjaeJ6p7Q6CO2nchbYEc3X3J6WrmTTDto7yMPqVSZTUyY5Tjbid+Ab8gLnATtygYtiDIJGQRRn2ZOiA==} dev: true From 952cff98996a29999842113db9fd3cf0e2bb8a51 Mon Sep 17 00:00:00 2001 From: zhangyue Date: Sat, 16 Mar 2024 22:39:42 +0800 Subject: [PATCH 08/34] feat: use ts-localstorage for browser --- libs/Universal-PicGo-Store/package.json | 10 +- .../src/lib/JSONStore.ts | 47 +++++--- .../src/lib/adapters/JSONAdapter.ts | 41 +++++++ .../src/lib/adapters/LocalForgeAdapter.ts | 30 +++++ libs/Universal-PicGo-Store/vite.config.ts | 2 +- pnpm-lock.yaml | 107 ++++++++++++++---- 6 files changed, 192 insertions(+), 45 deletions(-) create mode 100644 libs/Universal-PicGo-Store/src/lib/adapters/JSONAdapter.ts create mode 100644 libs/Universal-PicGo-Store/src/lib/adapters/LocalForgeAdapter.ts diff --git a/libs/Universal-PicGo-Store/package.json b/libs/Universal-PicGo-Store/package.json index a1018e4..5b9d9bd 100644 --- a/libs/Universal-PicGo-Store/package.json +++ b/libs/Universal-PicGo-Store/package.json @@ -26,10 +26,16 @@ }, "devDependencies": { "@terwer/eslint-config-custom": "^1.3.6", - "@terwer/vite-config-custom": "^0.7.6" + "@terwer/vite-config-custom": "^0.7.6", + "@types/lodash-es": "^4.17.12", + "@types/write-file-atomic": "^4.0.3" }, "dependencies": { - "localforage": "^1.10.0", + "@commonify/lowdb": "^3.0.0", + "comment-json": "^4.2.3", + "lodash-es": "^4.17.21", + "ts-localstorage": "^3.1.0", + "write-file-atomic": "^5.0.1", "zhi-lib-base": "^0.8.0" }, "publishConfig": { diff --git a/libs/Universal-PicGo-Store/src/lib/JSONStore.ts b/libs/Universal-PicGo-Store/src/lib/JSONStore.ts index 46e3b7e..6ad9334 100644 --- a/libs/Universal-PicGo-Store/src/lib/JSONStore.ts +++ b/libs/Universal-PicGo-Store/src/lib/JSONStore.ts @@ -1,47 +1,58 @@ -/* - * GNU GENERAL PUBLIC LICENSE - * Version 3, 29 June 2007 - * - * Copyright (C) 2024 Terwer, Inc. - * Everyone is permitted to copy and distribute verbatim copies - * of this license document, but changing it is not allowed. - */ - +import { LowSync } from "@commonify/lowdb" +import { JSONAdapter } from "./adapters/JSONAdapter" +import _ from "lodash" import { IJSON } from "../types" -import localForage from "localforage" import { hasNodeEnv } from "./utils" +import { LocalForgeAdapter } from "./adapters/LocalForgeAdapter" + +class LowWithLodash extends LowSync { + chain: _.ExpChain = _.chain(this).get("data") +} class JSONStore { + private readonly db: LowWithLodash + private hasRead = false + constructor(dbPath: string) { if (!dbPath) { throw Error("Please provide valid dbPath") } - + let adapter if (hasNodeEnv) { - + adapter = new JSONAdapter(dbPath) } else { + adapter = new LocalForgeAdapter(dbPath) } - alert(1) + this.db = new LowWithLodash(adapter) + this.read() } read(flush = false): IJSON { - throw Error("Not Implemented") + /* istanbul ignore else */ + if (flush || !this.hasRead) { + this.hasRead = true + this.db.read() + } + return this.db.data as IJSON } get(key = ""): any { - throw Error("get Not Implemented for json store") + return this.db.chain.get(key).value() } set(key: string, value: any): void { - throw Error("Not Implemented") + this.db.chain.set(key, value).value() + this.db.write() } has(key: string): boolean { - throw Error("Not Implemented") + return this.db.chain.has(key).value() } unset(key: string, value: any): boolean { - throw Error("Not Implemented") + const res = this.db.chain.get(key).unset(value).value() + this.db.write() + return res } } diff --git a/libs/Universal-PicGo-Store/src/lib/adapters/JSONAdapter.ts b/libs/Universal-PicGo-Store/src/lib/adapters/JSONAdapter.ts new file mode 100644 index 0000000..5420589 --- /dev/null +++ b/libs/Universal-PicGo-Store/src/lib/adapters/JSONAdapter.ts @@ -0,0 +1,41 @@ +import { IJSON } from "../../types" +import { TextFileSync } from "@commonify/lowdb" +import json from "comment-json" +import writeFile from "write-file-atomic" + +export class JSONAdapter { + private readonly adapter: TextFileSync + private readonly dbPath: string + constructor(dbPath: string) { + this.dbPath = dbPath + this.adapter = new TextFileSync(dbPath) + } + + read(): IJSON { + const data = this.adapter.read() + /* istanbul ignore if */ + if (data === null) { + return {} + } else { + try { + // comment-json will break in some cases + const res = json.parse(data || "{}") + if (res === null || typeof res !== "object") { + return {} + } + return res as IJSON + } catch (e) { + try { + return JSON.parse(data) + } catch (e) { + console.error("[PicGo store] JSON parse error", e) + return {} + } + } + } + } + + write(obj: any): void { + writeFile.sync(this.dbPath, json.stringify(obj, null, 2)) + } +} diff --git a/libs/Universal-PicGo-Store/src/lib/adapters/LocalForgeAdapter.ts b/libs/Universal-PicGo-Store/src/lib/adapters/LocalForgeAdapter.ts new file mode 100644 index 0000000..9f9b831 --- /dev/null +++ b/libs/Universal-PicGo-Store/src/lib/adapters/LocalForgeAdapter.ts @@ -0,0 +1,30 @@ +import { IJSON } from "../../types" +import localForage from "localforage" + +export class LocalForgeAdapter { + private readonly adapter: LocalForage + private readonly dbPath: string + + constructor(dbPath: string) { + this.dbPath = dbPath + this.adapter = localForage + localForage.config({ + driver: localForage.LOCALSTORAGE, // Force WebSQL; same as using setDriver() + name: "universal-picgo-store", + version: 1.0, + storeName: "picgo-store", // Should be alphanumeric, with underscores. + description: "universal picgo store", + }) + } + + read(): IJSON { + console.log(this.adapter) + throw new Error("Method LocalForgeAdapter.read not implemented") + + const data = this.adapter.getItem(this.dbPath) + } + + write(obj: any): void { + throw new Error("Method LocalForgeAdapter.write not implemented") + } +} diff --git a/libs/Universal-PicGo-Store/vite.config.ts b/libs/Universal-PicGo-Store/vite.config.ts index 0522d73..d706937 100644 --- a/libs/Universal-PicGo-Store/vite.config.ts +++ b/libs/Universal-PicGo-Store/vite.config.ts @@ -59,7 +59,7 @@ export default defineConfig({ plugins: [...(isWatch ? [livereload(devDistDir)] : [])] as any, // make sure to externalize deps that shouldn't be bundled // into your library - external: [], + external: ["worker_threads"], output: { entryFileNames: "[name].js", }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2d68c3f..f351601 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -39,9 +39,21 @@ importers: libs/Universal-PicGo-Store: dependencies: - localforage: - specifier: ^1.10.0 - version: 1.10.0 + '@commonify/lowdb': + specifier: ^3.0.0 + version: 3.0.0 + comment-json: + specifier: ^4.2.3 + version: 4.2.3 + lodash-es: + specifier: ^4.17.21 + version: 4.17.21 + ts-localstorage: + specifier: ^3.1.0 + version: 3.1.0 + write-file-atomic: + specifier: ^5.0.1 + version: 5.0.1 zhi-lib-base: specifier: ^0.8.0 version: 0.8.0 @@ -52,6 +64,12 @@ importers: '@terwer/vite-config-custom': specifier: ^0.7.6 version: 0.7.6(@types/minimist@1.2.2)(jsdom@22.1.0)(minimist@1.2.8)(rollup-plugin-livereload@2.0.5)(typescript@5.4.2)(vite-plugin-dts@2.3.0)(vite-plugin-node-polyfills@0.8.2)(vite-plugin-static-copy@0.15.0)(vite-tsconfig-paths@4.3.2)(vite@4.5.2)(vitest@0.31.4) + '@types/lodash-es': + specifier: ^4.17.12 + version: 4.17.12 + '@types/write-file-atomic': + specifier: ^4.0.3 + version: 4.0.3 packages/picgo-plugin-app: dependencies: @@ -536,6 +554,18 @@ packages: dev: true optional: true + /@commonify/lowdb@3.0.0: + resolution: {integrity: sha512-GwZq68zStvMENxEzN6EE8pacgY2Rlrs5L00BpvB6NvpDW96JUxIa8PJXd9T7qIdx07ro0ITBtw6HfSJw/qboGw==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + dependencies: + '@commonify/steno': 2.1.0 + dev: false + + /@commonify/steno@2.1.0: + resolution: {integrity: sha512-3W0LmYb84EU82Ky18M+D0tB33W66ccoC/Ot/8mm3uBQFuaTpiWaoxntQGBTL3+bIpV4e77ks53IE3sy9BRFBxA==} + engines: {node: ^14.13.1 || >=16.0.0} + dev: false + /@cspotcode/source-map-support@0.8.1: resolution: {integrity: sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==} engines: {node: '>=12'} @@ -1685,11 +1715,9 @@ packages: resolution: {integrity: sha512-0NgftHUcV4v34VhXm8QBSftKVXtbkBG3ViCjs6+eJ5a6y6Mi/jiFGPc1sC7QK+9BFhWrURE3EOggmWaSxL9OzQ==} dependencies: '@types/lodash': 4.17.0 - dev: false /@types/lodash@4.17.0: resolution: {integrity: sha512-t7dhREVv6dbNj0q17X12j7yDG4bD/DHYX7o5/DbDxobP0HnGPgpRz2Ej77aL7TZT3DSw13fqUTj8J4mMnqa7WA==} - dev: false /@types/minimist@1.2.2: resolution: {integrity: sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==} @@ -1718,6 +1746,12 @@ packages: /@types/web-bluetooth@0.0.20: resolution: {integrity: sha512-g9gZnnXVq7gM7v3tJCWV/qw7w+KeOlSHAhgF9RytFyifW6AF61hdT2ucrYhPq9hLs5JIryeupHV3qGk95dH9ow==} + /@types/write-file-atomic@4.0.3: + resolution: {integrity: sha512-qdo+vZRchyJIHNeuI1nrpsLw+hnkgqP/8mlaN6Wle/NKhydHmUN9l4p3ZE8yP90AJNJW4uB8HQhedb4f1vNayQ==} + dependencies: + '@types/node': 20.5.1 + dev: true + /@typescript-eslint/eslint-plugin@5.62.0(@typescript-eslint/parser@5.62.0)(eslint@8.57.0)(typescript@4.9.5): resolution: {integrity: sha512-TiZzBSJja/LbhNPvk6yc0JrX9XqhQ0hdh6M2svYfsHGejaKFIAGd9MQ+ERIMzLGlN/kZoYIgdxFV0PuljTKXag==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -2384,6 +2418,10 @@ packages: resolution: {integrity: sha512-c5AMf34bKdvPhQ7tBGhqkgKNUzMr4WUs+WDtC2ZUGOUncbxKMTvqxYctiseW3+L4bA8ec+GcZ6/A/FW4m8ukng==} dev: true + /array-timsort@1.0.3: + resolution: {integrity: sha512-/+3GRL7dDAGEfM6TseQk/U+mi18TU2Ms9I3UlLdUMhz2hbvGNTKdj9xniwXfUqgYhHxRx0+8UnKkvlNwVU+cWQ==} + dev: false + /array-union@2.1.0: resolution: {integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==} engines: {node: '>=8'} @@ -2849,6 +2887,17 @@ packages: dev: true optional: true + /comment-json@4.2.3: + resolution: {integrity: sha512-SsxdiOf064DWoZLH799Ata6u7iV658A11PlWtZATDlXPpKGJnbJZ5Z24ybixAi+LUUqJ/GKowAejtC5GFUG7Tw==} + engines: {node: '>= 6'} + dependencies: + array-timsort: 1.0.3 + core-util-is: 1.0.3 + esprima: 4.0.1 + has-own-prop: 2.0.0 + repeat-string: 1.6.1 + dev: false + /commitizen@4.3.0(@types/node@20.5.1)(typescript@5.4.2): resolution: {integrity: sha512-H0iNtClNEhT0fotHvGV3E9tDejDeS04sN1veIebsKYGMuGscFaswRoYJKmT3eW85eIJAs0F28bG2+a/9wCOfPw==} engines: {node: '>= 12'} @@ -2943,7 +2992,6 @@ packages: /core-util-is@1.0.3: resolution: {integrity: sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==} - dev: true /cosmiconfig-typescript-loader@4.4.0(@types/node@20.5.1)(cosmiconfig@8.3.6)(ts-node@10.9.2)(typescript@5.4.2): resolution: {integrity: sha512-BabizFdC3wBHhbI4kJh0VkQP9GkBfoHPydD0COMce1nJ1kJAB3F2TmJ/I7diULBKtmEWSwEbuN/KDtgnmUUVmw==} @@ -3680,6 +3728,12 @@ packages: eslint-visitor-keys: 3.4.3 dev: true + /esprima@4.0.1: + resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} + engines: {node: '>=4'} + hasBin: true + dev: false + /esquery@1.5.0: resolution: {integrity: sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==} engines: {node: '>=0.10'} @@ -4115,6 +4169,11 @@ packages: engines: {node: '>=8'} dev: true + /has-own-prop@2.0.0: + resolution: {integrity: sha512-Pq0h+hvsVm6dDEa8x82GnLSYHOzNDt7f0ddFa3FqcQlgzEiptPqL+XrOJNavjOzSYiYWIrgeVYYgGlLmnxwilQ==} + engines: {node: '>=8'} + dev: false + /has-property-descriptors@1.0.2: resolution: {integrity: sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==} dependencies: @@ -4312,10 +4371,6 @@ packages: engines: {node: '>= 4'} dev: true - /immediate@3.0.6: - resolution: {integrity: sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ==} - dev: false - /import-fresh@3.3.0: resolution: {integrity: sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==} engines: {node: '>=6'} @@ -4338,7 +4393,6 @@ packages: /imurmurhash@0.1.4: resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} engines: {node: '>=0.8.19'} - dev: true /indent-string@4.0.0: resolution: {integrity: sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==} @@ -4778,12 +4832,6 @@ packages: type-check: 0.4.0 dev: true - /lie@3.1.1: - resolution: {integrity: sha512-RiNhHysUjhrDQntfYSfY4MU24coXXdEOgw9WGcKHNeEwffDYbF//u87M1EWaMGzuFoSbqW0C9C6lEEhDOAswfw==} - dependencies: - immediate: 3.0.6 - dev: false - /lilconfig@2.1.0: resolution: {integrity: sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==} engines: {node: '>=10'} @@ -4825,12 +4873,6 @@ packages: pkg-types: 1.0.3 dev: true - /localforage@1.10.0: - resolution: {integrity: sha512-14/H1aX7hzBBmmh7sGPd+AOMkkIrHM3Z1PAyGgZigA1H1p5O5ANnMyWzvpAETtG68/dC4pC0ncy3+PPGzXZHPg==} - dependencies: - lie: 3.1.1 - dev: false - /locate-character@3.0.0: resolution: {integrity: sha512-SW13ws7BjaeJ6p7Q6CO2nchbYEc3X3J6WrmTTDto7yMPqVSZTUyY5Tjbid+Ab8gLnATtygYtiDIJGQRRn2ZOiA==} dev: true @@ -5813,6 +5855,11 @@ packages: engines: {node: '>= 0.10'} dev: true + /repeat-string@1.6.1: + resolution: {integrity: sha512-PV0dzCYDNfRi1jCDbJzpW7jNNDRuCOG/jI5ctQcGKt/clZD+YcPS3yIlWuTJMmESC8aevCFmWJy5wjAFgNqN6w==} + engines: {node: '>=0.10'} + dev: false + /require-directory@2.1.1: resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} engines: {node: '>=0.10.0'} @@ -6080,7 +6127,6 @@ packages: /signal-exit@4.1.0: resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} engines: {node: '>=14'} - dev: true /siyuan@0.9.5: resolution: {integrity: sha512-txDJp+uSmnAoCz4aDw6a3lCz2h4eRhyx5wgInCmSglQx7aoOpMK57nU31N3FY1NVREQcNV0OG6fJZ0iJJOkrag==} @@ -6473,6 +6519,11 @@ packages: engines: {node: '>=8'} dev: true + /ts-localstorage@3.1.0: + resolution: {integrity: sha512-uQUvga4uYKQHhkJsPUonDkVXKAqUSgRpeZeWYNF0rY1Sa7H7yYRH8CwB7sii8xH1SbKZsC01bfkIV+YppgPSpg==} + engines: {node: '>=16'} + dev: false + /ts-morph@18.0.0: resolution: {integrity: sha512-Kg5u0mk19PIIe4islUI/HWRvm9bC1lHejK4S0oh1zaZ77TMZAEmQC0sHQYiu2RgCQFZKXz1fMVi/7nOOeirznA==} dependencies: @@ -7480,6 +7531,14 @@ packages: resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} dev: true + /write-file-atomic@5.0.1: + resolution: {integrity: sha512-+QU2zd6OTD8XWIJCbffaiQeH9U73qIqafo1x6V1snCWYGJf6cVE0cDR4D8xRzcEnfI21IFrUPzPGtcPf8AC+Rw==} + engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + dependencies: + imurmurhash: 0.1.4 + signal-exit: 4.1.0 + dev: false + /ws@7.5.9: resolution: {integrity: sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q==} engines: {node: '>=8.3.0'} From c44c32a43697eb0c34a1179eefdf6af8aa6220dd Mon Sep 17 00:00:00 2001 From: zhangyue Date: Sat, 16 Mar 2024 22:52:51 +0800 Subject: [PATCH 09/34] feat: finish picgo store ataptor --- .../src/lib/JSONStore.ts | 4 +-- .../src/lib/adapters/LocalForgeAdapter.ts | 30 ------------------- .../src/lib/adapters/LocalStorageAdapter.ts | 25 ++++++++++++++++ 3 files changed, 27 insertions(+), 32 deletions(-) delete mode 100644 libs/Universal-PicGo-Store/src/lib/adapters/LocalForgeAdapter.ts create mode 100644 libs/Universal-PicGo-Store/src/lib/adapters/LocalStorageAdapter.ts diff --git a/libs/Universal-PicGo-Store/src/lib/JSONStore.ts b/libs/Universal-PicGo-Store/src/lib/JSONStore.ts index 6ad9334..a99dd82 100644 --- a/libs/Universal-PicGo-Store/src/lib/JSONStore.ts +++ b/libs/Universal-PicGo-Store/src/lib/JSONStore.ts @@ -3,7 +3,7 @@ import { JSONAdapter } from "./adapters/JSONAdapter" import _ from "lodash" import { IJSON } from "../types" import { hasNodeEnv } from "./utils" -import { LocalForgeAdapter } from "./adapters/LocalForgeAdapter" +import { LocalStorageAdapter } from "./adapters/LocalStorageAdapter" class LowWithLodash extends LowSync { chain: _.ExpChain = _.chain(this).get("data") @@ -21,7 +21,7 @@ class JSONStore { if (hasNodeEnv) { adapter = new JSONAdapter(dbPath) } else { - adapter = new LocalForgeAdapter(dbPath) + adapter = new LocalStorageAdapter(dbPath) } this.db = new LowWithLodash(adapter) this.read() diff --git a/libs/Universal-PicGo-Store/src/lib/adapters/LocalForgeAdapter.ts b/libs/Universal-PicGo-Store/src/lib/adapters/LocalForgeAdapter.ts deleted file mode 100644 index 9f9b831..0000000 --- a/libs/Universal-PicGo-Store/src/lib/adapters/LocalForgeAdapter.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { IJSON } from "../../types" -import localForage from "localforage" - -export class LocalForgeAdapter { - private readonly adapter: LocalForage - private readonly dbPath: string - - constructor(dbPath: string) { - this.dbPath = dbPath - this.adapter = localForage - localForage.config({ - driver: localForage.LOCALSTORAGE, // Force WebSQL; same as using setDriver() - name: "universal-picgo-store", - version: 1.0, - storeName: "picgo-store", // Should be alphanumeric, with underscores. - description: "universal picgo store", - }) - } - - read(): IJSON { - console.log(this.adapter) - throw new Error("Method LocalForgeAdapter.read not implemented") - - const data = this.adapter.getItem(this.dbPath) - } - - write(obj: any): void { - throw new Error("Method LocalForgeAdapter.write not implemented") - } -} diff --git a/libs/Universal-PicGo-Store/src/lib/adapters/LocalStorageAdapter.ts b/libs/Universal-PicGo-Store/src/lib/adapters/LocalStorageAdapter.ts new file mode 100644 index 0000000..31cdf09 --- /dev/null +++ b/libs/Universal-PicGo-Store/src/lib/adapters/LocalStorageAdapter.ts @@ -0,0 +1,25 @@ +import { IJSON } from "../../types" +import { LocalKey, LocalStorage } from "ts-localstorage" + +export class LocalStorageAdapter { + private readonly adapter: typeof LocalStorage + private readonly key: LocalKey + + constructor(dbPath: string) { + this.adapter = LocalStorage + this.key = new LocalKey(dbPath, {}) + } + + read(): IJSON { + const data = this.adapter.getItem(this.key) + /* istanbul ignore if */ + if (data === null) { + return {} + } + return data + } + + write(obj: any): void { + this.adapter.setItem(this.key, obj) + } +} From 7f9db6c4ae3b22307e374ed781da3238c9b40210 Mon Sep 17 00:00:00 2001 From: zhangyue Date: Sat, 16 Mar 2024 22:56:48 +0800 Subject: [PATCH 10/34] feat: init picgo --- .../src/core/UniversalPicGo.ts | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/libs/Universal-PicGo-Core/src/core/UniversalPicGo.ts b/libs/Universal-PicGo-Core/src/core/UniversalPicGo.ts index e1a0f27..fb6603e 100644 --- a/libs/Universal-PicGo-Core/src/core/UniversalPicGo.ts +++ b/libs/Universal-PicGo-Core/src/core/UniversalPicGo.ts @@ -116,18 +116,18 @@ class UniversalPicGo extends EventEmitter implements IPicGo { // this.log.warn("the format of config is invalid, please provide object") // return // } - // this.setConfig(config) - // this.db.saveConfig(config) + this.setConfig(config) + this.db.saveConfig(config) } removeConfig(key: string, propName: string): void { - // if (!key || !propName) return + if (!key || !propName) return // if (isConfigKeyInBlackList(key)) { // this.log.warn(`the config.${key} can't be removed`) // return // } - // this.unsetConfig(key, propName) - // this.db.unset(key, propName) + this.unsetConfig(key, propName) + this.db.unset(key, propName) } setConfig(config: IStringKeyMap): void { @@ -135,27 +135,27 @@ class UniversalPicGo extends EventEmitter implements IPicGo { // this.log.warn("the format of config is invalid, please provide object") // return // } - // Object.keys(config).forEach((name: string) => { - // if (isConfigKeyInBlackList(name)) { - // this.log.warn(`the config.${name} can't be modified`) - // // eslint-disable-next-line @typescript-eslint/no-dynamic-delete - // delete config[name] - // } - // set(this._config, name, config[name]) - // eventBus.emit(IBusEvent.CONFIG_CHANGE, { - // configName: name, - // value: config[name], - // }) - // }) + Object.keys(config).forEach((name: string) => { + // if (isConfigKeyInBlackList(name)) { + // this.log.warn(`the config.${name} can't be modified`) + // // eslint-disable-next-line @typescript-eslint/no-dynamic-delete + // delete config[name] + // } + _.set(this._config, name, config[name]) + // eventBus.emit(IBusEvent.CONFIG_CHANGE, { + // configName: name, + // value: config[name], + // }) + }) } unsetConfig(key: string, propName: string): void { - // if (!key || !propName) return + if (!key || !propName) return // if (isConfigKeyInBlackList(key)) { // this.log.warn(`the config.${key} can't be unset`) // return // } - // unset(this.getConfig(key), propName) + _.unset(this.getConfig(key), propName) } async upload(input?: any[]): Promise { From 08c41c9413a5deddba6f63fef19f745a3052876b Mon Sep 17 00:00:00 2001 From: zhangyue Date: Sat, 16 Mar 2024 22:57:40 +0800 Subject: [PATCH 11/34] feat: init picgo --- packages/picgo-plugin-app/src/pages/PicGoIndex.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/picgo-plugin-app/src/pages/PicGoIndex.vue b/packages/picgo-plugin-app/src/pages/PicGoIndex.vue index 4d538db..53521d5 100644 --- a/packages/picgo-plugin-app/src/pages/PicGoIndex.vue +++ b/packages/picgo-plugin-app/src/pages/PicGoIndex.vue @@ -11,12 +11,13 @@ import { UniversalPicGo } from "universal-picgo" import { createAppLogger } from "@/utils/appLogger.ts" import { ElMessage } from "element-plus" +import { isDev } from "@/utils/Constants.ts" const logger = createAppLogger("picgo-index") const handleTest = () => { try { - const picgo = new UniversalPicGo() + const picgo = new UniversalPicGo("", isDev) logger.debug("picgo =>", picgo) picgo.upload() From 7ca187512b94179253a67f7c923ca1f4e1c4950b Mon Sep 17 00:00:00 2001 From: zhangyue Date: Sat, 16 Mar 2024 23:00:48 +0800 Subject: [PATCH 12/34] feat: init picgo --- libs/Universal-PicGo-Core/src/lib/PluginHandler.ts | 6 +++--- libs/Universal-PicGo-Core/src/utils/getClipboardImage.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libs/Universal-PicGo-Core/src/lib/PluginHandler.ts b/libs/Universal-PicGo-Core/src/lib/PluginHandler.ts index 2ebfb1d..c055f00 100644 --- a/libs/Universal-PicGo-Core/src/lib/PluginHandler.ts +++ b/libs/Universal-PicGo-Core/src/lib/PluginHandler.ts @@ -21,11 +21,11 @@ export class PluginHandler implements IPluginHandler { options: IPluginHandlerOptions, env: IProcessEnv | undefined ): Promise> { - throw new Error("Method not implemented") + throw new Error("PluginHandler.install not implemented") } uninstall(plugins: string[]): Promise> { - throw new Error("Method not implemented") + throw new Error("PluginHandler.uninstall not implemented") } update( @@ -33,6 +33,6 @@ export class PluginHandler implements IPluginHandler { options: IPluginHandlerOptions, env: IProcessEnv | undefined ): Promise> { - throw new Error("Method not implemented") + throw new Error("PluginHandler.update not implemented") } } diff --git a/libs/Universal-PicGo-Core/src/utils/getClipboardImage.ts b/libs/Universal-PicGo-Core/src/utils/getClipboardImage.ts index 807838f..3830d1d 100644 --- a/libs/Universal-PicGo-Core/src/utils/getClipboardImage.ts +++ b/libs/Universal-PicGo-Core/src/utils/getClipboardImage.ts @@ -11,7 +11,7 @@ import { IClipboardImage, IPicGo } from "../types" // Thanks to vs-picgo: https://github.com/Spades-S/vs-picgo/blob/master/src/extension.ts const getClipboardImage = async (ctx: IPicGo): Promise => { - throw new Error("Not Implemented") + throw new Error("getClipboardImage Not Implemented") } export default getClipboardImage From 15fa1124f19ebcd285d27e6838ec39ced85f732f Mon Sep 17 00:00:00 2001 From: zhangyue Date: Sat, 16 Mar 2024 23:04:46 +0800 Subject: [PATCH 13/34] feat: init picgo --- libs/Universal-PicGo-Core/src/core/UniversalPicGo.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/Universal-PicGo-Core/src/core/UniversalPicGo.ts b/libs/Universal-PicGo-Core/src/core/UniversalPicGo.ts index fb6603e..d10c6c5 100644 --- a/libs/Universal-PicGo-Core/src/core/UniversalPicGo.ts +++ b/libs/Universal-PicGo-Core/src/core/UniversalPicGo.ts @@ -203,7 +203,7 @@ class UniversalPicGo extends EventEmitter implements IPicGo { private initConfigPath(): void { this.log.debug("win =>", win) - this.log.info("hasNodeEnv =>", hasNodeEnv) + this.log.info(`hasNodeEnv => ${hasNodeEnv}`) if (hasNodeEnv) { const os = win.require("os") const fs = win.fs From b88113ee0d110b46e5b8bb93cd2475abf58ba746 Mon Sep 17 00:00:00 2001 From: terwer Date: Mon, 18 Mar 2024 09:49:37 +0800 Subject: [PATCH 14/34] chore: ignore script cache --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index bda17ad..299cd55 100644 --- a/.gitignore +++ b/.gitignore @@ -39,4 +39,5 @@ yarn-error.log* .idea artifacts cookie.txt -token.txt \ No newline at end of file +token.txt +__pycache__ \ No newline at end of file From 7a0ee05a444efebc569e11d26c8f9acbc7093c98 Mon Sep 17 00:00:00 2001 From: terwer Date: Mon, 18 Mar 2024 13:26:31 +0800 Subject: [PATCH 15/34] feat: rename cfg folder to universal-picgo --- libs/Universal-PicGo-Core/custom.d.ts | 4 ++ .../src/core/UniversalPicGo.ts | 4 +- libs/Universal-PicGo-Core/tsconfig.json | 4 +- libs/Universal-PicGo-Core/vite.config.ts | 54 ++++++++++++++++++- 4 files changed, 61 insertions(+), 5 deletions(-) create mode 100644 libs/Universal-PicGo-Core/custom.d.ts diff --git a/libs/Universal-PicGo-Core/custom.d.ts b/libs/Universal-PicGo-Core/custom.d.ts new file mode 100644 index 0000000..1a74c95 --- /dev/null +++ b/libs/Universal-PicGo-Core/custom.d.ts @@ -0,0 +1,4 @@ +declare module '*.json' { + const value: { [key: string]: any } + export default value +} \ No newline at end of file diff --git a/libs/Universal-PicGo-Core/src/core/UniversalPicGo.ts b/libs/Universal-PicGo-Core/src/core/UniversalPicGo.ts index d10c6c5..dc3bc94 100644 --- a/libs/Universal-PicGo-Core/src/core/UniversalPicGo.ts +++ b/libs/Universal-PicGo-Core/src/core/UniversalPicGo.ts @@ -210,7 +210,7 @@ class UniversalPicGo extends EventEmitter implements IPicGo { const path = win.require("path") const { homedir } = os if (this.configPath === "") { - this.configPath = homedir() + "/.picgo/config.json" + this.configPath = homedir() + "/.universal-picgo/config.json" } if (path.extname(this.configPath).toUpperCase() !== ".JSON") { this.configPath = "" @@ -223,7 +223,7 @@ class UniversalPicGo extends EventEmitter implements IPicGo { } } else { if (this.configPath === "") { - this.configPath = `picgo-config-${this.VERSION}.json` + this.configPath = `universal-picgo-config.json` } } } diff --git a/libs/Universal-PicGo-Core/tsconfig.json b/libs/Universal-PicGo-Core/tsconfig.json index 9c76f42..691bb5c 100644 --- a/libs/Universal-PicGo-Core/tsconfig.json +++ b/libs/Universal-PicGo-Core/tsconfig.json @@ -33,7 +33,9 @@ "src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", - "src/**/*.vue" + "src/**/*.vue", + "vite.config.ts", + "custom.d.ts" ], "references": [ { diff --git a/libs/Universal-PicGo-Core/vite.config.ts b/libs/Universal-PicGo-Core/vite.config.ts index 0522d73..1f55ba5 100644 --- a/libs/Universal-PicGo-Core/vite.config.ts +++ b/libs/Universal-PicGo-Core/vite.config.ts @@ -1,18 +1,60 @@ /// import { resolve } from "path" -import { defineConfig } from "vite" +import { defineConfig, loadEnv } from "vite" import { viteStaticCopy } from "vite-plugin-static-copy" import dts from "vite-plugin-dts" import minimist from "minimist" import livereload from "rollup-plugin-livereload" import { nodePolyfills } from "vite-plugin-node-polyfills" +import fs from "fs" + +// methods start +const packageJson = fs.readFileSync("./package.json").toString() +const pkg = JSON.parse(packageJson) || {} + +const getAppBase = (): string => { + return "/plugins/siyuan-plugin-picgo/" +} + +const getDefineEnv = (isDevMode: boolean) => { + const mode = process.env.NODE_ENV + const isTest = mode === "test" + console.log("isServe=>", isServe) + console.log("mode=>", mode) + + const defaultEnv = { + DEV_MODE: `${isDevMode || isTest}`, + APP_BASE: `${appBase}`, + NODE_ENV: "development", + PICGO_VERSION: pkg.version, + } + const env = loadEnv(mode, process.cwd()) + const processEnvValues = { + "process.env": Object.entries(env).reduce((prev, [key, val]) => { + return { + ...prev, + [key]: val, + } + }, defaultEnv), + } + const defineEnv = { + ...processEnvValues, + ...{}, + } + console.log("defineEnv=>", defineEnv) + + return defineEnv +} +// methods end const args = minimist(process.argv.slice(2)) +const isServe = process.env.IS_SERVE const isWatch = args.watch || args.w || false +const isDev = isServe || isWatch const devDistDir = "./dist" const distDir = isWatch ? devDistDir : "./dist" -// const distDir = devDistDir +const appBase = getAppBase() console.log("isWatch=>", isWatch) console.log("distDir=>", distDir) @@ -40,6 +82,14 @@ export default defineConfig({ }), ], + base: "", + + // https://github.com/vitejs/vite/issues/1930 + // https://vitejs.dev/guide/env-and-mode.html#env-files + // https://github.com/vitejs/vite/discussions/3058#discussioncomment-2115319 + // 在这里自定义变量 + define: getDefineEnv(isDev), + build: { // 输出路径 outDir: distDir, From def516ba1961e992d7d3ce93af71e3cc67a3622b Mon Sep 17 00:00:00 2001 From: terwer Date: Mon, 18 Mar 2024 14:32:46 +0800 Subject: [PATCH 16/34] feat: add partial i18n support --- libs/Universal-PicGo-Core/package.json | 6 +- .../src/core/UniversalPicGo.ts | 17 ++- libs/Universal-PicGo-Core/src/i18n/en.ts | 118 +++++++++++++++++ libs/Universal-PicGo-Core/src/i18n/index.ts | 123 ++++++++++++++++++ libs/Universal-PicGo-Core/src/i18n/zh-CN.ts | 116 +++++++++++++++++ libs/Universal-PicGo-Core/src/i18n/zh-TW.ts | 115 ++++++++++++++++ .../src/utils/browserUtils.ts | 37 ++++++ pnpm-lock.yaml | 17 ++- 8 files changed, 542 insertions(+), 7 deletions(-) create mode 100644 libs/Universal-PicGo-Core/src/i18n/en.ts create mode 100644 libs/Universal-PicGo-Core/src/i18n/index.ts create mode 100644 libs/Universal-PicGo-Core/src/i18n/zh-CN.ts create mode 100644 libs/Universal-PicGo-Core/src/i18n/zh-TW.ts create mode 100644 libs/Universal-PicGo-Core/src/utils/browserUtils.ts diff --git a/libs/Universal-PicGo-Core/package.json b/libs/Universal-PicGo-Core/package.json index 9a73466..64f2418 100644 --- a/libs/Universal-PicGo-Core/package.json +++ b/libs/Universal-PicGo-Core/package.json @@ -30,8 +30,10 @@ "vite-plugin-node-polyfills": "^0.21.0" }, "dependencies": { - "zhi-lib-base": "^0.8.0", - "universal-picgo-store": "workspace:*" + "@picgo/i18n": "^1.0.0", + "js-yaml": "^4.1.0", + "universal-picgo-store": "workspace:*", + "zhi-lib-base": "^0.8.0" }, "publishConfig": { "access": "public" diff --git a/libs/Universal-PicGo-Core/src/core/UniversalPicGo.ts b/libs/Universal-PicGo-Core/src/core/UniversalPicGo.ts index dc3bc94..235c525 100644 --- a/libs/Universal-PicGo-Core/src/core/UniversalPicGo.ts +++ b/libs/Universal-PicGo-Core/src/core/UniversalPicGo.ts @@ -30,6 +30,8 @@ import { IBuildInEvent } from "../utils/enums" import DB from "../utils/db" import { hasNodeEnv, win } from "universal-picgo-store" import { ensureFileSync, pathExistsSync } from "../utils/nodeUtils" +import { I18nManager } from "../i18n" +import { getBrowserDirectoryPath } from "../utils/browserUtils" /* * 通用 PicGO 对象定义 @@ -223,7 +225,11 @@ class UniversalPicGo extends EventEmitter implements IPicGo { } } else { if (this.configPath === "") { + this.baseDir = "" this.configPath = `universal-picgo-config.json` + } else { + // 模拟 path.dirname 的功能,获取路径的目录部分赋值给 baseDir + this.baseDir = getBrowserDirectoryPath(this.configPath) } } } @@ -233,7 +239,16 @@ class UniversalPicGo extends EventEmitter implements IPicGo { this._config = this.db.read(true) as IConfig } - private init(): void {} + private init(): void { + try { + // init 18n at first + this.i18n = new I18nManager(this) + } catch (e: any) { + this.emit(IBuildInEvent.UPLOAD_PROGRESS, -1) + this.log.error(e) + throw e + } + } } export { UniversalPicGo } diff --git a/libs/Universal-PicGo-Core/src/i18n/en.ts b/libs/Universal-PicGo-Core/src/i18n/en.ts new file mode 100644 index 0000000..11d16d0 --- /dev/null +++ b/libs/Universal-PicGo-Core/src/i18n/en.ts @@ -0,0 +1,118 @@ +import { ILocales } from "./zh-CN" + +/* eslint-disable no-template-curly-in-string */ +export const EN: ILocales = { + UPLOAD_FAILED: "Upload failed", + CHECK_SETTINGS: "Please check your settings", + CHECK_SETTINGS_AND_NETWORK: "Please check your settings and network", + UPLOAD_FAILED_REASON: "Error code: ${code}, please open the browser and paste the address to see the reason", + SERVER_ERROR: "Server error, please try again later", + AUTH_FAILED: "Authentication failed", + + // smms + PICBED_SMMS: "SM.MS", + PICBED_SMMS_TOKEN: "Set Token", + PICBED_SMMS_BACKUP_DOMAIN: "Set Backup Upload Domain", + PICBED_SMMS_MESSAGE_BACKUP_DOMAIN: "Ex. smms.app", + + // Ali-cloud + PICBED_ALICLOUD: "Ali Cloud", + PICBED_ALICLOUD_ACCESSKEYID: "Set KeyId", + PICBED_ALICLOUD_ACCESSKEYSECRET: "Set KeySecret", + PICBED_ALICLOUD_BUCKET: "Set Bucket", + PICBED_ALICLOUD_AREA: "Set Area", + PICBED_ALICLOUD_PATH: "Set Path", + PICBED_ALICLOUD_CUSTOMURL: "Set Custom URL", + PICBED_ALICLOUD_OPTIONS: "Set URL Suffix", + PICBED_ALICLOUD_MESSAGE_AREA: "Ex. oss-cn-beijing", + PICBED_ALICLOUD_MESSAGE_PATH: "Ex. test/", + PICBED_ALICLOUD_MESSAGE_OPTIONS: "Ex. ?x-oss-process=xxx", + PICBED_ALICLOUD_MESSAGE_CUSTOMURL: "Ex. https://test.com", + + // Tencent-cloud + PICBED_TENCENTCLOUD: "Tencent Cloud", + PICBED_TENCENTCLOUD_VERSION: "Choose COS version", + PICBED_TENCENTCLOUD_SECRETID: "Set SecretId", + PICBED_TENCENTCLOUD_SECRETKEY: "Set SecretKey", + PICBED_TENCENTCLOUD_APPID: "Set AppId", + PICBED_TENCENTCLOUD_BUCKET: "Set Bucket", + PICBED_TENCENTCLOUD_AREA: "Set Area", + PICBED_TENCENTCLOUD_ENDPOINT: "Set Endpoint", + PICBED_TENCENTCLOUD_PATH: "Set Path", + PICBED_TENCENTCLOUD_OPTIONS: "Set URL Suffix", + PICBED_TENCENTCLOUD_SLIM: "Set ImageSlim", + PICBED_TENCENTCLOUD_SLIM_TIP: + "Image extremely intelligent compression, please refer to the [document description](https://cloud.tencent.com/document/product/436/49259)", + PICBED_TENCENTCLOUD_SLIM_CONFIRM: "OPEN", + PICBED_TENCENTCLOUD_SLIM_CANCEL: "CLOSE", + PICBED_TENCENTCLOUD_CUSTOMURL: "Set Custom URL", + PICBED_TENCENTCLOUD_MESSAGE_APPID: "Ex. 1234567890", + PICBED_TENCENTCLOUD_MESSAGE_AREA: "Ex. ap-beijing", + PICBED_TENCENTCLOUD_MESSAGE_ENDPOINT: "Ex. cos-internal.accelerate.tencentcos.cn", + PICBED_TENCENTCLOUD_MESSAGE_PATH: "Ex. test/", + PICBED_TENCENTCLOUD_MESSAGE_CUSTOMURL: "Ex. http://test.com", + PICBED_TENCENTCLOUD_MESSAGE_OPTIONS: "Ex. ?imageMogr2", + + // GitHub + PICBED_GITHUB: "GitHub", + PICBED_GITHUB_TOKEN: "Set Token", + PICBED_GITHUB_REPO: "Set Repo Name", + PICBED_GITHUB_PATH: "Set Path", + PICBED_GITHUB_BRANCH: "Set Branch", + PICBED_GITHUB_CUSTOMURL: "Set Custom URL", + PICBED_GITHUB_MESSAGE_REPO: "Ex. username/repo", + PICBED_GITHUB_MESSAGE_BRANCH: "Ex. main", + PICBED_GITHUB_MESSAGE_PATH: "Ex. test/", + PICBED_GITHUB_MESSAGE_CUSTOMURL: "Ex. https://test.com", + + // qiniu + PICBED_QINIU: "Qiniu", + PICBED_QINIU_ACCESSKEY: "Set AccessKey", + PICBED_QINIU_SECRETKEY: "Set SecretKey", + PICBED_QINIU_BUCKET: "Set Bucket", + PICBED_QINIU_PATH: "Set Path", + PICBED_QINIU_URL: "Set URL", + PICBED_QINIU_OPTIONS: "Set URL Suffix", + PICBED_QINIU_AREA: "Set Area", + PICBED_QINIU_MESSAGE_PATH: "Ex. test/", + PICBED_QINIU_MESSAGE_AREA: "Ex. z0", + PICBED_QINIU_MESSAGE_OPTIONS: "Ex. ?imageslim", + PICBED_QINIU_MESSAGE_URL: "Ex. https://xxx.yyy.glb.clouddn.com", + + // imgur + PICBED_IMGUR: "Imgur", + PICBED_IMGUR_CLIENTID: "Set ClientId", + PICBED_IMGUR_PROXY: "Set Proxy", + PICBED_IMGUR_MESSAGE_PROXY: "Ex. http://127.0.0.1:1080", + + // upyun + PICBED_UPYUN: "Upyun", + PICBED_UPYUN_BUCKET: "Set Bucket", + PICBED_UPYUN_OPERATOR: "Set Operator", + PICBED_UPYUN_PASSWORD: "Set Operator Password", + PICBED_UPYUN_PATH: "Set Path", + PICBED_UPYUN_URL: "Set URL", + PICBED_UPYUN_OPTIONS: "Set URL Suffix", + PICBED_UPYUN_MESSAGE_OPERATOR: "Ex. me", + PICBED_UPYUN_MESSAGE_PASSWORD: "Please type the operator password", + PICBED_UPYUN_MESSAGE_URL: "Ex. http://xxx.test.upcdn.net", + PICBED_UPYUN_MESSAGE_OPTIONS: "Ex. !imgslim", + PICBED_UPYUN_MESSAGE_PATH: "Ex. test/", + + // Plugin Handler + PLUGIN_HANDLER_PLUGIN_INSTALL_SUCCESS: "Plugin installed successfully", + PLUGIN_HANDLER_PLUGIN_INSTALL_FAILED: "Plugin installation failed", + PLUGIN_HANDLER_PLUGIN_INSTALL_FAILED_REASON: + "Plugin installation failed, error code is ${code}, error log is \n ${data}", + PLUGIN_HANDLER_PLUGIN_INSTALL_FAILED_PATH: + "Plugin installation failed, please enter a valid plugin name or valid installation path", + PLUGIN_HANDLER_PLUGIN_UNINSTALL_SUCCESS: "Plugin uninstalled successfully", + PLUGIN_HANDLER_PLUGIN_UNINSTALL_FAILED: "Plugin uninstall failed", + PLUGIN_HANDLER_PLUGIN_UNINSTALL_FAILED_REASON: + "Plugin uninstall failed, error code is ${code}, error log is \n ${data}", + PLUGIN_HANDLER_PLUGIN_UNINSTALL_FAILED_VALID: "Plugin uninstall failed, please enter a valid plugin name", + PLUGIN_HANDLER_PLUGIN_UPDATE_SUCCESS: "Plugin updated successfully", + PLUGIN_HANDLER_PLUGIN_UPDATE_FAILED: "Plugin update failed", + PLUGIN_HANDLER_PLUGIN_UPDATE_FAILED_REASON: "Plugin update failed, error code is ${code}, error log is \n ${data}", + PLUGIN_HANDLER_PLUGIN_UPDATE_FAILED_VALID: "Plugin update failed, please enter a valid plugin name", +} diff --git a/libs/Universal-PicGo-Core/src/i18n/index.ts b/libs/Universal-PicGo-Core/src/i18n/index.ts new file mode 100644 index 0000000..2503880 --- /dev/null +++ b/libs/Universal-PicGo-Core/src/i18n/index.ts @@ -0,0 +1,123 @@ +/* + * GNU GENERAL PUBLIC LICENSE + * Version 3, 29 June 2007 + * + * Copyright (C) 2024 Terwer, Inc. + * Everyone is permitted to copy and distribute verbatim copies + * of this license document, but changing it is not allowed. + */ + +import { II18nManager, ILocale, IPicGo, IStringKeyMap } from "../types" +import { ObjectAdapter, I18n } from "@picgo/i18n" +import { ZH_CN, ILocalesKey, ILocales } from "./zh-CN" +import { EN } from "./en" +import { ZH_TW } from "./zh-TW" +import yaml from "js-yaml" +import _ from "lodash-es" +import { hasNodeEnv, win } from "universal-picgo-store" +import { ensureFileSync, pathExistsSync } from "../utils/nodeUtils" +import { browserPathJoin } from "../utils/browserUtils" + +const languageList: IStringKeyMap> = { + "zh-CN": ZH_CN, + "zh-TW": ZH_TW, + en: EN, +} + +class I18nManager implements II18nManager { + private readonly i18n: I18n + private readonly objectAdapter: ObjectAdapter + private readonly ctx: IPicGo + constructor(ctx: IPicGo) { + this.ctx = ctx + this.objectAdapter = new ObjectAdapter(languageList) + let language = this.ctx.getConfig("settings.language") || "zh-CN" + if (!languageList[language]) { + language = "zh-CN" // use default + } + this.i18n = new I18n({ + adapter: this.objectAdapter, + defaultLanguage: language, + }) + this.loadOutterI18n() + } + + translate(key: ILocalesKey | T, args?: IStringKeyMap): string { + return this.i18n.translate(key, args) || key + } + + setLanguage(language: string): void { + this.i18n.setLanguage(language) + this.ctx.saveConfig({ + "settings.language": language, + }) + } + + addLocale(language: string, locales: ILocale): boolean { + const originLocales = this.objectAdapter.getLocale(language) + if (!originLocales) { + return false + } + const newLocales = _.merge(originLocales, locales) + this.objectAdapter.setLocale(language, newLocales) + return true + } + + addLanguage(language: string, locales: ILocale): boolean { + const originLocales = this.objectAdapter.getLocale(language) + if (originLocales) { + return false + } + this.objectAdapter.setLocale(language, locales) + languageList[language] = locales + return true + } + + getLanguageList(): string[] { + return Object.keys(languageList) + } + + // =================================================================================================================== + private getOutterI18nFolder(): string { + let i18nFolder: string + if (hasNodeEnv) { + const fs = win.fs + const path = win.require("path") + i18nFolder = path.join(this.ctx.baseDir, "i18n-cli") + if (!pathExistsSync(fs, path, i18nFolder)) { + ensureFileSync(fs, path, i18nFolder) + } + } else { + i18nFolder = browserPathJoin(this.ctx.baseDir, "i18n-cli") + } + + return i18nFolder + } + + private loadOutterI18n(): void { + const i18nFolder = this.getOutterI18nFolder() + if (hasNodeEnv) { + const fs = win.fs + const path = win.require("path") + const files = fs.readdirSync(i18nFolder, { + withFileTypes: true, + }) + files.forEach((file: any) => { + if (file.isFile() && file.name.endsWith(".yml")) { + const i18nFilePath = path.join(i18nFolder, file.name) + const i18nFile = fs.readFileSync(i18nFilePath, "utf8") + try { + const i18nFileObj = yaml.load(i18nFile) as ILocales + languageList[file.name.replace(/\.yml$/, "")] = i18nFileObj + } catch (e) { + console.error(e) + } + } + }) + } else { + throw new Error("load outer i18n is not support in browser") + } + } +} + +export { I18nManager } diff --git a/libs/Universal-PicGo-Core/src/i18n/zh-CN.ts b/libs/Universal-PicGo-Core/src/i18n/zh-CN.ts new file mode 100644 index 0000000..de17fe5 --- /dev/null +++ b/libs/Universal-PicGo-Core/src/i18n/zh-CN.ts @@ -0,0 +1,116 @@ +/* eslint-disable no-template-curly-in-string */ +export const ZH_CN = { + UPLOAD_FAILED: "上传失败", + CHECK_SETTINGS: "请检查你的配置项是否正确", + CHECK_SETTINGS_AND_NETWORK: "请检查你的配置项以及网络", + UPLOAD_FAILED_REASON: "错误码:${code},请打开浏览器粘贴地址查看相关原因", + SERVER_ERROR: "服务端出错,请重试", + AUTH_FAILED: "认证失败", + + // smms + PICBED_SMMS: "SM.MS", + PICBED_SMMS_TOKEN: "设定Token", + PICBED_SMMS_BACKUP_DOMAIN: "备用上传域名", + PICBED_SMMS_MESSAGE_BACKUP_DOMAIN: "例如 smms.app", + + // Ali-cloud + PICBED_ALICLOUD: "阿里云OSS", + PICBED_ALICLOUD_ACCESSKEYID: "设定KeyId", + PICBED_ALICLOUD_ACCESSKEYSECRET: "设定KeySecret", + PICBED_ALICLOUD_BUCKET: "设定Bucket", + PICBED_ALICLOUD_AREA: "设定存储区域", + PICBED_ALICLOUD_PATH: "设定存储路径", + PICBED_ALICLOUD_CUSTOMURL: "设定自定义域名", + PICBED_ALICLOUD_OPTIONS: "设定网址后缀", + PICBED_ALICLOUD_MESSAGE_AREA: "例如:oss-cn-beijing", + PICBED_ALICLOUD_MESSAGE_PATH: "例如:test/", + PICBED_ALICLOUD_MESSAGE_OPTIONS: "例如:?x-oss-process=xxx", + PICBED_ALICLOUD_MESSAGE_CUSTOMURL: "例如:https://test.com", + + // Tencent-cloud + PICBED_TENCENTCLOUD: "腾讯云COS", + PICBED_TENCENTCLOUD_VERSION: "COS版本", + PICBED_TENCENTCLOUD_SECRETID: "设定SecretId", + PICBED_TENCENTCLOUD_SECRETKEY: "设定SecretKey", + PICBED_TENCENTCLOUD_APPID: "设定AppId", + PICBED_TENCENTCLOUD_BUCKET: "设定Bucket", + PICBED_TENCENTCLOUD_AREA: "设定存储区域", + PICBED_TENCENTCLOUD_ENDPOINT: "设定Endpoint", + PICBED_TENCENTCLOUD_PATH: "设定存储路径", + PICBED_TENCENTCLOUD_OPTIONS: "设定网址后缀", + PICBED_TENCENTCLOUD_CUSTOMURL: "设定自定义域名", + PICBED_TENCENTCLOUD_SLIM: "极智压缩", + PICBED_TENCENTCLOUD_SLIM_TIP: + "图片极智压缩,详情请参考[文档说明](https://cloud.tencent.com/document/product/436/49259)", + PICBED_TENCENTCLOUD_SLIM_CONFIRM: "开启", + PICBED_TENCENTCLOUD_SLIM_CANCEL: "关闭", + PICBED_TENCENTCLOUD_MESSAGE_APPID: "例如:1234567890", + PICBED_TENCENTCLOUD_MESSAGE_AREA: "例如:ap-beijing", + PICBED_TENCENTCLOUD_MESSAGE_ENDPOINT: "例如:cos-internal.accelerate.tencentcos.cn", + PICBED_TENCENTCLOUD_MESSAGE_PATH: "例如:test/", + PICBED_TENCENTCLOUD_MESSAGE_CUSTOMURL: "例如:https://test.com", + PICBED_TENCENTCLOUD_MESSAGE_OPTIONS: "例如:?imageMogr2", + + // GitHub + PICBED_GITHUB: "GitHub", + PICBED_GITHUB_TOKEN: "设定Token", + PICBED_GITHUB_REPO: "设定仓库名", + PICBED_GITHUB_PATH: "设定存储路径", + PICBED_GITHUB_BRANCH: "设定分支名", + PICBED_GITHUB_CUSTOMURL: "设定自定义域名", + PICBED_GITHUB_MESSAGE_REPO: "格式:username/repo", + PICBED_GITHUB_MESSAGE_BRANCH: "例如:main", + PICBED_GITHUB_MESSAGE_PATH: "例如:test/", + PICBED_GITHUB_MESSAGE_CUSTOMURL: "例如:https://test.com", + + // qiniu + PICBED_QINIU: "七牛云", + PICBED_QINIU_ACCESSKEY: "设定AccessKey", + PICBED_QINIU_SECRETKEY: "设定SecretKey", + PICBED_QINIU_BUCKET: "设定Bucket", + PICBED_QINIU_PATH: "设定存储路径", + PICBED_QINIU_URL: "设定访问网址", + PICBED_QINIU_OPTIONS: "设定网址后缀", + PICBED_QINIU_AREA: "设定存储区域", + PICBED_QINIU_MESSAGE_PATH: "例如:test/", + PICBED_QINIU_MESSAGE_AREA: "例如:z0", + PICBED_QINIU_MESSAGE_OPTIONS: "例如:?imageslim", + PICBED_QINIU_MESSAGE_URL: "例如:https://xxx.yyy.glb.clouddn.com", + + // imgur + PICBED_IMGUR: "Imgur", + PICBED_IMGUR_CLIENTID: "设定ClientId", + PICBED_IMGUR_PROXY: "设定代理", + PICBED_IMGUR_MESSAGE_PROXY: "例如:http://127.0.0.1:1080", + + // upyun + PICBED_UPYUN: "又拍云", + PICBED_UPYUN_BUCKET: "设定Bucket", + PICBED_UPYUN_OPERATOR: "设定操作员", + PICBED_UPYUN_PASSWORD: "设定操作员密码", + PICBED_UPYUN_PATH: "设定存储路径", + PICBED_UPYUN_URL: "设定加速域名", + PICBED_UPYUN_OPTIONS: "设定网址后缀", + PICBED_UPYUN_MESSAGE_OPERATOR: "例如:me", + PICBED_UPYUN_MESSAGE_PASSWORD: "输入操作员密码", + PICBED_UPYUN_MESSAGE_URL: "例如:http://xxx.test.upcdn.net", + PICBED_UPYUN_MESSAGE_OPTIONS: "例如:!imgslim", + PICBED_UPYUN_MESSAGE_PATH: "例如:test/", + + // Plugin Handler + PLUGIN_HANDLER_PLUGIN_INSTALL_SUCCESS: "插件安装成功", + PLUGIN_HANDLER_PLUGIN_INSTALL_FAILED: "插件安装失败", + PLUGIN_HANDLER_PLUGIN_INSTALL_FAILED_REASON: "插件安装失败,失败码为${code},错误日志为 \n ${data}", + PLUGIN_HANDLER_PLUGIN_INSTALL_FAILED_PATH: "插件安装失败,请输入合法插件名或合法安装路径", + PLUGIN_HANDLER_PLUGIN_UNINSTALL_SUCCESS: "插件卸载成功", + PLUGIN_HANDLER_PLUGIN_UNINSTALL_FAILED: "插件卸载失败", + PLUGIN_HANDLER_PLUGIN_UNINSTALL_FAILED_REASON: "插件卸载失败,失败码为${code},错误日志为 \n ${data}", + PLUGIN_HANDLER_PLUGIN_UNINSTALL_FAILED_VALID: "插件卸载失败,请输入合法插件名", + PLUGIN_HANDLER_PLUGIN_UPDATE_SUCCESS: "插件更新成功", + PLUGIN_HANDLER_PLUGIN_UPDATE_FAILED: "插件更新失败", + PLUGIN_HANDLER_PLUGIN_UPDATE_FAILED_REASON: "插件更新失败,失败码为${code},错误日志为 \n ${data}", + PLUGIN_HANDLER_PLUGIN_UPDATE_FAILED_VALID: "插件更新失败,请输入合法插件名", +} + +export type ILocalesKey = keyof typeof ZH_CN +export type ILocales = typeof ZH_CN diff --git a/libs/Universal-PicGo-Core/src/i18n/zh-TW.ts b/libs/Universal-PicGo-Core/src/i18n/zh-TW.ts new file mode 100644 index 0000000..ff7f667 --- /dev/null +++ b/libs/Universal-PicGo-Core/src/i18n/zh-TW.ts @@ -0,0 +1,115 @@ +import { ILocales } from "./zh-CN" + +/* eslint-disable no-template-curly-in-string */ +export const ZH_TW: ILocales = { + UPLOAD_FAILED: "上傳失敗", + CHECK_SETTINGS: "請檢查你的設定是否正確", + CHECK_SETTINGS_AND_NETWORK: "請檢查你的設定及網路", + UPLOAD_FAILED_REASON: "錯誤碼:${code},請打開瀏覽器貼上地址查看相關原因", + SERVER_ERROR: "伺服器出錯,請重試", + AUTH_FAILED: "認證失敗", + + // smms + PICBED_SMMS: "SM.MS", + PICBED_SMMS_TOKEN: "設定Token", + PICBED_SMMS_BACKUP_DOMAIN: "備用上傳網址", + PICBED_SMMS_MESSAGE_BACKUP_DOMAIN: "例如 smms.app", + + // Ali-cloud + PICBED_ALICLOUD: "阿里云OSS", + PICBED_ALICLOUD_ACCESSKEYID: "設定KeyId", + PICBED_ALICLOUD_ACCESSKEYSECRET: "設定KeySecret", + PICBED_ALICLOUD_BUCKET: "設定Bucket", + PICBED_ALICLOUD_AREA: "設定儲存區域", + PICBED_ALICLOUD_PATH: "設定儲存路徑", + PICBED_ALICLOUD_CUSTOMURL: "設定自訂網址", + PICBED_ALICLOUD_OPTIONS: "設定網址後綴", + PICBED_ALICLOUD_MESSAGE_AREA: "例如:oss-cn-beijing", + PICBED_ALICLOUD_MESSAGE_PATH: "例如:test/", + PICBED_ALICLOUD_MESSAGE_OPTIONS: "例如:?x-oss-process=xxx", + PICBED_ALICLOUD_MESSAGE_CUSTOMURL: "例如:https://test.com", + + // Tencent-cloud + PICBED_TENCENTCLOUD: "騰訊云COS", + PICBED_TENCENTCLOUD_VERSION: "COS版本", + PICBED_TENCENTCLOUD_SECRETID: "設定SecretId", + PICBED_TENCENTCLOUD_SECRETKEY: "設定SecretKey", + PICBED_TENCENTCLOUD_APPID: "設定AppId", + PICBED_TENCENTCLOUD_BUCKET: "設定Bucket", + PICBED_TENCENTCLOUD_AREA: "設定儲存區域", + PICBED_TENCENTCLOUD_ENDPOINT: "設定Endpoint", + PICBED_TENCENTCLOUD_PATH: "設定儲存路徑", + PICBED_TENCENTCLOUD_OPTIONS: "設定網址後綴", + PICBED_TENCENTCLOUD_SLIM: "極智壓縮", + PICBED_TENCENTCLOUD_SLIM_CANCEL: "關閉", + PICBED_TENCENTCLOUD_SLIM_CONFIRM: "開啓", + PICBED_TENCENTCLOUD_SLIM_TIP: + "圖片極智壓縮,詳情請參考[文檔說明](https://cloud.tencent.com/document/product/436/49259)", + PICBED_TENCENTCLOUD_CUSTOMURL: "設定自訂網址", + PICBED_TENCENTCLOUD_MESSAGE_APPID: "例如:1234567890", + PICBED_TENCENTCLOUD_MESSAGE_AREA: "例如:ap-beijing", + PICBED_TENCENTCLOUD_MESSAGE_ENDPOINT: "例如:cos-internal.accelerate.tencentcos.cn", + PICBED_TENCENTCLOUD_MESSAGE_PATH: "例如:test/", + PICBED_TENCENTCLOUD_MESSAGE_CUSTOMURL: "例如:https://test.com", + PICBED_TENCENTCLOUD_MESSAGE_OPTIONS: "例如:?imageMogr2", + + // GitHub + PICBED_GITHUB: "GitHub", + PICBED_GITHUB_TOKEN: "設定Token", + PICBED_GITHUB_REPO: "設定倉庫名稱", + PICBED_GITHUB_PATH: "設定儲存路徑", + PICBED_GITHUB_BRANCH: "設定分支名稱", + PICBED_GITHUB_CUSTOMURL: "設定自訂網址", + PICBED_GITHUB_MESSAGE_REPO: "格式:username/repo", + PICBED_GITHUB_MESSAGE_BRANCH: "例如:main", + PICBED_GITHUB_MESSAGE_PATH: "例如:test/", + PICBED_GITHUB_MESSAGE_CUSTOMURL: "例如:https://test.com", + + // qiniu + PICBED_QINIU: "七牛云", + PICBED_QINIU_ACCESSKEY: "設定AccessKey", + PICBED_QINIU_SECRETKEY: "設定SecretKey", + PICBED_QINIU_BUCKET: "設定Bucket", + PICBED_QINIU_PATH: "設定儲存路徑", + PICBED_QINIU_URL: "設定訪問網址", + PICBED_QINIU_OPTIONS: "設定網址後綴", + PICBED_QINIU_AREA: "設定儲存區域", + PICBED_QINIU_MESSAGE_PATH: "例如:test/", + PICBED_QINIU_MESSAGE_AREA: "例如:z0", + PICBED_QINIU_MESSAGE_OPTIONS: "例如:?imageslim", + PICBED_QINIU_MESSAGE_URL: "例如:https://xxx.yyy.glb.clouddn.com", + + // imgur + PICBED_IMGUR: "Imgur", + PICBED_IMGUR_CLIENTID: "設定ClientId", + PICBED_IMGUR_PROXY: "設定PROXY", + PICBED_IMGUR_MESSAGE_PROXY: "例如:http://127.0.0.1:1080", + + // upyun + PICBED_UPYUN: "又拍云", + PICBED_UPYUN_BUCKET: "設定Bucket", + PICBED_UPYUN_OPERATOR: "設定操作員", + PICBED_UPYUN_PASSWORD: "設定操作員密碼", + PICBED_UPYUN_PATH: "設定儲存路徑", + PICBED_UPYUN_URL: "設定加速網址", + PICBED_UPYUN_OPTIONS: "設定網址後綴", + PICBED_UPYUN_MESSAGE_OPERATOR: "例如:me", + PICBED_UPYUN_MESSAGE_PASSWORD: "輸入操作員密碼", + PICBED_UPYUN_MESSAGE_URL: "例如:http://xxx.test.upcdn.net", + PICBED_UPYUN_MESSAGE_OPTIONS: "例如:!imgslim", + PICBED_UPYUN_MESSAGE_PATH: "例如:test/", + + // Plugin Handler + PLUGIN_HANDLER_PLUGIN_INSTALL_SUCCESS: "插件安裝成功", + PLUGIN_HANDLER_PLUGIN_INSTALL_FAILED: "插件安裝失敗", + PLUGIN_HANDLER_PLUGIN_INSTALL_FAILED_REASON: "插件安裝失敗,失敗碼為${code},錯誤紀錄為 \n ${data}", + PLUGIN_HANDLER_PLUGIN_INSTALL_FAILED_PATH: "插件安裝失敗,請輸入正確的插件名稱或正確的安裝路徑", + PLUGIN_HANDLER_PLUGIN_UNINSTALL_SUCCESS: "插件卸載成功", + PLUGIN_HANDLER_PLUGIN_UNINSTALL_FAILED: "插件卸載失敗", + PLUGIN_HANDLER_PLUGIN_UNINSTALL_FAILED_REASON: "插件卸載失敗,失敗碼為${code},錯誤紀錄為 \n ${data}", + PLUGIN_HANDLER_PLUGIN_UNINSTALL_FAILED_VALID: "插件卸載失敗,請輸入正確的插件名稱", + PLUGIN_HANDLER_PLUGIN_UPDATE_SUCCESS: "插件更新成功", + PLUGIN_HANDLER_PLUGIN_UPDATE_FAILED: "插件更新失敗", + PLUGIN_HANDLER_PLUGIN_UPDATE_FAILED_REASON: "插件更新失敗,失敗碼為${code},錯誤紀錄為 \n ${data}", + PLUGIN_HANDLER_PLUGIN_UPDATE_FAILED_VALID: "插件更新失敗,請輸入正確的插件名稱", +} diff --git a/libs/Universal-PicGo-Core/src/utils/browserUtils.ts b/libs/Universal-PicGo-Core/src/utils/browserUtils.ts new file mode 100644 index 0000000..0919eb6 --- /dev/null +++ b/libs/Universal-PicGo-Core/src/utils/browserUtils.ts @@ -0,0 +1,37 @@ +/* + * GNU GENERAL PUBLIC LICENSE + * Version 3, 29 June 2007 + * + * Copyright (C) 2024 Terwer, Inc. + * Everyone is permitted to copy and distribute verbatim copies + * of this license document, but changing it is not allowed. + */ + +/** + * 获取浏览器目录 + * + * @param path 完整的路径 + */ +export const getBrowserDirectoryPath = (path: string) => { + const parts = path.split("/") + parts.pop() + return parts.join("/") +} + +/** + * 浏览器路径拼接 + * + * @param paths 路径数组 + */ +export const browserPathJoin = (...paths: string[]) => { + // 过滤掉空路径 + const filteredPaths = paths.filter((path) => path && path.trim() !== "") + + // 使用斜杠连接路径 + const joinedPath = filteredPaths.join("/") + + // 处理多余的斜杠 + const normalizedPath = joinedPath.replace(/\/{2,}/g, "/") + + return normalizedPath +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f351601..769df4a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -20,6 +20,12 @@ importers: libs/Universal-PicGo-Core: dependencies: + '@picgo/i18n': + specifier: ^1.0.0 + version: 1.0.0 + js-yaml: + specifier: ^4.1.0 + version: 4.1.0 universal-picgo-store: specifier: workspace:* version: link:../Universal-PicGo-Store @@ -1246,6 +1252,13 @@ packages: - supports-color dev: true + /@picgo/i18n@1.0.0: + resolution: {integrity: sha512-D0fqwox9AZ1pnvgFqBKQe+16U08FkPLnUW1wQSBEdn+EvI48IC3jIWDTZd1MSQzXeODnh/w4eAiUyARrf2Hzig==} + dependencies: + chalk: 4.1.2 + tslib: 2.6.2 + dev: false + /@pkgr/core@0.1.1: resolution: {integrity: sha512-cq8o4cWH0ibXh9VGi5P20Tu9XF/0fFXl9EUinr9QfTM7a7p0oTA4iJRCQWppXR1Pg8dSM0UCItCkPwsk9qWWYA==} engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0} @@ -2728,7 +2741,6 @@ packages: dependencies: ansi-styles: 4.3.0 supports-color: 7.2.0 - dev: true /chalk@5.3.0: resolution: {integrity: sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==} @@ -4167,7 +4179,6 @@ packages: /has-flag@4.0.0: resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} engines: {node: '>=8'} - dev: true /has-own-prop@2.0.0: resolution: {integrity: sha512-Pq0h+hvsVm6dDEa8x82GnLSYHOzNDt7f0ddFa3FqcQlgzEiptPqL+XrOJNavjOzSYiYWIrgeVYYgGlLmnxwilQ==} @@ -6331,7 +6342,6 @@ packages: engines: {node: '>=8'} dependencies: has-flag: 4.0.0 - dev: true /supports-color@8.1.1: resolution: {integrity: sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==} @@ -6581,7 +6591,6 @@ packages: /tslib@2.6.2: resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} - dev: true /tsutils@3.21.0(typescript@4.9.5): resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} From 17da0861d9b41ef4db42f43f706726a08004982e Mon Sep 17 00:00:00 2001 From: terwer Date: Mon, 18 Mar 2024 15:04:54 +0800 Subject: [PATCH 17/34] feat: support browser i18n --- .../src/i18n/browserI18nDb.ts | 59 +++++++++++++++++++ libs/Universal-PicGo-Core/src/i18n/index.ts | 28 +++++++-- .../Universal-PicGo-Core/src/types/index.d.ts | 11 ++++ 3 files changed, 92 insertions(+), 6 deletions(-) create mode 100644 libs/Universal-PicGo-Core/src/i18n/browserI18nDb.ts diff --git a/libs/Universal-PicGo-Core/src/i18n/browserI18nDb.ts b/libs/Universal-PicGo-Core/src/i18n/browserI18nDb.ts new file mode 100644 index 0000000..3330f46 --- /dev/null +++ b/libs/Universal-PicGo-Core/src/i18n/browserI18nDb.ts @@ -0,0 +1,59 @@ +/* + * GNU GENERAL PUBLIC LICENSE + * Version 3, 29 June 2007 + * + * Copyright (C) 2024 Terwer, Inc. + * Everyone is permitted to copy and distribute verbatim copies + * of this license document, but changing it is not allowed. + */ + +import { IBrowserLocal, IPicGo } from "../types" +import { IJSON, JSONStore } from "universal-picgo-store" +import _ from "lodash-es" +import { browserPathJoin } from "../utils/browserUtils" + +class BrowserI18nDb { + private readonly ctx: IPicGo + private readonly db: JSONStore + private readonly hasRead!: boolean + private readonly i18nKey = "i18n" + + constructor(ctx: IPicGo) { + this.ctx = ctx + const browserI18nForder = browserPathJoin(this.ctx.baseDir, "picgo-i18n-cli") + this.db = new JSONStore(browserI18nForder) + + if (!this.db.has(this.i18nKey)) { + try { + this.db.set(this.i18nKey, []) + } catch (e: any) { + this.ctx.log.error(e) + throw e + } + } + } + + read(flush?: boolean): IBrowserLocal[] { + const i18n = this.db.read(flush) + return _.get(i18n, this.i18nKey) + } + + unset(): boolean { + this.read(true) + return this.db.unset(this.i18nKey, []) + } + + get(key: ""): any { + throw new Error("get is not supported by BrowserI18nDb") + } + + set(key: string, value: any): void { + throw new Error("set is not supported by BrowserI18nDb") + } + + has(key: string): boolean { + throw new Error("has is not supported by BrowserI18nDb") + } +} + +export default BrowserI18nDb diff --git a/libs/Universal-PicGo-Core/src/i18n/index.ts b/libs/Universal-PicGo-Core/src/i18n/index.ts index 2503880..30e879c 100644 --- a/libs/Universal-PicGo-Core/src/i18n/index.ts +++ b/libs/Universal-PicGo-Core/src/i18n/index.ts @@ -7,9 +7,9 @@ * of this license document, but changing it is not allowed. */ -import { II18nManager, ILocale, IPicGo, IStringKeyMap } from "../types" -import { ObjectAdapter, I18n } from "@picgo/i18n" -import { ZH_CN, ILocalesKey, ILocales } from "./zh-CN" +import { IBrowserLocal, II18nManager, ILocale, IPicGo, IStringKeyMap } from "../types" +import { I18n, ObjectAdapter } from "@picgo/i18n" +import { ILocales, ILocalesKey, ZH_CN } from "./zh-CN" import { EN } from "./en" import { ZH_TW } from "./zh-TW" import yaml from "js-yaml" @@ -17,6 +17,7 @@ import _ from "lodash-es" import { hasNodeEnv, win } from "universal-picgo-store" import { ensureFileSync, pathExistsSync } from "../utils/nodeUtils" import { browserPathJoin } from "../utils/browserUtils" +import BrowserI18nDb from "./browserI18nDb" const languageList: IStringKeyMap> = { "zh-CN": ZH_CN, @@ -28,8 +29,13 @@ class I18nManager implements II18nManager { private readonly i18n: I18n private readonly objectAdapter: ObjectAdapter private readonly ctx: IPicGo + private readonly browserI18nDb?: BrowserI18nDb + constructor(ctx: IPicGo) { this.ctx = ctx + if (!hasNodeEnv) { + this.browserI18nDb = new BrowserI18nDb(this.ctx) + } this.objectAdapter = new ObjectAdapter(languageList) let language = this.ctx.getConfig("settings.language") || "zh-CN" if (!languageList[language]) { @@ -88,17 +94,17 @@ class I18nManager implements II18nManager { ensureFileSync(fs, path, i18nFolder) } } else { - i18nFolder = browserPathJoin(this.ctx.baseDir, "i18n-cli") + i18nFolder = browserPathJoin(this.ctx.baseDir, "picgo-i18n-cli") } return i18nFolder } private loadOutterI18n(): void { - const i18nFolder = this.getOutterI18nFolder() if (hasNodeEnv) { const fs = win.fs const path = win.require("path") + const i18nFolder = this.getOutterI18nFolder() const files = fs.readdirSync(i18nFolder, { withFileTypes: true, }) @@ -115,7 +121,17 @@ class I18nManager implements II18nManager { } }) } else { - throw new Error("load outer i18n is not support in browser") + // "i18n": [ + // { + // name: "zh-CN", + // yaml: "---ILocales str---", + // } + // ] + const i18ns = this.browserI18nDb?.read() ?? [] + i18ns.forEach((i18n: IBrowserLocal) => { + const i18nFileObj = yaml.load(i18n.yaml) as ILocales + languageList[i18n.name] = i18nFileObj + }) } } } diff --git a/libs/Universal-PicGo-Core/src/types/index.d.ts b/libs/Universal-PicGo-Core/src/types/index.d.ts index 5b31763..e52bc32 100644 --- a/libs/Universal-PicGo-Core/src/types/index.d.ts +++ b/libs/Universal-PicGo-Core/src/types/index.d.ts @@ -224,6 +224,17 @@ export interface ILocale { [key: string]: any } +export interface IBrowserLocal { + /** + * local name + */ + name: string; + /** + * local string in yaml format + */ + yaml: string; +} + /** * for uploading image info */ From 5c0c623072b2813acbf9e45380a86812acddcac1 Mon Sep 17 00:00:00 2001 From: terwer Date: Mon, 18 Mar 2024 15:45:47 +0800 Subject: [PATCH 18/34] feat: add plugin db support --- .../src/core/UniversalPicGo.ts | 52 ++--- .../src/{i18n => db}/browserI18nDb.ts | 25 ++- .../src/db/browserPluginLoderDb.ts | 84 ++++++++ .../src/{utils => db}/db.ts | 45 +++-- libs/Universal-PicGo-Core/src/i18n/index.ts | 2 +- .../src/lib/PluginLoader.ts | 37 +++- .../Universal-PicGo-Core/src/types/index.d.ts | 14 ++ libs/Universal-PicGo-Core/src/utils/common.ts | 181 ++++++++++++++++++ 8 files changed, 384 insertions(+), 56 deletions(-) rename libs/Universal-PicGo-Core/src/{i18n => db}/browserI18nDb.ts (80%) create mode 100644 libs/Universal-PicGo-Core/src/db/browserPluginLoderDb.ts rename libs/Universal-PicGo-Core/src/{utils => db}/db.ts (64%) create mode 100644 libs/Universal-PicGo-Core/src/utils/common.ts diff --git a/libs/Universal-PicGo-Core/src/core/UniversalPicGo.ts b/libs/Universal-PicGo-Core/src/core/UniversalPicGo.ts index 235c525..65c3932 100644 --- a/libs/Universal-PicGo-Core/src/core/UniversalPicGo.ts +++ b/libs/Universal-PicGo-Core/src/core/UniversalPicGo.ts @@ -27,11 +27,12 @@ import { PluginHandler } from "../lib/PluginHandler" import _ from "lodash-es" import getClipboardImage from "../utils/getClipboardImage" import { IBuildInEvent } from "../utils/enums" -import DB from "../utils/db" +import DB from "../db/db" import { hasNodeEnv, win } from "universal-picgo-store" import { ensureFileSync, pathExistsSync } from "../utils/nodeUtils" import { I18nManager } from "../i18n" -import { getBrowserDirectoryPath } from "../utils/browserUtils" +import { browserPathJoin, getBrowserDirectoryPath } from "../utils/browserUtils" +import { isConfigKeyInBlackList, isInputConfigValid } from "../utils/common" /* * 通用 PicGO 对象定义 @@ -114,35 +115,35 @@ class UniversalPicGo extends EventEmitter implements IPicGo { } saveConfig(config: IStringKeyMap): void { - // if (!isInputConfigValid(config)) { - // this.log.warn("the format of config is invalid, please provide object") - // return - // } + if (!isInputConfigValid(config)) { + this.log.warn("the format of config is invalid, please provide object") + return + } this.setConfig(config) this.db.saveConfig(config) } removeConfig(key: string, propName: string): void { if (!key || !propName) return - // if (isConfigKeyInBlackList(key)) { - // this.log.warn(`the config.${key} can't be removed`) - // return - // } + if (isConfigKeyInBlackList(key)) { + this.log.warn(`the config.${key} can't be removed`) + return + } this.unsetConfig(key, propName) this.db.unset(key, propName) } setConfig(config: IStringKeyMap): void { - // if (!isInputConfigValid(config)) { - // this.log.warn("the format of config is invalid, please provide object") - // return - // } + if (!isInputConfigValid(config)) { + this.log.warn("the format of config is invalid, please provide object") + return + } Object.keys(config).forEach((name: string) => { - // if (isConfigKeyInBlackList(name)) { - // this.log.warn(`the config.${name} can't be modified`) - // // eslint-disable-next-line @typescript-eslint/no-dynamic-delete - // delete config[name] - // } + if (isConfigKeyInBlackList(name)) { + this.log.warn(`the config.${name} can't be modified`) + // eslint-disable-next-line @typescript-eslint/no-dynamic-delete + delete config[name] + } _.set(this._config, name, config[name]) // eventBus.emit(IBusEvent.CONFIG_CHANGE, { // configName: name, @@ -153,10 +154,10 @@ class UniversalPicGo extends EventEmitter implements IPicGo { unsetConfig(key: string, propName: string): void { if (!key || !propName) return - // if (isConfigKeyInBlackList(key)) { - // this.log.warn(`the config.${key} can't be unset`) - // return - // } + if (isConfigKeyInBlackList(key)) { + this.log.warn(`the config.${key} can't be unset`) + return + } _.unset(this.getConfig(key), propName) } @@ -225,8 +226,8 @@ class UniversalPicGo extends EventEmitter implements IPicGo { } } else { if (this.configPath === "") { - this.baseDir = "" - this.configPath = `universal-picgo-config.json` + this.baseDir = "universal-picgo" + this.configPath = browserPathJoin(this.baseDir, "config.json") } else { // 模拟 path.dirname 的功能,获取路径的目录部分赋值给 baseDir this.baseDir = getBrowserDirectoryPath(this.configPath) @@ -243,6 +244,7 @@ class UniversalPicGo extends EventEmitter implements IPicGo { try { // init 18n at first this.i18n = new I18nManager(this) + this._pluginLoader = new PluginLoader(this) } catch (e: any) { this.emit(IBuildInEvent.UPLOAD_PROGRESS, -1) this.log.error(e) diff --git a/libs/Universal-PicGo-Core/src/i18n/browserI18nDb.ts b/libs/Universal-PicGo-Core/src/db/browserI18nDb.ts similarity index 80% rename from libs/Universal-PicGo-Core/src/i18n/browserI18nDb.ts rename to libs/Universal-PicGo-Core/src/db/browserI18nDb.ts index 3330f46..87b423d 100644 --- a/libs/Universal-PicGo-Core/src/i18n/browserI18nDb.ts +++ b/libs/Universal-PicGo-Core/src/db/browserI18nDb.ts @@ -8,7 +8,7 @@ */ import { IBrowserLocal, IPicGo } from "../types" -import { IJSON, JSONStore } from "universal-picgo-store" +import { JSONStore } from "universal-picgo-store" import _ from "lodash-es" import { browserPathJoin } from "../utils/browserUtils" @@ -20,17 +20,10 @@ class BrowserI18nDb { constructor(ctx: IPicGo) { this.ctx = ctx - const browserI18nForder = browserPathJoin(this.ctx.baseDir, "picgo-i18n-cli") + const browserI18nForder = browserPathJoin(this.ctx.baseDir, "i18n-cli") this.db = new JSONStore(browserI18nForder) - if (!this.db.has(this.i18nKey)) { - try { - this.db.set(this.i18nKey, []) - } catch (e: any) { - this.ctx.log.error(e) - throw e - } - } + this.safeSet(this.i18nKey, []) } read(flush?: boolean): IBrowserLocal[] { @@ -54,6 +47,18 @@ class BrowserI18nDb { has(key: string): boolean { throw new Error("has is not supported by BrowserI18nDb") } + + // =================================================================================================================== + safeSet(key: string, value: any) { + if (!this.db.has(key)) { + try { + this.db.set(key, value) + } catch (e: any) { + this.ctx.log.error(e) + throw e + } + } + } } export default BrowserI18nDb diff --git a/libs/Universal-PicGo-Core/src/db/browserPluginLoderDb.ts b/libs/Universal-PicGo-Core/src/db/browserPluginLoderDb.ts new file mode 100644 index 0000000..ab30c1c --- /dev/null +++ b/libs/Universal-PicGo-Core/src/db/browserPluginLoderDb.ts @@ -0,0 +1,84 @@ +/* + * GNU GENERAL PUBLIC LICENSE + * Version 3, 29 June 2007 + * + * Copyright (C) 2024 Terwer, Inc. + * Everyone is permitted to copy and distribute verbatim copies + * of this license document, but changing it is not allowed. + */ + +import { IConfig, IPicGo } from "../types" +import { IJSON, JSONStore } from "universal-picgo-store" +import { browserPathJoin } from "../utils/browserUtils" + +class BrowserPluginLoaderDb { + private readonly ctx: IPicGo + private readonly db: JSONStore + + constructor(ctx: IPicGo) { + this.ctx = ctx + const packagePath = browserPathJoin(this.ctx.baseDir, "package.json") + this.db = new JSONStore(packagePath) + + // const pkg = { + // name: "picgo-plugins", + // description: "picgo-plugins", + // repository: "https://github.com/PicGo/PicGo-Core", + // license: "MIT", + // } + this.safeSet("name", "picgo-plugins") + this.safeSet("description", "picgo-plugins") + this.safeSet("repository", "https://github.com/terwer/siyuan-plugin-picgo/tree/main/libs/Universal-PicGo-Core") + this.safeSet("license", "MIT") + } + + read(flush?: boolean): IJSON { + return this.db.read(flush) + } + + get(key: ""): any { + this.read(true) + return this.db.get(key) + } + + set(key: string, value: any): void { + this.read(true) + return this.db.set(key, value) + } + + has(key: string): boolean { + this.read(true) + return this.db.has(key) + } + + unset(key: string, value: any): boolean { + this.read(true) + return this.db.unset(key, value) + } + + saveConfig(config: Partial): void { + Object.keys(config).forEach((name: string) => { + this.set(name, config[name]) + }) + } + + removeConfig(config: IConfig): void { + Object.keys(config).forEach((name: string) => { + this.unset(name, config[name]) + }) + } + + // =================================================================================================================== + safeSet(key: string, value: any) { + if (!this.db.has(key)) { + try { + this.db.set(key, value) + } catch (e: any) { + this.ctx.log.error(e) + throw e + } + } + } +} + +export default BrowserPluginLoaderDb diff --git a/libs/Universal-PicGo-Core/src/utils/db.ts b/libs/Universal-PicGo-Core/src/db/db.ts similarity index 64% rename from libs/Universal-PicGo-Core/src/utils/db.ts rename to libs/Universal-PicGo-Core/src/db/db.ts index 7943ad9..2f0c2e3 100644 --- a/libs/Universal-PicGo-Core/src/utils/db.ts +++ b/libs/Universal-PicGo-Core/src/db/db.ts @@ -1,3 +1,12 @@ +/* + * GNU GENERAL PUBLIC LICENSE + * Version 3, 29 June 2007 + * + * Copyright (C) 2024 Terwer, Inc. + * Everyone is permitted to copy and distribute verbatim copies + * of this license document, but changing it is not allowed. + */ + import { IConfig, IPicGo } from "../types" import { IJSON, JSONStore } from "universal-picgo-store" @@ -9,25 +18,11 @@ class DB { this.ctx = ctx this.db = new JSONStore(this.ctx.configPath) - if (!this.db.has("picBed")) { - try { - this.db.set("picBed", { - uploader: "smms", - current: "smms", - }) - } catch (e: any) { - this.ctx.log.error(e) - throw e - } - } - if (!this.db.has("picgoPlugins")) { - try { - this.db.set("picgoPlugins", {}) - } catch (e: any) { - this.ctx.log.error(e) - throw e - } - } + this.safeSet("picBed", { + uploader: "smms", + current: "smms", + }) + this.safeSet("picgoPlugins", {}) } read(flush?: boolean): IJSON { @@ -65,6 +60,18 @@ class DB { this.unset(name, config[name]) }) } + + // =================================================================================================================== + safeSet(key: string, value: any) { + if (!this.db.has(key)) { + try { + this.db.set(key, value) + } catch (e: any) { + this.ctx.log.error(e) + throw e + } + } + } } export default DB diff --git a/libs/Universal-PicGo-Core/src/i18n/index.ts b/libs/Universal-PicGo-Core/src/i18n/index.ts index 30e879c..668b78c 100644 --- a/libs/Universal-PicGo-Core/src/i18n/index.ts +++ b/libs/Universal-PicGo-Core/src/i18n/index.ts @@ -17,7 +17,7 @@ import _ from "lodash-es" import { hasNodeEnv, win } from "universal-picgo-store" import { ensureFileSync, pathExistsSync } from "../utils/nodeUtils" import { browserPathJoin } from "../utils/browserUtils" -import BrowserI18nDb from "./browserI18nDb" +import BrowserI18nDb from "../db/browserI18nDb" const languageList: IStringKeyMap> = { "zh-CN": ZH_CN, diff --git a/libs/Universal-PicGo-Core/src/lib/PluginLoader.ts b/libs/Universal-PicGo-Core/src/lib/PluginLoader.ts index 628eb94..a8d4be9 100644 --- a/libs/Universal-PicGo-Core/src/lib/PluginLoader.ts +++ b/libs/Universal-PicGo-Core/src/lib/PluginLoader.ts @@ -7,12 +7,25 @@ * of this license document, but changing it is not allowed. */ -import { IPicGoPlugin, IPicGoPluginInterface, IPluginLoader } from "../types" +import { IPicGo, IPicGoPlugin, IPicGoPluginInterface, IPluginLoader } from "../types" +import { hasNodeEnv, win } from "universal-picgo-store/src" +import BrowserPluginLoaderDb from "../db/browserPluginLoderDb" /** * Local plugin loader, file system is required */ export class PluginLoader implements IPluginLoader { + private readonly ctx: IPicGo + private browserPluginLoaderDb?: BrowserPluginLoaderDb + private list: string[] = [] + private readonly fullList: Set = new Set() + private readonly pluginMap: Map = new Map() + + constructor(ctx: IPicGo) { + this.ctx = ctx + this.init() + } + getFullList(): string[] { return [] } @@ -36,4 +49,26 @@ export class PluginLoader implements IPluginLoader { unregisterPlugin(name: string): void { return } + + // =================================================================================================================== + + private init(): void { + if (hasNodeEnv) { + const fs = win.fs + const path = win.require("path") + + const packagePath = path.join(this.ctx.baseDir, "package.json") + if (!fs.existsSync(packagePath)) { + const pkg = { + name: "picgo-plugins", + description: "picgo-plugins", + repository: "https://github.com/PicGo/PicGo-Core", + license: "MIT", + } + fs.writeFileSync(packagePath, JSON.stringify(pkg), "utf8") + } + } else { + this.browserPluginLoaderDb = new BrowserPluginLoaderDb(this.ctx) + } + } } diff --git a/libs/Universal-PicGo-Core/src/types/index.d.ts b/libs/Universal-PicGo-Core/src/types/index.d.ts index e52bc32..7f8e642 100644 --- a/libs/Universal-PicGo-Core/src/types/index.d.ts +++ b/libs/Universal-PicGo-Core/src/types/index.d.ts @@ -220,6 +220,20 @@ export interface IConfig { [configOptions: string]: any } +/** + * for an uploader/transformer/beforeTransformHandler/beforeUploadHandler/afterUploadHandler + */ +export interface IPlugin { + handle: ((ctx: IPicGo) => Promise) | ((ctx: IPicGo) => void) + /** The name of this handler */ + name?: string + /** The config of this handler */ + config?: (ctx: IPicGo) => IPluginConfig[] + [propName: string]: any +} + +export type IPluginNameType = 'simple' | 'scope' | 'normal' | 'unknown' + export interface ILocale { [key: string]: any } diff --git a/libs/Universal-PicGo-Core/src/utils/common.ts b/libs/Universal-PicGo-Core/src/utils/common.ts new file mode 100644 index 0000000..6b0e34e --- /dev/null +++ b/libs/Universal-PicGo-Core/src/utils/common.ts @@ -0,0 +1,181 @@ +/* + * GNU GENERAL PUBLIC LICENSE + * Version 3, 29 June 2007 + * + * Copyright (C) 2024 Terwer, Inc. + * Everyone is permitted to copy and distribute verbatim copies + * of this license document, but changing it is not allowed. + */ + +import { IPluginNameType } from "../types" +import { hasNodeEnv, win } from "universal-picgo-store" + +/** + * detect the input string's type + * for example + * 1. @xxx/picgo-plugin-xxx -> scope + * 2. picgo-plugin-xxx -> normal + * 3. xxx -> simple + * 4. not exists or is a path -> unknown + * @param name + */ +export const getPluginNameType = (name: string): IPluginNameType => { + if (/^@[^/]+\/picgo-plugin-/.test(name)) { + return "scope" + } else if (name.startsWith("picgo-plugin-")) { + return "normal" + } else if (isSimpleName(name)) { + return "simple" + } + return "unknown" +} + +/** + * detect the input string is a simple plugin name or not + * for example + * 1. xxx -> true + * 2. /Usr/xx/xxxx/picgo-plugin-xxx -> false + * @param nameOrPath pluginNameOrPath + */ +export const isSimpleName = (nameOrPath: string): boolean => { + if (hasNodeEnv) { + const fs = win.fs + const path = win.require("path") + if (path.isAbsolute(nameOrPath)) { + return false + } + const pluginPath = path.join(process.cwd(), nameOrPath) + if (fs.existsSync(pluginPath)) { + return false + } + } else { + if (nameOrPath.includes("/") || nameOrPath.includes("\\")) { + return false + } + } + + return true +} + +/** + * streamline the full plugin name to a simple one + * for example: + * 1. picgo-plugin-xxx -> xxx + * 2. @xxx/picgo-plugin-yyy -> yyy + * @param name pluginFullName + */ +export const handleStreamlinePluginName = (name: string): string => { + if (/^@[^/]+\/picgo-plugin-/.test(name)) { + return name.replace(/^@[^/]+\/picgo-plugin-/, "") + } else { + return name.replace(/picgo-plugin-/, "") + } +} + +/** + * complete plugin name to full name + * for example: + * 1. xxx -> picgo-plugin-xxx + * 2. picgo-plugin-xxx -> picgo-plugin-xxx + * @param name pluginSimpleName + * @param scope pluginScope + */ +export const handleCompletePluginName = (name: string, scope = ""): string => { + if (scope) { + return `@${scope}/picgo-plugin-${name}` + } else { + return `picgo-plugin-${name}` + } +} + +/** + * handle transform the path to unix style + * for example + * 1. C:\\xxx\\xxx -> C:/xxx/xxx + * 2. /xxx/xxx -> /xxx/xxx + * @param pathStr + */ +export const handleUnixStylePath = (pathStr: string): string => { + if (hasNodeEnv) { + const path = win.require("path") + const pathArr = pathStr.split(path.sep) + return pathArr.join("/") + } else { + const pathArr = pathStr.split("/") + return pathArr.join("/") + } +} + +/** + * remove plugin version when register plugin name + * 1. picgo-plugin-xxx@1.0.0 -> picgo-plugin-xxx + * 2. @xxx/picgo-plugin-xxx@1.0.0 -> @xxx/picgo-plugin-xxx + * @param nameOrPath + * @param scope + */ +export const removePluginVersion = (nameOrPath: string, scope = false): string => { + if (!nameOrPath.includes("@")) { + return nameOrPath + } else { + let reg = /(.+\/)?(picgo-plugin-\w+)(@.+)*/ + // if is a scope pkg + if (scope) { + reg = /(.+\/)?(^@[^/]+\/picgo-plugin-\w+)(@.+)*/ + } + const matchArr = nameOrPath.match(reg) + if (!matchArr) { + console.warn("can not remove plugin version") + return nameOrPath + } else { + return matchArr[2] + } + } +} + +/** + * the config black item list which won't be setted + * only can be got + */ +export const configBlackList = [] + +/** + * check some config key is in blackList + * @param key + */ +export const isConfigKeyInBlackList = (key: string): boolean => { + return configBlackList.some((blackItem) => key.startsWith(blackItem)) +} + +/** + * check the input config is valid + * config must be object such as { xxx: 'xxx' } + * && can't be array + * @param config + * @returns + */ +export const isInputConfigValid = (config: any): boolean => { + if (typeof config === "object" && !Array.isArray(config) && Object.keys(config).length > 0) { + return true + } + return false +} + +export function safeParse(str: string): T | string { + try { + return JSON.parse(str) + } catch (error) { + return str + } +} + +export const forceNumber = (num: string | number = 0): number => { + return isNaN(Number(num)) ? 0 : Number(num) +} + +// export const isDev = (): boolean => { +// return process.env.NODE_ENV === 'development' +// } +// +// export const isProd = (): boolean => { +// return process.env.NODE_ENV === 'production' +// } From a0717f3415f7889c465f04298f9e4a54614f0df3 Mon Sep 17 00:00:00 2001 From: terwer Date: Mon, 18 Mar 2024 18:37:03 +0800 Subject: [PATCH 19/34] feat: electron write file --- libs/Universal-PicGo-Core/src/i18n/index.ts | 26 +- .../src/lib/PluginLoader.ts | 2 +- libs/Universal-PicGo-Core/vite.config.ts | 5 +- libs/Universal-PicGo-Store/package.json | 4 +- .../src/lib/adapters/JSONAdapter.ts | 6 +- .../src/lib/base/electron/TextFile.ts | 48 +++ .../src/lib/base/electron/signalExitShim.ts | 17 ++ .../src/lib/base/electron/writeFileAtomic.ts | 273 ++++++++++++++++++ libs/Universal-PicGo-Store/vite.config.ts | 8 +- .../public/libs/imurmurhash-js/imurmurhash.js | 156 ++++++++++ .../picgo-plugin-app/src/pages/PicGoIndex.vue | 1 + .../picgo-plugin-app/src/utils/appLogger.ts | 4 +- packages/picgo-plugin-app/vite.config.ts | 18 +- pnpm-lock.yaml | 22 +- 14 files changed, 544 insertions(+), 46 deletions(-) create mode 100644 libs/Universal-PicGo-Store/src/lib/base/electron/TextFile.ts create mode 100644 libs/Universal-PicGo-Store/src/lib/base/electron/signalExitShim.ts create mode 100644 libs/Universal-PicGo-Store/src/lib/base/electron/writeFileAtomic.ts create mode 100644 packages/picgo-plugin-app/public/libs/imurmurhash-js/imurmurhash.js diff --git a/libs/Universal-PicGo-Core/src/i18n/index.ts b/libs/Universal-PicGo-Core/src/i18n/index.ts index 668b78c..f307e88 100644 --- a/libs/Universal-PicGo-Core/src/i18n/index.ts +++ b/libs/Universal-PicGo-Core/src/i18n/index.ts @@ -108,18 +108,20 @@ class I18nManager implements II18nManager { const files = fs.readdirSync(i18nFolder, { withFileTypes: true, }) - files.forEach((file: any) => { - if (file.isFile() && file.name.endsWith(".yml")) { - const i18nFilePath = path.join(i18nFolder, file.name) - const i18nFile = fs.readFileSync(i18nFilePath, "utf8") - try { - const i18nFileObj = yaml.load(i18nFile) as ILocales - languageList[file.name.replace(/\.yml$/, "")] = i18nFileObj - } catch (e) { - console.error(e) - } - } - }) + // files.forEach((file: any) => { + // if (file.isFile() && file.name.endsWith(".yml")) { + // const i18nFilePath = path.join(i18nFolder, file.name) + // alert(i18nFilePath) + // alert(fs) + // const i18nFile = fs.readFileSync(i18nFilePath, "utf8") + // try { + // const i18nFileObj = yaml.load(i18nFile) as ILocales + // languageList[file.name.replace(/\.yml$/, "")] = i18nFileObj + // } catch (e) { + // console.error(e) + // } + // } + // }) } else { // "i18n": [ // { diff --git a/libs/Universal-PicGo-Core/src/lib/PluginLoader.ts b/libs/Universal-PicGo-Core/src/lib/PluginLoader.ts index a8d4be9..a0da00a 100644 --- a/libs/Universal-PicGo-Core/src/lib/PluginLoader.ts +++ b/libs/Universal-PicGo-Core/src/lib/PluginLoader.ts @@ -8,7 +8,7 @@ */ import { IPicGo, IPicGoPlugin, IPicGoPluginInterface, IPluginLoader } from "../types" -import { hasNodeEnv, win } from "universal-picgo-store/src" +import { hasNodeEnv, win } from "universal-picgo-store" import BrowserPluginLoaderDb from "../db/browserPluginLoderDb" /** diff --git a/libs/Universal-PicGo-Core/vite.config.ts b/libs/Universal-PicGo-Core/vite.config.ts index 1f55ba5..a82ac13 100644 --- a/libs/Universal-PicGo-Core/vite.config.ts +++ b/libs/Universal-PicGo-Core/vite.config.ts @@ -61,7 +61,10 @@ console.log("distDir=>", distDir) export default defineConfig({ plugins: [ - dts(), + dts({ + insertTypesEntry: true, + // rollupTypes: true, + }), nodePolyfills({ // Whether to polyfill `node:` protocol imports. diff --git a/libs/Universal-PicGo-Store/package.json b/libs/Universal-PicGo-Store/package.json index 5b9d9bd..5556652 100644 --- a/libs/Universal-PicGo-Store/package.json +++ b/libs/Universal-PicGo-Store/package.json @@ -27,15 +27,13 @@ "devDependencies": { "@terwer/eslint-config-custom": "^1.3.6", "@terwer/vite-config-custom": "^0.7.6", - "@types/lodash-es": "^4.17.12", - "@types/write-file-atomic": "^4.0.3" + "@types/lodash-es": "^4.17.12" }, "dependencies": { "@commonify/lowdb": "^3.0.0", "comment-json": "^4.2.3", "lodash-es": "^4.17.21", "ts-localstorage": "^3.1.0", - "write-file-atomic": "^5.0.1", "zhi-lib-base": "^0.8.0" }, "publishConfig": { diff --git a/libs/Universal-PicGo-Store/src/lib/adapters/JSONAdapter.ts b/libs/Universal-PicGo-Store/src/lib/adapters/JSONAdapter.ts index 5420589..2b4abc4 100644 --- a/libs/Universal-PicGo-Store/src/lib/adapters/JSONAdapter.ts +++ b/libs/Universal-PicGo-Store/src/lib/adapters/JSONAdapter.ts @@ -1,7 +1,7 @@ import { IJSON } from "../../types" -import { TextFileSync } from "@commonify/lowdb" +import { TextFileSync } from "../base/electron/TextFile" import json from "comment-json" -import writeFile from "write-file-atomic" +import { writeFileSync } from "../base/electron/writeFileAtomic" export class JSONAdapter { private readonly adapter: TextFileSync @@ -36,6 +36,6 @@ export class JSONAdapter { } write(obj: any): void { - writeFile.sync(this.dbPath, json.stringify(obj, null, 2)) + writeFileSync(this.dbPath, json.stringify(obj, null, 2)) } } diff --git a/libs/Universal-PicGo-Store/src/lib/base/electron/TextFile.ts b/libs/Universal-PicGo-Store/src/lib/base/electron/TextFile.ts new file mode 100644 index 0000000..14da079 --- /dev/null +++ b/libs/Universal-PicGo-Store/src/lib/base/electron/TextFile.ts @@ -0,0 +1,48 @@ +/* + * GNU GENERAL PUBLIC LICENSE + * Version 3, 29 June 2007 + * + * Copyright (C) 2024 Terwer, Inc. + * Everyone is permitted to copy and distribute verbatim copies + * of this license document, but changing it is not allowed. + */ + +import { SyncAdapter } from "@commonify/lowdb" +import { win } from "../../utils" + +export class TextFileSync implements SyncAdapter { + // PathLike + #tempFilename: any + // PathLike + #filename: any + + // PathLike + constructor(filename: any) { + const path = win.require("path") + this.#filename = filename + const f = filename.toString() + this.#tempFilename = path.join(path.dirname(f), `.${path.basename(f)}.tmp`) + } + + read(): string | null { + let data + + try { + const fs = win.fs + data = fs.readFileSync(this.#filename, "utf-8") + } catch (e) { + if ((e as NodeJS.ErrnoException).code === "ENOENT") { + return null + } + throw e + } + + return data + } + + write(str: string): void { + const fs = win.fs + fs.writeFileSync(this.#tempFilename, str) + fs.renameSync(this.#tempFilename, this.#filename) + } +} diff --git a/libs/Universal-PicGo-Store/src/lib/base/electron/signalExitShim.ts b/libs/Universal-PicGo-Store/src/lib/base/electron/signalExitShim.ts new file mode 100644 index 0000000..9462e11 --- /dev/null +++ b/libs/Universal-PicGo-Store/src/lib/base/electron/signalExitShim.ts @@ -0,0 +1,17 @@ +/* + * GNU GENERAL PUBLIC LICENSE + * Version 3, 29 June 2007 + * + * Copyright (C) 2024 Terwer, Inc. + * Everyone is permitted to copy and distribute verbatim copies + * of this license document, but changing it is not allowed. + */ + +/** + * This is a browser shim that provides the same functional interface + * as the main node export, but it does nothing. + * @module + */ +export const onExit: (cb: any, opts?: { alwaysLast?: boolean }) => () => void = () => () => {} +export const load = () => {} +export const unload = () => {} diff --git a/libs/Universal-PicGo-Store/src/lib/base/electron/writeFileAtomic.ts b/libs/Universal-PicGo-Store/src/lib/base/electron/writeFileAtomic.ts new file mode 100644 index 0000000..8f7dd47 --- /dev/null +++ b/libs/Universal-PicGo-Store/src/lib/base/electron/writeFileAtomic.ts @@ -0,0 +1,273 @@ +/* + * GNU GENERAL PUBLIC LICENSE + * Version 3, 29 June 2007 + * + * Copyright (C) 2024 Terwer, Inc. + * Everyone is permitted to copy and distribute verbatim copies + * of this license document, but changing it is not allowed. + */ + +import { win } from "../../utils" +import { onExit } from "./signalExitShim" + +const fs = win.fs +const MurmurHash3 = win.MurmurHash3 +const path = win.require("path") +const { promisify } = win.require("util") +const activeFiles = {} as any + +// if we run inside of a worker_thread, `process.pid` is not unique +/* istanbul ignore next */ +const threadId = (function getId() { + try { + const workerThreads = win.require("worker_threads") + + /// if we are in main thread, this is set to `0` + return workerThreads.threadId + } catch (e) { + // worker_threads are not available, fallback to 0 + return 0 + } +})() + +let invocations = 0 +function getTmpname(filename: string) { + return ( + filename + + "." + + MurmurHash3(win.__filename).hash(String(process.pid)).hash(String(threadId)).hash(String(++invocations)).result() + ) +} + +function cleanupOnExit(tmpfile: any) { + return () => { + try { + fs.unlinkSync(typeof tmpfile === "function" ? tmpfile() : tmpfile) + } catch { + // ignore errors + } + } +} + +function serializeActiveFile(absoluteName: string) { + return new Promise((resolve: any) => { + // make a queue if it doesn't already exist + if (!activeFiles[absoluteName]) { + activeFiles[absoluteName] = [] + } + + activeFiles[absoluteName].push(resolve) // add this job to the queue + if (activeFiles[absoluteName].length === 1) { + resolve() + } // kick off the first one + }) +} + +// https://github.com/isaacs/node-graceful-fs/blob/master/polyfills.js#L315-L342 +function isChownErrOk(err: any) { + if (err.code === "ENOSYS") { + return true + } + + const nonroot = !process.getuid || process.getuid() !== 0 + if (nonroot) { + if (err.code === "EINVAL" || err.code === "EPERM") { + return true + } + } + + return false +} + +async function writeFileAsync(filename: string, data: any, options = {} as any) { + if (typeof options === "string") { + options = { encoding: options } + } + + let fd + let tmpfile: any + /* istanbul ignore next -- The closure only gets called when onExit triggers */ + const removeOnExitHandler = onExit(cleanupOnExit(() => tmpfile)) + const absoluteName = path.resolve(filename) + + try { + await serializeActiveFile(absoluteName) + const truename = await promisify(fs.realpath)(filename).catch(() => filename) + tmpfile = getTmpname(truename) + + if (!options.mode || !options.chown) { + // Either mode or chown is not explicitly set + // Default behavior is to copy it from original file + const stats = await promisify(fs.stat)(truename).catch(() => {}) + if (stats) { + if (options.mode == null) { + options.mode = stats.mode + } + + if (options.chown == null && process.getuid) { + options.chown = { uid: stats.uid, gid: stats.gid } + } + } + } + + fd = await promisify(fs.open)(tmpfile, "w", options.mode) + if (options.tmpfileCreated) { + await options.tmpfileCreated(tmpfile) + } + if (win.ArrayBuffer.isView(data)) { + await promisify(fs.write)(fd, data, 0, data.length, 0) + } else if (data != null) { + await promisify(fs.write)(fd, String(data), 0, String(options.encoding || "utf8")) + } + + if (options.fsync !== false) { + await promisify(fs.fsync)(fd) + } + + await promisify(fs.close)(fd) + fd = null + + if (options.chown) { + await promisify(fs.chown)(tmpfile, options.chown.uid, options.chown.gid).catch((err: any) => { + if (!isChownErrOk(err)) { + throw err + } + }) + } + + if (options.mode) { + await promisify(fs.chmod)(tmpfile, options.mode).catch((err: any) => { + if (!isChownErrOk(err)) { + throw err + } + }) + } + + await promisify(fs.rename)(tmpfile, truename) + } finally { + if (fd) { + await promisify(fs.close)(fd).catch( + /* istanbul ignore next */ + () => {} + ) + } + removeOnExitHandler() + await promisify(fs.unlink)(tmpfile).catch(() => {}) + activeFiles[absoluteName].shift() // remove the element added by serializeSameFile + if (activeFiles[absoluteName].length > 0) { + activeFiles[absoluteName][0]() // start next job if one is pending + } else { + delete activeFiles[absoluteName] + } + } +} + +async function writeFile(filename: string, data: any, options: any, callback: any) { + if (options instanceof Function) { + callback = options + options = {} + } + + const promise = writeFileAsync(filename, data, options) + if (callback) { + try { + const result = await promise + return callback(result) + } catch (err) { + return callback(err) + } + } + + return promise +} + +function writeFileSync(filename: string, data: any, options?: any) { + if (typeof options === "string") { + options = { encoding: options } + } else if (!options) { + options = {} + } + try { + filename = fs.realpathSync(filename) + } catch (ex) { + // it's ok, it'll happen on a not yet existing file + } + const tmpfile = getTmpname(filename) + + if (!options.mode || !options.chown) { + // Either mode or chown is not explicitly set + // Default behavior is to copy it from original file + try { + const stats = fs.statSync(filename) + options = Object.assign({}, options) + if (!options.mode) { + options.mode = stats.mode + } + if (!options.chown && process.getuid) { + options.chown = { uid: stats.uid, gid: stats.gid } + } + } catch (ex) { + // ignore stat errors + } + } + + let fd + const cleanup = cleanupOnExit(tmpfile) + const removeOnExitHandler = onExit(cleanup) + + let threw = true + try { + fd = fs.openSync(tmpfile, "w", options.mode || 0o666) + if (options.tmpfileCreated) { + options.tmpfileCreated(tmpfile) + } + if (win.ArrayBuffer.isView(data)) { + fs.writeSync(fd, data, 0, data.length, 0) + } else if (data != null) { + fs.writeSync(fd, String(data), 0, String(options.encoding || "utf8")) + } + if (options.fsync !== false) { + fs.fsyncSync(fd) + } + + fs.closeSync(fd) + fd = null + + if (options.chown) { + try { + fs.chownSync(tmpfile, options.chown.uid, options.chown.gid) + } catch (err) { + if (!isChownErrOk(err)) { + throw err + } + } + } + + if (options.mode) { + try { + fs.chmodSync(tmpfile, options.mode) + } catch (err) { + if (!isChownErrOk(err)) { + throw err + } + } + } + + fs.renameSync(tmpfile, filename) + threw = false + } finally { + if (fd) { + try { + fs.closeSync(fd) + } catch (ex) { + // ignore close errors at this stage, error may have closed fd already. + } + } + removeOnExitHandler() + if (threw) { + cleanup() + } + } +} + +export { writeFile, writeFileSync, getTmpname, cleanupOnExit } diff --git a/libs/Universal-PicGo-Store/vite.config.ts b/libs/Universal-PicGo-Store/vite.config.ts index d706937..d789895 100644 --- a/libs/Universal-PicGo-Store/vite.config.ts +++ b/libs/Universal-PicGo-Store/vite.config.ts @@ -19,7 +19,10 @@ console.log("distDir=>", distDir) export default defineConfig({ plugins: [ - dts(), + dts({ + insertTypesEntry: true, + // rollupTypes: true, + }), nodePolyfills({ // Whether to polyfill `node:` protocol imports. @@ -47,6 +50,7 @@ export default defineConfig({ // 构建后是否生成 source map 文件 sourcemap: false, + minify: false, lib: { // Could also be a dictionary or array of multiple entry points @@ -59,7 +63,7 @@ export default defineConfig({ plugins: [...(isWatch ? [livereload(devDistDir)] : [])] as any, // make sure to externalize deps that shouldn't be bundled // into your library - external: ["worker_threads"], + external: [], output: { entryFileNames: "[name].js", }, diff --git a/packages/picgo-plugin-app/public/libs/imurmurhash-js/imurmurhash.js b/packages/picgo-plugin-app/public/libs/imurmurhash-js/imurmurhash.js new file mode 100644 index 0000000..c412efe --- /dev/null +++ b/packages/picgo-plugin-app/public/libs/imurmurhash-js/imurmurhash.js @@ -0,0 +1,156 @@ +/* + * GNU GENERAL PUBLIC LICENSE + * Version 3, 29 June 2007 + * + * Copyright (C) 2024 Terwer, Inc. + * Everyone is permitted to copy and distribute verbatim copies + * of this license document, but changing it is not allowed. + */ + +// This script is copyed from https://raw.githubusercontent.com/jensyt/imurmurhash-js/master/imurmurhash.js +// access iMurmurHash using the global object MurmurHash3 + +/** + * @preserve + * JS Implementation of incremental MurmurHash3 (r150) (as of May 10, 2013) + * + * @author Jens Taylor + * @see http://github.com/homebrewing/brauhaus-diff + * @author Gary Court + * @see http://github.com/garycourt/murmurhash-js + * @author Austin Appleby + * @see http://sites.google.com/site/murmurhash/ + */ +;(function () { + var cache + + // Call this function without `new` to use the cached object (good for + // single-threaded environments), or with `new` to create a new object. + // + // @param {string} key A UTF-16 or ASCII string + // @param {number} seed An optional positive integer + // @return {object} A MurmurHash3 object for incremental hashing + function MurmurHash3(key, seed) { + var m = this instanceof MurmurHash3 ? this : cache + m.reset(seed) + if (typeof key === "string" && key.length > 0) { + m.hash(key) + } + + if (m !== this) { + return m + } + } + + // Incrementally add a string to this hash + // + // @param {string} key A UTF-16 or ASCII string + // @return {object} this + MurmurHash3.prototype.hash = function (key) { + var h1, k1, i, top, len + + len = key.length + this.len += len + + k1 = this.k1 + i = 0 + switch (this.rem) { + case 0: + k1 ^= len > i ? key.charCodeAt(i++) & 0xffff : 0 + case 1: + k1 ^= len > i ? (key.charCodeAt(i++) & 0xffff) << 8 : 0 + case 2: + k1 ^= len > i ? (key.charCodeAt(i++) & 0xffff) << 16 : 0 + case 3: + k1 ^= len > i ? (key.charCodeAt(i) & 0xff) << 24 : 0 + k1 ^= len > i ? (key.charCodeAt(i++) & 0xff00) >> 8 : 0 + } + + this.rem = (len + this.rem) & 3 // & 3 is same as % 4 + len -= this.rem + if (len > 0) { + h1 = this.h1 + while (1) { + k1 = (k1 * 0x2d51 + (k1 & 0xffff) * 0xcc9e0000) & 0xffffffff + k1 = (k1 << 15) | (k1 >>> 17) + k1 = (k1 * 0x3593 + (k1 & 0xffff) * 0x1b870000) & 0xffffffff + + h1 ^= k1 + h1 = (h1 << 13) | (h1 >>> 19) + h1 = (h1 * 5 + 0xe6546b64) & 0xffffffff + + if (i >= len) { + break + } + + k1 = + (key.charCodeAt(i++) & 0xffff) ^ + ((key.charCodeAt(i++) & 0xffff) << 8) ^ + ((key.charCodeAt(i++) & 0xffff) << 16) + top = key.charCodeAt(i++) + k1 ^= ((top & 0xff) << 24) ^ ((top & 0xff00) >> 8) + } + + k1 = 0 + switch (this.rem) { + case 3: + k1 ^= (key.charCodeAt(i + 2) & 0xffff) << 16 + case 2: + k1 ^= (key.charCodeAt(i + 1) & 0xffff) << 8 + case 1: + k1 ^= key.charCodeAt(i) & 0xffff + } + + this.h1 = h1 + } + + this.k1 = k1 + return this + } + + // Get the result of this hash + // + // @return {number} The 32-bit hash + MurmurHash3.prototype.result = function () { + var k1, h1 + + k1 = this.k1 + h1 = this.h1 + + if (k1 > 0) { + k1 = (k1 * 0x2d51 + (k1 & 0xffff) * 0xcc9e0000) & 0xffffffff + k1 = (k1 << 15) | (k1 >>> 17) + k1 = (k1 * 0x3593 + (k1 & 0xffff) * 0x1b870000) & 0xffffffff + h1 ^= k1 + } + + h1 ^= this.len + + h1 ^= h1 >>> 16 + h1 = (h1 * 0xca6b + (h1 & 0xffff) * 0x85eb0000) & 0xffffffff + h1 ^= h1 >>> 13 + h1 = (h1 * 0xae35 + (h1 & 0xffff) * 0xc2b20000) & 0xffffffff + h1 ^= h1 >>> 16 + + return h1 >>> 0 + } + + // Reset the hash object for reuse + // + // @param {number} seed An optional positive integer + MurmurHash3.prototype.reset = function (seed) { + this.h1 = typeof seed === "number" ? seed : 0 + this.rem = this.k1 = this.len = 0 + return this + } + + // A cached object to use. This can be safely used if you're in a single- + // threaded environment, otherwise you need to create new hashes to use. + cache = new MurmurHash3() + + if (typeof module != "undefined") { + module.exports = MurmurHash3 + } else { + this.MurmurHash3 = MurmurHash3 + } +})() diff --git a/packages/picgo-plugin-app/src/pages/PicGoIndex.vue b/packages/picgo-plugin-app/src/pages/PicGoIndex.vue index 53521d5..2f6a4e1 100644 --- a/packages/picgo-plugin-app/src/pages/PicGoIndex.vue +++ b/packages/picgo-plugin-app/src/pages/PicGoIndex.vue @@ -24,6 +24,7 @@ const handleTest = () => { ElMessage.success("success") } catch (e: any) { ElMessage.error(e.toString()) + logger.error(e) } } diff --git a/packages/picgo-plugin-app/src/utils/appLogger.ts b/packages/picgo-plugin-app/src/utils/appLogger.ts index 9567b5a..b4b43c1 100644 --- a/packages/picgo-plugin-app/src/utils/appLogger.ts +++ b/packages/picgo-plugin-app/src/utils/appLogger.ts @@ -10,12 +10,12 @@ import { isDev } from "./Constants.ts" import { simpleLogger } from "zhi-lib-base" -const win = window as any +// const win = window as any /** * 使用 eruda 更好的控制日志 */ -window.console = isDev ? win?.eruda?.get("console") : window.console +// window.console = isDev ? win?.eruda?.get("console") : window.console /** * 简单的日志接口 diff --git a/packages/picgo-plugin-app/vite.config.ts b/packages/picgo-plugin-app/vite.config.ts index f8302cb..0b71ee9 100644 --- a/packages/picgo-plugin-app/vite.config.ts +++ b/packages/picgo-plugin-app/vite.config.ts @@ -43,7 +43,6 @@ export default defineConfig(() => ({ createHtmlPlugin({ minify: !isDev, inject: { - // 在 body 标签底部插入指定的 JavaScript 文件 tags: isDev ? [ { @@ -53,8 +52,23 @@ export default defineConfig(() => ({ }, injectTo: "head-prepend", }, + { + tag: "script", + attrs: { + src: "./libs/imurmurhash-js/imurmurhash.js", + }, + injectTo: "head-prepend", + }, ] - : [], + : [ + { + tag: "script", + attrs: { + src: "./libs/imurmurhash-js/imurmurhash.js", + }, + injectTo: "head-prepend", + }, + ], data: { title: "eruda", injectScript: isDev ? `` : "", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 769df4a..8e9493a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -57,9 +57,6 @@ importers: ts-localstorage: specifier: ^3.1.0 version: 3.1.0 - write-file-atomic: - specifier: ^5.0.1 - version: 5.0.1 zhi-lib-base: specifier: ^0.8.0 version: 0.8.0 @@ -73,9 +70,6 @@ importers: '@types/lodash-es': specifier: ^4.17.12 version: 4.17.12 - '@types/write-file-atomic': - specifier: ^4.0.3 - version: 4.0.3 packages/picgo-plugin-app: dependencies: @@ -1759,12 +1753,6 @@ packages: /@types/web-bluetooth@0.0.20: resolution: {integrity: sha512-g9gZnnXVq7gM7v3tJCWV/qw7w+KeOlSHAhgF9RytFyifW6AF61hdT2ucrYhPq9hLs5JIryeupHV3qGk95dH9ow==} - /@types/write-file-atomic@4.0.3: - resolution: {integrity: sha512-qdo+vZRchyJIHNeuI1nrpsLw+hnkgqP/8mlaN6Wle/NKhydHmUN9l4p3ZE8yP90AJNJW4uB8HQhedb4f1vNayQ==} - dependencies: - '@types/node': 20.5.1 - dev: true - /@typescript-eslint/eslint-plugin@5.62.0(@typescript-eslint/parser@5.62.0)(eslint@8.57.0)(typescript@4.9.5): resolution: {integrity: sha512-TiZzBSJja/LbhNPvk6yc0JrX9XqhQ0hdh6M2svYfsHGejaKFIAGd9MQ+ERIMzLGlN/kZoYIgdxFV0PuljTKXag==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -4404,6 +4392,7 @@ packages: /imurmurhash@0.1.4: resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} engines: {node: '>=0.8.19'} + dev: true /indent-string@4.0.0: resolution: {integrity: sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==} @@ -6138,6 +6127,7 @@ packages: /signal-exit@4.1.0: resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} engines: {node: '>=14'} + dev: true /siyuan@0.9.5: resolution: {integrity: sha512-txDJp+uSmnAoCz4aDw6a3lCz2h4eRhyx5wgInCmSglQx7aoOpMK57nU31N3FY1NVREQcNV0OG6fJZ0iJJOkrag==} @@ -7540,14 +7530,6 @@ packages: resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} dev: true - /write-file-atomic@5.0.1: - resolution: {integrity: sha512-+QU2zd6OTD8XWIJCbffaiQeH9U73qIqafo1x6V1snCWYGJf6cVE0cDR4D8xRzcEnfI21IFrUPzPGtcPf8AC+Rw==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - dependencies: - imurmurhash: 0.1.4 - signal-exit: 4.1.0 - dev: false - /ws@7.5.9: resolution: {integrity: sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q==} engines: {node: '>=8.3.0'} From 7d3839187d88224c79a2f6d0ba7efd2de5dfdfef Mon Sep 17 00:00:00 2001 From: terwer Date: Tue, 19 Mar 2024 11:27:03 +0800 Subject: [PATCH 20/34] feat: db support electron and browser --- .../src/db/browserI18nDb.ts | 2 +- libs/Universal-PicGo-Core/src/i18n/index.ts | 32 ++-- .../src/utils/nodeUtils.ts | 13 ++ libs/Universal-PicGo-Core/vite.config.ts | 1 + .../src/lib/base/electron/Murmurhash3.ts | 124 ++++++++++++++ .../src/lib/base/electron/writeFileAtomic.ts | 14 +- libs/Universal-PicGo-Store/vite.config.ts | 4 +- .../public/libs/imurmurhash-js/imurmurhash.js | 156 ------------------ packages/picgo-plugin-app/vite.config.ts | 17 +- 9 files changed, 166 insertions(+), 197 deletions(-) create mode 100644 libs/Universal-PicGo-Store/src/lib/base/electron/Murmurhash3.ts delete mode 100644 packages/picgo-plugin-app/public/libs/imurmurhash-js/imurmurhash.js diff --git a/libs/Universal-PicGo-Core/src/db/browserI18nDb.ts b/libs/Universal-PicGo-Core/src/db/browserI18nDb.ts index 87b423d..ce86164 100644 --- a/libs/Universal-PicGo-Core/src/db/browserI18nDb.ts +++ b/libs/Universal-PicGo-Core/src/db/browserI18nDb.ts @@ -20,7 +20,7 @@ class BrowserI18nDb { constructor(ctx: IPicGo) { this.ctx = ctx - const browserI18nForder = browserPathJoin(this.ctx.baseDir, "i18n-cli") + const browserI18nForder = browserPathJoin(this.ctx.baseDir, "i18n-cli", "i18n.json") this.db = new JSONStore(browserI18nForder) this.safeSet(this.i18nKey, []) diff --git a/libs/Universal-PicGo-Core/src/i18n/index.ts b/libs/Universal-PicGo-Core/src/i18n/index.ts index f307e88..da2208a 100644 --- a/libs/Universal-PicGo-Core/src/i18n/index.ts +++ b/libs/Universal-PicGo-Core/src/i18n/index.ts @@ -15,7 +15,7 @@ import { ZH_TW } from "./zh-TW" import yaml from "js-yaml" import _ from "lodash-es" import { hasNodeEnv, win } from "universal-picgo-store" -import { ensureFileSync, pathExistsSync } from "../utils/nodeUtils" +import { ensureFolderSync, pathExistsSync } from "../utils/nodeUtils" import { browserPathJoin } from "../utils/browserUtils" import BrowserI18nDb from "../db/browserI18nDb" @@ -91,10 +91,10 @@ class I18nManager implements II18nManager { const path = win.require("path") i18nFolder = path.join(this.ctx.baseDir, "i18n-cli") if (!pathExistsSync(fs, path, i18nFolder)) { - ensureFileSync(fs, path, i18nFolder) + ensureFolderSync(fs, path, i18nFolder) } } else { - i18nFolder = browserPathJoin(this.ctx.baseDir, "picgo-i18n-cli") + i18nFolder = browserPathJoin(this.ctx.baseDir, "i18n-cli", "i18n.json") } return i18nFolder @@ -108,20 +108,18 @@ class I18nManager implements II18nManager { const files = fs.readdirSync(i18nFolder, { withFileTypes: true, }) - // files.forEach((file: any) => { - // if (file.isFile() && file.name.endsWith(".yml")) { - // const i18nFilePath = path.join(i18nFolder, file.name) - // alert(i18nFilePath) - // alert(fs) - // const i18nFile = fs.readFileSync(i18nFilePath, "utf8") - // try { - // const i18nFileObj = yaml.load(i18nFile) as ILocales - // languageList[file.name.replace(/\.yml$/, "")] = i18nFileObj - // } catch (e) { - // console.error(e) - // } - // } - // }) + files.forEach((file: any) => { + if (file.isFile() && file.name.endsWith(".yml")) { + const i18nFilePath = path.join(i18nFolder, file.name) + const i18nFile = fs.readFileSync(i18nFilePath, "utf8") + try { + const i18nFileObj = yaml.load(i18nFile) as ILocales + languageList[file.name.replace(/\.yml$/, "")] = i18nFileObj + } catch (e) { + console.error(e) + } + } + }) } else { // "i18n": [ // { diff --git a/libs/Universal-PicGo-Core/src/utils/nodeUtils.ts b/libs/Universal-PicGo-Core/src/utils/nodeUtils.ts index 46f699f..942939f 100644 --- a/libs/Universal-PicGo-Core/src/utils/nodeUtils.ts +++ b/libs/Universal-PicGo-Core/src/utils/nodeUtils.ts @@ -43,3 +43,16 @@ export const ensureFileSync = (fs: any, path: any, filePath: string) => { fs.writeFileSync(filePath, "") } } + +/** + * 确保目录存在 + * + * @param fs + * @param path + * @param dir + */ +export const ensureFolderSync = (fs: any, path: any, dir: string) => { + if (!fs.existsSync(dir)) { + fs.mkdirSync(dir, { recursive: true }) + } +} diff --git a/libs/Universal-PicGo-Core/vite.config.ts b/libs/Universal-PicGo-Core/vite.config.ts index a82ac13..28c77d7 100644 --- a/libs/Universal-PicGo-Core/vite.config.ts +++ b/libs/Universal-PicGo-Core/vite.config.ts @@ -100,6 +100,7 @@ export default defineConfig({ // 构建后是否生成 source map 文件 sourcemap: false, + minify: !isDev, lib: { // Could also be a dictionary or array of multiple entry points diff --git a/libs/Universal-PicGo-Store/src/lib/base/electron/Murmurhash3.ts b/libs/Universal-PicGo-Store/src/lib/base/electron/Murmurhash3.ts new file mode 100644 index 0000000..a3102ce --- /dev/null +++ b/libs/Universal-PicGo-Store/src/lib/base/electron/Murmurhash3.ts @@ -0,0 +1,124 @@ +/* + * GNU GENERAL PUBLIC LICENSE + * Version 3, 29 June 2007 + * + * Copyright (C) 2024 Terwer, Inc. + * Everyone is permitted to copy and distribute verbatim copies + * of this license document, but changing it is not allowed. + */ + +// This script is copyed from https://raw.githubusercontent.com/jensyt/imurmurhash-js/master/imurmurhash.js +// access iMurmurHash using the global object MurmurHash3 + +/** + @preserve + JS Implementation of incremental MurmurHash3 (r150) (as of May 10, 2013) + @author Jens Taylor + @see http://github.com/homebrewing/brauhaus-diff + @author Gary Court + @see http://github.com/garycourt/murmurhash-js + @author Austin Appleby + @see http://sites.google.com/site/murmurhash/ + */ + +/** + * This class representing MurmurHash3 implementation + */ + +/** + * Implementation of the MurmurHash3 algorithm + */ +class MurmurHash3 { + private h1: number + private rem: number + private k1: number + private len: number + + /** + * Creates an instance of MurmurHash3. + * @param seed - Optional seed for the hash function + */ + constructor(seed = 0) { + this.h1 = seed + this.rem = 0 + this.k1 = 0 + this.len = 0 + } + + /** + * Adds a string to the hash calculation. + * @param {string} key - The string to be hashed + * @returns {MurmurHash3} - The updated MurmurHash3 object + */ + hash(key: string): MurmurHash3 { + let h1: number = this.h1 + let k1: number + let i = 0 + let len: number = key.length + + this.len += len + + for (; len >= 4; len -= 4) { + k1 = + (key.charCodeAt(i) & 0xff) | + ((key.charCodeAt(i + 1) & 0xff) << 8) | + ((key.charCodeAt(i + 2) & 0xff) << 16) | + ((key.charCodeAt(i + 3) & 0xff) << 24) + + k1 = Math.imul(k1, 0xcc9e2d51) + k1 = (k1 << 15) | (k1 >>> 17) + k1 = Math.imul(k1, 0x1b873593) + + h1 ^= k1 + h1 = (h1 << 13) | (h1 >>> 19) + h1 = (Math.imul(h1, 5) + 0xe6546b64) | 0 + + i += 4 + } + + this.h1 = h1 + this.rem = len + this.k1 = 0 + + return this + } + + /** + * Finalizes the hash calculation and returns the hash value. + * @returns {number} - The 32-bit hash value + */ + result(): number { + let h1: number = this.h1 + let k1: number = this.k1 + + k1 ^= this.len & 3 + + k1 = Math.imul(k1, 0xcc9e2d51) + k1 = (k1 << 15) | (k1 >>> 17) + k1 = Math.imul(k1, 0x1b873593) + + h1 ^= k1 + + h1 ^= this.len + h1 ^= h1 >>> 16 + h1 = Math.imul(h1, 0x85ebca6b) + h1 ^= h1 >>> 13 + h1 = Math.imul(h1, 0xc2b2ae35) + h1 ^= h1 >>> 16 + + return h1 >>> 0 + } + + /** + * Resets the hash object for reuse. + * @param {number} seed - Optional seed for the hash function + * @returns {MurmurHash3} - The reset MurmurHash3 object + */ + reset(seed?: number): MurmurHash3 { + this.h1 = seed || 0 + this.rem = this.k1 = this.len = 0 + return this + } +} + +export default MurmurHash3 diff --git a/libs/Universal-PicGo-Store/src/lib/base/electron/writeFileAtomic.ts b/libs/Universal-PicGo-Store/src/lib/base/electron/writeFileAtomic.ts index 8f7dd47..09d212e 100644 --- a/libs/Universal-PicGo-Store/src/lib/base/electron/writeFileAtomic.ts +++ b/libs/Universal-PicGo-Store/src/lib/base/electron/writeFileAtomic.ts @@ -9,11 +9,10 @@ import { win } from "../../utils" import { onExit } from "./signalExitShim" +import MurmurHash3 from "./Murmurhash3" const fs = win.fs -const MurmurHash3 = win.MurmurHash3 -const path = win.require("path") -const { promisify } = win.require("util") +const murmurHash3 = new MurmurHash3(win.__filename) const activeFiles = {} as any // if we run inside of a worker_thread, `process.pid` is not unique @@ -35,7 +34,7 @@ function getTmpname(filename: string) { return ( filename + "." + - MurmurHash3(win.__filename).hash(String(process.pid)).hash(String(threadId)).hash(String(++invocations)).result() + murmurHash3.hash(String(win.process.pid)).hash(String(threadId)).hash(String(++invocations)).result() ) } @@ -69,7 +68,7 @@ function isChownErrOk(err: any) { return true } - const nonroot = !process.getuid || process.getuid() !== 0 + const nonroot = !win.process.getuid || win.process.getuid() !== 0 if (nonroot) { if (err.code === "EINVAL" || err.code === "EPERM") { return true @@ -80,6 +79,9 @@ function isChownErrOk(err: any) { } async function writeFileAsync(filename: string, data: any, options = {} as any) { + const path = win.require("path") + const { promisify } = win.require("util") + if (typeof options === "string") { options = { encoding: options } } @@ -203,7 +205,7 @@ function writeFileSync(filename: string, data: any, options?: any) { if (!options.mode) { options.mode = stats.mode } - if (!options.chown && process.getuid) { + if (!options.chown && win.process.getuid) { options.chown = { uid: stats.uid, gid: stats.gid } } } catch (ex) { diff --git a/libs/Universal-PicGo-Store/vite.config.ts b/libs/Universal-PicGo-Store/vite.config.ts index d789895..47a4547 100644 --- a/libs/Universal-PicGo-Store/vite.config.ts +++ b/libs/Universal-PicGo-Store/vite.config.ts @@ -9,7 +9,9 @@ import livereload from "rollup-plugin-livereload" import { nodePolyfills } from "vite-plugin-node-polyfills" const args = minimist(process.argv.slice(2)) +const isServe = process.env.IS_SERVE const isWatch = args.watch || args.w || false +const isDev = isServe || isWatch const devDistDir = "./dist" const distDir = isWatch ? devDistDir : "./dist" // const distDir = devDistDir @@ -50,7 +52,7 @@ export default defineConfig({ // 构建后是否生成 source map 文件 sourcemap: false, - minify: false, + minify: !isDev, lib: { // Could also be a dictionary or array of multiple entry points diff --git a/packages/picgo-plugin-app/public/libs/imurmurhash-js/imurmurhash.js b/packages/picgo-plugin-app/public/libs/imurmurhash-js/imurmurhash.js deleted file mode 100644 index c412efe..0000000 --- a/packages/picgo-plugin-app/public/libs/imurmurhash-js/imurmurhash.js +++ /dev/null @@ -1,156 +0,0 @@ -/* - * GNU GENERAL PUBLIC LICENSE - * Version 3, 29 June 2007 - * - * Copyright (C) 2024 Terwer, Inc. - * Everyone is permitted to copy and distribute verbatim copies - * of this license document, but changing it is not allowed. - */ - -// This script is copyed from https://raw.githubusercontent.com/jensyt/imurmurhash-js/master/imurmurhash.js -// access iMurmurHash using the global object MurmurHash3 - -/** - * @preserve - * JS Implementation of incremental MurmurHash3 (r150) (as of May 10, 2013) - * - * @author Jens Taylor - * @see http://github.com/homebrewing/brauhaus-diff - * @author Gary Court - * @see http://github.com/garycourt/murmurhash-js - * @author Austin Appleby - * @see http://sites.google.com/site/murmurhash/ - */ -;(function () { - var cache - - // Call this function without `new` to use the cached object (good for - // single-threaded environments), or with `new` to create a new object. - // - // @param {string} key A UTF-16 or ASCII string - // @param {number} seed An optional positive integer - // @return {object} A MurmurHash3 object for incremental hashing - function MurmurHash3(key, seed) { - var m = this instanceof MurmurHash3 ? this : cache - m.reset(seed) - if (typeof key === "string" && key.length > 0) { - m.hash(key) - } - - if (m !== this) { - return m - } - } - - // Incrementally add a string to this hash - // - // @param {string} key A UTF-16 or ASCII string - // @return {object} this - MurmurHash3.prototype.hash = function (key) { - var h1, k1, i, top, len - - len = key.length - this.len += len - - k1 = this.k1 - i = 0 - switch (this.rem) { - case 0: - k1 ^= len > i ? key.charCodeAt(i++) & 0xffff : 0 - case 1: - k1 ^= len > i ? (key.charCodeAt(i++) & 0xffff) << 8 : 0 - case 2: - k1 ^= len > i ? (key.charCodeAt(i++) & 0xffff) << 16 : 0 - case 3: - k1 ^= len > i ? (key.charCodeAt(i) & 0xff) << 24 : 0 - k1 ^= len > i ? (key.charCodeAt(i++) & 0xff00) >> 8 : 0 - } - - this.rem = (len + this.rem) & 3 // & 3 is same as % 4 - len -= this.rem - if (len > 0) { - h1 = this.h1 - while (1) { - k1 = (k1 * 0x2d51 + (k1 & 0xffff) * 0xcc9e0000) & 0xffffffff - k1 = (k1 << 15) | (k1 >>> 17) - k1 = (k1 * 0x3593 + (k1 & 0xffff) * 0x1b870000) & 0xffffffff - - h1 ^= k1 - h1 = (h1 << 13) | (h1 >>> 19) - h1 = (h1 * 5 + 0xe6546b64) & 0xffffffff - - if (i >= len) { - break - } - - k1 = - (key.charCodeAt(i++) & 0xffff) ^ - ((key.charCodeAt(i++) & 0xffff) << 8) ^ - ((key.charCodeAt(i++) & 0xffff) << 16) - top = key.charCodeAt(i++) - k1 ^= ((top & 0xff) << 24) ^ ((top & 0xff00) >> 8) - } - - k1 = 0 - switch (this.rem) { - case 3: - k1 ^= (key.charCodeAt(i + 2) & 0xffff) << 16 - case 2: - k1 ^= (key.charCodeAt(i + 1) & 0xffff) << 8 - case 1: - k1 ^= key.charCodeAt(i) & 0xffff - } - - this.h1 = h1 - } - - this.k1 = k1 - return this - } - - // Get the result of this hash - // - // @return {number} The 32-bit hash - MurmurHash3.prototype.result = function () { - var k1, h1 - - k1 = this.k1 - h1 = this.h1 - - if (k1 > 0) { - k1 = (k1 * 0x2d51 + (k1 & 0xffff) * 0xcc9e0000) & 0xffffffff - k1 = (k1 << 15) | (k1 >>> 17) - k1 = (k1 * 0x3593 + (k1 & 0xffff) * 0x1b870000) & 0xffffffff - h1 ^= k1 - } - - h1 ^= this.len - - h1 ^= h1 >>> 16 - h1 = (h1 * 0xca6b + (h1 & 0xffff) * 0x85eb0000) & 0xffffffff - h1 ^= h1 >>> 13 - h1 = (h1 * 0xae35 + (h1 & 0xffff) * 0xc2b20000) & 0xffffffff - h1 ^= h1 >>> 16 - - return h1 >>> 0 - } - - // Reset the hash object for reuse - // - // @param {number} seed An optional positive integer - MurmurHash3.prototype.reset = function (seed) { - this.h1 = typeof seed === "number" ? seed : 0 - this.rem = this.k1 = this.len = 0 - return this - } - - // A cached object to use. This can be safely used if you're in a single- - // threaded environment, otherwise you need to create new hashes to use. - cache = new MurmurHash3() - - if (typeof module != "undefined") { - module.exports = MurmurHash3 - } else { - this.MurmurHash3 = MurmurHash3 - } -})() diff --git a/packages/picgo-plugin-app/vite.config.ts b/packages/picgo-plugin-app/vite.config.ts index 0b71ee9..7c4898b 100644 --- a/packages/picgo-plugin-app/vite.config.ts +++ b/packages/picgo-plugin-app/vite.config.ts @@ -52,23 +52,8 @@ export default defineConfig(() => ({ }, injectTo: "head-prepend", }, - { - tag: "script", - attrs: { - src: "./libs/imurmurhash-js/imurmurhash.js", - }, - injectTo: "head-prepend", - }, ] - : [ - { - tag: "script", - attrs: { - src: "./libs/imurmurhash-js/imurmurhash.js", - }, - injectTo: "head-prepend", - }, - ], + : [], data: { title: "eruda", injectScript: isDev ? `` : "", From dd73797017630d626390ebf25aef089acfe11cf7 Mon Sep 17 00:00:00 2001 From: terwer Date: Tue, 19 Mar 2024 11:29:48 +0800 Subject: [PATCH 21/34] feat: db support electron and browser --- .../src/lib/base/electron/writeFileAtomic.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/Universal-PicGo-Store/src/lib/base/electron/writeFileAtomic.ts b/libs/Universal-PicGo-Store/src/lib/base/electron/writeFileAtomic.ts index 09d212e..33c4fb9 100644 --- a/libs/Universal-PicGo-Store/src/lib/base/electron/writeFileAtomic.ts +++ b/libs/Universal-PicGo-Store/src/lib/base/electron/writeFileAtomic.ts @@ -106,7 +106,7 @@ async function writeFileAsync(filename: string, data: any, options = {} as any) options.mode = stats.mode } - if (options.chown == null && process.getuid) { + if (options.chown == null && win.process.getuid) { options.chown = { uid: stats.uid, gid: stats.gid } } } From e27c09faeead2b99fa8ffbdc668799851d48ce43 Mon Sep 17 00:00:00 2001 From: terwer Date: Tue, 19 Mar 2024 11:30:22 +0800 Subject: [PATCH 22/34] feat: db support electron and browser --- libs/Universal-PicGo-Core/src/db/browserI18nDb.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/Universal-PicGo-Core/src/db/browserI18nDb.ts b/libs/Universal-PicGo-Core/src/db/browserI18nDb.ts index ce86164..9ee1427 100644 --- a/libs/Universal-PicGo-Core/src/db/browserI18nDb.ts +++ b/libs/Universal-PicGo-Core/src/db/browserI18nDb.ts @@ -20,8 +20,8 @@ class BrowserI18nDb { constructor(ctx: IPicGo) { this.ctx = ctx - const browserI18nForder = browserPathJoin(this.ctx.baseDir, "i18n-cli", "i18n.json") - this.db = new JSONStore(browserI18nForder) + const browserI18nPath = browserPathJoin(this.ctx.baseDir, "i18n-cli", "i18n.json") + this.db = new JSONStore(browserI18nPath) this.safeSet(this.i18nKey, []) } From adfa24e9064b5a6dce10570fb4e9d7bddd976464 Mon Sep 17 00:00:00 2001 From: terwer Date: Tue, 19 Mar 2024 11:46:58 +0800 Subject: [PATCH 23/34] feat: restructure db --- .../src/core/UniversalPicGo.ts | 6 ++--- .../src/db/{db.ts => config/index.ts} | 6 ++--- .../index.ts} | 20 +++++++++----- .../src/{db => i18n}/browserI18nDb.ts | 0 libs/Universal-PicGo-Core/src/i18n/index.ts | 2 +- .../src/lib/PluginLoader.ts | 26 +++---------------- 6 files changed, 25 insertions(+), 35 deletions(-) rename libs/Universal-PicGo-Core/src/db/{db.ts => config/index.ts} (95%) rename libs/Universal-PicGo-Core/src/db/{browserPluginLoderDb.ts => pluginLoder/index.ts} (80%) rename libs/Universal-PicGo-Core/src/{db => i18n}/browserI18nDb.ts (100%) diff --git a/libs/Universal-PicGo-Core/src/core/UniversalPicGo.ts b/libs/Universal-PicGo-Core/src/core/UniversalPicGo.ts index 65c3932..1da84f5 100644 --- a/libs/Universal-PicGo-Core/src/core/UniversalPicGo.ts +++ b/libs/Universal-PicGo-Core/src/core/UniversalPicGo.ts @@ -27,7 +27,7 @@ import { PluginHandler } from "../lib/PluginHandler" import _ from "lodash-es" import getClipboardImage from "../utils/getClipboardImage" import { IBuildInEvent } from "../utils/enums" -import DB from "../db/db" +import ConfigDb from "../db/config" import { hasNodeEnv, win } from "universal-picgo-store" import { ensureFileSync, pathExistsSync } from "../utils/nodeUtils" import { I18nManager } from "../i18n" @@ -43,7 +43,7 @@ import { isConfigKeyInBlackList, isInputConfigValid } from "../utils/common" class UniversalPicGo extends EventEmitter implements IPicGo { private _config!: IConfig private lifecycle!: Lifecycle - private db!: DB + private db!: ConfigDb private _pluginLoader!: PluginLoader configPath: string baseDir!: string @@ -236,7 +236,7 @@ class UniversalPicGo extends EventEmitter implements IPicGo { } private initConfig(): void { - this.db = new DB(this) + this.db = new ConfigDb(this) this._config = this.db.read(true) as IConfig } diff --git a/libs/Universal-PicGo-Core/src/db/db.ts b/libs/Universal-PicGo-Core/src/db/config/index.ts similarity index 95% rename from libs/Universal-PicGo-Core/src/db/db.ts rename to libs/Universal-PicGo-Core/src/db/config/index.ts index 2f0c2e3..f7eb527 100644 --- a/libs/Universal-PicGo-Core/src/db/db.ts +++ b/libs/Universal-PicGo-Core/src/db/config/index.ts @@ -7,10 +7,10 @@ * of this license document, but changing it is not allowed. */ -import { IConfig, IPicGo } from "../types" +import { IConfig, IPicGo } from "../../types" import { IJSON, JSONStore } from "universal-picgo-store" -class DB { +class ConfigDb { private readonly ctx: IPicGo private readonly db: JSONStore @@ -74,4 +74,4 @@ class DB { } } -export default DB +export default ConfigDb diff --git a/libs/Universal-PicGo-Core/src/db/browserPluginLoderDb.ts b/libs/Universal-PicGo-Core/src/db/pluginLoder/index.ts similarity index 80% rename from libs/Universal-PicGo-Core/src/db/browserPluginLoderDb.ts rename to libs/Universal-PicGo-Core/src/db/pluginLoder/index.ts index ab30c1c..524ef5f 100644 --- a/libs/Universal-PicGo-Core/src/db/browserPluginLoderDb.ts +++ b/libs/Universal-PicGo-Core/src/db/pluginLoder/index.ts @@ -7,17 +7,25 @@ * of this license document, but changing it is not allowed. */ -import { IConfig, IPicGo } from "../types" -import { IJSON, JSONStore } from "universal-picgo-store" -import { browserPathJoin } from "../utils/browserUtils" +import { IConfig, IPicGo } from "../../types" +import { hasNodeEnv, IJSON, JSONStore, win } from "universal-picgo-store" +import { browserPathJoin } from "../../utils/browserUtils" -class BrowserPluginLoaderDb { +class PluginLoaderDb { private readonly ctx: IPicGo private readonly db: JSONStore constructor(ctx: IPicGo) { this.ctx = ctx - const packagePath = browserPathJoin(this.ctx.baseDir, "package.json") + let packagePath: string + + if (hasNodeEnv) { + const path = win.require("path") + packagePath = path.join(this.ctx.baseDir, "package.json") + } else { + packagePath = browserPathJoin(this.ctx.baseDir, "package.json") + } + this.db = new JSONStore(packagePath) // const pkg = { @@ -81,4 +89,4 @@ class BrowserPluginLoaderDb { } } -export default BrowserPluginLoaderDb +export default PluginLoaderDb diff --git a/libs/Universal-PicGo-Core/src/db/browserI18nDb.ts b/libs/Universal-PicGo-Core/src/i18n/browserI18nDb.ts similarity index 100% rename from libs/Universal-PicGo-Core/src/db/browserI18nDb.ts rename to libs/Universal-PicGo-Core/src/i18n/browserI18nDb.ts diff --git a/libs/Universal-PicGo-Core/src/i18n/index.ts b/libs/Universal-PicGo-Core/src/i18n/index.ts index da2208a..0386382 100644 --- a/libs/Universal-PicGo-Core/src/i18n/index.ts +++ b/libs/Universal-PicGo-Core/src/i18n/index.ts @@ -17,7 +17,7 @@ import _ from "lodash-es" import { hasNodeEnv, win } from "universal-picgo-store" import { ensureFolderSync, pathExistsSync } from "../utils/nodeUtils" import { browserPathJoin } from "../utils/browserUtils" -import BrowserI18nDb from "../db/browserI18nDb" +import BrowserI18nDb from "./browserI18nDb" const languageList: IStringKeyMap> = { "zh-CN": ZH_CN, diff --git a/libs/Universal-PicGo-Core/src/lib/PluginLoader.ts b/libs/Universal-PicGo-Core/src/lib/PluginLoader.ts index a0da00a..dce45ef 100644 --- a/libs/Universal-PicGo-Core/src/lib/PluginLoader.ts +++ b/libs/Universal-PicGo-Core/src/lib/PluginLoader.ts @@ -8,21 +8,21 @@ */ import { IPicGo, IPicGoPlugin, IPicGoPluginInterface, IPluginLoader } from "../types" -import { hasNodeEnv, win } from "universal-picgo-store" -import BrowserPluginLoaderDb from "../db/browserPluginLoderDb" +import PluginLoaderDb from "../db/pluginLoder" /** * Local plugin loader, file system is required */ export class PluginLoader implements IPluginLoader { private readonly ctx: IPicGo - private browserPluginLoaderDb?: BrowserPluginLoaderDb + private db: PluginLoaderDb private list: string[] = [] private readonly fullList: Set = new Set() private readonly pluginMap: Map = new Map() constructor(ctx: IPicGo) { this.ctx = ctx + this.db = new PluginLoaderDb(this.ctx) this.init() } @@ -52,23 +52,5 @@ export class PluginLoader implements IPluginLoader { // =================================================================================================================== - private init(): void { - if (hasNodeEnv) { - const fs = win.fs - const path = win.require("path") - - const packagePath = path.join(this.ctx.baseDir, "package.json") - if (!fs.existsSync(packagePath)) { - const pkg = { - name: "picgo-plugins", - description: "picgo-plugins", - repository: "https://github.com/PicGo/PicGo-Core", - license: "MIT", - } - fs.writeFileSync(packagePath, JSON.stringify(pkg), "utf8") - } - } else { - this.browserPluginLoaderDb = new BrowserPluginLoaderDb(this.ctx) - } - } + private init(): void {} } From 6789d48d4762efdc2cefd660883f2952891f2f92 Mon Sep 17 00:00:00 2001 From: terwer Date: Tue, 19 Mar 2024 14:23:28 +0800 Subject: [PATCH 24/34] feat: add lifecycle --- .../src/core/Lifecycle.ts | 11 ++ .../src/core/UniversalPicGo.ts | 55 ++++--- libs/Universal-PicGo-Core/src/i18n/index.ts | 2 +- .../src/lib/LifecyclePlugins.ts | 47 ++++-- .../src/lib/PluginLoader.ts | 134 ++++++++++++++++-- .../src/plugins/transformer/base64.ts | 19 +++ .../src/plugins/transformer/index.ts | 21 +++ .../src/plugins/uploader/index.ts | 18 +++ .../Universal-PicGo-Core/src/types/index.d.ts | 6 + libs/Universal-PicGo-Core/src/utils/enums.ts | 7 + .../src/utils/eventBus.ts | 13 ++ .../src/utils/nodeUtils.ts | 20 ++- 12 files changed, 311 insertions(+), 42 deletions(-) create mode 100644 libs/Universal-PicGo-Core/src/plugins/transformer/base64.ts create mode 100644 libs/Universal-PicGo-Core/src/plugins/transformer/index.ts create mode 100644 libs/Universal-PicGo-Core/src/plugins/uploader/index.ts create mode 100644 libs/Universal-PicGo-Core/src/utils/eventBus.ts diff --git a/libs/Universal-PicGo-Core/src/core/Lifecycle.ts b/libs/Universal-PicGo-Core/src/core/Lifecycle.ts index ec5a3dc..140e709 100644 --- a/libs/Universal-PicGo-Core/src/core/Lifecycle.ts +++ b/libs/Universal-PicGo-Core/src/core/Lifecycle.ts @@ -9,8 +9,19 @@ import { EventEmitter } from "../utils/nodePolyfill" import { IPicGo } from "../types" +import { ILogger } from "zhi-lib-base" export class Lifecycle extends EventEmitter { + private readonly ctx: IPicGo + private readonly logger: ILogger + + constructor(ctx: IPicGo) { + super() + this.ctx = ctx + this.logger = this.ctx.getLogger("lifecycle") + this.logger.debug("lifecycle is inited") + } + async start(input: any[]): Promise { throw new Error("Lifecycle.start is not implemented") } diff --git a/libs/Universal-PicGo-Core/src/core/UniversalPicGo.ts b/libs/Universal-PicGo-Core/src/core/UniversalPicGo.ts index 1da84f5..ef173ad 100644 --- a/libs/Universal-PicGo-Core/src/core/UniversalPicGo.ts +++ b/libs/Universal-PicGo-Core/src/core/UniversalPicGo.ts @@ -21,18 +21,21 @@ import { IStringKeyMap, } from "../types" import { Lifecycle } from "./Lifecycle" +import uploaders from "../plugins/uploader" +import transformers from "../plugins/transformer" import { PluginLoader } from "../lib/PluginLoader" -import { LifecyclePlugins } from "../lib/LifecyclePlugins" +import { LifecyclePlugins, setCurrentPluginName } from "../lib/LifecyclePlugins" import { PluginHandler } from "../lib/PluginHandler" import _ from "lodash-es" import getClipboardImage from "../utils/getClipboardImage" -import { IBuildInEvent } from "../utils/enums" +import { IBuildInEvent, IBusEvent } from "../utils/enums" import ConfigDb from "../db/config" import { hasNodeEnv, win } from "universal-picgo-store" import { ensureFileSync, pathExistsSync } from "../utils/nodeUtils" import { I18nManager } from "../i18n" import { browserPathJoin, getBrowserDirectoryPath } from "../utils/browserUtils" import { isConfigKeyInBlackList, isInputConfigValid } from "../utils/common" +import { eventBus } from "../utils/eventBus" /* * 通用 PicGO 对象定义 @@ -55,6 +58,7 @@ class UniversalPicGo extends EventEmitter implements IPicGo { pluginHandler: PluginHandler i18n!: II18nManager VERSION: string = process.env.PICGO_VERSION ?? "unknown" + private readonly isDev: boolean // GUI_VERSION?: string @@ -62,9 +66,14 @@ class UniversalPicGo extends EventEmitter implements IPicGo { return this._pluginLoader } + public getLogger(name?: string): ILogger { + return simpleLogger(name ?? "universal-picgo", "universal-picgo", this.isDev) + } + constructor(configPath = "", isDev?: boolean) { super() - this.log = simpleLogger("universal-picgo-api", "universal-picgo", isDev ?? false) + this.isDev = isDev ?? false + this.log = this.getLogger() this.configPath = configPath this.output = [] this.input = [] @@ -145,10 +154,10 @@ class UniversalPicGo extends EventEmitter implements IPicGo { delete config[name] } _.set(this._config, name, config[name]) - // eventBus.emit(IBusEvent.CONFIG_CHANGE, { - // configName: name, - // value: config[name], - // }) + eventBus.emit(IBusEvent.CONFIG_CHANGE, { + configName: name, + value: config[name], + }) }) } @@ -174,18 +183,24 @@ class UniversalPicGo extends EventEmitter implements IPicGo { throw new Error("image not found in clipboard") } else { this.once(IBuildInEvent.FAILED, () => { - if (!shouldKeepAfterUploading) { - // 删除 picgo 生成的图片文件,例如 `~/.picgo/20200621205720.png` - // fs.remove(imgPath).catch((e) => { - // this.log.error(e) - // }) + if (hasNodeEnv) { + const fs = win.fs + if (!shouldKeepAfterUploading) { + // 删除 picgo 生成的图片文件,例如 `~/.picgo/20200621205720.png` + fs.remove(imgPath).catch((e: any) => { + this.log.error(e) + }) + } } }) this.once("finished", () => { - if (!shouldKeepAfterUploading) { - // fs.remove(imgPath).catch((e) => { - // this.log.error(e) - // }) + if (hasNodeEnv) { + const fs = win.fs + if (!shouldKeepAfterUploading) { + fs.remove(imgPath).catch((e: any) => { + this.log.error(e) + }) + } } }) const { output } = await this.lifecycle.start([imgPath]) @@ -245,6 +260,14 @@ class UniversalPicGo extends EventEmitter implements IPicGo { // init 18n at first this.i18n = new I18nManager(this) this._pluginLoader = new PluginLoader(this) + // load self plugins + setCurrentPluginName("picgo") + uploaders(this).register(this) + transformers(this).register(this) + setCurrentPluginName("") + // load third-party plugins + this._pluginLoader.load() + this.lifecycle = new Lifecycle(this) } catch (e: any) { this.emit(IBuildInEvent.UPLOAD_PROGRESS, -1) this.log.error(e) diff --git a/libs/Universal-PicGo-Core/src/i18n/index.ts b/libs/Universal-PicGo-Core/src/i18n/index.ts index 0386382..d68f71f 100644 --- a/libs/Universal-PicGo-Core/src/i18n/index.ts +++ b/libs/Universal-PicGo-Core/src/i18n/index.ts @@ -91,7 +91,7 @@ class I18nManager implements II18nManager { const path = win.require("path") i18nFolder = path.join(this.ctx.baseDir, "i18n-cli") if (!pathExistsSync(fs, path, i18nFolder)) { - ensureFolderSync(fs, path, i18nFolder) + ensureFolderSync(fs, i18nFolder) } } else { i18nFolder = browserPathJoin(this.ctx.baseDir, "i18n-cli", "i18n.json") diff --git a/libs/Universal-PicGo-Core/src/lib/LifecyclePlugins.ts b/libs/Universal-PicGo-Core/src/lib/LifecyclePlugins.ts index 7f999af..3f83029 100644 --- a/libs/Universal-PicGo-Core/src/lib/LifecyclePlugins.ts +++ b/libs/Universal-PicGo-Core/src/lib/LifecyclePlugins.ts @@ -9,7 +9,7 @@ import { ILifecyclePlugins, IPlugin } from "../types" -export class LifecyclePlugins implements ILifecyclePlugins { +class LifecyclePlugins implements ILifecyclePlugins { static currentPlugin: string | null private readonly list: Map private readonly pluginIdMap: Map @@ -21,27 +21,52 @@ export class LifecyclePlugins implements ILifecyclePlugins { this.pluginIdMap = new Map() } - get(id: string): IPlugin | undefined { - return undefined + getName(): string { + return this.name } - getIdList(): string[] { - return [] + get(id: string): IPlugin | undefined { + return this.list.get(id) } getList(): IPlugin[] { - return [] + return [...this.list.values()] } - getName(): string { - return "" + getIdList(): string[] { + return [...this.list.keys()] } register(id: string, plugin: IPlugin): void { - return + if (!id) throw new TypeError("id is required!") + if (typeof plugin.handle !== "function") throw new TypeError("plugin.handle must be a function!") + if (this.list.has(id)) throw new TypeError(`${this.name} duplicate id: ${id}!`) + this.list.set(id, plugin) + if (LifecyclePlugins.currentPlugin) { + if (this.pluginIdMap.has(LifecyclePlugins.currentPlugin)) { + this.pluginIdMap.get(LifecyclePlugins.currentPlugin)?.push(id) + } else { + this.pluginIdMap.set(LifecyclePlugins.currentPlugin, [id]) + } + } } - unregister(id: string): void { - return + unregister(pluginName: string): void { + if (this.pluginIdMap.has(pluginName)) { + const pluginList = this.pluginIdMap.get(pluginName) + pluginList?.forEach((plugin: string) => { + this.list.delete(plugin) + }) + } } } + +export const setCurrentPluginName = (name: string | null = null): void => { + LifecyclePlugins.currentPlugin = name +} + +export const getCurrentPluginName = (): string | null => { + return LifecyclePlugins.currentPlugin +} + +export { LifecyclePlugins } diff --git a/libs/Universal-PicGo-Core/src/lib/PluginLoader.ts b/libs/Universal-PicGo-Core/src/lib/PluginLoader.ts index dce45ef..550a689 100644 --- a/libs/Universal-PicGo-Core/src/lib/PluginLoader.ts +++ b/libs/Universal-PicGo-Core/src/lib/PluginLoader.ts @@ -9,6 +9,10 @@ import { IPicGo, IPicGoPlugin, IPicGoPluginInterface, IPluginLoader } from "../types" import PluginLoaderDb from "../db/pluginLoder" +import { hasNodeEnv, win } from "universal-picgo-store/src" +import { readJSONSync } from "../utils/nodeUtils" +import { IBuildInEvent } from "../utils/enums" +import { setCurrentPluginName } from "./LifecyclePlugins" /** * Local plugin loader, file system is required @@ -26,31 +30,137 @@ export class PluginLoader implements IPluginLoader { this.init() } - getFullList(): string[] { - return [] + // load all third party plugin + load(): boolean { + if (hasNodeEnv) { + const fs = win.fs + const path = win.require("path") + const packagePath = path.join(this.ctx.baseDir, "package.json") + const pluginDir = path.join(this.ctx.baseDir, "node_modules/") + // Thanks to hexo -> https://github.com/hexojs/hexo/blob/master/lib/hexo/load_plugins.js + if (!fs.existsSync(pluginDir)) { + return false + } + const json = readJSONSync(fs, packagePath) + const deps = Object.keys(json.dependencies || {}) + const devDeps = Object.keys(json.devDependencies || {}) + const modules = deps.concat(devDeps).filter((name: string) => { + if (!/^picgo-plugin-|^@[^/]+\/picgo-plugin-/.test(name)) return false + const path = this.resolvePlugin(this.ctx, name) + return fs.existsSync(path) + }) + for (const module of modules) { + this.registerPlugin(module) + } + return true + } else { + throw new Error("load is not supported in browser") + } } - getList(): string[] { - return [] + registerPlugin(name: string, plugin?: IPicGoPlugin): void { + if (hasNodeEnv) { + if (!name) { + this.ctx.log.warn("Please provide valid plugin") + return + } + this.fullList.add(name) + try { + // register local plugin + if (!plugin) { + if (this.ctx.getConfig(`picgoPlugins.${name}`) || this.ctx.getConfig(`picgoPlugins.${name}`) === undefined) { + this.list.push(name) + setCurrentPluginName(name) + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + this.getPlugin(name)!.register(this.ctx) + const plugin = `picgoPlugins[${name}]` + this.ctx.saveConfig({ + [plugin]: true, + }) + } + } else { + // register provided plugin + // && won't write config to files + this.list.push(name) + setCurrentPluginName(name) + const pluginInterface = plugin(this.ctx) + this.pluginMap.set(name, pluginInterface) + pluginInterface.register(this.ctx) + } + } catch (e) { + this.pluginMap.delete(name) + this.list = this.list.filter((item: string) => item !== name) + this.fullList.delete(name) + this.ctx.log.error(e as Error) + this.ctx.emit(IBuildInEvent.NOTIFICATION, { + title: `Plugin ${name} Load Error`, + body: e, + }) + } + } else { + throw new Error("registerPlugin is not supported in browser") + } } - getPlugin(name: string): IPicGoPluginInterface | undefined { - return undefined + unregisterPlugin(name: string): void { + this.list = this.list.filter((item: string) => item !== name) + this.fullList.delete(name) + this.pluginMap.delete(name) + setCurrentPluginName(name) + this.ctx.helper.uploader.unregister(name) + this.ctx.helper.transformer.unregister(name) + this.ctx.helper.beforeTransformPlugins.unregister(name) + this.ctx.helper.beforeUploadPlugins.unregister(name) + this.ctx.helper.afterUploadPlugins.unregister(name) + // this.ctx.cmd.unregister(name) + this.ctx.removeConfig("picgoPlugins", name) } - hasPlugin(name: string): boolean { - return false + // get plugin by name + getPlugin(name: string): IPicGoPluginInterface | undefined { + if (this.pluginMap.has(name)) { + return this.pluginMap.get(name) + } + if (!hasNodeEnv) { + return undefined + } + + const path = win.require("path") + const pluginDir = path.join(this.ctx.baseDir, "node_modules/") + // eslint-disable-next-line @typescript-eslint/no-var-requires + const plugin = require(pluginDir + name)(this.ctx) + this.pluginMap.set(name, plugin) + return plugin } - registerPlugin(name: string, plugin: IPicGoPlugin | undefined): void { - return + /** + * Get the list of enabled plugins + */ + getList(): string[] { + return this.list } - unregisterPlugin(name: string): void { - return + hasPlugin(name: string): boolean { + return this.fullList.has(name) } + /** + * Get the full list of plugins, whether it is enabled or not + */ + getFullList(): string[] { + return [...this.fullList] + } // =================================================================================================================== private init(): void {} + + // get plugin entry + private resolvePlugin(ctx: IPicGo, name: string): string { + if (hasNodeEnv) { + const path = win.require("path") + return path.join(ctx.baseDir, "node_modules", name) + } else { + throw new Error("resolvePlugin is not supported in browser") + } + } } diff --git a/libs/Universal-PicGo-Core/src/plugins/transformer/base64.ts b/libs/Universal-PicGo-Core/src/plugins/transformer/base64.ts new file mode 100644 index 0000000..1be8efc --- /dev/null +++ b/libs/Universal-PicGo-Core/src/plugins/transformer/base64.ts @@ -0,0 +1,19 @@ +/* + * GNU GENERAL PUBLIC LICENSE + * Version 3, 29 June 2007 + * + * Copyright (C) 2024 Terwer, Inc. + * Everyone is permitted to copy and distribute verbatim copies + * of this license document, but changing it is not allowed. + */ + +import { IPicGo } from "../../types" + +const handle = async (ctx: IPicGo): Promise => { + ctx.output.push(...ctx.input) + return ctx +} + +export default { + handle, +} diff --git a/libs/Universal-PicGo-Core/src/plugins/transformer/index.ts b/libs/Universal-PicGo-Core/src/plugins/transformer/index.ts new file mode 100644 index 0000000..03fcecd --- /dev/null +++ b/libs/Universal-PicGo-Core/src/plugins/transformer/index.ts @@ -0,0 +1,21 @@ +/* + * GNU GENERAL PUBLIC LICENSE + * Version 3, 29 June 2007 + * + * Copyright (C) 2024 Terwer, Inc. + * Everyone is permitted to copy and distribute verbatim copies + * of this license document, but changing it is not allowed. + */ + +import { IPicGo, IPicGoPlugin } from "../../types" +import ImgFromBase64 from "./base64" + +const buildInTransformers: IPicGoPlugin = () => { + return { + register(ctx: IPicGo) { + ctx.helper.transformer.register("base64", ImgFromBase64) + }, + } +} + +export default buildInTransformers diff --git a/libs/Universal-PicGo-Core/src/plugins/uploader/index.ts b/libs/Universal-PicGo-Core/src/plugins/uploader/index.ts new file mode 100644 index 0000000..fad8351 --- /dev/null +++ b/libs/Universal-PicGo-Core/src/plugins/uploader/index.ts @@ -0,0 +1,18 @@ +/* + * GNU GENERAL PUBLIC LICENSE + * Version 3, 29 June 2007 + * + * Copyright (C) 2024 Terwer, Inc. + * Everyone is permitted to copy and distribute verbatim copies + * of this license document, but changing it is not allowed. + */ + +import { IPicGo, IPicGoPlugin } from "../../types" + +const buildInUploaders: IPicGoPlugin = () => { + return { + register(ctx: IPicGo) {}, + } +} + +export default buildInUploaders diff --git a/libs/Universal-PicGo-Core/src/types/index.d.ts b/libs/Universal-PicGo-Core/src/types/index.d.ts index 7f8e642..2317bde 100644 --- a/libs/Universal-PicGo-Core/src/types/index.d.ts +++ b/libs/Universal-PicGo-Core/src/types/index.d.ts @@ -60,6 +60,12 @@ export interface IPicGo extends EventEmitter { // GUI_VERSION?: string i18n: II18nManager + /** + * get logger for debug + * + * @param name - logger bame + */ + getLogger: (name?: string) => ILogger /** * get picgo config */ diff --git a/libs/Universal-PicGo-Core/src/utils/enums.ts b/libs/Universal-PicGo-Core/src/utils/enums.ts index e979401..5e30eb9 100644 --- a/libs/Universal-PicGo-Core/src/utils/enums.ts +++ b/libs/Universal-PicGo-Core/src/utils/enums.ts @@ -22,3 +22,10 @@ export enum IBuildInEvent { UPDATE = "update", NOTIFICATION = "notification", } + +/** + * these events will be catched only by picgo + */ +export enum IBusEvent { + CONFIG_CHANGE = "CONFIG_CHANGE", +} diff --git a/libs/Universal-PicGo-Core/src/utils/eventBus.ts b/libs/Universal-PicGo-Core/src/utils/eventBus.ts new file mode 100644 index 0000000..c38205c --- /dev/null +++ b/libs/Universal-PicGo-Core/src/utils/eventBus.ts @@ -0,0 +1,13 @@ +/* + * GNU GENERAL PUBLIC LICENSE + * Version 3, 29 June 2007 + * + * Copyright (C) 2024 Terwer, Inc. + * Everyone is permitted to copy and distribute verbatim copies + * of this license document, but changing it is not allowed. + */ + +import { EventEmitter } from "./nodePolyfill" + +const eventBus = new EventEmitter() +export { eventBus } diff --git a/libs/Universal-PicGo-Core/src/utils/nodeUtils.ts b/libs/Universal-PicGo-Core/src/utils/nodeUtils.ts index 942939f..52ddcd7 100644 --- a/libs/Universal-PicGo-Core/src/utils/nodeUtils.ts +++ b/libs/Universal-PicGo-Core/src/utils/nodeUtils.ts @@ -48,11 +48,27 @@ export const ensureFileSync = (fs: any, path: any, filePath: string) => { * 确保目录存在 * * @param fs - * @param path * @param dir */ -export const ensureFolderSync = (fs: any, path: any, dir: string) => { +export const ensureFolderSync = (fs: any, dir: string) => { if (!fs.existsSync(dir)) { fs.mkdirSync(dir, { recursive: true }) } } + +/** + * 同步读取 JSON 文件的方法 + * + * @param fs - fs 模块 + * @param filePath - JSON 文件路径 + * @returns - JSON 文件内容转换后的对象,如果出错则返回空对象 {} + */ +export const readJSONSync = (fs: any, filePath: string): any => { + try { + const data = fs.readFileSync(filePath, "utf8") + return JSON.parse(data) + } catch (err: any) { + console.error(`Error reading JSON file: ${err.message}`) + return {} + } +} From 5c131a0b723243be107f4a6fd45b3f2884ed3667 Mon Sep 17 00:00:00 2001 From: terwer Date: Tue, 19 Mar 2024 15:31:05 +0800 Subject: [PATCH 25/34] feat: add clipboard image support --- libs/Universal-PicGo-Core/.eslintrc.cjs | 1 + libs/Universal-PicGo-Core/package.json | 1 + .../src/core/Lifecycle.ts | 128 +++++++++++++++++- libs/Universal-PicGo-Core/src/i18n/index.ts | 4 +- libs/Universal-PicGo-Core/src/index.ts | 2 + .../src/lib/PluginLoader.ts | 6 +- .../src/utils/clipboard/browser.ts | 16 +++ .../src/utils/clipboard/electron.ts | 72 ++++++++++ .../src/utils/clipboard/script/linux.sh | 49 +++++++ .../utils/clipboard/script/mac.applescript | 41 ++++++ .../src/utils/clipboard/script/windows.ps1 | 26 ++++ .../src/utils/clipboard/script/windows10.ps1 | 47 +++++++ .../src/utils/clipboard/script/wsl.sh | 18 +++ libs/Universal-PicGo-Core/src/utils/common.ts | 17 +++ .../src/utils/constants.ts | 10 ++ .../src/utils/createContext.ts | 56 ++++++++ .../src/utils/getClipboardImage.ts | 9 +- .../src/utils/os/index.ts | 36 +++++ .../src/utils/os/is-docker/index.ts | 41 ++++++ .../src/utils/os/is-inside-container/index.ts | 32 +++++ .../src/utils/os/is-wsl/index.ts | 35 +++++ .../src/components/home/BrowserIndex.vue | 39 ++++++ .../src/components/home/ElectronIndex.vue | 39 ++++++ .../picgo-plugin-app/src/pages/PicGoIndex.vue | 24 +--- pnpm-lock.yaml | 3 + 25 files changed, 724 insertions(+), 28 deletions(-) create mode 100644 libs/Universal-PicGo-Core/src/utils/clipboard/browser.ts create mode 100644 libs/Universal-PicGo-Core/src/utils/clipboard/electron.ts create mode 100644 libs/Universal-PicGo-Core/src/utils/clipboard/script/linux.sh create mode 100644 libs/Universal-PicGo-Core/src/utils/clipboard/script/mac.applescript create mode 100644 libs/Universal-PicGo-Core/src/utils/clipboard/script/windows.ps1 create mode 100644 libs/Universal-PicGo-Core/src/utils/clipboard/script/windows10.ps1 create mode 100644 libs/Universal-PicGo-Core/src/utils/clipboard/script/wsl.sh create mode 100644 libs/Universal-PicGo-Core/src/utils/constants.ts create mode 100644 libs/Universal-PicGo-Core/src/utils/createContext.ts create mode 100644 libs/Universal-PicGo-Core/src/utils/os/index.ts create mode 100644 libs/Universal-PicGo-Core/src/utils/os/is-docker/index.ts create mode 100644 libs/Universal-PicGo-Core/src/utils/os/is-inside-container/index.ts create mode 100644 libs/Universal-PicGo-Core/src/utils/os/is-wsl/index.ts create mode 100644 packages/picgo-plugin-app/src/components/home/BrowserIndex.vue create mode 100644 packages/picgo-plugin-app/src/components/home/ElectronIndex.vue diff --git a/libs/Universal-PicGo-Core/.eslintrc.cjs b/libs/Universal-PicGo-Core/.eslintrc.cjs index 41f5589..15a8935 100644 --- a/libs/Universal-PicGo-Core/.eslintrc.cjs +++ b/libs/Universal-PicGo-Core/.eslintrc.cjs @@ -16,6 +16,7 @@ module.exports = { "@typescript-eslint/no-unused-vars": "off", "@typescript-eslint/no-explicit-any": "off", "@typescript-eslint/no-empty-function": "off", + "@typescript-eslint/ban-types": "off", "turbo/no-undeclared-env-vars": "off", "prettier/prettier": "error", }, diff --git a/libs/Universal-PicGo-Core/package.json b/libs/Universal-PicGo-Core/package.json index 64f2418..d8feccc 100644 --- a/libs/Universal-PicGo-Core/package.json +++ b/libs/Universal-PicGo-Core/package.json @@ -31,6 +31,7 @@ }, "dependencies": { "@picgo/i18n": "^1.0.0", + "dayjs": "^1.11.10", "js-yaml": "^4.1.0", "universal-picgo-store": "workspace:*", "zhi-lib-base": "^0.8.0" diff --git a/libs/Universal-PicGo-Core/src/core/Lifecycle.ts b/libs/Universal-PicGo-Core/src/core/Lifecycle.ts index 140e709..61b1728 100644 --- a/libs/Universal-PicGo-Core/src/core/Lifecycle.ts +++ b/libs/Universal-PicGo-Core/src/core/Lifecycle.ts @@ -8,8 +8,11 @@ */ import { EventEmitter } from "../utils/nodePolyfill" -import { IPicGo } from "../types" +import { ILifecyclePlugins, IPicGo, IPlugin, Undefinable } from "../types" import { ILogger } from "zhi-lib-base" +import { createContext } from "../utils/createContext" +import { IBuildInEvent } from "../utils/enums" +import { handleUrlEncode } from "../utils/common" export class Lifecycle extends EventEmitter { private readonly ctx: IPicGo @@ -23,6 +26,127 @@ export class Lifecycle extends EventEmitter { } async start(input: any[]): Promise { - throw new Error("Lifecycle.start is not implemented") + // ensure every upload process has an unique context + const ctx = createContext(this.ctx) + try { + // images input + if (!Array.isArray(input)) { + throw new Error("Input must be an array.") + } + ctx.input = input + ctx.output = [] + + // lifecycle main + await this.beforeTransform(ctx) + await this.doTransform(ctx) + await this.beforeUpload(ctx) + await this.doUpload(ctx) + await this.afterUpload(ctx) + return ctx + } catch (e: any) { + ctx.log.warn(IBuildInEvent.FAILED) + ctx.emit(IBuildInEvent.UPLOAD_PROGRESS, -1) + ctx.emit(IBuildInEvent.FAILED, e) + ctx.log.error(e) + if (ctx.getConfig>("debug")) { + throw e + } + return ctx + } + } + + private async beforeTransform(ctx: IPicGo): Promise { + ctx.emit(IBuildInEvent.UPLOAD_PROGRESS, 0) + ctx.emit(IBuildInEvent.BEFORE_TRANSFORM, ctx) + ctx.log.info("Before transform") + await this.handlePlugins(ctx.helper.beforeTransformPlugins, ctx) + return ctx + } + + private async doTransform(ctx: IPicGo): Promise { + ctx.emit(IBuildInEvent.UPLOAD_PROGRESS, 30) + const type = ctx.getConfig>("picBed.transformer") || "path" + let currentTransformer = type + let transformer = ctx.helper.transformer.get(type) + if (!transformer) { + transformer = ctx.helper.transformer.get("path") + currentTransformer = "path" + ctx.log.warn(`Can't find transformer - ${type}, switch to default transformer - path`) + } + ctx.log.info(`Transforming... Current transformer is [${currentTransformer}]`) + await transformer?.handle(ctx) + return ctx + } + + private async beforeUpload(ctx: IPicGo): Promise { + ctx.emit(IBuildInEvent.UPLOAD_PROGRESS, 60) + ctx.log.info("Before upload") + ctx.emit(IBuildInEvent.BEFORE_UPLOAD, ctx) + await this.handlePlugins(ctx.helper.beforeUploadPlugins, ctx) + return ctx + } + + private async doUpload(ctx: IPicGo): Promise { + let type = + ctx.getConfig>("picBed.uploader") || + ctx.getConfig>("picBed.current") || + "smms" + let uploader = ctx.helper.uploader.get(type) + let currentTransformer = type + if (!uploader) { + type = "smms" + currentTransformer = "smms" + uploader = ctx.helper.uploader.get("smms") + ctx.log.warn(`Can't find uploader - ${type}, switch to default uploader - smms`) + } + ctx.log.info(`Uploading... Current uploader is [${currentTransformer}]`) + await uploader?.handle(ctx) + for (const outputImg of ctx.output) { + outputImg.type = type + } + return ctx + } + + private async afterUpload(ctx: IPicGo): Promise { + ctx.emit(IBuildInEvent.AFTER_UPLOAD, ctx) + ctx.emit(IBuildInEvent.UPLOAD_PROGRESS, 100) + await this.handlePlugins(ctx.helper.afterUploadPlugins, ctx) + let msg = "" + const length = ctx.output.length + // notice, now picgo builtin uploader will encodeOutputURL by default + const isEncodeOutputURL = ctx.getConfig>("settings.encodeOutputURL") === true + for (let i = 0; i < length; i++) { + if (typeof ctx.output[i].imgUrl !== "undefined") { + msg += isEncodeOutputURL ? handleUrlEncode(ctx.output[i].imgUrl!) : ctx.output[i].imgUrl! + if (i !== length - 1) { + msg += "\n" + } + } + delete ctx.output[i].base64Image + delete ctx.output[i].buffer + } + ctx.emit(IBuildInEvent.FINISHED, ctx) + ctx.log.info(`\n${msg}`) + return ctx + } + + // =================================================================================================================== + + private async handlePlugins(lifeCyclePlugins: ILifecyclePlugins, ctx: IPicGo): Promise { + const plugins = lifeCyclePlugins.getList() + const pluginNames = lifeCyclePlugins.getIdList() + const lifeCycleName = lifeCyclePlugins.getName() + await Promise.all( + plugins.map(async (plugin: IPlugin, index: number) => { + try { + ctx.log.info(`${lifeCycleName}: ${pluginNames[index]} running`) + await plugin.handle(ctx) + } catch (e) { + ctx.log.error(`${lifeCycleName}: ${pluginNames[index]} error`) + throw e + } + }) + ) + return ctx } } diff --git a/libs/Universal-PicGo-Core/src/i18n/index.ts b/libs/Universal-PicGo-Core/src/i18n/index.ts index d68f71f..f152e47 100644 --- a/libs/Universal-PicGo-Core/src/i18n/index.ts +++ b/libs/Universal-PicGo-Core/src/i18n/index.ts @@ -90,9 +90,7 @@ class I18nManager implements II18nManager { const fs = win.fs const path = win.require("path") i18nFolder = path.join(this.ctx.baseDir, "i18n-cli") - if (!pathExistsSync(fs, path, i18nFolder)) { - ensureFolderSync(fs, i18nFolder) - } + ensureFolderSync(fs, i18nFolder) } else { i18nFolder = browserPathJoin(this.ctx.baseDir, "i18n-cli", "i18n.json") } diff --git a/libs/Universal-PicGo-Core/src/index.ts b/libs/Universal-PicGo-Core/src/index.ts index e699cf3..79d9188 100644 --- a/libs/Universal-PicGo-Core/src/index.ts +++ b/libs/Universal-PicGo-Core/src/index.ts @@ -1,3 +1,5 @@ import { UniversalPicGo } from "./core/UniversalPicGo" +import { win, hasNodeEnv } from "universal-picgo-store" export { UniversalPicGo } +export { win, hasNodeEnv } diff --git a/libs/Universal-PicGo-Core/src/lib/PluginLoader.ts b/libs/Universal-PicGo-Core/src/lib/PluginLoader.ts index 550a689..ee3279e 100644 --- a/libs/Universal-PicGo-Core/src/lib/PluginLoader.ts +++ b/libs/Universal-PicGo-Core/src/lib/PluginLoader.ts @@ -13,12 +13,14 @@ import { hasNodeEnv, win } from "universal-picgo-store/src" import { readJSONSync } from "../utils/nodeUtils" import { IBuildInEvent } from "../utils/enums" import { setCurrentPluginName } from "./LifecyclePlugins" +import { ILogger } from "zhi-lib-base" /** * Local plugin loader, file system is required */ export class PluginLoader implements IPluginLoader { private readonly ctx: IPicGo + private readonly logger: ILogger private db: PluginLoaderDb private list: string[] = [] private readonly fullList: Set = new Set() @@ -26,6 +28,7 @@ export class PluginLoader implements IPluginLoader { constructor(ctx: IPicGo) { this.ctx = ctx + this.logger = ctx.getLogger("plugin-loader") this.db = new PluginLoaderDb(this.ctx) this.init() } @@ -54,7 +57,8 @@ export class PluginLoader implements IPluginLoader { } return true } else { - throw new Error("load is not supported in browser") + this.logger.warn("load is not supported in browser") + return false } } diff --git a/libs/Universal-PicGo-Core/src/utils/clipboard/browser.ts b/libs/Universal-PicGo-Core/src/utils/clipboard/browser.ts new file mode 100644 index 0000000..42b5c2a --- /dev/null +++ b/libs/Universal-PicGo-Core/src/utils/clipboard/browser.ts @@ -0,0 +1,16 @@ +/* + * GNU GENERAL PUBLIC LICENSE + * Version 3, 29 June 2007 + * + * Copyright (C) 2024 Terwer, Inc. + * Everyone is permitted to copy and distribute verbatim copies + * of this license document, but changing it is not allowed. + */ + +import { IClipboardImage, IPicGo } from "../../types" + +const getClipboardImageBrowser = async (ctx: IPicGo): Promise => { + throw new Error("getClipboardImage is not supported in browser") +} + +export { getClipboardImageBrowser } diff --git a/libs/Universal-PicGo-Core/src/utils/clipboard/electron.ts b/libs/Universal-PicGo-Core/src/utils/clipboard/electron.ts new file mode 100644 index 0000000..aa876ef --- /dev/null +++ b/libs/Universal-PicGo-Core/src/utils/clipboard/electron.ts @@ -0,0 +1,72 @@ +/* + * GNU GENERAL PUBLIC LICENSE + * Version 3, 29 June 2007 + * + * Copyright (C) 2024 Terwer, Inc. + * Everyone is permitted to copy and distribute verbatim copies + * of this license document, but changing it is not allowed. + */ + +import { IClipboardImage, IPicGo } from "../../types" +import { win } from "universal-picgo-store" +import { CLIPBOARD_IMAGE_FOLDER } from "../constants" +import { ensureFolderSync } from "../nodeUtils" +import dayjs from "dayjs" +import { getCurrentPlatform, Platform } from "../os" +import macClipboardScript from "./script/mac.applescript?raw" +import windowsClipboardScript from "./script/windows.ps1?raw" +import windows10ClipboardScript from "./script/windows10.ps1?raw" +import linuxClipboardScript from "./script/linux.sh?raw" +import wslClipboardScript from "./script/wsl.sh?raw" + +const platform2ScriptContent: { + [key in Platform]: string +} = { + darwin: macClipboardScript, + win32: windowsClipboardScript, + win10: windows10ClipboardScript, + linux: linuxClipboardScript, + wsl: wslClipboardScript, +} + +/** + * powershell will report error if file does not have a '.ps1' extension, + * so we should keep the extension name consistent with corresponding shell + */ +const platform2ScriptFilename: { + [key in Platform]: string +} = { + darwin: "mac.applescript", + win32: "windows.ps1", + win10: "windows10.ps1", + linux: "linux.sh", + wsl: "wsl.sh", +} + +const createImageFolder = (ctx: IPicGo): void => { + const fs = win.fs + const path = win.require("path") + const imagePath = path.join(ctx.baseDir, CLIPBOARD_IMAGE_FOLDER) + ensureFolderSync(fs, imagePath) +} + +const getClipboardImageElectron = async (ctx: IPicGo): Promise => { + const fs = win.fs + const path = win.require("path") + + createImageFolder(ctx) + // add an clipboard image folder to control the image cache file + const imagePath = path.join(ctx.baseDir, CLIPBOARD_IMAGE_FOLDER, `${dayjs().format("YYYYMMDDHHmmss")}.png`) + return await new Promise((resolve: Function, reject: Function): void => { + const platform = getCurrentPlatform() + const scriptPath = path.join(ctx.baseDir, platform2ScriptFilename[platform]) + // If the script does not exist yet, we need to write the content to the script file + if (!fs.existsSync(scriptPath)) { + fs.writeFileSync(scriptPath, platform2ScriptContent[platform], "utf8") + } + + throw new Error("开发中...") + }) +} + +export { getClipboardImageElectron } diff --git a/libs/Universal-PicGo-Core/src/utils/clipboard/script/linux.sh b/libs/Universal-PicGo-Core/src/utils/clipboard/script/linux.sh new file mode 100644 index 0000000..5c7914a --- /dev/null +++ b/libs/Universal-PicGo-Core/src/utils/clipboard/script/linux.sh @@ -0,0 +1,49 @@ +#!/bin/sh + +if [ -z "$DISPLAY" ]; then + echo "no support" >&2 + exit 1 +fi + +case "$XDG_SESSION_TYPE" in +wayland) + command -v wl-copy >/dev/null 2>&1 || { + echo >&2 "no wl-clipboard" + exit 1 + } + filePath=$(wl-copy -o 2>/dev/null | grep ^file:// | cut -c8-) + if [ -z "$filePath" ]; then + if + wl-copy -t image/png image/png -o >"$1" 2>/dev/null + then + echo "$1" + else + rm -f "$1" + echo "no image" + fi + else + echo "$filePath" + fi + ;; +x11 | tty) + # require xclip(see http://stackoverflow.com/questions/592620/check-if-a-program-exists-from-a-bash-script/677212#677212) + command -v xclip >/dev/null 2>&1 || { + echo >&2 "no xclip" + exit 1 + } + # write image in clipboard to file (see http://unix.stackexchange.com/questions/145131/copy-image-from-clipboard-to-file) + filePath=$(xclip -selection clipboard -o 2>/dev/null | grep ^file:// | cut -c8-) + if [ -z "$filePath" ]; then + if + xclip -selection clipboard -target image/png -o >"$1" 2>/dev/null + then + echo "$1" + else + rm -f "$1" + echo "no image" + fi + else + echo "$filePath" + fi + ;; +esac diff --git a/libs/Universal-PicGo-Core/src/utils/clipboard/script/mac.applescript b/libs/Universal-PicGo-Core/src/utils/clipboard/script/mac.applescript new file mode 100644 index 0000000..1bb0b72 --- /dev/null +++ b/libs/Universal-PicGo-Core/src/utils/clipboard/script/mac.applescript @@ -0,0 +1,41 @@ +-- From https://github.com/mushanshitiancai/vscode-paste-image +property fileTypes : {{«class PNGf», ".png"}} + +on run argv + if argv is {} then + return "" + end if + + if ((clipboard info) as string) contains "«class furl»" then + return POSIX path of (the clipboard as «class furl») + else + set imagePath to (item 1 of argv) + set theType to getType() + + if theType is not missing value then + try + set myFile to (open for access imagePath with write permission) + set eof myFile to 0 + write (the clipboard as (first item of theType)) to myFile + close access myFile + return (POSIX path of imagePath) + on error + try + close access myFile + end try + return "no image" + end try + else + return "no image" + end if + end if +end run + +on getType() + repeat with aType in fileTypes + repeat with theInfo in (clipboard info) + if (first item of theInfo) is equal to (first item of aType) then return aType + end repeat + end repeat + return missing value +end getType diff --git a/libs/Universal-PicGo-Core/src/utils/clipboard/script/windows.ps1 b/libs/Universal-PicGo-Core/src/utils/clipboard/script/windows.ps1 new file mode 100644 index 0000000..480b58f --- /dev/null +++ b/libs/Universal-PicGo-Core/src/utils/clipboard/script/windows.ps1 @@ -0,0 +1,26 @@ + +param($imagePath) + +# Adapted from https://github.com/octan3/img-clipboard-dump/blob/master/dump-clipboard-png.ps1 + +Add-Type -Assembly PresentationCore +$img = [Windows.Clipboard]::GetImage() + +if ($img -eq $null) { + "no image" + Exit 1 +} + +if (-not $imagePath) { + "no image" + Exit 1 +} + +$fcb = new-object Windows.Media.Imaging.FormatConvertedBitmap($img, [Windows.Media.PixelFormats]::Rgb24, $null, 0) +$stream = [IO.File]::Open($imagePath, "OpenOrCreate") +$encoder = New-Object Windows.Media.Imaging.PngBitmapEncoder +$encoder.Frames.Add([Windows.Media.Imaging.BitmapFrame]::Create($fcb)) | out-null +$encoder.Save($stream) | out-null +$stream.Dispose() | out-null + +$imagePath diff --git a/libs/Universal-PicGo-Core/src/utils/clipboard/script/windows10.ps1 b/libs/Universal-PicGo-Core/src/utils/clipboard/script/windows10.ps1 new file mode 100644 index 0000000..cadeb72 --- /dev/null +++ b/libs/Universal-PicGo-Core/src/utils/clipboard/script/windows10.ps1 @@ -0,0 +1,47 @@ +# Adapted from https://github.com/octan3/img-clipboard-dump/blob/master/dump-clipboard-png.ps1 +param($imagePath) + +# https://github.com/PowerShell/PowerShell/issues/7233 +# fix the output encoding bug +[console]::InputEncoding = [console]::OutputEncoding = New-Object System.Text.UTF8Encoding + +Add-Type -Assembly PresentationCore +function main { + $img = [Windows.Clipboard]::GetImage() + + if ($img -eq $null) { + "no image" + Exit 1 + } + + if (-not $imagePath) { + "no image" + Exit 1 + } + + $fcb = new-object Windows.Media.Imaging.FormatConvertedBitmap($img, [Windows.Media.PixelFormats]::Rgb24, $null, 0) + $stream = [IO.File]::Open($imagePath, "OpenOrCreate") + $encoder = New-Object Windows.Media.Imaging.PngBitmapEncoder + $encoder.Frames.Add([Windows.Media.Imaging.BitmapFrame]::Create($fcb)) | out-null + $encoder.Save($stream) | out-null + $stream.Dispose() | out-null + + $imagePath + # fix windows 10 native cmd crash bug when "picgo upload" + # https://github.com/PicGo/PicGo-Core/issues/32 + Exit 1 +} + +try { + # For WIN10 + $file = Get-Clipboard -Format FileDropList + if ($file -ne $null) { + Convert-Path $file + Exit 1 + } +} catch { + # For WIN7 WIN8 WIN10 + main +} + +main \ No newline at end of file diff --git a/libs/Universal-PicGo-Core/src/utils/clipboard/script/wsl.sh b/libs/Universal-PicGo-Core/src/utils/clipboard/script/wsl.sh new file mode 100644 index 0000000..649ccd0 --- /dev/null +++ b/libs/Universal-PicGo-Core/src/utils/clipboard/script/wsl.sh @@ -0,0 +1,18 @@ +#!/bin/sh +# grab the paths +scriptPath=$(echo $0 | awk '{ print substr( $0, 1, length($0)-6 ) }')"windows10.ps1" +imagePath=$(echo $1 | awk '{ print substr( $0, 1, length($0)-18 ) }') +imageName=$(echo $1 | awk '{ print substr( $0, length($0)-17, length($0) ) }') + +# run the powershell script +res=$(powershell.exe -noprofile -noninteractive -nologo -sta -executionpolicy unrestricted -file $(wslpath -w $scriptPath) $(wslpath -w $imagePath)"\\"$imageName) + +# note that there is a return symbol in powershell result +noImage=$(echo "no image\r") + +# check whether image exists +if [ "$res" = "$noImage" ] ;then + echo "no image" +else + echo $(wslpath -u -a "${res}") +fi diff --git a/libs/Universal-PicGo-Core/src/utils/common.ts b/libs/Universal-PicGo-Core/src/utils/common.ts index 6b0e34e..363a7e6 100644 --- a/libs/Universal-PicGo-Core/src/utils/common.ts +++ b/libs/Universal-PicGo-Core/src/utils/common.ts @@ -10,6 +10,23 @@ import { IPluginNameType } from "../types" import { hasNodeEnv, win } from "universal-picgo-store" +export const isUrlEncode = (url: string): boolean => { + url = url || "" + try { + // the whole url encode or decode shold not use encodeURIComponent or decodeURIComponent + return url !== decodeURI(url) + } catch (e) { + // if some error caught, try to let it go + return false + } +} +export const handleUrlEncode = (url: string): string => { + if (!isUrlEncode(url)) { + url = encodeURI(url) + } + return url +} + /** * detect the input string's type * for example diff --git a/libs/Universal-PicGo-Core/src/utils/constants.ts b/libs/Universal-PicGo-Core/src/utils/constants.ts new file mode 100644 index 0000000..7e2fc79 --- /dev/null +++ b/libs/Universal-PicGo-Core/src/utils/constants.ts @@ -0,0 +1,10 @@ +/* + * GNU GENERAL PUBLIC LICENSE + * Version 3, 29 June 2007 + * + * Copyright (C) 2024 Terwer, Inc. + * Everyone is permitted to copy and distribute verbatim copies + * of this license document, but changing it is not allowed. + */ + +export const CLIPBOARD_IMAGE_FOLDER = "picgo-clipboard-images" diff --git a/libs/Universal-PicGo-Core/src/utils/createContext.ts b/libs/Universal-PicGo-Core/src/utils/createContext.ts new file mode 100644 index 0000000..32c61fa --- /dev/null +++ b/libs/Universal-PicGo-Core/src/utils/createContext.ts @@ -0,0 +1,56 @@ +/* + * GNU GENERAL PUBLIC LICENSE + * Version 3, 29 June 2007 + * + * Copyright (C) 2024 Terwer, Inc. + * Everyone is permitted to copy and distribute verbatim copies + * of this license document, but changing it is not allowed. + */ + +import { IPicGo } from "../types" + +/** + * create an unique context for each upload process + * + * @param ctx + */ +const createContext = (ctx: IPicGo): IPicGo => { + return { + configPath: ctx.configPath, + baseDir: ctx.baseDir, + log: ctx.log, + // cmd: ctx.cmd, + output: [], + input: [], + pluginLoader: ctx.pluginLoader, + pluginHandler: ctx.pluginHandler, + helper: ctx.helper, + VERSION: ctx.VERSION, + // GUI_VERSION: ctx.GUI_VERSION, + i18n: ctx.i18n, + getLogger: ctx.getLogger.bind(ctx), + getConfig: ctx.getConfig.bind(ctx), + saveConfig: ctx.saveConfig.bind(ctx), + removeConfig: ctx.removeConfig.bind(ctx), + setConfig: ctx.setConfig.bind(ctx), + unsetConfig: ctx.unsetConfig.bind(ctx), + upload: ctx.upload.bind(ctx), + addListener: ctx.addListener.bind(ctx), + on: ctx.on.bind(ctx), + once: ctx.once.bind(ctx), + removeListener: ctx.removeListener.bind(ctx), + off: ctx.off.bind(ctx), + removeAllListeners: ctx.removeAllListeners.bind(ctx), + setMaxListeners: ctx.setMaxListeners.bind(ctx), + getMaxListeners: ctx.getMaxListeners.bind(ctx), + listeners: ctx.listeners.bind(ctx), + rawListeners: ctx.rawListeners.bind(ctx), + emit: ctx.emit.bind(ctx), + listenerCount: ctx.listenerCount.bind(ctx), + prependListener: ctx.prependListener.bind(ctx), + prependOnceListener: ctx.prependOnceListener.bind(ctx), + eventNames: ctx.eventNames.bind(ctx), + } +} + +export { createContext } diff --git a/libs/Universal-PicGo-Core/src/utils/getClipboardImage.ts b/libs/Universal-PicGo-Core/src/utils/getClipboardImage.ts index 3830d1d..3ba71dc 100644 --- a/libs/Universal-PicGo-Core/src/utils/getClipboardImage.ts +++ b/libs/Universal-PicGo-Core/src/utils/getClipboardImage.ts @@ -8,10 +8,17 @@ */ import { IClipboardImage, IPicGo } from "../types" +import { hasNodeEnv } from "universal-picgo-store" +import { getClipboardImageElectron } from "./clipboard/electron" +import { getClipboardImageBrowser } from "./clipboard/browser" // Thanks to vs-picgo: https://github.com/Spades-S/vs-picgo/blob/master/src/extension.ts const getClipboardImage = async (ctx: IPicGo): Promise => { - throw new Error("getClipboardImage Not Implemented") + if (hasNodeEnv) { + return await getClipboardImageElectron(ctx) + } else { + return await getClipboardImageBrowser(ctx) + } } export default getClipboardImage diff --git a/libs/Universal-PicGo-Core/src/utils/os/index.ts b/libs/Universal-PicGo-Core/src/utils/os/index.ts new file mode 100644 index 0000000..e29b289 --- /dev/null +++ b/libs/Universal-PicGo-Core/src/utils/os/index.ts @@ -0,0 +1,36 @@ +/* + * GNU GENERAL PUBLIC LICENSE + * Version 3, 29 June 2007 + * + * Copyright (C) 2024 Terwer, Inc. + * Everyone is permitted to copy and distribute verbatim copies + * of this license document, but changing it is not allowed. + */ + +import { isWsl } from "./is-wsl" +import { win } from "universal-picgo-store" + +export type Platform = "darwin" | "win32" | "win10" | "linux" | "wsl" + +const getCurrentPlatform = (): Platform => { + const os = win.require("os") + + const platform = win.process.platform + if (isWsl()) { + return "wsl" + } + if (platform === "win32") { + const currentOS = os.release().split(".")[0] + if (currentOS === "10") { + return "win10" + } else { + return "win32" + } + } else if (platform === "darwin") { + return "darwin" + } else { + return "linux" + } +} + +export { getCurrentPlatform } diff --git a/libs/Universal-PicGo-Core/src/utils/os/is-docker/index.ts b/libs/Universal-PicGo-Core/src/utils/os/is-docker/index.ts new file mode 100644 index 0000000..c43e372 --- /dev/null +++ b/libs/Universal-PicGo-Core/src/utils/os/is-docker/index.ts @@ -0,0 +1,41 @@ +/* + * GNU GENERAL PUBLIC LICENSE + * Version 3, 29 June 2007 + * + * Copyright (C) 2024 Terwer, Inc. + * Everyone is permitted to copy and distribute verbatim copies + * of this license document, but changing it is not allowed. + */ + +import { win } from "universal-picgo-store" + +let isDockerCached: boolean + +function hasDockerEnv() { + try { + const fs = win.fs + fs.statSync("/.dockerenv") + return true + } catch { + return false + } +} + +function hasDockerCGroup() { + try { + const fs = win.fs + return fs.readFileSync("/proc/self/cgroup", "utf8").includes("docker") + } catch { + return false + } +} + +const isDocker = () => { + if (isDockerCached === undefined) { + isDockerCached = hasDockerEnv() || hasDockerCGroup() + } + + return isDockerCached +} + +export { isDocker } diff --git a/libs/Universal-PicGo-Core/src/utils/os/is-inside-container/index.ts b/libs/Universal-PicGo-Core/src/utils/os/is-inside-container/index.ts new file mode 100644 index 0000000..394f433 --- /dev/null +++ b/libs/Universal-PicGo-Core/src/utils/os/is-inside-container/index.ts @@ -0,0 +1,32 @@ +/* + * GNU GENERAL PUBLIC LICENSE + * Version 3, 29 June 2007 + * + * Copyright (C) 2024 Terwer, Inc. + * Everyone is permitted to copy and distribute verbatim copies + * of this license document, but changing it is not allowed. + */ + +import { win } from "universal-picgo-store" +import { isDocker } from "../is-docker" + +let cachedResult: boolean + +// Podman detection +const hasContainerEnv = () => { + try { + const fs = win.fs + fs.statSync("/run/.containerenv") + return true + } catch { + return false + } +} + +export default function isInsideContainer() { + if (cachedResult === undefined) { + cachedResult = hasContainerEnv() || isDocker() + } + + return cachedResult +} diff --git a/libs/Universal-PicGo-Core/src/utils/os/is-wsl/index.ts b/libs/Universal-PicGo-Core/src/utils/os/is-wsl/index.ts new file mode 100644 index 0000000..03e7d06 --- /dev/null +++ b/libs/Universal-PicGo-Core/src/utils/os/is-wsl/index.ts @@ -0,0 +1,35 @@ +/* + * GNU GENERAL PUBLIC LICENSE + * Version 3, 29 June 2007 + * + * Copyright (C) 2024 Terwer, Inc. + * Everyone is permitted to copy and distribute verbatim copies + * of this license document, but changing it is not allowed. + */ + +import isInsideContainer from "../is-inside-container" +import { win } from "universal-picgo-store" + +const isWsl = () => { + const fs = win.fs + const os = win.require("os") + if (win.process.platform !== "linux") { + return false + } + + if (os.release().toLowerCase().includes("microsoft")) { + if (isInsideContainer()) { + return false + } + + return true + } + + try { + return fs.readFileSync("/proc/version", "utf8").toLowerCase().includes("microsoft") ? !isInsideContainer() : false + } catch { + return false + } +} + +export { isWsl } diff --git a/packages/picgo-plugin-app/src/components/home/BrowserIndex.vue b/packages/picgo-plugin-app/src/components/home/BrowserIndex.vue new file mode 100644 index 0000000..547d37f --- /dev/null +++ b/packages/picgo-plugin-app/src/components/home/BrowserIndex.vue @@ -0,0 +1,39 @@ + + + + + + + diff --git a/packages/picgo-plugin-app/src/components/home/ElectronIndex.vue b/packages/picgo-plugin-app/src/components/home/ElectronIndex.vue new file mode 100644 index 0000000..b24aace --- /dev/null +++ b/packages/picgo-plugin-app/src/components/home/ElectronIndex.vue @@ -0,0 +1,39 @@ + + + + + + + diff --git a/packages/picgo-plugin-app/src/pages/PicGoIndex.vue b/packages/picgo-plugin-app/src/pages/PicGoIndex.vue index 2f6a4e1..ea184e4 100644 --- a/packages/picgo-plugin-app/src/pages/PicGoIndex.vue +++ b/packages/picgo-plugin-app/src/pages/PicGoIndex.vue @@ -8,31 +8,13 @@ --> diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8e9493a..6970705 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -23,6 +23,9 @@ importers: '@picgo/i18n': specifier: ^1.0.0 version: 1.0.0 + dayjs: + specifier: ^1.11.10 + version: 1.11.10 js-yaml: specifier: ^4.1.0 version: 4.1.0 From 7b986abc68f52e0d2be9a68a73b5f51603da2e7f Mon Sep 17 00:00:00 2001 From: terwer Date: Tue, 19 Mar 2024 15:51:43 +0800 Subject: [PATCH 26/34] feat: save clipboard image --- libs/Universal-PicGo-Core/README.md | 15 ++++- .../src/utils/clipboard/electron.ts | 60 ++++++++++++++++++- packages/picgo-plugin-app/README.md | 8 ++- .../src/components/home/BrowserIndex.vue | 9 +-- .../src/components/home/ElectronIndex.vue | 9 +-- 5 files changed, 89 insertions(+), 12 deletions(-) diff --git a/libs/Universal-PicGo-Core/README.md b/libs/Universal-PicGo-Core/README.md index bfea3b6..97e0ab9 100644 --- a/libs/Universal-PicGo-Core/README.md +++ b/libs/Universal-PicGo-Core/README.md @@ -6,12 +6,23 @@ picgo lib for node, browser and electron ```js // usage +import { UniversalPicGo } from "universal-picgo" + +try { + const picgo = new UniversalPicGo() + console.log("picgo =>", picgo) + + const result = await picgo.upload() + console.log("upload success =>", result) +} catch (e: any) { + console.error(e) +} ``` ## Deps ``` -## Congregations! universal-picgo need no deps, it is just pure js code 🎉 +├── universal-picgo-store ``` ## Dev @@ -38,4 +49,4 @@ pnpm test -F universal-picgo ```bash pnpm publish -F universal-picgo --tag latest -``` \ No newline at end of file +``` diff --git a/libs/Universal-PicGo-Core/src/utils/clipboard/electron.ts b/libs/Universal-PicGo-Core/src/utils/clipboard/electron.ts index aa876ef..91bfdea 100644 --- a/libs/Universal-PicGo-Core/src/utils/clipboard/electron.ts +++ b/libs/Universal-PicGo-Core/src/utils/clipboard/electron.ts @@ -18,6 +18,7 @@ import windowsClipboardScript from "./script/windows.ps1?raw" import windows10ClipboardScript from "./script/windows10.ps1?raw" import linuxClipboardScript from "./script/linux.sh?raw" import wslClipboardScript from "./script/wsl.sh?raw" +import { IBuildInEvent } from "../enums" const platform2ScriptContent: { [key in Platform]: string @@ -53,6 +54,7 @@ const createImageFolder = (ctx: IPicGo): void => { const getClipboardImageElectron = async (ctx: IPicGo): Promise => { const fs = win.fs const path = win.require("path") + const { spawn } = win.require("child_process") createImageFolder(ctx) // add an clipboard image folder to control the image cache file @@ -65,7 +67,63 @@ const getClipboardImageElectron = async (ctx: IPicGo): Promise fs.writeFileSync(scriptPath, platform2ScriptContent[platform], "utf8") } - throw new Error("开发中...") + let execution + if (platform === "darwin") { + execution = spawn("osascript", [scriptPath, imagePath]) + } else if (platform === "win32" || platform === "win10") { + execution = spawn("powershell", [ + "-noprofile", + "-noninteractive", + "-nologo", + "-sta", + "-executionpolicy", + "unrestricted", + // fix windows 10 native cmd crash bug when "picgo upload" + // https://github.com/PicGo/PicGo-Core/issues/32 + // '-windowstyle','hidden', + // '-noexit', + "-file", + scriptPath, + imagePath, + ]) + } else { + execution = spawn("sh", [scriptPath, imagePath]) + } + + execution.stdout.on("data", (data: typeof win.Buffer) => { + if (platform === "linux") { + if (data.toString().trim() === "no xclip or wl-clipboard") { + ctx.emit(IBuildInEvent.NOTIFICATION, { + title: "xclip or wl-clipboard not found", + body: "Please install xclip(for x11) or wl-clipboard(for wayland) before run picgo", + }) + return reject(new Error("Please install xclip(for x11) or wl-clipboard(for wayland) before run picgo")) + } + } + const imgPath = data.toString().trim() + + // if the filePath is the real file in system + // we should keep it instead of removing + let shouldKeepAfterUploading = false + + // in macOS if your copy the file in system, it's basename will not equal to our default basename + if (path.basename(imgPath) !== path.basename(imagePath)) { + // if the path is not generate by picgo + // but the path exists, we should keep it + if (fs.existsSync(imgPath)) { + shouldKeepAfterUploading = true + } + } + // if the imgPath is invalid + if (imgPath !== "no image" && !fs.existsSync(imgPath)) { + return reject(new Error(`Can't find ${imgPath}`)) + } + + resolve({ + imgPath, + shouldKeepAfterUploading, + }) + }) }) } diff --git a/packages/picgo-plugin-app/README.md b/packages/picgo-plugin-app/README.md index 5da65ec..655e3d7 100644 --- a/packages/picgo-plugin-app/README.md +++ b/packages/picgo-plugin-app/README.md @@ -1,3 +1,9 @@ # picgo-plugin-app -picgo plugin app for siyuan-note \ No newline at end of file +picgo plugin app for siyuan-note + +## Deps + +``` +├── universal-picgo +``` \ No newline at end of file diff --git a/packages/picgo-plugin-app/src/components/home/BrowserIndex.vue b/packages/picgo-plugin-app/src/components/home/BrowserIndex.vue index 547d37f..7558d38 100644 --- a/packages/picgo-plugin-app/src/components/home/BrowserIndex.vue +++ b/packages/picgo-plugin-app/src/components/home/BrowserIndex.vue @@ -15,16 +15,17 @@ import { UniversalPicGo } from "universal-picgo" const logger = createAppLogger("picgo-browser-index") -const handleTest = () => { +const handleTest = async () => { try { const picgo = new UniversalPicGo("", isDev) logger.debug("picgo =>", picgo) - picgo.upload() - ElMessage.success("success") + const result = await picgo.upload() + logger.info("upload success =>", result) + ElMessage.success("upload success") } catch (e: any) { - ElMessage.error(e.toString()) logger.error(e) + ElMessage.error(e.toString()) } } diff --git a/packages/picgo-plugin-app/src/components/home/ElectronIndex.vue b/packages/picgo-plugin-app/src/components/home/ElectronIndex.vue index b24aace..55197fc 100644 --- a/packages/picgo-plugin-app/src/components/home/ElectronIndex.vue +++ b/packages/picgo-plugin-app/src/components/home/ElectronIndex.vue @@ -15,16 +15,17 @@ import { UniversalPicGo } from "universal-picgo" const logger = createAppLogger("picgo-electron-index") -const handleTest = () => { +const handleTest = async () => { try { const picgo = new UniversalPicGo("", isDev) logger.debug("picgo =>", picgo) - picgo.upload() - ElMessage.success("success") + const result = await picgo.upload() + logger.info("upload success =>", result) + ElMessage.success("upload success") } catch (e: any) { - ElMessage.error(e.toString()) logger.error(e) + ElMessage.error(e.toString()) } } From a570bca0928e8cdbca78852c47c2fd7f51555c93 Mon Sep 17 00:00:00 2001 From: terwer Date: Tue, 19 Mar 2024 18:02:43 +0800 Subject: [PATCH 27/34] feat: add transformer --- libs/Universal-PicGo-Core/package.json | 1 + .../src/core/Lifecycle.ts | 6 +- .../src/core/UniversalPicGo.ts | 4 +- .../src/lib/PluginLoader.ts | 2 +- .../src/plugins/transformer/index.ts | 2 + .../src/plugins/transformer/path.ts | 67 ++++++++ .../src/plugins/uploader/smms.ts | 104 ++++++++++++ .../Universal-PicGo-Core/src/types/index.d.ts | 14 ++ .../src/utils/clipboard/electron.ts | 36 +++- libs/Universal-PicGo-Core/src/utils/common.ts | 106 +++++++++++- .../src/utils/image-size/detector.ts | 40 +++++ .../src/utils/image-size/index.ts | 158 ++++++++++++++++++ .../src/utils/image-size/types/bmp.ts | 11 ++ .../src/utils/image-size/types/cur.ts | 17 ++ .../src/utils/image-size/types/dds.ts | 11 ++ .../src/utils/image-size/types/gif.ts | 12 ++ .../src/utils/image-size/types/heif.ts | 36 ++++ .../src/utils/image-size/types/icns.ts | 107 ++++++++++++ .../src/utils/image-size/types/ico.ts | 75 +++++++++ .../src/utils/image-size/types/index.ts | 42 +++++ .../src/utils/image-size/types/interface.ts | 17 ++ .../src/utils/image-size/types/j2c.ts | 12 ++ .../src/utils/image-size/types/jp2.ts | 23 +++ .../src/utils/image-size/types/jpg.ts | 150 +++++++++++++++++ .../src/utils/image-size/types/ktx.ts | 19 +++ .../src/utils/image-size/types/png.ts | 37 ++++ .../src/utils/image-size/types/pnm.ts | 78 +++++++++ .../src/utils/image-size/types/psd.ts | 11 ++ .../src/utils/image-size/types/svg.ts | 105 ++++++++++++ .../src/utils/image-size/types/tga.ts | 15 ++ .../src/utils/image-size/types/tiff.ts | 113 +++++++++++++ .../src/utils/image-size/types/utils.ts | 65 +++++++ .../src/utils/image-size/types/webp.ts | 66 ++++++++ .../src/lib/base/electron/writeFileAtomic.ts | 5 +- pnpm-lock.yaml | 7 + 35 files changed, 1567 insertions(+), 7 deletions(-) create mode 100644 libs/Universal-PicGo-Core/src/plugins/transformer/path.ts create mode 100644 libs/Universal-PicGo-Core/src/plugins/uploader/smms.ts create mode 100644 libs/Universal-PicGo-Core/src/utils/image-size/detector.ts create mode 100644 libs/Universal-PicGo-Core/src/utils/image-size/index.ts create mode 100644 libs/Universal-PicGo-Core/src/utils/image-size/types/bmp.ts create mode 100644 libs/Universal-PicGo-Core/src/utils/image-size/types/cur.ts create mode 100644 libs/Universal-PicGo-Core/src/utils/image-size/types/dds.ts create mode 100644 libs/Universal-PicGo-Core/src/utils/image-size/types/gif.ts create mode 100644 libs/Universal-PicGo-Core/src/utils/image-size/types/heif.ts create mode 100644 libs/Universal-PicGo-Core/src/utils/image-size/types/icns.ts create mode 100644 libs/Universal-PicGo-Core/src/utils/image-size/types/ico.ts create mode 100644 libs/Universal-PicGo-Core/src/utils/image-size/types/index.ts create mode 100644 libs/Universal-PicGo-Core/src/utils/image-size/types/interface.ts create mode 100644 libs/Universal-PicGo-Core/src/utils/image-size/types/j2c.ts create mode 100644 libs/Universal-PicGo-Core/src/utils/image-size/types/jp2.ts create mode 100644 libs/Universal-PicGo-Core/src/utils/image-size/types/jpg.ts create mode 100644 libs/Universal-PicGo-Core/src/utils/image-size/types/ktx.ts create mode 100644 libs/Universal-PicGo-Core/src/utils/image-size/types/png.ts create mode 100644 libs/Universal-PicGo-Core/src/utils/image-size/types/pnm.ts create mode 100644 libs/Universal-PicGo-Core/src/utils/image-size/types/psd.ts create mode 100644 libs/Universal-PicGo-Core/src/utils/image-size/types/svg.ts create mode 100644 libs/Universal-PicGo-Core/src/utils/image-size/types/tga.ts create mode 100644 libs/Universal-PicGo-Core/src/utils/image-size/types/tiff.ts create mode 100644 libs/Universal-PicGo-Core/src/utils/image-size/types/utils.ts create mode 100644 libs/Universal-PicGo-Core/src/utils/image-size/types/webp.ts diff --git a/libs/Universal-PicGo-Core/package.json b/libs/Universal-PicGo-Core/package.json index d8feccc..bf77fb8 100644 --- a/libs/Universal-PicGo-Core/package.json +++ b/libs/Universal-PicGo-Core/package.json @@ -33,6 +33,7 @@ "@picgo/i18n": "^1.0.0", "dayjs": "^1.11.10", "js-yaml": "^4.1.0", + "queue": "^7.0.0", "universal-picgo-store": "workspace:*", "zhi-lib-base": "^0.8.0" }, diff --git a/libs/Universal-PicGo-Core/src/core/Lifecycle.ts b/libs/Universal-PicGo-Core/src/core/Lifecycle.ts index 61b1728..9b26a1d 100644 --- a/libs/Universal-PicGo-Core/src/core/Lifecycle.ts +++ b/libs/Universal-PicGo-Core/src/core/Lifecycle.ts @@ -126,7 +126,11 @@ export class Lifecycle extends EventEmitter { delete ctx.output[i].buffer } ctx.emit(IBuildInEvent.FINISHED, ctx) - ctx.log.info(`\n${msg}`) + if (msg === "") { + ctx.log.warn("[after-upload] image upload occured an error, please read log for details") + } else { + ctx.log.info(`[after-upload] upload finishied => \n${msg}`) + } return ctx } diff --git a/libs/Universal-PicGo-Core/src/core/UniversalPicGo.ts b/libs/Universal-PicGo-Core/src/core/UniversalPicGo.ts index ef173ad..f868dd6 100644 --- a/libs/Universal-PicGo-Core/src/core/UniversalPicGo.ts +++ b/libs/Universal-PicGo-Core/src/core/UniversalPicGo.ts @@ -187,7 +187,7 @@ class UniversalPicGo extends EventEmitter implements IPicGo { const fs = win.fs if (!shouldKeepAfterUploading) { // 删除 picgo 生成的图片文件,例如 `~/.picgo/20200621205720.png` - fs.remove(imgPath).catch((e: any) => { + fs.promises.rm(imgPath).catch((e: any) => { this.log.error(e) }) } @@ -197,7 +197,7 @@ class UniversalPicGo extends EventEmitter implements IPicGo { if (hasNodeEnv) { const fs = win.fs if (!shouldKeepAfterUploading) { - fs.remove(imgPath).catch((e: any) => { + fs.promises.rm(imgPath).catch((e: any) => { this.log.error(e) }) } diff --git a/libs/Universal-PicGo-Core/src/lib/PluginLoader.ts b/libs/Universal-PicGo-Core/src/lib/PluginLoader.ts index ee3279e..7e44243 100644 --- a/libs/Universal-PicGo-Core/src/lib/PluginLoader.ts +++ b/libs/Universal-PicGo-Core/src/lib/PluginLoader.ts @@ -9,7 +9,7 @@ import { IPicGo, IPicGoPlugin, IPicGoPluginInterface, IPluginLoader } from "../types" import PluginLoaderDb from "../db/pluginLoder" -import { hasNodeEnv, win } from "universal-picgo-store/src" +import { hasNodeEnv, win } from "universal-picgo-store" import { readJSONSync } from "../utils/nodeUtils" import { IBuildInEvent } from "../utils/enums" import { setCurrentPluginName } from "./LifecyclePlugins" diff --git a/libs/Universal-PicGo-Core/src/plugins/transformer/index.ts b/libs/Universal-PicGo-Core/src/plugins/transformer/index.ts index 03fcecd..bf77fc0 100644 --- a/libs/Universal-PicGo-Core/src/plugins/transformer/index.ts +++ b/libs/Universal-PicGo-Core/src/plugins/transformer/index.ts @@ -8,11 +8,13 @@ */ import { IPicGo, IPicGoPlugin } from "../../types" +import ImgFromPath from "./path" import ImgFromBase64 from "./base64" const buildInTransformers: IPicGoPlugin = () => { return { register(ctx: IPicGo) { + ctx.helper.transformer.register("path", ImgFromPath) ctx.helper.transformer.register("base64", ImgFromBase64) }, } diff --git a/libs/Universal-PicGo-Core/src/plugins/transformer/path.ts b/libs/Universal-PicGo-Core/src/plugins/transformer/path.ts new file mode 100644 index 0000000..6fbe2d0 --- /dev/null +++ b/libs/Universal-PicGo-Core/src/plugins/transformer/path.ts @@ -0,0 +1,67 @@ +/* + * GNU GENERAL PUBLIC LICENSE + * Version 3, 29 June 2007 + * + * Copyright (C) 2024 Terwer, Inc. + * Everyone is permitted to copy and distribute verbatim copies + * of this license document, but changing it is not allowed. + */ + +import dayjs from "dayjs" +import { IImgInfo, IImgSize, IPathTransformedImgInfo, IPicGo } from "../../types" +import { win } from "universal-picgo-store" +import { getFSFile, getImageSize, getURLFile, isUrl } from "../../utils/common" + +const handle = async (ctx: IPicGo): Promise => { + const results: IImgInfo[] = ctx.output + await Promise.all( + ctx.input.map(async (item: string | typeof win.Buffer, index: number) => { + let info: IPathTransformedImgInfo + if (win.Buffer.isBuffer(item)) { + info = { + success: true, + buffer: item, + fileName: "", // will use getImageSize result + extname: "", // will use getImageSize result + } + } else if (isUrl(item)) { + info = await getURLFile(item, ctx) + } else { + info = await getFSFile(item) + } + if (info.success && info.buffer) { + const imgSize = getImgSize(ctx, info.buffer, item) + const extname = info.extname || imgSize.extname || ".png" + results[index] = { + buffer: info.buffer, + fileName: info.fileName || `${dayjs().format("YYYYMMDDHHmmss")}${extname}}`, + width: imgSize.width, + height: imgSize.height, + extname, + } + } else { + ctx.log.error(info.reason) + } + }) + ) + // remove empty item + ctx.output = results.filter((item) => item) + return ctx +} + +const getImgSize = (ctx: IPicGo, file: typeof win.Buffer, path: string | typeof win.Buffer): IImgSize => { + const imageSize = getImageSize(file) + if (!imageSize.real) { + if (typeof path === "string") { + ctx.log.warn(`can't get ${path}'s image size`) + } else { + ctx.log.warn("can't get image size") + } + ctx.log.warn("fallback to 200 * 200") + } + return imageSize +} + +export default { + handle, +} diff --git a/libs/Universal-PicGo-Core/src/plugins/uploader/smms.ts b/libs/Universal-PicGo-Core/src/plugins/uploader/smms.ts new file mode 100644 index 0000000..0dfd11b --- /dev/null +++ b/libs/Universal-PicGo-Core/src/plugins/uploader/smms.ts @@ -0,0 +1,104 @@ +/* + * GNU GENERAL PUBLIC LICENSE + * Version 3, 29 June 2007 + * + * Copyright (C) 2024 Terwer, Inc. + * Everyone is permitted to copy and distribute verbatim copies + * of this license document, but changing it is not allowed. + */ + +// const postOptions = (fileName: string, image: Buffer, apiToken: string, backupDomain = ''): IOldReqOptions => { +// const domain = backupDomain || 'sm.ms' +// return { +// method: 'POST', +// url: `https://${domain}/api/v2/upload`, +// headers: { +// contentType: 'multipart/form-data', +// 'User-Agent': 'PicGo', +// Authorization: apiToken +// }, +// formData: { +// smfile: { +// value: image, +// options: { +// filename: fileName +// } +// }, +// ssl: 'true' +// } +// } +// } +// +// const handle = async (ctx: IPicGo): Promise => { +// const smmsConfig = ctx.getConfig('picBed.smms') +// if (!smmsConfig) { +// throw new Error('Can not find smms config!') +// } +// const imgList = ctx.output +// for (const img of imgList) { +// if (img.fileName && img.buffer) { +// let image = img.buffer +// if (!image && img.base64Image) { +// image = Buffer.from(img.base64Image, 'base64') +// } +// const postConfig = postOptions(img.fileName, image, smmsConfig?.token, smmsConfig?.backupDomain) +// try { +// const res: string = await ctx.request(postConfig) +// const body = JSON.parse(res) +// if (body.code === 'success') { +// delete img.base64Image +// delete img.buffer +// img.imgUrl = body.data.url +// } else if (body.code === 'image_repeated' && typeof body.images === 'string') { // do extra check since this error return is not documented at https://doc.sm.ms/#api-Image-Upload +// delete img.base64Image +// delete img.buffer +// img.imgUrl = body.images +// } else { +// ctx.emit(IBuildInEvent.NOTIFICATION, { +// title: ctx.i18n.translate('UPLOAD_FAILED'), +// body: body.message +// }) +// throw new Error(body.message) +// } +// } catch (e: any) { +// ctx.log.error(e) +// throw e +// } +// } +// } +// return ctx +// } +// +// const config = (ctx: IPicGo): IPluginConfig[] => { +// const userConfig = ctx.getConfig('picBed.smms') || {} +// const config: IPluginConfig[] = [ +// { +// name: 'token', +// message: 'api token', +// type: 'password', +// get alias () { return ctx.i18n.translate('PICBED_SMMS_TOKEN') }, +// default: userConfig.token || '', +// required: true +// }, +// { +// name: 'backupDomain', +// type: 'input', +// get prefix () { return ctx.i18n.translate('PICBED_SMMS_BACKUP_DOMAIN') }, +// get message () { +// return ctx.i18n.translate('PICBED_SMMS_MESSAGE_BACKUP_DOMAIN') +// }, +// get alias () { return ctx.i18n.translate('PICBED_SMMS_BACKUP_DOMAIN') }, +// default: userConfig.backupDomain || '', +// required: false +// } +// ] +// return config +// } +// +// export default function register (ctx: IPicGo): void { +// ctx.helper.uploader.register('smms', { +// get name () { return ctx.i18n.translate('PICBED_SMMS') }, +// handle, +// config +// }) +// } diff --git a/libs/Universal-PicGo-Core/src/types/index.d.ts b/libs/Universal-PicGo-Core/src/types/index.d.ts index 2317bde..7c8bd0b 100644 --- a/libs/Universal-PicGo-Core/src/types/index.d.ts +++ b/libs/Universal-PicGo-Core/src/types/index.d.ts @@ -440,3 +440,17 @@ export interface II18nManager { */ getLanguageList: () => string[] } + +/** + * for transformer - path + */ +export interface IImgSize { + width: number + height: number + real?: boolean + extname?: string +} + +export interface IPathTransformedImgInfo extends IImgInfo { + success: boolean +} diff --git a/libs/Universal-PicGo-Core/src/utils/clipboard/electron.ts b/libs/Universal-PicGo-Core/src/utils/clipboard/electron.ts index 91bfdea..6ba7956 100644 --- a/libs/Universal-PicGo-Core/src/utils/clipboard/electron.ts +++ b/libs/Universal-PicGo-Core/src/utils/clipboard/electron.ts @@ -55,6 +55,7 @@ const getClipboardImageElectron = async (ctx: IPicGo): Promise const fs = win.fs const path = win.require("path") const { spawn } = win.require("child_process") + const logger = ctx.getLogger("get-clipboard-image-electron") createImageFolder(ctx) // add an clipboard image folder to control the image cache file @@ -101,6 +102,8 @@ const getClipboardImageElectron = async (ctx: IPicGo): Promise } } const imgPath = data.toString().trim() + logger.debug("spawn data imgPath =>", imgPath) + logger.debug("imagePathgPath =>", imagePath) // if the filePath is the real file in system // we should keep it instead of removing @@ -114,8 +117,17 @@ const getClipboardImageElectron = async (ctx: IPicGo): Promise shouldKeepAfterUploading = true } } + + // no image + if (imgPath === "no image") { + resolve({ + imgPath, + shouldKeepAfterUploading, + }) + } + // if the imgPath is invalid - if (imgPath !== "no image" && !fs.existsSync(imgPath)) { + if (!fs.existsSync(imgPath)) { return reject(new Error(`Can't find ${imgPath}`)) } @@ -123,6 +135,28 @@ const getClipboardImageElectron = async (ctx: IPicGo): Promise imgPath, shouldKeepAfterUploading, }) + + // // resolve with timeout + // const startTime = Date.now() + // const checkFileInterval = setInterval(() => { + // if (fs.existsSync(imagePath)) { + // clearInterval(checkFileInterval) + // + // const imgPath = imagePath + // logger.info("File exists at path: " + imgPath) + // resolve({ + // imgPath, + // shouldKeepAfterUploading: shouldKeepAfterUploading, + // }) + // } else { + // logger.debug("File doesn't exist yet, continuing to wait...") + // + // if (Date.now() - startTime > 10000) { + // clearInterval(checkFileInterval) + // reject(new Error("File not found within 10 seconds")) + // } + // } + // }, 500) // Check every 500 milliseconds if the file exists }) }) } diff --git a/libs/Universal-PicGo-Core/src/utils/common.ts b/libs/Universal-PicGo-Core/src/utils/common.ts index 363a7e6..f6f569a 100644 --- a/libs/Universal-PicGo-Core/src/utils/common.ts +++ b/libs/Universal-PicGo-Core/src/utils/common.ts @@ -7,8 +7,11 @@ * of this license document, but changing it is not allowed. */ -import { IPluginNameType } from "../types" +import { IImgSize, IPathTransformedImgInfo, IPicGo, IPluginNameType } from "../types" import { hasNodeEnv, win } from "universal-picgo-store" +import imageSize from "./image-size" + +export const isUrl = (url: string): boolean => url.startsWith("http://") || url.startsWith("https://") export const isUrlEncode = (url: string): boolean => { url = url || "" @@ -27,6 +30,85 @@ export const handleUrlEncode = (url: string): string => { return url } +export const getFSFile = async (filePath: string): Promise => { + try { + const fs = win.fs + const path = win.require("path") + return { + extname: path.extname(filePath), + fileName: path.basename(filePath), + buffer: await fs.promises.readFile(filePath), + success: true, + } + } catch { + return { + reason: `read file ${filePath} error`, + success: false, + } + } +} + +export const getURLFile = async (url: string, ctx: IPicGo): Promise => { + url = handleUrlEncode(url) + const isImage = false + const extname = "" + let timeoutId: any + + throw new Error("getURLFile is not implemented") + // const requestFn = new Promise((resolve, reject) => { + // ;(async () => { + // try { + // const res = await ctx + // .request({ + // method: "get", + // url, + // resolveWithFullResponse: true, + // responseType: "arraybuffer", + // }) + // .then((resp: any) => { + // const contentType = resp.headers["content-type"] + // if (contentType?.includes("image")) { + // isImage = true + // extname = `.${contentType.split("image/")[1]}` + // } + // return resp.data as Buffer + // }) + // clearTimeout(timeoutId) + // if (isImage) { + // const urlPath = new URL(url).pathname + // resolve({ + // buffer: res, + // fileName: path.basename(urlPath), + // extname, + // success: true, + // }) + // } else { + // resolve({ + // success: false, + // reason: `${url} is not image`, + // }) + // } + // } catch (error: any) { + // clearTimeout(timeoutId) + // resolve({ + // success: false, + // // eslint-disable-next-line @typescript-eslint/restrict-template-expressions + // reason: `request ${url} error, ${error?.message ?? ""}`, + // }) + // } + // })().catch(reject) + // }) + // const timeoutPromise = new Promise((resolve): void => { + // timeoutId = setTimeout(() => { + // resolve({ + // success: false, + // reason: `request ${url} timeout`, + // }) + // }, 10000) + // }) + // return Promise.race([requestFn, timeoutPromise]) +} + /** * detect the input string's type * for example @@ -196,3 +278,25 @@ export const forceNumber = (num: string | number = 0): number => { // export const isProd = (): boolean => { // return process.env.NODE_ENV === 'production' // } + +export const getImageSize = (file: typeof win.Buffer): IImgSize => { + try { + const { width = 0, height = 0, type } = imageSize(file) + const extname = type ? `.${type}` : ".png" + return { + real: true, + width, + height, + extname, + } + } catch (e) { + console.error(e) + // fallback to 200 * 200 + return { + real: false, + width: 200, + height: 200, + extname: ".png", + } + } +} diff --git a/libs/Universal-PicGo-Core/src/utils/image-size/detector.ts b/libs/Universal-PicGo-Core/src/utils/image-size/detector.ts new file mode 100644 index 0000000..24134d6 --- /dev/null +++ b/libs/Universal-PicGo-Core/src/utils/image-size/detector.ts @@ -0,0 +1,40 @@ +/* + * GNU GENERAL PUBLIC LICENSE + * Version 3, 29 June 2007 + * + * Copyright (C) 2024 Terwer, Inc. + * Everyone is permitted to copy and distribute verbatim copies + * of this license document, but changing it is not allowed. + */ + +import { imageType, typeHandlers } from "./types" +import { win } from "universal-picgo-store" + +const keys = Object.keys(typeHandlers) as imageType[] + +// This map helps avoid validating for every single image type +const firstBytes: { [byte: number]: imageType } = { + 0x38: "psd", + 0x42: "bmp", + 0x44: "dds", + 0x47: "gif", + 0x49: "tiff", + 0x4d: "tiff", + 0x52: "webp", + 0x69: "icns", + 0x89: "png", + 0xff: "jpg", +} + +export function detector(input: typeof win.Uint8Array): imageType | undefined { + const byte = input[0] + if (byte in firstBytes) { + const type = firstBytes[byte] + if (type && typeHandlers[type].validate(input)) { + return type + } + } + + const finder = (key: imageType) => typeHandlers[key].validate(input) + return keys.find(finder) +} diff --git a/libs/Universal-PicGo-Core/src/utils/image-size/index.ts b/libs/Universal-PicGo-Core/src/utils/image-size/index.ts new file mode 100644 index 0000000..d37ffe1 --- /dev/null +++ b/libs/Universal-PicGo-Core/src/utils/image-size/index.ts @@ -0,0 +1,158 @@ +/* + * GNU GENERAL PUBLIC LICENSE + * Version 3, 29 June 2007 + * + * Copyright (C) 2024 Terwer, Inc. + * Everyone is permitted to copy and distribute verbatim copies + * of this license document, but changing it is not allowed. + */ + +// This code is copied from https://github.com/image-size/image-size +// v1.1.1 + +import { ISizeCalculationResult } from "./types/interface" +import Queue from "queue" +import { imageType, typeHandlers } from "./types" +import { detector } from "./detector" +import { win } from "universal-picgo-store" + +type CallbackFn = (e: Error | null, r?: ISizeCalculationResult) => void + +// Maximum input size, with a default of 512 kilobytes. +// TO-DO: make this adaptive based on the initial signature of the image +const MaxInputSize = 512 * 1024 + +// This queue is for async `fs` operations, to avoid reaching file-descriptor limits +const queue = new Queue({ concurrency: 100, autostart: true }) + +type Options = { + disabledFS: boolean + disabledTypes: imageType[] +} + +const globalOptions: Options = { + disabledFS: false, + disabledTypes: [], +} + +/** + * Return size information based on an Uint8Array + * + * @param {Uint8Array} input + * @param {String} filepath + * @returns {Object} + */ +function lookup(input: typeof win.Uint8Array, filepath?: string): ISizeCalculationResult { + // detect the file type.. don't rely on the extension + const type = detector(input) + + if (typeof type !== "undefined") { + if (globalOptions.disabledTypes.indexOf(type) > -1) { + throw new TypeError("disabled file type: " + type) + } + + // find an appropriate handler for this file type + if (type in typeHandlers) { + const size = typeHandlers[type].calculate(input, filepath) + if (size !== undefined) { + size.type = size.type ?? type + return size + } + } + } + + // throw up, if we don't understand the file + throw new TypeError("unsupported file type: " + type + " (file: " + filepath + ")") +} + +/** + * Reads a file into an Uint8Array. + * @param {String} filepath + * @returns {Promise} + */ +async function readFileAsync(filepath: string): Promise { + const fs = win.fs + const handle = await fs.promises.open(filepath, "r") + try { + const { size } = await handle.stat() + if (size <= 0) { + throw new Error("Empty file") + } + const inputSize = Math.min(size, MaxInputSize) + const input = new Uint8Array(inputSize) + await handle.read(input, 0, inputSize, 0) + return input + } finally { + await handle.close() + } +} + +/** + * Synchronously reads a file into an Uint8Array, blocking the nodejs process. + * + * @param {String} filepath + * @returns {Uint8Array} + */ +function readFileSync(filepath: string): Uint8Array { + const fs = win.fs + + // read from the file, synchronously + const descriptor = fs.openSync(filepath, "r") + try { + const { size } = fs.fstatSync(descriptor) + if (size <= 0) { + throw new Error("Empty file") + } + const inputSize = Math.min(size, MaxInputSize) + const input = new Uint8Array(inputSize) + fs.readSync(descriptor, input, 0, inputSize, 0) + return input + } finally { + fs.closeSync(descriptor) + } +} +export default imageSize +export function imageSize(input: typeof win.Uint8Array | string): ISizeCalculationResult +export function imageSize(input: string, callback: CallbackFn): void + +/** + * @param {Uint8Array|string} input - Uint8Array or relative/absolute path of the image file + * @param {Function=} [callback] - optional function for async detection + */ +export function imageSize(input: typeof win.Uint8Array | string, callback?: CallbackFn): ISizeCalculationResult | void { + const path = win.require("path") + + // Handle Uint8Array input + if (input instanceof win.Uint8Array) { + return lookup(input) + } + + // input should be a string at this point + if (globalOptions.disabledFS) { + throw new TypeError("invalid invocation. input should be a Uint8Array") + } + + // resolve the file path + const filepath = path.resolve(input) + if (typeof callback === "function") { + queue.push(() => + readFileAsync(filepath) + .then((input) => win.process.nextTick(callback, null, lookup(input, filepath))) + .catch(callback) + ) + } else { + const input = readFileSync(filepath) + return lookup(input, filepath) + } +} + +export const disableFS = (v: boolean): void => { + globalOptions.disabledFS = v +} +export const disableTypes = (types: imageType[]): void => { + globalOptions.disabledTypes = types +} +export const setConcurrency = (c: number): void => { + queue.concurrency = c +} +export const types = Object.keys(typeHandlers) diff --git a/libs/Universal-PicGo-Core/src/utils/image-size/types/bmp.ts b/libs/Universal-PicGo-Core/src/utils/image-size/types/bmp.ts new file mode 100644 index 0000000..52007c8 --- /dev/null +++ b/libs/Universal-PicGo-Core/src/utils/image-size/types/bmp.ts @@ -0,0 +1,11 @@ +import type { IImage } from "./interface" +import { toUTF8String, readInt32LE, readUInt32LE } from "./utils" + +export const BMP: IImage = { + validate: (input) => toUTF8String(input, 0, 2) === "BM", + + calculate: (input) => ({ + height: Math.abs(readInt32LE(input, 22)), + width: readUInt32LE(input, 18), + }), +} diff --git a/libs/Universal-PicGo-Core/src/utils/image-size/types/cur.ts b/libs/Universal-PicGo-Core/src/utils/image-size/types/cur.ts new file mode 100644 index 0000000..c0fb82d --- /dev/null +++ b/libs/Universal-PicGo-Core/src/utils/image-size/types/cur.ts @@ -0,0 +1,17 @@ +import type { IImage } from "./interface" +import { ICO } from "./ico" +import { readUInt16LE } from "./utils" + +const TYPE_CURSOR = 2 +export const CUR: IImage = { + validate(input) { + const reserved = readUInt16LE(input, 0) + const imageCount = readUInt16LE(input, 4) + if (reserved !== 0 || imageCount === 0) return false + + const imageType = readUInt16LE(input, 2) + return imageType === TYPE_CURSOR + }, + + calculate: (input) => ICO.calculate(input), +} diff --git a/libs/Universal-PicGo-Core/src/utils/image-size/types/dds.ts b/libs/Universal-PicGo-Core/src/utils/image-size/types/dds.ts new file mode 100644 index 0000000..0d6e582 --- /dev/null +++ b/libs/Universal-PicGo-Core/src/utils/image-size/types/dds.ts @@ -0,0 +1,11 @@ +import type { IImage } from "./interface" +import { readUInt32LE } from "./utils" + +export const DDS: IImage = { + validate: (input) => readUInt32LE(input, 0) === 0x20534444, + + calculate: (input) => ({ + height: readUInt32LE(input, 12), + width: readUInt32LE(input, 16), + }), +} diff --git a/libs/Universal-PicGo-Core/src/utils/image-size/types/gif.ts b/libs/Universal-PicGo-Core/src/utils/image-size/types/gif.ts new file mode 100644 index 0000000..6da92d6 --- /dev/null +++ b/libs/Universal-PicGo-Core/src/utils/image-size/types/gif.ts @@ -0,0 +1,12 @@ +import type { IImage } from "./interface" +import { toUTF8String, readUInt16LE } from "./utils" + +const gifRegexp = /^GIF8[79]a/ +export const GIF: IImage = { + validate: (input) => gifRegexp.test(toUTF8String(input, 0, 6)), + + calculate: (input) => ({ + height: readUInt16LE(input, 8), + width: readUInt16LE(input, 6), + }), +} diff --git a/libs/Universal-PicGo-Core/src/utils/image-size/types/heif.ts b/libs/Universal-PicGo-Core/src/utils/image-size/types/heif.ts new file mode 100644 index 0000000..033ce2e --- /dev/null +++ b/libs/Universal-PicGo-Core/src/utils/image-size/types/heif.ts @@ -0,0 +1,36 @@ +import type { IImage } from "./interface" +import { findBox, readUInt32BE, toUTF8String } from "./utils" + +const brandMap = { + avif: "avif", + mif1: "heif", + msf1: "heif", // hief-sequence + heic: "heic", + heix: "heic", + hevc: "heic", // heic-sequence + hevx: "heic", // heic-sequence +} + +export const HEIF: IImage = { + validate(buffer) { + const ftype = toUTF8String(buffer, 4, 8) + const brand = toUTF8String(buffer, 8, 12) + return "ftyp" === ftype && brand in brandMap + }, + + calculate(buffer) { + // Based on https://nokiatech.github.io/heif/technical.html + const metaBox = findBox(buffer, "meta", 0) + const iprpBox = metaBox && findBox(buffer, "iprp", metaBox.offset + 12) + const ipcoBox = iprpBox && findBox(buffer, "ipco", iprpBox.offset + 8) + const ispeBox = ipcoBox && findBox(buffer, "ispe", ipcoBox.offset + 8) + if (ispeBox) { + return { + height: readUInt32BE(buffer, ispeBox.offset + 16), + width: readUInt32BE(buffer, ispeBox.offset + 12), + type: toUTF8String(buffer, 8, 12), + } + } + throw new TypeError("Invalid HEIF, no size found") + }, +} diff --git a/libs/Universal-PicGo-Core/src/utils/image-size/types/icns.ts b/libs/Universal-PicGo-Core/src/utils/image-size/types/icns.ts new file mode 100644 index 0000000..74cd654 --- /dev/null +++ b/libs/Universal-PicGo-Core/src/utils/image-size/types/icns.ts @@ -0,0 +1,107 @@ +import type { IImage, ISize } from "./interface" +import { toUTF8String, readUInt32BE } from "./utils" + +/** + * ICNS Header + * + * | Offset | Size | Purpose | + * | 0 | 4 | Magic literal, must be "icns" (0x69, 0x63, 0x6e, 0x73) | + * | 4 | 4 | Length of file, in bytes, msb first. | + * + */ +const SIZE_HEADER = 4 + 4 // 8 +const FILE_LENGTH_OFFSET = 4 // MSB => BIG ENDIAN + +/** + * Image Entry + * + * | Offset | Size | Purpose | + * | 0 | 4 | Icon type, see OSType below. | + * | 4 | 4 | Length of data, in bytes (including type and length), msb first. | + * | 8 | n | Icon data | + */ +const ENTRY_LENGTH_OFFSET = 4 // MSB => BIG ENDIAN + +const ICON_TYPE_SIZE: { [key: string]: number } = { + ICON: 32, + "ICN#": 32, + // m => 16 x 16 + "icm#": 16, + icm4: 16, + icm8: 16, + // s => 16 x 16 + "ics#": 16, + ics4: 16, + ics8: 16, + is32: 16, + s8mk: 16, + icp4: 16, + // l => 32 x 32 + icl4: 32, + icl8: 32, + il32: 32, + l8mk: 32, + icp5: 32, + ic11: 32, + // h => 48 x 48 + ich4: 48, + ich8: 48, + ih32: 48, + h8mk: 48, + // . => 64 x 64 + icp6: 64, + ic12: 32, + // t => 128 x 128 + it32: 128, + t8mk: 128, + ic07: 128, + // . => 256 x 256 + ic08: 256, + ic13: 256, + // . => 512 x 512 + ic09: 512, + ic14: 512, + // . => 1024 x 1024 + ic10: 1024, +} + +function readImageHeader(input: Uint8Array, imageOffset: number): [string, number] { + const imageLengthOffset = imageOffset + ENTRY_LENGTH_OFFSET + return [toUTF8String(input, imageOffset, imageLengthOffset), readUInt32BE(input, imageLengthOffset)] +} + +function getImageSize(type: string): ISize { + const size = ICON_TYPE_SIZE[type] + return { width: size, height: size, type } +} + +export const ICNS: IImage = { + validate: (input) => toUTF8String(input, 0, 4) === "icns", + + calculate(input) { + const inputLength = input.length + const fileLength = readUInt32BE(input, FILE_LENGTH_OFFSET) + let imageOffset = SIZE_HEADER + + let imageHeader = readImageHeader(input, imageOffset) + let imageSize = getImageSize(imageHeader[0]) + imageOffset += imageHeader[1] + + if (imageOffset === fileLength) return imageSize + + const result = { + height: imageSize.height, + images: [imageSize], + width: imageSize.width, + } + + while (imageOffset < fileLength && imageOffset < inputLength) { + imageHeader = readImageHeader(input, imageOffset) + imageSize = getImageSize(imageHeader[0]) + imageOffset += imageHeader[1] + result.images.push(imageSize) + } + + return result + }, +} diff --git a/libs/Universal-PicGo-Core/src/utils/image-size/types/ico.ts b/libs/Universal-PicGo-Core/src/utils/image-size/types/ico.ts new file mode 100644 index 0000000..6c3d486 --- /dev/null +++ b/libs/Universal-PicGo-Core/src/utils/image-size/types/ico.ts @@ -0,0 +1,75 @@ +import type { IImage, ISize } from "./interface" +import { readUInt16LE } from "./utils" + +const TYPE_ICON = 1 + +/** + * ICON Header + * + * | Offset | Size | Purpose | + * | 0 | 2 | Reserved. Must always be 0. | + * | 2 | 2 | Image type: 1 for icon (.ICO) image, 2 for cursor (.CUR) image. Other values are invalid. | + * | 4 | 2 | Number of images in the file. | + * + */ +const SIZE_HEADER = 2 + 2 + 2 // 6 + +/** + * Image Entry + * + * | Offset | Size | Purpose | + * | 0 | 1 | Image width in pixels. Can be any number between 0 and 255. Value 0 means width is 256 pixels. | + * | 1 | 1 | Image height in pixels. Can be any number between 0 and 255. Value 0 means height is 256 pixels. | + * | 2 | 1 | Number of colors in the color palette. Should be 0 if the image does not use a color palette. | + * | 3 | 1 | Reserved. Should be 0. | + * | 4 | 2 | ICO format: Color planes. Should be 0 or 1. | + * | | | CUR format: The horizontal coordinates of the hotspot in number of pixels from the left. | + * | 6 | 2 | ICO format: Bits per pixel. | + * | | | CUR format: The vertical coordinates of the hotspot in number of pixels from the top. | + * | 8 | 4 | The size of the image's data in bytes | + * | 12 | 4 | The offset of BMP or PNG data from the beginning of the ICO/CUR file | + * + */ +const SIZE_IMAGE_ENTRY = 1 + 1 + 1 + 1 + 2 + 2 + 4 + 4 // 16 + +function getSizeFromOffset(input: Uint8Array, offset: number): number { + const value = input[offset] + return value === 0 ? 256 : value +} + +function getImageSize(input: Uint8Array, imageIndex: number): ISize { + const offset = SIZE_HEADER + imageIndex * SIZE_IMAGE_ENTRY + return { + height: getSizeFromOffset(input, offset + 1), + width: getSizeFromOffset(input, offset), + } +} + +export const ICO: IImage = { + validate(input) { + const reserved = readUInt16LE(input, 0) + const imageCount = readUInt16LE(input, 4) + if (reserved !== 0 || imageCount === 0) return false + + const imageType = readUInt16LE(input, 2) + return imageType === TYPE_ICON + }, + + calculate(input) { + const nbImages = readUInt16LE(input, 4) + const imageSize = getImageSize(input, 0) + + if (nbImages === 1) return imageSize + + const imgs: ISize[] = [imageSize] + for (let imageIndex = 1; imageIndex < nbImages; imageIndex += 1) { + imgs.push(getImageSize(input, imageIndex)) + } + + return { + height: imageSize.height, + images: imgs, + width: imageSize.width, + } + }, +} diff --git a/libs/Universal-PicGo-Core/src/utils/image-size/types/index.ts b/libs/Universal-PicGo-Core/src/utils/image-size/types/index.ts new file mode 100644 index 0000000..871423a --- /dev/null +++ b/libs/Universal-PicGo-Core/src/utils/image-size/types/index.ts @@ -0,0 +1,42 @@ +// load all available handlers explicitly for browserify support +import { BMP } from "./bmp" +import { CUR } from "./cur" +import { DDS } from "./dds" +import { GIF } from "./gif" +import { HEIF } from "./heif" +import { ICNS } from "./icns" +import { ICO } from "./ico" +import { J2C } from "./j2c" +import { JP2 } from "./jp2" +import { JPG } from "./jpg" +import { KTX } from "./ktx" +import { PNG } from "./png" +import { PNM } from "./pnm" +import { PSD } from "./psd" +import { SVG } from "./svg" +import { TGA } from "./tga" +import { TIFF } from "./tiff" +import { WEBP } from "./webp" + +export const typeHandlers = { + bmp: BMP, + cur: CUR, + dds: DDS, + gif: GIF, + heif: HEIF, + icns: ICNS, + ico: ICO, + j2c: J2C, + jp2: JP2, + jpg: JPG, + ktx: KTX, + png: PNG, + pnm: PNM, + psd: PSD, + svg: SVG, + tga: TGA, + tiff: TIFF, + webp: WEBP, +} + +export type imageType = keyof typeof typeHandlers diff --git a/libs/Universal-PicGo-Core/src/utils/image-size/types/interface.ts b/libs/Universal-PicGo-Core/src/utils/image-size/types/interface.ts new file mode 100644 index 0000000..c6a0744 --- /dev/null +++ b/libs/Universal-PicGo-Core/src/utils/image-size/types/interface.ts @@ -0,0 +1,17 @@ +import { win } from "universal-picgo-store" + +export type ISize = { + width: number | undefined + height: number | undefined + orientation?: number + type?: string +} + +export type ISizeCalculationResult = { + images?: ISize[] +} & ISize + +export type IImage = { + validate: (input: typeof win.Uint8Array) => boolean + calculate: (input: typeof win.Uint8Array, filepath?: string) => ISizeCalculationResult +} diff --git a/libs/Universal-PicGo-Core/src/utils/image-size/types/j2c.ts b/libs/Universal-PicGo-Core/src/utils/image-size/types/j2c.ts new file mode 100644 index 0000000..e53a7d2 --- /dev/null +++ b/libs/Universal-PicGo-Core/src/utils/image-size/types/j2c.ts @@ -0,0 +1,12 @@ +import type { IImage } from "./interface" +import { toHexString, readUInt32BE } from "./utils" + +export const J2C: IImage = { + // TODO: this doesn't seem right. SIZ marker doesn't have to be right after the SOC + validate: (input) => toHexString(input, 0, 4) === "ff4fff51", + + calculate: (input) => ({ + height: readUInt32BE(input, 12), + width: readUInt32BE(input, 8), + }), +} diff --git a/libs/Universal-PicGo-Core/src/utils/image-size/types/jp2.ts b/libs/Universal-PicGo-Core/src/utils/image-size/types/jp2.ts new file mode 100644 index 0000000..78b472e --- /dev/null +++ b/libs/Universal-PicGo-Core/src/utils/image-size/types/jp2.ts @@ -0,0 +1,23 @@ +import type { IImage } from "./interface" +import { readUInt32BE, findBox } from "./utils" + +export const JP2: IImage = { + validate(input) { + if (readUInt32BE(input, 4) !== 0x6a502020 || readUInt32BE(input, 0) < 1) return false + const ftypBox = findBox(input, "ftyp", 0) + if (!ftypBox) return false + return readUInt32BE(input, ftypBox.offset + 4) === 0x66747970 + }, + + calculate(input) { + const jp2hBox = findBox(input, "jp2h", 0) + const ihdrBox = jp2hBox && findBox(input, "ihdr", jp2hBox.offset + 8) + if (ihdrBox) { + return { + height: readUInt32BE(input, ihdrBox.offset + 8), + width: readUInt32BE(input, ihdrBox.offset + 12), + } + } + throw new TypeError("Unsupported JPEG 2000 format") + }, +} diff --git a/libs/Universal-PicGo-Core/src/utils/image-size/types/jpg.ts b/libs/Universal-PicGo-Core/src/utils/image-size/types/jpg.ts new file mode 100644 index 0000000..a211261 --- /dev/null +++ b/libs/Universal-PicGo-Core/src/utils/image-size/types/jpg.ts @@ -0,0 +1,150 @@ +// NOTE: we only support baseline and progressive JPGs here +// due to the structure of the loader class, we only get a buffer +// with a maximum size of 4096 bytes. so if the SOF marker is outside +// if this range we can't detect the file size correctly. + +import type { IImage, ISize } from "./interface" +import { readUInt, readUInt16BE, toHexString } from "./utils" + +const EXIF_MARKER = "45786966" +const APP1_DATA_SIZE_BYTES = 2 +const EXIF_HEADER_BYTES = 6 +const TIFF_BYTE_ALIGN_BYTES = 2 +const BIG_ENDIAN_BYTE_ALIGN = "4d4d" +const LITTLE_ENDIAN_BYTE_ALIGN = "4949" + +// Each entry is exactly 12 bytes +const IDF_ENTRY_BYTES = 12 +const NUM_DIRECTORY_ENTRIES_BYTES = 2 + +function isEXIF(input: Uint8Array): boolean { + return toHexString(input, 2, 6) === EXIF_MARKER +} + +function extractSize(input: Uint8Array, index: number): ISize { + return { + height: readUInt16BE(input, index), + width: readUInt16BE(input, index + 2), + } +} + +function extractOrientation(exifBlock: Uint8Array, isBigEndian: boolean) { + // TODO: assert that this contains 0x002A + // let STATIC_MOTOROLA_TIFF_HEADER_BYTES = 2 + // let TIFF_IMAGE_FILE_DIRECTORY_BYTES = 4 + + // TODO: derive from TIFF_IMAGE_FILE_DIRECTORY_BYTES + const idfOffset = 8 + + // IDF osset works from right after the header bytes + // (so the offset includes the tiff byte align) + const offset = EXIF_HEADER_BYTES + idfOffset + + const idfDirectoryEntries = readUInt(exifBlock, 16, offset, isBigEndian) + + for (let directoryEntryNumber = 0; directoryEntryNumber < idfDirectoryEntries; directoryEntryNumber++) { + const start = offset + NUM_DIRECTORY_ENTRIES_BYTES + directoryEntryNumber * IDF_ENTRY_BYTES + const end = start + IDF_ENTRY_BYTES + + // Skip on corrupt EXIF blocks + if (start > exifBlock.length) { + return + } + + const block = exifBlock.slice(start, end) + const tagNumber = readUInt(block, 16, 0, isBigEndian) + + // 0x0112 (decimal: 274) is the `orientation` tag ID + if (tagNumber === 274) { + const dataFormat = readUInt(block, 16, 2, isBigEndian) + if (dataFormat !== 3) { + return + } + + // unsinged int has 2 bytes per component + // if there would more than 4 bytes in total it's a pointer + const numberOfComponents = readUInt(block, 32, 4, isBigEndian) + if (numberOfComponents !== 1) { + return + } + + return readUInt(block, 16, 8, isBigEndian) + } + } +} + +function validateExifBlock(input: Uint8Array, index: number) { + // Skip APP1 Data Size + const exifBlock = input.slice(APP1_DATA_SIZE_BYTES, index) + + // Consider byte alignment + const byteAlign = toHexString(exifBlock, EXIF_HEADER_BYTES, EXIF_HEADER_BYTES + TIFF_BYTE_ALIGN_BYTES) + + // Ignore Empty EXIF. Validate byte alignment + const isBigEndian = byteAlign === BIG_ENDIAN_BYTE_ALIGN + const isLittleEndian = byteAlign === LITTLE_ENDIAN_BYTE_ALIGN + + if (isBigEndian || isLittleEndian) { + return extractOrientation(exifBlock, isBigEndian) + } +} + +function validateInput(input: Uint8Array, index: number): void { + // index should be within buffer limits + if (index > input.length) { + throw new TypeError("Corrupt JPG, exceeded buffer limits") + } +} + +export const JPG: IImage = { + validate: (input) => toHexString(input, 0, 2) === "ffd8", + + calculate(input) { + // Skip 4 chars, they are for signature + input = input.slice(4) + + let orientation: number | undefined + let next: number + while (input.length) { + // read length of the next block + const i = readUInt16BE(input, 0) + + // Every JPEG block must begin with a 0xFF + if (input[i] !== 0xff) { + input = input.slice(1) + continue + } + + if (isEXIF(input)) { + orientation = validateExifBlock(input, i) + } + + // ensure correct format + validateInput(input, i) + + // 0xFFC0 is baseline standard(SOF) + // 0xFFC1 is baseline optimized(SOF) + // 0xFFC2 is progressive(SOF2) + next = input[i + 1] + if (next === 0xc0 || next === 0xc1 || next === 0xc2) { + const size = extractSize(input, i + 5) + + // TODO: is orientation=0 a valid answer here? + if (!orientation) { + return size + } + + return { + height: size.height, + orientation, + width: size.width, + } + } + + // move to the next block + input = input.slice(i + 2) + } + + throw new TypeError("Invalid JPG, no size found") + }, +} diff --git a/libs/Universal-PicGo-Core/src/utils/image-size/types/ktx.ts b/libs/Universal-PicGo-Core/src/utils/image-size/types/ktx.ts new file mode 100644 index 0000000..3f0c8ee --- /dev/null +++ b/libs/Universal-PicGo-Core/src/utils/image-size/types/ktx.ts @@ -0,0 +1,19 @@ +import type { IImage } from "./interface" +import { toUTF8String, readUInt32LE } from "./utils" + +export const KTX: IImage = { + validate: (input) => { + const signature = toUTF8String(input, 1, 7) + return ["KTX 11", "KTX 20"].includes(signature) + }, + + calculate: (input) => { + const type = input[5] === 0x31 ? "ktx" : "ktx2" + const offset = type === "ktx" ? 36 : 20 + return { + height: readUInt32LE(input, offset + 4), + width: readUInt32LE(input, offset), + type, + } + }, +} diff --git a/libs/Universal-PicGo-Core/src/utils/image-size/types/png.ts b/libs/Universal-PicGo-Core/src/utils/image-size/types/png.ts new file mode 100644 index 0000000..55ff630 --- /dev/null +++ b/libs/Universal-PicGo-Core/src/utils/image-size/types/png.ts @@ -0,0 +1,37 @@ +import type { IImage } from "./interface" +import { toUTF8String, readUInt32BE } from "./utils" + +const pngSignature = "PNG\r\n\x1a\n" +const pngImageHeaderChunkName = "IHDR" + +// Used to detect "fried" png's: http://www.jongware.com/pngdefry.html +const pngFriedChunkName = "CgBI" + +export const PNG: IImage = { + validate(input) { + if (pngSignature === toUTF8String(input, 1, 8)) { + let chunkName = toUTF8String(input, 12, 16) + if (chunkName === pngFriedChunkName) { + chunkName = toUTF8String(input, 28, 32) + } + if (chunkName !== pngImageHeaderChunkName) { + throw new TypeError("Invalid PNG") + } + return true + } + return false + }, + + calculate(input) { + if (toUTF8String(input, 12, 16) === pngFriedChunkName) { + return { + height: readUInt32BE(input, 36), + width: readUInt32BE(input, 32), + } + } + return { + height: readUInt32BE(input, 20), + width: readUInt32BE(input, 16), + } + }, +} diff --git a/libs/Universal-PicGo-Core/src/utils/image-size/types/pnm.ts b/libs/Universal-PicGo-Core/src/utils/image-size/types/pnm.ts new file mode 100644 index 0000000..9aa287b --- /dev/null +++ b/libs/Universal-PicGo-Core/src/utils/image-size/types/pnm.ts @@ -0,0 +1,78 @@ +import type { IImage, ISize } from "./interface" +import { toUTF8String } from "./utils" + +const PNMTypes = { + P1: "pbm/ascii", + P2: "pgm/ascii", + P3: "ppm/ascii", + P4: "pbm", + P5: "pgm", + P6: "ppm", + P7: "pam", + PF: "pfm", +} as const + +type ValidSignature = keyof typeof PNMTypes +type Handler = (type: string[]) => ISize + +const handlers: { [type: string]: Handler } = { + default: (lines) => { + let dimensions: string[] = [] + + while (lines.length > 0) { + const line = lines.shift() as string + if (line[0] === "#") { + continue + } + dimensions = line.split(" ") + break + } + + if (dimensions.length === 2) { + return { + height: parseInt(dimensions[1], 10), + width: parseInt(dimensions[0], 10), + } + } else { + throw new TypeError("Invalid PNM") + } + }, + pam: (lines) => { + const size: { [key: string]: number } = {} + while (lines.length > 0) { + const line = lines.shift() as string + if (line.length > 16 || line.charCodeAt(0) > 128) { + continue + } + const [key, value] = line.split(" ") + if (key && value) { + size[key.toLowerCase()] = parseInt(value, 10) + } + if (size.height && size.width) { + break + } + } + + if (size.height && size.width) { + return { + height: size.height, + width: size.width, + } + } else { + throw new TypeError("Invalid PAM") + } + }, +} + +export const PNM: IImage = { + validate: (input) => toUTF8String(input, 0, 2) in PNMTypes, + + calculate(input) { + const signature = toUTF8String(input, 0, 2) as ValidSignature + const type = PNMTypes[signature] + // TODO: this probably generates garbage. move to a stream based parser + const lines = toUTF8String(input, 3).split(/[\r\n]+/) + const handler = handlers[type] || handlers.default + return handler(lines) + }, +} diff --git a/libs/Universal-PicGo-Core/src/utils/image-size/types/psd.ts b/libs/Universal-PicGo-Core/src/utils/image-size/types/psd.ts new file mode 100644 index 0000000..7f0e08d --- /dev/null +++ b/libs/Universal-PicGo-Core/src/utils/image-size/types/psd.ts @@ -0,0 +1,11 @@ +import type { IImage } from "./interface" +import { toUTF8String, readUInt32BE } from "./utils" + +export const PSD: IImage = { + validate: (input) => toUTF8String(input, 0, 4) === "8BPS", + + calculate: (input) => ({ + height: readUInt32BE(input, 14), + width: readUInt32BE(input, 18), + }), +} diff --git a/libs/Universal-PicGo-Core/src/utils/image-size/types/svg.ts b/libs/Universal-PicGo-Core/src/utils/image-size/types/svg.ts new file mode 100644 index 0000000..091518b --- /dev/null +++ b/libs/Universal-PicGo-Core/src/utils/image-size/types/svg.ts @@ -0,0 +1,105 @@ +import type { IImage, ISize } from "./interface" +import { toUTF8String } from "./utils" + +type IAttributes = { + width: number | null + height: number | null + viewbox?: IAttributes | null +} + +const svgReg = /"']|"[^"]*"|'[^']*')*>/ + +const extractorRegExps = { + height: /\sheight=(['"])([^%]+?)\1/, + root: svgReg, + viewbox: /\sviewBox=(['"])(.+?)\1/i, + width: /\swidth=(['"])([^%]+?)\1/, +} + +const INCH_CM = 2.54 +const units: { [unit: string]: number } = { + in: 96, + cm: 96 / INCH_CM, + em: 16, + ex: 8, + m: (96 / INCH_CM) * 100, + mm: 96 / INCH_CM / 10, + pc: 96 / 72 / 12, + pt: 96 / 72, + px: 1, +} + +const unitsReg = new RegExp(`^([0-9.]+(?:e\\d+)?)(${Object.keys(units).join("|")})?$`) + +function parseLength(len: string) { + const m = unitsReg.exec(len) + if (!m) { + return undefined + } + return Math.round(Number(m[1]) * (units[m[2]] || 1)) +} + +function parseViewbox(viewbox: string): IAttributes { + const bounds = viewbox.split(" ") + return { + height: parseLength(bounds[3]) as number, + width: parseLength(bounds[2]) as number, + } +} + +function parseAttributes(root: string): IAttributes { + const width = root.match(extractorRegExps.width) + const height = root.match(extractorRegExps.height) + const viewbox = root.match(extractorRegExps.viewbox) + return { + height: height && (parseLength(height[2]) as number), + viewbox: viewbox && (parseViewbox(viewbox[2]) as IAttributes), + width: width && (parseLength(width[2]) as number), + } +} + +function calculateByDimensions(attrs: IAttributes): ISize { + return { + height: attrs.height as number, + width: attrs.width as number, + } +} + +function calculateByViewbox(attrs: IAttributes, viewbox: IAttributes): ISize { + const ratio = (viewbox.width as number) / (viewbox.height as number) + if (attrs.width) { + return { + height: Math.floor(attrs.width / ratio), + width: attrs.width, + } + } + if (attrs.height) { + return { + height: attrs.height, + width: Math.floor(attrs.height * ratio), + } + } + return { + height: viewbox.height as number, + width: viewbox.width as number, + } +} + +export const SVG: IImage = { + // Scan only the first kilo-byte to speed up the check on larger files + validate: (input) => svgReg.test(toUTF8String(input, 0, 1000)), + + calculate(input) { + const root = toUTF8String(input).match(extractorRegExps.root) + if (root) { + const attrs = parseAttributes(root[0]) + if (attrs.width && attrs.height) { + return calculateByDimensions(attrs) + } + if (attrs.viewbox) { + return calculateByViewbox(attrs, attrs.viewbox) + } + } + throw new TypeError("Invalid SVG") + }, +} diff --git a/libs/Universal-PicGo-Core/src/utils/image-size/types/tga.ts b/libs/Universal-PicGo-Core/src/utils/image-size/types/tga.ts new file mode 100644 index 0000000..454eaec --- /dev/null +++ b/libs/Universal-PicGo-Core/src/utils/image-size/types/tga.ts @@ -0,0 +1,15 @@ +import type { IImage } from "./interface" +import { readUInt16LE } from "./utils" + +export const TGA: IImage = { + validate(input) { + return readUInt16LE(input, 0) === 0 && readUInt16LE(input, 4) === 0 + }, + + calculate(input) { + return { + height: readUInt16LE(input, 14), + width: readUInt16LE(input, 12), + } + }, +} diff --git a/libs/Universal-PicGo-Core/src/utils/image-size/types/tiff.ts b/libs/Universal-PicGo-Core/src/utils/image-size/types/tiff.ts new file mode 100644 index 0000000..2d9ee47 --- /dev/null +++ b/libs/Universal-PicGo-Core/src/utils/image-size/types/tiff.ts @@ -0,0 +1,113 @@ +// based on http://www.compix.com/fileformattif.htm +// TO-DO: support big-endian as well +import type { IImage } from "./interface" +import { readUInt, toHexString, toUTF8String } from "./utils" +import { win } from "universal-picgo-store" + +// Read IFD (image-file-directory) into a buffer +function readIFD(input: Uint8Array, filepath: string, isBigEndian: boolean) { + const fs = win.fs + const ifdOffset = readUInt(input, 32, 4, isBigEndian) + + // read only till the end of the file + let bufferSize = 1024 + const fileSize = fs.statSync(filepath).size + if (ifdOffset + bufferSize > fileSize) { + bufferSize = fileSize - ifdOffset - 10 + } + + // populate the buffer + const endBuffer = new Uint8Array(bufferSize) + const descriptor = fs.openSync(filepath, "r") + fs.readSync(descriptor, endBuffer, 0, bufferSize, ifdOffset) + fs.closeSync(descriptor) + + return endBuffer.slice(2) +} + +// TIFF values seem to be messed up on Big-Endian, this helps +function readValue(input: Uint8Array, isBigEndian: boolean): number { + const low = readUInt(input, 16, 8, isBigEndian) + const high = readUInt(input, 16, 10, isBigEndian) + return (high << 16) + low +} + +// move to the next tag +function nextTag(input: Uint8Array) { + if (input.length > 24) { + return input.slice(12) + } +} + +// Extract IFD tags from TIFF metadata +function extractTags(input: Uint8Array, isBigEndian: boolean) { + const tags: { [key: number]: number } = {} + + let temp: Uint8Array | undefined = input + while (temp && temp.length) { + const code = readUInt(temp, 16, 0, isBigEndian) + const type = readUInt(temp, 16, 2, isBigEndian) + const length = readUInt(temp, 32, 4, isBigEndian) + + // 0 means end of IFD + if (code === 0) { + break + } else { + // 256 is width, 257 is height + // if (code === 256 || code === 257) { + if (length === 1 && (type === 3 || type === 4)) { + tags[code] = readValue(temp, isBigEndian) + } + + // move to the next tag + temp = nextTag(temp) + } + } + + return tags +} + +// Test if the TIFF is Big Endian or Little Endian +function determineEndianness(input: Uint8Array) { + const signature = toUTF8String(input, 0, 2) + if ("II" === signature) { + return "LE" + } else if ("MM" === signature) { + return "BE" + } +} + +const signatures = [ + // '492049', // currently not supported + "49492a00", // Little endian + "4d4d002a", // Big Endian + // '4d4d002a', // BigTIFF > 4GB. currently not supported +] + +export const TIFF: IImage = { + validate: (input) => signatures.includes(toHexString(input, 0, 4)), + + calculate(input, filepath) { + if (!filepath) { + throw new TypeError("Tiff doesn't support buffer") + } + + // Determine BE/LE + const isBigEndian = determineEndianness(input) === "BE" + + // read the IFD + const ifdBuffer = readIFD(input, filepath, isBigEndian) + + // extract the tags from the IFD + const tags = extractTags(ifdBuffer, isBigEndian) + + const width = tags[256] + const height = tags[257] + + if (!width || !height) { + throw new TypeError("Invalid Tiff. Missing tags") + } + + return { height, width } + }, +} diff --git a/libs/Universal-PicGo-Core/src/utils/image-size/types/utils.ts b/libs/Universal-PicGo-Core/src/utils/image-size/types/utils.ts new file mode 100644 index 0000000..d23d0a3 --- /dev/null +++ b/libs/Universal-PicGo-Core/src/utils/image-size/types/utils.ts @@ -0,0 +1,65 @@ +import { win } from "universal-picgo-store" + +const decoder = new TextDecoder() +export const toUTF8String = (input: typeof win.Uint8Array, start = 0, end = input.length) => + decoder.decode(input.slice(start, end)) + +export const toHexString = (input: typeof win.Uint8Array, start = 0, end = input.length) => + input.slice(start, end).reduce((memo: any, i: any) => memo + ("0" + i.toString(16)).slice(-2), "") + +export const readInt16LE = (input: typeof win.Uint8Array, offset = 0) => { + const val = input[offset] + input[offset + 1] * 2 ** 8 + return val | ((val & (2 ** 15)) * 0x1fffe) +} + +export const readUInt16BE = (input: typeof win.Uint8Array, offset = 0) => input[offset] * 2 ** 8 + input[offset + 1] + +export const readUInt16LE = (input: typeof win.Uint8Array, offset = 0) => input[offset] + input[offset + 1] * 2 ** 8 + +export const readUInt24LE = (input: typeof win.Uint8Array, offset = 0) => + input[offset] + input[offset + 1] * 2 ** 8 + input[offset + 2] * 2 ** 16 + +export const readInt32LE = (input: typeof win.Uint8Array, offset = 0) => + input[offset] + input[offset + 1] * 2 ** 8 + input[offset + 2] * 2 ** 16 + (input[offset + 3] << 24) + +export const readUInt32BE = (input: typeof win.Uint8Array, offset = 0) => + input[offset] * 2 ** 24 + input[offset + 1] * 2 ** 16 + input[offset + 2] * 2 ** 8 + input[offset + 3] + +export const readUInt32LE = (input: typeof win.Uint8Array, offset = 0) => + input[offset] + input[offset + 1] * 2 ** 8 + input[offset + 2] * 2 ** 16 + input[offset + 3] * 2 ** 24 + +// Abstract reading multi-byte unsigned integers +const methods = { + readUInt16BE, + readUInt16LE, + readUInt32BE, + readUInt32LE, +} as const + +type MethodName = keyof typeof methods +export function readUInt(input: typeof win.Uint8Array, bits: 16 | 32, offset: number, isBigEndian: boolean): number { + offset = offset || 0 + const endian = isBigEndian ? "BE" : "LE" + const methodName: MethodName = ("readUInt" + bits + endian) as MethodName + return methods[methodName](input, offset) +} + +function readBox(buffer: typeof win.Uint8Array, offset: number) { + if (buffer.length - offset < 4) return + const boxSize = readUInt32BE(buffer, offset) + if (buffer.length - offset < boxSize) return + return { + name: toUTF8String(buffer, 4 + offset, 8 + offset), + offset, + size: boxSize, + } +} + +export function findBox(buffer: typeof win.Uint8Array, boxName: string, offset: number) { + while (offset < buffer.length) { + const box = readBox(buffer, offset) + if (!box) break + if (box.name === boxName) return box + offset += box.size + } +} diff --git a/libs/Universal-PicGo-Core/src/utils/image-size/types/webp.ts b/libs/Universal-PicGo-Core/src/utils/image-size/types/webp.ts new file mode 100644 index 0000000..06e3cd7 --- /dev/null +++ b/libs/Universal-PicGo-Core/src/utils/image-size/types/webp.ts @@ -0,0 +1,66 @@ +// based on https://developers.google.com/speed/webp/docs/riff_container +import type { IImage, ISize } from "./interface" +import { toHexString, toUTF8String, readInt16LE, readUInt24LE } from "./utils" + +function calculateExtended(input: Uint8Array): ISize { + return { + height: 1 + readUInt24LE(input, 7), + width: 1 + readUInt24LE(input, 4), + } +} + +function calculateLossless(input: Uint8Array): ISize { + return { + height: 1 + (((input[4] & 0xf) << 10) | (input[3] << 2) | ((input[2] & 0xc0) >> 6)), + width: 1 + (((input[2] & 0x3f) << 8) | input[1]), + } +} + +function calculateLossy(input: Uint8Array): ISize { + // `& 0x3fff` returns the last 14 bits + // TO-DO: include webp scaling in the calculations + return { + height: readInt16LE(input, 8) & 0x3fff, + width: readInt16LE(input, 6) & 0x3fff, + } +} + +export const WEBP: IImage = { + validate(input) { + const riffHeader = "RIFF" === toUTF8String(input, 0, 4) + const webpHeader = "WEBP" === toUTF8String(input, 8, 12) + const vp8Header = "VP8" === toUTF8String(input, 12, 15) + return riffHeader && webpHeader && vp8Header + }, + + calculate(input) { + const chunkHeader = toUTF8String(input, 12, 16) + input = input.slice(20, 30) + + // Extended webp stream signature + if (chunkHeader === "VP8X") { + const extendedHeader = input[0] + const validStart = (extendedHeader & 0xc0) === 0 + const validEnd = (extendedHeader & 0x01) === 0 + if (validStart && validEnd) { + return calculateExtended(input) + } else { + // TODO: breaking change + throw new TypeError("Invalid WebP") + } + } + + // Lossless webp stream signature + if (chunkHeader === "VP8 " && input[0] !== 0x2f) { + return calculateLossy(input) + } + + // Lossy webp stream signature + const signature = toHexString(input, 3, 6) + if (chunkHeader === "VP8L" && signature !== "9d012a") { + return calculateLossless(input) + } + + throw new TypeError("Invalid WebP") + }, +} diff --git a/libs/Universal-PicGo-Store/src/lib/base/electron/writeFileAtomic.ts b/libs/Universal-PicGo-Store/src/lib/base/electron/writeFileAtomic.ts index 33c4fb9..9f3cd4e 100644 --- a/libs/Universal-PicGo-Store/src/lib/base/electron/writeFileAtomic.ts +++ b/libs/Universal-PicGo-Store/src/lib/base/electron/writeFileAtomic.ts @@ -11,7 +11,6 @@ import { win } from "../../utils" import { onExit } from "./signalExitShim" import MurmurHash3 from "./Murmurhash3" -const fs = win.fs const murmurHash3 = new MurmurHash3(win.__filename) const activeFiles = {} as any @@ -41,6 +40,7 @@ function getTmpname(filename: string) { function cleanupOnExit(tmpfile: any) { return () => { try { + const fs = win.fs fs.unlinkSync(typeof tmpfile === "function" ? tmpfile() : tmpfile) } catch { // ignore errors @@ -79,6 +79,7 @@ function isChownErrOk(err: any) { } async function writeFileAsync(filename: string, data: any, options = {} as any) { + const fs = win.fs const path = win.require("path") const { promisify } = win.require("util") @@ -184,6 +185,8 @@ async function writeFile(filename: string, data: any, options: any, callback: an } function writeFileSync(filename: string, data: any, options?: any) { + const fs = win.fs + if (typeof options === "string") { options = { encoding: options } } else if (!options) { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6970705..3073982 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -29,6 +29,9 @@ importers: js-yaml: specifier: ^4.1.0 version: 4.1.0 + queue: + specifier: ^7.0.0 + version: 7.0.0 universal-picgo-store: specifier: workspace:* version: link:../Universal-PicGo-Store @@ -5772,6 +5775,10 @@ packages: resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} dev: true + /queue@7.0.0: + resolution: {integrity: sha512-sphwS7HdfQnvrJAXUNAUgpf9H/546IE3p/5Lf2jr71O4udEYlqAhkevykumas2FYuMkX/29JMOgrRdRoYZ/X9w==} + dev: false + /quick-lru@4.0.1: resolution: {integrity: sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g==} engines: {node: '>=8'} From 678ad8aeb5ee03edfbde5bef4eb51d410f88a38a Mon Sep 17 00:00:00 2001 From: terwer Date: Tue, 19 Mar 2024 18:36:52 +0800 Subject: [PATCH 28/34] feat: add axios for request --- libs/Universal-PicGo-Core/package.json | 1 + .../src/plugins/uploader/index.ts | 6 +- .../src/plugins/uploader/smms.ts | 203 ++++++++++-------- pnpm-lock.yaml | 33 ++- 4 files changed, 140 insertions(+), 103 deletions(-) diff --git a/libs/Universal-PicGo-Core/package.json b/libs/Universal-PicGo-Core/package.json index bf77fb8..8e59a15 100644 --- a/libs/Universal-PicGo-Core/package.json +++ b/libs/Universal-PicGo-Core/package.json @@ -31,6 +31,7 @@ }, "dependencies": { "@picgo/i18n": "^1.0.0", + "axios": "^1.6.8", "dayjs": "^1.11.10", "js-yaml": "^4.1.0", "queue": "^7.0.0", diff --git a/libs/Universal-PicGo-Core/src/plugins/uploader/index.ts b/libs/Universal-PicGo-Core/src/plugins/uploader/index.ts index fad8351..f9dbc59 100644 --- a/libs/Universal-PicGo-Core/src/plugins/uploader/index.ts +++ b/libs/Universal-PicGo-Core/src/plugins/uploader/index.ts @@ -8,10 +8,12 @@ */ import { IPicGo, IPicGoPlugin } from "../../types" - +import SMMSUploader from "./smms" const buildInUploaders: IPicGoPlugin = () => { return { - register(ctx: IPicGo) {}, + register(ctx: IPicGo) { + SMMSUploader(ctx) + }, } } diff --git a/libs/Universal-PicGo-Core/src/plugins/uploader/smms.ts b/libs/Universal-PicGo-Core/src/plugins/uploader/smms.ts index 0dfd11b..5fb2e42 100644 --- a/libs/Universal-PicGo-Core/src/plugins/uploader/smms.ts +++ b/libs/Universal-PicGo-Core/src/plugins/uploader/smms.ts @@ -7,98 +7,111 @@ * of this license document, but changing it is not allowed. */ -// const postOptions = (fileName: string, image: Buffer, apiToken: string, backupDomain = ''): IOldReqOptions => { -// const domain = backupDomain || 'sm.ms' -// return { -// method: 'POST', -// url: `https://${domain}/api/v2/upload`, -// headers: { -// contentType: 'multipart/form-data', -// 'User-Agent': 'PicGo', -// Authorization: apiToken -// }, -// formData: { -// smfile: { -// value: image, -// options: { -// filename: fileName -// } -// }, -// ssl: 'true' -// } -// } -// } -// -// const handle = async (ctx: IPicGo): Promise => { -// const smmsConfig = ctx.getConfig('picBed.smms') -// if (!smmsConfig) { -// throw new Error('Can not find smms config!') -// } -// const imgList = ctx.output -// for (const img of imgList) { -// if (img.fileName && img.buffer) { -// let image = img.buffer -// if (!image && img.base64Image) { -// image = Buffer.from(img.base64Image, 'base64') -// } -// const postConfig = postOptions(img.fileName, image, smmsConfig?.token, smmsConfig?.backupDomain) -// try { -// const res: string = await ctx.request(postConfig) -// const body = JSON.parse(res) -// if (body.code === 'success') { -// delete img.base64Image -// delete img.buffer -// img.imgUrl = body.data.url -// } else if (body.code === 'image_repeated' && typeof body.images === 'string') { // do extra check since this error return is not documented at https://doc.sm.ms/#api-Image-Upload -// delete img.base64Image -// delete img.buffer -// img.imgUrl = body.images -// } else { -// ctx.emit(IBuildInEvent.NOTIFICATION, { -// title: ctx.i18n.translate('UPLOAD_FAILED'), -// body: body.message -// }) -// throw new Error(body.message) -// } -// } catch (e: any) { -// ctx.log.error(e) -// throw e -// } -// } -// } -// return ctx -// } -// -// const config = (ctx: IPicGo): IPluginConfig[] => { -// const userConfig = ctx.getConfig('picBed.smms') || {} -// const config: IPluginConfig[] = [ -// { -// name: 'token', -// message: 'api token', -// type: 'password', -// get alias () { return ctx.i18n.translate('PICBED_SMMS_TOKEN') }, -// default: userConfig.token || '', -// required: true -// }, -// { -// name: 'backupDomain', -// type: 'input', -// get prefix () { return ctx.i18n.translate('PICBED_SMMS_BACKUP_DOMAIN') }, -// get message () { -// return ctx.i18n.translate('PICBED_SMMS_MESSAGE_BACKUP_DOMAIN') -// }, -// get alias () { return ctx.i18n.translate('PICBED_SMMS_BACKUP_DOMAIN') }, -// default: userConfig.backupDomain || '', -// required: false -// } -// ] -// return config -// } -// -// export default function register (ctx: IPicGo): void { -// ctx.helper.uploader.register('smms', { -// get name () { return ctx.i18n.translate('PICBED_SMMS') }, -// handle, -// config -// }) -// } +import { ILocalesKey } from "../../i18n/zh-CN" +import { IPicGo, IPluginConfig, ISmmsConfig } from "../../types" +import { IBuildInEvent } from "../../utils/enums" + +const postOptions = (fileName: string, image: Buffer, apiToken: string, backupDomain = ""): IOldReqOptions => { + const domain = backupDomain || "sm.ms" + return { + method: "POST", + url: `https://${domain}/api/v2/upload`, + headers: { + contentType: "multipart/form-data", + "User-Agent": "PicGo", + Authorization: apiToken, + }, + formData: { + smfile: { + value: image, + options: { + filename: fileName, + }, + }, + ssl: "true", + }, + } +} + +const handle = async (ctx: IPicGo): Promise => { + const smmsConfig = ctx.getConfig("picBed.smms") + if (!smmsConfig) { + throw new Error("Can not find smms config!") + } + const imgList = ctx.output + for (const img of imgList) { + if (img.fileName && img.buffer) { + let image = img.buffer + if (!image && img.base64Image) { + image = Buffer.from(img.base64Image, "base64") + } + const postConfig = postOptions(img.fileName, image, smmsConfig?.token, smmsConfig?.backupDomain) + try { + const res: string = await ctx.request(postConfig) + const body = JSON.parse(res) + if (body.code === "success") { + delete img.base64Image + delete img.buffer + img.imgUrl = body.data.url + } else if (body.code === "image_repeated" && typeof body.images === "string") { + // do extra check since this error return is not documented at https://doc.sm.ms/#api-Image-Upload + delete img.base64Image + delete img.buffer + img.imgUrl = body.images + } else { + ctx.emit(IBuildInEvent.NOTIFICATION, { + title: ctx.i18n.translate("UPLOAD_FAILED"), + body: body.message, + }) + throw new Error(body.message) + } + } catch (e: any) { + ctx.log.error(e) + throw e + } + } + } + return ctx +} + +const config = (ctx: IPicGo): IPluginConfig[] => { + const userConfig = ctx.getConfig("picBed.smms") || {} + const config: IPluginConfig[] = [ + { + name: "token", + message: "api token", + type: "password", + get alias() { + return ctx.i18n.translate("PICBED_SMMS_TOKEN") + }, + default: userConfig.token || "", + required: true, + }, + { + name: "backupDomain", + type: "input", + get prefix() { + return ctx.i18n.translate("PICBED_SMMS_BACKUP_DOMAIN") + }, + get message() { + return ctx.i18n.translate("PICBED_SMMS_MESSAGE_BACKUP_DOMAIN") + }, + get alias() { + return ctx.i18n.translate("PICBED_SMMS_BACKUP_DOMAIN") + }, + default: userConfig.backupDomain || "", + required: false, + }, + ] + return config +} + +export default function register(ctx: IPicGo): void { + ctx.helper.uploader.register("smms", { + get name() { + return ctx.i18n.translate("PICBED_SMMS") + }, + handle, + config, + }) +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3073982..50b48de 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -23,6 +23,9 @@ importers: '@picgo/i18n': specifier: ^1.0.0 version: 1.0.0 + axios: + specifier: ^1.6.8 + version: 1.6.8 dayjs: specifier: ^1.11.10 version: 1.11.10 @@ -2497,7 +2500,6 @@ packages: /asynckit@0.4.0: resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} - dev: true /at-least-node@1.0.0: resolution: {integrity: sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==} @@ -2511,6 +2513,16 @@ packages: possible-typed-array-names: 1.0.0 dev: true + /axios@1.6.8: + resolution: {integrity: sha512-v/ZHtJDU39mDpyBoFVkETcd/uNdxrWRrg3bKpOKzXFA6Bvqopts6ALSMU3y6ijYxbw2B+wPrIv46egTzJXCLGQ==} + dependencies: + follow-redirects: 1.15.6 + form-data: 4.0.0 + proxy-from-env: 1.1.0 + transitivePeerDependencies: + - debug + dev: false + /axobject-query@4.0.0: resolution: {integrity: sha512-+60uv1hiVFhHZeO+Lz0RYzsVHy5Wr1ayX0mwda9KPDVLNJgZ1T9Ny7VmFbLDzxsH0D87I86vgj3gFrjTJUYznw==} dependencies: @@ -2875,7 +2887,6 @@ packages: engines: {node: '>= 0.8'} dependencies: delayed-stream: 1.0.0 - dev: true /commander@2.20.3: resolution: {integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==} @@ -3279,7 +3290,6 @@ packages: /delayed-stream@1.0.0: resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} engines: {node: '>=0.4.0'} - dev: true /dequal@2.0.3: resolution: {integrity: sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==} @@ -3953,6 +3963,16 @@ packages: resolution: {integrity: sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==} dev: true + /follow-redirects@1.15.6: + resolution: {integrity: sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==} + engines: {node: '>=4.0'} + peerDependencies: + debug: '*' + peerDependenciesMeta: + debug: + optional: true + dev: false + /for-each@0.3.3: resolution: {integrity: sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==} dependencies: @@ -3966,7 +3986,6 @@ packages: asynckit: 0.4.0 combined-stream: 1.0.8 mime-types: 2.1.33 - dev: true /fs-extra@10.1.0: resolution: {integrity: sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==} @@ -5099,14 +5118,12 @@ packages: /mime-db@1.50.0: resolution: {integrity: sha512-9tMZCDlYHqeERXEHO9f/hKfNXhre5dK2eE/krIvUjZbS2KPcqGDfNShIWS1uW9XOTKQKqK6qbeOci18rbfW77A==} engines: {node: '>= 0.6'} - dev: true /mime-types@2.1.33: resolution: {integrity: sha512-plLElXp7pRDd0bNZHw+nMd52vRYjLwQjygaNg7ddJ2uJtTlmnTCjWuPKxVu6//AdaRuME84SvLW91sIkBqGT0g==} engines: {node: '>= 0.6'} dependencies: mime-db: 1.50.0 - dev: true /mimic-fn@1.2.0: resolution: {integrity: sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==} @@ -5731,6 +5748,10 @@ packages: engines: {node: '>= 0.6.0'} dev: true + /proxy-from-env@1.1.0: + resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} + dev: false + /psl@1.9.0: resolution: {integrity: sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==} dev: true From 679625b63f2c3feb73edb69f5ca5b0fed11a0d32 Mon Sep 17 00:00:00 2001 From: zhangyue Date: Tue, 19 Mar 2024 21:58:00 +0800 Subject: [PATCH 29/34] feat: add smms plugin --- .../src/core/UniversalPicGo.ts | 4 + .../src/lib/PicGoRequest.ts | 25 ++++ .../src/plugins/uploader/smms.ts | 21 ++-- .../Universal-PicGo-Core/src/types/index.d.ts | 61 ++++++++++ libs/Universal-PicGo-Core/src/utils/common.ts | 114 +++++++++--------- 5 files changed, 159 insertions(+), 66 deletions(-) create mode 100644 libs/Universal-PicGo-Core/src/lib/PicGoRequest.ts diff --git a/libs/Universal-PicGo-Core/src/core/UniversalPicGo.ts b/libs/Universal-PicGo-Core/src/core/UniversalPicGo.ts index f868dd6..98c9648 100644 --- a/libs/Universal-PicGo-Core/src/core/UniversalPicGo.ts +++ b/libs/Universal-PicGo-Core/src/core/UniversalPicGo.ts @@ -17,6 +17,7 @@ import { IPicGo, IPicGoPlugin, IPicGoPluginInterface, + IPicGoRequest, IPluginLoader, IStringKeyMap, } from "../types" @@ -36,6 +37,7 @@ import { I18nManager } from "../i18n" import { browserPathJoin, getBrowserDirectoryPath } from "../utils/browserUtils" import { isConfigKeyInBlackList, isInputConfigValid } from "../utils/common" import { eventBus } from "../utils/eventBus" +import { PicGoRequest } from "../lib/PicGoRequest" /* * 通用 PicGO 对象定义 @@ -56,6 +58,7 @@ class UniversalPicGo extends EventEmitter implements IPicGo { output: IImgInfo[] input: any[] pluginHandler: PluginHandler + request: IPicGoRequest i18n!: II18nManager VERSION: string = process.env.PICGO_VERSION ?? "unknown" private readonly isDev: boolean @@ -87,6 +90,7 @@ class UniversalPicGo extends EventEmitter implements IPicGo { this.initConfigPath() // this.cmd = new Commander(this) this.pluginHandler = new PluginHandler(this) + this.request = PicGoRequest this.initConfig() this.init() diff --git a/libs/Universal-PicGo-Core/src/lib/PicGoRequest.ts b/libs/Universal-PicGo-Core/src/lib/PicGoRequest.ts new file mode 100644 index 0000000..e118cc2 --- /dev/null +++ b/libs/Universal-PicGo-Core/src/lib/PicGoRequest.ts @@ -0,0 +1,25 @@ +/* + * GNU GENERAL PUBLIC LICENSE + * Version 3, 29 June 2007 + * + * Copyright (C) 2022-2024 Terwer, Inc. + * Everyone is permitted to copy and distribute verbatim copies + * of this license document, but changing it is not allowed. + * + */ + +import { AxiosRequestConfig } from "axios" +import { IResponse } from "../types" + +// #64 dynamic get proxy value +/** + * PicGo 统一请求封装,基于 axios + * + * @param options + * @constructor + */ +function PicGoRequest(options: U): Promise> { + throw new Error("PicGoRequest is not implemented") +} + +export { PicGoRequest } diff --git a/libs/Universal-PicGo-Core/src/plugins/uploader/smms.ts b/libs/Universal-PicGo-Core/src/plugins/uploader/smms.ts index 5fb2e42..83c1bc9 100644 --- a/libs/Universal-PicGo-Core/src/plugins/uploader/smms.ts +++ b/libs/Universal-PicGo-Core/src/plugins/uploader/smms.ts @@ -10,26 +10,25 @@ import { ILocalesKey } from "../../i18n/zh-CN" import { IPicGo, IPluginConfig, ISmmsConfig } from "../../types" import { IBuildInEvent } from "../../utils/enums" +import { AxiosRequestConfig } from "axios" -const postOptions = (fileName: string, image: Buffer, apiToken: string, backupDomain = ""): IOldReqOptions => { +const postOptions = (fileName: string, image: Buffer, apiToken: string, backupDomain = ""): AxiosRequestConfig => { const domain = backupDomain || "sm.ms" + + const formData = new FormData() + formData.append("smfile", new Blob([image], { type: "image/png" }), fileName) + formData.append("ssl", "true") + return { method: "POST", url: `https://${domain}/api/v2/upload`, headers: { - contentType: "multipart/form-data", + "Content-Type": "multipart/form-data", "User-Agent": "PicGo", Authorization: apiToken, }, - formData: { - smfile: { - value: image, - options: { - filename: fileName, - }, - }, - ssl: "true", - }, + data: formData, + responseType: "json", } } diff --git a/libs/Universal-PicGo-Core/src/types/index.d.ts b/libs/Universal-PicGo-Core/src/types/index.d.ts index 7c8bd0b..fd71452 100644 --- a/libs/Universal-PicGo-Core/src/types/index.d.ts +++ b/libs/Universal-PicGo-Core/src/types/index.d.ts @@ -10,6 +10,7 @@ import { EventEmitter, Buffer } from "../utils/nodePolyfill" import { ILogger } from "zhi-lib-base" +import {AxiosRequestConfig} from "axios"; export interface IPicGo extends EventEmitter { /** @@ -46,6 +47,10 @@ export interface IPicGo extends EventEmitter { * install\uninstall\update picgo's plugin via npm */ pluginHandler: IPluginHandler + /** + * request based on axios + */ + request: IPicGoRequest /** * plugin system core part transformer\uploader\beforeTransformPlugins... */ @@ -454,3 +459,59 @@ export interface IImgSize { export interface IPathTransformedImgInfo extends IImgInfo { success: boolean } + +// ===================================================================================================================== +// request start + +export type IPicGoRequest = (config: U) => Promise> + +/** + * for PicGo new request api, the response will be json format + */ +export type IReqOptions = AxiosRequestConfig & { + resolveWithFullResponse: true +} + +/** + * for PicGo new request api, the response will be Buffer + */ +export type IReqOptionsWithArrayBufferRes = IReqOptions & { + responseType: 'arraybuffer' +} + +/** + * for PicGo new request api, the response will be just response data. (not statusCode, headers, etc.) + */ +export type IReqOptionsWithBodyResOnly = AxiosRequestConfig + +export type IFullResponse = AxiosResponse & { + statusCode: number + body: T +} + +type AxiosResponse = import('axios').AxiosResponse + +type AxiosRequestConfig = import('axios').AxiosRequestConfig + +interface IRequestOptionsWithFullResponse { + resolveWithFullResponse: true +} + +interface IRequestOptionsWithJSON { + json: true +} + +interface IRequestOptionsWithResponseTypeArrayBuffer { + responseType: 'arraybuffer' +} + +/** + * T is the response data type + * U is the config type + */ +export type IResponse = U extends IRequestOptionsWithFullResponse ? IFullResponse + : U extends IRequestOptionsWithJSON ? T + : U extends IRequestOptionsWithResponseTypeArrayBuffer ? Buffer + : U extends IReqOptionsWithBodyResOnly ? T + : string +// request end \ No newline at end of file diff --git a/libs/Universal-PicGo-Core/src/utils/common.ts b/libs/Universal-PicGo-Core/src/utils/common.ts index f6f569a..2722b48 100644 --- a/libs/Universal-PicGo-Core/src/utils/common.ts +++ b/libs/Universal-PicGo-Core/src/utils/common.ts @@ -50,63 +50,67 @@ export const getFSFile = async (filePath: string): Promise => { url = handleUrlEncode(url) - const isImage = false - const extname = "" + let isImage = false + let extname = "" let timeoutId: any - throw new Error("getURLFile is not implemented") - // const requestFn = new Promise((resolve, reject) => { - // ;(async () => { - // try { - // const res = await ctx - // .request({ - // method: "get", - // url, - // resolveWithFullResponse: true, - // responseType: "arraybuffer", - // }) - // .then((resp: any) => { - // const contentType = resp.headers["content-type"] - // if (contentType?.includes("image")) { - // isImage = true - // extname = `.${contentType.split("image/")[1]}` - // } - // return resp.data as Buffer - // }) - // clearTimeout(timeoutId) - // if (isImage) { - // const urlPath = new URL(url).pathname - // resolve({ - // buffer: res, - // fileName: path.basename(urlPath), - // extname, - // success: true, - // }) - // } else { - // resolve({ - // success: false, - // reason: `${url} is not image`, - // }) - // } - // } catch (error: any) { - // clearTimeout(timeoutId) - // resolve({ - // success: false, - // // eslint-disable-next-line @typescript-eslint/restrict-template-expressions - // reason: `request ${url} error, ${error?.message ?? ""}`, - // }) - // } - // })().catch(reject) - // }) - // const timeoutPromise = new Promise((resolve): void => { - // timeoutId = setTimeout(() => { - // resolve({ - // success: false, - // reason: `request ${url} timeout`, - // }) - // }, 10000) - // }) - // return Promise.race([requestFn, timeoutPromise]) + const requestFn = new Promise((resolve, reject) => { + ;(async () => { + try { + const res = await ctx + .request({ + method: "get", + url, + resolveWithFullResponse: true, + responseType: "arraybuffer", + }) + .then((resp: any) => { + const contentType = resp.headers["content-type"] + if (contentType?.includes("image")) { + isImage = true + extname = `.${contentType.split("image/")[1]}` + } + return resp.data as Buffer + }) + clearTimeout(timeoutId) + if (isImage) { + const urlPath = new URL(url).pathname + const fileName = urlPath.split("/").pop() + // if (hasNodeEnv) { + // const path = win.require("path") + // fileName = path.basename(urlPath) + // } + resolve({ + buffer: res, + fileName: fileName, + extname, + success: true, + }) + } else { + resolve({ + success: false, + reason: `${url} is not image`, + }) + } + } catch (error: any) { + clearTimeout(timeoutId) + resolve({ + success: false, + // eslint-disable-next-line @typescript-eslint/restrict-template-expressions + reason: `request ${url} error, ${error?.message ?? ""}`, + }) + } + })().catch(reject) + }) + const timeoutPromise = new Promise((resolve): void => { + timeoutId = setTimeout(() => { + resolve({ + success: false, + reason: `request ${url} timeout`, + }) + }, 10000) + }) + return Promise.race([requestFn, timeoutPromise]) } /** From 78deb045970b90f06111c0e127c06fe9ba9a623a Mon Sep 17 00:00:00 2001 From: zhangyue Date: Tue, 19 Mar 2024 22:09:57 +0800 Subject: [PATCH 30/34] feat: add picgo request --- libs/Universal-PicGo-Core/src/lib/PicGoRequest.ts | 4 ++++ libs/Universal-PicGo-Core/src/utils/createContext.ts | 1 + 2 files changed, 5 insertions(+) diff --git a/libs/Universal-PicGo-Core/src/lib/PicGoRequest.ts b/libs/Universal-PicGo-Core/src/lib/PicGoRequest.ts index e118cc2..d0268ed 100644 --- a/libs/Universal-PicGo-Core/src/lib/PicGoRequest.ts +++ b/libs/Universal-PicGo-Core/src/lib/PicGoRequest.ts @@ -10,6 +10,9 @@ import { AxiosRequestConfig } from "axios" import { IResponse } from "../types" +import { simpleLogger } from "zhi-lib-base" + +const logger = simpleLogger("picgo-request", "universal-picgo") // #64 dynamic get proxy value /** @@ -19,6 +22,7 @@ import { IResponse } from "../types" * @constructor */ function PicGoRequest(options: U): Promise> { + logger.info("PicGoRequest start request", options) throw new Error("PicGoRequest is not implemented") } diff --git a/libs/Universal-PicGo-Core/src/utils/createContext.ts b/libs/Universal-PicGo-Core/src/utils/createContext.ts index 32c61fa..c79b5c6 100644 --- a/libs/Universal-PicGo-Core/src/utils/createContext.ts +++ b/libs/Universal-PicGo-Core/src/utils/createContext.ts @@ -24,6 +24,7 @@ const createContext = (ctx: IPicGo): IPicGo => { input: [], pluginLoader: ctx.pluginLoader, pluginHandler: ctx.pluginHandler, + request: ctx.request.bind(ctx), helper: ctx.helper, VERSION: ctx.VERSION, // GUI_VERSION: ctx.GUI_VERSION, From 1a126456bf73f4c236c16fded98be2e9a46d1dc2 Mon Sep 17 00:00:00 2001 From: zhangyue Date: Tue, 19 Mar 2024 23:05:43 +0800 Subject: [PATCH 31/34] feat: add picgo request --- .../src/core/UniversalPicGo.ts | 10 +- .../src/lib/PicGoRequest.ts | 255 ++++++++++++++++-- .../Universal-PicGo-Core/src/types/index.d.ts | 5 + .../src/utils/createContext.ts | 2 +- 4 files changed, 253 insertions(+), 19 deletions(-) diff --git a/libs/Universal-PicGo-Core/src/core/UniversalPicGo.ts b/libs/Universal-PicGo-Core/src/core/UniversalPicGo.ts index 98c9648..7ff8504 100644 --- a/libs/Universal-PicGo-Core/src/core/UniversalPicGo.ts +++ b/libs/Universal-PicGo-Core/src/core/UniversalPicGo.ts @@ -37,7 +37,7 @@ import { I18nManager } from "../i18n" import { browserPathJoin, getBrowserDirectoryPath } from "../utils/browserUtils" import { isConfigKeyInBlackList, isInputConfigValid } from "../utils/common" import { eventBus } from "../utils/eventBus" -import { PicGoRequest } from "../lib/PicGoRequest" +import { PicGoRequestWrapper } from "../lib/PicGoRequest" /* * 通用 PicGO 对象定义 @@ -58,7 +58,7 @@ class UniversalPicGo extends EventEmitter implements IPicGo { output: IImgInfo[] input: any[] pluginHandler: PluginHandler - request: IPicGoRequest + requestWrapper: PicGoRequestWrapper i18n!: II18nManager VERSION: string = process.env.PICGO_VERSION ?? "unknown" private readonly isDev: boolean @@ -73,6 +73,10 @@ class UniversalPicGo extends EventEmitter implements IPicGo { return simpleLogger(name ?? "universal-picgo", "universal-picgo", this.isDev) } + get request(): PicGoRequestWrapper["PicGoRequest"] { + return this.requestWrapper.PicGoRequest.bind(this.requestWrapper) + } + constructor(configPath = "", isDev?: boolean) { super() this.isDev = isDev ?? false @@ -90,7 +94,7 @@ class UniversalPicGo extends EventEmitter implements IPicGo { this.initConfigPath() // this.cmd = new Commander(this) this.pluginHandler = new PluginHandler(this) - this.request = PicGoRequest + this.requestWrapper = new PicGoRequestWrapper(this) this.initConfig() this.init() diff --git a/libs/Universal-PicGo-Core/src/lib/PicGoRequest.ts b/libs/Universal-PicGo-Core/src/lib/PicGoRequest.ts index d0268ed..5abd0f1 100644 --- a/libs/Universal-PicGo-Core/src/lib/PicGoRequest.ts +++ b/libs/Universal-PicGo-Core/src/lib/PicGoRequest.ts @@ -8,22 +8,247 @@ * */ -import { AxiosRequestConfig } from "axios" -import { IResponse } from "../types" -import { simpleLogger } from "zhi-lib-base" +import axios, { AxiosRequestConfig, AxiosResponse } from "axios" +import { IConfig, IConfigChangePayload, IFullResponse, IPicGo, IResponse, Undefinable } from "../types" +import { ILogger } from "zhi-lib-base" +import { eventBus } from "../utils/eventBus" +import { IBusEvent } from "../utils/enums" -const logger = simpleLogger("picgo-request", "universal-picgo") +// legacy request adaptor start +// thanks for https://github.dev/request/request/blob/master/index.js +function appendFormData(form: FormData, key: string, data: any): void { + if (typeof data === "object" && "value" in data && "options" in data) { + form.append(key, data.value, data.options) + } else { + form.append(key, data) + } +} -// #64 dynamic get proxy value -/** - * PicGo 统一请求封装,基于 axios - * - * @param options - * @constructor - */ -function PicGoRequest(options: U): Promise> { - logger.info("PicGoRequest start request", options) - throw new Error("PicGoRequest is not implemented") +function requestInterceptor(options: any | AxiosRequestConfig): AxiosRequestConfig & { + __isOldOptions?: boolean +} { + let __isOldOptions = false + const opt: AxiosRequestConfig & { + __isOldOptions?: boolean + } = { + ...options, + url: (options.url as string) || "", + headers: options.headers || {}, + } + // user request config proxy + if (options.proxy) { + let proxyOptions = options.proxy + if (typeof proxyOptions === "string") { + try { + proxyOptions = new URL(options.proxy) + } catch (e) { + proxyOptions = false + opt.proxy = false + console.error(e) + } + __isOldOptions = true + } + // if (proxyOptions) { + // if (options.url?.startsWith("https://")) { + // opt.proxy = false + // opt.httpsAgent = tunnel.httpsOverHttp({ + // proxy: { + // host: proxyOptions?.hostname, + // port: parseInt(proxyOptions?.port, 10), + // }, + // }) + // } else { + // opt.proxy = { + // host: proxyOptions.hostname, + // port: parseInt(proxyOptions.port, 10), + // protocol: "http", + // } + // } + // } + } + if ("formData" in options) { + const form = new FormData() as any + for (const key in options.formData) { + const data = options.formData[key] + appendFormData(form, key, data) + } + opt.data = form + opt.headers = Object.assign(opt.headers || {}, form.getHeaders()) + __isOldOptions = true + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-expect-error + delete opt.formData + } + if ("body" in options) { + opt.data = options.body + __isOldOptions = true + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-expect-error + delete opt.body + } + if ("qs" in options) { + opt.params = options.qs + __isOldOptions = true + } + opt.__isOldOptions = __isOldOptions + return opt +} +// legacy request adaptor end + +function responseInterceptor(response: AxiosResponse): IFullResponse { + return { + ...response, + statusCode: response.status, + body: response.data, + } +} + +function responseErrorHandler(error: any) { + const errorObj = { + method: error?.config?.method?.toUpperCase() || "", + url: error?.config?.url || "", + statusCode: error?.response?.status || 0, + message: error?.message || "", + stack: error?.stack || {}, + response: { + status: error?.response?.status || 0, + statusCode: error?.response?.status || 0, + body: error?.response?.data || "", + }, + } + return Promise.reject(errorObj) +} + +class PicGoRequestWrapper { + private readonly ctx: IPicGo + private readonly logger: ILogger + private proxy: Undefinable = "" + private options: AxiosRequestConfig = {} + + constructor(ctx: IPicGo) { + this.ctx = ctx + this.logger = ctx.getLogger("picgo-request") + + this.init() + eventBus.on(IBusEvent.CONFIG_CHANGE, (data: IConfigChangePayload) => { + switch (data.configName) { + case "picBed": + if ((data.value as IConfig["picBed"])?.proxy) { + this.proxy = (data.value as IConfig["picBed"]).proxy + } + break + case "picBed.proxy": + this.proxy = data.value as string + break + } + }) + } + + private init(): void { + const proxy = this.ctx.getConfig>("picBed.proxy") + if (proxy) { + this.proxy = proxy + } + } + + private handleProxy(): AxiosRequestConfig["proxy"] | false { + if (this.proxy) { + try { + const proxyOptions = new URL(this.proxy) + return { + host: proxyOptions.hostname, + port: parseInt(proxyOptions.port || "0", 10), + protocol: proxyOptions.protocol, + } + } catch (e) { + /* empty */ + } + } + return false + } + + /** + * PicGo 统一请求封装,基于 axios + * + * @param userOptions + * @constructor + */ + public async PicGoRequest(userOptions: U): Promise> { + this.logger.debug("PicGoRequest before request, userOptions", userOptions) + + // handle options + this.options.proxy = this.handleProxy() + this.options.headers = userOptions.headers || {} + this.options.maxBodyLength = Infinity + this.options.maxContentLength = Infinity + // const httpsAgent = new https.Agent({ + // maxVersion: 'TLSv1.2', + // minVersion: 'TLSv1.2' + // }) + // if (this.options.proxy && userOptions.url?.startsWith("https://")) { + // this.options.httpsAgent = tunnel.httpsOverHttp({ + // proxy: { + // host: this.options.proxy.host, + // port: this.options.proxy.port, + // }, + // }) + // this.options.proxy = false + // } else { + // this.options.httpsAgent = httpsAgent + // } + + this.logger.debug("PicGoRequest start request, options", this.options) + const instance = axios.create(this.options) + instance.interceptors.response.use(responseInterceptor, responseErrorHandler) + + // compatible with old request options to new options + const opt = requestInterceptor(userOptions) + + const that = this + instance.interceptors.request.use(function (obj) { + // handle Content-Type + let contentType = "" + if (obj?.headers?.contentType) { + contentType = obj.headers.contentType as string + delete obj.headers.contentType + } else if (obj?.headers?.ContentType) { + contentType = obj.headers.ContentType as string + delete obj.headers.ContentType + } else if (obj?.headers?.["content-type"]) { + contentType = obj.headers["content-type"] as string + delete obj.headers["content-type"] + } + if (contentType !== "" && obj.headers) { + obj.headers["Content-Type"] = contentType + } + + that.logger.debug("PicGoRequest request interceptor, obj", obj) + return obj + }) + if ("resolveWithFullResponse" in userOptions && userOptions.resolveWithFullResponse) { + const resp = instance.request(opt) as Promise> + that.logger.debug("PicGoRequest request interceptor resolveWithFullResponse, resp", resp) + return resp + } else { + return instance.request(opt).then((res) => { + // use old request option format + let oldResp: any + if (opt.__isOldOptions) { + if ("json" in userOptions) { + if (userOptions.json) { + oldResp = res.data + } + } else { + oldResp = JSON.stringify(res.data) + } + } else { + oldResp = res.data + } + that.logger.debug("PicGoRequest request interceptor oldRequest, oldResp", oldResp) + return oldResp + }) as Promise> + } + } } -export { PicGoRequest } +export { PicGoRequestWrapper } diff --git a/libs/Universal-PicGo-Core/src/types/index.d.ts b/libs/Universal-PicGo-Core/src/types/index.d.ts index fd71452..eba0b03 100644 --- a/libs/Universal-PicGo-Core/src/types/index.d.ts +++ b/libs/Universal-PicGo-Core/src/types/index.d.ts @@ -460,6 +460,11 @@ export interface IPathTransformedImgInfo extends IImgInfo { success: boolean } +export interface IConfigChangePayload { + configName: string + value: T +} + // ===================================================================================================================== // request start diff --git a/libs/Universal-PicGo-Core/src/utils/createContext.ts b/libs/Universal-PicGo-Core/src/utils/createContext.ts index c79b5c6..8b20c69 100644 --- a/libs/Universal-PicGo-Core/src/utils/createContext.ts +++ b/libs/Universal-PicGo-Core/src/utils/createContext.ts @@ -24,7 +24,7 @@ const createContext = (ctx: IPicGo): IPicGo => { input: [], pluginLoader: ctx.pluginLoader, pluginHandler: ctx.pluginHandler, - request: ctx.request.bind(ctx), + request: ctx.request, helper: ctx.helper, VERSION: ctx.VERSION, // GUI_VERSION: ctx.GUI_VERSION, From ed67d2ddfbf1c89d84f4777905ea065a37a76cf0 Mon Sep 17 00:00:00 2001 From: terwer Date: Wed, 20 Mar 2024 09:43:30 +0800 Subject: [PATCH 32/34] feat: lifecycle should throw error --- libs/Universal-PicGo-Core/src/core/Lifecycle.ts | 9 +++++---- libs/Universal-PicGo-Core/src/plugins/uploader/smms.ts | 3 ++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/libs/Universal-PicGo-Core/src/core/Lifecycle.ts b/libs/Universal-PicGo-Core/src/core/Lifecycle.ts index 9b26a1d..47cccdf 100644 --- a/libs/Universal-PicGo-Core/src/core/Lifecycle.ts +++ b/libs/Universal-PicGo-Core/src/core/Lifecycle.ts @@ -48,10 +48,11 @@ export class Lifecycle extends EventEmitter { ctx.emit(IBuildInEvent.UPLOAD_PROGRESS, -1) ctx.emit(IBuildInEvent.FAILED, e) ctx.log.error(e) - if (ctx.getConfig>("debug")) { - throw e - } - return ctx + // if (ctx.getConfig>("debug")) { + // } + // should throw error to stop the process + throw e + // return ctx } } diff --git a/libs/Universal-PicGo-Core/src/plugins/uploader/smms.ts b/libs/Universal-PicGo-Core/src/plugins/uploader/smms.ts index 83c1bc9..9b2d2f7 100644 --- a/libs/Universal-PicGo-Core/src/plugins/uploader/smms.ts +++ b/libs/Universal-PicGo-Core/src/plugins/uploader/smms.ts @@ -11,6 +11,7 @@ import { ILocalesKey } from "../../i18n/zh-CN" import { IPicGo, IPluginConfig, ISmmsConfig } from "../../types" import { IBuildInEvent } from "../../utils/enums" import { AxiosRequestConfig } from "axios" +import { safeParse } from "../../utils/common" const postOptions = (fileName: string, image: Buffer, apiToken: string, backupDomain = ""): AxiosRequestConfig => { const domain = backupDomain || "sm.ms" @@ -47,7 +48,7 @@ const handle = async (ctx: IPicGo): Promise => { const postConfig = postOptions(img.fileName, image, smmsConfig?.token, smmsConfig?.backupDomain) try { const res: string = await ctx.request(postConfig) - const body = JSON.parse(res) + const body = safeParse(res) if (body.code === "success") { delete img.base64Image delete img.buffer From cce03db91381fbac614dd30b287953d9314068e5 Mon Sep 17 00:00:00 2001 From: terwer Date: Wed, 20 Mar 2024 09:47:16 +0800 Subject: [PATCH 33/34] feat: lifecycle should throw error --- libs/Universal-PicGo-Core/src/lib/PicGoRequest.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/Universal-PicGo-Core/src/lib/PicGoRequest.ts b/libs/Universal-PicGo-Core/src/lib/PicGoRequest.ts index 5abd0f1..8ca9c18 100644 --- a/libs/Universal-PicGo-Core/src/lib/PicGoRequest.ts +++ b/libs/Universal-PicGo-Core/src/lib/PicGoRequest.ts @@ -226,7 +226,7 @@ class PicGoRequestWrapper { return obj }) if ("resolveWithFullResponse" in userOptions && userOptions.resolveWithFullResponse) { - const resp = instance.request(opt) as Promise> + const resp = (await instance.request(opt)) as Promise> that.logger.debug("PicGoRequest request interceptor resolveWithFullResponse, resp", resp) return resp } else { From 7a7cb5915abfafc350a65e2add38a7186655094e Mon Sep 17 00:00:00 2001 From: terwer Date: Wed, 20 Mar 2024 09:51:35 +0800 Subject: [PATCH 34/34] feat: support sm.ms --- libs/Universal-PicGo-Core/src/plugins/uploader/smms.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/Universal-PicGo-Core/src/plugins/uploader/smms.ts b/libs/Universal-PicGo-Core/src/plugins/uploader/smms.ts index 9b2d2f7..96651f2 100644 --- a/libs/Universal-PicGo-Core/src/plugins/uploader/smms.ts +++ b/libs/Universal-PicGo-Core/src/plugins/uploader/smms.ts @@ -25,7 +25,7 @@ const postOptions = (fileName: string, image: Buffer, apiToken: string, backupDo url: `https://${domain}/api/v2/upload`, headers: { "Content-Type": "multipart/form-data", - "User-Agent": "PicGo", + // "User-Agent": "PicGo", Authorization: apiToken, }, data: formData,