piclist 2.4.1 → 2.4.2
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/AGENTS.md +36 -0
- package/dist/core/Lifecycle.d.ts +1 -0
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/utils/common/compress.d.ts +6 -0
- package/dist/utils/common/config.d.ts +6 -0
- package/dist/utils/common/hash.d.ts +4 -0
- package/dist/utils/common/imageFile.d.ts +5 -0
- package/dist/utils/common/plugin.d.ts +9 -0
- package/dist/utils/common/processingOptions.d.ts +3 -0
- package/dist/utils/common/rename.d.ts +5 -0
- package/dist/utils/common/url.d.ts +3 -0
- package/dist/utils/common/watermark.d.ts +4 -0
- package/dist/utils/common.d.ts +9 -46
- package/package.json +24 -23
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { IBuildInCompressOptions, IBuildInWaterMarkOptions, ILogger } from '../../types';
|
|
2
|
+
export declare function imageCompress(img: Buffer, options: IBuildInCompressOptions, rawFormat: string, logger: ILogger): Promise<Buffer>;
|
|
3
|
+
export declare function getConvertedFormat(options: IBuildInCompressOptions | undefined, rawFormat: string): string;
|
|
4
|
+
export declare const isNeedAddWatermark: (watermarkOptions: IBuildInWaterMarkOptions | undefined, fileExt: string) => boolean;
|
|
5
|
+
export declare const isNeedCompress: (compressOptions: IBuildInCompressOptions | undefined, fileExt: string) => boolean;
|
|
6
|
+
export declare const removeExif: (img: Buffer, fileExt: string) => Promise<Buffer>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const configBlackList: string[];
|
|
2
|
+
export declare const isConfigKeyInBlackList: (key: string) => boolean;
|
|
3
|
+
export declare const isInputConfigValid: (config: any) => boolean;
|
|
4
|
+
export declare function safeParse<T>(str: string): T | string;
|
|
5
|
+
export declare const forceNumber: (num?: string | number) => number;
|
|
6
|
+
export declare const isDev: () => boolean;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { IImgSize, IPathTransformedImgInfo, IPicGo } from '../../types';
|
|
2
|
+
export declare const getImageSize: (file: Buffer) => IImgSize;
|
|
3
|
+
export declare const getFSFile: (filePath: string) => Promise<IPathTransformedImgInfo>;
|
|
4
|
+
export declare function getImageTypeByMagicNumber(buffer: Buffer | Uint8Array): string;
|
|
5
|
+
export declare const getURLFile: (url: string, ctx: IPicGo) => Promise<IPathTransformedImgInfo>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ILogger, IPluginNameType } from '../../types';
|
|
2
|
+
export declare const getPluginNameType: (name: string) => IPluginNameType;
|
|
3
|
+
export declare const isSimpleName: (nameOrPath: string) => boolean;
|
|
4
|
+
export declare const handleStreamlinePluginName: (name: string) => string;
|
|
5
|
+
export declare const handleCompletePluginName: (name: string, scope?: string) => string;
|
|
6
|
+
export declare const getProcessPluginName: (nameOrPath: string, logger?: ILogger | Console) => string;
|
|
7
|
+
export declare const getNormalPluginName: (nameOrPath: string, logger?: ILogger | Console) => string;
|
|
8
|
+
export declare const handleUnixStylePath: (pathStr: string) => string;
|
|
9
|
+
export declare const removePluginVersion: (nameOrPath: string, scope?: boolean) => string;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { IBuildInCompressOptions, IBuildInCompressOptionsTreated, IBuildInWaterMarkOptions, IBuildInWaterMarkOptionsTreated } from '../../types';
|
|
2
|
+
export declare function getTreatedWaterMarkOptions(global: IBuildInWaterMarkOptions | undefined, idSpecificConfig: Partial<IBuildInWaterMarkOptions>, picBed: string, id: string): IBuildInWaterMarkOptionsTreated;
|
|
3
|
+
export declare function getTreatedCompressOptions(global: IBuildInCompressOptions | undefined, idSpecificConfig: Partial<IBuildInCompressOptions>, picBed: string, id: string): IBuildInCompressOptionsTreated;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { BinaryLike } from 'node:crypto';
|
|
2
|
+
export declare function randomStringGenerator(length: number): string;
|
|
3
|
+
export declare function renameFileNameWithTimestamp(oldName: string): string;
|
|
4
|
+
export declare function renameFileNameWithRandomString(oldName: string, length?: number): string;
|
|
5
|
+
export declare function renameFileNameWithCustomString(oldName: string, customFormat: string, affixFileName?: string, fileBuffer?: BinaryLike): string;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import sharp from 'sharp';
|
|
2
|
+
import type { IBuildInWaterMarkOptions, ILogger } from '../../types';
|
|
3
|
+
export declare function AddWatermark(img: Buffer, watermarkType: 'text' | 'image', defaultWatermarkFontPath: string, isFullScreenWatermark?: boolean, watermarkDegree?: number, text?: string, watermarkFontPath?: string, watermarkScaleRatio?: number, watermarkColor?: string, watermarkImagePath?: string, position?: sharp.Gravity, watermarkImageOpacity?: number): Promise<Buffer>;
|
|
4
|
+
export declare function imageAddWaterMark(img: Buffer, options: IBuildInWaterMarkOptions, defaultWatermarkFontPath: string, logger: ILogger): Promise<Buffer>;
|
package/dist/utils/common.d.ts
CHANGED
|
@@ -1,46 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
export declare const isUrlEncode: (url: string) => boolean;
|
|
11
|
-
export declare const handleUrlEncode: (url: string) => string;
|
|
12
|
-
export declare const getImageSize: (file: Buffer) => IImgSize;
|
|
13
|
-
export declare const getFSFile: (filePath: string) => Promise<IPathTransformedImgInfo>;
|
|
14
|
-
export declare function getImageTypeByMagicNumber(buffer: Buffer | Uint8Array): string;
|
|
15
|
-
export declare const getURLFile: (url: string, ctx: IPicGo) => Promise<IPathTransformedImgInfo>;
|
|
16
|
-
export declare const getPluginNameType: (name: string) => IPluginNameType;
|
|
17
|
-
export declare const isSimpleName: (nameOrPath: string) => boolean;
|
|
18
|
-
export declare const handleStreamlinePluginName: (name: string) => string;
|
|
19
|
-
export declare const handleCompletePluginName: (name: string, scope?: string) => string;
|
|
20
|
-
export declare const getProcessPluginName: (nameOrPath: string, logger?: ILogger | Console) => string;
|
|
21
|
-
export declare const getNormalPluginName: (nameOrPath: string, logger?: ILogger | Console) => string;
|
|
22
|
-
export declare const handleUnixStylePath: (pathStr: string) => string;
|
|
23
|
-
export declare const removePluginVersion: (nameOrPath: string, scope?: boolean) => string;
|
|
24
|
-
/**
|
|
25
|
-
* the config black item list which won't be setted
|
|
26
|
-
* only can be got
|
|
27
|
-
*/
|
|
28
|
-
export declare const configBlackList: never[];
|
|
29
|
-
/**
|
|
30
|
-
* check some config key is in blackList
|
|
31
|
-
* @param key
|
|
32
|
-
*/
|
|
33
|
-
export declare const isConfigKeyInBlackList: (key: string) => boolean;
|
|
34
|
-
export declare const isInputConfigValid: (config: any) => boolean;
|
|
35
|
-
export declare function safeParse<T>(str: string): T | string;
|
|
36
|
-
export declare const forceNumber: (num?: string | number) => number;
|
|
37
|
-
export declare const isDev: () => boolean;
|
|
38
|
-
export declare function AddWatermark(img: Buffer, watermarkType: 'text' | 'image', defaultWatermarkFontPath: string, isFullScreenWatermark?: boolean, watermarkDegree?: number, text?: string, watermarkFontPath?: string, watermarkScaleRatio?: number, watermarkColor?: string, watermarkImagePath?: string, position?: sharp.Gravity, watermarkImageOpacity?: number): Promise<Buffer>;
|
|
39
|
-
export declare function getTreatedWaterMarkOptions(global: IBuildInWaterMarkOptions | undefined, idSpecificConfig: Partial<IBuildInWaterMarkOptions>, picBed: string, id: string): IBuildInWaterMarkOptionsTreated;
|
|
40
|
-
export declare function getTreatedCompressOptions(global: IBuildInCompressOptions | undefined, idSpecificConfig: Partial<IBuildInCompressOptions>, picBed: string, id: string): IBuildInCompressOptionsTreated;
|
|
41
|
-
export declare function imageAddWaterMark(img: Buffer, options: IBuildInWaterMarkOptions, defaultWatermarkFontPath: string, logger: ILogger): Promise<Buffer>;
|
|
42
|
-
export declare function imageCompress(img: Buffer, options: IBuildInCompressOptions, rawFormat: string, logger: ILogger): Promise<Buffer>;
|
|
43
|
-
export declare function getConvertedFormat(options: IBuildInCompressOptions | undefined, rawFormat: string): string;
|
|
44
|
-
export declare const isNeedAddWatermark: (watermarkOptions: IBuildInWaterMarkOptions | undefined, fileExt: string) => boolean;
|
|
45
|
-
export declare const isNeedCompress: (compressOptions: IBuildInCompressOptions | undefined, fileExt: string) => boolean;
|
|
46
|
-
export declare const removeExif: (img: Buffer, fileExt: string) => Promise<Buffer>;
|
|
1
|
+
export { getConvertedFormat, imageCompress, isNeedAddWatermark, isNeedCompress, removeExif } from './common/compress';
|
|
2
|
+
export { configBlackList, forceNumber, isConfigKeyInBlackList, isDev, isInputConfigValid, safeParse, } from './common/config';
|
|
3
|
+
export { getMd5 } from './common/hash';
|
|
4
|
+
export { getFSFile, getImageSize, getImageTypeByMagicNumber, getURLFile } from './common/imageFile';
|
|
5
|
+
export { getNormalPluginName, getPluginNameType, getProcessPluginName, handleCompletePluginName, handleStreamlinePluginName, handleUnixStylePath, isSimpleName, removePluginVersion, } from './common/plugin';
|
|
6
|
+
export { getTreatedCompressOptions, getTreatedWaterMarkOptions } from './common/processingOptions';
|
|
7
|
+
export { randomStringGenerator, renameFileNameWithCustomString, renameFileNameWithRandomString, renameFileNameWithTimestamp, } from './common/rename';
|
|
8
|
+
export { handleUrlEncode, isUrl, isUrlEncode } from './common/url';
|
|
9
|
+
export { AddWatermark, imageAddWaterMark } from './common/watermark';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "piclist",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.2",
|
|
4
4
|
"description": "Modified PicGo core, A tool for picture uploading",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"picture",
|
|
@@ -61,27 +61,27 @@
|
|
|
61
61
|
"baseline-browser-mapping": "^2.9.13"
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"@aws-sdk/client-s3": "3.
|
|
65
|
-
"@aws-sdk/lib-storage": "3.
|
|
66
|
-
"@aws-sdk/s3-request-presigner": "3.
|
|
67
|
-
"@inquirer/prompts": "^8.
|
|
64
|
+
"@aws-sdk/client-s3": "3.1063.0",
|
|
65
|
+
"@aws-sdk/lib-storage": "3.1063.0",
|
|
66
|
+
"@aws-sdk/s3-request-presigner": "3.1063.0",
|
|
67
|
+
"@inquirer/prompts": "^8.5.2",
|
|
68
68
|
"@piclist/i18n": "^2.0.0",
|
|
69
69
|
"@piclist/store": "^3.0.1",
|
|
70
|
-
"@smithy/node-http-handler": "4.
|
|
71
|
-
"axios": "^1.
|
|
70
|
+
"@smithy/node-http-handler": "4.7.7",
|
|
71
|
+
"axios": "^1.17.0",
|
|
72
72
|
"chalk": "^5.6.2",
|
|
73
|
-
"commander": "^
|
|
73
|
+
"commander": "^15.0.0",
|
|
74
74
|
"cross-spawn": "^7.0.6",
|
|
75
|
-
"dayjs": "^1.11.
|
|
75
|
+
"dayjs": "^1.11.21",
|
|
76
76
|
"dotenv": "^17.4.2",
|
|
77
77
|
"file-type": "22.0.1",
|
|
78
78
|
"form-data": "^4.0.5",
|
|
79
|
-
"fs-extra": "^11.3.
|
|
79
|
+
"fs-extra": "^11.3.5",
|
|
80
80
|
"heic-convert": "^2.1.0",
|
|
81
81
|
"hpagent": "1.2.0",
|
|
82
82
|
"image-size": "^2.0.2",
|
|
83
83
|
"is-wsl": "^3.1.0",
|
|
84
|
-
"js-yaml": "^4.
|
|
84
|
+
"js-yaml": "^4.2.0",
|
|
85
85
|
"lodash-es": "^4.18.1",
|
|
86
86
|
"mime": "4.1.0",
|
|
87
87
|
"minimist": "^1.2.8",
|
|
@@ -92,12 +92,13 @@
|
|
|
92
92
|
"sharp": "0.34.4",
|
|
93
93
|
"text-to-svg": "^3.1.5",
|
|
94
94
|
"tunnel": "^0.0.6",
|
|
95
|
+
"ulid": "^3.0.2",
|
|
95
96
|
"uuid": "^14.0.0",
|
|
96
97
|
"webdav": "^5.10.0"
|
|
97
98
|
},
|
|
98
99
|
"devDependencies": {
|
|
99
100
|
"@eslint/js": "^10.0.1",
|
|
100
|
-
"@rollup/plugin-commonjs": "^29.0.
|
|
101
|
+
"@rollup/plugin-commonjs": "^29.0.3",
|
|
101
102
|
"@rollup/plugin-json": "^6.1.0",
|
|
102
103
|
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
103
104
|
"@rollup/plugin-replace": "^6.0.3",
|
|
@@ -105,36 +106,36 @@
|
|
|
105
106
|
"@rollup/plugin-typescript": "^12.3.0",
|
|
106
107
|
"@types/cross-spawn": "^6.0.6",
|
|
107
108
|
"@types/fs-extra": "^11.0.4",
|
|
108
|
-
"@types/heic-convert": "^2.1.
|
|
109
|
+
"@types/heic-convert": "^2.1.1",
|
|
109
110
|
"@types/js-yaml": "^4.0.9",
|
|
110
111
|
"@types/lodash-es": "^4.17.12",
|
|
111
|
-
"@types/node": "25.
|
|
112
|
+
"@types/node": "25.9.2",
|
|
112
113
|
"@types/resolve": "^1.20.6",
|
|
113
114
|
"@types/text-to-svg": "^3.1.4",
|
|
114
115
|
"@types/tunnel": "^0.0.7",
|
|
115
116
|
"@vitest/coverage-v8": "^4.1.0",
|
|
116
117
|
"cross-env": "^10.1.0",
|
|
117
|
-
"dpdm": "^4.0
|
|
118
|
-
"eslint": "^10.
|
|
118
|
+
"dpdm": "^4.2.0",
|
|
119
|
+
"eslint": "^10.4.1",
|
|
119
120
|
"eslint-config-prettier": "^10.1.8",
|
|
120
|
-
"eslint-plugin-jsonc": "^3.
|
|
121
|
-
"eslint-plugin-prettier": "^5.5.
|
|
121
|
+
"eslint-plugin-jsonc": "^3.2.0",
|
|
122
|
+
"eslint-plugin-prettier": "^5.5.6",
|
|
122
123
|
"eslint-plugin-simple-import-sort": "^13.0.0",
|
|
123
124
|
"eslint-plugin-unicorn": "^64.0.0",
|
|
124
125
|
"husky": "^9.1.7",
|
|
125
126
|
"jsonc-eslint-parser": "^3.1.0",
|
|
126
127
|
"node-bump-version": "^2.0.0",
|
|
127
|
-
"prettier": "^3.8.
|
|
128
|
+
"prettier": "^3.8.3",
|
|
128
129
|
"rimraf": "^6.1.3",
|
|
129
|
-
"rollup": "^4.
|
|
130
|
+
"rollup": "^4.61.1",
|
|
130
131
|
"rollup-plugin-copy": "^3.5.0",
|
|
131
132
|
"rollup-plugin-string": "^3.0.0",
|
|
132
133
|
"typescript": "^6.0.3",
|
|
133
|
-
"typescript-eslint": "^8.
|
|
134
|
-
"vitest": "^4.1.
|
|
134
|
+
"typescript-eslint": "^8.60.1",
|
|
135
|
+
"vitest": "^4.1.8"
|
|
135
136
|
},
|
|
136
137
|
"engines": {
|
|
137
|
-
"node": ">=22.
|
|
138
|
+
"node": ">=22.12.0"
|
|
138
139
|
},
|
|
139
140
|
"publishConfig": {
|
|
140
141
|
"access": "public"
|