Skip to content

Commit 3372ee0

Browse files
nikithaucAbrax20darrelmillerkrototypemuthu-rathinam
authored
Preview release/2.2.0 preview.1 (#356)
* FIx Batching Documentation code The code example in the Batching Documentation does not work. The batchResponse is not set in the example code. * Correcting missing import, incorrect reference in example (#326) * Release - 2.1.0 (#338) * updated broken link in README * Post request with empty body, now working fine. * updated the tests for this case * made change to use undefined instead of null as classname * added functionality to simplify building middleware chain * Updated GraphRequest.ts for .count() scenario Updated GraphRequest.ts to handle .count() when no parameter is specified * Bumped version to '2.1.0-Preview.1' * Adding the Modifying middleware chain samples * - fixes broken link to client instance * Updated the example to the correct return type * fix casing on filename * Update package.json * Designed ChaosHandler * Removing the set and get middleware chain method * Update README * Update README * Bump lodash from 4.17.15 to 4.17.19 in /samples/browser Bumps [lodash](https://github.com/lodash/lodash) from 4.17.15 to 4.17.19. - [Release notes](https://github.com/lodash/lodash/releases) - [Commits](lodash/lodash@4.17.15...4.17.19) Signed-off-by: dependabot[bot] <[email protected]> * Changed parsepath and query functions to split query params on first equals sign considering nested queries. Added comments to query functions * Correcting spelling in comments, setting the param key directlyand replacing ternary condition with if else * Adding a buildheaders function to conditionally set content type and checking if body is null when serializing content * Altering condition to be optimal Co-authored-by: Mustafa Zengin <[email protected]> * Adding formdata to the node project, setting the esModuleInterop config as true for allowing import of npm modules, adding unit test for application/xhtml+xml content type post * Adding a private query parsing function and more validations * Adding tests for url parsing and comments to the private url parsing functions * Adding more information in the return comments for functions returning the GraphRequest instance * Adding unit test for serializecontent testing if content is null, changed content type setting for put and patch * Changing the conditional expression to check for undefined or null headers Co-authored-by: Mustafa Zengin <[email protected]> * Adding the missing return Co-authored-by: Mustafa Zengin <[email protected]> * Removing the try catch block from the test case * Removing the try catch block from the test case * Returning if the content-type is present else setting content-type as default * Uninstalling formdata, restoring the tsconfigs and removing the condition to check if form-data is undefined in GraphRequest.ts * Restoring file * Reverting the package json changes * Bump yargs-parser from 13.1.1 to 13.1.2 in /samples/browser (#321) Bumps [yargs-parser](https://github.com/yargs/yargs-parser) from 13.1.1 to 13.1.2. - [Release notes](https://github.com/yargs/yargs-parser/releases) - [Changelog](https://github.com/yargs/yargs-parser/blob/master/docs/CHANGELOG-full.md) - [Commits](https://github.com/yargs/yargs-parser/commits) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump mixin-deep from 1.3.1 to 1.3.2 in /scripts (#301) Bumps [mixin-deep](https://github.com/jonschlinkert/mixin-deep) from 1.3.1 to 1.3.2. - [Release notes](https://github.com/jonschlinkert/mixin-deep/releases) - [Commits](jonschlinkert/mixin-deep@1.3.1...1.3.2) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Vincent Biret <[email protected]> Co-authored-by: nikithauc <[email protected]> * Bump http-proxy from 1.17.0 to 1.18.1 in /samples/browser (#319) Bumps [http-proxy](https://github.com/http-party/node-http-proxy) from 1.17.0 to 1.18.1. - [Release notes](https://github.com/http-party/node-http-proxy/releases) - [Changelog](https://github.com/http-party/node-http-proxy/blob/master/CHANGELOG.md) - [Commits](http-party/node-http-proxy@1.17.0...1.18.1) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Update OneDriveLargeFileUploadTask.ts (#325) * Update OneDriveLargeFileUploadTask.ts Trying to upload files with the '#' or '%' character in the filename ends with network errors of the form - 400 status response "The parameter item does not exist in method getByPath" Encoding the entire URL does not encode URL components correctly. When the SDK's client tries to encode these URL components in the parameters on the call to OneDriveLargeFileUploadTask.create, then the resultant file in OneDrive has the URL encoded filename (as opposed to the user-friendly/decoded filename). Therefore, fix the encoding in the SDK's URL components itself, directly. * Update OneDriveLargeFileUploadTask.ts Fix typo * Update src/tasks/OneDriveLargeFileUploadTask.ts Updated comment Co-authored-by: Mustafa Zengin <[email protected]> * Update OneDriveLargeFileUploadTask.ts Updated comment Co-authored-by: Mustafa Zengin <[email protected]> * Use correct class name (#284) Co-authored-by: Vincent Biret <[email protected]> Co-authored-by: nikithauc <[email protected]> * Typo in documentation example. (#270) Co-authored-by: Vincent Biret <[email protected]> Co-authored-by: nikithauc <[email protected]> * Enhancement/#311 page iterator request options (#318) * Adding request options property to PageIterator * Adding tests for page iterator task to test passing along the headers * using headersinit type for headers * Specifying parameter definition * using constants * Updating function documentation * remove response type, test passing fetchoptions * testing requestOptions set in pageiterator * typos, optional parameters comments * Sorting parameter list - chaoshandleroptions (#334) * Client init with middleware array (#333) * Passing midddleware array in client options * Tests for middleware array * Removing try catch * ifnode condition,chain middleware test * Adding missing exports * Array initialization Co-authored-by: Vincent Biret <[email protected]> * merging with dev * Using spread operator * Checking if middleware is not empty Co-authored-by: Vincent Biret <[email protected]> * Make GraphError real Error (#335) Co-authored-by: nikithauc <[email protected]> * Using ternary shorthand, upgrade preview 2.1.0-2 (#337) * Bump version to 2.1.0 * changing.substring parameter, comments to check middleware * adding tests, urlotherqueryoptions type Co-authored-by: Abhinav Srivastava <[email protected]> Co-authored-by: muthurathinam <[email protected]> Co-authored-by: Vincent Biret <[email protected]> Co-authored-by: warreee <[email protected]> Co-authored-by: Gideon Goldberg <[email protected]> Co-authored-by: Muthurathinam <[email protected]> Co-authored-by: Nikola Metulev <[email protected]> Co-authored-by: Behnam Mohammadi <[email protected]> Co-authored-by: DeVere Dyett <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Mustafa Zengin <[email protected]> Co-authored-by: Michael Mainer <[email protected]> Co-authored-by: Vincent Biret <[email protected]> Co-authored-by: Hari Sridharan <[email protected]> Co-authored-by: Mustafa Zengin <[email protected]> Co-authored-by: mattdenkers <[email protected]> Co-authored-by: lewgordon <[email protected]> Co-authored-by: Olivier Cuypers <[email protected]> * Setting GraphError prototype explicity. Version 2.1.1 (#347) Co-authored-by: Abrax20 <[email protected]> Co-authored-by: Darrel <[email protected]> Co-authored-by: Abhinav Srivastava <[email protected]> Co-authored-by: muthurathinam <[email protected]> Co-authored-by: Vincent Biret <[email protected]> Co-authored-by: warreee <[email protected]> Co-authored-by: Gideon Goldberg <[email protected]> Co-authored-by: Muthurathinam <[email protected]> Co-authored-by: Nikola Metulev <[email protected]> Co-authored-by: Behnam Mohammadi <[email protected]> Co-authored-by: DeVere Dyett <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Mustafa Zengin <[email protected]> Co-authored-by: Michael Mainer <[email protected]> Co-authored-by: Vincent Biret <[email protected]> Co-authored-by: Hari Sridharan <[email protected]> Co-authored-by: Mustafa Zengin <[email protected]> Co-authored-by: mattdenkers <[email protected]> Co-authored-by: lewgordon <[email protected]> Co-authored-by: Olivier Cuypers <[email protected]>
1 parent daa00ca commit 3372ee0

File tree

5 files changed

+12
-3
lines changed

5 files changed

+12
-3
lines changed

package-lock.json

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@microsoft/microsoft-graph-client",
3-
"version": "2.1.0-Preview.2",
3+
"version": "2.2.0-Preview.1",
44
"description": "Microsoft Graph Client Library",
55
"license": "MIT",
66
"main": "lib/src/index.js",

spec/core/GraphErrorHandler.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
import { assert } from "chai";
99

10+
import { GraphError } from "../../src";
1011
import { GraphErrorHandler } from "../../src/GraphErrorHandler";
1112

1213
describe("GraphErrorHandler.ts", () => {
@@ -41,6 +42,7 @@ describe("GraphErrorHandler.ts", () => {
4142

4243
it("Should construct error for error response without innerError property", () => {
4344
const gError = GraphErrorHandler["constructErrorFromResponse"](error, statusCode);
45+
assert.isTrue(gError instanceof GraphError);
4446
assert.equal(gError.statusCode, statusCode);
4547
assert.equal(gError.requestId, null);
4648
});
@@ -50,6 +52,7 @@ describe("GraphErrorHandler.ts", () => {
5052
"request-id": "some random id",
5153
};
5254
const gError = GraphErrorHandler["constructErrorFromResponse"](error, statusCode);
55+
assert.isTrue(gError instanceof GraphError);
5356
assert.equal(gError.statusCode, statusCode);
5457
assert.equal(gError.requestId, "some random id");
5558
});
@@ -62,6 +65,7 @@ describe("GraphErrorHandler.ts", () => {
6265
date,
6366
};
6467
const gError = GraphErrorHandler["constructErrorFromResponse"](error, statusCode);
68+
assert.isTrue(gError instanceof GraphError);
6569
assert.equal(gError.statusCode, statusCode);
6670
assert.equal(gError.requestId, "some random id");
6771
assert.equal(gError.date.toUTCString(), date.toUTCString());
@@ -81,6 +85,7 @@ describe("GraphErrorHandler.ts", () => {
8185
},
8286
};
8387
const gError = await GraphErrorHandler.getError(errorResponse);
88+
assert.isTrue(gError instanceof GraphError);
8489
assert.equal(gError.requestId, "some random id");
8590
assert.equal(gError.code, "500");
8691
assert.equal(gError.message, "Internal Server Error");
@@ -90,13 +95,15 @@ describe("GraphErrorHandler.ts", () => {
9095
const error = new Error("Some Error");
9196
error.name = "InvalidError";
9297
const gError = await GraphErrorHandler.getError(error);
98+
assert.isTrue(gError instanceof GraphError);
9399
assert.equal(gError.requestId, null);
94100
assert.equal(gError.message, "Some Error");
95101
assert.equal(gError.code, "InvalidError");
96102
});
97103

98104
it("Should construct some default error", async () => {
99105
const gError = await GraphErrorHandler.getError();
106+
assert.isTrue(gError instanceof GraphError);
100107
assert.equal(gError.message, "");
101108
assert.equal(gError.statusCode, -1);
102109
assert.equal(gError.code, null);

src/GraphError.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ export class GraphError extends Error {
5757
*/
5858
public constructor(statusCode: number = -1, message?: string, baseError?: Error) {
5959
super(message || (baseError && baseError.message));
60+
// https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes#extending-built-ins-like-error-array-and-map-may-no-longer-work
61+
Object.setPrototypeOf(this, GraphError.prototype);
6062
this.statusCode = statusCode;
6163
this.code = null;
6264
this.requestId = null;

src/Version.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212
* @module Version
1313
*/
1414

15-
export const PACKAGE_VERSION = "2.1.0-Preview.2";
15+
export const PACKAGE_VERSION = "2.2.0-Preview.1";

0 commit comments

Comments
 (0)