Commit Graph

53 Commits

Author SHA1 Message Date
Andy Hanson
45c9246c09 Remove esModuleInterop from tsconfigs (no longer mandatory) 2018-02-14 14:55:13 -08:00
Andy
bef4d2b27d
Enable "esModuleInterop" in all tsconfigs (#23354) 2018-02-05 11:01:56 -08:00
Matt R. Wilson
8433a74d30 [@types/request] Fill out Request and Response. (#23004)
* [@types/request] Fill out Request and Response.

This hold much more true to the actual lib where a `Request` and
`Response` reference each other and the `Request` has most of the
provided options merged onto it, plus other stuff.

Makes use of the newly added `@types/caseless` to DRY up some of the
header work.

Updated version reference from 2.0 to 2.47 to cover both the addition of
`caseless` and the removal of `getAgent` from the lib.

I have a project that uses `request-promise-native`, these changes work
in my testing and having the `Response` object typed allowed me to
remove all my declaration merging files from the `request` namespace.

* [@types/request] Update promise sub-libs.

Update `request-promise` and `request-promise-native` to use new
`Response` interface.
2018-01-29 11:57:16 -08:00
Niklas Mollenhauer
29b272bc7b Narrow some interface type members (#23106) 2018-01-22 08:58:16 -08:00
Matt R. Wilson
5ba5faa1de [@types/request] Lint fix. (#22874)
I had two PRs merge close together that caused the build to fail.
- #22809 fixed a bug
- #22821 removed all the overrides from `tslint.json`
Unfortunately, the former ended up with a couple lint issues.
```
./types/request/index.d.ts
ERROR: 64:20  unified-signatures  This overload and the one on line 63
can be combined into one signature taking `string | RequiredUriUrl &
TOptions`.

./types/request/request-tests.ts
ERROR: 10:5   prefer-const        Identifier 'value' is never
reassigned; use 'const' instead of 'let'.
```
2018-01-16 09:41:33 -08:00
Matt R. Wilson
dada969cd6 [@types/request] Fix initParam return type. (#22809) 2018-01-12 11:54:51 -08:00
Matt R. Wilson
f687ec5a6b [@types/request] Fix lints (#22821)
* [@types/request] Fix lints: ban-types.

Replace generic `Function` types with appropriate `(...): <T>`.

* [@types/request] Fix lints:no-duplicate-variable.

* [@types/request] Fix lints:no-inferrable-types.

* [@types/request] Fix lints:no-misused-new.

* [@types/request] Fix lints:no-var-keyword.

* [@types/request] Fix lints:object-literal-shorthand.

* [@types/request] Fix lints:prefer-const.

* [@types/request] Fix lints: strict-export-declare-modifiers.

* [@types/request] Fix lints: unified-signatures.
2018-01-12 11:54:20 -08:00
Matt R. Wilson
0b3ad10e81 [@types/request] Update cookie implementation. (#22165)
Add `@types/tough-cookie` as a dependency to correctly implement the
structure used by requests.
https://github.com/request/request/blob/master/lib/cookies.js
2018-01-09 11:24:38 -08:00
Matt R. Wilson
888c6e79ab
Fill out initParams of RequestAPI.
This method has the same signature as the verb functions as the args get
passed directly to `initParams` from all the verb functions.
https://github.com/request/request/blob/master/index.js#L58-L5
2017-11-28 08:43:05 -07:00
segayuu
fd1c81d5df cleanup lint error: object-literal-key-quotes 2017-10-30 12:31:52 +09:00
segayuu
ee5526f862 cleanup lint error: callable-types 2017-10-30 12:25:29 +09:00
segayuu
fb7564f1c0 cleanup lint error: no-consecutive-blank-lines 2017-10-30 12:22:26 +09:00
segayuu
0e3e3e4c81 cleanup lint error: triple-equals 2017-10-30 12:20:55 +09:00
segayuu
964a5b5515 cleanup lint error: prefer-template 2017-10-30 12:13:40 +09:00
segayuu
63cf38db03 cleanup lint error: no-var-requires 2017-10-30 11:55:47 +09:00
segayuu
9e6d73176f cleanup lint error: one-variable-per-declaration 2017-10-30 11:54:20 +09:00
segayuu
c775fd5830 cleanup lint error: no-void-expression 2017-10-30 11:49:50 +09:00
segayuu
6cffeea864 cleanup lint error: prefer-switch 2017-10-30 11:46:03 +09:00
segayuu
0a487b74a2 cleanup lint error: array-type 2017-10-30 11:43:07 +09:00
segayuu
cf4b4fd2ba cleanup ignore errors 2017-10-30 11:41:23 +09:00
segayuu
fd9dffdd7c cleanup lint error: semicolon 2017-10-30 11:23:03 +09:00
segayuu
7439f6d08f cleanup lint errors: whitespace, typedef-whitespace, space-within-parens, space-before-function-paren 2017-10-30 11:20:34 +09:00
segayuu
a2e8bfda4e cleanup lint error: ban-comma-operator 2017-10-30 11:16:35 +09:00
segayuu
8d2da56ea5 cleanup lint error: arrow-return-shorthand 2017-10-30 11:15:24 +09:00
segayuu
0339b28f80 cleanup lint error: one-line 2017-10-30 11:13:49 +09:00
segayuu
a3adeb702e Cleanup lint error: only-arrow-functions 2017-10-30 11:09:29 +09:00
segayuu
3c49d1b237 cleanup lint error: no-padding 2017-10-30 11:03:19 +09:00
segayuu
2dde57da14 cleanup lint error: comment-format 2017-10-30 10:57:56 +09:00
segayuu
b00a7ff72a cleanup lint error: trim-file 2017-10-30 10:54:58 +09:00
segayuu
d1806394be cleanup lint error: dt-header 2017-10-30 10:53:49 +09:00
segayuu
bde113c702 cleanup lint error: no-trailing-whitespace 2017-10-30 10:51:31 +09:00
Andy
19f89399e4 Ensure every package has a tslint.json (#21009)
* Ensure every package has a tslint.json

* Fixes
2017-10-25 11:13:50 -07:00
Oliver Joseph Ash
2be8cb24b6 Correct return type of Node querystring.parse (#20651)
* Correct return type of Node querystring.parse

https://nodejs.org/api/querystring.html#querystring_querystring_parse_str_sep_eq_options

* request-promise-native: require TS 2.2 to fix error from Node typings

* Node querystring.parse: return type: query value as array of strings

* Fix tests for request, request-promise, request-promise-native
2017-10-18 08:51:36 -07:00
Valérian Galliat
e9c47be75e request: response request always have an URI (#20526) 2017-10-16 13:38:41 -07:00
segayuu
90649b73fe [Bluebird] cleanup lint errors (#20449)
* Cleanup Lint Error: ban-types

* Cleanup lint error: unified-signatures(exclude Promise.props())

* Cleanup lint error: array-type

* Setting max-line-length not to exceed current length

* Cleanup lint error: one-line

* Cleanup lint error: lintstrict-export-declare-modifiers

* [request] toJSON() return Object => object
2017-10-12 13:41:30 -07:00
Andy
947a8fb761 Enable strictFunctionTypes (#20373) 2017-10-06 14:03:03 -07:00
Oz Weiss
19de2783df OAuthOptions.body_hash (#20182) 2017-10-04 11:03:19 -07:00
Jon Stevens
8887543504 Add optional tunnel boolean 2017-08-18 17:08:01 +07:00
Andy
5d6c651a1a Apply stricter lint rules (#19063) 2017-08-17 14:53:41 -07:00
Martin Zagora
c85c55bfe1 fixing request tests to pass strictNullChecks (#18596) 2017-08-14 13:19:51 -07:00
Vesa Poikajärvi
ece0190b35 [request] Add rejectUnauthorized to options (#18784) 2017-08-14 12:03:16 -07:00
cjbarth
d00caf8115 REQUEST: Add version number for correct version of @types npm package (#18026)
* Add version number for correct version of @types npm package

* Remove duplicate property
2017-07-17 11:11:28 -07:00
Max Winderbaum
40e971e511 Remove duplicate 'time' identifier in @types/request (#18077) 2017-07-17 11:06:58 -07:00
Silas Rech
01366d9625 Add timing properties (#18000) 2017-07-17 11:01:20 -07:00
Ryan Cavanaugh
b171a741f1 Merge pull request #17894 from wong2/patch-3
[request] Add time option to CoreOptions
2017-07-13 14:31:34 -07:00
Wang Dàpéng
814578c060 [request] Add time option to CoreOptions 2017-07-10 12:16:20 +08:00
Silas Rech
d3864ce144
[request] Add some missing properties 2017-06-30 18:01:44 +02:00
yairm210
787dc502fa Added .withCredentials to CoreOptions
Although not specified on the main page, as per 

b12a6245d9/tests/browser/test.js we can see that this is part of the request module. 

More practically: local testing shows adding the {withCredentials:false} option allows us to create a request that accepts an "*" value for the Access-Control-Allow-Origin header.
2017-06-26 13:15:08 +03:00
Nathan Shively-Sanders
a8ead39f70 Fix weak type errors in request tests 2017-06-16 10:08:42 -07:00
e020873
8455c29f95 [request] fix DefaultUriUrlRequestApi 2017-06-15 09:48:23 +02:00