fk-platform-sdk 1.1.0-beta.2 → 1.1.0-beta.5

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.
@@ -50,6 +50,7 @@ export declare class OrderConfirmation implements AnalyticsEvent {
50
50
  export declare class PageViewEvent implements AnalyticsEvent {
51
51
  type: string;
52
52
  private readonly en;
53
+ private readonly _ev;
53
54
  private t;
54
55
  private ib;
55
56
  private rt?;
@@ -60,3 +61,46 @@ export declare class PageViewEvent implements AnalyticsEvent {
60
61
  constructor(isBack: boolean, timestamp: number, responseType?: string, hyperlocalEligible?: boolean, pageMetaInfo?: PageMetaInfo, vertical?: string, category?: string);
61
62
  getValidator(): EventValidator;
62
63
  }
64
+ export interface TravelBookingEventParams {
65
+ timestamp: number;
66
+ revenue: number;
67
+ isInternational: boolean;
68
+ bookingId: string;
69
+ dateDeparture: string;
70
+ destinationCity: string;
71
+ originCity: string;
72
+ diffToDepartureDate?: number;
73
+ couponName?: string;
74
+ discount?: number;
75
+ tripFlag?: string;
76
+ journeyType?: string;
77
+ lengthOfStay?: number;
78
+ paymentMethod?: string;
79
+ bookingType?: string;
80
+ operator?: string;
81
+ segments?: string;
82
+ }
83
+ export declare class TravelBookingEvent implements AnalyticsEvent {
84
+ type: string;
85
+ private readonly en;
86
+ private readonly _ev;
87
+ private t;
88
+ private r;
89
+ private iit;
90
+ private bid;
91
+ private dtdd?;
92
+ private dd;
93
+ private dc;
94
+ private oc;
95
+ private cn?;
96
+ private d?;
97
+ private tf?;
98
+ private jt?;
99
+ private los?;
100
+ private pm?;
101
+ private bt?;
102
+ private o?;
103
+ private seg?;
104
+ constructor(params: TravelBookingEventParams);
105
+ getValidator(): EventValidator;
106
+ }
@@ -128,6 +128,7 @@ var PageViewEvent = /** @class */ (function () {
128
128
  function PageViewEvent(isBack, timestamp, responseType, hyperlocalEligible, pageMetaInfo, vertical, category) {
129
129
  this.type = "Travel.PageViewEvent";
130
130
  this.en = "PV";
131
+ this._ev = "3.9";
131
132
  this.t = timestamp;
132
133
  this.ib = isBack;
133
134
  this.rt = responseType;
@@ -146,3 +147,57 @@ var PageViewEvent = /** @class */ (function () {
146
147
  return PageViewEvent;
147
148
  }());
148
149
  exports.PageViewEvent = PageViewEvent;
150
+ var TravelBookingEvent = /** @class */ (function () {
151
+ function TravelBookingEvent(params) {
152
+ this.type = "Travel.TravelBookingEvent";
153
+ this.en = "TOC";
154
+ this._ev = "1.0";
155
+ this.t = params.timestamp;
156
+ this.r = params.revenue;
157
+ this.iit = params.isInternational;
158
+ this.bid = params.bookingId;
159
+ this.dtdd = params.diffToDepartureDate;
160
+ this.dd = params.dateDeparture;
161
+ this.dc = params.destinationCity;
162
+ this.oc = params.originCity;
163
+ this.cn = params.couponName;
164
+ this.d = params.discount;
165
+ this.tf = params.tripFlag;
166
+ this.jt = params.journeyType;
167
+ this.los = params.lengthOfStay;
168
+ this.pm = params.paymentMethod;
169
+ this.bt = params.bookingType;
170
+ this.o = params.operator;
171
+ this.seg = params.segments;
172
+ }
173
+ TravelBookingEvent.prototype.getValidator = function () {
174
+ var invalidValues = Validator_1.validate(metadataMap, this, "TravelBookingEvent");
175
+ return new EventValidator_1.EventValidator(invalidValues);
176
+ };
177
+ __decorate([
178
+ decorators_1.Positive(metadataMap, "TravelBookingEvent")
179
+ ], TravelBookingEvent.prototype, "t", void 0);
180
+ __decorate([
181
+ decorators_1.NonNegative(metadataMap, "TravelBookingEvent")
182
+ ], TravelBookingEvent.prototype, "r", void 0);
183
+ __decorate([
184
+ decorators_1.NonNull(metadataMap, "TravelBookingEvent")
185
+ ], TravelBookingEvent.prototype, "iit", void 0);
186
+ __decorate([
187
+ decorators_1.NonEmpty(metadataMap, "TravelBookingEvent")
188
+ ], TravelBookingEvent.prototype, "bid", void 0);
189
+ __decorate([
190
+ decorators_1.NonEmpty(metadataMap, "TravelBookingEvent")
191
+ ], TravelBookingEvent.prototype, "dd", void 0);
192
+ __decorate([
193
+ decorators_1.NonEmpty(metadataMap, "TravelBookingEvent")
194
+ ], TravelBookingEvent.prototype, "dc", void 0);
195
+ __decorate([
196
+ decorators_1.NonEmpty(metadataMap, "TravelBookingEvent")
197
+ ], TravelBookingEvent.prototype, "oc", void 0);
198
+ __decorate([
199
+ decorators_1.NonNegative(metadataMap, "TravelBookingEvent")
200
+ ], TravelBookingEvent.prototype, "d", void 0);
201
+ return TravelBookingEvent;
202
+ }());
203
+ exports.TravelBookingEvent = TravelBookingEvent;
@@ -1,5 +1,5 @@
1
1
  import { Bill, Cab, FoodDelivery, Recharge, Ticket, Travel, Healthcare, Nft } from "../";
2
- import { PageMetaInfo } from "../Travel";
2
+ import { PageMetaInfo, TravelBookingEventParams } from "../Travel";
3
3
  import { FoodDish } from "../FoodDish";
4
4
  import { Person } from "../Person";
5
5
  export interface AnalyticsHelper {
@@ -48,6 +48,7 @@ export interface TravelAnalyticsHelper {
48
48
  customerDetails: (email: string, phoneNumber: string, travellers: Person[]) => Travel.CustomerDetails;
49
49
  orderConfirmation: (amountToPay: number, paymentMethod: string) => Travel.OrderConfirmation;
50
50
  pageView: (isBack: boolean, timestamp: number, responseType?: string, hyperlocalEligible?: boolean, pageMetaInfo?: PageMetaInfo, vertical?: string, category?: string) => Travel.PageViewEvent;
51
+ travelBookingEvent: (params: TravelBookingEventParams) => Travel.TravelBookingEvent;
51
52
  }
52
53
  export interface NFTAnalyticsHelper {
53
54
  wallet: (stage: string, session_id: string) => Nft.Wallet;
@@ -17,6 +17,7 @@ export interface PartialNavigationContext {
17
17
  prevPageName?: string;
18
18
  prevPageType?: string;
19
19
  findingMethod?: string;
20
+ marketplace?: string;
20
21
  }
21
22
  export interface AnalyticsModule {
22
23
  pushEvent: (event: AnalyticsEvent) => void;
@@ -9,6 +9,15 @@ var __extends = (this && this.__extends) || (function () {
9
9
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
10
10
  };
11
11
  })();
12
+ var __rest = (this && this.__rest) || function (s, e) {
13
+ var t = {};
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
+ t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
18
+ t[p[i]] = s[p[i]];
19
+ return t;
20
+ };
12
21
  Object.defineProperty(exports, "__esModule", { value: true });
13
22
  var NativeModuleHelper_1 = require("../managers/NativeModuleHelper");
14
23
  var AnalyticsModuleImpl = /** @class */ (function (_super) {
@@ -72,12 +81,12 @@ var AnalyticsModuleImpl = /** @class */ (function (_super) {
72
81
  AnalyticsModuleImpl.prototype.ultraTrackEvent = function (event, partialNavigationContext, trackImmediately) {
73
82
  var _this = this;
74
83
  this.nativeModuleCallbackManager.executeOnBridge(function (requestId) {
75
- var type = event.type;
84
+ var type = event.type, eventData = __rest(event, ["type"]);
76
85
  var eventValidator = event.getValidator();
77
86
  if (eventValidator.isValid()) {
78
87
  _this.postMessage({
79
88
  methodName: "ultraTrackEvent",
80
- event: JSON.stringify(event),
89
+ event: JSON.stringify(eventData),
81
90
  partialNavigationContext: partialNavigationContext ? JSON.stringify(partialNavigationContext) : null,
82
91
  trackImmediately: trackImmediately || false,
83
92
  });
@@ -149,6 +149,9 @@ var SetupHelper = /** @class */ (function () {
149
149
  pageView: function (isBack, timestamp, responseType, hyperlocalEligible, pageMetaInfo, vertical, category) {
150
150
  return new analytics_1.Travel.PageViewEvent(isBack, timestamp, responseType, hyperlocalEligible, pageMetaInfo, vertical, category);
151
151
  },
152
+ travelBookingEvent: function (params) {
153
+ return new analytics_1.Travel.TravelBookingEvent(params);
154
+ },
152
155
  };
153
156
  };
154
157
  SetupHelper.getBillObject = function () {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fk-platform-sdk",
3
- "version": "1.1.0-beta.2",
3
+ "version": "1.1.0-beta.5",
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",