@gofynd/fdk-client-javascript 1.4.8-beta.3 → 1.4.9

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 (189) hide show
  1. package/README.md +26 -1
  2. package/package.json +2 -2
  3. package/sdk/application/ApplicationClient.d.ts +8 -0
  4. package/sdk/application/ApplicationClient.js +14 -0
  5. package/sdk/application/Cart/CartApplicationClient.d.ts +20 -20
  6. package/sdk/application/Cart/CartApplicationClient.js +20 -20
  7. package/sdk/application/Cart/CartApplicationModel.d.ts +2446 -664
  8. package/sdk/application/Cart/CartApplicationModel.js +783 -552
  9. package/sdk/application/Cart/CartApplicationValidator.d.ts +268 -194
  10. package/sdk/application/Cart/CartApplicationValidator.js +100 -114
  11. package/sdk/application/Catalog/CatalogApplicationClient.d.ts +53 -53
  12. package/sdk/application/Catalog/CatalogApplicationClient.js +53 -53
  13. package/sdk/application/Catalog/CatalogApplicationModel.d.ts +2012 -503
  14. package/sdk/application/Catalog/CatalogApplicationModel.js +603 -453
  15. package/sdk/application/Catalog/CatalogApplicationValidator.d.ts +64 -64
  16. package/sdk/application/Catalog/CatalogApplicationValidator.js +32 -32
  17. package/sdk/application/Common/CommonApplicationClient.d.ts +2 -2
  18. package/sdk/application/Common/CommonApplicationClient.js +2 -2
  19. package/sdk/application/Common/CommonApplicationModel.d.ts +170 -90
  20. package/sdk/application/Common/CommonApplicationModel.js +59 -58
  21. package/sdk/application/Common/CommonApplicationValidator.d.ts +8 -5
  22. package/sdk/application/Common/CommonApplicationValidator.js +3 -3
  23. package/sdk/application/Communication/CommunicationApplicationClient.d.ts +2 -2
  24. package/sdk/application/Communication/CommunicationApplicationClient.js +2 -2
  25. package/sdk/application/Communication/CommunicationApplicationModel.d.ts +170 -35
  26. package/sdk/application/Communication/CommunicationApplicationModel.js +54 -33
  27. package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +15 -15
  28. package/sdk/application/Configuration/ConfigurationApplicationClient.js +15 -15
  29. package/sdk/application/Configuration/ConfigurationApplicationModel.d.ts +624 -443
  30. package/sdk/application/Configuration/ConfigurationApplicationModel.js +259 -248
  31. package/sdk/application/Configuration/ConfigurationApplicationValidator.d.ts +32 -24
  32. package/sdk/application/Configuration/ConfigurationApplicationValidator.js +14 -13
  33. package/sdk/application/Content/ContentApplicationClient.d.ts +16 -16
  34. package/sdk/application/Content/ContentApplicationClient.js +16 -16
  35. package/sdk/application/Content/ContentApplicationModel.d.ts +1205 -282
  36. package/sdk/application/Content/ContentApplicationModel.js +341 -277
  37. package/sdk/application/Content/ContentApplicationValidator.d.ts +28 -17
  38. package/sdk/application/Content/ContentApplicationValidator.js +11 -10
  39. package/sdk/application/FileStorage/FileStorageApplicationClient.d.ts +3 -3
  40. package/sdk/application/FileStorage/FileStorageApplicationClient.js +3 -3
  41. package/sdk/application/FileStorage/FileStorageApplicationModel.d.ts +146 -37
  42. package/sdk/application/FileStorage/FileStorageApplicationModel.js +38 -36
  43. package/sdk/application/Lead/LeadApplicationClient.d.ts +3 -3
  44. package/sdk/application/Lead/LeadApplicationClient.js +3 -3
  45. package/sdk/application/Lead/LeadApplicationModel.d.ts +195 -134
  46. package/sdk/application/Lead/LeadApplicationModel.js +110 -67
  47. package/sdk/application/Lead/LeadApplicationValidator.d.ts +8 -8
  48. package/sdk/application/Lead/LeadApplicationValidator.js +4 -4
  49. package/sdk/application/Logistic/LogisticApplicationClient.d.ts +10 -10
  50. package/sdk/application/Logistic/LogisticApplicationClient.js +10 -10
  51. package/sdk/application/Logistic/LogisticApplicationModel.d.ts +1039 -221
  52. package/sdk/application/Logistic/LogisticApplicationModel.js +342 -199
  53. package/sdk/application/Logistic/LogisticApplicationValidator.d.ts +76 -82
  54. package/sdk/application/Logistic/LogisticApplicationValidator.js +38 -41
  55. package/sdk/application/Order/OrderApplicationClient.d.ts +10 -10
  56. package/sdk/application/Order/OrderApplicationClient.js +10 -10
  57. package/sdk/application/Order/OrderApplicationModel.d.ts +1400 -325
  58. package/sdk/application/Order/OrderApplicationModel.js +391 -317
  59. package/sdk/application/Order/OrderApplicationValidator.d.ts +32 -30
  60. package/sdk/application/Order/OrderApplicationValidator.js +15 -14
  61. package/sdk/application/Payment/PaymentApplicationClient.d.ts +43 -43
  62. package/sdk/application/Payment/PaymentApplicationClient.js +43 -43
  63. package/sdk/application/Payment/PaymentApplicationModel.d.ts +1111 -1022
  64. package/sdk/application/Payment/PaymentApplicationModel.js +537 -521
  65. package/sdk/application/Payment/PaymentApplicationValidator.d.ts +82 -49
  66. package/sdk/application/Payment/PaymentApplicationValidator.js +30 -30
  67. package/sdk/application/Rewards/RewardsApplicationModel.d.ts +28 -7
  68. package/sdk/application/Rewards/RewardsApplicationModel.js +7 -7
  69. package/sdk/application/Share/ShareApplicationModel.d.ts +178 -38
  70. package/sdk/application/Share/ShareApplicationModel.js +53 -37
  71. package/sdk/application/Share/ShareApplicationValidator.d.ts +4 -2
  72. package/sdk/application/Share/ShareApplicationValidator.js +2 -1
  73. package/sdk/application/Theme/ThemeApplicationClient.d.ts +4 -4
  74. package/sdk/application/Theme/ThemeApplicationClient.js +14 -8
  75. package/sdk/application/Theme/ThemeApplicationModel.d.ts +528 -287
  76. package/sdk/application/Theme/ThemeApplicationModel.js +208 -172
  77. package/sdk/application/Theme/ThemeApplicationValidator.d.ts +17 -12
  78. package/sdk/application/Theme/ThemeApplicationValidator.js +8 -6
  79. package/sdk/application/User/UserApplicationClient.d.ts +36 -36
  80. package/sdk/application/User/UserApplicationClient.js +36 -36
  81. package/sdk/application/User/UserApplicationModel.d.ts +1062 -255
  82. package/sdk/application/User/UserApplicationModel.js +298 -244
  83. package/sdk/application/User/UserApplicationValidator.d.ts +80 -80
  84. package/sdk/application/User/UserApplicationValidator.js +40 -40
  85. package/sdk/application/Webhook/WebhookApplicationClient.d.ts +1 -1
  86. package/sdk/application/Webhook/WebhookApplicationClient.js +1 -1
  87. package/sdk/application/Webhook/WebhookApplicationModel.d.ts +20 -5
  88. package/sdk/application/Webhook/WebhookApplicationModel.js +5 -5
  89. package/sdk/common/Clickstream.js +95 -15
  90. package/sdk/common/Constant.d.ts +9 -0
  91. package/sdk/common/Constant.js +11 -0
  92. package/sdk/common/Utility.js +19 -0
  93. package/sdk/common/utils.js +8 -1
  94. package/sdk/partner/Lead/LeadPartnerModel.d.ts +28 -7
  95. package/sdk/partner/Lead/LeadPartnerModel.js +7 -7
  96. package/sdk/partner/Logistics/LogisticsPartnerModel.d.ts +28 -7
  97. package/sdk/partner/Logistics/LogisticsPartnerModel.js +7 -7
  98. package/sdk/partner/PartnerClient.d.ts +8 -0
  99. package/sdk/partner/PartnerClient.js +14 -0
  100. package/sdk/partner/Theme/ThemePartnerClient.d.ts +20 -0
  101. package/sdk/partner/Theme/ThemePartnerClient.js +158 -0
  102. package/sdk/partner/Theme/ThemePartnerModel.d.ts +45 -6
  103. package/sdk/partner/Theme/ThemePartnerModel.js +33 -4
  104. package/sdk/partner/Theme/ThemePartnerValidator.d.ts +2 -0
  105. package/sdk/partner/Theme/ThemePartnerValidator.js +14 -0
  106. package/sdk/partner/Webhook/WebhookPartnerModel.d.ts +28 -7
  107. package/sdk/partner/Webhook/WebhookPartnerModel.js +7 -7
  108. package/sdk/platform/Analytics/AnalyticsPlatformModel.d.ts +28 -7
  109. package/sdk/platform/Analytics/AnalyticsPlatformModel.js +7 -7
  110. package/sdk/platform/Billing/BillingPlatformClient.d.ts +6 -397
  111. package/sdk/platform/Billing/BillingPlatformClient.js +77 -3215
  112. package/sdk/platform/Billing/BillingPlatformModel.d.ts +621 -2021
  113. package/sdk/platform/Billing/BillingPlatformModel.js +353 -2405
  114. package/sdk/platform/Billing/BillingPlatformValidator.d.ts +12 -451
  115. package/sdk/platform/Billing/BillingPlatformValidator.js +8 -483
  116. package/sdk/platform/Cart/CartPlatformModel.d.ts +28 -7
  117. package/sdk/platform/Cart/CartPlatformModel.js +8 -8
  118. package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +12 -2
  119. package/sdk/platform/Catalog/CatalogPlatformClient.js +41 -1
  120. package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +46 -12
  121. package/sdk/platform/Catalog/CatalogPlatformModel.js +14 -11
  122. package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +40 -0
  123. package/sdk/platform/Catalog/CatalogPlatformValidator.js +17 -0
  124. package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +28 -7
  125. package/sdk/platform/Communication/CommunicationPlatformModel.js +7 -7
  126. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +28 -7
  127. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +7 -7
  128. package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +0 -97
  129. package/sdk/platform/Configuration/ConfigurationPlatformClient.js +77 -782
  130. package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +24 -701
  131. package/sdk/platform/Configuration/ConfigurationPlatformModel.js +7 -539
  132. package/sdk/platform/Configuration/ConfigurationPlatformValidator.d.ts +1 -183
  133. package/sdk/platform/Configuration/ConfigurationPlatformValidator.js +0 -134
  134. package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +0 -10
  135. package/sdk/platform/Content/ContentPlatformApplicationClient.js +0 -79
  136. package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +1 -15
  137. package/sdk/platform/Content/ContentPlatformApplicationValidator.js +0 -13
  138. package/sdk/platform/Content/ContentPlatformModel.d.ts +58 -17
  139. package/sdk/platform/Content/ContentPlatformModel.js +28 -15
  140. package/sdk/platform/Discount/DiscountPlatformModel.d.ts +28 -7
  141. package/sdk/platform/Discount/DiscountPlatformModel.js +7 -7
  142. package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +127 -25
  143. package/sdk/platform/FileStorage/FileStoragePlatformModel.js +37 -25
  144. package/sdk/platform/Finance/FinancePlatformClient.d.ts +28 -28
  145. package/sdk/platform/Finance/FinancePlatformClient.js +28 -28
  146. package/sdk/platform/Finance/FinancePlatformModel.d.ts +1583 -347
  147. package/sdk/platform/Finance/FinancePlatformModel.js +463 -351
  148. package/sdk/platform/Lead/LeadPlatformModel.d.ts +28 -7
  149. package/sdk/platform/Lead/LeadPlatformModel.js +7 -7
  150. package/sdk/platform/Order/OrderPlatformClient.d.ts +22 -0
  151. package/sdk/platform/Order/OrderPlatformClient.js +165 -0
  152. package/sdk/platform/Order/OrderPlatformModel.d.ts +613 -39
  153. package/sdk/platform/Order/OrderPlatformModel.js +359 -41
  154. package/sdk/platform/Order/OrderPlatformValidator.d.ts +32 -1
  155. package/sdk/platform/Order/OrderPlatformValidator.js +28 -0
  156. package/sdk/platform/Payment/PaymentPlatformModel.d.ts +30 -9
  157. package/sdk/platform/Payment/PaymentPlatformModel.js +9 -9
  158. package/sdk/platform/PlatformClient.d.ts +8 -0
  159. package/sdk/platform/PlatformClient.js +14 -0
  160. package/sdk/platform/Rewards/RewardsPlatformModel.d.ts +28 -7
  161. package/sdk/platform/Rewards/RewardsPlatformModel.js +7 -7
  162. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.d.ts +12 -9
  163. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.js +12 -9
  164. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +120 -22
  165. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +76 -21
  166. package/sdk/platform/Share/SharePlatformModel.d.ts +28 -7
  167. package/sdk/platform/Share/SharePlatformModel.js +7 -7
  168. package/sdk/platform/Theme/ThemePlatformModel.d.ts +18 -5
  169. package/sdk/platform/Theme/ThemePlatformModel.js +7 -4
  170. package/sdk/platform/User/UserPlatformModel.d.ts +18 -18
  171. package/sdk/platform/User/UserPlatformModel.js +9 -9
  172. package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +28 -7
  173. package/sdk/platform/Webhook/WebhookPlatformModel.js +7 -7
  174. package/sdk/public/PublicClient.d.ts +0 -4
  175. package/sdk/public/PublicClient.js +0 -8
  176. package/sdk/public/index.d.ts +0 -2
  177. package/sdk/public/index.js +0 -4
  178. package/sdk/public/Billing/BillingPublicClient.d.ts +0 -45
  179. package/sdk/public/Billing/BillingPublicClient.js +0 -269
  180. package/sdk/public/Billing/BillingPublicModel.d.ts +0 -434
  181. package/sdk/public/Billing/BillingPublicModel.js +0 -395
  182. package/sdk/public/Billing/BillingPublicValidator.d.ts +0 -34
  183. package/sdk/public/Billing/BillingPublicValidator.js +0 -38
  184. package/sdk/public/Inventory/InventoryPublicClient.d.ts +0 -87
  185. package/sdk/public/Inventory/InventoryPublicClient.js +0 -529
  186. package/sdk/public/Inventory/InventoryPublicModel.d.ts +0 -393
  187. package/sdk/public/Inventory/InventoryPublicModel.js +0 -448
  188. package/sdk/public/Inventory/InventoryPublicValidator.d.ts +0 -91
  189. package/sdk/public/Inventory/InventoryPublicValidator.js +0 -85
@@ -4,41 +4,41 @@ const UserApplicationModel = require("./UserApplicationModel");
4
4
 
5
5
  /**
6
6
  * @typedef AddEmailParam
7
- * @property {string} [platform] - ID of the application
7
+ * @property {string} [platform] - ID of the application.
8
8
  * @property {UserApplicationModel.EditEmailRequestSchema} body
9
9
  */
10
10
 
11
11
  /**
12
12
  * @typedef AddMobileNumberParam
13
- * @property {string} [platform] - ID of the application
13
+ * @property {string} [platform] - ID of the application.
14
14
  * @property {UserApplicationModel.EditMobileRequestSchema} body
15
15
  */
16
16
 
17
17
  /**
18
18
  * @typedef DeleteEmailParam
19
- * @property {string} [platform] - ID of the application
20
- * @property {boolean} active - This is a boolean value to check if email ID is
21
- * active 1. True - Email ID is active 2.False - Email ID is inactive
22
- * @property {boolean} primary - This is a boolean value to check if email ID is
23
- * primary (main email ID) 1. True - Email ID is primary 2.False - Email ID is
24
- * not primary
25
- * @property {boolean} verified - This is a boolean value to check if email ID
26
- * is verified 1. True - Email ID is verified 2.False - Email ID is not verified yet
27
- * @property {string} email - The email ID to delete
19
+ * @property {string} [platform] - ID of the application.
20
+ * @property {boolean} active - Boolean value to check if email id is active 1.
21
+ * True - email id is active 2.False - email id is inactive.
22
+ * @property {boolean} primary - Boolean value to check if email id is primary
23
+ * (main email id) 1. True - email id is primary 2.False - email id is not primary.
24
+ * @property {boolean} verified - Boolean value to check if email id is verified
25
+ * 1. True - email id is verified 2.False - email id is not verified yet.
26
+ * @property {string} email - The email id to delete.
28
27
  */
29
28
 
30
29
  /**
31
30
  * @typedef DeleteMobileNumberParam
32
- * @property {string} [platform] - ID of the application
31
+ * @property {string} [platform] - ID of the application.
33
32
  * @property {boolean} active - This is a boolean value to check if mobile
34
- * number is active 1.True - Number is active 2. False - Number is inactive
33
+ * number is active 1.True - number is active 2. False - number is inactive.
35
34
  * @property {boolean} primary - This is a boolean value to check if mobile
36
- * number is primary number (main number) 1. True - Number is primary 2. False
37
- * - Number is not primary
35
+ * number is primary number (main number) 1. True - number is primary 2. False
36
+ * - number is not primary.
38
37
  * @property {boolean} verified - This is a boolean value to check if mobile
39
- * number is verified 1. True - Number is verified 2.False - Number is not verified yet
40
- * @property {string} countryCode - Country code of the phone number, e.g. 91
41
- * @property {string} phone - Phone number
38
+ * number is verified 1. True - number is verified 2.False - number is not
39
+ * verified yet.
40
+ * @property {string} countryCode - Country code of the phone number, e.g. 91.
41
+ * @property {string} phone - Phone number.
42
42
  */
43
43
 
44
44
  /**
@@ -57,7 +57,7 @@ const UserApplicationModel = require("./UserApplicationModel");
57
57
 
58
58
  /**
59
59
  * @typedef GetPlatformConfigParam
60
- * @property {string} [name] - Name of the application, e.g. Fynd
60
+ * @property {string} [name] - Name of the application, e.g. Fynd.
61
61
  */
62
62
 
63
63
  /**
@@ -69,7 +69,7 @@ const UserApplicationModel = require("./UserApplicationModel");
69
69
 
70
70
  /**
71
71
  * @typedef LoginWithAppleIOSParam
72
- * @property {string} [platform] - ID of the application
72
+ * @property {string} [platform] - ID of the application.
73
73
  * @property {UserApplicationModel.OAuthRequestAppleSchema} body
74
74
  */
75
75
 
@@ -80,31 +80,31 @@ const UserApplicationModel = require("./UserApplicationModel");
80
80
 
81
81
  /**
82
82
  * @typedef LoginWithFacebookParam
83
- * @property {string} [platform] - ID of the application
83
+ * @property {string} [platform] - ID of the application.
84
84
  * @property {UserApplicationModel.OAuthRequestSchema} body
85
85
  */
86
86
 
87
87
  /**
88
88
  * @typedef LoginWithGoogleParam
89
- * @property {string} [platform] - ID of the application
89
+ * @property {string} [platform] - ID of the application.
90
90
  * @property {UserApplicationModel.OAuthRequestSchema} body
91
91
  */
92
92
 
93
93
  /**
94
94
  * @typedef LoginWithGoogleAndroidParam
95
- * @property {string} [platform] - ID of the application
95
+ * @property {string} [platform] - ID of the application.
96
96
  * @property {UserApplicationModel.OAuthRequestSchema} body
97
97
  */
98
98
 
99
99
  /**
100
100
  * @typedef LoginWithGoogleIOSParam
101
- * @property {string} [platform] - ID of the application
101
+ * @property {string} [platform] - ID of the application.
102
102
  * @property {UserApplicationModel.OAuthRequestSchema} body
103
103
  */
104
104
 
105
105
  /**
106
106
  * @typedef LoginWithOTPParam
107
- * @property {string} [platform] - ID of the application
107
+ * @property {string} [platform] - ID of the application.
108
108
  * @property {UserApplicationModel.SendOtpRequestSchema} body
109
109
  */
110
110
 
@@ -117,7 +117,7 @@ const UserApplicationModel = require("./UserApplicationModel");
117
117
 
118
118
  /**
119
119
  * @typedef RegisterWithFormParam
120
- * @property {string} [platform] - ID of the application
120
+ * @property {string} [platform] - ID of the application.
121
121
  * @property {UserApplicationModel.FormRegisterRequestSchema} body
122
122
  */
123
123
 
@@ -128,37 +128,37 @@ const UserApplicationModel = require("./UserApplicationModel");
128
128
 
129
129
  /**
130
130
  * @typedef SendForgotOTPOnEmailParam
131
- * @property {string} [platform] - ID of the application
131
+ * @property {string} [platform] - ID of the application.
132
132
  * @property {UserApplicationModel.SendEmailForgotOtpRequestSchema} body
133
133
  */
134
134
 
135
135
  /**
136
136
  * @typedef SendForgotOTPOnMobileParam
137
- * @property {string} [platform] - ID of the application
137
+ * @property {string} [platform] - ID of the application.
138
138
  * @property {UserApplicationModel.SendMobileForgotOtpRequestSchema} body
139
139
  */
140
140
 
141
141
  /**
142
142
  * @typedef SendOTPOnEmailParam
143
- * @property {string} [platform] - ID of the application
143
+ * @property {string} [platform] - ID of the application.
144
144
  * @property {UserApplicationModel.SendEmailOtpRequestSchema} body
145
145
  */
146
146
 
147
147
  /**
148
148
  * @typedef SendOTPOnMobileParam
149
- * @property {string} [platform] - ID of the application
149
+ * @property {string} [platform] - ID of the application.
150
150
  * @property {UserApplicationModel.SendMobileOtpRequestSchema} body
151
151
  */
152
152
 
153
153
  /**
154
154
  * @typedef SendResetPasswordEmailParam
155
- * @property {string} [platform] - ID of the application
155
+ * @property {string} [platform] - ID of the application.
156
156
  * @property {UserApplicationModel.SendResetPasswordEmailRequestSchema} body
157
157
  */
158
158
 
159
159
  /**
160
160
  * @typedef SendResetPasswordMobileParam
161
- * @property {string} [platform] - ID of the application
161
+ * @property {string} [platform] - ID of the application.
162
162
  * @property {UserApplicationModel.SendResetPasswordMobileRequestSchema} body
163
163
  */
164
164
 
@@ -169,13 +169,13 @@ const UserApplicationModel = require("./UserApplicationModel");
169
169
 
170
170
  /**
171
171
  * @typedef SendVerificationLinkToEmailParam
172
- * @property {string} [platform] - ID of the application
172
+ * @property {string} [platform] - ID of the application.
173
173
  * @property {UserApplicationModel.EditEmailRequestSchema} body
174
174
  */
175
175
 
176
176
  /**
177
177
  * @typedef SendVerificationLinkToMobileParam
178
- * @property {string} [platform] - ID of the application
178
+ * @property {string} [platform] - ID of the application.
179
179
  * @property {UserApplicationModel.SendVerificationLinkMobileRequestSchema} body
180
180
  */
181
181
 
@@ -196,7 +196,7 @@ const UserApplicationModel = require("./UserApplicationModel");
196
196
 
197
197
  /**
198
198
  * @typedef UpdateProfileParam
199
- * @property {string} [platform] - ID of the application
199
+ * @property {string} [platform] - ID of the application.
200
200
  * @property {UserApplicationModel.EditProfileRequestSchema} body
201
201
  */
202
202
 
@@ -207,7 +207,7 @@ const UserApplicationModel = require("./UserApplicationModel");
207
207
 
208
208
  /**
209
209
  * @typedef UserExistsParam
210
- * @property {string} q - Email id or phone number of user
210
+ * @property {string} q - Email id or phone number of user.
211
211
  */
212
212
 
213
213
  /**
@@ -217,13 +217,13 @@ const UserApplicationModel = require("./UserApplicationModel");
217
217
 
218
218
  /**
219
219
  * @typedef VerifyEmailForgotOTPParam
220
- * @property {string} [platform] - ID of the application
220
+ * @property {string} [platform] - ID of the application.
221
221
  * @property {UserApplicationModel.VerifyEmailForgotOtpRequestSchema} body
222
222
  */
223
223
 
224
224
  /**
225
225
  * @typedef VerifyEmailOTPParam
226
- * @property {string} [platform] - ID of the application
226
+ * @property {string} [platform] - ID of the application.
227
227
  * @property {UserApplicationModel.VerifyEmailOtpRequestSchema} body
228
228
  */
229
229
 
@@ -234,13 +234,13 @@ const UserApplicationModel = require("./UserApplicationModel");
234
234
 
235
235
  /**
236
236
  * @typedef VerifyMobileForgotOTPParam
237
- * @property {string} [platform] - ID of the application
237
+ * @property {string} [platform] - ID of the application.
238
238
  * @property {UserApplicationModel.VerifyMobileForgotOtpRequestSchema} body
239
239
  */
240
240
 
241
241
  /**
242
242
  * @typedef VerifyMobileOTPParam
243
- * @property {string} [platform] - ID of the application
243
+ * @property {string} [platform] - ID of the application.
244
244
  * @property {UserApplicationModel.VerifyOtpRequestSchema} body
245
245
  */
246
246
 
@@ -14,7 +14,7 @@ declare class Webhook {
14
14
  * @returns {Promise<WebhookApplicationModel.ClickEventResponse>} - Success response
15
15
  * @name saveClickEvent
16
16
  * @summary: Endpoint to capture click events from sales channels and persist them in database.
17
- * @description: Endpoint to capture click events from sales channels. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/webhook/saveClickEvent/).
17
+ * @description: Send click events from sales channels. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/webhook/saveClickEvent/).
18
18
  */
19
19
  saveClickEvent({ body, requestHeaders }?: WebhookApplicationValidator.SaveClickEventParam, { responseHeaders }?: object): Promise<WebhookApplicationModel.ClickEventResponse>;
20
20
  }
@@ -40,7 +40,7 @@ class Webhook {
40
40
  * @returns {Promise<WebhookApplicationModel.ClickEventResponse>} - Success response
41
41
  * @name saveClickEvent
42
42
  * @summary: Endpoint to capture click events from sales channels and persist them in database.
43
- * @description: Endpoint to capture click events from sales channels. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/webhook/saveClickEvent/).
43
+ * @description: Send click events from sales channels. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/webhook/saveClickEvent/).
44
44
  */
45
45
  async saveClickEvent(
46
46
  { body, requestHeaders } = { requestHeaders: {} },
@@ -1,17 +1,17 @@
1
1
  export = WebhookApplicationModel;
2
2
  /**
3
3
  * @typedef ClickEventBatch
4
- * @property {string} [event_name]
4
+ * @property {string} [event_name] - Name of click event.
5
5
  */
6
6
  /**
7
7
  * @typedef ClickEventRequest
8
- * @property {ClickEventBatch[]} [batch]
8
+ * @property {ClickEventBatch[]} [batch] - List of click events captured.
9
9
  */
10
10
  /**
11
11
  * @typedef ClickEventResponse
12
- * @property {number} [success_count]
13
- * @property {number} [failed_count]
14
- * @property {ClickEventBatch[]} [failed_events]
12
+ * @property {number} [success_count] - Count of valid events.
13
+ * @property {number} [failed_count] - Count of events failed in schema validation.
14
+ * @property {ClickEventBatch[]} [failed_events] - List of failed events with error.
15
15
  */
16
16
  declare class WebhookApplicationModel {
17
17
  }
@@ -21,17 +21,32 @@ declare namespace WebhookApplicationModel {
21
21
  /** @returns {ClickEventBatch} */
22
22
  declare function ClickEventBatch(): ClickEventBatch;
23
23
  type ClickEventBatch = {
24
+ /**
25
+ * - Name of click event.
26
+ */
24
27
  event_name?: string;
25
28
  };
26
29
  /** @returns {ClickEventRequest} */
27
30
  declare function ClickEventRequest(): ClickEventRequest;
28
31
  type ClickEventRequest = {
32
+ /**
33
+ * - List of click events captured.
34
+ */
29
35
  batch?: ClickEventBatch[];
30
36
  };
31
37
  /** @returns {ClickEventResponse} */
32
38
  declare function ClickEventResponse(): ClickEventResponse;
33
39
  type ClickEventResponse = {
40
+ /**
41
+ * - Count of valid events.
42
+ */
34
43
  success_count?: number;
44
+ /**
45
+ * - Count of events failed in schema validation.
46
+ */
35
47
  failed_count?: number;
48
+ /**
49
+ * - List of failed events with error.
50
+ */
36
51
  failed_events?: ClickEventBatch[];
37
52
  };
@@ -2,19 +2,19 @@ const Joi = require("joi");
2
2
 
3
3
  /**
4
4
  * @typedef ClickEventBatch
5
- * @property {string} [event_name]
5
+ * @property {string} [event_name] - Name of click event.
6
6
  */
7
7
 
8
8
  /**
9
9
  * @typedef ClickEventRequest
10
- * @property {ClickEventBatch[]} [batch]
10
+ * @property {ClickEventBatch[]} [batch] - List of click events captured.
11
11
  */
12
12
 
13
13
  /**
14
14
  * @typedef ClickEventResponse
15
- * @property {number} [success_count]
16
- * @property {number} [failed_count]
17
- * @property {ClickEventBatch[]} [failed_events]
15
+ * @property {number} [success_count] - Count of valid events.
16
+ * @property {number} [failed_count] - Count of events failed in schema validation.
17
+ * @property {ClickEventBatch[]} [failed_events] - List of failed events with error.
18
18
  */
19
19
 
20
20
  class WebhookApplicationModel {
@@ -16,7 +16,35 @@ const sg = function safeGet(fn, defaultValue = null) {
16
16
  return defaultValue;
17
17
  }
18
18
  };
19
-
19
+ /**
20
+ * Safely extracts search query and click position
21
+ *
22
+ * @author Hitendra Singh
23
+ * @param {Object} [defaultValue] - Utm_params
24
+ * @returns {Object} - Query and position
25
+ */
26
+ const fetchPositionAndQuery = function (utm_params) {
27
+ if (!utm_params || !Object.keys(utm_params).length) {
28
+ return {
29
+ query: null,
30
+ position: null,
31
+ };
32
+ }
33
+ const decodedUri = utm_params.utm_content
34
+ ? atob(utm_params.utm_content)
35
+ : null;
36
+ if (decodedUri && utm_params.utm_medium === "search") {
37
+ const parts = decodedUri.split(":::");
38
+ return {
39
+ query: parts[0] || null,
40
+ position: parts[1] || null,
41
+ };
42
+ }
43
+ return {
44
+ query: null,
45
+ position: null,
46
+ };
47
+ };
20
48
  if (typeof window != "undefined") {
21
49
  window.FPI.event.on("user.login", (eventData) => {
22
50
  Logger({ level: "DEBUG", message: eventData });
@@ -57,7 +85,7 @@ if (typeof window != "undefined") {
57
85
 
58
86
  window.FPI.event.on("wishlist.add", (eventData) => {
59
87
  Logger({ level: "DEBUG", message: eventData });
60
- Clickstream.sendEvent("product_wishlist_add", {
88
+ const payload = {
61
89
  wishlist_name: "TODO",
62
90
  wishlist_id: "TODO",
63
91
  event_type: "engagement",
@@ -70,6 +98,11 @@ if (typeof window != "undefined") {
70
98
  currency: sg(() => eventData.item.price.effective.currency_code),
71
99
  value: "TODO",
72
100
  source_url: "TODO",
101
+ };
102
+ const queryResult = fetchPositionAndQuery(eventData.utm_params);
103
+ Clickstream.sendEvent("product_wishlist_add", {
104
+ ...payload,
105
+ ...queryResult,
73
106
  })
74
107
  .then((resp) => {
75
108
  Logger({ level: "DEBUG", message: "Click event sent" });
@@ -105,7 +138,7 @@ if (typeof window != "undefined") {
105
138
 
106
139
  window.FPI.event.on("cart.newProduct", (eventData) => {
107
140
  Logger({ level: "DEBUG", message: eventData });
108
- Clickstream.sendEvent("add_to_cart", {
141
+ const payload = {
109
142
  cart_id: eventData.cart_id,
110
143
  event_type: "engagement",
111
144
  product_id: sg(() => eventData.products[0]["uid"]),
@@ -117,9 +150,12 @@ if (typeof window != "undefined") {
117
150
  price: sg(() => eventData.products[0]["price"]["selling"]),
118
151
  quantity: sg(() => eventData.products[0]["quantity"]["current"]),
119
152
  source_url: "TODO",
120
- position: "TODO",
153
+ position: null,
154
+ query: null,
121
155
  value: "TODO",
122
- })
156
+ };
157
+ const queryResult = fetchPositionAndQuery(eventData.utm_params);
158
+ Clickstream.sendEvent("add_to_cart", { ...payload, ...queryResult })
123
159
  .then((resp) => {
124
160
  Logger({ level: "DEBUG", message: "Click event sent" });
125
161
  })
@@ -141,7 +177,7 @@ if (typeof window != "undefined") {
141
177
  price: sg(() => eventData.products[0]["price"]["selling"]),
142
178
  quantity: sg(() => eventData.products[0]["quantity"]["current"]),
143
179
  source_url: "TODO",
144
- position: "TODO",
180
+ position: null,
145
181
  value: "TODO",
146
182
  })
147
183
  .then((resp) => {
@@ -212,9 +248,30 @@ if (typeof window != "undefined") {
212
248
  });
213
249
  });
214
250
 
251
+ window.FPI.event.on("product_list.view", (eventData) => {
252
+ Logger({ level: "DEBUG", message: eventData });
253
+ Clickstream.sendEvent("product_listing", {
254
+ event_type: "impression",
255
+ query: sg(() => eventData.slug["q"]),
256
+ products: eventData.items.map((p) => {
257
+ return {
258
+ product_id: p.uid,
259
+ name: p.name,
260
+ currency: sg(() => p.price["effective"]["currency_code"]),
261
+ mrp: sg(() => p.price["effective"]["max"]),
262
+ esp: sg(() => p.price["effective"]["min"]),
263
+ source_url: p.url,
264
+ brand: sg(() => p.brand["name"]),
265
+ };
266
+ }),
267
+
268
+ item_total: sg(() => eventData["page"]["item_total"]),
269
+ });
270
+ });
271
+
215
272
  window.FPI.event.on("product.view", (eventData) => {
216
273
  Logger({ level: "DEBUG", message: eventData });
217
- Clickstream.sendEvent("product_view", {
274
+ const payload = {
218
275
  event_type: "click",
219
276
  product_id: sg(() => eventData.product["uid"]),
220
277
  currency: sg(() => eventData.product.price["currency_code"]),
@@ -225,8 +282,11 @@ if (typeof window != "undefined") {
225
282
  l1_category: sg(() => eventData.product.l1_category),
226
283
  source_url: sg(() => eventData.product.source_url),
227
284
  quantity: sg(() => eventData.product.sizes[0]["quantity"]),
228
- position: "TODO",
229
- })
285
+ position: null,
286
+ query: null,
287
+ };
288
+ const queryResult = fetchPositionAndQuery(eventData.utm_params);
289
+ Clickstream.sendEvent("product_view", { ...payload, ...queryResult })
230
290
  .then((resp) => {
231
291
  Logger({ level: "DEBUG", message: "Click event sent" });
232
292
  })
@@ -237,16 +297,36 @@ if (typeof window != "undefined") {
237
297
 
238
298
  window.FPI.event.on("search.products", (eventData) => {
239
299
  Logger({ level: "DEBUG", message: eventData });
240
- Clickstream.sendEvent("product_search", {
300
+ const payload = {
241
301
  event_type: "search",
242
302
  query: eventData.search_text,
243
- })
244
- .then((resp) => {
245
- Logger({ level: "DEBUG", message: "Click event sent" });
303
+ products: [],
304
+ item_total: null,
305
+ };
306
+ //filter eventData.data to find the products array and item total
307
+ const products = eventData.data
308
+ .filter((item) => {
309
+ if ((item["type"] === "product" && item.categories) || item.product)
310
+ return true;
246
311
  })
247
- .catch((err) => {
248
- Logger({ level: "ERROR", message: err });
312
+ .map((product) => {
313
+ return product.display || product.name;
249
314
  });
315
+ const item_total = sg(() => eventData.page["item_total"]);
316
+ if (payload.query) {
317
+ //only if query is present
318
+ Clickstream.sendEvent("product_search", {
319
+ ...payload,
320
+ products,
321
+ item_total,
322
+ })
323
+ .then((resp) => {
324
+ Logger({ level: "DEBUG", message: "Click event sent" });
325
+ })
326
+ .catch((err) => {
327
+ Logger({ level: "ERROR", message: err });
328
+ });
329
+ }
250
330
  });
251
331
 
252
332
  window.FPI.event.on("product_list.filter", (eventData) => {
@@ -12,6 +12,7 @@ export namespace AVAILABLE_PAGE_TYPE {
12
12
  const COLLECTIONS: string;
13
13
  const CONTACT_US: string;
14
14
  const EXTERNAL: string;
15
+ const CUSTOM: string;
15
16
  const FAQ: string;
16
17
  const FRESHCHAT: string;
17
18
  const HOME: string;
@@ -127,6 +128,14 @@ export const NAVIGATORS: {
127
128
  required: boolean;
128
129
  }[];
129
130
  };
131
+ custom: {
132
+ name: string;
133
+ link: string;
134
+ query: {
135
+ key: string;
136
+ required: boolean;
137
+ }[];
138
+ };
130
139
  faq: {
131
140
  name: string;
132
141
  link: string;
@@ -12,6 +12,7 @@ const AVAILABLE_PAGE_TYPE = {
12
12
  COLLECTIONS: "collections",
13
13
  CONTACT_US: "contact-us",
14
14
  EXTERNAL: "external",
15
+ CUSTOM: "custom",
15
16
  FAQ: "faq",
16
17
  FRESHCHAT: "freshchat",
17
18
  HOME: "home",
@@ -144,6 +145,16 @@ const NAVIGATORS = {
144
145
  },
145
146
  ],
146
147
  },
148
+ custom: {
149
+ name: "Custom theme link",
150
+ link: "/c/",
151
+ query: [
152
+ {
153
+ key: "url",
154
+ required: true,
155
+ },
156
+ ],
157
+ },
147
158
  faq: {
148
159
  name: "FAQ",
149
160
  link: "/faq",
@@ -31,6 +31,20 @@ function convertUrlToAction(url) {
31
31
  return utils.trimChar(pageType) === bestMatchingLink.value;
32
32
  });
33
33
  const closestMatchingNavKey = typeLink[closestMatchingNavLink] || "home";
34
+ // if it is custom theme link url should be in query object, also we will grab our main link from this url field in convertActionToUrl
35
+ if (closestMatchingNavLink === Constant.NAVIGATORS.custom.link) {
36
+ return {
37
+ type: "page",
38
+ page: {
39
+ type: closestMatchingNavKey,
40
+ query: {
41
+ url: [url.split("?")[0]],
42
+ ...query,
43
+ },
44
+ params: bestMatchingLink.params,
45
+ },
46
+ };
47
+ }
34
48
  return {
35
49
  type: "page",
36
50
  page: {
@@ -57,6 +71,11 @@ function convertActionToUrl(action) {
57
71
  case utils.NAV_TYPE.PAGE: {
58
72
  const item = Object.assign({}, Constant.NAVIGATORS[action.page.type]);
59
73
  if (item) {
74
+ // If it is custom action object then we need to get out link from query.url, in custom page action object url in query is original link, so get link from there and remove the url field
75
+ if (action.page.type === Constant.AVAILABLE_PAGE_TYPE.CUSTOM) {
76
+ item.link = action.page.query.url[0];
77
+ delete action.page.query.url;
78
+ }
60
79
  //get param
61
80
  item.link = utils.generateUrlWithParams(item, action.page.params);
62
81
  //get query
@@ -112,7 +112,14 @@ const findBestMatchingLink = (allLinks = [], pathname = "/") => {
112
112
  pathname = trimChar(pathname); // -> product/test-product-tag/reviews
113
113
  for (let i = 0; i < allLinks.length; i++) {
114
114
  let link = trimChar(allLinks[i]); // -> product/:slug/add-reviews
115
- if (new RegExp(`^${trimChar(link)}`).test(pathname)) {
115
+
116
+ const firstLinkMatch = trimChar(link).split("/")[0];
117
+ const firstPathMatch = trimChar(pathname).split("/")[0];
118
+ // atleast first string from path should match, if you don't add this condition then it will give link 'c' for 'collection' path name
119
+ if (
120
+ new RegExp(`^${trimChar(link)}`).test(pathname) &&
121
+ firstLinkMatch.length === firstPathMatch.length
122
+ ) {
116
123
  bestMatch.value = link;
117
124
  break;
118
125
  }
@@ -7,13 +7,13 @@ export = LeadPartnerModel;
7
7
  */
8
8
  /**
9
9
  * @typedef Page
10
- * @property {number} [item_total]
11
- * @property {string} [next_id]
12
- * @property {boolean} [has_previous]
13
- * @property {boolean} [has_next]
14
- * @property {number} [current]
15
- * @property {string} type
16
- * @property {number} [size]
10
+ * @property {number} [item_total] - The total number of items on the page.
11
+ * @property {string} [next_id] - The identifier for the next page.
12
+ * @property {boolean} [has_previous] - Indicates whether there is a previous page.
13
+ * @property {boolean} [has_next] - Indicates whether there is a next page.
14
+ * @property {number} [current] - The current page number.
15
+ * @property {string} type - The type of the page, such as 'PageType'.
16
+ * @property {number} [size] - The number of items per page.
17
17
  */
18
18
  /**
19
19
  * @typedef TicketHistoryList
@@ -194,12 +194,33 @@ type TicketList = {
194
194
  /** @returns {Page} */
195
195
  declare function Page(): Page;
196
196
  type Page = {
197
+ /**
198
+ * - The total number of items on the page.
199
+ */
197
200
  item_total?: number;
201
+ /**
202
+ * - The identifier for the next page.
203
+ */
198
204
  next_id?: string;
205
+ /**
206
+ * - Indicates whether there is a previous page.
207
+ */
199
208
  has_previous?: boolean;
209
+ /**
210
+ * - Indicates whether there is a next page.
211
+ */
200
212
  has_next?: boolean;
213
+ /**
214
+ * - The current page number.
215
+ */
201
216
  current?: number;
217
+ /**
218
+ * - The type of the page, such as 'PageType'.
219
+ */
202
220
  type: string;
221
+ /**
222
+ * - The number of items per page.
223
+ */
203
224
  size?: number;
204
225
  };
205
226
  /** @returns {TicketHistoryList} */