piclist 1.8.12 → 1.9.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/.prettierrc +1 -2
- package/CHANGELOG.md +29 -0
- package/README.md +9 -0
- package/dist/core/Lifecycle.d.ts +3 -7
- package/dist/i18n/zh-CN.d.ts +34 -0
- package/dist/index.cjs.js +2 -2
- package/dist/index.esm.js +2 -2
- package/dist/lib/LifecyclePlugins.d.ts +10 -1
- package/dist/plugins/commander/utils.d.ts +2 -0
- package/dist/plugins/transformer/index.d.ts +4 -2
- package/dist/plugins/uploader/advancedplist.d.ts +2 -0
- package/dist/plugins/uploader/alist.d.ts +2 -0
- package/dist/plugins/uploader/index.d.ts +4 -2
- package/dist/plugins/uploader/s3/uploader.d.ts +2 -5
- package/dist/plugins/uploader/utils.d.ts +18 -0
- package/dist/types/index.d.ts +20 -0
- package/package.json +3 -3
- package/rollup.config.js +1 -0
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
import { IPlugin, ILifecyclePlugins } from '../types';
|
|
2
2
|
export declare class LifecyclePlugins implements ILifecyclePlugins {
|
|
3
3
|
static currentPlugin: string | null;
|
|
4
|
+
/**
|
|
5
|
+
* The name of the plugin
|
|
6
|
+
*/
|
|
7
|
+
private readonly name;
|
|
8
|
+
/**
|
|
9
|
+
* The list of plugins
|
|
10
|
+
*/
|
|
4
11
|
private readonly list;
|
|
12
|
+
/**
|
|
13
|
+
* The map of plugin id
|
|
14
|
+
*/
|
|
5
15
|
private readonly pluginIdMap;
|
|
6
|
-
private readonly name;
|
|
7
16
|
constructor(name: string);
|
|
8
17
|
register(id: string, plugin: IPlugin): void;
|
|
9
18
|
unregister(pluginName: string): void;
|
|
@@ -1,27 +1,24 @@
|
|
|
1
|
+
import { S3Client } from '@aws-sdk/client-s3';
|
|
1
2
|
import { IAwsS3PListUserConfig, IImgInfo } from '../../../types';
|
|
2
3
|
export interface IUploadResult {
|
|
3
|
-
index: number;
|
|
4
4
|
key: string;
|
|
5
5
|
url: string;
|
|
6
6
|
imgURL: string;
|
|
7
7
|
versionId?: string;
|
|
8
8
|
eTag?: string;
|
|
9
9
|
}
|
|
10
|
-
declare function createS3Client(opts: IAwsS3PListUserConfig):
|
|
10
|
+
declare function createS3Client(opts: IAwsS3PListUserConfig): S3Client;
|
|
11
11
|
interface ICreateUploadTaskOpts {
|
|
12
12
|
client: any;
|
|
13
13
|
bucketName: string;
|
|
14
14
|
path: string;
|
|
15
15
|
item: IImgInfo;
|
|
16
|
-
index: number;
|
|
17
16
|
acl: string;
|
|
18
17
|
urlPrefix?: string;
|
|
19
18
|
}
|
|
20
19
|
declare function createUploadTask(opts: ICreateUploadTaskOpts): Promise<IUploadResult>;
|
|
21
|
-
declare function getFileURL(opts: ICreateUploadTaskOpts, eTag: string, versionId: string): Promise<string>;
|
|
22
20
|
declare const _default: {
|
|
23
21
|
createS3Client: typeof createS3Client;
|
|
24
22
|
createUploadTask: typeof createUploadTask;
|
|
25
|
-
getFileURL: typeof getFileURL;
|
|
26
23
|
};
|
|
27
24
|
export default _default;
|
|
@@ -5,3 +5,21 @@ export declare function formatPathHelper({ path, startSlash, endSlash, rootToEmp
|
|
|
5
5
|
rootToEmpty?: boolean;
|
|
6
6
|
}): string;
|
|
7
7
|
export declare function encodePath(path: string): string;
|
|
8
|
+
export declare const buildInUploaderNames: {
|
|
9
|
+
advancedplist: string;
|
|
10
|
+
alistplist: string;
|
|
11
|
+
aliyun: string;
|
|
12
|
+
'aws-s3-plist': string;
|
|
13
|
+
github: string;
|
|
14
|
+
imgur: string;
|
|
15
|
+
local: string;
|
|
16
|
+
lskyplist: string;
|
|
17
|
+
piclist: string;
|
|
18
|
+
qiniu: string;
|
|
19
|
+
sftpplist: string;
|
|
20
|
+
smms: string;
|
|
21
|
+
tcyun: string;
|
|
22
|
+
telegraphplist: string;
|
|
23
|
+
upyun: string;
|
|
24
|
+
webdavplist: string;
|
|
25
|
+
};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -248,6 +248,26 @@ export interface ISmmsConfig {
|
|
|
248
248
|
token: string;
|
|
249
249
|
backupDomain?: string;
|
|
250
250
|
}
|
|
251
|
+
/** 内置高级自定义图床 */
|
|
252
|
+
export interface IAdvancedPlistConfig {
|
|
253
|
+
endpoint: string;
|
|
254
|
+
method?: string;
|
|
255
|
+
formDataKey?: string;
|
|
256
|
+
headers?: string;
|
|
257
|
+
body?: string;
|
|
258
|
+
resDataPath?: string;
|
|
259
|
+
customPrefix?: string;
|
|
260
|
+
}
|
|
261
|
+
/** 内置alist 图床配置项 */
|
|
262
|
+
export interface IAlistConfig {
|
|
263
|
+
url: string;
|
|
264
|
+
token?: string;
|
|
265
|
+
username?: string;
|
|
266
|
+
password?: string;
|
|
267
|
+
uploadPath?: string;
|
|
268
|
+
webPath?: string;
|
|
269
|
+
customUrl?: string;
|
|
270
|
+
}
|
|
251
271
|
/** 本地图床配置项 */
|
|
252
272
|
export interface ILocalConfig {
|
|
253
273
|
path: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "piclist",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.9.1",
|
|
4
4
|
"description": "Modified PicGo core, A tool for picture uploading",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Kuingsmile",
|
|
@@ -26,11 +26,11 @@
|
|
|
26
26
|
"server": "node ./bin/picgo-server",
|
|
27
27
|
"lint": "eslint src/**/*.ts",
|
|
28
28
|
"lint:fix": "eslint src/**/*.ts --fix",
|
|
29
|
-
"
|
|
29
|
+
"lint:dpdm": "dpdm -T --tsconfig ./tsconfig.json --no-tree --no-warning --exit-code circular:1 src/index.ts",
|
|
30
30
|
"dev": "cross-env NODE_ENV=development rollup -c rollup.config.js -w",
|
|
31
|
+
"build": "cross-env NODE_ENV=production rimraf ./dist && rollup -c rollup.config.js",
|
|
31
32
|
"cz": "git-cz",
|
|
32
33
|
"release": "bump-version",
|
|
33
|
-
"lint:dpdm": "dpdm -T --tsconfig ./tsconfig.json --no-tree --no-warning --exit-code circular:1 src/index.ts",
|
|
34
34
|
"publish:npm": "cross-env NODE_ENV=production rimraf ./dist && rollup -c rollup.config.js && npm publish"
|
|
35
35
|
},
|
|
36
36
|
"keywords": [
|
package/rollup.config.js
CHANGED
|
@@ -7,6 +7,7 @@ import { string } from 'rollup-plugin-string'
|
|
|
7
7
|
import json from '@rollup/plugin-json'
|
|
8
8
|
import builtins from 'builtins'
|
|
9
9
|
import replace from '@rollup/plugin-replace'
|
|
10
|
+
|
|
10
11
|
const version = process.env.VERSION || pkg.version
|
|
11
12
|
const sourcemap = 'inline'
|
|
12
13
|
const banner = `/*
|