Skip to content

Commit 21db742

Browse files
author
Eric Koleda
committed
Upgrade lint rules and fix new lint errors.
1 parent 88405dc commit 21db742

16 files changed

+306
-321
lines changed

package-lock.json

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"chai": "4.2.0",
1919
"del": "1.2.1",
2020
"eslint": "4.19.1",
21-
"eslint-config-google": "0.9.1",
21+
"eslint-config-google": "0.14.0",
2222
"fibers": "4.0.2",
2323
"gas-local": "1.3.1",
2424
"gulp": "4.0.2",

samples/ChatWork.gs

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ function run() {
1717
} else {
1818
var authorizationUrl = service.getAuthorizationUrl();
1919
Logger.log('Open the following URL and re-run the script: %s',
20-
authorizationUrl);
20+
authorizationUrl);
2121
}
2222
}
2323

@@ -34,34 +34,33 @@ function reset() {
3434
function getService() {
3535
var scope = 'users.profile.me:read rooms.messages:read';
3636
return OAuth2.createService('ChatWork')
37-
// Set the endpoint URLs.
38-
.setAuthorizationBaseUrl(
39-
'https://www.chatwork.com/packages/oauth2/login.php')
40-
.setTokenUrl('https://oauth.chatwork.com/token')
37+
// Set the endpoint URLs.
38+
.setAuthorizationBaseUrl(
39+
'https://www.chatwork.com/packages/oauth2/login.php')
40+
.setTokenUrl('https://oauth.chatwork.com/token')
4141

42-
// Set the client ID and secret.
43-
.setClientId(CLIENT_ID)
44-
.setClientSecret(CLIENT_SECRET)
42+
// Set the client ID and secret.
43+
.setClientId(CLIENT_ID)
44+
.setClientSecret(CLIENT_SECRET)
4545

46-
// Set the name of the callback function that should be invoked to
47-
// complete the OAuth flow.
48-
.setCallbackFunction('authCallback')
46+
// Set the name of the callback function that should be invoked to
47+
// complete the OAuth flow.
48+
.setCallbackFunction('authCallback')
4949

50-
.setScope(scope)
50+
.setScope(scope)
5151

52-
.setTokenHeaders({
53-
'Authorization': 'Basic ' +
54-
Utilities.base64Encode(CLIENT_ID + ':' + CLIENT_SECRET)
55-
})
56-
// Avoid "invalid_client error".
57-
// This service does not support form field authentication.
58-
.setTokenPayloadHandler(function(tokenPayload) {
59-
delete tokenPayload.client_id;
60-
return tokenPayload;
61-
})
62-
// Set the property store where authorized tokens should be persisted.
63-
.setPropertyStore(PropertiesService.getUserProperties())
64-
;
52+
.setTokenHeaders({
53+
'Authorization': 'Basic ' +
54+
Utilities.base64Encode(CLIENT_ID + ':' + CLIENT_SECRET)
55+
})
56+
// Avoid "invalid_client error".
57+
// This service does not support form field authentication.
58+
.setTokenPayloadHandler(function(tokenPayload) {
59+
delete tokenPayload.client_id;
60+
return tokenPayload;
61+
})
62+
// Set the property store where authorized tokens should be persisted.
63+
.setPropertyStore(PropertiesService.getUserProperties());
6564
}
6665

6766
/**

samples/DocuSign.gs

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -51,31 +51,31 @@ function reset() {
5151
*/
5252
function getService() {
5353
return OAuth2.createService('DocuSign')
54-
// Set the endpoint URLs.
55-
.setAuthorizationBaseUrl('https://' + OAUTH_HOST + '/oauth/auth')
56-
.setTokenUrl('https://' + OAUTH_HOST + '/oauth/token')
57-
58-
// Set the client ID and secret.
59-
.setClientId(CLIENT_ID)
60-
.setClientSecret(CLIENT_SECRET)
61-
62-
// Set the name of the callback function that should be invoked to
63-
// complete the OAuth flow.
64-
.setCallbackFunction('authCallback')
65-
66-
// Set the property store where authorized tokens should be persisted.
67-
.setPropertyStore(PropertiesService.getUserProperties())
68-
69-
// Set the scope. The "signature" scope is used for all endpoints in the
70-
// eSignature REST API.
71-
.setScope('signature')
72-
73-
// Set the "Authorization" header when requesting tokens, as required by the
74-
// API.
75-
.setTokenHeaders({
76-
'Authorization': 'Basic ' +
77-
Utilities.base64Encode(CLIENT_ID + ':' + CLIENT_SECRET)
78-
});
54+
// Set the endpoint URLs.
55+
.setAuthorizationBaseUrl('https://' + OAUTH_HOST + '/oauth/auth')
56+
.setTokenUrl('https://' + OAUTH_HOST + '/oauth/token')
57+
58+
// Set the client ID and secret.
59+
.setClientId(CLIENT_ID)
60+
.setClientSecret(CLIENT_SECRET)
61+
62+
// Set the name of the callback function that should be invoked to
63+
// complete the OAuth flow.
64+
.setCallbackFunction('authCallback')
65+
66+
// Set the property store where authorized tokens should be persisted.
67+
.setPropertyStore(PropertiesService.getUserProperties())
68+
69+
// Set the scope. The "signature" scope is used for all endpoints in the
70+
// eSignature REST API.
71+
.setScope('signature')
72+
73+
// Set the "Authorization" header when requesting tokens, as required by
74+
// the API.
75+
.setTokenHeaders({
76+
'Authorization': 'Basic ' +
77+
Utilities.base64Encode(CLIENT_ID + ':' + CLIENT_SECRET)
78+
});
7979
};
8080

8181
/**

samples/Facebook.gs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -40,20 +40,20 @@ function reset() {
4040
*/
4141
function getService() {
4242
return OAuth2.createService('Facebook')
43-
// Set the endpoint URLs.
44-
.setAuthorizationBaseUrl('https://www.facebook.com/dialog/oauth')
45-
.setTokenUrl('https://graph.facebook.com/v2.6/oauth/access_token')
43+
// Set the endpoint URLs.
44+
.setAuthorizationBaseUrl('https://www.facebook.com/dialog/oauth')
45+
.setTokenUrl('https://graph.facebook.com/v2.6/oauth/access_token')
4646

47-
// Set the client ID and secret.
48-
.setClientId(CLIENT_ID)
49-
.setClientSecret(CLIENT_SECRET)
47+
// Set the client ID and secret.
48+
.setClientId(CLIENT_ID)
49+
.setClientSecret(CLIENT_SECRET)
5050

51-
// Set the name of the callback function that should be invoked to complete
52-
// the OAuth flow.
53-
.setCallbackFunction('authCallback')
51+
// Set the name of the callback function that should be invoked to
52+
// complete the OAuth flow.
53+
.setCallbackFunction('authCallback')
5454

55-
// Set the property store where authorized tokens should be persisted.
56-
.setPropertyStore(PropertiesService.getUserProperties());
55+
// Set the property store where authorized tokens should be persisted.
56+
.setPropertyStore(PropertiesService.getUserProperties());
5757
}
5858

5959
/**

samples/HubSpot.gs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -41,25 +41,25 @@ function reset() {
4141
*/
4242
function getService() {
4343
return OAuth2.createService('HubSpot')
44-
// Set the endpoint URLs.
45-
.setAuthorizationBaseUrl('https://app.hubspot.com/oauth/authorize')
46-
.setTokenUrl('https://api.hubapi.com/oauth/v1/token')
44+
// Set the endpoint URLs.
45+
.setAuthorizationBaseUrl('https://app.hubspot.com/oauth/authorize')
46+
.setTokenUrl('https://api.hubapi.com/oauth/v1/token')
4747

48-
// Set the client ID and secret.
49-
.setClientId(CLIENT_ID)
50-
.setClientSecret(CLIENT_SECRET)
48+
// Set the client ID and secret.
49+
.setClientId(CLIENT_ID)
50+
.setClientSecret(CLIENT_SECRET)
5151

52-
// Set the name of the callback function that should be invoked to
53-
// complete the OAuth flow.
54-
.setCallbackFunction('authCallback')
52+
// Set the name of the callback function that should be invoked to
53+
// complete the OAuth flow.
54+
.setCallbackFunction('authCallback')
5555

56-
// Set the property store where authorized tokens should be persisted.
57-
.setPropertyStore(PropertiesService.getUserProperties())
56+
// Set the property store where authorized tokens should be persisted.
57+
.setPropertyStore(PropertiesService.getUserProperties())
5858

59-
// Set the scopes to request from the user. The full list of scopes is
60-
// available here:
61-
// https://developers.hubspot.com/docs/api/working-with-oauth#scopes
62-
.setScope('contacts');
59+
// Set the scopes to request from the user. The full list of scopes is
60+
// available here:
61+
// https://developers.hubspot.com/docs/api/working-with-oauth#scopes
62+
.setScope('contacts');
6363
};
6464

6565
/**

0 commit comments

Comments
 (0)