fk-platform-sdk 1.0.41 → 1.0.42

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.
@@ -0,0 +1,27 @@
1
+ import { AnalyticsEvent } from "./interfaces/AnalyticsEvent";
2
+ import { EventValidator } from "./EventValidator";
3
+ export declare class PageView implements AnalyticsEvent {
4
+ type: string;
5
+ private load_time;
6
+ private page_name;
7
+ constructor(load_time: number, page_name: string);
8
+ getValidator(): EventValidator;
9
+ }
10
+ export declare class Wallet implements AnalyticsEvent {
11
+ type: string;
12
+ private stage;
13
+ constructor(stage: string);
14
+ getValidator(): EventValidator;
15
+ }
16
+ export declare class KycProcess implements AnalyticsEvent {
17
+ type: string;
18
+ private step;
19
+ constructor(step: string);
20
+ getValidator(): EventValidator;
21
+ }
22
+ export declare class Clicks implements AnalyticsEvent {
23
+ type: string;
24
+ private action;
25
+ constructor(action: string);
26
+ getValidator(): EventValidator;
27
+ }
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ var EventValidator_1 = require("./EventValidator");
10
+ var decorators_1 = require("./validation/decorators");
11
+ var Validator_1 = require("./validation/Validator");
12
+ var metadataMap = {};
13
+ var PageView = /** @class */ (function () {
14
+ function PageView(load_time, page_name) {
15
+ this.type = "Nft.PageView";
16
+ this.load_time = load_time;
17
+ this.page_name = page_name;
18
+ }
19
+ PageView.prototype.getValidator = function () {
20
+ var invalidValues = Validator_1.validate(metadataMap, this, "PageView");
21
+ return new EventValidator_1.EventValidator(invalidValues);
22
+ };
23
+ __decorate([
24
+ decorators_1.Positive(metadataMap, "PageView")
25
+ ], PageView.prototype, "load_time", void 0);
26
+ return PageView;
27
+ }());
28
+ exports.PageView = PageView;
29
+ var Wallet = /** @class */ (function () {
30
+ function Wallet(stage) {
31
+ this.type = "Nft.Wallet";
32
+ this.stage = stage;
33
+ }
34
+ Wallet.prototype.getValidator = function () {
35
+ var invalidValues = Validator_1.validate(metadataMap, this, "Wallet");
36
+ return new EventValidator_1.EventValidator(invalidValues);
37
+ };
38
+ __decorate([
39
+ decorators_1.Positive(metadataMap, "Wallet")
40
+ ], Wallet.prototype, "stage", void 0);
41
+ return Wallet;
42
+ }());
43
+ exports.Wallet = Wallet;
44
+ var KycProcess = /** @class */ (function () {
45
+ function KycProcess(step) {
46
+ this.type = "Nft.KycProcess";
47
+ this.step = step;
48
+ }
49
+ KycProcess.prototype.getValidator = function () {
50
+ var invalidValues = Validator_1.validate(metadataMap, this, "KycProcess");
51
+ return new EventValidator_1.EventValidator(invalidValues);
52
+ };
53
+ __decorate([
54
+ decorators_1.Positive(metadataMap, "KycProcess")
55
+ ], KycProcess.prototype, "step", void 0);
56
+ return KycProcess;
57
+ }());
58
+ exports.KycProcess = KycProcess;
59
+ var Clicks = /** @class */ (function () {
60
+ function Clicks(action) {
61
+ this.type = "Nft.Clicks";
62
+ this.action = action;
63
+ }
64
+ Clicks.prototype.getValidator = function () {
65
+ var invalidValues = Validator_1.validate(metadataMap, this, "Clicks");
66
+ return new EventValidator_1.EventValidator(invalidValues);
67
+ };
68
+ __decorate([
69
+ decorators_1.Positive(metadataMap, "Clicks")
70
+ ], Clicks.prototype, "action", void 0);
71
+ return Clicks;
72
+ }());
73
+ exports.Clicks = Clicks;
@@ -5,4 +5,5 @@ import * as Bill from "./Bill";
5
5
  import * as Ticket from "./ShowTicket";
6
6
  import * as FoodDelivery from "./FoodDelivery";
7
7
  import * as Healthcare from "./Healthcare";
8
- export { Bill, Cab, FoodDelivery, Recharge, Ticket, Travel, Healthcare };
8
+ import * as Nft from "./Nft";
9
+ export { Bill, Cab, FoodDelivery, Recharge, Ticket, Travel, Healthcare, Nft };
@@ -14,3 +14,5 @@ var FoodDelivery = require("./FoodDelivery");
14
14
  exports.FoodDelivery = FoodDelivery;
15
15
  var Healthcare = require("./Healthcare");
16
16
  exports.Healthcare = Healthcare;
17
+ var Nft = require("./Nft");
18
+ exports.Nft = Nft;
@@ -1,4 +1,4 @@
1
- import { Bill, Cab, FoodDelivery, Recharge, Ticket, Travel, Healthcare } from "../";
1
+ import { Bill, Cab, FoodDelivery, Recharge, Ticket, Travel, Healthcare, Nft } from "../";
2
2
  import { FoodDish } from "../FoodDish";
3
3
  import { Person } from "../Person";
4
4
  export interface AnalyticsHelper {
@@ -47,6 +47,12 @@ export interface TravelAnalyticsHelper {
47
47
  customerDetails: (email: string, phoneNumber: string, travellers: Person[]) => Travel.CustomerDetails;
48
48
  orderConfirmation: (amountToPay: number, paymentMethod: string) => Travel.OrderConfirmation;
49
49
  }
50
+ export interface NFTAnalyticsHelper {
51
+ wallet: (stage: string) => Nft.Wallet;
52
+ kycProcess: (step: string) => Nft.KycProcess;
53
+ pageView: (load_time: number, page_name: string) => Nft.PageView;
54
+ clicks: (action: string) => Nft.Clicks;
55
+ }
50
56
  export interface HealthcareAnalyticsHelper {
51
57
  orderConfirmation: (fk_accountid: string, fkh_userid: string, token_id: string, pincode: string, order_amount: number, offer_amount: number, payment_method: string, fkh_order_id: string, fkh_order_status: string, page_visit_timestamp: number) => Healthcare.OrderConfirmation;
52
58
  proceedToPay: (fk_accountid: string, fkh_userid: string, token_id: string, pincode: string, order_amount: number, offer_amount: number, payment_method: string, order_id: string, page_visit_timestamp: number) => Healthcare.ProceedToPay;
@@ -10,4 +10,5 @@ export interface NativeModuleManagerProvider {
10
10
  AppVersionModule: NativeModuleManager;
11
11
  DownloaderModule: NativeModuleManager;
12
12
  FontModule: NativeModuleManager;
13
+ GenericUltraShareModule: NativeModuleManager;
13
14
  }
@@ -0,0 +1,5 @@
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
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,7 +1,8 @@
1
1
  import { DeviceInfoResponse } from "../../types/DeviceInfoResponse";
2
- import { LocationManagerResponse } from "../../types/LocationManagerResponse";
2
+ import { LocationManagerResponse, PreciseLocationResponse } from "../../types/LocationManagerResponse";
3
3
  import { NativeModuleResponse } from "../NativeModuleResponse";
4
4
  export interface LocationModule {
5
5
  getUserPinCode: (clientID: string) => Promise<NativeModuleResponse<LocationManagerResponse>>;
6
6
  getUserDeviceId: () => Promise<NativeModuleResponse<DeviceInfoResponse>>;
7
+ getUserLocation: () => Promise<NativeModuleResponse<PreciseLocationResponse>>;
7
8
  }
@@ -8,6 +8,7 @@ import { LocationModule } from "../interfaces/modules/LocationModule";
8
8
  import { AppVersionModule } from "../interfaces/modules/AppVersionModule";
9
9
  import { DownloaderModule } from "../interfaces/modules/DownloaderModule";
10
10
  import { FontModule } from "../interfaces/modules/FontModule";
11
+ import { GenericUltraShareModule } from "../interfaces/modules/GenericUltraShareModule";
11
12
  export declare class ModuleManager {
12
13
  private moduleMap;
13
14
  constructor(nativeModuleCallbackManager: NativeModuleCallbackManager);
@@ -20,6 +21,7 @@ export declare class ModuleManager {
20
21
  getAppVersionModule(): AppVersionModule;
21
22
  getDownloaderModule(): DownloaderModule;
22
23
  getFontModule(): FontModule;
24
+ getShareModule(): GenericUltraShareModule;
23
25
  private addModule;
24
26
  private getModule;
25
27
  }
@@ -9,6 +9,7 @@ var LocationModuleImpl_1 = require("../modules/LocationModuleImpl");
9
9
  var AppVersionModuleImpl_1 = require("../modules/AppVersionModuleImpl");
10
10
  var DownloaderModuleImpl_1 = require("../modules/DownloaderModuleImpl");
11
11
  var FontModuleImpl_1 = require("../modules/FontModuleImpl");
12
+ var ShareModuleImpl_1 = require("../modules/ShareModuleImpl");
12
13
  var MODULE_NAME;
13
14
  (function (MODULE_NAME) {
14
15
  MODULE_NAME[MODULE_NAME["PERMISSION_MODULE"] = 0] = "PERMISSION_MODULE";
@@ -20,6 +21,7 @@ var MODULE_NAME;
20
21
  MODULE_NAME[MODULE_NAME["APP_VERSION_MODULE"] = 6] = "APP_VERSION_MODULE";
21
22
  MODULE_NAME[MODULE_NAME["DOWNLOADER_MODULE"] = 7] = "DOWNLOADER_MODULE";
22
23
  MODULE_NAME[MODULE_NAME["FONT_MODULE"] = 8] = "FONT_MODULE";
24
+ MODULE_NAME[MODULE_NAME["SHARE_MODULE"] = 9] = "SHARE_MODULE";
23
25
  })(MODULE_NAME || (MODULE_NAME = {}));
24
26
  var ModuleManager = /** @class */ (function () {
25
27
  function ModuleManager(nativeModuleCallbackManager) {
@@ -33,6 +35,7 @@ var ModuleManager = /** @class */ (function () {
33
35
  this.addModule(MODULE_NAME.APP_VERSION_MODULE, new AppVersionModuleImpl_1.AppVersionModuleImpl(nativeModuleCallbackManager));
34
36
  this.addModule(MODULE_NAME.DOWNLOADER_MODULE, new DownloaderModuleImpl_1.DownloaderModuleImpl(nativeModuleCallbackManager));
35
37
  this.addModule(MODULE_NAME.FONT_MODULE, new FontModuleImpl_1.FontModuleImpl(nativeModuleCallbackManager));
38
+ this.addModule(MODULE_NAME.SHARE_MODULE, new ShareModuleImpl_1.ShareModuleImpl(nativeModuleCallbackManager));
36
39
  }
37
40
  ModuleManager.prototype.getNavigationModule = function () {
38
41
  return this.getModule(MODULE_NAME.NAVIGATION_MODULE);
@@ -61,6 +64,9 @@ var ModuleManager = /** @class */ (function () {
61
64
  ModuleManager.prototype.getFontModule = function () {
62
65
  return this.getModule(MODULE_NAME.FONT_MODULE);
63
66
  };
67
+ ModuleManager.prototype.getShareModule = function () {
68
+ return this.getModule(MODULE_NAME.SHARE_MODULE);
69
+ };
64
70
  ModuleManager.prototype.addModule = function (moduleName, nativeModule) {
65
71
  this.moduleMap[moduleName] = nativeModule;
66
72
  };
@@ -2,10 +2,11 @@ import { NativeModuleResponse } from "../interfaces/NativeModuleResponse";
2
2
  import { NativeModule, NativeModuleManager } from "../managers/NativeModuleHelper";
3
3
  import { NativeModuleCallbackManager } from "../managers/NativeModuleCallbackManager";
4
4
  import { LocationModule } from "../interfaces/modules/LocationModule";
5
- import { LocationManagerResponse } from "../types/LocationManagerResponse";
5
+ import { LocationManagerResponse, PreciseLocationResponse } from "../types/LocationManagerResponse";
6
6
  import { DeviceInfoResponse } from "../types/DeviceInfoResponse";
7
7
  export declare class LocationModuleImpl extends NativeModule<NativeModuleManager> implements LocationModule {
8
8
  constructor(nativeModuleCallbackManager: NativeModuleCallbackManager);
9
9
  getUserPinCode(clientID: string): Promise<NativeModuleResponse<LocationManagerResponse>>;
10
10
  getUserDeviceId(): Promise<NativeModuleResponse<DeviceInfoResponse>>;
11
+ getUserLocation(): Promise<NativeModuleResponse<PreciseLocationResponse>>;
11
12
  }
@@ -35,6 +35,15 @@ var LocationModuleImpl = /** @class */ (function (_super) {
35
35
  });
36
36
  });
37
37
  };
38
+ LocationModuleImpl.prototype.getUserLocation = function () {
39
+ var _this = this;
40
+ return this.nativeModuleCallbackManager.executeOnBridge(function (requestId) {
41
+ _this.postMessage({
42
+ methodName: "getUserLocation",
43
+ requestId: requestId
44
+ });
45
+ });
46
+ };
38
47
  return LocationModuleImpl;
39
48
  }(NativeModuleHelper_1.NativeModule));
40
49
  exports.LocationModuleImpl = LocationModuleImpl;
@@ -0,0 +1,9 @@
1
+ import { NativeModuleResponse } from "../interfaces/NativeModuleResponse";
2
+ import { NativeModule, NativeModuleManager } from "../managers/NativeModuleHelper";
3
+ import { NativeModuleCallbackManager } from "../managers/NativeModuleCallbackManager";
4
+ import { GenericUltraShareModule } from "../interfaces/modules/GenericUltraShareModule";
5
+ import { GenericShareManagerResponse } from "../types/GenericShareManagerResponse";
6
+ export declare class ShareModuleImpl extends NativeModule<NativeModuleManager> implements GenericUltraShareModule {
7
+ constructor(nativeModuleCallbackManager: NativeModuleCallbackManager);
8
+ share(title: string, text: string, url: string, fileContentUri: string): Promise<NativeModuleResponse<GenericShareManagerResponse>>;
9
+ }
@@ -0,0 +1,35 @@
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()
18
+ .GenericUltraShareModule, nativeModuleCallbackManager) || this;
19
+ }
20
+ ShareModuleImpl.prototype.share = function (title, text, url, fileContentUri) {
21
+ var _this = this;
22
+ return this.nativeModuleCallbackManager.executeOnBridge(function (requestId) {
23
+ _this.postMessage({
24
+ methodName: "share",
25
+ requestId: requestId,
26
+ title: title,
27
+ text: text,
28
+ url: url,
29
+ fileContentUri: fileContentUri
30
+ });
31
+ });
32
+ };
33
+ return ShareModuleImpl;
34
+ }(NativeModuleHelper_1.NativeModule));
35
+ exports.ShareModuleImpl = ShareModuleImpl;
@@ -1,7 +1,7 @@
1
1
  import EventManager from "../interfaces/EventManager";
2
2
  import { BillAnalyticsHelper, CabAnalyticsHelper, FoodDeliveryAnalyticsHelper } from "../analytics/interfaces/AnalyticsHelper";
3
3
  import { RechargeAnalyticsHelper, TicketAnalyticsHelper, TravelAnalyticsHelper } from "../analytics/interfaces/AnalyticsHelper";
4
- import { HealthcareAnalyticsHelper } from "../analytics/interfaces/AnalyticsHelper";
4
+ import { HealthcareAnalyticsHelper, NFTAnalyticsHelper } from "../analytics/interfaces/AnalyticsHelper";
5
5
  export declare class SetupHelper {
6
6
  static setUpForBrowser(): void;
7
7
  static setupBillAnalyticsForBrowser(): void;
@@ -17,5 +17,6 @@ export declare class SetupHelper {
17
17
  static getFoodDeliveryObject(): FoodDeliveryAnalyticsHelper;
18
18
  static getRechargeObject(): RechargeAnalyticsHelper;
19
19
  static getTicketObject(): TicketAnalyticsHelper;
20
+ static getNftObject(): NFTAnalyticsHelper;
20
21
  static getHealthcareObject(): HealthcareAnalyticsHelper;
21
22
  }
@@ -228,6 +228,22 @@ var SetupHelper = /** @class */ (function () {
228
228
  },
229
229
  };
230
230
  };
231
+ SetupHelper.getNftObject = function () {
232
+ return {
233
+ wallet: function (stage) {
234
+ return new analytics_1.Nft.Wallet(stage);
235
+ },
236
+ pageView: function (load_time, page_name) {
237
+ return new analytics_1.Nft.PageView(load_time, page_name);
238
+ },
239
+ kycProcess: function (step) {
240
+ return new analytics_1.Nft.KycProcess(step);
241
+ },
242
+ clicks: function (action) {
243
+ return new analytics_1.Nft.Clicks(action);
244
+ }
245
+ };
246
+ };
231
247
  SetupHelper.getHealthcareObject = function () {
232
248
  return {
233
249
  orderConfirmation: function (fk_accountid, fkh_userid, token_id, pincode, order_amount, offer_amount, payment_method, fkh_order_id, fkh_order_status, page_visit_timestamp) {
@@ -0,0 +1,3 @@
1
+ export interface GenericShareManagerResponse {
2
+ message: string;
3
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,3 +1,7 @@
1
1
  export interface LocationManagerResponse {
2
2
  pincode: string;
3
3
  }
4
+ export interface PreciseLocationResponse {
5
+ latitude: string;
6
+ longitude: string;
7
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fk-platform-sdk",
3
- "version": "1.0.41",
3
+ "version": "1.0.42",
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",