piclist 1.9.14 → 2.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/.github/workflows/docker.yml +5 -5
- package/CHANGELOG.md +19 -0
- package/License +22 -22
- package/README.md +1 -1
- package/README_cn.md +1 -1
- package/bin/picgo +9 -7
- package/bin/picgo-server +180 -161
- package/dist/core/Lifecycle.d.ts +35 -36
- package/dist/core/PicGo.d.ts +52 -52
- package/dist/i18n/en.d.ts +2 -2
- package/dist/i18n/index.d.ts +19 -17
- package/dist/i18n/zh-CN.d.ts +293 -289
- package/dist/i18n/zh-TW.d.ts +2 -2
- package/dist/index.d.ts +10 -10
- package/dist/index.js +2 -0
- package/dist/lib/Commander.d.ts +22 -22
- package/dist/lib/LifecyclePlugins.d.ts +26 -26
- package/dist/lib/Logger.d.ts +19 -19
- package/dist/lib/PluginHandler.d.ts +10 -10
- package/dist/lib/PluginLoader.d.ts +27 -27
- package/dist/lib/Request.d.ts +12 -12
- package/dist/plugins/beforetransformer/compress.d.ts +5 -5
- package/dist/plugins/beforetransformer/skipProcess.d.ts +5 -5
- package/dist/plugins/beforetransformer/watermark.d.ts +5 -5
- package/dist/plugins/beforeupload/buildInRename.d.ts +5 -5
- package/dist/plugins/commander/config.d.ts +3 -3
- package/dist/plugins/commander/i18n.d.ts +3 -3
- package/dist/plugins/commander/index.d.ts +3 -3
- package/dist/plugins/commander/pluginHandler.d.ts +3 -3
- package/dist/plugins/commander/proxy.d.ts +3 -3
- package/dist/plugins/commander/setting.d.ts +5 -5
- package/dist/plugins/commander/upload.d.ts +3 -3
- package/dist/plugins/commander/use.d.ts +3 -3
- package/dist/plugins/commander/utils.d.ts +2 -2
- package/dist/plugins/transformer/base64.d.ts +5 -5
- package/dist/plugins/transformer/index.d.ts +5 -5
- package/dist/plugins/transformer/path.d.ts +5 -5
- package/dist/plugins/uploader/advancedplist.d.ts +2 -2
- package/dist/plugins/uploader/alist.d.ts +2 -2
- package/dist/plugins/uploader/aliyun.d.ts +2 -2
- package/dist/plugins/uploader/awss3plist.d.ts +2 -2
- package/dist/plugins/uploader/github.d.ts +2 -2
- package/dist/plugins/uploader/imgur.d.ts +2 -2
- package/dist/plugins/uploader/index.d.ts +5 -5
- package/dist/plugins/uploader/local.d.ts +2 -2
- package/dist/plugins/uploader/lsky.d.ts +20 -21
- package/dist/plugins/uploader/piclist.d.ts +2 -2
- package/dist/plugins/uploader/qiniu.d.ts +2 -2
- package/dist/plugins/uploader/s3/uploader.d.ts +25 -24
- package/dist/plugins/uploader/s3/utils.d.ts +9 -10
- package/dist/plugins/uploader/sftp.d.ts +2 -2
- package/dist/plugins/uploader/smms.d.ts +2 -2
- package/dist/plugins/uploader/tcyun.d.ts +8 -8
- package/dist/plugins/uploader/upyun.d.ts +2 -2
- package/dist/plugins/uploader/utils.d.ts +26 -26
- package/dist/plugins/uploader/webdav.d.ts +2 -2
- package/dist/types/index.d.ts +572 -693
- package/dist/types/oldRequest.d.ts +15 -15
- package/dist/utils/common.d.ts +42 -119
- package/dist/utils/createContext.d.ts +6 -6
- package/dist/utils/db.d.ts +17 -15
- package/dist/utils/enum.d.ts +27 -27
- package/dist/utils/eventBus.d.ts +3 -4
- package/dist/utils/getClipboardImage.d.ts +4 -4
- package/dist/utils/sshClient.d.ts +16 -16
- package/dist/utils/static.d.ts +1 -1
- package/docker-compose.yaml +11 -11
- package/eslint.config.js +104 -0
- package/package.json +61 -78
- package/rollup.config.js +25 -42
- package/.eslintignore +0 -6
- package/.eslintrc.js +0 -50
- package/.github/workflows/alpha.yml +0 -22
- package/.github/workflows/main.yml +0 -22
- package/.github/workflows/manually.yml +0 -19
- package/dist/index.cjs.js +0 -2
- package/dist/index.esm.js +0 -2
- package/dist/plugins/commander/init.d.ts +0 -3
- package/dist/utils/initUtils.d.ts +0 -26
- package/dist/utils/interfaces.d.ts +0 -201
package/dist/core/Lifecycle.d.ts
CHANGED
|
@@ -1,36 +1,35 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
private
|
|
9
|
-
private
|
|
10
|
-
private
|
|
11
|
-
private
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
private
|
|
15
|
-
private
|
|
16
|
-
private
|
|
17
|
-
private
|
|
18
|
-
private
|
|
19
|
-
private
|
|
20
|
-
private
|
|
21
|
-
private
|
|
22
|
-
private
|
|
23
|
-
private
|
|
24
|
-
private
|
|
25
|
-
private
|
|
26
|
-
private
|
|
27
|
-
private
|
|
28
|
-
private
|
|
29
|
-
private
|
|
30
|
-
private
|
|
31
|
-
private
|
|
32
|
-
private
|
|
33
|
-
private
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
export default Lifecycle;
|
|
1
|
+
import { EventEmitter } from 'node:events';
|
|
2
|
+
import { IPicGo } from '../types';
|
|
3
|
+
export declare class Lifecycle extends EventEmitter {
|
|
4
|
+
private readonly ctx;
|
|
5
|
+
ttfPath: string;
|
|
6
|
+
constructor(ctx: IPicGo);
|
|
7
|
+
private initializeDirs;
|
|
8
|
+
private downloadTTF;
|
|
9
|
+
private getProcessingOptions;
|
|
10
|
+
private getUploaderType;
|
|
11
|
+
private getSkipExtensions;
|
|
12
|
+
start(input: any[], skipProcess?: boolean): Promise<IPicGo>;
|
|
13
|
+
private initializeContext;
|
|
14
|
+
private handleSkipProcess;
|
|
15
|
+
private executeLifecycle;
|
|
16
|
+
private handleError;
|
|
17
|
+
private preprocess;
|
|
18
|
+
private initializeRawInputPaths;
|
|
19
|
+
private processImages;
|
|
20
|
+
private processImage;
|
|
21
|
+
private applyProcessing;
|
|
22
|
+
private addWatermark;
|
|
23
|
+
private compressImage;
|
|
24
|
+
private convertHeicAndCompress;
|
|
25
|
+
private saveProcessedImage;
|
|
26
|
+
private getFileBaseName;
|
|
27
|
+
private buildInRename;
|
|
28
|
+
private beforeTransform;
|
|
29
|
+
private doTransform;
|
|
30
|
+
private beforeUpload;
|
|
31
|
+
private doUpload;
|
|
32
|
+
private afterUpload;
|
|
33
|
+
private handlePlugins;
|
|
34
|
+
}
|
|
35
|
+
export default Lifecycle;
|
package/dist/core/PicGo.d.ts
CHANGED
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
private
|
|
10
|
-
private
|
|
11
|
-
private
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
private initConfigPath;
|
|
35
|
-
private initConfig;
|
|
36
|
-
private init;
|
|
37
|
-
/**
|
|
38
|
-
* easily mannually load a plugin
|
|
39
|
-
* if provide plugin name, will register plugin by name
|
|
40
|
-
* or just instantiate a plugin
|
|
41
|
-
*/
|
|
42
|
-
use(plugin: IPicGoPlugin, name?: string): IPicGoPluginInterface
|
|
43
|
-
registerCommands(): void;
|
|
44
|
-
getConfig<T>(name?: string): T;
|
|
45
|
-
saveConfig(config: IStringKeyMap<any>): void;
|
|
46
|
-
removeConfig(key: string, propName: string): void;
|
|
47
|
-
setConfig(config: IStringKeyMap<any>): void;
|
|
48
|
-
unsetConfig(key: string, propName: string): void;
|
|
49
|
-
get request(): IRequest['request'];
|
|
50
|
-
upload(input?: any[]): Promise<IImgInfo[] | Error>;
|
|
51
|
-
uploadReturnCtx(input?: any[], skipProcess?: boolean): Promise<IPicGo>;
|
|
52
|
-
}
|
|
1
|
+
import { EventEmitter } from 'node:events';
|
|
2
|
+
import { Commander } from '../lib/Commander';
|
|
3
|
+
import { Logger } from '../lib/Logger';
|
|
4
|
+
import { PluginHandler } from '../lib/PluginHandler';
|
|
5
|
+
import { Request } from '../lib/Request';
|
|
6
|
+
import { IHelper, II18nManager, IImgInfo, IPicGo, IPicGoPlugin, IPicGoPluginInterface, IPluginLoader, IRequest, IStringKeyMap } from '../types';
|
|
7
|
+
export declare class PicGo extends EventEmitter implements IPicGo {
|
|
8
|
+
private _config;
|
|
9
|
+
private lifecycle;
|
|
10
|
+
private db;
|
|
11
|
+
private _pluginLoader;
|
|
12
|
+
configPath: string;
|
|
13
|
+
baseDir: string;
|
|
14
|
+
helper: IHelper;
|
|
15
|
+
log: Logger;
|
|
16
|
+
cmd: Commander;
|
|
17
|
+
output: IImgInfo[];
|
|
18
|
+
input: any[];
|
|
19
|
+
rawInput: any[];
|
|
20
|
+
processedInput: 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
|
+
static create(configPath?: string): Promise<PicGo>;
|
|
34
|
+
private initConfigPath;
|
|
35
|
+
private initConfig;
|
|
36
|
+
private init;
|
|
37
|
+
/**
|
|
38
|
+
* easily mannually load a plugin
|
|
39
|
+
* if provide plugin name, will register plugin by name
|
|
40
|
+
* or just instantiate a plugin
|
|
41
|
+
*/
|
|
42
|
+
use(plugin: IPicGoPlugin, name?: string): Promise<IPicGoPluginInterface>;
|
|
43
|
+
registerCommands(): void;
|
|
44
|
+
getConfig<T>(name?: string): T;
|
|
45
|
+
saveConfig(config: IStringKeyMap<any>): void;
|
|
46
|
+
removeConfig(key: string, propName: string): void;
|
|
47
|
+
setConfig(config: IStringKeyMap<any>): void;
|
|
48
|
+
unsetConfig(key: string, propName: string): void;
|
|
49
|
+
get request(): IRequest['request'];
|
|
50
|
+
upload(input?: any[]): Promise<IImgInfo[] | Error>;
|
|
51
|
+
uploadReturnCtx(input?: any[], skipProcess?: boolean): Promise<IPicGo>;
|
|
52
|
+
}
|
package/dist/i18n/en.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ILocales } from './zh-CN';
|
|
2
|
-
export declare const EN: ILocales;
|
|
1
|
+
import { ILocales } from './zh-CN';
|
|
2
|
+
export declare const EN: ILocales;
|
package/dist/i18n/index.d.ts
CHANGED
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
private readonly
|
|
8
|
-
|
|
9
|
-
private
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
import { II18nManager, IPicGo, IStringKeyMap } from '../types';
|
|
2
|
+
import { ILocalesKey } from './zh-CN';
|
|
3
|
+
interface ILocale {
|
|
4
|
+
[key: string]: any;
|
|
5
|
+
}
|
|
6
|
+
declare class I18nManager implements II18nManager {
|
|
7
|
+
private readonly i18n;
|
|
8
|
+
private readonly objectAdapter;
|
|
9
|
+
private readonly ctx;
|
|
10
|
+
constructor(ctx: IPicGo);
|
|
11
|
+
private loadOutterI18n;
|
|
12
|
+
private getOutterI18nFolder;
|
|
13
|
+
translate<T extends string>(key: ILocalesKey | T, args?: IStringKeyMap<string>): string;
|
|
14
|
+
setLanguage(language: string): void;
|
|
15
|
+
addLocale(language: string, locales: ILocale): boolean;
|
|
16
|
+
addLanguage(language: string, locales: ILocale): boolean;
|
|
17
|
+
getLanguageList(): string[];
|
|
18
|
+
}
|
|
19
|
+
export { I18nManager };
|