Skip to content

Commit 159a371

Browse files
committed
Added repo info to package.json, regen lib/
1 parent 8e90023 commit 159a371

File tree

5 files changed

+36
-23
lines changed

5 files changed

+36
-23
lines changed

lib/graph-js-sdk-web.js

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ const GRAPH_BASE_URL = "https://graph.microsoft.com/";
1212
class GraphRequest {
1313
constructor(config, path) {
1414
this.config = config;
15-
this.urlParamSubstitutions = {};
1615
this._headers = {};
1716
this.urlComponents = {
1817
host: this.config.baseUrl,
@@ -29,7 +28,7 @@ class GraphRequest {
2928
message: rawErr.message,
3029
requestId: null,
3130
date: null,
32-
body: rawErr.response.text
31+
body: (rawErr.response !== undefined) ? rawErr.response.text : null
3332
};
3433
try {
3534
let errObj = rawErr.response.body.error;
@@ -93,13 +92,9 @@ class GraphRequest {
9392
return parts.reduce(joiner);
9493
}
9594
buildFullUrl() {
96-
let pathForSubstitutingParams = this.urlComponents.path;
97-
for (var param in this.urlParamSubstitutions) {
98-
pathForSubstitutingParams = pathForSubstitutingParams.replace(new RegExp("{" + param + "}", 'g'), this.urlParamSubstitutions[param]);
99-
}
10095
let url = this.urlJoin([this.urlComponents.host,
10196
this.urlComponents.version,
102-
pathForSubstitutingParams])
97+
this.urlComponents.path])
10398
+ this.createQueryString();
10499
if (this.config.debugLogging) {
105100
console.log(url);
@@ -172,12 +167,6 @@ class GraphRequest {
172167
.post(url)
173168
.send(content), callback);
174169
}
175-
setParam(params) {
176-
for (let key in params) {
177-
this.urlParamSubstitutions[key] = params[key];
178-
}
179-
return this;
180-
}
181170
create(content, callback) {
182171
return this.post(content, callback);
183172
}
@@ -293,9 +282,17 @@ class GraphRequest {
293282
}
294283
}();
295284
}
296-
query(queryDictionary) {
297-
for (let key in queryDictionary) {
298-
this.urlComponents.otherURLQueryParams[key] = queryDictionary[key];
285+
query(queryDictionaryOrString) {
286+
if (typeof queryDictionaryOrString === "string") {
287+
let queryStr = queryDictionaryOrString;
288+
let queryKey = queryStr.split("=")[0];
289+
let queryValue = queryStr.split("=")[1];
290+
this.urlComponents.otherURLQueryParams[queryKey] = queryValue;
291+
}
292+
else {
293+
for (let key in queryDictionaryOrString) {
294+
this.urlComponents.otherURLQueryParams[key] = queryDictionaryOrString[key];
295+
}
299296
}
300297
return this;
301298
}
@@ -1894,7 +1891,7 @@ Emitter.prototype.hasListeners = function(event){
18941891
},{}],8:[function(require,module,exports){
18951892
module.exports={
18961893
"name": "msgraph-sdk-javascript",
1897-
"version": "0.1.0",
1894+
"version": "0.1.1",
18981895
"description": "Microsoft Graph JavaScript SDK",
18991896
"main": "lib/index.js",
19001897
"typings": "lib/index",
@@ -1914,6 +1911,10 @@ module.exports={
19141911
},
19151912
"dependencies": {
19161913
"superagent": "^2.2.0"
1914+
},
1915+
"repository" : {
1916+
"type" : "git",
1917+
"url" : "https://github.com/microsoftgraph/msgraph-sdk-javascript.git"
19171918
}
19181919
}
19191920
},{}]},{},[1]);

lib/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export declare class GraphRequest {
6666
put(stream: any, errorCallback: Function): void;
6767
private configureRequest(requestBuilder, accessToken);
6868
getResultIterator(): IterableIterator<(callback: any) => void>;
69-
query(queryDictionary: {
69+
query(queryDictionaryOrString: string | {
7070
[key: string]: string | number;
7171
}): GraphRequest;
7272
private handleResponse(err, res, callback);

lib/index.js

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

lib/index.js.map

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: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "msgraph-sdk-javascript",
3-
"version": "0.1.0",
3+
"version": "0.1.1",
44
"description": "Microsoft Graph JavaScript SDK",
55
"main": "lib/index.js",
66
"typings": "lib/index",
@@ -20,5 +20,9 @@
2020
},
2121
"dependencies": {
2222
"superagent": "^2.2.0"
23+
},
24+
"repository" : {
25+
"type" : "git",
26+
"url" : "https://github.com/microsoftgraph/msgraph-sdk-javascript.git"
2327
}
2428
}

0 commit comments

Comments
 (0)