Skip to content

Commit 37b6a52

Browse files
garg-muditroot
andauthored
Version 7.0.2-v2.1-24.1.01.00 release (#355)
Co-authored-by: root <[email protected]>
1 parent 49f26da commit 37b6a52

File tree

8 files changed

+199
-127
lines changed

8 files changed

+199
-127
lines changed

.swagger-codegen-ignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
.swagger-codegen-ignore
2626
.gitignore
2727
CHANGELOG.md
28-
README.md
2928
git_push.sh
3029

3130
# Project files
@@ -39,4 +38,4 @@ test/*/*.spec.js
3938
test/assert-equals.js
4039
src/OAuth.js
4140
src/RestApi.js
42-
src/oauth/
41+
src/oauth/

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
See [DocuSign Support Center](https://support.docusign.com/en/releasenotes/) for Product Release Notes.
33

44

5+
## [v7.0.2] - eSignature API v2.1-24.1.01.00 - 2024-06-06
6+
### Changed
7+
- Resolved an issue with the PDF download logic that caused corrupted data.
58
## [v7.0.1] - eSignature API v2.1-24.1.01.00 - 2024-05-24
69
## Resolved "Generate Access Token SDK Method is broken since most recent RC Version"
710
## [v7.0.0] - eSignature API v2.1-24.1.01.00 - 2024-05-22

README.md

Lines changed: 67 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,101 @@
1-
# The Official DocuSign eSignature Node Client SDK
1+
# The Official Docusign eSignature Node Client SDK
22

33
[![NPM version][npm-image]][npm-url]
44
[![NPM downloads][downloads-image]][downloads-url]
5-
[![Build status][travis-image]][travis-url]
6-
[![Coverage Status][coveralls-image]][coveralls-url]
75

8-
[NPM module](https://www.npmjs.com/package/docusign-esign) that wraps the <a href="https://www.docusign.com">DocuSign</a> API
9-
10-
[Documentation about the DocuSign API](https://developers.docusign.com/)
6+
The Docusign SDK makes integrating Docusign into your apps and websites a seamless experience.
7+
8+
## Table of Contents
9+
- [Introduction](#introduction)
10+
- [Installation](#installation)
11+
* [Version Information](#versionInformation)
12+
* [Requirements](#requirements)
13+
* [Compatibility](#compatibility)
14+
* [NPM](#npm)
15+
- [Dependencies](#dependencies)
16+
- [API Reference](#apiReference)
17+
- [Code Examples](#codeExamples)
18+
- [OAuth Implementations](#oauthImplementations)
19+
- [Changelog](#changeLog)
20+
- [Support](#support)
21+
- [License](#license)
22+
- [Additional Resources](#additionalResources)
23+
24+
<a id="introduction"></a>
25+
## Introduction
26+
Integrate eSignatures into your application in minutes. The secure and award-winning Docusign eSignature API makes requesting signatures, automating forms, and tracking documents directly from your app easy.
27+
28+
<a id="installation"></a>
29+
## Installation
30+
This client SDK is provided as open source, which enables you to customize its functionality to suit your particular use case. To do so, download or clone the repository. If the SDK’s given functionality meets your integration needs, or if you’re working through our [code examples](https://developers.docusign.com/docs/esign-rest-api/how-to/) from the [Docusign Developer Center](https://developers.docusign.com/), you merely need to install it by following the instructions below.
1131

12-
[Documentation about this package](http://docusign.github.io/docusign-esign-node-client)
13-
<!---
14-
[Changelog](./CHANGELOG.md)
15-
commented out
16-
-->
32+
<a id="versionInformation"></a>
33+
### Version Information
34+
- **API version**: v2.1
35+
- **Latest SDK version**: 7.0.2
1736

37+
<a id="requirements"></a>
1838
## Requirements
1939
* Node 12
20-
* Free [developer account](https://go.docusign.com/sandbox/productshot/?elqCampaignId=16531)
40+
* Free [developer account](https://go.docusign.com/o/sandbox/?postActivateUrl=https://developers.docusign.com/)
2141

42+
<a id="compatibility"></a>
2243
## Compatibility
2344
* Node 12+
2445

25-
## Installation
26-
This SDK is provided as open source, which enables you to customize its functionality to suit your particular use case. To do so, download or clone the repository. If the SDK’s given functionality meets your integration needs, or if you’re working through our [code examples](https://developers.docusign.com/docs/esign-rest-api/how-to/) from the [DocuSign Developer Center](https://developers.docusign.com/), you merely need to install it by following the instructions below.
27-
46+
<a id="npm"></a>
2847
### NPM:
2948
1. Open your preferred command-line console, then navigate to your project.
3049
2. In the console, type the following commands: \
3150
npm install docusign-esign -save
3251

33-
## Dependencies
52+
<a id="dependencies"></a>
53+
## SDK Dependencies
3454
This client has the following external dependencies:
3555

3656
**Minimum:**
37-
* DocuSign-eSign
38-
* axios 1.6.8
39-
40-
**Optional:**
41-
* Async v2.6.2
42-
* Jsonwebtoken v9.0.0
43-
* Passport-oauth2
44-
* Path
45-
57+
* docusign-esign
58+
* Axios v1.6.8+
59+
* @devhigley/parse-proxy v1.0.3+
60+
* Csv-stringify v1.0.0+
61+
* Jsonwebtoken v9.0.0+
62+
* Passport-oauth2 v1.6.1+
63+
* Safe-buffer v5.1.2+
64+
65+
<a id="apiReference"></a>
66+
## API Reference
67+
You can refer to the API reference [here](https://developers.docusign.com/docs/esign-rest-api/reference/).
68+
69+
<a id="codeExamples"></a>
4670
## Code examples
71+
Explore our GitHub repository for the [Launcher](https://github.com/docusign/code-examples-node/), a self-executing package housing code examples for the eSignature Node SDK. This package showcases several common use cases and their respective source files. Additionally, you can download a version preconfigured for your Docusign developer account from [Quickstart](https://developers.docusign.com/docs/esign-rest-api/quickstart/). These examples support both the [Authorization Code Grant](https://developers.docusign.com/platform/auth/authcode/) and [JSON Web Token (JWT)](https://developers.docusign.com/platform/auth/jwt/) authentication workflows.
4772

48-
You can find on our GitHub a self-executing package of code examples for the eSignature C# SDK, called a [Launcher](https://github.com/docusign/code-examples-node/blob/master/README.md), that demonstrates common use cases. You can also download a version preconfigured for your DocuSign developer account from [Quickstart](https://developers.docusign.com/docs/esign-rest-api/quickstart/). These examples can use either the [Authorization Code Grant](https://developers.docusign.com/esign-rest-api/guides/authentication/oauth2-code-grant) or [JSON Web Token (JWT)](https://developers.docusign.com/esign-rest-api/guides/authentication/oauth2-jsonwebtoken) authentication workflows.
49-
73+
<a id="oauthImplementations"></a>
5074
## OAuth implementations
51-
For details regarding which type of OAuth grant will work best for your DocuSign integration, see [Choose OAuth Type](https://developers.docusign.com/platform/auth/choose/) in the [DocuSign Developer Center](https://developers.docusign.com/).
75+
For details regarding which type of OAuth grant will work best for your Docusign integration, see [Choose OAuth Type](https://developers.docusign.com/platform/auth/choose/) in the [Docusign Developer Center](https://developers.docusign.com/).
76+
77+
For security purposes, Docusign recommends using the [Authorization Code Grant](https://developers.docusign.com/platform/auth/authcode/) flow.
5278

53-
For security purposes, DocuSign recommends using the [Authorization Code Grant](https://developers.docusign.com/esign-rest-api/guides/authentication/oauth2-code-grant) flow.
79+
<a id="changeLog"></a>
80+
## Changelog
81+
You can refer to the complete changelog [here](https://github.com/docusign/docusign-esign-node-client/blob/master/CHANGELOG.md).
5482

83+
<a id="support"></a>
5584
## Support
56-
Log issues against this client through GitHub. We also have an [active developer community on Stack Overflow](http://stackoverflow.com/questions/tagged/docusignapi).
85+
Log issues against this client SDK through GitHub. You can also reach out to us through [Docusign Community](https://community.docusign.com/developer-59) and [Stack Overflow](https://stackoverflow.com/questions/tagged/docusignapi).
5786

87+
<a id="license"></a>
5888
## License
59-
The DocuSign eSignature Node Client SDK is licensed under the [MIT License](https://github.com/docusign/docusign-node-client/blob/master/LICENSE).
89+
The Docusign eSignature Node Client SDK is licensed under the [MIT License](https://github.com/docusign/docusign-esign-node-client/blob/master/LICENSE).
6090

91+
<a id="additionalResources"></a>
6192
### Additional resources
62-
* [DocuSign Developer Center](https://developers.docusign.com/)
63-
* [DocuSign API on Twitter](https://twitter.com/docusignapi)
64-
* [DocuSign For Developers on LinkedIn](https://www.linkedin.com/showcase/docusign-for-developers/)
65-
* [DocuSign For Developers on YouTube](https://www.youtube.com/channel/UCJSJ2kMs_qeQotmw4-lX2NQ)
93+
* [Docusign Developer Center](https://developers.docusign.com/)
94+
* [Docusign API on Twitter](https://twitter.com/docusignapi)
95+
* [Docusign For Developers on LinkedIn](https://www.linkedin.com/showcase/docusign-for-developers/)
96+
* [Docusign For Developers on YouTube](https://www.youtube.com/channel/UCJSJ2kMs_qeQotmw4-lX2NQ)
6697

6798
[npm-image]: https://img.shields.io/npm/v/docusign-esign.svg?style=flat
6899
[npm-url]: https://npmjs.org/package/docusign-esign
69100
[downloads-image]: https://img.shields.io/npm/dm/docusign-esign.svg?style=flat
70-
[downloads-url]: https://npmjs.org/package/docusign-esign
71-
[travis-image]: https://travis-ci.com/docusign/docusign-esign-node-client.svg?branch=master
72-
[travis-url]: https://travis-ci.com/docusign/docusign-esign-node-client
73-
[coveralls-image]: https://coveralls.io/repos/github/docusign/DocuSign-Node-Client/badge.svg?branch=master
74-
[coveralls-url]: https://coveralls.io/github/docusign/DocuSign-Node-Client?branch=master
101+
[downloads-url]: https://npmjs.org/package/docusign-esign

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "docusign-esign",
3-
"version": "7.0.1",
3+
"version": "7.0.2",
44
"description": "DocuSign Node.js API client.",
55
"license": "MIT",
66
"main": "src/index.js",
@@ -64,6 +64,7 @@
6464
"jsdoc": "3.6.10",
6565
"mocha": "~5.0.4",
6666
"mocha-junit-reporter": "^1.18.0",
67+
"pdf2json": "^3.1.3",
6768
"semistandard": "^12.0.1"
6869
}
6970
}

src/ApiClient.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
var defaultHeaders = {
3838
"X-DocuSign-SDK": "Node",
3939
"Node-Ver": process.version,
40-
"User-Agent": `Swagger-Codegen/v2.1/7.0.1/node/${process.version}`,
40+
"User-Agent": `Swagger-Codegen/v2.1/7.0.2/node/${process.version}`,
4141
};
4242

4343
var SCOPE_SIGNATURE = "signature";
@@ -695,13 +695,13 @@
695695
request
696696
.then((response) => {
697697
try {
698-
let streamData;
698+
const streamData = [];
699699
if (requestConfig.headers["Accept"] === "application/pdf") {
700-
response.data.on("data", (chunks) => {
701-
streamData += chunks;
700+
response.data.on("data", (chunk) => {
701+
streamData.push(chunk);
702702
});
703703
response.data.on("end", () => {
704-
resolve(streamData);
704+
resolve(Buffer.concat(streamData));
705705
});
706706
} else {
707707
data = _this.deserialize(response, returnType);
@@ -719,13 +719,13 @@
719719
request
720720
.then((response) => {
721721
try {
722-
let streamData;
722+
const streamData = [];
723723
if (requestConfig.headers["Accept"] === "application/pdf") {
724-
response.data.on("data", (chunks) => {
725-
streamData += chunks;
724+
response.data.on("data", (chunk) => {
725+
streamData.push(chunk);
726726
});
727727
response.data.on("end", () => {
728-
callback(null, streamData, response);
728+
callback(null, Buffer.concat(streamData), response);
729729
});
730730
} else {
731731
data = _this.deserialize(response, returnType);

test/SdkUnitTests.js

Lines changed: 49 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ var axios = require('axios');
1313

1414
var Buffer = global.Buffer.from ? global.Buffer : require('safe-buffer').Buffer;
1515
var fs = require('fs');
16+
const { ValidatePdf } = require('./helpers');
1617

1718
var userName = config.email;
1819
var privateKey = config.privateKey;
@@ -25,7 +26,6 @@ var basePath = restApi.BasePath.DEMO;
2526
var oAuthBasePath = oAuth.BasePath.DEMO;
2627

2728
var SignTest1File = 'docs/SignTest1.pdf';
28-
var LargeTestDocument1 = 'docs/LargeTestDocument1.pdf';
2929
var brandLogoPath = 'img/docusign-lgo.png';
3030
var brandXmlPath = 'docs/brand.xml';
3131
var accountId = '';
@@ -267,11 +267,11 @@ describe('SDK Unit Tests:', function (done) {
267267
var authUri = apiClient.getAuthorizationUri(integratorKeyAuthCode, scopes, RedirectURI, responseType, randomState);
268268

269269
axios.get(authUri)
270-
.then(function (res) {
270+
.then(function (res) {
271271
assert.equal(res.status, 200);
272272
done();
273273
})
274-
.catch((err)=>{
274+
.catch((err) => {
275275
assert.notEqual(err, undefined);
276276
});
277277
});
@@ -670,7 +670,7 @@ describe('SDK Unit Tests:', function (done) {
670670
try {
671671
var fs = require('fs');
672672
// read file from a local directory
673-
fileBytes = fs.readFileSync(path.resolve(__dirname, LargeTestDocument1));
673+
fileBytes = fs.readFileSync(path.resolve(__dirname, SignTest1File));
674674
} catch (ex) {
675675
// handle error
676676
console.log('Exception: ' + ex);
@@ -743,6 +743,13 @@ describe('SDK Unit Tests:', function (done) {
743743
var tempFile = path.resolve(__dirname, filename);
744744
fs.writeFile(tempFile, Buffer.from(pdfBytes, 'binary'), function (err) {
745745
if (err) console.log('Error: ' + err);
746+
ValidatePdf(tempFile).then(() => {
747+
done();
748+
}).catch((error) => {
749+
if (error) {
750+
return done(error);
751+
}
752+
});
746753
});
747754
console.log('Document from envelope ' + envelopeSummary.envelopeId + ' has been downloaded to ' + tempFile);
748755
} catch (ex) {
@@ -755,7 +762,6 @@ describe('SDK Unit Tests:', function (done) {
755762
return done(error);
756763
}
757764
});
758-
done();
759765
}
760766
})
761767
.catch(function (error) {
@@ -941,47 +947,53 @@ describe('SDK Unit Tests:', function (done) {
941947
var tempFile = path.resolve(__dirname, filename);
942948
fs.writeFile(tempFile, Buffer.from(pdfBytes, 'binary'), function (err) {
943949
if (err) console.log('Error: ' + err);
944-
});
945-
console.log('Document from envelope ' + envelopeSummary.envelopeId + ' has been downloaded to ' + tempFile);
946-
} catch (ex) {
947-
console.log('Exception: ' + ex);
948-
}
949-
diagApi.listRequestLogs()
950-
.then(function (logsList) {
951-
if (logsList) {
952-
var requestLogId = logsList.apiRequestLogs[0].requestLogId;
953-
console.log(requestLogId);
954-
diagApi.getRequestLog(requestLogId)
955-
.then(function (diagBytes) {
956-
if (diagBytes) {
957-
try {
958-
var fs = require('fs');
959-
// download the document pdf
960-
var filename = requestLogId + '.txt';
961-
var tempFile = path.resolve(__dirname, filename);
962-
fs.writeFile(tempFile, diagBytes, function (err) {
963-
if (err) console.log('Error: ' + err);
950+
ValidatePdf(tempFile).then(() => {
951+
diagApi.listRequestLogs()
952+
.then(function (logsList) {
953+
if (logsList) {
954+
var requestLogId = logsList.apiRequestLogs[0].requestLogId;
955+
console.log(requestLogId);
956+
diagApi.getRequestLog(requestLogId)
957+
.then(function (diagBytes) {
958+
if (diagBytes) {
959+
try {
960+
var fs = require('fs');
961+
// download the document pdf
962+
var filename = requestLogId + '.txt';
963+
var tempFile = path.resolve(__dirname, filename);
964+
fs.writeFile(tempFile, diagBytes, function (err) {
965+
if (err) console.log('Error: ' + err);
966+
});
967+
console.log('Diagnostics ID ' + requestLogId + ' data has been downloaded to ' + tempFile);
968+
done();
969+
} catch (ex) {
970+
console.log('Exception: ' + ex);
971+
done(ex);
972+
}
973+
}
974+
})
975+
.catch(function (error) {
976+
if (error) {
977+
return done(error);
978+
}
964979
});
965-
console.log('Diagnostics ID ' + requestLogId + ' data has been downloaded to ' + tempFile);
966-
done();
967-
} catch (ex) {
968-
console.log('Exception: ' + ex);
969-
done(ex);
970-
}
971980
}
972981
})
973982
.catch(function (error) {
974983
if (error) {
975984
return done(error);
976985
}
977986
});
978-
}
979-
})
980-
.catch(function (error) {
981-
if (error) {
982-
return done(error);
983-
}
987+
}).catch(function (error) {
988+
if (error) {
989+
return done(error);
990+
}
991+
});
984992
});
993+
console.log('Document from envelope ' + envelopeSummary.envelopeId + ' has been downloaded to ' + tempFile);
994+
} catch (ex) {
995+
console.log('Exception: ' + ex);
996+
}
985997
}
986998
})
987999
.catch(function (error) {

0 commit comments

Comments
 (0)