@jsforce/jsforce-node 3.2.1 → 3.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/VERSION.d.ts +1 -1
- package/lib/VERSION.js +1 -1
- package/lib/oauth2.js +1 -2
- package/lib/request.js +1 -1
- package/lib/session-refresh-delegate.js +3 -0
- package/package.json +1 -1
package/lib/VERSION.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "3.2.
|
|
1
|
+
declare const _default: "3.2.2";
|
|
2
2
|
export default _default;
|
package/lib/VERSION.js
CHANGED
package/lib/oauth2.js
CHANGED
|
@@ -163,7 +163,7 @@ class OAuth2 {
|
|
|
163
163
|
* OAuth2 Username-Password Flow (Resource Owner Password Credentials)
|
|
164
164
|
*/
|
|
165
165
|
async authenticate(username, password) {
|
|
166
|
-
if (!this.clientId || !this.clientSecret
|
|
166
|
+
if (!this.clientId || !this.clientSecret) {
|
|
167
167
|
throw new Error('No valid OAuth2 client configuration set');
|
|
168
168
|
}
|
|
169
169
|
const ret = await this._postParams({
|
|
@@ -172,7 +172,6 @@ class OAuth2 {
|
|
|
172
172
|
password,
|
|
173
173
|
client_id: this.clientId,
|
|
174
174
|
client_secret: this.clientSecret,
|
|
175
|
-
redirect_uri: this.redirectUri,
|
|
176
175
|
});
|
|
177
176
|
return ret;
|
|
178
177
|
}
|
package/lib/request.js
CHANGED
|
@@ -56,7 +56,7 @@ async function startFetchRequest(request, options, input, output, emitter, count
|
|
|
56
56
|
const controller = new abort_controller_1.default();
|
|
57
57
|
let retryCount = 0;
|
|
58
58
|
const retryOpts = {
|
|
59
|
-
statusCodes: options.retry?.statusCodes ?? [429, 500, 502, 503, 504],
|
|
59
|
+
statusCodes: options.retry?.statusCodes ?? [420, 429, 500, 502, 503, 504],
|
|
60
60
|
maxRetries: options.retry?.maxRetries ?? 5,
|
|
61
61
|
minTimeout: options.retry?.minTimeout ?? 500,
|
|
62
62
|
timeoutFactor: options.retry?.timeoutFactor ?? 2,
|
|
@@ -53,6 +53,9 @@ class SessionRefreshDelegate {
|
|
|
53
53
|
await this._refreshPromise;
|
|
54
54
|
this._logger.info('<refresh complete>');
|
|
55
55
|
}
|
|
56
|
+
catch (err) {
|
|
57
|
+
throw new Error(`Unable to refresh session due to: ${err.message}`);
|
|
58
|
+
}
|
|
56
59
|
finally {
|
|
57
60
|
this._refreshPromise = undefined;
|
|
58
61
|
this._lastRefreshedAt = Date.now();
|