You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Two output js files, one with polyfills for Fetch-API and ES6-Promises ([lib/graph-js-sdk-web.js](./lib/graph-js-sdk-web.js)) and one without ([lib/graph-js-sdk-core.js](./lib/graph-js-sdk-core.js))
7
+
[Refer [README.md](https://github.com/microsoftgraph/msgraph-sdk-javascript#browser) for usage]
8
+
* Enum for ResponseType, which lists down the available ResponseType options in autocomplete
9
+
10
+
Bug Fix
11
+
* Cannot access the property "request-id" of undefined in GraphError handling
12
+
13
+
### 1.1.0
14
+
New Features
15
+
* Support for Multipart POST request
16
+
17
+
Updates
18
+
* Light weight FetchAPI dependency (in replacement for SuperAgent)
19
+
20
+
Bug Fixes
21
+
* Updated putStream and getStream to work for all sized files
22
+
* Added obfuscation for output js file (graph-js-sdk-web.js)
23
+
* Updated versions of mocha and chai to 5.2.0 and 4.1.2 to fix security vulnerability in growl (which is a dependency of mocha)
24
+
* Running unit test files under types directory
25
+
* Compiling ts files
26
+
27
+
#### 1.0.0
28
+
* Added tests for new Graph functionality - Delta query, Extensibility, OneNote, and more.
29
+
30
+
#### 0.4.0
31
+
* Add support for ES5. Make sure to use `graph-js-sdk-web.js` for web apps
32
+
* Removed iterator helper method.
33
+
34
+
#### 0.3.1
35
+
* Support for Node.js versions 4 and 5
36
+
37
+
#### 0.3.0
38
+
* Migrated away from typings in client library core and TypeScript sample
39
+
40
+
#### 0.2.2
41
+
* Updated SuperAgent to version ``` 3.3.0 ```
42
+
43
+
#### 0.2.0
44
+
***Breaking change for existing apps** - Initialize the client library with `MicrosoftGraph.Client.init({...})`. See the updated usage section below for code samples.
45
+
* Added response handling tests to simulate Graph calls
46
+
* Added type declarations file for core client library, which adds intellisense for chained methods.
Copy file name to clipboardExpand all lines: README.md
+36-26Lines changed: 36 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,14 @@ The Microsoft Graph JavaScript client library is a lightweight wrapper around th
18
18
19
19
### Browser
20
20
21
-
Include [lib/graph-js-sdk-web.js](https://github.com/microsoftgraph/msgraph-sdk-javascript/raw/master/lib/graph-js-sdk-web.js) in your page.
21
+
The library comes with two varieties of options, you can pick one based on your use case
22
+
23
+
1. If your application has polyfills for **Fetch-API** and **ES6-Promise**, then can just include [lib/graph-js-sdk-core.js](./lib/graph-js-sdk-core.js) in your page.
2. If your application does not have polyfills for **Fetch-API** and **ES6-Promise**, then you have to include [lib/graph-js-sdk-web.js](./lib/graph-js-sdk-web.js) in your page.
let stream =fs.createReadStream('./logo.png'); //path to local file
152
159
client
153
160
.api('/me/drive/root/children/logo.png/content') // path to the destination in OneDrive
154
-
.put(stream, (err) => {
161
+
.putStream(stream, (err) => {
155
162
console.log(err);
156
163
});
157
164
````
@@ -241,7 +248,29 @@ You can pass in additional request headers, either individually or in a dictiona
241
248
````
242
249
243
250
### .responseType()
244
-
To set a custom response type, use the `.responseType(string)` method. To see an example, check the [browser sample](samples/browser/index.html) that downloads an image and displays it in an `<img>` element.
251
+
To set a custom response type, use the `.responseType(<ResponseType>)` method. Refer [ResponseType.ts](./src/ResponseType.ts) for available options.
You can run and debug the node samples found under [./samples/node/node-sample.js](./samples/node/node-sample.js) by running the *Run node samples* configuration from the **Debug** (Ctrl + Shift + D) menu in Visual Studio Code. Alternately, you can run the node samples from the CLI by entering `node ./samples/node/node-sample.js` (assuming you are at the root of this repo). You'll need to rename the *secrets.example.json* file to *secrets.json* and add a valid access token to it. You can get an access token by doing the following:
267
+
1. Go to [Graph Explorer](https://developer.microsoft.com/en-us/graph/graph-explorer).
268
+
2. Login with the account you want to use to run the node samples.
269
+
3. Open the F12 dev tools.
270
+
4. Type `tokenPlease()` into the console to get an access token.
271
+
5. Copy the access token and put it into the *secrets.json* file and save the file.
272
+
273
+
We suggest that you become acquainted with these samples as they show some of the main use scenarios for this client library.
245
274
246
275
## Additional information
247
276
### Options in `MicrosoftGraph.Client.init()`
@@ -287,7 +316,7 @@ These steps are not required to use this library.
287
316
288
317
```npm pack``` bundles the npm module.
289
318
290
-
```npm test``` runs tests of the core library (URL parsing, mock responses, etc)
319
+
```npm test``` runs tests of the core library (URL parsing, mock responses, etc). You can also set breakpoints and run this from within Visual Studio Code by selecting the *Run core test* configuration from the Debug view.
291
320
292
321
```npm run test:types``` to run tests against the Graph API for users, groups, Excel, OneNote, etc.
293
322
@@ -303,28 +332,6 @@ We'd love to get your feedback about the Microsoft Graph JavaScript client libra
303
332
304
333
## Contributing
305
334
Please see the [contributing guidelines](CONTRIBUTING.md).
306
-
## Changelog
307
-
308
-
#### 1.0.0
309
-
* Added tests for new Graph functionality - Delta query, Extensibility, OneNote, and more.
310
-
311
-
#### 0.4.0
312
-
* Add support for ES5. Make sure to use `graph-js-sdk-web.js` for web apps
313
-
* Removed iterator helper method.
314
-
315
-
#### 0.3.1
316
-
* Support for Node.js versions 4 and 5
317
-
318
-
#### 0.3.0
319
-
* Migrated away from typings in client library core and TypeScript sample
320
-
321
-
#### 0.2.2
322
-
* Updated SuperAgent to version ``` 3.3.0 ```
323
-
324
-
#### 0.2.0
325
-
***Breaking change for existing apps** - Initialize the client library with `MicrosoftGraph.Client.init({...})`. See the updated usage section below for code samples.
326
-
* Added response handling tests to simulate Graph calls
327
-
* Added type declarations file for core client library, which adds intellisense for chained methods.
328
335
329
336
330
337
## Additional resources
@@ -339,3 +346,6 @@ Please see the [contributing guidelines](CONTRIBUTING.md).
339
346
Copyright (c) Microsoft Corporation. All rights reserved.
340
347
341
348
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [[email protected]](mailto:[email protected]) with any additional questions or comments.
349
+
350
+
## Third Party Notices
351
+
See [Third Party Notices](https://github.com/microsoftgraph/msgraph-sdk-javascript/blob/master/THIRD%20PARTY%20NOTICES) for information on the packages that are included in the [package.json](https://github.com/microsoftgraph/msgraph-sdk-javascript/blob/master/package.json)
This file is based on or incorporates material from the projects listed below (Third Party OSS). The original copyright notice and the license under which Microsoft received such Third Party OSS, are set forth below. Such licenses and notices are provided for informational purposes only. Microsoft licenses the Third Party OSS to you under the licensing terms for the Microsoft product or service. Microsoft
2
+
reserves all other rights not expressly granted under this agreement, whether by implication, estoppel or otherwise.
3
+
4
+
superagent - 3.5.2
5
+
6
+
es6-promise - 4.1.0
7
+
8
+
Provided for Informational Purposes Only
9
+
10
+
MIT License
11
+
12
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the Software), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
13
+
14
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
15
+
16
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
0 commit comments