piclist 1.3.7 → 1.3.9
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/bin/{picgo-server → picgo-server.js} +13 -12
- package/bin/{picgo → picgo.js} +7 -4
- package/dist/core/Lifecycle.d.ts +1 -1
- package/dist/core/PicGo.d.ts +5 -5
- package/dist/dirname.d.ts +1 -0
- package/dist/i18n/en.d.ts +1 -1
- package/dist/i18n/index.d.ts +3 -4
- package/dist/i18n/zh-TW.d.ts +1 -1
- package/dist/index.d.ts +10 -10
- package/dist/index.esm.js +2 -2
- package/dist/lib/Commander.d.ts +1 -1
- package/dist/lib/LifecyclePlugins.d.ts +1 -1
- package/dist/lib/Logger.d.ts +1 -1
- package/dist/lib/PluginHandler.d.ts +1 -1
- package/dist/lib/PluginLoader.d.ts +1 -1
- package/dist/lib/Request.d.ts +1 -1
- package/dist/plugins/beforetransformer/compress.d.ts +1 -1
- package/dist/plugins/beforetransformer/watermark.d.ts +1 -1
- package/dist/plugins/beforeupload/buildInRename.d.ts +1 -1
- package/dist/plugins/commander/config.d.ts +1 -1
- package/dist/plugins/commander/i18n.d.ts +1 -1
- package/dist/plugins/commander/index.d.ts +1 -1
- package/dist/plugins/commander/init.d.ts +1 -1
- package/dist/plugins/commander/pluginHandler.d.ts +1 -1
- package/dist/plugins/commander/proxy.d.ts +1 -1
- package/dist/plugins/commander/setting.d.ts +1 -1
- package/dist/plugins/commander/upload.d.ts +1 -1
- package/dist/plugins/commander/use.d.ts +1 -1
- package/dist/plugins/transformer/base64.d.ts +1 -1
- package/dist/plugins/transformer/index.d.ts +1 -1
- package/dist/plugins/transformer/path.d.ts +1 -1
- package/dist/plugins/uploader/aliyun.d.ts +1 -1
- package/dist/plugins/uploader/github.d.ts +1 -1
- package/dist/plugins/uploader/imgur.d.ts +1 -1
- package/dist/plugins/uploader/index.d.ts +1 -1
- package/dist/plugins/uploader/local.d.ts +1 -1
- package/dist/plugins/uploader/piclist.d.ts +1 -1
- package/dist/plugins/uploader/qiniu.d.ts +1 -1
- package/dist/plugins/uploader/sftp.d.ts +1 -1
- package/dist/plugins/uploader/smms.d.ts +1 -1
- package/dist/plugins/uploader/tcyun.d.ts +1 -1
- package/dist/plugins/uploader/telegraph.d.ts +1 -1
- package/dist/plugins/uploader/upyun.d.ts +1 -1
- package/dist/plugins/uploader/webdav.d.ts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/utils/common.d.ts +1 -1
- package/dist/utils/createContext.d.ts +1 -1
- package/dist/utils/db.d.ts +2 -2
- package/dist/utils/getClipboardImage.d.ts +1 -1
- package/dist/utils/initUtils.d.ts +1 -1
- package/dist/utils/interfaces.d.ts +3 -3
- package/dist/utils/sshClient.d.ts +1 -1
- package/package.json +6 -5
- package/rollup.config.js +2 -18
- package/dist/index.cjs.js +0 -2
- /package/{.eslintrc.js → .eslintrc.cjs} +0 -0
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
|
|
3
|
+
import http from 'http'
|
|
4
|
+
import multer from 'multer'
|
|
5
|
+
import axios from 'axios'
|
|
6
|
+
import minimist from 'minimist'
|
|
7
|
+
import fs from 'fs-extra'
|
|
8
|
+
import path from 'path'
|
|
9
|
+
import os from 'os'
|
|
9
10
|
|
|
10
11
|
const tempDir = path.join(os.homedir(), '.piclist', 'serverTemp')
|
|
11
12
|
fs.ensureDirSync(tempDir)
|
|
@@ -67,11 +68,11 @@ if (configPath !== true && configPath !== '') {
|
|
|
67
68
|
} else {
|
|
68
69
|
configPath = ''
|
|
69
70
|
}
|
|
70
|
-
|
|
71
|
+
import { PicGo } from '../dist/index.esm.js'
|
|
71
72
|
const picgo = new PicGo(configPath)
|
|
72
73
|
const errorMessage = 'Upload failed, please check your network and config'
|
|
73
74
|
|
|
74
|
-
handleResponse
|
|
75
|
+
function handleResponse ({
|
|
75
76
|
response,
|
|
76
77
|
statusCode = 200,
|
|
77
78
|
header = {
|
|
@@ -83,7 +84,7 @@ handleResponse = ({
|
|
|
83
84
|
body = {
|
|
84
85
|
success: false
|
|
85
86
|
}
|
|
86
|
-
})
|
|
87
|
+
}) {
|
|
87
88
|
if (body && body.success === false) {
|
|
88
89
|
console.log('[PicList Server] upload failed, see log for more detail ↑')
|
|
89
90
|
}
|
|
@@ -92,7 +93,7 @@ handleResponse = ({
|
|
|
92
93
|
response.end()
|
|
93
94
|
}
|
|
94
95
|
|
|
95
|
-
ensureHTTPLink
|
|
96
|
+
function ensureHTTPLink (url) {
|
|
96
97
|
return url.startsWith('http') ? url : `http://${url}`
|
|
97
98
|
}
|
|
98
99
|
|
|
@@ -372,4 +373,4 @@ class Server {
|
|
|
372
373
|
const server = new Server()
|
|
373
374
|
server.startup()
|
|
374
375
|
|
|
375
|
-
|
|
376
|
+
export default server
|
package/bin/{picgo → picgo.js}
RENAMED
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
|
|
3
|
+
import { resolve } from 'path'
|
|
4
|
+
import minimist from 'minimist'
|
|
4
5
|
const argv = minimist(process.argv.slice(2))
|
|
5
6
|
let configPath = argv.c || argv.config || ''
|
|
6
7
|
if (configPath !== true && configPath !== '') {
|
|
7
|
-
configPath =
|
|
8
|
+
configPath = resolve(configPath)
|
|
8
9
|
} else {
|
|
9
10
|
configPath = ''
|
|
10
11
|
}
|
|
11
|
-
|
|
12
|
+
|
|
13
|
+
import { PicGo } from '../dist/index.esm.js'
|
|
14
|
+
|
|
12
15
|
const picgo = new PicGo(configPath)
|
|
13
16
|
picgo.registerCommands()
|
|
14
17
|
|
package/dist/core/Lifecycle.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { EventEmitter } from 'events';
|
|
3
|
-
import { type IPicGo } from '../types';
|
|
3
|
+
import { type IPicGo } from '../types/index.js';
|
|
4
4
|
export declare class Lifecycle extends EventEmitter {
|
|
5
5
|
private readonly ctx;
|
|
6
6
|
private readonly ttfLink;
|
package/dist/core/PicGo.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { EventEmitter } from 'events';
|
|
3
|
-
import Commander from '../lib/Commander';
|
|
4
|
-
import { Logger } from '../lib/Logger';
|
|
5
|
-
import { type IHelper, type IImgInfo, type IPicGo, type IStringKeyMap, type IPluginLoader, type II18nManager, type IPicGoPlugin, type IPicGoPluginInterface, type IRequest } from '../types';
|
|
6
|
-
import Request from '../lib/Request';
|
|
7
|
-
import PluginHandler from '../lib/PluginHandler';
|
|
3
|
+
import Commander from '../lib/Commander.js';
|
|
4
|
+
import { Logger } from '../lib/Logger.js';
|
|
5
|
+
import { type IHelper, type IImgInfo, type IPicGo, type IStringKeyMap, type IPluginLoader, type II18nManager, type IPicGoPlugin, type IPicGoPluginInterface, type IRequest } from '../types/index.js';
|
|
6
|
+
import Request from '../lib/Request.js';
|
|
7
|
+
import PluginHandler from '../lib/PluginHandler.js';
|
|
8
8
|
export declare class PicGo extends EventEmitter implements IPicGo {
|
|
9
9
|
private _config;
|
|
10
10
|
private lifecycle;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const projectRoot: string;
|
package/dist/i18n/en.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type ILocales } from './zh-CN';
|
|
1
|
+
import { type ILocales } from './zh-CN.js';
|
|
2
2
|
export declare const EN: ILocales;
|
package/dist/i18n/index.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { type ILocalesKey } from './zh-CN';
|
|
2
|
-
import { type IPicGo } from '../types';
|
|
3
|
-
import { type
|
|
4
|
-
import { type ILocale } from '@picgo/i18n/dist/types';
|
|
1
|
+
import { type ILocalesKey } from './zh-CN.js';
|
|
2
|
+
import { type IPicGo, type IStringKeyMap, type II18nManager } from '../types/index.js';
|
|
3
|
+
import { type ILocale } from '@picgo/i18n/dist/types/index.js';
|
|
5
4
|
declare class I18nManager implements II18nManager {
|
|
6
5
|
private readonly i18n;
|
|
7
6
|
private readonly objectAdapter;
|
package/dist/i18n/zh-TW.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type ILocales } from './zh-CN';
|
|
1
|
+
import { type ILocales } from './zh-CN.js';
|
|
2
2
|
export declare const ZH_TW: ILocales;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export { PicGo } from './core/PicGo';
|
|
2
|
-
export { Lifecycle } from './core/Lifecycle';
|
|
3
|
-
export { Logger } from './lib/Logger';
|
|
4
|
-
export { PluginHandler } from './lib/PluginHandler';
|
|
5
|
-
export { LifecyclePlugins } from './lib/LifecyclePlugins';
|
|
6
|
-
export { Commander } from './lib/Commander';
|
|
7
|
-
export { PluginLoader } from './lib/PluginLoader';
|
|
8
|
-
export { Request } from './lib/Request';
|
|
9
|
-
export * as PicGoUtils from './utils/common';
|
|
10
|
-
export * from './types';
|
|
1
|
+
export { PicGo } from './core/PicGo.js';
|
|
2
|
+
export { Lifecycle } from './core/Lifecycle.js';
|
|
3
|
+
export { Logger } from './lib/Logger.js';
|
|
4
|
+
export { PluginHandler } from './lib/PluginHandler.js';
|
|
5
|
+
export { LifecyclePlugins } from './lib/LifecyclePlugins.js';
|
|
6
|
+
export { Commander } from './lib/Commander.js';
|
|
7
|
+
export { PluginLoader } from './lib/PluginLoader.js';
|
|
8
|
+
export { Request } from './lib/Request.js';
|
|
9
|
+
export * as PicGoUtils from './utils/common.js';
|
|
10
|
+
export * from './types/index.js';
|