@gofynd/fdk-store-gql 3.0.75 → 3.0.76

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 (82) hide show
  1. package/github_app_jwt.txt +1 -1
  2. package/lib/graphql/mutations/applyCoupon.handler.d.ts +1 -1
  3. package/lib/graphql/mutations/applyCoupon.handler.js +1 -3
  4. package/lib/graphql/mutations/applyCoupon.handler.js.map +1 -1
  5. package/lib/graphql/mutations/getCartShareLink.handler.d.ts +1 -1
  6. package/lib/graphql/mutations/getCartShareLink.handler.js +1 -3
  7. package/lib/graphql/mutations/getCartShareLink.handler.js.map +1 -1
  8. package/lib/graphql/mutations/index.js +2 -20
  9. package/lib/graphql/mutations/index.js.map +1 -1
  10. package/lib/graphql/mutations/removeCoupon.handler.d.ts +1 -1
  11. package/lib/graphql/mutations/removeCoupon.handler.js +1 -3
  12. package/lib/graphql/mutations/removeCoupon.handler.js.map +1 -1
  13. package/lib/graphql/mutations/updateAddress.handler.d.ts +1 -1
  14. package/lib/graphql/mutations/updateAddress.handler.js +1 -3
  15. package/lib/graphql/mutations/updateAddress.handler.js.map +1 -1
  16. package/lib/graphql/mutations/updateShipmentStatus.handler.d.ts +5 -0
  17. package/lib/graphql/mutations/updateShipmentStatus.handler.js +11 -0
  18. package/lib/graphql/mutations/updateShipmentStatus.handler.js.map +1 -0
  19. package/lib/graphql/query/applicationContent.handler.d.ts +1 -1
  20. package/lib/graphql/query/applicationContent.handler.js +2 -4
  21. package/lib/graphql/query/applicationContent.handler.js.map +1 -1
  22. package/lib/graphql/query/brands.handler.d.ts +1 -1
  23. package/lib/graphql/query/brands.handler.js +2 -3
  24. package/lib/graphql/query/brands.handler.js.map +1 -1
  25. package/lib/graphql/query/collections.handler.d.ts +1 -1
  26. package/lib/graphql/query/collections.handler.js +1 -3
  27. package/lib/graphql/query/collections.handler.js.map +1 -1
  28. package/lib/graphql/query/coupons.handler.d.ts +1 -1
  29. package/lib/graphql/query/coupons.handler.js +1 -3
  30. package/lib/graphql/query/coupons.handler.js.map +1 -1
  31. package/lib/graphql/query/faqsByCategory.handler.d.ts +1 -1
  32. package/lib/graphql/query/faqsByCategory.handler.js +1 -3
  33. package/lib/graphql/query/faqsByCategory.handler.js.map +1 -1
  34. package/lib/graphql/query/followedListing.handler.d.ts +1 -1
  35. package/lib/graphql/query/followedListing.handler.js +1 -3
  36. package/lib/graphql/query/followedListing.handler.js.map +1 -1
  37. package/lib/graphql/query/index.js +0 -4
  38. package/lib/graphql/query/index.js.map +1 -1
  39. package/lib/graphql/query/order.handler.js +1 -1
  40. package/lib/graphql/query/order.handler.js.map +1 -1
  41. package/lib/helpers/FPI-events.js +62 -437
  42. package/lib/helpers/FPI-events.js.map +1 -1
  43. package/lib/store/index.d.ts +0 -1
  44. package/lib/store/index.js +7 -6
  45. package/lib/store/index.js.map +1 -1
  46. package/package.json +1 -1
  47. package/lib/graphql/mutations/addAddress.handler.d.ts +0 -3
  48. package/lib/graphql/mutations/addAddress.handler.js +0 -7
  49. package/lib/graphql/mutations/addAddress.handler.js.map +0 -1
  50. package/lib/graphql/mutations/createTicket.handler.d.ts +0 -3
  51. package/lib/graphql/mutations/createTicket.handler.js +0 -9
  52. package/lib/graphql/mutations/createTicket.handler.js.map +0 -1
  53. package/lib/graphql/mutations/forgotPassword.handler.d.ts +0 -3
  54. package/lib/graphql/mutations/forgotPassword.handler.js +0 -7
  55. package/lib/graphql/mutations/forgotPassword.handler.js.map +0 -1
  56. package/lib/graphql/mutations/registerWithForm.handler.d.ts +0 -3
  57. package/lib/graphql/mutations/registerWithForm.handler.js +0 -7
  58. package/lib/graphql/mutations/registerWithForm.handler.js.map +0 -1
  59. package/lib/graphql/mutations/removeAddress.handler.d.ts +0 -3
  60. package/lib/graphql/mutations/removeAddress.handler.js +0 -7
  61. package/lib/graphql/mutations/removeAddress.handler.js.map +0 -1
  62. package/lib/graphql/mutations/sendOTPOnEmail.handler.d.ts +0 -3
  63. package/lib/graphql/mutations/sendOTPOnEmail.handler.js +0 -11
  64. package/lib/graphql/mutations/sendOTPOnEmail.handler.js.map +0 -1
  65. package/lib/graphql/mutations/sendOTPOnMobile.handler.d.ts +0 -3
  66. package/lib/graphql/mutations/sendOTPOnMobile.handler.js +0 -11
  67. package/lib/graphql/mutations/sendOTPOnMobile.handler.js.map +0 -1
  68. package/lib/graphql/mutations/sendResetPasswordEmail.handler.d.ts +0 -3
  69. package/lib/graphql/mutations/sendResetPasswordEmail.handler.js +0 -7
  70. package/lib/graphql/mutations/sendResetPasswordEmail.handler.js.map +0 -1
  71. package/lib/graphql/mutations/sendResetPasswordMobile.handler.d.ts +0 -3
  72. package/lib/graphql/mutations/sendResetPasswordMobile.handler.js +0 -7
  73. package/lib/graphql/mutations/sendResetPasswordMobile.handler.js.map +0 -1
  74. package/lib/graphql/mutations/submitCustomForm.handler.d.ts +0 -3
  75. package/lib/graphql/mutations/submitCustomForm.handler.js +0 -7
  76. package/lib/graphql/mutations/submitCustomForm.handler.js.map +0 -1
  77. package/lib/graphql/query/productComparison.handler.d.ts +0 -3
  78. package/lib/graphql/query/productComparison.handler.js +0 -7
  79. package/lib/graphql/query/productComparison.handler.js.map +0 -1
  80. package/lib/graphql/query/promotions.handler.d.ts +0 -3
  81. package/lib/graphql/query/promotions.handler.js +0 -7
  82. package/lib/graphql/query/promotions.handler.js.map +0 -1
@@ -29,70 +29,6 @@ export const FPI_EVENTS = {
29
29
  };
30
30
  },
31
31
  },
32
- USER_REGISTER: {
33
- eventName: "user.register",
34
- payloadCreator: (result, param) => {
35
- var _a, _b;
36
- const formInput = param === null || param === void 0 ? void 0 : param.formRegisterRequestSchemaInput;
37
- return {
38
- email: (result === null || result === void 0 ? void 0 : result.email) || (formInput === null || formInput === void 0 ? void 0 : formInput.email),
39
- phone: {
40
- country_code: (result === null || result === void 0 ? void 0 : result.country_code) || ((_a = formInput === null || formInput === void 0 ? void 0 : formInput.phone) === null || _a === void 0 ? void 0 : _a.country_code),
41
- number: (result === null || result === void 0 ? void 0 : result.mobile) || ((_b = formInput === null || formInput === void 0 ? void 0 : formInput.phone) === null || _b === void 0 ? void 0 : _b.mobile),
42
- },
43
- has_password: (formInput === null || formInput === void 0 ? void 0 : formInput.password) ? true : false,
44
- first_name: formInput === null || formInput === void 0 ? void 0 : formInput.first_name,
45
- last_name: formInput === null || formInput === void 0 ? void 0 : formInput.last_name,
46
- gender: formInput === null || formInput === void 0 ? void 0 : formInput.gender,
47
- };
48
- },
49
- },
50
- USER_PASSWORD_RESET_REQUEST: {
51
- eventName: "user_password_reset.request",
52
- payloadCreator: (result, param) => {
53
- const emailInput = param === null || param === void 0 ? void 0 : param.sendResetPasswordEmailRequestSchemaInput;
54
- const mobileInput = param === null || param === void 0 ? void 0 : param.sendResetPasswordMobileRequestSchemaInput;
55
- // Determine method based on which input is present
56
- const method = emailInput ? 'email' : 'mobile';
57
- return Object.assign(Object.assign({ reset_method: method }, (emailInput ? {
58
- email: emailInput === null || emailInput === void 0 ? void 0 : emailInput.email,
59
- } : {})), (mobileInput ? {
60
- phone: {
61
- country_code: mobileInput === null || mobileInput === void 0 ? void 0 : mobileInput.country_code,
62
- number: mobileInput === null || mobileInput === void 0 ? void 0 : mobileInput.mobile,
63
- },
64
- } : {}));
65
- },
66
- },
67
- USER_PASSWORD_RESET_SUCCESS: {
68
- eventName: "user_password_reset.success",
69
- payloadCreator: (result) => {
70
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
71
- const primaryEmail = ((_c = (_b = (_a = result === null || result === void 0 ? void 0 : result.user) === null || _a === void 0 ? void 0 : _a.emails) === null || _b === void 0 ? void 0 : _b.find((e) => e === null || e === void 0 ? void 0 : e.primary)) === null || _c === void 0 ? void 0 : _c.email) || ((_f = (_e = (_d = result === null || result === void 0 ? void 0 : result.user) === null || _d === void 0 ? void 0 : _d.emails) === null || _e === void 0 ? void 0 : _e[0]) === null || _f === void 0 ? void 0 : _f.email);
72
- const primaryPhone = ((_h = (_g = result === null || result === void 0 ? void 0 : result.user) === null || _g === void 0 ? void 0 : _g.phone_numbers) === null || _h === void 0 ? void 0 : _h.find((p) => p === null || p === void 0 ? void 0 : p.primary)) || ((_k = (_j = result === null || result === void 0 ? void 0 : result.user) === null || _j === void 0 ? void 0 : _j.phone_numbers) === null || _k === void 0 ? void 0 : _k[0]);
73
- return Object.assign(Object.assign({ user_id: (_l = result === null || result === void 0 ? void 0 : result.user) === null || _l === void 0 ? void 0 : _l.user_id }, (primaryEmail ? { email: primaryEmail } : {})), (primaryPhone ? {
74
- phone: {
75
- country_code: primaryPhone === null || primaryPhone === void 0 ? void 0 : primaryPhone.country_code,
76
- number: primaryPhone === null || primaryPhone === void 0 ? void 0 : primaryPhone.phone,
77
- },
78
- } : {}));
79
- },
80
- },
81
- USER_RESEND_OTP: {
82
- eventName: "user.resend_otp",
83
- payloadCreator: (result, param) => {
84
- const emailInput = param === null || param === void 0 ? void 0 : param.sendEmailOtpRequestSchemaInput;
85
- const mobileInput = param === null || param === void 0 ? void 0 : param.sendMobileOtpRequestSchemaInput;
86
- return Object.assign(Object.assign({}, (emailInput ? {
87
- email: emailInput === null || emailInput === void 0 ? void 0 : emailInput.email
88
- } : {})), (mobileInput ? {
89
- phone: {
90
- country_code: (result === null || result === void 0 ? void 0 : result.country_code) || (mobileInput === null || mobileInput === void 0 ? void 0 : mobileInput.country_code),
91
- number: (result === null || result === void 0 ? void 0 : result.mobile) || (mobileInput === null || mobileInput === void 0 ? void 0 : mobileInput.mobile),
92
- },
93
- } : {}));
94
- },
95
- },
96
32
  PROFILE_UPDATE: {
97
33
  eventName: "user.update",
98
34
  payloadCreator: (result, param, store, oldStore) => {
@@ -105,126 +41,6 @@ export const FPI_EVENTS = {
105
41
  };
106
42
  },
107
43
  },
108
- ADDRESS_ADD: {
109
- eventName: "address.add",
110
- payloadCreator: (result, param) => {
111
- var _a, _b;
112
- const address2Input = param === null || param === void 0 ? void 0 : param.address2Input;
113
- return {
114
- address_id: result === null || result === void 0 ? void 0 : result.id,
115
- address_type: address2Input === null || address2Input === void 0 ? void 0 : address2Input.address_type,
116
- tags: address2Input === null || address2Input === void 0 ? void 0 : address2Input.tags,
117
- is_active: address2Input === null || address2Input === void 0 ? void 0 : address2Input.is_active,
118
- is_default_address: address2Input === null || address2Input === void 0 ? void 0 : address2Input.is_default_address,
119
- name: address2Input === null || address2Input === void 0 ? void 0 : address2Input.name,
120
- phone: {
121
- country_phone_code: address2Input === null || address2Input === void 0 ? void 0 : address2Input.country_phone_code,
122
- number: address2Input === null || address2Input === void 0 ? void 0 : address2Input.phone,
123
- },
124
- email: address2Input === null || address2Input === void 0 ? void 0 : address2Input.email,
125
- address: address2Input === null || address2Input === void 0 ? void 0 : address2Input.address,
126
- landmark: address2Input === null || address2Input === void 0 ? void 0 : address2Input.landmark,
127
- sector: address2Input === null || address2Input === void 0 ? void 0 : address2Input.sector,
128
- area: address2Input === null || address2Input === void 0 ? void 0 : address2Input.area,
129
- area_code: address2Input === null || address2Input === void 0 ? void 0 : address2Input.area_code,
130
- area_code_slug: address2Input === null || address2Input === void 0 ? void 0 : address2Input.area_code_slug,
131
- city: address2Input === null || address2Input === void 0 ? void 0 : address2Input.city,
132
- state: address2Input === null || address2Input === void 0 ? void 0 : address2Input.state,
133
- state_code: address2Input === null || address2Input === void 0 ? void 0 : address2Input.state_code,
134
- country: address2Input === null || address2Input === void 0 ? void 0 : address2Input.country,
135
- country_code: address2Input === null || address2Input === void 0 ? void 0 : address2Input.country_code,
136
- country_iso_code: address2Input === null || address2Input === void 0 ? void 0 : address2Input.country_iso_code,
137
- geo_location: {
138
- latitude: (_a = address2Input === null || address2Input === void 0 ? void 0 : address2Input.geo_location) === null || _a === void 0 ? void 0 : _a.latitude,
139
- longitude: (_b = address2Input === null || address2Input === void 0 ? void 0 : address2Input.geo_location) === null || _b === void 0 ? void 0 : _b.longitude,
140
- },
141
- google_map_point: address2Input === null || address2Input === void 0 ? void 0 : address2Input.google_map_point,
142
- custom_json: address2Input === null || address2Input === void 0 ? void 0 : address2Input._custom_json,
143
- meta: address2Input === null || address2Input === void 0 ? void 0 : address2Input.meta,
144
- };
145
- },
146
- },
147
- ADDRESS_UPDATE: {
148
- eventName: "address.update",
149
- payloadCreator: (result, param) => {
150
- var _a, _b;
151
- const address2Input = param === null || param === void 0 ? void 0 : param.address2Input;
152
- return {
153
- address_id: result === null || result === void 0 ? void 0 : result.id,
154
- address_type: address2Input === null || address2Input === void 0 ? void 0 : address2Input.address_type,
155
- tags: address2Input === null || address2Input === void 0 ? void 0 : address2Input.tags,
156
- is_active: address2Input === null || address2Input === void 0 ? void 0 : address2Input.is_active,
157
- is_default_address: address2Input === null || address2Input === void 0 ? void 0 : address2Input.is_default_address,
158
- name: address2Input === null || address2Input === void 0 ? void 0 : address2Input.name,
159
- phone: {
160
- country_phone_code: address2Input === null || address2Input === void 0 ? void 0 : address2Input.country_phone_code,
161
- number: address2Input === null || address2Input === void 0 ? void 0 : address2Input.phone,
162
- },
163
- email: address2Input === null || address2Input === void 0 ? void 0 : address2Input.email,
164
- address: address2Input === null || address2Input === void 0 ? void 0 : address2Input.address,
165
- landmark: address2Input === null || address2Input === void 0 ? void 0 : address2Input.landmark,
166
- sector: address2Input === null || address2Input === void 0 ? void 0 : address2Input.sector,
167
- area: address2Input === null || address2Input === void 0 ? void 0 : address2Input.area,
168
- area_code: address2Input === null || address2Input === void 0 ? void 0 : address2Input.area_code,
169
- area_code_slug: address2Input === null || address2Input === void 0 ? void 0 : address2Input.area_code_slug,
170
- city: address2Input === null || address2Input === void 0 ? void 0 : address2Input.city,
171
- state: address2Input === null || address2Input === void 0 ? void 0 : address2Input.state,
172
- state_code: address2Input === null || address2Input === void 0 ? void 0 : address2Input.state_code,
173
- country: address2Input === null || address2Input === void 0 ? void 0 : address2Input.country,
174
- country_code: address2Input === null || address2Input === void 0 ? void 0 : address2Input.country_code,
175
- country_iso_code: address2Input === null || address2Input === void 0 ? void 0 : address2Input.country_iso_code,
176
- geo_location: {
177
- latitude: (_a = address2Input === null || address2Input === void 0 ? void 0 : address2Input.geo_location) === null || _a === void 0 ? void 0 : _a.latitude,
178
- longitude: (_b = address2Input === null || address2Input === void 0 ? void 0 : address2Input.geo_location) === null || _b === void 0 ? void 0 : _b.longitude,
179
- },
180
- google_map_point: address2Input === null || address2Input === void 0 ? void 0 : address2Input.google_map_point,
181
- custom_json: address2Input === null || address2Input === void 0 ? void 0 : address2Input._custom_json,
182
- meta: address2Input === null || address2Input === void 0 ? void 0 : address2Input.meta,
183
- };
184
- },
185
- },
186
- ADDRESS_REMOVE: {
187
- eventName: "address.remove",
188
- payloadCreator: (result, param, store) => {
189
- var _a, _b, _c, _d;
190
- const addressId = (result === null || result === void 0 ? void 0 : result.id) || (param === null || param === void 0 ? void 0 : param.id);
191
- // Find address from store using ID
192
- const addressList = ((_b = (_a = store === null || store === void 0 ? void 0 : store.address) === null || _a === void 0 ? void 0 : _a.address) === null || _b === void 0 ? void 0 : _b.address) || [];
193
- const addressDetails = addressList.find((addr) => (addr === null || addr === void 0 ? void 0 : addr.id) === addressId);
194
- return {
195
- address_id: addressId,
196
- address_type: addressDetails === null || addressDetails === void 0 ? void 0 : addressDetails.address_type,
197
- tags: addressDetails === null || addressDetails === void 0 ? void 0 : addressDetails.tags,
198
- is_active: addressDetails === null || addressDetails === void 0 ? void 0 : addressDetails.is_active,
199
- is_default_address: addressDetails === null || addressDetails === void 0 ? void 0 : addressDetails.is_default_address,
200
- name: addressDetails === null || addressDetails === void 0 ? void 0 : addressDetails.name,
201
- phone: {
202
- country_phone_code: addressDetails === null || addressDetails === void 0 ? void 0 : addressDetails.country_phone_code,
203
- number: addressDetails === null || addressDetails === void 0 ? void 0 : addressDetails.phone,
204
- },
205
- email: addressDetails === null || addressDetails === void 0 ? void 0 : addressDetails.email,
206
- address: addressDetails === null || addressDetails === void 0 ? void 0 : addressDetails.address,
207
- landmark: addressDetails === null || addressDetails === void 0 ? void 0 : addressDetails.landmark,
208
- sector: addressDetails === null || addressDetails === void 0 ? void 0 : addressDetails.sector,
209
- area: addressDetails === null || addressDetails === void 0 ? void 0 : addressDetails.area,
210
- area_code: addressDetails === null || addressDetails === void 0 ? void 0 : addressDetails.area_code,
211
- area_code_slug: addressDetails === null || addressDetails === void 0 ? void 0 : addressDetails.area_code_slug,
212
- city: addressDetails === null || addressDetails === void 0 ? void 0 : addressDetails.city,
213
- state: addressDetails === null || addressDetails === void 0 ? void 0 : addressDetails.state,
214
- state_code: addressDetails === null || addressDetails === void 0 ? void 0 : addressDetails.state_code,
215
- country: addressDetails === null || addressDetails === void 0 ? void 0 : addressDetails.country,
216
- country_code: addressDetails === null || addressDetails === void 0 ? void 0 : addressDetails.country_code,
217
- country_iso_code: addressDetails === null || addressDetails === void 0 ? void 0 : addressDetails.country_iso_code,
218
- geo_location: {
219
- latitude: (_c = addressDetails === null || addressDetails === void 0 ? void 0 : addressDetails.geo_location) === null || _c === void 0 ? void 0 : _c.latitude,
220
- longitude: (_d = addressDetails === null || addressDetails === void 0 ? void 0 : addressDetails.geo_location) === null || _d === void 0 ? void 0 : _d.longitude,
221
- },
222
- google_map_point: addressDetails === null || addressDetails === void 0 ? void 0 : addressDetails.google_map_point,
223
- custom_json: addressDetails === null || addressDetails === void 0 ? void 0 : addressDetails._custom_json,
224
- meta: addressDetails === null || addressDetails === void 0 ? void 0 : addressDetails.meta,
225
- };
226
- },
227
- },
228
44
  PRODUCT_LIST_VIEW: {
229
45
  eventName: "product_list.view",
230
46
  payloadCreator: (result, param, store) => {
@@ -236,25 +52,6 @@ export const FPI_EVENTS = {
236
52
  };
237
53
  },
238
54
  },
239
- COLLECTIONS_VIEW: {
240
- eventName: "collections.view",
241
- payloadCreator: (result) => {
242
- var _a, _b, _c;
243
- const collections = ((_a = result === null || result === void 0 ? void 0 : result.items) === null || _a === void 0 ? void 0 : _a.map((collection, index) => ({
244
- id: collection === null || collection === void 0 ? void 0 : collection.uid,
245
- name: collection === null || collection === void 0 ? void 0 : collection.name,
246
- slug: collection === null || collection === void 0 ? void 0 : collection.slug,
247
- priority: collection === null || collection === void 0 ? void 0 : collection.priority,
248
- type: collection === null || collection === void 0 ? void 0 : collection.type,
249
- position: index + 1,
250
- }))) || [];
251
- return {
252
- collections,
253
- filter_tags: (_b = result === null || result === void 0 ? void 0 : result.filters) === null || _b === void 0 ? void 0 : _b.tags,
254
- filter_types: (_c = result === null || result === void 0 ? void 0 : result.filters) === null || _c === void 0 ? void 0 : _c.type,
255
- };
256
- },
257
- },
258
55
  COLLECTION_LIST_VIEW: {
259
56
  eventName: "collection_list.view",
260
57
  payloadCreator: (result, param, store, oldStore) => {
@@ -264,21 +61,6 @@ export const FPI_EVENTS = {
264
61
  };
265
62
  },
266
63
  },
267
- BRANDS_VIEW: {
268
- eventName: "brands.view",
269
- payloadCreator: (result) => {
270
- var _a;
271
- const brands = ((_a = result === null || result === void 0 ? void 0 : result.items) === null || _a === void 0 ? void 0 : _a.map((brand, index) => ({
272
- id: brand === null || brand === void 0 ? void 0 : brand.uid,
273
- name: brand === null || brand === void 0 ? void 0 : brand.name,
274
- slug: brand === null || brand === void 0 ? void 0 : brand.slug,
275
- position: index + 1,
276
- }))) || [];
277
- return {
278
- brands
279
- };
280
- },
281
- },
282
64
  PRODUCT_LIST_CLICK: {
283
65
  //not getting used
284
66
  eventName: "product_list.click",
@@ -338,34 +120,6 @@ export const FPI_EVENTS = {
338
120
  return store;
339
121
  },
340
122
  },
341
- COMPARE_VIEW: {
342
- eventName: "compare.view",
343
- payloadCreator: (result) => {
344
- var _a;
345
- return {
346
- products_compared: (_a = result === null || result === void 0 ? void 0 : result.items) === null || _a === void 0 ? void 0 : _a.map((item, index) => {
347
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
348
- return ({
349
- product_id: item === null || item === void 0 ? void 0 : item.uid,
350
- position: index + 1,
351
- product_slug: item === null || item === void 0 ? void 0 : item.slug,
352
- product_name: item === null || item === void 0 ? void 0 : item.name,
353
- brand: (_a = item === null || item === void 0 ? void 0 : item.brand) === null || _a === void 0 ? void 0 : _a.name,
354
- marked_price: {
355
- currency: (_c = (_b = item === null || item === void 0 ? void 0 : item.price) === null || _b === void 0 ? void 0 : _b.marked) === null || _c === void 0 ? void 0 : _c.currency_code,
356
- min: (_e = (_d = item === null || item === void 0 ? void 0 : item.price) === null || _d === void 0 ? void 0 : _d.marked) === null || _e === void 0 ? void 0 : _e.min,
357
- max: (_g = (_f = item === null || item === void 0 ? void 0 : item.price) === null || _f === void 0 ? void 0 : _f.marked) === null || _g === void 0 ? void 0 : _g.max,
358
- },
359
- effective_price: {
360
- currency: (_j = (_h = item === null || item === void 0 ? void 0 : item.price) === null || _h === void 0 ? void 0 : _h.effective) === null || _j === void 0 ? void 0 : _j.currency_code,
361
- min: (_l = (_k = item === null || item === void 0 ? void 0 : item.price) === null || _k === void 0 ? void 0 : _k.effective) === null || _l === void 0 ? void 0 : _l.min,
362
- max: (_o = (_m = item === null || item === void 0 ? void 0 : item.price) === null || _m === void 0 ? void 0 : _m.effective) === null || _o === void 0 ? void 0 : _o.max,
363
- },
364
- });
365
- }),
366
- };
367
- },
368
- },
369
123
  ADD_TO_COMPARE: {
370
124
  //not getting used
371
125
  eventName: "compare.add",
@@ -438,36 +192,6 @@ export const FPI_EVENTS = {
438
192
  return { item };
439
193
  },
440
194
  },
441
- VIEW_WISHLIST: {
442
- eventName: "wishlist.view",
443
- payloadCreator: (result, param) => {
444
- var _a;
445
- return {
446
- collection_type: param === null || param === void 0 ? void 0 : param.collectionType,
447
- items: (_a = result === null || result === void 0 ? void 0 : result.items) === null || _a === void 0 ? void 0 : _a.map((item, index) => {
448
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
449
- return ({
450
- product_id: item === null || item === void 0 ? void 0 : item.uid,
451
- position: index + 1,
452
- product_name: item === null || item === void 0 ? void 0 : item.name,
453
- product_slug: item === null || item === void 0 ? void 0 : item.slug,
454
- brand: (_a = item === null || item === void 0 ? void 0 : item.brand) === null || _a === void 0 ? void 0 : _a.name,
455
- item_type: item === null || item === void 0 ? void 0 : item.item_type,
456
- marked_price: {
457
- currency: (_c = (_b = item === null || item === void 0 ? void 0 : item.price) === null || _b === void 0 ? void 0 : _b.marked) === null || _c === void 0 ? void 0 : _c.currency_code,
458
- min: (_e = (_d = item === null || item === void 0 ? void 0 : item.price) === null || _d === void 0 ? void 0 : _d.marked) === null || _e === void 0 ? void 0 : _e.min,
459
- max: (_g = (_f = item === null || item === void 0 ? void 0 : item.price) === null || _f === void 0 ? void 0 : _f.marked) === null || _g === void 0 ? void 0 : _g.max,
460
- },
461
- effective_price: {
462
- currency: (_j = (_h = item === null || item === void 0 ? void 0 : item.price) === null || _h === void 0 ? void 0 : _h.effective) === null || _j === void 0 ? void 0 : _j.currency_code,
463
- min: (_l = (_k = item === null || item === void 0 ? void 0 : item.price) === null || _k === void 0 ? void 0 : _k.effective) === null || _l === void 0 ? void 0 : _l.min,
464
- max: (_o = (_m = item === null || item === void 0 ? void 0 : item.price) === null || _m === void 0 ? void 0 : _m.effective) === null || _o === void 0 ? void 0 : _o.max,
465
- },
466
- });
467
- }),
468
- };
469
- },
470
- },
471
195
  VIEW_CART: {
472
196
  eventName: "cart.view",
473
197
  payloadCreator: (result, param, store, oldStore) => {
@@ -681,122 +405,6 @@ export const FPI_EVENTS = {
681
405
  };
682
406
  },
683
407
  },
684
- CART_SHARE: {
685
- eventName: "cart.share",
686
- payloadCreator: (result, param) => {
687
- var _a;
688
- return {
689
- cart_id: (_a = param === null || param === void 0 ? void 0 : param.getShareCartLinkRequestInput) === null || _a === void 0 ? void 0 : _a.id,
690
- share_url: result === null || result === void 0 ? void 0 : result.share_url,
691
- token: result === null || result === void 0 ? void 0 : result.token,
692
- };
693
- },
694
- },
695
- COUPONS_VIEW: {
696
- eventName: "coupons.view",
697
- payloadCreator: (result, param, store) => {
698
- var _a, _b, _c;
699
- const cartDetails = (_a = store === null || store === void 0 ? void 0 : store.cart) === null || _a === void 0 ? void 0 : _a.cart_items;
700
- return {
701
- cart_id: (param === null || param === void 0 ? void 0 : param.id) || (cartDetails === null || cartDetails === void 0 ? void 0 : cartDetails.id),
702
- checkout_mode: (cartDetails === null || cartDetails === void 0 ? void 0 : cartDetails.checkout_mode) || 'self',
703
- buy_now: param === null || param === void 0 ? void 0 : param.buyNow,
704
- restrict_checkout: cartDetails === null || cartDetails === void 0 ? void 0 : cartDetails.restrict_checkout,
705
- currency: (_b = cartDetails === null || cartDetails === void 0 ? void 0 : cartDetails.currency) === null || _b === void 0 ? void 0 : _b.code,
706
- coupons: ((_c = result === null || result === void 0 ? void 0 : result.available_coupon_list) === null || _c === void 0 ? void 0 : _c.map((coupon) => ({
707
- coupon_code: coupon === null || coupon === void 0 ? void 0 : coupon.coupon_code,
708
- coupon_type: coupon === null || coupon === void 0 ? void 0 : coupon.coupon_type,
709
- coupon_amount: coupon === null || coupon === void 0 ? void 0 : coupon.coupon_amount,
710
- coupon_title: coupon === null || coupon === void 0 ? void 0 : coupon.title,
711
- coupon_description: coupon === null || coupon === void 0 ? void 0 : coupon.description,
712
- is_applied: coupon === null || coupon === void 0 ? void 0 : coupon.is_applied,
713
- is_applicable: coupon === null || coupon === void 0 ? void 0 : coupon.is_applicable,
714
- }))) || [],
715
- };
716
- },
717
- },
718
- COUPON_APPLY: {
719
- eventName: "coupon.apply",
720
- payloadCreator: (result) => {
721
- return result;
722
- }
723
- },
724
- COUPON_REMOVE: {
725
- eventName: "coupon.remove",
726
- payloadCreator: (result) => {
727
- return result;
728
- }
729
- },
730
- PROMOTIONS_VIEW: {
731
- eventName: "promotions.view",
732
- payloadCreator: (result, param) => {
733
- var _a;
734
- return {
735
- cart_id: param === null || param === void 0 ? void 0 : param.cartId,
736
- promotions: (_a = result === null || result === void 0 ? void 0 : result.available_promotions) === null || _a === void 0 ? void 0 : _a.map((promotion) => {
737
- var _a;
738
- return ({
739
- id: promotion === null || promotion === void 0 ? void 0 : promotion.id,
740
- promotion_name: promotion === null || promotion === void 0 ? void 0 : promotion.promotion_name,
741
- promotion_type: promotion === null || promotion === void 0 ? void 0 : promotion.promotion_type,
742
- description: promotion === null || promotion === void 0 ? void 0 : promotion.description,
743
- offer_text: promotion === null || promotion === void 0 ? void 0 : promotion.offer_text,
744
- discount_rules: promotion === null || promotion === void 0 ? void 0 : promotion.discount_rules,
745
- free_gift_items: (_a = promotion === null || promotion === void 0 ? void 0 : promotion.free_gift_items) === null || _a === void 0 ? void 0 : _a.map((item) => {
746
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
747
- return ({
748
- item_id: item === null || item === void 0 ? void 0 : item.item_id,
749
- item_name: item === null || item === void 0 ? void 0 : item.item_name,
750
- item_slug: item === null || item === void 0 ? void 0 : item.item_slug,
751
- marked_price: {
752
- min: (_b = (_a = item === null || item === void 0 ? void 0 : item.item_price_details) === null || _a === void 0 ? void 0 : _a.marked) === null || _b === void 0 ? void 0 : _b.min,
753
- max: (_d = (_c = item === null || item === void 0 ? void 0 : item.item_price_details) === null || _c === void 0 ? void 0 : _c.marked) === null || _d === void 0 ? void 0 : _d.max,
754
- },
755
- effective_price: {
756
- min: (_f = (_e = item === null || item === void 0 ? void 0 : item.item_price_details) === null || _e === void 0 ? void 0 : _e.effective) === null || _f === void 0 ? void 0 : _f.min,
757
- max: (_h = (_g = item === null || item === void 0 ? void 0 : item.item_price_details) === null || _g === void 0 ? void 0 : _g.effective) === null || _h === void 0 ? void 0 : _h.max,
758
- },
759
- currency: (_j = item === null || item === void 0 ? void 0 : item.item_price_details) === null || _j === void 0 ? void 0 : _j.currency,
760
- size: item === null || item === void 0 ? void 0 : item.size,
761
- });
762
- }),
763
- });
764
- }),
765
- };
766
- },
767
- },
768
- FAQ_CATEGORIES_VIEW: {
769
- eventName: "faq_categories.view",
770
- payloadCreator: (result) => {
771
- var _a;
772
- return {
773
- faq_categories: (_a = result === null || result === void 0 ? void 0 : result.categories) === null || _a === void 0 ? void 0 : _a.map((category) => ({
774
- id: category === null || category === void 0 ? void 0 : category.id,
775
- slug: category === null || category === void 0 ? void 0 : category.slug,
776
- title: category === null || category === void 0 ? void 0 : category.title,
777
- description: category === null || category === void 0 ? void 0 : category.description,
778
- children: category === null || category === void 0 ? void 0 : category.children,
779
- position: category === null || category === void 0 ? void 0 : category.index,
780
- })),
781
- };
782
- },
783
- },
784
- FAQS_VIEW: {
785
- eventName: "faqs.view",
786
- payloadCreator: (result, param) => {
787
- var _a;
788
- return {
789
- faq_category_slug: param === null || param === void 0 ? void 0 : param.slug,
790
- faqs: (_a = result === null || result === void 0 ? void 0 : result.faqs) === null || _a === void 0 ? void 0 : _a.map((faq, index) => ({
791
- id: faq === null || faq === void 0 ? void 0 : faq.id,
792
- slug: faq === null || faq === void 0 ? void 0 : faq.slug,
793
- question: faq === null || faq === void 0 ? void 0 : faq.question,
794
- answer: faq === null || faq === void 0 ? void 0 : faq.answer,
795
- position: index + 1,
796
- })),
797
- };
798
- },
799
- },
800
408
  ORDER_CHECKEDOUT: {
801
409
  eventName: "order.checkedout",
802
410
  payloadCreator: (result, param, store, oldStore) => {
@@ -886,27 +494,42 @@ export const FPI_EVENTS = {
886
494
  };
887
495
  },
888
496
  },
889
- ORDER_VIEW: {
890
- eventName: "order.view",
891
- payloadCreator: (result, param) => {
892
- var _a;
893
- return {
894
- order_id: param === null || param === void 0 ? void 0 : param.orderId,
895
- shipments: ((_a = result === null || result === void 0 ? void 0 : result.shipments) === null || _a === void 0 ? void 0 : _a.map((shipment) => {
896
- var _a, _b;
897
- return ({
898
- shipment_id: shipment === null || shipment === void 0 ? void 0 : shipment.shipment_id,
899
- current_status: (_a = shipment === null || shipment === void 0 ? void 0 : shipment.shipment_status) === null || _a === void 0 ? void 0 : _a.title,
900
- delivery_mode: shipment === null || shipment === void 0 ? void 0 : shipment.order_type,
901
- expected_delivery_date: shipment === null || shipment === void 0 ? void 0 : shipment.delivery_date,
902
- payment_methods: (_b = shipment === null || shipment === void 0 ? void 0 : shipment.payment_info) === null || _b === void 0 ? void 0 : _b.map((payment) => ({
903
- payment_mode: payment === null || payment === void 0 ? void 0 : payment.payment_mode,
904
- payment_status: payment === null || payment === void 0 ? void 0 : payment.status,
905
- amount: payment === null || payment === void 0 ? void 0 : payment.amount,
906
- })),
497
+ ORDER_PROCESSED: {
498
+ eventName: "order.processed",
499
+ payloadCreator: (result, param, store, oldStore) => {
500
+ var _a, _b, _c, _d, _e, _f, _g, _h;
501
+ try {
502
+ const orderData = result;
503
+ let eventData = {};
504
+ const breakup = {};
505
+ if (orderData.breakup_values) {
506
+ for (let i = 0; i < orderData.breakup_values.length; i++) {
507
+ breakup[orderData.breakup_values[i].name] =
508
+ orderData.breakup_values[i].value;
509
+ }
510
+ }
511
+ eventData.order_id = param === null || param === void 0 ? void 0 : param.orderId;
512
+ eventData.breakup_values_raw = breakup;
513
+ const arrShipments = [];
514
+ const items = [];
515
+ for (let i = 0; i < orderData.shipments.length; i++) {
516
+ arrShipments.push({
517
+ shipment_id: (_a = orderData.shipments[i]) === null || _a === void 0 ? void 0 : _a.shipment_id,
518
+ status: (_c = (_b = orderData.shipments[i]) === null || _b === void 0 ? void 0 : _b.shipment_status) === null || _c === void 0 ? void 0 : _c.title,
519
+ payment_mode: (_e = (_d = orderData.shipments[i]) === null || _d === void 0 ? void 0 : _d.payment) === null || _e === void 0 ? void 0 : _e.mode,
907
520
  });
908
- })) || [],
909
- };
521
+ (_h = (_g = (_f = orderData === null || orderData === void 0 ? void 0 : orderData.shipments) === null || _f === void 0 ? void 0 : _f[i]) === null || _g === void 0 ? void 0 : _g.bags) === null || _h === void 0 ? void 0 : _h.forEach((b) => {
522
+ var _a;
523
+ return items.push(Object.assign(Object.assign({}, ((b === null || b === void 0 ? void 0 : b.item) || {})), { price: (_a = b === null || b === void 0 ? void 0 : b.prices) === null || _a === void 0 ? void 0 : _a.price_effective, quantity: (b === null || b === void 0 ? void 0 : b.quantity) ? b === null || b === void 0 ? void 0 : b.quantity : 1 }));
524
+ });
525
+ }
526
+ eventData.shipments = arrShipments;
527
+ eventData.items = items;
528
+ return eventData;
529
+ }
530
+ catch (err) {
531
+ console.log("Error occurred: ", err);
532
+ }
910
533
  },
911
534
  },
912
535
  ORDER_TRACKING_VIEW: {
@@ -923,6 +546,33 @@ export const FPI_EVENTS = {
923
546
  return store;
924
547
  },
925
548
  },
549
+ REFUND_SUCCESS: {
550
+ eventName: "refund.success",
551
+ payloadCreator: (result, param) => {
552
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
553
+ const { updateShipmentStatusRequestInput: refund_data = {} } = param;
554
+ const orderMeta = (_a = refund_data.statuses) === null || _a === void 0 ? void 0 : _a[0];
555
+ if (!orderMeta || !(orderMeta === null || orderMeta === void 0 ? void 0 : orderMeta.shipments)) {
556
+ return;
557
+ }
558
+ const shipmentId = Object.keys(orderMeta.shipments)[0];
559
+ if (!shipmentId) {
560
+ return;
561
+ }
562
+ const eventData = {
563
+ status: orderMeta === null || orderMeta === void 0 ? void 0 : orderMeta.status,
564
+ bags: (_c = (_b = orderMeta === null || orderMeta === void 0 ? void 0 : orderMeta.shipments) === null || _b === void 0 ? void 0 : _b[shipmentId]) === null || _c === void 0 ? void 0 : _c.bags,
565
+ reason: ((_e = (_d = orderMeta === null || orderMeta === void 0 ? void 0 : orderMeta.shipments) === null || _d === void 0 ? void 0 : _d[shipmentId]) === null || _e === void 0 ? void 0 : _e.reason)
566
+ ? {
567
+ uid: "" + ((_h = (_g = (_f = orderMeta === null || orderMeta === void 0 ? void 0 : orderMeta.shipments) === null || _f === void 0 ? void 0 : _f[shipmentId]) === null || _g === void 0 ? void 0 : _g.reason) === null || _h === void 0 ? void 0 : _h[0]),
568
+ message: ((_k = (_j = orderMeta === null || orderMeta === void 0 ? void 0 : orderMeta.shipments) === null || _j === void 0 ? void 0 : _j[shipmentId]) === null || _k === void 0 ? void 0 : _k.reason_text) || "",
569
+ }
570
+ : {},
571
+ shipment_id: shipmentId,
572
+ };
573
+ return eventData;
574
+ },
575
+ },
926
576
  SEARCH_PRODUCTS: {
927
577
  eventName: "search.products",
928
578
  payloadCreator: (result, param, store) => {
@@ -965,31 +615,6 @@ export const FPI_EVENTS = {
965
615
  return store;
966
616
  },
967
617
  },
968
- CONTACT_US_SUBMIT: {
969
- eventName: "contact_us.submit",
970
- payloadCreator: (result, param) => {
971
- var _a, _b, _c, _d, _e, _f, _g;
972
- const ticket = (_a = result === null || result === void 0 ? void 0 : result.ticket) !== null && _a !== void 0 ? _a : result;
973
- return {
974
- form_slug: param === null || param === void 0 ? void 0 : param.slug,
975
- support_ticket: {
976
- ticket_id: ticket === null || ticket === void 0 ? void 0 : ticket._id,
977
- category: {
978
- key: (_b = ticket === null || ticket === void 0 ? void 0 : ticket.category) === null || _b === void 0 ? void 0 : _b.key,
979
- display: (_c = ticket === null || ticket === void 0 ? void 0 : ticket.category) === null || _c === void 0 ? void 0 : _c.display,
980
- },
981
- content: {
982
- title: (_d = ticket === null || ticket === void 0 ? void 0 : ticket.content) === null || _d === void 0 ? void 0 : _d.title,
983
- description: (_e = ticket === null || ticket === void 0 ? void 0 : ticket.content) === null || _e === void 0 ? void 0 : _e.description,
984
- },
985
- context: {
986
- company_id: (_f = ticket === null || ticket === void 0 ? void 0 : ticket.context) === null || _f === void 0 ? void 0 : _f.company_id,
987
- application_id: (_g = ticket === null || ticket === void 0 ? void 0 : ticket.context) === null || _g === void 0 ? void 0 : _g.application_id,
988
- }
989
- },
990
- };
991
- },
992
- },
993
618
  };
994
619
  function handleDynamicEventName(event, eventPayload, params) {
995
620
  var _a, _b, _c;