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
package/.eslintignore
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
name: publish
|
|
2
|
+
on:
|
|
3
|
+
push:
|
|
4
|
+
branches:
|
|
5
|
+
- alpha
|
|
6
|
+
jobs:
|
|
7
|
+
build:
|
|
8
|
+
runs-on: ubuntu-latest
|
|
9
|
+
steps:
|
|
10
|
+
- name: Clone repo
|
|
11
|
+
uses: actions/checkout@v1
|
|
12
|
+
- name: Setup node
|
|
13
|
+
uses: actions/setup-node@v1
|
|
14
|
+
with:
|
|
15
|
+
node-version: '12.x'
|
|
16
|
+
registry-url: 'https://registry.npmjs.org'
|
|
17
|
+
- name: Install modules
|
|
18
|
+
run: yarn
|
|
19
|
+
- run: npm run build
|
|
20
|
+
- run: npm publish --tag alpha --access public
|
|
21
|
+
env:
|
|
22
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,41 @@
|
|
|
1
|
+
# :tada: 1.5.0-alpha.1 (2022-03-08)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### :sparkles: Features
|
|
5
|
+
|
|
6
|
+
* add options for tencent cos ([1fccdcc](https://github.com/PicGo/PicGo-Core/commit/1fccdcc)), closes [#117](https://github.com/PicGo/PicGo-Core/issues/117)
|
|
7
|
+
* **i18n:** add i18n for picgo ([4b93a76](https://github.com/PicGo/PicGo-Core/commit/4b93a76))
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### :bug: Bug Fixes
|
|
11
|
+
|
|
12
|
+
* build error in windows ([5616fb9](https://github.com/PicGo/PicGo-Core/commit/5616fb9))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### :package: Chore
|
|
16
|
+
|
|
17
|
+
* add alpha branch for alpha version ([6882022](https://github.com/PicGo/PicGo-Core/commit/6882022)), closes [#106](https://github.com/PicGo/PicGo-Core/issues/106)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
# :tada: 1.5.0-alpha.0 (2021-10-26)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
### :package: Chore
|
|
25
|
+
|
|
26
|
+
* **build:** migrate to esbuild and change export assignment to esm export ([#102](https://github.com/PicGo/PicGo-Core/issues/102)) ([2a6cd18](https://github.com/PicGo/PicGo-Core/commit/2a6cd18))
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
## :tada: 1.4.26 (2021-08-23)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
### :bug: Bug Fixes
|
|
34
|
+
|
|
35
|
+
* engine bug in package.json ([1c65144](https://github.com/PicGo/PicGo-Core/commit/1c65144))
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
1
39
|
## :tada: 1.4.25 (2021-08-21)
|
|
2
40
|
|
|
3
41
|
|
package/README.md
CHANGED
|
@@ -87,8 +87,21 @@ Thanks to [vs-picgo](https://github.com/Spades-S/vs-picgo) && [Spades-S](https:/
|
|
|
87
87
|
|
|
88
88
|
### Use in node project
|
|
89
89
|
|
|
90
|
+
#### Common JS
|
|
91
|
+
|
|
92
|
+
```js
|
|
93
|
+
const { PicGo } = require('picgo')
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
#### ES Module
|
|
97
|
+
|
|
98
|
+
```js
|
|
99
|
+
import { PicGo } from 'picgo'
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
#### API usage example
|
|
103
|
+
|
|
90
104
|
```js
|
|
91
|
-
const PicGo = require('picgo')
|
|
92
105
|
const picgo = new PicGo()
|
|
93
106
|
|
|
94
107
|
// upload a picture from path
|
package/bin/picgo
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { EventEmitter } from 'events';
|
|
3
|
-
import { IPicGo } from '../types';
|
|
4
|
-
declare class Lifecycle extends EventEmitter {
|
|
5
|
-
private readonly ctx;
|
|
6
|
-
constructor(ctx: IPicGo);
|
|
7
|
-
start(input: any[]): Promise<IPicGo>;
|
|
8
|
-
private beforeTransform;
|
|
9
|
-
private doTransform;
|
|
10
|
-
private beforeUpload;
|
|
11
|
-
private doUpload;
|
|
12
|
-
private afterUpload;
|
|
13
|
-
private handlePlugins;
|
|
14
|
-
}
|
|
15
|
-
export default Lifecycle;
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { EventEmitter } from 'events';
|
|
3
|
+
import { IPicGo } from '../types';
|
|
4
|
+
export declare class Lifecycle extends EventEmitter {
|
|
5
|
+
private readonly ctx;
|
|
6
|
+
constructor(ctx: IPicGo);
|
|
7
|
+
start(input: any[]): Promise<IPicGo>;
|
|
8
|
+
private beforeTransform;
|
|
9
|
+
private doTransform;
|
|
10
|
+
private beforeUpload;
|
|
11
|
+
private doUpload;
|
|
12
|
+
private afterUpload;
|
|
13
|
+
private handlePlugins;
|
|
14
|
+
}
|
|
15
|
+
export default Lifecycle;
|
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { EventEmitter } from 'events';
|
|
3
|
-
import Commander from '../lib/Commander';
|
|
4
|
-
import Logger from '../lib/Logger';
|
|
5
|
-
import { IHelper, IImgInfo, IPicGo, IStringKeyMap, IPluginLoader } from '../types';
|
|
6
|
-
import Request from '../lib/Request';
|
|
7
|
-
import PluginHandler from '../lib/PluginHandler';
|
|
8
|
-
import { RequestPromiseAPI } from 'request-promise-native';
|
|
9
|
-
declare class PicGo extends EventEmitter implements IPicGo {
|
|
10
|
-
private _config;
|
|
11
|
-
private lifecycle;
|
|
12
|
-
private db;
|
|
13
|
-
private _pluginLoader;
|
|
14
|
-
configPath: string;
|
|
15
|
-
baseDir: string;
|
|
16
|
-
helper: IHelper;
|
|
17
|
-
log: Logger;
|
|
18
|
-
cmd: Commander;
|
|
19
|
-
output: IImgInfo[];
|
|
20
|
-
input: any[];
|
|
21
|
-
pluginHandler: PluginHandler;
|
|
22
|
-
/**
|
|
23
|
-
* @deprecated will be removed in v1.5.0+
|
|
24
|
-
*
|
|
25
|
-
* use request instead
|
|
26
|
-
*/
|
|
27
|
-
Request: Request;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
private
|
|
34
|
-
private
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { EventEmitter } from 'events';
|
|
3
|
+
import Commander from '../lib/Commander';
|
|
4
|
+
import { Logger } from '../lib/Logger';
|
|
5
|
+
import { IHelper, IImgInfo, IPicGo, IStringKeyMap, IPluginLoader, II18nManager } from '../types';
|
|
6
|
+
import Request from '../lib/Request';
|
|
7
|
+
import PluginHandler from '../lib/PluginHandler';
|
|
8
|
+
import { RequestPromiseAPI } from 'request-promise-native';
|
|
9
|
+
export declare class PicGo extends EventEmitter implements IPicGo {
|
|
10
|
+
private _config;
|
|
11
|
+
private lifecycle;
|
|
12
|
+
private db;
|
|
13
|
+
private _pluginLoader;
|
|
14
|
+
configPath: string;
|
|
15
|
+
baseDir: string;
|
|
16
|
+
helper: IHelper;
|
|
17
|
+
log: Logger;
|
|
18
|
+
cmd: Commander;
|
|
19
|
+
output: IImgInfo[];
|
|
20
|
+
input: any[];
|
|
21
|
+
pluginHandler: PluginHandler;
|
|
22
|
+
/**
|
|
23
|
+
* @deprecated will be removed in v1.5.0+
|
|
24
|
+
*
|
|
25
|
+
* use request instead
|
|
26
|
+
*/
|
|
27
|
+
Request: Request;
|
|
28
|
+
i18n: II18nManager;
|
|
29
|
+
VERSION: string;
|
|
30
|
+
GUI_VERSION?: string;
|
|
31
|
+
get pluginLoader(): IPluginLoader;
|
|
32
|
+
constructor(configPath?: string);
|
|
33
|
+
private initConfigPath;
|
|
34
|
+
private initConfig;
|
|
35
|
+
private init;
|
|
36
|
+
registerCommands(): void;
|
|
37
|
+
getConfig<T>(name?: string): T;
|
|
38
|
+
saveConfig(config: IStringKeyMap<any>): void;
|
|
39
|
+
removeConfig(key: string, propName: string): void;
|
|
40
|
+
setConfig(config: IStringKeyMap<any>): void;
|
|
41
|
+
unsetConfig(key: string, propName: string): void;
|
|
42
|
+
get request(): RequestPromiseAPI;
|
|
43
|
+
upload(input?: any[]): Promise<IImgInfo[] | Error>;
|
|
44
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ILocalesKey } from './zh-CN';
|
|
2
|
+
import { IPicGo } from '../types';
|
|
3
|
+
import { IStringKeyMap, II18nManager } from '../types/index';
|
|
4
|
+
import { ILocale } from '@picgo/i18n/dist/types';
|
|
5
|
+
declare class I18nManager implements II18nManager {
|
|
6
|
+
private readonly i18n;
|
|
7
|
+
private readonly objectAdapter;
|
|
8
|
+
private readonly ctx;
|
|
9
|
+
constructor(ctx: IPicGo);
|
|
10
|
+
translate<T extends string>(key: ILocalesKey | T, args?: IStringKeyMap<string>): string;
|
|
11
|
+
setLanguage(language: string): void;
|
|
12
|
+
addLocale(language: string, locales: ILocale): boolean;
|
|
13
|
+
addLanguage(language: string, locales: ILocale): boolean;
|
|
14
|
+
getLanguageList(): string[];
|
|
15
|
+
}
|
|
16
|
+
export { I18nManager };
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
export declare const ZH_CN: {
|
|
2
|
+
UPLOAD_FAILED: string;
|
|
3
|
+
CHECK_SETTINGS: string;
|
|
4
|
+
CHECK_SETTINGS_AND_NETWORK: string;
|
|
5
|
+
UPLOAD_FAILED_REASON: string;
|
|
6
|
+
SERVER_ERROR: string;
|
|
7
|
+
AUTH_FAILED: string;
|
|
8
|
+
PICBED_SMMS: string;
|
|
9
|
+
PICBED_SMMS_TOKEN: string;
|
|
10
|
+
PICBED_ALICLOUD: string;
|
|
11
|
+
PICBED_ALICLOUD_ACCESSKEYID: string;
|
|
12
|
+
PICBED_ALICLOUD_ACCESSKEYSECRET: string;
|
|
13
|
+
PICBED_ALICLOUD_BUCKET: string;
|
|
14
|
+
PICBED_ALICLOUD_AREA: string;
|
|
15
|
+
PICBED_ALICLOUD_PATH: string;
|
|
16
|
+
PICBED_ALICLOUD_CUSTOMURL: string;
|
|
17
|
+
PICBED_ALICLOUD_OPTIONS: string;
|
|
18
|
+
PICBED_TENCENTCLOUD: string;
|
|
19
|
+
PICBED_TENCENTCLOUD_VERSION: string;
|
|
20
|
+
PICBED_TENCENTCLOUD_SECRETID: string;
|
|
21
|
+
PICBED_TENCENTCLOUD_SECRETKEY: string;
|
|
22
|
+
PICBED_TENCENTCLOUD_APPID: string;
|
|
23
|
+
PICBED_TENCENTCLOUD_BUCKET: string;
|
|
24
|
+
PICBED_TENCENTCLOUD_AREA: string;
|
|
25
|
+
PICBED_TENCENTCLOUD_PATH: string;
|
|
26
|
+
PICBED_TENCENTCLOUD_CUSTOMURL: string;
|
|
27
|
+
PICBED_GITHUB: string;
|
|
28
|
+
PICBED_GITHUB_TOKEN: string;
|
|
29
|
+
PICBED_GITHUB_REPO: string;
|
|
30
|
+
PICBED_GITHUB_PATH: string;
|
|
31
|
+
PICBED_GITHUB_BRANCH: string;
|
|
32
|
+
PICBED_GITHUB_CUSTOMURL: string;
|
|
33
|
+
PICBED_QINIU: string;
|
|
34
|
+
PICBED_QINIU_ACCESSKEY: string;
|
|
35
|
+
PICBED_QINIU_SECRETKEY: string;
|
|
36
|
+
PICBED_QINIU_BUCKET: string;
|
|
37
|
+
PICBED_QINIU_PATH: string;
|
|
38
|
+
PICBED_QINIU_URL: string;
|
|
39
|
+
PICBED_QINIU_OPTIONS: string;
|
|
40
|
+
PICBED_QINIU_AREA: string;
|
|
41
|
+
PICBED_IMGUR: string;
|
|
42
|
+
PICBED_IMGUR_CLIENTID: string;
|
|
43
|
+
PICBED_IMGUR_PROXY: string;
|
|
44
|
+
PICBED_UPYUN: string;
|
|
45
|
+
PICBED_UPYUN_BUCKET: string;
|
|
46
|
+
PICBED_UPYUN_OPERATOR: string;
|
|
47
|
+
PICBED_UPYUN_PASSWORD: string;
|
|
48
|
+
PICBED_UPYUN_PATH: string;
|
|
49
|
+
PICBED_UPYUN_URL: string;
|
|
50
|
+
PICBED_UPYUN_OPTIONS: string;
|
|
51
|
+
PLUGIN_HANDLER_PLUGIN_INSTALL_SUCCESS: string;
|
|
52
|
+
PLUGIN_HANDLER_PLUGIN_INSTALL_FAILED: string;
|
|
53
|
+
PLUGIN_HANDLER_PLUGIN_INSTALL_FAILED_REASON: string;
|
|
54
|
+
PLUGIN_HANDLER_PLUGIN_INSTALL_FAILED_PATH: string;
|
|
55
|
+
PLUGIN_HANDLER_PLUGIN_UNINSTALL_SUCCESS: string;
|
|
56
|
+
PLUGIN_HANDLER_PLUGIN_UNINSTALL_FAILED: string;
|
|
57
|
+
PLUGIN_HANDLER_PLUGIN_UNINSTALL_FAILED_REASON: string;
|
|
58
|
+
PLUGIN_HANDLER_PLUGIN_UNINSTALL_FAILED_VALID: string;
|
|
59
|
+
PLUGIN_HANDLER_PLUGIN_UPDATE_SUCCESS: string;
|
|
60
|
+
PLUGIN_HANDLER_PLUGIN_UPDATE_FAILED: string;
|
|
61
|
+
PLUGIN_HANDLER_PLUGIN_UPDATE_FAILED_REASON: string;
|
|
62
|
+
PLUGIN_HANDLER_PLUGIN_UPDATE_FAILED_VALID: string;
|
|
63
|
+
};
|
|
64
|
+
export declare type ILocalesKey = keyof typeof ZH_CN;
|
|
65
|
+
export declare type ILocales = typeof ZH_CN;
|