TP-89230 | universal call sdk
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import {getResponseWithoutCors} from "@universal-call-sdk/common/lib/main.ts";
|
||||
import {RequestKeys} from "./types";
|
||||
import {RequestType} from "@universal-call-sdk/common/lib/main.ts";
|
||||
import getResponseWithoutCors from "@universal-call-sdk/common/lib/utils/getResponseWithoutCors.ts";
|
||||
import { RequestKeys} from "./types";
|
||||
import RequestType from "@universal-call-sdk/common/lib/types/RequestType.ts";
|
||||
|
||||
|
||||
const BASE_AMEYO_URL = window.BASE_AMEYO_URL;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import IAdapter from "@universal-call-sdk/common/Interfaces/IAdapter.ts";
|
||||
import GenericObject from "@universal-call-sdk/common/types/GenericObject.ts";
|
||||
import IAdapter from "@universal-call-sdk/common/lib/Interfaces/IAdapter.ts";
|
||||
import GenericObject from "@universal-call-sdk/common/lib/types/GenericObject.ts";
|
||||
import {AmeyoInitializationOptions, RequestKeys, StateType} from "./types.ts";
|
||||
import MessagingType from "../types/MessagingType.ts";
|
||||
import {
|
||||
|
||||
50
packages/common/dist/common.js
vendored
50
packages/common/dist/common.js
vendored
@@ -1,49 +1 @@
|
||||
var l = /* @__PURE__ */ ((t) => (t.JSON = "JSON", t.RAW = "RAW", t))(l || {});
|
||||
const o = ({
|
||||
url: t,
|
||||
method: e,
|
||||
data: a = {},
|
||||
requestKey: n,
|
||||
requestType: s = l.JSON,
|
||||
headers: r = null
|
||||
}) => {
|
||||
window.postMessage({
|
||||
type: "getResponseWithoutCors",
|
||||
data: {
|
||||
url: t,
|
||||
method: e,
|
||||
data: a,
|
||||
requestKey: n,
|
||||
requestType: s,
|
||||
headers: r
|
||||
}
|
||||
});
|
||||
};
|
||||
class C {
|
||||
registerOnCallIncoming(e) {
|
||||
e();
|
||||
}
|
||||
registerOnCallConnected(e) {
|
||||
e();
|
||||
}
|
||||
registerOnCallDisconnected(e) {
|
||||
e();
|
||||
}
|
||||
acceptCall() {
|
||||
}
|
||||
rejectCall() {
|
||||
}
|
||||
muteCall() {
|
||||
}
|
||||
unmuteCall() {
|
||||
}
|
||||
setOnBreak() {
|
||||
}
|
||||
setAvailable() {
|
||||
}
|
||||
}
|
||||
export {
|
||||
C as IAdapter,
|
||||
l as RequestType,
|
||||
o as getResponseWithoutCors
|
||||
};
|
||||
|
||||
|
||||
1
packages/common/dist/main.d.ts
vendored
Normal file
1
packages/common/dist/main.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export {};
|
||||
@@ -1,12 +1,11 @@
|
||||
import { default as RequestType } from '../types/RequestType.ts';
|
||||
import { default as GenericObject } from '../types/GenericObject.ts';
|
||||
type GetResponseWithoutCors = {
|
||||
url: string;
|
||||
method: string;
|
||||
data?: GenericObject | string;
|
||||
data?: Record<string, any> | string;
|
||||
requestKey: string;
|
||||
requestType?: RequestType;
|
||||
headers?: GenericObject | null;
|
||||
headers?: Record<string, any> | null;
|
||||
};
|
||||
export declare const getResponseWithoutCors: ({ url, method, data, requestKey, requestType, headers }: GetResponseWithoutCors) => void;
|
||||
export default getResponseWithoutCors;
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = common;
|
||||
|
||||
function common() {
|
||||
return 'Hello from common';
|
||||
}
|
||||
@@ -1,13 +1,13 @@
|
||||
import getResponseWithoutCors from "../utils/getResponseWithoutCors.ts"
|
||||
import GenericObject from "../../common/types/GenericObject.ts";
|
||||
import RequestType from "../../common/types/RequestType.ts";
|
||||
import IAdapter from "../Interfaces/IAdapter.ts";
|
||||
|
||||
|
||||
|
||||
export {
|
||||
getResponseWithoutCors,
|
||||
type GenericObject,
|
||||
RequestType,
|
||||
IAdapter
|
||||
}
|
||||
// import getResponseWithoutCors from "./utils/getResponseWithoutCors"
|
||||
// import GenericObject from "./types/GenericObject";
|
||||
// import RequestType from "./types/RequestType";
|
||||
// import IAdapter from "./Interfaces/IAdapter";
|
||||
//
|
||||
//
|
||||
//
|
||||
// export {
|
||||
// getResponseWithoutCors,
|
||||
// type GenericObject,
|
||||
// RequestType,
|
||||
// IAdapter
|
||||
// }
|
||||
@@ -2,7 +2,7 @@
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getResponseWithoutCors = void 0;
|
||||
var RequestType_1 = require("../types/RequestType.js");
|
||||
var MessagingType_1 = require("../../adapter-ameyo/types/MessagingType");
|
||||
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({
|
||||
@@ -1,5 +1,4 @@
|
||||
import RequestType from "../types/RequestType.ts";
|
||||
import GenericObject from "../types/GenericObject.ts";
|
||||
|
||||
enum MessagingType {
|
||||
GET_RESPONSE_WITHOUT_CORS = 'getResponseWithoutCors',
|
||||
@@ -10,10 +9,10 @@ enum MessagingType {
|
||||
type GetResponseWithoutCors = {
|
||||
url: string;
|
||||
method: string;
|
||||
data ? : GenericObject | string;
|
||||
data ?:Record<string, any> | string;
|
||||
requestKey: string;
|
||||
requestType ? : RequestType;
|
||||
headers ? : GenericObject | null;
|
||||
requestType ?: RequestType;
|
||||
headers ?: Record<string, any> | null;
|
||||
}
|
||||
|
||||
export const getResponseWithoutCors = ({
|
||||
@@ -2,7 +2,6 @@
|
||||
"name": "@universal-call-sdk/common",
|
||||
"version": "1.0.4",
|
||||
"type": "module",
|
||||
"main": "dist/index.js",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "tsc --p ./tsconfig.build.json && vite build",
|
||||
|
||||
@@ -20,5 +20,5 @@
|
||||
"noUnusedParameters": true,
|
||||
"noFallthroughCasesInSwitch": true
|
||||
},
|
||||
"include": ["src", "lib"]
|
||||
"include": ["lib"]
|
||||
}
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
{
|
||||
"extends": "./tsconfig.app.json",
|
||||
"include": [
|
||||
"Interfaces",
|
||||
"types",
|
||||
"utils"
|
||||
]
|
||||
"include":["lib"]
|
||||
}
|
||||
Reference in New Issue
Block a user