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.
@@ -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;
@@ -0,0 +1,2 @@
1
+ import { IPicGo, IStringKeyMap } from '../../types';
2
+ export declare const uploaderTranslators: (ctx: IPicGo) => IStringKeyMap<any>;
@@ -1,3 +1,5 @@
1
- import { IPicGoPlugin } from '../../types';
2
- declare const buildInTransformers: IPicGoPlugin;
1
+ import { IPicGo } from '../../types';
2
+ declare const buildInTransformers: () => {
3
+ register(ctx: IPicGo): void;
4
+ };
3
5
  export default buildInTransformers;
@@ -0,0 +1,2 @@
1
+ import { IPicGo } from '../../types';
2
+ export default function register(ctx: IPicGo): void;
@@ -0,0 +1,2 @@
1
+ import { IPicGo } from '../../types';
2
+ export default function register(ctx: IPicGo): void;
@@ -1,3 +1,5 @@
1
- import { IPicGoPlugin } from '../../types';
2
- declare const buildInUploaders: IPicGoPlugin;
1
+ import { IPicGo } from '../../types';
2
+ declare const buildInUploaders: () => {
3
+ register(ctx: IPicGo): void;
4
+ };
3
5
  export default buildInUploaders;
@@ -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): any;
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
+ };
@@ -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.8.12",
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
- "build": "cross-env NODE_ENV=production rimraf ./dist && rollup -c rollup.config.js",
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 = `/*