Files
call-sdk/packages/common/lib/utils/getResponseWithoutCors.js
2024-11-03 11:57:16 +05:30

22 lines
975 B
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getResponseWithoutCors = void 0;
var RequestType_1 = require("../types/RequestType.js");
var MessagingType_1 = require("@universal-call-sdk/adapter-ameyo/types/MessagingType.js");
var getResponseWithoutCors = function (_a) {
var url = _a.url, method = _a.method, _b = _a.data, data = _b === void 0 ? {} : _b, requestKey = _a.requestKey, _c = _a.requestType, requestType = _c === void 0 ? RequestType_1.default.JSON : _c, _d = _a.headers, headers = _d === void 0 ? null : _d;
window.postMessage({
type: MessagingType_1.default.GET_RESPONSE_WITHOUT_CORS,
data: {
url: url,
method: method,
data: data,
requestKey: requestKey,
requestType: requestType,
headers: headers
}
});
};
exports.getResponseWithoutCors = getResponseWithoutCors;
exports.default = exports.getResponseWithoutCors;