@ikas/app-helpers
Advanced tools
Comparing version 1.0.1-alpha.12 to 1.0.1-alpha.13
export declare class AppBridgeHelper { | ||
static startListener(callback: (msg: MessageEvent) => void): void; | ||
static stopListener(callback: (msg: MessageEvent) => void): void; | ||
static requestToken(): void; | ||
static closeLoader(): void; | ||
@@ -24,3 +23,3 @@ static startMerchantPayment(merchantPaymentId: string): void; | ||
export declare enum AppBridgeCallbackMessageType { | ||
REQUEST_TOKEN = "REQUEST_TOKEN" | ||
REQUEST_TOKEN_RESPONSE = "REQUEST_TOKEN_RESPONSE" | ||
} | ||
@@ -27,0 +26,0 @@ export declare type AppEvent = { |
@@ -11,9 +11,2 @@ "use strict"; | ||
} | ||
static requestToken() { | ||
const event = { | ||
type: AppBridgeMessageType.REQUEST_TOKEN, | ||
data: {}, | ||
}; | ||
AppBridgeHelper.sendEvent(event); | ||
} | ||
static closeLoader() { | ||
@@ -73,3 +66,3 @@ const event = { | ||
var _a, _b, _c; | ||
if (((_a = msg.data) === null || _a === void 0 ? void 0 : _a.type) === AppBridgeCallbackMessageType.REQUEST_TOKEN) { | ||
if (((_a = msg.data) === null || _a === void 0 ? void 0 : _a.type) === AppBridgeCallbackMessageType.REQUEST_TOKEN_RESPONSE) { | ||
const token = (_c = (_b = msg.data) === null || _b === void 0 ? void 0 : _b.data) === null || _c === void 0 ? void 0 : _c.token; | ||
@@ -82,3 +75,7 @@ resolve(token); | ||
AppBridgeHelper.startListener(callback); | ||
AppBridgeHelper.requestToken(); | ||
const event = { | ||
type: AppBridgeMessageType.REQUEST_TOKEN, | ||
data: {}, | ||
}; | ||
AppBridgeHelper.sendEvent(event); | ||
} | ||
@@ -109,4 +106,4 @@ catch (e) { | ||
(function (AppBridgeCallbackMessageType) { | ||
AppBridgeCallbackMessageType["REQUEST_TOKEN"] = "REQUEST_TOKEN"; | ||
AppBridgeCallbackMessageType["REQUEST_TOKEN_RESPONSE"] = "REQUEST_TOKEN_RESPONSE"; | ||
})(AppBridgeCallbackMessageType = exports.AppBridgeCallbackMessageType || (exports.AppBridgeCallbackMessageType = {})); | ||
//# sourceMappingURL=app-bridge.js.map |
{ | ||
"name": "@ikas/app-helpers", | ||
"version": "1.0.1-alpha.12", | ||
"version": "1.0.1-alpha.13", | ||
"description": "ikas store app helpers", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -10,11 +10,2 @@ export class AppBridgeHelper { | ||
static requestToken() { | ||
const event: AppEvent = { | ||
type: AppBridgeMessageType.REQUEST_TOKEN, | ||
data: {}, | ||
}; | ||
AppBridgeHelper.sendEvent(event); | ||
} | ||
static closeLoader() { | ||
@@ -85,3 +76,3 @@ const event: AppEvent = { | ||
const callback = (msg: MessageEvent) => { | ||
if (msg.data?.type === AppBridgeCallbackMessageType.REQUEST_TOKEN) { | ||
if (msg.data?.type === AppBridgeCallbackMessageType.REQUEST_TOKEN_RESPONSE) { | ||
const token = msg.data?.data?.token; | ||
@@ -97,3 +88,8 @@ resolve(token); | ||
AppBridgeHelper.requestToken(); | ||
const event: AppEvent = { | ||
type: AppBridgeMessageType.REQUEST_TOKEN, | ||
data: {}, | ||
}; | ||
AppBridgeHelper.sendEvent(event); | ||
} catch (e) { | ||
@@ -123,3 +119,3 @@ clearTimeout(timer); | ||
export enum AppBridgeCallbackMessageType { | ||
REQUEST_TOKEN = 'REQUEST_TOKEN', | ||
REQUEST_TOKEN_RESPONSE = 'REQUEST_TOKEN_RESPONSE', | ||
} | ||
@@ -126,0 +122,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
18113
298