Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ikas/app-helpers

Package Overview
Dependencies
Maintainers
2
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ikas/app-helpers - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2-alpha.0

9

dist/helpers/app-bridge.d.ts

@@ -11,2 +11,3 @@ export declare class AppBridgeHelper {

static getNewToken(): Promise<string | undefined>;
static getDashboardLanguage(): Promise<string | undefined>;
static sendEvent(event: AppEvent): void;

@@ -21,6 +22,10 @@ }

REQUEST_TOKEN = "REQUEST_TOKEN",
CLOSE_APP = "CLOSE_APP"
CLOSE_APP = "CLOSE_APP",
AUTHORIZED_APP_ID = "AUTHORIZED_APP_ID",
GET_DASHBOARD_LANGUAGE = "GET_DASHBOARD_LANGUAGE"
}
export declare enum AppBridgeCallbackMessageType {
REQUEST_TOKEN_RESPONSE = "REQUEST_TOKEN_RESPONSE"
REQUEST_TOKEN_RESPONSE = "REQUEST_TOKEN_RESPONSE",
AUTHORIZED_APP_ID_RESPONSE = "AUTHORIZED_APP_ID_RESPONSE",
GET_DASHBOARD_LANGUAGE_RESPONSE = "GET_DASHBOARD_LANGUAGE_RESPONSE"
}

@@ -27,0 +32,0 @@ export declare type AppEvent = {

@@ -85,2 +85,28 @@ "use strict";

}
static getDashboardLanguage() {
return new Promise((resolve, reject) => {
const timer = setTimeout(() => reject('Timed out'), 30000);
try {
const callback = (msg) => {
var _a, _b, _c;
if (((_a = msg.data) === null || _a === void 0 ? void 0 : _a.type) === AppBridgeCallbackMessageType.GET_DASHBOARD_LANGUAGE_RESPONSE) {
const lang = (_c = (_b = msg.data) === null || _b === void 0 ? void 0 : _b.data) === null || _c === void 0 ? void 0 : _c.lang;
resolve(lang);
AppBridgeHelper.stopListener(callback);
clearTimeout(timer);
}
};
AppBridgeHelper.startListener(callback);
const event = {
type: AppBridgeMessageType.GET_DASHBOARD_LANGUAGE,
data: {},
};
AppBridgeHelper.sendEvent(event);
}
catch (e) {
clearTimeout(timer);
reject(e);
}
});
}
static sendEvent(event) {

@@ -101,2 +127,4 @@ //@ts-ignore

AppBridgeMessageType["CLOSE_APP"] = "CLOSE_APP";
AppBridgeMessageType["AUTHORIZED_APP_ID"] = "AUTHORIZED_APP_ID";
AppBridgeMessageType["GET_DASHBOARD_LANGUAGE"] = "GET_DASHBOARD_LANGUAGE";
})(AppBridgeMessageType = exports.AppBridgeMessageType || (exports.AppBridgeMessageType = {}));

@@ -106,3 +134,5 @@ var AppBridgeCallbackMessageType;

AppBridgeCallbackMessageType["REQUEST_TOKEN_RESPONSE"] = "REQUEST_TOKEN_RESPONSE";
AppBridgeCallbackMessageType["AUTHORIZED_APP_ID_RESPONSE"] = "AUTHORIZED_APP_ID_RESPONSE";
AppBridgeCallbackMessageType["GET_DASHBOARD_LANGUAGE_RESPONSE"] = "GET_DASHBOARD_LANGUAGE_RESPONSE";
})(AppBridgeCallbackMessageType = exports.AppBridgeCallbackMessageType || (exports.AppBridgeCallbackMessageType = {}));
//# sourceMappingURL=app-bridge.js.map
{
"name": "@ikas/app-helpers",
"version": "1.0.1",
"version": "1.0.2-alpha.0",
"description": "ikas store app helpers",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -99,2 +99,31 @@ export class AppBridgeHelper {

static getDashboardLanguage(): Promise<string | undefined> {
return new Promise((resolve, reject) => {
const timer = setTimeout(() => reject('Timed out'), 30000);
try {
const callback = (msg: MessageEvent) => {
if (msg.data?.type === AppBridgeCallbackMessageType.GET_DASHBOARD_LANGUAGE_RESPONSE) {
const lang = msg.data?.data?.lang;
resolve(lang);
AppBridgeHelper.stopListener(callback);
clearTimeout(timer);
}
};
AppBridgeHelper.startListener(callback);
const event: AppEvent = {
type: AppBridgeMessageType.GET_DASHBOARD_LANGUAGE,
data: {},
};
AppBridgeHelper.sendEvent(event);
} catch (e) {
clearTimeout(timer);
reject(e);
}
});
}
static sendEvent(event: AppEvent) {

@@ -114,2 +143,4 @@ //@ts-ignore

CLOSE_APP = 'CLOSE_APP',
AUTHORIZED_APP_ID = 'AUTHORIZED_APP_ID',
GET_DASHBOARD_LANGUAGE = 'GET_DASHBOARD_LANGUAGE',
}

@@ -119,2 +150,4 @@

REQUEST_TOKEN_RESPONSE = 'REQUEST_TOKEN_RESPONSE',
AUTHORIZED_APP_ID_RESPONSE = 'AUTHORIZED_APP_ID_RESPONSE',
GET_DASHBOARD_LANGUAGE_RESPONSE = 'GET_DASHBOARD_LANGUAGE_RESPONSE',
}

@@ -121,0 +154,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc