universal-picgo 1.12.1 → 2.0.0
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/README.md +48 -0
- package/package.json +4 -7
- package/dist/README.md +0 -52
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -85200
- package/dist/package.json +0 -56
- package/dist/src/core/ExternalPicgo.d.ts +0 -24
- package/dist/src/core/Lifecycle.d.ts +0 -15
- package/dist/src/core/UniversalPicGo.d.ts +0 -47
- package/dist/src/db/config/index.d.ts +0 -25
- package/dist/src/db/externalPicGo/index.d.ts +0 -24
- package/dist/src/db/pluginLoder/index.d.ts +0 -24
- package/dist/src/i18n/browserI18nDb.d.ts +0 -16
- package/dist/src/i18n/en.d.ts +0 -3
- package/dist/src/i18n/index.d.ts +0 -18
- package/dist/src/i18n/zh-CN.d.ts +0 -143
- package/dist/src/i18n/zh-TW.d.ts +0 -3
- package/dist/src/index.d.ts +0 -17
- package/dist/src/index.spec.d.ts +0 -1
- package/dist/src/lib/LifecyclePlugins.d.ts +0 -18
- package/dist/src/lib/PicGoRequest.d.ts +0 -21
- package/dist/src/lib/PluginHandler.d.ts +0 -20
- package/dist/src/lib/PluginLoader.d.ts +0 -29
- package/dist/src/plugins/transformer/base64.d.ts +0 -6
- package/dist/src/plugins/transformer/index.d.ts +0 -4
- package/dist/src/plugins/transformer/path.d.ts +0 -6
- package/dist/src/plugins/uploader/aliyun/index.d.ts +0 -3
- package/dist/src/plugins/uploader/aliyun/node.d.ts +0 -4
- package/dist/src/plugins/uploader/aliyun/web.d.ts +0 -4
- package/dist/src/plugins/uploader/awss3.d.ts +0 -3
- package/dist/src/plugins/uploader/github.d.ts +0 -3
- package/dist/src/plugins/uploader/gitlab.d.ts +0 -3
- package/dist/src/plugins/uploader/imgur.d.ts +0 -3
- package/dist/src/plugins/uploader/index.d.ts +0 -4
- package/dist/src/plugins/uploader/lsky/index.d.ts +0 -3
- package/dist/src/plugins/uploader/qiniu/digest.d.ts +0 -7
- package/dist/src/plugins/uploader/qiniu/index.d.ts +0 -3
- package/dist/src/plugins/uploader/qiniu/rs.d.ts +0 -13
- package/dist/src/plugins/uploader/qiniu/util.d.ts +0 -8
- package/dist/src/plugins/uploader/s3/uploader.d.ts +0 -30
- package/dist/src/plugins/uploader/s3/utils.d.ts +0 -8
- package/dist/src/plugins/uploader/smms.d.ts +0 -3
- package/dist/src/plugins/uploader/tcyun.d.ts +0 -9
- package/dist/src/plugins/uploader/upyun/index.d.ts +0 -3
- package/dist/src/utils/CodingUtil.d.ts +0 -39
- package/dist/src/utils/CodingUtil.spec.d.ts +0 -1
- package/dist/src/utils/browserUtils.d.ts +0 -12
- package/dist/src/utils/clipboard/browser.d.ts +0 -4
- package/dist/src/utils/clipboard/electron.d.ts +0 -4
- package/dist/src/utils/common.d.ts +0 -135
- package/dist/src/utils/constants.d.ts +0 -1
- package/dist/src/utils/createContext.d.ts +0 -9
- package/dist/src/utils/enums.d.ts +0 -32
- package/dist/src/utils/getClipboardImage.d.ts +0 -4
- package/dist/src/utils/hashUtil.d.ts +0 -2
- package/dist/src/utils/image-size/detector.d.ts +0 -4
- package/dist/src/utils/image-size/index.d.ts +0 -12
- package/dist/src/utils/image-size/types/bmp.d.ts +0 -3
- package/dist/src/utils/image-size/types/cur.d.ts +0 -3
- package/dist/src/utils/image-size/types/dds.d.ts +0 -3
- package/dist/src/utils/image-size/types/gif.d.ts +0 -3
- package/dist/src/utils/image-size/types/heif.d.ts +0 -3
- package/dist/src/utils/image-size/types/icns.d.ts +0 -3
- package/dist/src/utils/image-size/types/ico.d.ts +0 -3
- package/dist/src/utils/image-size/types/index.d.ts +0 -21
- package/dist/src/utils/image-size/types/interface.d.ts +0 -15
- package/dist/src/utils/image-size/types/j2c.d.ts +0 -3
- package/dist/src/utils/image-size/types/jp2.d.ts +0 -3
- package/dist/src/utils/image-size/types/jpg.d.ts +0 -3
- package/dist/src/utils/image-size/types/ktx.d.ts +0 -3
- package/dist/src/utils/image-size/types/png.d.ts +0 -3
- package/dist/src/utils/image-size/types/pnm.d.ts +0 -3
- package/dist/src/utils/image-size/types/psd.d.ts +0 -3
- package/dist/src/utils/image-size/types/svg.d.ts +0 -3
- package/dist/src/utils/image-size/types/tga.d.ts +0 -3
- package/dist/src/utils/image-size/types/tiff.d.ts +0 -3
- package/dist/src/utils/image-size/types/utils.d.ts +0 -17
- package/dist/src/utils/image-size/types/webp.d.ts +0 -3
- package/dist/src/utils/nodePolyfill.d.ts +0 -4
- package/dist/src/utils/nodeUtils.d.ts +0 -31
- package/dist/src/utils/os/index.d.ts +0 -3
- package/dist/src/utils/os/is-docker/index.d.ts +0 -2
- package/dist/src/utils/os/is-inside-container/index.d.ts +0 -1
- package/dist/src/utils/os/is-wsl/index.d.ts +0 -2
- package/dist/src/utils/picgoEventBus.d.ts +0 -4
- package/dist/vite.config.d.ts +0 -2
package/dist/package.json
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "universal-picgo",
|
|
3
|
-
"version": "1.12.1",
|
|
4
|
-
"type": "module",
|
|
5
|
-
"description": "picgo lib for node, browser and electron",
|
|
6
|
-
"main": "./dist/index.js",
|
|
7
|
-
"typings": "./dist/index.d.ts",
|
|
8
|
-
"repository": "terwer/siyuan-plugin-picgo",
|
|
9
|
-
"homepage": "https://github.com/terwer/siyuan-plugin-picgo/tree/main/libs/Universal-PicGo-Core",
|
|
10
|
-
"author": "terwer",
|
|
11
|
-
"license": "MIT",
|
|
12
|
-
"files": [
|
|
13
|
-
"dist",
|
|
14
|
-
"README.md"
|
|
15
|
-
],
|
|
16
|
-
"keywords": [
|
|
17
|
-
"zhi",
|
|
18
|
-
"lib"
|
|
19
|
-
],
|
|
20
|
-
"scripts": {
|
|
21
|
-
"serve": "vite",
|
|
22
|
-
"dev": "vite build --watch",
|
|
23
|
-
"build": "vite build",
|
|
24
|
-
"start": "vite preview",
|
|
25
|
-
"test": "npx vitest --watch"
|
|
26
|
-
},
|
|
27
|
-
"devDependencies": {
|
|
28
|
-
"@terwer/eslint-config-custom": "^1.3.6",
|
|
29
|
-
"@terwer/vite-config-custom": "^0.7.6",
|
|
30
|
-
"@types/mime": "^4.0.0",
|
|
31
|
-
"@types/mime-types": "^2.1.4",
|
|
32
|
-
"vite-plugin-node-polyfills": "^0.22.0"
|
|
33
|
-
},
|
|
34
|
-
"dependencies": {
|
|
35
|
-
"@aws-sdk/client-s3": "^3.421.0",
|
|
36
|
-
"@aws-sdk/s3-request-presigner": "^3.421.0",
|
|
37
|
-
"@smithy/types": "^3.0.0",
|
|
38
|
-
"@smithy/protocol-http": "^4.0.0",
|
|
39
|
-
"@smithy/querystring-builder": "^3.0.0",
|
|
40
|
-
"@smithy/fetch-http-handler": "^3.0.1",
|
|
41
|
-
"@picgo/i18n": "^1.0.0",
|
|
42
|
-
"ali-oss": "^6.20.0",
|
|
43
|
-
"axios": "^1.6.8",
|
|
44
|
-
"dayjs": "^1.11.11",
|
|
45
|
-
"js-yaml": "^4.1.0",
|
|
46
|
-
"mime": "^4.0.3",
|
|
47
|
-
"mime-types": "^2.1.35",
|
|
48
|
-
"queue": "^7.0.0",
|
|
49
|
-
"universal-picgo-store": "workspace:*",
|
|
50
|
-
"zhi-lib-base": "^0.8.0",
|
|
51
|
-
"file-type": "^16.2.0"
|
|
52
|
-
},
|
|
53
|
-
"publishConfig": {
|
|
54
|
-
"access": "public"
|
|
55
|
-
}
|
|
56
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { IImgInfo, IPicGo } from '../types';
|
|
2
|
-
import { default as ExternalPicgoConfigDb } from '../db/externalPicGo';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
*外部的PicGO 上传 Api
|
|
6
|
-
*
|
|
7
|
-
* @since 0.6.0
|
|
8
|
-
* @version 1.6.0
|
|
9
|
-
* @author terwer
|
|
10
|
-
*/
|
|
11
|
-
declare class ExternalPicgo {
|
|
12
|
-
private logger;
|
|
13
|
-
private requestUrl;
|
|
14
|
-
private readonly endpointUrl;
|
|
15
|
-
db: ExternalPicgoConfigDb;
|
|
16
|
-
constructor(ctx: IPicGo, isDev?: boolean);
|
|
17
|
-
/**
|
|
18
|
-
* 上传图片到PicGO
|
|
19
|
-
*
|
|
20
|
-
* @param input 路径数组,可为空,为空上传剪贴板
|
|
21
|
-
*/
|
|
22
|
-
upload(input?: any[]): Promise<IImgInfo[] | Error>;
|
|
23
|
-
}
|
|
24
|
-
export { ExternalPicgo };
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { IPicGo } from '../types';
|
|
2
|
-
import { EventEmitter } from '../utils/nodePolyfill';
|
|
3
|
-
|
|
4
|
-
export declare class Lifecycle extends EventEmitter {
|
|
5
|
-
private readonly ctx;
|
|
6
|
-
private readonly logger;
|
|
7
|
-
constructor(ctx: IPicGo);
|
|
8
|
-
start(input: any[]): Promise<IPicGo>;
|
|
9
|
-
private beforeTransform;
|
|
10
|
-
private doTransform;
|
|
11
|
-
private beforeUpload;
|
|
12
|
-
private doUpload;
|
|
13
|
-
private afterUpload;
|
|
14
|
-
private handlePlugins;
|
|
15
|
-
}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { PicGoRequestWrapper } from '../lib/PicGoRequest';
|
|
2
|
-
import { PluginHandler } from '../lib/PluginHandler';
|
|
3
|
-
import { IHelper, II18nManager, IImgInfo, IPicGo, IPicGoPlugin, IPicGoPluginInterface, IPluginLoader, IStringKeyMap } from '../types';
|
|
4
|
-
import { EventEmitter } from '../utils/nodePolyfill';
|
|
5
|
-
import { ILogger } from 'zhi-lib-base';
|
|
6
|
-
|
|
7
|
-
declare class UniversalPicGo extends EventEmitter implements IPicGo {
|
|
8
|
-
private _config;
|
|
9
|
-
private lifecycle;
|
|
10
|
-
private db;
|
|
11
|
-
private _pluginLoader;
|
|
12
|
-
configPath: string;
|
|
13
|
-
zhiNpmPath: string;
|
|
14
|
-
baseDir: string;
|
|
15
|
-
pluginBaseDir: string;
|
|
16
|
-
helper: IHelper;
|
|
17
|
-
log: ILogger;
|
|
18
|
-
output: IImgInfo[];
|
|
19
|
-
input: any[];
|
|
20
|
-
pluginHandler: PluginHandler;
|
|
21
|
-
requestWrapper: PicGoRequestWrapper;
|
|
22
|
-
i18n: II18nManager;
|
|
23
|
-
VERSION: string;
|
|
24
|
-
private readonly isDev;
|
|
25
|
-
get pluginLoader(): IPluginLoader;
|
|
26
|
-
getLogger(name?: string): ILogger;
|
|
27
|
-
get request(): PicGoRequestWrapper["PicGoRequest"];
|
|
28
|
-
constructor(configPath?: string, pluginBaseDir?: string, zhiNpmPath?: string, isDev?: boolean);
|
|
29
|
-
/**
|
|
30
|
-
* easily mannually load a plugin
|
|
31
|
-
* if provide plugin name, will register plugin by name
|
|
32
|
-
* or just instantiate a plugin
|
|
33
|
-
*/
|
|
34
|
-
use(plugin: IPicGoPlugin, name?: string): IPicGoPluginInterface;
|
|
35
|
-
getConfig<T>(name?: string, defaultValue?: any): T;
|
|
36
|
-
saveConfig(config: IStringKeyMap<any>): void;
|
|
37
|
-
removeConfig(key: string, propName: string): void;
|
|
38
|
-
setConfig(config: IStringKeyMap<any>): void;
|
|
39
|
-
unsetConfig(key: string, propName: string): void;
|
|
40
|
-
upload(input?: any[]): Promise<IImgInfo[] | Error>;
|
|
41
|
-
private getDefautBaseDir;
|
|
42
|
-
private initConfigPath;
|
|
43
|
-
private initZhiNpmPath;
|
|
44
|
-
private initConfig;
|
|
45
|
-
private init;
|
|
46
|
-
}
|
|
47
|
-
export { UniversalPicGo };
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { IJSON } from 'universal-picgo-store';
|
|
2
|
-
import { IConfig, IPicGo, IPicgoDb } from '../../types';
|
|
3
|
-
|
|
4
|
-
declare class ConfigDb implements IPicgoDb<IConfig> {
|
|
5
|
-
private readonly ctx;
|
|
6
|
-
private readonly db;
|
|
7
|
-
readonly key: string;
|
|
8
|
-
readonly initialValue: {
|
|
9
|
-
picBed: {
|
|
10
|
-
uploader: string;
|
|
11
|
-
current: string;
|
|
12
|
-
};
|
|
13
|
-
picgoPlugins: {};
|
|
14
|
-
};
|
|
15
|
-
constructor(ctx: IPicGo);
|
|
16
|
-
read(flush?: boolean): IJSON;
|
|
17
|
-
get(key: string): any;
|
|
18
|
-
set(key: string, value: any): void;
|
|
19
|
-
has(key: string): boolean;
|
|
20
|
-
unset(key: string, value: any): boolean;
|
|
21
|
-
saveConfig(config: Partial<IConfig>): void;
|
|
22
|
-
removeConfig(config: IConfig): void;
|
|
23
|
-
safeSet(key: string, value: any): void;
|
|
24
|
-
}
|
|
25
|
-
export default ConfigDb;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { PicgoTypeEnum } from '../../utils/enums';
|
|
2
|
-
import { IJSON } from 'universal-picgo-store';
|
|
3
|
-
import { IExternalPicgoConfig, IPicGo, IPicgoDb } from '../../types';
|
|
4
|
-
|
|
5
|
-
declare class ExternalPicgoConfigDb implements IPicgoDb<IExternalPicgoConfig> {
|
|
6
|
-
private readonly ctx;
|
|
7
|
-
private readonly db;
|
|
8
|
-
readonly key: string;
|
|
9
|
-
readonly initialValue: {
|
|
10
|
-
useBundledPicgo: boolean;
|
|
11
|
-
picgoType: PicgoTypeEnum;
|
|
12
|
-
extPicgoApiUrl: string;
|
|
13
|
-
};
|
|
14
|
-
constructor(ctx: IPicGo);
|
|
15
|
-
read(flush?: boolean): IJSON;
|
|
16
|
-
get(key: string): any;
|
|
17
|
-
set(key: string, value: any): void;
|
|
18
|
-
has(key: string): boolean;
|
|
19
|
-
unset(key: string, value: any): boolean;
|
|
20
|
-
saveConfig(config: Partial<IExternalPicgoConfig>): void;
|
|
21
|
-
removeConfig(config: IExternalPicgoConfig): void;
|
|
22
|
-
safeSet(key: string, value: any): void;
|
|
23
|
-
}
|
|
24
|
-
export default ExternalPicgoConfigDb;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { IJSON } from 'universal-picgo-store';
|
|
2
|
-
import { IPicGo, IPicgoDb } from '../../types';
|
|
3
|
-
|
|
4
|
-
declare class PluginLoaderDb implements IPicgoDb<any> {
|
|
5
|
-
private readonly ctx;
|
|
6
|
-
private readonly db;
|
|
7
|
-
readonly key: string;
|
|
8
|
-
readonly initialValue: {
|
|
9
|
-
name: string;
|
|
10
|
-
description: string;
|
|
11
|
-
repository: string;
|
|
12
|
-
license: string;
|
|
13
|
-
};
|
|
14
|
-
constructor(ctx: IPicGo);
|
|
15
|
-
read(flush?: boolean): IJSON;
|
|
16
|
-
get(key: string): any;
|
|
17
|
-
set(key: string, value: any): void;
|
|
18
|
-
has(key: string): boolean;
|
|
19
|
-
unset(key: string, value: any): boolean;
|
|
20
|
-
saveConfig(config: Partial<any>): void;
|
|
21
|
-
removeConfig(config: any): void;
|
|
22
|
-
safeSet(key: string, value: any): void;
|
|
23
|
-
}
|
|
24
|
-
export default PluginLoaderDb;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { IBrowserLocal, IPicGo } from '../types';
|
|
2
|
-
|
|
3
|
-
declare class BrowserI18nDb {
|
|
4
|
-
private readonly ctx;
|
|
5
|
-
private readonly db;
|
|
6
|
-
private readonly hasRead;
|
|
7
|
-
private readonly i18nKey;
|
|
8
|
-
constructor(ctx: IPicGo);
|
|
9
|
-
read(flush?: boolean): IBrowserLocal[];
|
|
10
|
-
unset(): boolean;
|
|
11
|
-
get(key: string): any;
|
|
12
|
-
set(key: string, value: any): void;
|
|
13
|
-
has(key: string): boolean;
|
|
14
|
-
safeSet(key: string, value: any): void;
|
|
15
|
-
}
|
|
16
|
-
export default BrowserI18nDb;
|
package/dist/src/i18n/en.d.ts
DELETED
package/dist/src/i18n/index.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { ILocalesKey } from './zh-CN';
|
|
2
|
-
import { II18nManager, ILocale, IPicGo, IStringKeyMap } from '../types';
|
|
3
|
-
|
|
4
|
-
declare class I18nManager implements II18nManager {
|
|
5
|
-
private readonly i18n;
|
|
6
|
-
private readonly objectAdapter;
|
|
7
|
-
private readonly ctx;
|
|
8
|
-
private readonly browserI18nDb?;
|
|
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
|
-
private getOutterI18nFolder;
|
|
16
|
-
private loadOutterI18n;
|
|
17
|
-
}
|
|
18
|
-
export { I18nManager };
|
package/dist/src/i18n/zh-CN.d.ts
DELETED
|
@@ -1,143 +0,0 @@
|
|
|
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_SMMS_BACKUP_DOMAIN: string;
|
|
11
|
-
PICBED_SMMS_MESSAGE_BACKUP_DOMAIN: string;
|
|
12
|
-
PICBED_ALICLOUD: string;
|
|
13
|
-
PICBED_ALICLOUD_ACCESSKEYID: string;
|
|
14
|
-
PICBED_ALICLOUD_ACCESSKEYSECRET: string;
|
|
15
|
-
PICBED_ALICLOUD_BUCKET: string;
|
|
16
|
-
PICBED_ALICLOUD_AREA: string;
|
|
17
|
-
PICBED_ALICLOUD_PATH: string;
|
|
18
|
-
PICBED_ALICLOUD_CUSTOMURL: string;
|
|
19
|
-
PICBED_ALICLOUD_OPTIONS: string;
|
|
20
|
-
PICBED_ALICLOUD_MESSAGE_AREA: string;
|
|
21
|
-
PICBED_ALICLOUD_MESSAGE_PATH: string;
|
|
22
|
-
PICBED_ALICLOUD_MESSAGE_OPTIONS: string;
|
|
23
|
-
PICBED_ALICLOUD_MESSAGE_CUSTOMURL: string;
|
|
24
|
-
PICBED_TENCENTCLOUD: string;
|
|
25
|
-
PICBED_TENCENTCLOUD_VERSION: string;
|
|
26
|
-
PICBED_TENCENTCLOUD_SECRETID: string;
|
|
27
|
-
PICBED_TENCENTCLOUD_SECRETKEY: string;
|
|
28
|
-
PICBED_TENCENTCLOUD_APPID: string;
|
|
29
|
-
PICBED_TENCENTCLOUD_BUCKET: string;
|
|
30
|
-
PICBED_TENCENTCLOUD_AREA: string;
|
|
31
|
-
PICBED_TENCENTCLOUD_ENDPOINT: string;
|
|
32
|
-
PICBED_TENCENTCLOUD_PATH: string;
|
|
33
|
-
PICBED_TENCENTCLOUD_OPTIONS: string;
|
|
34
|
-
PICBED_TENCENTCLOUD_CUSTOMURL: string;
|
|
35
|
-
PICBED_TENCENTCLOUD_SLIM: string;
|
|
36
|
-
PICBED_TENCENTCLOUD_SLIM_TIP: string;
|
|
37
|
-
PICBED_TENCENTCLOUD_SLIM_CONFIRM: string;
|
|
38
|
-
PICBED_TENCENTCLOUD_SLIM_CANCEL: string;
|
|
39
|
-
PICBED_TENCENTCLOUD_MESSAGE_APPID: string;
|
|
40
|
-
PICBED_TENCENTCLOUD_MESSAGE_AREA: string;
|
|
41
|
-
PICBED_TENCENTCLOUD_MESSAGE_ENDPOINT: string;
|
|
42
|
-
PICBED_TENCENTCLOUD_MESSAGE_PATH: string;
|
|
43
|
-
PICBED_TENCENTCLOUD_MESSAGE_CUSTOMURL: string;
|
|
44
|
-
PICBED_TENCENTCLOUD_MESSAGE_OPTIONS: string;
|
|
45
|
-
PICBED_GITHUB: string;
|
|
46
|
-
PICBED_GITHUB_TOKEN: string;
|
|
47
|
-
PICBED_GITHUB_REPO: string;
|
|
48
|
-
PICBED_GITHUB_PATH: string;
|
|
49
|
-
PICBED_GITHUB_BRANCH: string;
|
|
50
|
-
PICBED_GITHUB_CUSTOMURL: string;
|
|
51
|
-
PICBED_GITHUB_MESSAGE_REPO: string;
|
|
52
|
-
PICBED_GITHUB_MESSAGE_BRANCH: string;
|
|
53
|
-
PICBED_GITHUB_MESSAGE_PATH: string;
|
|
54
|
-
PICBED_GITHUB_MESSAGE_CUSTOMURL: string;
|
|
55
|
-
PICBED_GITLAB: string;
|
|
56
|
-
PICBED_GITLAB_URL: string;
|
|
57
|
-
PICBED_GITLAB_TOKEN: string;
|
|
58
|
-
PICBED_GITLAB_REPO: string;
|
|
59
|
-
PICBED_GITLAB_BRANCH: string;
|
|
60
|
-
PICBED_GITLAB_PATH: string;
|
|
61
|
-
PICBED_GITLAB_AUTHOR_MAIL: string;
|
|
62
|
-
PICBED_GITLAB_AUTHOR_NAME: string;
|
|
63
|
-
PICBED_GITLAB_COMMIT_MESSAGE: string;
|
|
64
|
-
PICBED_GITLAB_MESSAGE_URL: string;
|
|
65
|
-
PICBED_GITLAB_MESSAGE_REPO: string;
|
|
66
|
-
PICBED_GITLAB_MESSAGE_BRANCH: string;
|
|
67
|
-
PICBED_QINIU: string;
|
|
68
|
-
PICBED_QINIU_ACCESSKEY: string;
|
|
69
|
-
PICBED_QINIU_SECRETKEY: string;
|
|
70
|
-
PICBED_QINIU_BUCKET: string;
|
|
71
|
-
PICBED_QINIU_PATH: string;
|
|
72
|
-
PICBED_QINIU_URL: string;
|
|
73
|
-
PICBED_QINIU_OPTIONS: string;
|
|
74
|
-
PICBED_QINIU_AREA: string;
|
|
75
|
-
PICBED_QINIU_MESSAGE_PATH: string;
|
|
76
|
-
PICBED_QINIU_MESSAGE_AREA: string;
|
|
77
|
-
PICBED_QINIU_MESSAGE_OPTIONS: string;
|
|
78
|
-
PICBED_QINIU_MESSAGE_URL: string;
|
|
79
|
-
PICBED_IMGUR: string;
|
|
80
|
-
PICBED_IMGUR_CLIENTID: string;
|
|
81
|
-
PICBED_IMGUR_PROXY: string;
|
|
82
|
-
PICBED_IMGUR_MESSAGE_PROXY: string;
|
|
83
|
-
PICBED_UPYUN: string;
|
|
84
|
-
PICBED_UPYUN_BUCKET: string;
|
|
85
|
-
PICBED_UPYUN_OPERATOR: string;
|
|
86
|
-
PICBED_UPYUN_PASSWORD: string;
|
|
87
|
-
PICBED_UPYUN_PATH: string;
|
|
88
|
-
PICBED_UPYUN_URL: string;
|
|
89
|
-
PICBED_UPYUN_OPTIONS: string;
|
|
90
|
-
PICBED_UPYUN_MESSAGE_OPERATOR: string;
|
|
91
|
-
PICBED_UPYUN_MESSAGE_PASSWORD: string;
|
|
92
|
-
PICBED_UPYUN_MESSAGE_URL: string;
|
|
93
|
-
PICBED_UPYUN_MESSAGE_OPTIONS: string;
|
|
94
|
-
PICBED_UPYUN_MESSAGE_PATH: string;
|
|
95
|
-
PICBED_AWSS3PLIST: string;
|
|
96
|
-
PICBED_AWSS3PLIST_ACCESSKEYID: string;
|
|
97
|
-
PICBED_AWSS3PLIST_SECRET_ACCESSKEY: string;
|
|
98
|
-
PICBED_AWSS3PLIST_BUCKET: string;
|
|
99
|
-
PICBED_AWSS3PLIST_REGION: string;
|
|
100
|
-
PICBED_AWSS3PLIST_UPLOADPATH: string;
|
|
101
|
-
PICBED_AWSS3PLIST_ENDPOINT: string;
|
|
102
|
-
PICBED_AWSS3PLIST_CUSTOM_URL: string;
|
|
103
|
-
PICBED_AWSS3PLIST_PATHSTYLEACCESS: string;
|
|
104
|
-
PICBED_AWSS3PLIST_REJECTUNAUTHORIZED: string;
|
|
105
|
-
PICBED_AWSS3PLIST_ACL: string;
|
|
106
|
-
PICBED_AWSS3PLIST_CORS_PROXY: string;
|
|
107
|
-
PICBED_AWSS3PLIST_MESSAGE_ACCESSKEYID: string;
|
|
108
|
-
PICBED_AWSS3PLIST_MESSAGE_SECRET_ACCESSKEY: string;
|
|
109
|
-
PICBED_AWSS3PLIST_MESSAGE_BUCKET: string;
|
|
110
|
-
PICBED_AWSS3PLIST_MESSAGE_REGION: string;
|
|
111
|
-
PICBED_AWSS3PLIST_MESSAGE_UPLOADPATH: string;
|
|
112
|
-
PICBED_AWSS3PLIST_MESSAGE_ENDPOINT: string;
|
|
113
|
-
PICBED_AWSS3PLIST_MESSAGE_CUSTOM_URL: string;
|
|
114
|
-
PICBED_AWSS3PLIST_MESSAGE_PATHSTYLEACCESS: string;
|
|
115
|
-
PICBED_AWSS3PLIST_MESSAGE_REJECTUNAUTHORIZED: string;
|
|
116
|
-
PICBED_AWSS3PLIST_MESSAGE_ACL: string;
|
|
117
|
-
PICBED_AWSS3PLIST_MESSAGE_CORS_PROXY: string;
|
|
118
|
-
PICBED_LSKY: string;
|
|
119
|
-
PICBED_ISKY_SERVER: string;
|
|
120
|
-
PICBED_ISKY_MESSAGE_SERVER: string;
|
|
121
|
-
PICBED_ISKY_EMAIL: string;
|
|
122
|
-
PICBED_ISKY_MESSAGE_EMAIL: string;
|
|
123
|
-
PICBED_ISKY_PASSWORD: string;
|
|
124
|
-
PICBED_ISKY_MESSAGE_PASSWORD: string;
|
|
125
|
-
PICBED_ISKY_STRATEGYID: string;
|
|
126
|
-
PICBED_ISKY_MESSAGE_STRATEGYID: string;
|
|
127
|
-
PLUGIN_HANDLER_PLUGIN_INSTALL_SUCCESS: string;
|
|
128
|
-
PLUGIN_HANDLER_PLUGIN_INSTALL_FAILED: string;
|
|
129
|
-
PLUGIN_HANDLER_PLUGIN_INSTALL_FAILED_REASON: string;
|
|
130
|
-
PLUGIN_HANDLER_PLUGIN_INSTALL_FAILED_PATH: string;
|
|
131
|
-
PLUGIN_HANDLER_PLUGIN_UNINSTALL_SUCCESS: string;
|
|
132
|
-
PLUGIN_HANDLER_PLUGIN_UNINSTALL_FAILED: string;
|
|
133
|
-
PLUGIN_HANDLER_PLUGIN_UNINSTALL_FAILED_REASON: string;
|
|
134
|
-
PLUGIN_HANDLER_PLUGIN_UNINSTALL_FAILED_VALID: string;
|
|
135
|
-
PLUGIN_HANDLER_PLUGIN_UPDATE_SUCCESS: string;
|
|
136
|
-
PLUGIN_HANDLER_PLUGIN_UPDATE_FAILED: string;
|
|
137
|
-
PLUGIN_HANDLER_PLUGIN_UPDATE_FAILED_REASON: string;
|
|
138
|
-
PLUGIN_HANDLER_PLUGIN_UPDATE_FAILED_VALID: string;
|
|
139
|
-
CORS_ANYWHERE_REQUIRED: string;
|
|
140
|
-
CORS_ANYWHERE_REQUIRED_LOCALHOST: string;
|
|
141
|
-
};
|
|
142
|
-
export type ILocalesKey = keyof typeof ZH_CN;
|
|
143
|
-
export type ILocales = typeof ZH_CN;
|
package/dist/src/i18n/zh-TW.d.ts
DELETED
package/dist/src/index.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { calculateMD5, isFileOrBlob, isSiyuanProxyAvailable } from './utils/common';
|
|
2
|
-
import { IConfig, IExternalPicgoConfig, IImgInfo, IPicBedType, IPicGo, IPicgoDb, IPicGoPlugin, IPluginConfig, IUploaderConfigItem, IUploaderConfigListItem } from './types';
|
|
3
|
-
import { IBusEvent, PicgoTypeEnum } from './utils/enums';
|
|
4
|
-
import { currentWin, hasNodeEnv, parentWin, win } from 'universal-picgo-store';
|
|
5
|
-
import { picgoEventBus } from './utils/picgoEventBus';
|
|
6
|
-
import { default as ExternalPicgoConfigDb } from './db/externalPicGo';
|
|
7
|
-
import { default as PluginLoaderDb } from './db/pluginLoder';
|
|
8
|
-
import { default as ConfigDb } from './db/config';
|
|
9
|
-
import { ExternalPicgo } from './core/ExternalPicgo';
|
|
10
|
-
import { UniversalPicGo } from './core/UniversalPicGo';
|
|
11
|
-
|
|
12
|
-
export { UniversalPicGo, ExternalPicgo, picgoEventBus };
|
|
13
|
-
export { ConfigDb, PluginLoaderDb, ExternalPicgoConfigDb };
|
|
14
|
-
export { PicgoTypeEnum, IBusEvent };
|
|
15
|
-
export { isFileOrBlob, calculateMD5, isSiyuanProxyAvailable };
|
|
16
|
-
export { win, currentWin, parentWin, hasNodeEnv };
|
|
17
|
-
export { type IPicGo, type IImgInfo, type IPicgoDb, type IConfig, type IExternalPicgoConfig, type IPicBedType, type IUploaderConfigItem, type IUploaderConfigListItem, type IPluginConfig, type IPicGoPlugin, };
|
package/dist/src/index.spec.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { ILifecyclePlugins, IPlugin } from '../types';
|
|
2
|
-
|
|
3
|
-
declare class LifecyclePlugins implements ILifecyclePlugins {
|
|
4
|
-
static currentPlugin: string | null;
|
|
5
|
-
private readonly list;
|
|
6
|
-
private readonly pluginIdMap;
|
|
7
|
-
private readonly name;
|
|
8
|
-
constructor(name: string);
|
|
9
|
-
getName(): string;
|
|
10
|
-
get(id: string): IPlugin | undefined;
|
|
11
|
-
getList(): IPlugin[];
|
|
12
|
-
getIdList(): string[];
|
|
13
|
-
register(id: string, plugin: IPlugin): void;
|
|
14
|
-
unregister(pluginName: string): void;
|
|
15
|
-
}
|
|
16
|
-
export declare const setCurrentPluginName: (name?: string | null) => void;
|
|
17
|
-
export declare const getCurrentPluginName: () => string | null;
|
|
18
|
-
export { LifecyclePlugins };
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { IPicGo, IResponse } from '../types';
|
|
2
|
-
import { AxiosRequestConfig } from 'axios';
|
|
3
|
-
|
|
4
|
-
declare class PicGoRequestWrapper {
|
|
5
|
-
private readonly ctx;
|
|
6
|
-
private readonly logger;
|
|
7
|
-
private proxy;
|
|
8
|
-
private siyuanProxy;
|
|
9
|
-
private options;
|
|
10
|
-
constructor(ctx: IPicGo);
|
|
11
|
-
private init;
|
|
12
|
-
private handleProxy;
|
|
13
|
-
/**
|
|
14
|
-
* PicGo 统一请求封装,基于 axios
|
|
15
|
-
*
|
|
16
|
-
* @param userOptions
|
|
17
|
-
* @constructor
|
|
18
|
-
*/
|
|
19
|
-
PicGoRequest<T, U extends AxiosRequestConfig>(userOptions: U): Promise<IResponse<T, U>>;
|
|
20
|
-
}
|
|
21
|
-
export { PicGoRequestWrapper };
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { IPicGo, IPluginHandler, IPluginHandlerOptions, IPluginHandlerResult, IProcessEnv } from '../types';
|
|
2
|
-
|
|
3
|
-
export declare class PluginHandler implements IPluginHandler {
|
|
4
|
-
private readonly ctx;
|
|
5
|
-
constructor(ctx: IPicGo);
|
|
6
|
-
install(plugins: string[], options: IPluginHandlerOptions, env: IProcessEnv | undefined): Promise<IPluginHandlerResult<boolean>>;
|
|
7
|
-
uninstall(plugins: string[]): Promise<IPluginHandlerResult<boolean>>;
|
|
8
|
-
update(plugins: string[], options: IPluginHandlerOptions, env: IProcessEnv | undefined): Promise<IPluginHandlerResult<boolean>>;
|
|
9
|
-
/**
|
|
10
|
-
* 执行 NPM 命令
|
|
11
|
-
*
|
|
12
|
-
* @param subCommand - 要执行的 NPM 命令
|
|
13
|
-
* @param modules - 模块数组
|
|
14
|
-
* @param cwd 当前路径
|
|
15
|
-
* @param options
|
|
16
|
-
* @param env 环境变量
|
|
17
|
-
* @returns 执行结果的 Promise
|
|
18
|
-
*/
|
|
19
|
-
private execCommand;
|
|
20
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { IPicGo, IPicGoPlugin, IPicGoPluginInterface, IPluginLoader } from '../types';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Local plugin loader, file system is required
|
|
5
|
-
*/
|
|
6
|
-
export declare class PluginLoader implements IPluginLoader {
|
|
7
|
-
private readonly ctx;
|
|
8
|
-
private readonly logger;
|
|
9
|
-
private db;
|
|
10
|
-
private list;
|
|
11
|
-
private readonly fullList;
|
|
12
|
-
private readonly pluginMap;
|
|
13
|
-
constructor(ctx: IPicGo);
|
|
14
|
-
load(): boolean;
|
|
15
|
-
registerPlugin(name: string, plugin?: IPicGoPlugin): void;
|
|
16
|
-
unregisterPlugin(name: string): void;
|
|
17
|
-
getPlugin(name: string): IPicGoPluginInterface | undefined;
|
|
18
|
-
/**
|
|
19
|
-
* Get the list of enabled plugins
|
|
20
|
-
*/
|
|
21
|
-
getList(): string[];
|
|
22
|
-
hasPlugin(name: string): boolean;
|
|
23
|
-
/**
|
|
24
|
-
* Get the full list of plugins, whether it is enabled or not
|
|
25
|
-
*/
|
|
26
|
-
getFullList(): string[];
|
|
27
|
-
private init;
|
|
28
|
-
private resolvePlugin;
|
|
29
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Mac } from './digest';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* 上传策略
|
|
5
|
-
* @link https://developer.qiniu.com/kodo/manual/1206/put-policy
|
|
6
|
-
*/
|
|
7
|
-
declare class PutPolicy {
|
|
8
|
-
private readonly expires;
|
|
9
|
-
constructor(options: any);
|
|
10
|
-
getFlags(): any;
|
|
11
|
-
uploadToken(mac: Mac): string;
|
|
12
|
-
}
|
|
13
|
-
export { PutPolicy };
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
declare const util: {
|
|
2
|
-
urlsafeBase64Encode: (jsonFlags: string) => string;
|
|
3
|
-
urlSafeBase64Decode: (fromStr: string) => string;
|
|
4
|
-
base64ToUrlSafe: (v: string) => string;
|
|
5
|
-
urlSafeToBase64: (v: string) => string;
|
|
6
|
-
hmacSha1: (encodedFlags: string, secretKey: string) => string;
|
|
7
|
-
};
|
|
8
|
-
export { util };
|