picgo 1.5.0-alpha.11 → 1.5.0-alpha.13

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.
@@ -2,7 +2,7 @@
2
2
  /// <reference types="node" />
3
3
  import { Command } from 'commander';
4
4
  import { Inquirer } from 'inquirer';
5
- import { RequestPromiseOptions } from 'request-promise-native';
5
+ import { IRequestPromiseOptions } from './oldRequest';
6
6
  export interface IPicGo extends NodeJS.EventEmitter {
7
7
  /**
8
8
  * picgo configPath
@@ -155,15 +155,14 @@ export interface IPluginLoader {
155
155
  export interface IRequestOld {
156
156
  request: import('axios').AxiosInstance;
157
157
  }
158
- export declare type IOldReqOptions = Omit<RequestPromiseOptions & {
158
+ export declare type IOldReqOptions = Omit<IRequestPromiseOptions & {
159
159
  url: string;
160
- resolveWithFullResponse?: true;
161
160
  }, 'auth'>;
162
161
  export declare type IOldReqOptionsWithFullResponse = IOldReqOptions & {
163
162
  resolveWithFullResponse: true;
164
163
  };
165
164
  export declare type IOldReqOptionsWithJSON = IOldReqOptions & {
166
- json: boolean;
165
+ json: true;
167
166
  };
168
167
  /**
169
168
  * for PicGo new request api, the response will be json format
@@ -185,12 +184,12 @@ export declare type IFullResponse<T = any, U = any> = AxiosResponse<T, U> & {
185
184
  statusCode: number;
186
185
  body: T;
187
186
  };
188
- export declare type AxiosResponse<T = any, U = any> = import('axios').AxiosResponse<T, U>;
189
- export declare type AxiosRequestConfig<T = any> = import('axios').AxiosRequestConfig<T>;
187
+ declare type AxiosResponse<T = any, U = any> = import('axios').AxiosResponse<T, U>;
188
+ declare type AxiosRequestConfig<T = any> = import('axios').AxiosRequestConfig<T>;
190
189
  interface IRequestOptionsWithFullResponse {
191
190
  resolveWithFullResponse: true;
192
191
  }
193
- interface IRequestOptionsWithJson {
192
+ interface IRequestOptionsWithJSON {
194
193
  json: true;
195
194
  }
196
195
  interface IRequestOptionsWithResponseTypeArrayBuffer {
@@ -200,7 +199,7 @@ interface IRequestOptionsWithResponseTypeArrayBuffer {
200
199
  * T is the response data type
201
200
  * U is the config type
202
201
  */
203
- export declare type IResponse<T, U> = U extends IRequestOptionsWithFullResponse ? IFullResponse<T, U> : U extends IRequestOptionsWithJson ? T : U extends IRequestOptionsWithResponseTypeArrayBuffer ? Buffer : string;
202
+ export declare type IResponse<T, U> = U extends IRequestOptionsWithFullResponse ? IFullResponse<T, U> : U extends IRequestOptionsWithJSON ? T : U extends IRequestOptionsWithResponseTypeArrayBuffer ? Buffer : U extends IOldReqOptionsWithFullResponse ? IFullResponse<T, U> : U extends IOldReqOptionsWithJSON ? T : U extends IOldReqOptions ? string : U extends IReqOptionsWithBodyResOnly ? T : string;
204
203
  /**
205
204
  * the old request lib will be removed in v1.5.0+
206
205
  * the request options have the following properties
@@ -507,6 +506,9 @@ export interface IConfigChangePayload<T> {
507
506
  configName: string;
508
507
  value: T;
509
508
  }
509
+ export interface ILocale {
510
+ [key: string]: any;
511
+ }
510
512
  export interface II18nManager {
511
513
  /**
512
514
  * translate text
@@ -0,0 +1,19 @@
1
+ export declare type IMethod = 'get' | 'GET' | 'delete' | 'DELETE' | 'head' | 'HEAD' | 'options' | 'OPTIONS' | 'post' | 'POST' | 'put' | 'PUT' | 'patch' | 'PATCH' | 'purge' | 'PURGE' | 'link' | 'LINK' | 'unlink' | 'UNLINK';
2
+ export interface IHeaders {
3
+ [key: string]: any;
4
+ }
5
+ export interface IRequestPromiseOptions {
6
+ baseUrl?: string | undefined;
7
+ url?: string;
8
+ method?: IMethod;
9
+ formData?: {
10
+ [key: string]: any;
11
+ } | undefined;
12
+ qs?: any;
13
+ json?: boolean;
14
+ body?: any;
15
+ resolveWithFullResponse?: boolean;
16
+ headers?: IHeaders;
17
+ proxy?: any;
18
+ timeout?: number;
19
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "picgo",
3
- "version": "1.5.0-alpha.11",
3
+ "version": "1.5.0-alpha.13",
4
4
  "description": "A tool for picture uploading",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
@@ -66,7 +66,6 @@
66
66
  "@types/mime-types": "^2.1.0",
67
67
  "@types/minimatch": "^3.0.3",
68
68
  "@types/node": "16.11.7",
69
- "@types/request-promise-native": "^1.0.15",
70
69
  "@types/resolve": "^0.0.8",
71
70
  "@types/rimraf": "^3.0.0",
72
71
  "@types/tunnel": "^0.0.3",