Skip to content

Commit 6c88de9

Browse files
HobbyProjectsrootacooper4960
authored
Version 5.14.0-rc1 release (#283)
* Version 5.14.0-rc1-v2.1-21.4.00.00 release * Update CHANGELOG.md Co-authored-by: root <root@devcenteradmin.docusigntest.com> Co-authored-by: acooper4960 <alex.cooper@seasoned.co>
1 parent f4fee3f commit 6c88de9

Some content is hidden

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

53 files changed

+3071
-615
lines changed

.swagger-codegen-ignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,4 @@ test/*/*.spec.js
3939
test/assert-equals.js
4040
src/OAuth.js
4141
src/RestApi.js
42-
src/ApiClient.js
4342
src/oauth/

CHANGELOG.md

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

44

5+
## [v5.14.0-rc1] - eSignature API v2.1-21.4.00.00 - 2021-12-13
6+
### Changed
7+
- Added support for version v2.1-21.4.00.00 of the DocuSign ESignature API.
8+
- Updated the SDK release version.
9+
### Security
10+
- Version bump for passport-oauth2: [CVE-2021-41580](https://nvd.nist.gov/vuln/detail/CVE-2021-41580).
11+
512
## [5.13.0] - ESignature API v2.1-21.3.02.00 - 2021-10-29
613
### Changed
714
- Added support for version v2.1-21.3.02.00 of the DocuSign ESignature API.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "docusign-esign",
3-
"version": "5.13.0",
3+
"version": "5.14.0-rc1",
44
"description": "DocuSign Node.js API client.",
55
"license": "MIT",
66
"main": "src/index.js",
@@ -36,7 +36,7 @@
3636
"push-docs": "git subtree push --prefix docs origin gh-pages",
3737
"update-docs": "./node_modules/.bin/jsdoc -c .jsdoc.json",
3838
"check-config": "./scripts/check-config.js",
39-
"test": "semistandard --fix && ./node_modules/mocha/bin/mocha --reporter mocha-junit-reporter test/SdkUnitTests test/SdkUnitTestsWithCallback"
39+
"test": "semistandard --fix && ./node_modules/mocha/bin/mocha --reporter mocha-junit-reporter --timeout 60000"
4040
},
4141
"semistandard": {
4242
"globals": [
@@ -53,7 +53,7 @@
5353
"dependencies": {
5454
"csv-stringify": "^1.0.0",
5555
"jsonwebtoken": "8.2.0",
56-
"passport-oauth2": "1.4.0",
56+
"passport-oauth2": "^1.6.1",
5757
"safe-buffer": "^5.1.2",
5858
"superagent": "3.8.2"
5959
},

src/ApiClient.js

Lines changed: 50 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,12 @@
22
* DocuSign REST API
33
* The DocuSign REST API provides you with a powerful, convenient, and simple Web services API for interacting with DocuSign.
44
*
5-
* OpenAPI spec version: v2
5+
* OpenAPI spec version: v2.1
66
* Contact: devcenter@docusign.com
77
*
88
* NOTE: This class is auto generated. Do not edit the class manually and submit a new issue instead.
99
*
1010
*/
11-
1211
(function(root, factory) {
1312
if (typeof define === 'function' && define.amd) {
1413
// AMD. Register as an anonymous module.
@@ -26,6 +25,10 @@
2625
}(this, function(superagent, opts) {
2726
'use strict';
2827

28+
var SCOPE_SIGNATURE = "signature";
29+
var SCOPE_EXTENDED = "extended";
30+
var SCOPE_IMPERSONATION = "impersonation";
31+
2932
var removeNulls = function(obj) {
3033
var isArray = obj instanceof Array;
3134
for (var k in obj) {
@@ -73,6 +76,7 @@
7376
'grant_type': 'urn:ietf:params:oauth:grant-type:jwt-bearer'
7477
});
7578

79+
7680
if (!callback){
7781
return new Promise(function(resolve, reject){
7882
request.end(function(err, data){
@@ -82,7 +86,7 @@
8286
resolve(data);
8387
}
8488
})
85-
})
89+
});
8690
} else {
8791
request.end(callback);
8892
}
@@ -106,7 +110,6 @@
106110

107111
/**
108112
* @module ApiClient
109-
* @version 3.0.0
110113
*/
111114

112115
/**
@@ -169,10 +172,10 @@
169172
this.cache = true;
170173
};
171174

172-
/**
175+
/**
173176
* Gets the API endpoint base URL.
174177
*/
175-
exports.prototype.getBasePath = function getBasePath() {
178+
exports.prototype.getBasePath = function getBasePath() {
176179
return this.basePath;
177180
};
178181

@@ -184,10 +187,10 @@
184187
this.oAuthBasePath = deriveOAuthBasePathFromRestBasePath(basePath);
185188
};
186189

187-
/**
190+
/**
188191
* Gets the authentication server endpoint base URL.
189192
*/
190-
exports.prototype.getOAuthBasePath = function getOAuthBasePath() {
193+
exports.prototype.getOAuthBasePath = function getOAuthBasePath() {
191194
return this.oAuthBasePath;
192195
};
193196

@@ -282,9 +285,9 @@
282285
exports.prototype.isFileParam = function(param) {
283286
// fs.ReadStream in Node.js (but not in runtime like browserify)
284287
if (typeof window === 'undefined' &&
285-
typeof require === 'function' &&
286-
require('fs') &&
287-
param instanceof require('fs').ReadStream) {
288+
typeof require === 'function' &&
289+
require('fs') &&
290+
param instanceof require('fs').ReadStream) {
288291
return true;
289292
}
290293
// Buffer in Node.js
@@ -487,8 +490,8 @@
487490
* @returns {Object} The SuperAgent request object if a callback is specified, else {Promise} A {@link https://www.promisejs.org/|Promise} object.
488491
*/
489492
exports.prototype.callApi = function callApi(path, httpMethod, pathParams,
490-
queryParams, headerParams, formParams, bodyParam, authNames, contentTypes, accepts,
491-
returnType, callback) {
493+
queryParams, headerParams, formParams, bodyParam, authNames, contentTypes, accepts,
494+
returnType, callback) {
492495

493496
var _this = this;
494497
var url = this.buildUrl(path, pathParams);
@@ -580,35 +583,36 @@
580583
})
581584
}
582585

583-
var data = null;
584-
if (!callback) {
585-
return new Promise(function(resolve, reject){
586-
request.end(function(error, data) {
587-
if (error) {
588-
reject(error);
589-
} else {
590-
try {
591-
data = _this.deserialize(data, returnType);
592-
resolve(data);
593-
} catch(error) {
586+
587+
var data = null;
588+
if (!callback) {
589+
return new Promise(function(resolve, reject){
590+
request.end(function(error, data) {
591+
if (error) {
594592
reject(error);
593+
} else {
594+
try {
595+
data = _this.deserialize(data, returnType);
596+
resolve(data);
597+
} catch(error){
598+
reject(error);
599+
}
600+
}
601+
})
602+
});
603+
} else {
604+
request.end(function(error, response) {
605+
if (!error) {
606+
try {
607+
data = _this.deserialize(response, returnType);
608+
} catch (err) {
609+
error = err;
595610
}
596611
}
597-
})
598-
});
599-
} else {
600-
request.end(function(error, response) {
601-
if (!error) {
602-
try {
603-
data = _this.deserialize(response, returnType);
604-
} catch (err) {
605-
error = err;
606-
}
607-
}
608-
callback(error, data, response);
609-
});
610-
return request;
611-
}
612+
callback(error, data, response);
613+
});
614+
return request;
615+
}
612616
};
613617

614618
/**
@@ -798,6 +802,7 @@
798802
var request = superagent.get("https://" + this.getOAuthBasePath() + "/oauth/userinfo").set(headers);
799803
var UserInfo = require('./OAuth').UserInfo;
800804

805+
801806
if(!callback) {
802807
try {
803808
return new Promise(function (resolve, reject) {
@@ -806,15 +811,15 @@
806811
reject(err);
807812
} else {
808813
try {
809-
resolve(UserInfo.constructFromObject(res.body));
814+
return resolve(UserInfo.constructFromObject(res.body));
810815
} catch (error) {
811816
reject(error);
812817
}
813818
}
814819
});
815820
});
816821
} catch (err) {
817-
throw(err)
822+
throw(err);
818823
}
819824
} else {
820825
request.end(function (err, res) {
@@ -839,7 +844,7 @@
839844
return "https://" + oAuthBasePath + "/oauth/auth" + "?" +
840845
"response_type=code&" +
841846
"client_id=" + encodeURIComponent(clientId) + "&" +
842-
"scope=" + encodeURIComponent("signature impersonation") + "&" +
847+
"scope=" + encodeURIComponent(`${SCOPE_SIGNATURE} ${SCOPE_IMPERSONATION}`) + "&" +
843848
"redirect_uri=" + encodeURIComponent(redirectURI);
844849
};
845850

@@ -869,7 +874,7 @@
869874
aud: oAuthBasePath,
870875
iat: now,
871876
exp: later,
872-
scope: "signature"
877+
scope: SCOPE_SIGNATURE
873878
};
874879

875880
var assertion = jwt.sign(jwt_payload, private_key, {algorithm: 'RS256'});
@@ -899,8 +904,8 @@
899904
return (
900905
Array.isArray(scopes)
901906
&& scopes.length > 0
902-
&& scopes.every(function(scope){
903-
return Object.keys(validScopes).some(function(key){
907+
&& scopes.every(function(scope) {
908+
return Object.keys(validScopes).some(function(key) {
904909
return validScopes[key] === scope;
905910
})
906911
})

0 commit comments

Comments
 (0)