Skip to content

Commit 0043f10

Browse files
authored
Remove timeout option and update node-fetch options (#425)
* Update node-fetch option * add link in readme to cancel request doc
1 parent a2b6dea commit 0043f10

File tree

2 files changed

+60
-56
lines changed

2 files changed

+60
-56
lines changed

README.md

+52-50
Original file line numberDiff line numberDiff line change
@@ -4,41 +4,43 @@
44

55
The Microsoft Graph JavaScript client library is a lightweight wrapper around the Microsoft Graph API that can be used server-side and in the browser.
66

7-
- [Microsoft Graph JavaScript Client Library](#microsoft-graph-javascript-client-library)
8-
- [Installation](#installation)
9-
- [Via npm](#via-npm)
10-
- [Via Script Tag](#via-script-tag)
11-
- [Getting started](#getting-started)
12-
- [1. Register your application](#1-register-your-application)
13-
- [2. Create a Client Instance](#2-create-a-client-instance)
14-
- [3. Make requests to the graph](#3-make-requests-to-the-graph)
15-
- Documentation
16-
- [HTTP Actions](docs/Actions.md)
17-
- [Chained APIs to call Microsoft Graph](docs/CallingPattern.md)
18-
- [OData system query options - Query Parameters](docs/QueryParameters.md)
19-
- [Batch multiple requests into single HTTP request](docs/content/Batching.md)
20-
- [Configurations to your request](docs/OtherAPIs.md)
21-
- [Query](docs/OtherAPIs.md#QUERY)
22-
- [Version](docs/OtherAPIs.md#VERSION)
23-
- [Headers](docs/OtherAPIs.md#HEADER-AND-HEADERS)
24-
- [Options](docs/OtherAPIs.md#OPTION-AND-OPTIONS)
25-
- [MiddlewareOptions](docs/OtherAPIs.md#MIDDLEWAREOPTIONS)
26-
- [ResponseType](docs/OtherAPIs.md#RESPONSETYPE)
27-
- [Upload large files to OneDrive, Outlook, Print API](docs/tasks/LargeFileUploadTask.md)
28-
- [Page Iteration](docs/tasks/PageIterator.md)
29-
- [Getting Raw Response](docs/GettingRawResponse.md)
30-
- [Creating an instance of TokenCredentialAuthenticationProvider](docs/TokenCredentialAuthenticationProvider.md)
31-
- [Questions and comments](#questions-and-comments)
32-
- [Contributing](#contributing)
33-
- [Additional resources](#additional-resources)
34-
- [Third Party Notices](#third-party-notices)
35-
- [Security Reporting](#security-reporting)
36-
- [License](#license)
37-
- [We Value and Adhere to the Microsoft Open Source Code of Conduct](#we-value-and-adhere-to-the-microsoft-open-source-code-of-conduct)
7+
- [Microsoft Graph JavaScript Client Library](#microsoft-graph-javascript-client-library)
8+
- [Installation](#installation)
9+
- [Via npm](#via-npm)
10+
- [Via Script Tag](#via-script-tag)
11+
- [Getting started](#getting-started)
12+
- [1. Register your application](#1-register-your-application)
13+
- [2. Create a Client Instance](#2-create-a-client-instance)
14+
- [3. Make requests to the graph](#3-make-requests-to-the-graph)
15+
- Documentation
16+
- [HTTP Actions](docs/Actions.md)
17+
- [Chained APIs to call Microsoft Graph](docs/CallingPattern.md)
18+
- [OData system query options - Query Parameters](docs/QueryParameters.md)
19+
- [Batch multiple requests into single HTTP request](docs/content/Batching.md)
20+
- [Cancel a HTTP request](docs/CancellingAHTTPRequest.md)
21+
- [Configurations to your request](docs/OtherAPIs.md)
22+
- [Query](docs/OtherAPIs.md#QUERY)
23+
- [Version](docs/OtherAPIs.md#VERSION)
24+
- [Headers](docs/OtherAPIs.md#HEADER-AND-HEADERS)
25+
- [Options](docs/OtherAPIs.md#OPTION-AND-OPTIONS)
26+
- [MiddlewareOptions](docs/OtherAPIs.md#MIDDLEWAREOPTIONS)
27+
- [ResponseType](docs/OtherAPIs.md#RESPONSETYPE)
28+
- [Upload large files to OneDrive, Outlook, Print API](docs/tasks/LargeFileUploadTask.md)
29+
- [Page Iteration](docs/tasks/PageIterator.md)
30+
- [Getting Raw Response](docs/GettingRawResponse.md)
31+
- [Creating an instance of TokenCredentialAuthenticationProvider](docs/TokenCredentialAuthenticationProvider.md)
32+
- [Questions and comments](#questions-and-comments)
33+
- [Contributing](#contributing)
34+
- [Additional resources](#additional-resources)
35+
- [Third Party Notices](#third-party-notices)
36+
- [Security Reporting](#security-reporting)
37+
- [License](#license)
38+
- [We Value and Adhere to the Microsoft Open Source Code of Conduct](#we-value-and-adhere-to-the-microsoft-open-source-code-of-conduct)
3839

3940
[![TypeScript demo](https://raw.githubusercontent.com/microsoftgraph/msgraph-sdk-javascript/master/types-demo.PNG)](https://github.com/microsoftgraph/msgraph-typescript-typings)
4041

4142
## Node version requirement
43+
4244
Node.js 10 LTS or higher.
4345

4446
## Installation
@@ -51,11 +53,11 @@ npm install @microsoft/microsoft-graph-client
5153

5254
import `@microsoft/microsoft-graph-client` into your module.
5355

54-
Also, you will need to import any fetch polyfill which suits your requirements.
55-
Following are some fetch polyfills -
56-
* [isomorphic-fetch](https://www.npmjs.com/package/isomorphic-fetch).
57-
* [cross-fetch](https://www.npmjs.com/package/cross-fetch)
58-
* [whatwg-fetch](https://www.npmjs.com/package/whatwg-fetch)
56+
Also, you will need to import any fetch polyfill which suits your requirements. Following are some fetch polyfills -
57+
58+
- [isomorphic-fetch](https://www.npmjs.com/package/isomorphic-fetch).
59+
- [cross-fetch](https://www.npmjs.com/package/cross-fetch)
60+
- [whatwg-fetch](https://www.npmjs.com/package/whatwg-fetch)
5961

6062
```typescript
6163
import "isomorphic-fetch"; // or import the fetch polyfill you installed
@@ -84,20 +86,20 @@ In case your browser doesn't have support for [Fetch](https://developer.mozilla.
8486
```
8587

8688
## Getting started
89+
8790
### 1. Register your application
8891

89-
To call Microsoft Graph, your app must acquire an access token from the Microsoft identity platform.
90-
Learn more about this -
91-
- [Authentication and authorization basics for Microsoft Graph](https://docs.microsoft.com/en-us/graph/auth/auth-concepts)
92-
- [Register your app with the Microsoft identity platform](https://docs.microsoft.com/en-us/graph/auth/auth-concepts)
92+
To call Microsoft Graph, your app must acquire an access token from the Microsoft identity platform. Learn more about this -
93+
94+
- [Authentication and authorization basics for Microsoft Graph](https://docs.microsoft.com/en-us/graph/auth/auth-concepts)
95+
- [Register your app with the Microsoft identity platform](https://docs.microsoft.com/en-us/graph/auth/auth-concepts)
9396

9497
### 2. Create a Client Instance
9598

9699
The Microsoft Graph client is designed to make it simple to make calls to Microsoft Graph. You can use a single client instance for the lifetime of the application.
97100

98101
For information on how to create a client instance, see [Creating Client Instance](./docs/CreatingClientInstance.md)
99102

100-
101103
### 3. Make requests to the graph
102104

103105
Once you have authentication setup and an instance of Client, you can begin to make calls to the service. All requests should start with `client.api(path)` and end with an [action](./docs/Actions.md).
@@ -151,16 +153,16 @@ Please see the [contributing guidelines](CONTRIBUTING.md).
151153

152154
## Additional resources
153155

154-
- [Microsoft Graph website](https://graph.microsoft.io)
156+
- [Microsoft Graph website](https://graph.microsoft.io)
155157

156-
- The Microsoft Graph TypeScript definitions enable editors to provide intellisense on Microsoft Graph objects including users, messages, and groups.
157-
- [@microsoft/microsoft-graph-types](https://www.npmjs.com/package/@microsoft/microsoft-graph-types) or [@types/microsoft-graph](https://www.npmjs.com/package/@types/microsoft-graph)
158-
- [@microsoft/microsoft-graph-types-beta](https://www.npmjs.com/package/@microsoft/microsoft-graph-types-beta)
159-
- [Build React Native apps with Microsoft Graph](https://docs.microsoft.com/en-us/graph/tutorials/react-native)
160-
- [Build Angular single-page apps with Microsoft Graph](https://github.com/microsoftgraph/msgraph-training-angularspa)
161-
- [Build Node.js Express apps with Microsoft Graph](https://github.com/microsoftgraph/msgraph-training-nodeexpressapp)
162-
- [Microsoft Graph Toolkit: UI Components and Authentication Providers for Microsoft Graph](https://docs.microsoft.com/en-us/graph/toolkit/overview)
163-
- [Office Dev Center](http://dev.office.com/)
158+
- The Microsoft Graph TypeScript definitions enable editors to provide intellisense on Microsoft Graph objects including users, messages, and groups.
159+
- [@microsoft/microsoft-graph-types](https://www.npmjs.com/package/@microsoft/microsoft-graph-types) or [@types/microsoft-graph](https://www.npmjs.com/package/@types/microsoft-graph)
160+
- [@microsoft/microsoft-graph-types-beta](https://www.npmjs.com/package/@microsoft/microsoft-graph-types-beta)
161+
- [Build React Native apps with Microsoft Graph](https://docs.microsoft.com/en-us/graph/tutorials/react-native)
162+
- [Build Angular single-page apps with Microsoft Graph](https://github.com/microsoftgraph/msgraph-training-angularspa)
163+
- [Build Node.js Express apps with Microsoft Graph](https://github.com/microsoftgraph/msgraph-training-nodeexpressapp)
164+
- [Microsoft Graph Toolkit: UI Components and Authentication Providers for Microsoft Graph](https://docs.microsoft.com/en-us/graph/toolkit/overview)
165+
- [Office Dev Center](http://dev.office.com/)
164166

165167
## Third Party Notices
166168

src/IFetchOptions.ts

+8-6
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,20 @@
88
/**
99
* @interface {@link https://github.com/bitinn/node-fetch/#options}
1010
* Signature to define the fetch request options for node environment
11-
* @property {number} [follow] - Maximum redirect count. 0 to not follow redirect
12-
* @property {number} [timeout] - Request/Response timeout in milliseconds, it resets on redirect. 0 to disable (OS limit applies)
13-
* @property {number} [compress] - Support gzip/deflate content encoding. false to disable
14-
* @property {number} [size] - Maximum response body size in bytes. 0 to disable
15-
* @property {any} [agent] - HTTP(S).Agent instance, allows custom proxy, certificate, lookup, family etc.
11+
* @property {number} [follow] - node-fetch option: maximum redirect count. 0 to not follow redirect
12+
* @property {number} [compress] - node-fetch option: support gzip/deflate content encoding. false to disable
13+
* @property {number} [size] - node-fetch option: maximum response body size in bytes. 0 to disable
14+
* @property {any} [agent] - node-fetch option: HTTP(S).Agent instance, allows custom proxy, certificate, lookup, family etc.
15+
* @property {number} [highWaterMark] - node-fetch option: maximum number of bytes to store in the internal buffer before ceasing to read from the underlying resource.
16+
* @property {boolean} [insecureHTTPParser] - node-fetch option: use an insecure HTTP parser that accepts invalid HTTP headers when `true`.
1617
*/
1718
export interface NodeFetchInit {
1819
follow?: number;
19-
timeout?: number;
2020
compress?: boolean;
2121
size?: number;
2222
agent?: any;
23+
highWaterMark?: number;
24+
insecureHTTPParser?: boolean;
2325
}
2426

2527
/**

0 commit comments

Comments
 (0)