@@ -12,11 +12,14 @@ const iam = require('@docusign/iam-sdk');
1212 * This function does the work of retrieving the tab groups
1313 * @param {object } args
1414 */
15+ //ds-snippet-start:ConnectedFields1Step2
1516const getTabGroups = async ( args ) => {
1617 const client = new iam . IamClient ( { accessToken : args . accessToken , serverURL : args . basePath } ) ;
1718 return await client . connectedFields . tabInfo . getConnectedFieldsTabGroups ( { accountId : args . accountId } ) ;
1819} ;
20+ //ds-snippet-end:ConnectedFields1Step2
1921
22+ //ds-snippet-start:ConnectedFields1Step3
2023const filterData = ( connectedFields ) => {
2124 return connectedFields . filter ( app =>
2225 app . tabs ?. some ( tab =>
@@ -25,6 +28,7 @@ const filterData = (connectedFields) => {
2528 )
2629 ) ;
2730} ;
31+ //ds-snippet-end:ConnectedFields1Step3
2832
2933/**
3034 * This function does the work of creating the envelope
@@ -42,11 +46,8 @@ const sendEnvelope = async (args) => {
4246 dsApiClient . addDefaultHeader ( 'Authorization' , 'Bearer ' + args . accessToken ) ;
4347 let envelopesApi = new docusign . EnvelopesApi ( dsApiClient ) ;
4448
45- // Step 1. Make the envelope request body
4649 const envelope = makeEnvelope ( args . envelopeArgs ) ;
4750
48- // Step 2. call Envelopes::create API method
49- // Exceptions will be caught by the calling function
5051 const results = await envelopesApi . createEnvelope ( args . accountId , {
5152 envelopeDefinition : envelope ,
5253 } ) ;
0 commit comments