Comparing version 2.0.0-beta.20 to 2.0.0-beta.21
@@ -22,6 +22,7 @@ import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object/define-property"; | ||
import { concatStreamsAsDuplex, readAll } from './util/stream'; | ||
import FormData from 'form-data'; | ||
/** | ||
* | ||
*/ | ||
export function createHttpRequestHandlerStreams(req) { | ||
@@ -35,3 +36,7 @@ var reqBody = req.body; | ||
_setTimeout(function () { | ||
duplex.end(reqBody, 'utf8'); | ||
if (reqBody instanceof FormData) { | ||
duplex.end(reqBody.getBuffer()); | ||
} else { | ||
duplex.end(reqBody, 'utf8'); | ||
} | ||
}, 0); | ||
@@ -178,2 +183,2 @@ } | ||
} | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9yZXF1ZXN0LWhlbHBlci50cyJdLCJuYW1lcyI6WyJQYXNzVGhyb3VnaCIsImNvbmNhdFN0cmVhbXNBc0R1cGxleCIsInJlYWRBbGwiLCJjcmVhdGVIdHRwUmVxdWVzdEhhbmRsZXJTdHJlYW1zIiwicmVxIiwicmVxQm9keSIsImJvZHkiLCJpbnB1dCIsIm91dHB1dCIsImR1cGxleCIsImVuZCIsIm9uIiwicmVzIiwibGlzdGVuZXJDb3VudCIsInJlc0JvZHkiLCJlbWl0Iiwic3RyZWFtIiwicmVkaXJlY3RTdGF0dXNlcyIsImlzUmVkaXJlY3QiLCJzdGF0dXMiLCJoYXMiLCJNQVhfUkVESVJFQ1RfQ09VTlQiLCJwZXJmb3JtUmVkaXJlY3RSZXF1ZXN0IiwiZm9sbG93UmVkaXJlY3QiLCJjb3VudGVyIiwicmVkaXJlY3RDYWxsYmFjayIsIkVycm9yIiwicmVkaXJlY3RVcmwiLCJoZWFkZXJzIiwiZ2V0UmVkaXJlY3RSZXF1ZXN0IiwibWV0aG9kIiwidXJsIiwibmV4dFJlcVBhcmFtcyIsImV4ZWN1dGVXaXRoVGltZW91dCIsImV4ZWN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gYXN5bmMgZnVuY3Rpb24gZXhlY3V0ZVdpdGhUaW1lb3V0PFQ+KFxuICBleGVjRm46ICgpID0+IFByb21pc2U8VD4sXG4gIG1zZWM6IG51bWJlciB8IHVuZGVmaW5lZCxcbiAgY2FuY2VsQ2FsbGJhY2s/OiAoKSA9PiB2b2lkLFxuKTogUHJvbWlzZTxUPiB7XG4gIGxldCB0aW1lb3V0ID0gZmFsc2U7XG4gIGxldCBwaWQgPVxuICAgIG1zZWMgIT0gbnVsbFxuICAgICAgPyBzZXRUaW1lb3V0KCgpID0+IHtcbiAgICAgICAgICB0aW1lb3V0ID0gdHJ1ZTtcbiAgICAgICAgICBjYW5jZWxDYWxsYmFjaz8uKCk7XG4gICAgICAgIH0sIG1zZWMpXG4gICAgICA6IHVuZGVmaW5lZDtcbiAgbGV0IHJlcztcbiAgdHJ5IHtcbiAgICByZXMgPSBhd2FpdCBleGVjRm4oKTtcbiAgfSBmaW5hbGx5IHtcbiAgICBpZiAocGlkKSB7XG4gICAgICBjbGVhclRpbWVvdXQocGlkKTtcbiAgICB9XG4gIH1cbiAgaWYgKHRpbWVvdXQpIHtcbiAgICB0aHJvdyBuZXcgRXJyb3IoJ1JlcXVlc3QgVGltZW91dCcpO1xuICB9XG4gIHJldHVybiByZXM7XG59XG4iXX0= |
@@ -42,2 +42,4 @@ "use strict"; | ||
var _formData = _interopRequireDefault(require("form-data")); | ||
function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); if (enumerableOnly) symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } | ||
@@ -60,3 +62,7 @@ | ||
(0, _setTimeout2.default)(() => { | ||
duplex.end(reqBody, 'utf8'); | ||
if (reqBody instanceof _formData.default) { | ||
duplex.end(reqBody.getBuffer()); | ||
} else { | ||
duplex.end(reqBody, 'utf8'); |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PFQ+LFxuICBtc2VjOiBudW1iZXIgfCB1bmRlZmluZWQsXG4gIGNhbmNlbENhbGxiYWNrPzogKCkgPT4gdm9pZCxcbik6IFByb21pc2U8VD4ge1xuICBsZXQgdGltZW91dCA9IGZhbHNlO1xuICBsZXQgcGlkID1cbiAgICBtc2VjICE9IG51bGxcbiAgICAgID8gc2V0VGltZW91dCgoKSA9PiB7XG4gICAgICAgICAgdGltZW91dCA9IHRydWU7XG4gICAgICAgICAgY2FuY2VsQ2FsbGJhY2s/LigpO1xuICAgICAgICB9LCBtc2VjKVxuICAgICAgOiB1bmRlZmluZWQ7XG4gIGxldCByZXM7XG4gIHRyeSB7XG4gICAgcmVzID0gYXdhaXQgZXhlY0ZuKCk7XG4gIH0gZmluYWxseSB7XG4gICAgaWYgKHBpZCkge1xuICAgICAgY2xlYXJUaW1lb3V0KHBpZCk7XG4gICAgfVxuICB9XG4gIGlmICh0aW1lb3V0KSB7XG4gICAgdGhyb3cgbmV3IEVycm9yKCdSZXF1ZXN0IFRpbWVvdXQnKTtcbiAgfVxuICByZXR1cm4gcmVzO1xufVxuIl19 |
/// <reference types="node" /> | ||
import { Optional } from './util'; | ||
import { URLSearchParams } from 'url'; | ||
import * as FormData from 'form-data'; | ||
/** | ||
@@ -8,3 +9,3 @@ * type defs | ||
export declare type Callback<T, T2 = undefined> = (err: Error | null | undefined, ret?: T, ret2?: T2) => any; | ||
export declare type HttpBody = Buffer | URLSearchParams | NodeJS.ReadableStream | string | null; | ||
export declare type HttpBody = Buffer | URLSearchParams | NodeJS.ReadableStream | string | FormData | null; | ||
export declare type HttpMethods = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS'; | ||
@@ -84,3 +85,10 @@ export declare type HttpRequest = { | ||
}; | ||
multipartFileFields?: { | ||
[fieldName: string]: MultipartFileFieldOptions; | ||
}; | ||
}; | ||
export declare type MultipartFileFieldOptions = { | ||
filename?: string; | ||
contentType: string; | ||
}; | ||
export declare type SignedRequestObject = { | ||
@@ -87,0 +95,0 @@ client: { |
@@ -20,6 +20,7 @@ import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object/define-property"; | ||
import { concatStreamsAsDuplex, readAll } from './util/stream'; | ||
import FormData from 'form-data'; | ||
/** | ||
* | ||
*/ | ||
export function createHttpRequestHandlerStreams(req) { | ||
@@ -35,3 +36,7 @@ const { | ||
_setTimeout(() => { | ||
duplex.end(reqBody, 'utf8'); | ||
if (reqBody instanceof FormData) { | ||
duplex.end(reqBody.getBuffer()); | ||
} else { | ||
duplex.end(reqBody, 'utf8'); | ||
} | ||
}, 0); | ||
@@ -121,2 +126,2 @@ } | ||
} | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9yZXF1ZXN0LWhlbHBlci50cyJdLCJuYW1lcyI6WyJQYXNzVGhyb3VnaCIsImNvbmNhdFN0cmVhbXNBc0R1cGxleCIsInJlYWRBbGwiLCJjcmVhdGVIdHRwUmVxdWVzdEhhbmRsZXJTdHJlYW1zIiwicmVxIiwiYm9keSIsInJlcUJvZHkiLCJpbnB1dCIsIm91dHB1dCIsImR1cGxleCIsImVuZCIsIm9uIiwicmVzIiwibGlzdGVuZXJDb3VudCIsInJlc0JvZHkiLCJlbWl0Iiwic3RyZWFtIiwicmVkaXJlY3RTdGF0dXNlcyIsImlzUmVkaXJlY3QiLCJzdGF0dXMiLCJoYXMiLCJNQVhfUkVESVJFQ1RfQ09VTlQiLCJwZXJmb3JtUmVkaXJlY3RSZXF1ZXN0IiwiZm9sbG93UmVkaXJlY3QiLCJjb3VudGVyIiwicmVkaXJlY3RDYWxsYmFjayIsIkVycm9yIiwicmVkaXJlY3RVcmwiLCJoZWFkZXJzIiwiZ2V0UmVkaXJlY3RSZXF1ZXN0IiwibWV0aG9kIiwidXJsIiwibmV4dFJlcVBhcmFtcyIsImV4ZWN1dGVXaXRoVGltZW91dCIsImV4ZWNGbiIsIm1z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cnJvcignUmVxdWVzdCBUaW1lb3V0Jyk7XG4gIH1cbiAgcmV0dXJuIHJlcztcbn1cbiJdfQ== |
@@ -13,3 +13,3 @@ { | ||
"homepage": "http://github.com/jsforce/jsforce", | ||
"version": "2.0.0-beta.20", | ||
"version": "2.0.0-beta.21", | ||
"repository": { | ||
@@ -101,3 +101,3 @@ "type": "git", | ||
"strip-ansi": "^6.0.0", | ||
"xml2js": "^0.4.22" | ||
"xml2js": "^0.5.0" | ||
}, | ||
@@ -104,0 +104,0 @@ "devDependencies": { |
@@ -66,2 +66,3 @@ /** | ||
import { JwtOAuth2Config, JwtOAuth2 } from './jwtOAuth2'; | ||
import FormData from 'form-data'; | ||
@@ -973,9 +974,37 @@ /** | ||
const url = [this._baseUrl(), 'sobjects', sobjectType].join('/'); | ||
let contentType, body; | ||
if (options && options.multipartFileFields) { | ||
// Send the record as a multipart/form-data request. Useful for fields containing large binary blobs. | ||
const form = new FormData(); | ||
// Extract the fields requested to be sent separately from the JSON | ||
Object.entries(options.multipartFileFields).forEach( | ||
([fieldName, fileDetails]) => { | ||
form.append( | ||
fieldName, | ||
Buffer.from(rec[fieldName], 'base64'), | ||
fileDetails, | ||
); | ||
delete rec[fieldName]; | ||
}, | ||
); | ||
// Serialize the remaining fields as JSON | ||
form.append(type, JSON.stringify(rec), { | ||
contentType: 'application/json', | ||
}); | ||
contentType = form.getHeaders()['content-type']; // This is necessary to ensure the 'boundary' is present | ||
body = form; | ||
} else { | ||
// Default behavior: send the request as JSON | ||
contentType = 'application/json'; | ||
body = JSON.stringify(rec); | ||
} | ||
return this.request({ | ||
method: 'POST', | ||
url, | ||
body: JSON.stringify(rec), | ||
body: body, | ||
headers: { | ||
...(options.headers || {}), | ||
'content-type': 'application/json', | ||
'content-type': contentType, | ||
}, | ||
@@ -982,0 +1011,0 @@ }); |
import { PassThrough } from 'stream'; | ||
import { concatStreamsAsDuplex, readAll } from './util/stream'; | ||
import { HttpRequest, HttpRequestOptions, HttpResponse } from './types'; | ||
import FormData from 'form-data'; | ||
@@ -13,5 +14,10 @@ /** | ||
const duplex = concatStreamsAsDuplex(input, output); | ||
if (typeof reqBody !== 'undefined') { | ||
setTimeout(() => { | ||
duplex.end(reqBody, 'utf8'); | ||
if (reqBody instanceof FormData) { | ||
duplex.end(reqBody.getBuffer()); | ||
} else { | ||
duplex.end(reqBody, 'utf8'); | ||
} | ||
}, 0); | ||
@@ -18,0 +24,0 @@ } |
import { Optional } from './util'; | ||
import { URLSearchParams } from 'url'; | ||
import * as FormData from 'form-data'; | ||
@@ -18,2 +19,3 @@ /** | ||
| string | ||
| FormData | ||
| null; | ||
@@ -103,4 +105,10 @@ //| Blob -- from fetch-blob - can add later if needed | ||
headers?: { [name: string]: string }; | ||
multipartFileFields?: { [fieldName: string]: MultipartFileFieldOptions }; | ||
}; | ||
export type MultipartFileFieldOptions = { | ||
filename?: string; | ||
contentType: string; | ||
}; | ||
export type SignedRequestObject = { | ||
@@ -107,0 +115,0 @@ client: { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
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
37318770
337187
15
+ Addedxml2js@0.5.0(transitive)
- Removedxml2js@0.4.23(transitive)
Updatedxml2js@^0.5.0