Skip to content

Commit 84cb4aa

Browse files
authored
Merge pull request #61 from docusign/3.0.0
3.0.0
2 parents 88d5e4f + a5db6ef commit 84cb4aa

File tree

1,017 files changed

+645234
-60360
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,017 files changed

+645234
-60360
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@ coverage
44
*.DS_Store
55
auth-info.json
66
config.json
7+
.idea/
8+
npm-debug.log

.jsdoc.json

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"tags": {
3+
"allowUnknownTags": true
4+
},
5+
"source": {
6+
"include": ["src", "package.json"],
7+
"includePattern": ".js$",
8+
"excludePattern": "(node_modules/|docs)"
9+
},
10+
"plugins": [
11+
"plugins/markdown"
12+
],
13+
"markdown": {
14+
"parser": "gfm",
15+
"hardwrap": true
16+
},
17+
"templates": {
18+
"cleverLinks": false,
19+
"monospaceLinks": true,
20+
"useLongnameInNav": false
21+
},
22+
"opts": {
23+
"source": "./src/",
24+
"destination": "./docs/",
25+
"encoding": "utf8",
26+
"recurse": true,
27+
"template": "./node_modules/docdash"
28+
},
29+
"docdash": {
30+
"static": false,
31+
"sort": true
32+
}
33+
}

.travis.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@ notifications:
1010
on_failure: change
1111

1212
node_js:
13-
- "0.10"
14-
- "0.12"
13+
- "2.2"
14+
- "3"
1515
- "4"
1616
- "5"
17+
- "6"
18+
- "7"
1719

1820
after_script: "npm install coveralls@2 && cat ./coverage/lcov.info | coveralls"
1921

CHANGELOG.md

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,32 @@ All notable changes to this project will be documented in this file.
44
See [DocuSign Support Center](https://support.docusign.com/en/releasenotes/) for Product Release Notes.
55

66
## [Unreleased]
7+
More information later on.
8+
9+
## [3.0.0] - 2017-03-10
10+
### BREAKING
11+
- The SDK now supports the**Full and latest DocuSign API support**(17.1.00.00). NO MORE OMITTED ENDPOINTS.
12+
- **Getter and setter methods of all models' fields were removed.** Direct access to models' fields is now required. See the code snippet in README.md and test/SdkUnitTests.js for example.
13+
- Added optional `opts` to several methods across different APIs. Old client code might need to be updated prior to using 3.0.0 and above.
14+
- Methods that accept optional parameters, defined as `opts`, now accept plain javascript objects only. For instance AuthenticationApi.login({'api_password': true}) will return a fake password that can be used in subsequent API calls instead of the original password.
15+
16+
### Removed
17+
- All Optional data structures that were used as optional parameters for some API methods (in the form of**Docusign.XxxApi.doSomethingOptions**). Use javascript plain objects instead.
18+
719
### Added
8-
- More test cases.
20+
- **Complete and proper SDK [Documentation](http://docusign.github.io/docusign-node-client/module-index.html), including detailed information and links about all modules and methods of the SDK.**
21+
- New test case: create a DocuSign template.
22+
23+
### Fixed
24+
- Issue [`#52`](https://github.com/docusign/DocuSign-Node-Client/issues/52): TypeError: self.envelopeTemplateDefinition.constructFromObject is not a function.
925

1026
### Changed
1127
- Updated the package with the latest API release.
1228

1329
## [2.1.0] - 2017-01-24
1430
### Added
1531
- Documentation about several Authentication methods supported by DocuSign API.
16-
32+
- Changelog to keep track of release highlights.
1733
### Changed
1834
- Support for DocuSign Core release 16.1.00.00.
1935
- Code snippet to use base URL from the login call. Required for integrations when they go live.

README.md

Lines changed: 119 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
[![bitHound Overall Score][bitHound-image]][bitHound-url]
77
[![Dependency Status] [david-image]][david-url]
88

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

1111
[Documentation about the DocuSign API](https://www.docusign.com/developer-center)
1212

13-
[Documentation about this package](http://docusign.github.io/docusign-node-client)
13+
[Documentation about this package](http://docusign.github.io/docusign-node-client/docusign-esign/3.0.0/module-index.html)
1414
<!---
1515
[Changelog](./CHANGELOG.md)
1616
commented out
@@ -22,7 +22,7 @@ You can sign up for a free [developer sandbox](https://www.docusign.com/develope
2222
Requirements
2323
============
2424

25-
Node 0.10 or later.
25+
Node 2.2.1 or later.
2626

2727
Installation
2828
============
@@ -37,13 +37,122 @@ Alternatively you can just copy the source code directly into your project.
3737

3838
This client has the following external dependencies:
3939

40-
* superagent 1.7.1
40+
* superagent@1.7.1
4141

4242
Usage
4343
=====
4444

4545
To initialize the client, make the Login API Call and send a template for signature:
46+
### SDK version 3.x.x
47+
```javascript
48+
var docusign = require('docusign-esign');
49+
var async = require('async');
50+
51+
var integratorKey = '***'; // Integrator Key associated with your DocuSign Integration
52+
var email = 'YOUR_EMAIL'; // Email for your DocuSign Account
53+
var password = 'YOUR_PASSWORD'; // Password for your DocuSign Account
54+
var docusignEnv = 'demo'; // DocuSign Environment generally demo for testing purposes
55+
var fullName = 'Joan Jett'; // Recipient's Full Name
56+
var recipientEmail = '[email protected]'; // Recipient's Email
57+
var templateId = '***'; // ID of the Template you want to create the Envelope with
58+
var templateRoleName = '***'; // Role Name of the Template
59+
60+
var baseUrl = 'https://' + docusignEnv + '.docusign.net/restapi';
61+
62+
// initialize the api client
63+
var apiClient = new docusign.ApiClient();
64+
apiClient.setBasePath(baseUrl);
65+
66+
// create JSON formatted auth header
67+
var creds = JSON.stringify({
68+
Username: email,
69+
Password: password,
70+
IntegratorKey: integratorKey
71+
});
72+
apiClient.addDefaultHeader('X-DocuSign-Authentication', creds);
73+
74+
// assign api client to the Configuration object
75+
docusign.Configuration.default.setDefaultApiClient(apiClient);
76+
77+
async.waterfall([
78+
function login (next) {
79+
// login call available off the AuthenticationApi
80+
var authApi = new docusign.AuthenticationApi();
81+
82+
// login has some optional parameters we can set
83+
var loginOps = {};
84+
loginOps.apiPassword = 'true';
85+
loginOps.includeAccountIdGuid = 'true';
86+
authApi.login(loginOps, function (err, loginInfo, response) {
87+
if (err) {
88+
return next(err);
89+
}
90+
if (loginInfo) {
91+
// list of user account(s)
92+
// note that a given user may be a member of multiple accounts
93+
var loginAccounts = loginInfo.loginAccounts;
94+
console.log('LoginInformation: ' + JSON.stringify(loginAccounts));
95+
var loginAccount = loginAccounts[0];
96+
var accountId = loginAccount.accountId;
97+
var baseUrl = loginAccount.baseUrl;
98+
var accountDomain = baseUrl.split("/v2");
99+
100+
// below code required for production, no effect in demo (same domain)
101+
apiClient.setBasePath(accountDomain[0]);
102+
docusign.Configuration.default.setDefaultApiClient(apiClient);
103+
next(null, loginAccount);
104+
}
105+
});
106+
},
107+
108+
function sendTemplate (loginAccount, next) {
109+
// create a new envelope object that we will manage the signature request through
110+
var envDef = new docusign.EnvelopeDefinition();
111+
envDef.emailSubject = 'Please sign this document sent from Node SDK';
112+
envDef.templateId = templateId;
113+
114+
// create a template role with a valid templateId and roleName and assign signer info
115+
var tRole = new docusign.TemplateRole();
116+
tRole.roleName = templateRoleName;
117+
tRole.name = fullName;
118+
tRole.email = recipientEmail;
119+
120+
// create a list of template roles and add our newly created role
121+
var templateRolesList = [];
122+
templateRolesList.push(tRole);
123+
124+
// assign template role(s) to the envelope
125+
envDef.templateRoles = templateRolesList;
126+
127+
// send the envelope by setting |status| to 'sent'. To save as a draft set to 'created'
128+
envDef.status = 'sent';
129+
130+
// use the |accountId| we retrieved through the Login API to create the Envelope
131+
var accountId = loginAccount.accountId;
132+
133+
// instantiate a new EnvelopesApi object
134+
var envelopesApi = new docusign.EnvelopesApi();
46135

136+
// call the createEnvelope() API
137+
envelopesApi.createEnvelope(accountId, {'envelopeDefinition': envDef}, function (err, envelopeSummary, response) {
138+
if (err) {
139+
return next(err);
140+
}
141+
console.log('EnvelopeSummary: ' + JSON.stringify(envelopeSummary));
142+
next(null);
143+
});
144+
}
145+
146+
], function end (error) {
147+
if (error) {
148+
console.log('Error: ', error);
149+
process.exit(1);
150+
}
151+
process.exit();
152+
});
153+
```
154+
155+
### SDK version 2.x.x
47156
```javascript
48157
var docusign = require('docusign-esign');
49158
var async = require('async');
@@ -180,7 +289,12 @@ The url for the Userinfo method is account-d.docusign.com for the demo/developer
180289
Testing
181290
=======
182291

183-
Unit tests are available in the [Test](./test) folder.
292+
Unit tests are available in the [Test](https://github.com/docusign/docusign-node-client/tree/master/test) folder.
293+
294+
Contributing
295+
============
296+
297+
**This SDK is auto-generated from OpenAPI specification file. For that reason, we actually do NOT accept pull requests. If you find a bug or have an idea that you want to see in the SDK, please open a new [issue](https://github.com/docusign/docusign-node-client/issues/new).**
184298

185299
Support
186300
=======
@@ -192,10 +306,6 @@ License
192306

193307
The DocuSign Node Client is licensed under the following [License](LICENSE).
194308

195-
Notes
196-
=======
197-
198-
This version of the client library does not implement all of the DocuSign REST API methods. The current client omits methods in the Accounts, Billing, Cloud Storage, Connect, Groups (Branding), and Templates (Bulk Recipients) categories. The client's methods support the core set of use cases that most integrations will encounter. For a complete list of omitted endpoints, see [Omitted Endpoints](./omitted_endpoints.md).
199309

200310
[npm-image]: https://img.shields.io/npm/v/docusign-esign.svg?style=flat
201311
[npm-url]: https://npmjs.org/package/docusign-esign

0 commit comments

Comments
 (0)