@sap-cloud-sdk/core
Version:
SAP Cloud SDK for JavaScript core
65 lines • 2.84 kB
JavaScript
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.ODataBatchRequestConfig = void 0;
var uuid_1 = require("uuid");
var odata_request_config_1 = require("./odata-request-config");
var ODataBatchRequestConfig = /** @class */ (function (_super) {
__extends(ODataBatchRequestConfig, _super);
/**
* Creates an instance of ODataBatchRequestConfig.
* @param defaultServicePath - The default OData service path
* @param boundary - Request boundary for separation of subrequests. Defaults to an autogenerated value.
*/
function ODataBatchRequestConfig(defaultServicePath, boundary) {
if (boundary === void 0) { boundary = "batch_".concat((0, uuid_1.v4)()); }
var _this = _super.call(this, 'post', defaultServicePath, {
'content-type': "multipart/mixed; boundary=".concat(boundary),
accept: 'multipart/mixed'
}) || this;
_this.defaultServicePath = defaultServicePath;
_this.boundary = boundary;
_this.subRequestPathType = 'relativeToService';
return _this;
}
Object.defineProperty(ODataBatchRequestConfig.prototype, "batchId", {
/**
* @deprecated Since v1.30.0. Use [[boundary]] instead.
*/
get: function () {
return this.boundary;
},
enumerable: false,
configurable: true
});
ODataBatchRequestConfig.prototype.withSubRequestPathType = function (subRequestPathType) {
this.subRequestPathType = subRequestPathType;
};
ODataBatchRequestConfig.prototype.resourcePath = function () {
return '$batch';
};
ODataBatchRequestConfig.prototype.queryParameters = function () {
return {};
};
/**
* @deprecated Since v1.30.0.
*/
ODataBatchRequestConfig.content_type_prefix = 'multipart/mixed; boundary=batch_';
return ODataBatchRequestConfig;
}(odata_request_config_1.ODataRequestConfig));
exports.ODataBatchRequestConfig = ODataBatchRequestConfig;
//# sourceMappingURL=odata-batch-request-config.js.map
;