TP-89230 | universal call sdk

This commit is contained in:
varnit goyal
2024-11-03 11:57:16 +05:30
parent ce48be0009
commit 0c53638da4
18 changed files with 28 additions and 89 deletions

View File

@@ -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;

View File

@@ -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 {

View File

@@ -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
View File

@@ -0,0 +1 @@
export {};

View File

@@ -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;

View File

@@ -1,7 +0,0 @@
'use strict';
module.exports = common;
function common() {
return 'Hello from common';
}

View File

@@ -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
// }

View File

@@ -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({

View File

@@ -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 = ({

View File

@@ -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",

View File

@@ -20,5 +20,5 @@
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true
},
"include": ["src", "lib"]
"include": ["lib"]
}

View File

@@ -1,8 +1,4 @@
{
"extends": "./tsconfig.app.json",
"include": [
"Interfaces",
"types",
"utils"
]
"include":["lib"]
}