piclist 1.7.6 → 1.7.7
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/dist/i18n/zh-CN.d.ts +27 -0
- package/dist/index.cjs.js +2 -2
- package/dist/index.esm.js +2 -2
- package/dist/plugins/uploader/awss3plist.d.ts +2 -0
- package/dist/plugins/uploader/s3/uploader.d.ts +28 -0
- package/dist/plugins/uploader/s3/utils.d.ts +10 -0
- package/dist/types/index.d.ts +17 -0
- package/package.json +9 -1
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { S3Client } from "@aws-sdk/client-s3";
|
|
2
|
+
import { IAwsS3PListUserConfig, IImgInfo } from "../../../types";
|
|
3
|
+
export interface IUploadResult {
|
|
4
|
+
index: number;
|
|
5
|
+
key: string;
|
|
6
|
+
url: string;
|
|
7
|
+
imgURL: string;
|
|
8
|
+
versionId?: string;
|
|
9
|
+
eTag?: string;
|
|
10
|
+
}
|
|
11
|
+
declare function createS3Client(opts: IAwsS3PListUserConfig): S3Client;
|
|
12
|
+
interface createUploadTaskOpts {
|
|
13
|
+
client: S3Client;
|
|
14
|
+
bucketName: string;
|
|
15
|
+
path: string;
|
|
16
|
+
item: IImgInfo;
|
|
17
|
+
index: number;
|
|
18
|
+
acl: string;
|
|
19
|
+
urlPrefix?: string;
|
|
20
|
+
}
|
|
21
|
+
declare function createUploadTask(opts: createUploadTaskOpts): Promise<IUploadResult>;
|
|
22
|
+
declare function getFileURL(opts: createUploadTaskOpts, eTag: string, versionId: string): Promise<string>;
|
|
23
|
+
declare const _default: {
|
|
24
|
+
createS3Client: typeof createS3Client;
|
|
25
|
+
createUploadTask: typeof createUploadTask;
|
|
26
|
+
getFileURL: typeof getFileURL;
|
|
27
|
+
};
|
|
28
|
+
export default _default;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { HttpsProxyAgent, HttpProxyAgent } from "hpagent";
|
|
3
|
+
import { IImgInfo } from "../../../types";
|
|
4
|
+
export declare function formatPath(info: IImgInfo, format?: string): string;
|
|
5
|
+
export declare function extractInfo(info: IImgInfo): Promise<{
|
|
6
|
+
body?: Buffer;
|
|
7
|
+
contentType?: string;
|
|
8
|
+
contentEncoding?: string;
|
|
9
|
+
}>;
|
|
10
|
+
export declare function getProxyAgent(proxy: string | undefined, sslEnabled: boolean, rejectUnauthorized: boolean): HttpProxyAgent | HttpsProxyAgent | undefined;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -287,6 +287,8 @@ export interface IUpyunConfig {
|
|
|
287
287
|
antiLeechToken: string;
|
|
288
288
|
/** 防盗链过期时间,单位为秒 */
|
|
289
289
|
expireTime: number;
|
|
290
|
+
/** 自定义API接入点 */
|
|
291
|
+
endpoint: string;
|
|
290
292
|
}
|
|
291
293
|
/** 腾讯云图床配置项 */
|
|
292
294
|
export interface ITcyunConfig {
|
|
@@ -404,6 +406,21 @@ export interface ILskyConfig {
|
|
|
404
406
|
albumId: string;
|
|
405
407
|
permission: IStringKeyMap<string>;
|
|
406
408
|
}
|
|
409
|
+
/** 内置aws s3 图床配置项 */
|
|
410
|
+
export interface IAwsS3PListUserConfig {
|
|
411
|
+
accessKeyID: string;
|
|
412
|
+
secretAccessKey: string;
|
|
413
|
+
bucketName: string;
|
|
414
|
+
uploadPath: string;
|
|
415
|
+
region?: string;
|
|
416
|
+
endpoint?: string;
|
|
417
|
+
proxy?: string;
|
|
418
|
+
urlPrefix?: string;
|
|
419
|
+
pathStyleAccess?: boolean;
|
|
420
|
+
rejectUnauthorized?: boolean;
|
|
421
|
+
acl?: string;
|
|
422
|
+
disableBucketPrefixToURL?: boolean;
|
|
423
|
+
}
|
|
407
424
|
/** PicGo 配置文件类型定义 */
|
|
408
425
|
export interface IConfig {
|
|
409
426
|
picBed: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "piclist",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.7",
|
|
4
4
|
"description": "Modified PicGo core, A tool for picture uploading",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Kuingsmile",
|
|
@@ -68,6 +68,7 @@
|
|
|
68
68
|
"@types/inquirer": "^0.0.42",
|
|
69
69
|
"@types/js-yaml": "^4.0.9",
|
|
70
70
|
"@types/lodash": "^4.14.201",
|
|
71
|
+
"@types/mime": "^3.0.4",
|
|
71
72
|
"@types/mime-types": "^2.1.3",
|
|
72
73
|
"@types/minimatch": "^3.0.3",
|
|
73
74
|
"@types/node": "16.11.7",
|
|
@@ -101,8 +102,12 @@
|
|
|
101
102
|
"typescript": "^4.9.5"
|
|
102
103
|
},
|
|
103
104
|
"dependencies": {
|
|
105
|
+
"@aws-sdk/client-s3": "3.421.0",
|
|
106
|
+
"@aws-sdk/lib-storage": "3.421.0",
|
|
107
|
+
"@aws-sdk/s3-request-presigner": "3.421.0",
|
|
104
108
|
"@picgo/i18n": "^1.0.0",
|
|
105
109
|
"@picgo/store": "^2.1.0",
|
|
110
|
+
"@smithy/node-http-handler": "2.1.6",
|
|
106
111
|
"axios": "^1.6.2",
|
|
107
112
|
"chalk": "^2.4.1",
|
|
108
113
|
"commander": "^8.1.0",
|
|
@@ -110,15 +115,18 @@
|
|
|
110
115
|
"dayjs": "^1.11.10",
|
|
111
116
|
"download-git-repo": "^3.0.2",
|
|
112
117
|
"ejs": "^2.6.1",
|
|
118
|
+
"file-type": "16.2.0",
|
|
113
119
|
"form-data": "^4.0.0",
|
|
114
120
|
"fs-extra": "^11.2.0",
|
|
115
121
|
"globby": "^11.1.0",
|
|
116
122
|
"heic-convert": "^1.2.4",
|
|
123
|
+
"hpagent": "1.2.0",
|
|
117
124
|
"image-size": "^1.0.2",
|
|
118
125
|
"inquirer": "^6.0.0",
|
|
119
126
|
"is-wsl": "^2.2.0",
|
|
120
127
|
"js-yaml": "^4.1.0",
|
|
121
128
|
"lodash": "^4.17.21",
|
|
129
|
+
"mime": "2.5.2",
|
|
122
130
|
"mime-types": "2.1.35",
|
|
123
131
|
"minimatch": "^3.0.4",
|
|
124
132
|
"minimist": "^1.2.8",
|