@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.
Files changed (310) hide show
  1. package/documentation/application/CART.md +5934 -4502
  2. package/documentation/application/CATALOG.md +6338 -7245
  3. package/documentation/application/COMMON.md +95 -222
  4. package/documentation/application/COMMUNICATION.md +106 -186
  5. package/documentation/application/CONFIGURATION.md +903 -1597
  6. package/documentation/application/CONTENT.md +557 -1279
  7. package/documentation/application/FILESTORAGE.md +84 -220
  8. package/documentation/application/LEAD.md +314 -660
  9. package/documentation/application/LOGISTIC.md +229 -305
  10. package/documentation/application/ORDER.md +642 -1137
  11. package/documentation/application/PAYMENT.md +2285 -3031
  12. package/documentation/application/POSCART.md +6079 -4642
  13. package/documentation/application/REWARDS.md +94 -248
  14. package/documentation/application/SHARE.md +152 -250
  15. package/documentation/application/THEME.md +952 -1235
  16. package/documentation/application/USER.md +1228 -1765
  17. package/documentation/platform/ANALYTICS.md +207 -349
  18. package/documentation/platform/AUDITTRAIL.md +121 -204
  19. package/documentation/platform/BILLING.md +865 -1376
  20. package/documentation/platform/CART.md +2814 -3662
  21. package/documentation/platform/CATALOG.md +14453 -17192
  22. package/documentation/platform/COMMON.md +95 -222
  23. package/documentation/platform/COMMUNICATION.md +1632 -2380
  24. package/documentation/platform/COMPANYPROFILE.md +572 -957
  25. package/documentation/platform/CONFIGURATION.md +3050 -4073
  26. package/documentation/platform/CONTENT.md +3438 -4172
  27. package/documentation/platform/DISCOUNT.md +140 -236
  28. package/documentation/platform/FILESTORAGE.md +187 -323
  29. package/documentation/platform/INVENTORY.md +268 -911
  30. package/documentation/platform/LEAD.md +2195 -2541
  31. package/documentation/platform/ORDER.md +3400 -5361
  32. package/documentation/platform/PARTNER.md +9 -36
  33. package/documentation/platform/PAYMENT.md +903 -1213
  34. package/documentation/platform/REWARDS.md +183 -347
  35. package/documentation/platform/SHARE.md +120 -213
  36. package/documentation/platform/THEME.md +12956 -13239
  37. package/documentation/platform/USER.md +975 -1120
  38. package/documentation/platform/WEBHOOK.md +78 -184
  39. package/documentation/public/CONFIGURATION.md +95 -222
  40. package/documentation/public/INVENTORY.md +100 -282
  41. package/documentation/public/WEBHOOK.md +27 -133
  42. package/package.json +1 -1
  43. package/sdk/application/Cart/CartApplicationClient.d.ts +243 -243
  44. package/sdk/application/Cart/CartApplicationClient.js +567 -567
  45. package/sdk/application/Cart/CartApplicationModel.d.ts +64 -63
  46. package/sdk/application/Cart/CartApplicationModel.js +489 -886
  47. package/sdk/application/Cart/CartApplicationValidator.d.ts +17 -17
  48. package/sdk/application/Cart/CartApplicationValidator.js +98 -98
  49. package/sdk/application/Catalog/CatalogApplicationClient.d.ts +358 -358
  50. package/sdk/application/Catalog/CatalogApplicationClient.js +1036 -1036
  51. package/sdk/application/Catalog/CatalogApplicationModel.d.ts +90 -90
  52. package/sdk/application/Catalog/CatalogApplicationModel.js +677 -1243
  53. package/sdk/application/Catalog/CatalogApplicationValidator.d.ts +19 -19
  54. package/sdk/application/Catalog/CatalogApplicationValidator.js +110 -110
  55. package/sdk/application/Common/CommonApplicationClient.d.ts +13 -13
  56. package/sdk/application/Common/CommonApplicationClient.js +38 -38
  57. package/sdk/application/Common/CommonApplicationModel.d.ts +12 -12
  58. package/sdk/application/Common/CommonApplicationModel.js +83 -160
  59. package/sdk/application/Common/CommonApplicationValidator.d.ts +1 -1
  60. package/sdk/application/Common/CommonApplicationValidator.js +6 -6
  61. package/sdk/application/Communication/CommunicationApplicationClient.d.ts +11 -11
  62. package/sdk/application/Communication/CommunicationApplicationClient.js +26 -26
  63. package/sdk/application/Communication/CommunicationApplicationModel.d.ts +6 -6
  64. package/sdk/application/Communication/CommunicationApplicationModel.js +38 -83
  65. package/sdk/application/Communication/CommunicationApplicationValidator.d.ts +1 -1
  66. package/sdk/application/Communication/CommunicationApplicationValidator.js +4 -4
  67. package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +116 -116
  68. package/sdk/application/Configuration/ConfigurationApplicationClient.js +330 -330
  69. package/sdk/application/Configuration/ConfigurationApplicationModel.d.ts +85 -85
  70. package/sdk/application/Configuration/ConfigurationApplicationModel.js +480 -851
  71. package/sdk/application/Configuration/ConfigurationApplicationValidator.d.ts +8 -8
  72. package/sdk/application/Configuration/ConfigurationApplicationValidator.js +33 -33
  73. package/sdk/application/Content/ContentApplicationClient.d.ts +67 -67
  74. package/sdk/application/Content/ContentApplicationClient.js +191 -191
  75. package/sdk/application/Content/ContentApplicationModel.d.ts +76 -76
  76. package/sdk/application/Content/ContentApplicationModel.js +467 -884
  77. package/sdk/application/Content/ContentApplicationValidator.d.ts +5 -5
  78. package/sdk/application/Content/ContentApplicationValidator.js +24 -24
  79. package/sdk/application/FileStorage/FileStorageApplicationClient.d.ts +25 -25
  80. package/sdk/application/FileStorage/FileStorageApplicationClient.js +59 -59
  81. package/sdk/application/FileStorage/FileStorageApplicationModel.d.ts +13 -13
  82. package/sdk/application/FileStorage/FileStorageApplicationModel.js +86 -169
  83. package/sdk/application/FileStorage/FileStorageApplicationValidator.d.ts +1 -1
  84. package/sdk/application/FileStorage/FileStorageApplicationValidator.js +7 -7
  85. package/sdk/application/Lead/LeadApplicationClient.d.ts +24 -24
  86. package/sdk/application/Lead/LeadApplicationClient.js +100 -100
  87. package/sdk/application/Lead/LeadApplicationModel.d.ts +35 -35
  88. package/sdk/application/Lead/LeadApplicationModel.js +267 -474
  89. package/sdk/application/Lead/LeadApplicationValidator.d.ts +2 -2
  90. package/sdk/application/Lead/LeadApplicationValidator.js +11 -11
  91. package/sdk/application/Logistic/LogisticApplicationClient.d.ts +30 -19
  92. package/sdk/application/Logistic/LogisticApplicationClient.js +110 -43
  93. package/sdk/application/Logistic/LogisticApplicationModel.d.ts +17 -14
  94. package/sdk/application/Logistic/LogisticApplicationModel.js +133 -201
  95. package/sdk/application/Logistic/LogisticApplicationValidator.d.ts +3 -2
  96. package/sdk/application/Logistic/LogisticApplicationValidator.js +14 -8
  97. package/sdk/application/Order/OrderApplicationClient.d.ts +85 -85
  98. package/sdk/application/Order/OrderApplicationClient.js +232 -232
  99. package/sdk/application/Order/OrderApplicationModel.d.ts +50 -50
  100. package/sdk/application/Order/OrderApplicationModel.js +352 -656
  101. package/sdk/application/Order/OrderApplicationValidator.d.ts +7 -7
  102. package/sdk/application/Order/OrderApplicationValidator.js +28 -28
  103. package/sdk/application/Payment/PaymentApplicationClient.d.ts +318 -318
  104. package/sdk/application/Payment/PaymentApplicationClient.js +739 -739
  105. package/sdk/application/Payment/PaymentApplicationModel.d.ts +72 -72
  106. package/sdk/application/Payment/PaymentApplicationModel.js +570 -1038
  107. package/sdk/application/Payment/PaymentApplicationValidator.d.ts +28 -28
  108. package/sdk/application/Payment/PaymentApplicationValidator.js +107 -107
  109. package/sdk/application/PosCart/PosCartApplicationClient.d.ts +254 -254
  110. package/sdk/application/PosCart/PosCartApplicationClient.js +617 -617
  111. package/sdk/application/PosCart/PosCartApplicationModel.d.ts +64 -63
  112. package/sdk/application/PosCart/PosCartApplicationModel.js +475 -871
  113. package/sdk/application/PosCart/PosCartApplicationValidator.d.ts +18 -18
  114. package/sdk/application/PosCart/PosCartApplicationValidator.js +103 -103
  115. package/sdk/application/Rewards/RewardsApplicationClient.d.ts +27 -27
  116. package/sdk/application/Rewards/RewardsApplicationClient.js +112 -112
  117. package/sdk/application/Rewards/RewardsApplicationModel.d.ts +14 -14
  118. package/sdk/application/Rewards/RewardsApplicationModel.js +96 -191
  119. package/sdk/application/Rewards/RewardsApplicationValidator.d.ts +3 -3
  120. package/sdk/application/Rewards/RewardsApplicationValidator.js +12 -12
  121. package/sdk/application/Share/ShareApplicationClient.d.ts +37 -37
  122. package/sdk/application/Share/ShareApplicationClient.js +84 -84
  123. package/sdk/application/Share/ShareApplicationModel.d.ts +8 -8
  124. package/sdk/application/Share/ShareApplicationModel.js +63 -123
  125. package/sdk/application/Share/ShareApplicationValidator.d.ts +4 -4
  126. package/sdk/application/Share/ShareApplicationValidator.js +12 -12
  127. package/sdk/application/Theme/ThemeApplicationClient.d.ts +8 -8
  128. package/sdk/application/Theme/ThemeApplicationClient.js +31 -31
  129. package/sdk/application/Theme/ThemeApplicationModel.d.ts +34 -34
  130. package/sdk/application/Theme/ThemeApplicationModel.js +190 -336
  131. package/sdk/application/Theme/ThemeApplicationValidator.d.ts +1 -1
  132. package/sdk/application/Theme/ThemeApplicationValidator.js +4 -4
  133. package/sdk/application/User/UserApplicationClient.d.ts +280 -280
  134. package/sdk/application/User/UserApplicationClient.js +581 -581
  135. package/sdk/application/User/UserApplicationModel.d.ts +79 -72
  136. package/sdk/application/User/UserApplicationModel.js +440 -689
  137. package/sdk/application/User/UserApplicationValidator.d.ts +24 -24
  138. package/sdk/application/User/UserApplicationValidator.js +89 -89
  139. package/sdk/common/AxiosHelper.js +1 -1
  140. package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.d.ts +51 -51
  141. package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.js +179 -179
  142. package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.d.ts +6 -6
  143. package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.js +20 -20
  144. package/sdk/platform/Analytics/AnalyticsPlatformModel.d.ts +11 -11
  145. package/sdk/platform/Analytics/AnalyticsPlatformModel.js +95 -178
  146. package/sdk/platform/AuditTrail/AuditTrailPlatformClient.d.ts +10 -10
  147. package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +41 -41
  148. package/sdk/platform/AuditTrail/AuditTrailPlatformModel.d.ts +10 -10
  149. package/sdk/platform/AuditTrail/AuditTrailPlatformModel.js +50 -89
  150. package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.d.ts +1 -1
  151. package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.js +6 -6
  152. package/sdk/platform/Billing/BillingPlatformClient.d.ts +60 -60
  153. package/sdk/platform/Billing/BillingPlatformClient.js +181 -181
  154. package/sdk/platform/Billing/BillingPlatformModel.d.ts +40 -40
  155. package/sdk/platform/Billing/BillingPlatformModel.js +342 -668
  156. package/sdk/platform/Billing/BillingPlatformValidator.d.ts +8 -8
  157. package/sdk/platform/Billing/BillingPlatformValidator.js +25 -25
  158. package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +168 -168
  159. package/sdk/platform/Cart/CartPlatformApplicationClient.js +553 -553
  160. package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +11 -11
  161. package/sdk/platform/Cart/CartPlatformApplicationValidator.js +63 -63
  162. package/sdk/platform/Cart/CartPlatformModel.d.ts +84 -83
  163. package/sdk/platform/Cart/CartPlatformModel.js +671 -1205
  164. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +632 -632
  165. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +1525 -1525
  166. package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +40 -40
  167. package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +174 -174
  168. package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +682 -682
  169. package/sdk/platform/Catalog/CatalogPlatformClient.js +1557 -1557
  170. package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +291 -291
  171. package/sdk/platform/Catalog/CatalogPlatformModel.js +2127 -3904
  172. package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +66 -66
  173. package/sdk/platform/Catalog/CatalogPlatformValidator.js +229 -229
  174. package/sdk/platform/Common/CommonPlatformClient.d.ts +12 -12
  175. package/sdk/platform/Common/CommonPlatformClient.js +41 -41
  176. package/sdk/platform/Common/CommonPlatformModel.d.ts +12 -12
  177. package/sdk/platform/Common/CommonPlatformModel.js +83 -160
  178. package/sdk/platform/Common/CommonPlatformValidator.d.ts +1 -1
  179. package/sdk/platform/Common/CommonPlatformValidator.js +6 -6
  180. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +326 -326
  181. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +943 -943
  182. package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.d.ts +30 -30
  183. package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.js +87 -87
  184. package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +67 -67
  185. package/sdk/platform/Communication/CommunicationPlatformModel.js +522 -974
  186. package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +55 -55
  187. package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +212 -212
  188. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +27 -27
  189. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +279 -542
  190. package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.d.ts +7 -7
  191. package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.js +24 -24
  192. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +163 -153
  193. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +615 -552
  194. package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.d.ts +22 -21
  195. package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.js +69 -63
  196. package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +125 -125
  197. package/sdk/platform/Configuration/ConfigurationPlatformClient.js +342 -342
  198. package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +148 -146
  199. package/sdk/platform/Configuration/ConfigurationPlatformModel.js +854 -1508
  200. package/sdk/platform/Configuration/ConfigurationPlatformValidator.d.ts +9 -9
  201. package/sdk/platform/Configuration/ConfigurationPlatformValidator.js +38 -38
  202. package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +534 -534
  203. package/sdk/platform/Content/ContentPlatformApplicationClient.js +1324 -1324
  204. package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +50 -50
  205. package/sdk/platform/Content/ContentPlatformApplicationValidator.js +156 -156
  206. package/sdk/platform/Content/ContentPlatformModel.d.ts +78 -78
  207. package/sdk/platform/Content/ContentPlatformModel.js +484 -907
  208. package/sdk/platform/Discount/DiscountPlatformClient.d.ts +65 -65
  209. package/sdk/platform/Discount/DiscountPlatformClient.js +216 -216
  210. package/sdk/platform/Discount/DiscountPlatformModel.d.ts +7 -7
  211. package/sdk/platform/Discount/DiscountPlatformModel.js +60 -121
  212. package/sdk/platform/Discount/DiscountPlatformValidator.d.ts +6 -6
  213. package/sdk/platform/Discount/DiscountPlatformValidator.js +29 -29
  214. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +24 -24
  215. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +58 -58
  216. package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.d.ts +1 -1
  217. package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.js +8 -8
  218. package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +52 -52
  219. package/sdk/platform/FileStorage/FileStoragePlatformClient.js +123 -123
  220. package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +13 -13
  221. package/sdk/platform/FileStorage/FileStoragePlatformModel.js +86 -169
  222. package/sdk/platform/FileStorage/FileStoragePlatformValidator.d.ts +3 -3
  223. package/sdk/platform/FileStorage/FileStoragePlatformValidator.js +11 -11
  224. package/sdk/platform/Inventory/InventoryPlatformClient.d.ts +63 -63
  225. package/sdk/platform/Inventory/InventoryPlatformClient.js +228 -228
  226. package/sdk/platform/Inventory/InventoryPlatformModel.d.ts +30 -30
  227. package/sdk/platform/Inventory/InventoryPlatformModel.js +497 -964
  228. package/sdk/platform/Inventory/InventoryPlatformValidator.d.ts +7 -7
  229. package/sdk/platform/Inventory/InventoryPlatformValidator.js +28 -28
  230. package/sdk/platform/Lead/LeadPlatformApplicationClient.d.ts +73 -73
  231. package/sdk/platform/Lead/LeadPlatformApplicationClient.js +200 -200
  232. package/sdk/platform/Lead/LeadPlatformApplicationValidator.d.ts +7 -7
  233. package/sdk/platform/Lead/LeadPlatformApplicationValidator.js +28 -28
  234. package/sdk/platform/Lead/LeadPlatformClient.d.ts +80 -80
  235. package/sdk/platform/Lead/LeadPlatformClient.js +212 -212
  236. package/sdk/platform/Lead/LeadPlatformModel.d.ts +35 -35
  237. package/sdk/platform/Lead/LeadPlatformModel.js +267 -474
  238. package/sdk/platform/Lead/LeadPlatformValidator.d.ts +6 -6
  239. package/sdk/platform/Lead/LeadPlatformValidator.js +24 -24
  240. package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +10 -10
  241. package/sdk/platform/Order/OrderPlatformApplicationClient.js +65 -65
  242. package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +1 -1
  243. package/sdk/platform/Order/OrderPlatformApplicationValidator.js +6 -6
  244. package/sdk/platform/Order/OrderPlatformClient.d.ts +357 -357
  245. package/sdk/platform/Order/OrderPlatformClient.js +1035 -1035
  246. package/sdk/platform/Order/OrderPlatformModel.d.ts +198 -196
  247. package/sdk/platform/Order/OrderPlatformModel.js +1574 -2861
  248. package/sdk/platform/Order/OrderPlatformValidator.d.ts +32 -32
  249. package/sdk/platform/Order/OrderPlatformValidator.js +160 -160
  250. package/sdk/platform/Partner/PartnerPlatformModel.d.ts +1 -1
  251. package/sdk/platform/Partner/PartnerPlatformModel.js +10 -26
  252. package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +57 -57
  253. package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +167 -167
  254. package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +6 -6
  255. package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +23 -23
  256. package/sdk/platform/Payment/PaymentPlatformClient.d.ts +42 -42
  257. package/sdk/platform/Payment/PaymentPlatformClient.js +153 -153
  258. package/sdk/platform/Payment/PaymentPlatformModel.d.ts +27 -27
  259. package/sdk/platform/Payment/PaymentPlatformModel.js +222 -410
  260. package/sdk/platform/Payment/PaymentPlatformValidator.d.ts +4 -4
  261. package/sdk/platform/Payment/PaymentPlatformValidator.js +21 -21
  262. package/sdk/platform/PlatformApplicationClient.d.ts +1496 -10325
  263. package/sdk/platform/PlatformApplicationClient.js +1584 -13899
  264. package/sdk/platform/PlatformClient.d.ts +7965 -7885
  265. package/sdk/platform/PlatformClient.js +8672 -10105
  266. package/sdk/platform/Rewards/RewardsPlatformApplicationClient.d.ts +83 -83
  267. package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +275 -275
  268. package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.d.ts +8 -8
  269. package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.js +34 -34
  270. package/sdk/platform/Rewards/RewardsPlatformModel.d.ts +15 -15
  271. package/sdk/platform/Rewards/RewardsPlatformModel.js +92 -194
  272. package/sdk/platform/Share/SharePlatformApplicationClient.d.ts +10 -10
  273. package/sdk/platform/Share/SharePlatformApplicationClient.js +59 -59
  274. package/sdk/platform/Share/SharePlatformApplicationValidator.d.ts +1 -1
  275. package/sdk/platform/Share/SharePlatformApplicationValidator.js +6 -6
  276. package/sdk/platform/Share/SharePlatformModel.d.ts +8 -8
  277. package/sdk/platform/Share/SharePlatformModel.js +60 -118
  278. package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +132 -132
  279. package/sdk/platform/Theme/ThemePlatformApplicationClient.js +310 -310
  280. package/sdk/platform/Theme/ThemePlatformApplicationValidator.d.ts +15 -15
  281. package/sdk/platform/Theme/ThemePlatformApplicationValidator.js +44 -44
  282. package/sdk/platform/Theme/ThemePlatformModel.d.ts +34 -34
  283. package/sdk/platform/Theme/ThemePlatformModel.js +190 -336
  284. package/sdk/platform/User/UserPlatformApplicationClient.d.ts +136 -69
  285. package/sdk/platform/User/UserPlatformApplicationClient.js +505 -166
  286. package/sdk/platform/User/UserPlatformApplicationValidator.d.ts +12 -7
  287. package/sdk/platform/User/UserPlatformApplicationValidator.js +61 -23
  288. package/sdk/platform/User/UserPlatformModel.d.ts +79 -72
  289. package/sdk/platform/User/UserPlatformModel.js +440 -689
  290. package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +31 -31
  291. package/sdk/platform/Webhook/WebhookPlatformClient.js +88 -88
  292. package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +7 -7
  293. package/sdk/platform/Webhook/WebhookPlatformModel.js +68 -136
  294. package/sdk/platform/Webhook/WebhookPlatformValidator.d.ts +3 -3
  295. package/sdk/platform/Webhook/WebhookPlatformValidator.js +14 -14
  296. package/sdk/public/Configuration/ConfigurationPublicClient.d.ts +13 -13
  297. package/sdk/public/Configuration/ConfigurationPublicClient.js +38 -38
  298. package/sdk/public/Configuration/ConfigurationPublicModel.d.ts +12 -12
  299. package/sdk/public/Configuration/ConfigurationPublicModel.js +85 -162
  300. package/sdk/public/Configuration/ConfigurationPublicValidator.d.ts +1 -1
  301. package/sdk/public/Configuration/ConfigurationPublicValidator.js +6 -6
  302. package/sdk/public/Inventory/InventoryPublicClient.d.ts +34 -34
  303. package/sdk/public/Inventory/InventoryPublicClient.js +113 -113
  304. package/sdk/public/Inventory/InventoryPublicModel.d.ts +10 -10
  305. package/sdk/public/Inventory/InventoryPublicModel.js +119 -245
  306. package/sdk/public/Inventory/InventoryPublicValidator.d.ts +3 -3
  307. package/sdk/public/Inventory/InventoryPublicValidator.js +15 -15
  308. package/sdk/public/Webhook/WebhookPublicModel.d.ts +7 -7
  309. package/sdk/public/Webhook/WebhookPublicModel.js +68 -136
  310. package/tests/application/catalog.spec.js +7 -0
@@ -10,34 +10,34 @@ class Cart {
10
10
  constructor(_conf) {
11
11
  this._conf = _conf;
12
12
  this._relativeUrls = {
13
- getCart: "/service/application/cart/v1.0/detail",
14
- getCartLastModified: "/service/application/cart/v1.0/detail",
13
+ addAddress: "/service/application/cart/v1.0/address",
15
14
  addItems: "/service/application/cart/v1.0/detail",
16
- updateCart: "/service/application/cart/v1.0/detail",
17
- getItemCount: "/service/application/cart/v1.0/basic",
18
- getCoupons: "/service/application/cart/v1.0/coupon",
19
15
  applyCoupon: "/service/application/cart/v1.0/coupon",
20
- removeCoupon: "/service/application/cart/v1.0/coupon",
21
- getBulkDiscountOffers: "/service/application/cart/v1.0/bulk-price",
22
16
  applyRewardPoints: "/service/application/cart/v1.0/redeem/points/",
23
- getAddresses: "/service/application/cart/v1.0/address",
24
- addAddress: "/service/application/cart/v1.0/address",
17
+ checkoutCart: "/service/application/cart/v1.0/checkout",
25
18
  getAddressById: "/service/application/cart/v1.0/address/{id}",
26
- updateAddress: "/service/application/cart/v1.0/address/{id}",
19
+ getAddresses: "/service/application/cart/v1.0/address",
20
+ getBulkDiscountOffers: "/service/application/cart/v1.0/bulk-price",
21
+ getCart: "/service/application/cart/v1.0/detail",
22
+ getCartLastModified: "/service/application/cart/v1.0/detail",
23
+ getCartShareLink: "/service/application/cart/v1.0/share-cart",
24
+ getCartSharedItems: "/service/application/cart/v1.0/share-cart/{token}",
25
+ getCoupons: "/service/application/cart/v1.0/coupon",
26
+ getItemCount: "/service/application/cart/v1.0/basic",
27
+ getLadderOffers: "/service/application/cart/v1.0/available-ladder-prices",
28
+ getPromotionOffers: "/service/application/cart/v1.0/available-promotions",
29
+ getShipments: "/service/application/cart/v1.0/shipment",
27
30
  removeAddress: "/service/application/cart/v1.0/address/{id}",
31
+ removeCoupon: "/service/application/cart/v1.0/coupon",
28
32
  selectAddress: "/service/application/cart/v1.0/select-address",
29
33
  selectPaymentMode: "/service/application/cart/v1.0/payment",
30
- validateCouponForPayment:
31
- "/service/application/cart/v1.0/payment/validate/",
32
- getShipments: "/service/application/cart/v1.0/shipment",
33
- checkoutCart: "/service/application/cart/v1.0/checkout",
34
+ updateAddress: "/service/application/cart/v1.0/address/{id}",
35
+ updateCart: "/service/application/cart/v1.0/detail",
34
36
  updateCartMeta: "/service/application/cart/v1.0/meta",
35
- getCartShareLink: "/service/application/cart/v1.0/share-cart",
36
- getCartSharedItems: "/service/application/cart/v1.0/share-cart/{token}",
37
37
  updateCartWithSharedItems:
38
38
  "/service/application/cart/v1.0/share-cart/{token}/{action}",
39
- getPromotionOffers: "/service/application/cart/v1.0/available-promotions",
40
- getLadderOffers: "/service/application/cart/v1.0/available-ladder-prices",
39
+ validateCouponForPayment:
40
+ "/service/application/cart/v1.0/payment/validate/",
41
41
  };
42
42
  this._urls = Object.entries(this._relativeUrls).reduce(
43
43
  (urls, [method, relativeUrl]) => {
@@ -57,19 +57,14 @@ class Cart {
57
57
 
58
58
  /**
59
59
  * @param {Object} arg - Arg object.
60
- * @param {string} [arg.id] -
61
- * @param {boolean} [arg.i] -
62
- * @param {boolean} [arg.b] -
63
- * @param {number} [arg.assignCardId] -
64
- * @param {string} [arg.areaCode] -
65
- * @param {boolean} [arg.buyNow] -
66
- * @returns {Promise<CartDetailResponse>} - Success response
67
- * @summary: Fetch all items added to the cart
68
- * @description: Use this API to get details of all the items added to a cart.
60
+ * @param {Address} arg.body
61
+ * @returns {Promise<SaveAddressResponse>} - Success response
62
+ * @summary: Add address to an account
63
+ * @description: Use this API to add an address to an account.
69
64
  */
70
- async getCart({ id, i, b, assignCardId, areaCode, buyNow } = {}) {
71
- const { error } = CartValidator.getCart().validate(
72
- { id, i, b, assignCardId, areaCode, buyNow },
65
+ async addAddress({ body } = {}) {
66
+ const { error } = CartValidator.addAddress().validate(
67
+ { body },
73
68
  { abortEarly: false, allowUnknown: true }
74
69
  );
75
70
  if (error) {
@@ -77,43 +72,37 @@ class Cart {
77
72
  }
78
73
 
79
74
  // Showing warrnings if extra unknown parameters are found
80
- const { error: warrning } = CartValidator.getCart().validate(
81
- { id, i, b, assignCardId, areaCode, buyNow },
75
+ const { error: warrning } = CartValidator.addAddress().validate(
76
+ { body },
82
77
  { abortEarly: false, allowUnknown: false }
83
78
  );
84
79
  if (warrning) {
85
80
  Logger({
86
81
  level: "WARN",
87
- message: "Parameter Validation warrnings for getCart",
82
+ message: "Parameter Validation warrnings for addAddress",
88
83
  });
89
84
  Logger({ level: "WARN", message: warrning });
90
85
  }
91
86
 
92
87
  const query_params = {};
93
- query_params["id"] = id;
94
- query_params["i"] = i;
95
- query_params["b"] = b;
96
- query_params["assign_card_id"] = assignCardId;
97
- query_params["area_code"] = areaCode;
98
- query_params["buy_now"] = buyNow;
99
88
 
100
89
  const xHeaders = {};
101
90
 
102
91
  const response = await APIClient.execute(
103
92
  this._conf,
104
- "get",
93
+ "post",
105
94
  constructUrl({
106
- url: this._urls["getCart"],
95
+ url: this._urls["addAddress"],
107
96
  params: {},
108
97
  }),
109
98
  query_params,
110
- undefined,
99
+ body,
111
100
  xHeaders
112
101
  );
113
102
 
114
103
  const {
115
104
  error: res_error,
116
- } = CartModel.CartDetailResponse().validate(response, {
105
+ } = CartModel.SaveAddressResponse().validate(response, {
117
106
  abortEarly: false,
118
107
  allowUnknown: false,
119
108
  });
@@ -121,68 +110,7 @@ class Cart {
121
110
  if (res_error) {
122
111
  Logger({
123
112
  level: "WARN",
124
- message: "Response Validation Warnnings for getCart",
125
- });
126
- Logger({ level: "WARN", message: res_error });
127
- }
128
-
129
- return response;
130
- }
131
-
132
- /**
133
- * @param {Object} arg - Arg object.
134
- * @param {string} [arg.id] -
135
- * @returns {Promise<any>} - Success response
136
- * @summary: Fetch last-modified timestamp
137
- * @description: Use this API to fetch Last-Modified timestamp in header metadata.
138
- */
139
- async getCartLastModified({ id } = {}) {
140
- const { error } = CartValidator.getCartLastModified().validate(
141
- { id },
142
- { abortEarly: false, allowUnknown: true }
143
- );
144
- if (error) {
145
- return Promise.reject(new FDKClientValidationError(error));
146
- }
147
-
148
- // Showing warrnings if extra unknown parameters are found
149
- const { error: warrning } = CartValidator.getCartLastModified().validate(
150
- { id },
151
- { abortEarly: false, allowUnknown: false }
152
- );
153
- if (warrning) {
154
- Logger({
155
- level: "WARN",
156
- message: "Parameter Validation warrnings for getCartLastModified",
157
- });
158
- Logger({ level: "WARN", message: warrning });
159
- }
160
-
161
- const query_params = {};
162
- query_params["id"] = id;
163
-
164
- const xHeaders = {};
165
-
166
- const response = await APIClient.execute(
167
- this._conf,
168
- "head",
169
- constructUrl({
170
- url: this._urls["getCartLastModified"],
171
- params: {},
172
- }),
173
- query_params,
174
- undefined,
175
- xHeaders
176
- );
177
-
178
- const { error: res_error } = Joi.string()
179
- .allow("")
180
- .validate(response, { abortEarly: false, allowUnknown: false });
181
-
182
- if (res_error) {
183
- Logger({
184
- level: "WARN",
185
- message: "Response Validation Warnnings for getCartLastModified",
113
+ message: "Response Validation Warnnings for addAddress",
186
114
  });
187
115
  Logger({ level: "WARN", message: res_error });
188
116
  }
@@ -263,19 +191,19 @@ class Cart {
263
191
 
264
192
  /**
265
193
  * @param {Object} arg - Arg object.
266
- * @param {string} [arg.id] -
267
194
  * @param {boolean} [arg.i] -
268
195
  * @param {boolean} [arg.b] -
269
- * @param {string} [arg.areaCode] -
196
+ * @param {boolean} [arg.p] -
197
+ * @param {string} [arg.id] -
270
198
  * @param {boolean} [arg.buyNow] -
271
- * @param {UpdateCartRequest} arg.body
272
- * @returns {Promise<UpdateCartDetailResponse>} - Success response
273
- * @summary: Update items in the cart
274
- * @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>
199
+ * @param {ApplyCouponRequest} arg.body
200
+ * @returns {Promise<CartDetailResponse>} - Success response
201
+ * @summary: Apply Coupon
202
+ * @description: Use this API to apply coupons on items in the cart.
275
203
  */
276
- async updateCart({ body, id, i, b, areaCode, buyNow } = {}) {
277
- const { error } = CartValidator.updateCart().validate(
278
- { body, id, i, b, areaCode, buyNow },
204
+ async applyCoupon({ body, i, b, p, id, buyNow } = {}) {
205
+ const { error } = CartValidator.applyCoupon().validate(
206
+ { body, i, b, p, id, buyNow },
279
207
  { abortEarly: false, allowUnknown: true }
280
208
  );
281
209
  if (error) {
@@ -283,32 +211,32 @@ class Cart {
283
211
  }
284
212
 
285
213
  // Showing warrnings if extra unknown parameters are found
286
- const { error: warrning } = CartValidator.updateCart().validate(
287
- { body, id, i, b, areaCode, buyNow },
214
+ const { error: warrning } = CartValidator.applyCoupon().validate(
215
+ { body, i, b, p, id, buyNow },
288
216
  { abortEarly: false, allowUnknown: false }
289
217
  );
290
218
  if (warrning) {
291
219
  Logger({
292
220
  level: "WARN",
293
- message: "Parameter Validation warrnings for updateCart",
221
+ message: "Parameter Validation warrnings for applyCoupon",
294
222
  });
295
223
  Logger({ level: "WARN", message: warrning });
296
224
  }
297
225
 
298
226
  const query_params = {};
299
- query_params["id"] = id;
300
227
  query_params["i"] = i;
301
228
  query_params["b"] = b;
302
- query_params["area_code"] = areaCode;
229
+ query_params["p"] = p;
230
+ query_params["id"] = id;
303
231
  query_params["buy_now"] = buyNow;
304
232
 
305
233
  const xHeaders = {};
306
234
 
307
235
  const response = await APIClient.execute(
308
236
  this._conf,
309
- "put",
237
+ "post",
310
238
  constructUrl({
311
- url: this._urls["updateCart"],
239
+ url: this._urls["applyCoupon"],
312
240
  params: {},
313
241
  }),
314
242
  query_params,
@@ -318,7 +246,7 @@ class Cart {
318
246
 
319
247
  const {
320
248
  error: res_error,
321
- } = CartModel.UpdateCartDetailResponse().validate(response, {
249
+ } = CartModel.CartDetailResponse().validate(response, {
322
250
  abortEarly: false,
323
251
  allowUnknown: false,
324
252
  });
@@ -326,7 +254,7 @@ class Cart {
326
254
  if (res_error) {
327
255
  Logger({
328
256
  level: "WARN",
329
- message: "Response Validation Warnnings for updateCart",
257
+ message: "Response Validation Warnnings for applyCoupon",
330
258
  });
331
259
  Logger({ level: "WARN", message: res_error });
332
260
  }
@@ -336,15 +264,18 @@ class Cart {
336
264
 
337
265
  /**
338
266
  * @param {Object} arg - Arg object.
339
- * @param {string} [arg.id] - The unique identifier of the cart.
267
+ * @param {string} [arg.id] -
268
+ * @param {boolean} [arg.i] -
269
+ * @param {boolean} [arg.b] -
340
270
  * @param {boolean} [arg.buyNow] -
341
- * @returns {Promise<CartItemCountResponse>} - Success response
342
- * @summary: Count items in the cart
343
- * @description: Use this API to get the total number of items present in cart.
271
+ * @param {RewardPointRequest} arg.body
272
+ * @returns {Promise<CartDetailResponse>} - Success response
273
+ * @summary: Apply reward points at cart
274
+ * @description: Use this API to redeem a fixed no. of reward points by applying it to the cart.
344
275
  */
345
- async getItemCount({ id, buyNow } = {}) {
346
- const { error } = CartValidator.getItemCount().validate(
347
- { id, buyNow },
276
+ async applyRewardPoints({ body, id, i, b, buyNow } = {}) {
277
+ const { error } = CartValidator.applyRewardPoints().validate(
278
+ { body, id, i, b, buyNow },
348
279
  { abortEarly: false, allowUnknown: true }
349
280
  );
350
281
  if (error) {
@@ -352,39 +283,41 @@ class Cart {
352
283
  }
353
284
 
354
285
  // Showing warrnings if extra unknown parameters are found
355
- const { error: warrning } = CartValidator.getItemCount().validate(
356
- { id, buyNow },
286
+ const { error: warrning } = CartValidator.applyRewardPoints().validate(
287
+ { body, id, i, b, buyNow },
357
288
  { abortEarly: false, allowUnknown: false }
358
289
  );
359
290
  if (warrning) {
360
291
  Logger({
361
292
  level: "WARN",
362
- message: "Parameter Validation warrnings for getItemCount",
293
+ message: "Parameter Validation warrnings for applyRewardPoints",
363
294
  });
364
295
  Logger({ level: "WARN", message: warrning });
365
296
  }
366
297
 
367
298
  const query_params = {};
368
299
  query_params["id"] = id;
300
+ query_params["i"] = i;
301
+ query_params["b"] = b;
369
302
  query_params["buy_now"] = buyNow;
370
303
 
371
304
  const xHeaders = {};
372
305
 
373
306
  const response = await APIClient.execute(
374
307
  this._conf,
375
- "get",
308
+ "post",
376
309
  constructUrl({
377
- url: this._urls["getItemCount"],
310
+ url: this._urls["applyRewardPoints"],
378
311
  params: {},
379
312
  }),
380
313
  query_params,
381
- undefined,
314
+ body,
382
315
  xHeaders
383
316
  );
384
317
 
385
318
  const {
386
319
  error: res_error,
387
- } = CartModel.CartItemCountResponse().validate(response, {
320
+ } = CartModel.CartDetailResponse().validate(response, {
388
321
  abortEarly: false,
389
322
  allowUnknown: false,
390
323
  });
@@ -392,7 +325,7 @@ class Cart {
392
325
  if (res_error) {
393
326
  Logger({
394
327
  level: "WARN",
395
- message: "Response Validation Warnnings for getItemCount",
328
+ message: "Response Validation Warnnings for applyRewardPoints",
396
329
  });
397
330
  Logger({ level: "WARN", message: res_error });
398
331
  }
@@ -402,15 +335,15 @@ class Cart {
402
335
 
403
336
  /**
404
337
  * @param {Object} arg - Arg object.
405
- * @param {string} [arg.id] -
406
- * @param {boolean} [arg.buyNow] -
407
- * @returns {Promise<GetCouponResponse>} - Success response
408
- * @summary: Fetch Coupon
409
- * @description: Use this API to get a list of available coupons along with their details.
338
+ * @param {boolean} [arg.buyNow] - This indicates the type of cart to checkout
339
+ * @param {CartCheckoutDetailRequest} arg.body
340
+ * @returns {Promise<CartCheckoutResponse>} - Success response
341
+ * @summary: Checkout all items in the cart
342
+ * @description: Use this API to checkout all items in the cart for payment and order generation. For COD, order will be directly generated, whereas for other checkout modes, user will be redirected to a payment gateway.
410
343
  */
411
- async getCoupons({ id, buyNow } = {}) {
412
- const { error } = CartValidator.getCoupons().validate(
413
- { id, buyNow },
344
+ async checkoutCart({ body, buyNow } = {}) {
345
+ const { error } = CartValidator.checkoutCart().validate(
346
+ { body, buyNow },
414
347
  { abortEarly: false, allowUnknown: true }
415
348
  );
416
349
  if (error) {
@@ -418,39 +351,38 @@ class Cart {
418
351
  }
419
352
 
420
353
  // Showing warrnings if extra unknown parameters are found
421
- const { error: warrning } = CartValidator.getCoupons().validate(
422
- { id, buyNow },
354
+ const { error: warrning } = CartValidator.checkoutCart().validate(
355
+ { body, buyNow },
423
356
  { abortEarly: false, allowUnknown: false }
424
357
  );
425
358
  if (warrning) {
426
359
  Logger({
427
360
  level: "WARN",
428
- message: "Parameter Validation warrnings for getCoupons",
361
+ message: "Parameter Validation warrnings for checkoutCart",
429
362
  });
430
363
  Logger({ level: "WARN", message: warrning });
431
364
  }
432
365
 
433
366
  const query_params = {};
434
- query_params["id"] = id;
435
367
  query_params["buy_now"] = buyNow;
436
368
 
437
369
  const xHeaders = {};
438
370
 
439
371
  const response = await APIClient.execute(
440
372
  this._conf,
441
- "get",
373
+ "post",
442
374
  constructUrl({
443
- url: this._urls["getCoupons"],
375
+ url: this._urls["checkoutCart"],
444
376
  params: {},
445
377
  }),
446
378
  query_params,
447
- undefined,
379
+ body,
448
380
  xHeaders
449
381
  );
450
382
 
451
383
  const {
452
384
  error: res_error,
453
- } = CartModel.GetCouponResponse().validate(response, {
385
+ } = CartModel.CartCheckoutResponse().validate(response, {
454
386
  abortEarly: false,
455
387
  allowUnknown: false,
456
388
  });
@@ -458,7 +390,7 @@ class Cart {
458
390
  if (res_error) {
459
391
  Logger({
460
392
  level: "WARN",
461
- message: "Response Validation Warnnings for getCoupons",
393
+ message: "Response Validation Warnnings for checkoutCart",
462
394
  });
463
395
  Logger({ level: "WARN", message: res_error });
464
396
  }
@@ -468,19 +400,28 @@ class Cart {
468
400
 
469
401
  /**
470
402
  * @param {Object} arg - Arg object.
471
- * @param {boolean} [arg.i] -
472
- * @param {boolean} [arg.b] -
473
- * @param {boolean} [arg.p] -
474
- * @param {string} [arg.id] -
403
+ * @param {string} arg.id -
404
+ * @param {string} [arg.cartId] -
475
405
  * @param {boolean} [arg.buyNow] -
476
- * @param {ApplyCouponRequest} arg.body
477
- * @returns {Promise<CartDetailResponse>} - Success response
478
- * @summary: Apply Coupon
479
- * @description: Use this API to apply coupons on items in the cart.
480
- */
481
- async applyCoupon({ body, i, b, p, id, buyNow } = {}) {
482
- const { error } = CartValidator.applyCoupon().validate(
483
- { body, i, b, p, id, buyNow },
406
+ * @param {string} [arg.mobileNo] -
407
+ * @param {string} [arg.checkoutMode] -
408
+ * @param {string} [arg.tags] -
409
+ * @param {boolean} [arg.isDefault] -
410
+ * @returns {Promise<Address>} - Success response
411
+ * @summary: Fetch a single address by its ID
412
+ * @description: Use this API to get an addresses using its ID. If successful, returns a Address resource in the response body specified in `Address`. Attibutes listed below are optional <ul> <li> <font color="monochrome">mobile_no</font></li> <li> <font color="monochrome">checkout_mode</font></li> <li> <font color="monochrome">tags</font></li> <li> <font color="monochrome">default</font></li> </ul>
413
+ */
414
+ async getAddressById({
415
+ id,
416
+ cartId,
417
+ buyNow,
418
+ mobileNo,
419
+ checkoutMode,
420
+ tags,
421
+ isDefault,
422
+ } = {}) {
423
+ const { error } = CartValidator.getAddressById().validate(
424
+ { id, cartId, buyNow, mobileNo, checkoutMode, tags, isDefault },
484
425
  { abortEarly: false, allowUnknown: true }
485
426
  );
486
427
  if (error) {
@@ -488,42 +429,41 @@ class Cart {
488
429
  }
489
430
 
490
431
  // Showing warrnings if extra unknown parameters are found
491
- const { error: warrning } = CartValidator.applyCoupon().validate(
492
- { body, i, b, p, id, buyNow },
432
+ const { error: warrning } = CartValidator.getAddressById().validate(
433
+ { id, cartId, buyNow, mobileNo, checkoutMode, tags, isDefault },
493
434
  { abortEarly: false, allowUnknown: false }
494
435
  );
495
436
  if (warrning) {
496
437
  Logger({
497
438
  level: "WARN",
498
- message: "Parameter Validation warrnings for applyCoupon",
439
+ message: "Parameter Validation warrnings for getAddressById",
499
440
  });
500
441
  Logger({ level: "WARN", message: warrning });
501
442
  }
502
443
 
503
444
  const query_params = {};
504
- query_params["i"] = i;
505
- query_params["b"] = b;
506
- query_params["p"] = p;
507
- query_params["id"] = id;
445
+ query_params["cart_id"] = cartId;
508
446
  query_params["buy_now"] = buyNow;
447
+ query_params["mobile_no"] = mobileNo;
448
+ query_params["checkout_mode"] = checkoutMode;
449
+ query_params["tags"] = tags;
450
+ query_params["is_default"] = isDefault;
509
451
 
510
452
  const xHeaders = {};
511
453
 
512
454
  const response = await APIClient.execute(
513
455
  this._conf,
514
- "post",
456
+ "get",
515
457
  constructUrl({
516
- url: this._urls["applyCoupon"],
517
- params: {},
458
+ url: this._urls["getAddressById"],
459
+ params: { id },
518
460
  }),
519
461
  query_params,
520
- body,
462
+ undefined,
521
463
  xHeaders
522
464
  );
523
465
 
524
- const {
525
- error: res_error,
526
- } = CartModel.CartDetailResponse().validate(response, {
466
+ const { error: res_error } = CartModel.Address().validate(response, {
527
467
  abortEarly: false,
528
468
  allowUnknown: false,
529
469
  });
@@ -531,7 +471,7 @@ class Cart {
531
471
  if (res_error) {
532
472
  Logger({
533
473
  level: "WARN",
534
- message: "Response Validation Warnnings for applyCoupon",
474
+ message: "Response Validation Warnnings for getAddressById",
535
475
  });
536
476
  Logger({ level: "WARN", message: res_error });
537
477
  }
@@ -541,15 +481,26 @@ class Cart {
541
481
 
542
482
  /**
543
483
  * @param {Object} arg - Arg object.
544
- * @param {string} [arg.id] -
484
+ * @param {string} [arg.cartId] -
545
485
  * @param {boolean} [arg.buyNow] -
546
- * @returns {Promise<CartDetailResponse>} - Success response
547
- * @summary: Remove Coupon Applied
548
- * @description: Remove Coupon applied on the cart by passing uid in request body.
486
+ * @param {string} [arg.mobileNo] -
487
+ * @param {string} [arg.checkoutMode] -
488
+ * @param {string} [arg.tags] -
489
+ * @param {boolean} [arg.isDefault] -
490
+ * @returns {Promise<GetAddressesResponse>} - Success response
491
+ * @summary: Fetch address
492
+ * @description: Use this API to get all the addresses associated with an account. If successful, returns a Address resource in the response body specified in GetAddressesResponse.attibutes listed below are optional <ul> <li> <font color="monochrome">uid</font></li> <li> <font color="monochrome">address_id</font></li> <li> <font color="monochrome">mobile_no</font></li> <li> <font color="monochrome">checkout_mode</font></li> <li> <font color="monochrome">tags</font></li> <li> <font color="monochrome">default</font></li> </ul>
549
493
  */
550
- async removeCoupon({ id, buyNow } = {}) {
551
- const { error } = CartValidator.removeCoupon().validate(
552
- { id, buyNow },
494
+ async getAddresses({
495
+ cartId,
496
+ buyNow,
497
+ mobileNo,
498
+ checkoutMode,
499
+ tags,
500
+ isDefault,
501
+ } = {}) {
502
+ const { error } = CartValidator.getAddresses().validate(
503
+ { cartId, buyNow, mobileNo, checkoutMode, tags, isDefault },
553
504
  { abortEarly: false, allowUnknown: true }
554
505
  );
555
506
  if (error) {
@@ -557,29 +508,33 @@ class Cart {
557
508
  }
558
509
 
559
510
  // Showing warrnings if extra unknown parameters are found
560
- const { error: warrning } = CartValidator.removeCoupon().validate(
561
- { id, buyNow },
511
+ const { error: warrning } = CartValidator.getAddresses().validate(
512
+ { cartId, buyNow, mobileNo, checkoutMode, tags, isDefault },
562
513
  { abortEarly: false, allowUnknown: false }
563
514
  );
564
515
  if (warrning) {
565
516
  Logger({
566
517
  level: "WARN",
567
- message: "Parameter Validation warrnings for removeCoupon",
518
+ message: "Parameter Validation warrnings for getAddresses",
568
519
  });
569
520
  Logger({ level: "WARN", message: warrning });
570
521
  }
571
522
 
572
523
  const query_params = {};
573
- query_params["id"] = id;
524
+ query_params["cart_id"] = cartId;
574
525
  query_params["buy_now"] = buyNow;
526
+ query_params["mobile_no"] = mobileNo;
527
+ query_params["checkout_mode"] = checkoutMode;
528
+ query_params["tags"] = tags;
529
+ query_params["is_default"] = isDefault;
575
530
 
576
531
  const xHeaders = {};
577
532
 
578
533
  const response = await APIClient.execute(
579
534
  this._conf,
580
- "delete",
535
+ "get",
581
536
  constructUrl({
582
- url: this._urls["removeCoupon"],
537
+ url: this._urls["getAddresses"],
583
538
  params: {},
584
539
  }),
585
540
  query_params,
@@ -589,7 +544,7 @@ class Cart {
589
544
 
590
545
  const {
591
546
  error: res_error,
592
- } = CartModel.CartDetailResponse().validate(response, {
547
+ } = CartModel.GetAddressesResponse().validate(response, {
593
548
  abortEarly: false,
594
549
  allowUnknown: false,
595
550
  });
@@ -597,7 +552,7 @@ class Cart {
597
552
  if (res_error) {
598
553
  Logger({
599
554
  level: "WARN",
600
- message: "Response Validation Warnnings for removeCoupon",
555
+ message: "Response Validation Warnnings for getAddresses",
601
556
  });
602
557
  Logger({ level: "WARN", message: res_error });
603
558
  }
@@ -682,15 +637,16 @@ class Cart {
682
637
  * @param {string} [arg.id] -
683
638
  * @param {boolean} [arg.i] -
684
639
  * @param {boolean} [arg.b] -
640
+ * @param {number} [arg.assignCardId] -
641
+ * @param {string} [arg.areaCode] -
685
642
  * @param {boolean} [arg.buyNow] -
686
- * @param {RewardPointRequest} arg.body
687
643
  * @returns {Promise<CartDetailResponse>} - Success response
688
- * @summary: Apply reward points at cart
689
- * @description: Use this API to redeem a fixed no. of reward points by applying it to the cart.
644
+ * @summary: Fetch all items added to the cart
645
+ * @description: Use this API to get details of all the items added to a cart.
690
646
  */
691
- async applyRewardPoints({ body, id, i, b, buyNow } = {}) {
692
- const { error } = CartValidator.applyRewardPoints().validate(
693
- { body, id, i, b, buyNow },
647
+ async getCart({ id, i, b, assignCardId, areaCode, buyNow } = {}) {
648
+ const { error } = CartValidator.getCart().validate(
649
+ { id, i, b, assignCardId, areaCode, buyNow },
694
650
  { abortEarly: false, allowUnknown: true }
695
651
  );
696
652
  if (error) {
@@ -698,14 +654,14 @@ class Cart {
698
654
  }
699
655
 
700
656
  // Showing warrnings if extra unknown parameters are found
701
- const { error: warrning } = CartValidator.applyRewardPoints().validate(
702
- { body, id, i, b, buyNow },
657
+ const { error: warrning } = CartValidator.getCart().validate(
658
+ { id, i, b, assignCardId, areaCode, buyNow },
703
659
  { abortEarly: false, allowUnknown: false }
704
660
  );
705
661
  if (warrning) {
706
662
  Logger({
707
663
  level: "WARN",
708
- message: "Parameter Validation warrnings for applyRewardPoints",
664
+ message: "Parameter Validation warrnings for getCart",
709
665
  });
710
666
  Logger({ level: "WARN", message: warrning });
711
667
  }
@@ -714,19 +670,21 @@ class Cart {
714
670
  query_params["id"] = id;
715
671
  query_params["i"] = i;
716
672
  query_params["b"] = b;
673
+ query_params["assign_card_id"] = assignCardId;
674
+ query_params["area_code"] = areaCode;
717
675
  query_params["buy_now"] = buyNow;
718
676
 
719
677
  const xHeaders = {};
720
678
 
721
679
  const response = await APIClient.execute(
722
680
  this._conf,
723
- "post",
681
+ "get",
724
682
  constructUrl({
725
- url: this._urls["applyRewardPoints"],
683
+ url: this._urls["getCart"],
726
684
  params: {},
727
685
  }),
728
686
  query_params,
729
- body,
687
+ undefined,
730
688
  xHeaders
731
689
  );
732
690
 
@@ -740,7 +698,7 @@ class Cart {
740
698
  if (res_error) {
741
699
  Logger({
742
700
  level: "WARN",
743
- message: "Response Validation Warnnings for applyRewardPoints",
701
+ message: "Response Validation Warnnings for getCart",
744
702
  });
745
703
  Logger({ level: "WARN", message: res_error });
746
704
  }
@@ -750,26 +708,14 @@ class Cart {
750
708
 
751
709
  /**
752
710
  * @param {Object} arg - Arg object.
753
- * @param {string} [arg.cartId] -
754
- * @param {boolean} [arg.buyNow] -
755
- * @param {string} [arg.mobileNo] -
756
- * @param {string} [arg.checkoutMode] -
757
- * @param {string} [arg.tags] -
758
- * @param {boolean} [arg.isDefault] -
759
- * @returns {Promise<GetAddressesResponse>} - Success response
760
- * @summary: Fetch address
761
- * @description: Use this API to get all the addresses associated with an account. If successful, returns a Address resource in the response body specified in GetAddressesResponse.attibutes listed below are optional <ul> <li> <font color="monochrome">uid</font></li> <li> <font color="monochrome">address_id</font></li> <li> <font color="monochrome">mobile_no</font></li> <li> <font color="monochrome">checkout_mode</font></li> <li> <font color="monochrome">tags</font></li> <li> <font color="monochrome">default</font></li> </ul>
711
+ * @param {string} [arg.id] -
712
+ * @returns {Promise<any>} - Success response
713
+ * @summary: Fetch last-modified timestamp
714
+ * @description: Use this API to fetch Last-Modified timestamp in header metadata.
762
715
  */
763
- async getAddresses({
764
- cartId,
765
- buyNow,
766
- mobileNo,
767
- checkoutMode,
768
- tags,
769
- isDefault,
770
- } = {}) {
771
- const { error } = CartValidator.getAddresses().validate(
772
- { cartId, buyNow, mobileNo, checkoutMode, tags, isDefault },
716
+ async getCartLastModified({ id } = {}) {
717
+ const { error } = CartValidator.getCartLastModified().validate(
718
+ { id },
773
719
  { abortEarly: false, allowUnknown: true }
774
720
  );
775
721
  if (error) {
@@ -777,33 +723,28 @@ class Cart {
777
723
  }
778
724
 
779
725
  // Showing warrnings if extra unknown parameters are found
780
- const { error: warrning } = CartValidator.getAddresses().validate(
781
- { cartId, buyNow, mobileNo, checkoutMode, tags, isDefault },
726
+ const { error: warrning } = CartValidator.getCartLastModified().validate(
727
+ { id },
782
728
  { abortEarly: false, allowUnknown: false }
783
729
  );
784
730
  if (warrning) {
785
731
  Logger({
786
732
  level: "WARN",
787
- message: "Parameter Validation warrnings for getAddresses",
733
+ message: "Parameter Validation warrnings for getCartLastModified",
788
734
  });
789
735
  Logger({ level: "WARN", message: warrning });
790
736
  }
791
737
 
792
738
  const query_params = {};
793
- query_params["cart_id"] = cartId;
794
- query_params["buy_now"] = buyNow;
795
- query_params["mobile_no"] = mobileNo;
796
- query_params["checkout_mode"] = checkoutMode;
797
- query_params["tags"] = tags;
798
- query_params["is_default"] = isDefault;
739
+ query_params["id"] = id;
799
740
 
800
741
  const xHeaders = {};
801
742
 
802
743
  const response = await APIClient.execute(
803
744
  this._conf,
804
- "get",
745
+ "head",
805
746
  constructUrl({
806
- url: this._urls["getAddresses"],
747
+ url: this._urls["getCartLastModified"],
807
748
  params: {},
808
749
  }),
809
750
  query_params,
@@ -811,17 +752,14 @@ class Cart {
811
752
  xHeaders
812
753
  );
813
754
 
814
- const {
815
- error: res_error,
816
- } = CartModel.GetAddressesResponse().validate(response, {
817
- abortEarly: false,
818
- allowUnknown: false,
819
- });
755
+ const { error: res_error } = Joi.string()
756
+ .allow("")
757
+ .validate(response, { abortEarly: false, allowUnknown: false });
820
758
 
821
759
  if (res_error) {
822
760
  Logger({
823
761
  level: "WARN",
824
- message: "Response Validation Warnnings for getAddresses",
762
+ message: "Response Validation Warnnings for getCartLastModified",
825
763
  });
826
764
  Logger({ level: "WARN", message: res_error });
827
765
  }
@@ -831,13 +769,13 @@ class Cart {
831
769
 
832
770
  /**
833
771
  * @param {Object} arg - Arg object.
834
- * @param {Address} arg.body
835
- * @returns {Promise<SaveAddressResponse>} - Success response
836
- * @summary: Add address to an account
837
- * @description: Use this API to add an address to an account.
772
+ * @param {GetShareCartLinkRequest} arg.body
773
+ * @returns {Promise<GetShareCartLinkResponse>} - Success response
774
+ * @summary: Generate token for sharing the cart
775
+ * @description: Use this API to generate a shared cart snapshot and return a shortlink token. The link can be shared with other users for getting the same items in their cart.
838
776
  */
839
- async addAddress({ body } = {}) {
840
- const { error } = CartValidator.addAddress().validate(
777
+ async getCartShareLink({ body } = {}) {
778
+ const { error } = CartValidator.getCartShareLink().validate(
841
779
  { body },
842
780
  { abortEarly: false, allowUnknown: true }
843
781
  );
@@ -846,14 +784,14 @@ class Cart {
846
784
  }
847
785
 
848
786
  // Showing warrnings if extra unknown parameters are found
849
- const { error: warrning } = CartValidator.addAddress().validate(
787
+ const { error: warrning } = CartValidator.getCartShareLink().validate(
850
788
  { body },
851
789
  { abortEarly: false, allowUnknown: false }
852
790
  );
853
791
  if (warrning) {
854
792
  Logger({
855
793
  level: "WARN",
856
- message: "Parameter Validation warrnings for addAddress",
794
+ message: "Parameter Validation warrnings for getCartShareLink",
857
795
  });
858
796
  Logger({ level: "WARN", message: warrning });
859
797
  }
@@ -866,7 +804,7 @@ class Cart {
866
804
  this._conf,
867
805
  "post",
868
806
  constructUrl({
869
- url: this._urls["addAddress"],
807
+ url: this._urls["getCartShareLink"],
870
808
  params: {},
871
809
  }),
872
810
  query_params,
@@ -876,7 +814,7 @@ class Cart {
876
814
 
877
815
  const {
878
816
  error: res_error,
879
- } = CartModel.SaveAddressResponse().validate(response, {
817
+ } = CartModel.GetShareCartLinkResponse().validate(response, {
880
818
  abortEarly: false,
881
819
  allowUnknown: false,
882
820
  });
@@ -884,7 +822,7 @@ class Cart {
884
822
  if (res_error) {
885
823
  Logger({
886
824
  level: "WARN",
887
- message: "Response Validation Warnnings for addAddress",
825
+ message: "Response Validation Warnnings for getCartShareLink",
888
826
  });
889
827
  Logger({ level: "WARN", message: res_error });
890
828
  }
@@ -894,28 +832,14 @@ class Cart {
894
832
 
895
833
  /**
896
834
  * @param {Object} arg - Arg object.
897
- * @param {string} arg.id -
898
- * @param {string} [arg.cartId] -
899
- * @param {boolean} [arg.buyNow] -
900
- * @param {string} [arg.mobileNo] -
901
- * @param {string} [arg.checkoutMode] -
902
- * @param {string} [arg.tags] -
903
- * @param {boolean} [arg.isDefault] -
904
- * @returns {Promise<Address>} - Success response
905
- * @summary: Fetch a single address by its ID
906
- * @description: Use this API to get an addresses using its ID. If successful, returns a Address resource in the response body specified in `Address`. Attibutes listed below are optional <ul> <li> <font color="monochrome">mobile_no</font></li> <li> <font color="monochrome">checkout_mode</font></li> <li> <font color="monochrome">tags</font></li> <li> <font color="monochrome">default</font></li> </ul>
835
+ * @param {string} arg.token - Token of the shared short link
836
+ * @returns {Promise<SharedCartResponse>} - Success response
837
+ * @summary: Get details of a shared cart
838
+ * @description: Use this API to get the shared cart details as per the token generated using the share-cart API.
907
839
  */
908
- async getAddressById({
909
- id,
910
- cartId,
911
- buyNow,
912
- mobileNo,
913
- checkoutMode,
914
- tags,
915
- isDefault,
916
- } = {}) {
917
- const { error } = CartValidator.getAddressById().validate(
918
- { id, cartId, buyNow, mobileNo, checkoutMode, tags, isDefault },
840
+ async getCartSharedItems({ token } = {}) {
841
+ const { error } = CartValidator.getCartSharedItems().validate(
842
+ { token },
919
843
  { abortEarly: false, allowUnknown: true }
920
844
  );
921
845
  if (error) {
@@ -923,25 +847,19 @@ class Cart {
923
847
  }
924
848
 
925
849
  // Showing warrnings if extra unknown parameters are found
926
- const { error: warrning } = CartValidator.getAddressById().validate(
927
- { id, cartId, buyNow, mobileNo, checkoutMode, tags, isDefault },
850
+ const { error: warrning } = CartValidator.getCartSharedItems().validate(
851
+ { token },
928
852
  { abortEarly: false, allowUnknown: false }
929
853
  );
930
854
  if (warrning) {
931
855
  Logger({
932
856
  level: "WARN",
933
- message: "Parameter Validation warrnings for getAddressById",
857
+ message: "Parameter Validation warrnings for getCartSharedItems",
934
858
  });
935
859
  Logger({ level: "WARN", message: warrning });
936
860
  }
937
861
 
938
862
  const query_params = {};
939
- query_params["cart_id"] = cartId;
940
- query_params["buy_now"] = buyNow;
941
- query_params["mobile_no"] = mobileNo;
942
- query_params["checkout_mode"] = checkoutMode;
943
- query_params["tags"] = tags;
944
- query_params["is_default"] = isDefault;
945
863
 
946
864
  const xHeaders = {};
947
865
 
@@ -949,15 +867,17 @@ class Cart {
949
867
  this._conf,
950
868
  "get",
951
869
  constructUrl({
952
- url: this._urls["getAddressById"],
953
- params: { id },
870
+ url: this._urls["getCartSharedItems"],
871
+ params: { token },
954
872
  }),
955
873
  query_params,
956
874
  undefined,
957
875
  xHeaders
958
876
  );
959
877
 
960
- const { error: res_error } = CartModel.Address().validate(response, {
878
+ const {
879
+ error: res_error,
880
+ } = CartModel.SharedCartResponse().validate(response, {
961
881
  abortEarly: false,
962
882
  allowUnknown: false,
963
883
  });
@@ -965,7 +885,7 @@ class Cart {
965
885
  if (res_error) {
966
886
  Logger({
967
887
  level: "WARN",
968
- message: "Response Validation Warnnings for getAddressById",
888
+ message: "Response Validation Warnnings for getCartSharedItems",
969
889
  });
970
890
  Logger({ level: "WARN", message: res_error });
971
891
  }
@@ -975,15 +895,15 @@ class Cart {
975
895
 
976
896
  /**
977
897
  * @param {Object} arg - Arg object.
978
- * @param {string} arg.id - ID allotted to the selected address
979
- * @param {Address} arg.body
980
- * @returns {Promise<UpdateAddressResponse>} - Success response
981
- * @summary: Update address added to an account
982
- * @description: <p>Use this API to update an existing address in the account. Request object should contain attributes mentioned in <font color="blue">Address </font> can be updated. These attributes are:</p> <ul> <li> <font color="monochrome">is_default_address</font></li> <li> <font color="monochrome">landmark</font></li> <li> <font color="monochrome">area</font></li> <li> <font color="monochrome">pincode</font></li> <li> <font color="monochrome">email</font></li> <li> <font color="monochrome">address_type</font></li> <li> <font color="monochrome">name</font></li> <li> <font color="monochrome">address_id</font></li> <li> <font color="monochrome">address</font></li> </ul>
983
- */
984
- async updateAddress({ id, body } = {}) {
985
- const { error } = CartValidator.updateAddress().validate(
986
- { id, body },
898
+ * @param {string} [arg.id] -
899
+ * @param {boolean} [arg.buyNow] -
900
+ * @returns {Promise<GetCouponResponse>} - Success response
901
+ * @summary: Fetch Coupon
902
+ * @description: Use this API to get a list of available coupons along with their details.
903
+ */
904
+ async getCoupons({ id, buyNow } = {}) {
905
+ const { error } = CartValidator.getCoupons().validate(
906
+ { id, buyNow },
987
907
  { abortEarly: false, allowUnknown: true }
988
908
  );
989
909
  if (error) {
@@ -991,37 +911,39 @@ class Cart {
991
911
  }
992
912
 
993
913
  // Showing warrnings if extra unknown parameters are found
994
- const { error: warrning } = CartValidator.updateAddress().validate(
995
- { id, body },
914
+ const { error: warrning } = CartValidator.getCoupons().validate(
915
+ { id, buyNow },
996
916
  { abortEarly: false, allowUnknown: false }
997
917
  );
998
918
  if (warrning) {
999
919
  Logger({
1000
920
  level: "WARN",
1001
- message: "Parameter Validation warrnings for updateAddress",
921
+ message: "Parameter Validation warrnings for getCoupons",
1002
922
  });
1003
923
  Logger({ level: "WARN", message: warrning });
1004
924
  }
1005
925
 
1006
926
  const query_params = {};
927
+ query_params["id"] = id;
928
+ query_params["buy_now"] = buyNow;
1007
929
 
1008
930
  const xHeaders = {};
1009
931
 
1010
932
  const response = await APIClient.execute(
1011
933
  this._conf,
1012
- "put",
934
+ "get",
1013
935
  constructUrl({
1014
- url: this._urls["updateAddress"],
1015
- params: { id },
936
+ url: this._urls["getCoupons"],
937
+ params: {},
1016
938
  }),
1017
939
  query_params,
1018
- body,
940
+ undefined,
1019
941
  xHeaders
1020
942
  );
1021
943
 
1022
944
  const {
1023
945
  error: res_error,
1024
- } = CartModel.UpdateAddressResponse().validate(response, {
946
+ } = CartModel.GetCouponResponse().validate(response, {
1025
947
  abortEarly: false,
1026
948
  allowUnknown: false,
1027
949
  });
@@ -1029,7 +951,7 @@ class Cart {
1029
951
  if (res_error) {
1030
952
  Logger({
1031
953
  level: "WARN",
1032
- message: "Response Validation Warnnings for updateAddress",
954
+ message: "Response Validation Warnnings for getCoupons",
1033
955
  });
1034
956
  Logger({ level: "WARN", message: res_error });
1035
957
  }
@@ -1039,14 +961,15 @@ class Cart {
1039
961
 
1040
962
  /**
1041
963
  * @param {Object} arg - Arg object.
1042
- * @param {string} arg.id - ID allotted to the selected address
1043
- * @returns {Promise<DeleteAddressResponse>} - Success response
1044
- * @summary: Remove address associated with an account
1045
- * @description: Use this API to delete an address by its ID. This will returns an object that will indicate whether the address was deleted successfully or not.
964
+ * @param {string} [arg.id] - The unique identifier of the cart.
965
+ * @param {boolean} [arg.buyNow] -
966
+ * @returns {Promise<CartItemCountResponse>} - Success response
967
+ * @summary: Count items in the cart
968
+ * @description: Use this API to get the total number of items present in cart.
1046
969
  */
1047
- async removeAddress({ id } = {}) {
1048
- const { error } = CartValidator.removeAddress().validate(
1049
- { id },
970
+ async getItemCount({ id, buyNow } = {}) {
971
+ const { error } = CartValidator.getItemCount().validate(
972
+ { id, buyNow },
1050
973
  { abortEarly: false, allowUnknown: true }
1051
974
  );
1052
975
  if (error) {
@@ -1054,28 +977,30 @@ class Cart {
1054
977
  }
1055
978
 
1056
979
  // Showing warrnings if extra unknown parameters are found
1057
- const { error: warrning } = CartValidator.removeAddress().validate(
1058
- { id },
980
+ const { error: warrning } = CartValidator.getItemCount().validate(
981
+ { id, buyNow },
1059
982
  { abortEarly: false, allowUnknown: false }
1060
983
  );
1061
984
  if (warrning) {
1062
985
  Logger({
1063
986
  level: "WARN",
1064
- message: "Parameter Validation warrnings for removeAddress",
987
+ message: "Parameter Validation warrnings for getItemCount",
1065
988
  });
1066
989
  Logger({ level: "WARN", message: warrning });
1067
990
  }
1068
991
 
1069
992
  const query_params = {};
993
+ query_params["id"] = id;
994
+ query_params["buy_now"] = buyNow;
1070
995
 
1071
996
  const xHeaders = {};
1072
997
 
1073
998
  const response = await APIClient.execute(
1074
999
  this._conf,
1075
- "delete",
1000
+ "get",
1076
1001
  constructUrl({
1077
- url: this._urls["removeAddress"],
1078
- params: { id },
1002
+ url: this._urls["getItemCount"],
1003
+ params: {},
1079
1004
  }),
1080
1005
  query_params,
1081
1006
  undefined,
@@ -1084,7 +1009,7 @@ class Cart {
1084
1009
 
1085
1010
  const {
1086
1011
  error: res_error,
1087
- } = CartModel.DeleteAddressResponse().validate(response, {
1012
+ } = CartModel.CartItemCountResponse().validate(response, {
1088
1013
  abortEarly: false,
1089
1014
  allowUnknown: false,
1090
1015
  });
@@ -1092,7 +1017,7 @@ class Cart {
1092
1017
  if (res_error) {
1093
1018
  Logger({
1094
1019
  level: "WARN",
1095
- message: "Response Validation Warnnings for removeAddress",
1020
+ message: "Response Validation Warnnings for getItemCount",
1096
1021
  });
1097
1022
  Logger({ level: "WARN", message: res_error });
1098
1023
  }
@@ -1102,18 +1027,21 @@ class Cart {
1102
1027
 
1103
1028
  /**
1104
1029
  * @param {Object} arg - Arg object.
1105
- * @param {string} [arg.cartId] -
1106
- * @param {boolean} [arg.buyNow] -
1107
- * @param {boolean} [arg.i] -
1108
- * @param {boolean} [arg.b] -
1109
- * @param {SelectCartAddressRequest} arg.body
1110
- * @returns {Promise<CartDetailResponse>} - Success response
1111
- * @summary: Select an address from available addresses
1112
- * @description: <p>Select Address from all addresses associated with the account in order to ship the cart items to that address, otherwise default address will be selected implicitly. See `SelectCartAddressRequest` in schema of request body for the list of attributes needed to select Address from account. On successful request, this API returns a Cart object. Below address attributes are required. <ul> <li> <font color="monochrome">address_id</font></li> <li> <font color="monochrome">billing_address_id</font></li> <li> <font color="monochrome">uid</font></li> </ul></p>
1030
+ * @param {string} arg.slug - A short, human-readable, URL-friendly
1031
+ * identifier of a product. You can get slug value from the endpoint
1032
+ * /service/application/catalog/v1.0/products/
1033
+ * @param {string} [arg.storeId] - Store uid of assigned store on PDP page.
1034
+ * If not passed default first created ladder will be returned
1035
+ * @param {string} [arg.promotionId] - Get ladder information of given
1036
+ * promotion id explicitely
1037
+ * @param {number} [arg.pageSize] - Number of offers to be fetched to show
1038
+ * @returns {Promise<LadderPriceOffers>} - Success response
1039
+ * @summary: Fetch ladder price promotion
1040
+ * @description: Use this API to get applicable ladder price promotion for current product
1113
1041
  */
1114
- async selectAddress({ body, cartId, buyNow, i, b } = {}) {
1115
- const { error } = CartValidator.selectAddress().validate(
1116
- { body, cartId, buyNow, i, b },
1042
+ async getLadderOffers({ slug, storeId, promotionId, pageSize } = {}) {
1043
+ const { error } = CartValidator.getLadderOffers().validate(
1044
+ { slug, storeId, promotionId, pageSize },
1117
1045
  { abortEarly: false, allowUnknown: true }
1118
1046
  );
1119
1047
  if (error) {
@@ -1121,41 +1049,41 @@ class Cart {
1121
1049
  }
1122
1050
 
1123
1051
  // Showing warrnings if extra unknown parameters are found
1124
- const { error: warrning } = CartValidator.selectAddress().validate(
1125
- { body, cartId, buyNow, i, b },
1052
+ const { error: warrning } = CartValidator.getLadderOffers().validate(
1053
+ { slug, storeId, promotionId, pageSize },
1126
1054
  { abortEarly: false, allowUnknown: false }
1127
1055
  );
1128
1056
  if (warrning) {
1129
1057
  Logger({
1130
1058
  level: "WARN",
1131
- message: "Parameter Validation warrnings for selectAddress",
1059
+ message: "Parameter Validation warrnings for getLadderOffers",
1132
1060
  });
1133
1061
  Logger({ level: "WARN", message: warrning });
1134
1062
  }
1135
1063
 
1136
1064
  const query_params = {};
1137
- query_params["cart_id"] = cartId;
1138
- query_params["buy_now"] = buyNow;
1139
- query_params["i"] = i;
1140
- query_params["b"] = b;
1065
+ query_params["slug"] = slug;
1066
+ query_params["store_id"] = storeId;
1067
+ query_params["promotion_id"] = promotionId;
1068
+ query_params["page_size"] = pageSize;
1141
1069
 
1142
1070
  const xHeaders = {};
1143
1071
 
1144
1072
  const response = await APIClient.execute(
1145
1073
  this._conf,
1146
- "post",
1074
+ "get",
1147
1075
  constructUrl({
1148
- url: this._urls["selectAddress"],
1076
+ url: this._urls["getLadderOffers"],
1149
1077
  params: {},
1150
1078
  }),
1151
1079
  query_params,
1152
- body,
1080
+ undefined,
1153
1081
  xHeaders
1154
1082
  );
1155
1083
 
1156
1084
  const {
1157
1085
  error: res_error,
1158
- } = CartModel.CartDetailResponse().validate(response, {
1086
+ } = CartModel.LadderPriceOffers().validate(response, {
1159
1087
  abortEarly: false,
1160
1088
  allowUnknown: false,
1161
1089
  });
@@ -1163,7 +1091,7 @@ class Cart {
1163
1091
  if (res_error) {
1164
1092
  Logger({
1165
1093
  level: "WARN",
1166
- message: "Response Validation Warnnings for selectAddress",
1094
+ message: "Response Validation Warnnings for getLadderOffers",
1167
1095
  });
1168
1096
  Logger({ level: "WARN", message: res_error });
1169
1097
  }
@@ -1173,16 +1101,18 @@ class Cart {
1173
1101
 
1174
1102
  /**
1175
1103
  * @param {Object} arg - Arg object.
1176
- * @param {string} [arg.id] -
1177
- * @param {boolean} [arg.buyNow] -
1178
- * @param {UpdateCartPaymentRequest} arg.body
1179
- * @returns {Promise<CartDetailResponse>} - Success response
1180
- * @summary: Update cart payment
1181
- * @description: Use this API to update cart payment.
1104
+ * @param {string} [arg.slug] - A short, human-readable, URL-friendly
1105
+ * identifier of a product. You can get slug value from the endpoint
1106
+ * /service/application/catalog/v1.0/products/
1107
+ * @param {number} [arg.pageSize] - Number of offers to be fetched to show
1108
+ * @param {string} [arg.promotionGroup] - Type of promotion groups
1109
+ * @returns {Promise<PromotionOffersResponse>} - Success response
1110
+ * @summary: Fetch available promotions
1111
+ * @description: Use this API to get top 5 offers available for current product
1182
1112
  */
1183
- async selectPaymentMode({ body, id, buyNow } = {}) {
1184
- const { error } = CartValidator.selectPaymentMode().validate(
1185
- { body, id, buyNow },
1113
+ async getPromotionOffers({ slug, pageSize, promotionGroup } = {}) {
1114
+ const { error } = CartValidator.getPromotionOffers().validate(
1115
+ { slug, pageSize, promotionGroup },
1186
1116
  { abortEarly: false, allowUnknown: true }
1187
1117
  );
1188
1118
  if (error) {
@@ -1190,39 +1120,40 @@ class Cart {
1190
1120
  }
1191
1121
 
1192
1122
  // Showing warrnings if extra unknown parameters are found
1193
- const { error: warrning } = CartValidator.selectPaymentMode().validate(
1194
- { body, id, buyNow },
1123
+ const { error: warrning } = CartValidator.getPromotionOffers().validate(
1124
+ { slug, pageSize, promotionGroup },
1195
1125
  { abortEarly: false, allowUnknown: false }
1196
1126
  );
1197
1127
  if (warrning) {
1198
1128
  Logger({
1199
1129
  level: "WARN",
1200
- message: "Parameter Validation warrnings for selectPaymentMode",
1130
+ message: "Parameter Validation warrnings for getPromotionOffers",
1201
1131
  });
1202
1132
  Logger({ level: "WARN", message: warrning });
1203
1133
  }
1204
1134
 
1205
1135
  const query_params = {};
1206
- query_params["id"] = id;
1207
- query_params["buy_now"] = buyNow;
1136
+ query_params["slug"] = slug;
1137
+ query_params["page_size"] = pageSize;
1138
+ query_params["promotion_group"] = promotionGroup;
1208
1139
 
1209
1140
  const xHeaders = {};
1210
1141
 
1211
1142
  const response = await APIClient.execute(
1212
1143
  this._conf,
1213
- "put",
1144
+ "get",
1214
1145
  constructUrl({
1215
- url: this._urls["selectPaymentMode"],
1146
+ url: this._urls["getPromotionOffers"],
1216
1147
  params: {},
1217
1148
  }),
1218
1149
  query_params,
1219
- body,
1150
+ undefined,
1220
1151
  xHeaders
1221
1152
  );
1222
1153
 
1223
1154
  const {
1224
1155
  error: res_error,
1225
- } = CartModel.CartDetailResponse().validate(response, {
1156
+ } = CartModel.PromotionOffersResponse().validate(response, {
1226
1157
  abortEarly: false,
1227
1158
  allowUnknown: false,
1228
1159
  });
@@ -1230,7 +1161,7 @@ class Cart {
1230
1161
  if (res_error) {
1231
1162
  Logger({
1232
1163
  level: "WARN",
1233
- message: "Response Validation Warnnings for selectPaymentMode",
1164
+ message: "Response Validation Warnnings for getPromotionOffers",
1234
1165
  });
1235
1166
  Logger({ level: "WARN", message: res_error });
1236
1167
  }
@@ -1240,36 +1171,20 @@ class Cart {
1240
1171
 
1241
1172
  /**
1242
1173
  * @param {Object} arg - Arg object.
1243
- * @param {string} [arg.id] -
1174
+ * @param {boolean} [arg.p] - This is a boolean value. Select `true` for
1175
+ * getting a payment option in response.
1176
+ * @param {string} [arg.id] - The unique identifier of the cart
1244
1177
  * @param {boolean} [arg.buyNow] -
1245
- * @param {string} [arg.addressId] -
1246
- * @param {string} [arg.paymentMode] -
1247
- * @param {string} [arg.paymentIdentifier] -
1248
- * @param {string} [arg.aggregatorName] -
1249
- * @param {string} [arg.merchantCode] -
1250
- * @returns {Promise<PaymentCouponValidate>} - Success response
1251
- * @summary: Verify the coupon eligibility against the payment mode
1252
- * @description: Use this API to validate a coupon against the payment mode such as NetBanking, Wallet, UPI etc.
1178
+ * @param {string} [arg.addressId] - ID allotted to the selected address
1179
+ * @param {string} [arg.areaCode] - The PIN Code of the destination address,
1180
+ * e.g. 400059
1181
+ * @returns {Promise<CartShipmentsResponse>} - Success response
1182
+ * @summary: Get delivery date and options before checkout
1183
+ * @description: Use this API to get shipment details, expected delivery date, items and price breakup of the shipment.
1253
1184
  */
1254
- async validateCouponForPayment({
1255
- id,
1256
- buyNow,
1257
- addressId,
1258
- paymentMode,
1259
- paymentIdentifier,
1260
- aggregatorName,
1261
- merchantCode,
1262
- } = {}) {
1263
- const { error } = CartValidator.validateCouponForPayment().validate(
1264
- {
1265
- id,
1266
- buyNow,
1267
- addressId,
1268
- paymentMode,
1269
- paymentIdentifier,
1270
- aggregatorName,
1271
- merchantCode,
1272
- },
1185
+ async getShipments({ p, id, buyNow, addressId, areaCode } = {}) {
1186
+ const { error } = CartValidator.getShipments().validate(
1187
+ { p, id, buyNow, addressId, areaCode },
1273
1188
  { abortEarly: false, allowUnknown: true }
1274
1189
  );
1275
1190
  if (error) {
@@ -1277,36 +1192,24 @@ class Cart {
1277
1192
  }
1278
1193
 
1279
1194
  // Showing warrnings if extra unknown parameters are found
1280
- const {
1281
- error: warrning,
1282
- } = CartValidator.validateCouponForPayment().validate(
1283
- {
1284
- id,
1285
- buyNow,
1286
- addressId,
1287
- paymentMode,
1288
- paymentIdentifier,
1289
- aggregatorName,
1290
- merchantCode,
1291
- },
1195
+ const { error: warrning } = CartValidator.getShipments().validate(
1196
+ { p, id, buyNow, addressId, areaCode },
1292
1197
  { abortEarly: false, allowUnknown: false }
1293
1198
  );
1294
1199
  if (warrning) {
1295
1200
  Logger({
1296
1201
  level: "WARN",
1297
- message: "Parameter Validation warrnings for validateCouponForPayment",
1202
+ message: "Parameter Validation warrnings for getShipments",
1298
1203
  });
1299
1204
  Logger({ level: "WARN", message: warrning });
1300
1205
  }
1301
1206
 
1302
1207
  const query_params = {};
1208
+ query_params["p"] = p;
1303
1209
  query_params["id"] = id;
1304
1210
  query_params["buy_now"] = buyNow;
1305
1211
  query_params["address_id"] = addressId;
1306
- query_params["payment_mode"] = paymentMode;
1307
- query_params["payment_identifier"] = paymentIdentifier;
1308
- query_params["aggregator_name"] = aggregatorName;
1309
- query_params["merchant_code"] = merchantCode;
1212
+ query_params["area_code"] = areaCode;
1310
1213
 
1311
1214
  const xHeaders = {};
1312
1215
 
@@ -1314,7 +1217,7 @@ class Cart {
1314
1217
  this._conf,
1315
1218
  "get",
1316
1219
  constructUrl({
1317
- url: this._urls["validateCouponForPayment"],
1220
+ url: this._urls["getShipments"],
1318
1221
  params: {},
1319
1222
  }),
1320
1223
  query_params,
@@ -1324,7 +1227,7 @@ class Cart {
1324
1227
 
1325
1228
  const {
1326
1229
  error: res_error,
1327
- } = CartModel.PaymentCouponValidate().validate(response, {
1230
+ } = CartModel.CartShipmentsResponse().validate(response, {
1328
1231
  abortEarly: false,
1329
1232
  allowUnknown: false,
1330
1233
  });
@@ -1332,7 +1235,7 @@ class Cart {
1332
1235
  if (res_error) {
1333
1236
  Logger({
1334
1237
  level: "WARN",
1335
- message: "Response Validation Warnnings for validateCouponForPayment",
1238
+ message: "Response Validation Warnnings for getShipments",
1336
1239
  });
1337
1240
  Logger({ level: "WARN", message: res_error });
1338
1241
  }
@@ -1342,20 +1245,78 @@ class Cart {
1342
1245
 
1343
1246
  /**
1344
1247
  * @param {Object} arg - Arg object.
1345
- * @param {boolean} [arg.p] - This is a boolean value. Select `true` for
1346
- * getting a payment option in response.
1347
- * @param {string} [arg.id] - The unique identifier of the cart
1248
+ * @param {string} arg.id - ID allotted to the selected address
1249
+ * @returns {Promise<DeleteAddressResponse>} - Success response
1250
+ * @summary: Remove address associated with an account
1251
+ * @description: Use this API to delete an address by its ID. This will returns an object that will indicate whether the address was deleted successfully or not.
1252
+ */
1253
+ async removeAddress({ id } = {}) {
1254
+ const { error } = CartValidator.removeAddress().validate(
1255
+ { id },
1256
+ { abortEarly: false, allowUnknown: true }
1257
+ );
1258
+ if (error) {
1259
+ return Promise.reject(new FDKClientValidationError(error));
1260
+ }
1261
+
1262
+ // Showing warrnings if extra unknown parameters are found
1263
+ const { error: warrning } = CartValidator.removeAddress().validate(
1264
+ { id },
1265
+ { abortEarly: false, allowUnknown: false }
1266
+ );
1267
+ if (warrning) {
1268
+ Logger({
1269
+ level: "WARN",
1270
+ message: "Parameter Validation warrnings for removeAddress",
1271
+ });
1272
+ Logger({ level: "WARN", message: warrning });
1273
+ }
1274
+
1275
+ const query_params = {};
1276
+
1277
+ const xHeaders = {};
1278
+
1279
+ const response = await APIClient.execute(
1280
+ this._conf,
1281
+ "delete",
1282
+ constructUrl({
1283
+ url: this._urls["removeAddress"],
1284
+ params: { id },
1285
+ }),
1286
+ query_params,
1287
+ undefined,
1288
+ xHeaders
1289
+ );
1290
+
1291
+ const {
1292
+ error: res_error,
1293
+ } = CartModel.DeleteAddressResponse().validate(response, {
1294
+ abortEarly: false,
1295
+ allowUnknown: false,
1296
+ });
1297
+
1298
+ if (res_error) {
1299
+ Logger({
1300
+ level: "WARN",
1301
+ message: "Response Validation Warnnings for removeAddress",
1302
+ });
1303
+ Logger({ level: "WARN", message: res_error });
1304
+ }
1305
+
1306
+ return response;
1307
+ }
1308
+
1309
+ /**
1310
+ * @param {Object} arg - Arg object.
1311
+ * @param {string} [arg.id] -
1348
1312
  * @param {boolean} [arg.buyNow] -
1349
- * @param {string} [arg.addressId] - ID allotted to the selected address
1350
- * @param {string} [arg.areaCode] - The PIN Code of the destination address,
1351
- * e.g. 400059
1352
- * @returns {Promise<CartShipmentsResponse>} - Success response
1353
- * @summary: Get delivery date and options before checkout
1354
- * @description: Use this API to get shipment details, expected delivery date, items and price breakup of the shipment.
1313
+ * @returns {Promise<CartDetailResponse>} - Success response
1314
+ * @summary: Remove Coupon Applied
1315
+ * @description: Remove Coupon applied on the cart by passing uid in request body.
1355
1316
  */
1356
- async getShipments({ p, id, buyNow, addressId, areaCode } = {}) {
1357
- const { error } = CartValidator.getShipments().validate(
1358
- { p, id, buyNow, addressId, areaCode },
1317
+ async removeCoupon({ id, buyNow } = {}) {
1318
+ const { error } = CartValidator.removeCoupon().validate(
1319
+ { id, buyNow },
1359
1320
  { abortEarly: false, allowUnknown: true }
1360
1321
  );
1361
1322
  if (error) {
@@ -1363,32 +1324,29 @@ class Cart {
1363
1324
  }
1364
1325
 
1365
1326
  // Showing warrnings if extra unknown parameters are found
1366
- const { error: warrning } = CartValidator.getShipments().validate(
1367
- { p, id, buyNow, addressId, areaCode },
1327
+ const { error: warrning } = CartValidator.removeCoupon().validate(
1328
+ { id, buyNow },
1368
1329
  { abortEarly: false, allowUnknown: false }
1369
1330
  );
1370
1331
  if (warrning) {
1371
1332
  Logger({
1372
1333
  level: "WARN",
1373
- message: "Parameter Validation warrnings for getShipments",
1334
+ message: "Parameter Validation warrnings for removeCoupon",
1374
1335
  });
1375
1336
  Logger({ level: "WARN", message: warrning });
1376
1337
  }
1377
1338
 
1378
1339
  const query_params = {};
1379
- query_params["p"] = p;
1380
1340
  query_params["id"] = id;
1381
1341
  query_params["buy_now"] = buyNow;
1382
- query_params["address_id"] = addressId;
1383
- query_params["area_code"] = areaCode;
1384
1342
 
1385
1343
  const xHeaders = {};
1386
1344
 
1387
1345
  const response = await APIClient.execute(
1388
1346
  this._conf,
1389
- "get",
1347
+ "delete",
1390
1348
  constructUrl({
1391
- url: this._urls["getShipments"],
1349
+ url: this._urls["removeCoupon"],
1392
1350
  params: {},
1393
1351
  }),
1394
1352
  query_params,
@@ -1398,7 +1356,7 @@ class Cart {
1398
1356
 
1399
1357
  const {
1400
1358
  error: res_error,
1401
- } = CartModel.CartShipmentsResponse().validate(response, {
1359
+ } = CartModel.CartDetailResponse().validate(response, {
1402
1360
  abortEarly: false,
1403
1361
  allowUnknown: false,
1404
1362
  });
@@ -1406,7 +1364,7 @@ class Cart {
1406
1364
  if (res_error) {
1407
1365
  Logger({
1408
1366
  level: "WARN",
1409
- message: "Response Validation Warnnings for getShipments",
1367
+ message: "Response Validation Warnnings for removeCoupon",
1410
1368
  });
1411
1369
  Logger({ level: "WARN", message: res_error });
1412
1370
  }
@@ -1416,15 +1374,18 @@ class Cart {
1416
1374
 
1417
1375
  /**
1418
1376
  * @param {Object} arg - Arg object.
1419
- * @param {boolean} [arg.buyNow] - This indicates the type of cart to checkout
1420
- * @param {CartCheckoutDetailRequest} arg.body
1421
- * @returns {Promise<CartCheckoutResponse>} - Success response
1422
- * @summary: Checkout all items in the cart
1423
- * @description: Use this API to checkout all items in the cart for payment and order generation. For COD, order will be directly generated, whereas for other checkout modes, user will be redirected to a payment gateway.
1377
+ * @param {string} [arg.cartId] -
1378
+ * @param {boolean} [arg.buyNow] -
1379
+ * @param {boolean} [arg.i] -
1380
+ * @param {boolean} [arg.b] -
1381
+ * @param {SelectCartAddressRequest} arg.body
1382
+ * @returns {Promise<CartDetailResponse>} - Success response
1383
+ * @summary: Select an address from available addresses
1384
+ * @description: <p>Select Address from all addresses associated with the account in order to ship the cart items to that address, otherwise default address will be selected implicitly. See `SelectCartAddressRequest` in schema of request body for the list of attributes needed to select Address from account. On successful request, this API returns a Cart object. Below address attributes are required. <ul> <li> <font color="monochrome">address_id</font></li> <li> <font color="monochrome">billing_address_id</font></li> <li> <font color="monochrome">uid</font></li> </ul></p>
1424
1385
  */
1425
- async checkoutCart({ body, buyNow } = {}) {
1426
- const { error } = CartValidator.checkoutCart().validate(
1427
- { body, buyNow },
1386
+ async selectAddress({ body, cartId, buyNow, i, b } = {}) {
1387
+ const { error } = CartValidator.selectAddress().validate(
1388
+ { body, cartId, buyNow, i, b },
1428
1389
  { abortEarly: false, allowUnknown: true }
1429
1390
  );
1430
1391
  if (error) {
@@ -1432,20 +1393,23 @@ class Cart {
1432
1393
  }
1433
1394
 
1434
1395
  // Showing warrnings if extra unknown parameters are found
1435
- const { error: warrning } = CartValidator.checkoutCart().validate(
1436
- { body, buyNow },
1396
+ const { error: warrning } = CartValidator.selectAddress().validate(
1397
+ { body, cartId, buyNow, i, b },
1437
1398
  { abortEarly: false, allowUnknown: false }
1438
1399
  );
1439
1400
  if (warrning) {
1440
1401
  Logger({
1441
1402
  level: "WARN",
1442
- message: "Parameter Validation warrnings for checkoutCart",
1403
+ message: "Parameter Validation warrnings for selectAddress",
1443
1404
  });
1444
1405
  Logger({ level: "WARN", message: warrning });
1445
1406
  }
1446
1407
 
1447
1408
  const query_params = {};
1409
+ query_params["cart_id"] = cartId;
1448
1410
  query_params["buy_now"] = buyNow;
1411
+ query_params["i"] = i;
1412
+ query_params["b"] = b;
1449
1413
 
1450
1414
  const xHeaders = {};
1451
1415
 
@@ -1453,7 +1417,7 @@ class Cart {
1453
1417
  this._conf,
1454
1418
  "post",
1455
1419
  constructUrl({
1456
- url: this._urls["checkoutCart"],
1420
+ url: this._urls["selectAddress"],
1457
1421
  params: {},
1458
1422
  }),
1459
1423
  query_params,
@@ -1463,7 +1427,7 @@ class Cart {
1463
1427
 
1464
1428
  const {
1465
1429
  error: res_error,
1466
- } = CartModel.CartCheckoutResponse().validate(response, {
1430
+ } = CartModel.CartDetailResponse().validate(response, {
1467
1431
  abortEarly: false,
1468
1432
  allowUnknown: false,
1469
1433
  });
@@ -1471,7 +1435,7 @@ class Cart {
1471
1435
  if (res_error) {
1472
1436
  Logger({
1473
1437
  level: "WARN",
1474
- message: "Response Validation Warnnings for checkoutCart",
1438
+ message: "Response Validation Warnnings for selectAddress",
1475
1439
  });
1476
1440
  Logger({ level: "WARN", message: res_error });
1477
1441
  }
@@ -1483,13 +1447,13 @@ class Cart {
1483
1447
  * @param {Object} arg - Arg object.
1484
1448
  * @param {string} [arg.id] -
1485
1449
  * @param {boolean} [arg.buyNow] -
1486
- * @param {CartMetaRequest} arg.body
1487
- * @returns {Promise<CartMetaResponse>} - Success response
1488
- * @summary: Update the cart meta
1489
- * @description: Use this API to update cart meta like checkout_mode and gstin.
1450
+ * @param {UpdateCartPaymentRequest} arg.body
1451
+ * @returns {Promise<CartDetailResponse>} - Success response
1452
+ * @summary: Update cart payment
1453
+ * @description: Use this API to update cart payment.
1490
1454
  */
1491
- async updateCartMeta({ body, id, buyNow } = {}) {
1492
- const { error } = CartValidator.updateCartMeta().validate(
1455
+ async selectPaymentMode({ body, id, buyNow } = {}) {
1456
+ const { error } = CartValidator.selectPaymentMode().validate(
1493
1457
  { body, id, buyNow },
1494
1458
  { abortEarly: false, allowUnknown: true }
1495
1459
  );
@@ -1498,14 +1462,14 @@ class Cart {
1498
1462
  }
1499
1463
 
1500
1464
  // Showing warrnings if extra unknown parameters are found
1501
- const { error: warrning } = CartValidator.updateCartMeta().validate(
1465
+ const { error: warrning } = CartValidator.selectPaymentMode().validate(
1502
1466
  { body, id, buyNow },
1503
1467
  { abortEarly: false, allowUnknown: false }
1504
1468
  );
1505
1469
  if (warrning) {
1506
1470
  Logger({
1507
1471
  level: "WARN",
1508
- message: "Parameter Validation warrnings for updateCartMeta",
1472
+ message: "Parameter Validation warrnings for selectPaymentMode",
1509
1473
  });
1510
1474
  Logger({ level: "WARN", message: warrning });
1511
1475
  }
@@ -1520,7 +1484,7 @@ class Cart {
1520
1484
  this._conf,
1521
1485
  "put",
1522
1486
  constructUrl({
1523
- url: this._urls["updateCartMeta"],
1487
+ url: this._urls["selectPaymentMode"],
1524
1488
  params: {},
1525
1489
  }),
1526
1490
  query_params,
@@ -1528,15 +1492,17 @@ class Cart {
1528
1492
  xHeaders
1529
1493
  );
1530
1494
 
1531
- const { error: res_error } = CartModel.CartMetaResponse().validate(
1532
- response,
1533
- { abortEarly: false, allowUnknown: false }
1534
- );
1495
+ const {
1496
+ error: res_error,
1497
+ } = CartModel.CartDetailResponse().validate(response, {
1498
+ abortEarly: false,
1499
+ allowUnknown: false,
1500
+ });
1535
1501
 
1536
1502
  if (res_error) {
1537
1503
  Logger({
1538
1504
  level: "WARN",
1539
- message: "Response Validation Warnnings for updateCartMeta",
1505
+ message: "Response Validation Warnnings for selectPaymentMode",
1540
1506
  });
1541
1507
  Logger({ level: "WARN", message: res_error });
1542
1508
  }
@@ -1546,14 +1512,15 @@ class Cart {
1546
1512
 
1547
1513
  /**
1548
1514
  * @param {Object} arg - Arg object.
1549
- * @param {GetShareCartLinkRequest} arg.body
1550
- * @returns {Promise<GetShareCartLinkResponse>} - Success response
1551
- * @summary: Generate token for sharing the cart
1552
- * @description: Use this API to generate a shared cart snapshot and return a shortlink token. The link can be shared with other users for getting the same items in their cart.
1515
+ * @param {string} arg.id - ID allotted to the selected address
1516
+ * @param {Address} arg.body
1517
+ * @returns {Promise<UpdateAddressResponse>} - Success response
1518
+ * @summary: Update address added to an account
1519
+ * @description: <p>Use this API to update an existing address in the account. Request object should contain attributes mentioned in <font color="blue">Address </font> can be updated. These attributes are:</p> <ul> <li> <font color="monochrome">is_default_address</font></li> <li> <font color="monochrome">landmark</font></li> <li> <font color="monochrome">area</font></li> <li> <font color="monochrome">pincode</font></li> <li> <font color="monochrome">email</font></li> <li> <font color="monochrome">address_type</font></li> <li> <font color="monochrome">name</font></li> <li> <font color="monochrome">address_id</font></li> <li> <font color="monochrome">address</font></li> </ul>
1553
1520
  */
1554
- async getCartShareLink({ body } = {}) {
1555
- const { error } = CartValidator.getCartShareLink().validate(
1556
- { body },
1521
+ async updateAddress({ id, body } = {}) {
1522
+ const { error } = CartValidator.updateAddress().validate(
1523
+ { id, body },
1557
1524
  { abortEarly: false, allowUnknown: true }
1558
1525
  );
1559
1526
  if (error) {
@@ -1561,14 +1528,14 @@ class Cart {
1561
1528
  }
1562
1529
 
1563
1530
  // Showing warrnings if extra unknown parameters are found
1564
- const { error: warrning } = CartValidator.getCartShareLink().validate(
1565
- { body },
1531
+ const { error: warrning } = CartValidator.updateAddress().validate(
1532
+ { id, body },
1566
1533
  { abortEarly: false, allowUnknown: false }
1567
1534
  );
1568
1535
  if (warrning) {
1569
1536
  Logger({
1570
1537
  level: "WARN",
1571
- message: "Parameter Validation warrnings for getCartShareLink",
1538
+ message: "Parameter Validation warrnings for updateAddress",
1572
1539
  });
1573
1540
  Logger({ level: "WARN", message: warrning });
1574
1541
  }
@@ -1579,10 +1546,10 @@ class Cart {
1579
1546
 
1580
1547
  const response = await APIClient.execute(
1581
1548
  this._conf,
1582
- "post",
1549
+ "put",
1583
1550
  constructUrl({
1584
- url: this._urls["getCartShareLink"],
1585
- params: {},
1551
+ url: this._urls["updateAddress"],
1552
+ params: { id },
1586
1553
  }),
1587
1554
  query_params,
1588
1555
  body,
@@ -1591,7 +1558,7 @@ class Cart {
1591
1558
 
1592
1559
  const {
1593
1560
  error: res_error,
1594
- } = CartModel.GetShareCartLinkResponse().validate(response, {
1561
+ } = CartModel.UpdateAddressResponse().validate(response, {
1595
1562
  abortEarly: false,
1596
1563
  allowUnknown: false,
1597
1564
  });
@@ -1599,7 +1566,7 @@ class Cart {
1599
1566
  if (res_error) {
1600
1567
  Logger({
1601
1568
  level: "WARN",
1602
- message: "Response Validation Warnnings for getCartShareLink",
1569
+ message: "Response Validation Warnnings for updateAddress",
1603
1570
  });
1604
1571
  Logger({ level: "WARN", message: res_error });
1605
1572
  }
@@ -1609,14 +1576,19 @@ class Cart {
1609
1576
 
1610
1577
  /**
1611
1578
  * @param {Object} arg - Arg object.
1612
- * @param {string} arg.token - Token of the shared short link
1613
- * @returns {Promise<SharedCartResponse>} - Success response
1614
- * @summary: Get details of a shared cart
1615
- * @description: Use this API to get the shared cart details as per the token generated using the share-cart API.
1579
+ * @param {string} [arg.id] -
1580
+ * @param {boolean} [arg.i] -
1581
+ * @param {boolean} [arg.b] -
1582
+ * @param {string} [arg.areaCode] -
1583
+ * @param {boolean} [arg.buyNow] -
1584
+ * @param {UpdateCartRequest} arg.body
1585
+ * @returns {Promise<UpdateCartDetailResponse>} - Success response
1586
+ * @summary: Update items in the cart
1587
+ * @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>
1616
1588
  */
1617
- async getCartSharedItems({ token } = {}) {
1618
- const { error } = CartValidator.getCartSharedItems().validate(
1619
- { token },
1589
+ async updateCart({ body, id, i, b, areaCode, buyNow } = {}) {
1590
+ const { error } = CartValidator.updateCart().validate(
1591
+ { body, id, i, b, areaCode, buyNow },
1620
1592
  { abortEarly: false, allowUnknown: true }
1621
1593
  );
1622
1594
  if (error) {
@@ -1624,37 +1596,42 @@ class Cart {
1624
1596
  }
1625
1597
 
1626
1598
  // Showing warrnings if extra unknown parameters are found
1627
- const { error: warrning } = CartValidator.getCartSharedItems().validate(
1628
- { token },
1599
+ const { error: warrning } = CartValidator.updateCart().validate(
1600
+ { body, id, i, b, areaCode, buyNow },
1629
1601
  { abortEarly: false, allowUnknown: false }
1630
1602
  );
1631
1603
  if (warrning) {
1632
1604
  Logger({
1633
1605
  level: "WARN",
1634
- message: "Parameter Validation warrnings for getCartSharedItems",
1606
+ message: "Parameter Validation warrnings for updateCart",
1635
1607
  });
1636
1608
  Logger({ level: "WARN", message: warrning });
1637
1609
  }
1638
1610
 
1639
1611
  const query_params = {};
1612
+ query_params["id"] = id;
1613
+ query_params["i"] = i;
1614
+ query_params["b"] = b;
1615
+ query_params["area_code"] = areaCode;
1616
+ query_params["buy_now"] = buyNow;
1640
1617
 
1641
1618
  const xHeaders = {};
1642
1619
 
1643
1620
  const response = await APIClient.execute(
1644
1621
  this._conf,
1645
- "get",
1622
+ "put",
1646
1623
  constructUrl({
1647
- url: this._urls["getCartSharedItems"],
1648
- params: { token },
1624
+ url: this._urls["updateCart"],
1625
+ params: {},
1649
1626
  }),
1650
1627
  query_params,
1651
- undefined,
1628
+ body,
1652
1629
  xHeaders
1653
1630
  );
1654
1631
 
1655
1632
  const {
1656
1633
  error: res_error,
1657
- } = CartModel.SharedCartResponse().validate(response, {
1634
+ } = CartModel.UpdateCartDetailResponse().validate(response, {
1658
1635
  abortEarly: false,
1659
1636
  allowUnknown: false,
1660
1637
  });
@@ -1662,7 +1639,7 @@ class Cart {
1662
1639
  if (res_error) {
1663
1640
  Logger({
1664
1641
  level: "WARN",
1665
- message: "Response Validation Warnnings for getCartSharedItems",
1642
+ message: "Response Validation Warnnings for updateCart",
1666
1643
  });
1667
1644
  Logger({ level: "WARN", message: res_error });
1668
1645
  }
@@ -1672,16 +1649,16 @@ class Cart {
1672
1649
 
1673
1650
  /**
1674
1651
  * @param {Object} arg - Arg object.
1675
- * @param {string} arg.token - Token of the shared short link
1676
- * @param {string} arg.action - Operation to perform on the existing cart
1677
- * merge or replace.
1678
- * @returns {Promise<SharedCartResponse>} - Success response
1679
- * @summary: Merge or replace existing cart
1680
- * @description: Use this API to merge the shared cart with existing cart, or replace the existing cart with the shared cart. The `action` parameter is used to indicate the operation Merge or Replace.
1652
+ * @param {string} [arg.id] -
1653
+ * @param {boolean} [arg.buyNow] -
1654
+ * @param {CartMetaRequest} arg.body
1655
+ * @returns {Promise<CartMetaResponse>} - Success response
1656
+ * @summary: Update the cart meta
1657
+ * @description: Use this API to update cart meta like checkout_mode and gstin.
1681
1658
  */
1682
- async updateCartWithSharedItems({ token, action } = {}) {
1683
- const { error } = CartValidator.updateCartWithSharedItems().validate(
1684
- { token, action },
1659
+ async updateCartMeta({ body, id, buyNow } = {}) {
1660
+ const { error } = CartValidator.updateCartMeta().validate(
1661
+ { body, id, buyNow },
1685
1662
  { abortEarly: false, allowUnknown: true }
1686
1663
  );
1687
1664
  if (error) {
@@ -1689,47 +1666,45 @@ class Cart {
1689
1666
  }
1690
1667
 
1691
1668
  // Showing warrnings if extra unknown parameters are found
1692
- const {
1693
- error: warrning,
1694
- } = CartValidator.updateCartWithSharedItems().validate(
1695
- { token, action },
1669
+ const { error: warrning } = CartValidator.updateCartMeta().validate(
1670
+ { body, id, buyNow },
1696
1671
  { abortEarly: false, allowUnknown: false }
1697
1672
  );
1698
1673
  if (warrning) {
1699
1674
  Logger({
1700
1675
  level: "WARN",
1701
- message: "Parameter Validation warrnings for updateCartWithSharedItems",
1676
+ message: "Parameter Validation warrnings for updateCartMeta",
1702
1677
  });
1703
1678
  Logger({ level: "WARN", message: warrning });
1704
1679
  }
1705
1680
 
1706
1681
  const query_params = {};
1682
+ query_params["id"] = id;
1683
+ query_params["buy_now"] = buyNow;
1707
1684
 
1708
1685
  const xHeaders = {};
1709
1686
 
1710
1687
  const response = await APIClient.execute(
1711
1688
  this._conf,
1712
- "post",
1689
+ "put",
1713
1690
  constructUrl({
1714
- url: this._urls["updateCartWithSharedItems"],
1715
- params: { token, action },
1691
+ url: this._urls["updateCartMeta"],
1692
+ params: {},
1716
1693
  }),
1717
1694
  query_params,
1718
- undefined,
1695
+ body,
1719
1696
  xHeaders
1720
1697
  );
1721
1698
 
1722
- const {
1723
- error: res_error,
1724
- } = CartModel.SharedCartResponse().validate(response, {
1725
- abortEarly: false,
1726
- allowUnknown: false,
1727
- });
1699
+ const { error: res_error } = CartModel.CartMetaResponse().validate(
1700
+ response,
1701
+ { abortEarly: false, allowUnknown: false }
1702
+ );
1728
1703
 
1729
1704
  if (res_error) {
1730
1705
  Logger({
1731
1706
  level: "WARN",
1732
- message: "Response Validation Warnnings for updateCartWithSharedItems",
1707
+ message: "Response Validation Warnnings for updateCartMeta",
1733
1708
  });
1734
1709
  Logger({ level: "WARN", message: res_error });
1735
1710
  }
@@ -1739,18 +1714,16 @@ class Cart {
1739
1714
 
1740
1715
  /**
1741
1716
  * @param {Object} arg - Arg object.
1742
- * @param {string} [arg.slug] - A short, human-readable, URL-friendly
1743
- * identifier of a product. You can get slug value from the endpoint
1744
- * /service/application/catalog/v1.0/products/
1745
- * @param {number} [arg.pageSize] - Number of offers to be fetched to show
1746
- * @param {string} [arg.promotionGroup] - Type of promotion groups
1747
- * @returns {Promise<PromotionOffersResponse>} - Success response
1748
- * @summary: Fetch available promotions
1749
- * @description: Use this API to get top 5 offers available for current product
1717
+ * @param {string} arg.token - Token of the shared short link
1718
+ * @param {string} arg.action - Operation to perform on the existing cart
1719
+ * merge or replace.
1720
+ * @returns {Promise<SharedCartResponse>} - Success response
1721
+ * @summary: Merge or replace existing cart
1722
+ * @description: Use this API to merge the shared cart with existing cart, or replace the existing cart with the shared cart. The `action` parameter is used to indicate the operation Merge or Replace.
1750
1723
  */
1751
- async getPromotionOffers({ slug, pageSize, promotionGroup } = {}) {
1752
- const { error } = CartValidator.getPromotionOffers().validate(
1753
- { slug, pageSize, promotionGroup },
1724
+ async updateCartWithSharedItems({ token, action } = {}) {
1725
+ const { error } = CartValidator.updateCartWithSharedItems().validate(
1726
+ { token, action },
1754
1727
  { abortEarly: false, allowUnknown: true }
1755
1728
  );
1756
1729
  if (error) {
@@ -1758,31 +1731,30 @@ class Cart {
1758
1731
  }
1759
1732
 
1760
1733
  // Showing warrnings if extra unknown parameters are found
1761
- const { error: warrning } = CartValidator.getPromotionOffers().validate(
1762
- { slug, pageSize, promotionGroup },
1734
+ const {
1735
+ error: warrning,
1736
+ } = CartValidator.updateCartWithSharedItems().validate(
1737
+ { token, action },
1763
1738
  { abortEarly: false, allowUnknown: false }
1764
1739
  );
1765
1740
  if (warrning) {
1766
1741
  Logger({
1767
1742
  level: "WARN",
1768
- message: "Parameter Validation warrnings for getPromotionOffers",
1743
+ message: "Parameter Validation warrnings for updateCartWithSharedItems",
1769
1744
  });
1770
1745
  Logger({ level: "WARN", message: warrning });
1771
1746
  }
1772
1747
 
1773
1748
  const query_params = {};
1774
- query_params["slug"] = slug;
1775
- query_params["page_size"] = pageSize;
1776
- query_params["promotion_group"] = promotionGroup;
1777
1749
 
1778
1750
  const xHeaders = {};
1779
1751
 
1780
1752
  const response = await APIClient.execute(
1781
1753
  this._conf,
1782
- "get",
1754
+ "post",
1783
1755
  constructUrl({
1784
- url: this._urls["getPromotionOffers"],
1785
- params: {},
1756
+ url: this._urls["updateCartWithSharedItems"],
1757
+ params: { token, action },
1786
1758
  }),
1787
1759
  query_params,
1788
1760
  undefined,
@@ -1791,7 +1763,7 @@ class Cart {
1791
1763
 
1792
1764
  const {
1793
1765
  error: res_error,
1794
- } = CartModel.PromotionOffersResponse().validate(response, {
1766
+ } = CartModel.SharedCartResponse().validate(response, {
1795
1767
  abortEarly: false,
1796
1768
  allowUnknown: false,
1797
1769
  });
@@ -1799,7 +1771,7 @@ class Cart {
1799
1771
  if (res_error) {
1800
1772
  Logger({
1801
1773
  level: "WARN",
1802
- message: "Response Validation Warnnings for getPromotionOffers",
1774
+ message: "Response Validation Warnnings for updateCartWithSharedItems",
1803
1775
  });
1804
1776
  Logger({ level: "WARN", message: res_error });
1805
1777
  }
@@ -1809,21 +1781,36 @@ class Cart {
1809
1781
 
1810
1782
  /**
1811
1783
  * @param {Object} arg - Arg object.
1812
- * @param {string} arg.slug - A short, human-readable, URL-friendly
1813
- * identifier of a product. You can get slug value from the endpoint
1814
- * /service/application/catalog/v1.0/products/
1815
- * @param {string} [arg.storeId] - Store uid of assigned store on PDP page.
1816
- * If not passed default first created ladder will be returned
1817
- * @param {string} [arg.promotionId] - Get ladder information of given
1818
- * promotion id explicitely
1819
- * @param {number} [arg.pageSize] - Number of offers to be fetched to show
1820
- * @returns {Promise<LadderPriceOffers>} - Success response
1821
- * @summary: Fetch ladder price promotion
1822
- * @description: Use this API to get applicable ladder price promotion for current product
1784
+ * @param {string} [arg.id] -
1785
+ * @param {boolean} [arg.buyNow] -
1786
+ * @param {string} [arg.addressId] -
1787
+ * @param {string} [arg.paymentMode] -
1788
+ * @param {string} [arg.paymentIdentifier] -
1789
+ * @param {string} [arg.aggregatorName] -
1790
+ * @param {string} [arg.merchantCode] -
1791
+ * @returns {Promise<PaymentCouponValidate>} - Success response
1792
+ * @summary: Verify the coupon eligibility against the payment mode
1793
+ * @description: Use this API to validate a coupon against the payment mode such as NetBanking, Wallet, UPI etc.
1823
1794
  */
1824
- async getLadderOffers({ slug, storeId, promotionId, pageSize } = {}) {
1825
- const { error } = CartValidator.getLadderOffers().validate(
1826
- { slug, storeId, promotionId, pageSize },
1795
+ async validateCouponForPayment({
1796
+ id,
1797
+ buyNow,
1798
+ addressId,
1799
+ paymentMode,
1800
+ paymentIdentifier,
1801
+ aggregatorName,
1802
+ merchantCode,
1803
+ } = {}) {
1804
+ const { error } = CartValidator.validateCouponForPayment().validate(
1805
+ {
1806
+ id,
1807
+ buyNow,
1808
+ addressId,
1809
+ paymentMode,
1810
+ paymentIdentifier,
1811
+ aggregatorName,
1812
+ merchantCode,
1813
+ },
1827
1814
  { abortEarly: false, allowUnknown: true }
1828
1815
  );
1829
1816
  if (error) {
@@ -1831,23 +1818,36 @@ class Cart {
1831
1818
  }
1832
1819
 
1833
1820
  // Showing warrnings if extra unknown parameters are found
1834
- const { error: warrning } = CartValidator.getLadderOffers().validate(
1835
- { slug, storeId, promotionId, pageSize },
1821
+ const {
1822
+ error: warrning,
1823
+ } = CartValidator.validateCouponForPayment().validate(
1824
+ {
1825
+ id,
1826
+ buyNow,
1827
+ addressId,
1828
+ paymentMode,
1829
+ paymentIdentifier,
1830
+ aggregatorName,
1831
+ merchantCode,
1832
+ },
1836
1833
  { abortEarly: false, allowUnknown: false }
1837
1834
  );
1838
1835
  if (warrning) {
1839
1836
  Logger({
1840
1837
  level: "WARN",
1841
- message: "Parameter Validation warrnings for getLadderOffers",
1838
+ message: "Parameter Validation warrnings for validateCouponForPayment",
1842
1839
  });
1843
1840
  Logger({ level: "WARN", message: warrning });
1844
1841
  }
1845
1842
 
1846
1843
  const query_params = {};
1847
- query_params["slug"] = slug;
1848
- query_params["store_id"] = storeId;
1849
- query_params["promotion_id"] = promotionId;
1850
- query_params["page_size"] = pageSize;
1844
+ query_params["id"] = id;
1845
+ query_params["buy_now"] = buyNow;
1846
+ query_params["address_id"] = addressId;
1847
+ query_params["payment_mode"] = paymentMode;
1848
+ query_params["payment_identifier"] = paymentIdentifier;
1849
+ query_params["aggregator_name"] = aggregatorName;
1850
+ query_params["merchant_code"] = merchantCode;
1851
1851
 
1852
1852
  const xHeaders = {};
1853
1853
 
@@ -1855,7 +1855,7 @@ class Cart {
1855
1855
  this._conf,
1856
1856
  "get",
1857
1857
  constructUrl({
1858
- url: this._urls["getLadderOffers"],
1858
+ url: this._urls["validateCouponForPayment"],
1859
1859
  params: {},
1860
1860
  }),
1861
1861
  query_params,
@@ -1865,7 +1865,7 @@ class Cart {
1865
1865
 
1866
1866
  const {
1867
1867
  error: res_error,
1868
- } = CartModel.LadderPriceOffers().validate(response, {
1868
+ } = CartModel.PaymentCouponValidate().validate(response, {
1869
1869
  abortEarly: false,
1870
1870
  allowUnknown: false,
1871
1871
  });
@@ -1873,7 +1873,7 @@ class Cart {
1873
1873
  if (res_error) {
1874
1874
  Logger({
1875
1875
  level: "WARN",
1876
- message: "Response Validation Warnnings for getLadderOffers",
1876
+ message: "Response Validation Warnnings for validateCouponForPayment",
1877
1877
  });
1878
1878
  Logger({ level: "WARN", message: res_error });
1879
1879
  }