Skip to content

Commit c93ec0f

Browse files
fix linter warnings
1 parent 8ff89c7 commit c93ec0f

File tree

6 files changed

+47
-47
lines changed

6 files changed

+47
-47
lines changed

lib/admin/examples/auditUsers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const auditUsers = async (args) => {
2929

3030
for (const user of modifiedUsers) {
3131
//ds-snippet-end:Admin5Step5
32-
//ds-snippet-start:Admin5Step4
32+
//ds-snippet-start:Admin5Step4
3333
opts.email = user.email;
3434
//ds-snippet-end:Admin5Step4
3535
//ds-snippet-start:Admin5Step5

lib/eSignature/controllers/eg044FocusedView.js

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,25 @@
44
* @author DocuSign
55
*/
66

7-
const path = require("path");
8-
const { sendEnvelope } = require("../examples/focusedView");
9-
const validator = require("validator");
10-
const { getExampleByNumber } = require("../../manifestService");
11-
const dsConfig = require("../../../config/index.js").config;
7+
const path = require('path');
8+
const { sendEnvelope } = require('../examples/focusedView');
9+
const validator = require('validator');
10+
const { getExampleByNumber } = require('../../manifestService');
11+
const dsConfig = require('../../../config/index.js').config;
1212
const { API_TYPES } = require('../../utils.js');
1313

1414
const eg044FocusedView = exports;
1515
const exampleNumber = 44;
1616
const eg = `eg0${exampleNumber}`; // This example reference.
1717
const api = API_TYPES.ESIGNATURE;
18-
const mustAuthenticate = "/ds/mustAuthenticate";
18+
const mustAuthenticate = '/ds/mustAuthenticate';
1919
const minimumBufferMin = 3;
2020
const signerClientId = 1000; // The id of the signer within this application.
21-
const demoDocsPath = path.resolve(__dirname, "../../../demo_documents");
22-
const pdf1File = "World_Wide_Corp_lorem.pdf";
23-
const dsReturnUrl = dsConfig.appUrl + "/ds-return";
24-
const dsPingUrl = dsConfig.appUrl + "/"; // Url that will be pinged by the DocuSign signing via Ajax
25-
21+
const demoDocsPath = path.resolve(__dirname, '../../../demo_documents');
22+
const pdf1File = 'World_Wide_Corp_lorem.pdf';
23+
const dsReturnUrl = dsConfig.appUrl + '/ds-return';
24+
const dsPingUrl = dsConfig.appUrl + '/'; // Url that will be pinged by the DocuSign signing via Ajax
25+
2626
/**
2727
* Create the envelope, the embedded signing, and then redirect to the DocuSign signing
2828
* @param {object} req Request obj
@@ -34,7 +34,7 @@ eg044FocusedView.createController = async (req, res) => {
3434
// double-check here to enable a better UX to the user.
3535
const isTokenOK = req.dsAuth.checkToken(minimumBufferMin);
3636
if (!isTokenOK) {
37-
req.flash("info", "Sorry, you need to re-authenticate.");
37+
req.flash('info', 'Sorry, you need to re-authenticate.');
3838
// Save the current operation so it will be resumed after authentication
3939
req.dsAuth.setEg(req, eg);
4040
return res.redirect(mustAuthenticate);
@@ -67,21 +67,21 @@ eg044FocusedView.createController = async (req, res) => {
6767
const errorMessage = errorBody && errorBody.message;
6868
// In production, may want to provide customized error messages and
6969
// remediation advice to the user.
70-
res.render("pages/error", { err: error, errorCode, errorMessage });
70+
res.render('pages/error', { err: error, errorCode, errorMessage });
7171
}
7272
if (results) {
7373
req.session.envelopeId = results.envelopeId; // Save for use by other examples
7474

7575
// Redirect the user to the embedded signing
7676
const example = getExampleByNumber(res.locals.manifest, exampleNumber, api);
77-
return res.render("pages/examples/eg044Embed", {
77+
return res.render('pages/examples/eg044Embed', {
7878
example: example,
7979
integrationKey: dsConfig.dsClientId,
8080
url: results.redirectUrl,
8181
});
8282
}
8383
};
84-
84+
8585
/**
8686
* Form page for this application
8787
*/
@@ -97,13 +97,13 @@ eg044FocusedView.getController = async (req, res) => {
9797
}
9898

9999
const example = getExampleByNumber(res.locals.manifest, exampleNumber, api);
100-
return res.render("pages/examples/eg044FocusedView", {
100+
return res.render('pages/examples/eg044FocusedView', {
101101
eg: eg,
102102
csrfToken: req.csrfToken(),
103103
example: example,
104104
sourceFile: path.basename(__filename),
105-
sourceUrl: "https://github.com/docusign/code-examples-node/blob/master/lib/eSignature/examples/focusedView.js",
105+
sourceUrl: 'https://github.com/docusign/code-examples-node/blob/master/lib/eSignature/examples/focusedView.js',
106106
documentation: dsConfig.documentation + eg,
107107
showDoc: dsConfig.documentation,
108108
});
109-
};
109+
};

lib/eSignature/examples/collectPayment.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const createEnvelopeWithPayment = async (args) => {
1616
// args.basePath
1717
// args.accessToken
1818
// args.accountId
19-
19+
2020
let dsApiClient = new docusign.ApiClient();
2121
dsApiClient.setBasePath(args.basePath);
2222
dsApiClient.addDefaultHeader('Authorization', 'Bearer ' + args.accessToken);

lib/eSignature/examples/embeddedSending.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const sendEnvelopeUsingEmbeddedSending = async (args) => {
3535
});
3636
let envelopeId = results.envelopeId;
3737
//ds-snippet-end:eSign11Step2
38-
38+
3939
// Step 3. create the sender view
4040
//ds-snippet-start:eSign11Step3
4141
let viewRequest = makeSenderViewRequest(args.envelopeArgs);
@@ -68,7 +68,7 @@ function makeSenderViewRequest(args) {
6868
return viewRequest;
6969
}
7070
//ds-snippet-end:eSign11Step3
71-
71+
7272
//ds-snippet-start:eSign11Step2
7373
function makeEnvelope(args) {
7474
// Data for this method
@@ -227,5 +227,5 @@ function document1(args) {
227227
`;
228228
}
229229
//ds-snippet-end:eSign11Step2
230-
230+
231231
module.exports = { sendEnvelopeUsingEmbeddedSending };

lib/eSignature/examples/focusedView.js

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
* @author DocuSign
55
*/
66

7-
const fs = require("fs-extra");
8-
const docusign = require("docusign-esign");
7+
const fs = require('fs-extra');
8+
const docusign = require('docusign-esign');
99

1010
/**
1111
* This function does the work of creating the envelope and the
@@ -21,9 +21,9 @@ const sendEnvelope = async (args) => {
2121
//ds-snippet-start:eSign44Step3
2222
let dsApiClient = new docusign.ApiClient();
2323
dsApiClient.setBasePath(args.basePath);
24-
dsApiClient.addDefaultHeader("Authorization", "Bearer " + args.accessToken);
25-
let envelopesApi = new docusign.EnvelopesApi(dsApiClient),
26-
results = null;
24+
dsApiClient.addDefaultHeader('Authorization', 'Bearer ' + args.accessToken);
25+
let envelopesApi = new docusign.EnvelopesApi(dsApiClient);
26+
let results = null;
2727

2828
// Make the envelope request body
2929
let envelope = makeEnvelope(args.envelopeArgs);
@@ -65,7 +65,7 @@ function makeEnvelope(args) {
6565
// args.signerEmail
6666
// args.signerName
6767
// args.signerClientId
68-
// docFile
68+
// docFile
6969

7070
// document 1 (pdf) has tag /sn1/
7171
//
@@ -79,15 +79,15 @@ function makeEnvelope(args) {
7979

8080
// create the envelope definition
8181
let env = new docusign.EnvelopeDefinition();
82-
env.emailSubject = "Please sign this document";
82+
env.emailSubject = 'Please sign this document';
8383

8484
// add the documents
85-
let doc1 = new docusign.Document(),
86-
doc1b64 = Buffer.from(docPdfBytes).toString("base64");
85+
let doc1 = new docusign.Document();
86+
let doc1b64 = Buffer.from(docPdfBytes).toString('base64');
8787
doc1.documentBase64 = doc1b64;
88-
doc1.name = "Lorem Ipsum"; // can be different from actual file name
89-
doc1.fileExtension = "pdf";
90-
doc1.documentId = "3";
88+
doc1.name = 'Lorem Ipsum'; // can be different from actual file name
89+
doc1.fileExtension = 'pdf';
90+
doc1.documentId = '3';
9191

9292
// The order in the docs array determines the order in the envelope
9393
env.documents = [doc1];
@@ -108,10 +108,10 @@ function makeEnvelope(args) {
108108
// The DocuSign platform seaches throughout your envelope's
109109
// documents for matching anchor strings.
110110
let signHere1 = docusign.SignHere.constructFromObject({
111-
anchorString: "/sn1/",
112-
anchorYOffset: "10",
113-
anchorUnits: "pixels",
114-
anchorXOffset: "20",
111+
anchorString: '/sn1/',
112+
anchorYOffset: '10',
113+
anchorUnits: 'pixels',
114+
anchorXOffset: '20',
115115
});
116116
// Tabs are set per recipient / signer
117117
let signer1Tabs = docusign.Tabs.constructFromObject({
@@ -127,7 +127,7 @@ function makeEnvelope(args) {
127127

128128
// Request that the envelope be sent by setting |status| to "sent".
129129
// To request that the envelope be created as a draft, set to "created"
130-
env.status = "sent";
130+
env.status = 'sent';
131131

132132
return env;
133133
}
@@ -151,12 +151,12 @@ function makeRecipientViewRequest(args) {
151151
// the DocuSign signing. It's usually better to use
152152
// the session mechanism of your web framework. Query parameters
153153
// can be changed/spoofed very easily.
154-
viewRequest.returnUrl = args.dsReturnUrl + "?state=123";
154+
viewRequest.returnUrl = args.dsReturnUrl + '?state=123';
155155

156156
// How has your app authenticated the user? In addition to your app's
157157
// authentication, you can include authenticate steps from DocuSign.
158158
// Eg, SMS authentication
159-
viewRequest.authenticationMethod = "none";
159+
viewRequest.authenticationMethod = 'none';
160160

161161
// Recipient information must match embedded recipient info
162162
// we used to create the envelope.
@@ -173,8 +173,8 @@ function makeRecipientViewRequest(args) {
173173
viewRequest.pingFrequency = 600; // seconds
174174
// NOTE: The pings will only be sent if the pingUrl is an https address
175175
viewRequest.pingUrl = args.dsPingUrl; // optional setting
176-
viewRequest.frameAncestors = ["http://localhost:3000", "https://apps-d.docusign.com"];
177-
viewRequest.messageOrigins = ["https://apps-d.docusign.com"]
176+
viewRequest.frameAncestors = ['http://localhost:3000', 'https://apps-d.docusign.com'];
177+
viewRequest.messageOrigins = ['https://apps-d.docusign.com'];
178178

179179
return viewRequest;
180180
}

lib/monitor/examples/getMonitoringData.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* @author DocuSign
55
*/
66

7-
const docusign = require("docusign-monitor");
7+
const docusign = require('docusign-monitor');
88

99
/**
1010
* This function does the work of getting the monitoring data
@@ -13,7 +13,7 @@ const getMonitoringData = async (args) => {
1313
//ds-snippet-start:Monitor1Step2
1414
let dsApiClient = new docusign.ApiClient();
1515
dsApiClient.setBasePath(args.basePath);
16-
dsApiClient.addDefaultHeader("Authorization", "Bearer " + args.accessToken);
16+
dsApiClient.addDefaultHeader('Authorization', 'Bearer ' + args.accessToken);
1717
//ds-snippet-end:Monitor1Step2
1818

1919
//ds-snippet-start:Monitor1Step3
@@ -33,7 +33,7 @@ const getMonitoringData = async (args) => {
3333
if (cursorValue != null) {
3434
options.cursor = cursorValue;
3535
}
36-
cursoredResult = await datasetApi.getStream("2.0", "monitor", options);
36+
cursoredResult = await datasetApi.getStream('2.0', 'monitor', options);
3737
let endCursor = cursoredResult.endCursor;
3838

3939
// If the endCursor from the response is the same as the one that you already have,

0 commit comments

Comments
 (0)