piclist 2.2.2 → 2.3.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/CHANGELOG.md CHANGED
@@ -1,3 +1,16 @@
1
+ ## (2026-01-25)
2
+
3
+ * :bug: Fix(custom): fix config migrate issue d79dee0, closes #40
4
+
5
+
6
+
7
+ ## (2026-01-12)
8
+
9
+ * :sparkles: Feature(custom): support secondary picbed upload in cli 1083185, closes #26
10
+ * :sparkles: Feature(custom): support secondary upload for server 2fd6a6f
11
+
12
+
13
+
1
14
  ## (2026-01-10)
2
15
 
3
16
  * :bug: Fix(custom): specific sharp to 0.34.4 dee8fac
package/bin/picgo-server CHANGED
@@ -226,8 +226,8 @@ router.post('/upload', async ({ response, list = [], urlparams }) => {
226
226
  if (list.length === 0) {
227
227
  // upload with clipboard
228
228
  console.log('[PicList Server] upload clipboard file')
229
- const result = await picgo.upload()
230
- const res = result[0].imgUrl
229
+ const result = await picgo.uploadReturnCtx()
230
+ const res = result.output[0].imgUrl
231
231
  console.log('[PicList Server] upload result:', res)
232
232
  if (res) {
233
233
  handleResponse({
@@ -249,8 +249,8 @@ router.post('/upload', async ({ response, list = [], urlparams }) => {
249
249
  } else {
250
250
  console.log('[PicList Server] upload files in list')
251
251
  // upload with files
252
- const result = await picgo.upload(list)
253
- const res = result.map(item => {
252
+ const result = await picgo.uploadReturnCtx(list)
253
+ const res = result.output.map(item => {
254
254
  return item.imgUrl
255
255
  })
256
256
  console.log('[PicList Server] upload result\n', res.join('\n'))
@@ -1,5 +1,5 @@
1
1
  import { EventEmitter } from 'node:events';
2
- import { IPicGo } from '../types';
2
+ import { IPicGo, IStringKeyMap } from '../types';
3
3
  export declare class Lifecycle extends EventEmitter {
4
4
  private readonly ctx;
5
5
  ttfPath: string;
@@ -10,6 +10,7 @@ export declare class Lifecycle extends EventEmitter {
10
10
  getUploaderType(ctx: IPicGo): {
11
11
  picBed: string;
12
12
  id: string;
13
+ config?: IStringKeyMap<any>;
13
14
  };
14
15
  private getSkipExtensions;
15
16
  start(input: any[], skipProcess?: boolean): Promise<IPicGo>;
@@ -3,7 +3,7 @@ import { Commander } from '../lib/Commander';
3
3
  import { Logger } from '../lib/Logger';
4
4
  import { PluginHandler } from '../lib/PluginHandler';
5
5
  import { Request } from '../lib/Request';
6
- import { IHelper, II18nManager, IImgInfo, IPicGo, IPicGoPlugin, IPicGoPluginInterface, IPluginLoader, IRequest, IStringKeyMap } from '../types';
6
+ import { IHelper, II18nManager, IImgInfo, IPicGo, IPicGoPlugin, IPicGoPluginInterface, IPluginLoader, IRequest, IStringKeyMap, IUploadResultWithBackup } from '../types';
7
7
  import { ConfigManager } from '../utils/configManager';
8
8
  export declare class PicGo extends EventEmitter implements IPicGo {
9
9
  private _config;
@@ -50,5 +50,6 @@ export declare class PicGo extends EventEmitter implements IPicGo {
50
50
  unsetConfig(key: string, propName: string): void;
51
51
  get request(): IRequest['request'];
52
52
  upload(input?: any[]): Promise<IImgInfo[] | Error>;
53
- uploadReturnCtx(input?: any[], skipProcess?: boolean): Promise<IPicGo>;
53
+ changeCurrentUploader(type: string, config: IStringKeyMap<any>): void;
54
+ uploadReturnCtx(input?: any[]): Promise<IUploadResultWithBackup>;
54
55
  }