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 sendEnvelopeForEmbeddedSigning = async (args) => {
2121 //ds-snippet-start:eSign1Step3
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 // Step 1. 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.
0 commit comments