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.
Files changed (58) hide show
  1. package/.eslintignore +2 -0
  2. package/.eslintrc.js +25 -0
  3. package/.github/workflows/alpha.yml +22 -0
  4. package/.github/workflows/main.yml +22 -0
  5. package/.github/workflows/manually.yml +19 -0
  6. package/CHANGELOG.md +549 -0
  7. package/License +21 -0
  8. package/README.md +116 -0
  9. package/bin/picgo +22 -0
  10. package/dist/core/Lifecycle.d.ts +15 -0
  11. package/dist/core/PicGo.d.ts +49 -0
  12. package/dist/i18n/en.d.ts +2 -0
  13. package/dist/i18n/index.d.ts +18 -0
  14. package/dist/i18n/zh-CN.d.ts +91 -0
  15. package/dist/i18n/zh-TW.d.ts +2 -0
  16. package/dist/index.cjs.js +3807 -0
  17. package/dist/index.d.ts +9 -0
  18. package/dist/index.esm.js +3769 -0
  19. package/dist/lib/Commander.d.ts +22 -0
  20. package/dist/lib/LifecyclePlugins.d.ts +17 -0
  21. package/dist/lib/Logger.d.ts +19 -0
  22. package/dist/lib/PluginHandler.d.ts +10 -0
  23. package/dist/lib/PluginLoader.d.ts +27 -0
  24. package/dist/lib/Request.d.ts +12 -0
  25. package/dist/plugins/commander/config.d.ts +3 -0
  26. package/dist/plugins/commander/i18n.d.ts +3 -0
  27. package/dist/plugins/commander/index.d.ts +3 -0
  28. package/dist/plugins/commander/init.d.ts +3 -0
  29. package/dist/plugins/commander/pluginHandler.d.ts +3 -0
  30. package/dist/plugins/commander/proxy.d.ts +3 -0
  31. package/dist/plugins/commander/setting.d.ts +5 -0
  32. package/dist/plugins/commander/upload.d.ts +3 -0
  33. package/dist/plugins/commander/use.d.ts +3 -0
  34. package/dist/plugins/transformer/base64.d.ts +5 -0
  35. package/dist/plugins/transformer/index.d.ts +3 -0
  36. package/dist/plugins/transformer/path.d.ts +5 -0
  37. package/dist/plugins/uploader/aliyun.d.ts +2 -0
  38. package/dist/plugins/uploader/github.d.ts +2 -0
  39. package/dist/plugins/uploader/imgur.d.ts +2 -0
  40. package/dist/plugins/uploader/index.d.ts +3 -0
  41. package/dist/plugins/uploader/qiniu.d.ts +2 -0
  42. package/dist/plugins/uploader/smms.d.ts +2 -0
  43. package/dist/plugins/uploader/tcyun.d.ts +8 -0
  44. package/dist/plugins/uploader/upyun.d.ts +2 -0
  45. package/dist/types/index.d.ts +537 -0
  46. package/dist/types/oldRequest.d.ts +19 -0
  47. package/dist/utils/common.d.ts +106 -0
  48. package/dist/utils/createContext.d.ts +6 -0
  49. package/dist/utils/db.d.ts +15 -0
  50. package/dist/utils/enum.d.ts +27 -0
  51. package/dist/utils/eventBus.d.ts +4 -0
  52. package/dist/utils/getClipboardImage.d.ts +4 -0
  53. package/dist/utils/initUtils.d.ts +26 -0
  54. package/dist/utils/interfaces.d.ts +203 -0
  55. package/dist/utils/static.d.ts +1 -0
  56. package/logo.png +0 -0
  57. package/package.json +133 -0
  58. 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;
@@ -0,0 +1,3 @@
1
+ import { IPlugin } from '../../types';
2
+ declare const config: IPlugin;
3
+ export default config;
@@ -0,0 +1,3 @@
1
+ import { IPlugin } from '../../types';
2
+ declare const i18n: IPlugin;
3
+ export default i18n;
@@ -0,0 +1,3 @@
1
+ import { IPicGo } from '../../types';
2
+ declare const _default: (ctx: IPicGo) => void;
3
+ export default _default;
@@ -0,0 +1,3 @@
1
+ import { IPlugin } from '../../types';
2
+ declare const init: IPlugin;
3
+ export default init;
@@ -0,0 +1,3 @@
1
+ import { IPlugin } from '../../types';
2
+ declare const pluginHandler: IPlugin;
3
+ export default pluginHandler;
@@ -0,0 +1,3 @@
1
+ import { IPlugin } from '../../types';
2
+ declare const proxy: IPlugin;
3
+ export default proxy;
@@ -0,0 +1,5 @@
1
+ import { IPicGo } from '../../types';
2
+ declare const setting: {
3
+ handle: (ctx: IPicGo) => void;
4
+ };
5
+ export default setting;
@@ -0,0 +1,3 @@
1
+ import { IPlugin } from '../../types';
2
+ declare const upload: IPlugin;
3
+ export default upload;
@@ -0,0 +1,3 @@
1
+ import { IPlugin } from '../../types';
2
+ declare const use: IPlugin;
3
+ export default use;
@@ -0,0 +1,5 @@
1
+ import { IPicGo } from '../../types';
2
+ declare const _default: {
3
+ handle: (ctx: IPicGo) => Promise<IPicGo>;
4
+ };
5
+ export default _default;
@@ -0,0 +1,3 @@
1
+ import { IPicGoPlugin } from '../../types';
2
+ declare const buildInTransformers: IPicGoPlugin;
3
+ export default buildInTransformers;
@@ -0,0 +1,5 @@
1
+ import { IPicGo } from '../../types';
2
+ declare const _default: {
3
+ handle: (ctx: IPicGo) => Promise<IPicGo>;
4
+ };
5
+ export default _default;
@@ -0,0 +1,2 @@
1
+ import { IPicGo } from '../../types';
2
+ export default function register(ctx: IPicGo): void;
@@ -0,0 +1,2 @@
1
+ import { IPicGo } from '../../types';
2
+ export default function register(ctx: IPicGo): void;
@@ -0,0 +1,2 @@
1
+ import { IPicGo } from '../../types';
2
+ export default function register(ctx: IPicGo): void;
@@ -0,0 +1,3 @@
1
+ import { IPicGoPlugin } from '../../types';
2
+ declare const buildInUploaders: IPicGoPlugin;
3
+ export default buildInUploaders;
@@ -0,0 +1,2 @@
1
+ import { IPicGo } from '../../types';
2
+ export default function register(ctx: IPicGo): void;
@@ -0,0 +1,2 @@
1
+ import { IPicGo } from '../../types';
2
+ export default function register(ctx: IPicGo): void;
@@ -0,0 +1,8 @@
1
+ import { IPicGo } from '../../types';
2
+ export interface ISignature {
3
+ signature: string;
4
+ appId: string;
5
+ bucket: string;
6
+ signTime: string;
7
+ }
8
+ export default function register(ctx: IPicGo): void;
@@ -0,0 +1,2 @@
1
+ import { IPicGo } from '../../types';
2
+ export default function register(ctx: IPicGo): void;