@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
@@ -2,8 +2,8 @@ const ApplicationAPIClient = require("../ApplicationAPIClient");
2
2
  const { FDKClientValidationError } = require("../../common/FDKError");
3
3
  const constructUrl = require("../constructUrl");
4
4
  const Paginator = require("../../common/Paginator");
5
- const CartValidator = require("./CartApplicationValidator");
6
- const CartModel = require("./CartApplicationModel");
5
+ const CartApplicationValidator = require("./CartApplicationValidator");
6
+ const CartApplicationModel = require("./CartApplicationModel");
7
7
  const { Logger } = require("./../../common/Logger");
8
8
  const Joi = require("joi");
9
9
 
@@ -59,14 +59,19 @@ class Cart {
59
59
  }
60
60
 
61
61
  /**
62
- * @param {Object} arg - Arg object.
63
- * @param {Address} arg.body
64
- * @returns {Promise<SaveAddressResponse>} - Success response
62
+ * @param {CartApplicationValidator.AddAddressParam} arg - Arg object.
63
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
64
+ * @param {import("../ApplicationAPIClient").Options} - Options
65
+ * @returns {Promise<CartApplicationModel.SaveAddressResponse>} - Success response
66
+ * @name addAddress
65
67
  * @summary: Add address to an account
66
- * @description: Use this API to add an address to an account.
68
+ * @description: Use this API to add an address to an account. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/addAddress/).
67
69
  */
68
- async addAddress({ body } = {}) {
69
- const { error } = CartValidator.addAddress().validate(
70
+ async addAddress(
71
+ { body, requestHeaders } = { requestHeaders: {} },
72
+ { responseHeaders } = { responseHeaders: false }
73
+ ) {
74
+ const { error } = CartApplicationValidator.addAddress().validate(
70
75
  { body },
71
76
  { abortEarly: false, allowUnknown: true }
72
77
  );
@@ -75,16 +80,15 @@ class Cart {
75
80
  }
76
81
 
77
82
  // Showing warrnings if extra unknown parameters are found
78
- const { error: warrning } = CartValidator.addAddress().validate(
83
+ const { error: warrning } = CartApplicationValidator.addAddress().validate(
79
84
  { body },
80
85
  { abortEarly: false, allowUnknown: false }
81
86
  );
82
87
  if (warrning) {
83
88
  Logger({
84
89
  level: "WARN",
85
- message: "Parameter Validation warrnings for addAddress",
90
+ message: `Parameter Validation warrnings for application > Cart > addAddress \n ${warrning}`,
86
91
  });
87
- Logger({ level: "WARN", message: warrning });
88
92
  }
89
93
 
90
94
  const query_params = {};
@@ -100,12 +104,18 @@ class Cart {
100
104
  }),
101
105
  query_params,
102
106
  body,
103
- xHeaders
107
+ { ...xHeaders, ...requestHeaders },
108
+ { responseHeaders }
104
109
  );
105
110
 
111
+ let responseData = response;
112
+ if (responseHeaders) {
113
+ responseData = response[0];
114
+ }
115
+
106
116
  const {
107
117
  error: res_error,
108
- } = CartModel.SaveAddressResponse().validate(response, {
118
+ } = CartApplicationModel.SaveAddressResponse().validate(responseData, {
109
119
  abortEarly: false,
110
120
  allowUnknown: false,
111
121
  });
@@ -113,28 +123,29 @@ class Cart {
113
123
  if (res_error) {
114
124
  Logger({
115
125
  level: "WARN",
116
- message: "Response Validation Warnnings for addAddress",
126
+ message: `Response Validation Warnnings for application > Cart > addAddress \n ${res_error}`,
117
127
  });
118
- Logger({ level: "WARN", message: res_error });
119
128
  }
120
129
 
121
130
  return response;
122
131
  }
123
132
 
124
133
  /**
125
- * @param {Object} arg - Arg object.
126
- * @param {boolean} [arg.i] -
127
- * @param {boolean} [arg.b] -
128
- * @param {string} [arg.areaCode] -
129
- * @param {boolean} [arg.buyNow] -
130
- * @param {string} [arg.id] -
131
- * @param {AddCartRequest} arg.body
132
- * @returns {Promise<AddCartDetailResponse>} - Success response
134
+ * @param {CartApplicationValidator.AddItemsParam} arg - Arg object.
135
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
136
+ * @param {import("../ApplicationAPIClient").Options} - Options
137
+ * @returns {Promise<CartApplicationModel.AddCartDetailResponse>} - Success response
138
+ * @name addItems
133
139
  * @summary: Add items to cart
134
- * @description: Use this API to add items to the cart.
140
+ * @description: Use this API to add items to the cart. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/addItems/).
135
141
  */
136
- async addItems({ body, i, b, areaCode, buyNow, id } = {}) {
137
- const { error } = CartValidator.addItems().validate(
142
+ async addItems(
143
+ { body, i, b, areaCode, buyNow, id, requestHeaders } = {
144
+ requestHeaders: {},
145
+ },
146
+ { responseHeaders } = { responseHeaders: false }
147
+ ) {
148
+ const { error } = CartApplicationValidator.addItems().validate(
138
149
  { body, i, b, areaCode, buyNow, id },
139
150
  { abortEarly: false, allowUnknown: true }
140
151
  );
@@ -143,16 +154,15 @@ class Cart {
143
154
  }
144
155
 
145
156
  // Showing warrnings if extra unknown parameters are found
146
- const { error: warrning } = CartValidator.addItems().validate(
157
+ const { error: warrning } = CartApplicationValidator.addItems().validate(
147
158
  { body, i, b, areaCode, buyNow, id },
148
159
  { abortEarly: false, allowUnknown: false }
149
160
  );
150
161
  if (warrning) {
151
162
  Logger({
152
163
  level: "WARN",
153
- message: "Parameter Validation warrnings for addItems",
164
+ message: `Parameter Validation warrnings for application > Cart > addItems \n ${warrning}`,
154
165
  });
155
- Logger({ level: "WARN", message: warrning });
156
166
  }
157
167
 
158
168
  const query_params = {};
@@ -173,12 +183,18 @@ class Cart {
173
183
  }),
174
184
  query_params,
175
185
  body,
176
- xHeaders
186
+ { ...xHeaders, ...requestHeaders },
187
+ { responseHeaders }
177
188
  );
178
189
 
190
+ let responseData = response;
191
+ if (responseHeaders) {
192
+ responseData = response[0];
193
+ }
194
+
179
195
  const {
180
196
  error: res_error,
181
- } = CartModel.AddCartDetailResponse().validate(response, {
197
+ } = CartApplicationModel.AddCartDetailResponse().validate(responseData, {
182
198
  abortEarly: false,
183
199
  allowUnknown: false,
184
200
  });
@@ -186,28 +202,27 @@ class Cart {
186
202
  if (res_error) {
187
203
  Logger({
188
204
  level: "WARN",
189
- message: "Response Validation Warnnings for addItems",
205
+ message: `Response Validation Warnnings for application > Cart > addItems \n ${res_error}`,
190
206
  });
191
- Logger({ level: "WARN", message: res_error });
192
207
  }
193
208
 
194
209
  return response;
195
210
  }
196
211
 
197
212
  /**
198
- * @param {Object} arg - Arg object.
199
- * @param {boolean} [arg.i] -
200
- * @param {boolean} [arg.b] -
201
- * @param {boolean} [arg.p] -
202
- * @param {string} [arg.id] -
203
- * @param {boolean} [arg.buyNow] -
204
- * @param {ApplyCouponRequest} arg.body
205
- * @returns {Promise<CartDetailResponse>} - Success response
213
+ * @param {CartApplicationValidator.ApplyCouponParam} arg - Arg object.
214
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
215
+ * @param {import("../ApplicationAPIClient").Options} - Options
216
+ * @returns {Promise<CartApplicationModel.CartDetailResponse>} - Success response
217
+ * @name applyCoupon
206
218
  * @summary: Apply Coupon
207
- * @description: Use this API to apply coupons on items in the cart.
219
+ * @description: Use this API to apply coupons on items in the cart. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/applyCoupon/).
208
220
  */
209
- async applyCoupon({ body, i, b, p, id, buyNow } = {}) {
210
- const { error } = CartValidator.applyCoupon().validate(
221
+ async applyCoupon(
222
+ { body, i, b, p, id, buyNow, requestHeaders } = { requestHeaders: {} },
223
+ { responseHeaders } = { responseHeaders: false }
224
+ ) {
225
+ const { error } = CartApplicationValidator.applyCoupon().validate(
211
226
  { body, i, b, p, id, buyNow },
212
227
  { abortEarly: false, allowUnknown: true }
213
228
  );
@@ -216,16 +231,15 @@ class Cart {
216
231
  }
217
232
 
218
233
  // Showing warrnings if extra unknown parameters are found
219
- const { error: warrning } = CartValidator.applyCoupon().validate(
234
+ const { error: warrning } = CartApplicationValidator.applyCoupon().validate(
220
235
  { body, i, b, p, id, buyNow },
221
236
  { abortEarly: false, allowUnknown: false }
222
237
  );
223
238
  if (warrning) {
224
239
  Logger({
225
240
  level: "WARN",
226
- message: "Parameter Validation warrnings for applyCoupon",
241
+ message: `Parameter Validation warrnings for application > Cart > applyCoupon \n ${warrning}`,
227
242
  });
228
- Logger({ level: "WARN", message: warrning });
229
243
  }
230
244
 
231
245
  const query_params = {};
@@ -246,12 +260,18 @@ class Cart {
246
260
  }),
247
261
  query_params,
248
262
  body,
249
- xHeaders
263
+ { ...xHeaders, ...requestHeaders },
264
+ { responseHeaders }
250
265
  );
251
266
 
267
+ let responseData = response;
268
+ if (responseHeaders) {
269
+ responseData = response[0];
270
+ }
271
+
252
272
  const {
253
273
  error: res_error,
254
- } = CartModel.CartDetailResponse().validate(response, {
274
+ } = CartApplicationModel.CartDetailResponse().validate(responseData, {
255
275
  abortEarly: false,
256
276
  allowUnknown: false,
257
277
  });
@@ -259,27 +279,27 @@ class Cart {
259
279
  if (res_error) {
260
280
  Logger({
261
281
  level: "WARN",
262
- message: "Response Validation Warnnings for applyCoupon",
282
+ message: `Response Validation Warnnings for application > Cart > applyCoupon \n ${res_error}`,
263
283
  });
264
- Logger({ level: "WARN", message: res_error });
265
284
  }
266
285
 
267
286
  return response;
268
287
  }
269
288
 
270
289
  /**
271
- * @param {Object} arg - Arg object.
272
- * @param {string} [arg.id] -
273
- * @param {boolean} [arg.i] -
274
- * @param {boolean} [arg.b] -
275
- * @param {boolean} [arg.buyNow] -
276
- * @param {RewardPointRequest} arg.body
277
- * @returns {Promise<CartDetailResponse>} - Success response
290
+ * @param {CartApplicationValidator.ApplyRewardPointsParam} arg - Arg object.
291
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
292
+ * @param {import("../ApplicationAPIClient").Options} - Options
293
+ * @returns {Promise<CartApplicationModel.CartDetailResponse>} - Success response
294
+ * @name applyRewardPoints
278
295
  * @summary: Apply reward points at cart
279
- * @description: Use this API to redeem a fixed no. of reward points by applying it to the cart.
296
+ * @description: Use this API to redeem a fixed no. of reward points by applying it to the cart. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/applyRewardPoints/).
280
297
  */
281
- async applyRewardPoints({ body, id, i, b, buyNow } = {}) {
282
- const { error } = CartValidator.applyRewardPoints().validate(
298
+ async applyRewardPoints(
299
+ { body, id, i, b, buyNow, requestHeaders } = { requestHeaders: {} },
300
+ { responseHeaders } = { responseHeaders: false }
301
+ ) {
302
+ const { error } = CartApplicationValidator.applyRewardPoints().validate(
283
303
  { body, id, i, b, buyNow },
284
304
  { abortEarly: false, allowUnknown: true }
285
305
  );
@@ -288,16 +308,17 @@ class Cart {
288
308
  }
289
309
 
290
310
  // Showing warrnings if extra unknown parameters are found
291
- const { error: warrning } = CartValidator.applyRewardPoints().validate(
311
+ const {
312
+ error: warrning,
313
+ } = CartApplicationValidator.applyRewardPoints().validate(
292
314
  { body, id, i, b, buyNow },
293
315
  { abortEarly: false, allowUnknown: false }
294
316
  );
295
317
  if (warrning) {
296
318
  Logger({
297
319
  level: "WARN",
298
- message: "Parameter Validation warrnings for applyRewardPoints",
320
+ message: `Parameter Validation warrnings for application > Cart > applyRewardPoints \n ${warrning}`,
299
321
  });
300
- Logger({ level: "WARN", message: warrning });
301
322
  }
302
323
 
303
324
  const query_params = {};
@@ -317,12 +338,18 @@ class Cart {
317
338
  }),
318
339
  query_params,
319
340
  body,
320
- xHeaders
341
+ { ...xHeaders, ...requestHeaders },
342
+ { responseHeaders }
321
343
  );
322
344
 
345
+ let responseData = response;
346
+ if (responseHeaders) {
347
+ responseData = response[0];
348
+ }
349
+
323
350
  const {
324
351
  error: res_error,
325
- } = CartModel.CartDetailResponse().validate(response, {
352
+ } = CartApplicationModel.CartDetailResponse().validate(responseData, {
326
353
  abortEarly: false,
327
354
  allowUnknown: false,
328
355
  });
@@ -330,24 +357,27 @@ class Cart {
330
357
  if (res_error) {
331
358
  Logger({
332
359
  level: "WARN",
333
- message: "Response Validation Warnnings for applyRewardPoints",
360
+ message: `Response Validation Warnnings for application > Cart > applyRewardPoints \n ${res_error}`,
334
361
  });
335
- Logger({ level: "WARN", message: res_error });
336
362
  }
337
363
 
338
364
  return response;
339
365
  }
340
366
 
341
367
  /**
342
- * @param {Object} arg - Arg object.
343
- * @param {boolean} [arg.buyNow] - This indicates the type of cart to checkout
344
- * @param {CartCheckoutDetailRequest} arg.body
345
- * @returns {Promise<CartCheckoutResponse>} - Success response
368
+ * @param {CartApplicationValidator.CheckoutCartParam} arg - Arg object.
369
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
370
+ * @param {import("../ApplicationAPIClient").Options} - Options
371
+ * @returns {Promise<CartApplicationModel.CartCheckoutResponse>} - Success response
372
+ * @name checkoutCart
346
373
  * @summary: Checkout all items in the cart
347
- * @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.
374
+ * @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/application/cart/checkoutCart/).
348
375
  */
349
- async checkoutCart({ body, buyNow } = {}) {
350
- const { error } = CartValidator.checkoutCart().validate(
376
+ async checkoutCart(
377
+ { body, buyNow, requestHeaders } = { requestHeaders: {} },
378
+ { responseHeaders } = { responseHeaders: false }
379
+ ) {
380
+ const { error } = CartApplicationValidator.checkoutCart().validate(
351
381
  { body, buyNow },
352
382
  { abortEarly: false, allowUnknown: true }
353
383
  );
@@ -356,16 +386,17 @@ class Cart {
356
386
  }
357
387
 
358
388
  // Showing warrnings if extra unknown parameters are found
359
- const { error: warrning } = CartValidator.checkoutCart().validate(
389
+ const {
390
+ error: warrning,
391
+ } = CartApplicationValidator.checkoutCart().validate(
360
392
  { body, buyNow },
361
393
  { abortEarly: false, allowUnknown: false }
362
394
  );
363
395
  if (warrning) {
364
396
  Logger({
365
397
  level: "WARN",
366
- message: "Parameter Validation warrnings for checkoutCart",
398
+ message: `Parameter Validation warrnings for application > Cart > checkoutCart \n ${warrning}`,
367
399
  });
368
- Logger({ level: "WARN", message: warrning });
369
400
  }
370
401
 
371
402
  const query_params = {};
@@ -382,12 +413,18 @@ class Cart {
382
413
  }),
383
414
  query_params,
384
415
  body,
385
- xHeaders
416
+ { ...xHeaders, ...requestHeaders },
417
+ { responseHeaders }
386
418
  );
387
419
 
420
+ let responseData = response;
421
+ if (responseHeaders) {
422
+ responseData = response[0];
423
+ }
424
+
388
425
  const {
389
426
  error: res_error,
390
- } = CartModel.CartCheckoutResponse().validate(response, {
427
+ } = CartApplicationModel.CartCheckoutResponse().validate(responseData, {
391
428
  abortEarly: false,
392
429
  allowUnknown: false,
393
430
  });
@@ -395,24 +432,27 @@ class Cart {
395
432
  if (res_error) {
396
433
  Logger({
397
434
  level: "WARN",
398
- message: "Response Validation Warnnings for checkoutCart",
435
+ message: `Response Validation Warnnings for application > Cart > checkoutCart \n ${res_error}`,
399
436
  });
400
- Logger({ level: "WARN", message: res_error });
401
437
  }
402
438
 
403
439
  return response;
404
440
  }
405
441
 
406
442
  /**
407
- * @param {Object} arg - Arg object.
408
- * @param {boolean} [arg.buyNow] - This indicates the type of cart to checkout
409
- * @param {CartCheckoutDetailV2Request} arg.body
410
- * @returns {Promise<CartCheckoutResponse>} - Success response
443
+ * @param {CartApplicationValidator.CheckoutCartV2Param} arg - Arg object.
444
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
445
+ * @param {import("../ApplicationAPIClient").Options} - Options
446
+ * @returns {Promise<CartApplicationModel.CartCheckoutResponse>} - Success response
447
+ * @name checkoutCartV2
411
448
  * @summary: Checkout all items in the cart
412
- * @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.
449
+ * @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/application/cart/checkoutCartV2/).
413
450
  */
414
- async checkoutCartV2({ body, buyNow } = {}) {
415
- const { error } = CartValidator.checkoutCartV2().validate(
451
+ async checkoutCartV2(
452
+ { body, buyNow, requestHeaders } = { requestHeaders: {} },
453
+ { responseHeaders } = { responseHeaders: false }
454
+ ) {
455
+ const { error } = CartApplicationValidator.checkoutCartV2().validate(
416
456
  { body, buyNow },
417
457
  { abortEarly: false, allowUnknown: true }
418
458
  );
@@ -421,16 +461,17 @@ class Cart {
421
461
  }
422
462
 
423
463
  // Showing warrnings if extra unknown parameters are found
424
- const { error: warrning } = CartValidator.checkoutCartV2().validate(
464
+ const {
465
+ error: warrning,
466
+ } = CartApplicationValidator.checkoutCartV2().validate(
425
467
  { body, buyNow },
426
468
  { abortEarly: false, allowUnknown: false }
427
469
  );
428
470
  if (warrning) {
429
471
  Logger({
430
472
  level: "WARN",
431
- message: "Parameter Validation warrnings for checkoutCartV2",
473
+ message: `Parameter Validation warrnings for application > Cart > checkoutCartV2 \n ${warrning}`,
432
474
  });
433
- Logger({ level: "WARN", message: warrning });
434
475
  }
435
476
 
436
477
  const query_params = {};
@@ -447,12 +488,18 @@ class Cart {
447
488
  }),
448
489
  query_params,
449
490
  body,
450
- xHeaders
491
+ { ...xHeaders, ...requestHeaders },
492
+ { responseHeaders }
451
493
  );
452
494
 
495
+ let responseData = response;
496
+ if (responseHeaders) {
497
+ responseData = response[0];
498
+ }
499
+
453
500
  const {
454
501
  error: res_error,
455
- } = CartModel.CartCheckoutResponse().validate(response, {
502
+ } = CartApplicationModel.CartCheckoutResponse().validate(responseData, {
456
503
  abortEarly: false,
457
504
  allowUnknown: false,
458
505
  });
@@ -460,23 +507,28 @@ class Cart {
460
507
  if (res_error) {
461
508
  Logger({
462
509
  level: "WARN",
463
- message: "Response Validation Warnnings for checkoutCartV2",
510
+ message: `Response Validation Warnnings for application > Cart > checkoutCartV2 \n ${res_error}`,
464
511
  });
465
- Logger({ level: "WARN", message: res_error });
466
512
  }
467
513
 
468
514
  return response;
469
515
  }
470
516
 
471
517
  /**
472
- * @param {Object} arg - Arg object.
473
- * @param {string} [arg.id] - The unique identifier of the cart.
474
- * @returns {Promise<DeleteCartDetailResponse>} - Success response
518
+ * @param {CartApplicationValidator.DeleteCartParam} arg - Arg object.
519
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
520
+ * @param {import("../ApplicationAPIClient").Options} - Options
521
+ * @returns {Promise<CartApplicationModel.DeleteCartDetailResponse>} -
522
+ * Success response
523
+ * @name deleteCart
475
524
  * @summary: Delete cart once user made successful checkout
476
- * @description: Use this API to delete the cart.
525
+ * @description: Use this API to delete the cart. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/deleteCart/).
477
526
  */
478
- async deleteCart({ id } = {}) {
479
- const { error } = CartValidator.deleteCart().validate(
527
+ async deleteCart(
528
+ { id, requestHeaders } = { requestHeaders: {} },
529
+ { responseHeaders } = { responseHeaders: false }
530
+ ) {
531
+ const { error } = CartApplicationValidator.deleteCart().validate(
480
532
  { id },
481
533
  { abortEarly: false, allowUnknown: true }
482
534
  );
@@ -485,16 +537,15 @@ class Cart {
485
537
  }
486
538
 
487
539
  // Showing warrnings if extra unknown parameters are found
488
- const { error: warrning } = CartValidator.deleteCart().validate(
540
+ const { error: warrning } = CartApplicationValidator.deleteCart().validate(
489
541
  { id },
490
542
  { abortEarly: false, allowUnknown: false }
491
543
  );
492
544
  if (warrning) {
493
545
  Logger({
494
546
  level: "WARN",
495
- message: "Parameter Validation warrnings for deleteCart",
547
+ message: `Parameter Validation warrnings for application > Cart > deleteCart \n ${warrning}`,
496
548
  });
497
- Logger({ level: "WARN", message: warrning });
498
549
  }
499
550
 
500
551
  const query_params = {};
@@ -511,12 +562,18 @@ class Cart {
511
562
  }),
512
563
  query_params,
513
564
  undefined,
514
- xHeaders
565
+ { ...xHeaders, ...requestHeaders },
566
+ { responseHeaders }
515
567
  );
516
568
 
569
+ let responseData = response;
570
+ if (responseHeaders) {
571
+ responseData = response[0];
572
+ }
573
+
517
574
  const {
518
575
  error: res_error,
519
- } = CartModel.DeleteCartDetailResponse().validate(response, {
576
+ } = CartApplicationModel.DeleteCartDetailResponse().validate(responseData, {
520
577
  abortEarly: false,
521
578
  allowUnknown: false,
522
579
  });
@@ -524,37 +581,36 @@ class Cart {
524
581
  if (res_error) {
525
582
  Logger({
526
583
  level: "WARN",
527
- message: "Response Validation Warnnings for deleteCart",
584
+ message: `Response Validation Warnnings for application > Cart > deleteCart \n ${res_error}`,
528
585
  });
529
- Logger({ level: "WARN", message: res_error });
530
586
  }
531
587
 
532
588
  return response;
533
589
  }
534
590
 
535
591
  /**
536
- * @param {Object} arg - Arg object.
537
- * @param {string} arg.id -
538
- * @param {string} [arg.cartId] -
539
- * @param {boolean} [arg.buyNow] -
540
- * @param {string} [arg.mobileNo] -
541
- * @param {string} [arg.checkoutMode] -
542
- * @param {string} [arg.tags] -
543
- * @param {boolean} [arg.isDefault] -
544
- * @returns {Promise<Address>} - Success response
592
+ * @param {CartApplicationValidator.GetAddressByIdParam} arg - Arg object.
593
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
594
+ * @param {import("../ApplicationAPIClient").Options} - Options
595
+ * @returns {Promise<CartApplicationModel.Address>} - Success response
596
+ * @name getAddressById
545
597
  * @summary: Fetch a single address by its ID
546
- * @description: Use this API to get an addresses using its ID. If successful, returns a Address resource in the response body specified in `Address`. Attibutes listed below are optional <ul> <li> <font color="monochrome">mobile_no</font></li> <li> <font color="monochrome">checkout_mode</font></li> <li> <font color="monochrome">tags</font></li> <li> <font color="monochrome">default</font></li> </ul>
598
+ * @description: Use this API to get an addresses using its ID. If successful, returns a Address resource in the response body specified in `Address`. Attibutes listed below are optional mobile_no checkout_mode tags default - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/getAddressById/).
547
599
  */
548
- async getAddressById({
549
- id,
550
- cartId,
551
- buyNow,
552
- mobileNo,
553
- checkoutMode,
554
- tags,
555
- isDefault,
556
- } = {}) {
557
- const { error } = CartValidator.getAddressById().validate(
600
+ async getAddressById(
601
+ {
602
+ id,
603
+ cartId,
604
+ buyNow,
605
+ mobileNo,
606
+ checkoutMode,
607
+ tags,
608
+ isDefault,
609
+ requestHeaders,
610
+ } = { requestHeaders: {} },
611
+ { responseHeaders } = { responseHeaders: false }
612
+ ) {
613
+ const { error } = CartApplicationValidator.getAddressById().validate(
558
614
  { id, cartId, buyNow, mobileNo, checkoutMode, tags, isDefault },
559
615
  { abortEarly: false, allowUnknown: true }
560
616
  );
@@ -563,16 +619,17 @@ class Cart {
563
619
  }
564
620
 
565
621
  // Showing warrnings if extra unknown parameters are found
566
- const { error: warrning } = CartValidator.getAddressById().validate(
622
+ const {
623
+ error: warrning,
624
+ } = CartApplicationValidator.getAddressById().validate(
567
625
  { id, cartId, buyNow, mobileNo, checkoutMode, tags, isDefault },
568
626
  { abortEarly: false, allowUnknown: false }
569
627
  );
570
628
  if (warrning) {
571
629
  Logger({
572
630
  level: "WARN",
573
- message: "Parameter Validation warrnings for getAddressById",
631
+ message: `Parameter Validation warrnings for application > Cart > getAddressById \n ${warrning}`,
574
632
  });
575
- Logger({ level: "WARN", message: warrning });
576
633
  }
577
634
 
578
635
  const query_params = {};
@@ -594,10 +651,18 @@ class Cart {
594
651
  }),
595
652
  query_params,
596
653
  undefined,
597
- xHeaders
654
+ { ...xHeaders, ...requestHeaders },
655
+ { responseHeaders }
598
656
  );
599
657
 
600
- const { error: res_error } = CartModel.Address().validate(response, {
658
+ let responseData = response;
659
+ if (responseHeaders) {
660
+ responseData = response[0];
661
+ }
662
+
663
+ const {
664
+ error: res_error,
665
+ } = CartApplicationModel.Address().validate(responseData, {
601
666
  abortEarly: false,
602
667
  allowUnknown: false,
603
668
  });
@@ -605,35 +670,35 @@ class Cart {
605
670
  if (res_error) {
606
671
  Logger({
607
672
  level: "WARN",
608
- message: "Response Validation Warnnings for getAddressById",
673
+ message: `Response Validation Warnnings for application > Cart > getAddressById \n ${res_error}`,
609
674
  });
610
- Logger({ level: "WARN", message: res_error });
611
675
  }
612
676
 
613
677
  return response;
614
678
  }
615
679
 
616
680
  /**
617
- * @param {Object} arg - Arg object.
618
- * @param {string} [arg.cartId] -
619
- * @param {boolean} [arg.buyNow] -
620
- * @param {string} [arg.mobileNo] -
621
- * @param {string} [arg.checkoutMode] -
622
- * @param {string} [arg.tags] -
623
- * @param {boolean} [arg.isDefault] -
624
- * @returns {Promise<GetAddressesResponse>} - Success response
681
+ * @param {CartApplicationValidator.GetAddressesParam} arg - Arg object.
682
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
683
+ * @param {import("../ApplicationAPIClient").Options} - Options
684
+ * @returns {Promise<CartApplicationModel.GetAddressesResponse>} - Success response
685
+ * @name getAddresses
625
686
  * @summary: Fetch address
626
- * @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>
687
+ * @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/application/cart/getAddresses/).
627
688
  */
628
- async getAddresses({
629
- cartId,
630
- buyNow,
631
- mobileNo,
632
- checkoutMode,
633
- tags,
634
- isDefault,
635
- } = {}) {
636
- const { error } = CartValidator.getAddresses().validate(
689
+ async getAddresses(
690
+ {
691
+ cartId,
692
+ buyNow,
693
+ mobileNo,
694
+ checkoutMode,
695
+ tags,
696
+ isDefault,
697
+ requestHeaders,
698
+ } = { requestHeaders: {} },
699
+ { responseHeaders } = { responseHeaders: false }
700
+ ) {
701
+ const { error } = CartApplicationValidator.getAddresses().validate(
637
702
  { cartId, buyNow, mobileNo, checkoutMode, tags, isDefault },
638
703
  { abortEarly: false, allowUnknown: true }
639
704
  );
@@ -642,16 +707,17 @@ class Cart {
642
707
  }
643
708
 
644
709
  // Showing warrnings if extra unknown parameters are found
645
- const { error: warrning } = CartValidator.getAddresses().validate(
710
+ const {
711
+ error: warrning,
712
+ } = CartApplicationValidator.getAddresses().validate(
646
713
  { cartId, buyNow, mobileNo, checkoutMode, tags, isDefault },
647
714
  { abortEarly: false, allowUnknown: false }
648
715
  );
649
716
  if (warrning) {
650
717
  Logger({
651
718
  level: "WARN",
652
- message: "Parameter Validation warrnings for getAddresses",
719
+ message: `Parameter Validation warrnings for application > Cart > getAddresses \n ${warrning}`,
653
720
  });
654
- Logger({ level: "WARN", message: warrning });
655
721
  }
656
722
 
657
723
  const query_params = {};
@@ -673,12 +739,18 @@ class Cart {
673
739
  }),
674
740
  query_params,
675
741
  undefined,
676
- xHeaders
742
+ { ...xHeaders, ...requestHeaders },
743
+ { responseHeaders }
677
744
  );
678
745
 
746
+ let responseData = response;
747
+ if (responseHeaders) {
748
+ responseData = response[0];
749
+ }
750
+
679
751
  const {
680
752
  error: res_error,
681
- } = CartModel.GetAddressesResponse().validate(response, {
753
+ } = CartApplicationModel.GetAddressesResponse().validate(responseData, {
682
754
  abortEarly: false,
683
755
  allowUnknown: false,
684
756
  });
@@ -686,28 +758,27 @@ class Cart {
686
758
  if (res_error) {
687
759
  Logger({
688
760
  level: "WARN",
689
- message: "Response Validation Warnnings for getAddresses",
761
+ message: `Response Validation Warnnings for application > Cart > getAddresses \n ${res_error}`,
690
762
  });
691
- Logger({ level: "WARN", message: res_error });
692
763
  }
693
764
 
694
765
  return response;
695
766
  }
696
767
 
697
768
  /**
698
- * @param {Object} arg - Arg object.
699
- * @param {number} [arg.itemId] - The Item ID of the product
700
- * @param {string} [arg.articleId] - Article Mongo ID
701
- * @param {number} [arg.uid] - UID of the product
702
- * @param {string} [arg.slug] - A short, human-readable, URL-friendly
703
- * identifier of a product. You can get slug value from the endpoint
704
- * /service/application/catalog/v1.0/products/
705
- * @returns {Promise<BulkPriceResponse>} - Success response
769
+ * @param {CartApplicationValidator.GetBulkDiscountOffersParam} arg - Arg object.
770
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
771
+ * @param {import("../ApplicationAPIClient").Options} - Options
772
+ * @returns {Promise<CartApplicationModel.BulkPriceResponse>} - Success response
773
+ * @name getBulkDiscountOffers
706
774
  * @summary: Get discount offers based on quantity
707
- * @description: Use this API to get a list of applicable offers along with current, next and best offer for given product. Either one of uid, item_id, slug should be present.
775
+ * @description: Use this API to get a list of applicable offers along with current, next and best offer for given product. Either one of uid, item_id, slug should be present. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/getBulkDiscountOffers/).
708
776
  */
709
- async getBulkDiscountOffers({ itemId, articleId, uid, slug } = {}) {
710
- const { error } = CartValidator.getBulkDiscountOffers().validate(
777
+ async getBulkDiscountOffers(
778
+ { itemId, articleId, uid, slug, requestHeaders } = { requestHeaders: {} },
779
+ { responseHeaders } = { responseHeaders: false }
780
+ ) {
781
+ const { error } = CartApplicationValidator.getBulkDiscountOffers().validate(
711
782
  { itemId, articleId, uid, slug },
712
783
  { abortEarly: false, allowUnknown: true }
713
784
  );
@@ -716,16 +787,17 @@ class Cart {
716
787
  }
717
788
 
718
789
  // Showing warrnings if extra unknown parameters are found
719
- const { error: warrning } = CartValidator.getBulkDiscountOffers().validate(
790
+ const {
791
+ error: warrning,
792
+ } = CartApplicationValidator.getBulkDiscountOffers().validate(
720
793
  { itemId, articleId, uid, slug },
721
794
  { abortEarly: false, allowUnknown: false }
722
795
  );
723
796
  if (warrning) {
724
797
  Logger({
725
798
  level: "WARN",
726
- message: "Parameter Validation warrnings for getBulkDiscountOffers",
799
+ message: `Parameter Validation warrnings for application > Cart > getBulkDiscountOffers \n ${warrning}`,
727
800
  });
728
- Logger({ level: "WARN", message: warrning });
729
801
  }
730
802
 
731
803
  const query_params = {};
@@ -745,12 +817,18 @@ class Cart {
745
817
  }),
746
818
  query_params,
747
819
  undefined,
748
- xHeaders
820
+ { ...xHeaders, ...requestHeaders },
821
+ { responseHeaders }
749
822
  );
750
823
 
824
+ let responseData = response;
825
+ if (responseHeaders) {
826
+ responseData = response[0];
827
+ }
828
+
751
829
  const {
752
830
  error: res_error,
753
- } = CartModel.BulkPriceResponse().validate(response, {
831
+ } = CartApplicationModel.BulkPriceResponse().validate(responseData, {
754
832
  abortEarly: false,
755
833
  allowUnknown: false,
756
834
  });
@@ -758,28 +836,29 @@ class Cart {
758
836
  if (res_error) {
759
837
  Logger({
760
838
  level: "WARN",
761
- message: "Response Validation Warnnings for getBulkDiscountOffers",
839
+ message: `Response Validation Warnnings for application > Cart > getBulkDiscountOffers \n ${res_error}`,
762
840
  });
763
- Logger({ level: "WARN", message: res_error });
764
841
  }
765
842
 
766
843
  return response;
767
844
  }
768
845
 
769
846
  /**
770
- * @param {Object} arg - Arg object.
771
- * @param {string} [arg.id] -
772
- * @param {boolean} [arg.i] -
773
- * @param {boolean} [arg.b] -
774
- * @param {number} [arg.assignCardId] -
775
- * @param {string} [arg.areaCode] -
776
- * @param {boolean} [arg.buyNow] -
777
- * @returns {Promise<CartDetailResponse>} - Success response
847
+ * @param {CartApplicationValidator.GetCartParam} arg - Arg object.
848
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
849
+ * @param {import("../ApplicationAPIClient").Options} - Options
850
+ * @returns {Promise<CartApplicationModel.CartDetailResponse>} - Success response
851
+ * @name getCart
778
852
  * @summary: Fetch all items added to the cart
779
- * @description: Use this API to get details of all the items added to a cart.
853
+ * @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/application/cart/getCart/).
780
854
  */
781
- async getCart({ id, i, b, assignCardId, areaCode, buyNow } = {}) {
782
- const { error } = CartValidator.getCart().validate(
855
+ async getCart(
856
+ { id, i, b, assignCardId, areaCode, buyNow, requestHeaders } = {
857
+ requestHeaders: {},
858
+ },
859
+ { responseHeaders } = { responseHeaders: false }
860
+ ) {
861
+ const { error } = CartApplicationValidator.getCart().validate(
783
862
  { id, i, b, assignCardId, areaCode, buyNow },
784
863
  { abortEarly: false, allowUnknown: true }
785
864
  );
@@ -788,16 +867,15 @@ class Cart {
788
867
  }
789
868
 
790
869
  // Showing warrnings if extra unknown parameters are found
791
- const { error: warrning } = CartValidator.getCart().validate(
870
+ const { error: warrning } = CartApplicationValidator.getCart().validate(
792
871
  { id, i, b, assignCardId, areaCode, buyNow },
793
872
  { abortEarly: false, allowUnknown: false }
794
873
  );
795
874
  if (warrning) {
796
875
  Logger({
797
876
  level: "WARN",
798
- message: "Parameter Validation warrnings for getCart",
877
+ message: `Parameter Validation warrnings for application > Cart > getCart \n ${warrning}`,
799
878
  });
800
- Logger({ level: "WARN", message: warrning });
801
879
  }
802
880
 
803
881
  const query_params = {};
@@ -819,12 +897,18 @@ class Cart {
819
897
  }),
820
898
  query_params,
821
899
  undefined,
822
- xHeaders
900
+ { ...xHeaders, ...requestHeaders },
901
+ { responseHeaders }
823
902
  );
824
903
 
904
+ let responseData = response;
905
+ if (responseHeaders) {
906
+ responseData = response[0];
907
+ }
908
+
825
909
  const {
826
910
  error: res_error,
827
- } = CartModel.CartDetailResponse().validate(response, {
911
+ } = CartApplicationModel.CartDetailResponse().validate(responseData, {
828
912
  abortEarly: false,
829
913
  allowUnknown: false,
830
914
  });
@@ -832,23 +916,27 @@ class Cart {
832
916
  if (res_error) {
833
917
  Logger({
834
918
  level: "WARN",
835
- message: "Response Validation Warnnings for getCart",
919
+ message: `Response Validation Warnnings for application > Cart > getCart \n ${res_error}`,
836
920
  });
837
- Logger({ level: "WARN", message: res_error });
838
921
  }
839
922
 
840
923
  return response;
841
924
  }
842
925
 
843
926
  /**
844
- * @param {Object} arg - Arg object.
845
- * @param {string} [arg.id] -
927
+ * @param {CartApplicationValidator.GetCartLastModifiedParam} arg - Arg object.
928
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
929
+ * @param {import("../ApplicationAPIClient").Options} - Options
846
930
  * @returns {Promise<any>} - Success response
931
+ * @name getCartLastModified
847
932
  * @summary: Fetch last-modified timestamp
848
- * @description: Use this API to fetch Last-Modified timestamp in header metadata.
933
+ * @description: Use this API to fetch Last-Modified timestamp in header metadata. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/getCartLastModified/).
849
934
  */
850
- async getCartLastModified({ id } = {}) {
851
- const { error } = CartValidator.getCartLastModified().validate(
935
+ async getCartLastModified(
936
+ { id, requestHeaders } = { requestHeaders: {} },
937
+ { responseHeaders } = { responseHeaders: false }
938
+ ) {
939
+ const { error } = CartApplicationValidator.getCartLastModified().validate(
852
940
  { id },
853
941
  { abortEarly: false, allowUnknown: true }
854
942
  );
@@ -857,16 +945,17 @@ class Cart {
857
945
  }
858
946
 
859
947
  // Showing warrnings if extra unknown parameters are found
860
- const { error: warrning } = CartValidator.getCartLastModified().validate(
948
+ const {
949
+ error: warrning,
950
+ } = CartApplicationValidator.getCartLastModified().validate(
861
951
  { id },
862
952
  { abortEarly: false, allowUnknown: false }
863
953
  );
864
954
  if (warrning) {
865
955
  Logger({
866
956
  level: "WARN",
867
- message: "Parameter Validation warrnings for getCartLastModified",
957
+ message: `Parameter Validation warrnings for application > Cart > getCartLastModified \n ${warrning}`,
868
958
  });
869
- Logger({ level: "WARN", message: warrning });
870
959
  }
871
960
 
872
961
  const query_params = {};
@@ -883,33 +972,44 @@ class Cart {
883
972
  }),
884
973
  query_params,
885
974
  undefined,
886
- xHeaders
975
+ { ...xHeaders, ...requestHeaders },
976
+ { responseHeaders }
887
977
  );
888
978
 
979
+ let responseData = response;
980
+ if (responseHeaders) {
981
+ responseData = response[0];
982
+ }
983
+
889
984
  const { error: res_error } = Joi.string()
890
985
  .allow("")
891
- .validate(response, { abortEarly: false, allowUnknown: false });
986
+ .validate(responseData, { abortEarly: false, allowUnknown: false });
892
987
 
893
988
  if (res_error) {
894
989
  Logger({
895
990
  level: "WARN",
896
- message: "Response Validation Warnnings for getCartLastModified",
991
+ message: `Response Validation Warnnings for application > Cart > getCartLastModified \n ${res_error}`,
897
992
  });
898
- Logger({ level: "WARN", message: res_error });
899
993
  }
900
994
 
901
995
  return response;
902
996
  }
903
997
 
904
998
  /**
905
- * @param {Object} arg - Arg object.
906
- * @param {GetShareCartLinkRequest} arg.body
907
- * @returns {Promise<GetShareCartLinkResponse>} - Success response
999
+ * @param {CartApplicationValidator.GetCartShareLinkParam} arg - Arg object.
1000
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1001
+ * @param {import("../ApplicationAPIClient").Options} - Options
1002
+ * @returns {Promise<CartApplicationModel.GetShareCartLinkResponse>} -
1003
+ * Success response
1004
+ * @name getCartShareLink
908
1005
  * @summary: Generate token for sharing the cart
909
- * @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.
1006
+ * @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/application/cart/getCartShareLink/).
910
1007
  */
911
- async getCartShareLink({ body } = {}) {
912
- const { error } = CartValidator.getCartShareLink().validate(
1008
+ async getCartShareLink(
1009
+ { body, requestHeaders } = { requestHeaders: {} },
1010
+ { responseHeaders } = { responseHeaders: false }
1011
+ ) {
1012
+ const { error } = CartApplicationValidator.getCartShareLink().validate(
913
1013
  { body },
914
1014
  { abortEarly: false, allowUnknown: true }
915
1015
  );
@@ -918,16 +1018,17 @@ class Cart {
918
1018
  }
919
1019
 
920
1020
  // Showing warrnings if extra unknown parameters are found
921
- const { error: warrning } = CartValidator.getCartShareLink().validate(
1021
+ const {
1022
+ error: warrning,
1023
+ } = CartApplicationValidator.getCartShareLink().validate(
922
1024
  { body },
923
1025
  { abortEarly: false, allowUnknown: false }
924
1026
  );
925
1027
  if (warrning) {
926
1028
  Logger({
927
1029
  level: "WARN",
928
- message: "Parameter Validation warrnings for getCartShareLink",
1030
+ message: `Parameter Validation warrnings for application > Cart > getCartShareLink \n ${warrning}`,
929
1031
  });
930
- Logger({ level: "WARN", message: warrning });
931
1032
  }
932
1033
 
933
1034
  const query_params = {};
@@ -943,12 +1044,18 @@ class Cart {
943
1044
  }),
944
1045
  query_params,
945
1046
  body,
946
- xHeaders
1047
+ { ...xHeaders, ...requestHeaders },
1048
+ { responseHeaders }
947
1049
  );
948
1050
 
1051
+ let responseData = response;
1052
+ if (responseHeaders) {
1053
+ responseData = response[0];
1054
+ }
1055
+
949
1056
  const {
950
1057
  error: res_error,
951
- } = CartModel.GetShareCartLinkResponse().validate(response, {
1058
+ } = CartApplicationModel.GetShareCartLinkResponse().validate(responseData, {
952
1059
  abortEarly: false,
953
1060
  allowUnknown: false,
954
1061
  });
@@ -956,23 +1063,27 @@ class Cart {
956
1063
  if (res_error) {
957
1064
  Logger({
958
1065
  level: "WARN",
959
- message: "Response Validation Warnnings for getCartShareLink",
1066
+ message: `Response Validation Warnnings for application > Cart > getCartShareLink \n ${res_error}`,
960
1067
  });
961
- Logger({ level: "WARN", message: res_error });
962
1068
  }
963
1069
 
964
1070
  return response;
965
1071
  }
966
1072
 
967
1073
  /**
968
- * @param {Object} arg - Arg object.
969
- * @param {string} arg.token - Token of the shared short link
970
- * @returns {Promise<SharedCartResponse>} - Success response
1074
+ * @param {CartApplicationValidator.GetCartSharedItemsParam} arg - Arg object.
1075
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1076
+ * @param {import("../ApplicationAPIClient").Options} - Options
1077
+ * @returns {Promise<CartApplicationModel.SharedCartResponse>} - Success response
1078
+ * @name getCartSharedItems
971
1079
  * @summary: Get details of a shared cart
972
- * @description: Use this API to get the shared cart details as per the token generated using the share-cart API.
1080
+ * @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/application/cart/getCartSharedItems/).
973
1081
  */
974
- async getCartSharedItems({ token } = {}) {
975
- const { error } = CartValidator.getCartSharedItems().validate(
1082
+ async getCartSharedItems(
1083
+ { token, requestHeaders } = { requestHeaders: {} },
1084
+ { responseHeaders } = { responseHeaders: false }
1085
+ ) {
1086
+ const { error } = CartApplicationValidator.getCartSharedItems().validate(
976
1087
  { token },
977
1088
  { abortEarly: false, allowUnknown: true }
978
1089
  );
@@ -981,16 +1092,17 @@ class Cart {
981
1092
  }
982
1093
 
983
1094
  // Showing warrnings if extra unknown parameters are found
984
- const { error: warrning } = CartValidator.getCartSharedItems().validate(
1095
+ const {
1096
+ error: warrning,
1097
+ } = CartApplicationValidator.getCartSharedItems().validate(
985
1098
  { token },
986
1099
  { abortEarly: false, allowUnknown: false }
987
1100
  );
988
1101
  if (warrning) {
989
1102
  Logger({
990
1103
  level: "WARN",
991
- message: "Parameter Validation warrnings for getCartSharedItems",
1104
+ message: `Parameter Validation warrnings for application > Cart > getCartSharedItems \n ${warrning}`,
992
1105
  });
993
- Logger({ level: "WARN", message: warrning });
994
1106
  }
995
1107
 
996
1108
  const query_params = {};
@@ -1006,12 +1118,18 @@ class Cart {
1006
1118
  }),
1007
1119
  query_params,
1008
1120
  undefined,
1009
- xHeaders
1121
+ { ...xHeaders, ...requestHeaders },
1122
+ { responseHeaders }
1010
1123
  );
1011
1124
 
1125
+ let responseData = response;
1126
+ if (responseHeaders) {
1127
+ responseData = response[0];
1128
+ }
1129
+
1012
1130
  const {
1013
1131
  error: res_error,
1014
- } = CartModel.SharedCartResponse().validate(response, {
1132
+ } = CartApplicationModel.SharedCartResponse().validate(responseData, {
1015
1133
  abortEarly: false,
1016
1134
  allowUnknown: false,
1017
1135
  });
@@ -1019,24 +1137,27 @@ class Cart {
1019
1137
  if (res_error) {
1020
1138
  Logger({
1021
1139
  level: "WARN",
1022
- message: "Response Validation Warnnings for getCartSharedItems",
1140
+ message: `Response Validation Warnnings for application > Cart > getCartSharedItems \n ${res_error}`,
1023
1141
  });
1024
- Logger({ level: "WARN", message: res_error });
1025
1142
  }
1026
1143
 
1027
1144
  return response;
1028
1145
  }
1029
1146
 
1030
1147
  /**
1031
- * @param {Object} arg - Arg object.
1032
- * @param {string} [arg.id] -
1033
- * @param {boolean} [arg.buyNow] -
1034
- * @returns {Promise<GetCouponResponse>} - Success response
1148
+ * @param {CartApplicationValidator.GetCouponsParam} arg - Arg object.
1149
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1150
+ * @param {import("../ApplicationAPIClient").Options} - Options
1151
+ * @returns {Promise<CartApplicationModel.GetCouponResponse>} - Success response
1152
+ * @name getCoupons
1035
1153
  * @summary: Fetch Coupon
1036
- * @description: Use this API to get a list of available coupons along with their details.
1154
+ * @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/application/cart/getCoupons/).
1037
1155
  */
1038
- async getCoupons({ id, buyNow } = {}) {
1039
- const { error } = CartValidator.getCoupons().validate(
1156
+ async getCoupons(
1157
+ { id, buyNow, requestHeaders } = { requestHeaders: {} },
1158
+ { responseHeaders } = { responseHeaders: false }
1159
+ ) {
1160
+ const { error } = CartApplicationValidator.getCoupons().validate(
1040
1161
  { id, buyNow },
1041
1162
  { abortEarly: false, allowUnknown: true }
1042
1163
  );
@@ -1045,16 +1166,15 @@ class Cart {
1045
1166
  }
1046
1167
 
1047
1168
  // Showing warrnings if extra unknown parameters are found
1048
- const { error: warrning } = CartValidator.getCoupons().validate(
1169
+ const { error: warrning } = CartApplicationValidator.getCoupons().validate(
1049
1170
  { id, buyNow },
1050
1171
  { abortEarly: false, allowUnknown: false }
1051
1172
  );
1052
1173
  if (warrning) {
1053
1174
  Logger({
1054
1175
  level: "WARN",
1055
- message: "Parameter Validation warrnings for getCoupons",
1176
+ message: `Parameter Validation warrnings for application > Cart > getCoupons \n ${warrning}`,
1056
1177
  });
1057
- Logger({ level: "WARN", message: warrning });
1058
1178
  }
1059
1179
 
1060
1180
  const query_params = {};
@@ -1072,12 +1192,18 @@ class Cart {
1072
1192
  }),
1073
1193
  query_params,
1074
1194
  undefined,
1075
- xHeaders
1195
+ { ...xHeaders, ...requestHeaders },
1196
+ { responseHeaders }
1076
1197
  );
1077
1198
 
1199
+ let responseData = response;
1200
+ if (responseHeaders) {
1201
+ responseData = response[0];
1202
+ }
1203
+
1078
1204
  const {
1079
1205
  error: res_error,
1080
- } = CartModel.GetCouponResponse().validate(response, {
1206
+ } = CartApplicationModel.GetCouponResponse().validate(responseData, {
1081
1207
  abortEarly: false,
1082
1208
  allowUnknown: false,
1083
1209
  });
@@ -1085,24 +1211,27 @@ class Cart {
1085
1211
  if (res_error) {
1086
1212
  Logger({
1087
1213
  level: "WARN",
1088
- message: "Response Validation Warnnings for getCoupons",
1214
+ message: `Response Validation Warnnings for application > Cart > getCoupons \n ${res_error}`,
1089
1215
  });
1090
- Logger({ level: "WARN", message: res_error });
1091
1216
  }
1092
1217
 
1093
1218
  return response;
1094
1219
  }
1095
1220
 
1096
1221
  /**
1097
- * @param {Object} arg - Arg object.
1098
- * @param {string} [arg.id] - The unique identifier of the cart.
1099
- * @param {boolean} [arg.buyNow] -
1100
- * @returns {Promise<CartItemCountResponse>} - Success response
1222
+ * @param {CartApplicationValidator.GetItemCountParam} arg - Arg object.
1223
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1224
+ * @param {import("../ApplicationAPIClient").Options} - Options
1225
+ * @returns {Promise<CartApplicationModel.CartItemCountResponse>} - Success response
1226
+ * @name getItemCount
1101
1227
  * @summary: Count items in the cart
1102
- * @description: Use this API to get the total number of items present in cart.
1228
+ * @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/application/cart/getItemCount/).
1103
1229
  */
1104
- async getItemCount({ id, buyNow } = {}) {
1105
- const { error } = CartValidator.getItemCount().validate(
1230
+ async getItemCount(
1231
+ { id, buyNow, requestHeaders } = { requestHeaders: {} },
1232
+ { responseHeaders } = { responseHeaders: false }
1233
+ ) {
1234
+ const { error } = CartApplicationValidator.getItemCount().validate(
1106
1235
  { id, buyNow },
1107
1236
  { abortEarly: false, allowUnknown: true }
1108
1237
  );
@@ -1111,16 +1240,17 @@ class Cart {
1111
1240
  }
1112
1241
 
1113
1242
  // Showing warrnings if extra unknown parameters are found
1114
- const { error: warrning } = CartValidator.getItemCount().validate(
1243
+ const {
1244
+ error: warrning,
1245
+ } = CartApplicationValidator.getItemCount().validate(
1115
1246
  { id, buyNow },
1116
1247
  { abortEarly: false, allowUnknown: false }
1117
1248
  );
1118
1249
  if (warrning) {
1119
1250
  Logger({
1120
1251
  level: "WARN",
1121
- message: "Parameter Validation warrnings for getItemCount",
1252
+ message: `Parameter Validation warrnings for application > Cart > getItemCount \n ${warrning}`,
1122
1253
  });
1123
- Logger({ level: "WARN", message: warrning });
1124
1254
  }
1125
1255
 
1126
1256
  const query_params = {};
@@ -1138,12 +1268,18 @@ class Cart {
1138
1268
  }),
1139
1269
  query_params,
1140
1270
  undefined,
1141
- xHeaders
1271
+ { ...xHeaders, ...requestHeaders },
1272
+ { responseHeaders }
1142
1273
  );
1143
1274
 
1275
+ let responseData = response;
1276
+ if (responseHeaders) {
1277
+ responseData = response[0];
1278
+ }
1279
+
1144
1280
  const {
1145
1281
  error: res_error,
1146
- } = CartModel.CartItemCountResponse().validate(response, {
1282
+ } = CartApplicationModel.CartItemCountResponse().validate(responseData, {
1147
1283
  abortEarly: false,
1148
1284
  allowUnknown: false,
1149
1285
  });
@@ -1151,30 +1287,29 @@ class Cart {
1151
1287
  if (res_error) {
1152
1288
  Logger({
1153
1289
  level: "WARN",
1154
- message: "Response Validation Warnnings for getItemCount",
1290
+ message: `Response Validation Warnnings for application > Cart > getItemCount \n ${res_error}`,
1155
1291
  });
1156
- Logger({ level: "WARN", message: res_error });
1157
1292
  }
1158
1293
 
1159
1294
  return response;
1160
1295
  }
1161
1296
 
1162
1297
  /**
1163
- * @param {Object} arg - Arg object.
1164
- * @param {string} arg.slug - A short, human-readable, URL-friendly
1165
- * identifier of a product. You can get slug value from the endpoint
1166
- * /service/application/catalog/v1.0/products/
1167
- * @param {string} [arg.storeId] - Store uid of assigned store on PDP page.
1168
- * If not passed default first created ladder will be returned
1169
- * @param {string} [arg.promotionId] - Get ladder information of given
1170
- * promotion id explicitely
1171
- * @param {number} [arg.pageSize] - Number of offers to be fetched to show
1172
- * @returns {Promise<LadderPriceOffers>} - Success response
1298
+ * @param {CartApplicationValidator.GetLadderOffersParam} arg - Arg object.
1299
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1300
+ * @param {import("../ApplicationAPIClient").Options} - Options
1301
+ * @returns {Promise<CartApplicationModel.LadderPriceOffers>} - Success response
1302
+ * @name getLadderOffers
1173
1303
  * @summary: Fetch ladder price promotion
1174
- * @description: Use this API to get applicable ladder price promotion for current product
1304
+ * @description: Use this API to get applicable ladder price promotion for current product - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/getLadderOffers/).
1175
1305
  */
1176
- async getLadderOffers({ slug, storeId, promotionId, pageSize } = {}) {
1177
- const { error } = CartValidator.getLadderOffers().validate(
1306
+ async getLadderOffers(
1307
+ { slug, storeId, promotionId, pageSize, requestHeaders } = {
1308
+ requestHeaders: {},
1309
+ },
1310
+ { responseHeaders } = { responseHeaders: false }
1311
+ ) {
1312
+ const { error } = CartApplicationValidator.getLadderOffers().validate(
1178
1313
  { slug, storeId, promotionId, pageSize },
1179
1314
  { abortEarly: false, allowUnknown: true }
1180
1315
  );
@@ -1183,16 +1318,17 @@ class Cart {
1183
1318
  }
1184
1319
 
1185
1320
  // Showing warrnings if extra unknown parameters are found
1186
- const { error: warrning } = CartValidator.getLadderOffers().validate(
1321
+ const {
1322
+ error: warrning,
1323
+ } = CartApplicationValidator.getLadderOffers().validate(
1187
1324
  { slug, storeId, promotionId, pageSize },
1188
1325
  { abortEarly: false, allowUnknown: false }
1189
1326
  );
1190
1327
  if (warrning) {
1191
1328
  Logger({
1192
1329
  level: "WARN",
1193
- message: "Parameter Validation warrnings for getLadderOffers",
1330
+ message: `Parameter Validation warrnings for application > Cart > getLadderOffers \n ${warrning}`,
1194
1331
  });
1195
- Logger({ level: "WARN", message: warrning });
1196
1332
  }
1197
1333
 
1198
1334
  const query_params = {};
@@ -1212,12 +1348,18 @@ class Cart {
1212
1348
  }),
1213
1349
  query_params,
1214
1350
  undefined,
1215
- xHeaders
1351
+ { ...xHeaders, ...requestHeaders },
1352
+ { responseHeaders }
1216
1353
  );
1217
1354
 
1355
+ let responseData = response;
1356
+ if (responseHeaders) {
1357
+ responseData = response[0];
1358
+ }
1359
+
1218
1360
  const {
1219
1361
  error: res_error,
1220
- } = CartModel.LadderPriceOffers().validate(response, {
1362
+ } = CartApplicationModel.LadderPriceOffers().validate(responseData, {
1221
1363
  abortEarly: false,
1222
1364
  allowUnknown: false,
1223
1365
  });
@@ -1225,28 +1367,29 @@ class Cart {
1225
1367
  if (res_error) {
1226
1368
  Logger({
1227
1369
  level: "WARN",
1228
- message: "Response Validation Warnnings for getLadderOffers",
1370
+ message: `Response Validation Warnnings for application > Cart > getLadderOffers \n ${res_error}`,
1229
1371
  });
1230
- Logger({ level: "WARN", message: res_error });
1231
1372
  }
1232
1373
 
1233
1374
  return response;
1234
1375
  }
1235
1376
 
1236
1377
  /**
1237
- * @param {Object} arg - Arg object.
1238
- * @param {string} [arg.slug] - A short, human-readable, URL-friendly
1239
- * identifier of a product. You can get slug value from the endpoint
1240
- * /service/application/catalog/v1.0/products/
1241
- * @param {number} [arg.pageSize] - Number of offers to be fetched to show
1242
- * @param {string} [arg.promotionGroup] - Type of promotion groups
1243
- * @param {number} [arg.storeId] - Store id
1244
- * @returns {Promise<PromotionOffersResponse>} - Success response
1378
+ * @param {CartApplicationValidator.GetPromotionOffersParam} arg - Arg object.
1379
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1380
+ * @param {import("../ApplicationAPIClient").Options} - Options
1381
+ * @returns {Promise<CartApplicationModel.PromotionOffersResponse>} - Success response
1382
+ * @name getPromotionOffers
1245
1383
  * @summary: Fetch available promotions
1246
- * @description: Use this API to get top 5 offers available for current product
1384
+ * @description: Use this API to get top 5 offers available for current product - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/getPromotionOffers/).
1247
1385
  */
1248
- async getPromotionOffers({ slug, pageSize, promotionGroup, storeId } = {}) {
1249
- const { error } = CartValidator.getPromotionOffers().validate(
1386
+ async getPromotionOffers(
1387
+ { slug, pageSize, promotionGroup, storeId, requestHeaders } = {
1388
+ requestHeaders: {},
1389
+ },
1390
+ { responseHeaders } = { responseHeaders: false }
1391
+ ) {
1392
+ const { error } = CartApplicationValidator.getPromotionOffers().validate(
1250
1393
  { slug, pageSize, promotionGroup, storeId },
1251
1394
  { abortEarly: false, allowUnknown: true }
1252
1395
  );
@@ -1255,16 +1398,17 @@ class Cart {
1255
1398
  }
1256
1399
 
1257
1400
  // Showing warrnings if extra unknown parameters are found
1258
- const { error: warrning } = CartValidator.getPromotionOffers().validate(
1401
+ const {
1402
+ error: warrning,
1403
+ } = CartApplicationValidator.getPromotionOffers().validate(
1259
1404
  { slug, pageSize, promotionGroup, storeId },
1260
1405
  { abortEarly: false, allowUnknown: false }
1261
1406
  );
1262
1407
  if (warrning) {
1263
1408
  Logger({
1264
1409
  level: "WARN",
1265
- message: "Parameter Validation warrnings for getPromotionOffers",
1410
+ message: `Parameter Validation warrnings for application > Cart > getPromotionOffers \n ${warrning}`,
1266
1411
  });
1267
- Logger({ level: "WARN", message: warrning });
1268
1412
  }
1269
1413
 
1270
1414
  const query_params = {};
@@ -1284,12 +1428,18 @@ class Cart {
1284
1428
  }),
1285
1429
  query_params,
1286
1430
  undefined,
1287
- xHeaders
1431
+ { ...xHeaders, ...requestHeaders },
1432
+ { responseHeaders }
1288
1433
  );
1289
1434
 
1435
+ let responseData = response;
1436
+ if (responseHeaders) {
1437
+ responseData = response[0];
1438
+ }
1439
+
1290
1440
  const {
1291
1441
  error: res_error,
1292
- } = CartModel.PromotionOffersResponse().validate(response, {
1442
+ } = CartApplicationModel.PromotionOffersResponse().validate(responseData, {
1293
1443
  abortEarly: false,
1294
1444
  allowUnknown: false,
1295
1445
  });
@@ -1297,33 +1447,29 @@ class Cart {
1297
1447
  if (res_error) {
1298
1448
  Logger({
1299
1449
  level: "WARN",
1300
- message: "Response Validation Warnnings for getPromotionOffers",
1450
+ message: `Response Validation Warnnings for application > Cart > getPromotionOffers \n ${res_error}`,
1301
1451
  });
1302
- Logger({ level: "WARN", message: res_error });
1303
1452
  }
1304
1453
 
1305
1454
  return response;
1306
1455
  }
1307
1456
 
1308
1457
  /**
1309
- * @param {Object} arg - Arg object.
1310
- * @param {boolean} [arg.p] - This is a boolean value. Select `true` for
1311
- * getting a payment option in response.
1312
- * @param {string} [arg.id] - The unique identifier of the cart
1313
- * @param {boolean} [arg.buyNow] -
1314
- * @param {string} [arg.addressId] - ID allotted to the selected address
1315
- * @param {string} [arg.areaCode] - The PIN Code of the destination address,
1316
- * e.g. 400059
1317
- * @param {string} [arg.orderType] - The order type of shipment HomeDelivery
1318
- * - If the customer wants the order home-delivered PickAtStore - If the
1319
- * customer wants the handover of an order at the store itself. Digital -
1320
- * If the customer wants to buy digital voucher ( for jiogames )
1321
- * @returns {Promise<CartShipmentsResponse>} - Success response
1458
+ * @param {CartApplicationValidator.GetShipmentsParam} arg - Arg object.
1459
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1460
+ * @param {import("../ApplicationAPIClient").Options} - Options
1461
+ * @returns {Promise<CartApplicationModel.CartShipmentsResponse>} - Success response
1462
+ * @name getShipments
1322
1463
  * @summary: Get delivery date and options before checkout
1323
- * @description: Use this API to get shipment details, expected delivery date, items and price breakup of the shipment.
1464
+ * @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/application/cart/getShipments/).
1324
1465
  */
1325
- async getShipments({ p, id, buyNow, addressId, areaCode, orderType } = {}) {
1326
- const { error } = CartValidator.getShipments().validate(
1466
+ async getShipments(
1467
+ { p, id, buyNow, addressId, areaCode, orderType, requestHeaders } = {
1468
+ requestHeaders: {},
1469
+ },
1470
+ { responseHeaders } = { responseHeaders: false }
1471
+ ) {
1472
+ const { error } = CartApplicationValidator.getShipments().validate(
1327
1473
  { p, id, buyNow, addressId, areaCode, orderType },
1328
1474
  { abortEarly: false, allowUnknown: true }
1329
1475
  );
@@ -1332,16 +1478,17 @@ class Cart {
1332
1478
  }
1333
1479
 
1334
1480
  // Showing warrnings if extra unknown parameters are found
1335
- const { error: warrning } = CartValidator.getShipments().validate(
1481
+ const {
1482
+ error: warrning,
1483
+ } = CartApplicationValidator.getShipments().validate(
1336
1484
  { p, id, buyNow, addressId, areaCode, orderType },
1337
1485
  { abortEarly: false, allowUnknown: false }
1338
1486
  );
1339
1487
  if (warrning) {
1340
1488
  Logger({
1341
1489
  level: "WARN",
1342
- message: "Parameter Validation warrnings for getShipments",
1490
+ message: `Parameter Validation warrnings for application > Cart > getShipments \n ${warrning}`,
1343
1491
  });
1344
- Logger({ level: "WARN", message: warrning });
1345
1492
  }
1346
1493
 
1347
1494
  const query_params = {};
@@ -1363,12 +1510,18 @@ class Cart {
1363
1510
  }),
1364
1511
  query_params,
1365
1512
  undefined,
1366
- xHeaders
1513
+ { ...xHeaders, ...requestHeaders },
1514
+ { responseHeaders }
1367
1515
  );
1368
1516
 
1517
+ let responseData = response;
1518
+ if (responseHeaders) {
1519
+ responseData = response[0];
1520
+ }
1521
+
1369
1522
  const {
1370
1523
  error: res_error,
1371
- } = CartModel.CartShipmentsResponse().validate(response, {
1524
+ } = CartApplicationModel.CartShipmentsResponse().validate(responseData, {
1372
1525
  abortEarly: false,
1373
1526
  allowUnknown: false,
1374
1527
  });
@@ -1376,23 +1529,27 @@ class Cart {
1376
1529
  if (res_error) {
1377
1530
  Logger({
1378
1531
  level: "WARN",
1379
- message: "Response Validation Warnnings for getShipments",
1532
+ message: `Response Validation Warnnings for application > Cart > getShipments \n ${res_error}`,
1380
1533
  });
1381
- Logger({ level: "WARN", message: res_error });
1382
1534
  }
1383
1535
 
1384
1536
  return response;
1385
1537
  }
1386
1538
 
1387
1539
  /**
1388
- * @param {Object} arg - Arg object.
1389
- * @param {string} arg.id - ID allotted to the selected address
1390
- * @returns {Promise<DeleteAddressResponse>} - Success response
1540
+ * @param {CartApplicationValidator.RemoveAddressParam} arg - Arg object.
1541
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1542
+ * @param {import("../ApplicationAPIClient").Options} - Options
1543
+ * @returns {Promise<CartApplicationModel.DeleteAddressResponse>} - Success response
1544
+ * @name removeAddress
1391
1545
  * @summary: Remove address associated with an account
1392
- * @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.
1546
+ * @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/application/cart/removeAddress/).
1393
1547
  */
1394
- async removeAddress({ id } = {}) {
1395
- const { error } = CartValidator.removeAddress().validate(
1548
+ async removeAddress(
1549
+ { id, requestHeaders } = { requestHeaders: {} },
1550
+ { responseHeaders } = { responseHeaders: false }
1551
+ ) {
1552
+ const { error } = CartApplicationValidator.removeAddress().validate(
1396
1553
  { id },
1397
1554
  { abortEarly: false, allowUnknown: true }
1398
1555
  );
@@ -1401,16 +1558,17 @@ class Cart {
1401
1558
  }
1402
1559
 
1403
1560
  // Showing warrnings if extra unknown parameters are found
1404
- const { error: warrning } = CartValidator.removeAddress().validate(
1561
+ const {
1562
+ error: warrning,
1563
+ } = CartApplicationValidator.removeAddress().validate(
1405
1564
  { id },
1406
1565
  { abortEarly: false, allowUnknown: false }
1407
1566
  );
1408
1567
  if (warrning) {
1409
1568
  Logger({
1410
1569
  level: "WARN",
1411
- message: "Parameter Validation warrnings for removeAddress",
1570
+ message: `Parameter Validation warrnings for application > Cart > removeAddress \n ${warrning}`,
1412
1571
  });
1413
- Logger({ level: "WARN", message: warrning });
1414
1572
  }
1415
1573
 
1416
1574
  const query_params = {};
@@ -1426,12 +1584,18 @@ class Cart {
1426
1584
  }),
1427
1585
  query_params,
1428
1586
  undefined,
1429
- xHeaders
1587
+ { ...xHeaders, ...requestHeaders },
1588
+ { responseHeaders }
1430
1589
  );
1431
1590
 
1591
+ let responseData = response;
1592
+ if (responseHeaders) {
1593
+ responseData = response[0];
1594
+ }
1595
+
1432
1596
  const {
1433
1597
  error: res_error,
1434
- } = CartModel.DeleteAddressResponse().validate(response, {
1598
+ } = CartApplicationModel.DeleteAddressResponse().validate(responseData, {
1435
1599
  abortEarly: false,
1436
1600
  allowUnknown: false,
1437
1601
  });
@@ -1439,24 +1603,27 @@ class Cart {
1439
1603
  if (res_error) {
1440
1604
  Logger({
1441
1605
  level: "WARN",
1442
- message: "Response Validation Warnnings for removeAddress",
1606
+ message: `Response Validation Warnnings for application > Cart > removeAddress \n ${res_error}`,
1443
1607
  });
1444
- Logger({ level: "WARN", message: res_error });
1445
1608
  }
1446
1609
 
1447
1610
  return response;
1448
1611
  }
1449
1612
 
1450
1613
  /**
1451
- * @param {Object} arg - Arg object.
1452
- * @param {string} [arg.id] -
1453
- * @param {boolean} [arg.buyNow] -
1454
- * @returns {Promise<CartDetailResponse>} - Success response
1614
+ * @param {CartApplicationValidator.RemoveCouponParam} arg - Arg object.
1615
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1616
+ * @param {import("../ApplicationAPIClient").Options} - Options
1617
+ * @returns {Promise<CartApplicationModel.CartDetailResponse>} - Success response
1618
+ * @name removeCoupon
1455
1619
  * @summary: Remove Coupon Applied
1456
- * @description: Remove Coupon applied on the cart by passing uid in request body.
1620
+ * @description: Remove Coupon applied on the cart by passing uid in request body. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/removeCoupon/).
1457
1621
  */
1458
- async removeCoupon({ id, buyNow } = {}) {
1459
- const { error } = CartValidator.removeCoupon().validate(
1622
+ async removeCoupon(
1623
+ { id, buyNow, requestHeaders } = { requestHeaders: {} },
1624
+ { responseHeaders } = { responseHeaders: false }
1625
+ ) {
1626
+ const { error } = CartApplicationValidator.removeCoupon().validate(
1460
1627
  { id, buyNow },
1461
1628
  { abortEarly: false, allowUnknown: true }
1462
1629
  );
@@ -1465,16 +1632,17 @@ class Cart {
1465
1632
  }
1466
1633
 
1467
1634
  // Showing warrnings if extra unknown parameters are found
1468
- const { error: warrning } = CartValidator.removeCoupon().validate(
1635
+ const {
1636
+ error: warrning,
1637
+ } = CartApplicationValidator.removeCoupon().validate(
1469
1638
  { id, buyNow },
1470
1639
  { abortEarly: false, allowUnknown: false }
1471
1640
  );
1472
1641
  if (warrning) {
1473
1642
  Logger({
1474
1643
  level: "WARN",
1475
- message: "Parameter Validation warrnings for removeCoupon",
1644
+ message: `Parameter Validation warrnings for application > Cart > removeCoupon \n ${warrning}`,
1476
1645
  });
1477
- Logger({ level: "WARN", message: warrning });
1478
1646
  }
1479
1647
 
1480
1648
  const query_params = {};
@@ -1492,12 +1660,18 @@ class Cart {
1492
1660
  }),
1493
1661
  query_params,
1494
1662
  undefined,
1495
- xHeaders
1663
+ { ...xHeaders, ...requestHeaders },
1664
+ { responseHeaders }
1496
1665
  );
1497
1666
 
1667
+ let responseData = response;
1668
+ if (responseHeaders) {
1669
+ responseData = response[0];
1670
+ }
1671
+
1498
1672
  const {
1499
1673
  error: res_error,
1500
- } = CartModel.CartDetailResponse().validate(response, {
1674
+ } = CartApplicationModel.CartDetailResponse().validate(responseData, {
1501
1675
  abortEarly: false,
1502
1676
  allowUnknown: false,
1503
1677
  });
@@ -1505,27 +1679,27 @@ class Cart {
1505
1679
  if (res_error) {
1506
1680
  Logger({
1507
1681
  level: "WARN",
1508
- message: "Response Validation Warnnings for removeCoupon",
1682
+ message: `Response Validation Warnnings for application > Cart > removeCoupon \n ${res_error}`,
1509
1683
  });
1510
- Logger({ level: "WARN", message: res_error });
1511
1684
  }
1512
1685
 
1513
1686
  return response;
1514
1687
  }
1515
1688
 
1516
1689
  /**
1517
- * @param {Object} arg - Arg object.
1518
- * @param {string} [arg.cartId] -
1519
- * @param {boolean} [arg.buyNow] -
1520
- * @param {boolean} [arg.i] -
1521
- * @param {boolean} [arg.b] -
1522
- * @param {SelectCartAddressRequest} arg.body
1523
- * @returns {Promise<CartDetailResponse>} - Success response
1690
+ * @param {CartApplicationValidator.SelectAddressParam} arg - Arg object.
1691
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1692
+ * @param {import("../ApplicationAPIClient").Options} - Options
1693
+ * @returns {Promise<CartApplicationModel.CartDetailResponse>} - Success response
1694
+ * @name selectAddress
1524
1695
  * @summary: Select an address from available addresses
1525
- * @description: <p>Select Address from all addresses associated with the account in order to ship the cart items to that address, otherwise default address will be selected implicitly. See `SelectCartAddressRequest` in schema of request body for the list of attributes needed to select Address from account. On successful request, this API returns a Cart object. Below address attributes are required. <ul> <li> <font color="monochrome">address_id</font></li> <li> <font color="monochrome">billing_address_id</font></li> <li> <font color="monochrome">uid</font></li> </ul></p>
1696
+ * @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 `SelectCartAddressRequest` in schema of request body for the list of attributes needed to select Address from account. On successful request, this API returns a Cart object. Below address attributes are required. address_id billing_address_id uid - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/selectAddress/).
1526
1697
  */
1527
- async selectAddress({ body, cartId, buyNow, i, b } = {}) {
1528
- const { error } = CartValidator.selectAddress().validate(
1698
+ async selectAddress(
1699
+ { body, cartId, buyNow, i, b, requestHeaders } = { requestHeaders: {} },
1700
+ { responseHeaders } = { responseHeaders: false }
1701
+ ) {
1702
+ const { error } = CartApplicationValidator.selectAddress().validate(
1529
1703
  { body, cartId, buyNow, i, b },
1530
1704
  { abortEarly: false, allowUnknown: true }
1531
1705
  );
@@ -1534,16 +1708,17 @@ class Cart {
1534
1708
  }
1535
1709
 
1536
1710
  // Showing warrnings if extra unknown parameters are found
1537
- const { error: warrning } = CartValidator.selectAddress().validate(
1711
+ const {
1712
+ error: warrning,
1713
+ } = CartApplicationValidator.selectAddress().validate(
1538
1714
  { body, cartId, buyNow, i, b },
1539
1715
  { abortEarly: false, allowUnknown: false }
1540
1716
  );
1541
1717
  if (warrning) {
1542
1718
  Logger({
1543
1719
  level: "WARN",
1544
- message: "Parameter Validation warrnings for selectAddress",
1720
+ message: `Parameter Validation warrnings for application > Cart > selectAddress \n ${warrning}`,
1545
1721
  });
1546
- Logger({ level: "WARN", message: warrning });
1547
1722
  }
1548
1723
 
1549
1724
  const query_params = {};
@@ -1563,12 +1738,18 @@ class Cart {
1563
1738
  }),
1564
1739
  query_params,
1565
1740
  body,
1566
- xHeaders
1741
+ { ...xHeaders, ...requestHeaders },
1742
+ { responseHeaders }
1567
1743
  );
1568
1744
 
1745
+ let responseData = response;
1746
+ if (responseHeaders) {
1747
+ responseData = response[0];
1748
+ }
1749
+
1569
1750
  const {
1570
1751
  error: res_error,
1571
- } = CartModel.CartDetailResponse().validate(response, {
1752
+ } = CartApplicationModel.CartDetailResponse().validate(responseData, {
1572
1753
  abortEarly: false,
1573
1754
  allowUnknown: false,
1574
1755
  });
@@ -1576,25 +1757,27 @@ class Cart {
1576
1757
  if (res_error) {
1577
1758
  Logger({
1578
1759
  level: "WARN",
1579
- message: "Response Validation Warnnings for selectAddress",
1760
+ message: `Response Validation Warnnings for application > Cart > selectAddress \n ${res_error}`,
1580
1761
  });
1581
- Logger({ level: "WARN", message: res_error });
1582
1762
  }
1583
1763
 
1584
1764
  return response;
1585
1765
  }
1586
1766
 
1587
1767
  /**
1588
- * @param {Object} arg - Arg object.
1589
- * @param {string} [arg.id] -
1590
- * @param {boolean} [arg.buyNow] -
1591
- * @param {UpdateCartPaymentRequest} arg.body
1592
- * @returns {Promise<CartDetailResponse>} - Success response
1768
+ * @param {CartApplicationValidator.SelectPaymentModeParam} arg - Arg object.
1769
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1770
+ * @param {import("../ApplicationAPIClient").Options} - Options
1771
+ * @returns {Promise<CartApplicationModel.CartDetailResponse>} - Success response
1772
+ * @name selectPaymentMode
1593
1773
  * @summary: Update cart payment
1594
- * @description: Use this API to update cart payment.
1774
+ * @description: Use this API to update cart payment. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/selectPaymentMode/).
1595
1775
  */
1596
- async selectPaymentMode({ body, id, buyNow } = {}) {
1597
- const { error } = CartValidator.selectPaymentMode().validate(
1776
+ async selectPaymentMode(
1777
+ { body, id, buyNow, requestHeaders } = { requestHeaders: {} },
1778
+ { responseHeaders } = { responseHeaders: false }
1779
+ ) {
1780
+ const { error } = CartApplicationValidator.selectPaymentMode().validate(
1598
1781
  { body, id, buyNow },
1599
1782
  { abortEarly: false, allowUnknown: true }
1600
1783
  );
@@ -1603,16 +1786,17 @@ class Cart {
1603
1786
  }
1604
1787
 
1605
1788
  // Showing warrnings if extra unknown parameters are found
1606
- const { error: warrning } = CartValidator.selectPaymentMode().validate(
1789
+ const {
1790
+ error: warrning,
1791
+ } = CartApplicationValidator.selectPaymentMode().validate(
1607
1792
  { body, id, buyNow },
1608
1793
  { abortEarly: false, allowUnknown: false }
1609
1794
  );
1610
1795
  if (warrning) {
1611
1796
  Logger({
1612
1797
  level: "WARN",
1613
- message: "Parameter Validation warrnings for selectPaymentMode",
1798
+ message: `Parameter Validation warrnings for application > Cart > selectPaymentMode \n ${warrning}`,
1614
1799
  });
1615
- Logger({ level: "WARN", message: warrning });
1616
1800
  }
1617
1801
 
1618
1802
  const query_params = {};
@@ -1630,12 +1814,18 @@ class Cart {
1630
1814
  }),
1631
1815
  query_params,
1632
1816
  body,
1633
- xHeaders
1817
+ { ...xHeaders, ...requestHeaders },
1818
+ { responseHeaders }
1634
1819
  );
1635
1820
 
1821
+ let responseData = response;
1822
+ if (responseHeaders) {
1823
+ responseData = response[0];
1824
+ }
1825
+
1636
1826
  const {
1637
1827
  error: res_error,
1638
- } = CartModel.CartDetailResponse().validate(response, {
1828
+ } = CartApplicationModel.CartDetailResponse().validate(responseData, {
1639
1829
  abortEarly: false,
1640
1830
  allowUnknown: false,
1641
1831
  });
@@ -1643,24 +1833,27 @@ class Cart {
1643
1833
  if (res_error) {
1644
1834
  Logger({
1645
1835
  level: "WARN",
1646
- message: "Response Validation Warnnings for selectPaymentMode",
1836
+ message: `Response Validation Warnnings for application > Cart > selectPaymentMode \n ${res_error}`,
1647
1837
  });
1648
- Logger({ level: "WARN", message: res_error });
1649
1838
  }
1650
1839
 
1651
1840
  return response;
1652
1841
  }
1653
1842
 
1654
1843
  /**
1655
- * @param {Object} arg - Arg object.
1656
- * @param {string} arg.id - ID allotted to the selected address
1657
- * @param {Address} arg.body
1658
- * @returns {Promise<UpdateAddressResponse>} - Success response
1844
+ * @param {CartApplicationValidator.UpdateAddressParam} arg - Arg object.
1845
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1846
+ * @param {import("../ApplicationAPIClient").Options} - Options
1847
+ * @returns {Promise<CartApplicationModel.UpdateAddressResponse>} - Success response
1848
+ * @name updateAddress
1659
1849
  * @summary: Update address added to an account
1660
- * @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>
1850
+ * @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/application/cart/updateAddress/).
1661
1851
  */
1662
- async updateAddress({ id, body } = {}) {
1663
- const { error } = CartValidator.updateAddress().validate(
1852
+ async updateAddress(
1853
+ { id, body, requestHeaders } = { requestHeaders: {} },
1854
+ { responseHeaders } = { responseHeaders: false }
1855
+ ) {
1856
+ const { error } = CartApplicationValidator.updateAddress().validate(
1664
1857
  { id, body },
1665
1858
  { abortEarly: false, allowUnknown: true }
1666
1859
  );
@@ -1669,16 +1862,17 @@ class Cart {
1669
1862
  }
1670
1863
 
1671
1864
  // Showing warrnings if extra unknown parameters are found
1672
- const { error: warrning } = CartValidator.updateAddress().validate(
1865
+ const {
1866
+ error: warrning,
1867
+ } = CartApplicationValidator.updateAddress().validate(
1673
1868
  { id, body },
1674
1869
  { abortEarly: false, allowUnknown: false }
1675
1870
  );
1676
1871
  if (warrning) {
1677
1872
  Logger({
1678
1873
  level: "WARN",
1679
- message: "Parameter Validation warrnings for updateAddress",
1874
+ message: `Parameter Validation warrnings for application > Cart > updateAddress \n ${warrning}`,
1680
1875
  });
1681
- Logger({ level: "WARN", message: warrning });
1682
1876
  }
1683
1877
 
1684
1878
  const query_params = {};
@@ -1694,12 +1888,18 @@ class Cart {
1694
1888
  }),
1695
1889
  query_params,
1696
1890
  body,
1697
- xHeaders
1891
+ { ...xHeaders, ...requestHeaders },
1892
+ { responseHeaders }
1698
1893
  );
1699
1894
 
1895
+ let responseData = response;
1896
+ if (responseHeaders) {
1897
+ responseData = response[0];
1898
+ }
1899
+
1700
1900
  const {
1701
1901
  error: res_error,
1702
- } = CartModel.UpdateAddressResponse().validate(response, {
1902
+ } = CartApplicationModel.UpdateAddressResponse().validate(responseData, {
1703
1903
  abortEarly: false,
1704
1904
  allowUnknown: false,
1705
1905
  });
@@ -1707,28 +1907,30 @@ class Cart {
1707
1907
  if (res_error) {
1708
1908
  Logger({
1709
1909
  level: "WARN",
1710
- message: "Response Validation Warnnings for updateAddress",
1910
+ message: `Response Validation Warnnings for application > Cart > updateAddress \n ${res_error}`,
1711
1911
  });
1712
- Logger({ level: "WARN", message: res_error });
1713
1912
  }
1714
1913
 
1715
1914
  return response;
1716
1915
  }
1717
1916
 
1718
1917
  /**
1719
- * @param {Object} arg - Arg object.
1720
- * @param {string} [arg.id] -
1721
- * @param {boolean} [arg.i] -
1722
- * @param {boolean} [arg.b] -
1723
- * @param {string} [arg.areaCode] -
1724
- * @param {boolean} [arg.buyNow] -
1725
- * @param {UpdateCartRequest} arg.body
1726
- * @returns {Promise<UpdateCartDetailResponse>} - Success response
1918
+ * @param {CartApplicationValidator.UpdateCartParam} arg - Arg object.
1919
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1920
+ * @param {import("../ApplicationAPIClient").Options} - Options
1921
+ * @returns {Promise<CartApplicationModel.UpdateCartDetailResponse>} -
1922
+ * Success response
1923
+ * @name updateCart
1727
1924
  * @summary: Update items in the cart
1728
- * @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>
1925
+ * @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/application/cart/updateCart/).
1729
1926
  */
1730
- async updateCart({ body, id, i, b, areaCode, buyNow } = {}) {
1731
- const { error } = CartValidator.updateCart().validate(
1927
+ async updateCart(
1928
+ { body, id, i, b, areaCode, buyNow, requestHeaders } = {
1929
+ requestHeaders: {},
1930
+ },
1931
+ { responseHeaders } = { responseHeaders: false }
1932
+ ) {
1933
+ const { error } = CartApplicationValidator.updateCart().validate(
1732
1934
  { body, id, i, b, areaCode, buyNow },
1733
1935
  { abortEarly: false, allowUnknown: true }
1734
1936
  );
@@ -1737,16 +1939,15 @@ class Cart {
1737
1939
  }
1738
1940
 
1739
1941
  // Showing warrnings if extra unknown parameters are found
1740
- const { error: warrning } = CartValidator.updateCart().validate(
1942
+ const { error: warrning } = CartApplicationValidator.updateCart().validate(
1741
1943
  { body, id, i, b, areaCode, buyNow },
1742
1944
  { abortEarly: false, allowUnknown: false }
1743
1945
  );
1744
1946
  if (warrning) {
1745
1947
  Logger({
1746
1948
  level: "WARN",
1747
- message: "Parameter Validation warrnings for updateCart",
1949
+ message: `Parameter Validation warrnings for application > Cart > updateCart \n ${warrning}`,
1748
1950
  });
1749
- Logger({ level: "WARN", message: warrning });
1750
1951
  }
1751
1952
 
1752
1953
  const query_params = {};
@@ -1767,12 +1968,18 @@ class Cart {
1767
1968
  }),
1768
1969
  query_params,
1769
1970
  body,
1770
- xHeaders
1971
+ { ...xHeaders, ...requestHeaders },
1972
+ { responseHeaders }
1771
1973
  );
1772
1974
 
1975
+ let responseData = response;
1976
+ if (responseHeaders) {
1977
+ responseData = response[0];
1978
+ }
1979
+
1773
1980
  const {
1774
1981
  error: res_error,
1775
- } = CartModel.UpdateCartDetailResponse().validate(response, {
1982
+ } = CartApplicationModel.UpdateCartDetailResponse().validate(responseData, {
1776
1983
  abortEarly: false,
1777
1984
  allowUnknown: false,
1778
1985
  });
@@ -1780,25 +1987,27 @@ class Cart {
1780
1987
  if (res_error) {
1781
1988
  Logger({
1782
1989
  level: "WARN",
1783
- message: "Response Validation Warnnings for updateCart",
1990
+ message: `Response Validation Warnnings for application > Cart > updateCart \n ${res_error}`,
1784
1991
  });
1785
- Logger({ level: "WARN", message: res_error });
1786
1992
  }
1787
1993
 
1788
1994
  return response;
1789
1995
  }
1790
1996
 
1791
1997
  /**
1792
- * @param {Object} arg - Arg object.
1793
- * @param {string} [arg.id] -
1794
- * @param {boolean} [arg.buyNow] -
1795
- * @param {CartMetaRequest} arg.body
1796
- * @returns {Promise<CartMetaResponse>} - Success response
1998
+ * @param {CartApplicationValidator.UpdateCartMetaParam} arg - Arg object.
1999
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
2000
+ * @param {import("../ApplicationAPIClient").Options} - Options
2001
+ * @returns {Promise<CartApplicationModel.CartMetaResponse>} - Success response
2002
+ * @name updateCartMeta
1797
2003
  * @summary: Update the cart meta
1798
- * @description: Use this API to update cart meta like checkout_mode and gstin.
2004
+ * @description: Use this API to update cart meta like checkout_mode and gstin. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/updateCartMeta/).
1799
2005
  */
1800
- async updateCartMeta({ body, id, buyNow } = {}) {
1801
- const { error } = CartValidator.updateCartMeta().validate(
2006
+ async updateCartMeta(
2007
+ { body, id, buyNow, requestHeaders } = { requestHeaders: {} },
2008
+ { responseHeaders } = { responseHeaders: false }
2009
+ ) {
2010
+ const { error } = CartApplicationValidator.updateCartMeta().validate(
1802
2011
  { body, id, buyNow },
1803
2012
  { abortEarly: false, allowUnknown: true }
1804
2013
  );
@@ -1807,16 +2016,17 @@ class Cart {
1807
2016
  }
1808
2017
 
1809
2018
  // Showing warrnings if extra unknown parameters are found
1810
- const { error: warrning } = CartValidator.updateCartMeta().validate(
2019
+ const {
2020
+ error: warrning,
2021
+ } = CartApplicationValidator.updateCartMeta().validate(
1811
2022
  { body, id, buyNow },
1812
2023
  { abortEarly: false, allowUnknown: false }
1813
2024
  );
1814
2025
  if (warrning) {
1815
2026
  Logger({
1816
2027
  level: "WARN",
1817
- message: "Parameter Validation warrnings for updateCartMeta",
2028
+ message: `Parameter Validation warrnings for application > Cart > updateCartMeta \n ${warrning}`,
1818
2029
  });
1819
- Logger({ level: "WARN", message: warrning });
1820
2030
  }
1821
2031
 
1822
2032
  const query_params = {};
@@ -1834,36 +2044,48 @@ class Cart {
1834
2044
  }),
1835
2045
  query_params,
1836
2046
  body,
1837
- xHeaders
2047
+ { ...xHeaders, ...requestHeaders },
2048
+ { responseHeaders }
1838
2049
  );
1839
2050
 
1840
- const { error: res_error } = CartModel.CartMetaResponse().validate(
1841
- response,
1842
- { abortEarly: false, allowUnknown: false }
1843
- );
2051
+ let responseData = response;
2052
+ if (responseHeaders) {
2053
+ responseData = response[0];
2054
+ }
2055
+
2056
+ const {
2057
+ error: res_error,
2058
+ } = CartApplicationModel.CartMetaResponse().validate(responseData, {
2059
+ abortEarly: false,
2060
+ allowUnknown: false,
2061
+ });
1844
2062
 
1845
2063
  if (res_error) {
1846
2064
  Logger({
1847
2065
  level: "WARN",
1848
- message: "Response Validation Warnnings for updateCartMeta",
2066
+ message: `Response Validation Warnnings for application > Cart > updateCartMeta \n ${res_error}`,
1849
2067
  });
1850
- Logger({ level: "WARN", message: res_error });
1851
2068
  }
1852
2069
 
1853
2070
  return response;
1854
2071
  }
1855
2072
 
1856
2073
  /**
1857
- * @param {Object} arg - Arg object.
1858
- * @param {string} arg.token - Token of the shared short link
1859
- * @param {string} arg.action - Operation to perform on the existing cart
1860
- * merge or replace.
1861
- * @returns {Promise<SharedCartResponse>} - Success response
2074
+ * @param {CartApplicationValidator.UpdateCartWithSharedItemsParam} arg - Arg object.
2075
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
2076
+ * @param {import("../ApplicationAPIClient").Options} - Options
2077
+ * @returns {Promise<CartApplicationModel.SharedCartResponse>} - Success response
2078
+ * @name updateCartWithSharedItems
1862
2079
  * @summary: Merge or replace existing cart
1863
- * @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.
2080
+ * @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/application/cart/updateCartWithSharedItems/).
1864
2081
  */
1865
- async updateCartWithSharedItems({ token, action } = {}) {
1866
- const { error } = CartValidator.updateCartWithSharedItems().validate(
2082
+ async updateCartWithSharedItems(
2083
+ { token, action, requestHeaders } = { requestHeaders: {} },
2084
+ { responseHeaders } = { responseHeaders: false }
2085
+ ) {
2086
+ const {
2087
+ error,
2088
+ } = CartApplicationValidator.updateCartWithSharedItems().validate(
1867
2089
  { token, action },
1868
2090
  { abortEarly: false, allowUnknown: true }
1869
2091
  );
@@ -1874,16 +2096,15 @@ class Cart {
1874
2096
  // Showing warrnings if extra unknown parameters are found
1875
2097
  const {
1876
2098
  error: warrning,
1877
- } = CartValidator.updateCartWithSharedItems().validate(
2099
+ } = CartApplicationValidator.updateCartWithSharedItems().validate(
1878
2100
  { token, action },
1879
2101
  { abortEarly: false, allowUnknown: false }
1880
2102
  );
1881
2103
  if (warrning) {
1882
2104
  Logger({
1883
2105
  level: "WARN",
1884
- message: "Parameter Validation warrnings for updateCartWithSharedItems",
2106
+ message: `Parameter Validation warrnings for application > Cart > updateCartWithSharedItems \n ${warrning}`,
1885
2107
  });
1886
- Logger({ level: "WARN", message: warrning });
1887
2108
  }
1888
2109
 
1889
2110
  const query_params = {};
@@ -1899,12 +2120,18 @@ class Cart {
1899
2120
  }),
1900
2121
  query_params,
1901
2122
  undefined,
1902
- xHeaders
2123
+ { ...xHeaders, ...requestHeaders },
2124
+ { responseHeaders }
1903
2125
  );
1904
2126
 
2127
+ let responseData = response;
2128
+ if (responseHeaders) {
2129
+ responseData = response[0];
2130
+ }
2131
+
1905
2132
  const {
1906
2133
  error: res_error,
1907
- } = CartModel.SharedCartResponse().validate(response, {
2134
+ } = CartApplicationModel.SharedCartResponse().validate(responseData, {
1908
2135
  abortEarly: false,
1909
2136
  allowUnknown: false,
1910
2137
  });
@@ -1912,45 +2139,42 @@ class Cart {
1912
2139
  if (res_error) {
1913
2140
  Logger({
1914
2141
  level: "WARN",
1915
- message: "Response Validation Warnnings for updateCartWithSharedItems",
2142
+ message: `Response Validation Warnnings for application > Cart > updateCartWithSharedItems \n ${res_error}`,
1916
2143
  });
1917
- Logger({ level: "WARN", message: res_error });
1918
2144
  }
1919
2145
 
1920
2146
  return response;
1921
2147
  }
1922
2148
 
1923
2149
  /**
1924
- * @param {Object} arg - Arg object.
1925
- * @param {string} [arg.id] -
1926
- * @param {boolean} [arg.buyNow] -
1927
- * @param {string} [arg.addressId] -
1928
- * @param {string} [arg.paymentMode] -
1929
- * @param {string} [arg.paymentIdentifier] -
1930
- * @param {string} [arg.aggregatorName] -
1931
- * @param {string} [arg.merchantCode] -
1932
- * @param {string} [arg.iin] -
1933
- * @param {string} [arg.network] -
1934
- * @param {string} [arg.type] -
1935
- * @param {string} [arg.cardId] -
1936
- * @returns {Promise<PaymentCouponValidate>} - Success response
2150
+ * @param {CartApplicationValidator.ValidateCouponForPaymentParam} arg - Arg object.
2151
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
2152
+ * @param {import("../ApplicationAPIClient").Options} - Options
2153
+ * @returns {Promise<CartApplicationModel.PaymentCouponValidate>} - Success response
2154
+ * @name validateCouponForPayment
1937
2155
  * @summary: Verify the coupon eligibility against the payment mode
1938
- * @description: Use this API to validate a coupon against the payment mode such as NetBanking, Wallet, UPI etc.
2156
+ * @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/application/cart/validateCouponForPayment/).
1939
2157
  */
1940
- async validateCouponForPayment({
1941
- id,
1942
- buyNow,
1943
- addressId,
1944
- paymentMode,
1945
- paymentIdentifier,
1946
- aggregatorName,
1947
- merchantCode,
1948
- iin,
1949
- network,
1950
- type,
1951
- cardId,
1952
- } = {}) {
1953
- const { error } = CartValidator.validateCouponForPayment().validate(
2158
+ async validateCouponForPayment(
2159
+ {
2160
+ id,
2161
+ buyNow,
2162
+ addressId,
2163
+ paymentMode,
2164
+ paymentIdentifier,
2165
+ aggregatorName,
2166
+ merchantCode,
2167
+ iin,
2168
+ network,
2169
+ type,
2170
+ cardId,
2171
+ requestHeaders,
2172
+ } = { requestHeaders: {} },
2173
+ { responseHeaders } = { responseHeaders: false }
2174
+ ) {
2175
+ const {
2176
+ error,
2177
+ } = CartApplicationValidator.validateCouponForPayment().validate(
1954
2178
  {
1955
2179
  id,
1956
2180
  buyNow,
@@ -1973,7 +2197,7 @@ class Cart {
1973
2197
  // Showing warrnings if extra unknown parameters are found
1974
2198
  const {
1975
2199
  error: warrning,
1976
- } = CartValidator.validateCouponForPayment().validate(
2200
+ } = CartApplicationValidator.validateCouponForPayment().validate(
1977
2201
  {
1978
2202
  id,
1979
2203
  buyNow,
@@ -1992,9 +2216,8 @@ class Cart {
1992
2216
  if (warrning) {
1993
2217
  Logger({
1994
2218
  level: "WARN",
1995
- message: "Parameter Validation warrnings for validateCouponForPayment",
2219
+ message: `Parameter Validation warrnings for application > Cart > validateCouponForPayment \n ${warrning}`,
1996
2220
  });
1997
- Logger({ level: "WARN", message: warrning });
1998
2221
  }
1999
2222
 
2000
2223
  const query_params = {};
@@ -2021,12 +2244,18 @@ class Cart {
2021
2244
  }),
2022
2245
  query_params,
2023
2246
  undefined,
2024
- xHeaders
2247
+ { ...xHeaders, ...requestHeaders },
2248
+ { responseHeaders }
2025
2249
  );
2026
2250
 
2251
+ let responseData = response;
2252
+ if (responseHeaders) {
2253
+ responseData = response[0];
2254
+ }
2255
+
2027
2256
  const {
2028
2257
  error: res_error,
2029
- } = CartModel.PaymentCouponValidate().validate(response, {
2258
+ } = CartApplicationModel.PaymentCouponValidate().validate(responseData, {
2030
2259
  abortEarly: false,
2031
2260
  allowUnknown: false,
2032
2261
  });
@@ -2034,9 +2263,8 @@ class Cart {
2034
2263
  if (res_error) {
2035
2264
  Logger({
2036
2265
  level: "WARN",
2037
- message: "Response Validation Warnnings for validateCouponForPayment",
2266
+ message: `Response Validation Warnnings for application > Cart > validateCouponForPayment \n ${res_error}`,
2038
2267
  });
2039
- Logger({ level: "WARN", message: res_error });
2040
2268
  }
2041
2269
 
2042
2270
  return response;