UNPKG

2.72 kBJavaScriptView Raw
1"use strict";
2var __extends = (this && this.__extends) || (function () {
3 var extendStatics = function (d, b) {
4 extendStatics = Object.setPrototypeOf ||
5 ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6 function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7 return extendStatics(d, b);
8 };
9 return function (d, b) {
10 if (typeof b !== "function" && b !== null)
11 throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12 extendStatics(d, b);
13 function __() { this.constructor = d; }
14 d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15 };
16})();
17Object.defineProperty(exports, "__esModule", { value: true });
18exports.ODataFunctionImportRequestConfigV4 = exports.ODataFunctionImportRequestConfig = void 0;
19var odata_common_1 = require("../../odata-common");
20var ODataFunctionImportRequestConfig = /** @class */ (function (_super) {
21 __extends(ODataFunctionImportRequestConfig, _super);
22 /**
23 * Creates an instance of ODataFunctionImportRequestConfig.
24 * @param method - HTTP method for the request
25 * @param defaultServicePath - Default path of the service
26 * @param functionImportName - The name of the function import.
27 * @param parameters - Object containing the parameters with a value and additional meta information
28 * @param oDataUri - ODataUri conversion interface at runtime either v2 or v4
29 */
30 function ODataFunctionImportRequestConfig(method, defaultServicePath, functionImportName, parameters, oDataUri) {
31 return _super.call(this, method, defaultServicePath, functionImportName, parameters, oDataUri) || this;
32 }
33 ODataFunctionImportRequestConfig.prototype.resourcePath = function () {
34 var _this = this;
35 return "".concat(this.functionImportName, "(").concat(Object.values(this.parameters)
36 .map(function (parameter) {
37 return "".concat(parameter.originalName, "=").concat(_this.oDataUri.convertToUriFormat(parameter.value, parameter.edmType));
38 })
39 .join(','), ")");
40 };
41 ODataFunctionImportRequestConfig.prototype.queryParameters = function () {
42 return this.prependDollarToQueryParameters({
43 format: 'json'
44 });
45 };
46 return ODataFunctionImportRequestConfig;
47}(odata_common_1.ODataFunctionImportRequestConfig));
48exports.ODataFunctionImportRequestConfig = ODataFunctionImportRequestConfig;
49exports.ODataFunctionImportRequestConfigV4 = ODataFunctionImportRequestConfig;
50//# sourceMappingURL=odata-function-import-request-config.js.map
\No newline at end of file