@gofynd/fdk-client-javascript 1.4.2-beta.4 → 1.4.2-beta.6
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/README.md +1 -1
- package/package.json +3 -2
- package/sdk/application/ApplicationClient.js +20 -0
- package/sdk/application/Cart/CartApplicationClient.d.ts +62 -62
- package/sdk/application/Cart/CartApplicationClient.js +82 -71
- package/sdk/application/Cart/CartApplicationValidator.d.ts +189 -34
- package/sdk/application/Cart/CartApplicationValidator.js +59 -34
- package/sdk/application/Catalog/CatalogApplicationClient.d.ts +78 -78
- package/sdk/application/Catalog/CatalogApplicationClient.js +78 -78
- package/sdk/application/Common/CommonApplicationClient.d.ts +4 -4
- package/sdk/application/Common/CommonApplicationClient.js +4 -4
- package/sdk/application/Communication/CommunicationApplicationClient.d.ts +6 -6
- package/sdk/application/Communication/CommunicationApplicationClient.js +6 -6
- package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +32 -67
- package/sdk/application/Configuration/ConfigurationApplicationClient.js +32 -106
- package/sdk/application/Content/ContentApplicationClient.d.ts +34 -64
- package/sdk/application/Content/ContentApplicationClient.js +34 -115
- package/sdk/application/FileStorage/FileStorageApplicationClient.d.ts +6 -42
- package/sdk/application/FileStorage/FileStorageApplicationClient.js +6 -42
- package/sdk/application/Lead/LeadApplicationClient.d.ts +14 -14
- package/sdk/application/Lead/LeadApplicationClient.js +14 -14
- package/sdk/application/Lead/LeadApplicationModel.js +1 -1
- package/sdk/application/Logistic/LogisticApplicationClient.d.ts +12 -12
- package/sdk/application/Logistic/LogisticApplicationClient.js +12 -12
- package/sdk/application/Order/OrderApplicationClient.d.ts +24 -24
- package/sdk/application/Order/OrderApplicationClient.js +24 -24
- package/sdk/application/Order/OrderApplicationModel.d.ts +23 -1
- package/sdk/application/Order/OrderApplicationModel.js +28 -0
- package/sdk/application/Payment/PaymentApplicationClient.d.ts +89 -89
- package/sdk/application/Payment/PaymentApplicationClient.js +94 -94
- package/sdk/application/Payment/PaymentApplicationModel.d.ts +498 -3
- package/sdk/application/Payment/PaymentApplicationModel.js +316 -2
- package/sdk/application/Payment/PaymentApplicationValidator.d.ts +5 -5
- package/sdk/application/Payment/PaymentApplicationValidator.js +3 -3
- package/sdk/application/PosCart/PosCartApplicationClient.d.ts +54 -54
- package/sdk/application/PosCart/PosCartApplicationClient.js +54 -54
- package/sdk/application/Rewards/RewardsApplicationClient.d.ts +14 -25
- package/sdk/application/Rewards/RewardsApplicationClient.js +14 -41
- package/sdk/application/Share/ShareApplicationClient.d.ts +14 -14
- package/sdk/application/Share/ShareApplicationClient.js +14 -14
- package/sdk/application/Share/ShareApplicationModel.d.ts +0 -4
- package/sdk/application/Share/ShareApplicationModel.js +0 -4
- package/sdk/application/Theme/ThemeApplicationClient.d.ts +8 -8
- package/sdk/application/Theme/ThemeApplicationClient.js +8 -8
- package/sdk/application/User/UserApplicationClient.d.ts +64 -64
- package/sdk/application/User/UserApplicationClient.js +64 -64
- package/sdk/common/Clickstream.d.ts +1 -0
- package/sdk/common/Clickstream.js +246 -0
- package/sdk/common/Utility.js +1 -4
- package/sdk/partner/Lead/LeadPartnerModel.js +1 -1
- package/sdk/partner/Theme/ThemePartnerClient.d.ts +38 -38
- package/sdk/partner/Theme/ThemePartnerClient.js +38 -38
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.d.ts +8 -8
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +8 -8
- package/sdk/platform/Billing/BillingPlatformClient.d.ts +34 -36
- package/sdk/platform/Billing/BillingPlatformClient.js +34 -36
- package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +98 -175
- package/sdk/platform/Cart/CartPlatformApplicationClient.js +98 -254
- package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +92 -18
- package/sdk/platform/Cart/CartPlatformApplicationValidator.js +28 -18
- package/sdk/platform/Cart/CartPlatformModel.d.ts +12 -0
- package/sdk/platform/Cart/CartPlatformModel.js +12 -0
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +195 -108
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +278 -113
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +2 -2
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +2 -2
- package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +335 -136
- package/sdk/platform/Catalog/CatalogPlatformClient.js +551 -136
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +5 -5
- package/sdk/platform/Catalog/CatalogPlatformModel.js +3 -3
- package/sdk/platform/Common/CommonPlatformClient.d.ts +3 -3
- package/sdk/platform/Common/CommonPlatformClient.js +3 -3
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +115 -290
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +115 -510
- package/sdk/platform/Communication/CommunicationPlatformClient.d.ts +2 -13
- package/sdk/platform/Communication/CommunicationPlatformClient.js +2 -29
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +32 -32
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +32 -32
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +52 -127
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +52 -204
- package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +35 -111
- package/sdk/platform/Configuration/ConfigurationPlatformClient.js +35 -212
- package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +142 -1
- package/sdk/platform/Configuration/ConfigurationPlatformModel.js +96 -0
- package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +130 -218
- package/sdk/platform/Content/ContentPlatformApplicationClient.js +136 -314
- package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +4 -4
- package/sdk/platform/Content/ContentPlatformApplicationValidator.js +4 -4
- package/sdk/platform/Content/ContentPlatformClient.d.ts +1 -1
- package/sdk/platform/Content/ContentPlatformClient.js +7 -7
- package/sdk/platform/Content/ContentPlatformValidator.d.ts +4 -4
- package/sdk/platform/Content/ContentPlatformValidator.js +4 -4
- package/sdk/platform/Discount/DiscountPlatformClient.d.ts +22 -48
- package/sdk/platform/Discount/DiscountPlatformClient.js +22 -73
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +20 -56
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +20 -59
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.d.ts +0 -2
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.js +0 -2
- package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +14 -50
- package/sdk/platform/FileStorage/FileStoragePlatformClient.js +16 -55
- package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +13 -14
- package/sdk/platform/FileStorage/FileStoragePlatformModel.js +12 -16
- package/sdk/platform/Finance/FinancePlatformClient.d.ts +44 -44
- package/sdk/platform/Finance/FinancePlatformClient.js +44 -44
- package/sdk/platform/Lead/LeadPlatformApplicationClient.d.ts +12 -12
- package/sdk/platform/Lead/LeadPlatformApplicationClient.js +12 -12
- package/sdk/platform/Lead/LeadPlatformClient.d.ts +22 -48
- package/sdk/platform/Lead/LeadPlatformClient.js +22 -72
- package/sdk/platform/Lead/LeadPlatformModel.js +1 -1
- package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +4 -4
- package/sdk/platform/Order/OrderPlatformApplicationClient.js +4 -4
- package/sdk/platform/Order/OrderPlatformClient.d.ts +79 -208
- package/sdk/platform/Order/OrderPlatformClient.js +79 -294
- package/sdk/platform/Order/OrderPlatformModel.d.ts +32 -3
- package/sdk/platform/Order/OrderPlatformModel.js +34 -2
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.d.ts +4 -4
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.js +4 -4
- package/sdk/platform/Partner/PartnerPlatformApplicationValidator.d.ts +4 -4
- package/sdk/platform/Partner/PartnerPlatformApplicationValidator.js +2 -2
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +81 -81
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +81 -81
- package/sdk/platform/Payment/PaymentPlatformClient.d.ts +20 -20
- package/sdk/platform/Payment/PaymentPlatformClient.js +20 -20
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.d.ts +23 -40
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +23 -61
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.d.ts +8 -8
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.js +8 -8
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +5 -5
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +8 -8
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +4 -0
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +5 -1
- package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.d.ts +2 -2
- package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.js +2 -2
- package/sdk/platform/Share/SharePlatformApplicationClient.d.ts +10 -10
- package/sdk/platform/Share/SharePlatformApplicationClient.js +10 -10
- package/sdk/platform/Share/SharePlatformModel.d.ts +0 -4
- package/sdk/platform/Share/SharePlatformModel.js +0 -4
- package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +56 -56
- package/sdk/platform/Theme/ThemePlatformApplicationClient.js +56 -56
- package/sdk/platform/Theme/ThemePlatformClient.d.ts +6 -6
- package/sdk/platform/Theme/ThemePlatformClient.js +6 -6
- package/sdk/platform/User/UserPlatformApplicationClient.d.ts +33 -33
- package/sdk/platform/User/UserPlatformApplicationClient.js +33 -33
- package/sdk/platform/User/UserPlatformModel.d.ts +4 -4
- package/sdk/platform/User/UserPlatformModel.js +4 -4
- package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +32 -45
- package/sdk/platform/Webhook/WebhookPlatformClient.js +32 -45
- package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +58 -1
- package/sdk/platform/Webhook/WebhookPlatformModel.js +66 -0
- package/sdk/public/Configuration/ConfigurationPublicClient.d.ts +2 -2
- package/sdk/public/Configuration/ConfigurationPublicClient.js +2 -2
- package/sdk/public/Partner/PartnerPublicClient.d.ts +2 -2
- package/sdk/public/Partner/PartnerPublicClient.js +2 -2
- package/sdk/public/Webhook/WebhookPublicClient.d.ts +4 -4
- package/sdk/public/Webhook/WebhookPublicClient.js +4 -4
|
@@ -108,8 +108,8 @@ class User {
|
|
|
108
108
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
109
109
|
* @returns {Promise<UserApplicationModel.VerifyEmailOTPSuccess>} - Success response
|
|
110
110
|
* @name addEmail
|
|
111
|
-
* @summary: Add email
|
|
112
|
-
* @description:
|
|
111
|
+
* @summary: Add email.
|
|
112
|
+
* @description: Adds a new email address to the user's profile. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/user/addEmail/).
|
|
113
113
|
*/
|
|
114
114
|
async addEmail(
|
|
115
115
|
{ body, platform, requestHeaders } = { requestHeaders: {} },
|
|
@@ -185,8 +185,8 @@ class User {
|
|
|
185
185
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
186
186
|
* @returns {Promise<UserApplicationModel.VerifyMobileOTPSuccess>} - Success response
|
|
187
187
|
* @name addMobileNumber
|
|
188
|
-
* @summary: Add mobile
|
|
189
|
-
* @description:
|
|
188
|
+
* @summary: Add mobile.
|
|
189
|
+
* @description: Adds a new mobile number to the user's profile. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/user/addMobileNumber/).
|
|
190
190
|
*/
|
|
191
191
|
async addMobileNumber(
|
|
192
192
|
{ body, platform, requestHeaders } = { requestHeaders: {} },
|
|
@@ -264,8 +264,8 @@ class User {
|
|
|
264
264
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
265
265
|
* @returns {Promise<UserApplicationModel.LoginSuccess>} - Success response
|
|
266
266
|
* @name deleteEmail
|
|
267
|
-
* @summary: Delete email
|
|
268
|
-
* @description:
|
|
267
|
+
* @summary: Delete email.
|
|
268
|
+
* @description: Removes an email address from the user's profile. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/user/deleteEmail/).
|
|
269
269
|
*/
|
|
270
270
|
async deleteEmail(
|
|
271
271
|
{ active, primary, verified, email, platform, requestHeaders } = {
|
|
@@ -515,8 +515,8 @@ class User {
|
|
|
515
515
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
516
516
|
* @returns {Promise<UserApplicationModel.LoginSuccess>} - Success response
|
|
517
517
|
* @name forgotPassword
|
|
518
|
-
* @summary: Forgot
|
|
519
|
-
* @description:
|
|
518
|
+
* @summary: Forgot password.
|
|
519
|
+
* @description: Initiates the password recovery process for the user. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/user/forgotPassword/).
|
|
520
520
|
*/
|
|
521
521
|
async forgotPassword(
|
|
522
522
|
{ body, requestHeaders } = { requestHeaders: {} },
|
|
@@ -673,8 +673,8 @@ class User {
|
|
|
673
673
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
674
674
|
* @returns {Promise<UserApplicationModel.UserObjectSchema>} - Success response
|
|
675
675
|
* @name getLoggedInUser
|
|
676
|
-
* @summary:
|
|
677
|
-
* @description:
|
|
676
|
+
* @summary: Current user.
|
|
677
|
+
* @description: Retrieve information about the currently logged-in user. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/user/getLoggedInUser/).
|
|
678
678
|
*/
|
|
679
679
|
async getLoggedInUser(
|
|
680
680
|
{ requestHeaders } = { requestHeaders: {} },
|
|
@@ -751,8 +751,8 @@ class User {
|
|
|
751
751
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
752
752
|
* @returns {Promise<UserApplicationModel.PlatformSchema>} - Success response
|
|
753
753
|
* @name getPlatformConfig
|
|
754
|
-
* @summary:
|
|
755
|
-
* @description:
|
|
754
|
+
* @summary: Platform config.
|
|
755
|
+
* @description: Retrieve configuration settings related to the user platform. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/user/getPlatformConfig/).
|
|
756
756
|
*/
|
|
757
757
|
async getPlatformConfig(
|
|
758
758
|
{ name, requestHeaders } = { requestHeaders: {} },
|
|
@@ -909,8 +909,8 @@ class User {
|
|
|
909
909
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
910
910
|
* @returns {Promise<UserApplicationModel.HasPasswordSuccess>} - Success response
|
|
911
911
|
* @name hasPassword
|
|
912
|
-
* @summary: Check password
|
|
913
|
-
* @description:
|
|
912
|
+
* @summary: Check password.
|
|
913
|
+
* @description: Checks if the user has set a password for the account. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/user/hasPassword/).
|
|
914
914
|
*/
|
|
915
915
|
async hasPassword(
|
|
916
916
|
{ requestHeaders } = { requestHeaders: {} },
|
|
@@ -985,8 +985,8 @@ class User {
|
|
|
985
985
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
986
986
|
* @returns {Promise<UserApplicationModel.AuthSuccess>} - Success response
|
|
987
987
|
* @name loginWithAppleIOS
|
|
988
|
-
* @summary:
|
|
989
|
-
* @description:
|
|
988
|
+
* @summary: Apple iOS login.
|
|
989
|
+
* @description: Enables login through Apple ID specifically for iOS users. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/user/loginWithAppleIOS/).
|
|
990
990
|
*/
|
|
991
991
|
async loginWithAppleIOS(
|
|
992
992
|
{ body, platform, requestHeaders } = { requestHeaders: {} },
|
|
@@ -1064,8 +1064,8 @@ class User {
|
|
|
1064
1064
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1065
1065
|
* @returns {Promise<UserApplicationModel.LoginSuccess>} - Success response
|
|
1066
1066
|
* @name loginWithEmailAndPassword
|
|
1067
|
-
* @summary:
|
|
1068
|
-
* @description:
|
|
1067
|
+
* @summary: Email/password login.
|
|
1068
|
+
* @description: Enables login using an email and password combination. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/user/loginWithEmailAndPassword/).
|
|
1069
1069
|
*/
|
|
1070
1070
|
async loginWithEmailAndPassword(
|
|
1071
1071
|
{ body, requestHeaders } = { requestHeaders: {} },
|
|
@@ -1144,8 +1144,8 @@ class User {
|
|
|
1144
1144
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1145
1145
|
* @returns {Promise<UserApplicationModel.AuthSuccess>} - Success response
|
|
1146
1146
|
* @name loginWithFacebook
|
|
1147
|
-
* @summary:
|
|
1148
|
-
* @description:
|
|
1147
|
+
* @summary: Facebook login.
|
|
1148
|
+
* @description: Enables login through Facebook accounts. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/user/loginWithFacebook/).
|
|
1149
1149
|
*/
|
|
1150
1150
|
async loginWithFacebook(
|
|
1151
1151
|
{ body, platform, requestHeaders } = { requestHeaders: {} },
|
|
@@ -1223,8 +1223,8 @@ class User {
|
|
|
1223
1223
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1224
1224
|
* @returns {Promise<UserApplicationModel.AuthSuccess>} - Success response
|
|
1225
1225
|
* @name loginWithGoogle
|
|
1226
|
-
* @summary:
|
|
1227
|
-
* @description:
|
|
1226
|
+
* @summary: Google login.
|
|
1227
|
+
* @description: Enables login through Google accounts. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/user/loginWithGoogle/).
|
|
1228
1228
|
*/
|
|
1229
1229
|
async loginWithGoogle(
|
|
1230
1230
|
{ body, platform, requestHeaders } = { requestHeaders: {} },
|
|
@@ -1302,8 +1302,8 @@ class User {
|
|
|
1302
1302
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1303
1303
|
* @returns {Promise<UserApplicationModel.AuthSuccess>} - Success response
|
|
1304
1304
|
* @name loginWithGoogleAndroid
|
|
1305
|
-
* @summary:
|
|
1306
|
-
* @description:
|
|
1305
|
+
* @summary: Android Google login.
|
|
1306
|
+
* @description: Facilitates Google login specifically for Android users. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/user/loginWithGoogleAndroid/).
|
|
1307
1307
|
*/
|
|
1308
1308
|
async loginWithGoogleAndroid(
|
|
1309
1309
|
{ body, platform, requestHeaders } = { requestHeaders: {} },
|
|
@@ -1383,8 +1383,8 @@ class User {
|
|
|
1383
1383
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1384
1384
|
* @returns {Promise<UserApplicationModel.AuthSuccess>} - Success response
|
|
1385
1385
|
* @name loginWithGoogleIOS
|
|
1386
|
-
* @summary:
|
|
1387
|
-
* @description:
|
|
1386
|
+
* @summary: iOS Google login.
|
|
1387
|
+
* @description: Facilitates Google login specifically for iOS users. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/user/loginWithGoogleIOS/).
|
|
1388
1388
|
*/
|
|
1389
1389
|
async loginWithGoogleIOS(
|
|
1390
1390
|
{ body, platform, requestHeaders } = { requestHeaders: {} },
|
|
@@ -1462,8 +1462,8 @@ class User {
|
|
|
1462
1462
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1463
1463
|
* @returns {Promise<UserApplicationModel.SendOtpResponse>} - Success response
|
|
1464
1464
|
* @name loginWithOTP
|
|
1465
|
-
* @summary:
|
|
1466
|
-
* @description:
|
|
1465
|
+
* @summary: OTP login.
|
|
1466
|
+
* @description: Allows users to log in using a one-time password. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/user/loginWithOTP/).
|
|
1467
1467
|
*/
|
|
1468
1468
|
async loginWithOTP(
|
|
1469
1469
|
{ body, platform, requestHeaders } = { requestHeaders: {} },
|
|
@@ -1695,8 +1695,8 @@ class User {
|
|
|
1695
1695
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1696
1696
|
* @returns {Promise<UserApplicationModel.RegisterFormSuccess>} - Success response
|
|
1697
1697
|
* @name registerWithForm
|
|
1698
|
-
* @summary:
|
|
1699
|
-
* @description:
|
|
1698
|
+
* @summary: User registration.
|
|
1699
|
+
* @description: Enables new users to register using a form. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/user/registerWithForm/).
|
|
1700
1700
|
*/
|
|
1701
1701
|
async registerWithForm(
|
|
1702
1702
|
{ body, platform, requestHeaders } = { requestHeaders: {} },
|
|
@@ -1775,8 +1775,8 @@ class User {
|
|
|
1775
1775
|
* @returns {Promise<UserApplicationModel.ResetForgotPasswordSuccess>} -
|
|
1776
1776
|
* Success response
|
|
1777
1777
|
* @name resetForgotPassword
|
|
1778
|
-
* @summary:
|
|
1779
|
-
* @description:
|
|
1778
|
+
* @summary: Forgot password.
|
|
1779
|
+
* @description: Initiates the password recovery process for the user. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/user/resetForgotPassword/).
|
|
1780
1780
|
*/
|
|
1781
1781
|
async resetForgotPassword(
|
|
1782
1782
|
{ body, requestHeaders } = { requestHeaders: {} },
|
|
@@ -1853,8 +1853,8 @@ class User {
|
|
|
1853
1853
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1854
1854
|
* @returns {Promise<UserApplicationModel.EmailOtpSuccess>} - Success response
|
|
1855
1855
|
* @name sendForgotOTPOnEmail
|
|
1856
|
-
* @summary: Send Forgot OTP
|
|
1857
|
-
* @description:
|
|
1856
|
+
* @summary: Send Forgot OTP Email
|
|
1857
|
+
* @description: Sends a one-time password to the user's forgot email for verification request. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/user/sendForgotOTPOnEmail/).
|
|
1858
1858
|
*/
|
|
1859
1859
|
async sendForgotOTPOnEmail(
|
|
1860
1860
|
{ body, platform, requestHeaders } = { requestHeaders: {} },
|
|
@@ -1932,8 +1932,8 @@ class User {
|
|
|
1932
1932
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1933
1933
|
* @returns {Promise<UserApplicationModel.OtpSuccess>} - Success response
|
|
1934
1934
|
* @name sendForgotOTPOnMobile
|
|
1935
|
-
* @summary: Send
|
|
1936
|
-
* @description:
|
|
1935
|
+
* @summary: Send forgot OTP on mobile
|
|
1936
|
+
* @description: Sends a one-time password to the user's forgot mobile for verification request. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/user/sendForgotOTPOnMobile/).
|
|
1937
1937
|
*/
|
|
1938
1938
|
async sendForgotOTPOnMobile(
|
|
1939
1939
|
{ body, platform, requestHeaders } = { requestHeaders: {} },
|
|
@@ -2011,8 +2011,8 @@ class User {
|
|
|
2011
2011
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
2012
2012
|
* @returns {Promise<UserApplicationModel.EmailOtpSuccess>} - Success response
|
|
2013
2013
|
* @name sendOTPOnEmail
|
|
2014
|
-
* @summary: Send OTP
|
|
2015
|
-
* @description:
|
|
2014
|
+
* @summary: Send email OTP.
|
|
2015
|
+
* @description: Sends a one-time password to the user's email for verification. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/user/sendOTPOnEmail/).
|
|
2016
2016
|
*/
|
|
2017
2017
|
async sendOTPOnEmail(
|
|
2018
2018
|
{ body, platform, requestHeaders } = { requestHeaders: {} },
|
|
@@ -2090,8 +2090,8 @@ class User {
|
|
|
2090
2090
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
2091
2091
|
* @returns {Promise<UserApplicationModel.OtpSuccess>} - Success response
|
|
2092
2092
|
* @name sendOTPOnMobile
|
|
2093
|
-
* @summary: Send OTP
|
|
2094
|
-
* @description:
|
|
2093
|
+
* @summary: Send mobile OTP.
|
|
2094
|
+
* @description: Sends a one-time password to the user's mobile for verification. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/user/sendOTPOnMobile/).
|
|
2095
2095
|
*/
|
|
2096
2096
|
async sendOTPOnMobile(
|
|
2097
2097
|
{ body, platform, requestHeaders } = { requestHeaders: {} },
|
|
@@ -2169,8 +2169,8 @@ class User {
|
|
|
2169
2169
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
2170
2170
|
* @returns {Promise<UserApplicationModel.ResetPasswordSuccess>} - Success response
|
|
2171
2171
|
* @name sendResetPasswordEmail
|
|
2172
|
-
* @summary: Reset
|
|
2173
|
-
* @description:
|
|
2172
|
+
* @summary: Reset password (Email).
|
|
2173
|
+
* @description: Sends a password reset link to the user's email. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/user/sendResetPasswordEmail/).
|
|
2174
2174
|
*/
|
|
2175
2175
|
async sendResetPasswordEmail(
|
|
2176
2176
|
{ body, platform, requestHeaders } = { requestHeaders: {} },
|
|
@@ -2250,8 +2250,8 @@ class User {
|
|
|
2250
2250
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
2251
2251
|
* @returns {Promise<any>} - Success response
|
|
2252
2252
|
* @name sendResetPasswordMobile
|
|
2253
|
-
* @summary: Reset
|
|
2254
|
-
* @description:
|
|
2253
|
+
* @summary: Reset password (Mobile).
|
|
2254
|
+
* @description: Sends a password reset OTP to the user's mobile number. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/user/sendResetPasswordMobile/).
|
|
2255
2255
|
*/
|
|
2256
2256
|
async sendResetPasswordMobile(
|
|
2257
2257
|
{ body, platform, requestHeaders } = { requestHeaders: {} },
|
|
@@ -2408,8 +2408,8 @@ class User {
|
|
|
2408
2408
|
* @returns {Promise<UserApplicationModel.SendEmailVerifyLinkSuccess>} -
|
|
2409
2409
|
* Success response
|
|
2410
2410
|
* @name sendVerificationLinkToEmail
|
|
2411
|
-
* @summary:
|
|
2412
|
-
* @description:
|
|
2411
|
+
* @summary: Verify new email.
|
|
2412
|
+
* @description: Sends a verification link to a newly added email address. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/user/sendVerificationLinkToEmail/).
|
|
2413
2413
|
*/
|
|
2414
2414
|
async sendVerificationLinkToEmail(
|
|
2415
2415
|
{ body, platform, requestHeaders } = { requestHeaders: {} },
|
|
@@ -2492,8 +2492,8 @@ class User {
|
|
|
2492
2492
|
* @returns {Promise<UserApplicationModel.SendMobileVerifyLinkSuccess>} -
|
|
2493
2493
|
* Success response
|
|
2494
2494
|
* @name sendVerificationLinkToMobile
|
|
2495
|
-
* @summary:
|
|
2496
|
-
* @description:
|
|
2495
|
+
* @summary: Verify new mobile.
|
|
2496
|
+
* @description: Sends a verification link to a newly added mobile number. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/user/sendVerificationLinkToMobile/).
|
|
2497
2497
|
*/
|
|
2498
2498
|
async sendVerificationLinkToMobile(
|
|
2499
2499
|
{ body, platform, requestHeaders } = { requestHeaders: {} },
|
|
@@ -2573,8 +2573,8 @@ class User {
|
|
|
2573
2573
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
2574
2574
|
* @returns {Promise<UserApplicationModel.LoginSuccess>} - Success response
|
|
2575
2575
|
* @name setEmailAsPrimary
|
|
2576
|
-
* @summary: Set email
|
|
2577
|
-
* @description:
|
|
2576
|
+
* @summary: Set primary email.
|
|
2577
|
+
* @description: Sets an email address as the primary contact for the user. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/user/setEmailAsPrimary/).
|
|
2578
2578
|
*/
|
|
2579
2579
|
async setEmailAsPrimary(
|
|
2580
2580
|
{ body, requestHeaders } = { requestHeaders: {} },
|
|
@@ -2651,8 +2651,8 @@ class User {
|
|
|
2651
2651
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
2652
2652
|
* @returns {Promise<UserApplicationModel.LoginSuccess>} - Success response
|
|
2653
2653
|
* @name setMobileNumberAsPrimary
|
|
2654
|
-
* @summary: Set mobile
|
|
2655
|
-
* @description:
|
|
2654
|
+
* @summary: Set primary mobile.
|
|
2655
|
+
* @description: Sets a mobile number as the primary contact for the user. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/user/setMobileNumberAsPrimary/).
|
|
2656
2656
|
*/
|
|
2657
2657
|
async setMobileNumberAsPrimary(
|
|
2658
2658
|
{ body, requestHeaders } = { requestHeaders: {} },
|
|
@@ -2731,8 +2731,8 @@ class User {
|
|
|
2731
2731
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
2732
2732
|
* @returns {Promise<UserApplicationModel.VerifyEmailSuccess>} - Success response
|
|
2733
2733
|
* @name updatePassword
|
|
2734
|
-
* @summary: Update
|
|
2735
|
-
* @description:
|
|
2734
|
+
* @summary: Update password.
|
|
2735
|
+
* @description: Allows users to update their existing password. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/user/updatePassword/).
|
|
2736
2736
|
*/
|
|
2737
2737
|
async updatePassword(
|
|
2738
2738
|
{ body, requestHeaders } = { requestHeaders: {} },
|
|
@@ -3043,8 +3043,8 @@ class User {
|
|
|
3043
3043
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
3044
3044
|
* @returns {Promise<UserApplicationModel.VerifyEmailSuccess>} - Success response
|
|
3045
3045
|
* @name verifyEmail
|
|
3046
|
-
* @summary: Verify email
|
|
3047
|
-
* @description:
|
|
3046
|
+
* @summary: Verify email.
|
|
3047
|
+
* @description: Verifies the user's email address. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/user/verifyEmail/).
|
|
3048
3048
|
*/
|
|
3049
3049
|
async verifyEmail(
|
|
3050
3050
|
{ body, requestHeaders } = { requestHeaders: {} },
|
|
@@ -3119,8 +3119,8 @@ class User {
|
|
|
3119
3119
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
3120
3120
|
* @returns {Promise<UserApplicationModel.VerifyForgotOtpSuccess>} - Success response
|
|
3121
3121
|
* @name verifyEmailForgotOTP
|
|
3122
|
-
* @summary: Verify Forgot OTP
|
|
3123
|
-
* @description:
|
|
3122
|
+
* @summary: Verify Email Forgot OTP
|
|
3123
|
+
* @description: Validates the OTP sent to the user's forgot email address request. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/user/verifyEmailForgotOTP/).
|
|
3124
3124
|
*/
|
|
3125
3125
|
async verifyEmailForgotOTP(
|
|
3126
3126
|
{ body, platform, requestHeaders } = { requestHeaders: {} },
|
|
@@ -3198,8 +3198,8 @@ class User {
|
|
|
3198
3198
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
3199
3199
|
* @returns {Promise<UserApplicationModel.VerifyOtpSuccess>} - Success response
|
|
3200
3200
|
* @name verifyEmailOTP
|
|
3201
|
-
* @summary: Verify OTP
|
|
3202
|
-
* @description:
|
|
3201
|
+
* @summary: Verify Email OTP
|
|
3202
|
+
* @description: Validates the OTP sent to the user's email address request. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/user/verifyEmailOTP/).
|
|
3203
3203
|
*/
|
|
3204
3204
|
async verifyEmailOTP(
|
|
3205
3205
|
{ body, platform, requestHeaders } = { requestHeaders: {} },
|
|
@@ -3277,8 +3277,8 @@ class User {
|
|
|
3277
3277
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
3278
3278
|
* @returns {Promise<UserApplicationModel.VerifyEmailSuccess>} - Success response
|
|
3279
3279
|
* @name verifyMobile
|
|
3280
|
-
* @summary: Verify mobile
|
|
3281
|
-
* @description:
|
|
3280
|
+
* @summary: Verify mobile.
|
|
3281
|
+
* @description: Verifies the user's mobile number. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/user/verifyMobile/).
|
|
3282
3282
|
*/
|
|
3283
3283
|
async verifyMobile(
|
|
3284
3284
|
{ body, requestHeaders } = { requestHeaders: {} },
|
|
@@ -3434,8 +3434,8 @@ class User {
|
|
|
3434
3434
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
3435
3435
|
* @returns {Promise<UserApplicationModel.VerifyOtpSuccess>} - Success response
|
|
3436
3436
|
* @name verifyMobileOTP
|
|
3437
|
-
* @summary: Verify OTP
|
|
3438
|
-
* @description:
|
|
3437
|
+
* @summary: Verify mobile OTP.
|
|
3438
|
+
* @description: Validates the OTP sent to the user's mobile. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/user/verifyMobileOTP/).
|
|
3439
3439
|
*/
|
|
3440
3440
|
async verifyMobileOTP(
|
|
3441
3441
|
{ body, platform, requestHeaders } = { requestHeaders: {} },
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
const Clickstream = require("@gofynd/flick");
|
|
2
|
+
const { Logger } = require("../common/Logger");
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Safely extracts a value from an Object of n-depth
|
|
6
|
+
*
|
|
7
|
+
* @author Nikhil Kakade
|
|
8
|
+
* @param {function} fn
|
|
9
|
+
* @param {any} [defaultValue] - Null
|
|
10
|
+
* @returns {any}
|
|
11
|
+
*/
|
|
12
|
+
const sg = function safeGet(fn, defaultValue = null) {
|
|
13
|
+
try {
|
|
14
|
+
return fn();
|
|
15
|
+
} catch (err) {
|
|
16
|
+
return defaultValue;
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
if (typeof window != "undefined") {
|
|
21
|
+
window.FPI.event.on("user.login", (eventData) => {
|
|
22
|
+
Logger({ level: "DEBUG", message: eventData });
|
|
23
|
+
Clickstream.identify(eventData["user_id"], { ...eventData }).catch(
|
|
24
|
+
(err) => {
|
|
25
|
+
Logger({ level: "ERROR", message: err });
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
window.FPI.event.on("user.update", (eventData) => {
|
|
31
|
+
Logger({ level: "DEBUG", message: eventData });
|
|
32
|
+
Clickstream.identify(eventData["used_id"], { ...eventData }).catch(
|
|
33
|
+
(err) => {
|
|
34
|
+
Logger({ level: "ERROR", message: err });
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
window.FPI.event.on("user.logout", (eventData) => {
|
|
40
|
+
Logger({ level: "DEBUG", message: eventData });
|
|
41
|
+
Clickstream.reset().catch((err) => {
|
|
42
|
+
Logger({ level: "ERROR", message: err });
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
window.FPI.event.on("wishlist.add", (eventData) => {
|
|
47
|
+
Logger({ level: "DEBUG", message: eventData });
|
|
48
|
+
Clickstream.sendEvent("product_wishlist_add", {
|
|
49
|
+
wishlist_name: "TODO",
|
|
50
|
+
wishlist_id: "TODO",
|
|
51
|
+
event_type: "click",
|
|
52
|
+
product_id: sg(() => eventData.item["uid"]),
|
|
53
|
+
brand: sg(() => eventData.item.brand["name"]),
|
|
54
|
+
l3_category: sg(() => eventData.item.categories[0]["name"]),
|
|
55
|
+
mrp: sg(() => eventData.item.price.marked.max),
|
|
56
|
+
quantity: "TODO",
|
|
57
|
+
esp: sg(() => eventData.item.price.effective.min),
|
|
58
|
+
currency: sg(() => eventData.item.price.effective.currency_code),
|
|
59
|
+
value: "TODO",
|
|
60
|
+
source_url: "TODO",
|
|
61
|
+
})
|
|
62
|
+
.then((resp) => {
|
|
63
|
+
Logger({ level: "DEBUG", message: "Click event sent" });
|
|
64
|
+
})
|
|
65
|
+
.catch((err) => {
|
|
66
|
+
Logger({ level: "ERROR", message: err });
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
window.FPI.event.on("wishlist.remove", (eventData) => {
|
|
71
|
+
Logger({ level: "DEBUG", message: eventData });
|
|
72
|
+
Clickstream.sendEvent("product_wishlist_remove", {
|
|
73
|
+
wishlist_name: "TODO",
|
|
74
|
+
wishlist_id: "TODO",
|
|
75
|
+
event_type: "click",
|
|
76
|
+
product_id: sg(() => eventData.item["uid"]),
|
|
77
|
+
brand: sg(() => eventData.item.brand["name"]),
|
|
78
|
+
l3_category: sg(() => eventData.item.categories[0]["name"]),
|
|
79
|
+
mrp: sg(() => eventData.item.price.marked.max),
|
|
80
|
+
quantity: "TODO",
|
|
81
|
+
esp: sg(() => eventData.item.price.effective.min),
|
|
82
|
+
currency: sg(() => eventData.item.price.effective.currency_code),
|
|
83
|
+
value: "TODO",
|
|
84
|
+
source_url: "TODO",
|
|
85
|
+
})
|
|
86
|
+
.then((resp) => {
|
|
87
|
+
Logger({ level: "DEBUG", message: "Click event sent" });
|
|
88
|
+
})
|
|
89
|
+
.catch((err) => {
|
|
90
|
+
Logger({ level: "ERROR", message: err });
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
window.FPI.event.on("cart.newProduct", (eventData) => {
|
|
95
|
+
Logger({ level: "DEBUG", message: eventData });
|
|
96
|
+
Clickstream.sendEvent("add_to_cart", {
|
|
97
|
+
cart_id: eventData.cart_id,
|
|
98
|
+
event_type: "click",
|
|
99
|
+
product_id: sg(() => eventData.products[0]["uid"]),
|
|
100
|
+
brand: sg(() => eventData.products[0]["brand"]["name"]),
|
|
101
|
+
l3_category: sg(() => eventData.products[0]["category"]["name"]),
|
|
102
|
+
l1_category: "TODO",
|
|
103
|
+
currency: sg(() => eventData.products[0]["price"]["currency_code"]),
|
|
104
|
+
price: sg(() => eventData.products[0]["price"]["selling"]),
|
|
105
|
+
quantity: sg(() => eventData.products[0]["quantity"]["current"]),
|
|
106
|
+
source_url: "TODO",
|
|
107
|
+
position: "TODO",
|
|
108
|
+
value: "TODO",
|
|
109
|
+
})
|
|
110
|
+
.then((resp) => {
|
|
111
|
+
Logger({ level: "DEBUG", message: "Click event sent" });
|
|
112
|
+
})
|
|
113
|
+
.catch((err) => {
|
|
114
|
+
Logger({ level: "ERROR", message: err });
|
|
115
|
+
});
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
window.FPI.event.on("cart.remove", (eventData) => {
|
|
119
|
+
Logger({ level: "DEBUG", message: eventData });
|
|
120
|
+
Clickstream.sendEvent("remove_from_cart", {
|
|
121
|
+
cart_id: eventData.cart_id,
|
|
122
|
+
event_type: "click",
|
|
123
|
+
product_id: sg(() => eventData.products[0]["uid"]),
|
|
124
|
+
brand: sg(() => eventData.products[0]["brand"]["name"]),
|
|
125
|
+
l3_category: sg(() => eventData.products[0]["category"]["name"]),
|
|
126
|
+
l1_category: "TODO",
|
|
127
|
+
currency: sg(() => eventData.products[0]["price"]["currency_code"]),
|
|
128
|
+
price: sg(() => eventData.products[0]["price"]["selling"]),
|
|
129
|
+
quantity: sg(() => eventData.products[0]["quantity"]["current"]),
|
|
130
|
+
source_url: "TODO",
|
|
131
|
+
position: "TODO",
|
|
132
|
+
value: "TODO",
|
|
133
|
+
})
|
|
134
|
+
.then((resp) => {
|
|
135
|
+
Logger({ level: "DEBUG", message: "Click event sent" });
|
|
136
|
+
})
|
|
137
|
+
.catch((err) => {
|
|
138
|
+
Logger({ level: "ERROR", message: err });
|
|
139
|
+
});
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
window.FPI.event.on("order.processed", (eventData) => {
|
|
143
|
+
Logger({ level: "DEBUG", message: eventData });
|
|
144
|
+
Clickstream.sendEvent("order_complete", {
|
|
145
|
+
event_type: "click",
|
|
146
|
+
...eventData,
|
|
147
|
+
})
|
|
148
|
+
.then((resp) => {
|
|
149
|
+
Logger({ level: "DEBUG", message: "Click event sent" });
|
|
150
|
+
})
|
|
151
|
+
.catch((err) => {
|
|
152
|
+
Logger({ level: "ERROR", message: err });
|
|
153
|
+
});
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
window.FPI.event.on("refund.success", (eventData) => {
|
|
157
|
+
Logger({ level: "DEBUG", message: eventData });
|
|
158
|
+
Clickstream.sendEvent("order_refunded", {
|
|
159
|
+
event_type: "click",
|
|
160
|
+
...eventData,
|
|
161
|
+
})
|
|
162
|
+
.then((resp) => {
|
|
163
|
+
Logger({ level: "DEBUG", message: "Click event sent" });
|
|
164
|
+
})
|
|
165
|
+
.catch((err) => {
|
|
166
|
+
Logger({ level: "ERROR", message: err });
|
|
167
|
+
});
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
window.FPI.event.on("order.checkout", (eventData) => {
|
|
171
|
+
Logger({ level: "DEBUG", message: eventData });
|
|
172
|
+
Clickstream.sendEvent("order_checkout", {
|
|
173
|
+
event_type: "click",
|
|
174
|
+
cart_id: eventData.cart_id,
|
|
175
|
+
cart_total: sg(() => eventData.breakup_values_raw["mrp_total"]),
|
|
176
|
+
items: sg(() => eventData.products.lenght),
|
|
177
|
+
shipping: sg(() => eventData.breakup_values_raw["delivery_charge"]),
|
|
178
|
+
tax: sg(() => eventData.breakup_values_raw["gst_charges"]),
|
|
179
|
+
order_total: sg(() => eventData.breakup_values_raw["total"]),
|
|
180
|
+
currency: sg(() => eventData.products[0]["price"]["currency_code"]),
|
|
181
|
+
products: eventData.products.map((p) => {
|
|
182
|
+
return {
|
|
183
|
+
product_id: p.uid,
|
|
184
|
+
l3_category: sg(() => p.category["name"]),
|
|
185
|
+
l1_category: "TODO",
|
|
186
|
+
quantity: sg(() => p.quantity["current"]),
|
|
187
|
+
price: sg(() => p.price["marked"]),
|
|
188
|
+
value: sg(() => p.price["effective"]),
|
|
189
|
+
currency: sg(() => p.price["currency_code"]),
|
|
190
|
+
};
|
|
191
|
+
}),
|
|
192
|
+
})
|
|
193
|
+
.then((resp) => {
|
|
194
|
+
Logger({ level: "DEBUG", message: "Click event sent" });
|
|
195
|
+
})
|
|
196
|
+
.catch((err) => {
|
|
197
|
+
Logger({ level: "ERROR", message: err });
|
|
198
|
+
});
|
|
199
|
+
});
|
|
200
|
+
|
|
201
|
+
window.FPI.event.on("product.view", (eventData) => {
|
|
202
|
+
Logger({ level: "DEBUG", message: eventData });
|
|
203
|
+
Clickstream.sendEvent("product_view", {
|
|
204
|
+
event_type: "click",
|
|
205
|
+
product_id: sg(() => eventData.product["uid"]),
|
|
206
|
+
currency: sg(() => eventData.product.price["currency"]),
|
|
207
|
+
brand: sg(() => eventData.product.brand["name"]),
|
|
208
|
+
l3_category: sg(() => eventData.product.l3_category),
|
|
209
|
+
mrp: sg(() => eventData.product.price.max),
|
|
210
|
+
esp: sg(() => eventData.product.price.min),
|
|
211
|
+
l1_category: sg(() => eventData.product.l1_category),
|
|
212
|
+
source_url: sg(() => eventData.product.source_url),
|
|
213
|
+
quantity: sg(() => eventData.product.sizes[0]["quantity"]),
|
|
214
|
+
position: "TODO",
|
|
215
|
+
})
|
|
216
|
+
.then((resp) => {
|
|
217
|
+
Logger({ level: "DEBUG", message: "Click event sent" });
|
|
218
|
+
})
|
|
219
|
+
.catch((err) => {
|
|
220
|
+
Logger({ level: "ERROR", message: err });
|
|
221
|
+
});
|
|
222
|
+
});
|
|
223
|
+
|
|
224
|
+
window.FPI.event.on("search.products", (eventData) => {
|
|
225
|
+
Logger({ level: "DEBUG", message: eventData });
|
|
226
|
+
Clickstream.sendEvent("product_search", {
|
|
227
|
+
type: "search",
|
|
228
|
+
query: eventData.search_text,
|
|
229
|
+
})
|
|
230
|
+
.then((resp) => {
|
|
231
|
+
Logger({ level: "DEBUG", message: "Click event sent" });
|
|
232
|
+
})
|
|
233
|
+
.catch((err) => {
|
|
234
|
+
Logger({ level: "ERROR", message: err });
|
|
235
|
+
});
|
|
236
|
+
});
|
|
237
|
+
|
|
238
|
+
window.FPI.event.on("product_list.filter", (eventData) => {
|
|
239
|
+
Logger({ level: "DEBUG", message: eventData });
|
|
240
|
+
// Clickstream.sendEvent("add_to_cart", { event_type: "conversion", product_uid: eventData.products[0]['uid'], user_id: eventData.user['user_id'], brand: eventData.products[0]['brand']['name'], category: eventData.products[0]['category']['name'], currency: eventData.products[0]['price']['currency_code'], price: eventData.products[0]['price']['selling'], quantity: eventData.products[0]['quantity']['current'], cart: [] }).then((resp) => {
|
|
241
|
+
// console.log("Event sent succesfully")
|
|
242
|
+
// }).catch(err => {
|
|
243
|
+
// console.error(err)
|
|
244
|
+
// })
|
|
245
|
+
});
|
|
246
|
+
}
|
package/sdk/common/Utility.js
CHANGED
|
@@ -30,10 +30,7 @@ function convertUrlToAction(url) {
|
|
|
30
30
|
const closestMatchingNavLink = Object.keys(typeLink).find((pageType) => {
|
|
31
31
|
return utils.trimChar(pageType) === bestMatchingLink.value;
|
|
32
32
|
});
|
|
33
|
-
const closestMatchingNavKey = typeLink[closestMatchingNavLink];
|
|
34
|
-
if (!closestMatchingNavKey) {
|
|
35
|
-
closestMatchingNavKey = "home";
|
|
36
|
-
}
|
|
33
|
+
const closestMatchingNavKey = typeLink[closestMatchingNavLink] || "home";
|
|
37
34
|
return {
|
|
38
35
|
type: "page",
|
|
39
36
|
page: {
|