Skip to content

Commit 749359a

Browse files
committed
📦 Chore: create oldRequest types
1 parent 62b2e6b commit 749359a

File tree

5 files changed

+32
-41
lines changed

5 files changed

+32
-41
lines changed

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@
6666
"@types/mime-types": "^2.1.0",
6767
"@types/minimatch": "^3.0.3",
6868
"@types/node": "16.11.7",
69-
"@types/request-promise-native": "^1.0.15",
7069
"@types/resolve": "^0.0.8",
7170
"@types/rimraf": "^3.0.0",
7271
"@types/tunnel": "^0.0.3",

src/types/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Command } from 'commander'
22
import { Inquirer } from 'inquirer'
3-
import { RequestPromiseOptions } from 'request-promise-native'
3+
import { IRequestPromiseOptions } from './oldRequest'
44

55
export interface IPicGo extends NodeJS.EventEmitter {
66
/**
@@ -163,7 +163,7 @@ export interface IRequestOld {
163163
request: import('axios').AxiosInstance
164164
}
165165

166-
export type IOldReqOptions = Omit<RequestPromiseOptions & {
166+
export type IOldReqOptions = Omit<IRequestPromiseOptions & {
167167
url: string
168168
}, 'auth'>
169169

src/types/oldRequest.ts

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
export type IMethod =
2+
| 'get' | 'GET'
3+
| 'delete' | 'DELETE'
4+
| 'head' | 'HEAD'
5+
| 'options' | 'OPTIONS'
6+
| 'post' | 'POST'
7+
| 'put' | 'PUT'
8+
| 'patch' | 'PATCH'
9+
| 'purge' | 'PURGE'
10+
| 'link' | 'LINK'
11+
| 'unlink' | 'UNLINK'
12+
13+
export interface IHeaders {
14+
[key: string]: any
15+
}
16+
17+
export interface IRequestPromiseOptions {
18+
baseUrl?: string | undefined
19+
url?: string
20+
method?: IMethod
21+
formData?: { [key: string]: any } | undefined
22+
qs?: any
23+
json?: boolean
24+
body?: any
25+
resolveWithFullResponse?: boolean
26+
headers?: IHeaders
27+
proxy?: any
28+
timeout?: number
29+
}

src/utils/common.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// import requestPromise from 'request-promise-native'
21
import axios from 'axios'
32
import fs from 'fs-extra'
43
import path from 'path'

yarn.lock

Lines changed: 1 addition & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -464,11 +464,6 @@
464464
dependencies:
465465
bson "*"
466466

467-
"@types/caseless@*":
468-
version "0.12.2"
469-
resolved "https://registry.yarnpkg.com/@types/caseless/-/caseless-0.12.2.tgz#f65d3d6389e01eeb458bd54dc8f52b95a9463bc8"
470-
integrity sha512-6ckxMjBBD8URvjB6J3NcnuAn5Pkl7t3TizAg+xdlzzQGSPSmBcXf8KoIH0ua/i+tio+ZRUHEXp0HEmvaR4kt0w==
471-
472467
"@types/cross-spawn@^6.0.0":
473468
version "6.0.2"
474469
resolved "https://registry.yarnpkg.com/@types/cross-spawn/-/cross-spawn-6.0.2.tgz#168309de311cd30a2b8ae720de6475c2fbf33ac7"
@@ -600,23 +595,6 @@
600595
resolved "https://registry.yarnpkg.com/@types/parse-json/-/parse-json-4.0.0.tgz#2f8bb441434d163b35fb8ffdccd7138927ffb8c0"
601596
integrity sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==
602597

603-
"@types/request-promise-native@^1.0.15":
604-
version "1.0.18"
605-
resolved "https://registry.yarnpkg.com/@types/request-promise-native/-/request-promise-native-1.0.18.tgz#437ee2d0b772e01c9691a983b558084b4b3efc2c"
606-
integrity sha512-tPnODeISFc/c1LjWyLuZUY+Z0uLB3+IMfNoQyDEi395+j6kTFTTRAqjENjoPJUid4vHRGEozoTrcTrfZM+AcbA==
607-
dependencies:
608-
"@types/request" "*"
609-
610-
"@types/request@*":
611-
version "2.48.7"
612-
resolved "https://registry.yarnpkg.com/@types/request/-/request-2.48.7.tgz#a962d11a26e0d71d9a9913d96bb806dc4d4c2f19"
613-
integrity sha512-GWP9AZW7foLd4YQxyFZDBepl0lPsWLMEXDZUjQ/c1gqVPDPECrRZyEzuhJdnPWioFCq3Tv0qoGpMD6U+ygd4ZA==
614-
dependencies:
615-
"@types/caseless" "*"
616-
"@types/node" "*"
617-
"@types/tough-cookie" "*"
618-
form-data "^2.5.0"
619-
620598
"@types/resolve@1.17.1":
621599
version "1.17.1"
622600
resolved "https://registry.yarnpkg.com/@types/resolve/-/resolve-1.17.1.tgz#3afd6ad8967c77e4376c598a82ddd58f46ec45d6"
@@ -747,11 +725,6 @@
747725
dependencies:
748726
"@types/node" "*"
749727

750-
"@types/tough-cookie@*":
751-
version "4.0.1"
752-
resolved "https://registry.yarnpkg.com/@types/tough-cookie/-/tough-cookie-4.0.1.tgz#8f80dd965ad81f3e1bc26d6f5c727e132721ff40"
753-
integrity sha512-Y0K95ThC3esLEYD6ZuqNek29lNX2EM1qxV8y2FTLUB0ff5wWrk7az+mLrnNFUnaXcgKye22+sFBRXOgpPILZNg==
754-
755728
"@types/tunnel@^0.0.3":
756729
version "0.0.3"
757730
resolved "https://registry.npmmirror.com/@types/tunnel/-/tunnel-0.0.3.tgz#f109e730b072b3136347561fc558c9358bb8c6e9"
@@ -1346,7 +1319,7 @@ color-name@~1.1.4:
13461319
resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2"
13471320
integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==
13481321

1349-
combined-stream@^1.0.6, combined-stream@^1.0.8:
1322+
combined-stream@^1.0.8:
13501323
version "1.0.8"
13511324
resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f"
13521325
integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==
@@ -2616,15 +2589,6 @@ follow-redirects@^1.14.9:
26162589
resolved "https://registry.npmmirror.com/follow-redirects/-/follow-redirects-1.15.1.tgz#0ca6a452306c9b276e4d3127483e29575e207ad5"
26172590
integrity sha512-yLAMQs+k0b2m7cVxpS1VKJVvoz7SS9Td1zss3XRwXj+ZDH00RJgnuLx7E44wx02kQLrdM3aOOy+FpzS7+8OizA==
26182591

2619-
form-data@^2.5.0:
2620-
version "2.5.1"
2621-
resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.5.1.tgz#f2cbec57b5e59e23716e128fe44d4e5dd23895f4"
2622-
integrity sha512-m21N3WOmEEURgk6B9GLOE4RuWOFf28Lhh9qGYeNlGq4VDXUlJy2th2slBNU8Gp8EzloYZOibZJ7t5ecIrFSjVA==
2623-
dependencies:
2624-
asynckit "^0.4.0"
2625-
combined-stream "^1.0.6"
2626-
mime-types "^2.1.12"
2627-
26282592
form-data@^4.0.0:
26292593
version "4.0.0"
26302594
resolved "https://registry.npmmirror.com/form-data/-/form-data-4.0.0.tgz#93919daeaf361ee529584b9b31664dc12c9fa452"

0 commit comments

Comments
 (0)