piclist 1.3.9 → 1.6.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/bin/{picgo.js → picgo} +4 -7
- package/bin/{picgo-server.js → picgo-server} +12 -13
- package/dist/core/Lifecycle.d.ts +1 -1
- package/dist/core/PicGo.d.ts +5 -5
- package/dist/i18n/en.d.ts +1 -1
- package/dist/i18n/index.d.ts +4 -3
- package/dist/i18n/zh-TW.d.ts +1 -1
- package/dist/index.cjs.js +2 -0
- 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 +9 -10
- package/rollup.config.js +19 -3
- package/dist/dirname.d.ts +0 -1
- /package/{.eslintrc.cjs → .eslintrc.js} +0 -0
package/bin/{picgo.js → picgo}
RENAMED
|
@@ -1,17 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import minimist from 'minimist'
|
|
2
|
+
const path = require('path')
|
|
3
|
+
const minimist = require('minimist')
|
|
5
4
|
const argv = minimist(process.argv.slice(2))
|
|
6
5
|
let configPath = argv.c || argv.config || ''
|
|
7
6
|
if (configPath !== true && configPath !== '') {
|
|
8
|
-
configPath = resolve(configPath)
|
|
7
|
+
configPath = path.resolve(configPath)
|
|
9
8
|
} else {
|
|
10
9
|
configPath = ''
|
|
11
10
|
}
|
|
12
|
-
|
|
13
|
-
import { PicGo } from '../dist/index.esm.js'
|
|
14
|
-
|
|
11
|
+
const { PicGo } = require('..')
|
|
15
12
|
const picgo = new PicGo(configPath)
|
|
16
13
|
picgo.registerCommands()
|
|
17
14
|
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
import os from 'os'
|
|
2
|
+
const http = require('http')
|
|
3
|
+
const multer = require('multer')
|
|
4
|
+
const axios = require('axios')
|
|
5
|
+
const minimist = require('minimist')
|
|
6
|
+
const fs = require('fs-extra')
|
|
7
|
+
const path = require('path')
|
|
8
|
+
const os = require('os')
|
|
10
9
|
|
|
11
10
|
const tempDir = path.join(os.homedir(), '.piclist', 'serverTemp')
|
|
12
11
|
fs.ensureDirSync(tempDir)
|
|
@@ -68,11 +67,11 @@ if (configPath !== true && configPath !== '') {
|
|
|
68
67
|
} else {
|
|
69
68
|
configPath = ''
|
|
70
69
|
}
|
|
71
|
-
|
|
70
|
+
const { PicGo } = require('..')
|
|
72
71
|
const picgo = new PicGo(configPath)
|
|
73
72
|
const errorMessage = 'Upload failed, please check your network and config'
|
|
74
73
|
|
|
75
|
-
|
|
74
|
+
handleResponse = ({
|
|
76
75
|
response,
|
|
77
76
|
statusCode = 200,
|
|
78
77
|
header = {
|
|
@@ -84,7 +83,7 @@ function handleResponse ({
|
|
|
84
83
|
body = {
|
|
85
84
|
success: false
|
|
86
85
|
}
|
|
87
|
-
}) {
|
|
86
|
+
}) => {
|
|
88
87
|
if (body && body.success === false) {
|
|
89
88
|
console.log('[PicList Server] upload failed, see log for more detail ↑')
|
|
90
89
|
}
|
|
@@ -93,7 +92,7 @@ function handleResponse ({
|
|
|
93
92
|
response.end()
|
|
94
93
|
}
|
|
95
94
|
|
|
96
|
-
|
|
95
|
+
ensureHTTPLink = url => {
|
|
97
96
|
return url.startsWith('http') ? url : `http://${url}`
|
|
98
97
|
}
|
|
99
98
|
|
|
@@ -373,4 +372,4 @@ class Server {
|
|
|
373
372
|
const server = new Server()
|
|
374
373
|
server.startup()
|
|
375
374
|
|
|
376
|
-
|
|
375
|
+
module.exports = server
|
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';
|
|
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';
|
|
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';
|
|
8
8
|
export declare class PicGo extends EventEmitter implements IPicGo {
|
|
9
9
|
private _config;
|
|
10
10
|
private lifecycle;
|
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';
|
|
2
2
|
export declare const EN: ILocales;
|
package/dist/i18n/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { type ILocalesKey } from './zh-CN
|
|
2
|
-
import { type IPicGo
|
|
3
|
-
import { type
|
|
1
|
+
import { type ILocalesKey } from './zh-CN';
|
|
2
|
+
import { type IPicGo } from '../types';
|
|
3
|
+
import { type IStringKeyMap, type II18nManager } from '../types/index';
|
|
4
|
+
import { type ILocale } from '@picgo/i18n/dist/types';
|
|
4
5
|
declare class I18nManager implements II18nManager {
|
|
5
6
|
private readonly i18n;
|
|
6
7
|
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';
|
|
2
2
|
export declare const ZH_TW: ILocales;
|