rest-client-sdk 7.6.0 → 7.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/dist/index.cjs +10 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +10 -3
- package/dist/index.mjs.map +1 -1
- package/dist/types/client/AbstractClient.d.ts +3 -2
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -858,15 +858,18 @@ var AbstractClient = /*#__PURE__*/function () {
|
|
|
858
858
|
/**
|
|
859
859
|
* delete an entity
|
|
860
860
|
*
|
|
861
|
-
* @param {Record<string, unknown>} the entity to delete
|
|
861
|
+
* @param {Record<string, unknown>} entity the entity to delete
|
|
862
862
|
* @param {Record<string, unknown>} requestParams parameters that will be send as second parameter to the `fetch` call
|
|
863
|
+
* @param {Record<string, unknown>} queryParam query parameters that will be added to the request
|
|
863
864
|
*/
|
|
864
865
|
}, {
|
|
865
866
|
key: "delete",
|
|
866
867
|
value: function _delete(entity) {
|
|
867
868
|
var _this = this;
|
|
868
869
|
var requestParams = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
869
|
-
var
|
|
870
|
+
var queryParam = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
871
|
+
var url = new URI(this.getEntityURI(entity));
|
|
872
|
+
url.addSearch(queryParam);
|
|
870
873
|
var identifier = this._getEntityIdentifier(entity);
|
|
871
874
|
return this.authorizedFetch(url, _objectSpread2({
|
|
872
875
|
method: 'DELETE'
|
|
@@ -1060,7 +1063,11 @@ var AbstractClient = /*#__PURE__*/function () {
|
|
|
1060
1063
|
var _this6 = this;
|
|
1061
1064
|
var params = requestParams;
|
|
1062
1065
|
var baseHeaders = {};
|
|
1063
|
-
|
|
1066
|
+
|
|
1067
|
+
// a FormData body must let fetch set the Content-Type itself,
|
|
1068
|
+
// with the multipart/form-data boundary
|
|
1069
|
+
var isFormDataBody = FormData !== undefined && params.body instanceof FormData;
|
|
1070
|
+
if ((params.method !== 'GET' || params.method !== 'GET' && params.method !== 'DELETE') && !isFormDataBody) {
|
|
1064
1071
|
baseHeaders = {
|
|
1065
1072
|
'Content-Type': 'application/json'
|
|
1066
1073
|
};
|