Skip to content

Commit 2fc151b

Browse files
Adding samples for rich samples browser and node
1 parent 988502c commit 2fc151b

44 files changed

Lines changed: 2204 additions & 900 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,8 @@ src/**/*.js.map
1414
src/**/*.d.ts
1515

1616
samples/node/secrets.json
17-
samples/browser/secrets.js
18-
samples/typescript/sample.js
19-
samples/typescript/sample.d.ts
20-
samples/typescript/graph-typings.d.ts
21-
samples/typescript/sample.js.map
17+
samples/browser/src/secrets.js
18+
samples/browser/src/graph-js-sdk-core.js
2219

2320
spec/**/*.js
2421
spec/**/*.d.ts

.vscode/launch.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"type": "node",
99
"request": "launch",
1010
"name": "Run node samples",
11-
"program": "${workspaceRoot}/samples/node/node-sample.js",
11+
"program": "${workspaceRoot}/samples/node/main.js",
1212
"cwd": "${workspaceRoot}",
1313
"outFiles": [],
1414
"internalConsoleOptions": "openOnSessionStart"

docs/CreatingClientInstance.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Library is shipped with one such authentication provider named [MSALAuthenticati
1717
let clientOptions: ClientOptions = {
1818
authProvider: new MSALAuthenticationProvider(<CLIENT_ID>, <SCOPES>, <OPTIONS>)
1919
};
20-
const client = new Client(clientOptions);
20+
const client = Client.initWithMiddleware(clientOptions);
2121
```
2222

2323
Want to use own preferred authentication library, for which one has to implement [AuthenticationProvider](../src/IAuthenticationProvider.ts) interface and pass in the instance of it as `authProvider` in [ClientOptions](../src/IClientOptions.ts).
@@ -27,7 +27,7 @@ let clientOptions: ClientOptions = {
2727
// MyCustomAuthenticationProvider is the user's own authentication provider implementing AuthenticationProvider interface
2828
authProvider: new MyCustomAuthenticationProvider()
2929
};
30-
const client = new Client(clientOptions);
30+
const client = Client.initWithMiddleware(clientOptions);
3131
```
3232

3333
Refer, [custom authentication provider](./CustomAuthenticationProvider.md) for more detailed information.
@@ -42,7 +42,7 @@ let clientOptions: ClientOptions = {
4242
// MyFirstMiddleware is the first middleware in my custom middleware chain
4343
middleware: new MyFirstMiddleware()
4444
};
45-
const client = new Client(clientOptions);
45+
const client = Client.initWithMiddleware(clientOptions);
4646
```
4747

4848
Refer, [custom middleware chain](./CustomMiddlewareChain.md) for more detailed information.

docs/CustomAuthenticationProvider.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,5 @@ import { MyAuthenticationProvider } from "./MyAuthenticationProvider";
3535
let clientOptions: ClientOptions = {
3636
authProvider: new MyCustomAuthenticationProvider()
3737
};
38-
const client = new Client(clientOptions);
38+
const client = Client.initWithMiddleware(clientOptions);
3939
```

docs/CustomMiddlewareChain.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ Pass first middleware in the chain for initializing the client.
9393
let clientOptions: ClientOptions = {
9494
middleware: authenticationHandler
9595
};
96-
const client = new Client(clientOptions);
96+
const client = Client.initWithMiddleware(clientOptions);
9797
```
9898

9999
## Passing Options for Middleware

lib/graph-js-sdk-core.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.

lib/graph-js-sdk-web.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.

lib/spec/core/Client.js

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

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

0 commit comments

Comments
 (0)