fk-platform-sdk 1.0.2 → 1.0.3-7.beta4
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/.vscode/settings.json +3 -0
- package/analytics/index.js +1 -0
- package/dist/FKPlatform.js +1 -2
- package/dist/analytics/Bill.d.ts +31 -0
- package/dist/analytics/Bill.js +103 -0
- package/dist/analytics/Cab.d.ts +26 -0
- package/dist/analytics/Cab.js +66 -0
- package/dist/analytics/EventValidator.d.ts +6 -0
- package/dist/analytics/EventValidator.js +15 -0
- package/dist/analytics/FoodDelivery.d.ts +45 -0
- package/dist/analytics/FoodDelivery.js +131 -0
- package/dist/analytics/FoodDish.d.ts +7 -0
- package/dist/analytics/FoodDish.js +12 -0
- package/dist/analytics/Healthcare.d.ts +131 -0
- package/dist/analytics/Healthcare.js +231 -0
- package/dist/analytics/Person.d.ts +6 -0
- package/dist/analytics/Person.js +11 -0
- package/dist/analytics/Recharge.d.ts +27 -0
- package/dist/analytics/Recharge.js +82 -0
- package/dist/analytics/ShowTicket.d.ts +36 -0
- package/dist/analytics/ShowTicket.js +97 -0
- package/dist/analytics/Travel.d.ts +45 -0
- package/dist/analytics/Travel.js +126 -0
- package/dist/analytics/index.d.ts +8 -0
- package/dist/analytics/index.js +16 -0
- package/dist/analytics/interfaces/AnalyticsEvent.d.ts +5 -0
- package/dist/analytics/interfaces/AnalyticsEvent.js +13 -0
- package/dist/analytics/interfaces/AnalyticsHelper.d.ts +61 -0
- package/dist/analytics/interfaces/AnalyticsModule.d.ts +5 -0
- package/dist/analytics/validation/ValidationMetadata.d.ts +10 -0
- package/dist/analytics/validation/ValidationTypes.d.ts +6 -0
- package/dist/analytics/validation/ValidationTypes.js +12 -0
- package/dist/analytics/validation/Validator.d.ts +3 -0
- package/dist/analytics/validation/Validator.js +38 -0
- package/dist/analytics/validation/decorators.d.ts +16 -0
- package/dist/analytics/validation/decorators.js +67 -0
- package/dist/analytics/web/bill-index.d.ts +1 -0
- package/dist/analytics/web/bill-index.js +4 -0
- package/dist/analytics/web/cab-index.d.ts +1 -0
- package/dist/analytics/web/cab-index.js +4 -0
- package/dist/analytics/web/food-delivery-index.d.ts +1 -0
- package/dist/analytics/web/food-delivery-index.js +4 -0
- package/dist/analytics/web/recharge-index.d.ts +1 -0
- package/dist/analytics/web/recharge-index.js +4 -0
- package/dist/analytics/web/ticket-index.d.ts +1 -0
- package/dist/analytics/web/ticket-index.js +4 -0
- package/dist/analytics/web/travel-index.d.ts +1 -0
- package/dist/analytics/web/travel-index.js +4 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/interfaces/FKExtension.d.ts +2 -0
- package/dist/interfaces/FKWindow.d.ts +4 -0
- package/dist/interfaces/NativeModuleManagerProvider.d.ts +12 -8
- package/dist/interfaces/modules/AppVersionModule.d.ts +5 -0
- package/dist/interfaces/{ContactsModule.d.ts → modules/ContactsModule.d.ts} +5 -2
- package/dist/interfaces/modules/DownloaderModule.d.ts +5 -0
- package/dist/interfaces/modules/FontModule.d.ts +5 -0
- package/dist/interfaces/modules/FontModule.js +2 -0
- package/dist/interfaces/modules/GenericUltraShareModule.d.ts +5 -0
- package/dist/interfaces/modules/GenericUltraShareModule.js +2 -0
- package/dist/interfaces/modules/LocationModule.d.ts +7 -0
- package/dist/interfaces/modules/LocationModule.js +2 -0
- package/dist/interfaces/modules/NavigationModule.js +2 -0
- package/dist/interfaces/modules/PermissionsModule.d.ts +18 -0
- package/dist/interfaces/modules/SMSModule.d.ts +5 -0
- package/dist/interfaces/modules/SMSModule.js +2 -0
- package/dist/managers/ModuleManager.d.ts +17 -3
- package/dist/managers/ModuleManager.js +42 -0
- package/dist/managers/NativeModuleCallbackManager.js +17 -12
- package/dist/managers/{modules/NativeModuleManager.d.ts → NativeModuleHelper.d.ts} +9 -5
- package/dist/managers/NativeModuleHelper.js +65 -0
- package/dist/modules/AnalyticsModuleImpl.d.ts +9 -0
- package/dist/modules/AnalyticsModuleImpl.js +54 -0
- package/dist/modules/AppVersionModuleImpl.d.ts +9 -0
- package/dist/modules/AppVersionModuleImpl.js +30 -0
- package/dist/modules/AuthModuleImpl.d.ts +2 -3
- package/dist/modules/AuthModuleImpl.js +7 -4
- package/dist/modules/ContactsModuleImpl.d.ts +3 -4
- package/dist/modules/ContactsModuleImpl.js +12 -5
- package/dist/modules/DownloaderModuleImpl.d.ts +9 -0
- package/dist/modules/DownloaderModuleImpl.js +32 -0
- package/dist/modules/FontModuleImpl.d.ts +9 -0
- package/dist/modules/FontModuleImpl.js +32 -0
- package/dist/modules/LocationModuleImpl.d.ts +11 -0
- package/dist/modules/LocationModuleImpl.js +40 -0
- package/dist/modules/NavigationModuleImpl.d.ts +3 -4
- package/dist/modules/NavigationModuleImpl.js +25 -11
- package/dist/modules/PermissionsModuleImpl.d.ts +3 -4
- package/dist/modules/PermissionsModuleImpl.js +12 -8
- package/dist/modules/SMSModuleImpl.d.ts +9 -0
- package/dist/modules/SMSModuleImpl.js +30 -0
- package/dist/modules/ShareModuleImpl.d.ts +9 -0
- package/dist/modules/ShareModuleImpl.js +33 -0
- package/dist/private/tracking-setup-index.js +12 -5
- package/dist/setup/SetupHelper.d.ts +16 -0
- package/dist/setup/SetupHelper.js +218 -0
- package/dist/types/AppVersionManagerResponse.d.ts +3 -0
- package/dist/types/AppVersionManagerResponse.js +2 -0
- package/dist/types/DeviceInfoResponse.d.ts +3 -0
- package/dist/types/DeviceInfoResponse.js +2 -0
- package/dist/types/DownloadManagerResponse.d.ts +3 -0
- package/dist/types/DownloadManagerResponse.js +2 -0
- package/dist/types/FontsManagerResponse.d.ts +3 -0
- package/dist/types/FontsManagerResponse.js +2 -0
- package/dist/types/GenericShareManagerResponse.d.ts +3 -0
- package/dist/types/GenericShareManagerResponse.js +2 -0
- package/dist/types/LocationManagerResponse.d.ts +3 -0
- package/dist/types/LocationManagerResponse.js +2 -0
- package/dist/types/SMSManagerResponse.d.ts +3 -0
- package/dist/types/SMSManagerResponse.js +2 -0
- package/dist/web/index.d.ts +1 -1
- package/dist/web/index.js +2 -2
- package/package.json +2 -1
- package/dist/interfaces/PermissionsModule.d.ts +0 -9
- package/dist/managers/modules/AuthModuleManager.d.ts +0 -4
- package/dist/managers/modules/ContactsModuleManager.d.ts +0 -9
- package/dist/managers/modules/NativeModuleManager.js +0 -30
- package/dist/managers/modules/NavigationModuleManager.d.ts +0 -10
- package/dist/managers/modules/PermissionsModuleManager.d.ts +0 -14
- /package/dist/{interfaces/ContactsModule.js → analytics/interfaces/AnalyticsHelper.js} +0 -0
- /package/dist/{interfaces/NavigationModule.js → analytics/interfaces/AnalyticsModule.js} +0 -0
- /package/dist/{interfaces/PermissionsModule.js → analytics/validation/ValidationMetadata.js} +0 -0
- /package/dist/{managers/modules/AuthModuleManager.js → interfaces/modules/AppVersionModule.js} +0 -0
- /package/dist/{managers/modules/ContactsModuleManager.js → interfaces/modules/ContactsModule.js} +0 -0
- /package/dist/{managers/modules/NavigationModuleManager.js → interfaces/modules/DownloaderModule.js} +0 -0
- /package/dist/interfaces/{NavigationModule.d.ts → modules/NavigationModule.d.ts} +0 -0
- /package/dist/{managers/modules/PermissionsModuleManager.js → interfaces/modules/PermissionsModule.js} +0 -0
|
@@ -0,0 +1,33 @@
|
|
|
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 ShareModuleImpl = /** @class */ (function (_super) {
|
|
15
|
+
__extends(ShareModuleImpl, _super);
|
|
16
|
+
function ShareModuleImpl(nativeModuleCallbackManager) {
|
|
17
|
+
return _super.call(this, NativeModuleHelper_1.NativeModuleHelper.getCurrentNativeModuleProvider().DownloaderModule, nativeModuleCallbackManager) || this;
|
|
18
|
+
}
|
|
19
|
+
ShareModuleImpl.prototype.share = function (title, text, url) {
|
|
20
|
+
var _this = this;
|
|
21
|
+
return this.nativeModuleCallbackManager.executeOnBridge(function (requestId) {
|
|
22
|
+
_this.postMessage({
|
|
23
|
+
methodName: "share",
|
|
24
|
+
requestId: requestId,
|
|
25
|
+
title: title,
|
|
26
|
+
text: text,
|
|
27
|
+
url: url,
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
return ShareModuleImpl;
|
|
32
|
+
}(NativeModuleHelper_1.NativeModule));
|
|
33
|
+
exports.ShareModuleImpl = ShareModuleImpl;
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var
|
|
3
|
+
var NativeModuleCallbackManager_1 = require("../managers/NativeModuleCallbackManager");
|
|
4
|
+
var NavigationModuleImpl_1 = require("../modules/NavigationModuleImpl");
|
|
4
5
|
var LAST_WINDOW_LOCATION = "";
|
|
5
6
|
var pushStateOriginal = history.pushState;
|
|
6
7
|
var replaceStateOriginal = history.replaceState;
|
|
8
|
+
var nativeCallbackManager = new NativeModuleCallbackManager_1.NativeModuleCallbackManager();
|
|
9
|
+
var nativeModule = new NavigationModuleImpl_1.NavigationModuleImpl(nativeCallbackManager);
|
|
7
10
|
function trySettingUpLocationChangeEvents() {
|
|
8
11
|
history.pushState = function (data, title, url) {
|
|
9
12
|
var args = [];
|
|
@@ -27,15 +30,19 @@ function trySettingUpLocationChangeEvents() {
|
|
|
27
30
|
}
|
|
28
31
|
});
|
|
29
32
|
}
|
|
33
|
+
function startsWith(searchString, stringVal) {
|
|
34
|
+
return stringVal.substring(0, searchString.length) === searchString;
|
|
35
|
+
}
|
|
30
36
|
function notfiyLocationChange(url, isBackNavigation) {
|
|
31
|
-
var navigationModule = NativeModuleManager_1.NativeModuleHelper.getCurrentNativeModuleProvider().NavigationModule;
|
|
32
37
|
if (url) {
|
|
33
38
|
if (url !== LAST_WINDOW_LOCATION) {
|
|
34
39
|
LAST_WINDOW_LOCATION = url;
|
|
35
|
-
if (
|
|
36
|
-
|
|
40
|
+
if (typeof url === "string") {
|
|
41
|
+
if (!startsWith("http", url)) {
|
|
42
|
+
url = location.protocol + "//" + window.location.hostname + url;
|
|
43
|
+
}
|
|
44
|
+
nativeModule.notifyPageLocationChange(url, !!isBackNavigation);
|
|
37
45
|
}
|
|
38
|
-
navigationModule.notifyPageLocationChange(url, !!isBackNavigation);
|
|
39
46
|
}
|
|
40
47
|
}
|
|
41
48
|
}
|
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
import EventManager from "../interfaces/EventManager";
|
|
2
|
+
import { BillAnalyticsHelper, CabAnalyticsHelper, FoodDeliveryAnalyticsHelper } from "../analytics/interfaces/AnalyticsHelper";
|
|
3
|
+
import { RechargeAnalyticsHelper, TicketAnalyticsHelper, TravelAnalyticsHelper } from "../analytics/interfaces/AnalyticsHelper";
|
|
4
|
+
import { HealthcareAnalyticsHelper } from "../analytics/interfaces/AnalyticsHelper";
|
|
2
5
|
export declare class SetupHelper {
|
|
3
6
|
static setUpForBrowser(): void;
|
|
7
|
+
static setupBillAnalyticsForBrowser(): void;
|
|
8
|
+
static setupCabAnalyticsForBrowser(): void;
|
|
9
|
+
static setupFoodDeliveryAnalyticsForBrowser(): void;
|
|
10
|
+
static setupRechargeAnalyticsForBrowser(): void;
|
|
11
|
+
static setupTicketAnalyticsForBrowser(): void;
|
|
12
|
+
static setupTravelAnalyticsForBrowser(): void;
|
|
4
13
|
static setUpForReactNative(eventManager: EventManager, nativeModules: any): void;
|
|
14
|
+
static getTravelObject(): TravelAnalyticsHelper;
|
|
15
|
+
static getBillObject(): BillAnalyticsHelper;
|
|
16
|
+
static getCabObject(): CabAnalyticsHelper;
|
|
17
|
+
static getFoodDeliveryObject(): FoodDeliveryAnalyticsHelper;
|
|
18
|
+
static getRechargeObject(): RechargeAnalyticsHelper;
|
|
19
|
+
static getTicketObject(): TicketAnalyticsHelper;
|
|
20
|
+
static getHealthcareObject(): HealthcareAnalyticsHelper;
|
|
5
21
|
}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
var FKPlatform_1 = require("../FKPlatform");
|
|
4
4
|
var WindowManager_1 = require("../managers/WindowManager");
|
|
5
|
+
var analytics_1 = require("../analytics");
|
|
5
6
|
var SetupHelper = /** @class */ (function () {
|
|
6
7
|
function SetupHelper() {
|
|
7
8
|
}
|
|
@@ -18,6 +19,90 @@ var SetupHelper = /** @class */ (function () {
|
|
|
18
19
|
};
|
|
19
20
|
}
|
|
20
21
|
};
|
|
22
|
+
SetupHelper.setupBillAnalyticsForBrowser = function () {
|
|
23
|
+
SetupHelper.setUpForBrowser();
|
|
24
|
+
var windowObj = WindowManager_1.WindowManager.getWindow();
|
|
25
|
+
if (windowObj && windowObj.FKExtension) {
|
|
26
|
+
if (!windowObj.FKExtension.analyticsHelper) {
|
|
27
|
+
windowObj.FKExtension.analyticsHelper = {
|
|
28
|
+
bill: this.getBillObject(),
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
windowObj.FKExtension.analyticsHelper.bill = this.getBillObject();
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
SetupHelper.setupCabAnalyticsForBrowser = function () {
|
|
37
|
+
SetupHelper.setUpForBrowser();
|
|
38
|
+
var windowObj = WindowManager_1.WindowManager.getWindow();
|
|
39
|
+
if (windowObj && windowObj.FKExtension) {
|
|
40
|
+
if (!windowObj.FKExtension.analyticsHelper) {
|
|
41
|
+
windowObj.FKExtension.analyticsHelper = {
|
|
42
|
+
cab: this.getCabObject(),
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
windowObj.FKExtension.analyticsHelper.cab = this.getCabObject();
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
SetupHelper.setupFoodDeliveryAnalyticsForBrowser = function () {
|
|
51
|
+
SetupHelper.setUpForBrowser();
|
|
52
|
+
var windowObj = WindowManager_1.WindowManager.getWindow();
|
|
53
|
+
if (windowObj && windowObj.FKExtension) {
|
|
54
|
+
if (!windowObj.FKExtension.analyticsHelper) {
|
|
55
|
+
windowObj.FKExtension.analyticsHelper = {
|
|
56
|
+
foodDelivery: this.getFoodDeliveryObject(),
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
windowObj.FKExtension.analyticsHelper.foodDelivery = this.getFoodDeliveryObject();
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
SetupHelper.setupRechargeAnalyticsForBrowser = function () {
|
|
65
|
+
SetupHelper.setUpForBrowser();
|
|
66
|
+
var windowObj = WindowManager_1.WindowManager.getWindow();
|
|
67
|
+
if (windowObj && windowObj.FKExtension) {
|
|
68
|
+
if (!windowObj.FKExtension.analyticsHelper) {
|
|
69
|
+
windowObj.FKExtension.analyticsHelper = {
|
|
70
|
+
recharge: this.getRechargeObject(),
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
windowObj.FKExtension.analyticsHelper.recharge = this.getRechargeObject();
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
SetupHelper.setupTicketAnalyticsForBrowser = function () {
|
|
79
|
+
SetupHelper.setUpForBrowser();
|
|
80
|
+
var windowObj = WindowManager_1.WindowManager.getWindow();
|
|
81
|
+
if (windowObj && windowObj.FKExtension) {
|
|
82
|
+
if (!windowObj.FKExtension.analyticsHelper) {
|
|
83
|
+
windowObj.FKExtension.analyticsHelper = {
|
|
84
|
+
ticket: this.getTicketObject(),
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
windowObj.FKExtension.analyticsHelper.ticket = this.getTicketObject();
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
SetupHelper.setupTravelAnalyticsForBrowser = function () {
|
|
93
|
+
SetupHelper.setUpForBrowser();
|
|
94
|
+
var windowObj = WindowManager_1.WindowManager.getWindow();
|
|
95
|
+
if (windowObj && windowObj.FKExtension) {
|
|
96
|
+
if (!windowObj.FKExtension.analyticsHelper) {
|
|
97
|
+
windowObj.FKExtension.analyticsHelper = {
|
|
98
|
+
travel: this.getTravelObject(),
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
windowObj.FKExtension.analyticsHelper.travel = this.getTravelObject();
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
};
|
|
21
106
|
SetupHelper.setUpForReactNative = function (eventManager, nativeModules) {
|
|
22
107
|
var windowObj = WindowManager_1.WindowManager.getWindow();
|
|
23
108
|
if (windowObj && !windowObj.FKExtension) {
|
|
@@ -44,6 +129,139 @@ var SetupHelper = /** @class */ (function () {
|
|
|
44
129
|
}
|
|
45
130
|
}
|
|
46
131
|
};
|
|
132
|
+
SetupHelper.getTravelObject = function () {
|
|
133
|
+
return {
|
|
134
|
+
search: function (fromLocation, toLocation, date, roundTrip, travellerCount) {
|
|
135
|
+
return new analytics_1.Travel.Search(fromLocation, toLocation, date, roundTrip, travellerCount);
|
|
136
|
+
},
|
|
137
|
+
select: function (name, category, price) {
|
|
138
|
+
return new analytics_1.Travel.Select(name, category, price);
|
|
139
|
+
},
|
|
140
|
+
proceedToPayEvent: function (amountToPay, offerAmount, bookingCharge, vasCharge) {
|
|
141
|
+
return new analytics_1.Travel.ProceedToPay(amountToPay, offerAmount, bookingCharge, vasCharge);
|
|
142
|
+
},
|
|
143
|
+
customerDetails: function (email, phoneNumber, travellers) {
|
|
144
|
+
return new analytics_1.Travel.CustomerDetails(email, phoneNumber, travellers);
|
|
145
|
+
},
|
|
146
|
+
orderConfirmation: function (amountToPay, paymentMethod) {
|
|
147
|
+
return new analytics_1.Travel.OrderConfirmation(amountToPay, paymentMethod);
|
|
148
|
+
},
|
|
149
|
+
};
|
|
150
|
+
};
|
|
151
|
+
SetupHelper.getBillObject = function () {
|
|
152
|
+
return {
|
|
153
|
+
select: function (productName, connectionNumber, category, price) {
|
|
154
|
+
return new analytics_1.Bill.Select(productName, connectionNumber, category, price);
|
|
155
|
+
},
|
|
156
|
+
proceedToPay: function (amountToPay, offerAmount) {
|
|
157
|
+
return new analytics_1.Bill.ProceedToPay(amountToPay, offerAmount);
|
|
158
|
+
},
|
|
159
|
+
customerDetails: function (phoneNumber, billingAddress) {
|
|
160
|
+
return new analytics_1.Bill.CustomerDetails(phoneNumber, billingAddress);
|
|
161
|
+
},
|
|
162
|
+
orderConfirmation: function (orderAmount, paymentMethod) {
|
|
163
|
+
return new analytics_1.Bill.OrderConfirmation(orderAmount, paymentMethod);
|
|
164
|
+
},
|
|
165
|
+
};
|
|
166
|
+
};
|
|
167
|
+
SetupHelper.getCabObject = function () {
|
|
168
|
+
return {
|
|
169
|
+
select: function (source, destination, cab_type, rideNow, rideLaterTime) {
|
|
170
|
+
return new analytics_1.Cab.Select(source, destination, cab_type, rideNow, rideLaterTime);
|
|
171
|
+
},
|
|
172
|
+
orderConfirmation: function (amount, paymentMethod, couponCode) {
|
|
173
|
+
return new analytics_1.Cab.OrderConfirmation(amount, paymentMethod, couponCode);
|
|
174
|
+
},
|
|
175
|
+
orderCancellation: function (cancellationReason) {
|
|
176
|
+
return new analytics_1.Cab.OrderCancellation(cancellationReason);
|
|
177
|
+
},
|
|
178
|
+
};
|
|
179
|
+
};
|
|
180
|
+
SetupHelper.getFoodDeliveryObject = function () {
|
|
181
|
+
return {
|
|
182
|
+
search: function (searchQuery, searchCategory) {
|
|
183
|
+
return new analytics_1.FoodDelivery.Search(searchQuery, searchCategory);
|
|
184
|
+
},
|
|
185
|
+
select: function (restaurant) {
|
|
186
|
+
return new analytics_1.FoodDelivery.Select(restaurant);
|
|
187
|
+
},
|
|
188
|
+
checkOut: function (products) {
|
|
189
|
+
return new analytics_1.FoodDelivery.CheckOut(products);
|
|
190
|
+
},
|
|
191
|
+
proceedToPay: function (amountToPay, offerAmount, deliveryCharge, packingCharge) {
|
|
192
|
+
return new analytics_1.FoodDelivery.ProceedToPay(amountToPay, offerAmount, deliveryCharge, packingCharge);
|
|
193
|
+
},
|
|
194
|
+
customerDetails: function (deliveryAddress, addressType) {
|
|
195
|
+
return new analytics_1.FoodDelivery.CustomerDetails(deliveryAddress, addressType);
|
|
196
|
+
},
|
|
197
|
+
orderConfirmation: function (amountToPay, paymentMethod) {
|
|
198
|
+
return new analytics_1.FoodDelivery.OrderConfirmation(amountToPay, paymentMethod);
|
|
199
|
+
},
|
|
200
|
+
};
|
|
201
|
+
};
|
|
202
|
+
SetupHelper.getRechargeObject = function () {
|
|
203
|
+
return {
|
|
204
|
+
select: function (phoneNumber, operator, circle, category, expiry, amount) {
|
|
205
|
+
return new analytics_1.Recharge.Select(phoneNumber, operator, circle, category, expiry, amount);
|
|
206
|
+
},
|
|
207
|
+
proceedToPay: function (amountToPay, offerAmount) {
|
|
208
|
+
return new analytics_1.Recharge.ProceedToPay(amountToPay, offerAmount);
|
|
209
|
+
},
|
|
210
|
+
orderConfirmation: function (orderAmount, paymentMethod) {
|
|
211
|
+
return new analytics_1.Recharge.OrderConfirmation(orderAmount, paymentMethod);
|
|
212
|
+
},
|
|
213
|
+
};
|
|
214
|
+
};
|
|
215
|
+
SetupHelper.getTicketObject = function () {
|
|
216
|
+
return {
|
|
217
|
+
select: function (name, category, time, eventLocation, noOfPeople) {
|
|
218
|
+
return new analytics_1.Ticket.Select(name, category, time, eventLocation, noOfPeople);
|
|
219
|
+
},
|
|
220
|
+
addToCart: function (ticketClass, price, eventTime) {
|
|
221
|
+
return new analytics_1.Ticket.AddToCart(ticketClass, price, eventTime);
|
|
222
|
+
},
|
|
223
|
+
proceedToPay: function (amountToPay, offerAmount, noOfTickets, bookingCharge) {
|
|
224
|
+
return new analytics_1.Ticket.ProceedToPay(amountToPay, offerAmount, noOfTickets, bookingCharge);
|
|
225
|
+
},
|
|
226
|
+
orderConfirmation: function (amountToPay, paymentMethod) {
|
|
227
|
+
return new analytics_1.Ticket.OrderConfirmation(amountToPay, paymentMethod);
|
|
228
|
+
},
|
|
229
|
+
};
|
|
230
|
+
};
|
|
231
|
+
SetupHelper.getHealthcareObject = function () {
|
|
232
|
+
return {
|
|
233
|
+
orderConfirmation: function (fk_accountid, fkh_userid, token_id, pincode, order_amount, offer_amount, payment_method, fkh_order_id, fkh_order_status, page_visit_timestamp) {
|
|
234
|
+
return new analytics_1.Healthcare.OrderConfirmation(fk_accountid, fkh_userid, token_id, pincode, order_amount, offer_amount, payment_method, fkh_order_id, fkh_order_status, page_visit_timestamp);
|
|
235
|
+
},
|
|
236
|
+
proceedToPay: function (fk_accountid, fkh_userid, token_id, pincode, order_amount, offer_amount, payment_method, order_id, page_visit_timestamp) {
|
|
237
|
+
return new analytics_1.Healthcare.ProceedToPay(fk_accountid, fkh_userid, token_id, pincode, order_amount, offer_amount, payment_method, order_id, page_visit_timestamp);
|
|
238
|
+
},
|
|
239
|
+
uploadPrescription: function (fk_accountid, fkh_userid, token_id, pincode, page_name, page_visit_timestamp) {
|
|
240
|
+
return new analytics_1.Healthcare.UploadPrescription(fk_accountid, fkh_userid, token_id, pincode, page_name, page_visit_timestamp);
|
|
241
|
+
},
|
|
242
|
+
addToCart: function (fk_accountid, fkh_userid, token_id, pincode, product_name, product_id, price, quantity, source, page_visit_timestamp) {
|
|
243
|
+
return new analytics_1.Healthcare.AddToCart(fk_accountid, fkh_userid, token_id, pincode, product_name, product_id, price, quantity, source, page_visit_timestamp);
|
|
244
|
+
},
|
|
245
|
+
search: function (fk_accountid, fkh_userid, token_id, pincode, search_query, page_visit_timestamp) {
|
|
246
|
+
return new analytics_1.Healthcare.Search(fk_accountid, fkh_userid, token_id, pincode, search_query, page_visit_timestamp);
|
|
247
|
+
},
|
|
248
|
+
locationPincodeEnter: function (fk_accountid, fkh_userid, token_id, pincode, city, state, page_visit_timestamp) {
|
|
249
|
+
return new analytics_1.Healthcare.LocationPincodeEnter(fk_accountid, fkh_userid, token_id, pincode, city, state, page_visit_timestamp);
|
|
250
|
+
},
|
|
251
|
+
pageView: function (fk_accountid, fkh_userid, token_id, pincode, page_name, page_visit_timestamp) {
|
|
252
|
+
return new analytics_1.Healthcare.PageView(fk_accountid, fkh_userid, token_id, pincode, page_name, page_visit_timestamp);
|
|
253
|
+
},
|
|
254
|
+
addAddress: function (fk_accountid, fkh_userid, token_id, pincode, address_tag, subarea, page_visit_timestamp) {
|
|
255
|
+
return new analytics_1.Healthcare.AddAddress(fk_accountid, fkh_userid, token_id, pincode, address_tag, subarea, page_visit_timestamp);
|
|
256
|
+
},
|
|
257
|
+
obpUploadPrescription: function (fk_accountid, fkh_userid, token_id, pincode, rx_file_size, no_of_rx_uploaded, rx_source, page_visit_timestamp) {
|
|
258
|
+
return new analytics_1.Healthcare.ObpUploadPrescription(fk_accountid, fkh_userid, token_id, pincode, rx_file_size, no_of_rx_uploaded, rx_source, page_visit_timestamp);
|
|
259
|
+
},
|
|
260
|
+
cartContinueButton: function (fk_accountid, fkh_userid, token_id, pincode, coupon_code, cart_value, cart_unit_count, cart_savings_value, cart_item_count, page_visit_timestamp) {
|
|
261
|
+
return new analytics_1.Healthcare.CartContinueButton(fk_accountid, fkh_userid, token_id, pincode, coupon_code, cart_value, cart_unit_count, cart_savings_value, cart_item_count, page_visit_timestamp);
|
|
262
|
+
}
|
|
263
|
+
};
|
|
264
|
+
};
|
|
47
265
|
return SetupHelper;
|
|
48
266
|
}());
|
|
49
267
|
exports.SetupHelper = SetupHelper;
|
package/dist/web/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FKPlatformError } from "../errors/FKPlatformError";
|
|
2
2
|
import FKPlatform from "../FKPlatform";
|
|
3
|
-
import { Scope } from "../
|
|
3
|
+
import { Scope } from "../interfaces/modules/PermissionsModule";
|
|
4
4
|
export default FKPlatform;
|
|
5
5
|
export { Scope, FKPlatformError, };
|
package/dist/web/index.js
CHANGED
|
@@ -3,10 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
var FKPlatformError_1 = require("../errors/FKPlatformError");
|
|
4
4
|
exports.FKPlatformError = FKPlatformError_1.FKPlatformError;
|
|
5
5
|
var FKPlatform_1 = require("../FKPlatform");
|
|
6
|
-
var PermissionsModuleManager_1 = require("../managers/modules/PermissionsModuleManager");
|
|
7
|
-
exports.Scope = PermissionsModuleManager_1.Scope;
|
|
8
6
|
var SetupHelper_1 = require("../setup/SetupHelper");
|
|
9
7
|
var WindowManager_1 = require("../managers/WindowManager");
|
|
8
|
+
var PermissionsModule_1 = require("../interfaces/modules/PermissionsModule");
|
|
9
|
+
exports.Scope = PermissionsModule_1.Scope;
|
|
10
10
|
if (WindowManager_1.WindowManager.isBrowser()) {
|
|
11
11
|
SetupHelper_1.SetupHelper.setUpForBrowser();
|
|
12
12
|
if (navigator && navigator.userAgent) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fk-platform-sdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.37.beta4",
|
|
4
4
|
"description": "SDK to enable external experience integration within flipkart app.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
"babel-loader": "^7.1.2",
|
|
29
29
|
"babel-preset-env": "^1.6.1",
|
|
30
30
|
"compression-webpack-plugin": "^1.1.0",
|
|
31
|
+
"typescript": "2.9.2",
|
|
31
32
|
"webpack": "^3.10.0"
|
|
32
33
|
},
|
|
33
34
|
"peerDependencies": {
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Scope, ScopeAccessRequest } from "../managers/modules/PermissionsModuleManager";
|
|
2
|
-
import { PermissionsManagerResponse } from "../types/PermissionsManagerResponse";
|
|
3
|
-
import { NativeModuleResponse } from "./NativeModuleResponse";
|
|
4
|
-
export interface PermissionsModule {
|
|
5
|
-
getToken: (scopeRequests: ScopeAccessRequest[]) => Promise<NativeModuleResponse<PermissionsManagerResponse>>;
|
|
6
|
-
getScopes: () => {
|
|
7
|
-
[key: string]: Scope;
|
|
8
|
-
};
|
|
9
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { NativeModuleManager } from "./NativeModuleManager";
|
|
2
|
-
export interface Contact {
|
|
3
|
-
name: string;
|
|
4
|
-
phoneNumber: string;
|
|
5
|
-
}
|
|
6
|
-
export interface ContactsModuleManager extends NativeModuleManager {
|
|
7
|
-
pickPhoneNumber: (requestId: string) => void;
|
|
8
|
-
getContactInfo: (requestId: string, phoneNumbersSerialized: string) => void;
|
|
9
|
-
}
|
|
@@ -1,30 +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
|
-
//tslint-disable
|
|
7
|
-
var NativeModuleHelper = /** @class */ (function () {
|
|
8
|
-
function NativeModuleHelper() {
|
|
9
|
-
}
|
|
10
|
-
NativeModuleHelper.getCurrentNativeModuleProvider = function () {
|
|
11
|
-
var windowObj = WindowManager_1.WindowManager.getWindow();
|
|
12
|
-
if (windowObj) {
|
|
13
|
-
if (windowObj.nativeModules) {
|
|
14
|
-
return windowObj.nativeModules;
|
|
15
|
-
}
|
|
16
|
-
return windowObj;
|
|
17
|
-
}
|
|
18
|
-
throw new FKPlatformError_1.FKPlatformError(Errors_1.Errors.NATIVE_MODULES_MISSING);
|
|
19
|
-
};
|
|
20
|
-
return NativeModuleHelper;
|
|
21
|
-
}());
|
|
22
|
-
exports.NativeModuleHelper = NativeModuleHelper;
|
|
23
|
-
var NativeModule = /** @class */ (function () {
|
|
24
|
-
function NativeModule(nativeModuleManager, nativeModuleCallbackManager) {
|
|
25
|
-
this.nativeModuleManager = nativeModuleManager;
|
|
26
|
-
this.nativeModuleCallbackManager = nativeModuleCallbackManager;
|
|
27
|
-
}
|
|
28
|
-
return NativeModule;
|
|
29
|
-
}());
|
|
30
|
-
exports.NativeModule = NativeModule;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { NativeModuleManager } from "./NativeModuleManager";
|
|
2
|
-
export interface NavigationModuleManager extends NativeModuleManager {
|
|
3
|
-
exitSession: () => void;
|
|
4
|
-
exitToHomePage: () => void;
|
|
5
|
-
startPayment: (paymentToken: string) => void;
|
|
6
|
-
notifyPageLocationChange: (currentUri: string, isBackNavigation: boolean) => void;
|
|
7
|
-
openReactNativePage?: (bundleName: string, screenName: string, params: string) => void;
|
|
8
|
-
clearHistory?: () => void;
|
|
9
|
-
navigateToFlipkart: (uri: string) => void;
|
|
10
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { NativeModuleManager } from "./NativeModuleManager";
|
|
2
|
-
export declare enum Scope {
|
|
3
|
-
USER_NAME = "user.name",
|
|
4
|
-
USER_EMAIL = "user.email",
|
|
5
|
-
USER_MOBILE = "user.mobile"
|
|
6
|
-
}
|
|
7
|
-
export interface ScopeAccessRequest {
|
|
8
|
-
scope: Scope;
|
|
9
|
-
isMandatory?: boolean;
|
|
10
|
-
shouldVerify?: boolean;
|
|
11
|
-
}
|
|
12
|
-
export interface PermissionsModuleManager extends NativeModuleManager {
|
|
13
|
-
getToken: (requestId: string, scopeRequestsSerialized: string) => void;
|
|
14
|
-
}
|
|
File without changes
|
|
File without changes
|
/package/dist/{interfaces/PermissionsModule.js → analytics/validation/ValidationMetadata.js}
RENAMED
|
File without changes
|
/package/dist/{managers/modules/AuthModuleManager.js → interfaces/modules/AppVersionModule.js}
RENAMED
|
File without changes
|
/package/dist/{managers/modules/ContactsModuleManager.js → interfaces/modules/ContactsModule.js}
RENAMED
|
File without changes
|
/package/dist/{managers/modules/NavigationModuleManager.js → interfaces/modules/DownloaderModule.js}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|