Skip to content

Commit b025e0c

Browse files
Merge branch 'dev' into LargeFileUploadTask
2 parents de10426 + cadb721 commit b025e0c

20 files changed

+150
-51
lines changed

CHANGELOG.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
## Changelog
2+
3+
### 1.2.0
4+
Updates
5+
6+
* 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.

README.md

Lines changed: 21 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,14 @@ The Microsoft Graph JavaScript client library is a lightweight wrapper around th
1818

1919
### Browser
2020

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.
24+
```html
25+
<script type="text/javascript" src="graph-js-sdk-core.js"></script>
26+
```
27+
28+
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.
2229
```html
2330
<script type="text/javascript" src="graph-js-sdk-web.js"></script>
2431
```
@@ -241,7 +248,19 @@ You can pass in additional request headers, either individually or in a dictiona
241248
````
242249

243250
### .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.
252+
````js
253+
client
254+
.api(`/me/drive/root/children/${fileName}/content`)
255+
.responseType(MicrosoftGraph.ResponseType.BLOB)
256+
.get()
257+
.then((res) => {
258+
console.log("Downloaded..!!");
259+
})
260+
.catch((err) => {
261+
throw err;
262+
});
263+
````
245264

246265
## Running node samples
247266
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:
@@ -313,28 +332,6 @@ We'd love to get your feedback about the Microsoft Graph JavaScript client libra
313332

314333
## Contributing
315334
Please see the [contributing guidelines](CONTRIBUTING.md).
316-
## Changelog
317-
318-
#### 1.0.0
319-
* Added tests for new Graph functionality - Delta query, Extensibility, OneNote, and more.
320-
321-
#### 0.4.0
322-
* Add support for ES5. Make sure to use `graph-js-sdk-web.js` for web apps
323-
* Removed iterator helper method.
324-
325-
#### 0.3.1
326-
* Support for Node.js versions 4 and 5
327-
328-
#### 0.3.0
329-
* Migrated away from typings in client library core and TypeScript sample
330-
331-
#### 0.2.2
332-
* Updated SuperAgent to version ``` 3.3.0 ```
333-
334-
#### 0.2.0
335-
* **Breaking change for existing apps** - Initialize the client library with `MicrosoftGraph.Client.init({...})`. See the updated usage section below for code samples.
336-
* Added response handling tests to simulate Graph calls
337-
* Added type declarations file for core client library, which adds intellisense for chained methods.
338335

339336

340337
## Additional resources

core-browserify.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
var browserify = require('browserify');
2+
var b = browserify();
3+
b.add('./browser-wrapper.js');
4+
b.external("es6-promise");
5+
b.external("isomorphic-fetch");
6+
b.bundle().pipe(process.stdout);

lib/graph-js-sdk-core.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/src/GraphRequest.js

Lines changed: 10 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/src/ResponseType.d.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
export declare enum ResponseType {
2+
ARRAYBUFFER = "arraybuffer",
3+
BLOB = "blob",
4+
DOCUMENT = "document",
5+
JSON = "json",
6+
STREAM = "stream",
7+
TEXT = "text"
8+
}

lib/src/ResponseType.js

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/src/ResponseType.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/src/common.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
export declare let oDataQueryNames: string[];
22
export declare const DEFAULT_VERSION = "v1.0";
33
export declare const GRAPH_BASE_URL = "https://graph.microsoft.com/";
4-
export declare const PACKAGE_VERSION = "1.1.0";
4+
export declare const PACKAGE_VERSION = "1.2.0";
55
export interface AuthProviderCallback {
66
(error: any, accessToken: string): void;
77
}

lib/src/common.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)