@gofynd/fdk-client-javascript 1.0.2 → 1.0.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/documentation/application/CART.md +5934 -4502
- package/documentation/application/CATALOG.md +6338 -7245
- package/documentation/application/COMMON.md +95 -222
- package/documentation/application/COMMUNICATION.md +106 -186
- package/documentation/application/CONFIGURATION.md +903 -1597
- package/documentation/application/CONTENT.md +557 -1279
- package/documentation/application/FILESTORAGE.md +84 -220
- package/documentation/application/LEAD.md +314 -660
- package/documentation/application/LOGISTIC.md +229 -305
- package/documentation/application/ORDER.md +642 -1137
- package/documentation/application/PAYMENT.md +2285 -3031
- package/documentation/application/POSCART.md +6079 -4642
- package/documentation/application/REWARDS.md +94 -248
- package/documentation/application/SHARE.md +152 -250
- package/documentation/application/THEME.md +952 -1235
- package/documentation/application/USER.md +1228 -1765
- package/documentation/platform/ANALYTICS.md +207 -349
- package/documentation/platform/AUDITTRAIL.md +121 -204
- package/documentation/platform/BILLING.md +865 -1376
- package/documentation/platform/CART.md +2814 -3662
- package/documentation/platform/CATALOG.md +14453 -17192
- package/documentation/platform/COMMON.md +95 -222
- package/documentation/platform/COMMUNICATION.md +1632 -2380
- package/documentation/platform/COMPANYPROFILE.md +572 -957
- package/documentation/platform/CONFIGURATION.md +3050 -4073
- package/documentation/platform/CONTENT.md +3438 -4172
- package/documentation/platform/DISCOUNT.md +140 -236
- package/documentation/platform/FILESTORAGE.md +187 -323
- package/documentation/platform/INVENTORY.md +268 -911
- package/documentation/platform/LEAD.md +2195 -2541
- package/documentation/platform/ORDER.md +3400 -5361
- package/documentation/platform/PARTNER.md +9 -36
- package/documentation/platform/PAYMENT.md +903 -1213
- package/documentation/platform/REWARDS.md +183 -347
- package/documentation/platform/SHARE.md +120 -213
- package/documentation/platform/THEME.md +12956 -13239
- package/documentation/platform/USER.md +975 -1120
- package/documentation/platform/WEBHOOK.md +78 -184
- package/documentation/public/CONFIGURATION.md +95 -222
- package/documentation/public/INVENTORY.md +100 -282
- package/documentation/public/WEBHOOK.md +27 -133
- package/package.json +1 -1
- package/sdk/application/Cart/CartApplicationClient.d.ts +243 -243
- package/sdk/application/Cart/CartApplicationClient.js +567 -567
- package/sdk/application/Cart/CartApplicationModel.d.ts +64 -63
- package/sdk/application/Cart/CartApplicationModel.js +489 -886
- package/sdk/application/Cart/CartApplicationValidator.d.ts +17 -17
- package/sdk/application/Cart/CartApplicationValidator.js +98 -98
- package/sdk/application/Catalog/CatalogApplicationClient.d.ts +358 -358
- package/sdk/application/Catalog/CatalogApplicationClient.js +1036 -1036
- package/sdk/application/Catalog/CatalogApplicationModel.d.ts +90 -90
- package/sdk/application/Catalog/CatalogApplicationModel.js +677 -1243
- package/sdk/application/Catalog/CatalogApplicationValidator.d.ts +19 -19
- package/sdk/application/Catalog/CatalogApplicationValidator.js +110 -110
- package/sdk/application/Common/CommonApplicationClient.d.ts +13 -13
- package/sdk/application/Common/CommonApplicationClient.js +38 -38
- package/sdk/application/Common/CommonApplicationModel.d.ts +12 -12
- package/sdk/application/Common/CommonApplicationModel.js +83 -160
- package/sdk/application/Common/CommonApplicationValidator.d.ts +1 -1
- package/sdk/application/Common/CommonApplicationValidator.js +6 -6
- package/sdk/application/Communication/CommunicationApplicationClient.d.ts +11 -11
- package/sdk/application/Communication/CommunicationApplicationClient.js +26 -26
- package/sdk/application/Communication/CommunicationApplicationModel.d.ts +6 -6
- package/sdk/application/Communication/CommunicationApplicationModel.js +38 -83
- package/sdk/application/Communication/CommunicationApplicationValidator.d.ts +1 -1
- package/sdk/application/Communication/CommunicationApplicationValidator.js +4 -4
- package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +116 -116
- package/sdk/application/Configuration/ConfigurationApplicationClient.js +330 -330
- package/sdk/application/Configuration/ConfigurationApplicationModel.d.ts +85 -85
- package/sdk/application/Configuration/ConfigurationApplicationModel.js +480 -851
- package/sdk/application/Configuration/ConfigurationApplicationValidator.d.ts +8 -8
- package/sdk/application/Configuration/ConfigurationApplicationValidator.js +33 -33
- package/sdk/application/Content/ContentApplicationClient.d.ts +67 -67
- package/sdk/application/Content/ContentApplicationClient.js +191 -191
- package/sdk/application/Content/ContentApplicationModel.d.ts +76 -76
- package/sdk/application/Content/ContentApplicationModel.js +467 -884
- package/sdk/application/Content/ContentApplicationValidator.d.ts +5 -5
- package/sdk/application/Content/ContentApplicationValidator.js +24 -24
- package/sdk/application/FileStorage/FileStorageApplicationClient.d.ts +25 -25
- package/sdk/application/FileStorage/FileStorageApplicationClient.js +59 -59
- package/sdk/application/FileStorage/FileStorageApplicationModel.d.ts +13 -13
- package/sdk/application/FileStorage/FileStorageApplicationModel.js +86 -169
- package/sdk/application/FileStorage/FileStorageApplicationValidator.d.ts +1 -1
- package/sdk/application/FileStorage/FileStorageApplicationValidator.js +7 -7
- package/sdk/application/Lead/LeadApplicationClient.d.ts +24 -24
- package/sdk/application/Lead/LeadApplicationClient.js +100 -100
- package/sdk/application/Lead/LeadApplicationModel.d.ts +35 -35
- package/sdk/application/Lead/LeadApplicationModel.js +267 -474
- package/sdk/application/Lead/LeadApplicationValidator.d.ts +2 -2
- package/sdk/application/Lead/LeadApplicationValidator.js +11 -11
- package/sdk/application/Logistic/LogisticApplicationClient.d.ts +30 -19
- package/sdk/application/Logistic/LogisticApplicationClient.js +110 -43
- package/sdk/application/Logistic/LogisticApplicationModel.d.ts +17 -14
- package/sdk/application/Logistic/LogisticApplicationModel.js +133 -201
- package/sdk/application/Logistic/LogisticApplicationValidator.d.ts +3 -2
- package/sdk/application/Logistic/LogisticApplicationValidator.js +14 -8
- package/sdk/application/Order/OrderApplicationClient.d.ts +85 -85
- package/sdk/application/Order/OrderApplicationClient.js +232 -232
- package/sdk/application/Order/OrderApplicationModel.d.ts +50 -50
- package/sdk/application/Order/OrderApplicationModel.js +352 -656
- package/sdk/application/Order/OrderApplicationValidator.d.ts +7 -7
- package/sdk/application/Order/OrderApplicationValidator.js +28 -28
- package/sdk/application/Payment/PaymentApplicationClient.d.ts +318 -318
- package/sdk/application/Payment/PaymentApplicationClient.js +739 -739
- package/sdk/application/Payment/PaymentApplicationModel.d.ts +72 -72
- package/sdk/application/Payment/PaymentApplicationModel.js +570 -1038
- package/sdk/application/Payment/PaymentApplicationValidator.d.ts +28 -28
- package/sdk/application/Payment/PaymentApplicationValidator.js +107 -107
- package/sdk/application/PosCart/PosCartApplicationClient.d.ts +254 -254
- package/sdk/application/PosCart/PosCartApplicationClient.js +617 -617
- package/sdk/application/PosCart/PosCartApplicationModel.d.ts +64 -63
- package/sdk/application/PosCart/PosCartApplicationModel.js +475 -871
- package/sdk/application/PosCart/PosCartApplicationValidator.d.ts +18 -18
- package/sdk/application/PosCart/PosCartApplicationValidator.js +103 -103
- package/sdk/application/Rewards/RewardsApplicationClient.d.ts +27 -27
- package/sdk/application/Rewards/RewardsApplicationClient.js +112 -112
- package/sdk/application/Rewards/RewardsApplicationModel.d.ts +14 -14
- package/sdk/application/Rewards/RewardsApplicationModel.js +96 -191
- package/sdk/application/Rewards/RewardsApplicationValidator.d.ts +3 -3
- package/sdk/application/Rewards/RewardsApplicationValidator.js +12 -12
- package/sdk/application/Share/ShareApplicationClient.d.ts +37 -37
- package/sdk/application/Share/ShareApplicationClient.js +84 -84
- package/sdk/application/Share/ShareApplicationModel.d.ts +8 -8
- package/sdk/application/Share/ShareApplicationModel.js +63 -123
- package/sdk/application/Share/ShareApplicationValidator.d.ts +4 -4
- package/sdk/application/Share/ShareApplicationValidator.js +12 -12
- package/sdk/application/Theme/ThemeApplicationClient.d.ts +8 -8
- package/sdk/application/Theme/ThemeApplicationClient.js +31 -31
- package/sdk/application/Theme/ThemeApplicationModel.d.ts +34 -34
- package/sdk/application/Theme/ThemeApplicationModel.js +190 -336
- package/sdk/application/Theme/ThemeApplicationValidator.d.ts +1 -1
- package/sdk/application/Theme/ThemeApplicationValidator.js +4 -4
- package/sdk/application/User/UserApplicationClient.d.ts +280 -280
- package/sdk/application/User/UserApplicationClient.js +581 -581
- package/sdk/application/User/UserApplicationModel.d.ts +79 -72
- package/sdk/application/User/UserApplicationModel.js +440 -689
- package/sdk/application/User/UserApplicationValidator.d.ts +24 -24
- package/sdk/application/User/UserApplicationValidator.js +89 -89
- package/sdk/common/AxiosHelper.js +1 -1
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.d.ts +51 -51
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.js +179 -179
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.d.ts +6 -6
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.js +20 -20
- package/sdk/platform/Analytics/AnalyticsPlatformModel.d.ts +11 -11
- package/sdk/platform/Analytics/AnalyticsPlatformModel.js +95 -178
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.d.ts +10 -10
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +41 -41
- package/sdk/platform/AuditTrail/AuditTrailPlatformModel.d.ts +10 -10
- package/sdk/platform/AuditTrail/AuditTrailPlatformModel.js +50 -89
- package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.d.ts +1 -1
- package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.js +6 -6
- package/sdk/platform/Billing/BillingPlatformClient.d.ts +60 -60
- package/sdk/platform/Billing/BillingPlatformClient.js +181 -181
- package/sdk/platform/Billing/BillingPlatformModel.d.ts +40 -40
- package/sdk/platform/Billing/BillingPlatformModel.js +342 -668
- package/sdk/platform/Billing/BillingPlatformValidator.d.ts +8 -8
- package/sdk/platform/Billing/BillingPlatformValidator.js +25 -25
- package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +168 -168
- package/sdk/platform/Cart/CartPlatformApplicationClient.js +553 -553
- package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +11 -11
- package/sdk/platform/Cart/CartPlatformApplicationValidator.js +63 -63
- package/sdk/platform/Cart/CartPlatformModel.d.ts +84 -83
- package/sdk/platform/Cart/CartPlatformModel.js +671 -1205
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +632 -632
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +1525 -1525
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +40 -40
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +174 -174
- package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +682 -682
- package/sdk/platform/Catalog/CatalogPlatformClient.js +1557 -1557
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +291 -291
- package/sdk/platform/Catalog/CatalogPlatformModel.js +2127 -3904
- package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +66 -66
- package/sdk/platform/Catalog/CatalogPlatformValidator.js +229 -229
- package/sdk/platform/Common/CommonPlatformClient.d.ts +12 -12
- package/sdk/platform/Common/CommonPlatformClient.js +41 -41
- package/sdk/platform/Common/CommonPlatformModel.d.ts +12 -12
- package/sdk/platform/Common/CommonPlatformModel.js +83 -160
- package/sdk/platform/Common/CommonPlatformValidator.d.ts +1 -1
- package/sdk/platform/Common/CommonPlatformValidator.js +6 -6
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +326 -326
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +943 -943
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.d.ts +30 -30
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.js +87 -87
- package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +67 -67
- package/sdk/platform/Communication/CommunicationPlatformModel.js +522 -974
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +55 -55
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +212 -212
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +27 -27
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +279 -542
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.d.ts +7 -7
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.js +24 -24
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +163 -153
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +615 -552
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.d.ts +22 -21
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.js +69 -63
- package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +125 -125
- package/sdk/platform/Configuration/ConfigurationPlatformClient.js +342 -342
- package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +148 -146
- package/sdk/platform/Configuration/ConfigurationPlatformModel.js +854 -1508
- package/sdk/platform/Configuration/ConfigurationPlatformValidator.d.ts +9 -9
- package/sdk/platform/Configuration/ConfigurationPlatformValidator.js +38 -38
- package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +534 -534
- package/sdk/platform/Content/ContentPlatformApplicationClient.js +1324 -1324
- package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +50 -50
- package/sdk/platform/Content/ContentPlatformApplicationValidator.js +156 -156
- package/sdk/platform/Content/ContentPlatformModel.d.ts +78 -78
- package/sdk/platform/Content/ContentPlatformModel.js +484 -907
- package/sdk/platform/Discount/DiscountPlatformClient.d.ts +65 -65
- package/sdk/platform/Discount/DiscountPlatformClient.js +216 -216
- package/sdk/platform/Discount/DiscountPlatformModel.d.ts +7 -7
- package/sdk/platform/Discount/DiscountPlatformModel.js +60 -121
- package/sdk/platform/Discount/DiscountPlatformValidator.d.ts +6 -6
- package/sdk/platform/Discount/DiscountPlatformValidator.js +29 -29
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +24 -24
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +58 -58
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.d.ts +1 -1
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.js +8 -8
- package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +52 -52
- package/sdk/platform/FileStorage/FileStoragePlatformClient.js +123 -123
- package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +13 -13
- package/sdk/platform/FileStorage/FileStoragePlatformModel.js +86 -169
- package/sdk/platform/FileStorage/FileStoragePlatformValidator.d.ts +3 -3
- package/sdk/platform/FileStorage/FileStoragePlatformValidator.js +11 -11
- package/sdk/platform/Inventory/InventoryPlatformClient.d.ts +63 -63
- package/sdk/platform/Inventory/InventoryPlatformClient.js +228 -228
- package/sdk/platform/Inventory/InventoryPlatformModel.d.ts +30 -30
- package/sdk/platform/Inventory/InventoryPlatformModel.js +497 -964
- package/sdk/platform/Inventory/InventoryPlatformValidator.d.ts +7 -7
- package/sdk/platform/Inventory/InventoryPlatformValidator.js +28 -28
- package/sdk/platform/Lead/LeadPlatformApplicationClient.d.ts +73 -73
- package/sdk/platform/Lead/LeadPlatformApplicationClient.js +200 -200
- package/sdk/platform/Lead/LeadPlatformApplicationValidator.d.ts +7 -7
- package/sdk/platform/Lead/LeadPlatformApplicationValidator.js +28 -28
- package/sdk/platform/Lead/LeadPlatformClient.d.ts +80 -80
- package/sdk/platform/Lead/LeadPlatformClient.js +212 -212
- package/sdk/platform/Lead/LeadPlatformModel.d.ts +35 -35
- package/sdk/platform/Lead/LeadPlatformModel.js +267 -474
- package/sdk/platform/Lead/LeadPlatformValidator.d.ts +6 -6
- package/sdk/platform/Lead/LeadPlatformValidator.js +24 -24
- package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +10 -10
- package/sdk/platform/Order/OrderPlatformApplicationClient.js +65 -65
- package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +1 -1
- package/sdk/platform/Order/OrderPlatformApplicationValidator.js +6 -6
- package/sdk/platform/Order/OrderPlatformClient.d.ts +357 -357
- package/sdk/platform/Order/OrderPlatformClient.js +1035 -1035
- package/sdk/platform/Order/OrderPlatformModel.d.ts +198 -196
- package/sdk/platform/Order/OrderPlatformModel.js +1574 -2861
- package/sdk/platform/Order/OrderPlatformValidator.d.ts +32 -32
- package/sdk/platform/Order/OrderPlatformValidator.js +160 -160
- package/sdk/platform/Partner/PartnerPlatformModel.d.ts +1 -1
- package/sdk/platform/Partner/PartnerPlatformModel.js +10 -26
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +57 -57
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +167 -167
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +6 -6
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +23 -23
- package/sdk/platform/Payment/PaymentPlatformClient.d.ts +42 -42
- package/sdk/platform/Payment/PaymentPlatformClient.js +153 -153
- package/sdk/platform/Payment/PaymentPlatformModel.d.ts +27 -27
- package/sdk/platform/Payment/PaymentPlatformModel.js +222 -410
- package/sdk/platform/Payment/PaymentPlatformValidator.d.ts +4 -4
- package/sdk/platform/Payment/PaymentPlatformValidator.js +21 -21
- package/sdk/platform/PlatformApplicationClient.d.ts +1496 -10325
- package/sdk/platform/PlatformApplicationClient.js +1584 -13899
- package/sdk/platform/PlatformClient.d.ts +7965 -7885
- package/sdk/platform/PlatformClient.js +8672 -10105
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.d.ts +83 -83
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +275 -275
- package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.d.ts +8 -8
- package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.js +34 -34
- package/sdk/platform/Rewards/RewardsPlatformModel.d.ts +15 -15
- package/sdk/platform/Rewards/RewardsPlatformModel.js +92 -194
- package/sdk/platform/Share/SharePlatformApplicationClient.d.ts +10 -10
- package/sdk/platform/Share/SharePlatformApplicationClient.js +59 -59
- package/sdk/platform/Share/SharePlatformApplicationValidator.d.ts +1 -1
- package/sdk/platform/Share/SharePlatformApplicationValidator.js +6 -6
- package/sdk/platform/Share/SharePlatformModel.d.ts +8 -8
- package/sdk/platform/Share/SharePlatformModel.js +60 -118
- package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +132 -132
- package/sdk/platform/Theme/ThemePlatformApplicationClient.js +310 -310
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.d.ts +15 -15
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.js +44 -44
- package/sdk/platform/Theme/ThemePlatformModel.d.ts +34 -34
- package/sdk/platform/Theme/ThemePlatformModel.js +190 -336
- package/sdk/platform/User/UserPlatformApplicationClient.d.ts +136 -69
- package/sdk/platform/User/UserPlatformApplicationClient.js +505 -166
- package/sdk/platform/User/UserPlatformApplicationValidator.d.ts +12 -7
- package/sdk/platform/User/UserPlatformApplicationValidator.js +61 -23
- package/sdk/platform/User/UserPlatformModel.d.ts +79 -72
- package/sdk/platform/User/UserPlatformModel.js +440 -689
- package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +31 -31
- package/sdk/platform/Webhook/WebhookPlatformClient.js +88 -88
- package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +7 -7
- package/sdk/platform/Webhook/WebhookPlatformModel.js +68 -136
- package/sdk/platform/Webhook/WebhookPlatformValidator.d.ts +3 -3
- package/sdk/platform/Webhook/WebhookPlatformValidator.js +14 -14
- package/sdk/public/Configuration/ConfigurationPublicClient.d.ts +13 -13
- package/sdk/public/Configuration/ConfigurationPublicClient.js +38 -38
- package/sdk/public/Configuration/ConfigurationPublicModel.d.ts +12 -12
- package/sdk/public/Configuration/ConfigurationPublicModel.js +85 -162
- package/sdk/public/Configuration/ConfigurationPublicValidator.d.ts +1 -1
- package/sdk/public/Configuration/ConfigurationPublicValidator.js +6 -6
- package/sdk/public/Inventory/InventoryPublicClient.d.ts +34 -34
- package/sdk/public/Inventory/InventoryPublicClient.js +113 -113
- package/sdk/public/Inventory/InventoryPublicModel.d.ts +10 -10
- package/sdk/public/Inventory/InventoryPublicModel.js +119 -245
- package/sdk/public/Inventory/InventoryPublicValidator.d.ts +3 -3
- package/sdk/public/Inventory/InventoryPublicValidator.js +15 -15
- package/sdk/public/Webhook/WebhookPublicModel.d.ts +7 -7
- package/sdk/public/Webhook/WebhookPublicModel.js +68 -136
- package/tests/application/catalog.spec.js +7 -0
|
@@ -13,38 +13,19 @@ class Cart {
|
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* @param {Object} arg - Arg object.
|
|
16
|
-
* @param {
|
|
17
|
-
* @param {
|
|
18
|
-
* @param {
|
|
19
|
-
* @
|
|
20
|
-
* @
|
|
21
|
-
* @
|
|
22
|
-
* @param {string} [arg.typeSlug] -
|
|
23
|
-
* @param {string} [arg.code] -
|
|
24
|
-
* @returns {Promise<CouponsResponse>} - Success response
|
|
25
|
-
* @summary: Get with single coupon details or coupon list
|
|
26
|
-
* @description: Get coupon list with pagination
|
|
16
|
+
* @param {string} arg.cartId - Current Cart _id
|
|
17
|
+
* @param {boolean} [arg.b] -
|
|
18
|
+
* @param {AddCartRequest} arg.body
|
|
19
|
+
* @returns {Promise<AddCartDetailResponse>} - Success response
|
|
20
|
+
* @summary: Add items to abandoned cart
|
|
21
|
+
* @description: Use this API to add items to the abandoned cart.
|
|
27
22
|
*/
|
|
28
|
-
async
|
|
29
|
-
|
|
30
|
-
pageSize,
|
|
31
|
-
isArchived,
|
|
32
|
-
title,
|
|
33
|
-
isPublic,
|
|
34
|
-
isDisplay,
|
|
35
|
-
typeSlug,
|
|
36
|
-
code,
|
|
37
|
-
} = {}) {
|
|
38
|
-
const { error } = CartValidator.getCoupons().validate(
|
|
23
|
+
async addItems({ cartId, body, b } = {}) {
|
|
24
|
+
const { error } = CartValidator.addItems().validate(
|
|
39
25
|
{
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
title,
|
|
44
|
-
isPublic,
|
|
45
|
-
isDisplay,
|
|
46
|
-
typeSlug,
|
|
47
|
-
code,
|
|
26
|
+
cartId,
|
|
27
|
+
body,
|
|
28
|
+
b,
|
|
48
29
|
},
|
|
49
30
|
{ abortEarly: false, allowUnknown: true }
|
|
50
31
|
);
|
|
@@ -53,54 +34,44 @@ class Cart {
|
|
|
53
34
|
}
|
|
54
35
|
|
|
55
36
|
// Showing warrnings if extra unknown parameters are found
|
|
56
|
-
const { error: warrning } = CartValidator.
|
|
37
|
+
const { error: warrning } = CartValidator.addItems().validate(
|
|
57
38
|
{
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
title,
|
|
62
|
-
isPublic,
|
|
63
|
-
isDisplay,
|
|
64
|
-
typeSlug,
|
|
65
|
-
code,
|
|
39
|
+
cartId,
|
|
40
|
+
body,
|
|
41
|
+
b,
|
|
66
42
|
},
|
|
67
43
|
{ abortEarly: false, allowUnknown: false }
|
|
68
44
|
);
|
|
69
45
|
if (warrning) {
|
|
70
46
|
Logger({
|
|
71
47
|
level: "WARN",
|
|
72
|
-
message: "Parameter Validation warrnings for
|
|
48
|
+
message: "Parameter Validation warrnings for addItems",
|
|
73
49
|
});
|
|
74
50
|
Logger({ level: "WARN", message: warrning });
|
|
75
51
|
}
|
|
76
52
|
|
|
77
53
|
const query_params = {};
|
|
78
|
-
query_params["
|
|
79
|
-
query_params["page_size"] = pageSize;
|
|
80
|
-
query_params["is_archived"] = isArchived;
|
|
81
|
-
query_params["title"] = title;
|
|
82
|
-
query_params["is_public"] = isPublic;
|
|
83
|
-
query_params["is_display"] = isDisplay;
|
|
84
|
-
query_params["type_slug"] = typeSlug;
|
|
85
|
-
query_params["code"] = code;
|
|
54
|
+
query_params["b"] = b;
|
|
86
55
|
|
|
87
56
|
const response = await PlatformAPIClient.execute(
|
|
88
57
|
this.config,
|
|
89
|
-
"
|
|
90
|
-
`/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/
|
|
58
|
+
"post",
|
|
59
|
+
`/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/abandoned/carts/${cartId}`,
|
|
91
60
|
query_params,
|
|
92
|
-
|
|
61
|
+
body
|
|
93
62
|
);
|
|
94
63
|
|
|
95
|
-
const {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
64
|
+
const {
|
|
65
|
+
error: res_error,
|
|
66
|
+
} = CartModel.AddCartDetailResponse().validate(response, {
|
|
67
|
+
abortEarly: false,
|
|
68
|
+
allowUnknown: false,
|
|
69
|
+
});
|
|
99
70
|
|
|
100
71
|
if (res_error) {
|
|
101
72
|
Logger({
|
|
102
73
|
level: "WARN",
|
|
103
|
-
message: "Response Validation Warnnings for
|
|
74
|
+
message: "Response Validation Warnnings for addItems",
|
|
104
75
|
});
|
|
105
76
|
Logger({ level: "WARN", message: res_error });
|
|
106
77
|
}
|
|
@@ -110,65 +81,13 @@ class Cart {
|
|
|
110
81
|
|
|
111
82
|
/**
|
|
112
83
|
* @param {Object} arg - Arg object.
|
|
113
|
-
* @param {
|
|
114
|
-
* @
|
|
115
|
-
* @
|
|
116
|
-
* @
|
|
117
|
-
* @param {string} [arg.title] -
|
|
118
|
-
* @param {boolean} [arg.isPublic] -
|
|
119
|
-
* @param {boolean} [arg.isDisplay] -
|
|
120
|
-
* @param {string} [arg.typeSlug] -
|
|
121
|
-
* @param {string} [arg.code] -
|
|
122
|
-
* @summary: Get with single coupon details or coupon list
|
|
123
|
-
* @description: Get coupon list with pagination
|
|
124
|
-
*/
|
|
125
|
-
getCouponsPaginator({
|
|
126
|
-
companyId,
|
|
127
|
-
applicationId,
|
|
128
|
-
pageSize,
|
|
129
|
-
isArchived,
|
|
130
|
-
title,
|
|
131
|
-
isPublic,
|
|
132
|
-
isDisplay,
|
|
133
|
-
typeSlug,
|
|
134
|
-
code,
|
|
135
|
-
} = {}) {
|
|
136
|
-
const paginator = new Paginator();
|
|
137
|
-
const callback = async () => {
|
|
138
|
-
const pageId = paginator.nextId;
|
|
139
|
-
const pageNo = paginator.pageNo;
|
|
140
|
-
const pageType = "number";
|
|
141
|
-
const data = await this.getCoupons({
|
|
142
|
-
companyId: companyId,
|
|
143
|
-
applicationId: applicationId,
|
|
144
|
-
pageNo: pageNo,
|
|
145
|
-
pageSize: pageSize,
|
|
146
|
-
isArchived: isArchived,
|
|
147
|
-
title: title,
|
|
148
|
-
isPublic: isPublic,
|
|
149
|
-
isDisplay: isDisplay,
|
|
150
|
-
typeSlug: typeSlug,
|
|
151
|
-
code: code,
|
|
152
|
-
});
|
|
153
|
-
paginator.setPaginator({
|
|
154
|
-
hasNext: data.page.has_next ? true : false,
|
|
155
|
-
nextId: data.page.next_id,
|
|
156
|
-
});
|
|
157
|
-
return data;
|
|
158
|
-
};
|
|
159
|
-
paginator.setCallback(callback.bind(this));
|
|
160
|
-
return paginator;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
/**
|
|
164
|
-
* @param {Object} arg - Arg object.
|
|
165
|
-
* @param {CouponAdd} arg.body
|
|
166
|
-
* @returns {Promise<SuccessMessage>} - Success response
|
|
167
|
-
* @summary: Create new coupon
|
|
168
|
-
* @description: Create new coupon
|
|
84
|
+
* @param {OpenApiCartServiceabilityRequest} arg.body
|
|
85
|
+
* @returns {Promise<OpenApiCartServiceabilityResponse>} - Success response
|
|
86
|
+
* @summary: Check Pincode Serviceability
|
|
87
|
+
* @description: Check Pincode serviceability for cart items provided in `cart_items` and address pincode in `shipping_address`
|
|
169
88
|
*/
|
|
170
|
-
async
|
|
171
|
-
const { error } = CartValidator.
|
|
89
|
+
async checkCartServiceability({ body } = {}) {
|
|
90
|
+
const { error } = CartValidator.checkCartServiceability().validate(
|
|
172
91
|
{
|
|
173
92
|
body,
|
|
174
93
|
},
|
|
@@ -179,7 +98,9 @@ class Cart {
|
|
|
179
98
|
}
|
|
180
99
|
|
|
181
100
|
// Showing warrnings if extra unknown parameters are found
|
|
182
|
-
const {
|
|
101
|
+
const {
|
|
102
|
+
error: warrning,
|
|
103
|
+
} = CartValidator.checkCartServiceability().validate(
|
|
183
104
|
{
|
|
184
105
|
body,
|
|
185
106
|
},
|
|
@@ -188,7 +109,7 @@ class Cart {
|
|
|
188
109
|
if (warrning) {
|
|
189
110
|
Logger({
|
|
190
111
|
level: "WARN",
|
|
191
|
-
message: "Parameter Validation warrnings for
|
|
112
|
+
message: "Parameter Validation warrnings for checkCartServiceability",
|
|
192
113
|
});
|
|
193
114
|
Logger({ level: "WARN", message: warrning });
|
|
194
115
|
}
|
|
@@ -198,12 +119,14 @@ class Cart {
|
|
|
198
119
|
const response = await PlatformAPIClient.execute(
|
|
199
120
|
this.config,
|
|
200
121
|
"post",
|
|
201
|
-
`/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/
|
|
122
|
+
`/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/cart/serviceability`,
|
|
202
123
|
query_params,
|
|
203
124
|
body
|
|
204
125
|
);
|
|
205
126
|
|
|
206
|
-
const {
|
|
127
|
+
const {
|
|
128
|
+
error: res_error,
|
|
129
|
+
} = CartModel.OpenApiCartServiceabilityResponse().validate(response, {
|
|
207
130
|
abortEarly: false,
|
|
208
131
|
allowUnknown: false,
|
|
209
132
|
});
|
|
@@ -211,7 +134,7 @@ class Cart {
|
|
|
211
134
|
if (res_error) {
|
|
212
135
|
Logger({
|
|
213
136
|
level: "WARN",
|
|
214
|
-
message: "Response Validation Warnnings for
|
|
137
|
+
message: "Response Validation Warnnings for checkCartServiceability",
|
|
215
138
|
});
|
|
216
139
|
Logger({ level: "WARN", message: res_error });
|
|
217
140
|
}
|
|
@@ -221,15 +144,15 @@ class Cart {
|
|
|
221
144
|
|
|
222
145
|
/**
|
|
223
146
|
* @param {Object} arg - Arg object.
|
|
224
|
-
* @param {
|
|
225
|
-
* @returns {Promise<
|
|
226
|
-
* @summary:
|
|
227
|
-
* @description:
|
|
147
|
+
* @param {OpenApiPlatformCheckoutReq} arg.body
|
|
148
|
+
* @returns {Promise<OpenApiCheckoutResponse>} - Success response
|
|
149
|
+
* @summary: Create Fynd order with cart details
|
|
150
|
+
* @description: Generate Fynd order for cart details send with provided `cart_items`
|
|
228
151
|
*/
|
|
229
|
-
async
|
|
230
|
-
const { error } = CartValidator.
|
|
152
|
+
async checkoutCart({ body } = {}) {
|
|
153
|
+
const { error } = CartValidator.checkoutCart().validate(
|
|
231
154
|
{
|
|
232
|
-
|
|
155
|
+
body,
|
|
233
156
|
},
|
|
234
157
|
{ abortEarly: false, allowUnknown: true }
|
|
235
158
|
);
|
|
@@ -238,16 +161,16 @@ class Cart {
|
|
|
238
161
|
}
|
|
239
162
|
|
|
240
163
|
// Showing warrnings if extra unknown parameters are found
|
|
241
|
-
const { error: warrning } = CartValidator.
|
|
164
|
+
const { error: warrning } = CartValidator.checkoutCart().validate(
|
|
242
165
|
{
|
|
243
|
-
|
|
166
|
+
body,
|
|
244
167
|
},
|
|
245
168
|
{ abortEarly: false, allowUnknown: false }
|
|
246
169
|
);
|
|
247
170
|
if (warrning) {
|
|
248
171
|
Logger({
|
|
249
172
|
level: "WARN",
|
|
250
|
-
message: "Parameter Validation warrnings for
|
|
173
|
+
message: "Parameter Validation warrnings for checkoutCart",
|
|
251
174
|
});
|
|
252
175
|
Logger({ level: "WARN", message: warrning });
|
|
253
176
|
}
|
|
@@ -256,13 +179,15 @@ class Cart {
|
|
|
256
179
|
|
|
257
180
|
const response = await PlatformAPIClient.execute(
|
|
258
181
|
this.config,
|
|
259
|
-
"
|
|
260
|
-
`/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/
|
|
182
|
+
"post",
|
|
183
|
+
`/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/cart/checkout`,
|
|
261
184
|
query_params,
|
|
262
|
-
|
|
185
|
+
body
|
|
263
186
|
);
|
|
264
187
|
|
|
265
|
-
const {
|
|
188
|
+
const {
|
|
189
|
+
error: res_error,
|
|
190
|
+
} = CartModel.OpenApiCheckoutResponse().validate(response, {
|
|
266
191
|
abortEarly: false,
|
|
267
192
|
allowUnknown: false,
|
|
268
193
|
});
|
|
@@ -270,7 +195,7 @@ class Cart {
|
|
|
270
195
|
if (res_error) {
|
|
271
196
|
Logger({
|
|
272
197
|
level: "WARN",
|
|
273
|
-
message: "Response Validation Warnnings for
|
|
198
|
+
message: "Response Validation Warnnings for checkoutCart",
|
|
274
199
|
});
|
|
275
200
|
Logger({ level: "WARN", message: res_error });
|
|
276
201
|
}
|
|
@@ -280,16 +205,14 @@ class Cart {
|
|
|
280
205
|
|
|
281
206
|
/**
|
|
282
207
|
* @param {Object} arg - Arg object.
|
|
283
|
-
* @param {
|
|
284
|
-
* @param {CouponUpdate} arg.body
|
|
208
|
+
* @param {CouponAdd} arg.body
|
|
285
209
|
* @returns {Promise<SuccessMessage>} - Success response
|
|
286
|
-
* @summary:
|
|
287
|
-
* @description:
|
|
210
|
+
* @summary: Create new coupon
|
|
211
|
+
* @description: Create new coupon
|
|
288
212
|
*/
|
|
289
|
-
async
|
|
290
|
-
const { error } = CartValidator.
|
|
213
|
+
async createCoupon({ body } = {}) {
|
|
214
|
+
const { error } = CartValidator.createCoupon().validate(
|
|
291
215
|
{
|
|
292
|
-
id,
|
|
293
216
|
body,
|
|
294
217
|
},
|
|
295
218
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -299,9 +222,8 @@ class Cart {
|
|
|
299
222
|
}
|
|
300
223
|
|
|
301
224
|
// Showing warrnings if extra unknown parameters are found
|
|
302
|
-
const { error: warrning } = CartValidator.
|
|
225
|
+
const { error: warrning } = CartValidator.createCoupon().validate(
|
|
303
226
|
{
|
|
304
|
-
id,
|
|
305
227
|
body,
|
|
306
228
|
},
|
|
307
229
|
{ abortEarly: false, allowUnknown: false }
|
|
@@ -309,7 +231,7 @@ class Cart {
|
|
|
309
231
|
if (warrning) {
|
|
310
232
|
Logger({
|
|
311
233
|
level: "WARN",
|
|
312
|
-
message: "Parameter Validation warrnings for
|
|
234
|
+
message: "Parameter Validation warrnings for createCoupon",
|
|
313
235
|
});
|
|
314
236
|
Logger({ level: "WARN", message: warrning });
|
|
315
237
|
}
|
|
@@ -318,8 +240,8 @@ class Cart {
|
|
|
318
240
|
|
|
319
241
|
const response = await PlatformAPIClient.execute(
|
|
320
242
|
this.config,
|
|
321
|
-
"
|
|
322
|
-
`/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/coupon
|
|
243
|
+
"post",
|
|
244
|
+
`/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/coupon`,
|
|
323
245
|
query_params,
|
|
324
246
|
body
|
|
325
247
|
);
|
|
@@ -332,7 +254,7 @@ class Cart {
|
|
|
332
254
|
if (res_error) {
|
|
333
255
|
Logger({
|
|
334
256
|
level: "WARN",
|
|
335
|
-
message: "Response Validation Warnnings for
|
|
257
|
+
message: "Response Validation Warnnings for createCoupon",
|
|
336
258
|
});
|
|
337
259
|
Logger({ level: "WARN", message: res_error });
|
|
338
260
|
}
|
|
@@ -342,16 +264,14 @@ class Cart {
|
|
|
342
264
|
|
|
343
265
|
/**
|
|
344
266
|
* @param {Object} arg - Arg object.
|
|
345
|
-
* @param {
|
|
346
|
-
* @
|
|
347
|
-
* @
|
|
348
|
-
* @
|
|
349
|
-
* @description: Update archive/unarchive and change schedule for coupon
|
|
267
|
+
* @param {PromotionAdd} arg.body
|
|
268
|
+
* @returns {Promise<PromotionAdd>} - Success response
|
|
269
|
+
* @summary: Create new promotion
|
|
270
|
+
* @description: Create new promotion
|
|
350
271
|
*/
|
|
351
|
-
async
|
|
352
|
-
const { error } = CartValidator.
|
|
272
|
+
async createPromotion({ body } = {}) {
|
|
273
|
+
const { error } = CartValidator.createPromotion().validate(
|
|
353
274
|
{
|
|
354
|
-
id,
|
|
355
275
|
body,
|
|
356
276
|
},
|
|
357
277
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -361,9 +281,8 @@ class Cart {
|
|
|
361
281
|
}
|
|
362
282
|
|
|
363
283
|
// Showing warrnings if extra unknown parameters are found
|
|
364
|
-
const { error: warrning } = CartValidator.
|
|
284
|
+
const { error: warrning } = CartValidator.createPromotion().validate(
|
|
365
285
|
{
|
|
366
|
-
id,
|
|
367
286
|
body,
|
|
368
287
|
},
|
|
369
288
|
{ abortEarly: false, allowUnknown: false }
|
|
@@ -371,7 +290,7 @@ class Cart {
|
|
|
371
290
|
if (warrning) {
|
|
372
291
|
Logger({
|
|
373
292
|
level: "WARN",
|
|
374
|
-
message: "Parameter Validation warrnings for
|
|
293
|
+
message: "Parameter Validation warrnings for createPromotion",
|
|
375
294
|
});
|
|
376
295
|
Logger({ level: "WARN", message: warrning });
|
|
377
296
|
}
|
|
@@ -380,13 +299,13 @@ class Cart {
|
|
|
380
299
|
|
|
381
300
|
const response = await PlatformAPIClient.execute(
|
|
382
301
|
this.config,
|
|
383
|
-
"
|
|
384
|
-
`/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/
|
|
302
|
+
"post",
|
|
303
|
+
`/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/promotion`,
|
|
385
304
|
query_params,
|
|
386
305
|
body
|
|
387
306
|
);
|
|
388
307
|
|
|
389
|
-
const { error: res_error } = CartModel.
|
|
308
|
+
const { error: res_error } = CartModel.PromotionAdd().validate(response, {
|
|
390
309
|
abortEarly: false,
|
|
391
310
|
allowUnknown: false,
|
|
392
311
|
});
|
|
@@ -394,7 +313,7 @@ class Cart {
|
|
|
394
313
|
if (res_error) {
|
|
395
314
|
Logger({
|
|
396
315
|
level: "WARN",
|
|
397
|
-
message: "Response Validation Warnnings for
|
|
316
|
+
message: "Response Validation Warnnings for createPromotion",
|
|
398
317
|
});
|
|
399
318
|
Logger({ level: "WARN", message: res_error });
|
|
400
319
|
}
|
|
@@ -404,38 +323,98 @@ class Cart {
|
|
|
404
323
|
|
|
405
324
|
/**
|
|
406
325
|
* @param {Object} arg - Arg object.
|
|
407
|
-
* @param {
|
|
408
|
-
* @
|
|
409
|
-
* @
|
|
410
|
-
* @
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
326
|
+
* @param {OpenapiCartDetailsRequest} arg.body
|
|
327
|
+
* @returns {Promise<OpenapiCartDetailsResponse>} - Success response
|
|
328
|
+
* @summary: Fetch Cart Details
|
|
329
|
+
* @description: Get all the details of cart for a list of provided `cart_items`
|
|
330
|
+
*/
|
|
331
|
+
async fetchAndvalidateCartItems({ body } = {}) {
|
|
332
|
+
const { error } = CartValidator.fetchAndvalidateCartItems().validate(
|
|
333
|
+
{
|
|
334
|
+
body,
|
|
335
|
+
},
|
|
336
|
+
{ abortEarly: false, allowUnknown: true }
|
|
337
|
+
);
|
|
338
|
+
if (error) {
|
|
339
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
// Showing warrnings if extra unknown parameters are found
|
|
343
|
+
const {
|
|
344
|
+
error: warrning,
|
|
345
|
+
} = CartValidator.fetchAndvalidateCartItems().validate(
|
|
346
|
+
{
|
|
347
|
+
body,
|
|
348
|
+
},
|
|
349
|
+
{ abortEarly: false, allowUnknown: false }
|
|
350
|
+
);
|
|
351
|
+
if (warrning) {
|
|
352
|
+
Logger({
|
|
353
|
+
level: "WARN",
|
|
354
|
+
message: "Parameter Validation warrnings for fetchAndvalidateCartItems",
|
|
355
|
+
});
|
|
356
|
+
Logger({ level: "WARN", message: warrning });
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
const query_params = {};
|
|
360
|
+
|
|
361
|
+
const response = await PlatformAPIClient.execute(
|
|
362
|
+
this.config,
|
|
363
|
+
"post",
|
|
364
|
+
`/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/cart/validate`,
|
|
365
|
+
query_params,
|
|
366
|
+
body
|
|
367
|
+
);
|
|
368
|
+
|
|
369
|
+
const {
|
|
370
|
+
error: res_error,
|
|
371
|
+
} = CartModel.OpenapiCartDetailsResponse().validate(response, {
|
|
372
|
+
abortEarly: false,
|
|
373
|
+
allowUnknown: false,
|
|
374
|
+
});
|
|
375
|
+
|
|
376
|
+
if (res_error) {
|
|
377
|
+
Logger({
|
|
378
|
+
level: "WARN",
|
|
379
|
+
message: "Response Validation Warnnings for fetchAndvalidateCartItems",
|
|
380
|
+
});
|
|
381
|
+
Logger({ level: "WARN", message: res_error });
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
return response;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
/**
|
|
388
|
+
* @param {Object} arg - Arg object.
|
|
389
|
+
* @param {number} [arg.pageNo] -
|
|
390
|
+
* @param {number} [arg.pageSize] -
|
|
391
|
+
* @param {string} [arg.fromDate] -
|
|
392
|
+
* @param {string} [arg.toDate] -
|
|
393
|
+
* @param {boolean} [arg.anonymousCart] -
|
|
394
|
+
* @param {string} [arg.lastId] -
|
|
395
|
+
* @param {string} [arg.sortOn] -
|
|
396
|
+
* @returns {Promise<AbandonedCartResponse>} - Success response
|
|
397
|
+
* @summary: Get with abandoned cart list
|
|
398
|
+
* @description: Get abandoned cart list with pagination
|
|
399
|
+
*/
|
|
400
|
+
async getAbandonedCart({
|
|
420
401
|
pageNo,
|
|
421
402
|
pageSize,
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
promotionId,
|
|
403
|
+
fromDate,
|
|
404
|
+
toDate,
|
|
405
|
+
anonymousCart,
|
|
406
|
+
lastId,
|
|
407
|
+
sortOn,
|
|
428
408
|
} = {}) {
|
|
429
|
-
const { error } = CartValidator.
|
|
409
|
+
const { error } = CartValidator.getAbandonedCart().validate(
|
|
430
410
|
{
|
|
431
411
|
pageNo,
|
|
432
412
|
pageSize,
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
promotionId,
|
|
413
|
+
fromDate,
|
|
414
|
+
toDate,
|
|
415
|
+
anonymousCart,
|
|
416
|
+
lastId,
|
|
417
|
+
sortOn,
|
|
439
418
|
},
|
|
440
419
|
{ abortEarly: false, allowUnknown: true }
|
|
441
420
|
);
|
|
@@ -444,23 +423,22 @@ class Cart {
|
|
|
444
423
|
}
|
|
445
424
|
|
|
446
425
|
// Showing warrnings if extra unknown parameters are found
|
|
447
|
-
const { error: warrning } = CartValidator.
|
|
426
|
+
const { error: warrning } = CartValidator.getAbandonedCart().validate(
|
|
448
427
|
{
|
|
449
428
|
pageNo,
|
|
450
429
|
pageSize,
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
promotionId,
|
|
430
|
+
fromDate,
|
|
431
|
+
toDate,
|
|
432
|
+
anonymousCart,
|
|
433
|
+
lastId,
|
|
434
|
+
sortOn,
|
|
457
435
|
},
|
|
458
436
|
{ abortEarly: false, allowUnknown: false }
|
|
459
437
|
);
|
|
460
438
|
if (warrning) {
|
|
461
439
|
Logger({
|
|
462
440
|
level: "WARN",
|
|
463
|
-
message: "Parameter Validation warrnings for
|
|
441
|
+
message: "Parameter Validation warrnings for getAbandonedCart",
|
|
464
442
|
});
|
|
465
443
|
Logger({ level: "WARN", message: warrning });
|
|
466
444
|
}
|
|
@@ -468,24 +446,23 @@ class Cart {
|
|
|
468
446
|
const query_params = {};
|
|
469
447
|
query_params["page_no"] = pageNo;
|
|
470
448
|
query_params["page_size"] = pageSize;
|
|
471
|
-
query_params["
|
|
472
|
-
query_params["
|
|
473
|
-
query_params["
|
|
474
|
-
query_params["
|
|
475
|
-
query_params["
|
|
476
|
-
query_params["promotion_id"] = promotionId;
|
|
449
|
+
query_params["from_date"] = fromDate;
|
|
450
|
+
query_params["to_date"] = toDate;
|
|
451
|
+
query_params["anonymous_cart"] = anonymousCart;
|
|
452
|
+
query_params["last_id"] = lastId;
|
|
453
|
+
query_params["sort_on"] = sortOn;
|
|
477
454
|
|
|
478
455
|
const response = await PlatformAPIClient.execute(
|
|
479
456
|
this.config,
|
|
480
457
|
"get",
|
|
481
|
-
`/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/
|
|
458
|
+
`/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/abandoned/carts`,
|
|
482
459
|
query_params,
|
|
483
460
|
undefined
|
|
484
461
|
);
|
|
485
462
|
|
|
486
463
|
const {
|
|
487
464
|
error: res_error,
|
|
488
|
-
} = CartModel.
|
|
465
|
+
} = CartModel.AbandonedCartResponse().validate(response, {
|
|
489
466
|
abortEarly: false,
|
|
490
467
|
allowUnknown: false,
|
|
491
468
|
});
|
|
@@ -493,7 +470,7 @@ class Cart {
|
|
|
493
470
|
if (res_error) {
|
|
494
471
|
Logger({
|
|
495
472
|
level: "WARN",
|
|
496
|
-
message: "Response Validation Warnnings for
|
|
473
|
+
message: "Response Validation Warnnings for getAbandonedCart",
|
|
497
474
|
});
|
|
498
475
|
Logger({ level: "WARN", message: res_error });
|
|
499
476
|
}
|
|
@@ -506,42 +483,39 @@ class Cart {
|
|
|
506
483
|
* @param {string} arg.companyId - Current company id
|
|
507
484
|
* @param {string} arg.applicationId - Current Application _id
|
|
508
485
|
* @param {number} [arg.pageSize] -
|
|
509
|
-
* @param {string} [arg.
|
|
510
|
-
* @param {
|
|
511
|
-
* @param {
|
|
512
|
-
* @param {string} [arg.
|
|
513
|
-
* @param {string} [arg.
|
|
514
|
-
* @
|
|
515
|
-
* @
|
|
516
|
-
* @description: Get promotion list with pagination
|
|
486
|
+
* @param {string} [arg.fromDate] -
|
|
487
|
+
* @param {string} [arg.toDate] -
|
|
488
|
+
* @param {boolean} [arg.anonymousCart] -
|
|
489
|
+
* @param {string} [arg.lastId] -
|
|
490
|
+
* @param {string} [arg.sortOn] -
|
|
491
|
+
* @summary: Get with abandoned cart list
|
|
492
|
+
* @description: Get abandoned cart list with pagination
|
|
517
493
|
*/
|
|
518
|
-
|
|
494
|
+
getAbandonedCartPaginator({
|
|
519
495
|
companyId,
|
|
520
496
|
applicationId,
|
|
521
497
|
pageSize,
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
promotionId,
|
|
498
|
+
fromDate,
|
|
499
|
+
toDate,
|
|
500
|
+
anonymousCart,
|
|
501
|
+
lastId,
|
|
502
|
+
sortOn,
|
|
528
503
|
} = {}) {
|
|
529
504
|
const paginator = new Paginator();
|
|
530
505
|
const callback = async () => {
|
|
531
506
|
const pageId = paginator.nextId;
|
|
532
507
|
const pageNo = paginator.pageNo;
|
|
533
508
|
const pageType = "number";
|
|
534
|
-
const data = await this.
|
|
509
|
+
const data = await this.getAbandonedCart({
|
|
535
510
|
companyId: companyId,
|
|
536
511
|
applicationId: applicationId,
|
|
537
512
|
pageNo: pageNo,
|
|
538
513
|
pageSize: pageSize,
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
promotionId: promotionId,
|
|
514
|
+
fromDate: fromDate,
|
|
515
|
+
toDate: toDate,
|
|
516
|
+
anonymousCart: anonymousCart,
|
|
517
|
+
lastId: lastId,
|
|
518
|
+
sortOn: sortOn,
|
|
545
519
|
});
|
|
546
520
|
paginator.setPaginator({
|
|
547
521
|
hasNext: data.page.has_next ? true : false,
|
|
@@ -555,15 +529,19 @@ class Cart {
|
|
|
555
529
|
|
|
556
530
|
/**
|
|
557
531
|
* @param {Object} arg - Arg object.
|
|
558
|
-
* @param {
|
|
559
|
-
* @
|
|
560
|
-
* @
|
|
561
|
-
* @
|
|
532
|
+
* @param {string} [arg.id] -
|
|
533
|
+
* @param {boolean} [arg.i] -
|
|
534
|
+
* @param {boolean} [arg.b] -
|
|
535
|
+
* @returns {Promise<CartDetailResponse>} - Success response
|
|
536
|
+
* @summary: Fetch all items added to the cart
|
|
537
|
+
* @description: Use this API to get details of all the items added to a cart.
|
|
562
538
|
*/
|
|
563
|
-
async
|
|
564
|
-
const { error } = CartValidator.
|
|
539
|
+
async getAbandonedCartDetails({ id, i, b } = {}) {
|
|
540
|
+
const { error } = CartValidator.getAbandonedCartDetails().validate(
|
|
565
541
|
{
|
|
566
|
-
|
|
542
|
+
id,
|
|
543
|
+
i,
|
|
544
|
+
b,
|
|
567
545
|
},
|
|
568
546
|
{ abortEarly: false, allowUnknown: true }
|
|
569
547
|
);
|
|
@@ -572,31 +550,40 @@ class Cart {
|
|
|
572
550
|
}
|
|
573
551
|
|
|
574
552
|
// Showing warrnings if extra unknown parameters are found
|
|
575
|
-
const {
|
|
553
|
+
const {
|
|
554
|
+
error: warrning,
|
|
555
|
+
} = CartValidator.getAbandonedCartDetails().validate(
|
|
576
556
|
{
|
|
577
|
-
|
|
557
|
+
id,
|
|
558
|
+
i,
|
|
559
|
+
b,
|
|
578
560
|
},
|
|
579
561
|
{ abortEarly: false, allowUnknown: false }
|
|
580
562
|
);
|
|
581
563
|
if (warrning) {
|
|
582
564
|
Logger({
|
|
583
565
|
level: "WARN",
|
|
584
|
-
message: "Parameter Validation warrnings for
|
|
566
|
+
message: "Parameter Validation warrnings for getAbandonedCartDetails",
|
|
585
567
|
});
|
|
586
568
|
Logger({ level: "WARN", message: warrning });
|
|
587
569
|
}
|
|
588
570
|
|
|
589
571
|
const query_params = {};
|
|
572
|
+
query_params["id"] = id;
|
|
573
|
+
query_params["i"] = i;
|
|
574
|
+
query_params["b"] = b;
|
|
590
575
|
|
|
591
576
|
const response = await PlatformAPIClient.execute(
|
|
592
577
|
this.config,
|
|
593
|
-
"
|
|
594
|
-
`/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/
|
|
578
|
+
"get",
|
|
579
|
+
`/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/abandoned/cart/detail`,
|
|
595
580
|
query_params,
|
|
596
|
-
|
|
581
|
+
undefined
|
|
597
582
|
);
|
|
598
583
|
|
|
599
|
-
const {
|
|
584
|
+
const {
|
|
585
|
+
error: res_error,
|
|
586
|
+
} = CartModel.CartDetailResponse().validate(response, {
|
|
600
587
|
abortEarly: false,
|
|
601
588
|
allowUnknown: false,
|
|
602
589
|
});
|
|
@@ -604,7 +591,7 @@ class Cart {
|
|
|
604
591
|
if (res_error) {
|
|
605
592
|
Logger({
|
|
606
593
|
level: "WARN",
|
|
607
|
-
message: "Response Validation Warnnings for
|
|
594
|
+
message: "Response Validation Warnnings for getAbandonedCartDetails",
|
|
608
595
|
});
|
|
609
596
|
Logger({ level: "WARN", message: res_error });
|
|
610
597
|
}
|
|
@@ -615,12 +602,12 @@ class Cart {
|
|
|
615
602
|
/**
|
|
616
603
|
* @param {Object} arg - Arg object.
|
|
617
604
|
* @param {string} arg.id -
|
|
618
|
-
* @returns {Promise<
|
|
619
|
-
* @summary: Get with single
|
|
620
|
-
* @description: Get single
|
|
605
|
+
* @returns {Promise<CouponUpdate>} - Success response
|
|
606
|
+
* @summary: Get with single coupon details or coupon list
|
|
607
|
+
* @description: Get single coupon details with `id` in path param
|
|
621
608
|
*/
|
|
622
|
-
async
|
|
623
|
-
const { error } = CartValidator.
|
|
609
|
+
async getCouponById({ id } = {}) {
|
|
610
|
+
const { error } = CartValidator.getCouponById().validate(
|
|
624
611
|
{
|
|
625
612
|
id,
|
|
626
613
|
},
|
|
@@ -631,7 +618,7 @@ class Cart {
|
|
|
631
618
|
}
|
|
632
619
|
|
|
633
620
|
// Showing warrnings if extra unknown parameters are found
|
|
634
|
-
const { error: warrning } = CartValidator.
|
|
621
|
+
const { error: warrning } = CartValidator.getCouponById().validate(
|
|
635
622
|
{
|
|
636
623
|
id,
|
|
637
624
|
},
|
|
@@ -640,7 +627,7 @@ class Cart {
|
|
|
640
627
|
if (warrning) {
|
|
641
628
|
Logger({
|
|
642
629
|
level: "WARN",
|
|
643
|
-
message: "Parameter Validation warrnings for
|
|
630
|
+
message: "Parameter Validation warrnings for getCouponById",
|
|
644
631
|
});
|
|
645
632
|
Logger({ level: "WARN", message: warrning });
|
|
646
633
|
}
|
|
@@ -650,20 +637,20 @@ class Cart {
|
|
|
650
637
|
const response = await PlatformAPIClient.execute(
|
|
651
638
|
this.config,
|
|
652
639
|
"get",
|
|
653
|
-
`/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/
|
|
640
|
+
`/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/coupon/${id}`,
|
|
654
641
|
query_params,
|
|
655
642
|
undefined
|
|
656
643
|
);
|
|
657
644
|
|
|
658
|
-
const { error: res_error } = CartModel.
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
);
|
|
645
|
+
const { error: res_error } = CartModel.CouponUpdate().validate(response, {
|
|
646
|
+
abortEarly: false,
|
|
647
|
+
allowUnknown: false,
|
|
648
|
+
});
|
|
662
649
|
|
|
663
650
|
if (res_error) {
|
|
664
651
|
Logger({
|
|
665
652
|
level: "WARN",
|
|
666
|
-
message: "Response Validation Warnnings for
|
|
653
|
+
message: "Response Validation Warnnings for getCouponById",
|
|
667
654
|
});
|
|
668
655
|
Logger({ level: "WARN", message: res_error });
|
|
669
656
|
}
|
|
@@ -673,51 +660,86 @@ class Cart {
|
|
|
673
660
|
|
|
674
661
|
/**
|
|
675
662
|
* @param {Object} arg - Arg object.
|
|
676
|
-
* @param {
|
|
677
|
-
* @param {
|
|
678
|
-
* @
|
|
679
|
-
* @
|
|
680
|
-
* @
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
663
|
+
* @param {number} [arg.pageNo] -
|
|
664
|
+
* @param {number} [arg.pageSize] -
|
|
665
|
+
* @param {boolean} [arg.isArchived] -
|
|
666
|
+
* @param {string} [arg.title] -
|
|
667
|
+
* @param {boolean} [arg.isPublic] -
|
|
668
|
+
* @param {boolean} [arg.isDisplay] -
|
|
669
|
+
* @param {string} [arg.typeSlug] -
|
|
670
|
+
* @param {string} [arg.code] -
|
|
671
|
+
* @returns {Promise<CouponsResponse>} - Success response
|
|
672
|
+
* @summary: Get with single coupon details or coupon list
|
|
673
|
+
* @description: Get coupon list with pagination
|
|
674
|
+
*/
|
|
675
|
+
async getCoupons({
|
|
676
|
+
pageNo,
|
|
677
|
+
pageSize,
|
|
678
|
+
isArchived,
|
|
679
|
+
title,
|
|
680
|
+
isPublic,
|
|
681
|
+
isDisplay,
|
|
682
|
+
typeSlug,
|
|
683
|
+
code,
|
|
684
|
+
} = {}) {
|
|
685
|
+
const { error } = CartValidator.getCoupons().validate(
|
|
686
|
+
{
|
|
687
|
+
pageNo,
|
|
688
|
+
pageSize,
|
|
689
|
+
isArchived,
|
|
690
|
+
title,
|
|
691
|
+
isPublic,
|
|
692
|
+
isDisplay,
|
|
693
|
+
typeSlug,
|
|
694
|
+
code,
|
|
695
|
+
},
|
|
696
|
+
{ abortEarly: false, allowUnknown: true }
|
|
697
|
+
);
|
|
698
|
+
if (error) {
|
|
691
699
|
return Promise.reject(new FDKClientValidationError(error));
|
|
692
700
|
}
|
|
693
701
|
|
|
694
702
|
// Showing warrnings if extra unknown parameters are found
|
|
695
|
-
const { error: warrning } = CartValidator.
|
|
703
|
+
const { error: warrning } = CartValidator.getCoupons().validate(
|
|
696
704
|
{
|
|
697
|
-
|
|
698
|
-
|
|
705
|
+
pageNo,
|
|
706
|
+
pageSize,
|
|
707
|
+
isArchived,
|
|
708
|
+
title,
|
|
709
|
+
isPublic,
|
|
710
|
+
isDisplay,
|
|
711
|
+
typeSlug,
|
|
712
|
+
code,
|
|
699
713
|
},
|
|
700
714
|
{ abortEarly: false, allowUnknown: false }
|
|
701
715
|
);
|
|
702
716
|
if (warrning) {
|
|
703
717
|
Logger({
|
|
704
718
|
level: "WARN",
|
|
705
|
-
message: "Parameter Validation warrnings for
|
|
719
|
+
message: "Parameter Validation warrnings for getCoupons",
|
|
706
720
|
});
|
|
707
721
|
Logger({ level: "WARN", message: warrning });
|
|
708
722
|
}
|
|
709
723
|
|
|
710
724
|
const query_params = {};
|
|
725
|
+
query_params["page_no"] = pageNo;
|
|
726
|
+
query_params["page_size"] = pageSize;
|
|
727
|
+
query_params["is_archived"] = isArchived;
|
|
728
|
+
query_params["title"] = title;
|
|
729
|
+
query_params["is_public"] = isPublic;
|
|
730
|
+
query_params["is_display"] = isDisplay;
|
|
731
|
+
query_params["type_slug"] = typeSlug;
|
|
732
|
+
query_params["code"] = code;
|
|
711
733
|
|
|
712
734
|
const response = await PlatformAPIClient.execute(
|
|
713
735
|
this.config,
|
|
714
|
-
"
|
|
715
|
-
`/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/
|
|
736
|
+
"get",
|
|
737
|
+
`/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/coupon`,
|
|
716
738
|
query_params,
|
|
717
|
-
|
|
739
|
+
undefined
|
|
718
740
|
);
|
|
719
741
|
|
|
720
|
-
const { error: res_error } = CartModel.
|
|
742
|
+
const { error: res_error } = CartModel.CouponsResponse().validate(
|
|
721
743
|
response,
|
|
722
744
|
{ abortEarly: false, allowUnknown: false }
|
|
723
745
|
);
|
|
@@ -725,7 +747,7 @@ class Cart {
|
|
|
725
747
|
if (res_error) {
|
|
726
748
|
Logger({
|
|
727
749
|
level: "WARN",
|
|
728
|
-
message: "Response Validation Warnnings for
|
|
750
|
+
message: "Response Validation Warnnings for getCoupons",
|
|
729
751
|
});
|
|
730
752
|
Logger({ level: "WARN", message: res_error });
|
|
731
753
|
}
|
|
@@ -733,19 +755,69 @@ class Cart {
|
|
|
733
755
|
return response;
|
|
734
756
|
}
|
|
735
757
|
|
|
758
|
+
/**
|
|
759
|
+
* @param {Object} arg - Arg object.
|
|
760
|
+
* @param {string} arg.companyId - Current company id
|
|
761
|
+
* @param {string} arg.applicationId - Current Application _id
|
|
762
|
+
* @param {number} [arg.pageSize] -
|
|
763
|
+
* @param {boolean} [arg.isArchived] -
|
|
764
|
+
* @param {string} [arg.title] -
|
|
765
|
+
* @param {boolean} [arg.isPublic] -
|
|
766
|
+
* @param {boolean} [arg.isDisplay] -
|
|
767
|
+
* @param {string} [arg.typeSlug] -
|
|
768
|
+
* @param {string} [arg.code] -
|
|
769
|
+
* @summary: Get with single coupon details or coupon list
|
|
770
|
+
* @description: Get coupon list with pagination
|
|
771
|
+
*/
|
|
772
|
+
getCouponsPaginator({
|
|
773
|
+
companyId,
|
|
774
|
+
applicationId,
|
|
775
|
+
pageSize,
|
|
776
|
+
isArchived,
|
|
777
|
+
title,
|
|
778
|
+
isPublic,
|
|
779
|
+
isDisplay,
|
|
780
|
+
typeSlug,
|
|
781
|
+
code,
|
|
782
|
+
} = {}) {
|
|
783
|
+
const paginator = new Paginator();
|
|
784
|
+
const callback = async () => {
|
|
785
|
+
const pageId = paginator.nextId;
|
|
786
|
+
const pageNo = paginator.pageNo;
|
|
787
|
+
const pageType = "number";
|
|
788
|
+
const data = await this.getCoupons({
|
|
789
|
+
companyId: companyId,
|
|
790
|
+
applicationId: applicationId,
|
|
791
|
+
pageNo: pageNo,
|
|
792
|
+
pageSize: pageSize,
|
|
793
|
+
isArchived: isArchived,
|
|
794
|
+
title: title,
|
|
795
|
+
isPublic: isPublic,
|
|
796
|
+
isDisplay: isDisplay,
|
|
797
|
+
typeSlug: typeSlug,
|
|
798
|
+
code: code,
|
|
799
|
+
});
|
|
800
|
+
paginator.setPaginator({
|
|
801
|
+
hasNext: data.page.has_next ? true : false,
|
|
802
|
+
nextId: data.page.next_id,
|
|
803
|
+
});
|
|
804
|
+
return data;
|
|
805
|
+
};
|
|
806
|
+
paginator.setCallback(callback.bind(this));
|
|
807
|
+
return paginator;
|
|
808
|
+
}
|
|
809
|
+
|
|
736
810
|
/**
|
|
737
811
|
* @param {Object} arg - Arg object.
|
|
738
812
|
* @param {string} arg.id -
|
|
739
|
-
* @
|
|
740
|
-
* @
|
|
741
|
-
* @
|
|
742
|
-
* @description: Update publish/unpublish and change schedule for promotion
|
|
813
|
+
* @returns {Promise<PromotionUpdate>} - Success response
|
|
814
|
+
* @summary: Get with single promotion details or promotion list
|
|
815
|
+
* @description: Get single promotion details with `id` in path param
|
|
743
816
|
*/
|
|
744
|
-
async
|
|
745
|
-
const { error } = CartValidator.
|
|
817
|
+
async getPromotionById({ id } = {}) {
|
|
818
|
+
const { error } = CartValidator.getPromotionById().validate(
|
|
746
819
|
{
|
|
747
820
|
id,
|
|
748
|
-
body,
|
|
749
821
|
},
|
|
750
822
|
{ abortEarly: false, allowUnknown: true }
|
|
751
823
|
);
|
|
@@ -754,19 +826,16 @@ class Cart {
|
|
|
754
826
|
}
|
|
755
827
|
|
|
756
828
|
// Showing warrnings if extra unknown parameters are found
|
|
757
|
-
const {
|
|
758
|
-
error: warrning,
|
|
759
|
-
} = CartValidator.updatePromotionPartially().validate(
|
|
829
|
+
const { error: warrning } = CartValidator.getPromotionById().validate(
|
|
760
830
|
{
|
|
761
831
|
id,
|
|
762
|
-
body,
|
|
763
832
|
},
|
|
764
833
|
{ abortEarly: false, allowUnknown: false }
|
|
765
834
|
);
|
|
766
835
|
if (warrning) {
|
|
767
836
|
Logger({
|
|
768
837
|
level: "WARN",
|
|
769
|
-
message: "Parameter Validation warrnings for
|
|
838
|
+
message: "Parameter Validation warrnings for getPromotionById",
|
|
770
839
|
});
|
|
771
840
|
Logger({ level: "WARN", message: warrning });
|
|
772
841
|
}
|
|
@@ -775,21 +844,21 @@ class Cart {
|
|
|
775
844
|
|
|
776
845
|
const response = await PlatformAPIClient.execute(
|
|
777
846
|
this.config,
|
|
778
|
-
"
|
|
847
|
+
"get",
|
|
779
848
|
`/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/promotion/${id}`,
|
|
780
849
|
query_params,
|
|
781
|
-
|
|
850
|
+
undefined
|
|
782
851
|
);
|
|
783
852
|
|
|
784
|
-
const { error: res_error } = CartModel.
|
|
785
|
-
|
|
786
|
-
allowUnknown: false
|
|
787
|
-
|
|
853
|
+
const { error: res_error } = CartModel.PromotionUpdate().validate(
|
|
854
|
+
response,
|
|
855
|
+
{ abortEarly: false, allowUnknown: false }
|
|
856
|
+
);
|
|
788
857
|
|
|
789
858
|
if (res_error) {
|
|
790
859
|
Logger({
|
|
791
860
|
level: "WARN",
|
|
792
|
-
message: "Response Validation Warnnings for
|
|
861
|
+
message: "Response Validation Warnnings for getPromotionById",
|
|
793
862
|
});
|
|
794
863
|
Logger({ level: "WARN", message: res_error });
|
|
795
864
|
}
|
|
@@ -799,15 +868,38 @@ class Cart {
|
|
|
799
868
|
|
|
800
869
|
/**
|
|
801
870
|
* @param {Object} arg - Arg object.
|
|
802
|
-
* @param {
|
|
803
|
-
* @
|
|
804
|
-
* @
|
|
805
|
-
* @
|
|
871
|
+
* @param {number} [arg.pageNo] -
|
|
872
|
+
* @param {number} [arg.pageSize] -
|
|
873
|
+
* @param {string} [arg.q] -
|
|
874
|
+
* @param {boolean} [arg.isActive] -
|
|
875
|
+
* @param {string} [arg.promoGroup] -
|
|
876
|
+
* @param {string} [arg.promotionType] -
|
|
877
|
+
* @param {string} [arg.fpPanel] -
|
|
878
|
+
* @param {string} [arg.promotionId] -
|
|
879
|
+
* @returns {Promise<PromotionsResponse>} - Success response
|
|
880
|
+
* @summary: Get promotion list
|
|
881
|
+
* @description: Get promotion list with pagination
|
|
806
882
|
*/
|
|
807
|
-
async
|
|
808
|
-
|
|
883
|
+
async getPromotions({
|
|
884
|
+
pageNo,
|
|
885
|
+
pageSize,
|
|
886
|
+
q,
|
|
887
|
+
isActive,
|
|
888
|
+
promoGroup,
|
|
889
|
+
promotionType,
|
|
890
|
+
fpPanel,
|
|
891
|
+
promotionId,
|
|
892
|
+
} = {}) {
|
|
893
|
+
const { error } = CartValidator.getPromotions().validate(
|
|
809
894
|
{
|
|
810
|
-
|
|
895
|
+
pageNo,
|
|
896
|
+
pageSize,
|
|
897
|
+
q,
|
|
898
|
+
isActive,
|
|
899
|
+
promoGroup,
|
|
900
|
+
promotionType,
|
|
901
|
+
fpPanel,
|
|
902
|
+
promotionId,
|
|
811
903
|
},
|
|
812
904
|
{ abortEarly: false, allowUnknown: true }
|
|
813
905
|
);
|
|
@@ -816,35 +908,48 @@ class Cart {
|
|
|
816
908
|
}
|
|
817
909
|
|
|
818
910
|
// Showing warrnings if extra unknown parameters are found
|
|
819
|
-
const {
|
|
820
|
-
error: warrning,
|
|
821
|
-
} = CartValidator.fetchAndvalidateCartItems().validate(
|
|
911
|
+
const { error: warrning } = CartValidator.getPromotions().validate(
|
|
822
912
|
{
|
|
823
|
-
|
|
913
|
+
pageNo,
|
|
914
|
+
pageSize,
|
|
915
|
+
q,
|
|
916
|
+
isActive,
|
|
917
|
+
promoGroup,
|
|
918
|
+
promotionType,
|
|
919
|
+
fpPanel,
|
|
920
|
+
promotionId,
|
|
824
921
|
},
|
|
825
922
|
{ abortEarly: false, allowUnknown: false }
|
|
826
923
|
);
|
|
827
924
|
if (warrning) {
|
|
828
925
|
Logger({
|
|
829
926
|
level: "WARN",
|
|
830
|
-
message: "Parameter Validation warrnings for
|
|
927
|
+
message: "Parameter Validation warrnings for getPromotions",
|
|
831
928
|
});
|
|
832
929
|
Logger({ level: "WARN", message: warrning });
|
|
833
930
|
}
|
|
834
931
|
|
|
835
932
|
const query_params = {};
|
|
933
|
+
query_params["page_no"] = pageNo;
|
|
934
|
+
query_params["page_size"] = pageSize;
|
|
935
|
+
query_params["q"] = q;
|
|
936
|
+
query_params["is_active"] = isActive;
|
|
937
|
+
query_params["promo_group"] = promoGroup;
|
|
938
|
+
query_params["promotion_type"] = promotionType;
|
|
939
|
+
query_params["fp_panel"] = fpPanel;
|
|
940
|
+
query_params["promotion_id"] = promotionId;
|
|
836
941
|
|
|
837
942
|
const response = await PlatformAPIClient.execute(
|
|
838
943
|
this.config,
|
|
839
|
-
"
|
|
840
|
-
`/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/
|
|
944
|
+
"get",
|
|
945
|
+
`/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/promotion`,
|
|
841
946
|
query_params,
|
|
842
|
-
|
|
947
|
+
undefined
|
|
843
948
|
);
|
|
844
949
|
|
|
845
950
|
const {
|
|
846
951
|
error: res_error,
|
|
847
|
-
} = CartModel.
|
|
952
|
+
} = CartModel.PromotionsResponse().validate(response, {
|
|
848
953
|
abortEarly: false,
|
|
849
954
|
allowUnknown: false,
|
|
850
955
|
});
|
|
@@ -852,7 +957,7 @@ class Cart {
|
|
|
852
957
|
if (res_error) {
|
|
853
958
|
Logger({
|
|
854
959
|
level: "WARN",
|
|
855
|
-
message: "Response Validation Warnnings for
|
|
960
|
+
message: "Response Validation Warnnings for getPromotions",
|
|
856
961
|
});
|
|
857
962
|
Logger({ level: "WARN", message: res_error });
|
|
858
963
|
}
|
|
@@ -862,78 +967,71 @@ class Cart {
|
|
|
862
967
|
|
|
863
968
|
/**
|
|
864
969
|
* @param {Object} arg - Arg object.
|
|
865
|
-
* @param {
|
|
866
|
-
* @
|
|
867
|
-
* @
|
|
868
|
-
* @
|
|
970
|
+
* @param {string} arg.companyId - Current company id
|
|
971
|
+
* @param {string} arg.applicationId - Current Application _id
|
|
972
|
+
* @param {number} [arg.pageSize] -
|
|
973
|
+
* @param {string} [arg.q] -
|
|
974
|
+
* @param {boolean} [arg.isActive] -
|
|
975
|
+
* @param {string} [arg.promoGroup] -
|
|
976
|
+
* @param {string} [arg.promotionType] -
|
|
977
|
+
* @param {string} [arg.fpPanel] -
|
|
978
|
+
* @param {string} [arg.promotionId] -
|
|
979
|
+
* @summary: Get promotion list
|
|
980
|
+
* @description: Get promotion list with pagination
|
|
869
981
|
*/
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
const {
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
982
|
+
getPromotionsPaginator({
|
|
983
|
+
companyId,
|
|
984
|
+
applicationId,
|
|
985
|
+
pageSize,
|
|
986
|
+
q,
|
|
987
|
+
isActive,
|
|
988
|
+
promoGroup,
|
|
989
|
+
promotionType,
|
|
990
|
+
fpPanel,
|
|
991
|
+
promotionId,
|
|
992
|
+
} = {}) {
|
|
993
|
+
const paginator = new Paginator();
|
|
994
|
+
const callback = async () => {
|
|
995
|
+
const pageId = paginator.nextId;
|
|
996
|
+
const pageNo = paginator.pageNo;
|
|
997
|
+
const pageType = "number";
|
|
998
|
+
const data = await this.getPromotions({
|
|
999
|
+
companyId: companyId,
|
|
1000
|
+
applicationId: applicationId,
|
|
1001
|
+
pageNo: pageNo,
|
|
1002
|
+
pageSize: pageSize,
|
|
1003
|
+
q: q,
|
|
1004
|
+
isActive: isActive,
|
|
1005
|
+
promoGroup: promoGroup,
|
|
1006
|
+
promotionType: promotionType,
|
|
1007
|
+
fpPanel: fpPanel,
|
|
1008
|
+
promotionId: promotionId,
|
|
894
1009
|
});
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
const query_params = {};
|
|
899
|
-
|
|
900
|
-
const response = await PlatformAPIClient.execute(
|
|
901
|
-
this.config,
|
|
902
|
-
"post",
|
|
903
|
-
`/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/cart/serviceability`,
|
|
904
|
-
query_params,
|
|
905
|
-
body
|
|
906
|
-
);
|
|
907
|
-
|
|
908
|
-
const {
|
|
909
|
-
error: res_error,
|
|
910
|
-
} = CartModel.OpenApiCartServiceabilityResponse().validate(response, {
|
|
911
|
-
abortEarly: false,
|
|
912
|
-
allowUnknown: false,
|
|
913
|
-
});
|
|
914
|
-
|
|
915
|
-
if (res_error) {
|
|
916
|
-
Logger({
|
|
917
|
-
level: "WARN",
|
|
918
|
-
message: "Response Validation Warnnings for checkCartServiceability",
|
|
1010
|
+
paginator.setPaginator({
|
|
1011
|
+
hasNext: data.page.has_next ? true : false,
|
|
1012
|
+
nextId: data.page.next_id,
|
|
919
1013
|
});
|
|
920
|
-
|
|
921
|
-
}
|
|
922
|
-
|
|
923
|
-
return
|
|
1014
|
+
return data;
|
|
1015
|
+
};
|
|
1016
|
+
paginator.setCallback(callback.bind(this));
|
|
1017
|
+
return paginator;
|
|
924
1018
|
}
|
|
925
1019
|
|
|
926
1020
|
/**
|
|
927
1021
|
* @param {Object} arg - Arg object.
|
|
928
|
-
* @param {
|
|
929
|
-
* @
|
|
930
|
-
* @
|
|
931
|
-
* @
|
|
1022
|
+
* @param {string} arg.cartId - Current Cart _id
|
|
1023
|
+
* @param {boolean} [arg.b] -
|
|
1024
|
+
* @param {UpdateCartRequest} arg.body
|
|
1025
|
+
* @returns {Promise<UpdateCartDetailResponse>} - Success response
|
|
1026
|
+
* @summary: Update items in the abandoned cart
|
|
1027
|
+
* @description: <p>Use this API to update items added to the cart with the help of a request object containing attributes like item_quantity and item_size. These attributes will be fetched from the following APIs</p> <ul> <li><font color="monochrome">operation</font> Operation for current api call. <b>update_item</b> for update items. <b>remove_item</b> for removing items.</li> <li> <font color="monochrome">item_id</font> "/platform/content/v1/products/"</li> <li> <font color="monochrome">item_size</font> "/platform/content/v1/products/:slug/sizes/"</li> <li> <font color="monochrome">quantity</font> item quantity (must be greater than or equal to 1)</li> <li> <font color="monochrome">article_id</font> "/content/v1/products/:identifier/sizes/price/"</li> <li> <font color="monochrome">item_index</font> item position in the cart (must be greater than or equal to 0)</li> </ul>
|
|
932
1028
|
*/
|
|
933
|
-
async
|
|
934
|
-
const { error } = CartValidator.
|
|
1029
|
+
async updateCart({ cartId, body, b } = {}) {
|
|
1030
|
+
const { error } = CartValidator.updateCart().validate(
|
|
935
1031
|
{
|
|
1032
|
+
cartId,
|
|
936
1033
|
body,
|
|
1034
|
+
b,
|
|
937
1035
|
},
|
|
938
1036
|
{ abortEarly: false, allowUnknown: true }
|
|
939
1037
|
);
|
|
@@ -942,33 +1040,36 @@ class Cart {
|
|
|
942
1040
|
}
|
|
943
1041
|
|
|
944
1042
|
// Showing warrnings if extra unknown parameters are found
|
|
945
|
-
const { error: warrning } = CartValidator.
|
|
1043
|
+
const { error: warrning } = CartValidator.updateCart().validate(
|
|
946
1044
|
{
|
|
1045
|
+
cartId,
|
|
947
1046
|
body,
|
|
1047
|
+
b,
|
|
948
1048
|
},
|
|
949
1049
|
{ abortEarly: false, allowUnknown: false }
|
|
950
1050
|
);
|
|
951
1051
|
if (warrning) {
|
|
952
1052
|
Logger({
|
|
953
1053
|
level: "WARN",
|
|
954
|
-
message: "Parameter Validation warrnings for
|
|
1054
|
+
message: "Parameter Validation warrnings for updateCart",
|
|
955
1055
|
});
|
|
956
1056
|
Logger({ level: "WARN", message: warrning });
|
|
957
1057
|
}
|
|
958
1058
|
|
|
959
1059
|
const query_params = {};
|
|
1060
|
+
query_params["b"] = b;
|
|
960
1061
|
|
|
961
1062
|
const response = await PlatformAPIClient.execute(
|
|
962
1063
|
this.config,
|
|
963
|
-
"
|
|
964
|
-
`/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/
|
|
1064
|
+
"put",
|
|
1065
|
+
`/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/abandoned/carts/${cartId}`,
|
|
965
1066
|
query_params,
|
|
966
1067
|
body
|
|
967
1068
|
);
|
|
968
1069
|
|
|
969
1070
|
const {
|
|
970
1071
|
error: res_error,
|
|
971
|
-
} = CartModel.
|
|
1072
|
+
} = CartModel.UpdateCartDetailResponse().validate(response, {
|
|
972
1073
|
abortEarly: false,
|
|
973
1074
|
allowUnknown: false,
|
|
974
1075
|
});
|
|
@@ -976,7 +1077,7 @@ class Cart {
|
|
|
976
1077
|
if (res_error) {
|
|
977
1078
|
Logger({
|
|
978
1079
|
level: "WARN",
|
|
979
|
-
message: "Response Validation Warnnings for
|
|
1080
|
+
message: "Response Validation Warnnings for updateCart",
|
|
980
1081
|
});
|
|
981
1082
|
Logger({ level: "WARN", message: res_error });
|
|
982
1083
|
}
|
|
@@ -986,35 +1087,17 @@ class Cart {
|
|
|
986
1087
|
|
|
987
1088
|
/**
|
|
988
1089
|
* @param {Object} arg - Arg object.
|
|
989
|
-
* @param {
|
|
990
|
-
* @param {
|
|
991
|
-
* @
|
|
992
|
-
* @
|
|
993
|
-
* @
|
|
994
|
-
* @param {string} [arg.lastId] -
|
|
995
|
-
* @param {string} [arg.sortOn] -
|
|
996
|
-
* @returns {Promise<AbandonedCartResponse>} - Success response
|
|
997
|
-
* @summary: Get with abandoned cart list
|
|
998
|
-
* @description: Get abandoned cart list with pagination
|
|
1090
|
+
* @param {string} arg.id -
|
|
1091
|
+
* @param {CouponUpdate} arg.body
|
|
1092
|
+
* @returns {Promise<SuccessMessage>} - Success response
|
|
1093
|
+
* @summary: Update existing coupon configuration
|
|
1094
|
+
* @description: Update coupon with id sent in `id`
|
|
999
1095
|
*/
|
|
1000
|
-
async
|
|
1001
|
-
|
|
1002
|
-
pageSize,
|
|
1003
|
-
fromDate,
|
|
1004
|
-
toDate,
|
|
1005
|
-
anonymousCart,
|
|
1006
|
-
lastId,
|
|
1007
|
-
sortOn,
|
|
1008
|
-
} = {}) {
|
|
1009
|
-
const { error } = CartValidator.getAbandonedCart().validate(
|
|
1096
|
+
async updateCoupon({ id, body } = {}) {
|
|
1097
|
+
const { error } = CartValidator.updateCoupon().validate(
|
|
1010
1098
|
{
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
fromDate,
|
|
1014
|
-
toDate,
|
|
1015
|
-
anonymousCart,
|
|
1016
|
-
lastId,
|
|
1017
|
-
sortOn,
|
|
1099
|
+
id,
|
|
1100
|
+
body,
|
|
1018
1101
|
},
|
|
1019
1102
|
{ abortEarly: false, allowUnknown: true }
|
|
1020
1103
|
);
|
|
@@ -1023,46 +1106,32 @@ class Cart {
|
|
|
1023
1106
|
}
|
|
1024
1107
|
|
|
1025
1108
|
// Showing warrnings if extra unknown parameters are found
|
|
1026
|
-
const { error: warrning } = CartValidator.
|
|
1109
|
+
const { error: warrning } = CartValidator.updateCoupon().validate(
|
|
1027
1110
|
{
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
fromDate,
|
|
1031
|
-
toDate,
|
|
1032
|
-
anonymousCart,
|
|
1033
|
-
lastId,
|
|
1034
|
-
sortOn,
|
|
1111
|
+
id,
|
|
1112
|
+
body,
|
|
1035
1113
|
},
|
|
1036
1114
|
{ abortEarly: false, allowUnknown: false }
|
|
1037
1115
|
);
|
|
1038
1116
|
if (warrning) {
|
|
1039
1117
|
Logger({
|
|
1040
1118
|
level: "WARN",
|
|
1041
|
-
message: "Parameter Validation warrnings for
|
|
1119
|
+
message: "Parameter Validation warrnings for updateCoupon",
|
|
1042
1120
|
});
|
|
1043
1121
|
Logger({ level: "WARN", message: warrning });
|
|
1044
1122
|
}
|
|
1045
1123
|
|
|
1046
1124
|
const query_params = {};
|
|
1047
|
-
query_params["page_no"] = pageNo;
|
|
1048
|
-
query_params["page_size"] = pageSize;
|
|
1049
|
-
query_params["from_date"] = fromDate;
|
|
1050
|
-
query_params["to_date"] = toDate;
|
|
1051
|
-
query_params["anonymous_cart"] = anonymousCart;
|
|
1052
|
-
query_params["last_id"] = lastId;
|
|
1053
|
-
query_params["sort_on"] = sortOn;
|
|
1054
1125
|
|
|
1055
1126
|
const response = await PlatformAPIClient.execute(
|
|
1056
1127
|
this.config,
|
|
1057
|
-
"
|
|
1058
|
-
`/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/
|
|
1128
|
+
"put",
|
|
1129
|
+
`/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/coupon/${id}`,
|
|
1059
1130
|
query_params,
|
|
1060
|
-
|
|
1131
|
+
body
|
|
1061
1132
|
);
|
|
1062
1133
|
|
|
1063
|
-
const {
|
|
1064
|
-
error: res_error,
|
|
1065
|
-
} = CartModel.AbandonedCartResponse().validate(response, {
|
|
1134
|
+
const { error: res_error } = CartModel.SuccessMessage().validate(response, {
|
|
1066
1135
|
abortEarly: false,
|
|
1067
1136
|
allowUnknown: false,
|
|
1068
1137
|
});
|
|
@@ -1070,7 +1139,7 @@ class Cart {
|
|
|
1070
1139
|
if (res_error) {
|
|
1071
1140
|
Logger({
|
|
1072
1141
|
level: "WARN",
|
|
1073
|
-
message: "Response Validation Warnnings for
|
|
1142
|
+
message: "Response Validation Warnnings for updateCoupon",
|
|
1074
1143
|
});
|
|
1075
1144
|
Logger({ level: "WARN", message: res_error });
|
|
1076
1145
|
}
|
|
@@ -1080,68 +1149,17 @@ class Cart {
|
|
|
1080
1149
|
|
|
1081
1150
|
/**
|
|
1082
1151
|
* @param {Object} arg - Arg object.
|
|
1083
|
-
* @param {string} arg.
|
|
1084
|
-
* @param {
|
|
1085
|
-
* @
|
|
1086
|
-
* @
|
|
1087
|
-
* @
|
|
1088
|
-
* @param {boolean} [arg.anonymousCart] -
|
|
1089
|
-
* @param {string} [arg.lastId] -
|
|
1090
|
-
* @param {string} [arg.sortOn] -
|
|
1091
|
-
* @summary: Get with abandoned cart list
|
|
1092
|
-
* @description: Get abandoned cart list with pagination
|
|
1093
|
-
*/
|
|
1094
|
-
getAbandonedCartPaginator({
|
|
1095
|
-
companyId,
|
|
1096
|
-
applicationId,
|
|
1097
|
-
pageSize,
|
|
1098
|
-
fromDate,
|
|
1099
|
-
toDate,
|
|
1100
|
-
anonymousCart,
|
|
1101
|
-
lastId,
|
|
1102
|
-
sortOn,
|
|
1103
|
-
} = {}) {
|
|
1104
|
-
const paginator = new Paginator();
|
|
1105
|
-
const callback = async () => {
|
|
1106
|
-
const pageId = paginator.nextId;
|
|
1107
|
-
const pageNo = paginator.pageNo;
|
|
1108
|
-
const pageType = "number";
|
|
1109
|
-
const data = await this.getAbandonedCart({
|
|
1110
|
-
companyId: companyId,
|
|
1111
|
-
applicationId: applicationId,
|
|
1112
|
-
pageNo: pageNo,
|
|
1113
|
-
pageSize: pageSize,
|
|
1114
|
-
fromDate: fromDate,
|
|
1115
|
-
toDate: toDate,
|
|
1116
|
-
anonymousCart: anonymousCart,
|
|
1117
|
-
lastId: lastId,
|
|
1118
|
-
sortOn: sortOn,
|
|
1119
|
-
});
|
|
1120
|
-
paginator.setPaginator({
|
|
1121
|
-
hasNext: data.page.has_next ? true : false,
|
|
1122
|
-
nextId: data.page.next_id,
|
|
1123
|
-
});
|
|
1124
|
-
return data;
|
|
1125
|
-
};
|
|
1126
|
-
paginator.setCallback(callback.bind(this));
|
|
1127
|
-
return paginator;
|
|
1128
|
-
}
|
|
1129
|
-
|
|
1130
|
-
/**
|
|
1131
|
-
* @param {Object} arg - Arg object.
|
|
1132
|
-
* @param {string} [arg.id] -
|
|
1133
|
-
* @param {boolean} [arg.i] -
|
|
1134
|
-
* @param {boolean} [arg.b] -
|
|
1135
|
-
* @returns {Promise<CartDetailResponse>} - Success response
|
|
1136
|
-
* @summary: Fetch all items added to the cart
|
|
1137
|
-
* @description: Use this API to get details of all the items added to a cart.
|
|
1152
|
+
* @param {string} arg.id -
|
|
1153
|
+
* @param {CouponPartialUpdate} arg.body
|
|
1154
|
+
* @returns {Promise<SuccessMessage>} - Success response
|
|
1155
|
+
* @summary: Update coupon archive state and schedule
|
|
1156
|
+
* @description: Update archive/unarchive and change schedule for coupon
|
|
1138
1157
|
*/
|
|
1139
|
-
async
|
|
1140
|
-
const { error } = CartValidator.
|
|
1158
|
+
async updateCouponPartially({ id, body } = {}) {
|
|
1159
|
+
const { error } = CartValidator.updateCouponPartially().validate(
|
|
1141
1160
|
{
|
|
1142
1161
|
id,
|
|
1143
|
-
|
|
1144
|
-
b,
|
|
1162
|
+
body,
|
|
1145
1163
|
},
|
|
1146
1164
|
{ abortEarly: false, allowUnknown: true }
|
|
1147
1165
|
);
|
|
@@ -1150,40 +1168,32 @@ class Cart {
|
|
|
1150
1168
|
}
|
|
1151
1169
|
|
|
1152
1170
|
// Showing warrnings if extra unknown parameters are found
|
|
1153
|
-
const {
|
|
1154
|
-
error: warrning,
|
|
1155
|
-
} = CartValidator.getAbandonedCartDetails().validate(
|
|
1171
|
+
const { error: warrning } = CartValidator.updateCouponPartially().validate(
|
|
1156
1172
|
{
|
|
1157
1173
|
id,
|
|
1158
|
-
|
|
1159
|
-
b,
|
|
1174
|
+
body,
|
|
1160
1175
|
},
|
|
1161
1176
|
{ abortEarly: false, allowUnknown: false }
|
|
1162
1177
|
);
|
|
1163
1178
|
if (warrning) {
|
|
1164
1179
|
Logger({
|
|
1165
1180
|
level: "WARN",
|
|
1166
|
-
message: "Parameter Validation warrnings for
|
|
1181
|
+
message: "Parameter Validation warrnings for updateCouponPartially",
|
|
1167
1182
|
});
|
|
1168
1183
|
Logger({ level: "WARN", message: warrning });
|
|
1169
1184
|
}
|
|
1170
1185
|
|
|
1171
1186
|
const query_params = {};
|
|
1172
|
-
query_params["id"] = id;
|
|
1173
|
-
query_params["i"] = i;
|
|
1174
|
-
query_params["b"] = b;
|
|
1175
1187
|
|
|
1176
1188
|
const response = await PlatformAPIClient.execute(
|
|
1177
1189
|
this.config,
|
|
1178
|
-
"
|
|
1179
|
-
`/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/
|
|
1190
|
+
"patch",
|
|
1191
|
+
`/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/coupon/${id}`,
|
|
1180
1192
|
query_params,
|
|
1181
|
-
|
|
1193
|
+
body
|
|
1182
1194
|
);
|
|
1183
1195
|
|
|
1184
|
-
const {
|
|
1185
|
-
error: res_error,
|
|
1186
|
-
} = CartModel.CartDetailResponse().validate(response, {
|
|
1196
|
+
const { error: res_error } = CartModel.SuccessMessage().validate(response, {
|
|
1187
1197
|
abortEarly: false,
|
|
1188
1198
|
allowUnknown: false,
|
|
1189
1199
|
});
|
|
@@ -1191,7 +1201,7 @@ class Cart {
|
|
|
1191
1201
|
if (res_error) {
|
|
1192
1202
|
Logger({
|
|
1193
1203
|
level: "WARN",
|
|
1194
|
-
message: "Response Validation Warnnings for
|
|
1204
|
+
message: "Response Validation Warnnings for updateCouponPartially",
|
|
1195
1205
|
});
|
|
1196
1206
|
Logger({ level: "WARN", message: res_error });
|
|
1197
1207
|
}
|
|
@@ -1201,19 +1211,17 @@ class Cart {
|
|
|
1201
1211
|
|
|
1202
1212
|
/**
|
|
1203
1213
|
* @param {Object} arg - Arg object.
|
|
1204
|
-
* @param {string} arg.
|
|
1205
|
-
* @param {
|
|
1206
|
-
* @
|
|
1207
|
-
* @
|
|
1208
|
-
* @
|
|
1209
|
-
* @description: Use this API to add items to the abandoned cart.
|
|
1214
|
+
* @param {string} arg.id -
|
|
1215
|
+
* @param {PromotionUpdate} arg.body
|
|
1216
|
+
* @returns {Promise<PromotionUpdate>} - Success response
|
|
1217
|
+
* @summary: Update existing promotion configuration
|
|
1218
|
+
* @description: Update promotion with id sent in `id`
|
|
1210
1219
|
*/
|
|
1211
|
-
async
|
|
1212
|
-
const { error } = CartValidator.
|
|
1220
|
+
async updatePromotion({ id, body } = {}) {
|
|
1221
|
+
const { error } = CartValidator.updatePromotion().validate(
|
|
1213
1222
|
{
|
|
1214
|
-
|
|
1223
|
+
id,
|
|
1215
1224
|
body,
|
|
1216
|
-
b,
|
|
1217
1225
|
},
|
|
1218
1226
|
{ abortEarly: false, allowUnknown: true }
|
|
1219
1227
|
);
|
|
@@ -1222,44 +1230,40 @@ class Cart {
|
|
|
1222
1230
|
}
|
|
1223
1231
|
|
|
1224
1232
|
// Showing warrnings if extra unknown parameters are found
|
|
1225
|
-
const { error: warrning } = CartValidator.
|
|
1233
|
+
const { error: warrning } = CartValidator.updatePromotion().validate(
|
|
1226
1234
|
{
|
|
1227
|
-
|
|
1235
|
+
id,
|
|
1228
1236
|
body,
|
|
1229
|
-
b,
|
|
1230
1237
|
},
|
|
1231
1238
|
{ abortEarly: false, allowUnknown: false }
|
|
1232
1239
|
);
|
|
1233
1240
|
if (warrning) {
|
|
1234
1241
|
Logger({
|
|
1235
1242
|
level: "WARN",
|
|
1236
|
-
message: "Parameter Validation warrnings for
|
|
1243
|
+
message: "Parameter Validation warrnings for updatePromotion",
|
|
1237
1244
|
});
|
|
1238
1245
|
Logger({ level: "WARN", message: warrning });
|
|
1239
1246
|
}
|
|
1240
1247
|
|
|
1241
1248
|
const query_params = {};
|
|
1242
|
-
query_params["b"] = b;
|
|
1243
1249
|
|
|
1244
1250
|
const response = await PlatformAPIClient.execute(
|
|
1245
1251
|
this.config,
|
|
1246
|
-
"
|
|
1247
|
-
`/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/
|
|
1252
|
+
"put",
|
|
1253
|
+
`/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/promotion/${id}`,
|
|
1248
1254
|
query_params,
|
|
1249
1255
|
body
|
|
1250
1256
|
);
|
|
1251
1257
|
|
|
1252
|
-
const {
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
allowUnknown: false,
|
|
1257
|
-
});
|
|
1258
|
+
const { error: res_error } = CartModel.PromotionUpdate().validate(
|
|
1259
|
+
response,
|
|
1260
|
+
{ abortEarly: false, allowUnknown: false }
|
|
1261
|
+
);
|
|
1258
1262
|
|
|
1259
1263
|
if (res_error) {
|
|
1260
1264
|
Logger({
|
|
1261
1265
|
level: "WARN",
|
|
1262
|
-
message: "Response Validation Warnnings for
|
|
1266
|
+
message: "Response Validation Warnnings for updatePromotion",
|
|
1263
1267
|
});
|
|
1264
1268
|
Logger({ level: "WARN", message: res_error });
|
|
1265
1269
|
}
|
|
@@ -1269,19 +1273,17 @@ class Cart {
|
|
|
1269
1273
|
|
|
1270
1274
|
/**
|
|
1271
1275
|
* @param {Object} arg - Arg object.
|
|
1272
|
-
* @param {string} arg.
|
|
1273
|
-
* @param {
|
|
1274
|
-
* @
|
|
1275
|
-
* @
|
|
1276
|
-
* @
|
|
1277
|
-
* @description: <p>Use this API to update items added to the cart with the help of a request object containing attributes like item_quantity and item_size. These attributes will be fetched from the following APIs</p> <ul> <li><font color="monochrome">operation</font> Operation for current api call. <b>update_item</b> for update items. <b>remove_item</b> for removing items.</li> <li> <font color="monochrome">item_id</font> "/platform/content/v1/products/"</li> <li> <font color="monochrome">item_size</font> "/platform/content/v1/products/:slug/sizes/"</li> <li> <font color="monochrome">quantity</font> item quantity (must be greater than or equal to 1)</li> <li> <font color="monochrome">article_id</font> "/content/v1/products/:identifier/sizes/price/"</li> <li> <font color="monochrome">item_index</font> item position in the cart (must be greater than or equal to 0)</li> </ul>
|
|
1276
|
+
* @param {string} arg.id -
|
|
1277
|
+
* @param {PromotionPartialUpdate} arg.body
|
|
1278
|
+
* @returns {Promise<SuccessMessage>} - Success response
|
|
1279
|
+
* @summary: Update promotion publish state and schedule
|
|
1280
|
+
* @description: Update publish/unpublish and change schedule for promotion
|
|
1278
1281
|
*/
|
|
1279
|
-
async
|
|
1280
|
-
const { error } = CartValidator.
|
|
1282
|
+
async updatePromotionPartially({ id, body } = {}) {
|
|
1283
|
+
const { error } = CartValidator.updatePromotionPartially().validate(
|
|
1281
1284
|
{
|
|
1282
|
-
|
|
1285
|
+
id,
|
|
1283
1286
|
body,
|
|
1284
|
-
b,
|
|
1285
1287
|
},
|
|
1286
1288
|
{ abortEarly: false, allowUnknown: true }
|
|
1287
1289
|
);
|
|
@@ -1290,36 +1292,34 @@ class Cart {
|
|
|
1290
1292
|
}
|
|
1291
1293
|
|
|
1292
1294
|
// Showing warrnings if extra unknown parameters are found
|
|
1293
|
-
const {
|
|
1295
|
+
const {
|
|
1296
|
+
error: warrning,
|
|
1297
|
+
} = CartValidator.updatePromotionPartially().validate(
|
|
1294
1298
|
{
|
|
1295
|
-
|
|
1299
|
+
id,
|
|
1296
1300
|
body,
|
|
1297
|
-
b,
|
|
1298
1301
|
},
|
|
1299
1302
|
{ abortEarly: false, allowUnknown: false }
|
|
1300
1303
|
);
|
|
1301
1304
|
if (warrning) {
|
|
1302
1305
|
Logger({
|
|
1303
1306
|
level: "WARN",
|
|
1304
|
-
message: "Parameter Validation warrnings for
|
|
1307
|
+
message: "Parameter Validation warrnings for updatePromotionPartially",
|
|
1305
1308
|
});
|
|
1306
1309
|
Logger({ level: "WARN", message: warrning });
|
|
1307
1310
|
}
|
|
1308
1311
|
|
|
1309
1312
|
const query_params = {};
|
|
1310
|
-
query_params["b"] = b;
|
|
1311
1313
|
|
|
1312
1314
|
const response = await PlatformAPIClient.execute(
|
|
1313
1315
|
this.config,
|
|
1314
|
-
"
|
|
1315
|
-
`/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/
|
|
1316
|
+
"patch",
|
|
1317
|
+
`/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/promotion/${id}`,
|
|
1316
1318
|
query_params,
|
|
1317
1319
|
body
|
|
1318
1320
|
);
|
|
1319
1321
|
|
|
1320
|
-
const {
|
|
1321
|
-
error: res_error,
|
|
1322
|
-
} = CartModel.UpdateCartDetailResponse().validate(response, {
|
|
1322
|
+
const { error: res_error } = CartModel.SuccessMessage().validate(response, {
|
|
1323
1323
|
abortEarly: false,
|
|
1324
1324
|
allowUnknown: false,
|
|
1325
1325
|
});
|
|
@@ -1327,7 +1327,7 @@ class Cart {
|
|
|
1327
1327
|
if (res_error) {
|
|
1328
1328
|
Logger({
|
|
1329
1329
|
level: "WARN",
|
|
1330
|
-
message: "Response Validation Warnnings for
|
|
1330
|
+
message: "Response Validation Warnnings for updatePromotionPartially",
|
|
1331
1331
|
});
|
|
1332
1332
|
Logger({ level: "WARN", message: res_error });
|
|
1333
1333
|
}
|