@gofynd/fdk-client-javascript 1.1.6 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (321) hide show
  1. package/README.md +12 -0
  2. package/index.js +0 -3
  3. package/package.json +1 -1
  4. package/sdk/application/ApplicationAPIClient.d.ts +15 -1
  5. package/sdk/application/ApplicationAPIClient.js +8 -1
  6. package/sdk/application/ApplicationClient.d.ts +37 -6
  7. package/sdk/application/ApplicationClient.js +31 -0
  8. package/sdk/application/ApplicationConfig.d.ts +52 -12
  9. package/sdk/application/ApplicationConfig.js +37 -2
  10. package/sdk/application/ApplicationModels.d.ts +46 -1
  11. package/sdk/application/ApplicationModels.js +18 -0
  12. package/sdk/application/Cart/CartApplicationClient.d.ts +172 -357
  13. package/sdk/application/Cart/CartApplicationClient.js +620 -483
  14. package/sdk/application/Cart/CartApplicationModel.d.ts +2054 -96
  15. package/sdk/application/Cart/CartApplicationModel.js +1224 -93
  16. package/sdk/application/Cart/CartApplicationValidator.d.ts +508 -30
  17. package/sdk/application/Cart/CartApplicationValidator.js +270 -15
  18. package/sdk/application/Catalog/CatalogApplicationClient.d.ts +234 -413
  19. package/sdk/application/Catalog/CatalogApplicationClient.js +777 -630
  20. package/sdk/application/Catalog/CatalogApplicationModel.d.ts +2218 -117
  21. package/sdk/application/Catalog/CatalogApplicationModel.js +1499 -170
  22. package/sdk/application/Catalog/CatalogApplicationValidator.d.ts +798 -31
  23. package/sdk/application/Catalog/CatalogApplicationValidator.js +318 -3
  24. package/sdk/application/Common/CommonApplicationClient.d.ts +14 -21
  25. package/sdk/application/Common/CommonApplicationClient.js +50 -33
  26. package/sdk/application/Common/CommonApplicationModel.d.ts +448 -19
  27. package/sdk/application/Common/CommonApplicationModel.js +224 -16
  28. package/sdk/application/Common/CommonApplicationValidator.d.ts +42 -4
  29. package/sdk/application/Common/CommonApplicationValidator.js +21 -3
  30. package/sdk/application/Communication/CommunicationApplicationClient.d.ts +25 -18
  31. package/sdk/application/Communication/CommunicationApplicationClient.js +74 -47
  32. package/sdk/application/Communication/CommunicationApplicationModel.d.ts +190 -14
  33. package/sdk/application/Communication/CommunicationApplicationModel.js +124 -7
  34. package/sdk/application/Communication/CommunicationApplicationValidator.d.ts +27 -4
  35. package/sdk/application/Communication/CommunicationApplicationValidator.js +21 -5
  36. package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +113 -112
  37. package/sdk/application/Configuration/ConfigurationApplicationClient.js +381 -260
  38. package/sdk/application/Configuration/ConfigurationApplicationModel.d.ts +2453 -110
  39. package/sdk/application/Configuration/ConfigurationApplicationModel.js +1254 -108
  40. package/sdk/application/Configuration/ConfigurationApplicationValidator.d.ts +160 -8
  41. package/sdk/application/Configuration/ConfigurationApplicationValidator.js +88 -4
  42. package/sdk/application/Content/ContentApplicationClient.d.ts +120 -138
  43. package/sdk/application/Content/ContentApplicationClient.js +409 -277
  44. package/sdk/application/Content/ContentApplicationModel.d.ts +1627 -105
  45. package/sdk/application/Content/ContentApplicationModel.js +1202 -109
  46. package/sdk/application/Content/ContentApplicationValidator.d.ts +214 -12
  47. package/sdk/application/Content/ContentApplicationValidator.js +113 -3
  48. package/sdk/application/FileStorage/FileStorageApplicationClient.d.ts +20 -29
  49. package/sdk/application/FileStorage/FileStorageApplicationClient.js +68 -47
  50. package/sdk/application/FileStorage/FileStorageApplicationModel.d.ts +299 -20
  51. package/sdk/application/FileStorage/FileStorageApplicationModel.js +209 -16
  52. package/sdk/application/FileStorage/FileStorageApplicationValidator.d.ts +55 -5
  53. package/sdk/application/FileStorage/FileStorageApplicationValidator.js +33 -6
  54. package/sdk/application/Lead/LeadApplicationClient.d.ts +50 -53
  55. package/sdk/application/Lead/LeadApplicationClient.js +169 -103
  56. package/sdk/application/Lead/LeadApplicationModel.d.ts +1405 -54
  57. package/sdk/application/Lead/LeadApplicationModel.js +619 -73
  58. package/sdk/application/Lead/LeadApplicationValidator.d.ts +91 -9
  59. package/sdk/application/Lead/LeadApplicationValidator.js +51 -6
  60. package/sdk/application/Logistic/LogisticApplicationClient.d.ts +34 -33
  61. package/sdk/application/Logistic/LogisticApplicationClient.js +110 -73
  62. package/sdk/application/Logistic/LogisticApplicationModel.d.ts +399 -28
  63. package/sdk/application/Logistic/LogisticApplicationModel.js +293 -24
  64. package/sdk/application/Logistic/LogisticApplicationValidator.d.ts +48 -6
  65. package/sdk/application/Logistic/LogisticApplicationValidator.js +34 -6
  66. package/sdk/application/Order/OrderApplicationClient.d.ts +81 -133
  67. package/sdk/application/Order/OrderApplicationClient.js +297 -217
  68. package/sdk/application/Order/OrderApplicationModel.d.ts +1101 -66
  69. package/sdk/application/Order/OrderApplicationModel.js +776 -57
  70. package/sdk/application/Order/OrderApplicationValidator.d.ts +249 -14
  71. package/sdk/application/Order/OrderApplicationValidator.js +114 -5
  72. package/sdk/application/Payment/PaymentApplicationClient.d.ts +341 -356
  73. package/sdk/application/Payment/PaymentApplicationClient.js +1077 -703
  74. package/sdk/application/Payment/PaymentApplicationModel.d.ts +3125 -99
  75. package/sdk/application/Payment/PaymentApplicationModel.js +1158 -62
  76. package/sdk/application/Payment/PaymentApplicationValidator.d.ts +494 -41
  77. package/sdk/application/Payment/PaymentApplicationValidator.js +297 -25
  78. package/sdk/application/PosCart/PosCartApplicationClient.d.ts +178 -350
  79. package/sdk/application/PosCart/PosCartApplicationClient.js +636 -491
  80. package/sdk/application/PosCart/PosCartApplicationModel.d.ts +1823 -89
  81. package/sdk/application/PosCart/PosCartApplicationModel.js +1117 -85
  82. package/sdk/application/PosCart/PosCartApplicationValidator.d.ts +480 -29
  83. package/sdk/application/PosCart/PosCartApplicationValidator.js +262 -15
  84. package/sdk/application/Rewards/RewardsApplicationClient.d.ts +49 -47
  85. package/sdk/application/Rewards/RewardsApplicationClient.js +160 -102
  86. package/sdk/application/Rewards/RewardsApplicationModel.d.ts +343 -22
  87. package/sdk/application/Rewards/RewardsApplicationModel.js +230 -15
  88. package/sdk/application/Rewards/RewardsApplicationValidator.d.ts +70 -7
  89. package/sdk/application/Rewards/RewardsApplicationValidator.js +45 -6
  90. package/sdk/application/Share/ShareApplicationClient.d.ts +44 -50
  91. package/sdk/application/Share/ShareApplicationClient.js +165 -97
  92. package/sdk/application/Share/ShareApplicationModel.d.ts +230 -15
  93. package/sdk/application/Share/ShareApplicationModel.js +154 -16
  94. package/sdk/application/Share/ShareApplicationValidator.d.ts +86 -8
  95. package/sdk/application/Share/ShareApplicationValidator.js +48 -4
  96. package/sdk/application/Theme/ThemeApplicationClient.d.ts +25 -27
  97. package/sdk/application/Theme/ThemeApplicationClient.js +83 -54
  98. package/sdk/application/Theme/ThemeApplicationModel.d.ts +621 -48
  99. package/sdk/application/Theme/ThemeApplicationModel.js +464 -40
  100. package/sdk/application/Theme/ThemeApplicationValidator.d.ts +49 -5
  101. package/sdk/application/Theme/ThemeApplicationValidator.js +26 -3
  102. package/sdk/application/User/UserApplicationClient.d.ts +219 -303
  103. package/sdk/application/User/UserApplicationClient.js +819 -522
  104. package/sdk/application/User/UserApplicationModel.d.ts +1390 -101
  105. package/sdk/application/User/UserApplicationModel.js +983 -44
  106. package/sdk/application/User/UserApplicationValidator.d.ts +457 -33
  107. package/sdk/application/User/UserApplicationValidator.js +265 -31
  108. package/sdk/common/AxiosHelper.js +8 -2
  109. package/sdk/common/Paginator.d.ts +27 -12
  110. package/sdk/common/Paginator.js +15 -0
  111. package/sdk/common/RequestSigner.js +0 -1
  112. package/sdk/partner/PartnerAPIClient.d.ts +15 -1
  113. package/sdk/partner/PartnerAPIClient.js +8 -1
  114. package/sdk/partner/PartnerClient.d.ts +20 -3
  115. package/sdk/partner/PartnerClient.js +17 -0
  116. package/sdk/partner/PartnerConfig.d.ts +40 -14
  117. package/sdk/partner/PartnerConfig.js +31 -6
  118. package/sdk/platform/AuditTrail/AuditTrailPlatformClient.d.ts +26 -25
  119. package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +82 -53
  120. package/sdk/platform/AuditTrail/AuditTrailPlatformModel.d.ts +202 -17
  121. package/sdk/platform/AuditTrail/AuditTrailPlatformModel.js +139 -10
  122. package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.d.ts +42 -5
  123. package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.js +26 -4
  124. package/sdk/platform/Billing/BillingPlatformClient.d.ts +88 -97
  125. package/sdk/platform/Billing/BillingPlatformClient.js +310 -191
  126. package/sdk/platform/Billing/BillingPlatformModel.d.ts +1211 -68
  127. package/sdk/platform/Billing/BillingPlatformModel.js +824 -59
  128. package/sdk/platform/Billing/BillingPlatformValidator.d.ts +153 -12
  129. package/sdk/platform/Billing/BillingPlatformValidator.js +87 -8
  130. package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +392 -634
  131. package/sdk/platform/Cart/CartPlatformApplicationClient.js +1480 -957
  132. package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +827 -57
  133. package/sdk/platform/Cart/CartPlatformApplicationValidator.js +492 -34
  134. package/sdk/platform/Cart/CartPlatformModel.d.ts +3639 -175
  135. package/sdk/platform/Cart/CartPlatformModel.js +2368 -212
  136. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +438 -615
  137. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +1449 -984
  138. package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +1081 -49
  139. package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +482 -23
  140. package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +573 -824
  141. package/sdk/platform/Catalog/CatalogPlatformClient.js +1773 -1264
  142. package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +6871 -326
  143. package/sdk/platform/Catalog/CatalogPlatformModel.js +4215 -349
  144. package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +1331 -71
  145. package/sdk/platform/Catalog/CatalogPlatformValidator.js +611 -30
  146. package/sdk/platform/Common/CommonPlatformClient.d.ts +14 -21
  147. package/sdk/platform/Common/CommonPlatformClient.js +48 -33
  148. package/sdk/platform/Common/CommonPlatformModel.d.ts +448 -19
  149. package/sdk/platform/Common/CommonPlatformModel.js +224 -16
  150. package/sdk/platform/Common/CommonPlatformValidator.d.ts +42 -4
  151. package/sdk/platform/Common/CommonPlatformValidator.js +21 -3
  152. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +457 -279
  153. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +1423 -553
  154. package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.d.ts +581 -42
  155. package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.js +294 -22
  156. package/sdk/platform/Communication/CommunicationPlatformClient.d.ts +18 -5
  157. package/sdk/platform/Communication/CommunicationPlatformClient.js +58 -19
  158. package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +1630 -102
  159. package/sdk/platform/Communication/CommunicationPlatformModel.js +1150 -85
  160. package/sdk/platform/Communication/CommunicationPlatformValidator.d.ts +16 -3
  161. package/sdk/platform/Communication/CommunicationPlatformValidator.js +11 -3
  162. package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +102 -111
  163. package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +321 -225
  164. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +830 -43
  165. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +612 -78
  166. package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.d.ts +180 -13
  167. package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.js +98 -10
  168. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +232 -212
  169. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +737 -438
  170. package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.d.ts +293 -22
  171. package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.js +184 -17
  172. package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +166 -178
  173. package/sdk/platform/Configuration/ConfigurationPlatformClient.js +519 -310
  174. package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +4504 -188
  175. package/sdk/platform/Configuration/ConfigurationPlatformModel.js +2242 -204
  176. package/sdk/platform/Configuration/ConfigurationPlatformValidator.d.ts +332 -19
  177. package/sdk/platform/Configuration/ConfigurationPlatformValidator.js +153 -10
  178. package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +495 -560
  179. package/sdk/platform/Content/ContentPlatformApplicationClient.js +1777 -987
  180. package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +872 -62
  181. package/sdk/platform/Content/ContentPlatformApplicationValidator.js +487 -35
  182. package/sdk/platform/Content/ContentPlatformModel.d.ts +1661 -108
  183. package/sdk/platform/Content/ContentPlatformModel.js +1217 -113
  184. package/sdk/platform/Discount/DiscountPlatformClient.d.ts +67 -101
  185. package/sdk/platform/Discount/DiscountPlatformClient.js +240 -176
  186. package/sdk/platform/Discount/DiscountPlatformModel.d.ts +242 -15
  187. package/sdk/platform/Discount/DiscountPlatformModel.js +162 -10
  188. package/sdk/platform/Discount/DiscountPlatformValidator.d.ts +185 -13
  189. package/sdk/platform/Discount/DiscountPlatformValidator.js +88 -8
  190. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +32 -41
  191. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +106 -74
  192. package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.d.ts +77 -6
  193. package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.js +41 -6
  194. package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +39 -54
  195. package/sdk/platform/FileStorage/FileStoragePlatformClient.js +124 -99
  196. package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +299 -20
  197. package/sdk/platform/FileStorage/FileStoragePlatformModel.js +207 -16
  198. package/sdk/platform/FileStorage/FileStoragePlatformValidator.d.ts +98 -8
  199. package/sdk/platform/FileStorage/FileStoragePlatformValidator.js +54 -7
  200. package/sdk/platform/Finance/FinancePlatformClient.d.ts +85 -91
  201. package/sdk/platform/Finance/FinancePlatformClient.js +272 -180
  202. package/sdk/platform/Finance/FinancePlatformModel.d.ts +619 -50
  203. package/sdk/platform/Finance/FinancePlatformModel.js +458 -30
  204. package/sdk/platform/Finance/FinancePlatformValidator.d.ts +123 -15
  205. package/sdk/platform/Finance/FinancePlatformValidator.js +95 -16
  206. package/sdk/platform/Inventory/InventoryPlatformClient.d.ts +99 -97
  207. package/sdk/platform/Inventory/InventoryPlatformClient.js +288 -199
  208. package/sdk/platform/Inventory/InventoryPlatformModel.d.ts +1354 -61
  209. package/sdk/platform/Inventory/InventoryPlatformModel.js +916 -83
  210. package/sdk/platform/Inventory/InventoryPlatformValidator.d.ts +168 -12
  211. package/sdk/platform/Inventory/InventoryPlatformValidator.js +82 -6
  212. package/sdk/platform/Lead/LeadPlatformApplicationClient.d.ts +86 -106
  213. package/sdk/platform/Lead/LeadPlatformApplicationClient.js +326 -186
  214. package/sdk/platform/Lead/LeadPlatformApplicationValidator.d.ts +180 -14
  215. package/sdk/platform/Lead/LeadPlatformApplicationValidator.js +94 -9
  216. package/sdk/platform/Lead/LeadPlatformClient.d.ts +75 -101
  217. package/sdk/platform/Lead/LeadPlatformClient.js +240 -174
  218. package/sdk/platform/Lead/LeadPlatformModel.d.ts +1403 -54
  219. package/sdk/platform/Lead/LeadPlatformModel.js +618 -73
  220. package/sdk/platform/Lead/LeadPlatformValidator.d.ts +173 -12
  221. package/sdk/platform/Lead/LeadPlatformValidator.js +85 -8
  222. package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +18 -14
  223. package/sdk/platform/Order/OrderPlatformApplicationClient.js +56 -29
  224. package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +26 -4
  225. package/sdk/platform/Order/OrderPlatformApplicationValidator.js +16 -3
  226. package/sdk/platform/Order/OrderPlatformClient.d.ts +343 -556
  227. package/sdk/platform/Order/OrderPlatformClient.js +969 -762
  228. package/sdk/platform/Order/OrderPlatformModel.d.ts +4967 -247
  229. package/sdk/platform/Order/OrderPlatformModel.js +3249 -259
  230. package/sdk/platform/Order/OrderPlatformValidator.d.ts +758 -37
  231. package/sdk/platform/Order/OrderPlatformValidator.js +351 -22
  232. package/sdk/platform/Partner/PartnerPlatformApplicationClient.d.ts +28 -36
  233. package/sdk/platform/Partner/PartnerPlatformApplicationClient.js +103 -59
  234. package/sdk/platform/Partner/PartnerPlatformApplicationValidator.d.ts +66 -6
  235. package/sdk/platform/Partner/PartnerPlatformApplicationValidator.js +32 -4
  236. package/sdk/platform/Partner/PartnerPlatformClient.d.ts +68 -107
  237. package/sdk/platform/Partner/PartnerPlatformClient.js +253 -174
  238. package/sdk/platform/Partner/PartnerPlatformModel.d.ts +767 -45
  239. package/sdk/platform/Partner/PartnerPlatformModel.js +524 -41
  240. package/sdk/platform/Partner/PartnerPlatformValidator.d.ts +207 -13
  241. package/sdk/platform/Partner/PartnerPlatformValidator.js +87 -5
  242. package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +255 -260
  243. package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +860 -504
  244. package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +348 -30
  245. package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +221 -19
  246. package/sdk/platform/Payment/PaymentPlatformClient.d.ts +73 -73
  247. package/sdk/platform/Payment/PaymentPlatformClient.js +238 -154
  248. package/sdk/platform/Payment/PaymentPlatformModel.d.ts +2658 -93
  249. package/sdk/platform/Payment/PaymentPlatformModel.js +1035 -36
  250. package/sdk/platform/Payment/PaymentPlatformValidator.d.ts +111 -11
  251. package/sdk/platform/Payment/PaymentPlatformValidator.js +68 -7
  252. package/sdk/platform/PlatformAPIClient.d.ts +16 -1
  253. package/sdk/platform/PlatformAPIClient.js +9 -1
  254. package/sdk/platform/PlatformApplicationClient.d.ts +22 -1798
  255. package/sdk/platform/PlatformApplicationClient.js +17 -1899
  256. package/sdk/platform/PlatformClient.d.ts +29 -12579
  257. package/sdk/platform/PlatformClient.js +26 -15085
  258. package/sdk/platform/PlatformConfig.d.ts +37 -11
  259. package/sdk/platform/PlatformConfig.js +32 -6
  260. package/sdk/platform/Rewards/RewardsPlatformApplicationClient.d.ts +80 -92
  261. package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +307 -177
  262. package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.d.ts +149 -12
  263. package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.js +82 -8
  264. package/sdk/platform/Rewards/RewardsPlatformModel.d.ts +371 -23
  265. package/sdk/platform/Rewards/RewardsPlatformModel.js +246 -16
  266. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.d.ts +120 -89
  267. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.js +349 -201
  268. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.d.ts +128 -12
  269. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.js +85 -11
  270. package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +148 -178
  271. package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +454 -329
  272. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +1399 -96
  273. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +1022 -71
  274. package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.d.ts +280 -18
  275. package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.js +134 -11
  276. package/sdk/platform/Share/SharePlatformApplicationClient.d.ts +38 -47
  277. package/sdk/platform/Share/SharePlatformApplicationClient.js +137 -73
  278. package/sdk/platform/Share/SharePlatformApplicationValidator.d.ts +87 -7
  279. package/sdk/platform/Share/SharePlatformApplicationValidator.js +42 -5
  280. package/sdk/platform/Share/SharePlatformModel.d.ts +250 -16
  281. package/sdk/platform/Share/SharePlatformModel.js +165 -17
  282. package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +149 -183
  283. package/sdk/platform/Theme/ThemePlatformApplicationClient.js +579 -330
  284. package/sdk/platform/Theme/ThemePlatformApplicationValidator.d.ts +308 -24
  285. package/sdk/platform/Theme/ThemePlatformApplicationValidator.js +162 -10
  286. package/sdk/platform/Theme/ThemePlatformModel.d.ts +621 -48
  287. package/sdk/platform/Theme/ThemePlatformModel.js +464 -40
  288. package/sdk/platform/User/UserPlatformApplicationClient.d.ts +119 -151
  289. package/sdk/platform/User/UserPlatformApplicationClient.js +411 -244
  290. package/sdk/platform/User/UserPlatformApplicationValidator.d.ts +235 -18
  291. package/sdk/platform/User/UserPlatformApplicationValidator.js +126 -12
  292. package/sdk/platform/User/UserPlatformModel.d.ts +1390 -101
  293. package/sdk/platform/User/UserPlatformModel.js +983 -44
  294. package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +38 -47
  295. package/sdk/platform/Webhook/WebhookPlatformClient.js +137 -87
  296. package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +242 -16
  297. package/sdk/platform/Webhook/WebhookPlatformModel.js +167 -18
  298. package/sdk/platform/Webhook/WebhookPlatformValidator.d.ts +83 -7
  299. package/sdk/platform/Webhook/WebhookPlatformValidator.js +43 -5
  300. package/sdk/public/Configuration/ConfigurationPublicClient.d.ts +14 -21
  301. package/sdk/public/Configuration/ConfigurationPublicClient.js +46 -33
  302. package/sdk/public/Configuration/ConfigurationPublicModel.d.ts +473 -19
  303. package/sdk/public/Configuration/ConfigurationPublicModel.js +224 -16
  304. package/sdk/public/Configuration/ConfigurationPublicValidator.d.ts +42 -4
  305. package/sdk/public/Configuration/ConfigurationPublicValidator.js +21 -3
  306. package/sdk/public/Inventory/InventoryPublicClient.d.ts +48 -48
  307. package/sdk/public/Inventory/InventoryPublicClient.js +146 -98
  308. package/sdk/public/Inventory/InventoryPublicModel.d.ts +392 -21
  309. package/sdk/public/Inventory/InventoryPublicModel.js +267 -27
  310. package/sdk/public/Inventory/InventoryPublicValidator.d.ts +90 -8
  311. package/sdk/public/Inventory/InventoryPublicValidator.js +44 -4
  312. package/sdk/public/PublicClient.d.ts +19 -3
  313. package/sdk/public/PublicClient.js +16 -0
  314. package/sdk/public/PublicConfig.d.ts +27 -6
  315. package/sdk/public/PublicConfig.js +17 -1
  316. package/sdk/public/Webhook/WebhookPublicClient.d.ts +13 -11
  317. package/sdk/public/Webhook/WebhookPublicClient.js +42 -27
  318. package/sdk/public/Webhook/WebhookPublicModel.d.ts +242 -16
  319. package/sdk/public/Webhook/WebhookPublicModel.js +167 -18
  320. package/sdk/public/Webhook/WebhookPublicValidator.d.ts +18 -3
  321. package/sdk/public/Webhook/WebhookPublicValidator.js +14 -4
@@ -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,15 @@ 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 {import("../ApplicationAPIClient").Options} - Options
64
+ * @returns {Promise<CartApplicationModel.SaveAddressResponse>} - Success response
65
+ * @name addAddress
65
66
  * @summary: Add address to an account
66
- * @description: Use this API to add an address to an account.
67
+ * @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
68
  */
68
- async addAddress({ body } = {}) {
69
- const { error } = CartValidator.addAddress().validate(
69
+ async addAddress({ body } = {}, { headers } = { headers: false }) {
70
+ const { error } = CartApplicationValidator.addAddress().validate(
70
71
  { body },
71
72
  { abortEarly: false, allowUnknown: true }
72
73
  );
@@ -75,16 +76,15 @@ class Cart {
75
76
  }
76
77
 
77
78
  // Showing warrnings if extra unknown parameters are found
78
- const { error: warrning } = CartValidator.addAddress().validate(
79
+ const { error: warrning } = CartApplicationValidator.addAddress().validate(
79
80
  { body },
80
81
  { abortEarly: false, allowUnknown: false }
81
82
  );
82
83
  if (warrning) {
83
84
  Logger({
84
85
  level: "WARN",
85
- message: "Parameter Validation warrnings for addAddress",
86
+ message: `Parameter Validation warrnings for application > Cart > addAddress \n ${warrning}`,
86
87
  });
87
- Logger({ level: "WARN", message: warrning });
88
88
  }
89
89
 
90
90
  const query_params = {};
@@ -100,12 +100,18 @@ class Cart {
100
100
  }),
101
101
  query_params,
102
102
  body,
103
- xHeaders
103
+ xHeaders,
104
+ { headers }
104
105
  );
105
106
 
107
+ let responseData = response;
108
+ if (headers) {
109
+ responseData = response[0];
110
+ }
111
+
106
112
  const {
107
113
  error: res_error,
108
- } = CartModel.SaveAddressResponse().validate(response, {
114
+ } = CartApplicationModel.SaveAddressResponse().validate(responseData, {
109
115
  abortEarly: false,
110
116
  allowUnknown: false,
111
117
  });
@@ -113,28 +119,26 @@ class Cart {
113
119
  if (res_error) {
114
120
  Logger({
115
121
  level: "WARN",
116
- message: "Response Validation Warnnings for addAddress",
122
+ message: `Response Validation Warnnings for application > Cart > addAddress \n ${res_error}`,
117
123
  });
118
- Logger({ level: "WARN", message: res_error });
119
124
  }
120
125
 
121
126
  return response;
122
127
  }
123
128
 
124
129
  /**
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
130
+ * @param {CartApplicationValidator.AddItemsParam} arg - Arg object.
131
+ * @param {import("../ApplicationAPIClient").Options} - Options
132
+ * @returns {Promise<CartApplicationModel.AddCartDetailResponse>} - Success response
133
+ * @name addItems
133
134
  * @summary: Add items to cart
134
- * @description: Use this API to add items to the cart.
135
+ * @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
136
  */
136
- async addItems({ body, i, b, areaCode, buyNow, id } = {}) {
137
- const { error } = CartValidator.addItems().validate(
137
+ async addItems(
138
+ { body, i, b, areaCode, buyNow, id } = {},
139
+ { headers } = { headers: false }
140
+ ) {
141
+ const { error } = CartApplicationValidator.addItems().validate(
138
142
  { body, i, b, areaCode, buyNow, id },
139
143
  { abortEarly: false, allowUnknown: true }
140
144
  );
@@ -143,16 +147,15 @@ class Cart {
143
147
  }
144
148
 
145
149
  // Showing warrnings if extra unknown parameters are found
146
- const { error: warrning } = CartValidator.addItems().validate(
150
+ const { error: warrning } = CartApplicationValidator.addItems().validate(
147
151
  { body, i, b, areaCode, buyNow, id },
148
152
  { abortEarly: false, allowUnknown: false }
149
153
  );
150
154
  if (warrning) {
151
155
  Logger({
152
156
  level: "WARN",
153
- message: "Parameter Validation warrnings for addItems",
157
+ message: `Parameter Validation warrnings for application > Cart > addItems \n ${warrning}`,
154
158
  });
155
- Logger({ level: "WARN", message: warrning });
156
159
  }
157
160
 
158
161
  const query_params = {};
@@ -173,12 +176,18 @@ class Cart {
173
176
  }),
174
177
  query_params,
175
178
  body,
176
- xHeaders
179
+ xHeaders,
180
+ { headers }
177
181
  );
178
182
 
183
+ let responseData = response;
184
+ if (headers) {
185
+ responseData = response[0];
186
+ }
187
+
179
188
  const {
180
189
  error: res_error,
181
- } = CartModel.AddCartDetailResponse().validate(response, {
190
+ } = CartApplicationModel.AddCartDetailResponse().validate(responseData, {
182
191
  abortEarly: false,
183
192
  allowUnknown: false,
184
193
  });
@@ -186,28 +195,26 @@ class Cart {
186
195
  if (res_error) {
187
196
  Logger({
188
197
  level: "WARN",
189
- message: "Response Validation Warnnings for addItems",
198
+ message: `Response Validation Warnnings for application > Cart > addItems \n ${res_error}`,
190
199
  });
191
- Logger({ level: "WARN", message: res_error });
192
200
  }
193
201
 
194
202
  return response;
195
203
  }
196
204
 
197
205
  /**
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
206
+ * @param {CartApplicationValidator.ApplyCouponParam} arg - Arg object.
207
+ * @param {import("../ApplicationAPIClient").Options} - Options
208
+ * @returns {Promise<CartApplicationModel.CartDetailResponse>} - Success response
209
+ * @name applyCoupon
206
210
  * @summary: Apply Coupon
207
- * @description: Use this API to apply coupons on items in the cart.
211
+ * @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
212
  */
209
- async applyCoupon({ body, i, b, p, id, buyNow } = {}) {
210
- const { error } = CartValidator.applyCoupon().validate(
213
+ async applyCoupon(
214
+ { body, i, b, p, id, buyNow } = {},
215
+ { headers } = { headers: false }
216
+ ) {
217
+ const { error } = CartApplicationValidator.applyCoupon().validate(
211
218
  { body, i, b, p, id, buyNow },
212
219
  { abortEarly: false, allowUnknown: true }
213
220
  );
@@ -216,16 +223,15 @@ class Cart {
216
223
  }
217
224
 
218
225
  // Showing warrnings if extra unknown parameters are found
219
- const { error: warrning } = CartValidator.applyCoupon().validate(
226
+ const { error: warrning } = CartApplicationValidator.applyCoupon().validate(
220
227
  { body, i, b, p, id, buyNow },
221
228
  { abortEarly: false, allowUnknown: false }
222
229
  );
223
230
  if (warrning) {
224
231
  Logger({
225
232
  level: "WARN",
226
- message: "Parameter Validation warrnings for applyCoupon",
233
+ message: `Parameter Validation warrnings for application > Cart > applyCoupon \n ${warrning}`,
227
234
  });
228
- Logger({ level: "WARN", message: warrning });
229
235
  }
230
236
 
231
237
  const query_params = {};
@@ -246,12 +252,18 @@ class Cart {
246
252
  }),
247
253
  query_params,
248
254
  body,
249
- xHeaders
255
+ xHeaders,
256
+ { headers }
250
257
  );
251
258
 
259
+ let responseData = response;
260
+ if (headers) {
261
+ responseData = response[0];
262
+ }
263
+
252
264
  const {
253
265
  error: res_error,
254
- } = CartModel.CartDetailResponse().validate(response, {
266
+ } = CartApplicationModel.CartDetailResponse().validate(responseData, {
255
267
  abortEarly: false,
256
268
  allowUnknown: false,
257
269
  });
@@ -259,27 +271,26 @@ class Cart {
259
271
  if (res_error) {
260
272
  Logger({
261
273
  level: "WARN",
262
- message: "Response Validation Warnnings for applyCoupon",
274
+ message: `Response Validation Warnnings for application > Cart > applyCoupon \n ${res_error}`,
263
275
  });
264
- Logger({ level: "WARN", message: res_error });
265
276
  }
266
277
 
267
278
  return response;
268
279
  }
269
280
 
270
281
  /**
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
282
+ * @param {CartApplicationValidator.ApplyRewardPointsParam} arg - Arg object.
283
+ * @param {import("../ApplicationAPIClient").Options} - Options
284
+ * @returns {Promise<CartApplicationModel.CartDetailResponse>} - Success response
285
+ * @name applyRewardPoints
278
286
  * @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.
287
+ * @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
288
  */
281
- async applyRewardPoints({ body, id, i, b, buyNow } = {}) {
282
- const { error } = CartValidator.applyRewardPoints().validate(
289
+ async applyRewardPoints(
290
+ { body, id, i, b, buyNow } = {},
291
+ { headers } = { headers: false }
292
+ ) {
293
+ const { error } = CartApplicationValidator.applyRewardPoints().validate(
283
294
  { body, id, i, b, buyNow },
284
295
  { abortEarly: false, allowUnknown: true }
285
296
  );
@@ -288,16 +299,17 @@ class Cart {
288
299
  }
289
300
 
290
301
  // Showing warrnings if extra unknown parameters are found
291
- const { error: warrning } = CartValidator.applyRewardPoints().validate(
302
+ const {
303
+ error: warrning,
304
+ } = CartApplicationValidator.applyRewardPoints().validate(
292
305
  { body, id, i, b, buyNow },
293
306
  { abortEarly: false, allowUnknown: false }
294
307
  );
295
308
  if (warrning) {
296
309
  Logger({
297
310
  level: "WARN",
298
- message: "Parameter Validation warrnings for applyRewardPoints",
311
+ message: `Parameter Validation warrnings for application > Cart > applyRewardPoints \n ${warrning}`,
299
312
  });
300
- Logger({ level: "WARN", message: warrning });
301
313
  }
302
314
 
303
315
  const query_params = {};
@@ -317,12 +329,18 @@ class Cart {
317
329
  }),
318
330
  query_params,
319
331
  body,
320
- xHeaders
332
+ xHeaders,
333
+ { headers }
321
334
  );
322
335
 
336
+ let responseData = response;
337
+ if (headers) {
338
+ responseData = response[0];
339
+ }
340
+
323
341
  const {
324
342
  error: res_error,
325
- } = CartModel.CartDetailResponse().validate(response, {
343
+ } = CartApplicationModel.CartDetailResponse().validate(responseData, {
326
344
  abortEarly: false,
327
345
  allowUnknown: false,
328
346
  });
@@ -330,24 +348,23 @@ class Cart {
330
348
  if (res_error) {
331
349
  Logger({
332
350
  level: "WARN",
333
- message: "Response Validation Warnnings for applyRewardPoints",
351
+ message: `Response Validation Warnnings for application > Cart > applyRewardPoints \n ${res_error}`,
334
352
  });
335
- Logger({ level: "WARN", message: res_error });
336
353
  }
337
354
 
338
355
  return response;
339
356
  }
340
357
 
341
358
  /**
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
359
+ * @param {CartApplicationValidator.CheckoutCartParam} arg - Arg object.
360
+ * @param {import("../ApplicationAPIClient").Options} - Options
361
+ * @returns {Promise<CartApplicationModel.CartCheckoutResponse>} - Success response
362
+ * @name checkoutCart
346
363
  * @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.
364
+ * @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
365
  */
349
- async checkoutCart({ body, buyNow } = {}) {
350
- const { error } = CartValidator.checkoutCart().validate(
366
+ async checkoutCart({ body, buyNow } = {}, { headers } = { headers: false }) {
367
+ const { error } = CartApplicationValidator.checkoutCart().validate(
351
368
  { body, buyNow },
352
369
  { abortEarly: false, allowUnknown: true }
353
370
  );
@@ -356,16 +373,17 @@ class Cart {
356
373
  }
357
374
 
358
375
  // Showing warrnings if extra unknown parameters are found
359
- const { error: warrning } = CartValidator.checkoutCart().validate(
376
+ const {
377
+ error: warrning,
378
+ } = CartApplicationValidator.checkoutCart().validate(
360
379
  { body, buyNow },
361
380
  { abortEarly: false, allowUnknown: false }
362
381
  );
363
382
  if (warrning) {
364
383
  Logger({
365
384
  level: "WARN",
366
- message: "Parameter Validation warrnings for checkoutCart",
385
+ message: `Parameter Validation warrnings for application > Cart > checkoutCart \n ${warrning}`,
367
386
  });
368
- Logger({ level: "WARN", message: warrning });
369
387
  }
370
388
 
371
389
  const query_params = {};
@@ -382,12 +400,18 @@ class Cart {
382
400
  }),
383
401
  query_params,
384
402
  body,
385
- xHeaders
403
+ xHeaders,
404
+ { headers }
386
405
  );
387
406
 
407
+ let responseData = response;
408
+ if (headers) {
409
+ responseData = response[0];
410
+ }
411
+
388
412
  const {
389
413
  error: res_error,
390
- } = CartModel.CartCheckoutResponse().validate(response, {
414
+ } = CartApplicationModel.CartCheckoutResponse().validate(responseData, {
391
415
  abortEarly: false,
392
416
  allowUnknown: false,
393
417
  });
@@ -395,24 +419,26 @@ class Cart {
395
419
  if (res_error) {
396
420
  Logger({
397
421
  level: "WARN",
398
- message: "Response Validation Warnnings for checkoutCart",
422
+ message: `Response Validation Warnnings for application > Cart > checkoutCart \n ${res_error}`,
399
423
  });
400
- Logger({ level: "WARN", message: res_error });
401
424
  }
402
425
 
403
426
  return response;
404
427
  }
405
428
 
406
429
  /**
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
430
+ * @param {CartApplicationValidator.CheckoutCartV2Param} arg - Arg object.
431
+ * @param {import("../ApplicationAPIClient").Options} - Options
432
+ * @returns {Promise<CartApplicationModel.CartCheckoutResponse>} - Success response
433
+ * @name checkoutCartV2
411
434
  * @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.
435
+ * @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
436
  */
414
- async checkoutCartV2({ body, buyNow } = {}) {
415
- const { error } = CartValidator.checkoutCartV2().validate(
437
+ async checkoutCartV2(
438
+ { body, buyNow } = {},
439
+ { headers } = { headers: false }
440
+ ) {
441
+ const { error } = CartApplicationValidator.checkoutCartV2().validate(
416
442
  { body, buyNow },
417
443
  { abortEarly: false, allowUnknown: true }
418
444
  );
@@ -421,16 +447,17 @@ class Cart {
421
447
  }
422
448
 
423
449
  // Showing warrnings if extra unknown parameters are found
424
- const { error: warrning } = CartValidator.checkoutCartV2().validate(
450
+ const {
451
+ error: warrning,
452
+ } = CartApplicationValidator.checkoutCartV2().validate(
425
453
  { body, buyNow },
426
454
  { abortEarly: false, allowUnknown: false }
427
455
  );
428
456
  if (warrning) {
429
457
  Logger({
430
458
  level: "WARN",
431
- message: "Parameter Validation warrnings for checkoutCartV2",
459
+ message: `Parameter Validation warrnings for application > Cart > checkoutCartV2 \n ${warrning}`,
432
460
  });
433
- Logger({ level: "WARN", message: warrning });
434
461
  }
435
462
 
436
463
  const query_params = {};
@@ -447,12 +474,18 @@ class Cart {
447
474
  }),
448
475
  query_params,
449
476
  body,
450
- xHeaders
477
+ xHeaders,
478
+ { headers }
451
479
  );
452
480
 
481
+ let responseData = response;
482
+ if (headers) {
483
+ responseData = response[0];
484
+ }
485
+
453
486
  const {
454
487
  error: res_error,
455
- } = CartModel.CartCheckoutResponse().validate(response, {
488
+ } = CartApplicationModel.CartCheckoutResponse().validate(responseData, {
456
489
  abortEarly: false,
457
490
  allowUnknown: false,
458
491
  });
@@ -460,23 +493,24 @@ class Cart {
460
493
  if (res_error) {
461
494
  Logger({
462
495
  level: "WARN",
463
- message: "Response Validation Warnnings for checkoutCartV2",
496
+ message: `Response Validation Warnnings for application > Cart > checkoutCartV2 \n ${res_error}`,
464
497
  });
465
- Logger({ level: "WARN", message: res_error });
466
498
  }
467
499
 
468
500
  return response;
469
501
  }
470
502
 
471
503
  /**
472
- * @param {Object} arg - Arg object.
473
- * @param {string} [arg.id] - The unique identifier of the cart.
474
- * @returns {Promise<DeleteCartDetailResponse>} - Success response
504
+ * @param {CartApplicationValidator.DeleteCartParam} arg - Arg object.
505
+ * @param {import("../ApplicationAPIClient").Options} - Options
506
+ * @returns {Promise<CartApplicationModel.DeleteCartDetailResponse>} -
507
+ * Success response
508
+ * @name deleteCart
475
509
  * @summary: Delete cart once user made successful checkout
476
- * @description: Use this API to delete the cart.
510
+ * @description: Use this API to delete the cart. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/deleteCart/).
477
511
  */
478
- async deleteCart({ id } = {}) {
479
- const { error } = CartValidator.deleteCart().validate(
512
+ async deleteCart({ id } = {}, { headers } = { headers: false }) {
513
+ const { error } = CartApplicationValidator.deleteCart().validate(
480
514
  { id },
481
515
  { abortEarly: false, allowUnknown: true }
482
516
  );
@@ -485,16 +519,15 @@ class Cart {
485
519
  }
486
520
 
487
521
  // Showing warrnings if extra unknown parameters are found
488
- const { error: warrning } = CartValidator.deleteCart().validate(
522
+ const { error: warrning } = CartApplicationValidator.deleteCart().validate(
489
523
  { id },
490
524
  { abortEarly: false, allowUnknown: false }
491
525
  );
492
526
  if (warrning) {
493
527
  Logger({
494
528
  level: "WARN",
495
- message: "Parameter Validation warrnings for deleteCart",
529
+ message: `Parameter Validation warrnings for application > Cart > deleteCart \n ${warrning}`,
496
530
  });
497
- Logger({ level: "WARN", message: warrning });
498
531
  }
499
532
 
500
533
  const query_params = {};
@@ -511,12 +544,18 @@ class Cart {
511
544
  }),
512
545
  query_params,
513
546
  undefined,
514
- xHeaders
547
+ xHeaders,
548
+ { headers }
515
549
  );
516
550
 
551
+ let responseData = response;
552
+ if (headers) {
553
+ responseData = response[0];
554
+ }
555
+
517
556
  const {
518
557
  error: res_error,
519
- } = CartModel.DeleteCartDetailResponse().validate(response, {
558
+ } = CartApplicationModel.DeleteCartDetailResponse().validate(responseData, {
520
559
  abortEarly: false,
521
560
  allowUnknown: false,
522
561
  });
@@ -524,37 +563,26 @@ class Cart {
524
563
  if (res_error) {
525
564
  Logger({
526
565
  level: "WARN",
527
- message: "Response Validation Warnnings for deleteCart",
566
+ message: `Response Validation Warnnings for application > Cart > deleteCart \n ${res_error}`,
528
567
  });
529
- Logger({ level: "WARN", message: res_error });
530
568
  }
531
569
 
532
570
  return response;
533
571
  }
534
572
 
535
573
  /**
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
574
+ * @param {CartApplicationValidator.GetAddressByIdParam} arg - Arg object.
575
+ * @param {import("../ApplicationAPIClient").Options} - Options
576
+ * @returns {Promise<CartApplicationModel.Address>} - Success response
577
+ * @name getAddressById
545
578
  * @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>
579
+ * @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> - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/getAddressById/).
547
580
  */
548
- async getAddressById({
549
- id,
550
- cartId,
551
- buyNow,
552
- mobileNo,
553
- checkoutMode,
554
- tags,
555
- isDefault,
556
- } = {}) {
557
- const { error } = CartValidator.getAddressById().validate(
581
+ async getAddressById(
582
+ { id, cartId, buyNow, mobileNo, checkoutMode, tags, isDefault } = {},
583
+ { headers } = { headers: false }
584
+ ) {
585
+ const { error } = CartApplicationValidator.getAddressById().validate(
558
586
  { id, cartId, buyNow, mobileNo, checkoutMode, tags, isDefault },
559
587
  { abortEarly: false, allowUnknown: true }
560
588
  );
@@ -563,16 +591,17 @@ class Cart {
563
591
  }
564
592
 
565
593
  // Showing warrnings if extra unknown parameters are found
566
- const { error: warrning } = CartValidator.getAddressById().validate(
594
+ const {
595
+ error: warrning,
596
+ } = CartApplicationValidator.getAddressById().validate(
567
597
  { id, cartId, buyNow, mobileNo, checkoutMode, tags, isDefault },
568
598
  { abortEarly: false, allowUnknown: false }
569
599
  );
570
600
  if (warrning) {
571
601
  Logger({
572
602
  level: "WARN",
573
- message: "Parameter Validation warrnings for getAddressById",
603
+ message: `Parameter Validation warrnings for application > Cart > getAddressById \n ${warrning}`,
574
604
  });
575
- Logger({ level: "WARN", message: warrning });
576
605
  }
577
606
 
578
607
  const query_params = {};
@@ -594,10 +623,18 @@ class Cart {
594
623
  }),
595
624
  query_params,
596
625
  undefined,
597
- xHeaders
626
+ xHeaders,
627
+ { headers }
598
628
  );
599
629
 
600
- const { error: res_error } = CartModel.Address().validate(response, {
630
+ let responseData = response;
631
+ if (headers) {
632
+ responseData = response[0];
633
+ }
634
+
635
+ const {
636
+ error: res_error,
637
+ } = CartApplicationModel.Address().validate(responseData, {
601
638
  abortEarly: false,
602
639
  allowUnknown: false,
603
640
  });
@@ -605,35 +642,26 @@ class Cart {
605
642
  if (res_error) {
606
643
  Logger({
607
644
  level: "WARN",
608
- message: "Response Validation Warnnings for getAddressById",
645
+ message: `Response Validation Warnnings for application > Cart > getAddressById \n ${res_error}`,
609
646
  });
610
- Logger({ level: "WARN", message: res_error });
611
647
  }
612
648
 
613
649
  return response;
614
650
  }
615
651
 
616
652
  /**
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
653
+ * @param {CartApplicationValidator.GetAddressesParam} arg - Arg object.
654
+ * @param {import("../ApplicationAPIClient").Options} - Options
655
+ * @returns {Promise<CartApplicationModel.GetAddressesResponse>} - Success response
656
+ * @name getAddresses
625
657
  * @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>
658
+ * @description: Use this API to get all the addresses associated with an account. If successful, returns a Address resource in the response body specified in GetAddressesResponse.attibutes listed below are optional <ul> <li> <font color="monochrome">uid</font></li> <li> <font color="monochrome">address_id</font></li> <li> <font color="monochrome">mobile_no</font></li> <li> <font color="monochrome">checkout_mode</font></li> <li> <font color="monochrome">tags</font></li> <li> <font color="monochrome">default</font></li> </ul> - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/getAddresses/).
627
659
  */
628
- async getAddresses({
629
- cartId,
630
- buyNow,
631
- mobileNo,
632
- checkoutMode,
633
- tags,
634
- isDefault,
635
- } = {}) {
636
- const { error } = CartValidator.getAddresses().validate(
660
+ async getAddresses(
661
+ { cartId, buyNow, mobileNo, checkoutMode, tags, isDefault } = {},
662
+ { headers } = { headers: false }
663
+ ) {
664
+ const { error } = CartApplicationValidator.getAddresses().validate(
637
665
  { cartId, buyNow, mobileNo, checkoutMode, tags, isDefault },
638
666
  { abortEarly: false, allowUnknown: true }
639
667
  );
@@ -642,16 +670,17 @@ class Cart {
642
670
  }
643
671
 
644
672
  // Showing warrnings if extra unknown parameters are found
645
- const { error: warrning } = CartValidator.getAddresses().validate(
673
+ const {
674
+ error: warrning,
675
+ } = CartApplicationValidator.getAddresses().validate(
646
676
  { cartId, buyNow, mobileNo, checkoutMode, tags, isDefault },
647
677
  { abortEarly: false, allowUnknown: false }
648
678
  );
649
679
  if (warrning) {
650
680
  Logger({
651
681
  level: "WARN",
652
- message: "Parameter Validation warrnings for getAddresses",
682
+ message: `Parameter Validation warrnings for application > Cart > getAddresses \n ${warrning}`,
653
683
  });
654
- Logger({ level: "WARN", message: warrning });
655
684
  }
656
685
 
657
686
  const query_params = {};
@@ -673,12 +702,18 @@ class Cart {
673
702
  }),
674
703
  query_params,
675
704
  undefined,
676
- xHeaders
705
+ xHeaders,
706
+ { headers }
677
707
  );
678
708
 
709
+ let responseData = response;
710
+ if (headers) {
711
+ responseData = response[0];
712
+ }
713
+
679
714
  const {
680
715
  error: res_error,
681
- } = CartModel.GetAddressesResponse().validate(response, {
716
+ } = CartApplicationModel.GetAddressesResponse().validate(responseData, {
682
717
  abortEarly: false,
683
718
  allowUnknown: false,
684
719
  });
@@ -686,28 +721,26 @@ class Cart {
686
721
  if (res_error) {
687
722
  Logger({
688
723
  level: "WARN",
689
- message: "Response Validation Warnnings for getAddresses",
724
+ message: `Response Validation Warnnings for application > Cart > getAddresses \n ${res_error}`,
690
725
  });
691
- Logger({ level: "WARN", message: res_error });
692
726
  }
693
727
 
694
728
  return response;
695
729
  }
696
730
 
697
731
  /**
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
732
+ * @param {CartApplicationValidator.GetBulkDiscountOffersParam} arg - Arg object.
733
+ * @param {import("../ApplicationAPIClient").Options} - Options
734
+ * @returns {Promise<CartApplicationModel.BulkPriceResponse>} - Success response
735
+ * @name getBulkDiscountOffers
706
736
  * @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.
737
+ * @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
738
  */
709
- async getBulkDiscountOffers({ itemId, articleId, uid, slug } = {}) {
710
- const { error } = CartValidator.getBulkDiscountOffers().validate(
739
+ async getBulkDiscountOffers(
740
+ { itemId, articleId, uid, slug } = {},
741
+ { headers } = { headers: false }
742
+ ) {
743
+ const { error } = CartApplicationValidator.getBulkDiscountOffers().validate(
711
744
  { itemId, articleId, uid, slug },
712
745
  { abortEarly: false, allowUnknown: true }
713
746
  );
@@ -716,16 +749,17 @@ class Cart {
716
749
  }
717
750
 
718
751
  // Showing warrnings if extra unknown parameters are found
719
- const { error: warrning } = CartValidator.getBulkDiscountOffers().validate(
752
+ const {
753
+ error: warrning,
754
+ } = CartApplicationValidator.getBulkDiscountOffers().validate(
720
755
  { itemId, articleId, uid, slug },
721
756
  { abortEarly: false, allowUnknown: false }
722
757
  );
723
758
  if (warrning) {
724
759
  Logger({
725
760
  level: "WARN",
726
- message: "Parameter Validation warrnings for getBulkDiscountOffers",
761
+ message: `Parameter Validation warrnings for application > Cart > getBulkDiscountOffers \n ${warrning}`,
727
762
  });
728
- Logger({ level: "WARN", message: warrning });
729
763
  }
730
764
 
731
765
  const query_params = {};
@@ -745,12 +779,18 @@ class Cart {
745
779
  }),
746
780
  query_params,
747
781
  undefined,
748
- xHeaders
782
+ xHeaders,
783
+ { headers }
749
784
  );
750
785
 
786
+ let responseData = response;
787
+ if (headers) {
788
+ responseData = response[0];
789
+ }
790
+
751
791
  const {
752
792
  error: res_error,
753
- } = CartModel.BulkPriceResponse().validate(response, {
793
+ } = CartApplicationModel.BulkPriceResponse().validate(responseData, {
754
794
  abortEarly: false,
755
795
  allowUnknown: false,
756
796
  });
@@ -758,28 +798,26 @@ class Cart {
758
798
  if (res_error) {
759
799
  Logger({
760
800
  level: "WARN",
761
- message: "Response Validation Warnnings for getBulkDiscountOffers",
801
+ message: `Response Validation Warnnings for application > Cart > getBulkDiscountOffers \n ${res_error}`,
762
802
  });
763
- Logger({ level: "WARN", message: res_error });
764
803
  }
765
804
 
766
805
  return response;
767
806
  }
768
807
 
769
808
  /**
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
809
+ * @param {CartApplicationValidator.GetCartParam} arg - Arg object.
810
+ * @param {import("../ApplicationAPIClient").Options} - Options
811
+ * @returns {Promise<CartApplicationModel.CartDetailResponse>} - Success response
812
+ * @name getCart
778
813
  * @summary: Fetch all items added to the cart
779
- * @description: Use this API to get details of all the items added to a cart.
814
+ * @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
815
  */
781
- async getCart({ id, i, b, assignCardId, areaCode, buyNow } = {}) {
782
- const { error } = CartValidator.getCart().validate(
816
+ async getCart(
817
+ { id, i, b, assignCardId, areaCode, buyNow } = {},
818
+ { headers } = { headers: false }
819
+ ) {
820
+ const { error } = CartApplicationValidator.getCart().validate(
783
821
  { id, i, b, assignCardId, areaCode, buyNow },
784
822
  { abortEarly: false, allowUnknown: true }
785
823
  );
@@ -788,16 +826,15 @@ class Cart {
788
826
  }
789
827
 
790
828
  // Showing warrnings if extra unknown parameters are found
791
- const { error: warrning } = CartValidator.getCart().validate(
829
+ const { error: warrning } = CartApplicationValidator.getCart().validate(
792
830
  { id, i, b, assignCardId, areaCode, buyNow },
793
831
  { abortEarly: false, allowUnknown: false }
794
832
  );
795
833
  if (warrning) {
796
834
  Logger({
797
835
  level: "WARN",
798
- message: "Parameter Validation warrnings for getCart",
836
+ message: `Parameter Validation warrnings for application > Cart > getCart \n ${warrning}`,
799
837
  });
800
- Logger({ level: "WARN", message: warrning });
801
838
  }
802
839
 
803
840
  const query_params = {};
@@ -819,12 +856,18 @@ class Cart {
819
856
  }),
820
857
  query_params,
821
858
  undefined,
822
- xHeaders
859
+ xHeaders,
860
+ { headers }
823
861
  );
824
862
 
863
+ let responseData = response;
864
+ if (headers) {
865
+ responseData = response[0];
866
+ }
867
+
825
868
  const {
826
869
  error: res_error,
827
- } = CartModel.CartDetailResponse().validate(response, {
870
+ } = CartApplicationModel.CartDetailResponse().validate(responseData, {
828
871
  abortEarly: false,
829
872
  allowUnknown: false,
830
873
  });
@@ -832,23 +875,23 @@ class Cart {
832
875
  if (res_error) {
833
876
  Logger({
834
877
  level: "WARN",
835
- message: "Response Validation Warnnings for getCart",
878
+ message: `Response Validation Warnnings for application > Cart > getCart \n ${res_error}`,
836
879
  });
837
- Logger({ level: "WARN", message: res_error });
838
880
  }
839
881
 
840
882
  return response;
841
883
  }
842
884
 
843
885
  /**
844
- * @param {Object} arg - Arg object.
845
- * @param {string} [arg.id] -
886
+ * @param {CartApplicationValidator.GetCartLastModifiedParam} arg - Arg object.
887
+ * @param {import("../ApplicationAPIClient").Options} - Options
846
888
  * @returns {Promise<any>} - Success response
889
+ * @name getCartLastModified
847
890
  * @summary: Fetch last-modified timestamp
848
- * @description: Use this API to fetch Last-Modified timestamp in header metadata.
891
+ * @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
892
  */
850
- async getCartLastModified({ id } = {}) {
851
- const { error } = CartValidator.getCartLastModified().validate(
893
+ async getCartLastModified({ id } = {}, { headers } = { headers: false }) {
894
+ const { error } = CartApplicationValidator.getCartLastModified().validate(
852
895
  { id },
853
896
  { abortEarly: false, allowUnknown: true }
854
897
  );
@@ -857,16 +900,17 @@ class Cart {
857
900
  }
858
901
 
859
902
  // Showing warrnings if extra unknown parameters are found
860
- const { error: warrning } = CartValidator.getCartLastModified().validate(
903
+ const {
904
+ error: warrning,
905
+ } = CartApplicationValidator.getCartLastModified().validate(
861
906
  { id },
862
907
  { abortEarly: false, allowUnknown: false }
863
908
  );
864
909
  if (warrning) {
865
910
  Logger({
866
911
  level: "WARN",
867
- message: "Parameter Validation warrnings for getCartLastModified",
912
+ message: `Parameter Validation warrnings for application > Cart > getCartLastModified \n ${warrning}`,
868
913
  });
869
- Logger({ level: "WARN", message: warrning });
870
914
  }
871
915
 
872
916
  const query_params = {};
@@ -883,33 +927,40 @@ class Cart {
883
927
  }),
884
928
  query_params,
885
929
  undefined,
886
- xHeaders
930
+ xHeaders,
931
+ { headers }
887
932
  );
888
933
 
934
+ let responseData = response;
935
+ if (headers) {
936
+ responseData = response[0];
937
+ }
938
+
889
939
  const { error: res_error } = Joi.string()
890
940
  .allow("")
891
- .validate(response, { abortEarly: false, allowUnknown: false });
941
+ .validate(responseData, { abortEarly: false, allowUnknown: false });
892
942
 
893
943
  if (res_error) {
894
944
  Logger({
895
945
  level: "WARN",
896
- message: "Response Validation Warnnings for getCartLastModified",
946
+ message: `Response Validation Warnnings for application > Cart > getCartLastModified \n ${res_error}`,
897
947
  });
898
- Logger({ level: "WARN", message: res_error });
899
948
  }
900
949
 
901
950
  return response;
902
951
  }
903
952
 
904
953
  /**
905
- * @param {Object} arg - Arg object.
906
- * @param {GetShareCartLinkRequest} arg.body
907
- * @returns {Promise<GetShareCartLinkResponse>} - Success response
954
+ * @param {CartApplicationValidator.GetCartShareLinkParam} arg - Arg object.
955
+ * @param {import("../ApplicationAPIClient").Options} - Options
956
+ * @returns {Promise<CartApplicationModel.GetShareCartLinkResponse>} -
957
+ * Success response
958
+ * @name getCartShareLink
908
959
  * @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.
960
+ * @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
961
  */
911
- async getCartShareLink({ body } = {}) {
912
- const { error } = CartValidator.getCartShareLink().validate(
962
+ async getCartShareLink({ body } = {}, { headers } = { headers: false }) {
963
+ const { error } = CartApplicationValidator.getCartShareLink().validate(
913
964
  { body },
914
965
  { abortEarly: false, allowUnknown: true }
915
966
  );
@@ -918,16 +969,17 @@ class Cart {
918
969
  }
919
970
 
920
971
  // Showing warrnings if extra unknown parameters are found
921
- const { error: warrning } = CartValidator.getCartShareLink().validate(
972
+ const {
973
+ error: warrning,
974
+ } = CartApplicationValidator.getCartShareLink().validate(
922
975
  { body },
923
976
  { abortEarly: false, allowUnknown: false }
924
977
  );
925
978
  if (warrning) {
926
979
  Logger({
927
980
  level: "WARN",
928
- message: "Parameter Validation warrnings for getCartShareLink",
981
+ message: `Parameter Validation warrnings for application > Cart > getCartShareLink \n ${warrning}`,
929
982
  });
930
- Logger({ level: "WARN", message: warrning });
931
983
  }
932
984
 
933
985
  const query_params = {};
@@ -943,12 +995,18 @@ class Cart {
943
995
  }),
944
996
  query_params,
945
997
  body,
946
- xHeaders
998
+ xHeaders,
999
+ { headers }
947
1000
  );
948
1001
 
1002
+ let responseData = response;
1003
+ if (headers) {
1004
+ responseData = response[0];
1005
+ }
1006
+
949
1007
  const {
950
1008
  error: res_error,
951
- } = CartModel.GetShareCartLinkResponse().validate(response, {
1009
+ } = CartApplicationModel.GetShareCartLinkResponse().validate(responseData, {
952
1010
  abortEarly: false,
953
1011
  allowUnknown: false,
954
1012
  });
@@ -956,23 +1014,23 @@ class Cart {
956
1014
  if (res_error) {
957
1015
  Logger({
958
1016
  level: "WARN",
959
- message: "Response Validation Warnnings for getCartShareLink",
1017
+ message: `Response Validation Warnnings for application > Cart > getCartShareLink \n ${res_error}`,
960
1018
  });
961
- Logger({ level: "WARN", message: res_error });
962
1019
  }
963
1020
 
964
1021
  return response;
965
1022
  }
966
1023
 
967
1024
  /**
968
- * @param {Object} arg - Arg object.
969
- * @param {string} arg.token - Token of the shared short link
970
- * @returns {Promise<SharedCartResponse>} - Success response
1025
+ * @param {CartApplicationValidator.GetCartSharedItemsParam} arg - Arg object.
1026
+ * @param {import("../ApplicationAPIClient").Options} - Options
1027
+ * @returns {Promise<CartApplicationModel.SharedCartResponse>} - Success response
1028
+ * @name getCartSharedItems
971
1029
  * @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.
1030
+ * @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
1031
  */
974
- async getCartSharedItems({ token } = {}) {
975
- const { error } = CartValidator.getCartSharedItems().validate(
1032
+ async getCartSharedItems({ token } = {}, { headers } = { headers: false }) {
1033
+ const { error } = CartApplicationValidator.getCartSharedItems().validate(
976
1034
  { token },
977
1035
  { abortEarly: false, allowUnknown: true }
978
1036
  );
@@ -981,16 +1039,17 @@ class Cart {
981
1039
  }
982
1040
 
983
1041
  // Showing warrnings if extra unknown parameters are found
984
- const { error: warrning } = CartValidator.getCartSharedItems().validate(
1042
+ const {
1043
+ error: warrning,
1044
+ } = CartApplicationValidator.getCartSharedItems().validate(
985
1045
  { token },
986
1046
  { abortEarly: false, allowUnknown: false }
987
1047
  );
988
1048
  if (warrning) {
989
1049
  Logger({
990
1050
  level: "WARN",
991
- message: "Parameter Validation warrnings for getCartSharedItems",
1051
+ message: `Parameter Validation warrnings for application > Cart > getCartSharedItems \n ${warrning}`,
992
1052
  });
993
- Logger({ level: "WARN", message: warrning });
994
1053
  }
995
1054
 
996
1055
  const query_params = {};
@@ -1006,12 +1065,18 @@ class Cart {
1006
1065
  }),
1007
1066
  query_params,
1008
1067
  undefined,
1009
- xHeaders
1068
+ xHeaders,
1069
+ { headers }
1010
1070
  );
1011
1071
 
1072
+ let responseData = response;
1073
+ if (headers) {
1074
+ responseData = response[0];
1075
+ }
1076
+
1012
1077
  const {
1013
1078
  error: res_error,
1014
- } = CartModel.SharedCartResponse().validate(response, {
1079
+ } = CartApplicationModel.SharedCartResponse().validate(responseData, {
1015
1080
  abortEarly: false,
1016
1081
  allowUnknown: false,
1017
1082
  });
@@ -1019,24 +1084,23 @@ class Cart {
1019
1084
  if (res_error) {
1020
1085
  Logger({
1021
1086
  level: "WARN",
1022
- message: "Response Validation Warnnings for getCartSharedItems",
1087
+ message: `Response Validation Warnnings for application > Cart > getCartSharedItems \n ${res_error}`,
1023
1088
  });
1024
- Logger({ level: "WARN", message: res_error });
1025
1089
  }
1026
1090
 
1027
1091
  return response;
1028
1092
  }
1029
1093
 
1030
1094
  /**
1031
- * @param {Object} arg - Arg object.
1032
- * @param {string} [arg.id] -
1033
- * @param {boolean} [arg.buyNow] -
1034
- * @returns {Promise<GetCouponResponse>} - Success response
1095
+ * @param {CartApplicationValidator.GetCouponsParam} arg - Arg object.
1096
+ * @param {import("../ApplicationAPIClient").Options} - Options
1097
+ * @returns {Promise<CartApplicationModel.GetCouponResponse>} - Success response
1098
+ * @name getCoupons
1035
1099
  * @summary: Fetch Coupon
1036
- * @description: Use this API to get a list of available coupons along with their details.
1100
+ * @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
1101
  */
1038
- async getCoupons({ id, buyNow } = {}) {
1039
- const { error } = CartValidator.getCoupons().validate(
1102
+ async getCoupons({ id, buyNow } = {}, { headers } = { headers: false }) {
1103
+ const { error } = CartApplicationValidator.getCoupons().validate(
1040
1104
  { id, buyNow },
1041
1105
  { abortEarly: false, allowUnknown: true }
1042
1106
  );
@@ -1045,16 +1109,15 @@ class Cart {
1045
1109
  }
1046
1110
 
1047
1111
  // Showing warrnings if extra unknown parameters are found
1048
- const { error: warrning } = CartValidator.getCoupons().validate(
1112
+ const { error: warrning } = CartApplicationValidator.getCoupons().validate(
1049
1113
  { id, buyNow },
1050
1114
  { abortEarly: false, allowUnknown: false }
1051
1115
  );
1052
1116
  if (warrning) {
1053
1117
  Logger({
1054
1118
  level: "WARN",
1055
- message: "Parameter Validation warrnings for getCoupons",
1119
+ message: `Parameter Validation warrnings for application > Cart > getCoupons \n ${warrning}`,
1056
1120
  });
1057
- Logger({ level: "WARN", message: warrning });
1058
1121
  }
1059
1122
 
1060
1123
  const query_params = {};
@@ -1072,12 +1135,18 @@ class Cart {
1072
1135
  }),
1073
1136
  query_params,
1074
1137
  undefined,
1075
- xHeaders
1138
+ xHeaders,
1139
+ { headers }
1076
1140
  );
1077
1141
 
1142
+ let responseData = response;
1143
+ if (headers) {
1144
+ responseData = response[0];
1145
+ }
1146
+
1078
1147
  const {
1079
1148
  error: res_error,
1080
- } = CartModel.GetCouponResponse().validate(response, {
1149
+ } = CartApplicationModel.GetCouponResponse().validate(responseData, {
1081
1150
  abortEarly: false,
1082
1151
  allowUnknown: false,
1083
1152
  });
@@ -1085,24 +1154,23 @@ class Cart {
1085
1154
  if (res_error) {
1086
1155
  Logger({
1087
1156
  level: "WARN",
1088
- message: "Response Validation Warnnings for getCoupons",
1157
+ message: `Response Validation Warnnings for application > Cart > getCoupons \n ${res_error}`,
1089
1158
  });
1090
- Logger({ level: "WARN", message: res_error });
1091
1159
  }
1092
1160
 
1093
1161
  return response;
1094
1162
  }
1095
1163
 
1096
1164
  /**
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
1165
+ * @param {CartApplicationValidator.GetItemCountParam} arg - Arg object.
1166
+ * @param {import("../ApplicationAPIClient").Options} - Options
1167
+ * @returns {Promise<CartApplicationModel.CartItemCountResponse>} - Success response
1168
+ * @name getItemCount
1101
1169
  * @summary: Count items in the cart
1102
- * @description: Use this API to get the total number of items present in cart.
1170
+ * @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
1171
  */
1104
- async getItemCount({ id, buyNow } = {}) {
1105
- const { error } = CartValidator.getItemCount().validate(
1172
+ async getItemCount({ id, buyNow } = {}, { headers } = { headers: false }) {
1173
+ const { error } = CartApplicationValidator.getItemCount().validate(
1106
1174
  { id, buyNow },
1107
1175
  { abortEarly: false, allowUnknown: true }
1108
1176
  );
@@ -1111,16 +1179,17 @@ class Cart {
1111
1179
  }
1112
1180
 
1113
1181
  // Showing warrnings if extra unknown parameters are found
1114
- const { error: warrning } = CartValidator.getItemCount().validate(
1182
+ const {
1183
+ error: warrning,
1184
+ } = CartApplicationValidator.getItemCount().validate(
1115
1185
  { id, buyNow },
1116
1186
  { abortEarly: false, allowUnknown: false }
1117
1187
  );
1118
1188
  if (warrning) {
1119
1189
  Logger({
1120
1190
  level: "WARN",
1121
- message: "Parameter Validation warrnings for getItemCount",
1191
+ message: `Parameter Validation warrnings for application > Cart > getItemCount \n ${warrning}`,
1122
1192
  });
1123
- Logger({ level: "WARN", message: warrning });
1124
1193
  }
1125
1194
 
1126
1195
  const query_params = {};
@@ -1138,12 +1207,18 @@ class Cart {
1138
1207
  }),
1139
1208
  query_params,
1140
1209
  undefined,
1141
- xHeaders
1210
+ xHeaders,
1211
+ { headers }
1142
1212
  );
1143
1213
 
1214
+ let responseData = response;
1215
+ if (headers) {
1216
+ responseData = response[0];
1217
+ }
1218
+
1144
1219
  const {
1145
1220
  error: res_error,
1146
- } = CartModel.CartItemCountResponse().validate(response, {
1221
+ } = CartApplicationModel.CartItemCountResponse().validate(responseData, {
1147
1222
  abortEarly: false,
1148
1223
  allowUnknown: false,
1149
1224
  });
@@ -1151,30 +1226,26 @@ class Cart {
1151
1226
  if (res_error) {
1152
1227
  Logger({
1153
1228
  level: "WARN",
1154
- message: "Response Validation Warnnings for getItemCount",
1229
+ message: `Response Validation Warnnings for application > Cart > getItemCount \n ${res_error}`,
1155
1230
  });
1156
- Logger({ level: "WARN", message: res_error });
1157
1231
  }
1158
1232
 
1159
1233
  return response;
1160
1234
  }
1161
1235
 
1162
1236
  /**
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
1237
+ * @param {CartApplicationValidator.GetLadderOffersParam} arg - Arg object.
1238
+ * @param {import("../ApplicationAPIClient").Options} - Options
1239
+ * @returns {Promise<CartApplicationModel.LadderPriceOffers>} - Success response
1240
+ * @name getLadderOffers
1173
1241
  * @summary: Fetch ladder price promotion
1174
- * @description: Use this API to get applicable ladder price promotion for current product
1242
+ * @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
1243
  */
1176
- async getLadderOffers({ slug, storeId, promotionId, pageSize } = {}) {
1177
- const { error } = CartValidator.getLadderOffers().validate(
1244
+ async getLadderOffers(
1245
+ { slug, storeId, promotionId, pageSize } = {},
1246
+ { headers } = { headers: false }
1247
+ ) {
1248
+ const { error } = CartApplicationValidator.getLadderOffers().validate(
1178
1249
  { slug, storeId, promotionId, pageSize },
1179
1250
  { abortEarly: false, allowUnknown: true }
1180
1251
  );
@@ -1183,16 +1254,17 @@ class Cart {
1183
1254
  }
1184
1255
 
1185
1256
  // Showing warrnings if extra unknown parameters are found
1186
- const { error: warrning } = CartValidator.getLadderOffers().validate(
1257
+ const {
1258
+ error: warrning,
1259
+ } = CartApplicationValidator.getLadderOffers().validate(
1187
1260
  { slug, storeId, promotionId, pageSize },
1188
1261
  { abortEarly: false, allowUnknown: false }
1189
1262
  );
1190
1263
  if (warrning) {
1191
1264
  Logger({
1192
1265
  level: "WARN",
1193
- message: "Parameter Validation warrnings for getLadderOffers",
1266
+ message: `Parameter Validation warrnings for application > Cart > getLadderOffers \n ${warrning}`,
1194
1267
  });
1195
- Logger({ level: "WARN", message: warrning });
1196
1268
  }
1197
1269
 
1198
1270
  const query_params = {};
@@ -1212,12 +1284,18 @@ class Cart {
1212
1284
  }),
1213
1285
  query_params,
1214
1286
  undefined,
1215
- xHeaders
1287
+ xHeaders,
1288
+ { headers }
1216
1289
  );
1217
1290
 
1291
+ let responseData = response;
1292
+ if (headers) {
1293
+ responseData = response[0];
1294
+ }
1295
+
1218
1296
  const {
1219
1297
  error: res_error,
1220
- } = CartModel.LadderPriceOffers().validate(response, {
1298
+ } = CartApplicationModel.LadderPriceOffers().validate(responseData, {
1221
1299
  abortEarly: false,
1222
1300
  allowUnknown: false,
1223
1301
  });
@@ -1225,28 +1303,26 @@ class Cart {
1225
1303
  if (res_error) {
1226
1304
  Logger({
1227
1305
  level: "WARN",
1228
- message: "Response Validation Warnnings for getLadderOffers",
1306
+ message: `Response Validation Warnnings for application > Cart > getLadderOffers \n ${res_error}`,
1229
1307
  });
1230
- Logger({ level: "WARN", message: res_error });
1231
1308
  }
1232
1309
 
1233
1310
  return response;
1234
1311
  }
1235
1312
 
1236
1313
  /**
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
1314
+ * @param {CartApplicationValidator.GetPromotionOffersParam} arg - Arg object.
1315
+ * @param {import("../ApplicationAPIClient").Options} - Options
1316
+ * @returns {Promise<CartApplicationModel.PromotionOffersResponse>} - Success response
1317
+ * @name getPromotionOffers
1245
1318
  * @summary: Fetch available promotions
1246
- * @description: Use this API to get top 5 offers available for current product
1319
+ * @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
1320
  */
1248
- async getPromotionOffers({ slug, pageSize, promotionGroup, storeId } = {}) {
1249
- const { error } = CartValidator.getPromotionOffers().validate(
1321
+ async getPromotionOffers(
1322
+ { slug, pageSize, promotionGroup, storeId } = {},
1323
+ { headers } = { headers: false }
1324
+ ) {
1325
+ const { error } = CartApplicationValidator.getPromotionOffers().validate(
1250
1326
  { slug, pageSize, promotionGroup, storeId },
1251
1327
  { abortEarly: false, allowUnknown: true }
1252
1328
  );
@@ -1255,16 +1331,17 @@ class Cart {
1255
1331
  }
1256
1332
 
1257
1333
  // Showing warrnings if extra unknown parameters are found
1258
- const { error: warrning } = CartValidator.getPromotionOffers().validate(
1334
+ const {
1335
+ error: warrning,
1336
+ } = CartApplicationValidator.getPromotionOffers().validate(
1259
1337
  { slug, pageSize, promotionGroup, storeId },
1260
1338
  { abortEarly: false, allowUnknown: false }
1261
1339
  );
1262
1340
  if (warrning) {
1263
1341
  Logger({
1264
1342
  level: "WARN",
1265
- message: "Parameter Validation warrnings for getPromotionOffers",
1343
+ message: `Parameter Validation warrnings for application > Cart > getPromotionOffers \n ${warrning}`,
1266
1344
  });
1267
- Logger({ level: "WARN", message: warrning });
1268
1345
  }
1269
1346
 
1270
1347
  const query_params = {};
@@ -1284,12 +1361,18 @@ class Cart {
1284
1361
  }),
1285
1362
  query_params,
1286
1363
  undefined,
1287
- xHeaders
1364
+ xHeaders,
1365
+ { headers }
1288
1366
  );
1289
1367
 
1368
+ let responseData = response;
1369
+ if (headers) {
1370
+ responseData = response[0];
1371
+ }
1372
+
1290
1373
  const {
1291
1374
  error: res_error,
1292
- } = CartModel.PromotionOffersResponse().validate(response, {
1375
+ } = CartApplicationModel.PromotionOffersResponse().validate(responseData, {
1293
1376
  abortEarly: false,
1294
1377
  allowUnknown: false,
1295
1378
  });
@@ -1297,33 +1380,26 @@ class Cart {
1297
1380
  if (res_error) {
1298
1381
  Logger({
1299
1382
  level: "WARN",
1300
- message: "Response Validation Warnnings for getPromotionOffers",
1383
+ message: `Response Validation Warnnings for application > Cart > getPromotionOffers \n ${res_error}`,
1301
1384
  });
1302
- Logger({ level: "WARN", message: res_error });
1303
1385
  }
1304
1386
 
1305
1387
  return response;
1306
1388
  }
1307
1389
 
1308
1390
  /**
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
1391
+ * @param {CartApplicationValidator.GetShipmentsParam} arg - Arg object.
1392
+ * @param {import("../ApplicationAPIClient").Options} - Options
1393
+ * @returns {Promise<CartApplicationModel.CartShipmentsResponse>} - Success response
1394
+ * @name getShipments
1322
1395
  * @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.
1396
+ * @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
1397
  */
1325
- async getShipments({ p, id, buyNow, addressId, areaCode, orderType } = {}) {
1326
- const { error } = CartValidator.getShipments().validate(
1398
+ async getShipments(
1399
+ { p, id, buyNow, addressId, areaCode, orderType } = {},
1400
+ { headers } = { headers: false }
1401
+ ) {
1402
+ const { error } = CartApplicationValidator.getShipments().validate(
1327
1403
  { p, id, buyNow, addressId, areaCode, orderType },
1328
1404
  { abortEarly: false, allowUnknown: true }
1329
1405
  );
@@ -1332,16 +1408,17 @@ class Cart {
1332
1408
  }
1333
1409
 
1334
1410
  // Showing warrnings if extra unknown parameters are found
1335
- const { error: warrning } = CartValidator.getShipments().validate(
1411
+ const {
1412
+ error: warrning,
1413
+ } = CartApplicationValidator.getShipments().validate(
1336
1414
  { p, id, buyNow, addressId, areaCode, orderType },
1337
1415
  { abortEarly: false, allowUnknown: false }
1338
1416
  );
1339
1417
  if (warrning) {
1340
1418
  Logger({
1341
1419
  level: "WARN",
1342
- message: "Parameter Validation warrnings for getShipments",
1420
+ message: `Parameter Validation warrnings for application > Cart > getShipments \n ${warrning}`,
1343
1421
  });
1344
- Logger({ level: "WARN", message: warrning });
1345
1422
  }
1346
1423
 
1347
1424
  const query_params = {};
@@ -1363,12 +1440,18 @@ class Cart {
1363
1440
  }),
1364
1441
  query_params,
1365
1442
  undefined,
1366
- xHeaders
1443
+ xHeaders,
1444
+ { headers }
1367
1445
  );
1368
1446
 
1447
+ let responseData = response;
1448
+ if (headers) {
1449
+ responseData = response[0];
1450
+ }
1451
+
1369
1452
  const {
1370
1453
  error: res_error,
1371
- } = CartModel.CartShipmentsResponse().validate(response, {
1454
+ } = CartApplicationModel.CartShipmentsResponse().validate(responseData, {
1372
1455
  abortEarly: false,
1373
1456
  allowUnknown: false,
1374
1457
  });
@@ -1376,23 +1459,23 @@ class Cart {
1376
1459
  if (res_error) {
1377
1460
  Logger({
1378
1461
  level: "WARN",
1379
- message: "Response Validation Warnnings for getShipments",
1462
+ message: `Response Validation Warnnings for application > Cart > getShipments \n ${res_error}`,
1380
1463
  });
1381
- Logger({ level: "WARN", message: res_error });
1382
1464
  }
1383
1465
 
1384
1466
  return response;
1385
1467
  }
1386
1468
 
1387
1469
  /**
1388
- * @param {Object} arg - Arg object.
1389
- * @param {string} arg.id - ID allotted to the selected address
1390
- * @returns {Promise<DeleteAddressResponse>} - Success response
1470
+ * @param {CartApplicationValidator.RemoveAddressParam} arg - Arg object.
1471
+ * @param {import("../ApplicationAPIClient").Options} - Options
1472
+ * @returns {Promise<CartApplicationModel.DeleteAddressResponse>} - Success response
1473
+ * @name removeAddress
1391
1474
  * @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.
1475
+ * @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
1476
  */
1394
- async removeAddress({ id } = {}) {
1395
- const { error } = CartValidator.removeAddress().validate(
1477
+ async removeAddress({ id } = {}, { headers } = { headers: false }) {
1478
+ const { error } = CartApplicationValidator.removeAddress().validate(
1396
1479
  { id },
1397
1480
  { abortEarly: false, allowUnknown: true }
1398
1481
  );
@@ -1401,16 +1484,17 @@ class Cart {
1401
1484
  }
1402
1485
 
1403
1486
  // Showing warrnings if extra unknown parameters are found
1404
- const { error: warrning } = CartValidator.removeAddress().validate(
1487
+ const {
1488
+ error: warrning,
1489
+ } = CartApplicationValidator.removeAddress().validate(
1405
1490
  { id },
1406
1491
  { abortEarly: false, allowUnknown: false }
1407
1492
  );
1408
1493
  if (warrning) {
1409
1494
  Logger({
1410
1495
  level: "WARN",
1411
- message: "Parameter Validation warrnings for removeAddress",
1496
+ message: `Parameter Validation warrnings for application > Cart > removeAddress \n ${warrning}`,
1412
1497
  });
1413
- Logger({ level: "WARN", message: warrning });
1414
1498
  }
1415
1499
 
1416
1500
  const query_params = {};
@@ -1426,12 +1510,18 @@ class Cart {
1426
1510
  }),
1427
1511
  query_params,
1428
1512
  undefined,
1429
- xHeaders
1513
+ xHeaders,
1514
+ { headers }
1430
1515
  );
1431
1516
 
1517
+ let responseData = response;
1518
+ if (headers) {
1519
+ responseData = response[0];
1520
+ }
1521
+
1432
1522
  const {
1433
1523
  error: res_error,
1434
- } = CartModel.DeleteAddressResponse().validate(response, {
1524
+ } = CartApplicationModel.DeleteAddressResponse().validate(responseData, {
1435
1525
  abortEarly: false,
1436
1526
  allowUnknown: false,
1437
1527
  });
@@ -1439,24 +1529,23 @@ class Cart {
1439
1529
  if (res_error) {
1440
1530
  Logger({
1441
1531
  level: "WARN",
1442
- message: "Response Validation Warnnings for removeAddress",
1532
+ message: `Response Validation Warnnings for application > Cart > removeAddress \n ${res_error}`,
1443
1533
  });
1444
- Logger({ level: "WARN", message: res_error });
1445
1534
  }
1446
1535
 
1447
1536
  return response;
1448
1537
  }
1449
1538
 
1450
1539
  /**
1451
- * @param {Object} arg - Arg object.
1452
- * @param {string} [arg.id] -
1453
- * @param {boolean} [arg.buyNow] -
1454
- * @returns {Promise<CartDetailResponse>} - Success response
1540
+ * @param {CartApplicationValidator.RemoveCouponParam} arg - Arg object.
1541
+ * @param {import("../ApplicationAPIClient").Options} - Options
1542
+ * @returns {Promise<CartApplicationModel.CartDetailResponse>} - Success response
1543
+ * @name removeCoupon
1455
1544
  * @summary: Remove Coupon Applied
1456
- * @description: Remove Coupon applied on the cart by passing uid in request body.
1545
+ * @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
1546
  */
1458
- async removeCoupon({ id, buyNow } = {}) {
1459
- const { error } = CartValidator.removeCoupon().validate(
1547
+ async removeCoupon({ id, buyNow } = {}, { headers } = { headers: false }) {
1548
+ const { error } = CartApplicationValidator.removeCoupon().validate(
1460
1549
  { id, buyNow },
1461
1550
  { abortEarly: false, allowUnknown: true }
1462
1551
  );
@@ -1465,16 +1554,17 @@ class Cart {
1465
1554
  }
1466
1555
 
1467
1556
  // Showing warrnings if extra unknown parameters are found
1468
- const { error: warrning } = CartValidator.removeCoupon().validate(
1557
+ const {
1558
+ error: warrning,
1559
+ } = CartApplicationValidator.removeCoupon().validate(
1469
1560
  { id, buyNow },
1470
1561
  { abortEarly: false, allowUnknown: false }
1471
1562
  );
1472
1563
  if (warrning) {
1473
1564
  Logger({
1474
1565
  level: "WARN",
1475
- message: "Parameter Validation warrnings for removeCoupon",
1566
+ message: `Parameter Validation warrnings for application > Cart > removeCoupon \n ${warrning}`,
1476
1567
  });
1477
- Logger({ level: "WARN", message: warrning });
1478
1568
  }
1479
1569
 
1480
1570
  const query_params = {};
@@ -1492,12 +1582,18 @@ class Cart {
1492
1582
  }),
1493
1583
  query_params,
1494
1584
  undefined,
1495
- xHeaders
1585
+ xHeaders,
1586
+ { headers }
1496
1587
  );
1497
1588
 
1589
+ let responseData = response;
1590
+ if (headers) {
1591
+ responseData = response[0];
1592
+ }
1593
+
1498
1594
  const {
1499
1595
  error: res_error,
1500
- } = CartModel.CartDetailResponse().validate(response, {
1596
+ } = CartApplicationModel.CartDetailResponse().validate(responseData, {
1501
1597
  abortEarly: false,
1502
1598
  allowUnknown: false,
1503
1599
  });
@@ -1505,27 +1601,26 @@ class Cart {
1505
1601
  if (res_error) {
1506
1602
  Logger({
1507
1603
  level: "WARN",
1508
- message: "Response Validation Warnnings for removeCoupon",
1604
+ message: `Response Validation Warnnings for application > Cart > removeCoupon \n ${res_error}`,
1509
1605
  });
1510
- Logger({ level: "WARN", message: res_error });
1511
1606
  }
1512
1607
 
1513
1608
  return response;
1514
1609
  }
1515
1610
 
1516
1611
  /**
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
1612
+ * @param {CartApplicationValidator.SelectAddressParam} arg - Arg object.
1613
+ * @param {import("../ApplicationAPIClient").Options} - Options
1614
+ * @returns {Promise<CartApplicationModel.CartDetailResponse>} - Success response
1615
+ * @name selectAddress
1524
1616
  * @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>
1617
+ * @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> - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/selectAddress/).
1526
1618
  */
1527
- async selectAddress({ body, cartId, buyNow, i, b } = {}) {
1528
- const { error } = CartValidator.selectAddress().validate(
1619
+ async selectAddress(
1620
+ { body, cartId, buyNow, i, b } = {},
1621
+ { headers } = { headers: false }
1622
+ ) {
1623
+ const { error } = CartApplicationValidator.selectAddress().validate(
1529
1624
  { body, cartId, buyNow, i, b },
1530
1625
  { abortEarly: false, allowUnknown: true }
1531
1626
  );
@@ -1534,16 +1629,17 @@ class Cart {
1534
1629
  }
1535
1630
 
1536
1631
  // Showing warrnings if extra unknown parameters are found
1537
- const { error: warrning } = CartValidator.selectAddress().validate(
1632
+ const {
1633
+ error: warrning,
1634
+ } = CartApplicationValidator.selectAddress().validate(
1538
1635
  { body, cartId, buyNow, i, b },
1539
1636
  { abortEarly: false, allowUnknown: false }
1540
1637
  );
1541
1638
  if (warrning) {
1542
1639
  Logger({
1543
1640
  level: "WARN",
1544
- message: "Parameter Validation warrnings for selectAddress",
1641
+ message: `Parameter Validation warrnings for application > Cart > selectAddress \n ${warrning}`,
1545
1642
  });
1546
- Logger({ level: "WARN", message: warrning });
1547
1643
  }
1548
1644
 
1549
1645
  const query_params = {};
@@ -1563,12 +1659,18 @@ class Cart {
1563
1659
  }),
1564
1660
  query_params,
1565
1661
  body,
1566
- xHeaders
1662
+ xHeaders,
1663
+ { headers }
1567
1664
  );
1568
1665
 
1666
+ let responseData = response;
1667
+ if (headers) {
1668
+ responseData = response[0];
1669
+ }
1670
+
1569
1671
  const {
1570
1672
  error: res_error,
1571
- } = CartModel.CartDetailResponse().validate(response, {
1673
+ } = CartApplicationModel.CartDetailResponse().validate(responseData, {
1572
1674
  abortEarly: false,
1573
1675
  allowUnknown: false,
1574
1676
  });
@@ -1576,25 +1678,26 @@ class Cart {
1576
1678
  if (res_error) {
1577
1679
  Logger({
1578
1680
  level: "WARN",
1579
- message: "Response Validation Warnnings for selectAddress",
1681
+ message: `Response Validation Warnnings for application > Cart > selectAddress \n ${res_error}`,
1580
1682
  });
1581
- Logger({ level: "WARN", message: res_error });
1582
1683
  }
1583
1684
 
1584
1685
  return response;
1585
1686
  }
1586
1687
 
1587
1688
  /**
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
1689
+ * @param {CartApplicationValidator.SelectPaymentModeParam} arg - Arg object.
1690
+ * @param {import("../ApplicationAPIClient").Options} - Options
1691
+ * @returns {Promise<CartApplicationModel.CartDetailResponse>} - Success response
1692
+ * @name selectPaymentMode
1593
1693
  * @summary: Update cart payment
1594
- * @description: Use this API to update cart payment.
1694
+ * @description: Use this API to update cart payment. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/selectPaymentMode/).
1595
1695
  */
1596
- async selectPaymentMode({ body, id, buyNow } = {}) {
1597
- const { error } = CartValidator.selectPaymentMode().validate(
1696
+ async selectPaymentMode(
1697
+ { body, id, buyNow } = {},
1698
+ { headers } = { headers: false }
1699
+ ) {
1700
+ const { error } = CartApplicationValidator.selectPaymentMode().validate(
1598
1701
  { body, id, buyNow },
1599
1702
  { abortEarly: false, allowUnknown: true }
1600
1703
  );
@@ -1603,16 +1706,17 @@ class Cart {
1603
1706
  }
1604
1707
 
1605
1708
  // Showing warrnings if extra unknown parameters are found
1606
- const { error: warrning } = CartValidator.selectPaymentMode().validate(
1709
+ const {
1710
+ error: warrning,
1711
+ } = CartApplicationValidator.selectPaymentMode().validate(
1607
1712
  { body, id, buyNow },
1608
1713
  { abortEarly: false, allowUnknown: false }
1609
1714
  );
1610
1715
  if (warrning) {
1611
1716
  Logger({
1612
1717
  level: "WARN",
1613
- message: "Parameter Validation warrnings for selectPaymentMode",
1718
+ message: `Parameter Validation warrnings for application > Cart > selectPaymentMode \n ${warrning}`,
1614
1719
  });
1615
- Logger({ level: "WARN", message: warrning });
1616
1720
  }
1617
1721
 
1618
1722
  const query_params = {};
@@ -1630,12 +1734,18 @@ class Cart {
1630
1734
  }),
1631
1735
  query_params,
1632
1736
  body,
1633
- xHeaders
1737
+ xHeaders,
1738
+ { headers }
1634
1739
  );
1635
1740
 
1741
+ let responseData = response;
1742
+ if (headers) {
1743
+ responseData = response[0];
1744
+ }
1745
+
1636
1746
  const {
1637
1747
  error: res_error,
1638
- } = CartModel.CartDetailResponse().validate(response, {
1748
+ } = CartApplicationModel.CartDetailResponse().validate(responseData, {
1639
1749
  abortEarly: false,
1640
1750
  allowUnknown: false,
1641
1751
  });
@@ -1643,24 +1753,23 @@ class Cart {
1643
1753
  if (res_error) {
1644
1754
  Logger({
1645
1755
  level: "WARN",
1646
- message: "Response Validation Warnnings for selectPaymentMode",
1756
+ message: `Response Validation Warnnings for application > Cart > selectPaymentMode \n ${res_error}`,
1647
1757
  });
1648
- Logger({ level: "WARN", message: res_error });
1649
1758
  }
1650
1759
 
1651
1760
  return response;
1652
1761
  }
1653
1762
 
1654
1763
  /**
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
1764
+ * @param {CartApplicationValidator.UpdateAddressParam} arg - Arg object.
1765
+ * @param {import("../ApplicationAPIClient").Options} - Options
1766
+ * @returns {Promise<CartApplicationModel.UpdateAddressResponse>} - Success response
1767
+ * @name updateAddress
1659
1768
  * @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>
1769
+ * @description: <p>Use this API to update an existing address in the account. Request object should contain attributes mentioned in <font color="blue">Address </font> can be updated. These attributes are:</p> <ul> <li> <font color="monochrome">is_default_address</font></li> <li> <font color="monochrome">landmark</font></li> <li> <font color="monochrome">area</font></li> <li> <font color="monochrome">pincode</font></li> <li> <font color="monochrome">email</font></li> <li> <font color="monochrome">address_type</font></li> <li> <font color="monochrome">name</font></li> <li> <font color="monochrome">address_id</font></li> <li> <font color="monochrome">address</font></li> </ul> - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/updateAddress/).
1661
1770
  */
1662
- async updateAddress({ id, body } = {}) {
1663
- const { error } = CartValidator.updateAddress().validate(
1771
+ async updateAddress({ id, body } = {}, { headers } = { headers: false }) {
1772
+ const { error } = CartApplicationValidator.updateAddress().validate(
1664
1773
  { id, body },
1665
1774
  { abortEarly: false, allowUnknown: true }
1666
1775
  );
@@ -1669,16 +1778,17 @@ class Cart {
1669
1778
  }
1670
1779
 
1671
1780
  // Showing warrnings if extra unknown parameters are found
1672
- const { error: warrning } = CartValidator.updateAddress().validate(
1781
+ const {
1782
+ error: warrning,
1783
+ } = CartApplicationValidator.updateAddress().validate(
1673
1784
  { id, body },
1674
1785
  { abortEarly: false, allowUnknown: false }
1675
1786
  );
1676
1787
  if (warrning) {
1677
1788
  Logger({
1678
1789
  level: "WARN",
1679
- message: "Parameter Validation warrnings for updateAddress",
1790
+ message: `Parameter Validation warrnings for application > Cart > updateAddress \n ${warrning}`,
1680
1791
  });
1681
- Logger({ level: "WARN", message: warrning });
1682
1792
  }
1683
1793
 
1684
1794
  const query_params = {};
@@ -1694,12 +1804,18 @@ class Cart {
1694
1804
  }),
1695
1805
  query_params,
1696
1806
  body,
1697
- xHeaders
1807
+ xHeaders,
1808
+ { headers }
1698
1809
  );
1699
1810
 
1811
+ let responseData = response;
1812
+ if (headers) {
1813
+ responseData = response[0];
1814
+ }
1815
+
1700
1816
  const {
1701
1817
  error: res_error,
1702
- } = CartModel.UpdateAddressResponse().validate(response, {
1818
+ } = CartApplicationModel.UpdateAddressResponse().validate(responseData, {
1703
1819
  abortEarly: false,
1704
1820
  allowUnknown: false,
1705
1821
  });
@@ -1707,28 +1823,27 @@ class Cart {
1707
1823
  if (res_error) {
1708
1824
  Logger({
1709
1825
  level: "WARN",
1710
- message: "Response Validation Warnnings for updateAddress",
1826
+ message: `Response Validation Warnnings for application > Cart > updateAddress \n ${res_error}`,
1711
1827
  });
1712
- Logger({ level: "WARN", message: res_error });
1713
1828
  }
1714
1829
 
1715
1830
  return response;
1716
1831
  }
1717
1832
 
1718
1833
  /**
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
1834
+ * @param {CartApplicationValidator.UpdateCartParam} arg - Arg object.
1835
+ * @param {import("../ApplicationAPIClient").Options} - Options
1836
+ * @returns {Promise<CartApplicationModel.UpdateCartDetailResponse>} -
1837
+ * Success response
1838
+ * @name updateCart
1727
1839
  * @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>
1840
+ * @description: <p>Use this API to update items added to the cart with the help of a request object containing attributes like item_quantity and item_size. These attributes will be fetched from the following APIs</p> <ul> <li><font color="monochrome">operation</font> Operation for current api call. <b>update_item</b> for update items. <b>remove_item</b> for removing items.</li> <li> <font color="monochrome">item_id</font> "/platform/content/v1/products/"</li> <li> <font color="monochrome">item_size</font> "/platform/content/v1/products/:slug/sizes/"</li> <li> <font color="monochrome">quantity</font> item quantity (must be greater than or equal to 1)</li> <li> <font color="monochrome">article_id</font> "/content​/v1​/products​/:identifier​/sizes​/price​/"</li> <li> <font color="monochrome">item_index</font> item position in the cart (must be greater than or equal to 0)</li> </ul> - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/updateCart/).
1729
1841
  */
1730
- async updateCart({ body, id, i, b, areaCode, buyNow } = {}) {
1731
- const { error } = CartValidator.updateCart().validate(
1842
+ async updateCart(
1843
+ { body, id, i, b, areaCode, buyNow } = {},
1844
+ { headers } = { headers: false }
1845
+ ) {
1846
+ const { error } = CartApplicationValidator.updateCart().validate(
1732
1847
  { body, id, i, b, areaCode, buyNow },
1733
1848
  { abortEarly: false, allowUnknown: true }
1734
1849
  );
@@ -1737,16 +1852,15 @@ class Cart {
1737
1852
  }
1738
1853
 
1739
1854
  // Showing warrnings if extra unknown parameters are found
1740
- const { error: warrning } = CartValidator.updateCart().validate(
1855
+ const { error: warrning } = CartApplicationValidator.updateCart().validate(
1741
1856
  { body, id, i, b, areaCode, buyNow },
1742
1857
  { abortEarly: false, allowUnknown: false }
1743
1858
  );
1744
1859
  if (warrning) {
1745
1860
  Logger({
1746
1861
  level: "WARN",
1747
- message: "Parameter Validation warrnings for updateCart",
1862
+ message: `Parameter Validation warrnings for application > Cart > updateCart \n ${warrning}`,
1748
1863
  });
1749
- Logger({ level: "WARN", message: warrning });
1750
1864
  }
1751
1865
 
1752
1866
  const query_params = {};
@@ -1767,12 +1881,18 @@ class Cart {
1767
1881
  }),
1768
1882
  query_params,
1769
1883
  body,
1770
- xHeaders
1884
+ xHeaders,
1885
+ { headers }
1771
1886
  );
1772
1887
 
1888
+ let responseData = response;
1889
+ if (headers) {
1890
+ responseData = response[0];
1891
+ }
1892
+
1773
1893
  const {
1774
1894
  error: res_error,
1775
- } = CartModel.UpdateCartDetailResponse().validate(response, {
1895
+ } = CartApplicationModel.UpdateCartDetailResponse().validate(responseData, {
1776
1896
  abortEarly: false,
1777
1897
  allowUnknown: false,
1778
1898
  });
@@ -1780,25 +1900,26 @@ class Cart {
1780
1900
  if (res_error) {
1781
1901
  Logger({
1782
1902
  level: "WARN",
1783
- message: "Response Validation Warnnings for updateCart",
1903
+ message: `Response Validation Warnnings for application > Cart > updateCart \n ${res_error}`,
1784
1904
  });
1785
- Logger({ level: "WARN", message: res_error });
1786
1905
  }
1787
1906
 
1788
1907
  return response;
1789
1908
  }
1790
1909
 
1791
1910
  /**
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
1911
+ * @param {CartApplicationValidator.UpdateCartMetaParam} arg - Arg object.
1912
+ * @param {import("../ApplicationAPIClient").Options} - Options
1913
+ * @returns {Promise<CartApplicationModel.CartMetaResponse>} - Success response
1914
+ * @name updateCartMeta
1797
1915
  * @summary: Update the cart meta
1798
- * @description: Use this API to update cart meta like checkout_mode and gstin.
1916
+ * @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
1917
  */
1800
- async updateCartMeta({ body, id, buyNow } = {}) {
1801
- const { error } = CartValidator.updateCartMeta().validate(
1918
+ async updateCartMeta(
1919
+ { body, id, buyNow } = {},
1920
+ { headers } = { headers: false }
1921
+ ) {
1922
+ const { error } = CartApplicationValidator.updateCartMeta().validate(
1802
1923
  { body, id, buyNow },
1803
1924
  { abortEarly: false, allowUnknown: true }
1804
1925
  );
@@ -1807,16 +1928,17 @@ class Cart {
1807
1928
  }
1808
1929
 
1809
1930
  // Showing warrnings if extra unknown parameters are found
1810
- const { error: warrning } = CartValidator.updateCartMeta().validate(
1931
+ const {
1932
+ error: warrning,
1933
+ } = CartApplicationValidator.updateCartMeta().validate(
1811
1934
  { body, id, buyNow },
1812
1935
  { abortEarly: false, allowUnknown: false }
1813
1936
  );
1814
1937
  if (warrning) {
1815
1938
  Logger({
1816
1939
  level: "WARN",
1817
- message: "Parameter Validation warrnings for updateCartMeta",
1940
+ message: `Parameter Validation warrnings for application > Cart > updateCartMeta \n ${warrning}`,
1818
1941
  });
1819
- Logger({ level: "WARN", message: warrning });
1820
1942
  }
1821
1943
 
1822
1944
  const query_params = {};
@@ -1834,36 +1956,47 @@ class Cart {
1834
1956
  }),
1835
1957
  query_params,
1836
1958
  body,
1837
- xHeaders
1959
+ xHeaders,
1960
+ { headers }
1838
1961
  );
1839
1962
 
1840
- const { error: res_error } = CartModel.CartMetaResponse().validate(
1841
- response,
1842
- { abortEarly: false, allowUnknown: false }
1843
- );
1963
+ let responseData = response;
1964
+ if (headers) {
1965
+ responseData = response[0];
1966
+ }
1967
+
1968
+ const {
1969
+ error: res_error,
1970
+ } = CartApplicationModel.CartMetaResponse().validate(responseData, {
1971
+ abortEarly: false,
1972
+ allowUnknown: false,
1973
+ });
1844
1974
 
1845
1975
  if (res_error) {
1846
1976
  Logger({
1847
1977
  level: "WARN",
1848
- message: "Response Validation Warnnings for updateCartMeta",
1978
+ message: `Response Validation Warnnings for application > Cart > updateCartMeta \n ${res_error}`,
1849
1979
  });
1850
- Logger({ level: "WARN", message: res_error });
1851
1980
  }
1852
1981
 
1853
1982
  return response;
1854
1983
  }
1855
1984
 
1856
1985
  /**
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
1986
+ * @param {CartApplicationValidator.UpdateCartWithSharedItemsParam} arg - Arg object.
1987
+ * @param {import("../ApplicationAPIClient").Options} - Options
1988
+ * @returns {Promise<CartApplicationModel.SharedCartResponse>} - Success response
1989
+ * @name updateCartWithSharedItems
1862
1990
  * @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.
1991
+ * @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
1992
  */
1865
- async updateCartWithSharedItems({ token, action } = {}) {
1866
- const { error } = CartValidator.updateCartWithSharedItems().validate(
1993
+ async updateCartWithSharedItems(
1994
+ { token, action } = {},
1995
+ { headers } = { headers: false }
1996
+ ) {
1997
+ const {
1998
+ error,
1999
+ } = CartApplicationValidator.updateCartWithSharedItems().validate(
1867
2000
  { token, action },
1868
2001
  { abortEarly: false, allowUnknown: true }
1869
2002
  );
@@ -1874,16 +2007,15 @@ class Cart {
1874
2007
  // Showing warrnings if extra unknown parameters are found
1875
2008
  const {
1876
2009
  error: warrning,
1877
- } = CartValidator.updateCartWithSharedItems().validate(
2010
+ } = CartApplicationValidator.updateCartWithSharedItems().validate(
1878
2011
  { token, action },
1879
2012
  { abortEarly: false, allowUnknown: false }
1880
2013
  );
1881
2014
  if (warrning) {
1882
2015
  Logger({
1883
2016
  level: "WARN",
1884
- message: "Parameter Validation warrnings for updateCartWithSharedItems",
2017
+ message: `Parameter Validation warrnings for application > Cart > updateCartWithSharedItems \n ${warrning}`,
1885
2018
  });
1886
- Logger({ level: "WARN", message: warrning });
1887
2019
  }
1888
2020
 
1889
2021
  const query_params = {};
@@ -1899,12 +2031,18 @@ class Cart {
1899
2031
  }),
1900
2032
  query_params,
1901
2033
  undefined,
1902
- xHeaders
2034
+ xHeaders,
2035
+ { headers }
1903
2036
  );
1904
2037
 
2038
+ let responseData = response;
2039
+ if (headers) {
2040
+ responseData = response[0];
2041
+ }
2042
+
1905
2043
  const {
1906
2044
  error: res_error,
1907
- } = CartModel.SharedCartResponse().validate(response, {
2045
+ } = CartApplicationModel.SharedCartResponse().validate(responseData, {
1908
2046
  abortEarly: false,
1909
2047
  allowUnknown: false,
1910
2048
  });
@@ -1912,45 +2050,40 @@ class Cart {
1912
2050
  if (res_error) {
1913
2051
  Logger({
1914
2052
  level: "WARN",
1915
- message: "Response Validation Warnnings for updateCartWithSharedItems",
2053
+ message: `Response Validation Warnnings for application > Cart > updateCartWithSharedItems \n ${res_error}`,
1916
2054
  });
1917
- Logger({ level: "WARN", message: res_error });
1918
2055
  }
1919
2056
 
1920
2057
  return response;
1921
2058
  }
1922
2059
 
1923
2060
  /**
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
2061
+ * @param {CartApplicationValidator.ValidateCouponForPaymentParam} arg - Arg object.
2062
+ * @param {import("../ApplicationAPIClient").Options} - Options
2063
+ * @returns {Promise<CartApplicationModel.PaymentCouponValidate>} - Success response
2064
+ * @name validateCouponForPayment
1937
2065
  * @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.
2066
+ * @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
2067
  */
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(
2068
+ async validateCouponForPayment(
2069
+ {
2070
+ id,
2071
+ buyNow,
2072
+ addressId,
2073
+ paymentMode,
2074
+ paymentIdentifier,
2075
+ aggregatorName,
2076
+ merchantCode,
2077
+ iin,
2078
+ network,
2079
+ type,
2080
+ cardId,
2081
+ } = {},
2082
+ { headers } = { headers: false }
2083
+ ) {
2084
+ const {
2085
+ error,
2086
+ } = CartApplicationValidator.validateCouponForPayment().validate(
1954
2087
  {
1955
2088
  id,
1956
2089
  buyNow,
@@ -1973,7 +2106,7 @@ class Cart {
1973
2106
  // Showing warrnings if extra unknown parameters are found
1974
2107
  const {
1975
2108
  error: warrning,
1976
- } = CartValidator.validateCouponForPayment().validate(
2109
+ } = CartApplicationValidator.validateCouponForPayment().validate(
1977
2110
  {
1978
2111
  id,
1979
2112
  buyNow,
@@ -1992,9 +2125,8 @@ class Cart {
1992
2125
  if (warrning) {
1993
2126
  Logger({
1994
2127
  level: "WARN",
1995
- message: "Parameter Validation warrnings for validateCouponForPayment",
2128
+ message: `Parameter Validation warrnings for application > Cart > validateCouponForPayment \n ${warrning}`,
1996
2129
  });
1997
- Logger({ level: "WARN", message: warrning });
1998
2130
  }
1999
2131
 
2000
2132
  const query_params = {};
@@ -2021,12 +2153,18 @@ class Cart {
2021
2153
  }),
2022
2154
  query_params,
2023
2155
  undefined,
2024
- xHeaders
2156
+ xHeaders,
2157
+ { headers }
2025
2158
  );
2026
2159
 
2160
+ let responseData = response;
2161
+ if (headers) {
2162
+ responseData = response[0];
2163
+ }
2164
+
2027
2165
  const {
2028
2166
  error: res_error,
2029
- } = CartModel.PaymentCouponValidate().validate(response, {
2167
+ } = CartApplicationModel.PaymentCouponValidate().validate(responseData, {
2030
2168
  abortEarly: false,
2031
2169
  allowUnknown: false,
2032
2170
  });
@@ -2034,9 +2172,8 @@ class Cart {
2034
2172
  if (res_error) {
2035
2173
  Logger({
2036
2174
  level: "WARN",
2037
- message: "Response Validation Warnnings for validateCouponForPayment",
2175
+ message: `Response Validation Warnnings for application > Cart > validateCouponForPayment \n ${res_error}`,
2038
2176
  });
2039
- Logger({ level: "WARN", message: res_error });
2040
2177
  }
2041
2178
 
2042
2179
  return response;