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.
Files changed (127) hide show
  1. package/.vscode/settings.json +3 -0
  2. package/analytics/index.js +1 -0
  3. package/dist/FKPlatform.js +1 -2
  4. package/dist/analytics/Bill.d.ts +31 -0
  5. package/dist/analytics/Bill.js +103 -0
  6. package/dist/analytics/Cab.d.ts +26 -0
  7. package/dist/analytics/Cab.js +66 -0
  8. package/dist/analytics/EventValidator.d.ts +6 -0
  9. package/dist/analytics/EventValidator.js +15 -0
  10. package/dist/analytics/FoodDelivery.d.ts +45 -0
  11. package/dist/analytics/FoodDelivery.js +131 -0
  12. package/dist/analytics/FoodDish.d.ts +7 -0
  13. package/dist/analytics/FoodDish.js +12 -0
  14. package/dist/analytics/Healthcare.d.ts +131 -0
  15. package/dist/analytics/Healthcare.js +231 -0
  16. package/dist/analytics/Person.d.ts +6 -0
  17. package/dist/analytics/Person.js +11 -0
  18. package/dist/analytics/Recharge.d.ts +27 -0
  19. package/dist/analytics/Recharge.js +82 -0
  20. package/dist/analytics/ShowTicket.d.ts +36 -0
  21. package/dist/analytics/ShowTicket.js +97 -0
  22. package/dist/analytics/Travel.d.ts +45 -0
  23. package/dist/analytics/Travel.js +126 -0
  24. package/dist/analytics/index.d.ts +8 -0
  25. package/dist/analytics/index.js +16 -0
  26. package/dist/analytics/interfaces/AnalyticsEvent.d.ts +5 -0
  27. package/dist/analytics/interfaces/AnalyticsEvent.js +13 -0
  28. package/dist/analytics/interfaces/AnalyticsHelper.d.ts +61 -0
  29. package/dist/analytics/interfaces/AnalyticsModule.d.ts +5 -0
  30. package/dist/analytics/validation/ValidationMetadata.d.ts +10 -0
  31. package/dist/analytics/validation/ValidationTypes.d.ts +6 -0
  32. package/dist/analytics/validation/ValidationTypes.js +12 -0
  33. package/dist/analytics/validation/Validator.d.ts +3 -0
  34. package/dist/analytics/validation/Validator.js +38 -0
  35. package/dist/analytics/validation/decorators.d.ts +16 -0
  36. package/dist/analytics/validation/decorators.js +67 -0
  37. package/dist/analytics/web/bill-index.d.ts +1 -0
  38. package/dist/analytics/web/bill-index.js +4 -0
  39. package/dist/analytics/web/cab-index.d.ts +1 -0
  40. package/dist/analytics/web/cab-index.js +4 -0
  41. package/dist/analytics/web/food-delivery-index.d.ts +1 -0
  42. package/dist/analytics/web/food-delivery-index.js +4 -0
  43. package/dist/analytics/web/recharge-index.d.ts +1 -0
  44. package/dist/analytics/web/recharge-index.js +4 -0
  45. package/dist/analytics/web/ticket-index.d.ts +1 -0
  46. package/dist/analytics/web/ticket-index.js +4 -0
  47. package/dist/analytics/web/travel-index.d.ts +1 -0
  48. package/dist/analytics/web/travel-index.js +4 -0
  49. package/dist/index.d.ts +1 -1
  50. package/dist/index.js +2 -2
  51. package/dist/interfaces/FKExtension.d.ts +2 -0
  52. package/dist/interfaces/FKWindow.d.ts +4 -0
  53. package/dist/interfaces/NativeModuleManagerProvider.d.ts +12 -8
  54. package/dist/interfaces/modules/AppVersionModule.d.ts +5 -0
  55. package/dist/interfaces/{ContactsModule.d.ts → modules/ContactsModule.d.ts} +5 -2
  56. package/dist/interfaces/modules/DownloaderModule.d.ts +5 -0
  57. package/dist/interfaces/modules/FontModule.d.ts +5 -0
  58. package/dist/interfaces/modules/FontModule.js +2 -0
  59. package/dist/interfaces/modules/GenericUltraShareModule.d.ts +5 -0
  60. package/dist/interfaces/modules/GenericUltraShareModule.js +2 -0
  61. package/dist/interfaces/modules/LocationModule.d.ts +7 -0
  62. package/dist/interfaces/modules/LocationModule.js +2 -0
  63. package/dist/interfaces/modules/NavigationModule.js +2 -0
  64. package/dist/interfaces/modules/PermissionsModule.d.ts +18 -0
  65. package/dist/interfaces/modules/SMSModule.d.ts +5 -0
  66. package/dist/interfaces/modules/SMSModule.js +2 -0
  67. package/dist/managers/ModuleManager.d.ts +17 -3
  68. package/dist/managers/ModuleManager.js +42 -0
  69. package/dist/managers/NativeModuleCallbackManager.js +17 -12
  70. package/dist/managers/{modules/NativeModuleManager.d.ts → NativeModuleHelper.d.ts} +9 -5
  71. package/dist/managers/NativeModuleHelper.js +65 -0
  72. package/dist/modules/AnalyticsModuleImpl.d.ts +9 -0
  73. package/dist/modules/AnalyticsModuleImpl.js +54 -0
  74. package/dist/modules/AppVersionModuleImpl.d.ts +9 -0
  75. package/dist/modules/AppVersionModuleImpl.js +30 -0
  76. package/dist/modules/AuthModuleImpl.d.ts +2 -3
  77. package/dist/modules/AuthModuleImpl.js +7 -4
  78. package/dist/modules/ContactsModuleImpl.d.ts +3 -4
  79. package/dist/modules/ContactsModuleImpl.js +12 -5
  80. package/dist/modules/DownloaderModuleImpl.d.ts +9 -0
  81. package/dist/modules/DownloaderModuleImpl.js +32 -0
  82. package/dist/modules/FontModuleImpl.d.ts +9 -0
  83. package/dist/modules/FontModuleImpl.js +32 -0
  84. package/dist/modules/LocationModuleImpl.d.ts +11 -0
  85. package/dist/modules/LocationModuleImpl.js +40 -0
  86. package/dist/modules/NavigationModuleImpl.d.ts +3 -4
  87. package/dist/modules/NavigationModuleImpl.js +25 -11
  88. package/dist/modules/PermissionsModuleImpl.d.ts +3 -4
  89. package/dist/modules/PermissionsModuleImpl.js +12 -8
  90. package/dist/modules/SMSModuleImpl.d.ts +9 -0
  91. package/dist/modules/SMSModuleImpl.js +30 -0
  92. package/dist/modules/ShareModuleImpl.d.ts +9 -0
  93. package/dist/modules/ShareModuleImpl.js +33 -0
  94. package/dist/private/tracking-setup-index.js +12 -5
  95. package/dist/setup/SetupHelper.d.ts +16 -0
  96. package/dist/setup/SetupHelper.js +218 -0
  97. package/dist/types/AppVersionManagerResponse.d.ts +3 -0
  98. package/dist/types/AppVersionManagerResponse.js +2 -0
  99. package/dist/types/DeviceInfoResponse.d.ts +3 -0
  100. package/dist/types/DeviceInfoResponse.js +2 -0
  101. package/dist/types/DownloadManagerResponse.d.ts +3 -0
  102. package/dist/types/DownloadManagerResponse.js +2 -0
  103. package/dist/types/FontsManagerResponse.d.ts +3 -0
  104. package/dist/types/FontsManagerResponse.js +2 -0
  105. package/dist/types/GenericShareManagerResponse.d.ts +3 -0
  106. package/dist/types/GenericShareManagerResponse.js +2 -0
  107. package/dist/types/LocationManagerResponse.d.ts +3 -0
  108. package/dist/types/LocationManagerResponse.js +2 -0
  109. package/dist/types/SMSManagerResponse.d.ts +3 -0
  110. package/dist/types/SMSManagerResponse.js +2 -0
  111. package/dist/web/index.d.ts +1 -1
  112. package/dist/web/index.js +2 -2
  113. package/package.json +2 -1
  114. package/dist/interfaces/PermissionsModule.d.ts +0 -9
  115. package/dist/managers/modules/AuthModuleManager.d.ts +0 -4
  116. package/dist/managers/modules/ContactsModuleManager.d.ts +0 -9
  117. package/dist/managers/modules/NativeModuleManager.js +0 -30
  118. package/dist/managers/modules/NavigationModuleManager.d.ts +0 -10
  119. package/dist/managers/modules/PermissionsModuleManager.d.ts +0 -14
  120. /package/dist/{interfaces/ContactsModule.js → analytics/interfaces/AnalyticsHelper.js} +0 -0
  121. /package/dist/{interfaces/NavigationModule.js → analytics/interfaces/AnalyticsModule.js} +0 -0
  122. /package/dist/{interfaces/PermissionsModule.js → analytics/validation/ValidationMetadata.js} +0 -0
  123. /package/dist/{managers/modules/AuthModuleManager.js → interfaces/modules/AppVersionModule.js} +0 -0
  124. /package/dist/{managers/modules/ContactsModuleManager.js → interfaces/modules/ContactsModule.js} +0 -0
  125. /package/dist/{managers/modules/NavigationModuleManager.js → interfaces/modules/DownloaderModule.js} +0 -0
  126. /package/dist/interfaces/{NavigationModule.d.ts → modules/NavigationModule.d.ts} +0 -0
  127. /package/dist/{managers/modules/PermissionsModuleManager.js → interfaces/modules/PermissionsModule.js} +0 -0
@@ -1,13 +1,17 @@
1
- import { NativeModuleManagerProvider } from "../../interfaces/NativeModuleManagerProvider";
2
- import { NativeModuleCallbackManager } from "../NativeModuleCallbackManager";
3
- export interface NativeModuleManager {
4
- dummy?: string;
5
- }
1
+ import { NativeModuleManagerProvider } from "../interfaces/NativeModuleManagerProvider";
2
+ import { NativeModuleCallbackManager } from "./NativeModuleCallbackManager";
6
3
  export declare class NativeModuleHelper {
7
4
  static getCurrentNativeModuleProvider(): NativeModuleManagerProvider;
8
5
  }
6
+ export interface NativeModuleManager {
7
+ postMessage: (args: any[]) => void;
8
+ [key: string]: any;
9
+ }
9
10
  export declare class NativeModule<T extends NativeModuleManager> {
10
11
  protected nativeModuleManager: T;
11
12
  protected nativeModuleCallbackManager: NativeModuleCallbackManager;
12
13
  constructor(nativeModuleManager: T, nativeModuleCallbackManager: NativeModuleCallbackManager);
14
+ protected postMessage(dict: {
15
+ [key: string]: any;
16
+ }): void;
13
17
  }
@@ -0,0 +1,65 @@
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;
@@ -0,0 +1,9 @@
1
+ import { NativeModule, NativeModuleManager } from "../managers/NativeModuleHelper";
2
+ import { NativeModuleCallbackManager } from "../managers/NativeModuleCallbackManager";
3
+ import { AnalyticsEvent } from "../analytics/interfaces/AnalyticsEvent";
4
+ import { AnalyticsModule } 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
+ }
@@ -0,0 +1,54 @@
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
+ return AnalyticsModuleImpl;
53
+ }(NativeModuleHelper_1.NativeModule));
54
+ exports.AnalyticsModuleImpl = AnalyticsModuleImpl;
@@ -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 { 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
+ }
@@ -0,0 +1,30 @@
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;
@@ -1,7 +1,6 @@
1
- import { AuthModuleManager } from "../managers/modules/AuthModuleManager";
2
- import { NativeModule } from "../managers/modules/NativeModuleManager";
1
+ import { NativeModule, NativeModuleManager } from "../managers/NativeModuleHelper";
3
2
  import { NativeModuleCallbackManager } from "../managers/NativeModuleCallbackManager";
4
- export declare class AuthModuleImpl extends NativeModule<AuthModuleManager> {
3
+ export declare class AuthModuleImpl extends NativeModule<NativeModuleManager> {
5
4
  constructor(nativeModuleCallbackManager: NativeModuleCallbackManager);
6
5
  init(clientId: string): void;
7
6
  }
@@ -10,15 +10,18 @@ var __extends = (this && this.__extends) || (function () {
10
10
  };
11
11
  })();
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
- var NativeModuleManager_1 = require("../managers/modules/NativeModuleManager");
13
+ var NativeModuleHelper_1 = require("../managers/NativeModuleHelper");
14
14
  var AuthModuleImpl = /** @class */ (function (_super) {
15
15
  __extends(AuthModuleImpl, _super);
16
16
  function AuthModuleImpl(nativeModuleCallbackManager) {
17
- return _super.call(this, NativeModuleManager_1.NativeModuleHelper.getCurrentNativeModuleProvider().AuthModule, nativeModuleCallbackManager) || this;
17
+ return _super.call(this, NativeModuleHelper_1.NativeModuleHelper.getCurrentNativeModuleProvider().AuthModule, nativeModuleCallbackManager) || this;
18
18
  }
19
19
  AuthModuleImpl.prototype.init = function (clientId) {
20
- this.nativeModuleManager.init(clientId);
20
+ this.postMessage({
21
+ methodName: "init",
22
+ clientId: clientId,
23
+ });
21
24
  };
22
25
  return AuthModuleImpl;
23
- }(NativeModuleManager_1.NativeModule));
26
+ }(NativeModuleHelper_1.NativeModule));
24
27
  exports.AuthModuleImpl = AuthModuleImpl;
@@ -1,9 +1,8 @@
1
- import { NativeModule } from "../managers/modules/NativeModuleManager";
1
+ import { NativeModule, NativeModuleManager } from "../managers/NativeModuleHelper";
2
2
  import { NativeModuleCallbackManager } from "../managers/NativeModuleCallbackManager";
3
- import { ContactsModuleManager, Contact } from "../managers/modules/ContactsModuleManager";
4
- import { ContactsModule } from "../interfaces/ContactsModule";
3
+ import { ContactsModule, Contact } from "../interfaces/modules/ContactsModule";
5
4
  import { NativeModuleResponse } from "../interfaces/NativeModuleResponse";
6
- export declare class ContactsModuleImpl extends NativeModule<ContactsModuleManager> implements ContactsModule {
5
+ export declare class ContactsModuleImpl extends NativeModule<NativeModuleManager> implements ContactsModule {
7
6
  constructor(nativeModuleCallbackManager: NativeModuleCallbackManager);
8
7
  pickPhoneNumber(): Promise<NativeModuleResponse<Contact>>;
9
8
  getContactInfo(phoneNumbers: string[]): Promise<NativeModuleResponse<{
@@ -10,24 +10,31 @@ var __extends = (this && this.__extends) || (function () {
10
10
  };
11
11
  })();
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
- var NativeModuleManager_1 = require("../managers/modules/NativeModuleManager");
13
+ var NativeModuleHelper_1 = require("../managers/NativeModuleHelper");
14
14
  var ContactsModuleImpl = /** @class */ (function (_super) {
15
15
  __extends(ContactsModuleImpl, _super);
16
16
  function ContactsModuleImpl(nativeModuleCallbackManager) {
17
- return _super.call(this, NativeModuleManager_1.NativeModuleHelper.getCurrentNativeModuleProvider().ContactsModule, nativeModuleCallbackManager) || this;
17
+ return _super.call(this, NativeModuleHelper_1.NativeModuleHelper.getCurrentNativeModuleProvider().ContactsModule, nativeModuleCallbackManager) || this;
18
18
  }
19
19
  ContactsModuleImpl.prototype.pickPhoneNumber = function () {
20
20
  var _this = this;
21
21
  return this.nativeModuleCallbackManager.executeOnBridge(function (requestId) {
22
- _this.nativeModuleManager.pickPhoneNumber(requestId);
22
+ _this.postMessage({
23
+ methodName: "pickPhoneNumber",
24
+ requestId: requestId,
25
+ });
23
26
  });
24
27
  };
25
28
  ContactsModuleImpl.prototype.getContactInfo = function (phoneNumbers) {
26
29
  var _this = this;
27
30
  return this.nativeModuleCallbackManager.executeOnBridge(function (requestId) {
28
- _this.nativeModuleManager.getContactInfo(requestId, JSON.stringify(phoneNumbers));
31
+ _this.postMessage({
32
+ methodName: "getContactInfo",
33
+ requestId: requestId,
34
+ numbers: JSON.stringify(phoneNumbers),
35
+ });
29
36
  });
30
37
  };
31
38
  return ContactsModuleImpl;
32
- }(NativeModuleManager_1.NativeModule));
39
+ }(NativeModuleHelper_1.NativeModule));
33
40
  exports.ContactsModuleImpl = ContactsModuleImpl;
@@ -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 { DownloaderModule } from "../interfaces/modules/DownloaderModule";
5
+ import { DownloadManagerResponse } from "../types/DownloadManagerResponse";
6
+ export declare class DownloaderModuleImpl extends NativeModule<NativeModuleManager> implements DownloaderModule {
7
+ constructor(nativeModuleCallbackManager: NativeModuleCallbackManager);
8
+ fileDownload(url: string, mimeType: string): Promise<NativeModuleResponse<DownloadManagerResponse>>;
9
+ }
@@ -0,0 +1,32 @@
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 DownloaderModuleImpl = /** @class */ (function (_super) {
15
+ __extends(DownloaderModuleImpl, _super);
16
+ function DownloaderModuleImpl(nativeModuleCallbackManager) {
17
+ return _super.call(this, NativeModuleHelper_1.NativeModuleHelper.getCurrentNativeModuleProvider().DownloaderModule, nativeModuleCallbackManager) || this;
18
+ }
19
+ DownloaderModuleImpl.prototype.fileDownload = function (url, mimeType) {
20
+ var _this = this;
21
+ return this.nativeModuleCallbackManager.executeOnBridge(function (requestId) {
22
+ _this.postMessage({
23
+ methodName: "fileDownload",
24
+ requestId: requestId,
25
+ url: url,
26
+ mimeType: mimeType
27
+ });
28
+ });
29
+ };
30
+ return DownloaderModuleImpl;
31
+ }(NativeModuleHelper_1.NativeModule));
32
+ exports.DownloaderModuleImpl = DownloaderModuleImpl;
@@ -0,0 +1,9 @@
1
+ import { NativeModule, NativeModuleManager } from "../managers/NativeModuleHelper";
2
+ import { NativeModuleCallbackManager } from "../managers/NativeModuleCallbackManager";
3
+ import { NativeModuleResponse } from "../interfaces/NativeModuleResponse";
4
+ import { FontsManagerResponse } from "../types/FontsManagerResponse";
5
+ import { FontModule } from "../interfaces/modules/FontModule";
6
+ export declare class FontModuleImpl extends NativeModule<NativeModuleManager> implements FontModule {
7
+ constructor(nativeModuleCallbackManager: NativeModuleCallbackManager);
8
+ downloadFont(fontFamily: string, url: string): Promise<NativeModuleResponse<FontsManagerResponse>>;
9
+ }
@@ -0,0 +1,32 @@
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 FontModuleImpl = /** @class */ (function (_super) {
15
+ __extends(FontModuleImpl, _super);
16
+ function FontModuleImpl(nativeModuleCallbackManager) {
17
+ return _super.call(this, NativeModuleHelper_1.NativeModuleHelper.getCurrentNativeModuleProvider().FontModule, nativeModuleCallbackManager) || this;
18
+ }
19
+ FontModuleImpl.prototype.downloadFont = function (fontFamily, url) {
20
+ var _this = this;
21
+ return this.nativeModuleCallbackManager.executeOnBridge(function (requestId) {
22
+ _this.postMessage({
23
+ methodName: "downloadFont",
24
+ requestId: requestId,
25
+ fontFamily: fontFamily,
26
+ url: url
27
+ });
28
+ });
29
+ };
30
+ return FontModuleImpl;
31
+ }(NativeModuleHelper_1.NativeModule));
32
+ exports.FontModuleImpl = FontModuleImpl;
@@ -0,0 +1,11 @@
1
+ import { NativeModuleResponse } from "../interfaces/NativeModuleResponse";
2
+ import { NativeModule, NativeModuleManager } from "../managers/NativeModuleHelper";
3
+ import { NativeModuleCallbackManager } from "../managers/NativeModuleCallbackManager";
4
+ import { LocationModule } from "../interfaces/modules/LocationModule";
5
+ import { LocationManagerResponse } from "../types/LocationManagerResponse";
6
+ import { DeviceInfoResponse } from "../types/DeviceInfoResponse";
7
+ export declare class LocationModuleImpl extends NativeModule<NativeModuleManager> implements LocationModule {
8
+ constructor(nativeModuleCallbackManager: NativeModuleCallbackManager);
9
+ getUserPinCode(clientID: string): Promise<NativeModuleResponse<LocationManagerResponse>>;
10
+ getUserDeviceId(): Promise<NativeModuleResponse<DeviceInfoResponse>>;
11
+ }
@@ -0,0 +1,40 @@
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 LocationModuleImpl = /** @class */ (function (_super) {
15
+ __extends(LocationModuleImpl, _super);
16
+ function LocationModuleImpl(nativeModuleCallbackManager) {
17
+ return _super.call(this, NativeModuleHelper_1.NativeModuleHelper.getCurrentNativeModuleProvider().LocationModule, nativeModuleCallbackManager) || this;
18
+ }
19
+ LocationModuleImpl.prototype.getUserPinCode = function (clientID) {
20
+ var _this = this;
21
+ return this.nativeModuleCallbackManager.executeOnBridge(function (requestId) {
22
+ _this.postMessage({
23
+ methodName: "getUserPinCode",
24
+ requestId: requestId,
25
+ clientID: clientID
26
+ });
27
+ });
28
+ };
29
+ LocationModuleImpl.prototype.getUserDeviceId = function () {
30
+ var _this = this;
31
+ return this.nativeModuleCallbackManager.executeOnBridge(function (requestId) {
32
+ _this.postMessage({
33
+ methodName: "getUserDeviceID",
34
+ requestId: requestId
35
+ });
36
+ });
37
+ };
38
+ return LocationModuleImpl;
39
+ }(NativeModuleHelper_1.NativeModule));
40
+ exports.LocationModuleImpl = LocationModuleImpl;
@@ -1,8 +1,7 @@
1
- import { NavigationModule } from "../interfaces/NavigationModule";
2
- import { NativeModule } from "../managers/modules/NativeModuleManager";
3
- import { NavigationModuleManager } from "../managers/modules/NavigationModuleManager";
1
+ import { NavigationModule } from "../interfaces/modules/NavigationModule";
2
+ import { NativeModule, NativeModuleManager } from "../managers/NativeModuleHelper";
4
3
  import { NativeModuleCallbackManager } from "../managers/NativeModuleCallbackManager";
5
- export declare class NavigationModuleImpl extends NativeModule<NavigationModuleManager> implements NavigationModule {
4
+ export declare class NavigationModuleImpl extends NativeModule<NativeModuleManager> implements NavigationModule {
6
5
  constructor(nativeModuleCallbackManager: NativeModuleCallbackManager);
7
6
  exitSession(): void;
8
7
  exitToHomePage(): void;
@@ -10,32 +10,46 @@ var __extends = (this && this.__extends) || (function () {
10
10
  };
11
11
  })();
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
- var NativeModuleManager_1 = require("../managers/modules/NativeModuleManager");
13
+ var NativeModuleHelper_1 = require("../managers/NativeModuleHelper");
14
14
  var NavigationModuleImpl = /** @class */ (function (_super) {
15
15
  __extends(NavigationModuleImpl, _super);
16
16
  function NavigationModuleImpl(nativeModuleCallbackManager) {
17
- return _super.call(this, NativeModuleManager_1.NativeModuleHelper.getCurrentNativeModuleProvider().NavigationModule, nativeModuleCallbackManager) || this;
17
+ return _super.call(this, NativeModuleHelper_1.NativeModuleHelper.getCurrentNativeModuleProvider().NavigationModule, nativeModuleCallbackManager) || this;
18
18
  }
19
19
  NavigationModuleImpl.prototype.exitSession = function () {
20
- this.nativeModuleManager.exitSession();
20
+ this.postMessage({
21
+ methodName: "exitSession",
22
+ });
21
23
  };
22
24
  NavigationModuleImpl.prototype.exitToHomePage = function () {
23
- this.nativeModuleManager.exitToHomePage();
25
+ this.postMessage({
26
+ methodName: "exitToHomePage",
27
+ });
24
28
  };
25
29
  NavigationModuleImpl.prototype.clearHistory = function () {
26
- if (this.nativeModuleManager.clearHistory) {
27
- this.nativeModuleManager.clearHistory();
28
- }
30
+ this.postMessage({
31
+ methodName: "clearHistory",
32
+ });
29
33
  };
30
34
  NavigationModuleImpl.prototype.startPayment = function (paymentToken) {
31
- this.nativeModuleManager.startPayment(paymentToken);
35
+ this.postMessage({
36
+ methodName: "startPayment",
37
+ paymentToken: paymentToken,
38
+ });
32
39
  };
33
40
  NavigationModuleImpl.prototype.notifyPageLocationChange = function (currentUri, isBackNavigation) {
34
- this.nativeModuleManager.notifyPageLocationChange(currentUri, isBackNavigation);
41
+ this.postMessage({
42
+ methodName: "notifyPageLocationChange",
43
+ currentUri: currentUri,
44
+ isBackNavigation: isBackNavigation,
45
+ });
35
46
  };
36
47
  NavigationModuleImpl.prototype.navigateToFlipkart = function (uri) {
37
- this.nativeModuleManager.navigateToFlipkart(uri);
48
+ this.postMessage({
49
+ methodName: "navigateToFlipkart",
50
+ uri: uri,
51
+ });
38
52
  };
39
53
  return NavigationModuleImpl;
40
- }(NativeModuleManager_1.NativeModule));
54
+ }(NativeModuleHelper_1.NativeModule));
41
55
  exports.NavigationModuleImpl = NavigationModuleImpl;
@@ -1,10 +1,9 @@
1
1
  import { NativeModuleResponse } from "../interfaces/NativeModuleResponse";
2
- import { NativeModule } from "../managers/modules/NativeModuleManager";
3
- import { PermissionsModuleManager, ScopeAccessRequest, Scope } from "../managers/modules/PermissionsModuleManager";
2
+ import { NativeModule, NativeModuleManager } from "../managers/NativeModuleHelper";
4
3
  import { NativeModuleCallbackManager } from "../managers/NativeModuleCallbackManager";
5
4
  import { PermissionsManagerResponse } from "../types/PermissionsManagerResponse";
6
- import { PermissionsModule } from "../interfaces/PermissionsModule";
7
- export declare class PermissionsModuleImpl extends NativeModule<PermissionsModuleManager> implements PermissionsModule {
5
+ import { PermissionsModule, Scope, ScopeAccessRequest } from "../interfaces/modules/PermissionsModule";
6
+ export declare class PermissionsModuleImpl extends NativeModule<NativeModuleManager> implements PermissionsModule {
8
7
  private allScopes;
9
8
  constructor(nativeModuleCallbackManager: NativeModuleCallbackManager);
10
9
  getToken(scopes: ScopeAccessRequest[]): Promise<NativeModuleResponse<PermissionsManagerResponse>>;
@@ -10,28 +10,32 @@ var __extends = (this && this.__extends) || (function () {
10
10
  };
11
11
  })();
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
- var NativeModuleManager_1 = require("../managers/modules/NativeModuleManager");
14
- var PermissionsModuleManager_1 = require("../managers/modules/PermissionsModuleManager");
13
+ var NativeModuleHelper_1 = require("../managers/NativeModuleHelper");
14
+ var PermissionsModule_1 = require("../interfaces/modules/PermissionsModule");
15
15
  var PermissionsModuleImpl = /** @class */ (function (_super) {
16
16
  __extends(PermissionsModuleImpl, _super);
17
17
  function PermissionsModuleImpl(nativeModuleCallbackManager) {
18
- var _this = _super.call(this, NativeModuleManager_1.NativeModuleHelper.getCurrentNativeModuleProvider().PermissionsModule, nativeModuleCallbackManager) || this;
18
+ var _this = _super.call(this, NativeModuleHelper_1.NativeModuleHelper.getCurrentNativeModuleProvider().PermissionsModule, nativeModuleCallbackManager) || this;
19
19
  _this.allScopes = Object.freeze({
20
- USER_NAME: PermissionsModuleManager_1.Scope.USER_NAME,
21
- USER_EMAIL: PermissionsModuleManager_1.Scope.USER_EMAIL,
22
- USER_MOBILE: PermissionsModuleManager_1.Scope.USER_MOBILE,
20
+ USER_NAME: PermissionsModule_1.Scope.USER_NAME,
21
+ USER_EMAIL: PermissionsModule_1.Scope.USER_EMAIL,
22
+ USER_MOBILE: PermissionsModule_1.Scope.USER_MOBILE,
23
23
  });
24
24
  return _this;
25
25
  }
26
26
  PermissionsModuleImpl.prototype.getToken = function (scopes) {
27
27
  var _this = this;
28
28
  return this.nativeModuleCallbackManager.executeOnBridge(function (requestId) {
29
- _this.nativeModuleManager.getToken(requestId, JSON.stringify(scopes));
29
+ _this.postMessage({
30
+ methodName: "getToken",
31
+ requestId: requestId,
32
+ scopes: JSON.stringify(scopes),
33
+ });
30
34
  });
31
35
  };
32
36
  PermissionsModuleImpl.prototype.getScopes = function () {
33
37
  return this.allScopes;
34
38
  };
35
39
  return PermissionsModuleImpl;
36
- }(NativeModuleManager_1.NativeModule));
40
+ }(NativeModuleHelper_1.NativeModule));
37
41
  exports.PermissionsModuleImpl = PermissionsModuleImpl;
@@ -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 { SMSManagerResponse } from "../types/SMSManagerResponse";
5
+ import { SMSModule } from "../interfaces/modules/SMSModule";
6
+ export declare class SMSModuleImpl extends NativeModule<NativeModuleManager> implements SMSModule {
7
+ constructor(nativeModuleCallbackManager: NativeModuleCallbackManager);
8
+ captureMessage(): Promise<NativeModuleResponse<SMSManagerResponse>>;
9
+ }
@@ -0,0 +1,30 @@
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 SMSModuleImpl = /** @class */ (function (_super) {
15
+ __extends(SMSModuleImpl, _super);
16
+ function SMSModuleImpl(nativeModuleCallbackManager) {
17
+ return _super.call(this, NativeModuleHelper_1.NativeModuleHelper.getCurrentNativeModuleProvider().SMSModule, nativeModuleCallbackManager) || this;
18
+ }
19
+ SMSModuleImpl.prototype.captureMessage = function () {
20
+ var _this = this;
21
+ return this.nativeModuleCallbackManager.executeOnBridge(function (requestId) {
22
+ _this.postMessage({
23
+ methodName: "captureMessage",
24
+ requestId: requestId,
25
+ });
26
+ });
27
+ };
28
+ return SMSModuleImpl;
29
+ }(NativeModuleHelper_1.NativeModule));
30
+ exports.SMSModuleImpl = SMSModuleImpl;
@@ -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): Promise<NativeModuleResponse<GenericShareManagerResponse>>;
9
+ }