piclist 0.0.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/.eslintrc.js +25 -0
- package/.github/workflows/alpha.yml +22 -0
- package/.github/workflows/main.yml +22 -0
- package/.github/workflows/manually.yml +19 -0
- package/CHANGELOG.md +549 -0
- package/License +21 -0
- package/README.md +116 -0
- package/bin/picgo +22 -0
- package/dist/core/Lifecycle.d.ts +15 -0
- package/dist/core/PicGo.d.ts +49 -0
- package/dist/i18n/en.d.ts +2 -0
- package/dist/i18n/index.d.ts +18 -0
- package/dist/i18n/zh-CN.d.ts +91 -0
- package/dist/i18n/zh-TW.d.ts +2 -0
- package/dist/index.cjs.js +3807 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.esm.js +3769 -0
- package/dist/lib/Commander.d.ts +22 -0
- package/dist/lib/LifecyclePlugins.d.ts +17 -0
- package/dist/lib/Logger.d.ts +19 -0
- package/dist/lib/PluginHandler.d.ts +10 -0
- package/dist/lib/PluginLoader.d.ts +27 -0
- package/dist/lib/Request.d.ts +12 -0
- package/dist/plugins/commander/config.d.ts +3 -0
- package/dist/plugins/commander/i18n.d.ts +3 -0
- package/dist/plugins/commander/index.d.ts +3 -0
- package/dist/plugins/commander/init.d.ts +3 -0
- package/dist/plugins/commander/pluginHandler.d.ts +3 -0
- package/dist/plugins/commander/proxy.d.ts +3 -0
- package/dist/plugins/commander/setting.d.ts +5 -0
- package/dist/plugins/commander/upload.d.ts +3 -0
- package/dist/plugins/commander/use.d.ts +3 -0
- package/dist/plugins/transformer/base64.d.ts +5 -0
- package/dist/plugins/transformer/index.d.ts +3 -0
- package/dist/plugins/transformer/path.d.ts +5 -0
- 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/plugins/uploader/index.d.ts +3 -0
- 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 +537 -0
- package/dist/types/oldRequest.d.ts +19 -0
- package/dist/utils/common.d.ts +106 -0
- package/dist/utils/createContext.d.ts +6 -0
- package/dist/utils/db.d.ts +15 -0
- package/dist/utils/enum.d.ts +27 -0
- package/dist/utils/eventBus.d.ts +4 -0
- package/dist/utils/getClipboardImage.d.ts +4 -0
- package/dist/utils/initUtils.d.ts +26 -0
- package/dist/utils/interfaces.d.ts +203 -0
- package/dist/utils/static.d.ts +1 -0
- package/logo.png +0 -0
- package/package.json +133 -0
- package/rollup.config.js +87 -0
|
@@ -0,0 +1,22 @@
|
|
|
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 readonly name;
|
|
6
|
+
static currentPlugin: string | null;
|
|
7
|
+
private readonly list;
|
|
8
|
+
private readonly pluginIdMap;
|
|
9
|
+
private readonly ctx;
|
|
10
|
+
program: Command;
|
|
11
|
+
inquirer: Inquirer;
|
|
12
|
+
constructor(ctx: IPicGo);
|
|
13
|
+
getName(): string;
|
|
14
|
+
init(): void;
|
|
15
|
+
register(id: string, plugin: IPlugin): void;
|
|
16
|
+
unregister(pluginName: string): void;
|
|
17
|
+
loadCommands(): void;
|
|
18
|
+
get(id: string): IPlugin | undefined;
|
|
19
|
+
getList(): IPlugin[];
|
|
20
|
+
getIdList(): string[];
|
|
21
|
+
}
|
|
22
|
+
export default Commander;
|
|
@@ -0,0 +1,17 @@
|
|
|
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 declare const getCurrentPluginName: () => string | null;
|
|
17
|
+
export default LifecyclePlugins;
|
|
@@ -0,0 +1,19 @@
|
|
|
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 checkLogFileIsLarge;
|
|
10
|
+
private recreateLogFile;
|
|
11
|
+
private handleWriteLog;
|
|
12
|
+
private checkLogLevel;
|
|
13
|
+
success(...msg: ILogArgvType[]): void;
|
|
14
|
+
info(...msg: ILogArgvType[]): void;
|
|
15
|
+
error(...msg: ILogArgvTypeWithError[]): void;
|
|
16
|
+
warn(...msg: ILogArgvType[]): void;
|
|
17
|
+
debug(...msg: ILogArgvType[]): void;
|
|
18
|
+
}
|
|
19
|
+
export default Logger;
|
|
@@ -0,0 +1,10 @@
|
|
|
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;
|
|
@@ -0,0 +1,27 @@
|
|
|
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;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AxiosRequestConfig } from 'axios';
|
|
2
|
+
import { IPicGo, IRequestConfig, IOldReqOptions, IResponse, IRequest } from '../types';
|
|
3
|
+
export declare class Request implements IRequest {
|
|
4
|
+
private readonly ctx;
|
|
5
|
+
private proxy;
|
|
6
|
+
options: AxiosRequestConfig<any>;
|
|
7
|
+
constructor(ctx: IPicGo);
|
|
8
|
+
private init;
|
|
9
|
+
private handleProxy;
|
|
10
|
+
request<T, U extends (IRequestConfig<U> extends IOldReqOptions ? IOldReqOptions : IRequestConfig<U> extends AxiosRequestConfig ? AxiosRequestConfig : never)>(options: U): Promise<IResponse<T, U>>;
|
|
11
|
+
}
|
|
12
|
+
export default Request;
|