Skip to content

Commit 0a57f8b

Browse files
authored
Merge pull request #31 from microsoftgraph/fix-return-type-on-http-actions
Removed void return type from HTTP actions
2 parents 4afb18b + 9434d51 commit 0a57f8b

File tree

3 files changed

+19
-19
lines changed

3 files changed

+19
-19
lines changed

lib/graph-js-sdk-web.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2239,8 +2239,8 @@ exports.cleanHeader = function(header, shouldStripCookie){
22392239

22402240
},{}],13:[function(require,module,exports){
22412241
module.exports={
2242-
"name": "msgraph-sdk-javascript",
2243-
"version": "0.3.1",
2242+
"name": "@microsoft/microsoft-graph-client",
2243+
"version": "0.3.2",
22442244
"description": "Microsoft Graph Client Library",
22452245
"main": "lib/src/index.js",
22462246
"typings": "lib/src/index",

lib/src/GraphRequest.d.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ export declare class GraphRequest {
2525
count(count: boolean): GraphRequest;
2626
responseType(responseType: string): GraphRequest;
2727
private addCsvQueryParamater(propertyName, propertyValue, additionalProperties);
28-
delete(callback?: GraphRequestCallback): Promise<any> | void;
29-
patch(content: any, callback?: GraphRequestCallback): Promise<any> | void;
30-
post(content: any, callback?: GraphRequestCallback): Promise<any> | void;
31-
put(content: any, callback?: GraphRequestCallback): Promise<any> | void;
32-
create(content: any, callback?: GraphRequestCallback): Promise<any> | void;
33-
update(content: any, callback?: GraphRequestCallback): Promise<any> | void;
34-
del(callback?: GraphRequestCallback): Promise<any> | void;
35-
get(callback?: GraphRequestCallback): Promise<any> | void;
28+
delete(callback?: GraphRequestCallback): Promise<any>;
29+
patch(content: any, callback?: GraphRequestCallback): Promise<any>;
30+
post(content: any, callback?: GraphRequestCallback): Promise<any>;
31+
put(content: any, callback?: GraphRequestCallback): Promise<any>;
32+
create(content: any, callback?: GraphRequestCallback): Promise<any>;
33+
update(content: any, callback?: GraphRequestCallback): Promise<any>;
34+
del(callback?: GraphRequestCallback): Promise<any>;
35+
get(callback?: GraphRequestCallback): Promise<any>;
3636
private routeResponseToPromise(requestBuilder);
3737
private routeResponseToCallback(requestBuilder, callback);
3838
private sendRequestAndRouteResponse(requestBuilder, callback?);

src/GraphRequest.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -195,12 +195,12 @@ export class GraphRequest {
195195
}
196196

197197

198-
delete(callback?:GraphRequestCallback):Promise<any>|void {
198+
delete(callback?:GraphRequestCallback):Promise<any> {
199199
let url = this.buildFullUrl();
200200
return this.sendRequestAndRouteResponse(request.del(url), callback)
201201
}
202202

203-
patch(content:any, callback?:GraphRequestCallback):Promise<any>|void {
203+
patch(content:any, callback?:GraphRequestCallback):Promise<any> {
204204
let url = this.buildFullUrl();
205205

206206
return this.sendRequestAndRouteResponse(
@@ -211,7 +211,7 @@ export class GraphRequest {
211211
);
212212
}
213213

214-
post(content:any, callback?:GraphRequestCallback):Promise<any>|void {
214+
post(content:any, callback?:GraphRequestCallback):Promise<any> {
215215
let url = this.buildFullUrl();
216216
return this.sendRequestAndRouteResponse(
217217
request
@@ -221,7 +221,7 @@ export class GraphRequest {
221221
);
222222
}
223223

224-
put(content:any, callback?:GraphRequestCallback):Promise<any>|void {
224+
put(content:any, callback?:GraphRequestCallback):Promise<any> {
225225
let url = this.buildFullUrl();
226226
return this.sendRequestAndRouteResponse(
227227
request
@@ -234,20 +234,20 @@ export class GraphRequest {
234234

235235
// request aliases
236236
// alias for post
237-
create(content:any, callback?:GraphRequestCallback):Promise<any>|void {
237+
create(content:any, callback?:GraphRequestCallback):Promise<any> {
238238
return this.post(content, callback);
239239
}
240240

241241
// alias for patch
242-
update(content:any, callback?:GraphRequestCallback):Promise<any>|void {
242+
update(content:any, callback?:GraphRequestCallback):Promise<any> {
243243
return this.patch(content, callback);
244244
}
245245

246-
del(callback?:GraphRequestCallback):Promise<any>|void {
246+
del(callback?:GraphRequestCallback):Promise<any> {
247247
return this.delete(callback);
248248
}
249249

250-
get(callback?:GraphRequestCallback):Promise<any>|void {
250+
get(callback?:GraphRequestCallback):Promise<any> {
251251
let url = this.buildFullUrl();
252252
return this.sendRequestAndRouteResponse(
253253
request
@@ -288,7 +288,7 @@ export class GraphRequest {
288288
* Help method that's called from the final actions( .get(), .post(), etc.) that after making the request either invokes
289289
* routeResponseToCallback() or routeResponseToPromise()
290290
*/
291-
private sendRequestAndRouteResponse(requestBuilder:request.SuperAgentRequest, callback?:GraphRequestCallback):Promise<any>|void {
291+
private sendRequestAndRouteResponse(requestBuilder:request.SuperAgentRequest, callback?:GraphRequestCallback):Promise<any> {
292292
// return a promise when Promises are supported and no callback was provided
293293
if (callback == null && typeof Promise !== "undefined") {
294294
return this.routeResponseToPromise(requestBuilder);

0 commit comments

Comments
 (0)