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