@jsforce/jsforce-node 3.6.5 → 3.7.0

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 CHANGED
@@ -1,2 +1,2 @@
1
- declare const _default: "3.6.5";
1
+ declare const _default: "3.7.0";
2
2
  export default _default;
package/lib/VERSION.js CHANGED
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = '3.6.5';
3
+ exports.default = '3.7.0';
@@ -121,9 +121,10 @@ export declare class MetadataApi<S extends Schema> {
121
121
  */
122
122
  deploy(zipInput: Readable | Buffer | string, options?: Partial<DeployOptions>): DeployResultLocator<S>;
123
123
  /**
124
- * Checks the status of declarative metadata call deploy()
124
+ * Checks the status of declarative metadata call deploy(), using either
125
+ * SOAP or REST APIs. SOAP is the default.
125
126
  */
126
- checkDeployStatus(asyncProcessId: string, includeDetails?: boolean): Promise<DeployResult>;
127
+ checkDeployStatus(asyncProcessId: string, includeDetails?: boolean, rest?: boolean): Promise<DeployResult>;
127
128
  cancelDeploy(id: string): Promise<CancelDeployResult>;
128
129
  }
129
130
  /**
@@ -254,13 +254,20 @@ class MetadataApi {
254
254
  return new DeployResultLocator(this, res);
255
255
  }
256
256
  /**
257
- * Checks the status of declarative metadata call deploy()
257
+ * Checks the status of declarative metadata call deploy(), using either
258
+ * SOAP or REST APIs. SOAP is the default.
258
259
  */
259
- checkDeployStatus(asyncProcessId, includeDetails = false) {
260
- return this._invoke('checkDeployStatus', {
261
- asyncProcessId,
262
- includeDetails,
263
- }, schema_1.ApiSchemas.DeployResult);
260
+ async checkDeployStatus(asyncProcessId, includeDetails = false, rest = false) {
261
+ if (rest) {
262
+ const url = `/metadata/deployRequest/${asyncProcessId}${includeDetails ? '?includeDetails=true' : ''}`;
263
+ return (await this._conn.requestGet(url)).deployResult;
264
+ }
265
+ else {
266
+ return this._invoke('checkDeployStatus', {
267
+ asyncProcessId,
268
+ includeDetails,
269
+ }, schema_1.ApiSchemas.DeployResult);
270
+ }
264
271
  }
265
272
  async cancelDeploy(id) {
266
273
  return this._invoke('cancelDeploy', { id });
package/lib/request.js CHANGED
@@ -84,9 +84,7 @@ async function startFetchRequest(request, options, input, output, emitter, count
84
84
  if (resOrErr instanceof node_fetch_1.Response) {
85
85
  if (retryOpts.statusCodes.includes(resOrErr.status)) {
86
86
  if (maxRetry === retryCount) {
87
- const err = new Error('Request failed');
88
- err.name = 'RequestRetryError';
89
- throw err;
87
+ return false;
90
88
  }
91
89
  else {
92
90
  return true;
@@ -160,9 +158,7 @@ async function startFetchRequest(request, options, input, output, emitter, count
160
158
  }
161
159
  logger.debug('Skipping retry...');
162
160
  if (maxRetry === retryCount) {
163
- const error = new Error('Request failed', { cause: err });
164
- error.name = 'RequestRetryError';
165
- throw error;
161
+ throw err;
166
162
  }
167
163
  else {
168
164
  throw err;
package/package.json CHANGED
@@ -10,7 +10,7 @@
10
10
  "database.com"
11
11
  ],
12
12
  "homepage": "http://github.com/jsforce/jsforce",
13
- "version": "3.6.5",
13
+ "version": "3.7.0",
14
14
  "repository": {
15
15
  "type": "git",
16
16
  "url": "git://github.com/jsforce/jsforce.git"