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