Skip to content

Commit

Permalink
Version 7.0.2-v2.1-24.1.01.00 release (#355)
Browse files Browse the repository at this point in the history
Co-authored-by: root <[email protected]>
  • Loading branch information
garg-mudit and root authored Jun 6, 2024
1 parent 49f26da commit 37b6a52
Show file tree
Hide file tree
Showing 8 changed files with 199 additions and 127 deletions.
3 changes: 1 addition & 2 deletions .swagger-codegen-ignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
.swagger-codegen-ignore
.gitignore
CHANGELOG.md
README.md
git_push.sh

# Project files
Expand All @@ -39,4 +38,4 @@ test/*/*.spec.js
test/assert-equals.js
src/OAuth.js
src/RestApi.js
src/oauth/
src/oauth/
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
See [DocuSign Support Center](https://support.docusign.com/en/releasenotes/) for Product Release Notes.


## [v7.0.2] - eSignature API v2.1-24.1.01.00 - 2024-06-06
### Changed
- Resolved an issue with the PDF download logic that caused corrupted data.
## [v7.0.1] - eSignature API v2.1-24.1.01.00 - 2024-05-24
## Resolved "Generate Access Token SDK Method is broken since most recent RC Version"
## [v7.0.0] - eSignature API v2.1-24.1.01.00 - 2024-05-22
Expand Down
107 changes: 67 additions & 40 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,74 +1,101 @@
# The Official DocuSign eSignature Node Client SDK
# The Official Docusign eSignature Node Client SDK

[![NPM version][npm-image]][npm-url]
[![NPM downloads][downloads-image]][downloads-url]
[![Build status][travis-image]][travis-url]
[![Coverage Status][coveralls-image]][coveralls-url]

[NPM module](https://www.npmjs.com/package/docusign-esign) that wraps the <a href="https://www.docusign.com">DocuSign</a> API

[Documentation about the DocuSign API](https://developers.docusign.com/)
The Docusign SDK makes integrating Docusign into your apps and websites a seamless experience.

## Table of Contents
- [Introduction](#introduction)
- [Installation](#installation)
* [Version Information](#versionInformation)
* [Requirements](#requirements)
* [Compatibility](#compatibility)
* [NPM](#npm)
- [Dependencies](#dependencies)
- [API Reference](#apiReference)
- [Code Examples](#codeExamples)
- [OAuth Implementations](#oauthImplementations)
- [Changelog](#changeLog)
- [Support](#support)
- [License](#license)
- [Additional Resources](#additionalResources)

<a id="introduction"></a>
## Introduction
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.

<a id="installation"></a>
## Installation
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.

[Documentation about this package](http://docusign.github.io/docusign-esign-node-client)
<!---
[Changelog](./CHANGELOG.md)
commented out
-->
<a id="versionInformation"></a>
### Version Information
- **API version**: v2.1
- **Latest SDK version**: 7.0.2

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

<a id="compatibility"></a>
## Compatibility
* Node 12+

## Installation
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.

<a id="npm"></a>
### NPM:
1. Open your preferred command-line console, then navigate to your project.
2. In the console, type the following commands: \
npm install docusign-esign -save

## Dependencies
<a id="dependencies"></a>
## SDK Dependencies
This client has the following external dependencies:

**Minimum:**
* DocuSign-eSign
* axios 1.6.8

**Optional:**
* Async v2.6.2
* Jsonwebtoken v9.0.0
* Passport-oauth2
* Path

* docusign-esign
* Axios v1.6.8+
* @devhigley/parse-proxy v1.0.3+
* Csv-stringify v1.0.0+
* Jsonwebtoken v9.0.0+
* Passport-oauth2 v1.6.1+
* Safe-buffer v5.1.2+

<a id="apiReference"></a>
## API Reference
You can refer to the API reference [here](https://developers.docusign.com/docs/esign-rest-api/reference/).

<a id="codeExamples"></a>
## Code examples
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.

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.

<a id="oauthImplementations"></a>
## OAuth implementations
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/).
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/).

For security purposes, Docusign recommends using the [Authorization Code Grant](https://developers.docusign.com/platform/auth/authcode/) flow.

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

<a id="support"></a>
## Support
Log issues against this client through GitHub. We also have an [active developer community on Stack Overflow](http://stackoverflow.com/questions/tagged/docusignapi).
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).

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

<a id="additionalResources"></a>
### Additional resources
* [DocuSign Developer Center](https://developers.docusign.com/)
* [DocuSign API on Twitter](https://twitter.com/docusignapi)
* [DocuSign For Developers on LinkedIn](https://www.linkedin.com/showcase/docusign-for-developers/)
* [DocuSign For Developers on YouTube](https://www.youtube.com/channel/UCJSJ2kMs_qeQotmw4-lX2NQ)
* [Docusign Developer Center](https://developers.docusign.com/)
* [Docusign API on Twitter](https://twitter.com/docusignapi)
* [Docusign For Developers on LinkedIn](https://www.linkedin.com/showcase/docusign-for-developers/)
* [Docusign For Developers on YouTube](https://www.youtube.com/channel/UCJSJ2kMs_qeQotmw4-lX2NQ)

[npm-image]: https://img.shields.io/npm/v/docusign-esign.svg?style=flat
[npm-url]: https://npmjs.org/package/docusign-esign
[downloads-image]: https://img.shields.io/npm/dm/docusign-esign.svg?style=flat
[downloads-url]: https://npmjs.org/package/docusign-esign
[travis-image]: https://travis-ci.com/docusign/docusign-esign-node-client.svg?branch=master
[travis-url]: https://travis-ci.com/docusign/docusign-esign-node-client
[coveralls-image]: https://coveralls.io/repos/github/docusign/DocuSign-Node-Client/badge.svg?branch=master
[coveralls-url]: https://coveralls.io/github/docusign/DocuSign-Node-Client?branch=master
[downloads-url]: https://npmjs.org/package/docusign-esign
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "docusign-esign",
"version": "7.0.1",
"version": "7.0.2",
"description": "DocuSign Node.js API client.",
"license": "MIT",
"main": "src/index.js",
Expand Down Expand Up @@ -64,6 +64,7 @@
"jsdoc": "3.6.10",
"mocha": "~5.0.4",
"mocha-junit-reporter": "^1.18.0",
"pdf2json": "^3.1.3",
"semistandard": "^12.0.1"
}
}
18 changes: 9 additions & 9 deletions src/ApiClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
var defaultHeaders = {
"X-DocuSign-SDK": "Node",
"Node-Ver": process.version,
"User-Agent": `Swagger-Codegen/v2.1/7.0.1/node/${process.version}`,
"User-Agent": `Swagger-Codegen/v2.1/7.0.2/node/${process.version}`,
};

var SCOPE_SIGNATURE = "signature";
Expand Down Expand Up @@ -695,13 +695,13 @@
request
.then((response) => {
try {
let streamData;
const streamData = [];
if (requestConfig.headers["Accept"] === "application/pdf") {
response.data.on("data", (chunks) => {
streamData += chunks;
response.data.on("data", (chunk) => {
streamData.push(chunk);
});
response.data.on("end", () => {
resolve(streamData);
resolve(Buffer.concat(streamData));
});
} else {
data = _this.deserialize(response, returnType);
Expand All @@ -719,13 +719,13 @@
request
.then((response) => {
try {
let streamData;
const streamData = [];
if (requestConfig.headers["Accept"] === "application/pdf") {
response.data.on("data", (chunks) => {
streamData += chunks;
response.data.on("data", (chunk) => {
streamData.push(chunk);
});
response.data.on("end", () => {
callback(null, streamData, response);
callback(null, Buffer.concat(streamData), response);
});
} else {
data = _this.deserialize(response, returnType);
Expand Down
86 changes: 49 additions & 37 deletions test/SdkUnitTests.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ var axios = require('axios');

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

var userName = config.email;
var privateKey = config.privateKey;
Expand All @@ -25,7 +26,6 @@ var basePath = restApi.BasePath.DEMO;
var oAuthBasePath = oAuth.BasePath.DEMO;

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

axios.get(authUri)
.then(function (res) {
.then(function (res) {
assert.equal(res.status, 200);
done();
})
.catch((err)=>{
.catch((err) => {
assert.notEqual(err, undefined);
});
});
Expand Down Expand Up @@ -670,7 +670,7 @@ describe('SDK Unit Tests:', function (done) {
try {
var fs = require('fs');
// read file from a local directory
fileBytes = fs.readFileSync(path.resolve(__dirname, LargeTestDocument1));
fileBytes = fs.readFileSync(path.resolve(__dirname, SignTest1File));
} catch (ex) {
// handle error
console.log('Exception: ' + ex);
Expand Down Expand Up @@ -743,6 +743,13 @@ describe('SDK Unit Tests:', function (done) {
var tempFile = path.resolve(__dirname, filename);
fs.writeFile(tempFile, Buffer.from(pdfBytes, 'binary'), function (err) {
if (err) console.log('Error: ' + err);
ValidatePdf(tempFile).then(() => {
done();
}).catch((error) => {
if (error) {
return done(error);
}
});
});
console.log('Document from envelope ' + envelopeSummary.envelopeId + ' has been downloaded to ' + tempFile);
} catch (ex) {
Expand All @@ -755,7 +762,6 @@ describe('SDK Unit Tests:', function (done) {
return done(error);
}
});
done();
}
})
.catch(function (error) {
Expand Down Expand Up @@ -941,47 +947,53 @@ describe('SDK Unit Tests:', function (done) {
var tempFile = path.resolve(__dirname, filename);
fs.writeFile(tempFile, Buffer.from(pdfBytes, 'binary'), function (err) {
if (err) console.log('Error: ' + err);
});
console.log('Document from envelope ' + envelopeSummary.envelopeId + ' has been downloaded to ' + tempFile);
} catch (ex) {
console.log('Exception: ' + ex);
}
diagApi.listRequestLogs()
.then(function (logsList) {
if (logsList) {
var requestLogId = logsList.apiRequestLogs[0].requestLogId;
console.log(requestLogId);
diagApi.getRequestLog(requestLogId)
.then(function (diagBytes) {
if (diagBytes) {
try {
var fs = require('fs');
// download the document pdf
var filename = requestLogId + '.txt';
var tempFile = path.resolve(__dirname, filename);
fs.writeFile(tempFile, diagBytes, function (err) {
if (err) console.log('Error: ' + err);
ValidatePdf(tempFile).then(() => {
diagApi.listRequestLogs()
.then(function (logsList) {
if (logsList) {
var requestLogId = logsList.apiRequestLogs[0].requestLogId;
console.log(requestLogId);
diagApi.getRequestLog(requestLogId)
.then(function (diagBytes) {
if (diagBytes) {
try {
var fs = require('fs');
// download the document pdf
var filename = requestLogId + '.txt';
var tempFile = path.resolve(__dirname, filename);
fs.writeFile(tempFile, diagBytes, function (err) {
if (err) console.log('Error: ' + err);
});
console.log('Diagnostics ID ' + requestLogId + ' data has been downloaded to ' + tempFile);
done();
} catch (ex) {
console.log('Exception: ' + ex);
done(ex);
}
}
})
.catch(function (error) {
if (error) {
return done(error);
}
});
console.log('Diagnostics ID ' + requestLogId + ' data has been downloaded to ' + tempFile);
done();
} catch (ex) {
console.log('Exception: ' + ex);
done(ex);
}
}
})
.catch(function (error) {
if (error) {
return done(error);
}
});
}
})
.catch(function (error) {
if (error) {
return done(error);
}
}).catch(function (error) {
if (error) {
return done(error);
}
});
});
console.log('Document from envelope ' + envelopeSummary.envelopeId + ' has been downloaded to ' + tempFile);
} catch (ex) {
console.log('Exception: ' + ex);
}
}
})
.catch(function (error) {
Expand Down
Loading

0 comments on commit 37b6a52

Please sign in to comment.