picgo 1.4.26 → 1.5.0-alpha.2

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 (101) hide show
  1. package/.eslintignore +2 -0
  2. package/.github/workflows/alpha.yml +22 -0
  3. package/CHANGELOG.md +43 -0
  4. package/README.md +14 -1
  5. package/bin/picgo +1 -1
  6. package/dist/{src/core → core}/Lifecycle.d.ts +15 -15
  7. package/dist/{src/core → core}/PicGo.d.ts +44 -44
  8. package/dist/i18n/en.d.ts +2 -0
  9. package/dist/i18n/index.d.ts +16 -0
  10. package/dist/i18n/zh-CN.d.ts +65 -0
  11. package/dist/index.cjs.js +2 -0
  12. package/dist/index.d.ts +9 -0
  13. package/dist/index.esm.js +2 -0
  14. package/dist/{src/lib → lib}/Commander.d.ts +16 -16
  15. package/dist/{src/lib → lib}/LifecyclePlugins.d.ts +16 -16
  16. package/dist/{src/lib → lib}/Logger.d.ts +16 -16
  17. package/dist/{src/lib → lib}/PluginHandler.d.ts +10 -10
  18. package/dist/{src/lib → lib}/PluginLoader.d.ts +27 -27
  19. package/dist/{src/lib → lib}/Request.d.ts +11 -11
  20. package/dist/{src/plugins → plugins}/commander/config.d.ts +3 -3
  21. package/dist/plugins/commander/i18n.d.ts +3 -0
  22. package/dist/{src/plugins → plugins}/commander/index.d.ts +3 -3
  23. package/dist/{src/plugins → plugins}/commander/init.d.ts +3 -3
  24. package/dist/{src/plugins → plugins}/commander/pluginHandler.d.ts +3 -3
  25. package/dist/{src/plugins → plugins}/commander/proxy.d.ts +3 -3
  26. package/dist/{src/plugins → plugins}/commander/setting.d.ts +5 -5
  27. package/dist/{src/plugins → plugins}/commander/upload.d.ts +3 -3
  28. package/dist/{src/plugins → plugins}/commander/use.d.ts +3 -3
  29. package/dist/{src/plugins → plugins}/transformer/base64.d.ts +5 -5
  30. package/dist/{src/plugins → plugins}/transformer/index.d.ts +3 -3
  31. package/dist/{src/plugins → plugins}/transformer/path.d.ts +5 -5
  32. package/dist/plugins/uploader/aliyun.d.ts +2 -0
  33. package/dist/plugins/uploader/github.d.ts +2 -0
  34. package/dist/plugins/uploader/imgur.d.ts +2 -0
  35. package/dist/{src/plugins → plugins}/uploader/index.d.ts +3 -3
  36. package/dist/plugins/uploader/qiniu.d.ts +2 -0
  37. package/dist/plugins/uploader/smms.d.ts +2 -0
  38. package/dist/plugins/uploader/tcyun.d.ts +8 -0
  39. package/dist/plugins/uploader/upyun.d.ts +2 -0
  40. package/dist/types/index.d.ts +468 -0
  41. package/dist/{src/utils → utils}/common.d.ts +102 -101
  42. package/dist/{src/utils → utils}/createContext.d.ts +6 -6
  43. package/dist/{src/utils → utils}/db.d.ts +15 -15
  44. package/dist/{src/utils → utils}/enum.d.ts +27 -27
  45. package/dist/{src/utils → utils}/eventBus.d.ts +4 -4
  46. package/dist/{src/utils → utils}/getClipboardImage.d.ts +4 -3
  47. package/dist/{src/utils → utils}/initUtils.d.ts +26 -26
  48. package/dist/{src/utils → utils}/interfaces.d.ts +203 -203
  49. package/package.json +27 -22
  50. package/rollup.config.js +82 -0
  51. package/dist/package.json +0 -127
  52. package/dist/src/core/Lifecycle.js +0 -123
  53. package/dist/src/core/PicGo.js +0 -210
  54. package/dist/src/index.d.ts +0 -2
  55. package/dist/src/index.js +0 -6
  56. package/dist/src/lib/Commander.js +0 -56
  57. package/dist/src/lib/LifecyclePlugins.js +0 -52
  58. package/dist/src/lib/Logger.js +0 -82
  59. package/dist/src/lib/PluginHandler.js +0 -260
  60. package/dist/src/lib/PluginLoader.js +0 -145
  61. package/dist/src/lib/Request.js +0 -42
  62. package/dist/src/plugins/commander/config.js +0 -11
  63. package/dist/src/plugins/commander/index.js +0 -21
  64. package/dist/src/plugins/commander/init.js +0 -122
  65. package/dist/src/plugins/commander/pluginHandler.js +0 -43
  66. package/dist/src/plugins/commander/proxy.js +0 -14
  67. package/dist/src/plugins/commander/setting.js +0 -102
  68. package/dist/src/plugins/commander/upload.js +0 -35
  69. package/dist/src/plugins/commander/use.js +0 -87
  70. package/dist/src/plugins/transformer/base64.js +0 -9
  71. package/dist/src/plugins/transformer/index.js +0 -16
  72. package/dist/src/plugins/transformer/path.js +0 -42
  73. package/dist/src/plugins/uploader/aliyun.d.ts +0 -7
  74. package/dist/src/plugins/uploader/aliyun.js +0 -129
  75. package/dist/src/plugins/uploader/github.d.ts +0 -7
  76. package/dist/src/plugins/uploader/github.js +0 -101
  77. package/dist/src/plugins/uploader/imgur.d.ts +0 -7
  78. package/dist/src/plugins/uploader/imgur.js +0 -81
  79. package/dist/src/plugins/uploader/index.js +0 -26
  80. package/dist/src/plugins/uploader/qiniu.d.ts +0 -7
  81. package/dist/src/plugins/uploader/qiniu.js +0 -132
  82. package/dist/src/plugins/uploader/smms.d.ts +0 -7
  83. package/dist/src/plugins/uploader/smms.js +0 -74
  84. package/dist/src/plugins/uploader/tcyun.d.ts +0 -13
  85. package/dist/src/plugins/uploader/tcyun.js +0 -218
  86. package/dist/src/plugins/uploader/upyun.d.ts +0 -7
  87. package/dist/src/plugins/uploader/upyun.js +0 -128
  88. package/dist/src/types/index.d.ts +0 -471
  89. package/dist/src/utils/clipboard/linux.sh +0 -18
  90. package/dist/src/utils/clipboard/mac.applescript +0 -0
  91. package/dist/src/utils/clipboard/windows.ps1 +0 -26
  92. package/dist/src/utils/clipboard/windows10.ps1 +0 -47
  93. package/dist/src/utils/clipboard/wsl.sh +0 -18
  94. package/dist/src/utils/common.js +0 -353
  95. package/dist/src/utils/createContext.js +0 -45
  96. package/dist/src/utils/db.js +0 -85
  97. package/dist/src/utils/enum.js +0 -33
  98. package/dist/src/utils/eventBus.js +0 -6
  99. package/dist/src/utils/getClipboardImage.js +0 -101
  100. package/dist/src/utils/initUtils.js +0 -120
  101. 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;
@@ -0,0 +1,3 @@
1
+ import { IPlugin } from '../../types';
2
+ declare const i18n: IPlugin;
3
+ export default i18n;
@@ -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;
@@ -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;
@@ -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;
@@ -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;