piclist 1.9.14 → 2.0.0

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.
Files changed (80) hide show
  1. package/.github/workflows/docker.yml +5 -5
  2. package/CHANGELOG.md +13 -0
  3. package/License +22 -22
  4. package/README.md +1 -1
  5. package/README_cn.md +1 -1
  6. package/bin/picgo +9 -7
  7. package/bin/picgo-server +180 -161
  8. package/dist/core/Lifecycle.d.ts +35 -36
  9. package/dist/core/PicGo.d.ts +52 -52
  10. package/dist/i18n/en.d.ts +2 -2
  11. package/dist/i18n/index.d.ts +19 -17
  12. package/dist/i18n/zh-CN.d.ts +293 -289
  13. package/dist/i18n/zh-TW.d.ts +2 -2
  14. package/dist/index.d.ts +10 -10
  15. package/dist/index.js +2 -0
  16. package/dist/lib/Commander.d.ts +22 -22
  17. package/dist/lib/LifecyclePlugins.d.ts +26 -26
  18. package/dist/lib/Logger.d.ts +19 -19
  19. package/dist/lib/PluginHandler.d.ts +10 -10
  20. package/dist/lib/PluginLoader.d.ts +27 -27
  21. package/dist/lib/Request.d.ts +12 -12
  22. package/dist/plugins/beforetransformer/compress.d.ts +5 -5
  23. package/dist/plugins/beforetransformer/skipProcess.d.ts +5 -5
  24. package/dist/plugins/beforetransformer/watermark.d.ts +5 -5
  25. package/dist/plugins/beforeupload/buildInRename.d.ts +5 -5
  26. package/dist/plugins/commander/config.d.ts +3 -3
  27. package/dist/plugins/commander/i18n.d.ts +3 -3
  28. package/dist/plugins/commander/index.d.ts +3 -3
  29. package/dist/plugins/commander/pluginHandler.d.ts +3 -3
  30. package/dist/plugins/commander/proxy.d.ts +3 -3
  31. package/dist/plugins/commander/setting.d.ts +5 -5
  32. package/dist/plugins/commander/upload.d.ts +3 -3
  33. package/dist/plugins/commander/use.d.ts +3 -3
  34. package/dist/plugins/commander/utils.d.ts +2 -2
  35. package/dist/plugins/transformer/base64.d.ts +5 -5
  36. package/dist/plugins/transformer/index.d.ts +5 -5
  37. package/dist/plugins/transformer/path.d.ts +5 -5
  38. package/dist/plugins/uploader/advancedplist.d.ts +2 -2
  39. package/dist/plugins/uploader/alist.d.ts +2 -2
  40. package/dist/plugins/uploader/aliyun.d.ts +2 -2
  41. package/dist/plugins/uploader/awss3plist.d.ts +2 -2
  42. package/dist/plugins/uploader/github.d.ts +2 -2
  43. package/dist/plugins/uploader/imgur.d.ts +2 -2
  44. package/dist/plugins/uploader/index.d.ts +5 -5
  45. package/dist/plugins/uploader/local.d.ts +2 -2
  46. package/dist/plugins/uploader/lsky.d.ts +20 -21
  47. package/dist/plugins/uploader/piclist.d.ts +2 -2
  48. package/dist/plugins/uploader/qiniu.d.ts +2 -2
  49. package/dist/plugins/uploader/s3/uploader.d.ts +25 -24
  50. package/dist/plugins/uploader/s3/utils.d.ts +9 -10
  51. package/dist/plugins/uploader/sftp.d.ts +2 -2
  52. package/dist/plugins/uploader/smms.d.ts +2 -2
  53. package/dist/plugins/uploader/tcyun.d.ts +8 -8
  54. package/dist/plugins/uploader/upyun.d.ts +2 -2
  55. package/dist/plugins/uploader/utils.d.ts +26 -26
  56. package/dist/plugins/uploader/webdav.d.ts +2 -2
  57. package/dist/types/index.d.ts +572 -693
  58. package/dist/types/oldRequest.d.ts +15 -15
  59. package/dist/utils/common.d.ts +42 -119
  60. package/dist/utils/createContext.d.ts +6 -6
  61. package/dist/utils/db.d.ts +17 -15
  62. package/dist/utils/enum.d.ts +27 -27
  63. package/dist/utils/eventBus.d.ts +3 -4
  64. package/dist/utils/getClipboardImage.d.ts +4 -4
  65. package/dist/utils/sshClient.d.ts +16 -16
  66. package/dist/utils/static.d.ts +1 -1
  67. package/docker-compose.yaml +11 -11
  68. package/eslint.config.js +104 -0
  69. package/package.json +62 -78
  70. package/rollup.config.js +25 -42
  71. package/.eslintignore +0 -6
  72. package/.eslintrc.js +0 -50
  73. package/.github/workflows/alpha.yml +0 -22
  74. package/.github/workflows/main.yml +0 -22
  75. package/.github/workflows/manually.yml +0 -19
  76. package/dist/index.cjs.js +0 -2
  77. package/dist/index.esm.js +0 -2
  78. package/dist/plugins/commander/init.d.ts +0 -3
  79. package/dist/utils/initUtils.d.ts +0 -26
  80. package/dist/utils/interfaces.d.ts +0 -201
@@ -1,22 +1,22 @@
1
- import { Command } from 'commander';
2
- import { Inquirer } from 'inquirer';
3
- import { IPlugin, ICommander, IPicGo } from '../types';
4
- export declare class Commander implements ICommander {
5
- private readonly name;
6
- static currentPlugin: string | null;
7
- private readonly list;
8
- private readonly pluginIdMap;
9
- private readonly ctx;
10
- program: Command;
11
- inquirer: Inquirer;
12
- constructor(ctx: IPicGo);
13
- getName(): string;
14
- init(): void;
15
- register(id: string, plugin: IPlugin): void;
16
- unregister(pluginName: string): void;
17
- loadCommands(): void;
18
- get(id: string): IPlugin | undefined;
19
- getList(): IPlugin[];
20
- getIdList(): string[];
21
- }
22
- export default Commander;
1
+ import { Command } from 'commander';
2
+ import { Inquirer } from 'inquirer';
3
+ import { ICommander, IPicGo, IPlugin } from '../types';
4
+ export declare class Commander implements ICommander {
5
+ private readonly name;
6
+ static currentPlugin: string | null;
7
+ private readonly list;
8
+ private readonly pluginIdMap;
9
+ private readonly ctx;
10
+ program: Command;
11
+ inquirer: Inquirer;
12
+ constructor(ctx: IPicGo);
13
+ getName(): string;
14
+ init(): void;
15
+ register(id: string, plugin: IPlugin): void;
16
+ unregister(pluginName: string): void;
17
+ loadCommands(): void;
18
+ get(id: string): IPlugin | undefined;
19
+ getList(): IPlugin[];
20
+ getIdList(): string[];
21
+ }
22
+ export default Commander;
@@ -1,26 +1,26 @@
1
- import { IPlugin, ILifecyclePlugins } from '../types';
2
- export declare class LifecyclePlugins implements ILifecyclePlugins {
3
- static currentPlugin: string | null;
4
- /**
5
- * The name of the plugin
6
- */
7
- private readonly name;
8
- /**
9
- * The list of plugins
10
- */
11
- private readonly list;
12
- /**
13
- * The map of plugin id
14
- */
15
- private readonly pluginIdMap;
16
- constructor(name: string);
17
- register(id: string, plugin: IPlugin): void;
18
- unregister(pluginName: string): void;
19
- getName(): string;
20
- get(id: string): IPlugin | undefined;
21
- getList(): IPlugin[];
22
- getIdList(): string[];
23
- }
24
- export declare const setCurrentPluginName: (name?: string | null) => void;
25
- export declare const getCurrentPluginName: () => string | null;
26
- export default LifecyclePlugins;
1
+ import { ILifecyclePlugins, IPlugin } from '../types';
2
+ export declare class LifecyclePlugins implements ILifecyclePlugins {
3
+ static currentPlugin: string | null;
4
+ /**
5
+ * The name of the plugin
6
+ */
7
+ private readonly name;
8
+ /**
9
+ * The list of plugins
10
+ */
11
+ private readonly list;
12
+ /**
13
+ * The map of plugin id
14
+ */
15
+ private readonly pluginIdMap;
16
+ constructor(name: string);
17
+ register(id: string, plugin: IPlugin): void;
18
+ unregister(pluginName: string): void;
19
+ getName(): string;
20
+ get(id: string): IPlugin | undefined;
21
+ getList(): IPlugin[];
22
+ getIdList(): string[];
23
+ }
24
+ export declare const setCurrentPluginName: (name?: string | null) => void;
25
+ export declare const getCurrentPluginName: () => string | null;
26
+ export default LifecyclePlugins;
@@ -1,19 +1,19 @@
1
- import { ILogArgvType, ILogArgvTypeWithError, ILogger, IPicGo } from '../types';
2
- export declare class Logger implements ILogger {
3
- private readonly level;
4
- private readonly ctx;
5
- private logLevel;
6
- private logPath;
7
- constructor(ctx: IPicGo);
8
- private handleLog;
9
- private checkLogFileIsLarge;
10
- private recreateLogFile;
11
- private handleWriteLog;
12
- private checkLogLevel;
13
- success(...msg: ILogArgvType[]): void;
14
- info(...msg: ILogArgvType[]): void;
15
- error(...msg: ILogArgvTypeWithError[]): void;
16
- warn(...msg: ILogArgvType[]): void;
17
- debug(...msg: ILogArgvType[]): void;
18
- }
19
- export default Logger;
1
+ import { ILogArgvType, ILogArgvTypeWithError, ILogger, IPicGo } from '../types';
2
+ export declare class Logger implements ILogger {
3
+ private readonly level;
4
+ private readonly ctx;
5
+ private logLevel;
6
+ private logPath;
7
+ constructor(ctx: IPicGo);
8
+ private handleLog;
9
+ private checkLogFileIsLarge;
10
+ private recreateLogFile;
11
+ private handleWriteLog;
12
+ private checkLogLevel;
13
+ success(...msg: ILogArgvType[]): void;
14
+ info(...msg: ILogArgvType[]): void;
15
+ error(...msg: ILogArgvTypeWithError[]): void;
16
+ warn(...msg: ILogArgvType[]): void;
17
+ debug(...msg: ILogArgvType[]): void;
18
+ }
19
+ export default Logger;
@@ -1,10 +1,10 @@
1
- import { IProcessEnv, IPluginHandler, IPluginHandlerOptions, IPicGo, IPluginHandlerResult } from '../types';
2
- export declare class PluginHandler implements IPluginHandler {
3
- private readonly ctx;
4
- constructor(ctx: IPicGo);
5
- install(plugins: string[], options?: IPluginHandlerOptions, env?: IProcessEnv): Promise<IPluginHandlerResult<boolean>>;
6
- uninstall(plugins: string[]): Promise<IPluginHandlerResult<boolean>>;
7
- update(plugins: string[], options?: IPluginHandlerOptions, env?: IProcessEnv): Promise<IPluginHandlerResult<boolean>>;
8
- private execCommand;
9
- }
10
- export default PluginHandler;
1
+ import { IPicGo, IPluginHandler, IPluginHandlerOptions, IPluginHandlerResult, IProcessEnv } from '../types';
2
+ export declare class PluginHandler implements IPluginHandler {
3
+ private readonly ctx;
4
+ constructor(ctx: IPicGo);
5
+ install(plugins: string[], options?: IPluginHandlerOptions, env?: IProcessEnv): Promise<IPluginHandlerResult<boolean>>;
6
+ uninstall(plugins: string[]): Promise<IPluginHandlerResult<boolean>>;
7
+ update(plugins: string[], options?: IPluginHandlerOptions, env?: IProcessEnv): Promise<IPluginHandlerResult<boolean>>;
8
+ private execCommand;
9
+ }
10
+ export default PluginHandler;
@@ -1,27 +1,27 @@
1
- import { IPicGo, IPicGoPlugin, IPluginLoader, IPicGoPluginInterface } from '../types/index';
2
- /**
3
- * Local plugin loader, file system is required
4
- */
5
- export declare class PluginLoader implements IPluginLoader {
6
- private readonly ctx;
7
- private list;
8
- private readonly fullList;
9
- private readonly pluginMap;
10
- constructor(ctx: IPicGo);
11
- private init;
12
- private resolvePlugin;
13
- load(): boolean;
14
- registerPlugin(name: string, plugin?: IPicGoPlugin): void;
15
- unregisterPlugin(name: string): void;
16
- getPlugin(name: string): IPicGoPluginInterface | undefined;
17
- /**
18
- * Get the list of enabled plugins
19
- */
20
- getList(): string[];
21
- hasPlugin(name: string): boolean;
22
- /**
23
- * Get the full list of plugins, whether it is enabled or not
24
- */
25
- getFullList(): string[];
26
- }
27
- export default PluginLoader;
1
+ import { IPicGo, IPicGoPlugin, IPicGoPluginInterface, IPluginLoader } from '../types/index';
2
+ /**
3
+ * Local plugin loader, file system is required
4
+ */
5
+ export declare class PluginLoader implements IPluginLoader {
6
+ private readonly ctx;
7
+ private list;
8
+ private readonly fullList;
9
+ private readonly pluginMap;
10
+ constructor(ctx: IPicGo);
11
+ private init;
12
+ private resolvePlugin;
13
+ load(): Promise<boolean>;
14
+ registerPlugin(name: string, plugin?: IPicGoPlugin): Promise<void>;
15
+ unregisterPlugin(name: string): void;
16
+ getPlugin(name: string): Promise<IPicGoPluginInterface | undefined>;
17
+ /**
18
+ * Get the list of enabled plugins
19
+ */
20
+ getList(): string[];
21
+ hasPlugin(name: string): boolean;
22
+ /**
23
+ * Get the full list of plugins, whether it is enabled or not
24
+ */
25
+ getFullList(): string[];
26
+ }
27
+ export default PluginLoader;
@@ -1,12 +1,12 @@
1
- import type { AxiosRequestConfig } from 'axios';
2
- import type { IPicGo, IRequestConfig, IOldReqOptions, IResponse, IRequest } from '../types';
3
- export declare class Request implements IRequest {
4
- private readonly ctx;
5
- private proxy;
6
- options: AxiosRequestConfig<any>;
7
- constructor(ctx: IPicGo);
8
- private init;
9
- private handleProxy;
10
- request<T, U extends IRequestConfig<U> extends IOldReqOptions ? IOldReqOptions : IRequestConfig<U> extends AxiosRequestConfig ? AxiosRequestConfig : never>(options: U): Promise<IResponse<T, U>>;
11
- }
12
- export default Request;
1
+ import type { AxiosRequestConfig } from 'axios';
2
+ import type { IOldReqOptions, IPicGo, IRequest, IRequestConfig, IResponse } from '../types';
3
+ export declare class Request implements IRequest {
4
+ private readonly ctx;
5
+ private proxy;
6
+ options: AxiosRequestConfig<any>;
7
+ constructor(ctx: IPicGo);
8
+ private init;
9
+ private handleProxy;
10
+ request<T, U extends IRequestConfig<U> extends IOldReqOptions ? IOldReqOptions : IRequestConfig<U> extends AxiosRequestConfig ? AxiosRequestConfig : never>(options: U): Promise<IResponse<T, U>>;
11
+ }
12
+ export default Request;
@@ -1,5 +1,5 @@
1
- import { IPicGo, IPluginConfig } from '../../types';
2
- declare const _default: {
3
- config: (ctx: IPicGo) => IPluginConfig[];
4
- };
5
- export default _default;
1
+ import { IPicGo, IPluginConfig } from '../../types';
2
+ declare const _default: {
3
+ config: (ctx: IPicGo) => IPluginConfig[];
4
+ };
5
+ export default _default;
@@ -1,5 +1,5 @@
1
- import { IPicGo, IPluginConfig } from '../../types';
2
- declare const _default: {
3
- config: (ctx: IPicGo) => IPluginConfig[];
4
- };
5
- export default _default;
1
+ import { IPicGo, IPluginConfig } from '../../types';
2
+ declare const _default: {
3
+ config: (ctx: IPicGo) => IPluginConfig[];
4
+ };
5
+ export default _default;
@@ -1,5 +1,5 @@
1
- import { IPicGo, IPluginConfig } from '../../types';
2
- declare const _default: {
3
- config: (ctx: IPicGo) => IPluginConfig[];
4
- };
5
- export default _default;
1
+ import { IPicGo, IPluginConfig } from '../../types';
2
+ declare const _default: {
3
+ config: (ctx: IPicGo) => IPluginConfig[];
4
+ };
5
+ export default _default;
@@ -1,5 +1,5 @@
1
- import { IPicGo, IPluginConfig } from '../../types';
2
- declare const _default: {
3
- config: (ctx: IPicGo) => IPluginConfig[];
4
- };
5
- export default _default;
1
+ import { IPicGo, IPluginConfig } from '../../types';
2
+ declare const _default: {
3
+ config: (ctx: IPicGo) => IPluginConfig[];
4
+ };
5
+ export default _default;
@@ -1,3 +1,3 @@
1
- import { IPlugin } from '../../types';
2
- declare const config: IPlugin;
3
- export default config;
1
+ import { IPlugin } from '../../types';
2
+ declare const config: IPlugin;
3
+ export default config;
@@ -1,3 +1,3 @@
1
- import { IPlugin } from '../../types';
2
- declare const i18n: IPlugin;
3
- export default i18n;
1
+ import { IPlugin } from '../../types';
2
+ declare const i18n: IPlugin;
3
+ export default i18n;
@@ -1,3 +1,3 @@
1
- import { IPicGo } from '../../types';
2
- declare const _default: (ctx: IPicGo) => void;
3
- export default _default;
1
+ import { IPicGo } from '../../types';
2
+ declare const _default: (ctx: IPicGo) => void;
3
+ export default _default;
@@ -1,3 +1,3 @@
1
- import { IPlugin } from '../../types';
2
- declare const pluginHandler: IPlugin;
3
- export default pluginHandler;
1
+ import { IPlugin } from '../../types';
2
+ declare const pluginHandler: IPlugin;
3
+ export default pluginHandler;
@@ -1,3 +1,3 @@
1
- import { IPlugin } from '../../types';
2
- declare const proxy: IPlugin;
3
- export default proxy;
1
+ import { IPlugin } from '../../types';
2
+ declare const proxy: IPlugin;
3
+ export default proxy;
@@ -1,5 +1,5 @@
1
- import { IPicGo } from '../../types';
2
- declare const setting: {
3
- handle: (ctx: IPicGo) => void;
4
- };
5
- export default setting;
1
+ import { IPicGo } from '../../types';
2
+ declare const setting: {
3
+ handle: (ctx: IPicGo) => void;
4
+ };
5
+ export default setting;
@@ -1,3 +1,3 @@
1
- import { IPlugin } from '../../types';
2
- declare const upload: IPlugin;
3
- export default upload;
1
+ import { IPlugin } from '../../types';
2
+ declare const upload: IPlugin;
3
+ export default upload;
@@ -1,3 +1,3 @@
1
- import { IPlugin } from '../../types';
2
- declare const use: IPlugin;
3
- export default use;
1
+ import { IPlugin } from '../../types';
2
+ declare const use: IPlugin;
3
+ export default use;
@@ -1,2 +1,2 @@
1
- import { IPicGo, IStringKeyMap } from '../../types';
2
- export declare const uploaderTranslators: (ctx: IPicGo) => IStringKeyMap<any>;
1
+ import { IPicGo, IStringKeyMap } from '../../types';
2
+ export declare const uploaderTranslators: (ctx: IPicGo) => IStringKeyMap<any>;
@@ -1,5 +1,5 @@
1
- import { IPicGo } from '../../types';
2
- declare const _default: {
3
- handle: (ctx: IPicGo) => Promise<IPicGo>;
4
- };
5
- export default _default;
1
+ import { IPicGo } from '../../types';
2
+ declare const _default: {
3
+ handle: (ctx: IPicGo) => Promise<IPicGo>;
4
+ };
5
+ export default _default;
@@ -1,5 +1,5 @@
1
- import { IPicGo } from '../../types';
2
- declare const buildInTransformers: () => {
3
- register(ctx: IPicGo): void;
4
- };
5
- export default buildInTransformers;
1
+ import { IPicGo } from '../../types';
2
+ declare const buildInTransformers: () => {
3
+ register(ctx: IPicGo): void;
4
+ };
5
+ export default buildInTransformers;
@@ -1,5 +1,5 @@
1
- import { IPicGo } from '../../types';
2
- declare const _default: {
3
- handle: (ctx: IPicGo) => Promise<IPicGo>;
4
- };
5
- export default _default;
1
+ import { IPicGo } from '../../types';
2
+ declare const _default: {
3
+ handle: (ctx: IPicGo) => Promise<IPicGo>;
4
+ };
5
+ export default _default;
@@ -1,2 +1,2 @@
1
- import { IPicGo } from '../../types';
2
- export default function register(ctx: IPicGo): void;
1
+ import { IPicGo } from '../../types';
2
+ export default function register(ctx: IPicGo): void;
@@ -1,2 +1,2 @@
1
- import { IPicGo } from '../../types';
2
- export default function register(ctx: IPicGo): void;
1
+ import { IPicGo } from '../../types';
2
+ export default function register(ctx: IPicGo): void;
@@ -1,2 +1,2 @@
1
- import { IPicGo } from '../../types';
2
- export default function register(ctx: IPicGo): void;
1
+ import { IPicGo } from '../../types';
2
+ export default function register(ctx: IPicGo): void;
@@ -1,2 +1,2 @@
1
- import { IPicGo } from '../../types';
2
- export default function register(ctx: IPicGo): void;
1
+ import { IPicGo } from '../../types';
2
+ export default function register(ctx: IPicGo): void;
@@ -1,2 +1,2 @@
1
- import { IPicGo } from '../../types';
2
- export default function register(ctx: IPicGo): void;
1
+ import { IPicGo } from '../../types';
2
+ export default function register(ctx: IPicGo): void;
@@ -1,2 +1,2 @@
1
- import { IPicGo } from '../../types';
2
- export default function register(ctx: IPicGo): void;
1
+ import { IPicGo } from '../../types';
2
+ export default function register(ctx: IPicGo): void;
@@ -1,5 +1,5 @@
1
- import { IPicGo } from '../../types';
2
- declare const buildInUploaders: () => {
3
- register(ctx: IPicGo): void;
4
- };
5
- export default buildInUploaders;
1
+ import { IPicGo } from '../../types';
2
+ declare const buildInUploaders: () => {
3
+ register(ctx: IPicGo): void;
4
+ };
5
+ export default buildInUploaders;
@@ -1,2 +1,2 @@
1
- import { IPicGo } from '../../types';
2
- export default function register(ctx: IPicGo): void;
1
+ import { IPicGo } from '../../types';
2
+ export default function register(ctx: IPicGo): void;
@@ -1,21 +1,20 @@
1
- /// <reference types="node" />
2
- import { IPicGo } from '../../types';
3
- export interface IMGTYPE {
4
- imgUrl?: string;
5
- type?: string;
6
- key?: string;
7
- id?: string;
8
- }
9
- export interface IV2FORMDATA {
10
- file: {
11
- value: Buffer;
12
- options: {
13
- filename: string;
14
- };
15
- };
16
- ssl: string;
17
- strategy_id?: string;
18
- album_id?: string;
19
- permission?: number;
20
- }
21
- export default function register(ctx: IPicGo): void;
1
+ import { IPicGo } from '../../types';
2
+ export interface IMGTYPE {
3
+ imgUrl?: string;
4
+ type?: string;
5
+ key?: string;
6
+ id?: string;
7
+ }
8
+ export interface IV2FORMDATA {
9
+ file: {
10
+ value: Buffer;
11
+ options: {
12
+ filename: string;
13
+ };
14
+ };
15
+ ssl: string;
16
+ strategy_id?: string;
17
+ album_id?: string;
18
+ permission?: number;
19
+ }
20
+ export default function register(ctx: IPicGo): void;
@@ -1,2 +1,2 @@
1
- import { IPicGo } from '../../types';
2
- export default function register(ctx: IPicGo): void;
1
+ import { IPicGo } from '../../types';
2
+ export default function register(ctx: IPicGo): void;
@@ -1,2 +1,2 @@
1
- import { IPicGo } from '../../types';
2
- export default function register(ctx: IPicGo): void;
1
+ import { IPicGo } from '../../types';
2
+ export default function register(ctx: IPicGo): void;
@@ -1,24 +1,25 @@
1
- import { S3Client } from '@aws-sdk/client-s3';
2
- import { IAwsS3PListUserConfig, IImgInfo } from '../../../types';
3
- export interface IUploadResult {
4
- key: string;
5
- url: string;
6
- imgURL: string;
7
- versionId?: string;
8
- eTag?: string;
9
- }
10
- declare function createS3Client(opts: IAwsS3PListUserConfig): S3Client;
11
- interface ICreateUploadTaskOpts {
12
- client: any;
13
- bucketName: string;
14
- path: string;
15
- item: IImgInfo;
16
- acl: string;
17
- urlPrefix?: string;
18
- }
19
- declare function createUploadTask(opts: ICreateUploadTaskOpts): Promise<IUploadResult>;
20
- declare const _default: {
21
- createS3Client: typeof createS3Client;
22
- createUploadTask: typeof createUploadTask;
23
- };
24
- export default _default;
1
+ import { ObjectCannedACL, S3Client } from '@aws-sdk/client-s3';
2
+ import { IAwsS3PListUserConfig, IImgInfo } from '../../../types';
3
+ export interface IUploadResult {
4
+ key: string;
5
+ url: string;
6
+ imgURL: string;
7
+ versionId?: string;
8
+ eTag?: string;
9
+ }
10
+ declare function createS3Client(opts: IAwsS3PListUserConfig): S3Client;
11
+ interface ICreateUploadTaskOpts {
12
+ client: any;
13
+ bucketName: string;
14
+ path: string;
15
+ item: IImgInfo;
16
+ acl?: ObjectCannedACL;
17
+ urlPrefix?: string;
18
+ options: string;
19
+ }
20
+ declare function createUploadTask(opts: ICreateUploadTaskOpts): Promise<IUploadResult>;
21
+ declare const _default: {
22
+ createS3Client: typeof createS3Client;
23
+ createUploadTask: typeof createUploadTask;
24
+ };
25
+ export default _default;
@@ -1,10 +1,9 @@
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;
1
+ import { HttpProxyAgent, HttpsProxyAgent } from 'hpagent';
2
+ import { IImgInfo } from '../../../types';
3
+ export declare function formatPath(info: IImgInfo, format?: string): string;
4
+ export declare function extractInfo(info: IImgInfo): Promise<{
5
+ body?: Buffer;
6
+ contentType?: string;
7
+ contentEncoding?: string;
8
+ }>;
9
+ export declare function getProxyAgent(proxy: string | undefined, sslEnabled: boolean, rejectUnauthorized: boolean): HttpProxyAgent | HttpsProxyAgent | undefined;
@@ -1,2 +1,2 @@
1
- import { IPicGo } from '../../types';
2
- export default function register(ctx: IPicGo): void;
1
+ import { IPicGo } from '../../types';
2
+ export default function register(ctx: IPicGo): void;
@@ -1,2 +1,2 @@
1
- import { IPicGo } from '../../types';
2
- export default function register(ctx: IPicGo): void;
1
+ import { IPicGo } from '../../types';
2
+ export default function register(ctx: IPicGo): void;
@@ -1,8 +1,8 @@
1
- import { IPicGo } from '../../types';
2
- export interface ISignature {
3
- signature: string;
4
- appId: string;
5
- bucket: string;
6
- signTime: string;
7
- }
8
- export default function register(ctx: IPicGo): void;
1
+ import { IPicGo } from '../../types';
2
+ export interface ISignature {
3
+ signature: string;
4
+ appId: string;
5
+ bucket: string;
6
+ signTime: string;
7
+ }
8
+ export default function register(ctx: IPicGo): void;
@@ -1,2 +1,2 @@
1
- import { IPicGo } from '../../types';
2
- export default function register(ctx: IPicGo): void;
1
+ import { IPicGo } from '../../types';
2
+ export default function register(ctx: IPicGo): void;