@@ -12,11 +12,14 @@ const iam = require('@docusign/iam-sdk');
12
12
* This function does the work of retrieving the tab groups
13
13
* @param {object } args
14
14
*/
15
+ //ds-snippet-start:ConnectedFields1Step2
15
16
const getTabGroups = async ( args ) => {
16
17
const client = new iam . IamClient ( { accessToken : args . accessToken , serverURL : args . basePath } ) ;
17
18
return await client . connectedFields . tabInfo . getConnectedFieldsTabGroups ( { accountId : args . accountId } ) ;
18
19
} ;
20
+ //ds-snippet-end:ConnectedFields1Step2
19
21
22
+ //ds-snippet-start:ConnectedFields1Step3
20
23
const filterData = ( connectedFields ) => {
21
24
return connectedFields . filter ( app =>
22
25
app . tabs ?. some ( tab =>
@@ -25,6 +28,7 @@ const filterData = (connectedFields) => {
25
28
)
26
29
) ;
27
30
} ;
31
+ //ds-snippet-end:ConnectedFields1Step3
28
32
29
33
/**
30
34
* This function does the work of creating the envelope
@@ -42,11 +46,8 @@ const sendEnvelope = async (args) => {
42
46
dsApiClient . addDefaultHeader ( 'Authorization' , 'Bearer ' + args . accessToken ) ;
43
47
let envelopesApi = new docusign . EnvelopesApi ( dsApiClient ) ;
44
48
45
- // Step 1. Make the envelope request body
46
49
const envelope = makeEnvelope ( args . envelopeArgs ) ;
47
50
48
- // Step 2. call Envelopes::create API method
49
- // Exceptions will be caught by the calling function
50
51
const results = await envelopesApi . createEnvelope ( args . accountId , {
51
52
envelopeDefinition : envelope ,
52
53
} ) ;
0 commit comments