@jsforce/jsforce-node
Advanced tools
Comparing version 3.2.2 to 3.2.3
@@ -250,3 +250,3 @@ "use strict"; | ||
} | ||
return Array.isArray(errors) ? errors[0] : errors; | ||
return errors; | ||
} | ||
@@ -265,2 +265,11 @@ /** | ||
} | ||
if (Array.isArray(error)) { | ||
if (error.length === 1) { | ||
error = error[0]; | ||
} | ||
else { | ||
return new HttpApiError(`Multiple errors returned. | ||
Check \`error.data\` for the error details`, 'MULTIPLE_API_ERRORS', error); | ||
} | ||
} | ||
error = | ||
@@ -279,5 +288,5 @@ typeof error === 'object' && | ||
Check that the org exists and can be reached. | ||
See error.content for the full html response.`, error.errorCode, error.message); | ||
See \`error.data\` for the full html response.`, error.errorCode, error.message); | ||
} | ||
return new HttpApiError(error.message, error.errorCode); | ||
return error instanceof HttpApiError ? error : new HttpApiError(error.message, error.errorCode, error); | ||
} | ||
@@ -290,11 +299,22 @@ } | ||
class HttpApiError extends Error { | ||
/** | ||
* This contains error-specific details, usually returned from the API. | ||
*/ | ||
data; | ||
errorCode; | ||
content; | ||
constructor(message, errorCode, content) { | ||
constructor(message, errorCode, data) { | ||
super(message); | ||
this.name = errorCode || this.name; | ||
this.errorCode = this.name; | ||
this.content = content; | ||
this.data = data; | ||
} | ||
/** | ||
* This will be removed in the next major (v4) | ||
* | ||
* @deprecated use `error.data` instead | ||
*/ | ||
get content() { | ||
return this.data; | ||
} | ||
} | ||
exports.default = HttpApi; |
@@ -75,6 +75,7 @@ "use strict"; | ||
else { | ||
this.loginUrl = loginUrl || defaultOAuth2Config.loginUrl; | ||
this.authzServiceUrl = `${this.loginUrl}/services/oauth2/authorize`; | ||
this.tokenServiceUrl = `${this.loginUrl}/services/oauth2/token`; | ||
this.revokeServiceUrl = `${this.loginUrl}/services/oauth2/revoke`; | ||
const loginUrlObject = new URL(loginUrl || defaultOAuth2Config.loginUrl); | ||
this.loginUrl = loginUrlObject.href; | ||
this.authzServiceUrl = `${loginUrlObject.origin}/services/oauth2/authorize`; | ||
this.tokenServiceUrl = `${loginUrlObject.origin}/services/oauth2/token`; | ||
this.revokeServiceUrl = `${loginUrlObject.origin}/services/oauth2/revoke`; | ||
} | ||
@@ -81,0 +82,0 @@ this.clientId = clientId; |
@@ -1,2 +0,2 @@ | ||
declare const _default: "3.2.2"; | ||
declare const _default: "3.2.3"; | ||
export default _default; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.default = '3.2.2'; | ||
exports.default = '3.2.3'; |
@@ -13,3 +13,3 @@ { | ||
"homepage": "http://github.com/jsforce/jsforce", | ||
"version": "3.2.2", | ||
"version": "3.2.3", | ||
"repository": { | ||
@@ -23,3 +23,3 @@ "type": "git", | ||
"type": "MIT", | ||
"url": "http://github.com/jsforce/jsforce/raw/master/LICENSE" | ||
"url": "http://github.com/jsforce/jsforce/raw/main/LICENSE" | ||
} | ||
@@ -26,0 +26,0 @@ ], |
@@ -63,4 +63,4 @@ # jsforce | ||
If you want to implement any additional features, to be added to JSforce to our master branch, which may or may not be merged please first check current [opening issues](https://github.com/jsforce/jsforce/issues?q=is%3Aopen) with milestones and confirm whether the feature is on road map or not. | ||
If you want to implement any additional features, to be added to JSforce to our main branch, which may or may not be merged please first check current [opening issues](https://github.com/jsforce/jsforce/issues?q=is%3Aopen) with milestones and confirm whether the feature is on road map or not. | ||
If your feature implementation is brand-new or fixing unsupposed bugs in the library's test cases, please include additional test codes in the `test/` directory. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2160548
61650