fk-platform-sdk 1.0.47 → 1.1.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/dist/FKPlatform.d.ts +0 -27
- package/dist/FKPlatform.js +0 -53
- package/dist/analytics/Bill.d.ts +0 -31
- package/dist/analytics/Bill.js +0 -103
- package/dist/analytics/Cab.d.ts +0 -26
- package/dist/analytics/Cab.js +0 -66
- package/dist/analytics/EventValidator.d.ts +0 -6
- package/dist/analytics/EventValidator.js +0 -15
- package/dist/analytics/FoodDelivery.d.ts +0 -45
- package/dist/analytics/FoodDelivery.js +0 -131
- package/dist/analytics/FoodDish.d.ts +0 -7
- package/dist/analytics/FoodDish.js +0 -12
- package/dist/analytics/Healthcare.d.ts +0 -131
- package/dist/analytics/Healthcare.js +0 -231
- package/dist/analytics/Nft.d.ts +0 -37
- package/dist/analytics/Nft.js +0 -83
- package/dist/analytics/Person.d.ts +0 -6
- package/dist/analytics/Person.js +0 -11
- package/dist/analytics/Recharge.d.ts +0 -27
- package/dist/analytics/Recharge.js +0 -82
- package/dist/analytics/ShowTicket.d.ts +0 -36
- package/dist/analytics/ShowTicket.js +0 -97
- package/dist/analytics/Travel.d.ts +0 -45
- package/dist/analytics/Travel.js +0 -126
- package/dist/analytics/index.d.ts +0 -9
- package/dist/analytics/index.js +0 -18
- package/dist/analytics/interfaces/AnalyticsEvent.d.ts +0 -5
- package/dist/analytics/interfaces/AnalyticsEvent.js +0 -13
- package/dist/analytics/interfaces/AnalyticsHelper.d.ts +0 -67
- package/dist/analytics/interfaces/AnalyticsHelper.js +0 -2
- package/dist/analytics/interfaces/AnalyticsModule.d.ts +0 -19
- package/dist/analytics/interfaces/AnalyticsModule.js +0 -2
- package/dist/analytics/validation/ValidationMetadata.d.ts +0 -10
- package/dist/analytics/validation/ValidationMetadata.js +0 -2
- package/dist/analytics/validation/ValidationTypes.d.ts +0 -6
- package/dist/analytics/validation/ValidationTypes.js +0 -12
- package/dist/analytics/validation/Validator.d.ts +0 -3
- package/dist/analytics/validation/Validator.js +0 -38
- package/dist/analytics/validation/decorators.d.ts +0 -16
- package/dist/analytics/validation/decorators.js +0 -67
- package/dist/analytics/web/bill-index.d.ts +0 -1
- package/dist/analytics/web/bill-index.js +0 -4
- package/dist/analytics/web/cab-index.d.ts +0 -1
- package/dist/analytics/web/cab-index.js +0 -4
- package/dist/analytics/web/food-delivery-index.d.ts +0 -1
- package/dist/analytics/web/food-delivery-index.js +0 -4
- package/dist/analytics/web/recharge-index.d.ts +0 -1
- package/dist/analytics/web/recharge-index.js +0 -4
- package/dist/analytics/web/ticket-index.d.ts +0 -1
- package/dist/analytics/web/ticket-index.js +0 -4
- package/dist/analytics/web/travel-index.d.ts +0 -1
- package/dist/analytics/web/travel-index.js +0 -4
- package/dist/browser-index.d.ts +0 -1
- package/dist/browser-index.js +0 -8
- package/dist/constants/Errors.d.ts +0 -6
- package/dist/constants/Errors.js +0 -13
- package/dist/errors/FKPlatformError.d.ts +0 -3
- package/dist/errors/FKPlatformError.js +0 -20
- package/dist/errors/NativeModuleError.d.ts +0 -5
- package/dist/errors/NativeModuleError.js +0 -2
- package/dist/index.d.ts +0 -5
- package/dist/index.js +0 -21
- package/dist/interfaces/AuthenticationTokens.d.ts +0 -4
- package/dist/interfaces/AuthenticationTokens.js +0 -2
- package/dist/interfaces/EventManager.d.ts +0 -3
- package/dist/interfaces/EventManager.js +0 -2
- package/dist/interfaces/FKExtension.d.ts +0 -11
- package/dist/interfaces/FKExtension.js +0 -2
- package/dist/interfaces/FKWindow.d.ts +0 -11
- package/dist/interfaces/FKWindow.js +0 -2
- package/dist/interfaces/NativeModuleManagerProvider.d.ts +0 -15
- package/dist/interfaces/NativeModuleManagerProvider.js +0 -2
- package/dist/interfaces/NativeModuleResponse.d.ts +0 -10
- package/dist/interfaces/NativeModuleResponse.js +0 -2
- package/dist/interfaces/modules/AppVersionModule.d.ts +0 -5
- package/dist/interfaces/modules/AppVersionModule.js +0 -2
- package/dist/interfaces/modules/ContactsModule.d.ts +0 -11
- package/dist/interfaces/modules/ContactsModule.js +0 -2
- package/dist/interfaces/modules/DownloaderModule.d.ts +0 -5
- package/dist/interfaces/modules/DownloaderModule.js +0 -2
- package/dist/interfaces/modules/ErrorHandlerModule.d.ts +0 -11
- package/dist/interfaces/modules/ErrorHandlerModule.js +0 -2
- package/dist/interfaces/modules/FontModule.d.ts +0 -5
- package/dist/interfaces/modules/FontModule.js +0 -2
- package/dist/interfaces/modules/GenericUltraShareModule.d.ts +0 -5
- package/dist/interfaces/modules/GenericUltraShareModule.js +0 -2
- package/dist/interfaces/modules/LocationModule.d.ts +0 -8
- package/dist/interfaces/modules/LocationModule.js +0 -2
- package/dist/interfaces/modules/NavigationModule.d.ts +0 -12
- package/dist/interfaces/modules/NavigationModule.js +0 -2
- package/dist/interfaces/modules/PermissionsModule.d.ts +0 -19
- package/dist/interfaces/modules/PermissionsModule.js +0 -8
- package/dist/interfaces/modules/SMSModule.d.ts +0 -5
- package/dist/interfaces/modules/SMSModule.js +0 -2
- package/dist/managers/ModuleManager.d.ts +0 -29
- package/dist/managers/ModuleManager.js +0 -84
- package/dist/managers/NativeModuleCallbackManager.d.ts +0 -12
- package/dist/managers/NativeModuleCallbackManager.js +0 -65
- package/dist/managers/NativeModuleHelper.d.ts +0 -17
- package/dist/managers/NativeModuleHelper.js +0 -65
- package/dist/managers/WindowManager.d.ts +0 -5
- package/dist/managers/WindowManager.js +0 -20
- package/dist/modules/AnalyticsModuleImpl.d.ts +0 -11
- package/dist/modules/AnalyticsModuleImpl.js +0 -74
- package/dist/modules/AppVersionModuleImpl.d.ts +0 -9
- package/dist/modules/AppVersionModuleImpl.js +0 -30
- package/dist/modules/AuthModuleImpl.d.ts +0 -6
- package/dist/modules/AuthModuleImpl.js +0 -27
- package/dist/modules/ContactsModuleImpl.d.ts +0 -11
- package/dist/modules/ContactsModuleImpl.js +0 -40
- package/dist/modules/DownloaderModuleImpl.d.ts +0 -9
- package/dist/modules/DownloaderModuleImpl.js +0 -32
- package/dist/modules/ErrorHandlerModuleImpl.d.ts +0 -8
- package/dist/modules/ErrorHandlerModuleImpl.js +0 -31
- package/dist/modules/FontModuleImpl.d.ts +0 -9
- package/dist/modules/FontModuleImpl.js +0 -32
- package/dist/modules/LocationModuleImpl.d.ts +0 -12
- package/dist/modules/LocationModuleImpl.js +0 -49
- package/dist/modules/NavigationModuleImpl.d.ts +0 -15
- package/dist/modules/NavigationModuleImpl.js +0 -72
- package/dist/modules/PermissionsModuleImpl.d.ts +0 -14
- package/dist/modules/PermissionsModuleImpl.js +0 -51
- package/dist/modules/SMSModuleImpl.d.ts +0 -9
- package/dist/modules/SMSModuleImpl.js +0 -30
- package/dist/modules/ShareModuleImpl.d.ts +0 -9
- package/dist/modules/ShareModuleImpl.js +0 -35
- package/dist/private/tracking-setup-index.d.ts +0 -1
- package/dist/private/tracking-setup-index.js +0 -49
- package/dist/setup/SetupHelper.d.ts +0 -22
- package/dist/setup/SetupHelper.js +0 -283
- package/dist/types/AppVersionManagerResponse.d.ts +0 -3
- package/dist/types/AppVersionManagerResponse.js +0 -2
- package/dist/types/DeviceInfoResponse.d.ts +0 -3
- package/dist/types/DeviceInfoResponse.js +0 -2
- package/dist/types/DownloadManagerResponse.d.ts +0 -3
- package/dist/types/DownloadManagerResponse.js +0 -2
- package/dist/types/FontsManagerResponse.d.ts +0 -3
- package/dist/types/FontsManagerResponse.js +0 -2
- package/dist/types/GenericShareManagerResponse.d.ts +0 -3
- package/dist/types/GenericShareManagerResponse.js +0 -2
- package/dist/types/LocationManagerResponse.d.ts +0 -7
- package/dist/types/LocationManagerResponse.js +0 -2
- package/dist/types/NativeModuleResponseType.d.ts +0 -1
- package/dist/types/NativeModuleResponseType.js +0 -2
- package/dist/types/PermissionsManagerResponse.d.ts +0 -3
- package/dist/types/PermissionsManagerResponse.js +0 -2
- package/dist/types/SMSManagerResponse.d.ts +0 -3
- package/dist/types/SMSManagerResponse.js +0 -2
- package/dist/web/index.d.ts +0 -5
- package/dist/web/index.js +0 -19
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { FKExtension } from "./FKExtension";
|
|
2
|
-
import { NativeModuleManagerProvider } from "./NativeModuleManagerProvider";
|
|
3
|
-
export interface FKWindow extends Window, NativeModuleManagerProvider {
|
|
4
|
-
FKExtension: FKExtension;
|
|
5
|
-
Promise: any;
|
|
6
|
-
nativeModules?: NativeModuleManagerProvider;
|
|
7
|
-
webkit?: WebKit;
|
|
8
|
-
}
|
|
9
|
-
export interface WebKit {
|
|
10
|
-
messageHandlers: NativeModuleManagerProvider;
|
|
11
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { NativeModuleManager } from "../managers/NativeModuleHelper";
|
|
2
|
-
export interface NativeModuleManagerProvider {
|
|
3
|
-
PermissionsModule: NativeModuleManager;
|
|
4
|
-
NavigationModule: NativeModuleManager;
|
|
5
|
-
AuthModule: NativeModuleManager;
|
|
6
|
-
ContactsModule: NativeModuleManager;
|
|
7
|
-
AnalyticsModule: NativeModuleManager;
|
|
8
|
-
SMSModule: NativeModuleManager;
|
|
9
|
-
LocationModule: NativeModuleManager;
|
|
10
|
-
AppVersionModule: NativeModuleManager;
|
|
11
|
-
DownloaderModule: NativeModuleManager;
|
|
12
|
-
FontModule: NativeModuleManager;
|
|
13
|
-
GenericUltraShareModule: NativeModuleManager;
|
|
14
|
-
ErrorHandlerModule: NativeModuleManager;
|
|
15
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { NativeModuleResponseType } from "../types/NativeModuleResponseType";
|
|
2
|
-
export interface NativeModuleResponseInternal {
|
|
3
|
-
requestId: string;
|
|
4
|
-
result: NativeModuleResponseType;
|
|
5
|
-
grantToken?: string | null;
|
|
6
|
-
}
|
|
7
|
-
export interface NativeModuleResponse<T> {
|
|
8
|
-
result: T;
|
|
9
|
-
grantToken?: string | null;
|
|
10
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { NativeModuleResponse } from "../NativeModuleResponse";
|
|
2
|
-
export interface Contact {
|
|
3
|
-
name: string;
|
|
4
|
-
phoneNumber: string;
|
|
5
|
-
}
|
|
6
|
-
export interface ContactsModule {
|
|
7
|
-
pickPhoneNumber: () => Promise<NativeModuleResponse<Contact>>;
|
|
8
|
-
getContactInfo: (phoneNumbers: string[]) => Promise<NativeModuleResponse<{
|
|
9
|
-
[key: string]: Contact;
|
|
10
|
-
}>>;
|
|
11
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { NativeModuleResponse } from "../NativeModuleResponse";
|
|
2
|
-
import { DownloadManagerResponse } from "../../types/DownloadManagerResponse";
|
|
3
|
-
export interface DownloaderModule {
|
|
4
|
-
fileDownload: (url: string, mimeType: string) => Promise<NativeModuleResponse<DownloadManagerResponse>>;
|
|
5
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export interface ErrorInfoRequest {
|
|
2
|
-
errorTitle: string;
|
|
3
|
-
errorDescription: string;
|
|
4
|
-
errorMessage: string;
|
|
5
|
-
pageUrl: string;
|
|
6
|
-
callbackMethod?: string;
|
|
7
|
-
ctaText?: string;
|
|
8
|
-
}
|
|
9
|
-
export interface ErrorHandlerModule {
|
|
10
|
-
openErrorHandlingFlow: (errorInfo: ErrorInfoRequest) => void;
|
|
11
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { NativeModuleResponse } from "../NativeModuleResponse";
|
|
2
|
-
import { FontsManagerResponse } from "../../types/FontsManagerResponse";
|
|
3
|
-
export interface FontModule {
|
|
4
|
-
downloadFont: (fontFamily: string, url: string) => Promise<NativeModuleResponse<FontsManagerResponse>>;
|
|
5
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { NativeModuleResponse } from "../NativeModuleResponse";
|
|
2
|
-
import { GenericShareManagerResponse } from "../../types/GenericShareManagerResponse";
|
|
3
|
-
export interface GenericUltraShareModule {
|
|
4
|
-
share: (title: string, text: string, url: string, fileContentUri: string) => Promise<NativeModuleResponse<GenericShareManagerResponse>>;
|
|
5
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { DeviceInfoResponse } from "../../types/DeviceInfoResponse";
|
|
2
|
-
import { LocationManagerResponse, PreciseLocationResponse } from "../../types/LocationManagerResponse";
|
|
3
|
-
import { NativeModuleResponse } from "../NativeModuleResponse";
|
|
4
|
-
export interface LocationModule {
|
|
5
|
-
getUserPinCode: (clientID: string) => Promise<NativeModuleResponse<LocationManagerResponse>>;
|
|
6
|
-
getUserDeviceId: () => Promise<NativeModuleResponse<DeviceInfoResponse>>;
|
|
7
|
-
getUserLocation: () => Promise<NativeModuleResponse<PreciseLocationResponse>>;
|
|
8
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export interface NavigationModule {
|
|
2
|
-
exitSession: () => void;
|
|
3
|
-
exitToHomePage: () => void;
|
|
4
|
-
startPayment: (paymentToken: string) => void;
|
|
5
|
-
startPaymentByUrl: (paymentUrl: string, postPaymentUrl: string) => void;
|
|
6
|
-
notifyPageLocationChange: (currentUri: string, isBackNavigation: boolean) => void;
|
|
7
|
-
navigateToFlipkart: (uri: string) => void;
|
|
8
|
-
hideSplash: () => void;
|
|
9
|
-
overrideBackPressAndExitUltra: () => void;
|
|
10
|
-
clearHistory?: () => void;
|
|
11
|
-
openReactNativePage?: (bundleName: string, screenName: string, params: string) => void;
|
|
12
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { PermissionsManagerResponse } from "../../types/PermissionsManagerResponse";
|
|
2
|
-
import { NativeModuleResponse } from "../NativeModuleResponse";
|
|
3
|
-
export declare enum Scope {
|
|
4
|
-
USER_NAME = "user.name",
|
|
5
|
-
USER_EMAIL = "user.email",
|
|
6
|
-
USER_MOBILE = "user.mobile"
|
|
7
|
-
}
|
|
8
|
-
export interface ScopeAccessRequest {
|
|
9
|
-
scope: Scope;
|
|
10
|
-
isMandatory?: boolean;
|
|
11
|
-
shouldVerify?: boolean;
|
|
12
|
-
}
|
|
13
|
-
export interface PermissionsModule {
|
|
14
|
-
getToken: (scopeRequests: ScopeAccessRequest[]) => Promise<NativeModuleResponse<PermissionsManagerResponse>>;
|
|
15
|
-
getScopes: () => {
|
|
16
|
-
[key: string]: Scope;
|
|
17
|
-
};
|
|
18
|
-
getUltraPlusToken: () => Promise<NativeModuleResponse<PermissionsManagerResponse>>;
|
|
19
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var Scope;
|
|
4
|
-
(function (Scope) {
|
|
5
|
-
Scope["USER_NAME"] = "user.name";
|
|
6
|
-
Scope["USER_EMAIL"] = "user.email";
|
|
7
|
-
Scope["USER_MOBILE"] = "user.mobile";
|
|
8
|
-
})(Scope = exports.Scope || (exports.Scope = {}));
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { NavigationModule } from "../interfaces/modules/NavigationModule";
|
|
2
|
-
import { PermissionsModule } from "../interfaces/modules/PermissionsModule";
|
|
3
|
-
import { ContactsModule } from "../interfaces/modules/ContactsModule";
|
|
4
|
-
import { NativeModuleCallbackManager } from "./NativeModuleCallbackManager";
|
|
5
|
-
import { AnalyticsModule } from "../analytics/interfaces/AnalyticsModule";
|
|
6
|
-
import { SMSModule } from "../interfaces/modules/SMSModule";
|
|
7
|
-
import { LocationModule } from "../interfaces/modules/LocationModule";
|
|
8
|
-
import { AppVersionModule } from "../interfaces/modules/AppVersionModule";
|
|
9
|
-
import { DownloaderModule } from "../interfaces/modules/DownloaderModule";
|
|
10
|
-
import { FontModule } from "../interfaces/modules/FontModule";
|
|
11
|
-
import { GenericUltraShareModule } from "../interfaces/modules/GenericUltraShareModule";
|
|
12
|
-
import { ErrorHandlerModule } from "../interfaces/modules/ErrorHandlerModule";
|
|
13
|
-
export declare class ModuleManager {
|
|
14
|
-
private moduleMap;
|
|
15
|
-
constructor(nativeModuleCallbackManager: NativeModuleCallbackManager);
|
|
16
|
-
getNavigationModule(): NavigationModule;
|
|
17
|
-
getPermissionsModule(): PermissionsModule;
|
|
18
|
-
getContactsModule(): ContactsModule;
|
|
19
|
-
getAnalyticsModule(): AnalyticsModule;
|
|
20
|
-
getSMSModule(): SMSModule;
|
|
21
|
-
getLocationModule(): LocationModule;
|
|
22
|
-
getAppVersionModule(): AppVersionModule;
|
|
23
|
-
getDownloaderModule(): DownloaderModule;
|
|
24
|
-
getFontModule(): FontModule;
|
|
25
|
-
getShareModule(): GenericUltraShareModule;
|
|
26
|
-
getErrorHandlerModule(): ErrorHandlerModule;
|
|
27
|
-
private addModule;
|
|
28
|
-
private getModule;
|
|
29
|
-
}
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var NavigationModuleImpl_1 = require("../modules/NavigationModuleImpl");
|
|
4
|
-
var PermissionsModuleImpl_1 = require("../modules/PermissionsModuleImpl");
|
|
5
|
-
var ContactsModuleImpl_1 = require("../modules/ContactsModuleImpl");
|
|
6
|
-
var AnalyticsModuleImpl_1 = require("../modules/AnalyticsModuleImpl");
|
|
7
|
-
var SMSModuleImpl_1 = require("../modules/SMSModuleImpl");
|
|
8
|
-
var LocationModuleImpl_1 = require("../modules/LocationModuleImpl");
|
|
9
|
-
var AppVersionModuleImpl_1 = require("../modules/AppVersionModuleImpl");
|
|
10
|
-
var DownloaderModuleImpl_1 = require("../modules/DownloaderModuleImpl");
|
|
11
|
-
var FontModuleImpl_1 = require("../modules/FontModuleImpl");
|
|
12
|
-
var ShareModuleImpl_1 = require("../modules/ShareModuleImpl");
|
|
13
|
-
var ErrorHandlerModuleImpl_1 = require("../modules/ErrorHandlerModuleImpl");
|
|
14
|
-
var MODULE_NAME;
|
|
15
|
-
(function (MODULE_NAME) {
|
|
16
|
-
MODULE_NAME[MODULE_NAME["PERMISSION_MODULE"] = 0] = "PERMISSION_MODULE";
|
|
17
|
-
MODULE_NAME[MODULE_NAME["NAVIGATION_MODULE"] = 1] = "NAVIGATION_MODULE";
|
|
18
|
-
MODULE_NAME[MODULE_NAME["CONTACTS_MODULE"] = 2] = "CONTACTS_MODULE";
|
|
19
|
-
MODULE_NAME[MODULE_NAME["ANALYTICS_MODULE"] = 3] = "ANALYTICS_MODULE";
|
|
20
|
-
MODULE_NAME[MODULE_NAME["SMS_MODULE"] = 4] = "SMS_MODULE";
|
|
21
|
-
MODULE_NAME[MODULE_NAME["LOCATION_MODULE"] = 5] = "LOCATION_MODULE";
|
|
22
|
-
MODULE_NAME[MODULE_NAME["APP_VERSION_MODULE"] = 6] = "APP_VERSION_MODULE";
|
|
23
|
-
MODULE_NAME[MODULE_NAME["DOWNLOADER_MODULE"] = 7] = "DOWNLOADER_MODULE";
|
|
24
|
-
MODULE_NAME[MODULE_NAME["FONT_MODULE"] = 8] = "FONT_MODULE";
|
|
25
|
-
MODULE_NAME[MODULE_NAME["SHARE_MODULE"] = 9] = "SHARE_MODULE";
|
|
26
|
-
MODULE_NAME[MODULE_NAME["ERROR_HANDLER_MODULE"] = 10] = "ERROR_HANDLER_MODULE";
|
|
27
|
-
})(MODULE_NAME || (MODULE_NAME = {}));
|
|
28
|
-
var ModuleManager = /** @class */ (function () {
|
|
29
|
-
function ModuleManager(nativeModuleCallbackManager) {
|
|
30
|
-
this.moduleMap = {};
|
|
31
|
-
this.addModule(MODULE_NAME.PERMISSION_MODULE, new PermissionsModuleImpl_1.PermissionsModuleImpl(nativeModuleCallbackManager));
|
|
32
|
-
this.addModule(MODULE_NAME.NAVIGATION_MODULE, new NavigationModuleImpl_1.NavigationModuleImpl(nativeModuleCallbackManager));
|
|
33
|
-
this.addModule(MODULE_NAME.CONTACTS_MODULE, new ContactsModuleImpl_1.ContactsModuleImpl(nativeModuleCallbackManager));
|
|
34
|
-
this.addModule(MODULE_NAME.ANALYTICS_MODULE, new AnalyticsModuleImpl_1.AnalyticsModuleImpl(nativeModuleCallbackManager));
|
|
35
|
-
this.addModule(MODULE_NAME.SMS_MODULE, new SMSModuleImpl_1.SMSModuleImpl(nativeModuleCallbackManager));
|
|
36
|
-
this.addModule(MODULE_NAME.LOCATION_MODULE, new LocationModuleImpl_1.LocationModuleImpl(nativeModuleCallbackManager));
|
|
37
|
-
this.addModule(MODULE_NAME.APP_VERSION_MODULE, new AppVersionModuleImpl_1.AppVersionModuleImpl(nativeModuleCallbackManager));
|
|
38
|
-
this.addModule(MODULE_NAME.DOWNLOADER_MODULE, new DownloaderModuleImpl_1.DownloaderModuleImpl(nativeModuleCallbackManager));
|
|
39
|
-
this.addModule(MODULE_NAME.FONT_MODULE, new FontModuleImpl_1.FontModuleImpl(nativeModuleCallbackManager));
|
|
40
|
-
this.addModule(MODULE_NAME.SHARE_MODULE, new ShareModuleImpl_1.ShareModuleImpl(nativeModuleCallbackManager));
|
|
41
|
-
this.addModule(MODULE_NAME.ERROR_HANDLER_MODULE, new ErrorHandlerModuleImpl_1.ErrorHandlerModuleImpl(nativeModuleCallbackManager));
|
|
42
|
-
}
|
|
43
|
-
ModuleManager.prototype.getNavigationModule = function () {
|
|
44
|
-
return this.getModule(MODULE_NAME.NAVIGATION_MODULE);
|
|
45
|
-
};
|
|
46
|
-
ModuleManager.prototype.getPermissionsModule = function () {
|
|
47
|
-
return this.getModule(MODULE_NAME.PERMISSION_MODULE);
|
|
48
|
-
};
|
|
49
|
-
ModuleManager.prototype.getContactsModule = function () {
|
|
50
|
-
return this.getModule(MODULE_NAME.CONTACTS_MODULE);
|
|
51
|
-
};
|
|
52
|
-
ModuleManager.prototype.getAnalyticsModule = function () {
|
|
53
|
-
return this.getModule(MODULE_NAME.ANALYTICS_MODULE);
|
|
54
|
-
};
|
|
55
|
-
ModuleManager.prototype.getSMSModule = function () {
|
|
56
|
-
return this.getModule(MODULE_NAME.SMS_MODULE);
|
|
57
|
-
};
|
|
58
|
-
ModuleManager.prototype.getLocationModule = function () {
|
|
59
|
-
return this.getModule(MODULE_NAME.LOCATION_MODULE);
|
|
60
|
-
};
|
|
61
|
-
ModuleManager.prototype.getAppVersionModule = function () {
|
|
62
|
-
return this.getModule(MODULE_NAME.APP_VERSION_MODULE);
|
|
63
|
-
};
|
|
64
|
-
ModuleManager.prototype.getDownloaderModule = function () {
|
|
65
|
-
return this.getModule(MODULE_NAME.DOWNLOADER_MODULE);
|
|
66
|
-
};
|
|
67
|
-
ModuleManager.prototype.getFontModule = function () {
|
|
68
|
-
return this.getModule(MODULE_NAME.FONT_MODULE);
|
|
69
|
-
};
|
|
70
|
-
ModuleManager.prototype.getShareModule = function () {
|
|
71
|
-
return this.getModule(MODULE_NAME.SHARE_MODULE);
|
|
72
|
-
};
|
|
73
|
-
ModuleManager.prototype.getErrorHandlerModule = function () {
|
|
74
|
-
return this.getModule(MODULE_NAME.ERROR_HANDLER_MODULE);
|
|
75
|
-
};
|
|
76
|
-
ModuleManager.prototype.addModule = function (moduleName, nativeModule) {
|
|
77
|
-
this.moduleMap[moduleName] = nativeModule;
|
|
78
|
-
};
|
|
79
|
-
ModuleManager.prototype.getModule = function (moduleName) {
|
|
80
|
-
return this.moduleMap[moduleName];
|
|
81
|
-
};
|
|
82
|
-
return ModuleManager;
|
|
83
|
-
}());
|
|
84
|
-
exports.ModuleManager = ModuleManager;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { NativeModuleResponse } from "../interfaces/NativeModuleResponse";
|
|
2
|
-
export declare class NativeModuleCallbackManager {
|
|
3
|
-
private static callbackId;
|
|
4
|
-
private callbackQueue;
|
|
5
|
-
constructor();
|
|
6
|
-
executeOnBridge<T>(moduleInvoker: (requestId: string) => void): Promise<NativeModuleResponse<T>>;
|
|
7
|
-
private checkInit;
|
|
8
|
-
private getNewCallbackId;
|
|
9
|
-
private queueCallbackIfRequired;
|
|
10
|
-
private nativeModuleResolve;
|
|
11
|
-
private nativeModuleReject;
|
|
12
|
-
}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var WindowManager_1 = require("./WindowManager");
|
|
4
|
-
var tcs_instanceqm_1 = require("tcs-instanceqm");
|
|
5
|
-
var NativeModuleCallbackManager = /** @class */ (function () {
|
|
6
|
-
function NativeModuleCallbackManager() {
|
|
7
|
-
var _this = this;
|
|
8
|
-
this.nativeModuleResolve = function (response) {
|
|
9
|
-
var queuedTask = _this.callbackQueue[response.requestId];
|
|
10
|
-
if (queuedTask) {
|
|
11
|
-
delete _this.callbackQueue[response.requestId];
|
|
12
|
-
queuedTask.trySetResult(response);
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
this.nativeModuleReject = function (error) {
|
|
16
|
-
var queuedTask = _this.callbackQueue[error.requestId];
|
|
17
|
-
if (queuedTask) {
|
|
18
|
-
delete _this.callbackQueue[error.requestId];
|
|
19
|
-
if (!error.code) {
|
|
20
|
-
error.code = 0;
|
|
21
|
-
}
|
|
22
|
-
queuedTask.trySetError(error);
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
this.checkInit();
|
|
26
|
-
this.callbackQueue = {};
|
|
27
|
-
}
|
|
28
|
-
NativeModuleCallbackManager.prototype.executeOnBridge = function (moduleInvoker) {
|
|
29
|
-
try {
|
|
30
|
-
var tcs_1 = new tcs_instanceqm_1.TaskCompletionSource();
|
|
31
|
-
var newRequestId = this.getNewCallbackId();
|
|
32
|
-
this.queueCallbackIfRequired(newRequestId, tcs_1);
|
|
33
|
-
moduleInvoker(newRequestId);
|
|
34
|
-
return new Promise(function (resolve, reject) {
|
|
35
|
-
tcs_1.getResultAsync().then(function (response) {
|
|
36
|
-
resolve({
|
|
37
|
-
grantToken: response.grantToken,
|
|
38
|
-
result: response.result,
|
|
39
|
-
});
|
|
40
|
-
}).catch(function (error) {
|
|
41
|
-
reject(error);
|
|
42
|
-
});
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
catch (error) {
|
|
46
|
-
return Promise.reject(error);
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
NativeModuleCallbackManager.prototype.checkInit = function () {
|
|
50
|
-
var windowObj = WindowManager_1.WindowManager.getWindow();
|
|
51
|
-
if (windowObj && windowObj.FKExtension) {
|
|
52
|
-
windowObj.FKExtension.nativeModuleResolve = this.nativeModuleResolve;
|
|
53
|
-
windowObj.FKExtension.nativeModuleReject = this.nativeModuleReject;
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
NativeModuleCallbackManager.prototype.getNewCallbackId = function () {
|
|
57
|
-
return NativeModuleCallbackManager.callbackId++ + "";
|
|
58
|
-
};
|
|
59
|
-
NativeModuleCallbackManager.prototype.queueCallbackIfRequired = function (requestId, task) {
|
|
60
|
-
this.callbackQueue[requestId] = task;
|
|
61
|
-
};
|
|
62
|
-
NativeModuleCallbackManager.callbackId = 1;
|
|
63
|
-
return NativeModuleCallbackManager;
|
|
64
|
-
}());
|
|
65
|
-
exports.NativeModuleCallbackManager = NativeModuleCallbackManager;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { NativeModuleManagerProvider } from "../interfaces/NativeModuleManagerProvider";
|
|
2
|
-
import { NativeModuleCallbackManager } from "./NativeModuleCallbackManager";
|
|
3
|
-
export declare class NativeModuleHelper {
|
|
4
|
-
static getCurrentNativeModuleProvider(): NativeModuleManagerProvider;
|
|
5
|
-
}
|
|
6
|
-
export interface NativeModuleManager {
|
|
7
|
-
postMessage: (args: any[]) => void;
|
|
8
|
-
[key: string]: any;
|
|
9
|
-
}
|
|
10
|
-
export declare class NativeModule<T extends NativeModuleManager> {
|
|
11
|
-
protected nativeModuleManager: T;
|
|
12
|
-
protected nativeModuleCallbackManager: NativeModuleCallbackManager;
|
|
13
|
-
constructor(nativeModuleManager: T, nativeModuleCallbackManager: NativeModuleCallbackManager);
|
|
14
|
-
protected postMessage(dict: {
|
|
15
|
-
[key: string]: any;
|
|
16
|
-
}): void;
|
|
17
|
-
}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var WindowManager_1 = require("./WindowManager");
|
|
4
|
-
var Errors_1 = require("../constants/Errors");
|
|
5
|
-
var FKPlatformError_1 = require("../errors/FKPlatformError");
|
|
6
|
-
var NativeModuleHelper = /** @class */ (function () {
|
|
7
|
-
function NativeModuleHelper() {
|
|
8
|
-
}
|
|
9
|
-
NativeModuleHelper.getCurrentNativeModuleProvider = function () {
|
|
10
|
-
var windowObj = WindowManager_1.WindowManager.getWindow();
|
|
11
|
-
if (windowObj) {
|
|
12
|
-
if (windowObj.nativeModules) {
|
|
13
|
-
return windowObj.nativeModules;
|
|
14
|
-
}
|
|
15
|
-
if (windowObj.webkit) {
|
|
16
|
-
return windowObj.webkit.messageHandlers;
|
|
17
|
-
}
|
|
18
|
-
return windowObj;
|
|
19
|
-
}
|
|
20
|
-
throw new FKPlatformError_1.FKPlatformError(Errors_1.Errors.NATIVE_MODULES_MISSING);
|
|
21
|
-
};
|
|
22
|
-
return NativeModuleHelper;
|
|
23
|
-
}());
|
|
24
|
-
exports.NativeModuleHelper = NativeModuleHelper;
|
|
25
|
-
var NativeModule = /** @class */ (function () {
|
|
26
|
-
function NativeModule(nativeModuleManager, nativeModuleCallbackManager) {
|
|
27
|
-
this.nativeModuleManager = nativeModuleManager;
|
|
28
|
-
this.nativeModuleCallbackManager = nativeModuleCallbackManager;
|
|
29
|
-
}
|
|
30
|
-
NativeModule.prototype.postMessage = function (dict) {
|
|
31
|
-
var _a;
|
|
32
|
-
var methodName = dict.methodName;
|
|
33
|
-
var args = Object.keys(dict).map(function (key) { return dict[key]; });
|
|
34
|
-
/** All the bridge method calls for modules flows via this method */
|
|
35
|
-
/**
|
|
36
|
-
* We first check if the method name exists on the native end. This is done to maintain
|
|
37
|
-
* backward compatibility.
|
|
38
|
-
*
|
|
39
|
-
* If the method exists, invoke that method via the bridge.
|
|
40
|
-
*
|
|
41
|
-
* The new implementation will be as follows:
|
|
42
|
-
* 1. In iOS postMessage will be triggered with dictionary as argument. The first key in dictionary will
|
|
43
|
-
* contain the method name. Using this method name, appropriate methods will be called in native.
|
|
44
|
-
* 2. In Android, the same implementation will continue. You need to expose the exact method annotated with
|
|
45
|
-
* JS Annotation.
|
|
46
|
-
*
|
|
47
|
-
*/
|
|
48
|
-
// check if this method name exists in native. This is done for backward compatibility.
|
|
49
|
-
if (this.nativeModuleManager[methodName]) {
|
|
50
|
-
// shift is used to remove the first element from the array, ie the method name since we are calling the exact method.
|
|
51
|
-
args.shift();
|
|
52
|
-
(_a = this.nativeModuleManager)[methodName].apply(_a, args);
|
|
53
|
-
}
|
|
54
|
-
// tslint:disable-next-line:no-string-literal
|
|
55
|
-
if (this.nativeModuleManager["postMessage"]) {
|
|
56
|
-
// if the native module does not exist, fire the postMessage
|
|
57
|
-
// we also pass the first parameter as the method name so that the client can figure out what
|
|
58
|
-
// method they will have to invoke
|
|
59
|
-
this.nativeModuleManager.postMessage(args);
|
|
60
|
-
}
|
|
61
|
-
return;
|
|
62
|
-
};
|
|
63
|
-
return NativeModule;
|
|
64
|
-
}());
|
|
65
|
-
exports.NativeModule = NativeModule;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var WindowManager = /** @class */ (function () {
|
|
4
|
-
function WindowManager() {
|
|
5
|
-
}
|
|
6
|
-
//Can return null e.g, when called in case runtime is React Native
|
|
7
|
-
WindowManager.getWindow = function () {
|
|
8
|
-
if (window) {
|
|
9
|
-
return window;
|
|
10
|
-
}
|
|
11
|
-
else {
|
|
12
|
-
return global;
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
WindowManager.isBrowser = function () {
|
|
16
|
-
return navigator.product !== "ReactNative";
|
|
17
|
-
};
|
|
18
|
-
return WindowManager;
|
|
19
|
-
}());
|
|
20
|
-
exports.WindowManager = WindowManager;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { NativeModule, NativeModuleManager } from "../managers/NativeModuleHelper";
|
|
2
|
-
import { NativeModuleCallbackManager } from "../managers/NativeModuleCallbackManager";
|
|
3
|
-
import { AnalyticsEvent } from "../analytics/interfaces/AnalyticsEvent";
|
|
4
|
-
import { AnalyticsModule, EventInfo, ErrorInfo } from "../analytics/interfaces/AnalyticsModule";
|
|
5
|
-
export declare class AnalyticsModuleImpl extends NativeModule<NativeModuleManager> implements AnalyticsModule {
|
|
6
|
-
constructor(nativeModuleCallbackManager: NativeModuleCallbackManager);
|
|
7
|
-
pushEvent(event: AnalyticsEvent): void;
|
|
8
|
-
forceFlushEvents(): void;
|
|
9
|
-
logPerformanceMetrics(eventInfo: EventInfo): void;
|
|
10
|
-
logPageError(errorInfo: ErrorInfo): void;
|
|
11
|
-
}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = Object.setPrototypeOf ||
|
|
4
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
-
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
6
|
-
return function (d, b) {
|
|
7
|
-
extendStatics(d, b);
|
|
8
|
-
function __() { this.constructor = d; }
|
|
9
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
10
|
-
};
|
|
11
|
-
})();
|
|
12
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
var NativeModuleHelper_1 = require("../managers/NativeModuleHelper");
|
|
14
|
-
var AnalyticsModuleImpl = /** @class */ (function (_super) {
|
|
15
|
-
__extends(AnalyticsModuleImpl, _super);
|
|
16
|
-
function AnalyticsModuleImpl(nativeModuleCallbackManager) {
|
|
17
|
-
return _super.call(this, NativeModuleHelper_1.NativeModuleHelper.getCurrentNativeModuleProvider().AnalyticsModule, nativeModuleCallbackManager) || this;
|
|
18
|
-
}
|
|
19
|
-
AnalyticsModuleImpl.prototype.pushEvent = function (event) {
|
|
20
|
-
var _this = this;
|
|
21
|
-
this.nativeModuleCallbackManager.executeOnBridge(function (requestId) {
|
|
22
|
-
var type = event.type;
|
|
23
|
-
delete event.type;
|
|
24
|
-
var eventValidator = event.getValidator();
|
|
25
|
-
if (eventValidator.isValid()) {
|
|
26
|
-
_this.postMessage({
|
|
27
|
-
methodName: "pushEvent",
|
|
28
|
-
requestId: requestId,
|
|
29
|
-
type: type,
|
|
30
|
-
event: JSON.stringify(event),
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
else {
|
|
34
|
-
_this.postMessage({
|
|
35
|
-
methodName: "onEventValidationError",
|
|
36
|
-
requestId: requestId,
|
|
37
|
-
type: type,
|
|
38
|
-
error: eventValidator.getErrorMessage(),
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
};
|
|
43
|
-
AnalyticsModuleImpl.prototype.forceFlushEvents = function () {
|
|
44
|
-
var _this = this;
|
|
45
|
-
this.nativeModuleCallbackManager.executeOnBridge(function (requestId) {
|
|
46
|
-
_this.postMessage({
|
|
47
|
-
methodName: "forceFlushEvents",
|
|
48
|
-
requestId: requestId
|
|
49
|
-
});
|
|
50
|
-
});
|
|
51
|
-
};
|
|
52
|
-
AnalyticsModuleImpl.prototype.logPerformanceMetrics = function (eventInfo) {
|
|
53
|
-
var _this = this;
|
|
54
|
-
this.nativeModuleCallbackManager.executeOnBridge(function (requestId) {
|
|
55
|
-
_this.postMessage({
|
|
56
|
-
methodName: "logPerformanceMetrics",
|
|
57
|
-
requestId: requestId,
|
|
58
|
-
eventInfo: JSON.stringify(eventInfo)
|
|
59
|
-
});
|
|
60
|
-
});
|
|
61
|
-
};
|
|
62
|
-
AnalyticsModuleImpl.prototype.logPageError = function (errorInfo) {
|
|
63
|
-
var _this = this;
|
|
64
|
-
this.nativeModuleCallbackManager.executeOnBridge(function (requestId) {
|
|
65
|
-
_this.postMessage({
|
|
66
|
-
methodName: "logPageError",
|
|
67
|
-
requestId: requestId,
|
|
68
|
-
errorInfo: JSON.stringify(errorInfo)
|
|
69
|
-
});
|
|
70
|
-
});
|
|
71
|
-
};
|
|
72
|
-
return AnalyticsModuleImpl;
|
|
73
|
-
}(NativeModuleHelper_1.NativeModule));
|
|
74
|
-
exports.AnalyticsModuleImpl = AnalyticsModuleImpl;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { NativeModuleResponse } from "../interfaces/NativeModuleResponse";
|
|
2
|
-
import { NativeModule, NativeModuleManager } from "../managers/NativeModuleHelper";
|
|
3
|
-
import { NativeModuleCallbackManager } from "../managers/NativeModuleCallbackManager";
|
|
4
|
-
import { AppVersionModule } from "../interfaces/modules/AppVersionModule";
|
|
5
|
-
import { AppVersionManagerResponse } from "../types/AppVersionManagerResponse";
|
|
6
|
-
export declare class AppVersionModuleImpl extends NativeModule<NativeModuleManager> implements AppVersionModule {
|
|
7
|
-
constructor(nativeModuleCallbackManager: NativeModuleCallbackManager);
|
|
8
|
-
getApkVersion(): Promise<NativeModuleResponse<AppVersionManagerResponse>>;
|
|
9
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = Object.setPrototypeOf ||
|
|
4
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
-
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
6
|
-
return function (d, b) {
|
|
7
|
-
extendStatics(d, b);
|
|
8
|
-
function __() { this.constructor = d; }
|
|
9
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
10
|
-
};
|
|
11
|
-
})();
|
|
12
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
var NativeModuleHelper_1 = require("../managers/NativeModuleHelper");
|
|
14
|
-
var AppVersionModuleImpl = /** @class */ (function (_super) {
|
|
15
|
-
__extends(AppVersionModuleImpl, _super);
|
|
16
|
-
function AppVersionModuleImpl(nativeModuleCallbackManager) {
|
|
17
|
-
return _super.call(this, NativeModuleHelper_1.NativeModuleHelper.getCurrentNativeModuleProvider().AppVersionModule, nativeModuleCallbackManager) || this;
|
|
18
|
-
}
|
|
19
|
-
AppVersionModuleImpl.prototype.getApkVersion = function () {
|
|
20
|
-
var _this = this;
|
|
21
|
-
return this.nativeModuleCallbackManager.executeOnBridge(function (requestId) {
|
|
22
|
-
_this.postMessage({
|
|
23
|
-
methodName: "getApkVersion",
|
|
24
|
-
requestId: requestId
|
|
25
|
-
});
|
|
26
|
-
});
|
|
27
|
-
};
|
|
28
|
-
return AppVersionModuleImpl;
|
|
29
|
-
}(NativeModuleHelper_1.NativeModule));
|
|
30
|
-
exports.AppVersionModuleImpl = AppVersionModuleImpl;
|