Skip to content

Commit ae1b8af

Browse files
author
acooper4960
authored
Merge pull request #105 from docusign/ListTabs_DataType
4.0.1 ListTabs data type
2 parents 5eec18a + 450cdc9 commit ae1b8af

File tree

6 files changed

+109
-6
lines changed

6 files changed

+109
-6
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ See [DocuSign Support Center](https://support.docusign.com/en/releasenotes/) for
66
## [Unreleased]
77
More information later on.
88

9+
## [4.0.1] - 2018-06-25
10+
### Fixed
11+
- Issues [`#101`](https://github.com/docusign/DocuSign-Node-Client/issues/101) and [`#66`](https://github.com/docusign/DocuSign-Node-Client/issues/66)
12+
- listTabs now maps to an array of List instead of array of Array
13+
914
## [4.0.0] - 2018-06-06
1015
### BREAKING
1116
- This update has some breaking changes as certain api calls no longer accept query parameters.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,4 +326,4 @@ The DocuSign Node Client is licensed under the MIT [License](LICENSE).
326326
[travis-image]: https://img.shields.io/travis/docusign/docusign-node-client.svg?style=flat
327327
[travis-url]: https://travis-ci.org/docusign/docusign-node-client
328328
[coveralls-image]: https://coveralls.io/repos/github/docusign/DocuSign-Node-Client/badge.svg?branch=master
329-
[coveralls-url]: https://coveralls.io/github/docusign/DocuSign-Node-Client?branch=master
329+
[coveralls-url]: https://coveralls.io/github/docusign/DocuSign-Node-Client?branch=master

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "docusign-esign",
3-
"version": "4.0.0",
3+
"version": "4.0.1",
44
"description": "DocuSign Node.js API client.",
55
"license": "MIT",
66
"main": "src/index.js",

src/model/Tabs.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
obj['lastNameTabs'] = ApiClient.convertToType(data['lastNameTabs'], [LastName]);
9999
}
100100
if (data.hasOwnProperty('listTabs')) {
101-
obj['listTabs'] = ApiClient.convertToType(data['listTabs'], [Array]);
101+
obj['listTabs'] = ApiClient.convertToType(data['listTabs'], [List]);
102102
}
103103
if (data.hasOwnProperty('notarizeTabs')) {
104104
obj['notarizeTabs'] = ApiClient.convertToType(data['notarizeTabs'], [Notarize]);
@@ -209,7 +209,7 @@
209209
exports.prototype['lastNameTabs'] = undefined;
210210
/**
211211
* Specify this tag to give your recipient a list of options, presented as a drop-down list, from which they can select.
212-
* @member {Array.<module:model/Array>} listTabs
212+
* @member {Array.<module:model/List>} listTabs
213213
*/
214214
exports.prototype['listTabs'] = undefined;
215215
/**

src/model/TemplateTabs.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
obj['lastNameTabs'] = ApiClient.convertToType(data['lastNameTabs'], [LastName]);
9999
}
100100
if (data.hasOwnProperty('listTabs')) {
101-
obj['listTabs'] = ApiClient.convertToType(data['listTabs'], [Array]);
101+
obj['listTabs'] = ApiClient.convertToType(data['listTabs'], [List]);
102102
}
103103
if (data.hasOwnProperty('notarizeTabs')) {
104104
obj['notarizeTabs'] = ApiClient.convertToType(data['notarizeTabs'], [Notarize]);
@@ -209,7 +209,7 @@
209209
exports.prototype['lastNameTabs'] = undefined;
210210
/**
211211
* Specify this tag to give your recipient a list of options, presented as a drop-down list, from which they can select.
212-
* @member {Array.<module:model/Array>} listTabs
212+
* @member {Array.<module:model/List>} listTabs
213213
*/
214214
exports.prototype['listTabs'] = undefined;
215215
/**

test/SdkUnitTests.js

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,8 @@ describe('SDK Unit Tests:', function (done) {
566566
assert.equal(envelopeId, docsList.envelopeId);
567567
console.log('EnvelopeDocumentsResult: ' + JSON.stringify(docsList));
568568
done();
569+
} else {
570+
return done(response);
569571
}
570572
});
571573
});
@@ -710,6 +712,102 @@ describe('SDK Unit Tests:', function (done) {
710712
});
711713
});
712714

715+
it('should listRecipients with list tabs attached', function (done) {
716+
var fileBytes = null;
717+
try {
718+
var fs = require('fs');
719+
// read file from a local directory
720+
fileBytes = fs.readFileSync(path.resolve(__dirname, SignTest1File));
721+
} catch (ex) {
722+
// handle error
723+
console.log('Exception: ' + ex);
724+
return done(ex);
725+
}
726+
var envDef = new docusign.EnvelopeDefinition();
727+
envDef.emailSubject = 'Please Sign my Node SDK Envelope';
728+
envDef.emailBlurb = 'Hello, Please sign my Node SDK Envelope.';
729+
730+
var doc = new docusign.Document();
731+
732+
var base64Doc = Buffer.from(fileBytes).toString('base64');
733+
doc.documentBase64 = base64Doc;
734+
doc.name = '..TestFile.pdf';
735+
doc.documentId = '1';
736+
737+
var docs = [];
738+
docs.push(doc);
739+
envDef.documents = docs;
740+
741+
var envelopesApi = new docusign.EnvelopesApi(apiClient);
742+
// call the listRecipients() API
743+
744+
try {
745+
// Add a recipient to sign the document
746+
var signer = new docusign.Signer();
747+
signer.email = UserName;
748+
signer.name = 'Pat Developer';
749+
signer.recipientId = '1';
750+
751+
var signHere = new docusign.SignHere();
752+
signHere.documentId = '1';
753+
signHere.pageNumber = '1';
754+
signHere.recipientId = '1';
755+
signHere.xPosition = '100';
756+
signHere.yPosition = '100';
757+
758+
var listItem = new docusign.ListItem();
759+
listItem.selected = 'true';
760+
listItem.name = 'listItemName';
761+
listItem.value = 'listItemvalue';
762+
763+
var list = new docusign.List();
764+
list.documentId = '1';
765+
list.pageNumber = '1';
766+
list.recipientId = '1';
767+
list.xPosition = '100';
768+
list.yPosition = '100';
769+
list.listItems = [];
770+
list.listItems.push(listItem);
771+
772+
var listTabs = [];
773+
listTabs.push(list);
774+
775+
var tabs = new docusign.Tabs();
776+
tabs.listTabs = listTabs;
777+
signer.tabs = tabs;
778+
779+
// Above causes issue
780+
envDef.recipients = new docusign.Recipients();
781+
envDef.recipients.signers = [];
782+
envDef.recipients.signers.push(signer);
783+
784+
envelopesApi.createEnvelope(accountId, {'envelopeDefinition': envDef}, function (error, envelopeSummary) {
785+
if (error) {
786+
console.log(error);
787+
return done(error);
788+
}
789+
790+
if (envelopeSummary) {
791+
console.log('EnvelopeSummary: ' + JSON.stringify(envelopeSummary));
792+
envelopeId = envelopeSummary.envelopeId;
793+
envelopesApi.listRecipients(accountId, envelopeId, {includeTabs: 'true'}, function (error, recips) {
794+
if (error) {
795+
console.log('Error: ' + error);
796+
return done(error);
797+
}
798+
799+
if (recips) {
800+
console.log('Recipients: ' + JSON.stringify(recips));
801+
assert.equal(recips.signers[0].tabs.hasOwnProperty('listTabs'), true);
802+
done();
803+
}
804+
});
805+
}
806+
});
807+
} catch (e) {
808+
console.log(e);
809+
}
810+
});
713811
it('getTemplate', function (done) {
714812
var templatesApi = new docusign.TemplatesApi(apiClient);
715813
templatesApi.get(accountId, TemplateId, null, function (error, envelopeTemplate, response) {

0 commit comments

Comments
 (0)