picgo 1.4.25 → 1.5.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintignore +2 -0
- package/.github/workflows/alpha.yml +22 -0
- package/CHANGELOG.md +38 -0
- package/README.md +14 -1
- package/bin/picgo +1 -1
- package/dist/{src/core → core}/Lifecycle.d.ts +15 -15
- package/dist/{src/core → core}/PicGo.d.ts +44 -44
- package/dist/i18n/en.d.ts +2 -0
- package/dist/i18n/index.d.ts +16 -0
- package/dist/i18n/zh-CN.d.ts +65 -0
- package/dist/index.cjs.js +2 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.esm.js +2 -0
- package/dist/{src/lib → lib}/Commander.d.ts +16 -16
- package/dist/{src/lib → lib}/LifecyclePlugins.d.ts +16 -16
- package/dist/{src/lib → lib}/Logger.d.ts +16 -16
- package/dist/{src/lib → lib}/PluginHandler.d.ts +10 -10
- package/dist/{src/lib → lib}/PluginLoader.d.ts +27 -27
- package/dist/{src/lib → lib}/Request.d.ts +11 -11
- package/dist/{src/plugins → plugins}/commander/config.d.ts +3 -3
- package/dist/plugins/commander/i18n.d.ts +3 -0
- package/dist/{src/plugins → plugins}/commander/index.d.ts +3 -3
- package/dist/{src/plugins → plugins}/commander/init.d.ts +3 -3
- package/dist/{src/plugins → plugins}/commander/pluginHandler.d.ts +3 -3
- package/dist/{src/plugins → plugins}/commander/proxy.d.ts +3 -3
- package/dist/{src/plugins → plugins}/commander/setting.d.ts +5 -5
- package/dist/{src/plugins → plugins}/commander/upload.d.ts +3 -3
- package/dist/{src/plugins → plugins}/commander/use.d.ts +3 -3
- package/dist/{src/plugins → plugins}/transformer/base64.d.ts +5 -5
- package/dist/{src/plugins → plugins}/transformer/index.d.ts +3 -3
- package/dist/{src/plugins → plugins}/transformer/path.d.ts +5 -5
- package/dist/plugins/uploader/aliyun.d.ts +2 -0
- package/dist/plugins/uploader/github.d.ts +2 -0
- package/dist/plugins/uploader/imgur.d.ts +2 -0
- package/dist/{src/plugins → plugins}/uploader/index.d.ts +3 -3
- package/dist/plugins/uploader/qiniu.d.ts +2 -0
- package/dist/plugins/uploader/smms.d.ts +2 -0
- package/dist/plugins/uploader/tcyun.d.ts +8 -0
- package/dist/plugins/uploader/upyun.d.ts +2 -0
- package/dist/types/index.d.ts +468 -0
- package/dist/{src/utils → utils}/common.d.ts +101 -101
- package/dist/{src/utils → utils}/createContext.d.ts +6 -6
- package/dist/{src/utils → utils}/db.d.ts +15 -15
- package/dist/{src/utils → utils}/enum.d.ts +27 -27
- package/dist/{src/utils → utils}/eventBus.d.ts +4 -4
- package/dist/{src/utils → utils}/getClipboardImage.d.ts +4 -3
- package/dist/{src/utils → utils}/initUtils.d.ts +26 -26
- package/dist/{src/utils → utils}/interfaces.d.ts +203 -203
- package/package.json +28 -23
- package/rollup.config.js +82 -0
- package/dist/package.json +0 -127
- package/dist/src/core/Lifecycle.js +0 -123
- package/dist/src/core/PicGo.js +0 -210
- package/dist/src/index.d.ts +0 -2
- package/dist/src/index.js +0 -6
- package/dist/src/lib/Commander.js +0 -56
- package/dist/src/lib/LifecyclePlugins.js +0 -52
- package/dist/src/lib/Logger.js +0 -82
- package/dist/src/lib/PluginHandler.js +0 -260
- package/dist/src/lib/PluginLoader.js +0 -145
- package/dist/src/lib/Request.js +0 -42
- package/dist/src/plugins/commander/config.js +0 -11
- package/dist/src/plugins/commander/index.js +0 -21
- package/dist/src/plugins/commander/init.js +0 -122
- package/dist/src/plugins/commander/pluginHandler.js +0 -43
- package/dist/src/plugins/commander/proxy.js +0 -14
- package/dist/src/plugins/commander/setting.js +0 -102
- package/dist/src/plugins/commander/upload.js +0 -35
- package/dist/src/plugins/commander/use.js +0 -87
- package/dist/src/plugins/transformer/base64.js +0 -9
- package/dist/src/plugins/transformer/index.js +0 -16
- package/dist/src/plugins/transformer/path.js +0 -42
- package/dist/src/plugins/uploader/aliyun.d.ts +0 -7
- package/dist/src/plugins/uploader/aliyun.js +0 -129
- package/dist/src/plugins/uploader/github.d.ts +0 -7
- package/dist/src/plugins/uploader/github.js +0 -101
- package/dist/src/plugins/uploader/imgur.d.ts +0 -7
- package/dist/src/plugins/uploader/imgur.js +0 -81
- package/dist/src/plugins/uploader/index.js +0 -26
- package/dist/src/plugins/uploader/qiniu.d.ts +0 -7
- package/dist/src/plugins/uploader/qiniu.js +0 -132
- package/dist/src/plugins/uploader/smms.d.ts +0 -7
- package/dist/src/plugins/uploader/smms.js +0 -74
- package/dist/src/plugins/uploader/tcyun.d.ts +0 -13
- package/dist/src/plugins/uploader/tcyun.js +0 -218
- package/dist/src/plugins/uploader/upyun.d.ts +0 -7
- package/dist/src/plugins/uploader/upyun.js +0 -128
- package/dist/src/types/index.d.ts +0 -471
- package/dist/src/utils/clipboard/linux.sh +0 -18
- package/dist/src/utils/clipboard/mac.applescript +0 -0
- package/dist/src/utils/clipboard/windows.ps1 +0 -26
- package/dist/src/utils/clipboard/windows10.ps1 +0 -47
- package/dist/src/utils/clipboard/wsl.sh +0 -18
- package/dist/src/utils/common.js +0 -353
- package/dist/src/utils/createContext.js +0 -45
- package/dist/src/utils/db.js +0 -85
- package/dist/src/utils/enum.js +0 -33
- package/dist/src/utils/eventBus.js +0 -6
- package/dist/src/utils/getClipboardImage.js +0 -101
- package/dist/src/utils/initUtils.js +0 -120
- package/dist/src/utils/interfaces.js +0 -3
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { Command } from 'commander';
|
|
2
|
-
import { Inquirer } from 'inquirer';
|
|
3
|
-
import { IPlugin, ICommander, IPicGo } from '../types';
|
|
4
|
-
declare class Commander implements ICommander {
|
|
5
|
-
private list;
|
|
6
|
-
program: Command;
|
|
7
|
-
inquirer: Inquirer;
|
|
8
|
-
private readonly ctx;
|
|
9
|
-
constructor(ctx: IPicGo);
|
|
10
|
-
init(): void;
|
|
11
|
-
register(name: string, plugin: IPlugin): void;
|
|
12
|
-
loadCommands(): void;
|
|
13
|
-
get(name: string): IPlugin;
|
|
14
|
-
getList(): IPlugin[];
|
|
15
|
-
}
|
|
16
|
-
export default Commander;
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import { Inquirer } from 'inquirer';
|
|
3
|
+
import { IPlugin, ICommander, IPicGo } from '../types';
|
|
4
|
+
export declare class Commander implements ICommander {
|
|
5
|
+
private list;
|
|
6
|
+
program: Command;
|
|
7
|
+
inquirer: Inquirer;
|
|
8
|
+
private readonly ctx;
|
|
9
|
+
constructor(ctx: IPicGo);
|
|
10
|
+
init(): void;
|
|
11
|
+
register(name: string, plugin: IPlugin): void;
|
|
12
|
+
loadCommands(): void;
|
|
13
|
+
get(name: string): IPlugin;
|
|
14
|
+
getList(): IPlugin[];
|
|
15
|
+
}
|
|
16
|
+
export default Commander;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { IPlugin, ILifecyclePlugins } from '../types';
|
|
2
|
-
declare class LifecyclePlugins implements ILifecyclePlugins {
|
|
3
|
-
static currentPlugin: string | null;
|
|
4
|
-
private readonly list;
|
|
5
|
-
private readonly pluginIdMap;
|
|
6
|
-
private readonly name;
|
|
7
|
-
constructor(name: string);
|
|
8
|
-
register(id: string, plugin: IPlugin): void;
|
|
9
|
-
unregister(pluginName: string): void;
|
|
10
|
-
getName(): string;
|
|
11
|
-
get(id: string): IPlugin | undefined;
|
|
12
|
-
getList(): IPlugin[];
|
|
13
|
-
getIdList(): string[];
|
|
14
|
-
}
|
|
15
|
-
export declare const setCurrentPluginName: (name?: string | null) => void;
|
|
16
|
-
export default LifecyclePlugins;
|
|
1
|
+
import { IPlugin, ILifecyclePlugins } from '../types';
|
|
2
|
+
export declare class LifecyclePlugins implements ILifecyclePlugins {
|
|
3
|
+
static currentPlugin: string | null;
|
|
4
|
+
private readonly list;
|
|
5
|
+
private readonly pluginIdMap;
|
|
6
|
+
private readonly name;
|
|
7
|
+
constructor(name: string);
|
|
8
|
+
register(id: string, plugin: IPlugin): void;
|
|
9
|
+
unregister(pluginName: string): void;
|
|
10
|
+
getName(): string;
|
|
11
|
+
get(id: string): IPlugin | undefined;
|
|
12
|
+
getList(): IPlugin[];
|
|
13
|
+
getIdList(): string[];
|
|
14
|
+
}
|
|
15
|
+
export declare const setCurrentPluginName: (name?: string | null) => void;
|
|
16
|
+
export default LifecyclePlugins;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { ILogArgvType, ILogArgvTypeWithError, ILogger, IPicGo } from '../types';
|
|
2
|
-
declare class Logger implements ILogger {
|
|
3
|
-
private readonly level;
|
|
4
|
-
private readonly ctx;
|
|
5
|
-
private logLevel;
|
|
6
|
-
private logPath;
|
|
7
|
-
constructor(ctx: IPicGo);
|
|
8
|
-
private handleLog;
|
|
9
|
-
private handleWriteLog;
|
|
10
|
-
private checkLogLevel;
|
|
11
|
-
success(...msg: ILogArgvType[]): void;
|
|
12
|
-
info(...msg: ILogArgvType[]): void;
|
|
13
|
-
error(...msg: ILogArgvTypeWithError[]): void;
|
|
14
|
-
warn(...msg: ILogArgvType[]): void;
|
|
15
|
-
}
|
|
16
|
-
export default Logger;
|
|
1
|
+
import { ILogArgvType, ILogArgvTypeWithError, ILogger, IPicGo } from '../types';
|
|
2
|
+
export declare class Logger implements ILogger {
|
|
3
|
+
private readonly level;
|
|
4
|
+
private readonly ctx;
|
|
5
|
+
private logLevel;
|
|
6
|
+
private logPath;
|
|
7
|
+
constructor(ctx: IPicGo);
|
|
8
|
+
private handleLog;
|
|
9
|
+
private handleWriteLog;
|
|
10
|
+
private checkLogLevel;
|
|
11
|
+
success(...msg: ILogArgvType[]): void;
|
|
12
|
+
info(...msg: ILogArgvType[]): void;
|
|
13
|
+
error(...msg: ILogArgvTypeWithError[]): void;
|
|
14
|
+
warn(...msg: ILogArgvType[]): void;
|
|
15
|
+
}
|
|
16
|
+
export default Logger;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { IProcessEnv, IPluginHandler, IPluginHandlerOptions, IPicGo, IPluginHandlerResult } from '../types';
|
|
2
|
-
declare class PluginHandler implements IPluginHandler {
|
|
3
|
-
private readonly ctx;
|
|
4
|
-
constructor(ctx: IPicGo);
|
|
5
|
-
install(plugins: string[], options?: IPluginHandlerOptions, env?: IProcessEnv): Promise<IPluginHandlerResult<boolean>>;
|
|
6
|
-
uninstall(plugins: string[]): Promise<IPluginHandlerResult<boolean>>;
|
|
7
|
-
update(plugins: string[], options?: IPluginHandlerOptions, env?: IProcessEnv): Promise<IPluginHandlerResult<boolean>>;
|
|
8
|
-
private execCommand;
|
|
9
|
-
}
|
|
10
|
-
export default PluginHandler;
|
|
1
|
+
import { IProcessEnv, IPluginHandler, IPluginHandlerOptions, IPicGo, IPluginHandlerResult } from '../types';
|
|
2
|
+
export declare class PluginHandler implements IPluginHandler {
|
|
3
|
+
private readonly ctx;
|
|
4
|
+
constructor(ctx: IPicGo);
|
|
5
|
+
install(plugins: string[], options?: IPluginHandlerOptions, env?: IProcessEnv): Promise<IPluginHandlerResult<boolean>>;
|
|
6
|
+
uninstall(plugins: string[]): Promise<IPluginHandlerResult<boolean>>;
|
|
7
|
+
update(plugins: string[], options?: IPluginHandlerOptions, env?: IProcessEnv): Promise<IPluginHandlerResult<boolean>>;
|
|
8
|
+
private execCommand;
|
|
9
|
+
}
|
|
10
|
+
export default PluginHandler;
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { IPicGo, IPicGoPlugin, IPluginLoader, IPicGoPluginInterface } from '../types/index';
|
|
2
|
-
/**
|
|
3
|
-
* Local plugin loader, file system is required
|
|
4
|
-
*/
|
|
5
|
-
declare class PluginLoader implements IPluginLoader {
|
|
6
|
-
private readonly ctx;
|
|
7
|
-
private list;
|
|
8
|
-
private readonly fullList;
|
|
9
|
-
private readonly pluginMap;
|
|
10
|
-
constructor(ctx: IPicGo);
|
|
11
|
-
private init;
|
|
12
|
-
private resolvePlugin;
|
|
13
|
-
load(): boolean;
|
|
14
|
-
registerPlugin(name: string, plugin?: IPicGoPlugin): void;
|
|
15
|
-
unregisterPlugin(name: string): void;
|
|
16
|
-
getPlugin(name: string): IPicGoPluginInterface | undefined;
|
|
17
|
-
/**
|
|
18
|
-
* Get the list of enabled plugins
|
|
19
|
-
*/
|
|
20
|
-
getList(): string[];
|
|
21
|
-
hasPlugin(name: string): boolean;
|
|
22
|
-
/**
|
|
23
|
-
* Get the full list of plugins, whether it is enabled or not
|
|
24
|
-
*/
|
|
25
|
-
getFullList(): string[];
|
|
26
|
-
}
|
|
27
|
-
export default PluginLoader;
|
|
1
|
+
import { IPicGo, IPicGoPlugin, IPluginLoader, IPicGoPluginInterface } from '../types/index';
|
|
2
|
+
/**
|
|
3
|
+
* Local plugin loader, file system is required
|
|
4
|
+
*/
|
|
5
|
+
export declare class PluginLoader implements IPluginLoader {
|
|
6
|
+
private readonly ctx;
|
|
7
|
+
private list;
|
|
8
|
+
private readonly fullList;
|
|
9
|
+
private readonly pluginMap;
|
|
10
|
+
constructor(ctx: IPicGo);
|
|
11
|
+
private init;
|
|
12
|
+
private resolvePlugin;
|
|
13
|
+
load(): boolean;
|
|
14
|
+
registerPlugin(name: string, plugin?: IPicGoPlugin): void;
|
|
15
|
+
unregisterPlugin(name: string): void;
|
|
16
|
+
getPlugin(name: string): IPicGoPluginInterface | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* Get the list of enabled plugins
|
|
19
|
+
*/
|
|
20
|
+
getList(): string[];
|
|
21
|
+
hasPlugin(name: string): boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Get the full list of plugins, whether it is enabled or not
|
|
24
|
+
*/
|
|
25
|
+
getFullList(): string[];
|
|
26
|
+
}
|
|
27
|
+
export default PluginLoader;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { RequestPromiseOptions, RequestPromiseAPI } from 'request-promise-native';
|
|
2
|
-
import { IPicGo } from '../types';
|
|
3
|
-
declare class Request {
|
|
4
|
-
private readonly ctx;
|
|
5
|
-
private proxy;
|
|
6
|
-
options: RequestPromiseOptions;
|
|
7
|
-
constructor(ctx: IPicGo);
|
|
8
|
-
private init;
|
|
9
|
-
get request(): RequestPromiseAPI;
|
|
10
|
-
}
|
|
11
|
-
export default Request;
|
|
1
|
+
import { RequestPromiseOptions, RequestPromiseAPI } from 'request-promise-native';
|
|
2
|
+
import { IPicGo } from '../types';
|
|
3
|
+
export declare class Request {
|
|
4
|
+
private readonly ctx;
|
|
5
|
+
private proxy;
|
|
6
|
+
options: RequestPromiseOptions;
|
|
7
|
+
constructor(ctx: IPicGo);
|
|
8
|
+
private init;
|
|
9
|
+
get request(): RequestPromiseAPI;
|
|
10
|
+
}
|
|
11
|
+
export default Request;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { IPlugin } from '../../types';
|
|
2
|
-
declare const config: IPlugin;
|
|
3
|
-
export default config;
|
|
1
|
+
import { IPlugin } from '../../types';
|
|
2
|
+
declare const config: IPlugin;
|
|
3
|
+
export default config;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { IPicGo } from '../../types';
|
|
2
|
-
declare const _default: (ctx: IPicGo) => void;
|
|
3
|
-
export default _default;
|
|
1
|
+
import { IPicGo } from '../../types';
|
|
2
|
+
declare const _default: (ctx: IPicGo) => void;
|
|
3
|
+
export default _default;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { IPlugin } from '../../types';
|
|
2
|
-
declare const init: IPlugin;
|
|
3
|
-
export default init;
|
|
1
|
+
import { IPlugin } from '../../types';
|
|
2
|
+
declare const init: IPlugin;
|
|
3
|
+
export default init;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { IPlugin } from '../../types';
|
|
2
|
-
declare const pluginHandler: IPlugin;
|
|
3
|
-
export default pluginHandler;
|
|
1
|
+
import { IPlugin } from '../../types';
|
|
2
|
+
declare const pluginHandler: IPlugin;
|
|
3
|
+
export default pluginHandler;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { IPlugin } from '../../types';
|
|
2
|
-
declare const proxy: IPlugin;
|
|
3
|
-
export default proxy;
|
|
1
|
+
import { IPlugin } from '../../types';
|
|
2
|
+
declare const proxy: IPlugin;
|
|
3
|
+
export default proxy;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { IPicGo } from '../../types';
|
|
2
|
-
declare const setting: {
|
|
3
|
-
handle: (ctx: IPicGo) => void;
|
|
4
|
-
};
|
|
5
|
-
export default setting;
|
|
1
|
+
import { IPicGo } from '../../types';
|
|
2
|
+
declare const setting: {
|
|
3
|
+
handle: (ctx: IPicGo) => void;
|
|
4
|
+
};
|
|
5
|
+
export default setting;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { IPlugin } from '../../types';
|
|
2
|
-
declare const upload: IPlugin;
|
|
3
|
-
export default upload;
|
|
1
|
+
import { IPlugin } from '../../types';
|
|
2
|
+
declare const upload: IPlugin;
|
|
3
|
+
export default upload;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { IPlugin } from '../../types';
|
|
2
|
-
declare const use: IPlugin;
|
|
3
|
-
export default use;
|
|
1
|
+
import { IPlugin } from '../../types';
|
|
2
|
+
declare const use: IPlugin;
|
|
3
|
+
export default use;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { IPicGo } from '../../types';
|
|
2
|
-
declare const _default: {
|
|
3
|
-
handle: (ctx: IPicGo) => Promise<IPicGo>;
|
|
4
|
-
};
|
|
5
|
-
export default _default;
|
|
1
|
+
import { IPicGo } from '../../types';
|
|
2
|
+
declare const _default: {
|
|
3
|
+
handle: (ctx: IPicGo) => Promise<IPicGo>;
|
|
4
|
+
};
|
|
5
|
+
export default _default;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { IPicGoPlugin } from '../../types';
|
|
2
|
-
declare const buildInTransformers: IPicGoPlugin;
|
|
3
|
-
export default buildInTransformers;
|
|
1
|
+
import { IPicGoPlugin } from '../../types';
|
|
2
|
+
declare const buildInTransformers: IPicGoPlugin;
|
|
3
|
+
export default buildInTransformers;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { IPicGo } from '../../types';
|
|
2
|
-
declare const _default: {
|
|
3
|
-
handle: (ctx: IPicGo) => Promise<IPicGo>;
|
|
4
|
-
};
|
|
5
|
-
export default _default;
|
|
1
|
+
import { IPicGo } from '../../types';
|
|
2
|
+
declare const _default: {
|
|
3
|
+
handle: (ctx: IPicGo) => Promise<IPicGo>;
|
|
4
|
+
};
|
|
5
|
+
export default _default;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { IPicGoPlugin } from '../../types';
|
|
2
|
-
declare const buildInUploaders: IPicGoPlugin;
|
|
3
|
-
export default buildInUploaders;
|
|
1
|
+
import { IPicGoPlugin } from '../../types';
|
|
2
|
+
declare const buildInUploaders: IPicGoPlugin;
|
|
3
|
+
export default buildInUploaders;
|