@gofynd/fdk-client-javascript 1.1.6 → 1.2.0

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 (321) hide show
  1. package/README.md +12 -0
  2. package/index.js +0 -3
  3. package/package.json +1 -1
  4. package/sdk/application/ApplicationAPIClient.d.ts +15 -1
  5. package/sdk/application/ApplicationAPIClient.js +8 -1
  6. package/sdk/application/ApplicationClient.d.ts +37 -6
  7. package/sdk/application/ApplicationClient.js +31 -0
  8. package/sdk/application/ApplicationConfig.d.ts +52 -12
  9. package/sdk/application/ApplicationConfig.js +37 -2
  10. package/sdk/application/ApplicationModels.d.ts +46 -1
  11. package/sdk/application/ApplicationModels.js +18 -0
  12. package/sdk/application/Cart/CartApplicationClient.d.ts +172 -357
  13. package/sdk/application/Cart/CartApplicationClient.js +620 -483
  14. package/sdk/application/Cart/CartApplicationModel.d.ts +2054 -96
  15. package/sdk/application/Cart/CartApplicationModel.js +1224 -93
  16. package/sdk/application/Cart/CartApplicationValidator.d.ts +508 -30
  17. package/sdk/application/Cart/CartApplicationValidator.js +270 -15
  18. package/sdk/application/Catalog/CatalogApplicationClient.d.ts +234 -413
  19. package/sdk/application/Catalog/CatalogApplicationClient.js +777 -630
  20. package/sdk/application/Catalog/CatalogApplicationModel.d.ts +2218 -117
  21. package/sdk/application/Catalog/CatalogApplicationModel.js +1499 -170
  22. package/sdk/application/Catalog/CatalogApplicationValidator.d.ts +798 -31
  23. package/sdk/application/Catalog/CatalogApplicationValidator.js +318 -3
  24. package/sdk/application/Common/CommonApplicationClient.d.ts +14 -21
  25. package/sdk/application/Common/CommonApplicationClient.js +50 -33
  26. package/sdk/application/Common/CommonApplicationModel.d.ts +448 -19
  27. package/sdk/application/Common/CommonApplicationModel.js +224 -16
  28. package/sdk/application/Common/CommonApplicationValidator.d.ts +42 -4
  29. package/sdk/application/Common/CommonApplicationValidator.js +21 -3
  30. package/sdk/application/Communication/CommunicationApplicationClient.d.ts +25 -18
  31. package/sdk/application/Communication/CommunicationApplicationClient.js +74 -47
  32. package/sdk/application/Communication/CommunicationApplicationModel.d.ts +190 -14
  33. package/sdk/application/Communication/CommunicationApplicationModel.js +124 -7
  34. package/sdk/application/Communication/CommunicationApplicationValidator.d.ts +27 -4
  35. package/sdk/application/Communication/CommunicationApplicationValidator.js +21 -5
  36. package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +113 -112
  37. package/sdk/application/Configuration/ConfigurationApplicationClient.js +381 -260
  38. package/sdk/application/Configuration/ConfigurationApplicationModel.d.ts +2453 -110
  39. package/sdk/application/Configuration/ConfigurationApplicationModel.js +1254 -108
  40. package/sdk/application/Configuration/ConfigurationApplicationValidator.d.ts +160 -8
  41. package/sdk/application/Configuration/ConfigurationApplicationValidator.js +88 -4
  42. package/sdk/application/Content/ContentApplicationClient.d.ts +120 -138
  43. package/sdk/application/Content/ContentApplicationClient.js +409 -277
  44. package/sdk/application/Content/ContentApplicationModel.d.ts +1627 -105
  45. package/sdk/application/Content/ContentApplicationModel.js +1202 -109
  46. package/sdk/application/Content/ContentApplicationValidator.d.ts +214 -12
  47. package/sdk/application/Content/ContentApplicationValidator.js +113 -3
  48. package/sdk/application/FileStorage/FileStorageApplicationClient.d.ts +20 -29
  49. package/sdk/application/FileStorage/FileStorageApplicationClient.js +68 -47
  50. package/sdk/application/FileStorage/FileStorageApplicationModel.d.ts +299 -20
  51. package/sdk/application/FileStorage/FileStorageApplicationModel.js +209 -16
  52. package/sdk/application/FileStorage/FileStorageApplicationValidator.d.ts +55 -5
  53. package/sdk/application/FileStorage/FileStorageApplicationValidator.js +33 -6
  54. package/sdk/application/Lead/LeadApplicationClient.d.ts +50 -53
  55. package/sdk/application/Lead/LeadApplicationClient.js +169 -103
  56. package/sdk/application/Lead/LeadApplicationModel.d.ts +1405 -54
  57. package/sdk/application/Lead/LeadApplicationModel.js +619 -73
  58. package/sdk/application/Lead/LeadApplicationValidator.d.ts +91 -9
  59. package/sdk/application/Lead/LeadApplicationValidator.js +51 -6
  60. package/sdk/application/Logistic/LogisticApplicationClient.d.ts +34 -33
  61. package/sdk/application/Logistic/LogisticApplicationClient.js +110 -73
  62. package/sdk/application/Logistic/LogisticApplicationModel.d.ts +399 -28
  63. package/sdk/application/Logistic/LogisticApplicationModel.js +293 -24
  64. package/sdk/application/Logistic/LogisticApplicationValidator.d.ts +48 -6
  65. package/sdk/application/Logistic/LogisticApplicationValidator.js +34 -6
  66. package/sdk/application/Order/OrderApplicationClient.d.ts +81 -133
  67. package/sdk/application/Order/OrderApplicationClient.js +297 -217
  68. package/sdk/application/Order/OrderApplicationModel.d.ts +1101 -66
  69. package/sdk/application/Order/OrderApplicationModel.js +776 -57
  70. package/sdk/application/Order/OrderApplicationValidator.d.ts +249 -14
  71. package/sdk/application/Order/OrderApplicationValidator.js +114 -5
  72. package/sdk/application/Payment/PaymentApplicationClient.d.ts +341 -356
  73. package/sdk/application/Payment/PaymentApplicationClient.js +1077 -703
  74. package/sdk/application/Payment/PaymentApplicationModel.d.ts +3125 -99
  75. package/sdk/application/Payment/PaymentApplicationModel.js +1158 -62
  76. package/sdk/application/Payment/PaymentApplicationValidator.d.ts +494 -41
  77. package/sdk/application/Payment/PaymentApplicationValidator.js +297 -25
  78. package/sdk/application/PosCart/PosCartApplicationClient.d.ts +178 -350
  79. package/sdk/application/PosCart/PosCartApplicationClient.js +636 -491
  80. package/sdk/application/PosCart/PosCartApplicationModel.d.ts +1823 -89
  81. package/sdk/application/PosCart/PosCartApplicationModel.js +1117 -85
  82. package/sdk/application/PosCart/PosCartApplicationValidator.d.ts +480 -29
  83. package/sdk/application/PosCart/PosCartApplicationValidator.js +262 -15
  84. package/sdk/application/Rewards/RewardsApplicationClient.d.ts +49 -47
  85. package/sdk/application/Rewards/RewardsApplicationClient.js +160 -102
  86. package/sdk/application/Rewards/RewardsApplicationModel.d.ts +343 -22
  87. package/sdk/application/Rewards/RewardsApplicationModel.js +230 -15
  88. package/sdk/application/Rewards/RewardsApplicationValidator.d.ts +70 -7
  89. package/sdk/application/Rewards/RewardsApplicationValidator.js +45 -6
  90. package/sdk/application/Share/ShareApplicationClient.d.ts +44 -50
  91. package/sdk/application/Share/ShareApplicationClient.js +165 -97
  92. package/sdk/application/Share/ShareApplicationModel.d.ts +230 -15
  93. package/sdk/application/Share/ShareApplicationModel.js +154 -16
  94. package/sdk/application/Share/ShareApplicationValidator.d.ts +86 -8
  95. package/sdk/application/Share/ShareApplicationValidator.js +48 -4
  96. package/sdk/application/Theme/ThemeApplicationClient.d.ts +25 -27
  97. package/sdk/application/Theme/ThemeApplicationClient.js +83 -54
  98. package/sdk/application/Theme/ThemeApplicationModel.d.ts +621 -48
  99. package/sdk/application/Theme/ThemeApplicationModel.js +464 -40
  100. package/sdk/application/Theme/ThemeApplicationValidator.d.ts +49 -5
  101. package/sdk/application/Theme/ThemeApplicationValidator.js +26 -3
  102. package/sdk/application/User/UserApplicationClient.d.ts +219 -303
  103. package/sdk/application/User/UserApplicationClient.js +819 -522
  104. package/sdk/application/User/UserApplicationModel.d.ts +1390 -101
  105. package/sdk/application/User/UserApplicationModel.js +983 -44
  106. package/sdk/application/User/UserApplicationValidator.d.ts +457 -33
  107. package/sdk/application/User/UserApplicationValidator.js +265 -31
  108. package/sdk/common/AxiosHelper.js +8 -2
  109. package/sdk/common/Paginator.d.ts +27 -12
  110. package/sdk/common/Paginator.js +15 -0
  111. package/sdk/common/RequestSigner.js +0 -1
  112. package/sdk/partner/PartnerAPIClient.d.ts +15 -1
  113. package/sdk/partner/PartnerAPIClient.js +8 -1
  114. package/sdk/partner/PartnerClient.d.ts +20 -3
  115. package/sdk/partner/PartnerClient.js +17 -0
  116. package/sdk/partner/PartnerConfig.d.ts +40 -14
  117. package/sdk/partner/PartnerConfig.js +31 -6
  118. package/sdk/platform/AuditTrail/AuditTrailPlatformClient.d.ts +26 -25
  119. package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +82 -53
  120. package/sdk/platform/AuditTrail/AuditTrailPlatformModel.d.ts +202 -17
  121. package/sdk/platform/AuditTrail/AuditTrailPlatformModel.js +139 -10
  122. package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.d.ts +42 -5
  123. package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.js +26 -4
  124. package/sdk/platform/Billing/BillingPlatformClient.d.ts +88 -97
  125. package/sdk/platform/Billing/BillingPlatformClient.js +310 -191
  126. package/sdk/platform/Billing/BillingPlatformModel.d.ts +1211 -68
  127. package/sdk/platform/Billing/BillingPlatformModel.js +824 -59
  128. package/sdk/platform/Billing/BillingPlatformValidator.d.ts +153 -12
  129. package/sdk/platform/Billing/BillingPlatformValidator.js +87 -8
  130. package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +392 -634
  131. package/sdk/platform/Cart/CartPlatformApplicationClient.js +1480 -957
  132. package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +827 -57
  133. package/sdk/platform/Cart/CartPlatformApplicationValidator.js +492 -34
  134. package/sdk/platform/Cart/CartPlatformModel.d.ts +3639 -175
  135. package/sdk/platform/Cart/CartPlatformModel.js +2368 -212
  136. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +438 -615
  137. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +1449 -984
  138. package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +1081 -49
  139. package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +482 -23
  140. package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +573 -824
  141. package/sdk/platform/Catalog/CatalogPlatformClient.js +1773 -1264
  142. package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +6871 -326
  143. package/sdk/platform/Catalog/CatalogPlatformModel.js +4215 -349
  144. package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +1331 -71
  145. package/sdk/platform/Catalog/CatalogPlatformValidator.js +611 -30
  146. package/sdk/platform/Common/CommonPlatformClient.d.ts +14 -21
  147. package/sdk/platform/Common/CommonPlatformClient.js +48 -33
  148. package/sdk/platform/Common/CommonPlatformModel.d.ts +448 -19
  149. package/sdk/platform/Common/CommonPlatformModel.js +224 -16
  150. package/sdk/platform/Common/CommonPlatformValidator.d.ts +42 -4
  151. package/sdk/platform/Common/CommonPlatformValidator.js +21 -3
  152. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +457 -279
  153. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +1423 -553
  154. package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.d.ts +581 -42
  155. package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.js +294 -22
  156. package/sdk/platform/Communication/CommunicationPlatformClient.d.ts +18 -5
  157. package/sdk/platform/Communication/CommunicationPlatformClient.js +58 -19
  158. package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +1630 -102
  159. package/sdk/platform/Communication/CommunicationPlatformModel.js +1150 -85
  160. package/sdk/platform/Communication/CommunicationPlatformValidator.d.ts +16 -3
  161. package/sdk/platform/Communication/CommunicationPlatformValidator.js +11 -3
  162. package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +102 -111
  163. package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +321 -225
  164. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +830 -43
  165. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +612 -78
  166. package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.d.ts +180 -13
  167. package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.js +98 -10
  168. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +232 -212
  169. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +737 -438
  170. package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.d.ts +293 -22
  171. package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.js +184 -17
  172. package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +166 -178
  173. package/sdk/platform/Configuration/ConfigurationPlatformClient.js +519 -310
  174. package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +4504 -188
  175. package/sdk/platform/Configuration/ConfigurationPlatformModel.js +2242 -204
  176. package/sdk/platform/Configuration/ConfigurationPlatformValidator.d.ts +332 -19
  177. package/sdk/platform/Configuration/ConfigurationPlatformValidator.js +153 -10
  178. package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +495 -560
  179. package/sdk/platform/Content/ContentPlatformApplicationClient.js +1777 -987
  180. package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +872 -62
  181. package/sdk/platform/Content/ContentPlatformApplicationValidator.js +487 -35
  182. package/sdk/platform/Content/ContentPlatformModel.d.ts +1661 -108
  183. package/sdk/platform/Content/ContentPlatformModel.js +1217 -113
  184. package/sdk/platform/Discount/DiscountPlatformClient.d.ts +67 -101
  185. package/sdk/platform/Discount/DiscountPlatformClient.js +240 -176
  186. package/sdk/platform/Discount/DiscountPlatformModel.d.ts +242 -15
  187. package/sdk/platform/Discount/DiscountPlatformModel.js +162 -10
  188. package/sdk/platform/Discount/DiscountPlatformValidator.d.ts +185 -13
  189. package/sdk/platform/Discount/DiscountPlatformValidator.js +88 -8
  190. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +32 -41
  191. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +106 -74
  192. package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.d.ts +77 -6
  193. package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.js +41 -6
  194. package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +39 -54
  195. package/sdk/platform/FileStorage/FileStoragePlatformClient.js +124 -99
  196. package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +299 -20
  197. package/sdk/platform/FileStorage/FileStoragePlatformModel.js +207 -16
  198. package/sdk/platform/FileStorage/FileStoragePlatformValidator.d.ts +98 -8
  199. package/sdk/platform/FileStorage/FileStoragePlatformValidator.js +54 -7
  200. package/sdk/platform/Finance/FinancePlatformClient.d.ts +85 -91
  201. package/sdk/platform/Finance/FinancePlatformClient.js +272 -180
  202. package/sdk/platform/Finance/FinancePlatformModel.d.ts +619 -50
  203. package/sdk/platform/Finance/FinancePlatformModel.js +458 -30
  204. package/sdk/platform/Finance/FinancePlatformValidator.d.ts +123 -15
  205. package/sdk/platform/Finance/FinancePlatformValidator.js +95 -16
  206. package/sdk/platform/Inventory/InventoryPlatformClient.d.ts +99 -97
  207. package/sdk/platform/Inventory/InventoryPlatformClient.js +288 -199
  208. package/sdk/platform/Inventory/InventoryPlatformModel.d.ts +1354 -61
  209. package/sdk/platform/Inventory/InventoryPlatformModel.js +916 -83
  210. package/sdk/platform/Inventory/InventoryPlatformValidator.d.ts +168 -12
  211. package/sdk/platform/Inventory/InventoryPlatformValidator.js +82 -6
  212. package/sdk/platform/Lead/LeadPlatformApplicationClient.d.ts +86 -106
  213. package/sdk/platform/Lead/LeadPlatformApplicationClient.js +326 -186
  214. package/sdk/platform/Lead/LeadPlatformApplicationValidator.d.ts +180 -14
  215. package/sdk/platform/Lead/LeadPlatformApplicationValidator.js +94 -9
  216. package/sdk/platform/Lead/LeadPlatformClient.d.ts +75 -101
  217. package/sdk/platform/Lead/LeadPlatformClient.js +240 -174
  218. package/sdk/platform/Lead/LeadPlatformModel.d.ts +1403 -54
  219. package/sdk/platform/Lead/LeadPlatformModel.js +618 -73
  220. package/sdk/platform/Lead/LeadPlatformValidator.d.ts +173 -12
  221. package/sdk/platform/Lead/LeadPlatformValidator.js +85 -8
  222. package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +18 -14
  223. package/sdk/platform/Order/OrderPlatformApplicationClient.js +56 -29
  224. package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +26 -4
  225. package/sdk/platform/Order/OrderPlatformApplicationValidator.js +16 -3
  226. package/sdk/platform/Order/OrderPlatformClient.d.ts +343 -556
  227. package/sdk/platform/Order/OrderPlatformClient.js +969 -762
  228. package/sdk/platform/Order/OrderPlatformModel.d.ts +4967 -247
  229. package/sdk/platform/Order/OrderPlatformModel.js +3249 -259
  230. package/sdk/platform/Order/OrderPlatformValidator.d.ts +758 -37
  231. package/sdk/platform/Order/OrderPlatformValidator.js +351 -22
  232. package/sdk/platform/Partner/PartnerPlatformApplicationClient.d.ts +28 -36
  233. package/sdk/platform/Partner/PartnerPlatformApplicationClient.js +103 -59
  234. package/sdk/platform/Partner/PartnerPlatformApplicationValidator.d.ts +66 -6
  235. package/sdk/platform/Partner/PartnerPlatformApplicationValidator.js +32 -4
  236. package/sdk/platform/Partner/PartnerPlatformClient.d.ts +68 -107
  237. package/sdk/platform/Partner/PartnerPlatformClient.js +253 -174
  238. package/sdk/platform/Partner/PartnerPlatformModel.d.ts +767 -45
  239. package/sdk/platform/Partner/PartnerPlatformModel.js +524 -41
  240. package/sdk/platform/Partner/PartnerPlatformValidator.d.ts +207 -13
  241. package/sdk/platform/Partner/PartnerPlatformValidator.js +87 -5
  242. package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +255 -260
  243. package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +860 -504
  244. package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +348 -30
  245. package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +221 -19
  246. package/sdk/platform/Payment/PaymentPlatformClient.d.ts +73 -73
  247. package/sdk/platform/Payment/PaymentPlatformClient.js +238 -154
  248. package/sdk/platform/Payment/PaymentPlatformModel.d.ts +2658 -93
  249. package/sdk/platform/Payment/PaymentPlatformModel.js +1035 -36
  250. package/sdk/platform/Payment/PaymentPlatformValidator.d.ts +111 -11
  251. package/sdk/platform/Payment/PaymentPlatformValidator.js +68 -7
  252. package/sdk/platform/PlatformAPIClient.d.ts +16 -1
  253. package/sdk/platform/PlatformAPIClient.js +9 -1
  254. package/sdk/platform/PlatformApplicationClient.d.ts +22 -1798
  255. package/sdk/platform/PlatformApplicationClient.js +17 -1899
  256. package/sdk/platform/PlatformClient.d.ts +29 -12579
  257. package/sdk/platform/PlatformClient.js +26 -15085
  258. package/sdk/platform/PlatformConfig.d.ts +37 -11
  259. package/sdk/platform/PlatformConfig.js +32 -6
  260. package/sdk/platform/Rewards/RewardsPlatformApplicationClient.d.ts +80 -92
  261. package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +307 -177
  262. package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.d.ts +149 -12
  263. package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.js +82 -8
  264. package/sdk/platform/Rewards/RewardsPlatformModel.d.ts +371 -23
  265. package/sdk/platform/Rewards/RewardsPlatformModel.js +246 -16
  266. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.d.ts +120 -89
  267. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.js +349 -201
  268. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.d.ts +128 -12
  269. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.js +85 -11
  270. package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +148 -178
  271. package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +454 -329
  272. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +1399 -96
  273. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +1022 -71
  274. package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.d.ts +280 -18
  275. package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.js +134 -11
  276. package/sdk/platform/Share/SharePlatformApplicationClient.d.ts +38 -47
  277. package/sdk/platform/Share/SharePlatformApplicationClient.js +137 -73
  278. package/sdk/platform/Share/SharePlatformApplicationValidator.d.ts +87 -7
  279. package/sdk/platform/Share/SharePlatformApplicationValidator.js +42 -5
  280. package/sdk/platform/Share/SharePlatformModel.d.ts +250 -16
  281. package/sdk/platform/Share/SharePlatformModel.js +165 -17
  282. package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +149 -183
  283. package/sdk/platform/Theme/ThemePlatformApplicationClient.js +579 -330
  284. package/sdk/platform/Theme/ThemePlatformApplicationValidator.d.ts +308 -24
  285. package/sdk/platform/Theme/ThemePlatformApplicationValidator.js +162 -10
  286. package/sdk/platform/Theme/ThemePlatformModel.d.ts +621 -48
  287. package/sdk/platform/Theme/ThemePlatformModel.js +464 -40
  288. package/sdk/platform/User/UserPlatformApplicationClient.d.ts +119 -151
  289. package/sdk/platform/User/UserPlatformApplicationClient.js +411 -244
  290. package/sdk/platform/User/UserPlatformApplicationValidator.d.ts +235 -18
  291. package/sdk/platform/User/UserPlatformApplicationValidator.js +126 -12
  292. package/sdk/platform/User/UserPlatformModel.d.ts +1390 -101
  293. package/sdk/platform/User/UserPlatformModel.js +983 -44
  294. package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +38 -47
  295. package/sdk/platform/Webhook/WebhookPlatformClient.js +137 -87
  296. package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +242 -16
  297. package/sdk/platform/Webhook/WebhookPlatformModel.js +167 -18
  298. package/sdk/platform/Webhook/WebhookPlatformValidator.d.ts +83 -7
  299. package/sdk/platform/Webhook/WebhookPlatformValidator.js +43 -5
  300. package/sdk/public/Configuration/ConfigurationPublicClient.d.ts +14 -21
  301. package/sdk/public/Configuration/ConfigurationPublicClient.js +46 -33
  302. package/sdk/public/Configuration/ConfigurationPublicModel.d.ts +473 -19
  303. package/sdk/public/Configuration/ConfigurationPublicModel.js +224 -16
  304. package/sdk/public/Configuration/ConfigurationPublicValidator.d.ts +42 -4
  305. package/sdk/public/Configuration/ConfigurationPublicValidator.js +21 -3
  306. package/sdk/public/Inventory/InventoryPublicClient.d.ts +48 -48
  307. package/sdk/public/Inventory/InventoryPublicClient.js +146 -98
  308. package/sdk/public/Inventory/InventoryPublicModel.d.ts +392 -21
  309. package/sdk/public/Inventory/InventoryPublicModel.js +267 -27
  310. package/sdk/public/Inventory/InventoryPublicValidator.d.ts +90 -8
  311. package/sdk/public/Inventory/InventoryPublicValidator.js +44 -4
  312. package/sdk/public/PublicClient.d.ts +19 -3
  313. package/sdk/public/PublicClient.js +16 -0
  314. package/sdk/public/PublicConfig.d.ts +27 -6
  315. package/sdk/public/PublicConfig.js +17 -1
  316. package/sdk/public/Webhook/WebhookPublicClient.d.ts +13 -11
  317. package/sdk/public/Webhook/WebhookPublicClient.js +42 -27
  318. package/sdk/public/Webhook/WebhookPublicModel.d.ts +242 -16
  319. package/sdk/public/Webhook/WebhookPublicModel.js +167 -18
  320. package/sdk/public/Webhook/WebhookPublicValidator.d.ts +18 -3
  321. package/sdk/public/Webhook/WebhookPublicValidator.js +14 -4
@@ -1,8 +1,8 @@
1
1
  const PlatformAPIClient = require("../PlatformAPIClient");
2
2
  const { FDKClientValidationError } = require("../../common/FDKError");
3
3
  const Paginator = require("../../common/Paginator");
4
- const CartValidator = require("./CartPlatformApplicationValidator");
5
- const CartModel = require("./CartPlatformModel");
4
+ const CartPlatformApplicationValidator = require("./CartPlatformApplicationValidator");
5
+ const CartPlatformModel = require("./CartPlatformModel");
6
6
  const { Logger } = require("./../../common/Logger");
7
7
  const Joi = require("joi");
8
8
 
@@ -13,14 +13,15 @@ class Cart {
13
13
  }
14
14
 
15
15
  /**
16
- * @param {Object} arg - Arg object.
17
- * @param {PlatformAddress} arg.body
18
- * @returns {Promise<SaveAddressResponse>} - Success response
16
+ * @param {CartPlatformApplicationValidator.AddAddressParam} arg - Arg object
17
+ * @param {import("../PlatformAPIClient").Options} - Options
18
+ * @returns {Promise<CartPlatformModel.SaveAddressResponse>} - Success response
19
+ * @name addAddress
19
20
  * @summary: Add address to an account
20
- * @description: Use this API to add an address to an account.
21
+ * @description: Use this API to add an address to an account. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/cart/addAddress/).
21
22
  */
22
- async addAddress({ body } = {}) {
23
- const { error } = CartValidator.addAddress().validate(
23
+ async addAddress({ body } = {}, { headers } = { headers: false }) {
24
+ const { error } = CartPlatformApplicationValidator.addAddress().validate(
24
25
  {
25
26
  body,
26
27
  },
@@ -31,7 +32,9 @@ class Cart {
31
32
  }
32
33
 
33
34
  // Showing warrnings if extra unknown parameters are found
34
- const { error: warrning } = CartValidator.addAddress().validate(
35
+ const {
36
+ error: warrning,
37
+ } = CartPlatformApplicationValidator.addAddress().validate(
35
38
  {
36
39
  body,
37
40
  },
@@ -40,9 +43,8 @@ class Cart {
40
43
  if (warrning) {
41
44
  Logger({
42
45
  level: "WARN",
43
- message: "Parameter Validation warrnings for addAddress",
46
+ message: `Parameter Validation warrnings for platform > Cart > addAddress \n ${warrning}`,
44
47
  });
45
- Logger({ level: "WARN", message: warrning });
46
48
  }
47
49
 
48
50
  const query_params = {};
@@ -52,12 +54,19 @@ class Cart {
52
54
  "post",
53
55
  `/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/address`,
54
56
  query_params,
55
- body
57
+ body,
58
+ undefined,
59
+ { headers }
56
60
  );
57
61
 
62
+ let responseData = response;
63
+ if (headers) {
64
+ responseData = response[0];
65
+ }
66
+
58
67
  const {
59
68
  error: res_error,
60
- } = CartModel.SaveAddressResponse().validate(response, {
69
+ } = CartPlatformModel.SaveAddressResponse().validate(responseData, {
61
70
  abortEarly: false,
62
71
  allowUnknown: false,
63
72
  });
@@ -65,25 +74,23 @@ class Cart {
65
74
  if (res_error) {
66
75
  Logger({
67
76
  level: "WARN",
68
- message: "Response Validation Warnnings for addAddress",
77
+ message: `Response Validation Warnnings for platform > Cart > addAddress \n ${res_error}`,
69
78
  });
70
- Logger({ level: "WARN", message: res_error });
71
79
  }
72
80
 
73
81
  return response;
74
82
  }
75
83
 
76
84
  /**
77
- * @param {Object} arg - Arg object.
78
- * @param {string} arg.cartId - Current Cart _id
79
- * @param {boolean} [arg.b] -
80
- * @param {AddCartRequest} arg.body
81
- * @returns {Promise<AddCartDetailResponse>} - Success response
85
+ * @param {CartPlatformApplicationValidator.AddItemsParam} arg - Arg object
86
+ * @param {import("../PlatformAPIClient").Options} - Options
87
+ * @returns {Promise<CartPlatformModel.AddCartDetailResponse>} - Success response
88
+ * @name addItems
82
89
  * @summary: Add items to abandoned cart
83
- * @description: Use this API to add items to the abandoned cart.
90
+ * @description: Use this API to add items to the abandoned cart. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/cart/addItems/).
84
91
  */
85
- async addItems({ cartId, body, b } = {}) {
86
- const { error } = CartValidator.addItems().validate(
92
+ async addItems({ cartId, body, b } = {}, { headers } = { headers: false }) {
93
+ const { error } = CartPlatformApplicationValidator.addItems().validate(
87
94
  {
88
95
  cartId,
89
96
  body,
@@ -96,7 +103,9 @@ class Cart {
96
103
  }
97
104
 
98
105
  // Showing warrnings if extra unknown parameters are found
99
- const { error: warrning } = CartValidator.addItems().validate(
106
+ const {
107
+ error: warrning,
108
+ } = CartPlatformApplicationValidator.addItems().validate(
100
109
  {
101
110
  cartId,
102
111
  body,
@@ -107,9 +116,8 @@ class Cart {
107
116
  if (warrning) {
108
117
  Logger({
109
118
  level: "WARN",
110
- message: "Parameter Validation warrnings for addItems",
119
+ message: `Parameter Validation warrnings for platform > Cart > addItems \n ${warrning}`,
111
120
  });
112
- Logger({ level: "WARN", message: warrning });
113
121
  }
114
122
 
115
123
  const query_params = {};
@@ -120,12 +128,19 @@ class Cart {
120
128
  "post",
121
129
  `/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/abandoned/carts/${cartId}`,
122
130
  query_params,
123
- body
131
+ body,
132
+ undefined,
133
+ { headers }
124
134
  );
125
135
 
136
+ let responseData = response;
137
+ if (headers) {
138
+ responseData = response[0];
139
+ }
140
+
126
141
  const {
127
142
  error: res_error,
128
- } = CartModel.AddCartDetailResponse().validate(response, {
143
+ } = CartPlatformModel.AddCartDetailResponse().validate(responseData, {
129
144
  abortEarly: false,
130
145
  allowUnknown: false,
131
146
  });
@@ -133,23 +148,25 @@ class Cart {
133
148
  if (res_error) {
134
149
  Logger({
135
150
  level: "WARN",
136
- message: "Response Validation Warnnings for addItems",
151
+ message: `Response Validation Warnnings for platform > Cart > addItems \n ${res_error}`,
137
152
  });
138
- Logger({ level: "WARN", message: res_error });
139
153
  }
140
154
 
141
155
  return response;
142
156
  }
143
157
 
144
158
  /**
145
- * @param {Object} arg - Arg object.
146
- * @param {PriceAdjustmentAdd} arg.body
147
- * @returns {Promise<PriceAdjustmentResponse>} - Success response
159
+ * @param {CartPlatformApplicationValidator.AddPriceAdjustmentParam} arg - Arg object
160
+ * @param {import("../PlatformAPIClient").Options} - Options
161
+ * @returns {Promise<CartPlatformModel.PriceAdjustmentResponse>} - Success response
162
+ * @name addPriceAdjustment
148
163
  * @summary: Create new price adjustment
149
- * @description: Create new price adjustment
164
+ * @description: Create new price adjustment - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/cart/addPriceAdjustment/).
150
165
  */
151
- async addPriceAdjustment({ body } = {}) {
152
- const { error } = CartValidator.addPriceAdjustment().validate(
166
+ async addPriceAdjustment({ body } = {}, { headers } = { headers: false }) {
167
+ const {
168
+ error,
169
+ } = CartPlatformApplicationValidator.addPriceAdjustment().validate(
153
170
  {
154
171
  body,
155
172
  },
@@ -160,7 +177,9 @@ class Cart {
160
177
  }
161
178
 
162
179
  // Showing warrnings if extra unknown parameters are found
163
- const { error: warrning } = CartValidator.addPriceAdjustment().validate(
180
+ const {
181
+ error: warrning,
182
+ } = CartPlatformApplicationValidator.addPriceAdjustment().validate(
164
183
  {
165
184
  body,
166
185
  },
@@ -169,9 +188,8 @@ class Cart {
169
188
  if (warrning) {
170
189
  Logger({
171
190
  level: "WARN",
172
- message: "Parameter Validation warrnings for addPriceAdjustment",
191
+ message: `Parameter Validation warrnings for platform > Cart > addPriceAdjustment \n ${warrning}`,
173
192
  });
174
- Logger({ level: "WARN", message: warrning });
175
193
  }
176
194
 
177
195
  const query_params = {};
@@ -181,12 +199,19 @@ class Cart {
181
199
  "post",
182
200
  `/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/price-adjustment`,
183
201
  query_params,
184
- body
202
+ body,
203
+ undefined,
204
+ { headers }
185
205
  );
186
206
 
207
+ let responseData = response;
208
+ if (headers) {
209
+ responseData = response[0];
210
+ }
211
+
187
212
  const {
188
213
  error: res_error,
189
- } = CartModel.PriceAdjustmentResponse().validate(response, {
214
+ } = CartPlatformModel.PriceAdjustmentResponse().validate(responseData, {
190
215
  abortEarly: false,
191
216
  allowUnknown: false,
192
217
  });
@@ -194,28 +219,26 @@ class Cart {
194
219
  if (res_error) {
195
220
  Logger({
196
221
  level: "WARN",
197
- message: "Response Validation Warnnings for addPriceAdjustment",
222
+ message: `Response Validation Warnnings for platform > Cart > addPriceAdjustment \n ${res_error}`,
198
223
  });
199
- Logger({ level: "WARN", message: res_error });
200
224
  }
201
225
 
202
226
  return response;
203
227
  }
204
228
 
205
229
  /**
206
- * @param {Object} arg - Arg object.
207
- * @param {boolean} [arg.i] -
208
- * @param {boolean} [arg.b] -
209
- * @param {boolean} [arg.p] -
210
- * @param {string} [arg.id] -
211
- * @param {boolean} [arg.buyNow] -
212
- * @param {ApplyCouponRequest} arg.body
213
- * @returns {Promise<CartDetailResponse>} - Success response
230
+ * @param {CartPlatformApplicationValidator.ApplyCouponParam} arg - Arg object
231
+ * @param {import("../PlatformAPIClient").Options} - Options
232
+ * @returns {Promise<CartPlatformModel.CartDetailResponse>} - Success response
233
+ * @name applyCoupon
214
234
  * @summary: Apply Coupon for platform pos user
215
- * @description: Use this API to apply coupons on items in the cart.
235
+ * @description: Use this API to apply coupons on items in the cart. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/cart/applyCoupon/).
216
236
  */
217
- async applyCoupon({ body, i, b, p, id, buyNow } = {}) {
218
- const { error } = CartValidator.applyCoupon().validate(
237
+ async applyCoupon(
238
+ { body, i, b, p, id, buyNow } = {},
239
+ { headers } = { headers: false }
240
+ ) {
241
+ const { error } = CartPlatformApplicationValidator.applyCoupon().validate(
219
242
  {
220
243
  body,
221
244
  i,
@@ -231,7 +254,9 @@ class Cart {
231
254
  }
232
255
 
233
256
  // Showing warrnings if extra unknown parameters are found
234
- const { error: warrning } = CartValidator.applyCoupon().validate(
257
+ const {
258
+ error: warrning,
259
+ } = CartPlatformApplicationValidator.applyCoupon().validate(
235
260
  {
236
261
  body,
237
262
  i,
@@ -245,9 +270,8 @@ class Cart {
245
270
  if (warrning) {
246
271
  Logger({
247
272
  level: "WARN",
248
- message: "Parameter Validation warrnings for applyCoupon",
273
+ message: `Parameter Validation warrnings for platform > Cart > applyCoupon \n ${warrning}`,
249
274
  });
250
- Logger({ level: "WARN", message: warrning });
251
275
  }
252
276
 
253
277
  const query_params = {};
@@ -262,12 +286,19 @@ class Cart {
262
286
  "post",
263
287
  `/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/platform-pos-coupon`,
264
288
  query_params,
265
- body
289
+ body,
290
+ undefined,
291
+ { headers }
266
292
  );
267
293
 
294
+ let responseData = response;
295
+ if (headers) {
296
+ responseData = response[0];
297
+ }
298
+
268
299
  const {
269
300
  error: res_error,
270
- } = CartModel.CartDetailResponse().validate(response, {
301
+ } = CartPlatformModel.CartDetailResponse().validate(responseData, {
271
302
  abortEarly: false,
272
303
  allowUnknown: false,
273
304
  });
@@ -275,23 +306,32 @@ class Cart {
275
306
  if (res_error) {
276
307
  Logger({
277
308
  level: "WARN",
278
- message: "Response Validation Warnnings for applyCoupon",
309
+ message: `Response Validation Warnnings for platform > Cart > applyCoupon \n ${res_error}`,
279
310
  });
280
- Logger({ level: "WARN", message: res_error });
281
311
  }
282
312
 
283
313
  return response;
284
314
  }
285
315
 
286
316
  /**
287
- * @param {Object} arg - Arg object.
288
- * @param {OpenApiCartServiceabilityRequest} arg.body
289
- * @returns {Promise<OpenApiCartServiceabilityResponse>} - Success response
317
+ * @param {CartPlatformApplicationValidator.CheckCartServiceabilityParam} arg
318
+ * - Arg object
319
+ *
320
+ * @param {import("../PlatformAPIClient").Options} - Options
321
+ * @returns {Promise<CartPlatformModel.OpenApiCartServiceabilityResponse>}
322
+ * - Success response
323
+ *
324
+ * @name checkCartServiceability
290
325
  * @summary: Check Pincode Serviceability
291
- * @description: Check Pincode serviceability for cart items provided in `cart_items` and address pincode in `shipping_address`
326
+ * @description: Check Pincode serviceability for cart items provided in `cart_items` and address pincode in `shipping_address` - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/cart/checkCartServiceability/).
292
327
  */
293
- async checkCartServiceability({ body } = {}) {
294
- const { error } = CartValidator.checkCartServiceability().validate(
328
+ async checkCartServiceability(
329
+ { body } = {},
330
+ { headers } = { headers: false }
331
+ ) {
332
+ const {
333
+ error,
334
+ } = CartPlatformApplicationValidator.checkCartServiceability().validate(
295
335
  {
296
336
  body,
297
337
  },
@@ -304,7 +344,7 @@ class Cart {
304
344
  // Showing warrnings if extra unknown parameters are found
305
345
  const {
306
346
  error: warrning,
307
- } = CartValidator.checkCartServiceability().validate(
347
+ } = CartPlatformApplicationValidator.checkCartServiceability().validate(
308
348
  {
309
349
  body,
310
350
  },
@@ -313,9 +353,8 @@ class Cart {
313
353
  if (warrning) {
314
354
  Logger({
315
355
  level: "WARN",
316
- message: "Parameter Validation warrnings for checkCartServiceability",
356
+ message: `Parameter Validation warrnings for platform > Cart > checkCartServiceability \n ${warrning}`,
317
357
  });
318
- Logger({ level: "WARN", message: warrning });
319
358
  }
320
359
 
321
360
  const query_params = {};
@@ -325,36 +364,43 @@ class Cart {
325
364
  "post",
326
365
  `/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/cart/serviceability`,
327
366
  query_params,
328
- body
367
+ body,
368
+ undefined,
369
+ { headers }
329
370
  );
330
371
 
372
+ let responseData = response;
373
+ if (headers) {
374
+ responseData = response[0];
375
+ }
376
+
331
377
  const {
332
378
  error: res_error,
333
- } = CartModel.OpenApiCartServiceabilityResponse().validate(response, {
334
- abortEarly: false,
335
- allowUnknown: false,
336
- });
379
+ } = CartPlatformModel.OpenApiCartServiceabilityResponse().validate(
380
+ responseData,
381
+ { abortEarly: false, allowUnknown: false }
382
+ );
337
383
 
338
384
  if (res_error) {
339
385
  Logger({
340
386
  level: "WARN",
341
- message: "Response Validation Warnnings for checkCartServiceability",
387
+ message: `Response Validation Warnnings for platform > Cart > checkCartServiceability \n ${res_error}`,
342
388
  });
343
- Logger({ level: "WARN", message: res_error });
344
389
  }
345
390
 
346
391
  return response;
347
392
  }
348
393
 
349
394
  /**
350
- * @param {Object} arg - Arg object.
351
- * @param {OpenApiPlatformCheckoutReq} arg.body
352
- * @returns {Promise<OpenApiCheckoutResponse>} - Success response
395
+ * @param {CartPlatformApplicationValidator.CheckoutCartParam} arg - Arg object
396
+ * @param {import("../PlatformAPIClient").Options} - Options
397
+ * @returns {Promise<CartPlatformModel.OpenApiCheckoutResponse>} - Success response
398
+ * @name checkoutCart
353
399
  * @summary: Create Fynd order with cart details
354
- * @description: Generate Fynd order for cart details send with provided `cart_items`
400
+ * @description: Generate Fynd order for cart details send with provided `cart_items` - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/cart/checkoutCart/).
355
401
  */
356
- async checkoutCart({ body } = {}) {
357
- const { error } = CartValidator.checkoutCart().validate(
402
+ async checkoutCart({ body } = {}, { headers } = { headers: false }) {
403
+ const { error } = CartPlatformApplicationValidator.checkoutCart().validate(
358
404
  {
359
405
  body,
360
406
  },
@@ -365,7 +411,9 @@ class Cart {
365
411
  }
366
412
 
367
413
  // Showing warrnings if extra unknown parameters are found
368
- const { error: warrning } = CartValidator.checkoutCart().validate(
414
+ const {
415
+ error: warrning,
416
+ } = CartPlatformApplicationValidator.checkoutCart().validate(
369
417
  {
370
418
  body,
371
419
  },
@@ -374,9 +422,8 @@ class Cart {
374
422
  if (warrning) {
375
423
  Logger({
376
424
  level: "WARN",
377
- message: "Parameter Validation warrnings for checkoutCart",
425
+ message: `Parameter Validation warrnings for platform > Cart > checkoutCart \n ${warrning}`,
378
426
  });
379
- Logger({ level: "WARN", message: warrning });
380
427
  }
381
428
 
382
429
  const query_params = {};
@@ -386,12 +433,19 @@ class Cart {
386
433
  "post",
387
434
  `/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/cart/checkout`,
388
435
  query_params,
389
- body
436
+ body,
437
+ undefined,
438
+ { headers }
390
439
  );
391
440
 
441
+ let responseData = response;
442
+ if (headers) {
443
+ responseData = response[0];
444
+ }
445
+
392
446
  const {
393
447
  error: res_error,
394
- } = CartModel.OpenApiCheckoutResponse().validate(response, {
448
+ } = CartPlatformModel.OpenApiCheckoutResponse().validate(responseData, {
395
449
  abortEarly: false,
396
450
  allowUnknown: false,
397
451
  });
@@ -399,23 +453,27 @@ class Cart {
399
453
  if (res_error) {
400
454
  Logger({
401
455
  level: "WARN",
402
- message: "Response Validation Warnnings for checkoutCart",
456
+ message: `Response Validation Warnnings for platform > Cart > checkoutCart \n ${res_error}`,
403
457
  });
404
- Logger({ level: "WARN", message: res_error });
405
458
  }
406
459
 
407
460
  return response;
408
461
  }
409
462
 
410
463
  /**
411
- * @param {Object} arg - Arg object.
412
- * @param {CartMetaConfigAdd} arg.body
413
- * @returns {Promise<CartMetaConfigAdd>} - Success response
464
+ * @param {CartPlatformApplicationValidator.CreateCartMetaConfigParam} arg
465
+ * - Arg object
466
+ *
467
+ * @param {import("../PlatformAPIClient").Options} - Options
468
+ * @returns {Promise<CartPlatformModel.CartMetaConfigAdd>} - Success response
469
+ * @name createCartMetaConfig
414
470
  * @summary: Create new cart meta configuration
415
- * @description: Create new cart meta configuration
471
+ * @description: Create new cart meta configuration - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/cart/createCartMetaConfig/).
416
472
  */
417
- async createCartMetaConfig({ body } = {}) {
418
- const { error } = CartValidator.createCartMetaConfig().validate(
473
+ async createCartMetaConfig({ body } = {}, { headers } = { headers: false }) {
474
+ const {
475
+ error,
476
+ } = CartPlatformApplicationValidator.createCartMetaConfig().validate(
419
477
  {
420
478
  body,
421
479
  },
@@ -426,7 +484,9 @@ class Cart {
426
484
  }
427
485
 
428
486
  // Showing warrnings if extra unknown parameters are found
429
- const { error: warrning } = CartValidator.createCartMetaConfig().validate(
487
+ const {
488
+ error: warrning,
489
+ } = CartPlatformApplicationValidator.createCartMetaConfig().validate(
430
490
  {
431
491
  body,
432
492
  },
@@ -435,9 +495,8 @@ class Cart {
435
495
  if (warrning) {
436
496
  Logger({
437
497
  level: "WARN",
438
- message: "Parameter Validation warrnings for createCartMetaConfig",
498
+ message: `Parameter Validation warrnings for platform > Cart > createCartMetaConfig \n ${warrning}`,
439
499
  });
440
- Logger({ level: "WARN", message: warrning });
441
500
  }
442
501
 
443
502
  const query_params = {};
@@ -447,12 +506,19 @@ class Cart {
447
506
  "post",
448
507
  `/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/cart_configuration`,
449
508
  query_params,
450
- body
509
+ body,
510
+ undefined,
511
+ { headers }
451
512
  );
452
513
 
514
+ let responseData = response;
515
+ if (headers) {
516
+ responseData = response[0];
517
+ }
518
+
453
519
  const {
454
520
  error: res_error,
455
- } = CartModel.CartMetaConfigAdd().validate(response, {
521
+ } = CartPlatformModel.CartMetaConfigAdd().validate(responseData, {
456
522
  abortEarly: false,
457
523
  allowUnknown: false,
458
524
  });
@@ -460,23 +526,23 @@ class Cart {
460
526
  if (res_error) {
461
527
  Logger({
462
528
  level: "WARN",
463
- message: "Response Validation Warnnings for createCartMetaConfig",
529
+ message: `Response Validation Warnnings for platform > Cart > createCartMetaConfig \n ${res_error}`,
464
530
  });
465
- Logger({ level: "WARN", message: res_error });
466
531
  }
467
532
 
468
533
  return response;
469
534
  }
470
535
 
471
536
  /**
472
- * @param {Object} arg - Arg object.
473
- * @param {CouponAdd} arg.body
474
- * @returns {Promise<SuccessMessage>} - Success response
537
+ * @param {CartPlatformApplicationValidator.CreateCouponParam} arg - Arg object
538
+ * @param {import("../PlatformAPIClient").Options} - Options
539
+ * @returns {Promise<CartPlatformModel.SuccessMessage>} - Success response
540
+ * @name createCoupon
475
541
  * @summary: Create new coupon
476
- * @description: Create new coupon
542
+ * @description: Create new coupon - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/cart/createCoupon/).
477
543
  */
478
- async createCoupon({ body } = {}) {
479
- const { error } = CartValidator.createCoupon().validate(
544
+ async createCoupon({ body } = {}, { headers } = { headers: false }) {
545
+ const { error } = CartPlatformApplicationValidator.createCoupon().validate(
480
546
  {
481
547
  body,
482
548
  },
@@ -487,7 +553,9 @@ class Cart {
487
553
  }
488
554
 
489
555
  // Showing warrnings if extra unknown parameters are found
490
- const { error: warrning } = CartValidator.createCoupon().validate(
556
+ const {
557
+ error: warrning,
558
+ } = CartPlatformApplicationValidator.createCoupon().validate(
491
559
  {
492
560
  body,
493
561
  },
@@ -496,9 +564,8 @@ class Cart {
496
564
  if (warrning) {
497
565
  Logger({
498
566
  level: "WARN",
499
- message: "Parameter Validation warrnings for createCoupon",
567
+ message: `Parameter Validation warrnings for platform > Cart > createCoupon \n ${warrning}`,
500
568
  });
501
- Logger({ level: "WARN", message: warrning });
502
569
  }
503
570
 
504
571
  const query_params = {};
@@ -508,10 +575,19 @@ class Cart {
508
575
  "post",
509
576
  `/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/coupon`,
510
577
  query_params,
511
- body
578
+ body,
579
+ undefined,
580
+ { headers }
512
581
  );
513
582
 
514
- const { error: res_error } = CartModel.SuccessMessage().validate(response, {
583
+ let responseData = response;
584
+ if (headers) {
585
+ responseData = response[0];
586
+ }
587
+
588
+ const {
589
+ error: res_error,
590
+ } = CartPlatformModel.SuccessMessage().validate(responseData, {
515
591
  abortEarly: false,
516
592
  allowUnknown: false,
517
593
  });
@@ -519,23 +595,25 @@ class Cart {
519
595
  if (res_error) {
520
596
  Logger({
521
597
  level: "WARN",
522
- message: "Response Validation Warnnings for createCoupon",
598
+ message: `Response Validation Warnnings for platform > Cart > createCoupon \n ${res_error}`,
523
599
  });
524
- Logger({ level: "WARN", message: res_error });
525
600
  }
526
601
 
527
602
  return response;
528
603
  }
529
604
 
530
605
  /**
531
- * @param {Object} arg - Arg object.
532
- * @param {PromotionAdd} arg.body
533
- * @returns {Promise<PromotionAdd>} - Success response
606
+ * @param {CartPlatformApplicationValidator.CreatePromotionParam} arg - Arg object
607
+ * @param {import("../PlatformAPIClient").Options} - Options
608
+ * @returns {Promise<CartPlatformModel.PromotionAdd>} - Success response
609
+ * @name createPromotion
534
610
  * @summary: Create new promotion
535
- * @description: Create new promotion
611
+ * @description: Create new promotion - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/cart/createPromotion/).
536
612
  */
537
- async createPromotion({ body } = {}) {
538
- const { error } = CartValidator.createPromotion().validate(
613
+ async createPromotion({ body } = {}, { headers } = { headers: false }) {
614
+ const {
615
+ error,
616
+ } = CartPlatformApplicationValidator.createPromotion().validate(
539
617
  {
540
618
  body,
541
619
  },
@@ -546,7 +624,9 @@ class Cart {
546
624
  }
547
625
 
548
626
  // Showing warrnings if extra unknown parameters are found
549
- const { error: warrning } = CartValidator.createPromotion().validate(
627
+ const {
628
+ error: warrning,
629
+ } = CartPlatformApplicationValidator.createPromotion().validate(
550
630
  {
551
631
  body,
552
632
  },
@@ -555,9 +635,8 @@ class Cart {
555
635
  if (warrning) {
556
636
  Logger({
557
637
  level: "WARN",
558
- message: "Parameter Validation warrnings for createPromotion",
638
+ message: `Parameter Validation warrnings for platform > Cart > createPromotion \n ${warrning}`,
559
639
  });
560
- Logger({ level: "WARN", message: warrning });
561
640
  }
562
641
 
563
642
  const query_params = {};
@@ -567,10 +646,19 @@ class Cart {
567
646
  "post",
568
647
  `/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/promotion`,
569
648
  query_params,
570
- body
649
+ body,
650
+ undefined,
651
+ { headers }
571
652
  );
572
653
 
573
- const { error: res_error } = CartModel.PromotionAdd().validate(response, {
654
+ let responseData = response;
655
+ if (headers) {
656
+ responseData = response[0];
657
+ }
658
+
659
+ const {
660
+ error: res_error,
661
+ } = CartPlatformModel.PromotionAdd().validate(responseData, {
574
662
  abortEarly: false,
575
663
  allowUnknown: false,
576
664
  });
@@ -578,24 +666,23 @@ class Cart {
578
666
  if (res_error) {
579
667
  Logger({
580
668
  level: "WARN",
581
- message: "Response Validation Warnnings for createPromotion",
669
+ message: `Response Validation Warnnings for platform > Cart > createPromotion \n ${res_error}`,
582
670
  });
583
- Logger({ level: "WARN", message: res_error });
584
671
  }
585
672
 
586
673
  return response;
587
674
  }
588
675
 
589
676
  /**
590
- * @param {Object} arg - Arg object.
591
- * @param {string} [arg.id] - The unique identifier of the cart.
592
- * @param {DeleteCartRequest} arg.body
593
- * @returns {Promise<DeleteCartDetailResponse>} - Success response
677
+ * @param {CartPlatformApplicationValidator.DeleteCartParam} arg - Arg object
678
+ * @param {import("../PlatformAPIClient").Options} - Options
679
+ * @returns {Promise<CartPlatformModel.DeleteCartDetailResponse>} - Success response
680
+ * @name deleteCart
594
681
  * @summary: Delete cart once user made successful checkout
595
- * @description: Use this API to delete the cart.
682
+ * @description: Use this API to delete the cart. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/cart/deleteCart/).
596
683
  */
597
- async deleteCart({ body, id } = {}) {
598
- const { error } = CartValidator.deleteCart().validate(
684
+ async deleteCart({ body, id } = {}, { headers } = { headers: false }) {
685
+ const { error } = CartPlatformApplicationValidator.deleteCart().validate(
599
686
  {
600
687
  body,
601
688
  id,
@@ -607,7 +694,9 @@ class Cart {
607
694
  }
608
695
 
609
696
  // Showing warrnings if extra unknown parameters are found
610
- const { error: warrning } = CartValidator.deleteCart().validate(
697
+ const {
698
+ error: warrning,
699
+ } = CartPlatformApplicationValidator.deleteCart().validate(
611
700
  {
612
701
  body,
613
702
  id,
@@ -617,9 +706,8 @@ class Cart {
617
706
  if (warrning) {
618
707
  Logger({
619
708
  level: "WARN",
620
- message: "Parameter Validation warrnings for deleteCart",
709
+ message: `Parameter Validation warrnings for platform > Cart > deleteCart \n ${warrning}`,
621
710
  });
622
- Logger({ level: "WARN", message: warrning });
623
711
  }
624
712
 
625
713
  const query_params = {};
@@ -630,12 +718,19 @@ class Cart {
630
718
  "put",
631
719
  `/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/cart_archive`,
632
720
  query_params,
633
- body
721
+ body,
722
+ undefined,
723
+ { headers }
634
724
  );
635
725
 
726
+ let responseData = response;
727
+ if (headers) {
728
+ responseData = response[0];
729
+ }
730
+
636
731
  const {
637
732
  error: res_error,
638
- } = CartModel.DeleteCartDetailResponse().validate(response, {
733
+ } = CartPlatformModel.DeleteCartDetailResponse().validate(responseData, {
639
734
  abortEarly: false,
640
735
  allowUnknown: false,
641
736
  });
@@ -643,23 +738,30 @@ class Cart {
643
738
  if (res_error) {
644
739
  Logger({
645
740
  level: "WARN",
646
- message: "Response Validation Warnnings for deleteCart",
741
+ message: `Response Validation Warnnings for platform > Cart > deleteCart \n ${res_error}`,
647
742
  });
648
- Logger({ level: "WARN", message: res_error });
649
743
  }
650
744
 
651
745
  return response;
652
746
  }
653
747
 
654
748
  /**
655
- * @param {Object} arg - Arg object.
656
- * @param {OpenapiCartDetailsRequest} arg.body
657
- * @returns {Promise<OpenapiCartDetailsResponse>} - Success response
749
+ * @param {CartPlatformApplicationValidator.FetchAndvalidateCartItemsParam} arg
750
+ * - Arg object
751
+ *
752
+ * @param {import("../PlatformAPIClient").Options} - Options
753
+ * @returns {Promise<CartPlatformModel.OpenapiCartDetailsResponse>} - Success response
754
+ * @name fetchAndvalidateCartItems
658
755
  * @summary: Fetch Cart Details
659
- * @description: Get all the details of cart for a list of provided `cart_items`
756
+ * @description: Get all the details of cart for a list of provided `cart_items` - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/cart/fetchAndvalidateCartItems/).
660
757
  */
661
- async fetchAndvalidateCartItems({ body } = {}) {
662
- const { error } = CartValidator.fetchAndvalidateCartItems().validate(
758
+ async fetchAndvalidateCartItems(
759
+ { body } = {},
760
+ { headers } = { headers: false }
761
+ ) {
762
+ const {
763
+ error,
764
+ } = CartPlatformApplicationValidator.fetchAndvalidateCartItems().validate(
663
765
  {
664
766
  body,
665
767
  },
@@ -672,7 +774,7 @@ class Cart {
672
774
  // Showing warrnings if extra unknown parameters are found
673
775
  const {
674
776
  error: warrning,
675
- } = CartValidator.fetchAndvalidateCartItems().validate(
777
+ } = CartPlatformApplicationValidator.fetchAndvalidateCartItems().validate(
676
778
  {
677
779
  body,
678
780
  },
@@ -681,9 +783,8 @@ class Cart {
681
783
  if (warrning) {
682
784
  Logger({
683
785
  level: "WARN",
684
- message: "Parameter Validation warrnings for fetchAndvalidateCartItems",
786
+ message: `Parameter Validation warrnings for platform > Cart > fetchAndvalidateCartItems \n ${warrning}`,
685
787
  });
686
- Logger({ level: "WARN", message: warrning });
687
788
  }
688
789
 
689
790
  const query_params = {};
@@ -693,12 +794,19 @@ class Cart {
693
794
  "post",
694
795
  `/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/cart/validate`,
695
796
  query_params,
696
- body
797
+ body,
798
+ undefined,
799
+ { headers }
697
800
  );
698
801
 
802
+ let responseData = response;
803
+ if (headers) {
804
+ responseData = response[0];
805
+ }
806
+
699
807
  const {
700
808
  error: res_error,
701
- } = CartModel.OpenapiCartDetailsResponse().validate(response, {
809
+ } = CartPlatformModel.OpenapiCartDetailsResponse().validate(responseData, {
702
810
  abortEarly: false,
703
811
  allowUnknown: false,
704
812
  });
@@ -706,22 +814,24 @@ class Cart {
706
814
  if (res_error) {
707
815
  Logger({
708
816
  level: "WARN",
709
- message: "Response Validation Warnnings for fetchAndvalidateCartItems",
817
+ message: `Response Validation Warnnings for platform > Cart > fetchAndvalidateCartItems \n ${res_error}`,
710
818
  });
711
- Logger({ level: "WARN", message: res_error });
712
819
  }
713
820
 
714
821
  return response;
715
822
  }
716
823
 
717
824
  /**
718
- * @param {Object} arg - Arg object.
719
- * @returns {Promise<CartMetaConfigAdd>} - Success response
825
+ * @param {import("../PlatformAPIClient").Options} - Options
826
+ * @returns {Promise<CartPlatformModel.CartMetaConfigAdd>} - Success response
827
+ * @name fetchCartMetaConfig
720
828
  * @summary: Fetch cart meta configuration
721
- * @description: Fetch cart meta configuration
829
+ * @description: Fetch cart meta configuration - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/cart/fetchCartMetaConfig/).
722
830
  */
723
- async fetchCartMetaConfig({} = {}) {
724
- const { error } = CartValidator.fetchCartMetaConfig().validate(
831
+ async fetchCartMetaConfig({ headers } = { headers: false }) {
832
+ const {
833
+ error,
834
+ } = CartPlatformApplicationValidator.fetchCartMetaConfig().validate(
725
835
  {},
726
836
  { abortEarly: false, allowUnknown: true }
727
837
  );
@@ -730,16 +840,17 @@ class Cart {
730
840
  }
731
841
 
732
842
  // Showing warrnings if extra unknown parameters are found
733
- const { error: warrning } = CartValidator.fetchCartMetaConfig().validate(
843
+ const {
844
+ error: warrning,
845
+ } = CartPlatformApplicationValidator.fetchCartMetaConfig().validate(
734
846
  {},
735
847
  { abortEarly: false, allowUnknown: false }
736
848
  );
737
849
  if (warrning) {
738
850
  Logger({
739
851
  level: "WARN",
740
- message: "Parameter Validation warrnings for fetchCartMetaConfig",
852
+ message: `Parameter Validation warrnings for platform > Cart > fetchCartMetaConfig \n ${warrning}`,
741
853
  });
742
- Logger({ level: "WARN", message: warrning });
743
854
  }
744
855
 
745
856
  const query_params = {};
@@ -749,12 +860,19 @@ class Cart {
749
860
  "get",
750
861
  `/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/cart_configuration`,
751
862
  query_params,
752
- undefined
863
+ undefined,
864
+ undefined,
865
+ { headers }
753
866
  );
754
867
 
868
+ let responseData = response;
869
+ if (headers) {
870
+ responseData = response[0];
871
+ }
872
+
755
873
  const {
756
874
  error: res_error,
757
- } = CartModel.CartMetaConfigAdd().validate(response, {
875
+ } = CartPlatformModel.CartMetaConfigAdd().validate(responseData, {
758
876
  abortEarly: false,
759
877
  allowUnknown: false,
760
878
  });
@@ -762,37 +880,28 @@ class Cart {
762
880
  if (res_error) {
763
881
  Logger({
764
882
  level: "WARN",
765
- message: "Response Validation Warnnings for fetchCartMetaConfig",
883
+ message: `Response Validation Warnnings for platform > Cart > fetchCartMetaConfig \n ${res_error}`,
766
884
  });
767
- Logger({ level: "WARN", message: res_error });
768
885
  }
769
886
 
770
887
  return response;
771
888
  }
772
889
 
773
890
  /**
774
- * @param {Object} arg - Arg object.
775
- * @param {number} [arg.pageNo] -
776
- * @param {number} [arg.pageSize] -
777
- * @param {string} [arg.fromDate] -
778
- * @param {string} [arg.toDate] -
779
- * @param {boolean} [arg.anonymousCart] -
780
- * @param {string} [arg.lastId] -
781
- * @param {string} [arg.sortOn] -
782
- * @returns {Promise<AbandonedCartResponse>} - Success response
891
+ * @param {CartPlatformApplicationValidator.GetAbandonedCartParam} arg - Arg object
892
+ * @param {import("../PlatformAPIClient").Options} - Options
893
+ * @returns {Promise<CartPlatformModel.AbandonedCartResponse>} - Success response
894
+ * @name getAbandonedCart
783
895
  * @summary: Get with abandoned cart list
784
- * @description: Get abandoned cart list with pagination
896
+ * @description: Get abandoned cart list with pagination - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/cart/getAbandonedCart/).
785
897
  */
786
- async getAbandonedCart({
787
- pageNo,
788
- pageSize,
789
- fromDate,
790
- toDate,
791
- anonymousCart,
792
- lastId,
793
- sortOn,
794
- } = {}) {
795
- const { error } = CartValidator.getAbandonedCart().validate(
898
+ async getAbandonedCart(
899
+ { pageNo, pageSize, fromDate, toDate, anonymousCart, lastId, sortOn } = {},
900
+ { headers } = { headers: false }
901
+ ) {
902
+ const {
903
+ error,
904
+ } = CartPlatformApplicationValidator.getAbandonedCart().validate(
796
905
  {
797
906
  pageNo,
798
907
  pageSize,
@@ -809,7 +918,9 @@ class Cart {
809
918
  }
810
919
 
811
920
  // Showing warrnings if extra unknown parameters are found
812
- const { error: warrning } = CartValidator.getAbandonedCart().validate(
921
+ const {
922
+ error: warrning,
923
+ } = CartPlatformApplicationValidator.getAbandonedCart().validate(
813
924
  {
814
925
  pageNo,
815
926
  pageSize,
@@ -824,9 +935,8 @@ class Cart {
824
935
  if (warrning) {
825
936
  Logger({
826
937
  level: "WARN",
827
- message: "Parameter Validation warrnings for getAbandonedCart",
938
+ message: `Parameter Validation warrnings for platform > Cart > getAbandonedCart \n ${warrning}`,
828
939
  });
829
- Logger({ level: "WARN", message: warrning });
830
940
  }
831
941
 
832
942
  const query_params = {};
@@ -843,12 +953,19 @@ class Cart {
843
953
  "get",
844
954
  `/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/abandoned/carts`,
845
955
  query_params,
846
- undefined
956
+ undefined,
957
+ undefined,
958
+ { headers }
847
959
  );
848
960
 
961
+ let responseData = response;
962
+ if (headers) {
963
+ responseData = response[0];
964
+ }
965
+
849
966
  const {
850
967
  error: res_error,
851
- } = CartModel.AbandonedCartResponse().validate(response, {
968
+ } = CartPlatformModel.AbandonedCartResponse().validate(responseData, {
852
969
  abortEarly: false,
853
970
  allowUnknown: false,
854
971
  });
@@ -856,9 +973,8 @@ class Cart {
856
973
  if (res_error) {
857
974
  Logger({
858
975
  level: "WARN",
859
- message: "Response Validation Warnnings for getAbandonedCart",
976
+ message: `Response Validation Warnnings for platform > Cart > getAbandonedCart \n ${res_error}`,
860
977
  });
861
- Logger({ level: "WARN", message: res_error });
862
978
  }
863
979
 
864
980
  return response;
@@ -874,6 +990,7 @@ class Cart {
874
990
  * @param {boolean} [arg.anonymousCart] -
875
991
  * @param {string} [arg.lastId] -
876
992
  * @param {string} [arg.sortOn] -
993
+ * @returns {Paginator<CartPlatformModel.AbandonedCartResponse>}
877
994
  * @summary: Get with abandoned cart list
878
995
  * @description: Get abandoned cart list with pagination
879
996
  */
@@ -914,16 +1031,22 @@ class Cart {
914
1031
  }
915
1032
 
916
1033
  /**
917
- * @param {Object} arg - Arg object.
918
- * @param {string} [arg.id] -
919
- * @param {boolean} [arg.i] -
920
- * @param {boolean} [arg.b] -
921
- * @returns {Promise<CartDetailResponse>} - Success response
1034
+ * @param {CartPlatformApplicationValidator.GetAbandonedCartDetailsParam} arg
1035
+ * - Arg object
1036
+ *
1037
+ * @param {import("../PlatformAPIClient").Options} - Options
1038
+ * @returns {Promise<CartPlatformModel.CartDetailResponse>} - Success response
1039
+ * @name getAbandonedCartDetails
922
1040
  * @summary: Fetch all items added to the cart
923
- * @description: Use this API to get details of all the items added to a cart.
1041
+ * @description: Use this API to get details of all the items added to a cart. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/cart/getAbandonedCartDetails/).
924
1042
  */
925
- async getAbandonedCartDetails({ id, i, b } = {}) {
926
- const { error } = CartValidator.getAbandonedCartDetails().validate(
1043
+ async getAbandonedCartDetails(
1044
+ { id, i, b } = {},
1045
+ { headers } = { headers: false }
1046
+ ) {
1047
+ const {
1048
+ error,
1049
+ } = CartPlatformApplicationValidator.getAbandonedCartDetails().validate(
927
1050
  {
928
1051
  id,
929
1052
  i,
@@ -938,7 +1061,7 @@ class Cart {
938
1061
  // Showing warrnings if extra unknown parameters are found
939
1062
  const {
940
1063
  error: warrning,
941
- } = CartValidator.getAbandonedCartDetails().validate(
1064
+ } = CartPlatformApplicationValidator.getAbandonedCartDetails().validate(
942
1065
  {
943
1066
  id,
944
1067
  i,
@@ -949,9 +1072,8 @@ class Cart {
949
1072
  if (warrning) {
950
1073
  Logger({
951
1074
  level: "WARN",
952
- message: "Parameter Validation warrnings for getAbandonedCartDetails",
1075
+ message: `Parameter Validation warrnings for platform > Cart > getAbandonedCartDetails \n ${warrning}`,
953
1076
  });
954
- Logger({ level: "WARN", message: warrning });
955
1077
  }
956
1078
 
957
1079
  const query_params = {};
@@ -964,12 +1086,19 @@ class Cart {
964
1086
  "get",
965
1087
  `/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/abandoned/cart/detail`,
966
1088
  query_params,
967
- undefined
1089
+ undefined,
1090
+ undefined,
1091
+ { headers }
968
1092
  );
969
1093
 
1094
+ let responseData = response;
1095
+ if (headers) {
1096
+ responseData = response[0];
1097
+ }
1098
+
970
1099
  const {
971
1100
  error: res_error,
972
- } = CartModel.CartDetailResponse().validate(response, {
1101
+ } = CartPlatformModel.CartDetailResponse().validate(responseData, {
973
1102
  abortEarly: false,
974
1103
  allowUnknown: false,
975
1104
  });
@@ -977,39 +1106,37 @@ class Cart {
977
1106
  if (res_error) {
978
1107
  Logger({
979
1108
  level: "WARN",
980
- message: "Response Validation Warnnings for getAbandonedCartDetails",
1109
+ message: `Response Validation Warnnings for platform > Cart > getAbandonedCartDetails \n ${res_error}`,
981
1110
  });
982
- Logger({ level: "WARN", message: res_error });
983
1111
  }
984
1112
 
985
1113
  return response;
986
1114
  }
987
1115
 
988
1116
  /**
989
- * @param {Object} arg - Arg object.
990
- * @param {string} arg.id -
991
- * @param {string} [arg.cartId] -
992
- * @param {boolean} [arg.buyNow] -
993
- * @param {string} [arg.mobileNo] -
994
- * @param {string} [arg.checkoutMode] -
995
- * @param {string} [arg.tags] -
996
- * @param {boolean} [arg.isDefault] -
997
- * @param {string} [arg.userId] -
998
- * @returns {Promise<PlatformAddress>} - Success response
1117
+ * @param {CartPlatformApplicationValidator.GetAddressByIdParam} arg - Arg object
1118
+ * @param {import("../PlatformAPIClient").Options} - Options
1119
+ * @returns {Promise<CartPlatformModel.PlatformAddress>} - Success response
1120
+ * @name getAddressById
999
1121
  * @summary: Fetch a single address by its ID
1000
- * @description: Use this API to get an addresses using its ID. If successful, returns a Address resource in the response body specified in `PlatformAddress`. 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>
1122
+ * @description: Use this API to get an addresses using its ID. If successful, returns a Address resource in the response body specified in `PlatformAddress`. 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> - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/cart/getAddressById/).
1001
1123
  */
1002
- async getAddressById({
1003
- id,
1004
- cartId,
1005
- buyNow,
1006
- mobileNo,
1007
- checkoutMode,
1008
- tags,
1009
- isDefault,
1010
- userId,
1011
- } = {}) {
1012
- const { error } = CartValidator.getAddressById().validate(
1124
+ async getAddressById(
1125
+ {
1126
+ id,
1127
+ cartId,
1128
+ buyNow,
1129
+ mobileNo,
1130
+ checkoutMode,
1131
+ tags,
1132
+ isDefault,
1133
+ userId,
1134
+ } = {},
1135
+ { headers } = { headers: false }
1136
+ ) {
1137
+ const {
1138
+ error,
1139
+ } = CartPlatformApplicationValidator.getAddressById().validate(
1013
1140
  {
1014
1141
  id,
1015
1142
  cartId,
@@ -1027,7 +1154,9 @@ class Cart {
1027
1154
  }
1028
1155
 
1029
1156
  // Showing warrnings if extra unknown parameters are found
1030
- const { error: warrning } = CartValidator.getAddressById().validate(
1157
+ const {
1158
+ error: warrning,
1159
+ } = CartPlatformApplicationValidator.getAddressById().validate(
1031
1160
  {
1032
1161
  id,
1033
1162
  cartId,
@@ -1043,9 +1172,8 @@ class Cart {
1043
1172
  if (warrning) {
1044
1173
  Logger({
1045
1174
  level: "WARN",
1046
- message: "Parameter Validation warrnings for getAddressById",
1175
+ message: `Parameter Validation warrnings for platform > Cart > getAddressById \n ${warrning}`,
1047
1176
  });
1048
- Logger({ level: "WARN", message: warrning });
1049
1177
  }
1050
1178
 
1051
1179
  const query_params = {};
@@ -1062,48 +1190,47 @@ class Cart {
1062
1190
  "get",
1063
1191
  `/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/address/${id}`,
1064
1192
  query_params,
1065
- undefined
1193
+ undefined,
1194
+ undefined,
1195
+ { headers }
1066
1196
  );
1067
1197
 
1068
- const { error: res_error } = CartModel.PlatformAddress().validate(
1069
- response,
1070
- { abortEarly: false, allowUnknown: false }
1071
- );
1198
+ let responseData = response;
1199
+ if (headers) {
1200
+ responseData = response[0];
1201
+ }
1202
+
1203
+ const {
1204
+ error: res_error,
1205
+ } = CartPlatformModel.PlatformAddress().validate(responseData, {
1206
+ abortEarly: false,
1207
+ allowUnknown: false,
1208
+ });
1072
1209
 
1073
1210
  if (res_error) {
1074
1211
  Logger({
1075
1212
  level: "WARN",
1076
- message: "Response Validation Warnnings for getAddressById",
1213
+ message: `Response Validation Warnnings for platform > Cart > getAddressById \n ${res_error}`,
1077
1214
  });
1078
- Logger({ level: "WARN", message: res_error });
1079
1215
  }
1080
1216
 
1081
1217
  return response;
1082
1218
  }
1083
1219
 
1084
1220
  /**
1085
- * @param {Object} arg - Arg object.
1086
- * @param {string} [arg.cartId] -
1087
- * @param {boolean} [arg.buyNow] -
1088
- * @param {string} [arg.mobileNo] -
1089
- * @param {string} [arg.checkoutMode] -
1090
- * @param {string} [arg.tags] -
1091
- * @param {boolean} [arg.isDefault] -
1092
- * @param {string} [arg.userId] -
1093
- * @returns {Promise<PlatformGetAddressesResponse>} - Success response
1221
+ * @param {CartPlatformApplicationValidator.GetAddressesParam} arg - Arg object
1222
+ * @param {import("../PlatformAPIClient").Options} - Options
1223
+ * @returns {Promise<CartPlatformModel.PlatformGetAddressesResponse>} -
1224
+ * Success response
1225
+ * @name getAddresses
1094
1226
  * @summary: Fetch address
1095
- * @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>
1227
+ * @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> - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/cart/getAddresses/).
1096
1228
  */
1097
- async getAddresses({
1098
- cartId,
1099
- buyNow,
1100
- mobileNo,
1101
- checkoutMode,
1102
- tags,
1103
- isDefault,
1104
- userId,
1105
- } = {}) {
1106
- const { error } = CartValidator.getAddresses().validate(
1229
+ async getAddresses(
1230
+ { cartId, buyNow, mobileNo, checkoutMode, tags, isDefault, userId } = {},
1231
+ { headers } = { headers: false }
1232
+ ) {
1233
+ const { error } = CartPlatformApplicationValidator.getAddresses().validate(
1107
1234
  {
1108
1235
  cartId,
1109
1236
  buyNow,
@@ -1120,7 +1247,9 @@ class Cart {
1120
1247
  }
1121
1248
 
1122
1249
  // Showing warrnings if extra unknown parameters are found
1123
- const { error: warrning } = CartValidator.getAddresses().validate(
1250
+ const {
1251
+ error: warrning,
1252
+ } = CartPlatformApplicationValidator.getAddresses().validate(
1124
1253
  {
1125
1254
  cartId,
1126
1255
  buyNow,
@@ -1135,9 +1264,8 @@ class Cart {
1135
1264
  if (warrning) {
1136
1265
  Logger({
1137
1266
  level: "WARN",
1138
- message: "Parameter Validation warrnings for getAddresses",
1267
+ message: `Parameter Validation warrnings for platform > Cart > getAddresses \n ${warrning}`,
1139
1268
  });
1140
- Logger({ level: "WARN", message: warrning });
1141
1269
  }
1142
1270
 
1143
1271
  const query_params = {};
@@ -1154,37 +1282,43 @@ class Cart {
1154
1282
  "get",
1155
1283
  `/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/address`,
1156
1284
  query_params,
1157
- undefined
1285
+ undefined,
1286
+ undefined,
1287
+ { headers }
1158
1288
  );
1159
1289
 
1290
+ let responseData = response;
1291
+ if (headers) {
1292
+ responseData = response[0];
1293
+ }
1294
+
1160
1295
  const {
1161
1296
  error: res_error,
1162
- } = CartModel.PlatformGetAddressesResponse().validate(response, {
1163
- abortEarly: false,
1164
- allowUnknown: false,
1165
- });
1297
+ } = CartPlatformModel.PlatformGetAddressesResponse().validate(
1298
+ responseData,
1299
+ { abortEarly: false, allowUnknown: false }
1300
+ );
1166
1301
 
1167
1302
  if (res_error) {
1168
1303
  Logger({
1169
1304
  level: "WARN",
1170
- message: "Response Validation Warnnings for getAddresses",
1305
+ message: `Response Validation Warnnings for platform > Cart > getAddresses \n ${res_error}`,
1171
1306
  });
1172
- Logger({ level: "WARN", message: res_error });
1173
1307
  }
1174
1308
 
1175
1309
  return response;
1176
1310
  }
1177
1311
 
1178
1312
  /**
1179
- * @param {Object} arg - Arg object.
1180
- * @param {string} [arg.id] -
1181
- * @param {boolean} [arg.buyNow] -
1182
- * @returns {Promise<GetCouponResponse>} - Success response
1313
+ * @param {CartPlatformApplicationValidator.GetAppCouponsParam} arg - Arg object
1314
+ * @param {import("../PlatformAPIClient").Options} - Options
1315
+ * @returns {Promise<CartPlatformModel.GetCouponResponse>} - Success response
1316
+ * @name getAppCoupons
1183
1317
  * @summary: Fetch Coupon
1184
- * @description: Use this API to get a list of available coupons along with their details.
1318
+ * @description: Use this API to get a list of available coupons along with their details. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/cart/getAppCoupons/).
1185
1319
  */
1186
- async getAppCoupons({ id, buyNow } = {}) {
1187
- const { error } = CartValidator.getAppCoupons().validate(
1320
+ async getAppCoupons({ id, buyNow } = {}, { headers } = { headers: false }) {
1321
+ const { error } = CartPlatformApplicationValidator.getAppCoupons().validate(
1188
1322
  {
1189
1323
  id,
1190
1324
  buyNow,
@@ -1196,7 +1330,9 @@ class Cart {
1196
1330
  }
1197
1331
 
1198
1332
  // Showing warrnings if extra unknown parameters are found
1199
- const { error: warrning } = CartValidator.getAppCoupons().validate(
1333
+ const {
1334
+ error: warrning,
1335
+ } = CartPlatformApplicationValidator.getAppCoupons().validate(
1200
1336
  {
1201
1337
  id,
1202
1338
  buyNow,
@@ -1206,9 +1342,8 @@ class Cart {
1206
1342
  if (warrning) {
1207
1343
  Logger({
1208
1344
  level: "WARN",
1209
- message: "Parameter Validation warrnings for getAppCoupons",
1345
+ message: `Parameter Validation warrnings for platform > Cart > getAppCoupons \n ${warrning}`,
1210
1346
  });
1211
- Logger({ level: "WARN", message: warrning });
1212
1347
  }
1213
1348
 
1214
1349
  const query_params = {};
@@ -1220,12 +1355,19 @@ class Cart {
1220
1355
  "get",
1221
1356
  `/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/platform-pos-coupon`,
1222
1357
  query_params,
1223
- undefined
1358
+ undefined,
1359
+ undefined,
1360
+ { headers }
1224
1361
  );
1225
1362
 
1363
+ let responseData = response;
1364
+ if (headers) {
1365
+ responseData = response[0];
1366
+ }
1367
+
1226
1368
  const {
1227
1369
  error: res_error,
1228
- } = CartModel.GetCouponResponse().validate(response, {
1370
+ } = CartPlatformModel.GetCouponResponse().validate(responseData, {
1229
1371
  abortEarly: false,
1230
1372
  allowUnknown: false,
1231
1373
  });
@@ -1233,24 +1375,30 @@ class Cart {
1233
1375
  if (res_error) {
1234
1376
  Logger({
1235
1377
  level: "WARN",
1236
- message: "Response Validation Warnnings for getAppCoupons",
1378
+ message: `Response Validation Warnnings for platform > Cart > getAppCoupons \n ${res_error}`,
1237
1379
  });
1238
- Logger({ level: "WARN", message: res_error });
1239
1380
  }
1240
1381
 
1241
1382
  return response;
1242
1383
  }
1243
1384
 
1244
1385
  /**
1245
- * @param {Object} arg - Arg object.
1246
- * @param {string} arg.areaCode -
1247
- * @param {string} [arg.id] -
1248
- * @returns {Promise<CartDeliveryModesResponse>} - Success response
1386
+ * @param {CartPlatformApplicationValidator.GetAvailableDeliveryModesParam} arg
1387
+ * - Arg object
1388
+ *
1389
+ * @param {import("../PlatformAPIClient").Options} - Options
1390
+ * @returns {Promise<CartPlatformModel.CartDeliveryModesResponse>} - Success response
1391
+ * @name getAvailableDeliveryModes
1249
1392
  * @summary: Get available delivery modes for cart
1250
- * @description: Use this API to get the delivery modes (home-delivery/store-pickup) along with a list of pickup stores available for a given cart at a given PIN Code. User can then view the address of a pickup store with the help of store-address API.
1393
+ * @description: Use this API to get the delivery modes (home-delivery/store-pickup) along with a list of pickup stores available for a given cart at a given PIN Code. User can then view the address of a pickup store with the help of store-address API. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/cart/getAvailableDeliveryModes/).
1251
1394
  */
1252
- async getAvailableDeliveryModes({ areaCode, id } = {}) {
1253
- const { error } = CartValidator.getAvailableDeliveryModes().validate(
1395
+ async getAvailableDeliveryModes(
1396
+ { areaCode, id } = {},
1397
+ { headers } = { headers: false }
1398
+ ) {
1399
+ const {
1400
+ error,
1401
+ } = CartPlatformApplicationValidator.getAvailableDeliveryModes().validate(
1254
1402
  {
1255
1403
  areaCode,
1256
1404
  id,
@@ -1264,7 +1412,7 @@ class Cart {
1264
1412
  // Showing warrnings if extra unknown parameters are found
1265
1413
  const {
1266
1414
  error: warrning,
1267
- } = CartValidator.getAvailableDeliveryModes().validate(
1415
+ } = CartPlatformApplicationValidator.getAvailableDeliveryModes().validate(
1268
1416
  {
1269
1417
  areaCode,
1270
1418
  id,
@@ -1274,9 +1422,8 @@ class Cart {
1274
1422
  if (warrning) {
1275
1423
  Logger({
1276
1424
  level: "WARN",
1277
- message: "Parameter Validation warrnings for getAvailableDeliveryModes",
1425
+ message: `Parameter Validation warrnings for platform > Cart > getAvailableDeliveryModes \n ${warrning}`,
1278
1426
  });
1279
- Logger({ level: "WARN", message: warrning });
1280
1427
  }
1281
1428
 
1282
1429
  const query_params = {};
@@ -1288,12 +1435,19 @@ class Cart {
1288
1435
  "get",
1289
1436
  `/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/available-delivery-mode`,
1290
1437
  query_params,
1291
- undefined
1438
+ undefined,
1439
+ undefined,
1440
+ { headers }
1292
1441
  );
1293
1442
 
1443
+ let responseData = response;
1444
+ if (headers) {
1445
+ responseData = response[0];
1446
+ }
1447
+
1294
1448
  const {
1295
1449
  error: res_error,
1296
- } = CartModel.CartDeliveryModesResponse().validate(response, {
1450
+ } = CartPlatformModel.CartDeliveryModesResponse().validate(responseData, {
1297
1451
  abortEarly: false,
1298
1452
  allowUnknown: false,
1299
1453
  });
@@ -1301,28 +1455,26 @@ class Cart {
1301
1455
  if (res_error) {
1302
1456
  Logger({
1303
1457
  level: "WARN",
1304
- message: "Response Validation Warnnings for getAvailableDeliveryModes",
1458
+ message: `Response Validation Warnnings for platform > Cart > getAvailableDeliveryModes \n ${res_error}`,
1305
1459
  });
1306
- Logger({ level: "WARN", message: res_error });
1307
1460
  }
1308
1461
 
1309
1462
  return response;
1310
1463
  }
1311
1464
 
1312
1465
  /**
1313
- * @param {Object} arg - Arg object.
1314
- * @param {string} [arg.id] -
1315
- * @param {string} [arg.userId] -
1316
- * @param {boolean} [arg.i] -
1317
- * @param {boolean} [arg.b] -
1318
- * @param {number} [arg.assignCardId] -
1319
- * @param {boolean} [arg.buyNow] -
1320
- * @returns {Promise<CartDetailResponse>} - Success response
1466
+ * @param {CartPlatformApplicationValidator.GetCartParam} arg - Arg object
1467
+ * @param {import("../PlatformAPIClient").Options} - Options
1468
+ * @returns {Promise<CartPlatformModel.CartDetailResponse>} - Success response
1469
+ * @name getCart
1321
1470
  * @summary: Fetch all items added to the customer cart using cart id
1322
- * @description: Use this API to get details of all the items added to a cart.
1471
+ * @description: Use this API to get details of all the items added to a cart. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/cart/getCart/).
1323
1472
  */
1324
- async getCart({ id, userId, i, b, assignCardId, buyNow } = {}) {
1325
- const { error } = CartValidator.getCart().validate(
1473
+ async getCart(
1474
+ { id, userId, i, b, assignCardId, buyNow } = {},
1475
+ { headers } = { headers: false }
1476
+ ) {
1477
+ const { error } = CartPlatformApplicationValidator.getCart().validate(
1326
1478
  {
1327
1479
  id,
1328
1480
  userId,
@@ -1338,7 +1490,9 @@ class Cart {
1338
1490
  }
1339
1491
 
1340
1492
  // Showing warrnings if extra unknown parameters are found
1341
- const { error: warrning } = CartValidator.getCart().validate(
1493
+ const {
1494
+ error: warrning,
1495
+ } = CartPlatformApplicationValidator.getCart().validate(
1342
1496
  {
1343
1497
  id,
1344
1498
  userId,
@@ -1352,9 +1506,8 @@ class Cart {
1352
1506
  if (warrning) {
1353
1507
  Logger({
1354
1508
  level: "WARN",
1355
- message: "Parameter Validation warrnings for getCart",
1509
+ message: `Parameter Validation warrnings for platform > Cart > getCart \n ${warrning}`,
1356
1510
  });
1357
- Logger({ level: "WARN", message: warrning });
1358
1511
  }
1359
1512
 
1360
1513
  const query_params = {};
@@ -1370,12 +1523,19 @@ class Cart {
1370
1523
  "get",
1371
1524
  `/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/detail`,
1372
1525
  query_params,
1373
- undefined
1526
+ undefined,
1527
+ undefined,
1528
+ { headers }
1374
1529
  );
1375
1530
 
1531
+ let responseData = response;
1532
+ if (headers) {
1533
+ responseData = response[0];
1534
+ }
1535
+
1376
1536
  const {
1377
1537
  error: res_error,
1378
- } = CartModel.CartDetailResponse().validate(response, {
1538
+ } = CartPlatformModel.CartDetailResponse().validate(responseData, {
1379
1539
  abortEarly: false,
1380
1540
  allowUnknown: false,
1381
1541
  });
@@ -1383,25 +1543,26 @@ class Cart {
1383
1543
  if (res_error) {
1384
1544
  Logger({
1385
1545
  level: "WARN",
1386
- message: "Response Validation Warnnings for getCart",
1546
+ message: `Response Validation Warnnings for platform > Cart > getCart \n ${res_error}`,
1387
1547
  });
1388
- Logger({ level: "WARN", message: res_error });
1389
1548
  }
1390
1549
 
1391
1550
  return response;
1392
1551
  }
1393
1552
 
1394
1553
  /**
1395
- * @param {Object} arg - Arg object.
1396
- * @param {string} [arg.fromDate] -
1397
- * @param {string} [arg.toDate] -
1398
- * @param {string} [arg.filterOn] -
1399
- * @returns {Promise<MultiCartResponse>} - Success response
1554
+ * @param {CartPlatformApplicationValidator.GetCartListParam} arg - Arg object
1555
+ * @param {import("../PlatformAPIClient").Options} - Options
1556
+ * @returns {Promise<CartPlatformModel.MultiCartResponse>} - Success response
1557
+ * @name getCartList
1400
1558
  * @summary: Get cart list for store os user
1401
- * @description: Get all carts for the store os user which is created for customer
1559
+ * @description: Get all carts for the store os user which is created for customer - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/cart/getCartList/).
1402
1560
  */
1403
- async getCartList({ fromDate, toDate, filterOn } = {}) {
1404
- const { error } = CartValidator.getCartList().validate(
1561
+ async getCartList(
1562
+ { fromDate, toDate, filterOn } = {},
1563
+ { headers } = { headers: false }
1564
+ ) {
1565
+ const { error } = CartPlatformApplicationValidator.getCartList().validate(
1405
1566
  {
1406
1567
  fromDate,
1407
1568
  toDate,
@@ -1414,7 +1575,9 @@ class Cart {
1414
1575
  }
1415
1576
 
1416
1577
  // Showing warrnings if extra unknown parameters are found
1417
- const { error: warrning } = CartValidator.getCartList().validate(
1578
+ const {
1579
+ error: warrning,
1580
+ } = CartPlatformApplicationValidator.getCartList().validate(
1418
1581
  {
1419
1582
  fromDate,
1420
1583
  toDate,
@@ -1425,9 +1588,8 @@ class Cart {
1425
1588
  if (warrning) {
1426
1589
  Logger({
1427
1590
  level: "WARN",
1428
- message: "Parameter Validation warrnings for getCartList",
1591
+ message: `Parameter Validation warrnings for platform > Cart > getCartList \n ${warrning}`,
1429
1592
  });
1430
- Logger({ level: "WARN", message: warrning });
1431
1593
  }
1432
1594
 
1433
1595
  const query_params = {};
@@ -1440,12 +1602,19 @@ class Cart {
1440
1602
  "get",
1441
1603
  `/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/cart-list`,
1442
1604
  query_params,
1443
- undefined
1605
+ undefined,
1606
+ undefined,
1607
+ { headers }
1444
1608
  );
1445
1609
 
1610
+ let responseData = response;
1611
+ if (headers) {
1612
+ responseData = response[0];
1613
+ }
1614
+
1446
1615
  const {
1447
1616
  error: res_error,
1448
- } = CartModel.MultiCartResponse().validate(response, {
1617
+ } = CartPlatformModel.MultiCartResponse().validate(responseData, {
1449
1618
  abortEarly: false,
1450
1619
  allowUnknown: false,
1451
1620
  });
@@ -1453,23 +1622,25 @@ class Cart {
1453
1622
  if (res_error) {
1454
1623
  Logger({
1455
1624
  level: "WARN",
1456
- message: "Response Validation Warnnings for getCartList",
1625
+ message: `Response Validation Warnnings for platform > Cart > getCartList \n ${res_error}`,
1457
1626
  });
1458
- Logger({ level: "WARN", message: res_error });
1459
1627
  }
1460
1628
 
1461
1629
  return response;
1462
1630
  }
1463
1631
 
1464
1632
  /**
1465
- * @param {Object} arg - Arg object.
1466
- * @param {GetShareCartLinkRequest} arg.body
1467
- * @returns {Promise<GetShareCartLinkResponse>} - Success response
1633
+ * @param {CartPlatformApplicationValidator.GetCartShareLinkParam} arg - Arg object
1634
+ * @param {import("../PlatformAPIClient").Options} - Options
1635
+ * @returns {Promise<CartPlatformModel.GetShareCartLinkResponse>} - Success response
1636
+ * @name getCartShareLink
1468
1637
  * @summary: Generate token for sharing the cart
1469
- * @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.
1638
+ * @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. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/cart/getCartShareLink/).
1470
1639
  */
1471
- async getCartShareLink({ body } = {}) {
1472
- const { error } = CartValidator.getCartShareLink().validate(
1640
+ async getCartShareLink({ body } = {}, { headers } = { headers: false }) {
1641
+ const {
1642
+ error,
1643
+ } = CartPlatformApplicationValidator.getCartShareLink().validate(
1473
1644
  {
1474
1645
  body,
1475
1646
  },
@@ -1480,7 +1651,9 @@ class Cart {
1480
1651
  }
1481
1652
 
1482
1653
  // Showing warrnings if extra unknown parameters are found
1483
- const { error: warrning } = CartValidator.getCartShareLink().validate(
1654
+ const {
1655
+ error: warrning,
1656
+ } = CartPlatformApplicationValidator.getCartShareLink().validate(
1484
1657
  {
1485
1658
  body,
1486
1659
  },
@@ -1489,9 +1662,8 @@ class Cart {
1489
1662
  if (warrning) {
1490
1663
  Logger({
1491
1664
  level: "WARN",
1492
- message: "Parameter Validation warrnings for getCartShareLink",
1665
+ message: `Parameter Validation warrnings for platform > Cart > getCartShareLink \n ${warrning}`,
1493
1666
  });
1494
- Logger({ level: "WARN", message: warrning });
1495
1667
  }
1496
1668
 
1497
1669
  const query_params = {};
@@ -1501,12 +1673,19 @@ class Cart {
1501
1673
  "post",
1502
1674
  `/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/share-cart`,
1503
1675
  query_params,
1504
- body
1676
+ body,
1677
+ undefined,
1678
+ { headers }
1505
1679
  );
1506
1680
 
1681
+ let responseData = response;
1682
+ if (headers) {
1683
+ responseData = response[0];
1684
+ }
1685
+
1507
1686
  const {
1508
1687
  error: res_error,
1509
- } = CartModel.GetShareCartLinkResponse().validate(response, {
1688
+ } = CartPlatformModel.GetShareCartLinkResponse().validate(responseData, {
1510
1689
  abortEarly: false,
1511
1690
  allowUnknown: false,
1512
1691
  });
@@ -1514,23 +1693,25 @@ class Cart {
1514
1693
  if (res_error) {
1515
1694
  Logger({
1516
1695
  level: "WARN",
1517
- message: "Response Validation Warnnings for getCartShareLink",
1696
+ message: `Response Validation Warnnings for platform > Cart > getCartShareLink \n ${res_error}`,
1518
1697
  });
1519
- Logger({ level: "WARN", message: res_error });
1520
1698
  }
1521
1699
 
1522
1700
  return response;
1523
1701
  }
1524
1702
 
1525
1703
  /**
1526
- * @param {Object} arg - Arg object.
1527
- * @param {string} arg.token - Token of the shared short link
1528
- * @returns {Promise<SharedCartResponse>} - Success response
1704
+ * @param {CartPlatformApplicationValidator.GetCartSharedItemsParam} arg - Arg object
1705
+ * @param {import("../PlatformAPIClient").Options} - Options
1706
+ * @returns {Promise<CartPlatformModel.SharedCartResponse>} - Success response
1707
+ * @name getCartSharedItems
1529
1708
  * @summary: Get details of a shared cart
1530
- * @description: Use this API to get the shared cart details as per the token generated using the share-cart API.
1709
+ * @description: Use this API to get the shared cart details as per the token generated using the share-cart API. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/cart/getCartSharedItems/).
1531
1710
  */
1532
- async getCartSharedItems({ token } = {}) {
1533
- const { error } = CartValidator.getCartSharedItems().validate(
1711
+ async getCartSharedItems({ token } = {}, { headers } = { headers: false }) {
1712
+ const {
1713
+ error,
1714
+ } = CartPlatformApplicationValidator.getCartSharedItems().validate(
1534
1715
  {
1535
1716
  token,
1536
1717
  },
@@ -1541,7 +1722,9 @@ class Cart {
1541
1722
  }
1542
1723
 
1543
1724
  // Showing warrnings if extra unknown parameters are found
1544
- const { error: warrning } = CartValidator.getCartSharedItems().validate(
1725
+ const {
1726
+ error: warrning,
1727
+ } = CartPlatformApplicationValidator.getCartSharedItems().validate(
1545
1728
  {
1546
1729
  token,
1547
1730
  },
@@ -1550,9 +1733,8 @@ class Cart {
1550
1733
  if (warrning) {
1551
1734
  Logger({
1552
1735
  level: "WARN",
1553
- message: "Parameter Validation warrnings for getCartSharedItems",
1736
+ message: `Parameter Validation warrnings for platform > Cart > getCartSharedItems \n ${warrning}`,
1554
1737
  });
1555
- Logger({ level: "WARN", message: warrning });
1556
1738
  }
1557
1739
 
1558
1740
  const query_params = {};
@@ -1562,12 +1744,19 @@ class Cart {
1562
1744
  "get",
1563
1745
  `/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/share-cart/${token}`,
1564
1746
  query_params,
1565
- undefined
1747
+ undefined,
1748
+ undefined,
1749
+ { headers }
1566
1750
  );
1567
1751
 
1752
+ let responseData = response;
1753
+ if (headers) {
1754
+ responseData = response[0];
1755
+ }
1756
+
1568
1757
  const {
1569
1758
  error: res_error,
1570
- } = CartModel.SharedCartResponse().validate(response, {
1759
+ } = CartPlatformModel.SharedCartResponse().validate(responseData, {
1571
1760
  abortEarly: false,
1572
1761
  allowUnknown: false,
1573
1762
  });
@@ -1575,23 +1764,23 @@ class Cart {
1575
1764
  if (res_error) {
1576
1765
  Logger({
1577
1766
  level: "WARN",
1578
- message: "Response Validation Warnnings for getCartSharedItems",
1767
+ message: `Response Validation Warnnings for platform > Cart > getCartSharedItems \n ${res_error}`,
1579
1768
  });
1580
- Logger({ level: "WARN", message: res_error });
1581
1769
  }
1582
1770
 
1583
1771
  return response;
1584
1772
  }
1585
1773
 
1586
1774
  /**
1587
- * @param {Object} arg - Arg object.
1588
- * @param {string} arg.id -
1589
- * @returns {Promise<CouponUpdate>} - Success response
1775
+ * @param {CartPlatformApplicationValidator.GetCouponByIdParam} arg - Arg object
1776
+ * @param {import("../PlatformAPIClient").Options} - Options
1777
+ * @returns {Promise<CartPlatformModel.CouponUpdate>} - Success response
1778
+ * @name getCouponById
1590
1779
  * @summary: Get with single coupon details or coupon list
1591
- * @description: Get single coupon details with `id` in path param
1780
+ * @description: Get single coupon details with `id` in path param - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/cart/getCouponById/).
1592
1781
  */
1593
- async getCouponById({ id } = {}) {
1594
- const { error } = CartValidator.getCouponById().validate(
1782
+ async getCouponById({ id } = {}, { headers } = { headers: false }) {
1783
+ const { error } = CartPlatformApplicationValidator.getCouponById().validate(
1595
1784
  {
1596
1785
  id,
1597
1786
  },
@@ -1602,7 +1791,9 @@ class Cart {
1602
1791
  }
1603
1792
 
1604
1793
  // Showing warrnings if extra unknown parameters are found
1605
- const { error: warrning } = CartValidator.getCouponById().validate(
1794
+ const {
1795
+ error: warrning,
1796
+ } = CartPlatformApplicationValidator.getCouponById().validate(
1606
1797
  {
1607
1798
  id,
1608
1799
  },
@@ -1611,9 +1802,8 @@ class Cart {
1611
1802
  if (warrning) {
1612
1803
  Logger({
1613
1804
  level: "WARN",
1614
- message: "Parameter Validation warrnings for getCouponById",
1805
+ message: `Parameter Validation warrnings for platform > Cart > getCouponById \n ${warrning}`,
1615
1806
  });
1616
- Logger({ level: "WARN", message: warrning });
1617
1807
  }
1618
1808
 
1619
1809
  const query_params = {};
@@ -1623,10 +1813,19 @@ class Cart {
1623
1813
  "get",
1624
1814
  `/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/coupon/${id}`,
1625
1815
  query_params,
1626
- undefined
1816
+ undefined,
1817
+ undefined,
1818
+ { headers }
1627
1819
  );
1628
1820
 
1629
- const { error: res_error } = CartModel.CouponUpdate().validate(response, {
1821
+ let responseData = response;
1822
+ if (headers) {
1823
+ responseData = response[0];
1824
+ }
1825
+
1826
+ const {
1827
+ error: res_error,
1828
+ } = CartPlatformModel.CouponUpdate().validate(responseData, {
1630
1829
  abortEarly: false,
1631
1830
  allowUnknown: false,
1632
1831
  });
@@ -1634,23 +1833,25 @@ class Cart {
1634
1833
  if (res_error) {
1635
1834
  Logger({
1636
1835
  level: "WARN",
1637
- message: "Response Validation Warnnings for getCouponById",
1836
+ message: `Response Validation Warnnings for platform > Cart > getCouponById \n ${res_error}`,
1638
1837
  });
1639
- Logger({ level: "WARN", message: res_error });
1640
1838
  }
1641
1839
 
1642
1840
  return response;
1643
1841
  }
1644
1842
 
1645
1843
  /**
1646
- * @param {Object} arg - Arg object.
1647
- * @param {string} [arg.code] -
1844
+ * @param {CartPlatformApplicationValidator.GetCouponCodeExistsParam} arg - Arg object
1845
+ * @param {import("../PlatformAPIClient").Options} - Options
1648
1846
  * @returns {Promise<Object>} - Success response
1847
+ * @name getCouponCodeExists
1649
1848
  * @summary: Check if coupon is already created with coupon code
1650
- * @description: Check if sent coupon code is already existing coupon code. As coupon code is to be unique.
1849
+ * @description: Check if sent coupon code is already existing coupon code. As coupon code is to be unique. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/cart/getCouponCodeExists/).
1651
1850
  */
1652
- async getCouponCodeExists({ code } = {}) {
1653
- const { error } = CartValidator.getCouponCodeExists().validate(
1851
+ async getCouponCodeExists({ code } = {}, { headers } = { headers: false }) {
1852
+ const {
1853
+ error,
1854
+ } = CartPlatformApplicationValidator.getCouponCodeExists().validate(
1654
1855
  {
1655
1856
  code,
1656
1857
  },
@@ -1661,7 +1862,9 @@ class Cart {
1661
1862
  }
1662
1863
 
1663
1864
  // Showing warrnings if extra unknown parameters are found
1664
- const { error: warrning } = CartValidator.getCouponCodeExists().validate(
1865
+ const {
1866
+ error: warrning,
1867
+ } = CartPlatformApplicationValidator.getCouponCodeExists().validate(
1665
1868
  {
1666
1869
  code,
1667
1870
  },
@@ -1670,9 +1873,8 @@ class Cart {
1670
1873
  if (warrning) {
1671
1874
  Logger({
1672
1875
  level: "WARN",
1673
- message: "Parameter Validation warrnings for getCouponCodeExists",
1876
+ message: `Parameter Validation warrnings for platform > Cart > getCouponCodeExists \n ${warrning}`,
1674
1877
  });
1675
- Logger({ level: "WARN", message: warrning });
1676
1878
  }
1677
1879
 
1678
1880
  const query_params = {};
@@ -1683,10 +1885,17 @@ class Cart {
1683
1885
  "get",
1684
1886
  `/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/coupon_code_exists`,
1685
1887
  query_params,
1686
- undefined
1888
+ undefined,
1889
+ undefined,
1890
+ { headers }
1687
1891
  );
1688
1892
 
1689
- const { error: res_error } = Joi.any().validate(response, {
1893
+ let responseData = response;
1894
+ if (headers) {
1895
+ responseData = response[0];
1896
+ }
1897
+
1898
+ const { error: res_error } = Joi.any().validate(responseData, {
1690
1899
  abortEarly: false,
1691
1900
  allowUnknown: false,
1692
1901
  });
@@ -1694,22 +1903,24 @@ class Cart {
1694
1903
  if (res_error) {
1695
1904
  Logger({
1696
1905
  level: "WARN",
1697
- message: "Response Validation Warnnings for getCouponCodeExists",
1906
+ message: `Response Validation Warnnings for platform > Cart > getCouponCodeExists \n ${res_error}`,
1698
1907
  });
1699
- Logger({ level: "WARN", message: res_error });
1700
1908
  }
1701
1909
 
1702
1910
  return response;
1703
1911
  }
1704
1912
 
1705
1913
  /**
1706
- * @param {Object} arg - Arg object.
1914
+ * @param {import("../PlatformAPIClient").Options} - Options
1707
1915
  * @returns {Promise<Object>} - Success response
1916
+ * @name getCouponOptionValues
1708
1917
  * @summary: Get coupon options enums with display values
1709
- * @description: Get coupon enum values for fields in valid coupon object. Used for front end to create, update and filter coupon lists via fields
1918
+ * @description: Get coupon enum values for fields in valid coupon object. Used for front end to create, update and filter coupon lists via fields - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/cart/getCouponOptionValues/).
1710
1919
  */
1711
- async getCouponOptionValues({} = {}) {
1712
- const { error } = CartValidator.getCouponOptionValues().validate(
1920
+ async getCouponOptionValues({ headers } = { headers: false }) {
1921
+ const {
1922
+ error,
1923
+ } = CartPlatformApplicationValidator.getCouponOptionValues().validate(
1713
1924
  {},
1714
1925
  { abortEarly: false, allowUnknown: true }
1715
1926
  );
@@ -1718,16 +1929,17 @@ class Cart {
1718
1929
  }
1719
1930
 
1720
1931
  // Showing warrnings if extra unknown parameters are found
1721
- const { error: warrning } = CartValidator.getCouponOptionValues().validate(
1932
+ const {
1933
+ error: warrning,
1934
+ } = CartPlatformApplicationValidator.getCouponOptionValues().validate(
1722
1935
  {},
1723
1936
  { abortEarly: false, allowUnknown: false }
1724
1937
  );
1725
1938
  if (warrning) {
1726
1939
  Logger({
1727
1940
  level: "WARN",
1728
- message: "Parameter Validation warrnings for getCouponOptionValues",
1941
+ message: `Parameter Validation warrnings for platform > Cart > getCouponOptionValues \n ${warrning}`,
1729
1942
  });
1730
- Logger({ level: "WARN", message: warrning });
1731
1943
  }
1732
1944
 
1733
1945
  const query_params = {};
@@ -1737,10 +1949,17 @@ class Cart {
1737
1949
  "get",
1738
1950
  `/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/coupon_options`,
1739
1951
  query_params,
1740
- undefined
1952
+ undefined,
1953
+ undefined,
1954
+ { headers }
1741
1955
  );
1742
1956
 
1743
- const { error: res_error } = Joi.any().validate(response, {
1957
+ let responseData = response;
1958
+ if (headers) {
1959
+ responseData = response[0];
1960
+ }
1961
+
1962
+ const { error: res_error } = Joi.any().validate(responseData, {
1744
1963
  abortEarly: false,
1745
1964
  allowUnknown: false,
1746
1965
  });
@@ -1748,39 +1967,35 @@ class Cart {
1748
1967
  if (res_error) {
1749
1968
  Logger({
1750
1969
  level: "WARN",
1751
- message: "Response Validation Warnnings for getCouponOptionValues",
1970
+ message: `Response Validation Warnnings for platform > Cart > getCouponOptionValues \n ${res_error}`,
1752
1971
  });
1753
- Logger({ level: "WARN", message: res_error });
1754
1972
  }
1755
1973
 
1756
1974
  return response;
1757
1975
  }
1758
1976
 
1759
1977
  /**
1760
- * @param {Object} arg - Arg object.
1761
- * @param {number} [arg.pageNo] -
1762
- * @param {number} [arg.pageSize] -
1763
- * @param {boolean} [arg.isArchived] -
1764
- * @param {string} [arg.title] -
1765
- * @param {boolean} [arg.isPublic] -
1766
- * @param {boolean} [arg.isDisplay] -
1767
- * @param {string} [arg.typeSlug] -
1768
- * @param {string} [arg.code] -
1769
- * @returns {Promise<CouponsResponse>} - Success response
1978
+ * @param {CartPlatformApplicationValidator.GetCouponsParam} arg - Arg object
1979
+ * @param {import("../PlatformAPIClient").Options} - Options
1980
+ * @returns {Promise<CartPlatformModel.CouponsResponse>} - Success response
1981
+ * @name getCoupons
1770
1982
  * @summary: Get with single coupon details or coupon list
1771
- * @description: Get coupon list with pagination
1983
+ * @description: Get coupon list with pagination - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/cart/getCoupons/).
1772
1984
  */
1773
- async getCoupons({
1774
- pageNo,
1775
- pageSize,
1776
- isArchived,
1777
- title,
1778
- isPublic,
1779
- isDisplay,
1780
- typeSlug,
1781
- code,
1782
- } = {}) {
1783
- const { error } = CartValidator.getCoupons().validate(
1985
+ async getCoupons(
1986
+ {
1987
+ pageNo,
1988
+ pageSize,
1989
+ isArchived,
1990
+ title,
1991
+ isPublic,
1992
+ isDisplay,
1993
+ typeSlug,
1994
+ code,
1995
+ } = {},
1996
+ { headers } = { headers: false }
1997
+ ) {
1998
+ const { error } = CartPlatformApplicationValidator.getCoupons().validate(
1784
1999
  {
1785
2000
  pageNo,
1786
2001
  pageSize,
@@ -1798,7 +2013,9 @@ class Cart {
1798
2013
  }
1799
2014
 
1800
2015
  // Showing warrnings if extra unknown parameters are found
1801
- const { error: warrning } = CartValidator.getCoupons().validate(
2016
+ const {
2017
+ error: warrning,
2018
+ } = CartPlatformApplicationValidator.getCoupons().validate(
1802
2019
  {
1803
2020
  pageNo,
1804
2021
  pageSize,
@@ -1814,9 +2031,8 @@ class Cart {
1814
2031
  if (warrning) {
1815
2032
  Logger({
1816
2033
  level: "WARN",
1817
- message: "Parameter Validation warrnings for getCoupons",
2034
+ message: `Parameter Validation warrnings for platform > Cart > getCoupons \n ${warrning}`,
1818
2035
  });
1819
- Logger({ level: "WARN", message: warrning });
1820
2036
  }
1821
2037
 
1822
2038
  const query_params = {};
@@ -1834,20 +2050,28 @@ class Cart {
1834
2050
  "get",
1835
2051
  `/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/coupon`,
1836
2052
  query_params,
1837
- undefined
2053
+ undefined,
2054
+ undefined,
2055
+ { headers }
1838
2056
  );
1839
2057
 
1840
- const { error: res_error } = CartModel.CouponsResponse().validate(
1841
- response,
1842
- { abortEarly: false, allowUnknown: false }
1843
- );
2058
+ let responseData = response;
2059
+ if (headers) {
2060
+ responseData = response[0];
2061
+ }
2062
+
2063
+ const {
2064
+ error: res_error,
2065
+ } = CartPlatformModel.CouponsResponse().validate(responseData, {
2066
+ abortEarly: false,
2067
+ allowUnknown: false,
2068
+ });
1844
2069
 
1845
2070
  if (res_error) {
1846
2071
  Logger({
1847
2072
  level: "WARN",
1848
- message: "Response Validation Warnnings for getCoupons",
2073
+ message: `Response Validation Warnnings for platform > Cart > getCoupons \n ${res_error}`,
1849
2074
  });
1850
- Logger({ level: "WARN", message: res_error });
1851
2075
  }
1852
2076
 
1853
2077
  return response;
@@ -1864,6 +2088,7 @@ class Cart {
1864
2088
  * @param {boolean} [arg.isDisplay] -
1865
2089
  * @param {string} [arg.typeSlug] -
1866
2090
  * @param {string} [arg.code] -
2091
+ * @returns {Paginator<CartPlatformModel.CouponsResponse>}
1867
2092
  * @summary: Get with single coupon details or coupon list
1868
2093
  * @description: Get coupon list with pagination
1869
2094
  */
@@ -1906,15 +2131,15 @@ class Cart {
1906
2131
  }
1907
2132
 
1908
2133
  /**
1909
- * @param {Object} arg - Arg object.
1910
- * @param {string} [arg.id] - The unique identifier of the cart.
1911
- * @param {boolean} [arg.buyNow] -
1912
- * @returns {Promise<CartItemCountResponse>} - Success response
2134
+ * @param {CartPlatformApplicationValidator.GetItemCountParam} arg - Arg object
2135
+ * @param {import("../PlatformAPIClient").Options} - Options
2136
+ * @returns {Promise<CartPlatformModel.CartItemCountResponse>} - Success response
2137
+ * @name getItemCount
1913
2138
  * @summary: Count items in the customer's cart
1914
- * @description: Use this API to get the total number of items present in cart.
2139
+ * @description: Use this API to get the total number of items present in cart. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/cart/getItemCount/).
1915
2140
  */
1916
- async getItemCount({ id, buyNow } = {}) {
1917
- const { error } = CartValidator.getItemCount().validate(
2141
+ async getItemCount({ id, buyNow } = {}, { headers } = { headers: false }) {
2142
+ const { error } = CartPlatformApplicationValidator.getItemCount().validate(
1918
2143
  {
1919
2144
  id,
1920
2145
  buyNow,
@@ -1926,7 +2151,9 @@ class Cart {
1926
2151
  }
1927
2152
 
1928
2153
  // Showing warrnings if extra unknown parameters are found
1929
- const { error: warrning } = CartValidator.getItemCount().validate(
2154
+ const {
2155
+ error: warrning,
2156
+ } = CartPlatformApplicationValidator.getItemCount().validate(
1930
2157
  {
1931
2158
  id,
1932
2159
  buyNow,
@@ -1936,9 +2163,8 @@ class Cart {
1936
2163
  if (warrning) {
1937
2164
  Logger({
1938
2165
  level: "WARN",
1939
- message: "Parameter Validation warrnings for getItemCount",
2166
+ message: `Parameter Validation warrnings for platform > Cart > getItemCount \n ${warrning}`,
1940
2167
  });
1941
- Logger({ level: "WARN", message: warrning });
1942
2168
  }
1943
2169
 
1944
2170
  const query_params = {};
@@ -1950,12 +2176,19 @@ class Cart {
1950
2176
  "get",
1951
2177
  `/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/basic`,
1952
2178
  query_params,
1953
- undefined
2179
+ undefined,
2180
+ undefined,
2181
+ { headers }
1954
2182
  );
1955
2183
 
2184
+ let responseData = response;
2185
+ if (headers) {
2186
+ responseData = response[0];
2187
+ }
2188
+
1956
2189
  const {
1957
2190
  error: res_error,
1958
- } = CartModel.CartItemCountResponse().validate(response, {
2191
+ } = CartPlatformModel.CartItemCountResponse().validate(responseData, {
1959
2192
  abortEarly: false,
1960
2193
  allowUnknown: false,
1961
2194
  });
@@ -1963,24 +2196,30 @@ class Cart {
1963
2196
  if (res_error) {
1964
2197
  Logger({
1965
2198
  level: "WARN",
1966
- message: "Response Validation Warnnings for getItemCount",
2199
+ message: `Response Validation Warnnings for platform > Cart > getItemCount \n ${res_error}`,
1967
2200
  });
1968
- Logger({ level: "WARN", message: res_error });
1969
2201
  }
1970
2202
 
1971
2203
  return response;
1972
2204
  }
1973
2205
 
1974
2206
  /**
1975
- * @param {Object} arg - Arg object.
1976
- * @param {string} [arg.entityType] - Entity_type as promotion or coupon
1977
- * @param {boolean} [arg.isHidden] - Promo-coupon config shown or not
1978
- * @returns {Promise<ActivePromosResponse>} - Success response
2207
+ * @param {CartPlatformApplicationValidator.GetPromosCouponConfigParam} arg
2208
+ * - Arg object
2209
+ *
2210
+ * @param {import("../PlatformAPIClient").Options} - Options
2211
+ * @returns {Promise<CartPlatformModel.ActivePromosResponse>} - Success response
2212
+ * @name getPromosCouponConfig
1979
2213
  * @summary: Fetch all promos that are set as active
1980
- * @description: Use this API to get list of all the active promos/coupons.
2214
+ * @description: Use this API to get list of all the active promos/coupons. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/cart/getPromosCouponConfig/).
1981
2215
  */
1982
- async getPromosCouponConfig({ entityType, isHidden } = {}) {
1983
- const { error } = CartValidator.getPromosCouponConfig().validate(
2216
+ async getPromosCouponConfig(
2217
+ { entityType, isHidden } = {},
2218
+ { headers } = { headers: false }
2219
+ ) {
2220
+ const {
2221
+ error,
2222
+ } = CartPlatformApplicationValidator.getPromosCouponConfig().validate(
1984
2223
  {
1985
2224
  entityType,
1986
2225
  isHidden,
@@ -1992,7 +2231,9 @@ class Cart {
1992
2231
  }
1993
2232
 
1994
2233
  // Showing warrnings if extra unknown parameters are found
1995
- const { error: warrning } = CartValidator.getPromosCouponConfig().validate(
2234
+ const {
2235
+ error: warrning,
2236
+ } = CartPlatformApplicationValidator.getPromosCouponConfig().validate(
1996
2237
  {
1997
2238
  entityType,
1998
2239
  isHidden,
@@ -2002,9 +2243,8 @@ class Cart {
2002
2243
  if (warrning) {
2003
2244
  Logger({
2004
2245
  level: "WARN",
2005
- message: "Parameter Validation warrnings for getPromosCouponConfig",
2246
+ message: `Parameter Validation warrnings for platform > Cart > getPromosCouponConfig \n ${warrning}`,
2006
2247
  });
2007
- Logger({ level: "WARN", message: warrning });
2008
2248
  }
2009
2249
 
2010
2250
  const query_params = {};
@@ -2016,12 +2256,19 @@ class Cart {
2016
2256
  "get",
2017
2257
  `/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/promo-coupons`,
2018
2258
  query_params,
2019
- undefined
2259
+ undefined,
2260
+ undefined,
2261
+ { headers }
2020
2262
  );
2021
2263
 
2264
+ let responseData = response;
2265
+ if (headers) {
2266
+ responseData = response[0];
2267
+ }
2268
+
2022
2269
  const {
2023
2270
  error: res_error,
2024
- } = CartModel.ActivePromosResponse().validate(response, {
2271
+ } = CartPlatformModel.ActivePromosResponse().validate(responseData, {
2025
2272
  abortEarly: false,
2026
2273
  allowUnknown: false,
2027
2274
  });
@@ -2029,23 +2276,25 @@ class Cart {
2029
2276
  if (res_error) {
2030
2277
  Logger({
2031
2278
  level: "WARN",
2032
- message: "Response Validation Warnnings for getPromosCouponConfig",
2279
+ message: `Response Validation Warnnings for platform > Cart > getPromosCouponConfig \n ${res_error}`,
2033
2280
  });
2034
- Logger({ level: "WARN", message: res_error });
2035
2281
  }
2036
2282
 
2037
2283
  return response;
2038
2284
  }
2039
2285
 
2040
2286
  /**
2041
- * @param {Object} arg - Arg object.
2042
- * @param {string} arg.id -
2043
- * @returns {Promise<PromotionUpdate>} - Success response
2287
+ * @param {CartPlatformApplicationValidator.GetPromotionByIdParam} arg - Arg object
2288
+ * @param {import("../PlatformAPIClient").Options} - Options
2289
+ * @returns {Promise<CartPlatformModel.PromotionUpdate>} - Success response
2290
+ * @name getPromotionById
2044
2291
  * @summary: Get with single promotion details or promotion list
2045
- * @description: Get single promotion details with `id` in path param
2292
+ * @description: Get single promotion details with `id` in path param - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/cart/getPromotionById/).
2046
2293
  */
2047
- async getPromotionById({ id } = {}) {
2048
- const { error } = CartValidator.getPromotionById().validate(
2294
+ async getPromotionById({ id } = {}, { headers } = { headers: false }) {
2295
+ const {
2296
+ error,
2297
+ } = CartPlatformApplicationValidator.getPromotionById().validate(
2049
2298
  {
2050
2299
  id,
2051
2300
  },
@@ -2056,7 +2305,9 @@ class Cart {
2056
2305
  }
2057
2306
 
2058
2307
  // Showing warrnings if extra unknown parameters are found
2059
- const { error: warrning } = CartValidator.getPromotionById().validate(
2308
+ const {
2309
+ error: warrning,
2310
+ } = CartPlatformApplicationValidator.getPromotionById().validate(
2060
2311
  {
2061
2312
  id,
2062
2313
  },
@@ -2065,9 +2316,8 @@ class Cart {
2065
2316
  if (warrning) {
2066
2317
  Logger({
2067
2318
  level: "WARN",
2068
- message: "Parameter Validation warrnings for getPromotionById",
2319
+ message: `Parameter Validation warrnings for platform > Cart > getPromotionById \n ${warrning}`,
2069
2320
  });
2070
- Logger({ level: "WARN", message: warrning });
2071
2321
  }
2072
2322
 
2073
2323
  const query_params = {};
@@ -2077,34 +2327,50 @@ class Cart {
2077
2327
  "get",
2078
2328
  `/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/promotion/${id}`,
2079
2329
  query_params,
2080
- undefined
2330
+ undefined,
2331
+ undefined,
2332
+ { headers }
2081
2333
  );
2082
2334
 
2083
- const { error: res_error } = CartModel.PromotionUpdate().validate(
2084
- response,
2085
- { abortEarly: false, allowUnknown: false }
2086
- );
2335
+ let responseData = response;
2336
+ if (headers) {
2337
+ responseData = response[0];
2338
+ }
2339
+
2340
+ const {
2341
+ error: res_error,
2342
+ } = CartPlatformModel.PromotionUpdate().validate(responseData, {
2343
+ abortEarly: false,
2344
+ allowUnknown: false,
2345
+ });
2087
2346
 
2088
2347
  if (res_error) {
2089
2348
  Logger({
2090
2349
  level: "WARN",
2091
- message: "Response Validation Warnnings for getPromotionById",
2350
+ message: `Response Validation Warnnings for platform > Cart > getPromotionById \n ${res_error}`,
2092
2351
  });
2093
- Logger({ level: "WARN", message: res_error });
2094
2352
  }
2095
2353
 
2096
2354
  return response;
2097
2355
  }
2098
2356
 
2099
2357
  /**
2100
- * @param {Object} arg - Arg object.
2101
- * @param {string} [arg.code] -
2358
+ * @param {CartPlatformApplicationValidator.GetPromotionCodeExistsParam} arg
2359
+ * - Arg object
2360
+ *
2361
+ * @param {import("../PlatformAPIClient").Options} - Options
2102
2362
  * @returns {Promise<Object>} - Success response
2363
+ * @name getPromotionCodeExists
2103
2364
  * @summary: Check if promotion is already created with promotion code
2104
- * @description: Check if sent promotion code is already existing promotion code. As promotion code is to be unique.
2365
+ * @description: Check if sent promotion code is already existing promotion code. As promotion code is to be unique. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/cart/getPromotionCodeExists/).
2105
2366
  */
2106
- async getPromotionCodeExists({ code } = {}) {
2107
- const { error } = CartValidator.getPromotionCodeExists().validate(
2367
+ async getPromotionCodeExists(
2368
+ { code } = {},
2369
+ { headers } = { headers: false }
2370
+ ) {
2371
+ const {
2372
+ error,
2373
+ } = CartPlatformApplicationValidator.getPromotionCodeExists().validate(
2108
2374
  {
2109
2375
  code,
2110
2376
  },
@@ -2115,7 +2381,9 @@ class Cart {
2115
2381
  }
2116
2382
 
2117
2383
  // Showing warrnings if extra unknown parameters are found
2118
- const { error: warrning } = CartValidator.getPromotionCodeExists().validate(
2384
+ const {
2385
+ error: warrning,
2386
+ } = CartPlatformApplicationValidator.getPromotionCodeExists().validate(
2119
2387
  {
2120
2388
  code,
2121
2389
  },
@@ -2124,9 +2392,8 @@ class Cart {
2124
2392
  if (warrning) {
2125
2393
  Logger({
2126
2394
  level: "WARN",
2127
- message: "Parameter Validation warrnings for getPromotionCodeExists",
2395
+ message: `Parameter Validation warrnings for platform > Cart > getPromotionCodeExists \n ${warrning}`,
2128
2396
  });
2129
- Logger({ level: "WARN", message: warrning });
2130
2397
  }
2131
2398
 
2132
2399
  const query_params = {};
@@ -2137,10 +2404,17 @@ class Cart {
2137
2404
  "get",
2138
2405
  `/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/promotion_code_exists`,
2139
2406
  query_params,
2140
- undefined
2407
+ undefined,
2408
+ undefined,
2409
+ { headers }
2141
2410
  );
2142
2411
 
2143
- const { error: res_error } = Joi.any().validate(response, {
2412
+ let responseData = response;
2413
+ if (headers) {
2414
+ responseData = response[0];
2415
+ }
2416
+
2417
+ const { error: res_error } = Joi.any().validate(responseData, {
2144
2418
  abortEarly: false,
2145
2419
  allowUnknown: false,
2146
2420
  });
@@ -2148,39 +2422,35 @@ class Cart {
2148
2422
  if (res_error) {
2149
2423
  Logger({
2150
2424
  level: "WARN",
2151
- message: "Response Validation Warnnings for getPromotionCodeExists",
2425
+ message: `Response Validation Warnnings for platform > Cart > getPromotionCodeExists \n ${res_error}`,
2152
2426
  });
2153
- Logger({ level: "WARN", message: res_error });
2154
2427
  }
2155
2428
 
2156
2429
  return response;
2157
2430
  }
2158
2431
 
2159
2432
  /**
2160
- * @param {Object} arg - Arg object.
2161
- * @param {number} [arg.pageNo] -
2162
- * @param {number} [arg.pageSize] -
2163
- * @param {string} [arg.q] -
2164
- * @param {boolean} [arg.isActive] -
2165
- * @param {string} [arg.promoGroup] -
2166
- * @param {string} [arg.promotionType] -
2167
- * @param {string} [arg.fpPanel] -
2168
- * @param {string} [arg.promotionId] -
2169
- * @returns {Promise<PromotionsResponse>} - Success response
2433
+ * @param {CartPlatformApplicationValidator.GetPromotionsParam} arg - Arg object
2434
+ * @param {import("../PlatformAPIClient").Options} - Options
2435
+ * @returns {Promise<CartPlatformModel.PromotionsResponse>} - Success response
2436
+ * @name getPromotions
2170
2437
  * @summary: Get promotion list
2171
- * @description: Get promotion list with pagination
2438
+ * @description: Get promotion list with pagination - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/cart/getPromotions/).
2172
2439
  */
2173
- async getPromotions({
2174
- pageNo,
2175
- pageSize,
2176
- q,
2177
- isActive,
2178
- promoGroup,
2179
- promotionType,
2180
- fpPanel,
2181
- promotionId,
2182
- } = {}) {
2183
- const { error } = CartValidator.getPromotions().validate(
2440
+ async getPromotions(
2441
+ {
2442
+ pageNo,
2443
+ pageSize,
2444
+ q,
2445
+ isActive,
2446
+ promoGroup,
2447
+ promotionType,
2448
+ fpPanel,
2449
+ promotionId,
2450
+ } = {},
2451
+ { headers } = { headers: false }
2452
+ ) {
2453
+ const { error } = CartPlatformApplicationValidator.getPromotions().validate(
2184
2454
  {
2185
2455
  pageNo,
2186
2456
  pageSize,
@@ -2198,7 +2468,9 @@ class Cart {
2198
2468
  }
2199
2469
 
2200
2470
  // Showing warrnings if extra unknown parameters are found
2201
- const { error: warrning } = CartValidator.getPromotions().validate(
2471
+ const {
2472
+ error: warrning,
2473
+ } = CartPlatformApplicationValidator.getPromotions().validate(
2202
2474
  {
2203
2475
  pageNo,
2204
2476
  pageSize,
@@ -2214,9 +2486,8 @@ class Cart {
2214
2486
  if (warrning) {
2215
2487
  Logger({
2216
2488
  level: "WARN",
2217
- message: "Parameter Validation warrnings for getPromotions",
2489
+ message: `Parameter Validation warrnings for platform > Cart > getPromotions \n ${warrning}`,
2218
2490
  });
2219
- Logger({ level: "WARN", message: warrning });
2220
2491
  }
2221
2492
 
2222
2493
  const query_params = {};
@@ -2234,12 +2505,19 @@ class Cart {
2234
2505
  "get",
2235
2506
  `/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/promotion`,
2236
2507
  query_params,
2237
- undefined
2508
+ undefined,
2509
+ undefined,
2510
+ { headers }
2238
2511
  );
2239
2512
 
2513
+ let responseData = response;
2514
+ if (headers) {
2515
+ responseData = response[0];
2516
+ }
2517
+
2240
2518
  const {
2241
2519
  error: res_error,
2242
- } = CartModel.PromotionsResponse().validate(response, {
2520
+ } = CartPlatformModel.PromotionsResponse().validate(responseData, {
2243
2521
  abortEarly: false,
2244
2522
  allowUnknown: false,
2245
2523
  });
@@ -2247,9 +2525,8 @@ class Cart {
2247
2525
  if (res_error) {
2248
2526
  Logger({
2249
2527
  level: "WARN",
2250
- message: "Response Validation Warnnings for getPromotions",
2528
+ message: `Response Validation Warnnings for platform > Cart > getPromotions \n ${res_error}`,
2251
2529
  });
2252
- Logger({ level: "WARN", message: res_error });
2253
2530
  }
2254
2531
 
2255
2532
  return response;
@@ -2266,6 +2543,7 @@ class Cart {
2266
2543
  * @param {string} [arg.promotionType] -
2267
2544
  * @param {string} [arg.fpPanel] -
2268
2545
  * @param {string} [arg.promotionId] -
2546
+ * @returns {Paginator<CartPlatformModel.PromotionsResponse>}
2269
2547
  * @summary: Get promotion list
2270
2548
  * @description: Get promotion list with pagination
2271
2549
  */
@@ -2308,35 +2586,28 @@ class Cart {
2308
2586
  }
2309
2587
 
2310
2588
  /**
2311
- * @param {Object} arg - Arg object.
2312
- * @param {number} [arg.pickAtStoreUid] -
2313
- * @param {number} [arg.orderingStoreId] -
2314
- * @param {boolean} [arg.i] - This is a boolean value. Select `true` to
2315
- * retrieve all the items added in the cart.
2316
- * @param {boolean} [arg.p] - This is a boolean value. Select `true` for
2317
- * getting a payment option in response.
2318
- * @param {string} [arg.id] - The unique identifier of the cart
2319
- * @param {string} [arg.addressId] - ID allotted to the selected address
2320
- * @param {string} [arg.areaCode] - The PIN Code of the destination address,
2321
- * e.g. 400059
2322
- * @param {string} [arg.orderType] - The order type of shipment HomeDelivery
2323
- * - If the customer wants the order home-delivered PickAtStore - If the
2324
- * customer wants the handover of an order at the store itself.
2325
- * @returns {Promise<PlatformCartShipmentsResponse>} - Success response
2589
+ * @param {CartPlatformApplicationValidator.GetShipmentsParam} arg - Arg object
2590
+ * @param {import("../PlatformAPIClient").Options} - Options
2591
+ * @returns {Promise<CartPlatformModel.PlatformCartShipmentsResponse>} -
2592
+ * Success response
2593
+ * @name getShipments
2326
2594
  * @summary: Get delivery date and options before checkout
2327
- * @description: Use this API to get shipment details, expected delivery date, items and price breakup of the shipment.
2595
+ * @description: Use this API to get shipment details, expected delivery date, items and price breakup of the shipment. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/cart/getShipments/).
2328
2596
  */
2329
- async getShipments({
2330
- pickAtStoreUid,
2331
- orderingStoreId,
2332
- i,
2333
- p,
2334
- id,
2335
- addressId,
2336
- areaCode,
2337
- orderType,
2338
- } = {}) {
2339
- const { error } = CartValidator.getShipments().validate(
2597
+ async getShipments(
2598
+ {
2599
+ pickAtStoreUid,
2600
+ orderingStoreId,
2601
+ i,
2602
+ p,
2603
+ id,
2604
+ addressId,
2605
+ areaCode,
2606
+ orderType,
2607
+ } = {},
2608
+ { headers } = { headers: false }
2609
+ ) {
2610
+ const { error } = CartPlatformApplicationValidator.getShipments().validate(
2340
2611
  {
2341
2612
  pickAtStoreUid,
2342
2613
  orderingStoreId,
@@ -2354,7 +2625,9 @@ class Cart {
2354
2625
  }
2355
2626
 
2356
2627
  // Showing warrnings if extra unknown parameters are found
2357
- const { error: warrning } = CartValidator.getShipments().validate(
2628
+ const {
2629
+ error: warrning,
2630
+ } = CartPlatformApplicationValidator.getShipments().validate(
2358
2631
  {
2359
2632
  pickAtStoreUid,
2360
2633
  orderingStoreId,
@@ -2370,9 +2643,8 @@ class Cart {
2370
2643
  if (warrning) {
2371
2644
  Logger({
2372
2645
  level: "WARN",
2373
- message: "Parameter Validation warrnings for getShipments",
2646
+ message: `Parameter Validation warrnings for platform > Cart > getShipments \n ${warrning}`,
2374
2647
  });
2375
- Logger({ level: "WARN", message: warrning });
2376
2648
  }
2377
2649
 
2378
2650
  const query_params = {};
@@ -2390,36 +2662,50 @@ class Cart {
2390
2662
  "get",
2391
2663
  `/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/shipment`,
2392
2664
  query_params,
2393
- undefined
2665
+ undefined,
2666
+ undefined,
2667
+ { headers }
2394
2668
  );
2395
2669
 
2670
+ let responseData = response;
2671
+ if (headers) {
2672
+ responseData = response[0];
2673
+ }
2674
+
2396
2675
  const {
2397
2676
  error: res_error,
2398
- } = CartModel.PlatformCartShipmentsResponse().validate(response, {
2399
- abortEarly: false,
2400
- allowUnknown: false,
2401
- });
2677
+ } = CartPlatformModel.PlatformCartShipmentsResponse().validate(
2678
+ responseData,
2679
+ { abortEarly: false, allowUnknown: false }
2680
+ );
2402
2681
 
2403
2682
  if (res_error) {
2404
2683
  Logger({
2405
2684
  level: "WARN",
2406
- message: "Response Validation Warnnings for getShipments",
2685
+ message: `Response Validation Warnnings for platform > Cart > getShipments \n ${res_error}`,
2407
2686
  });
2408
- Logger({ level: "WARN", message: res_error });
2409
2687
  }
2410
2688
 
2411
2689
  return response;
2412
2690
  }
2413
2691
 
2414
2692
  /**
2415
- * @param {Object} arg - Arg object.
2416
- * @param {number} arg.storeUid -
2417
- * @returns {Promise<StoreDetailsResponse>} - Success response
2693
+ * @param {CartPlatformApplicationValidator.GetStoreAddressByUidParam} arg
2694
+ * - Arg object
2695
+ *
2696
+ * @param {import("../PlatformAPIClient").Options} - Options
2697
+ * @returns {Promise<CartPlatformModel.StoreDetailsResponse>} - Success response
2698
+ * @name getStoreAddressByUid
2418
2699
  * @summary: Get list of stores for give uids
2419
- * @description: Use this API to get the store details by entering the unique identifier of the pickup stores shown in the response of available-delivery-mode API.
2700
+ * @description: Use this API to get the store details by entering the unique identifier of the pickup stores shown in the response of available-delivery-mode API. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/cart/getStoreAddressByUid/).
2420
2701
  */
2421
- async getStoreAddressByUid({ storeUid } = {}) {
2422
- const { error } = CartValidator.getStoreAddressByUid().validate(
2702
+ async getStoreAddressByUid(
2703
+ { storeUid } = {},
2704
+ { headers } = { headers: false }
2705
+ ) {
2706
+ const {
2707
+ error,
2708
+ } = CartPlatformApplicationValidator.getStoreAddressByUid().validate(
2423
2709
  {
2424
2710
  storeUid,
2425
2711
  },
@@ -2430,7 +2716,9 @@ class Cart {
2430
2716
  }
2431
2717
 
2432
2718
  // Showing warrnings if extra unknown parameters are found
2433
- const { error: warrning } = CartValidator.getStoreAddressByUid().validate(
2719
+ const {
2720
+ error: warrning,
2721
+ } = CartPlatformApplicationValidator.getStoreAddressByUid().validate(
2434
2722
  {
2435
2723
  storeUid,
2436
2724
  },
@@ -2439,9 +2727,8 @@ class Cart {
2439
2727
  if (warrning) {
2440
2728
  Logger({
2441
2729
  level: "WARN",
2442
- message: "Parameter Validation warrnings for getStoreAddressByUid",
2730
+ message: `Parameter Validation warrnings for platform > Cart > getStoreAddressByUid \n ${warrning}`,
2443
2731
  });
2444
- Logger({ level: "WARN", message: warrning });
2445
2732
  }
2446
2733
 
2447
2734
  const query_params = {};
@@ -2452,12 +2739,19 @@ class Cart {
2452
2739
  "get",
2453
2740
  `/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/store-address`,
2454
2741
  query_params,
2455
- undefined
2742
+ undefined,
2743
+ undefined,
2744
+ { headers }
2456
2745
  );
2457
2746
 
2747
+ let responseData = response;
2748
+ if (headers) {
2749
+ responseData = response[0];
2750
+ }
2751
+
2458
2752
  const {
2459
2753
  error: res_error,
2460
- } = CartModel.StoreDetailsResponse().validate(response, {
2754
+ } = CartPlatformModel.StoreDetailsResponse().validate(responseData, {
2461
2755
  abortEarly: false,
2462
2756
  allowUnknown: false,
2463
2757
  });
@@ -2465,23 +2759,23 @@ class Cart {
2465
2759
  if (res_error) {
2466
2760
  Logger({
2467
2761
  level: "WARN",
2468
- message: "Response Validation Warnnings for getStoreAddressByUid",
2762
+ message: `Response Validation Warnnings for platform > Cart > getStoreAddressByUid \n ${res_error}`,
2469
2763
  });
2470
- Logger({ level: "WARN", message: res_error });
2471
2764
  }
2472
2765
 
2473
2766
  return response;
2474
2767
  }
2475
2768
 
2476
2769
  /**
2477
- * @param {Object} arg - Arg object.
2478
- * @param {OverrideCheckoutReq} arg.body
2479
- * @returns {Promise<OverrideCheckoutResponse>} - Success response
2770
+ * @param {CartPlatformApplicationValidator.OverrideCartParam} arg - Arg object
2771
+ * @param {import("../PlatformAPIClient").Options} - Options
2772
+ * @returns {Promise<CartPlatformModel.OverrideCheckoutResponse>} - Success response
2773
+ * @name overrideCart
2480
2774
  * @summary: Create Fynd order with overriding cart details
2481
- * @description: Generate Fynd order while overriding cart details sent with provided `cart_items`
2775
+ * @description: Generate Fynd order while overriding cart details sent with provided `cart_items` - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/cart/overrideCart/).
2482
2776
  */
2483
- async overrideCart({ body } = {}) {
2484
- const { error } = CartValidator.overrideCart().validate(
2777
+ async overrideCart({ body } = {}, { headers } = { headers: false }) {
2778
+ const { error } = CartPlatformApplicationValidator.overrideCart().validate(
2485
2779
  {
2486
2780
  body,
2487
2781
  },
@@ -2492,7 +2786,9 @@ class Cart {
2492
2786
  }
2493
2787
 
2494
2788
  // Showing warrnings if extra unknown parameters are found
2495
- const { error: warrning } = CartValidator.overrideCart().validate(
2789
+ const {
2790
+ error: warrning,
2791
+ } = CartPlatformApplicationValidator.overrideCart().validate(
2496
2792
  {
2497
2793
  body,
2498
2794
  },
@@ -2501,9 +2797,8 @@ class Cart {
2501
2797
  if (warrning) {
2502
2798
  Logger({
2503
2799
  level: "WARN",
2504
- message: "Parameter Validation warrnings for overrideCart",
2800
+ message: `Parameter Validation warrnings for platform > Cart > overrideCart \n ${warrning}`,
2505
2801
  });
2506
- Logger({ level: "WARN", message: warrning });
2507
2802
  }
2508
2803
 
2509
2804
  const query_params = {};
@@ -2513,12 +2808,19 @@ class Cart {
2513
2808
  "post",
2514
2809
  `/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/checkout/over-ride`,
2515
2810
  query_params,
2516
- body
2811
+ body,
2812
+ undefined,
2813
+ { headers }
2517
2814
  );
2518
2815
 
2816
+ let responseData = response;
2817
+ if (headers) {
2818
+ responseData = response[0];
2819
+ }
2820
+
2519
2821
  const {
2520
2822
  error: res_error,
2521
- } = CartModel.OverrideCheckoutResponse().validate(response, {
2823
+ } = CartPlatformModel.OverrideCheckoutResponse().validate(responseData, {
2522
2824
  abortEarly: false,
2523
2825
  allowUnknown: false,
2524
2826
  });
@@ -2526,27 +2828,28 @@ class Cart {
2526
2828
  if (res_error) {
2527
2829
  Logger({
2528
2830
  level: "WARN",
2529
- message: "Response Validation Warnnings for overrideCart",
2831
+ message: `Response Validation Warnnings for platform > Cart > overrideCart \n ${res_error}`,
2530
2832
  });
2531
- Logger({ level: "WARN", message: res_error });
2532
2833
  }
2533
2834
 
2534
2835
  return response;
2535
2836
  }
2536
2837
 
2537
2838
  /**
2538
- * @param {Object} arg - Arg object.
2539
- * @param {boolean} [arg.i] -
2540
- * @param {boolean} [arg.b] -
2541
- * @param {boolean} [arg.buyNow] -
2542
- * @param {string} [arg.id] -
2543
- * @param {PlatformAddCartRequest} arg.body
2544
- * @returns {Promise<AddCartDetailResponse>} - Success response
2839
+ * @param {CartPlatformApplicationValidator.PlatformAddItemsParam} arg - Arg object
2840
+ * @param {import("../PlatformAPIClient").Options} - Options
2841
+ * @returns {Promise<CartPlatformModel.AddCartDetailResponse>} - Success response
2842
+ * @name platformAddItems
2545
2843
  * @summary: Add items to cart
2546
- * @description: Use this API to add items to the cart.
2844
+ * @description: Use this API to add items to the cart. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/cart/platformAddItems/).
2547
2845
  */
2548
- async platformAddItems({ body, i, b, buyNow, id } = {}) {
2549
- const { error } = CartValidator.platformAddItems().validate(
2846
+ async platformAddItems(
2847
+ { body, i, b, buyNow, id } = {},
2848
+ { headers } = { headers: false }
2849
+ ) {
2850
+ const {
2851
+ error,
2852
+ } = CartPlatformApplicationValidator.platformAddItems().validate(
2550
2853
  {
2551
2854
  body,
2552
2855
  i,
@@ -2561,7 +2864,9 @@ class Cart {
2561
2864
  }
2562
2865
 
2563
2866
  // Showing warrnings if extra unknown parameters are found
2564
- const { error: warrning } = CartValidator.platformAddItems().validate(
2867
+ const {
2868
+ error: warrning,
2869
+ } = CartPlatformApplicationValidator.platformAddItems().validate(
2565
2870
  {
2566
2871
  body,
2567
2872
  i,
@@ -2574,9 +2879,8 @@ class Cart {
2574
2879
  if (warrning) {
2575
2880
  Logger({
2576
2881
  level: "WARN",
2577
- message: "Parameter Validation warrnings for platformAddItems",
2882
+ message: `Parameter Validation warrnings for platform > Cart > platformAddItems \n ${warrning}`,
2578
2883
  });
2579
- Logger({ level: "WARN", message: warrning });
2580
2884
  }
2581
2885
 
2582
2886
  const query_params = {};
@@ -2590,12 +2894,19 @@ class Cart {
2590
2894
  "post",
2591
2895
  `/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/detail`,
2592
2896
  query_params,
2593
- body
2897
+ body,
2898
+ undefined,
2899
+ { headers }
2594
2900
  );
2595
2901
 
2902
+ let responseData = response;
2903
+ if (headers) {
2904
+ responseData = response[0];
2905
+ }
2906
+
2596
2907
  const {
2597
2908
  error: res_error,
2598
- } = CartModel.AddCartDetailResponse().validate(response, {
2909
+ } = CartPlatformModel.AddCartDetailResponse().validate(responseData, {
2599
2910
  abortEarly: false,
2600
2911
  allowUnknown: false,
2601
2912
  });
@@ -2603,24 +2914,30 @@ class Cart {
2603
2914
  if (res_error) {
2604
2915
  Logger({
2605
2916
  level: "WARN",
2606
- message: "Response Validation Warnnings for platformAddItems",
2917
+ message: `Response Validation Warnnings for platform > Cart > platformAddItems \n ${res_error}`,
2607
2918
  });
2608
- Logger({ level: "WARN", message: res_error });
2609
2919
  }
2610
2920
 
2611
2921
  return response;
2612
2922
  }
2613
2923
 
2614
2924
  /**
2615
- * @param {Object} arg - Arg object.
2616
- * @param {string} [arg.id] -
2617
- * @param {PlatformCartCheckoutDetailRequest} arg.body
2618
- * @returns {Promise<CartCheckoutResponse>} - Success response
2925
+ * @param {CartPlatformApplicationValidator.PlatformCheckoutCartParam} arg
2926
+ * - Arg object
2927
+ *
2928
+ * @param {import("../PlatformAPIClient").Options} - Options
2929
+ * @returns {Promise<CartPlatformModel.CartCheckoutResponse>} - Success response
2930
+ * @name platformCheckoutCart
2619
2931
  * @summary: Checkout all items in the cart
2620
- * @description: Use this API to checkout all items in the cart for payment and order generation. For COD, order will be generated directly, whereas for other checkout modes, user will be redirected to a payment gateway.
2932
+ * @description: Use this API to checkout all items in the cart for payment and order generation. For COD, order will be generated directly, whereas for other checkout modes, user will be redirected to a payment gateway. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/cart/platformCheckoutCart/).
2621
2933
  */
2622
- async platformCheckoutCart({ body, id } = {}) {
2623
- const { error } = CartValidator.platformCheckoutCart().validate(
2934
+ async platformCheckoutCart(
2935
+ { body, id } = {},
2936
+ { headers } = { headers: false }
2937
+ ) {
2938
+ const {
2939
+ error,
2940
+ } = CartPlatformApplicationValidator.platformCheckoutCart().validate(
2624
2941
  {
2625
2942
  body,
2626
2943
  id,
@@ -2632,7 +2949,9 @@ class Cart {
2632
2949
  }
2633
2950
 
2634
2951
  // Showing warrnings if extra unknown parameters are found
2635
- const { error: warrning } = CartValidator.platformCheckoutCart().validate(
2952
+ const {
2953
+ error: warrning,
2954
+ } = CartPlatformApplicationValidator.platformCheckoutCart().validate(
2636
2955
  {
2637
2956
  body,
2638
2957
  id,
@@ -2642,9 +2961,8 @@ class Cart {
2642
2961
  if (warrning) {
2643
2962
  Logger({
2644
2963
  level: "WARN",
2645
- message: "Parameter Validation warrnings for platformCheckoutCart",
2964
+ message: `Parameter Validation warrnings for platform > Cart > platformCheckoutCart \n ${warrning}`,
2646
2965
  });
2647
- Logger({ level: "WARN", message: warrning });
2648
2966
  }
2649
2967
 
2650
2968
  const query_params = {};
@@ -2655,12 +2973,19 @@ class Cart {
2655
2973
  "post",
2656
2974
  `/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/checkout`,
2657
2975
  query_params,
2658
- body
2976
+ body,
2977
+ undefined,
2978
+ { headers }
2659
2979
  );
2660
2980
 
2981
+ let responseData = response;
2982
+ if (headers) {
2983
+ responseData = response[0];
2984
+ }
2985
+
2661
2986
  const {
2662
2987
  error: res_error,
2663
- } = CartModel.CartCheckoutResponse().validate(response, {
2988
+ } = CartPlatformModel.CartCheckoutResponse().validate(responseData, {
2664
2989
  abortEarly: false,
2665
2990
  allowUnknown: false,
2666
2991
  });
@@ -2668,24 +2993,30 @@ class Cart {
2668
2993
  if (res_error) {
2669
2994
  Logger({
2670
2995
  level: "WARN",
2671
- message: "Response Validation Warnnings for platformCheckoutCart",
2996
+ message: `Response Validation Warnnings for platform > Cart > platformCheckoutCart \n ${res_error}`,
2672
2997
  });
2673
- Logger({ level: "WARN", message: res_error });
2674
2998
  }
2675
2999
 
2676
3000
  return response;
2677
3001
  }
2678
3002
 
2679
3003
  /**
2680
- * @param {Object} arg - Arg object.
2681
- * @param {string} [arg.id] -
2682
- * @param {PlatformCartCheckoutDetailV2Request} arg.body
2683
- * @returns {Promise<CartCheckoutResponse>} - Success response
3004
+ * @param {CartPlatformApplicationValidator.PlatformCheckoutCartV2Param} arg
3005
+ * - Arg object
3006
+ *
3007
+ * @param {import("../PlatformAPIClient").Options} - Options
3008
+ * @returns {Promise<CartPlatformModel.CartCheckoutResponse>} - Success response
3009
+ * @name platformCheckoutCartV2
2684
3010
  * @summary: Checkout all items in the cart
2685
- * @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.
3011
+ * @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. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/cart/platformCheckoutCartV2/).
2686
3012
  */
2687
- async platformCheckoutCartV2({ body, id } = {}) {
2688
- const { error } = CartValidator.platformCheckoutCartV2().validate(
3013
+ async platformCheckoutCartV2(
3014
+ { body, id } = {},
3015
+ { headers } = { headers: false }
3016
+ ) {
3017
+ const {
3018
+ error,
3019
+ } = CartPlatformApplicationValidator.platformCheckoutCartV2().validate(
2689
3020
  {
2690
3021
  body,
2691
3022
  id,
@@ -2697,7 +3028,9 @@ class Cart {
2697
3028
  }
2698
3029
 
2699
3030
  // Showing warrnings if extra unknown parameters are found
2700
- const { error: warrning } = CartValidator.platformCheckoutCartV2().validate(
3031
+ const {
3032
+ error: warrning,
3033
+ } = CartPlatformApplicationValidator.platformCheckoutCartV2().validate(
2701
3034
  {
2702
3035
  body,
2703
3036
  id,
@@ -2707,9 +3040,8 @@ class Cart {
2707
3040
  if (warrning) {
2708
3041
  Logger({
2709
3042
  level: "WARN",
2710
- message: "Parameter Validation warrnings for platformCheckoutCartV2",
3043
+ message: `Parameter Validation warrnings for platform > Cart > platformCheckoutCartV2 \n ${warrning}`,
2711
3044
  });
2712
- Logger({ level: "WARN", message: warrning });
2713
3045
  }
2714
3046
 
2715
3047
  const query_params = {};
@@ -2720,12 +3052,19 @@ class Cart {
2720
3052
  "post",
2721
3053
  `/service/platform/cart/v2.0/company/${this.config.companyId}/application/${this.applicationId}/checkout`,
2722
3054
  query_params,
2723
- body
3055
+ body,
3056
+ undefined,
3057
+ { headers }
2724
3058
  );
2725
3059
 
3060
+ let responseData = response;
3061
+ if (headers) {
3062
+ responseData = response[0];
3063
+ }
3064
+
2726
3065
  const {
2727
3066
  error: res_error,
2728
- } = CartModel.CartCheckoutResponse().validate(response, {
3067
+ } = CartPlatformModel.CartCheckoutResponse().validate(responseData, {
2729
3068
  abortEarly: false,
2730
3069
  allowUnknown: false,
2731
3070
  });
@@ -2733,27 +3072,28 @@ class Cart {
2733
3072
  if (res_error) {
2734
3073
  Logger({
2735
3074
  level: "WARN",
2736
- message: "Response Validation Warnnings for platformCheckoutCartV2",
3075
+ message: `Response Validation Warnnings for platform > Cart > platformCheckoutCartV2 \n ${res_error}`,
2737
3076
  });
2738
- Logger({ level: "WARN", message: res_error });
2739
3077
  }
2740
3078
 
2741
3079
  return response;
2742
3080
  }
2743
3081
 
2744
3082
  /**
2745
- * @param {Object} arg - Arg object.
2746
- * @param {string} [arg.id] -
2747
- * @param {boolean} [arg.i] -
2748
- * @param {boolean} [arg.b] -
2749
- * @param {boolean} [arg.buyNow] -
2750
- * @param {PlatformUpdateCartRequest} arg.body
2751
- * @returns {Promise<UpdateCartDetailResponse>} - Success response
3083
+ * @param {CartPlatformApplicationValidator.PlatformUpdateCartParam} arg - Arg object
3084
+ * @param {import("../PlatformAPIClient").Options} - Options
3085
+ * @returns {Promise<CartPlatformModel.UpdateCartDetailResponse>} - Success response
3086
+ * @name platformUpdateCart
2752
3087
  * @summary: Update items in the customer 's cart using cart id
2753
- * @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>
3088
+ * @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> - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/cart/platformUpdateCart/).
2754
3089
  */
2755
- async platformUpdateCart({ body, id, i, b, buyNow } = {}) {
2756
- const { error } = CartValidator.platformUpdateCart().validate(
3090
+ async platformUpdateCart(
3091
+ { body, id, i, b, buyNow } = {},
3092
+ { headers } = { headers: false }
3093
+ ) {
3094
+ const {
3095
+ error,
3096
+ } = CartPlatformApplicationValidator.platformUpdateCart().validate(
2757
3097
  {
2758
3098
  body,
2759
3099
  id,
@@ -2768,7 +3108,9 @@ class Cart {
2768
3108
  }
2769
3109
 
2770
3110
  // Showing warrnings if extra unknown parameters are found
2771
- const { error: warrning } = CartValidator.platformUpdateCart().validate(
3111
+ const {
3112
+ error: warrning,
3113
+ } = CartPlatformApplicationValidator.platformUpdateCart().validate(
2772
3114
  {
2773
3115
  body,
2774
3116
  id,
@@ -2781,9 +3123,8 @@ class Cart {
2781
3123
  if (warrning) {
2782
3124
  Logger({
2783
3125
  level: "WARN",
2784
- message: "Parameter Validation warrnings for platformUpdateCart",
3126
+ message: `Parameter Validation warrnings for platform > Cart > platformUpdateCart \n ${warrning}`,
2785
3127
  });
2786
- Logger({ level: "WARN", message: warrning });
2787
3128
  }
2788
3129
 
2789
3130
  const query_params = {};
@@ -2797,12 +3138,19 @@ class Cart {
2797
3138
  "put",
2798
3139
  `/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/detail`,
2799
3140
  query_params,
2800
- body
3141
+ body,
3142
+ undefined,
3143
+ { headers }
2801
3144
  );
2802
3145
 
3146
+ let responseData = response;
3147
+ if (headers) {
3148
+ responseData = response[0];
3149
+ }
3150
+
2803
3151
  const {
2804
3152
  error: res_error,
2805
- } = CartModel.UpdateCartDetailResponse().validate(response, {
3153
+ } = CartPlatformModel.UpdateCartDetailResponse().validate(responseData, {
2806
3154
  abortEarly: false,
2807
3155
  allowUnknown: false,
2808
3156
  });
@@ -2810,24 +3158,23 @@ class Cart {
2810
3158
  if (res_error) {
2811
3159
  Logger({
2812
3160
  level: "WARN",
2813
- message: "Response Validation Warnnings for platformUpdateCart",
3161
+ message: `Response Validation Warnnings for platform > Cart > platformUpdateCart \n ${res_error}`,
2814
3162
  });
2815
- Logger({ level: "WARN", message: res_error });
2816
3163
  }
2817
3164
 
2818
3165
  return response;
2819
3166
  }
2820
3167
 
2821
3168
  /**
2822
- * @param {Object} arg - Arg object.
2823
- * @param {string} arg.id - ID allotted to the selected address
2824
- * @param {string} [arg.userId] - Option to delete address for the provided user_id.
2825
- * @returns {Promise<DeleteAddressResponse>} - Success response
3169
+ * @param {CartPlatformApplicationValidator.RemoveAddressParam} arg - Arg object
3170
+ * @param {import("../PlatformAPIClient").Options} - Options
3171
+ * @returns {Promise<CartPlatformModel.DeleteAddressResponse>} - Success response
3172
+ * @name removeAddress
2826
3173
  * @summary: Remove address associated with an account
2827
- * @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.
3174
+ * @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. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/cart/removeAddress/).
2828
3175
  */
2829
- async removeAddress({ id, userId } = {}) {
2830
- const { error } = CartValidator.removeAddress().validate(
3176
+ async removeAddress({ id, userId } = {}, { headers } = { headers: false }) {
3177
+ const { error } = CartPlatformApplicationValidator.removeAddress().validate(
2831
3178
  {
2832
3179
  id,
2833
3180
  userId,
@@ -2839,7 +3186,9 @@ class Cart {
2839
3186
  }
2840
3187
 
2841
3188
  // Showing warrnings if extra unknown parameters are found
2842
- const { error: warrning } = CartValidator.removeAddress().validate(
3189
+ const {
3190
+ error: warrning,
3191
+ } = CartPlatformApplicationValidator.removeAddress().validate(
2843
3192
  {
2844
3193
  id,
2845
3194
  userId,
@@ -2849,9 +3198,8 @@ class Cart {
2849
3198
  if (warrning) {
2850
3199
  Logger({
2851
3200
  level: "WARN",
2852
- message: "Parameter Validation warrnings for removeAddress",
3201
+ message: `Parameter Validation warrnings for platform > Cart > removeAddress \n ${warrning}`,
2853
3202
  });
2854
- Logger({ level: "WARN", message: warrning });
2855
3203
  }
2856
3204
 
2857
3205
  const query_params = {};
@@ -2862,12 +3210,19 @@ class Cart {
2862
3210
  "delete",
2863
3211
  `/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/address/${id}`,
2864
3212
  query_params,
2865
- undefined
3213
+ undefined,
3214
+ undefined,
3215
+ { headers }
2866
3216
  );
2867
3217
 
3218
+ let responseData = response;
3219
+ if (headers) {
3220
+ responseData = response[0];
3221
+ }
3222
+
2868
3223
  const {
2869
3224
  error: res_error,
2870
- } = CartModel.DeleteAddressResponse().validate(response, {
3225
+ } = CartPlatformModel.DeleteAddressResponse().validate(responseData, {
2871
3226
  abortEarly: false,
2872
3227
  allowUnknown: false,
2873
3228
  });
@@ -2875,24 +3230,23 @@ class Cart {
2875
3230
  if (res_error) {
2876
3231
  Logger({
2877
3232
  level: "WARN",
2878
- message: "Response Validation Warnnings for removeAddress",
3233
+ message: `Response Validation Warnnings for platform > Cart > removeAddress \n ${res_error}`,
2879
3234
  });
2880
- Logger({ level: "WARN", message: res_error });
2881
3235
  }
2882
3236
 
2883
3237
  return response;
2884
3238
  }
2885
3239
 
2886
3240
  /**
2887
- * @param {Object} arg - Arg object.
2888
- * @param {string} [arg.uid] -
2889
- * @param {boolean} [arg.buyNow] -
2890
- * @returns {Promise<CartDetailResponse>} - Success response
3241
+ * @param {CartPlatformApplicationValidator.RemoveCouponParam} arg - Arg object
3242
+ * @param {import("../PlatformAPIClient").Options} - Options
3243
+ * @returns {Promise<CartPlatformModel.CartDetailResponse>} - Success response
3244
+ * @name removeCoupon
2891
3245
  * @summary: Remove Applied Coupon for platform pos user
2892
- * @description: Remove Coupon applied on the cart by passing uid in request body.
3246
+ * @description: Remove Coupon applied on the cart by passing uid in request body. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/cart/removeCoupon/).
2893
3247
  */
2894
- async removeCoupon({ uid, buyNow } = {}) {
2895
- const { error } = CartValidator.removeCoupon().validate(
3248
+ async removeCoupon({ uid, buyNow } = {}, { headers } = { headers: false }) {
3249
+ const { error } = CartPlatformApplicationValidator.removeCoupon().validate(
2896
3250
  {
2897
3251
  uid,
2898
3252
  buyNow,
@@ -2904,7 +3258,9 @@ class Cart {
2904
3258
  }
2905
3259
 
2906
3260
  // Showing warrnings if extra unknown parameters are found
2907
- const { error: warrning } = CartValidator.removeCoupon().validate(
3261
+ const {
3262
+ error: warrning,
3263
+ } = CartPlatformApplicationValidator.removeCoupon().validate(
2908
3264
  {
2909
3265
  uid,
2910
3266
  buyNow,
@@ -2914,9 +3270,8 @@ class Cart {
2914
3270
  if (warrning) {
2915
3271
  Logger({
2916
3272
  level: "WARN",
2917
- message: "Parameter Validation warrnings for removeCoupon",
3273
+ message: `Parameter Validation warrnings for platform > Cart > removeCoupon \n ${warrning}`,
2918
3274
  });
2919
- Logger({ level: "WARN", message: warrning });
2920
3275
  }
2921
3276
 
2922
3277
  const query_params = {};
@@ -2928,12 +3283,19 @@ class Cart {
2928
3283
  "delete",
2929
3284
  `/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/platform-pos-coupon`,
2930
3285
  query_params,
2931
- undefined
3286
+ undefined,
3287
+ undefined,
3288
+ { headers }
2932
3289
  );
2933
3290
 
3291
+ let responseData = response;
3292
+ if (headers) {
3293
+ responseData = response[0];
3294
+ }
3295
+
2934
3296
  const {
2935
3297
  error: res_error,
2936
- } = CartModel.CartDetailResponse().validate(response, {
3298
+ } = CartPlatformModel.CartDetailResponse().validate(responseData, {
2937
3299
  abortEarly: false,
2938
3300
  allowUnknown: false,
2939
3301
  });
@@ -2941,23 +3303,27 @@ class Cart {
2941
3303
  if (res_error) {
2942
3304
  Logger({
2943
3305
  level: "WARN",
2944
- message: "Response Validation Warnnings for removeCoupon",
3306
+ message: `Response Validation Warnnings for platform > Cart > removeCoupon \n ${res_error}`,
2945
3307
  });
2946
- Logger({ level: "WARN", message: res_error });
2947
3308
  }
2948
3309
 
2949
3310
  return response;
2950
3311
  }
2951
3312
 
2952
3313
  /**
2953
- * @param {Object} arg - Arg object.
2954
- * @param {string} arg.id -
2955
- * @returns {Promise<SuccessMessage>} - Success response
3314
+ * @param {CartPlatformApplicationValidator.RemovePriceAdjustmentParam} arg
3315
+ * - Arg object
3316
+ *
3317
+ * @param {import("../PlatformAPIClient").Options} - Options
3318
+ * @returns {Promise<CartPlatformModel.SuccessMessage>} - Success response
3319
+ * @name removePriceAdjustment
2956
3320
  * @summary: Remove price adjustment
2957
- * @description: Remove price adjustment
3321
+ * @description: Remove price adjustment - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/cart/removePriceAdjustment/).
2958
3322
  */
2959
- async removePriceAdjustment({ id } = {}) {
2960
- const { error } = CartValidator.removePriceAdjustment().validate(
3323
+ async removePriceAdjustment({ id } = {}, { headers } = { headers: false }) {
3324
+ const {
3325
+ error,
3326
+ } = CartPlatformApplicationValidator.removePriceAdjustment().validate(
2961
3327
  {
2962
3328
  id,
2963
3329
  },
@@ -2968,7 +3334,9 @@ class Cart {
2968
3334
  }
2969
3335
 
2970
3336
  // Showing warrnings if extra unknown parameters are found
2971
- const { error: warrning } = CartValidator.removePriceAdjustment().validate(
3337
+ const {
3338
+ error: warrning,
3339
+ } = CartPlatformApplicationValidator.removePriceAdjustment().validate(
2972
3340
  {
2973
3341
  id,
2974
3342
  },
@@ -2977,9 +3345,8 @@ class Cart {
2977
3345
  if (warrning) {
2978
3346
  Logger({
2979
3347
  level: "WARN",
2980
- message: "Parameter Validation warrnings for removePriceAdjustment",
3348
+ message: `Parameter Validation warrnings for platform > Cart > removePriceAdjustment \n ${warrning}`,
2981
3349
  });
2982
- Logger({ level: "WARN", message: warrning });
2983
3350
  }
2984
3351
 
2985
3352
  const query_params = {};
@@ -2989,10 +3356,19 @@ class Cart {
2989
3356
  "delete",
2990
3357
  `/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/price-adjustment/${id}`,
2991
3358
  query_params,
2992
- undefined
3359
+ undefined,
3360
+ undefined,
3361
+ { headers }
2993
3362
  );
2994
3363
 
2995
- const { error: res_error } = CartModel.SuccessMessage().validate(response, {
3364
+ let responseData = response;
3365
+ if (headers) {
3366
+ responseData = response[0];
3367
+ }
3368
+
3369
+ const {
3370
+ error: res_error,
3371
+ } = CartPlatformModel.SuccessMessage().validate(responseData, {
2996
3372
  abortEarly: false,
2997
3373
  allowUnknown: false,
2998
3374
  });
@@ -3000,27 +3376,26 @@ class Cart {
3000
3376
  if (res_error) {
3001
3377
  Logger({
3002
3378
  level: "WARN",
3003
- message: "Response Validation Warnnings for removePriceAdjustment",
3379
+ message: `Response Validation Warnnings for platform > Cart > removePriceAdjustment \n ${res_error}`,
3004
3380
  });
3005
- Logger({ level: "WARN", message: res_error });
3006
3381
  }
3007
3382
 
3008
3383
  return response;
3009
3384
  }
3010
3385
 
3011
3386
  /**
3012
- * @param {Object} arg - Arg object.
3013
- * @param {string} [arg.cartId] -
3014
- * @param {boolean} [arg.buyNow] -
3015
- * @param {boolean} [arg.i] -
3016
- * @param {boolean} [arg.b] -
3017
- * @param {PlatformSelectCartAddressRequest} arg.body
3018
- * @returns {Promise<CartDetailResponse>} - Success response
3387
+ * @param {CartPlatformApplicationValidator.SelectAddressParam} arg - Arg object
3388
+ * @param {import("../PlatformAPIClient").Options} - Options
3389
+ * @returns {Promise<CartPlatformModel.CartDetailResponse>} - Success response
3390
+ * @name selectAddress
3019
3391
  * @summary: Select an address from available addresses
3020
- * @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 `PlatformSelectCartAddressRequest` 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>
3392
+ * @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 `PlatformSelectCartAddressRequest` 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> - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/cart/selectAddress/).
3021
3393
  */
3022
- async selectAddress({ body, cartId, buyNow, i, b } = {}) {
3023
- const { error } = CartValidator.selectAddress().validate(
3394
+ async selectAddress(
3395
+ { body, cartId, buyNow, i, b } = {},
3396
+ { headers } = { headers: false }
3397
+ ) {
3398
+ const { error } = CartPlatformApplicationValidator.selectAddress().validate(
3024
3399
  {
3025
3400
  body,
3026
3401
  cartId,
@@ -3035,7 +3410,9 @@ class Cart {
3035
3410
  }
3036
3411
 
3037
3412
  // Showing warrnings if extra unknown parameters are found
3038
- const { error: warrning } = CartValidator.selectAddress().validate(
3413
+ const {
3414
+ error: warrning,
3415
+ } = CartPlatformApplicationValidator.selectAddress().validate(
3039
3416
  {
3040
3417
  body,
3041
3418
  cartId,
@@ -3048,9 +3425,8 @@ class Cart {
3048
3425
  if (warrning) {
3049
3426
  Logger({
3050
3427
  level: "WARN",
3051
- message: "Parameter Validation warrnings for selectAddress",
3428
+ message: `Parameter Validation warrnings for platform > Cart > selectAddress \n ${warrning}`,
3052
3429
  });
3053
- Logger({ level: "WARN", message: warrning });
3054
3430
  }
3055
3431
 
3056
3432
  const query_params = {};
@@ -3064,12 +3440,19 @@ class Cart {
3064
3440
  "post",
3065
3441
  `/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/select-address`,
3066
3442
  query_params,
3067
- body
3443
+ body,
3444
+ undefined,
3445
+ { headers }
3068
3446
  );
3069
3447
 
3448
+ let responseData = response;
3449
+ if (headers) {
3450
+ responseData = response[0];
3451
+ }
3452
+
3070
3453
  const {
3071
3454
  error: res_error,
3072
- } = CartModel.CartDetailResponse().validate(response, {
3455
+ } = CartPlatformModel.CartDetailResponse().validate(responseData, {
3073
3456
  abortEarly: false,
3074
3457
  allowUnknown: false,
3075
3458
  });
@@ -3077,28 +3460,28 @@ class Cart {
3077
3460
  if (res_error) {
3078
3461
  Logger({
3079
3462
  level: "WARN",
3080
- message: "Response Validation Warnnings for selectAddress",
3463
+ message: `Response Validation Warnnings for platform > Cart > selectAddress \n ${res_error}`,
3081
3464
  });
3082
- Logger({ level: "WARN", message: res_error });
3083
3465
  }
3084
3466
 
3085
3467
  return response;
3086
3468
  }
3087
3469
 
3088
3470
  /**
3089
- * @param {Object} arg - Arg object.
3090
- * @param {string} [arg.id] -
3091
- * @param {boolean} [arg.buyNow] -
3092
- * @param {string} [arg.orderType] - The order type of shipment HomeDelivery
3093
- * - If the customer wants the order home-delivered PickAtStore - If the
3094
- * customer wants the handover of an order at the store itself.
3095
- * @param {UpdateCartPaymentRequest} arg.body
3096
- * @returns {Promise<CartDetailResponse>} - Success response
3471
+ * @param {CartPlatformApplicationValidator.SelectPaymentModeParam} arg - Arg object
3472
+ * @param {import("../PlatformAPIClient").Options} - Options
3473
+ * @returns {Promise<CartPlatformModel.CartDetailResponse>} - Success response
3474
+ * @name selectPaymentMode
3097
3475
  * @summary: Update cart payment
3098
- * @description: Use this API to update cart payment.
3476
+ * @description: Use this API to update cart payment. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/cart/selectPaymentMode/).
3099
3477
  */
3100
- async selectPaymentMode({ body, id, buyNow, orderType } = {}) {
3101
- const { error } = CartValidator.selectPaymentMode().validate(
3478
+ async selectPaymentMode(
3479
+ { body, id, buyNow, orderType } = {},
3480
+ { headers } = { headers: false }
3481
+ ) {
3482
+ const {
3483
+ error,
3484
+ } = CartPlatformApplicationValidator.selectPaymentMode().validate(
3102
3485
  {
3103
3486
  body,
3104
3487
  id,
@@ -3112,7 +3495,9 @@ class Cart {
3112
3495
  }
3113
3496
 
3114
3497
  // Showing warrnings if extra unknown parameters are found
3115
- const { error: warrning } = CartValidator.selectPaymentMode().validate(
3498
+ const {
3499
+ error: warrning,
3500
+ } = CartPlatformApplicationValidator.selectPaymentMode().validate(
3116
3501
  {
3117
3502
  body,
3118
3503
  id,
@@ -3124,9 +3509,8 @@ class Cart {
3124
3509
  if (warrning) {
3125
3510
  Logger({
3126
3511
  level: "WARN",
3127
- message: "Parameter Validation warrnings for selectPaymentMode",
3512
+ message: `Parameter Validation warrnings for platform > Cart > selectPaymentMode \n ${warrning}`,
3128
3513
  });
3129
- Logger({ level: "WARN", message: warrning });
3130
3514
  }
3131
3515
 
3132
3516
  const query_params = {};
@@ -3139,12 +3523,19 @@ class Cart {
3139
3523
  "put",
3140
3524
  `/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/payment`,
3141
3525
  query_params,
3142
- body
3526
+ body,
3527
+ undefined,
3528
+ { headers }
3143
3529
  );
3144
3530
 
3531
+ let responseData = response;
3532
+ if (headers) {
3533
+ responseData = response[0];
3534
+ }
3535
+
3145
3536
  const {
3146
3537
  error: res_error,
3147
- } = CartModel.CartDetailResponse().validate(response, {
3538
+ } = CartPlatformModel.CartDetailResponse().validate(responseData, {
3148
3539
  abortEarly: false,
3149
3540
  allowUnknown: false,
3150
3541
  });
@@ -3152,28 +3543,28 @@ class Cart {
3152
3543
  if (res_error) {
3153
3544
  Logger({
3154
3545
  level: "WARN",
3155
- message: "Response Validation Warnnings for selectPaymentMode",
3546
+ message: `Response Validation Warnnings for platform > Cart > selectPaymentMode \n ${res_error}`,
3156
3547
  });
3157
- Logger({ level: "WARN", message: res_error });
3158
3548
  }
3159
3549
 
3160
3550
  return response;
3161
3551
  }
3162
3552
 
3163
3553
  /**
3164
- * @param {Object} arg - Arg object.
3165
- * @param {string} [arg.id] -
3166
- * @param {boolean} [arg.buyNow] -
3167
- * @param {string} [arg.orderType] - The order type of shipment HomeDelivery
3168
- * - If the customer wants the order home-delivered PickAtStore - If the
3169
- * customer wants the handover of an order at the store itself.
3170
- * @param {UpdateCartPaymentRequestV2} arg.body
3171
- * @returns {Promise<CartDetailResponse>} - Success response
3554
+ * @param {CartPlatformApplicationValidator.SelectPaymentModeV2Param} arg - Arg object
3555
+ * @param {import("../PlatformAPIClient").Options} - Options
3556
+ * @returns {Promise<CartPlatformModel.CartDetailResponse>} - Success response
3557
+ * @name selectPaymentModeV2
3172
3558
  * @summary: Update cart payment
3173
- * @description: Use this API to update cart payment.
3559
+ * @description: Use this API to update cart payment. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/cart/selectPaymentModeV2/).
3174
3560
  */
3175
- async selectPaymentModeV2({ body, id, buyNow, orderType } = {}) {
3176
- const { error } = CartValidator.selectPaymentModeV2().validate(
3561
+ async selectPaymentModeV2(
3562
+ { body, id, buyNow, orderType } = {},
3563
+ { headers } = { headers: false }
3564
+ ) {
3565
+ const {
3566
+ error,
3567
+ } = CartPlatformApplicationValidator.selectPaymentModeV2().validate(
3177
3568
  {
3178
3569
  body,
3179
3570
  id,
@@ -3187,7 +3578,9 @@ class Cart {
3187
3578
  }
3188
3579
 
3189
3580
  // Showing warrnings if extra unknown parameters are found
3190
- const { error: warrning } = CartValidator.selectPaymentModeV2().validate(
3581
+ const {
3582
+ error: warrning,
3583
+ } = CartPlatformApplicationValidator.selectPaymentModeV2().validate(
3191
3584
  {
3192
3585
  body,
3193
3586
  id,
@@ -3199,9 +3592,8 @@ class Cart {
3199
3592
  if (warrning) {
3200
3593
  Logger({
3201
3594
  level: "WARN",
3202
- message: "Parameter Validation warrnings for selectPaymentModeV2",
3595
+ message: `Parameter Validation warrnings for platform > Cart > selectPaymentModeV2 \n ${warrning}`,
3203
3596
  });
3204
- Logger({ level: "WARN", message: warrning });
3205
3597
  }
3206
3598
 
3207
3599
  const query_params = {};
@@ -3214,12 +3606,19 @@ class Cart {
3214
3606
  "put",
3215
3607
  `/service/platform/cart/v2.0/company/${this.config.companyId}/application/${this.applicationId}/payment`,
3216
3608
  query_params,
3217
- body
3609
+ body,
3610
+ undefined,
3611
+ { headers }
3218
3612
  );
3219
3613
 
3614
+ let responseData = response;
3615
+ if (headers) {
3616
+ responseData = response[0];
3617
+ }
3618
+
3220
3619
  const {
3221
3620
  error: res_error,
3222
- } = CartModel.CartDetailResponse().validate(response, {
3621
+ } = CartPlatformModel.CartDetailResponse().validate(responseData, {
3223
3622
  abortEarly: false,
3224
3623
  allowUnknown: false,
3225
3624
  });
@@ -3227,24 +3626,23 @@ class Cart {
3227
3626
  if (res_error) {
3228
3627
  Logger({
3229
3628
  level: "WARN",
3230
- message: "Response Validation Warnnings for selectPaymentModeV2",
3629
+ message: `Response Validation Warnnings for platform > Cart > selectPaymentModeV2 \n ${res_error}`,
3231
3630
  });
3232
- Logger({ level: "WARN", message: res_error });
3233
3631
  }
3234
3632
 
3235
3633
  return response;
3236
3634
  }
3237
3635
 
3238
3636
  /**
3239
- * @param {Object} arg - Arg object.
3240
- * @param {string} arg.id - ID allotted to the selected address
3241
- * @param {PlatformAddress} arg.body
3242
- * @returns {Promise<UpdateAddressResponse>} - Success response
3637
+ * @param {CartPlatformApplicationValidator.UpdateAddressParam} arg - Arg object
3638
+ * @param {import("../PlatformAPIClient").Options} - Options
3639
+ * @returns {Promise<CartPlatformModel.UpdateAddressResponse>} - Success response
3640
+ * @name updateAddress
3243
3641
  * @summary: Update address added to an account
3244
- * @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>
3642
+ * @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> - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/cart/updateAddress/).
3245
3643
  */
3246
- async updateAddress({ id, body } = {}) {
3247
- const { error } = CartValidator.updateAddress().validate(
3644
+ async updateAddress({ id, body } = {}, { headers } = { headers: false }) {
3645
+ const { error } = CartPlatformApplicationValidator.updateAddress().validate(
3248
3646
  {
3249
3647
  id,
3250
3648
  body,
@@ -3256,7 +3654,9 @@ class Cart {
3256
3654
  }
3257
3655
 
3258
3656
  // Showing warrnings if extra unknown parameters are found
3259
- const { error: warrning } = CartValidator.updateAddress().validate(
3657
+ const {
3658
+ error: warrning,
3659
+ } = CartPlatformApplicationValidator.updateAddress().validate(
3260
3660
  {
3261
3661
  id,
3262
3662
  body,
@@ -3266,9 +3666,8 @@ class Cart {
3266
3666
  if (warrning) {
3267
3667
  Logger({
3268
3668
  level: "WARN",
3269
- message: "Parameter Validation warrnings for updateAddress",
3669
+ message: `Parameter Validation warrnings for platform > Cart > updateAddress \n ${warrning}`,
3270
3670
  });
3271
- Logger({ level: "WARN", message: warrning });
3272
3671
  }
3273
3672
 
3274
3673
  const query_params = {};
@@ -3278,12 +3677,19 @@ class Cart {
3278
3677
  "put",
3279
3678
  `/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/address/${id}`,
3280
3679
  query_params,
3281
- body
3680
+ body,
3681
+ undefined,
3682
+ { headers }
3282
3683
  );
3283
3684
 
3685
+ let responseData = response;
3686
+ if (headers) {
3687
+ responseData = response[0];
3688
+ }
3689
+
3284
3690
  const {
3285
3691
  error: res_error,
3286
- } = CartModel.UpdateAddressResponse().validate(response, {
3692
+ } = CartPlatformModel.UpdateAddressResponse().validate(responseData, {
3287
3693
  abortEarly: false,
3288
3694
  allowUnknown: false,
3289
3695
  });
@@ -3291,25 +3697,23 @@ class Cart {
3291
3697
  if (res_error) {
3292
3698
  Logger({
3293
3699
  level: "WARN",
3294
- message: "Response Validation Warnnings for updateAddress",
3700
+ message: `Response Validation Warnnings for platform > Cart > updateAddress \n ${res_error}`,
3295
3701
  });
3296
- Logger({ level: "WARN", message: res_error });
3297
3702
  }
3298
3703
 
3299
3704
  return response;
3300
3705
  }
3301
3706
 
3302
3707
  /**
3303
- * @param {Object} arg - Arg object.
3304
- * @param {string} arg.cartId - Current Cart _id
3305
- * @param {boolean} [arg.b] -
3306
- * @param {UpdateCartRequest} arg.body
3307
- * @returns {Promise<UpdateCartDetailResponse>} - Success response
3708
+ * @param {CartPlatformApplicationValidator.UpdateCartParam} arg - Arg object
3709
+ * @param {import("../PlatformAPIClient").Options} - Options
3710
+ * @returns {Promise<CartPlatformModel.UpdateCartDetailResponse>} - Success response
3711
+ * @name updateCart
3308
3712
  * @summary: Update items in the abandoned cart
3309
- * @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>
3713
+ * @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> - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/cart/updateCart/).
3310
3714
  */
3311
- async updateCart({ cartId, body, b } = {}) {
3312
- const { error } = CartValidator.updateCart().validate(
3715
+ async updateCart({ cartId, body, b } = {}, { headers } = { headers: false }) {
3716
+ const { error } = CartPlatformApplicationValidator.updateCart().validate(
3313
3717
  {
3314
3718
  cartId,
3315
3719
  body,
@@ -3322,7 +3726,9 @@ class Cart {
3322
3726
  }
3323
3727
 
3324
3728
  // Showing warrnings if extra unknown parameters are found
3325
- const { error: warrning } = CartValidator.updateCart().validate(
3729
+ const {
3730
+ error: warrning,
3731
+ } = CartPlatformApplicationValidator.updateCart().validate(
3326
3732
  {
3327
3733
  cartId,
3328
3734
  body,
@@ -3333,9 +3739,8 @@ class Cart {
3333
3739
  if (warrning) {
3334
3740
  Logger({
3335
3741
  level: "WARN",
3336
- message: "Parameter Validation warrnings for updateCart",
3742
+ message: `Parameter Validation warrnings for platform > Cart > updateCart \n ${warrning}`,
3337
3743
  });
3338
- Logger({ level: "WARN", message: warrning });
3339
3744
  }
3340
3745
 
3341
3746
  const query_params = {};
@@ -3346,12 +3751,19 @@ class Cart {
3346
3751
  "put",
3347
3752
  `/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/abandoned/carts/${cartId}`,
3348
3753
  query_params,
3349
- body
3754
+ body,
3755
+ undefined,
3756
+ { headers }
3350
3757
  );
3351
3758
 
3759
+ let responseData = response;
3760
+ if (headers) {
3761
+ responseData = response[0];
3762
+ }
3763
+
3352
3764
  const {
3353
3765
  error: res_error,
3354
- } = CartModel.UpdateCartDetailResponse().validate(response, {
3766
+ } = CartPlatformModel.UpdateCartDetailResponse().validate(responseData, {
3355
3767
  abortEarly: false,
3356
3768
  allowUnknown: false,
3357
3769
  });
@@ -3359,25 +3771,28 @@ class Cart {
3359
3771
  if (res_error) {
3360
3772
  Logger({
3361
3773
  level: "WARN",
3362
- message: "Response Validation Warnnings for updateCart",
3774
+ message: `Response Validation Warnnings for platform > Cart > updateCart \n ${res_error}`,
3363
3775
  });
3364
- Logger({ level: "WARN", message: res_error });
3365
3776
  }
3366
3777
 
3367
3778
  return response;
3368
3779
  }
3369
3780
 
3370
3781
  /**
3371
- * @param {Object} arg - Arg object.
3372
- * @param {string} [arg.id] -
3373
- * @param {boolean} [arg.buyNow] -
3374
- * @param {PlatformCartMetaRequest} arg.body
3375
- * @returns {Promise<CartMetaResponse>} - Success response
3782
+ * @param {CartPlatformApplicationValidator.UpdateCartMetaParam} arg - Arg object
3783
+ * @param {import("../PlatformAPIClient").Options} - Options
3784
+ * @returns {Promise<CartPlatformModel.CartMetaResponse>} - Success response
3785
+ * @name updateCartMeta
3376
3786
  * @summary: Update the cart meta for platform pos user
3377
- * @description: Use this API to update cart meta like checkout_mode and gstin.
3787
+ * @description: Use this API to update cart meta like checkout_mode and gstin. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/cart/updateCartMeta/).
3378
3788
  */
3379
- async updateCartMeta({ body, id, buyNow } = {}) {
3380
- const { error } = CartValidator.updateCartMeta().validate(
3789
+ async updateCartMeta(
3790
+ { body, id, buyNow } = {},
3791
+ { headers } = { headers: false }
3792
+ ) {
3793
+ const {
3794
+ error,
3795
+ } = CartPlatformApplicationValidator.updateCartMeta().validate(
3381
3796
  {
3382
3797
  body,
3383
3798
  id,
@@ -3390,7 +3805,9 @@ class Cart {
3390
3805
  }
3391
3806
 
3392
3807
  // Showing warrnings if extra unknown parameters are found
3393
- const { error: warrning } = CartValidator.updateCartMeta().validate(
3808
+ const {
3809
+ error: warrning,
3810
+ } = CartPlatformApplicationValidator.updateCartMeta().validate(
3394
3811
  {
3395
3812
  body,
3396
3813
  id,
@@ -3401,9 +3818,8 @@ class Cart {
3401
3818
  if (warrning) {
3402
3819
  Logger({
3403
3820
  level: "WARN",
3404
- message: "Parameter Validation warrnings for updateCartMeta",
3821
+ message: `Parameter Validation warrnings for platform > Cart > updateCartMeta \n ${warrning}`,
3405
3822
  });
3406
- Logger({ level: "WARN", message: warrning });
3407
3823
  }
3408
3824
 
3409
3825
  const query_params = {};
@@ -3415,35 +3831,50 @@ class Cart {
3415
3831
  "put",
3416
3832
  `/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/meta`,
3417
3833
  query_params,
3418
- body
3834
+ body,
3835
+ undefined,
3836
+ { headers }
3419
3837
  );
3420
3838
 
3421
- const { error: res_error } = CartModel.CartMetaResponse().validate(
3422
- response,
3423
- { abortEarly: false, allowUnknown: false }
3424
- );
3839
+ let responseData = response;
3840
+ if (headers) {
3841
+ responseData = response[0];
3842
+ }
3843
+
3844
+ const {
3845
+ error: res_error,
3846
+ } = CartPlatformModel.CartMetaResponse().validate(responseData, {
3847
+ abortEarly: false,
3848
+ allowUnknown: false,
3849
+ });
3425
3850
 
3426
3851
  if (res_error) {
3427
3852
  Logger({
3428
3853
  level: "WARN",
3429
- message: "Response Validation Warnnings for updateCartMeta",
3854
+ message: `Response Validation Warnnings for platform > Cart > updateCartMeta \n ${res_error}`,
3430
3855
  });
3431
- Logger({ level: "WARN", message: res_error });
3432
3856
  }
3433
3857
 
3434
3858
  return response;
3435
3859
  }
3436
3860
 
3437
3861
  /**
3438
- * @param {Object} arg - Arg object.
3439
- * @param {string} arg.cartMetaId -
3440
- * @param {CartMetaConfigUpdate} arg.body
3441
- * @returns {Promise<CartMetaConfigUpdate>} - Success response
3862
+ * @param {CartPlatformApplicationValidator.UpdateCartMetaConfigParam} arg
3863
+ * - Arg object
3864
+ *
3865
+ * @param {import("../PlatformAPIClient").Options} - Options
3866
+ * @returns {Promise<CartPlatformModel.CartMetaConfigUpdate>} - Success response
3867
+ * @name updateCartMetaConfig
3442
3868
  * @summary: Update cart meta configuration
3443
- * @description: Update cart meta configuration
3869
+ * @description: Update cart meta configuration - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/cart/updateCartMetaConfig/).
3444
3870
  */
3445
- async updateCartMetaConfig({ cartMetaId, body } = {}) {
3446
- const { error } = CartValidator.updateCartMetaConfig().validate(
3871
+ async updateCartMetaConfig(
3872
+ { cartMetaId, body } = {},
3873
+ { headers } = { headers: false }
3874
+ ) {
3875
+ const {
3876
+ error,
3877
+ } = CartPlatformApplicationValidator.updateCartMetaConfig().validate(
3447
3878
  {
3448
3879
  cartMetaId,
3449
3880
  body,
@@ -3455,7 +3886,9 @@ class Cart {
3455
3886
  }
3456
3887
 
3457
3888
  // Showing warrnings if extra unknown parameters are found
3458
- const { error: warrning } = CartValidator.updateCartMetaConfig().validate(
3889
+ const {
3890
+ error: warrning,
3891
+ } = CartPlatformApplicationValidator.updateCartMetaConfig().validate(
3459
3892
  {
3460
3893
  cartMetaId,
3461
3894
  body,
@@ -3465,9 +3898,8 @@ class Cart {
3465
3898
  if (warrning) {
3466
3899
  Logger({
3467
3900
  level: "WARN",
3468
- message: "Parameter Validation warrnings for updateCartMetaConfig",
3901
+ message: `Parameter Validation warrnings for platform > Cart > updateCartMetaConfig \n ${warrning}`,
3469
3902
  });
3470
- Logger({ level: "WARN", message: warrning });
3471
3903
  }
3472
3904
 
3473
3905
  const query_params = {};
@@ -3477,12 +3909,19 @@ class Cart {
3477
3909
  "put",
3478
3910
  `/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/cart_configuration/${cartMetaId}`,
3479
3911
  query_params,
3480
- body
3912
+ body,
3913
+ undefined,
3914
+ { headers }
3481
3915
  );
3482
3916
 
3917
+ let responseData = response;
3918
+ if (headers) {
3919
+ responseData = response[0];
3920
+ }
3921
+
3483
3922
  const {
3484
3923
  error: res_error,
3485
- } = CartModel.CartMetaConfigUpdate().validate(response, {
3924
+ } = CartPlatformModel.CartMetaConfigUpdate().validate(responseData, {
3486
3925
  abortEarly: false,
3487
3926
  allowUnknown: false,
3488
3927
  });
@@ -3490,24 +3929,25 @@ class Cart {
3490
3929
  if (res_error) {
3491
3930
  Logger({
3492
3931
  level: "WARN",
3493
- message: "Response Validation Warnnings for updateCartMetaConfig",
3932
+ message: `Response Validation Warnnings for platform > Cart > updateCartMetaConfig \n ${res_error}`,
3494
3933
  });
3495
- Logger({ level: "WARN", message: res_error });
3496
3934
  }
3497
3935
 
3498
3936
  return response;
3499
3937
  }
3500
3938
 
3501
3939
  /**
3502
- * @param {Object} arg - Arg object.
3503
- * @param {string} [arg.id] -
3504
- * @param {UpdateUserCartMapping} arg.body
3505
- * @returns {Promise<UserCartMappingResponse>} - Success response
3940
+ * @param {CartPlatformApplicationValidator.UpdateCartUserParam} arg - Arg object
3941
+ * @param {import("../PlatformAPIClient").Options} - Options
3942
+ * @returns {Promise<CartPlatformModel.UserCartMappingResponse>} - Success response
3943
+ * @name updateCartUser
3506
3944
  * @summary: Update user id for store os customer
3507
- * @description: Update user id for store os customer after creating customer
3945
+ * @description: Update user id for store os customer after creating customer - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/cart/updateCartUser/).
3508
3946
  */
3509
- async updateCartUser({ body, id } = {}) {
3510
- const { error } = CartValidator.updateCartUser().validate(
3947
+ async updateCartUser({ body, id } = {}, { headers } = { headers: false }) {
3948
+ const {
3949
+ error,
3950
+ } = CartPlatformApplicationValidator.updateCartUser().validate(
3511
3951
  {
3512
3952
  body,
3513
3953
  id,
@@ -3519,7 +3959,9 @@ class Cart {
3519
3959
  }
3520
3960
 
3521
3961
  // Showing warrnings if extra unknown parameters are found
3522
- const { error: warrning } = CartValidator.updateCartUser().validate(
3962
+ const {
3963
+ error: warrning,
3964
+ } = CartPlatformApplicationValidator.updateCartUser().validate(
3523
3965
  {
3524
3966
  body,
3525
3967
  id,
@@ -3529,9 +3971,8 @@ class Cart {
3529
3971
  if (warrning) {
3530
3972
  Logger({
3531
3973
  level: "WARN",
3532
- message: "Parameter Validation warrnings for updateCartUser",
3974
+ message: `Parameter Validation warrnings for platform > Cart > updateCartUser \n ${warrning}`,
3533
3975
  });
3534
- Logger({ level: "WARN", message: warrning });
3535
3976
  }
3536
3977
 
3537
3978
  const query_params = {};
@@ -3542,12 +3983,19 @@ class Cart {
3542
3983
  "put",
3543
3984
  `/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/update-user`,
3544
3985
  query_params,
3545
- body
3986
+ body,
3987
+ undefined,
3988
+ { headers }
3546
3989
  );
3547
3990
 
3991
+ let responseData = response;
3992
+ if (headers) {
3993
+ responseData = response[0];
3994
+ }
3995
+
3548
3996
  const {
3549
3997
  error: res_error,
3550
- } = CartModel.UserCartMappingResponse().validate(response, {
3998
+ } = CartPlatformModel.UserCartMappingResponse().validate(responseData, {
3551
3999
  abortEarly: false,
3552
4000
  allowUnknown: false,
3553
4001
  });
@@ -3555,26 +4003,30 @@ class Cart {
3555
4003
  if (res_error) {
3556
4004
  Logger({
3557
4005
  level: "WARN",
3558
- message: "Response Validation Warnnings for updateCartUser",
4006
+ message: `Response Validation Warnnings for platform > Cart > updateCartUser \n ${res_error}`,
3559
4007
  });
3560
- Logger({ level: "WARN", message: res_error });
3561
4008
  }
3562
4009
 
3563
4010
  return response;
3564
4011
  }
3565
4012
 
3566
4013
  /**
3567
- * @param {Object} arg - Arg object.
3568
- * @param {string} arg.token - Token of the shared short link
3569
- * @param {string} arg.action - Operation to perform on the existing cart
3570
- * merge or replace.
3571
- * @param {string} [arg.cartId] -
3572
- * @returns {Promise<SharedCartResponse>} - Success response
4014
+ * @param {CartPlatformApplicationValidator.UpdateCartWithSharedItemsParam} arg
4015
+ * - Arg object
4016
+ *
4017
+ * @param {import("../PlatformAPIClient").Options} - Options
4018
+ * @returns {Promise<CartPlatformModel.SharedCartResponse>} - Success response
4019
+ * @name updateCartWithSharedItems
3573
4020
  * @summary: Merge or replace existing cart
3574
- * @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.
4021
+ * @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. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/cart/updateCartWithSharedItems/).
3575
4022
  */
3576
- async updateCartWithSharedItems({ token, action, cartId } = {}) {
3577
- const { error } = CartValidator.updateCartWithSharedItems().validate(
4023
+ async updateCartWithSharedItems(
4024
+ { token, action, cartId } = {},
4025
+ { headers } = { headers: false }
4026
+ ) {
4027
+ const {
4028
+ error,
4029
+ } = CartPlatformApplicationValidator.updateCartWithSharedItems().validate(
3578
4030
  {
3579
4031
  token,
3580
4032
  action,
@@ -3589,7 +4041,7 @@ class Cart {
3589
4041
  // Showing warrnings if extra unknown parameters are found
3590
4042
  const {
3591
4043
  error: warrning,
3592
- } = CartValidator.updateCartWithSharedItems().validate(
4044
+ } = CartPlatformApplicationValidator.updateCartWithSharedItems().validate(
3593
4045
  {
3594
4046
  token,
3595
4047
  action,
@@ -3600,9 +4052,8 @@ class Cart {
3600
4052
  if (warrning) {
3601
4053
  Logger({
3602
4054
  level: "WARN",
3603
- message: "Parameter Validation warrnings for updateCartWithSharedItems",
4055
+ message: `Parameter Validation warrnings for platform > Cart > updateCartWithSharedItems \n ${warrning}`,
3604
4056
  });
3605
- Logger({ level: "WARN", message: warrning });
3606
4057
  }
3607
4058
 
3608
4059
  const query_params = {};
@@ -3613,12 +4064,19 @@ class Cart {
3613
4064
  "post",
3614
4065
  `/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/share-cart/${token}/${action}`,
3615
4066
  query_params,
3616
- undefined
4067
+ undefined,
4068
+ undefined,
4069
+ { headers }
3617
4070
  );
3618
4071
 
4072
+ let responseData = response;
4073
+ if (headers) {
4074
+ responseData = response[0];
4075
+ }
4076
+
3619
4077
  const {
3620
4078
  error: res_error,
3621
- } = CartModel.SharedCartResponse().validate(response, {
4079
+ } = CartPlatformModel.SharedCartResponse().validate(responseData, {
3622
4080
  abortEarly: false,
3623
4081
  allowUnknown: false,
3624
4082
  });
@@ -3626,24 +4084,23 @@ class Cart {
3626
4084
  if (res_error) {
3627
4085
  Logger({
3628
4086
  level: "WARN",
3629
- message: "Response Validation Warnnings for updateCartWithSharedItems",
4087
+ message: `Response Validation Warnnings for platform > Cart > updateCartWithSharedItems \n ${res_error}`,
3630
4088
  });
3631
- Logger({ level: "WARN", message: res_error });
3632
4089
  }
3633
4090
 
3634
4091
  return response;
3635
4092
  }
3636
4093
 
3637
4094
  /**
3638
- * @param {Object} arg - Arg object.
3639
- * @param {string} arg.id -
3640
- * @param {CouponUpdate} arg.body
3641
- * @returns {Promise<SuccessMessage>} - Success response
4095
+ * @param {CartPlatformApplicationValidator.UpdateCouponParam} arg - Arg object
4096
+ * @param {import("../PlatformAPIClient").Options} - Options
4097
+ * @returns {Promise<CartPlatformModel.SuccessMessage>} - Success response
4098
+ * @name updateCoupon
3642
4099
  * @summary: Update existing coupon configuration
3643
- * @description: Update coupon with id sent in `id`
4100
+ * @description: Update coupon with id sent in `id` - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/cart/updateCoupon/).
3644
4101
  */
3645
- async updateCoupon({ id, body } = {}) {
3646
- const { error } = CartValidator.updateCoupon().validate(
4102
+ async updateCoupon({ id, body } = {}, { headers } = { headers: false }) {
4103
+ const { error } = CartPlatformApplicationValidator.updateCoupon().validate(
3647
4104
  {
3648
4105
  id,
3649
4106
  body,
@@ -3655,7 +4112,9 @@ class Cart {
3655
4112
  }
3656
4113
 
3657
4114
  // Showing warrnings if extra unknown parameters are found
3658
- const { error: warrning } = CartValidator.updateCoupon().validate(
4115
+ const {
4116
+ error: warrning,
4117
+ } = CartPlatformApplicationValidator.updateCoupon().validate(
3659
4118
  {
3660
4119
  id,
3661
4120
  body,
@@ -3665,9 +4124,8 @@ class Cart {
3665
4124
  if (warrning) {
3666
4125
  Logger({
3667
4126
  level: "WARN",
3668
- message: "Parameter Validation warrnings for updateCoupon",
4127
+ message: `Parameter Validation warrnings for platform > Cart > updateCoupon \n ${warrning}`,
3669
4128
  });
3670
- Logger({ level: "WARN", message: warrning });
3671
4129
  }
3672
4130
 
3673
4131
  const query_params = {};
@@ -3677,10 +4135,19 @@ class Cart {
3677
4135
  "put",
3678
4136
  `/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/coupon/${id}`,
3679
4137
  query_params,
3680
- body
4138
+ body,
4139
+ undefined,
4140
+ { headers }
3681
4141
  );
3682
4142
 
3683
- const { error: res_error } = CartModel.SuccessMessage().validate(response, {
4143
+ let responseData = response;
4144
+ if (headers) {
4145
+ responseData = response[0];
4146
+ }
4147
+
4148
+ const {
4149
+ error: res_error,
4150
+ } = CartPlatformModel.SuccessMessage().validate(responseData, {
3684
4151
  abortEarly: false,
3685
4152
  allowUnknown: false,
3686
4153
  });
@@ -3688,24 +4155,30 @@ class Cart {
3688
4155
  if (res_error) {
3689
4156
  Logger({
3690
4157
  level: "WARN",
3691
- message: "Response Validation Warnnings for updateCoupon",
4158
+ message: `Response Validation Warnnings for platform > Cart > updateCoupon \n ${res_error}`,
3692
4159
  });
3693
- Logger({ level: "WARN", message: res_error });
3694
4160
  }
3695
4161
 
3696
4162
  return response;
3697
4163
  }
3698
4164
 
3699
4165
  /**
3700
- * @param {Object} arg - Arg object.
3701
- * @param {string} arg.id -
3702
- * @param {CouponPartialUpdate} arg.body
3703
- * @returns {Promise<SuccessMessage>} - Success response
4166
+ * @param {CartPlatformApplicationValidator.UpdateCouponPartiallyParam} arg
4167
+ * - Arg object
4168
+ *
4169
+ * @param {import("../PlatformAPIClient").Options} - Options
4170
+ * @returns {Promise<CartPlatformModel.SuccessMessage>} - Success response
4171
+ * @name updateCouponPartially
3704
4172
  * @summary: Update coupon archive state and schedule
3705
- * @description: Update archive/unarchive and change schedule for coupon
4173
+ * @description: Update archive/unarchive and change schedule for coupon - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/cart/updateCouponPartially/).
3706
4174
  */
3707
- async updateCouponPartially({ id, body } = {}) {
3708
- const { error } = CartValidator.updateCouponPartially().validate(
4175
+ async updateCouponPartially(
4176
+ { id, body } = {},
4177
+ { headers } = { headers: false }
4178
+ ) {
4179
+ const {
4180
+ error,
4181
+ } = CartPlatformApplicationValidator.updateCouponPartially().validate(
3709
4182
  {
3710
4183
  id,
3711
4184
  body,
@@ -3717,7 +4190,9 @@ class Cart {
3717
4190
  }
3718
4191
 
3719
4192
  // Showing warrnings if extra unknown parameters are found
3720
- const { error: warrning } = CartValidator.updateCouponPartially().validate(
4193
+ const {
4194
+ error: warrning,
4195
+ } = CartPlatformApplicationValidator.updateCouponPartially().validate(
3721
4196
  {
3722
4197
  id,
3723
4198
  body,
@@ -3727,9 +4202,8 @@ class Cart {
3727
4202
  if (warrning) {
3728
4203
  Logger({
3729
4204
  level: "WARN",
3730
- message: "Parameter Validation warrnings for updateCouponPartially",
4205
+ message: `Parameter Validation warrnings for platform > Cart > updateCouponPartially \n ${warrning}`,
3731
4206
  });
3732
- Logger({ level: "WARN", message: warrning });
3733
4207
  }
3734
4208
 
3735
4209
  const query_params = {};
@@ -3739,10 +4213,19 @@ class Cart {
3739
4213
  "patch",
3740
4214
  `/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/coupon/${id}`,
3741
4215
  query_params,
3742
- body
4216
+ body,
4217
+ undefined,
4218
+ { headers }
3743
4219
  );
3744
4220
 
3745
- const { error: res_error } = CartModel.SuccessMessage().validate(response, {
4221
+ let responseData = response;
4222
+ if (headers) {
4223
+ responseData = response[0];
4224
+ }
4225
+
4226
+ const {
4227
+ error: res_error,
4228
+ } = CartPlatformModel.SuccessMessage().validate(responseData, {
3746
4229
  abortEarly: false,
3747
4230
  allowUnknown: false,
3748
4231
  });
@@ -3750,24 +4233,30 @@ class Cart {
3750
4233
  if (res_error) {
3751
4234
  Logger({
3752
4235
  level: "WARN",
3753
- message: "Response Validation Warnnings for updateCouponPartially",
4236
+ message: `Response Validation Warnnings for platform > Cart > updateCouponPartially \n ${res_error}`,
3754
4237
  });
3755
- Logger({ level: "WARN", message: res_error });
3756
4238
  }
3757
4239
 
3758
4240
  return response;
3759
4241
  }
3760
4242
 
3761
4243
  /**
3762
- * @param {Object} arg - Arg object.
3763
- * @param {string} arg.id -
3764
- * @param {PriceAdjustmentUpdate} arg.body
3765
- * @returns {Promise<PriceAdjustmentResponse>} - Success response
4244
+ * @param {CartPlatformApplicationValidator.UpdatePriceAdjustmentParam} arg
4245
+ * - Arg object
4246
+ *
4247
+ * @param {import("../PlatformAPIClient").Options} - Options
4248
+ * @returns {Promise<CartPlatformModel.PriceAdjustmentResponse>} - Success response
4249
+ * @name updatePriceAdjustment
3766
4250
  * @summary: Update price adjustment configuration
3767
- * @description: Update price adjustment configuration
4251
+ * @description: Update price adjustment configuration - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/cart/updatePriceAdjustment/).
3768
4252
  */
3769
- async updatePriceAdjustment({ id, body } = {}) {
3770
- const { error } = CartValidator.updatePriceAdjustment().validate(
4253
+ async updatePriceAdjustment(
4254
+ { id, body } = {},
4255
+ { headers } = { headers: false }
4256
+ ) {
4257
+ const {
4258
+ error,
4259
+ } = CartPlatformApplicationValidator.updatePriceAdjustment().validate(
3771
4260
  {
3772
4261
  id,
3773
4262
  body,
@@ -3779,7 +4268,9 @@ class Cart {
3779
4268
  }
3780
4269
 
3781
4270
  // Showing warrnings if extra unknown parameters are found
3782
- const { error: warrning } = CartValidator.updatePriceAdjustment().validate(
4271
+ const {
4272
+ error: warrning,
4273
+ } = CartPlatformApplicationValidator.updatePriceAdjustment().validate(
3783
4274
  {
3784
4275
  id,
3785
4276
  body,
@@ -3789,9 +4280,8 @@ class Cart {
3789
4280
  if (warrning) {
3790
4281
  Logger({
3791
4282
  level: "WARN",
3792
- message: "Parameter Validation warrnings for updatePriceAdjustment",
4283
+ message: `Parameter Validation warrnings for platform > Cart > updatePriceAdjustment \n ${warrning}`,
3793
4284
  });
3794
- Logger({ level: "WARN", message: warrning });
3795
4285
  }
3796
4286
 
3797
4287
  const query_params = {};
@@ -3801,12 +4291,19 @@ class Cart {
3801
4291
  "put",
3802
4292
  `/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/price-adjustment/${id}`,
3803
4293
  query_params,
3804
- body
4294
+ body,
4295
+ undefined,
4296
+ { headers }
3805
4297
  );
3806
4298
 
4299
+ let responseData = response;
4300
+ if (headers) {
4301
+ responseData = response[0];
4302
+ }
4303
+
3807
4304
  const {
3808
4305
  error: res_error,
3809
- } = CartModel.PriceAdjustmentResponse().validate(response, {
4306
+ } = CartPlatformModel.PriceAdjustmentResponse().validate(responseData, {
3810
4307
  abortEarly: false,
3811
4308
  allowUnknown: false,
3812
4309
  });
@@ -3814,24 +4311,25 @@ class Cart {
3814
4311
  if (res_error) {
3815
4312
  Logger({
3816
4313
  level: "WARN",
3817
- message: "Response Validation Warnnings for updatePriceAdjustment",
4314
+ message: `Response Validation Warnnings for platform > Cart > updatePriceAdjustment \n ${res_error}`,
3818
4315
  });
3819
- Logger({ level: "WARN", message: res_error });
3820
4316
  }
3821
4317
 
3822
4318
  return response;
3823
4319
  }
3824
4320
 
3825
4321
  /**
3826
- * @param {Object} arg - Arg object.
3827
- * @param {string} arg.id -
3828
- * @param {PromotionUpdate} arg.body
3829
- * @returns {Promise<PromotionUpdate>} - Success response
4322
+ * @param {CartPlatformApplicationValidator.UpdatePromotionParam} arg - Arg object
4323
+ * @param {import("../PlatformAPIClient").Options} - Options
4324
+ * @returns {Promise<CartPlatformModel.PromotionUpdate>} - Success response
4325
+ * @name updatePromotion
3830
4326
  * @summary: Update existing promotion configuration
3831
- * @description: Update promotion with id sent in `id`
4327
+ * @description: Update promotion with id sent in `id` - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/cart/updatePromotion/).
3832
4328
  */
3833
- async updatePromotion({ id, body } = {}) {
3834
- const { error } = CartValidator.updatePromotion().validate(
4329
+ async updatePromotion({ id, body } = {}, { headers } = { headers: false }) {
4330
+ const {
4331
+ error,
4332
+ } = CartPlatformApplicationValidator.updatePromotion().validate(
3835
4333
  {
3836
4334
  id,
3837
4335
  body,
@@ -3843,7 +4341,9 @@ class Cart {
3843
4341
  }
3844
4342
 
3845
4343
  // Showing warrnings if extra unknown parameters are found
3846
- const { error: warrning } = CartValidator.updatePromotion().validate(
4344
+ const {
4345
+ error: warrning,
4346
+ } = CartPlatformApplicationValidator.updatePromotion().validate(
3847
4347
  {
3848
4348
  id,
3849
4349
  body,
@@ -3853,9 +4353,8 @@ class Cart {
3853
4353
  if (warrning) {
3854
4354
  Logger({
3855
4355
  level: "WARN",
3856
- message: "Parameter Validation warrnings for updatePromotion",
4356
+ message: `Parameter Validation warrnings for platform > Cart > updatePromotion \n ${warrning}`,
3857
4357
  });
3858
- Logger({ level: "WARN", message: warrning });
3859
4358
  }
3860
4359
 
3861
4360
  const query_params = {};
@@ -3865,35 +4364,50 @@ class Cart {
3865
4364
  "put",
3866
4365
  `/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/promotion/${id}`,
3867
4366
  query_params,
3868
- body
4367
+ body,
4368
+ undefined,
4369
+ { headers }
3869
4370
  );
3870
4371
 
3871
- const { error: res_error } = CartModel.PromotionUpdate().validate(
3872
- response,
3873
- { abortEarly: false, allowUnknown: false }
3874
- );
4372
+ let responseData = response;
4373
+ if (headers) {
4374
+ responseData = response[0];
4375
+ }
4376
+
4377
+ const {
4378
+ error: res_error,
4379
+ } = CartPlatformModel.PromotionUpdate().validate(responseData, {
4380
+ abortEarly: false,
4381
+ allowUnknown: false,
4382
+ });
3875
4383
 
3876
4384
  if (res_error) {
3877
4385
  Logger({
3878
4386
  level: "WARN",
3879
- message: "Response Validation Warnnings for updatePromotion",
4387
+ message: `Response Validation Warnnings for platform > Cart > updatePromotion \n ${res_error}`,
3880
4388
  });
3881
- Logger({ level: "WARN", message: res_error });
3882
4389
  }
3883
4390
 
3884
4391
  return response;
3885
4392
  }
3886
4393
 
3887
4394
  /**
3888
- * @param {Object} arg - Arg object.
3889
- * @param {string} arg.id -
3890
- * @param {PromotionPartialUpdate} arg.body
3891
- * @returns {Promise<SuccessMessage>} - Success response
4395
+ * @param {CartPlatformApplicationValidator.UpdatePromotionPartiallyParam} arg
4396
+ * - Arg object
4397
+ *
4398
+ * @param {import("../PlatformAPIClient").Options} - Options
4399
+ * @returns {Promise<CartPlatformModel.SuccessMessage>} - Success response
4400
+ * @name updatePromotionPartially
3892
4401
  * @summary: Update promotion publish state and schedule
3893
- * @description: Update publish/unpublish and change schedule for promotion
4402
+ * @description: Update publish/unpublish and change schedule for promotion - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/cart/updatePromotionPartially/).
3894
4403
  */
3895
- async updatePromotionPartially({ id, body } = {}) {
3896
- const { error } = CartValidator.updatePromotionPartially().validate(
4404
+ async updatePromotionPartially(
4405
+ { id, body } = {},
4406
+ { headers } = { headers: false }
4407
+ ) {
4408
+ const {
4409
+ error,
4410
+ } = CartPlatformApplicationValidator.updatePromotionPartially().validate(
3897
4411
  {
3898
4412
  id,
3899
4413
  body,
@@ -3907,7 +4421,7 @@ class Cart {
3907
4421
  // Showing warrnings if extra unknown parameters are found
3908
4422
  const {
3909
4423
  error: warrning,
3910
- } = CartValidator.updatePromotionPartially().validate(
4424
+ } = CartPlatformApplicationValidator.updatePromotionPartially().validate(
3911
4425
  {
3912
4426
  id,
3913
4427
  body,
@@ -3917,9 +4431,8 @@ class Cart {
3917
4431
  if (warrning) {
3918
4432
  Logger({
3919
4433
  level: "WARN",
3920
- message: "Parameter Validation warrnings for updatePromotionPartially",
4434
+ message: `Parameter Validation warrnings for platform > Cart > updatePromotionPartially \n ${warrning}`,
3921
4435
  });
3922
- Logger({ level: "WARN", message: warrning });
3923
4436
  }
3924
4437
 
3925
4438
  const query_params = {};
@@ -3929,10 +4442,19 @@ class Cart {
3929
4442
  "patch",
3930
4443
  `/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/promotion/${id}`,
3931
4444
  query_params,
3932
- body
4445
+ body,
4446
+ undefined,
4447
+ { headers }
3933
4448
  );
3934
4449
 
3935
- const { error: res_error } = CartModel.SuccessMessage().validate(response, {
4450
+ let responseData = response;
4451
+ if (headers) {
4452
+ responseData = response[0];
4453
+ }
4454
+
4455
+ const {
4456
+ error: res_error,
4457
+ } = CartPlatformModel.SuccessMessage().validate(responseData, {
3936
4458
  abortEarly: false,
3937
4459
  allowUnknown: false,
3938
4460
  });
@@ -3940,42 +4462,29 @@ class Cart {
3940
4462
  if (res_error) {
3941
4463
  Logger({
3942
4464
  level: "WARN",
3943
- message: "Response Validation Warnnings for updatePromotionPartially",
4465
+ message: `Response Validation Warnnings for platform > Cart > updatePromotionPartially \n ${res_error}`,
3944
4466
  });
3945
- Logger({ level: "WARN", message: res_error });
3946
4467
  }
3947
4468
 
3948
4469
  return response;
3949
4470
  }
3950
4471
 
3951
4472
  /**
3952
- * @param {Object} arg - Arg object.
3953
- * @param {boolean} [arg.i] - This is a boolean value. Select `true` to
3954
- * retrieve all the items added in the cart.
3955
- * @param {boolean} [arg.p] - This is a boolean value. Select `true` for
3956
- * getting a payment option in response.
3957
- * @param {string} [arg.id] - The unique identifier of the cart
3958
- * @param {string} [arg.addressId] - ID allotted to an address
3959
- * @param {string} [arg.areaCode] - The PIN Code of the destination address,
3960
- * e.g. 400059
3961
- * @param {string} [arg.orderType] - The order type of shipment HomeDelivery
3962
- * - If the customer wants the order home-delivered PickAtStore - If the
3963
- * customer wants the handover of an order at the store itself.
3964
- * @param {UpdateCartShipmentRequest} arg.body
3965
- * @returns {Promise<PlatformCartShipmentsResponse>} - Success response
4473
+ * @param {CartPlatformApplicationValidator.UpdateShipmentsParam} arg - Arg object
4474
+ * @param {import("../PlatformAPIClient").Options} - Options
4475
+ * @returns {Promise<CartPlatformModel.PlatformCartShipmentsResponse>} -
4476
+ * Success response
4477
+ * @name updateShipments
3966
4478
  * @summary: Update shipment delivery type and quantity before checkout
3967
- * @description: Use this API to update the delivery type and quantity as per customer's preference for either store pick-up or home-delivery.
4479
+ * @description: Use this API to update the delivery type and quantity as per customer's preference for either store pick-up or home-delivery. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/cart/updateShipments/).
3968
4480
  */
3969
- async updateShipments({
3970
- body,
3971
- i,
3972
- p,
3973
- id,
3974
- addressId,
3975
- areaCode,
3976
- orderType,
3977
- } = {}) {
3978
- const { error } = CartValidator.updateShipments().validate(
4481
+ async updateShipments(
4482
+ { body, i, p, id, addressId, areaCode, orderType } = {},
4483
+ { headers } = { headers: false }
4484
+ ) {
4485
+ const {
4486
+ error,
4487
+ } = CartPlatformApplicationValidator.updateShipments().validate(
3979
4488
  {
3980
4489
  body,
3981
4490
  i,
@@ -3992,7 +4501,9 @@ class Cart {
3992
4501
  }
3993
4502
 
3994
4503
  // Showing warrnings if extra unknown parameters are found
3995
- const { error: warrning } = CartValidator.updateShipments().validate(
4504
+ const {
4505
+ error: warrning,
4506
+ } = CartPlatformApplicationValidator.updateShipments().validate(
3996
4507
  {
3997
4508
  body,
3998
4509
  i,
@@ -4007,9 +4518,8 @@ class Cart {
4007
4518
  if (warrning) {
4008
4519
  Logger({
4009
4520
  level: "WARN",
4010
- message: "Parameter Validation warrnings for updateShipments",
4521
+ message: `Parameter Validation warrnings for platform > Cart > updateShipments \n ${warrning}`,
4011
4522
  });
4012
- Logger({ level: "WARN", message: warrning });
4013
4523
  }
4014
4524
 
4015
4525
  const query_params = {};
@@ -4025,50 +4535,58 @@ class Cart {
4025
4535
  "put",
4026
4536
  `/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/shipment`,
4027
4537
  query_params,
4028
- body
4538
+ body,
4539
+ undefined,
4540
+ { headers }
4029
4541
  );
4030
4542
 
4543
+ let responseData = response;
4544
+ if (headers) {
4545
+ responseData = response[0];
4546
+ }
4547
+
4031
4548
  const {
4032
4549
  error: res_error,
4033
- } = CartModel.PlatformCartShipmentsResponse().validate(response, {
4034
- abortEarly: false,
4035
- allowUnknown: false,
4036
- });
4550
+ } = CartPlatformModel.PlatformCartShipmentsResponse().validate(
4551
+ responseData,
4552
+ { abortEarly: false, allowUnknown: false }
4553
+ );
4037
4554
 
4038
4555
  if (res_error) {
4039
4556
  Logger({
4040
4557
  level: "WARN",
4041
- message: "Response Validation Warnnings for updateShipments",
4558
+ message: `Response Validation Warnnings for platform > Cart > updateShipments \n ${res_error}`,
4042
4559
  });
4043
- Logger({ level: "WARN", message: res_error });
4044
4560
  }
4045
4561
 
4046
4562
  return response;
4047
4563
  }
4048
4564
 
4049
4565
  /**
4050
- * @param {Object} arg - Arg object.
4051
- * @param {string} [arg.id] -
4052
- * @param {boolean} [arg.buyNow] -
4053
- * @param {string} [arg.addressId] -
4054
- * @param {string} [arg.paymentMode] -
4055
- * @param {string} [arg.paymentIdentifier] -
4056
- * @param {string} [arg.aggregatorName] -
4057
- * @param {string} [arg.merchantCode] -
4058
- * @returns {Promise<PaymentCouponValidate>} - Success response
4566
+ * @param {CartPlatformApplicationValidator.ValidateCouponForPaymentParam} arg
4567
+ * - Arg object
4568
+ *
4569
+ * @param {import("../PlatformAPIClient").Options} - Options
4570
+ * @returns {Promise<CartPlatformModel.PaymentCouponValidate>} - Success response
4571
+ * @name validateCouponForPayment
4059
4572
  * @summary: Verify the coupon eligibility against the payment mode
4060
- * @description: Use this API to validate a coupon against the payment mode such as NetBanking, Wallet, UPI etc.
4573
+ * @description: Use this API to validate a coupon against the payment mode such as NetBanking, Wallet, UPI etc. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/cart/validateCouponForPayment/).
4061
4574
  */
4062
- async validateCouponForPayment({
4063
- id,
4064
- buyNow,
4065
- addressId,
4066
- paymentMode,
4067
- paymentIdentifier,
4068
- aggregatorName,
4069
- merchantCode,
4070
- } = {}) {
4071
- const { error } = CartValidator.validateCouponForPayment().validate(
4575
+ async validateCouponForPayment(
4576
+ {
4577
+ id,
4578
+ buyNow,
4579
+ addressId,
4580
+ paymentMode,
4581
+ paymentIdentifier,
4582
+ aggregatorName,
4583
+ merchantCode,
4584
+ } = {},
4585
+ { headers } = { headers: false }
4586
+ ) {
4587
+ const {
4588
+ error,
4589
+ } = CartPlatformApplicationValidator.validateCouponForPayment().validate(
4072
4590
  {
4073
4591
  id,
4074
4592
  buyNow,
@@ -4087,7 +4605,7 @@ class Cart {
4087
4605
  // Showing warrnings if extra unknown parameters are found
4088
4606
  const {
4089
4607
  error: warrning,
4090
- } = CartValidator.validateCouponForPayment().validate(
4608
+ } = CartPlatformApplicationValidator.validateCouponForPayment().validate(
4091
4609
  {
4092
4610
  id,
4093
4611
  buyNow,
@@ -4102,9 +4620,8 @@ class Cart {
4102
4620
  if (warrning) {
4103
4621
  Logger({
4104
4622
  level: "WARN",
4105
- message: "Parameter Validation warrnings for validateCouponForPayment",
4623
+ message: `Parameter Validation warrnings for platform > Cart > validateCouponForPayment \n ${warrning}`,
4106
4624
  });
4107
- Logger({ level: "WARN", message: warrning });
4108
4625
  }
4109
4626
 
4110
4627
  const query_params = {};
@@ -4121,12 +4638,19 @@ class Cart {
4121
4638
  "get",
4122
4639
  `/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/payment/validate/`,
4123
4640
  query_params,
4124
- undefined
4641
+ undefined,
4642
+ undefined,
4643
+ { headers }
4125
4644
  );
4126
4645
 
4646
+ let responseData = response;
4647
+ if (headers) {
4648
+ responseData = response[0];
4649
+ }
4650
+
4127
4651
  const {
4128
4652
  error: res_error,
4129
- } = CartModel.PaymentCouponValidate().validate(response, {
4653
+ } = CartPlatformModel.PaymentCouponValidate().validate(responseData, {
4130
4654
  abortEarly: false,
4131
4655
  allowUnknown: false,
4132
4656
  });
@@ -4134,9 +4658,8 @@ class Cart {
4134
4658
  if (res_error) {
4135
4659
  Logger({
4136
4660
  level: "WARN",
4137
- message: "Response Validation Warnnings for validateCouponForPayment",
4661
+ message: `Response Validation Warnnings for platform > Cart > validateCouponForPayment \n ${res_error}`,
4138
4662
  });
4139
- Logger({ level: "WARN", message: res_error });
4140
4663
  }
4141
4664
 
4142
4665
  return response;