Skip to content

Commit 980fdf4

Browse files
committed
fix lint warnings
1 parent 339f118 commit 980fdf4

File tree

2 files changed

+21
-16
lines changed

2 files changed

+21
-16
lines changed

sheets/next18/Invoice.gs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,9 @@ function generateInvoices() {
3939
* Generates a single invoice in Google Docs for a given Salesforce account and
4040
* an owed amount.
4141
*
42-
* @param accountId The Salesforce account Id to invoice
43-
* @param amount The owed amount to invoice
42+
* @param {string} accountId The Salesforce account Id to invoice
43+
* @param {string} amount The owed amount to invoice
44+
* @return {string} the url of the created invoice
4445
*/
4546
function generateInvoice(accountId, amount) {
4647
var folder = DriveApp.getFolderById(INVOICES_FOLDER);
@@ -57,7 +58,7 @@ function generateInvoice(accountId, amount) {
5758
invoice.getBody().replaceText(
5859
'{{account address}}', account['BillingAddress']['street']);
5960
invoice.getBody().replaceText(
60-
'{{date}}', Utilities.formatDate(new Date(), "GMT", "yyyy-MM-dd"));
61+
'{{date}}', Utilities.formatDate(new Date(), 'GMT', 'yyyy-MM-dd'));
6162
invoice.getBody().replaceText('{{amount}}', amount);
6263
invoice.saveAndClose();
6364
return invoice.getUrl();

sheets/next18/Salesforce.gs

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ function login() {
5050
/**
5151
* Displays a modal dialog with a simple HTML link that opens in a new tab.
5252
*
53-
* @param url the URL to link to
54-
* @param message the message to display to the user as a link
55-
* @param title the title of the dialog
53+
* @param {string} url the URL to link to
54+
* @param {string} message the message to display to the user as a link
55+
* @param {string} title the title of the dialog
5656
*/
5757
function showLinkDialog(url, message, title) {
5858
var template = HtmlService.createTemplateFromFile('LinkDialog');
@@ -64,6 +64,8 @@ function showLinkDialog(url, message, title) {
6464
/**
6565
* Creates a Salesforce OAuth2 service, using the Apps Script OAuth2 library:
6666
* https://github.com/gsuitedevs/apps-script-oauth2
67+
*
68+
* @return {Object} a Salesforce OAuth2 service
6769
*/
6870
function getSalesforceService() {
6971
return OAuth2.createService('salesforce')
@@ -73,12 +75,15 @@ function getSalesforceService() {
7375
.setClientId(SALESFORCE_CLIENT_ID)
7476
.setClientSecret(SALESFORCE_CLIENT_SECRET)
7577
.setCallbackFunction('authCallback')
76-
.setPropertyStore(PropertiesService.getUserProperties())
78+
.setPropertyStore(PropertiesService.getUserProperties());
7779
}
7880

7981
/**
8082
* Authentication callback for OAuth2: called when Salesforce redirects back to
8183
* Apps Script after sign-in.
84+
*
85+
* @param {Object} request the HTTP request, provided by Apps Script
86+
* @return {Object} HTMLOutput to render the callback as a web page
8287
*/
8388
function authCallback(request) {
8489
var salesforce = getSalesforceService();
@@ -109,7 +114,7 @@ function promptQuery() {
109114
/**
110115
* Executes the given SOQL query and copies its results to a new sheet.
111116
*
112-
* @param query the SOQL to execute
117+
* @param {string} query the SOQL to execute
113118
*/
114119
function executeQuery(query) {
115120
var response = fetchSoqlResults(query);
@@ -139,8 +144,8 @@ function executeQuery(query) {
139144
/**
140145
* Makes an API call to Salesforce to execute a given SOQL query.
141146
*
142-
* @param query the SOQL query to execute
143-
* @return the API response from Salesforce, as a parsed JSON object.
147+
* @param {string} query the SOQL query to execute
148+
* @return {Object} the API response from Salesforce, as a parsed JSON object.
144149
*/
145150
function fetchSoqlResults(query) {
146151
var salesforce = getSalesforceService();
@@ -151,8 +156,8 @@ function fetchSoqlResults(query) {
151156
'headers': {
152157
'Authorization': 'Bearer ' + salesforce.getAccessToken(),
153158
'Content-Type': 'application/json'
154-
},
155-
}
159+
}
160+
};
156161
var url = 'https://' + SALESFORCE_INSTANCE +
157162
'.salesforce.com/services/data/v30.0/query';
158163
var response = UrlFetchApp.fetch(url +
@@ -165,8 +170,8 @@ function fetchSoqlResults(query) {
165170
* Parses the Salesforce response and extracts the list of field names in the
166171
* result set.
167172
*
168-
* @param record a single Salesforce response record
169-
* @return an array of string keys of that record
173+
* @param {Object} record a single Salesforce response record
174+
* @return {Array<string>} an array of string keys of that record
170175
*/
171176
function getFields(record) {
172177
var fields = [];
@@ -180,6 +185,5 @@ function getFields(record) {
180185

181186
/** Resets the Salesforce service, removing any saved OAuth tokens. */
182187
function logout() {
183-
var salesforce = getSalesforceService();
184-
salesforce.reset();
188+
getSalesforceService().reset();
185189
}

0 commit comments

Comments
 (0)