fk-platform-sdk 1.0.44 → 1.0.46-beta1
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/dist/analytics/Nft.d.ts +8 -4
- package/dist/analytics/Nft.js +8 -4
- package/dist/analytics/interfaces/AnalyticsHelper.d.ts +4 -4
- package/dist/analytics/interfaces/AnalyticsModule.d.ts +2 -0
- package/dist/interfaces/NativeModuleManagerProvider.d.ts +1 -0
- package/dist/interfaces/modules/ErrorHandlerModule.d.ts +10 -0
- package/dist/interfaces/modules/ErrorHandlerModule.js +2 -0
- package/dist/interfaces/modules/PermissionsModule.d.ts +1 -0
- package/dist/managers/ModuleManager.d.ts +2 -0
- package/dist/managers/ModuleManager.js +5 -0
- package/dist/modules/AnalyticsModuleImpl.d.ts +2 -0
- package/dist/modules/AnalyticsModuleImpl.js +20 -0
- package/dist/modules/ErrorHandlerModuleImpl.d.ts +8 -0
- package/dist/modules/ErrorHandlerModuleImpl.js +31 -0
- package/dist/modules/PermissionsModuleImpl.d.ts +1 -0
- package/dist/modules/PermissionsModuleImpl.js +10 -0
- package/dist/setup/SetupHelper.js +8 -8
- package/package.json +1 -1
package/dist/analytics/Nft.d.ts
CHANGED
|
@@ -7,19 +7,22 @@ export declare class PageView implements AnalyticsEvent {
|
|
|
7
7
|
private category;
|
|
8
8
|
private value;
|
|
9
9
|
private label;
|
|
10
|
-
|
|
10
|
+
private session_id;
|
|
11
|
+
constructor(load_time: number, page_name: string, category: string, value: string, label: string, session_id: string);
|
|
11
12
|
getValidator(): EventValidator;
|
|
12
13
|
}
|
|
13
14
|
export declare class Wallet implements AnalyticsEvent {
|
|
14
15
|
type: string;
|
|
15
16
|
private stage;
|
|
16
|
-
|
|
17
|
+
private session_id;
|
|
18
|
+
constructor(stage: string, session_id: string);
|
|
17
19
|
getValidator(): EventValidator;
|
|
18
20
|
}
|
|
19
21
|
export declare class KycProcess implements AnalyticsEvent {
|
|
20
22
|
type: string;
|
|
21
23
|
private step;
|
|
22
|
-
|
|
24
|
+
private session_id;
|
|
25
|
+
constructor(step: string, session_id: string);
|
|
23
26
|
getValidator(): EventValidator;
|
|
24
27
|
}
|
|
25
28
|
export declare class Clicks implements AnalyticsEvent {
|
|
@@ -28,6 +31,7 @@ export declare class Clicks implements AnalyticsEvent {
|
|
|
28
31
|
private category;
|
|
29
32
|
private value;
|
|
30
33
|
private label;
|
|
31
|
-
|
|
34
|
+
private session_id;
|
|
35
|
+
constructor(action: string, category: string, value: string, label: string, session_id: string);
|
|
32
36
|
getValidator(): EventValidator;
|
|
33
37
|
}
|
package/dist/analytics/Nft.js
CHANGED
|
@@ -11,13 +11,14 @@ var decorators_1 = require("./validation/decorators");
|
|
|
11
11
|
var Validator_1 = require("./validation/Validator");
|
|
12
12
|
var metadataMap = {};
|
|
13
13
|
var PageView = /** @class */ (function () {
|
|
14
|
-
function PageView(load_time, page_name, category, value, label) {
|
|
14
|
+
function PageView(load_time, page_name, category, value, label, session_id) {
|
|
15
15
|
this.type = "Nft.PageView";
|
|
16
16
|
this.load_time = load_time;
|
|
17
17
|
this.page_name = page_name;
|
|
18
18
|
this.category = category;
|
|
19
19
|
this.value = value;
|
|
20
20
|
this.label = label;
|
|
21
|
+
this.session_id = session_id;
|
|
21
22
|
}
|
|
22
23
|
PageView.prototype.getValidator = function () {
|
|
23
24
|
var invalidValues = Validator_1.validate(metadataMap, this, "PageView");
|
|
@@ -30,9 +31,10 @@ var PageView = /** @class */ (function () {
|
|
|
30
31
|
}());
|
|
31
32
|
exports.PageView = PageView;
|
|
32
33
|
var Wallet = /** @class */ (function () {
|
|
33
|
-
function Wallet(stage) {
|
|
34
|
+
function Wallet(stage, session_id) {
|
|
34
35
|
this.type = "Nft.Wallet";
|
|
35
36
|
this.stage = stage;
|
|
37
|
+
this.session_id = session_id;
|
|
36
38
|
}
|
|
37
39
|
Wallet.prototype.getValidator = function () {
|
|
38
40
|
var invalidValues = Validator_1.validate(metadataMap, this, "Wallet");
|
|
@@ -45,9 +47,10 @@ var Wallet = /** @class */ (function () {
|
|
|
45
47
|
}());
|
|
46
48
|
exports.Wallet = Wallet;
|
|
47
49
|
var KycProcess = /** @class */ (function () {
|
|
48
|
-
function KycProcess(step) {
|
|
50
|
+
function KycProcess(step, session_id) {
|
|
49
51
|
this.type = "Nft.KycProcess";
|
|
50
52
|
this.step = step;
|
|
53
|
+
this.session_id = session_id;
|
|
51
54
|
}
|
|
52
55
|
KycProcess.prototype.getValidator = function () {
|
|
53
56
|
var invalidValues = Validator_1.validate(metadataMap, this, "KycProcess");
|
|
@@ -60,12 +63,13 @@ var KycProcess = /** @class */ (function () {
|
|
|
60
63
|
}());
|
|
61
64
|
exports.KycProcess = KycProcess;
|
|
62
65
|
var Clicks = /** @class */ (function () {
|
|
63
|
-
function Clicks(action, category, value, label) {
|
|
66
|
+
function Clicks(action, category, value, label, session_id) {
|
|
64
67
|
this.type = "Nft.Clicks";
|
|
65
68
|
this.action = action;
|
|
66
69
|
this.category = category;
|
|
67
70
|
this.value = value;
|
|
68
71
|
this.label = label;
|
|
72
|
+
this.session_id = session_id;
|
|
69
73
|
}
|
|
70
74
|
Clicks.prototype.getValidator = function () {
|
|
71
75
|
var invalidValues = Validator_1.validate(metadataMap, this, "Clicks");
|
|
@@ -48,10 +48,10 @@ export interface TravelAnalyticsHelper {
|
|
|
48
48
|
orderConfirmation: (amountToPay: number, paymentMethod: string) => Travel.OrderConfirmation;
|
|
49
49
|
}
|
|
50
50
|
export interface NFTAnalyticsHelper {
|
|
51
|
-
wallet: (stage: string) => Nft.Wallet;
|
|
52
|
-
kycProcess: (step: string) => Nft.KycProcess;
|
|
53
|
-
pageView: (load_time: number, page_name: string, category: string, value: string, label: string) => Nft.PageView;
|
|
54
|
-
clicks: (action: string, category: string, value: string, label: string) => Nft.Clicks;
|
|
51
|
+
wallet: (stage: string, session_id: string) => Nft.Wallet;
|
|
52
|
+
kycProcess: (step: string, session_id: string) => Nft.KycProcess;
|
|
53
|
+
pageView: (load_time: number, page_name: string, category: string, value: string, label: string, session_id: string) => Nft.PageView;
|
|
54
|
+
clicks: (action: string, category: string, value: string, label: string, session_id: string) => Nft.Clicks;
|
|
55
55
|
}
|
|
56
56
|
export interface HealthcareAnalyticsHelper {
|
|
57
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;
|
|
@@ -2,4 +2,6 @@ import { AnalyticsEvent } from "./AnalyticsEvent";
|
|
|
2
2
|
export interface AnalyticsModule {
|
|
3
3
|
pushEvent: (event: AnalyticsEvent) => void;
|
|
4
4
|
forceFlushEvents: () => void;
|
|
5
|
+
logPerformanceMetrics: (eventInfo: Record<string, any>) => void;
|
|
6
|
+
logPageError: (errorInfo: Record<string, any>) => void;
|
|
5
7
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface ErrorInfoRequest {
|
|
2
|
+
errorTitle: string;
|
|
3
|
+
errorDescription: string;
|
|
4
|
+
errorMessage: string;
|
|
5
|
+
callbackMethod?: string;
|
|
6
|
+
ctaText?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface ErrorHandlerModule {
|
|
9
|
+
openErrorHandlingFlow: (errorInfo: ErrorInfoRequest) => void;
|
|
10
|
+
}
|
|
@@ -9,6 +9,7 @@ import { AppVersionModule } from "../interfaces/modules/AppVersionModule";
|
|
|
9
9
|
import { DownloaderModule } from "../interfaces/modules/DownloaderModule";
|
|
10
10
|
import { FontModule } from "../interfaces/modules/FontModule";
|
|
11
11
|
import { GenericUltraShareModule } from "../interfaces/modules/GenericUltraShareModule";
|
|
12
|
+
import { ErrorHandlerModule } from "../interfaces/modules/ErrorHandlerModule";
|
|
12
13
|
export declare class ModuleManager {
|
|
13
14
|
private moduleMap;
|
|
14
15
|
constructor(nativeModuleCallbackManager: NativeModuleCallbackManager);
|
|
@@ -22,6 +23,7 @@ export declare class ModuleManager {
|
|
|
22
23
|
getDownloaderModule(): DownloaderModule;
|
|
23
24
|
getFontModule(): FontModule;
|
|
24
25
|
getShareModule(): GenericUltraShareModule;
|
|
26
|
+
getErrorHandlerModule(): ErrorHandlerModule;
|
|
25
27
|
private addModule;
|
|
26
28
|
private getModule;
|
|
27
29
|
}
|
|
@@ -22,6 +22,7 @@ var MODULE_NAME;
|
|
|
22
22
|
MODULE_NAME[MODULE_NAME["DOWNLOADER_MODULE"] = 7] = "DOWNLOADER_MODULE";
|
|
23
23
|
MODULE_NAME[MODULE_NAME["FONT_MODULE"] = 8] = "FONT_MODULE";
|
|
24
24
|
MODULE_NAME[MODULE_NAME["SHARE_MODULE"] = 9] = "SHARE_MODULE";
|
|
25
|
+
MODULE_NAME[MODULE_NAME["ERROR_HANDLER_MODULE"] = 10] = "ERROR_HANDLER_MODULE";
|
|
25
26
|
})(MODULE_NAME || (MODULE_NAME = {}));
|
|
26
27
|
var ModuleManager = /** @class */ (function () {
|
|
27
28
|
function ModuleManager(nativeModuleCallbackManager) {
|
|
@@ -36,6 +37,7 @@ var ModuleManager = /** @class */ (function () {
|
|
|
36
37
|
this.addModule(MODULE_NAME.DOWNLOADER_MODULE, new DownloaderModuleImpl_1.DownloaderModuleImpl(nativeModuleCallbackManager));
|
|
37
38
|
this.addModule(MODULE_NAME.FONT_MODULE, new FontModuleImpl_1.FontModuleImpl(nativeModuleCallbackManager));
|
|
38
39
|
this.addModule(MODULE_NAME.SHARE_MODULE, new ShareModuleImpl_1.ShareModuleImpl(nativeModuleCallbackManager));
|
|
40
|
+
this.addModule(MODULE_NAME.ERROR_HANDLER_MODULE, new ShareModuleImpl_1.ShareModuleImpl(nativeModuleCallbackManager));
|
|
39
41
|
}
|
|
40
42
|
ModuleManager.prototype.getNavigationModule = function () {
|
|
41
43
|
return this.getModule(MODULE_NAME.NAVIGATION_MODULE);
|
|
@@ -67,6 +69,9 @@ var ModuleManager = /** @class */ (function () {
|
|
|
67
69
|
ModuleManager.prototype.getShareModule = function () {
|
|
68
70
|
return this.getModule(MODULE_NAME.SHARE_MODULE);
|
|
69
71
|
};
|
|
72
|
+
ModuleManager.prototype.getErrorHandlerModule = function () {
|
|
73
|
+
return this.getModule(MODULE_NAME.ERROR_HANDLER_MODULE);
|
|
74
|
+
};
|
|
70
75
|
ModuleManager.prototype.addModule = function (moduleName, nativeModule) {
|
|
71
76
|
this.moduleMap[moduleName] = nativeModule;
|
|
72
77
|
};
|
|
@@ -6,4 +6,6 @@ export declare class AnalyticsModuleImpl extends NativeModule<NativeModuleManage
|
|
|
6
6
|
constructor(nativeModuleCallbackManager: NativeModuleCallbackManager);
|
|
7
7
|
pushEvent(event: AnalyticsEvent): void;
|
|
8
8
|
forceFlushEvents(): void;
|
|
9
|
+
logPerformanceMetrics(eventInfo: Record<string, any>): void;
|
|
10
|
+
logPageError(errorInfo: Record<string, any>): void;
|
|
9
11
|
}
|
|
@@ -49,6 +49,26 @@ var AnalyticsModuleImpl = /** @class */ (function (_super) {
|
|
|
49
49
|
});
|
|
50
50
|
});
|
|
51
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: 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: errorInfo
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
};
|
|
52
72
|
return AnalyticsModuleImpl;
|
|
53
73
|
}(NativeModuleHelper_1.NativeModule));
|
|
54
74
|
exports.AnalyticsModuleImpl = AnalyticsModuleImpl;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { NativeModule, NativeModuleManager } from "../managers/NativeModuleHelper";
|
|
2
|
+
import { NativeModuleCallbackManager } from "../managers/NativeModuleCallbackManager";
|
|
3
|
+
import { ErrorHandlerModule } from "../interfaces/modules/ErrorHandlerModule";
|
|
4
|
+
import { ErrorInfoRequest } from "../interfaces/modules/ErrorHandlerModule";
|
|
5
|
+
export declare class ErrorHandlerModuleImpl extends NativeModule<NativeModuleManager> implements ErrorHandlerModule {
|
|
6
|
+
constructor(nativeModuleCallbackManager: NativeModuleCallbackManager);
|
|
7
|
+
openErrorHandlingFlow(errorInfo: ErrorInfoRequest): void;
|
|
8
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
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 ErrorHandlerModuleImpl = /** @class */ (function (_super) {
|
|
15
|
+
__extends(ErrorHandlerModuleImpl, _super);
|
|
16
|
+
function ErrorHandlerModuleImpl(nativeModuleCallbackManager) {
|
|
17
|
+
return _super.call(this, NativeModuleHelper_1.NativeModuleHelper.getCurrentNativeModuleProvider().ErrorHandlerModule, nativeModuleCallbackManager) || this;
|
|
18
|
+
}
|
|
19
|
+
ErrorHandlerModuleImpl.prototype.openErrorHandlingFlow = function (errorInfo) {
|
|
20
|
+
var _this = this;
|
|
21
|
+
this.nativeModuleCallbackManager.executeOnBridge(function (requestId) {
|
|
22
|
+
_this.postMessage({
|
|
23
|
+
methodName: "openErrorHandlingFlow",
|
|
24
|
+
requestId: requestId,
|
|
25
|
+
errorInfo: JSON.stringify(errorInfo)
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
return ErrorHandlerModuleImpl;
|
|
30
|
+
}(NativeModuleHelper_1.NativeModule));
|
|
31
|
+
exports.ErrorHandlerModuleImpl = ErrorHandlerModuleImpl;
|
|
@@ -36,6 +36,16 @@ var PermissionsModuleImpl = /** @class */ (function (_super) {
|
|
|
36
36
|
PermissionsModuleImpl.prototype.getScopes = function () {
|
|
37
37
|
return this.allScopes;
|
|
38
38
|
};
|
|
39
|
+
// This is for ultraPlus where only token will be provided to clients
|
|
40
|
+
PermissionsModuleImpl.prototype.getUltraPlusToken = function () {
|
|
41
|
+
var _this = this;
|
|
42
|
+
return this.nativeModuleCallbackManager.executeOnBridge(function (requestId) {
|
|
43
|
+
_this.postMessage({
|
|
44
|
+
methodName: "getUltraPlusToken",
|
|
45
|
+
requestId: requestId
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
};
|
|
39
49
|
return PermissionsModuleImpl;
|
|
40
50
|
}(NativeModuleHelper_1.NativeModule));
|
|
41
51
|
exports.PermissionsModuleImpl = PermissionsModuleImpl;
|
|
@@ -230,17 +230,17 @@ var SetupHelper = /** @class */ (function () {
|
|
|
230
230
|
};
|
|
231
231
|
SetupHelper.getNftObject = function () {
|
|
232
232
|
return {
|
|
233
|
-
wallet: function (stage) {
|
|
234
|
-
return new analytics_1.Nft.Wallet(stage);
|
|
233
|
+
wallet: function (stage, session_id) {
|
|
234
|
+
return new analytics_1.Nft.Wallet(stage, session_id);
|
|
235
235
|
},
|
|
236
|
-
pageView: function (load_time, page_name, category, value, label) {
|
|
237
|
-
return new analytics_1.Nft.PageView(load_time, page_name, category, value, label);
|
|
236
|
+
pageView: function (load_time, page_name, category, value, label, session_id) {
|
|
237
|
+
return new analytics_1.Nft.PageView(load_time, page_name, category, value, label, session_id);
|
|
238
238
|
},
|
|
239
|
-
kycProcess: function (step) {
|
|
240
|
-
return new analytics_1.Nft.KycProcess(step);
|
|
239
|
+
kycProcess: function (step, session_id) {
|
|
240
|
+
return new analytics_1.Nft.KycProcess(step, session_id);
|
|
241
241
|
},
|
|
242
|
-
clicks: function (action, category, value, label) {
|
|
243
|
-
return new analytics_1.Nft.Clicks(action, category, value, label);
|
|
242
|
+
clicks: function (action, category, value, label, session_id) {
|
|
243
|
+
return new analytics_1.Nft.Clicks(action, category, value, label, session_id);
|
|
244
244
|
}
|
|
245
245
|
};
|
|
246
246
|
};
|