Skip to content

Commit 9bc86f5

Browse files
Merge pull request #143 from microsoftgraph/RetryHandler
Implemented RetryHandler
2 parents cf32982 + 50be590 commit 9bc86f5

38 files changed

+736
-82
lines changed

.gitignore

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ coverage
1111
**/*.tgz
1212
npm-debug.log
1313

14-
lib
14+
/lib/*
15+
!/lib/.npmignore
1516

1617
src/**/*.js
1718
src/**/*.js.map
@@ -20,8 +21,9 @@ src/**/*.d.ts
2021
samples/node/secrets.json
2122
samples/browser/src/secrets.js
2223
samples/browser/src/graph-js-sdk-core.js
24+
samples/browser/src/graph-js-sdk-web.js
2325

2426
spec/**/*.js
2527
spec/**/*.d.ts
2628
spec/**/*.js.map
27-
spec/**/secrets.ts
29+
spec/**/secrets.ts

.huskyrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"hooks": {
3-
"pre-commit": "npm run lint && lint-staged && npm run test"
3+
"pre-commit": "lint-staged && npm run lint && npm run test"
44
}
55
}

browserify.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,7 @@
1111
const Browserify = require("browserify");
1212
const browserify = Browserify();
1313
browserify.add("./browser-wrapper.js");
14+
browserify.add("./browser-wrapper-dependency.js");
15+
browserify.exclude("isomorphic-fetch");
16+
browserify.exclude("es6-promise");
1417
browserify.bundle().pipe(process.stdout);

docs/CustomMiddlewareChain.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,4 +144,4 @@ export class MyLoggingHandler implements Middleware {
144144
}
145145
```
146146

147-
Refer [MiddlewareOption](../src/middleware/option/IMiddlewareOption.ts) interface to know its structure.
147+
Refer [MiddlewareOptions](../src/middleware/option/IMiddlewareOptions.ts) interface to know its structure.

docs/OtherAPIs.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,13 @@ try {
9696

9797
## MIDDLEWAREOPTIONS
9898

99-
You can override the client middleware behavior by setting per request middleware options. Use the `.middlewareOptions()` request builder method to add custom middleware behavior for a specific request. The `middlewareOptions()` method takes an array of strongly typed middleware options. These middleware options are an implementation of the [MiddlewareOption](../src/middleware/option/IMiddlewareOption.ts) interface.
99+
You can override the client middleware behavior by setting per request middleware options. Use the `.middlewareOptions()` request builder method to add custom middleware behavior for a specific request. The `middlewareOptions()` method takes an array of strongly typed middleware options. These middleware options are an implementation of the [MiddlewareOptions](../src/middleware/option/IMiddlewareOptions.ts) interface.
100100

101101
```typescript
102102
try {
103103
let res = await client
104104
.api("/me/messages")
105-
.middlewareOptions([new RetryHandlerOption(5000)])
105+
.middlewareOptions([new RetryHandlerOptions(5000)])
106106
.get();
107107
console.log(res);
108108
} catch (error) {

lib/.npmignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.npmignore
2+
spec/

samples/browser/README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,14 @@ Register the application as mentioned in the [Getting Started](../../README.md#1
1414

1515
4. Install the application by `npm install`.
1616

17-
5. Update your `clientId` in [main.js](./src/main.js) file.
17+
5. Rename the [secrets.sample.js](./src/secrets.sample.js) file as **secrets.js**.
1818

19-
6. Run `npm start` to build and start the application.
19+
6. Update your `clientId` in **secret.js** file.
2020

21-
7. Navigate to `http://localhost:8080` in your web browser.
21+
7. Run `npm start` to build and start the application.
2222

23-
8. Sign in with your account.
23+
8. Navigate to `http://localhost:8080` in your web browser.
2424

25-
9. Click on the Options to view the result.
25+
9. Sign in with your account.
26+
27+
10. Click on the Options to view the result.

samples/browser/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "",
55
"main": "./src/main.js",
66
"scripts": {
7-
"copy": "copyfiles -f ../../lib/graph-js-sdk-core.js ./src",
7+
"copy": "copyfiles -f ../../lib/graph-js-sdk-web.js ./src",
88
"start": "npm run copy && light-server --config .lightrc"
99
},
1010
"author": "",

samples/browser/src/index.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
<html>
33
<head>
44
<title>Sample For Browser</title>
5+
<script type="text/javascript" src="./secrets.js"></script>
56
<script src="https://secure.aadcdn.microsoftonline-p.com/lib/0.2.4/js/msal.js"></script>
6-
<script type="text/javascript" src="./graph-js-sdk-core.js"></script>
7+
<script type="text/javascript" src="./graph-js-sdk-web.js"></script>
78
<script type="text/javascript" src="./request.js"></script>
89
<script type="text/javascript" src="./ui.js"></script>
910
<script type="text/javascript" src="./main.js"></script>

samples/browser/src/main.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,11 @@ window.addEventListener(
66
false,
77
);
88

9-
const clientId = "<YOUR_CLIENT_ID>";
10-
119
let client, scopes;
1210
const init = async () => {
13-
scopes = ["user.read", "profile", "User.ReadWrite", "User.Readwrite.All", "User.Invite.All", "contacts.read", "Notes.ReadWrite", "Notes.Read", "Notes.Create", "Files.Read", "Files.Read.All", "Files.ReadWrite", "Files.ReadWrite.All"];
11+
scopes = ["user.read", "profile", "User.ReadWrite", "User.Readwrite.All", "User.Invite.All", "contacts.read", "Notes.ReadWrite", "Notes.Read", "Notes.Create", "Files.Read", "Files.Read.All", "Files.ReadWrite", "Files.ReadWrite.All", "Mail.Read", "Mail.ReadWrite", "Mail.Send"];
1412

15-
let msalProvider = new MicrosoftGraph.MSALAuthenticationProvider(clientId, scopes, {
13+
let msalProvider = new MicrosoftGraph.MSALAuthenticationProvider(Secrets.clientId, scopes, {
1614
redirectUri: "http://localhost:8080",
1715
});
1816
client = new MicrosoftGraph.Client({

0 commit comments

Comments
 (0)