@gofynd/fdk-client-javascript 1.4.2-beta.7 → 1.4.3
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 +5 -3
- package/sdk/application/ApplicationAPIClient.d.ts +1 -1
- package/sdk/application/ApplicationAPIClient.js +0 -1
- package/sdk/application/Cart/CartApplicationClient.d.ts +25 -25
- package/sdk/application/Cart/CartApplicationClient.js +25 -25
- package/sdk/application/Catalog/CatalogApplicationClient.d.ts +40 -40
- package/sdk/application/Catalog/CatalogApplicationClient.js +40 -40
- package/sdk/application/Common/CommonApplicationClient.d.ts +2 -2
- package/sdk/application/Common/CommonApplicationClient.js +2 -2
- package/sdk/application/Communication/CommunicationApplicationClient.d.ts +3 -3
- package/sdk/application/Communication/CommunicationApplicationClient.js +3 -3
- package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +16 -16
- package/sdk/application/Configuration/ConfigurationApplicationClient.js +16 -16
- package/sdk/application/Content/ContentApplicationClient.d.ts +10 -10
- package/sdk/application/Content/ContentApplicationClient.js +10 -10
- package/sdk/application/Content/ContentApplicationModel.d.ts +18 -18
- package/sdk/application/Content/ContentApplicationModel.js +26 -26
- package/sdk/application/FileStorage/FileStorageApplicationClient.d.ts +2 -2
- package/sdk/application/FileStorage/FileStorageApplicationClient.js +12 -6
- package/sdk/application/Lead/LeadApplicationClient.d.ts +7 -7
- package/sdk/application/Lead/LeadApplicationClient.js +7 -7
- package/sdk/application/Lead/LeadApplicationModel.d.ts +64 -77
- package/sdk/application/Lead/LeadApplicationModel.js +42 -52
- package/sdk/application/Logistic/LogisticApplicationClient.d.ts +9 -9
- package/sdk/application/Logistic/LogisticApplicationClient.js +9 -9
- package/sdk/application/Order/OrderApplicationClient.d.ts +12 -12
- package/sdk/application/Order/OrderApplicationClient.js +12 -12
- package/sdk/application/Payment/PaymentApplicationClient.d.ts +47 -47
- package/sdk/application/Payment/PaymentApplicationClient.js +52 -52
- package/sdk/application/Payment/PaymentApplicationModel.d.ts +5 -2
- package/sdk/application/Payment/PaymentApplicationModel.js +4 -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 +27 -27
- package/sdk/application/PosCart/PosCartApplicationClient.js +27 -27
- package/sdk/application/Rewards/RewardsApplicationClient.d.ts +6 -6
- package/sdk/application/Rewards/RewardsApplicationClient.js +6 -6
- package/sdk/application/Share/ShareApplicationClient.d.ts +7 -7
- package/sdk/application/Share/ShareApplicationClient.js +7 -7
- package/sdk/application/Share/ShareApplicationModel.d.ts +2 -0
- package/sdk/application/Share/ShareApplicationModel.js +2 -0
- package/sdk/application/Theme/ThemeApplicationClient.d.ts +4 -4
- package/sdk/application/Theme/ThemeApplicationClient.js +4 -4
- package/sdk/application/Theme/ThemeApplicationModel.d.ts +25 -32
- package/sdk/application/Theme/ThemeApplicationModel.js +30 -40
- package/sdk/application/User/UserApplicationClient.d.ts +28 -28
- package/sdk/application/User/UserApplicationClient.js +28 -28
- package/sdk/application/User/UserApplicationModel.d.ts +44 -13
- package/sdk/application/User/UserApplicationModel.js +17 -13
- package/sdk/common/AxiosHelper.d.ts +1 -1
- package/sdk/common/AxiosHelper.js +38 -17
- package/sdk/common/Clickstream.js +22 -16
- package/sdk/common/curlHelper.js +1 -3
- package/sdk/common/utils.d.ts +15 -0
- package/sdk/common/utils.js +30 -0
- package/sdk/partner/FileStorage/FileStoragePartnerClient.d.ts +2 -2
- package/sdk/partner/FileStorage/FileStoragePartnerClient.js +2 -2
- package/sdk/partner/Lead/LeadPartnerClient.d.ts +1 -1
- package/sdk/partner/Lead/LeadPartnerClient.js +1 -1
- package/sdk/partner/Logistics/LogisticsPartnerClient.d.ts +4 -4
- package/sdk/partner/Logistics/LogisticsPartnerClient.js +4 -4
- package/sdk/partner/OAuthClient.d.ts +3 -3
- package/sdk/partner/PartnerAPIClient.d.ts +1 -1
- package/sdk/partner/PartnerAPIClient.js +0 -1
- package/sdk/partner/Theme/ThemePartnerClient.d.ts +19 -19
- package/sdk/partner/Theme/ThemePartnerClient.js +19 -19
- package/sdk/partner/Theme/ThemePartnerModel.d.ts +25 -32
- package/sdk/partner/Theme/ThemePartnerModel.js +30 -40
- package/sdk/partner/Webhook/WebhookPartnerClient.d.ts +2 -2
- package/sdk/partner/Webhook/WebhookPartnerClient.js +2 -2
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.d.ts +4 -4
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +4 -4
- package/sdk/platform/Billing/BillingPlatformClient.d.ts +17 -17
- package/sdk/platform/Billing/BillingPlatformClient.js +17 -17
- package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +49 -49
- package/sdk/platform/Cart/CartPlatformApplicationClient.js +49 -49
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +60 -60
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +62 -62
- package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +87 -87
- package/sdk/platform/Catalog/CatalogPlatformClient.js +87 -87
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +65 -28
- package/sdk/platform/Catalog/CatalogPlatformModel.js +68 -36
- package/sdk/platform/Common/CommonPlatformClient.d.ts +2 -2
- package/sdk/platform/Common/CommonPlatformClient.js +2 -2
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +58 -58
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +58 -58
- package/sdk/platform/Communication/CommunicationPlatformClient.d.ts +1 -1
- package/sdk/platform/Communication/CommunicationPlatformClient.js +1 -1
- package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +12 -0
- package/sdk/platform/Communication/CommunicationPlatformModel.js +12 -0
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +16 -16
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +16 -16
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +2 -0
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +2 -0
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +32 -32
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +32 -32
- package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +18 -18
- package/sdk/platform/Configuration/ConfigurationPlatformClient.js +18 -18
- package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +57 -57
- package/sdk/platform/Content/ContentPlatformApplicationClient.js +63 -63
- package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +4 -4
- package/sdk/platform/Content/ContentPlatformApplicationValidator.js +4 -4
- package/sdk/platform/Content/ContentPlatformClient.d.ts +3 -3
- package/sdk/platform/Content/ContentPlatformClient.js +9 -9
- package/sdk/platform/Content/ContentPlatformModel.d.ts +18 -18
- package/sdk/platform/Content/ContentPlatformModel.js +26 -26
- package/sdk/platform/Content/ContentPlatformValidator.d.ts +4 -4
- package/sdk/platform/Content/ContentPlatformValidator.js +4 -4
- package/sdk/platform/Discount/DiscountPlatformClient.d.ts +11 -11
- package/sdk/platform/Discount/DiscountPlatformClient.js +11 -11
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +9 -9
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +19 -13
- package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +8 -8
- package/sdk/platform/FileStorage/FileStoragePlatformClient.js +23 -14
- package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +12 -1
- package/sdk/platform/FileStorage/FileStoragePlatformModel.js +14 -0
- package/sdk/platform/Finance/FinancePlatformClient.d.ts +27 -27
- package/sdk/platform/Finance/FinancePlatformClient.js +27 -27
- package/sdk/platform/Lead/LeadPlatformApplicationClient.d.ts +6 -6
- package/sdk/platform/Lead/LeadPlatformApplicationClient.js +6 -6
- package/sdk/platform/Lead/LeadPlatformClient.d.ts +11 -11
- package/sdk/platform/Lead/LeadPlatformClient.js +11 -11
- package/sdk/platform/Lead/LeadPlatformModel.d.ts +62 -77
- package/sdk/platform/Lead/LeadPlatformModel.js +40 -52
- package/sdk/platform/OAuthClient.d.ts +3 -3
- package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +2 -2
- package/sdk/platform/Order/OrderPlatformApplicationClient.js +2 -2
- package/sdk/platform/Order/OrderPlatformClient.d.ts +41 -41
- package/sdk/platform/Order/OrderPlatformClient.js +41 -41
- package/sdk/platform/Order/OrderPlatformModel.d.ts +8 -2
- package/sdk/platform/Order/OrderPlatformModel.js +8 -2
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.d.ts +2 -2
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.js +2 -2
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +38 -38
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +38 -38
- package/sdk/platform/Payment/PaymentPlatformClient.d.ts +10 -10
- package/sdk/platform/Payment/PaymentPlatformClient.js +10 -10
- package/sdk/platform/PlatformAPIClient.d.ts +1 -1
- package/sdk/platform/PlatformAPIClient.js +0 -1
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.d.ts +12 -12
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +12 -12
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.d.ts +9 -9
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.js +9 -9
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +15 -15
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +15 -15
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +2 -2
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +4 -2
- package/sdk/platform/Share/SharePlatformApplicationClient.d.ts +5 -5
- package/sdk/platform/Share/SharePlatformApplicationClient.js +5 -5
- package/sdk/platform/Share/SharePlatformModel.d.ts +2 -0
- package/sdk/platform/Share/SharePlatformModel.js +2 -0
- package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +28 -28
- package/sdk/platform/Theme/ThemePlatformApplicationClient.js +28 -28
- package/sdk/platform/Theme/ThemePlatformClient.d.ts +3 -3
- package/sdk/platform/Theme/ThemePlatformClient.js +3 -3
- package/sdk/platform/Theme/ThemePlatformModel.d.ts +25 -32
- package/sdk/platform/Theme/ThemePlatformModel.js +30 -40
- package/sdk/platform/User/UserPlatformApplicationClient.d.ts +16 -16
- package/sdk/platform/User/UserPlatformApplicationClient.js +16 -16
- package/sdk/platform/User/UserPlatformModel.d.ts +48 -13
- package/sdk/platform/User/UserPlatformModel.js +21 -13
- package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +16 -16
- package/sdk/platform/Webhook/WebhookPlatformClient.js +16 -16
- package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +2 -2
- package/sdk/platform/Webhook/WebhookPlatformModel.js +1 -1
- package/sdk/public/Billing/BillingPublicClient.d.ts +1 -1
- package/sdk/public/Billing/BillingPublicClient.js +4 -4
- package/sdk/public/Billing/BillingPublicValidator.d.ts +2 -2
- package/sdk/public/Billing/BillingPublicValidator.js +2 -2
- package/sdk/public/Configuration/ConfigurationPublicClient.d.ts +1 -1
- package/sdk/public/Configuration/ConfigurationPublicClient.js +1 -1
- package/sdk/public/Content/ContentPublicValidator.d.ts +2 -2
- package/sdk/public/Content/ContentPublicValidator.js +3 -3
- package/sdk/public/Inventory/InventoryPublicModel.d.ts +8 -8
- package/sdk/public/Inventory/InventoryPublicModel.js +8 -8
- package/sdk/public/Partner/PartnerPublicClient.d.ts +1 -1
- package/sdk/public/Partner/PartnerPublicClient.js +1 -1
- package/sdk/public/PublicAPIClient.d.ts +1 -1
- package/sdk/public/Webhook/WebhookPublicClient.d.ts +2 -2
- package/sdk/public/Webhook/WebhookPublicClient.js +2 -2
|
@@ -108,7 +108,7 @@ 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
|
|
111
|
+
* @summary: Add email
|
|
112
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(
|
|
@@ -185,7 +185,7 @@ 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
|
|
188
|
+
* @summary: Add mobile
|
|
189
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(
|
|
@@ -264,7 +264,7 @@ 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
|
|
267
|
+
* @summary: Delete email
|
|
268
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(
|
|
@@ -515,7 +515,7 @@ class User {
|
|
|
515
515
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
516
516
|
* @returns {Promise<UserApplicationModel.LoginSuccess>} - Success response
|
|
517
517
|
* @name forgotPassword
|
|
518
|
-
* @summary: Forgot password
|
|
518
|
+
* @summary: Forgot password
|
|
519
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(
|
|
@@ -673,7 +673,7 @@ class User {
|
|
|
673
673
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
674
674
|
* @returns {Promise<UserApplicationModel.UserObjectSchema>} - Success response
|
|
675
675
|
* @name getLoggedInUser
|
|
676
|
-
* @summary: Current user
|
|
676
|
+
* @summary: Current user
|
|
677
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(
|
|
@@ -751,7 +751,7 @@ class User {
|
|
|
751
751
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
752
752
|
* @returns {Promise<UserApplicationModel.PlatformSchema>} - Success response
|
|
753
753
|
* @name getPlatformConfig
|
|
754
|
-
* @summary: Platform config
|
|
754
|
+
* @summary: Platform config
|
|
755
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(
|
|
@@ -909,7 +909,7 @@ 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
|
|
912
|
+
* @summary: Check password
|
|
913
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(
|
|
@@ -985,7 +985,7 @@ class User {
|
|
|
985
985
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
986
986
|
* @returns {Promise<UserApplicationModel.AuthSuccess>} - Success response
|
|
987
987
|
* @name loginWithAppleIOS
|
|
988
|
-
* @summary: Apple iOS login
|
|
988
|
+
* @summary: Apple iOS login
|
|
989
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(
|
|
@@ -1064,7 +1064,7 @@ class User {
|
|
|
1064
1064
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1065
1065
|
* @returns {Promise<UserApplicationModel.LoginSuccess>} - Success response
|
|
1066
1066
|
* @name loginWithEmailAndPassword
|
|
1067
|
-
* @summary: Email/password login
|
|
1067
|
+
* @summary: Email/password login
|
|
1068
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(
|
|
@@ -1144,7 +1144,7 @@ class User {
|
|
|
1144
1144
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1145
1145
|
* @returns {Promise<UserApplicationModel.AuthSuccess>} - Success response
|
|
1146
1146
|
* @name loginWithFacebook
|
|
1147
|
-
* @summary: Facebook login
|
|
1147
|
+
* @summary: Facebook login
|
|
1148
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(
|
|
@@ -1223,7 +1223,7 @@ class User {
|
|
|
1223
1223
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1224
1224
|
* @returns {Promise<UserApplicationModel.AuthSuccess>} - Success response
|
|
1225
1225
|
* @name loginWithGoogle
|
|
1226
|
-
* @summary: Google login
|
|
1226
|
+
* @summary: Google login
|
|
1227
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(
|
|
@@ -1302,7 +1302,7 @@ class User {
|
|
|
1302
1302
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1303
1303
|
* @returns {Promise<UserApplicationModel.AuthSuccess>} - Success response
|
|
1304
1304
|
* @name loginWithGoogleAndroid
|
|
1305
|
-
* @summary: Android Google login
|
|
1305
|
+
* @summary: Android Google login
|
|
1306
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(
|
|
@@ -1383,7 +1383,7 @@ class User {
|
|
|
1383
1383
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1384
1384
|
* @returns {Promise<UserApplicationModel.AuthSuccess>} - Success response
|
|
1385
1385
|
* @name loginWithGoogleIOS
|
|
1386
|
-
* @summary: iOS Google login
|
|
1386
|
+
* @summary: iOS Google login
|
|
1387
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(
|
|
@@ -1462,7 +1462,7 @@ class User {
|
|
|
1462
1462
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1463
1463
|
* @returns {Promise<UserApplicationModel.SendOtpResponse>} - Success response
|
|
1464
1464
|
* @name loginWithOTP
|
|
1465
|
-
* @summary: OTP login
|
|
1465
|
+
* @summary: OTP login
|
|
1466
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(
|
|
@@ -1695,7 +1695,7 @@ class User {
|
|
|
1695
1695
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1696
1696
|
* @returns {Promise<UserApplicationModel.RegisterFormSuccess>} - Success response
|
|
1697
1697
|
* @name registerWithForm
|
|
1698
|
-
* @summary: User registration
|
|
1698
|
+
* @summary: User registration
|
|
1699
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(
|
|
@@ -1775,7 +1775,7 @@ class User {
|
|
|
1775
1775
|
* @returns {Promise<UserApplicationModel.ResetForgotPasswordSuccess>} -
|
|
1776
1776
|
* Success response
|
|
1777
1777
|
* @name resetForgotPassword
|
|
1778
|
-
* @summary: Forgot password
|
|
1778
|
+
* @summary: Forgot password
|
|
1779
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(
|
|
@@ -2011,7 +2011,7 @@ class User {
|
|
|
2011
2011
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
2012
2012
|
* @returns {Promise<UserApplicationModel.EmailOtpSuccess>} - Success response
|
|
2013
2013
|
* @name sendOTPOnEmail
|
|
2014
|
-
* @summary: Send email OTP
|
|
2014
|
+
* @summary: Send email OTP
|
|
2015
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(
|
|
@@ -2090,7 +2090,7 @@ class User {
|
|
|
2090
2090
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
2091
2091
|
* @returns {Promise<UserApplicationModel.OtpSuccess>} - Success response
|
|
2092
2092
|
* @name sendOTPOnMobile
|
|
2093
|
-
* @summary: Send mobile OTP
|
|
2093
|
+
* @summary: Send mobile OTP
|
|
2094
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(
|
|
@@ -2169,7 +2169,7 @@ class User {
|
|
|
2169
2169
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
2170
2170
|
* @returns {Promise<UserApplicationModel.ResetPasswordSuccess>} - Success response
|
|
2171
2171
|
* @name sendResetPasswordEmail
|
|
2172
|
-
* @summary: Reset password (Email)
|
|
2172
|
+
* @summary: Reset password (Email)
|
|
2173
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(
|
|
@@ -2250,7 +2250,7 @@ class User {
|
|
|
2250
2250
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
2251
2251
|
* @returns {Promise<any>} - Success response
|
|
2252
2252
|
* @name sendResetPasswordMobile
|
|
2253
|
-
* @summary: Reset password (Mobile)
|
|
2253
|
+
* @summary: Reset password (Mobile)
|
|
2254
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(
|
|
@@ -2408,7 +2408,7 @@ class User {
|
|
|
2408
2408
|
* @returns {Promise<UserApplicationModel.SendEmailVerifyLinkSuccess>} -
|
|
2409
2409
|
* Success response
|
|
2410
2410
|
* @name sendVerificationLinkToEmail
|
|
2411
|
-
* @summary: Verify new email
|
|
2411
|
+
* @summary: Verify new email
|
|
2412
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(
|
|
@@ -2492,7 +2492,7 @@ class User {
|
|
|
2492
2492
|
* @returns {Promise<UserApplicationModel.SendMobileVerifyLinkSuccess>} -
|
|
2493
2493
|
* Success response
|
|
2494
2494
|
* @name sendVerificationLinkToMobile
|
|
2495
|
-
* @summary: Verify new mobile
|
|
2495
|
+
* @summary: Verify new mobile
|
|
2496
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(
|
|
@@ -2573,7 +2573,7 @@ class User {
|
|
|
2573
2573
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
2574
2574
|
* @returns {Promise<UserApplicationModel.LoginSuccess>} - Success response
|
|
2575
2575
|
* @name setEmailAsPrimary
|
|
2576
|
-
* @summary: Set primary email
|
|
2576
|
+
* @summary: Set primary email
|
|
2577
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(
|
|
@@ -2651,7 +2651,7 @@ class User {
|
|
|
2651
2651
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
2652
2652
|
* @returns {Promise<UserApplicationModel.LoginSuccess>} - Success response
|
|
2653
2653
|
* @name setMobileNumberAsPrimary
|
|
2654
|
-
* @summary: Set primary mobile
|
|
2654
|
+
* @summary: Set primary mobile
|
|
2655
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(
|
|
@@ -2731,7 +2731,7 @@ class User {
|
|
|
2731
2731
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
2732
2732
|
* @returns {Promise<UserApplicationModel.VerifyEmailSuccess>} - Success response
|
|
2733
2733
|
* @name updatePassword
|
|
2734
|
-
* @summary: Update password
|
|
2734
|
+
* @summary: Update password
|
|
2735
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(
|
|
@@ -3043,7 +3043,7 @@ 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
|
|
3046
|
+
* @summary: Verify email
|
|
3047
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(
|
|
@@ -3277,7 +3277,7 @@ 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
|
|
3280
|
+
* @summary: Verify mobile
|
|
3281
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(
|
|
@@ -3434,7 +3434,7 @@ class User {
|
|
|
3434
3434
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
3435
3435
|
* @returns {Promise<UserApplicationModel.VerifyOtpSuccess>} - Success response
|
|
3436
3436
|
* @name verifyMobileOTP
|
|
3437
|
-
* @summary: Verify mobile OTP
|
|
3437
|
+
* @summary: Verify mobile OTP
|
|
3438
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(
|
|
@@ -488,21 +488,23 @@ export = UserApplicationModel;
|
|
|
488
488
|
* @property {string} [_id]
|
|
489
489
|
* @property {string} [created_at]
|
|
490
490
|
* @property {string} [updated_at]
|
|
491
|
+
* @property {string} [external_id]
|
|
492
|
+
* @property {string} [rr_id]
|
|
491
493
|
*/
|
|
492
494
|
/**
|
|
493
495
|
* @typedef PhoneNumber
|
|
494
|
-
* @property {
|
|
495
|
-
* @property {
|
|
496
|
-
* @property {boolean} [
|
|
497
|
-
* @property {
|
|
498
|
-
* @property {
|
|
496
|
+
* @property {string} [phone] - Phone number
|
|
497
|
+
* @property {number} [country_code] - Country code
|
|
498
|
+
* @property {boolean} [active] - Is the phone number active
|
|
499
|
+
* @property {boolean} [primary] - Is it a primary phone number
|
|
500
|
+
* @property {boolean} [verified] - Is the phone number verified
|
|
499
501
|
*/
|
|
500
502
|
/**
|
|
501
503
|
* @typedef Email
|
|
502
|
-
* @property {
|
|
503
|
-
* @property {boolean} [
|
|
504
|
-
* @property {
|
|
505
|
-
* @property {boolean} [
|
|
504
|
+
* @property {string} [email] - Email address
|
|
505
|
+
* @property {boolean} [active] - Is the email active
|
|
506
|
+
* @property {boolean} [primary] - Is it a primary email
|
|
507
|
+
* @property {boolean} [verified] - Is the email verified
|
|
506
508
|
*/
|
|
507
509
|
declare class UserApplicationModel {
|
|
508
510
|
}
|
|
@@ -1085,21 +1087,50 @@ type UserSchema = {
|
|
|
1085
1087
|
_id?: string;
|
|
1086
1088
|
created_at?: string;
|
|
1087
1089
|
updated_at?: string;
|
|
1090
|
+
external_id?: string;
|
|
1091
|
+
rr_id?: string;
|
|
1088
1092
|
};
|
|
1089
1093
|
/** @returns {PhoneNumber} */
|
|
1090
1094
|
declare function PhoneNumber(): PhoneNumber;
|
|
1091
1095
|
type PhoneNumber = {
|
|
1096
|
+
/**
|
|
1097
|
+
* - Phone number
|
|
1098
|
+
*/
|
|
1099
|
+
phone?: string;
|
|
1100
|
+
/**
|
|
1101
|
+
* - Country code
|
|
1102
|
+
*/
|
|
1103
|
+
country_code?: number;
|
|
1104
|
+
/**
|
|
1105
|
+
* - Is the phone number active
|
|
1106
|
+
*/
|
|
1092
1107
|
active?: boolean;
|
|
1108
|
+
/**
|
|
1109
|
+
* - Is it a primary phone number
|
|
1110
|
+
*/
|
|
1093
1111
|
primary?: boolean;
|
|
1112
|
+
/**
|
|
1113
|
+
* - Is the phone number verified
|
|
1114
|
+
*/
|
|
1094
1115
|
verified?: boolean;
|
|
1095
|
-
phone?: string;
|
|
1096
|
-
country_code?: number;
|
|
1097
1116
|
};
|
|
1098
1117
|
/** @returns {Email} */
|
|
1099
1118
|
declare function Email(): Email;
|
|
1100
1119
|
type Email = {
|
|
1101
|
-
|
|
1102
|
-
|
|
1120
|
+
/**
|
|
1121
|
+
* - Email address
|
|
1122
|
+
*/
|
|
1103
1123
|
email?: string;
|
|
1124
|
+
/**
|
|
1125
|
+
* - Is the email active
|
|
1126
|
+
*/
|
|
1104
1127
|
active?: boolean;
|
|
1128
|
+
/**
|
|
1129
|
+
* - Is it a primary email
|
|
1130
|
+
*/
|
|
1131
|
+
primary?: boolean;
|
|
1132
|
+
/**
|
|
1133
|
+
* - Is the email verified
|
|
1134
|
+
*/
|
|
1135
|
+
verified?: boolean;
|
|
1105
1136
|
};
|
|
@@ -563,23 +563,25 @@ const Joi = require("joi");
|
|
|
563
563
|
* @property {string} [_id]
|
|
564
564
|
* @property {string} [created_at]
|
|
565
565
|
* @property {string} [updated_at]
|
|
566
|
+
* @property {string} [external_id]
|
|
567
|
+
* @property {string} [rr_id]
|
|
566
568
|
*/
|
|
567
569
|
|
|
568
570
|
/**
|
|
569
571
|
* @typedef PhoneNumber
|
|
570
|
-
* @property {
|
|
571
|
-
* @property {
|
|
572
|
-
* @property {boolean} [
|
|
573
|
-
* @property {
|
|
574
|
-
* @property {
|
|
572
|
+
* @property {string} [phone] - Phone number
|
|
573
|
+
* @property {number} [country_code] - Country code
|
|
574
|
+
* @property {boolean} [active] - Is the phone number active
|
|
575
|
+
* @property {boolean} [primary] - Is it a primary phone number
|
|
576
|
+
* @property {boolean} [verified] - Is the phone number verified
|
|
575
577
|
*/
|
|
576
578
|
|
|
577
579
|
/**
|
|
578
580
|
* @typedef Email
|
|
579
|
-
* @property {
|
|
580
|
-
* @property {boolean} [
|
|
581
|
-
* @property {
|
|
582
|
-
* @property {boolean} [
|
|
581
|
+
* @property {string} [email] - Email address
|
|
582
|
+
* @property {boolean} [active] - Is the email active
|
|
583
|
+
* @property {boolean} [primary] - Is it a primary email
|
|
584
|
+
* @property {boolean} [verified] - Is the email verified
|
|
583
585
|
*/
|
|
584
586
|
|
|
585
587
|
class UserApplicationModel {
|
|
@@ -1297,27 +1299,29 @@ class UserApplicationModel {
|
|
|
1297
1299
|
_id: Joi.string().allow(""),
|
|
1298
1300
|
created_at: Joi.string().allow(""),
|
|
1299
1301
|
updated_at: Joi.string().allow(""),
|
|
1302
|
+
external_id: Joi.string().allow(""),
|
|
1303
|
+
rr_id: Joi.string().allow(""),
|
|
1300
1304
|
});
|
|
1301
1305
|
}
|
|
1302
1306
|
|
|
1303
1307
|
/** @returns {PhoneNumber} */
|
|
1304
1308
|
static PhoneNumber() {
|
|
1305
1309
|
return Joi.object({
|
|
1310
|
+
phone: Joi.string().allow(""),
|
|
1311
|
+
country_code: Joi.number(),
|
|
1306
1312
|
active: Joi.boolean(),
|
|
1307
1313
|
primary: Joi.boolean(),
|
|
1308
1314
|
verified: Joi.boolean(),
|
|
1309
|
-
phone: Joi.string().allow(""),
|
|
1310
|
-
country_code: Joi.number(),
|
|
1311
1315
|
});
|
|
1312
1316
|
}
|
|
1313
1317
|
|
|
1314
1318
|
/** @returns {Email} */
|
|
1315
1319
|
static Email() {
|
|
1316
1320
|
return Joi.object({
|
|
1317
|
-
primary: Joi.boolean(),
|
|
1318
|
-
verified: Joi.boolean(),
|
|
1319
1321
|
email: Joi.string().allow(""),
|
|
1320
1322
|
active: Joi.boolean(),
|
|
1323
|
+
primary: Joi.boolean(),
|
|
1324
|
+
verified: Joi.boolean(),
|
|
1321
1325
|
});
|
|
1322
1326
|
}
|
|
1323
1327
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const fdkAxios:
|
|
1
|
+
export const fdkAxios: import("axios").AxiosInstance;
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
const combineURLs = require("
|
|
2
|
-
const
|
|
3
|
-
const axios = require("axios");
|
|
1
|
+
const { isAbsoluteURL, combineURLs } = require("./utils");
|
|
2
|
+
const axios = require("axios").default;
|
|
4
3
|
const querystring = require("query-string");
|
|
5
4
|
const { sign } = require("@gofynd/fp-signature");
|
|
6
5
|
const { FDKServerResponseError } = require("./FDKError");
|
|
7
6
|
const { log, Logger, getLoggerLevel } = require("./Logger");
|
|
8
7
|
const createCurl = require("./curlHelper");
|
|
9
8
|
const { version } = require("./../../package.json");
|
|
10
|
-
axios.defaults.withCredentials = true;
|
|
11
9
|
|
|
12
10
|
function getTransformer(config) {
|
|
13
11
|
const { transformRequest } = config;
|
|
@@ -82,6 +80,7 @@ function requestInterceptorFn() {
|
|
|
82
80
|
};
|
|
83
81
|
}
|
|
84
82
|
const fdkAxios = axios.create({
|
|
83
|
+
withCredentials: true,
|
|
85
84
|
paramsSerializer: (params) => {
|
|
86
85
|
return querystring.stringify(params);
|
|
87
86
|
},
|
|
@@ -132,33 +131,55 @@ fdkAxios.interceptors.response.use(
|
|
|
132
131
|
function (error) {
|
|
133
132
|
if (error.response) {
|
|
134
133
|
// Request made and server responded
|
|
134
|
+
const responseData = error.response.data;
|
|
135
135
|
Logger({
|
|
136
136
|
level: "ERROR",
|
|
137
|
-
message:
|
|
138
|
-
|
|
137
|
+
message:
|
|
138
|
+
responseData && responseData.message
|
|
139
|
+
? responseData.message
|
|
140
|
+
: error.message,
|
|
141
|
+
stack:
|
|
142
|
+
responseData && responseData.stack ? responseData.stack : error.stack,
|
|
139
143
|
request: {
|
|
140
|
-
method:
|
|
141
|
-
|
|
142
|
-
|
|
144
|
+
method:
|
|
145
|
+
error.config && error.config.url ? error.config.url : undefined,
|
|
146
|
+
url:
|
|
147
|
+
error.config && error.config.method
|
|
148
|
+
? error.config.method
|
|
149
|
+
: undefined,
|
|
150
|
+
headers:
|
|
151
|
+
error.config && error.config.headers
|
|
152
|
+
? error.config.headers
|
|
153
|
+
: undefined,
|
|
143
154
|
},
|
|
144
155
|
});
|
|
145
156
|
throw new FDKServerResponseError(
|
|
146
|
-
|
|
147
|
-
|
|
157
|
+
responseData && responseData.message
|
|
158
|
+
? responseData.message
|
|
159
|
+
: error.message,
|
|
160
|
+
"",
|
|
161
|
+
// Not Sending Stack for response error
|
|
148
162
|
error.response.statusText,
|
|
149
163
|
error.response.status,
|
|
150
|
-
|
|
164
|
+
responseData
|
|
151
165
|
);
|
|
152
166
|
} else if (error.request) {
|
|
153
167
|
// The request was made but no error.response was received
|
|
154
168
|
Logger({
|
|
155
169
|
level: "ERROR",
|
|
156
|
-
message: error.
|
|
157
|
-
stack: error.
|
|
170
|
+
message: error.message,
|
|
171
|
+
stack: error.stack,
|
|
158
172
|
request: {
|
|
159
|
-
method:
|
|
160
|
-
|
|
161
|
-
|
|
173
|
+
method:
|
|
174
|
+
error.config && error.config.url ? error.config.url : undefined,
|
|
175
|
+
url:
|
|
176
|
+
error.config && error.config.method
|
|
177
|
+
? error.config.method
|
|
178
|
+
: undefined,
|
|
179
|
+
headers:
|
|
180
|
+
error.config && error.config.headers
|
|
181
|
+
? error.config.headers
|
|
182
|
+
: undefined,
|
|
162
183
|
},
|
|
163
184
|
});
|
|
164
185
|
throw new FDKServerResponseError(
|
|
@@ -22,7 +22,10 @@ if (typeof window != "undefined") {
|
|
|
22
22
|
Logger({ level: "DEBUG", message: eventData });
|
|
23
23
|
Clickstream.identify(eventData["user_id"], {
|
|
24
24
|
event_type: "identity",
|
|
25
|
-
|
|
25
|
+
email: sg(() => eventData["email"]),
|
|
26
|
+
phone: sg(() => eventData["phone_number"]),
|
|
27
|
+
login_value: sg(() => eventData["login_value"]),
|
|
28
|
+
method: sg(() => eventData["method"]),
|
|
26
29
|
}).catch((err) => {
|
|
27
30
|
Logger({ level: "ERROR", message: err });
|
|
28
31
|
});
|
|
@@ -32,7 +35,9 @@ if (typeof window != "undefined") {
|
|
|
32
35
|
Logger({ level: "DEBUG", message: eventData });
|
|
33
36
|
Clickstream.identify(eventData["used_id"], {
|
|
34
37
|
event_type: "identity",
|
|
35
|
-
|
|
38
|
+
email: sg(() => eventData["email"]),
|
|
39
|
+
phone: sg(() => eventData["phone_number"]),
|
|
40
|
+
method: sg(() => eventData["method"]),
|
|
36
41
|
}).catch((err) => {
|
|
37
42
|
Logger({ level: "ERROR", message: err });
|
|
38
43
|
});
|
|
@@ -40,12 +45,11 @@ if (typeof window != "undefined") {
|
|
|
40
45
|
|
|
41
46
|
window.FPI.event.on("user.logout", (eventData) => {
|
|
42
47
|
Logger({ level: "DEBUG", message: eventData });
|
|
43
|
-
Clickstream.sendEvent("user_logout", {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
});
|
|
48
|
+
Clickstream.sendEvent("user_logout", { event_type: "identity" }).catch(
|
|
49
|
+
(err) => {
|
|
50
|
+
Logger({ level: "ERROR", message: err });
|
|
51
|
+
}
|
|
52
|
+
);
|
|
49
53
|
Clickstream.reset().catch((err) => {
|
|
50
54
|
Logger({ level: "ERROR", message: err });
|
|
51
55
|
});
|
|
@@ -56,7 +60,7 @@ if (typeof window != "undefined") {
|
|
|
56
60
|
Clickstream.sendEvent("product_wishlist_add", {
|
|
57
61
|
wishlist_name: "TODO",
|
|
58
62
|
wishlist_id: "TODO",
|
|
59
|
-
event_type: "
|
|
63
|
+
event_type: "engagement",
|
|
60
64
|
product_id: sg(() => eventData.item["uid"]),
|
|
61
65
|
brand: sg(() => eventData.item.brand["name"]),
|
|
62
66
|
l3_category: sg(() => eventData.item.categories[0]["name"]),
|
|
@@ -80,7 +84,7 @@ if (typeof window != "undefined") {
|
|
|
80
84
|
Clickstream.sendEvent("product_wishlist_remove", {
|
|
81
85
|
wishlist_name: "TODO",
|
|
82
86
|
wishlist_id: "TODO",
|
|
83
|
-
event_type: "
|
|
87
|
+
event_type: "engagement",
|
|
84
88
|
product_id: sg(() => eventData.item["uid"]),
|
|
85
89
|
brand: sg(() => eventData.item.brand["name"]),
|
|
86
90
|
l3_category: sg(() => eventData.item.categories[0]["name"]),
|
|
@@ -103,8 +107,9 @@ if (typeof window != "undefined") {
|
|
|
103
107
|
Logger({ level: "DEBUG", message: eventData });
|
|
104
108
|
Clickstream.sendEvent("add_to_cart", {
|
|
105
109
|
cart_id: eventData.cart_id,
|
|
106
|
-
event_type: "
|
|
110
|
+
event_type: "engagement",
|
|
107
111
|
product_id: sg(() => eventData.products[0]["uid"]),
|
|
112
|
+
article_id: sg(() => eventData.products[0]["article"]["uid"]),
|
|
108
113
|
brand: sg(() => eventData.products[0]["brand"]["name"]),
|
|
109
114
|
l3_category: sg(() => eventData.products[0]["category"]["name"]),
|
|
110
115
|
l1_category: "TODO",
|
|
@@ -127,7 +132,7 @@ if (typeof window != "undefined") {
|
|
|
127
132
|
Logger({ level: "DEBUG", message: eventData });
|
|
128
133
|
Clickstream.sendEvent("remove_from_cart", {
|
|
129
134
|
cart_id: eventData.cart_id,
|
|
130
|
-
event_type: "
|
|
135
|
+
event_type: "engagement",
|
|
131
136
|
product_id: sg(() => eventData.products[0]["uid"]),
|
|
132
137
|
brand: sg(() => eventData.products[0]["brand"]["name"]),
|
|
133
138
|
l3_category: sg(() => eventData.products[0]["category"]["name"]),
|
|
@@ -150,7 +155,7 @@ if (typeof window != "undefined") {
|
|
|
150
155
|
window.FPI.event.on("order.processed", (eventData) => {
|
|
151
156
|
Logger({ level: "DEBUG", message: eventData });
|
|
152
157
|
Clickstream.sendEvent("order_complete", {
|
|
153
|
-
event_type: "
|
|
158
|
+
event_type: "conversion",
|
|
154
159
|
...eventData,
|
|
155
160
|
})
|
|
156
161
|
.then((resp) => {
|
|
@@ -164,7 +169,7 @@ if (typeof window != "undefined") {
|
|
|
164
169
|
window.FPI.event.on("refund.success", (eventData) => {
|
|
165
170
|
Logger({ level: "DEBUG", message: eventData });
|
|
166
171
|
Clickstream.sendEvent("order_refunded", {
|
|
167
|
-
event_type: "
|
|
172
|
+
event_type: "conversion",
|
|
168
173
|
...eventData,
|
|
169
174
|
})
|
|
170
175
|
.then((resp) => {
|
|
@@ -178,7 +183,7 @@ if (typeof window != "undefined") {
|
|
|
178
183
|
window.FPI.event.on("order.checkout", (eventData) => {
|
|
179
184
|
Logger({ level: "DEBUG", message: eventData });
|
|
180
185
|
Clickstream.sendEvent("order_checkout", {
|
|
181
|
-
event_type: "
|
|
186
|
+
event_type: "conversion",
|
|
182
187
|
cart_id: eventData.cart_id,
|
|
183
188
|
cart_total: sg(() => eventData.breakup_values_raw["mrp_total"]),
|
|
184
189
|
items: sg(() => eventData.products.lenght),
|
|
@@ -195,6 +200,7 @@ if (typeof window != "undefined") {
|
|
|
195
200
|
price: sg(() => p.price["marked"]),
|
|
196
201
|
value: sg(() => p.price["effective"]),
|
|
197
202
|
currency: sg(() => p.price["currency_code"]),
|
|
203
|
+
article_id: sg(() => p.article["uid"]),
|
|
198
204
|
};
|
|
199
205
|
}),
|
|
200
206
|
})
|
|
@@ -211,7 +217,7 @@ if (typeof window != "undefined") {
|
|
|
211
217
|
Clickstream.sendEvent("product_view", {
|
|
212
218
|
event_type: "click",
|
|
213
219
|
product_id: sg(() => eventData.product["uid"]),
|
|
214
|
-
currency: sg(() => eventData.product.price["
|
|
220
|
+
currency: sg(() => eventData.product.price["currency_code"]),
|
|
215
221
|
brand: sg(() => eventData.product.brand["name"]),
|
|
216
222
|
l3_category: sg(() => eventData.product.l3_category),
|
|
217
223
|
mrp: sg(() => eventData.product.price.max),
|
package/sdk/common/curlHelper.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
const qs = require("query-string");
|
|
2
|
-
const combineURLs = require("
|
|
3
|
-
const isAbsoluteURL = require("axios/lib/helpers/isAbsoluteURL");
|
|
4
|
-
|
|
2
|
+
const { combineURLs, isAbsoluteURL } = require("./utils");
|
|
5
3
|
let reqConfig;
|
|
6
4
|
|
|
7
5
|
// generate url with query params
|
package/sdk/common/utils.d.ts
CHANGED
|
@@ -15,3 +15,18 @@ export namespace NAV_TYPE {
|
|
|
15
15
|
const PAGE: string;
|
|
16
16
|
const POPUP: string;
|
|
17
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* Creates a new URL by combining the specified URLs
|
|
20
|
+
*
|
|
21
|
+
* @param {string} baseURL The base URL
|
|
22
|
+
* @param {string} relativeURL The relative URL
|
|
23
|
+
* @returns {string} The combined URL
|
|
24
|
+
*/
|
|
25
|
+
export function combineURLs(baseURL: string, relativeURL: string): string;
|
|
26
|
+
/**
|
|
27
|
+
* Determines whether the specified URL is absolute
|
|
28
|
+
*
|
|
29
|
+
* @param {string} url The URL to test
|
|
30
|
+
* @returns {boolean} True if the specified URL is absolute, otherwise false
|
|
31
|
+
*/
|
|
32
|
+
export function isAbsoluteURL(url: string): boolean;
|