rest-client-sdk 7.2.3 → 7.3.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/README.md +6 -1
- package/dist/index.cjs +23 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +23 -1
- package/dist/index.mjs.map +1 -1
- package/dist/types/client/AbstractClient.d.ts +9 -0
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1111,6 +1111,28 @@ var AbstractClient = /*#__PURE__*/function () {
|
|
|
1111
1111
|
value: function update(entity) {
|
|
1112
1112
|
var queryParam = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1113
1113
|
var requestParams = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
1114
|
+
return this._update('PUT', entity, queryParam, requestParams);
|
|
1115
|
+
}
|
|
1116
|
+
/**
|
|
1117
|
+
* partially update an entity using the `PATCH` HTTP verb
|
|
1118
|
+
*
|
|
1119
|
+
* @param {Record<string, unknown>} entity the entity to update
|
|
1120
|
+
* @param {Record<string, unknown>} queryParam query parameters that will be added to the request
|
|
1121
|
+
* @param {Record<string, unknown>} requestParams parameters that will be send as second parameter to the `fetch` call
|
|
1122
|
+
*/
|
|
1123
|
+
|
|
1124
|
+
}, {
|
|
1125
|
+
key: "patch",
|
|
1126
|
+
value: function patch(entity) {
|
|
1127
|
+
var queryParam = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1128
|
+
var requestParams = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
1129
|
+
return this._update('PATCH', entity, queryParam, requestParams);
|
|
1130
|
+
}
|
|
1131
|
+
}, {
|
|
1132
|
+
key: "_update",
|
|
1133
|
+
value: function _update(method, entity) {
|
|
1134
|
+
var queryParam = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
1135
|
+
var requestParams = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
1114
1136
|
var url = new URI(this.getEntityURI(entity));
|
|
1115
1137
|
url.addSearch(queryParam);
|
|
1116
1138
|
var newSerializedModel = this.serializer.normalizeItem(entity, this.metadata);
|
|
@@ -1128,7 +1150,7 @@ var AbstractClient = /*#__PURE__*/function () {
|
|
|
1128
1150
|
}
|
|
1129
1151
|
|
|
1130
1152
|
return this.deserializeResponse(this.authorizedFetch(url, _objectSpread2({
|
|
1131
|
-
method:
|
|
1153
|
+
method: method,
|
|
1132
1154
|
body: this.serializer.encodeItem(newSerializedModel, this.metadata)
|
|
1133
1155
|
}, requestParams)), 'item');
|
|
1134
1156
|
}
|