Skip to content

Commit cc0f188

Browse files
committed
Changed [string] to string[], fixed spacing, fixed double parens
1 parent 2d22130 commit cc0f188

File tree

11 files changed

+511
-471
lines changed

11 files changed

+511
-471
lines changed

lib/graph-js-sdk-web.js

Lines changed: 389 additions & 367 deletions
Large diffs are not rendered by default.

lib/spec/core/urlGeneration.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export {};

lib/spec/core/urlGeneration.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.

lib/spec/core/urlParsing.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export {};

lib/spec/core/urlParsing.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.

lib/src/GraphRequest.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ export declare class GraphRequest {
1717
private urlJoin(urlSegments);
1818
buildFullUrl(): string;
1919
version(v: string): GraphRequest;
20-
select(properties: string | [string]): GraphRequest;
21-
expand(properties: string | [string]): GraphRequest;
22-
orderby(properties: string | [string]): GraphRequest;
20+
select(properties: string | string[]): GraphRequest;
21+
expand(properties: string | string[]): GraphRequest;
22+
orderby(properties: string | string[]): GraphRequest;
2323
filter(filterStr: string): GraphRequest;
2424
top(n: number): GraphRequest;
2525
skip(n: number): GraphRequest;

lib/src/GraphRequest.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.

lib/src/ResponseHandler.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.

lib/src/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.

samples/node/node-sample.js

Lines changed: 45 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ const client = MicrosoftGraph.init({
1515
}
1616
});
1717

18+
/*
19+
1820
// Get the name of the authenticated user with callbacks
1921
client
2022
.api('/me')
@@ -27,7 +29,8 @@ client
2729
console.log(res.displayName);
2830
});
2931
30-
/*
32+
33+
3134
// Get the name of the authenticated user with promises
3235
client
3336
.api('/me')
@@ -39,11 +42,14 @@ client
3942
console.log(err);
4043
});
4144
45+
*/
46+
4247
// Update the authenticated users birthday.
4348
client
4449
.api('/me')
50+
.header("content-type", "application/json")
4551
.update(
46-
{"birthday": "1908-12-22T00:00:00Z"},
52+
{ "birthday": "1908-12-22T00:00:00Z" },
4753
(err, res) => {
4854
if (err) {
4955
console.log(err);
@@ -54,6 +60,11 @@ client
5460
);
5561

5662

63+
64+
65+
/*
66+
67+
5768
// GET /users
5869
client
5970
.api('/users')
@@ -74,12 +85,13 @@ client
7485
.select("displayName")
7586
.get((err, res) => {
7687
if (err) {
77-
console.log(err)
88+
console.
89+
console.log("%c" + err, 'color: #bada55')
7890
return;
7991
}
80-
const topContacts = res.value.map((u) => {return u.displayName});
92+
const topContacts = res.value.map((u) => { return u.displayName });
8193
console.log("Your top contacts are", topContacts.join(", "));
82-
});
94+
});
8395
8496
8597
// Use promises instead of callbacks
@@ -92,7 +104,7 @@ client
92104
console.log(res.displayName);
93105
})
94106
.catch(console.error);
95-
107+
96108
// Find my top 5 contacts on the beta endpoint
97109
// .select() can be called multiple times
98110
client
@@ -115,7 +127,7 @@ const mail = {
115127
subject: "MicrosoftGraph JavaScript SDK Samples",
116128
toRecipients: [{
117129
emailAddress: {
118-
address: "example@example.com"
130+
address: "mmainer@microsoft.com"
119131
}
120132
}],
121133
body: {
@@ -127,7 +139,7 @@ const mail = {
127139
client
128140
.api('/users/me/sendMail')
129141
.post(
130-
{message: mail},
142+
{ message: mail },
131143
(err, res) => {
132144
if (err)
133145
console.log(err);
@@ -145,30 +157,33 @@ client
145157
return;
146158
}
147159
var upcomingEventNames = []
148-
for (var i=0; i<res.value.length; i++) {
160+
for (var i = 0; i < res.value.length; i++) {
149161
upcomingEventNames.push(res.value[i].subject);
150162
}
151163
console.log("My calendar events include", upcomingEventNames.join(", "))
152164
})
153165
166+
*/
154167

155168
// URL substitution example
156-
let userIds = [secrets.userId1,
157-
secrets.userId2];
158-
159-
for (let i=0; i<userIds.length; i++) {
160-
let fetchUser = client
161-
.api(`/me/people/${userIds[i]}`)
162-
.version('beta')
163-
.select('displayName')
164-
.get((err, res) => {
165-
if (err) {
166-
console.log(err)
167-
return;
168-
}
169-
console.log(res.displayName)
170-
})
171-
}
169+
// let userIds = [secrets.userId1,
170+
// secrets.userId2];
171+
172+
// for (let i = 0; i < userIds.length; i++) {
173+
// let fetchUser = client
174+
// .api(`/me/people/${userIds[i]}`)
175+
// .version('beta')
176+
// .select('displayName')
177+
// .get((err, res) => {
178+
// if (err) {
179+
// console.log(err)
180+
// return;
181+
// }
182+
// console.log(res.displayName)
183+
// })
184+
// }
185+
186+
/*
172187
173188
// Find my top 5 contacts
174189
client
@@ -201,8 +216,8 @@ client
201216
.api('/me')
202217
.select("displayName")
203218
.header('foo1', 'bar1')
204-
.headers({'foo2': 'bar2'}) //.headers() for object, .header() for 2 params
205-
.headers({'foo3': 'bar3', 'foo4': 'bar4'})
219+
.headers({ 'foo2': 'bar2' }) //.headers() for object, .header() for 2 params
220+
.headers({ 'foo3': 'bar3', 'foo4': 'bar4' })
206221
.get((err, res) => {
207222
if (err) {
208223
console.log(err)
@@ -221,6 +236,9 @@ client
221236
console.log(res)
222237
})
223238
239+
*/
240+
241+
/*
224242
225243
// Download a file from OneDrive
226244
let fs = require('fs'); // requires filesystem module

0 commit comments

Comments
 (0)