Skip to content

Commit

Permalink
Version 5.14.0-rc1 release (#283)
Browse files Browse the repository at this point in the history
* Version 5.14.0-rc1-v2.1-21.4.00.00 release

* Update CHANGELOG.md

Co-authored-by: root <[email protected]>
Co-authored-by: acooper4960 <[email protected]>
  • Loading branch information
3 people authored Dec 15, 2021
1 parent f4fee3f commit 6c88de9
Show file tree
Hide file tree
Showing 53 changed files with 3,071 additions and 615 deletions.
1 change: 0 additions & 1 deletion .swagger-codegen-ignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,4 @@ test/*/*.spec.js
test/assert-equals.js
src/OAuth.js
src/RestApi.js
src/ApiClient.js
src/oauth/
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
See [DocuSign Support Center](https://support.docusign.com/en/releasenotes/) for Product Release Notes.


## [v5.14.0-rc1] - eSignature API v2.1-21.4.00.00 - 2021-12-13
### Changed
- Added support for version v2.1-21.4.00.00 of the DocuSign ESignature API.
- Updated the SDK release version.
### Security
- Version bump for passport-oauth2: [CVE-2021-41580](https://nvd.nist.gov/vuln/detail/CVE-2021-41580).

## [5.13.0] - ESignature API v2.1-21.3.02.00 - 2021-10-29
### Changed
- Added support for version v2.1-21.3.02.00 of the DocuSign ESignature API.
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "docusign-esign",
"version": "5.13.0",
"version": "5.14.0-rc1",
"description": "DocuSign Node.js API client.",
"license": "MIT",
"main": "src/index.js",
Expand Down Expand Up @@ -36,7 +36,7 @@
"push-docs": "git subtree push --prefix docs origin gh-pages",
"update-docs": "./node_modules/.bin/jsdoc -c .jsdoc.json",
"check-config": "./scripts/check-config.js",
"test": "semistandard --fix && ./node_modules/mocha/bin/mocha --reporter mocha-junit-reporter test/SdkUnitTests test/SdkUnitTestsWithCallback"
"test": "semistandard --fix && ./node_modules/mocha/bin/mocha --reporter mocha-junit-reporter --timeout 60000"
},
"semistandard": {
"globals": [
Expand All @@ -53,7 +53,7 @@
"dependencies": {
"csv-stringify": "^1.0.0",
"jsonwebtoken": "8.2.0",
"passport-oauth2": "1.4.0",
"passport-oauth2": "^1.6.1",
"safe-buffer": "^5.1.2",
"superagent": "3.8.2"
},
Expand Down
95 changes: 50 additions & 45 deletions src/ApiClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@
* DocuSign REST API
* The DocuSign REST API provides you with a powerful, convenient, and simple Web services API for interacting with DocuSign.
*
* OpenAPI spec version: v2
* OpenAPI spec version: v2.1
* Contact: [email protected]
*
* NOTE: This class is auto generated. Do not edit the class manually and submit a new issue instead.
*
*/

(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
Expand All @@ -26,6 +25,10 @@
}(this, function(superagent, opts) {
'use strict';

var SCOPE_SIGNATURE = "signature";
var SCOPE_EXTENDED = "extended";
var SCOPE_IMPERSONATION = "impersonation";

var removeNulls = function(obj) {
var isArray = obj instanceof Array;
for (var k in obj) {
Expand Down Expand Up @@ -73,6 +76,7 @@
'grant_type': 'urn:ietf:params:oauth:grant-type:jwt-bearer'
});


if (!callback){
return new Promise(function(resolve, reject){
request.end(function(err, data){
Expand All @@ -82,7 +86,7 @@
resolve(data);
}
})
})
});
} else {
request.end(callback);
}
Expand All @@ -106,7 +110,6 @@

/**
* @module ApiClient
* @version 3.0.0
*/

/**
Expand Down Expand Up @@ -169,10 +172,10 @@
this.cache = true;
};

/**
/**
* Gets the API endpoint base URL.
*/
exports.prototype.getBasePath = function getBasePath() {
exports.prototype.getBasePath = function getBasePath() {
return this.basePath;
};

Expand All @@ -184,10 +187,10 @@
this.oAuthBasePath = deriveOAuthBasePathFromRestBasePath(basePath);
};

/**
/**
* Gets the authentication server endpoint base URL.
*/
exports.prototype.getOAuthBasePath = function getOAuthBasePath() {
exports.prototype.getOAuthBasePath = function getOAuthBasePath() {
return this.oAuthBasePath;
};

Expand Down Expand Up @@ -282,9 +285,9 @@
exports.prototype.isFileParam = function(param) {
// fs.ReadStream in Node.js (but not in runtime like browserify)
if (typeof window === 'undefined' &&
typeof require === 'function' &&
require('fs') &&
param instanceof require('fs').ReadStream) {
typeof require === 'function' &&
require('fs') &&
param instanceof require('fs').ReadStream) {
return true;
}
// Buffer in Node.js
Expand Down Expand Up @@ -487,8 +490,8 @@
* @returns {Object} The SuperAgent request object if a callback is specified, else {Promise} A {@link https://www.promisejs.org/|Promise} object.
*/
exports.prototype.callApi = function callApi(path, httpMethod, pathParams,
queryParams, headerParams, formParams, bodyParam, authNames, contentTypes, accepts,
returnType, callback) {
queryParams, headerParams, formParams, bodyParam, authNames, contentTypes, accepts,
returnType, callback) {

var _this = this;
var url = this.buildUrl(path, pathParams);
Expand Down Expand Up @@ -580,35 +583,36 @@
})
}

var data = null;
if (!callback) {
return new Promise(function(resolve, reject){
request.end(function(error, data) {
if (error) {
reject(error);
} else {
try {
data = _this.deserialize(data, returnType);
resolve(data);
} catch(error) {

var data = null;
if (!callback) {
return new Promise(function(resolve, reject){
request.end(function(error, data) {
if (error) {
reject(error);
} else {
try {
data = _this.deserialize(data, returnType);
resolve(data);
} catch(error){
reject(error);
}
}
})
});
} else {
request.end(function(error, response) {
if (!error) {
try {
data = _this.deserialize(response, returnType);
} catch (err) {
error = err;
}
}
})
});
} else {
request.end(function(error, response) {
if (!error) {
try {
data = _this.deserialize(response, returnType);
} catch (err) {
error = err;
}
}
callback(error, data, response);
});
return request;
}
callback(error, data, response);
});
return request;
}
};

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


if(!callback) {
try {
return new Promise(function (resolve, reject) {
Expand All @@ -806,15 +811,15 @@
reject(err);
} else {
try {
resolve(UserInfo.constructFromObject(res.body));
return resolve(UserInfo.constructFromObject(res.body));
} catch (error) {
reject(error);
}
}
});
});
} catch (err) {
throw(err)
throw(err);
}
} else {
request.end(function (err, res) {
Expand All @@ -839,7 +844,7 @@
return "https://" + oAuthBasePath + "/oauth/auth" + "?" +
"response_type=code&" +
"client_id=" + encodeURIComponent(clientId) + "&" +
"scope=" + encodeURIComponent("signature impersonation") + "&" +
"scope=" + encodeURIComponent(`${SCOPE_SIGNATURE} ${SCOPE_IMPERSONATION}`) + "&" +
"redirect_uri=" + encodeURIComponent(redirectURI);
};

Expand Down Expand Up @@ -869,7 +874,7 @@
aud: oAuthBasePath,
iat: now,
exp: later,
scope: "signature"
scope: SCOPE_SIGNATURE
};

var assertion = jwt.sign(jwt_payload, private_key, {algorithm: 'RS256'});
Expand Down Expand Up @@ -899,8 +904,8 @@
return (
Array.isArray(scopes)
&& scopes.length > 0
&& scopes.every(function(scope){
return Object.keys(validScopes).some(function(key){
&& scopes.every(function(scope) {
return Object.keys(validScopes).some(function(key) {
return validScopes[key] === scope;
})
})
Expand Down
Loading

0 comments on commit 6c88de9

Please sign in to comment.