piclist 2.3.5 → 2.4.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/README.md +2 -1
- package/README_en.md +2 -1
- package/bin/picgo-server +5 -0
- package/dist/i18n/zh-CN.d.ts +2 -0
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/lib/Commander.d.ts +2 -2
- package/dist/lib/PluginHandler.d.ts +1 -0
- package/dist/plugins/uploader/s3/utils.d.ts +0 -1
- package/dist/types/index.d.ts +6 -2
- package/dist/utils/inquirerShim.d.ts +23 -0
- package/package.json +19 -20
package/dist/lib/Commander.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
|
-
import { Inquirer } from 'inquirer';
|
|
3
2
|
import { ICommander, IPicGo, IPlugin } from '../types';
|
|
3
|
+
import { IInquirerAdapter } from '../utils/inquirerShim';
|
|
4
4
|
export declare class Commander implements ICommander {
|
|
5
5
|
private readonly name;
|
|
6
6
|
static currentPlugin: string | null;
|
|
@@ -8,7 +8,7 @@ export declare class Commander implements ICommander {
|
|
|
8
8
|
private readonly pluginIdMap;
|
|
9
9
|
private readonly ctx;
|
|
10
10
|
program: Command;
|
|
11
|
-
inquirer:
|
|
11
|
+
inquirer: IInquirerAdapter;
|
|
12
12
|
constructor(ctx: IPicGo);
|
|
13
13
|
getName(): string;
|
|
14
14
|
init(): void;
|
|
@@ -2,6 +2,7 @@ import { IPicGo, IPluginHandler, IPluginHandlerOptions, IPluginHandlerResult, IP
|
|
|
2
2
|
export declare class PluginHandler implements IPluginHandler {
|
|
3
3
|
private readonly ctx;
|
|
4
4
|
constructor(ctx: IPicGo);
|
|
5
|
+
getList(): Promise<string[]>;
|
|
5
6
|
install(plugins: string[], options?: IPluginHandlerOptions, env?: IProcessEnv): Promise<IPluginHandlerResult<boolean>>;
|
|
6
7
|
uninstall(plugins: string[]): Promise<IPluginHandlerResult<boolean>>;
|
|
7
8
|
update(plugins: string[], options?: IPluginHandlerOptions, env?: IProcessEnv): Promise<IPluginHandlerResult<boolean>>;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { HttpProxyAgent, HttpsProxyAgent } from 'hpagent';
|
|
2
2
|
import { IImgInfo } from '../../../types';
|
|
3
|
-
export declare function formatPath(info: IImgInfo, format?: string): string;
|
|
4
3
|
export declare function extractInfo(info: IImgInfo): Promise<{
|
|
5
4
|
body?: Buffer;
|
|
6
5
|
contentType?: string;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
|
-
import { Inquirer } from 'inquirer';
|
|
3
2
|
import { FormatEnum, GravityEnum } from 'sharp';
|
|
4
3
|
import type { ConfigManager } from '../utils/configManager';
|
|
4
|
+
import type { IInquirerAdapter } from '../utils/inquirerShim';
|
|
5
5
|
import { IRequestPromiseOptions } from './oldRequest';
|
|
6
6
|
export interface IPicGo extends NodeJS.EventEmitter {
|
|
7
7
|
configPath: string;
|
|
@@ -61,7 +61,7 @@ export interface IHelper {
|
|
|
61
61
|
}
|
|
62
62
|
export interface ICommander extends ILifecyclePlugins {
|
|
63
63
|
program: Command;
|
|
64
|
-
inquirer:
|
|
64
|
+
inquirer: IInquirerAdapter;
|
|
65
65
|
}
|
|
66
66
|
export interface IPluginLoader {
|
|
67
67
|
registerPlugin: (name: string, plugin?: IPicGoPlugin) => Promise<void>;
|
|
@@ -427,6 +427,7 @@ export interface IPluginProcessResult {
|
|
|
427
427
|
fullName: string;
|
|
428
428
|
}
|
|
429
429
|
export interface IPluginHandler {
|
|
430
|
+
getList: () => Promise<string[]>;
|
|
430
431
|
install: (plugins: string[], options: IPluginHandlerOptions, env?: IProcessEnv) => Promise<IPluginHandlerResult<boolean>>;
|
|
431
432
|
update: (plugins: string[], options: IPluginHandlerOptions, env?: IProcessEnv) => Promise<IPluginHandlerResult<boolean>>;
|
|
432
433
|
uninstall: (plugins: string[]) => Promise<IPluginHandlerResult<boolean>>;
|
|
@@ -610,6 +611,8 @@ export interface IBuildInCompressOptions {
|
|
|
610
611
|
reSizeWidthMap?: Record<string, number>;
|
|
611
612
|
reSizeHeight?: number;
|
|
612
613
|
reSizeHeightMap?: Record<string, number>;
|
|
614
|
+
longEdgeAsHeight?: boolean;
|
|
615
|
+
longEdgeAsHeightMap?: Record<string, boolean>;
|
|
613
616
|
skipReSizeOfSmallImg?: boolean;
|
|
614
617
|
skipReSizeOfSmallImgMap?: Record<string, boolean>;
|
|
615
618
|
isReSizeByPercent?: boolean;
|
|
@@ -640,6 +643,7 @@ export interface IBuildInCompressOptionsTreated {
|
|
|
640
643
|
skipReSizeOfSmallImg?: boolean;
|
|
641
644
|
isReSizeByPercent?: boolean;
|
|
642
645
|
reSizePercent?: number;
|
|
646
|
+
longEdgeAsHeight?: boolean;
|
|
643
647
|
isRotate?: boolean;
|
|
644
648
|
rotateDegree?: number;
|
|
645
649
|
isRemoveExif?: boolean;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export interface IInquirerQuestion {
|
|
2
|
+
type: string;
|
|
3
|
+
name: string;
|
|
4
|
+
message?: string;
|
|
5
|
+
choices?: ({
|
|
6
|
+
name: string;
|
|
7
|
+
value: any;
|
|
8
|
+
} | string)[];
|
|
9
|
+
default?: any;
|
|
10
|
+
validate?: (val: any) => boolean | string | Promise<boolean | string>;
|
|
11
|
+
when?: boolean | ((answers: Record<string, any>) => boolean | Promise<boolean>);
|
|
12
|
+
filter?: (val: any) => any;
|
|
13
|
+
transformer?: (val: any) => string;
|
|
14
|
+
[key: string]: any;
|
|
15
|
+
}
|
|
16
|
+
export interface IInquirerAdapter {
|
|
17
|
+
prompt<T = Record<string, any>>(questions: IInquirerQuestion[]): Promise<T>;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Creates an adapter whose `.prompt()` method mirrors the legacy
|
|
21
|
+
* `inquirer.prompt(questions)` API.
|
|
22
|
+
*/
|
|
23
|
+
export declare function createInquirerAdapter(): IInquirerAdapter;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "piclist",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.1",
|
|
4
4
|
"description": "Modified PicGo core, A tool for picture uploading",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"picture",
|
|
@@ -61,28 +61,28 @@
|
|
|
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.
|
|
64
|
+
"@aws-sdk/client-s3": "3.1042.0",
|
|
65
|
+
"@aws-sdk/lib-storage": "3.1042.0",
|
|
66
|
+
"@aws-sdk/s3-request-presigner": "3.1042.0",
|
|
67
|
+
"@inquirer/prompts": "^8.4.2",
|
|
67
68
|
"@piclist/i18n": "^2.0.0",
|
|
68
69
|
"@piclist/store": "^3.0.1",
|
|
69
|
-
"@smithy/node-http-handler": "4.
|
|
70
|
-
"axios": "^1.
|
|
70
|
+
"@smithy/node-http-handler": "4.6.1",
|
|
71
|
+
"axios": "^1.16.0",
|
|
71
72
|
"chalk": "^5.6.2",
|
|
72
|
-
"commander": "^
|
|
73
|
+
"commander": "^14.0.3",
|
|
73
74
|
"cross-spawn": "^7.0.6",
|
|
74
75
|
"dayjs": "^1.11.20",
|
|
75
|
-
"dotenv": "^17.
|
|
76
|
-
"file-type": "
|
|
76
|
+
"dotenv": "^17.4.2",
|
|
77
|
+
"file-type": "22.0.1",
|
|
77
78
|
"form-data": "^4.0.5",
|
|
78
79
|
"fs-extra": "^11.3.4",
|
|
79
80
|
"heic-convert": "^2.1.0",
|
|
80
81
|
"hpagent": "1.2.0",
|
|
81
82
|
"image-size": "^2.0.2",
|
|
82
|
-
"inquirer": "^6.0.0",
|
|
83
83
|
"is-wsl": "^3.1.0",
|
|
84
84
|
"js-yaml": "^4.1.1",
|
|
85
|
-
"lodash-es": "^4.
|
|
85
|
+
"lodash-es": "^4.18.1",
|
|
86
86
|
"mime": "4.1.0",
|
|
87
87
|
"minimist": "^1.2.8",
|
|
88
88
|
"multer": "^2.1.1",
|
|
@@ -92,8 +92,8 @@
|
|
|
92
92
|
"sharp": "0.34.4",
|
|
93
93
|
"text-to-svg": "^3.1.5",
|
|
94
94
|
"tunnel": "^0.0.6",
|
|
95
|
-
"uuid": "^
|
|
96
|
-
"webdav": "^5.
|
|
95
|
+
"uuid": "^14.0.0",
|
|
96
|
+
"webdav": "^5.10.0"
|
|
97
97
|
},
|
|
98
98
|
"devDependencies": {
|
|
99
99
|
"@eslint/js": "^10.0.1",
|
|
@@ -106,7 +106,6 @@
|
|
|
106
106
|
"@types/cross-spawn": "^6.0.6",
|
|
107
107
|
"@types/fs-extra": "^11.0.4",
|
|
108
108
|
"@types/heic-convert": "^2.1.0",
|
|
109
|
-
"@types/inquirer": "^0.0.42",
|
|
110
109
|
"@types/js-yaml": "^4.0.9",
|
|
111
110
|
"@types/lodash-es": "^4.17.12",
|
|
112
111
|
"@types/node": "25.5.0",
|
|
@@ -116,12 +115,12 @@
|
|
|
116
115
|
"@vitest/coverage-v8": "^4.1.0",
|
|
117
116
|
"cross-env": "^10.1.0",
|
|
118
117
|
"dpdm": "^4.0.1",
|
|
119
|
-
"eslint": "^10.
|
|
118
|
+
"eslint": "^10.3.0",
|
|
120
119
|
"eslint-config-prettier": "^10.1.8",
|
|
121
120
|
"eslint-plugin-jsonc": "^3.1.2",
|
|
122
121
|
"eslint-plugin-prettier": "^5.5.5",
|
|
123
|
-
"eslint-plugin-simple-import-sort": "^
|
|
124
|
-
"eslint-plugin-unicorn": "^
|
|
122
|
+
"eslint-plugin-simple-import-sort": "^13.0.0",
|
|
123
|
+
"eslint-plugin-unicorn": "^64.0.0",
|
|
125
124
|
"husky": "^9.1.7",
|
|
126
125
|
"jsonc-eslint-parser": "^3.1.0",
|
|
127
126
|
"node-bump-version": "^2.0.0",
|
|
@@ -130,12 +129,12 @@
|
|
|
130
129
|
"rollup": "^4.60.0",
|
|
131
130
|
"rollup-plugin-copy": "^3.5.0",
|
|
132
131
|
"rollup-plugin-string": "^3.0.0",
|
|
133
|
-
"typescript": "^
|
|
134
|
-
"typescript-eslint": "^8.
|
|
132
|
+
"typescript": "^6.0.3",
|
|
133
|
+
"typescript-eslint": "^8.59.2",
|
|
135
134
|
"vitest": "^4.1.0"
|
|
136
135
|
},
|
|
137
136
|
"engines": {
|
|
138
|
-
"node": ">=
|
|
137
|
+
"node": ">=22.0.0"
|
|
139
138
|
},
|
|
140
139
|
"publishConfig": {
|
|
141
140
|
"access": "public"
|