piclist 1.9.13 → 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.
- package/.github/workflows/docker.yml +5 -5
- package/CHANGELOG.md +22 -0
- package/License +22 -22
- package/README.md +1 -1
- package/README_cn.md +1 -1
- package/bin/picgo +9 -7
- package/bin/picgo-server +180 -161
- package/dist/core/Lifecycle.d.ts +35 -36
- package/dist/core/PicGo.d.ts +52 -52
- package/dist/i18n/en.d.ts +2 -2
- package/dist/i18n/index.d.ts +19 -17
- package/dist/i18n/zh-CN.d.ts +293 -289
- package/dist/i18n/zh-TW.d.ts +2 -2
- package/dist/index.d.ts +10 -10
- package/dist/index.js +2 -0
- package/dist/lib/Commander.d.ts +22 -22
- package/dist/lib/LifecyclePlugins.d.ts +26 -26
- package/dist/lib/Logger.d.ts +19 -19
- package/dist/lib/PluginHandler.d.ts +10 -10
- package/dist/lib/PluginLoader.d.ts +27 -27
- package/dist/lib/Request.d.ts +12 -12
- package/dist/plugins/beforetransformer/compress.d.ts +5 -5
- package/dist/plugins/beforetransformer/skipProcess.d.ts +5 -5
- package/dist/plugins/beforetransformer/watermark.d.ts +5 -5
- package/dist/plugins/beforeupload/buildInRename.d.ts +5 -5
- package/dist/plugins/commander/config.d.ts +3 -3
- package/dist/plugins/commander/i18n.d.ts +3 -3
- package/dist/plugins/commander/index.d.ts +3 -3
- package/dist/plugins/commander/pluginHandler.d.ts +3 -3
- package/dist/plugins/commander/proxy.d.ts +3 -3
- package/dist/plugins/commander/setting.d.ts +5 -5
- package/dist/plugins/commander/upload.d.ts +3 -3
- package/dist/plugins/commander/use.d.ts +3 -3
- package/dist/plugins/commander/utils.d.ts +2 -2
- package/dist/plugins/transformer/base64.d.ts +5 -5
- package/dist/plugins/transformer/index.d.ts +5 -5
- package/dist/plugins/transformer/path.d.ts +5 -5
- package/dist/plugins/uploader/advancedplist.d.ts +2 -2
- package/dist/plugins/uploader/alist.d.ts +2 -2
- package/dist/plugins/uploader/aliyun.d.ts +2 -2
- package/dist/plugins/uploader/awss3plist.d.ts +2 -2
- package/dist/plugins/uploader/github.d.ts +2 -2
- package/dist/plugins/uploader/imgur.d.ts +2 -2
- package/dist/plugins/uploader/index.d.ts +5 -5
- package/dist/plugins/uploader/local.d.ts +2 -2
- package/dist/plugins/uploader/lsky.d.ts +20 -21
- package/dist/plugins/uploader/piclist.d.ts +2 -2
- package/dist/plugins/uploader/qiniu.d.ts +2 -2
- package/dist/plugins/uploader/s3/uploader.d.ts +25 -24
- package/dist/plugins/uploader/s3/utils.d.ts +9 -10
- package/dist/plugins/uploader/sftp.d.ts +2 -2
- package/dist/plugins/uploader/smms.d.ts +2 -2
- package/dist/plugins/uploader/tcyun.d.ts +8 -8
- package/dist/plugins/uploader/upyun.d.ts +2 -2
- package/dist/plugins/uploader/utils.d.ts +26 -26
- package/dist/plugins/uploader/webdav.d.ts +2 -2
- package/dist/types/index.d.ts +572 -693
- package/dist/types/oldRequest.d.ts +15 -15
- package/dist/utils/common.d.ts +42 -119
- package/dist/utils/createContext.d.ts +6 -6
- package/dist/utils/db.d.ts +17 -15
- package/dist/utils/enum.d.ts +27 -27
- package/dist/utils/eventBus.d.ts +3 -4
- package/dist/utils/getClipboardImage.d.ts +4 -4
- package/dist/utils/sshClient.d.ts +16 -16
- package/dist/utils/static.d.ts +1 -1
- package/docker-compose.yaml +11 -11
- package/eslint.config.js +104 -0
- package/package.json +62 -78
- package/rollup.config.js +25 -42
- package/.eslintignore +0 -6
- package/.eslintrc.js +0 -50
- package/.github/workflows/alpha.yml +0 -22
- package/.github/workflows/main.yml +0 -22
- package/.github/workflows/manually.yml +0 -19
- package/dist/index.cjs.js +0 -2
- package/dist/index.esm.js +0 -2
- package/dist/plugins/commander/init.d.ts +0 -3
- package/dist/utils/initUtils.d.ts +0 -26
- package/dist/utils/interfaces.d.ts +0 -201
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { IPicGo, IOptions } from '../types';
|
|
2
|
-
/**
|
|
3
|
-
* Generate template files to destination files.
|
|
4
|
-
* @param {PicGo} ctx
|
|
5
|
-
* @param {IOptions} options
|
|
6
|
-
*/
|
|
7
|
-
declare const generate: (ctx: IPicGo, options: IOptions) => Promise<any>;
|
|
8
|
-
/**
|
|
9
|
-
* Return the filters' result
|
|
10
|
-
* @param ctx PicGo
|
|
11
|
-
* @param exp condition expression
|
|
12
|
-
* @param data options data
|
|
13
|
-
*/
|
|
14
|
-
declare const filters: (ctx: IPicGo, exp: any, data: any) => boolean;
|
|
15
|
-
/**
|
|
16
|
-
* Render files to a virtual tree object
|
|
17
|
-
* @param {array} files
|
|
18
|
-
*/
|
|
19
|
-
declare const render: (files: string[], source: string, options: any) => any;
|
|
20
|
-
/**
|
|
21
|
-
* Write rendered files' content to real file
|
|
22
|
-
* @param {string} dir
|
|
23
|
-
* @param {object} files
|
|
24
|
-
*/
|
|
25
|
-
declare const writeFileTree: (dir: string, files: any) => void;
|
|
26
|
-
export { filters, generate, render, writeFileTree };
|
|
@@ -1,201 +0,0 @@
|
|
|
1
|
-
/** This file is deprecated */
|
|
2
|
-
/// <reference types="node" />
|
|
3
|
-
import { PicGo } from '../core/PicGo';
|
|
4
|
-
import { LifecyclePlugins } from '../lib/LifecyclePlugins';
|
|
5
|
-
import { IWebdavPlistConfig } from '../types';
|
|
6
|
-
/**
|
|
7
|
-
* for plugin config
|
|
8
|
-
*/
|
|
9
|
-
export interface IPluginConfig {
|
|
10
|
-
name: string;
|
|
11
|
-
type: string;
|
|
12
|
-
required: boolean;
|
|
13
|
-
default?: any;
|
|
14
|
-
[propName: string]: any;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* for lifecycle plugins
|
|
18
|
-
*/
|
|
19
|
-
export interface IHelper {
|
|
20
|
-
transformer: LifecyclePlugins;
|
|
21
|
-
uploader: LifecyclePlugins;
|
|
22
|
-
beforeTransformPlugins: LifecyclePlugins;
|
|
23
|
-
beforeUploadPlugins: LifecyclePlugins;
|
|
24
|
-
afterUploadPlugins: LifecyclePlugins;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* for uploading image info
|
|
28
|
-
*/
|
|
29
|
-
export interface IImgInfo {
|
|
30
|
-
buffer?: Buffer;
|
|
31
|
-
base64Image?: string;
|
|
32
|
-
fileName?: string;
|
|
33
|
-
width?: number;
|
|
34
|
-
height?: number;
|
|
35
|
-
extname?: string;
|
|
36
|
-
[propName: string]: any;
|
|
37
|
-
}
|
|
38
|
-
export interface IPathTransformedImgInfo extends IImgInfo {
|
|
39
|
-
success: boolean;
|
|
40
|
-
}
|
|
41
|
-
/** SM.MS 图床配置项 */
|
|
42
|
-
export interface ISmmsConfig {
|
|
43
|
-
token: string;
|
|
44
|
-
}
|
|
45
|
-
/** 七牛云图床配置项 */
|
|
46
|
-
export interface IQiniuConfig {
|
|
47
|
-
accessKey: string;
|
|
48
|
-
secretKey: string;
|
|
49
|
-
/** 存储空间名 */
|
|
50
|
-
bucket: string;
|
|
51
|
-
/** 自定义域名 */
|
|
52
|
-
url: string;
|
|
53
|
-
/** 存储区域编号 */
|
|
54
|
-
area: 'z0' | 'z1' | 'z2' | 'na0' | 'as0';
|
|
55
|
-
/** 网址后缀,比如使用 `?imageslim` 可进行[图片瘦身](https://developer.qiniu.com/dora/api/1271/image-thin-body-imageslim) */
|
|
56
|
-
options: string;
|
|
57
|
-
/** 自定义存储路径,比如 `img/` */
|
|
58
|
-
path: string;
|
|
59
|
-
}
|
|
60
|
-
/** 又拍云图床配置项 */
|
|
61
|
-
export interface IUpyunConfig {
|
|
62
|
-
/** 存储空间名,及你的服务名 */
|
|
63
|
-
bucket: string;
|
|
64
|
-
/** 操作员 */
|
|
65
|
-
operator: string;
|
|
66
|
-
/** 密码 */
|
|
67
|
-
password: string;
|
|
68
|
-
/** 针对图片的一些后缀处理参数 */
|
|
69
|
-
options: string;
|
|
70
|
-
/** 自定义存储路径,比如 `img/` */
|
|
71
|
-
path: string;
|
|
72
|
-
/** 加速域名,注意要加 `http://` 或者 `https://` */
|
|
73
|
-
url: string;
|
|
74
|
-
}
|
|
75
|
-
/** 腾讯云图床配置项 */
|
|
76
|
-
export interface ITcyunConfig {
|
|
77
|
-
secretId: string;
|
|
78
|
-
secretKey: string;
|
|
79
|
-
/** 存储桶名,v4 和 v5 版本不一样 */
|
|
80
|
-
bucket: string;
|
|
81
|
-
appId: string;
|
|
82
|
-
/** 存储区域,例如 ap-beijing-1 */
|
|
83
|
-
area: string;
|
|
84
|
-
/** 自定义存储路径,比如 img/ */
|
|
85
|
-
path: string;
|
|
86
|
-
/** 自定义域名,注意要加 `http://` 或者 `https://` */
|
|
87
|
-
customUrl: string;
|
|
88
|
-
/** COS 版本,v4 或者 v5 */
|
|
89
|
-
version: 'v5' | 'v4';
|
|
90
|
-
}
|
|
91
|
-
/** GitHub 图床配置项 */
|
|
92
|
-
export interface IGithubConfig {
|
|
93
|
-
/** 仓库名,格式是 `username/reponame` */
|
|
94
|
-
repo: string;
|
|
95
|
-
/** github token */
|
|
96
|
-
token: string;
|
|
97
|
-
/** 自定义存储路径,比如 `img/` */
|
|
98
|
-
path: string;
|
|
99
|
-
/** 自定义域名,注意要加 `http://` 或者 `https://` */
|
|
100
|
-
customUrl: string;
|
|
101
|
-
/** 分支名,默认是 `master` */
|
|
102
|
-
branch: string;
|
|
103
|
-
}
|
|
104
|
-
/** 阿里云图床配置项 */
|
|
105
|
-
export interface IAliyunConfig {
|
|
106
|
-
accessKeyId: string;
|
|
107
|
-
accessKeySecret: string;
|
|
108
|
-
/** 存储空间名 */
|
|
109
|
-
bucket: string;
|
|
110
|
-
/** 存储区域代号 */
|
|
111
|
-
area: string;
|
|
112
|
-
/** 自定义存储路径 */
|
|
113
|
-
path: string;
|
|
114
|
-
/** 自定义域名,注意要加 `http://` 或者 `https://` */
|
|
115
|
-
customUrl: string;
|
|
116
|
-
/** 针对图片的一些后缀处理参数 PicGo 2.2.0+ PicGo-Core 1.4.0+ */
|
|
117
|
-
options: string;
|
|
118
|
-
}
|
|
119
|
-
/** Imgur 图床配置项 */
|
|
120
|
-
export interface IImgurConfig {
|
|
121
|
-
/** imgur 的 `clientId` */
|
|
122
|
-
clientId: string;
|
|
123
|
-
/** 代理地址,仅支持 http 代理 */
|
|
124
|
-
proxy: string;
|
|
125
|
-
}
|
|
126
|
-
/** PicGo 配置文件类型定义 */
|
|
127
|
-
export interface IConfig {
|
|
128
|
-
picBed: {
|
|
129
|
-
uploader: string;
|
|
130
|
-
current?: string;
|
|
131
|
-
smms?: ISmmsConfig;
|
|
132
|
-
qiniu?: IQiniuConfig;
|
|
133
|
-
upyun?: IUpyunConfig;
|
|
134
|
-
tcyun?: ITcyunConfig;
|
|
135
|
-
github?: IGithubConfig;
|
|
136
|
-
aliyun?: IAliyunConfig;
|
|
137
|
-
imgur?: IImgurConfig;
|
|
138
|
-
webdavplist?: IWebdavPlistConfig;
|
|
139
|
-
transformer?: string;
|
|
140
|
-
proxy: string;
|
|
141
|
-
};
|
|
142
|
-
picgoPlugins: Record<string, boolean>;
|
|
143
|
-
debug?: boolean;
|
|
144
|
-
silent?: boolean;
|
|
145
|
-
settings?: {
|
|
146
|
-
logLevel: string;
|
|
147
|
-
logPath: string;
|
|
148
|
-
};
|
|
149
|
-
/** 下载插件时 npm 命令自定义的 registry */
|
|
150
|
-
registry: string;
|
|
151
|
-
}
|
|
152
|
-
/**
|
|
153
|
-
* for plugin
|
|
154
|
-
*/
|
|
155
|
-
export interface IPlugin {
|
|
156
|
-
handle: ((ctx: PicGo) => Promise<any>) | ((ctx: PicGo) => void);
|
|
157
|
-
[propName: string]: any;
|
|
158
|
-
}
|
|
159
|
-
/**
|
|
160
|
-
* for spawn output
|
|
161
|
-
*/
|
|
162
|
-
export interface IResult {
|
|
163
|
-
code: number;
|
|
164
|
-
data: string;
|
|
165
|
-
}
|
|
166
|
-
/**
|
|
167
|
-
* for transformer - path
|
|
168
|
-
*/
|
|
169
|
-
export interface IImgSize {
|
|
170
|
-
width: number;
|
|
171
|
-
height: number;
|
|
172
|
-
real?: boolean;
|
|
173
|
-
}
|
|
174
|
-
/**
|
|
175
|
-
* for initUtils
|
|
176
|
-
*/
|
|
177
|
-
export interface IOptions {
|
|
178
|
-
template: string;
|
|
179
|
-
dest: string;
|
|
180
|
-
hasSlash: boolean;
|
|
181
|
-
inPlace: boolean;
|
|
182
|
-
clone: boolean;
|
|
183
|
-
offline: boolean;
|
|
184
|
-
tmp: string;
|
|
185
|
-
project: string;
|
|
186
|
-
}
|
|
187
|
-
/**
|
|
188
|
-
* for clipboard image
|
|
189
|
-
*/
|
|
190
|
-
export interface IClipboardImage {
|
|
191
|
-
imgPath: string;
|
|
192
|
-
isExistFile: boolean;
|
|
193
|
-
}
|
|
194
|
-
/**
|
|
195
|
-
* for install command environment variable
|
|
196
|
-
*/
|
|
197
|
-
export type IProcessEnv = Record<string, Undefinable<string>>;
|
|
198
|
-
export type ILogArgvType = string | number;
|
|
199
|
-
export type ILogArgvTypeWithError = ILogArgvType | Error;
|
|
200
|
-
export type Nullable<T> = T | null;
|
|
201
|
-
export type Undefinable<T> = T | undefined;
|