@gofynd/fdk-client-javascript 1.0.1 → 1.0.3

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 (318) hide show
  1. package/documentation/application/CART.md +5934 -4502
  2. package/documentation/application/CATALOG.md +6338 -7245
  3. package/documentation/application/COMMON.md +95 -222
  4. package/documentation/application/COMMUNICATION.md +106 -186
  5. package/documentation/application/CONFIGURATION.md +903 -1597
  6. package/documentation/application/CONTENT.md +562 -1270
  7. package/documentation/application/FILESTORAGE.md +84 -220
  8. package/documentation/application/LEAD.md +314 -660
  9. package/documentation/application/LOGISTIC.md +229 -305
  10. package/documentation/application/ORDER.md +642 -1137
  11. package/documentation/application/PAYMENT.md +2285 -3031
  12. package/documentation/application/POSCART.md +6079 -4642
  13. package/documentation/application/REWARDS.md +94 -248
  14. package/documentation/application/SHARE.md +152 -250
  15. package/documentation/application/THEME.md +952 -1235
  16. package/documentation/application/USER.md +1228 -1765
  17. package/documentation/platform/ANALYTICS.md +207 -349
  18. package/documentation/platform/AUDITTRAIL.md +121 -204
  19. package/documentation/platform/BILLING.md +865 -1376
  20. package/documentation/platform/CART.md +2814 -3662
  21. package/documentation/platform/CATALOG.md +15266 -17619
  22. package/documentation/platform/COMMON.md +95 -222
  23. package/documentation/platform/COMMUNICATION.md +1632 -2380
  24. package/documentation/platform/COMPANYPROFILE.md +572 -957
  25. package/documentation/platform/CONFIGURATION.md +3050 -4073
  26. package/documentation/platform/CONTENT.md +3509 -4121
  27. package/documentation/platform/DISCOUNT.md +140 -236
  28. package/documentation/platform/FILESTORAGE.md +187 -323
  29. package/documentation/platform/INVENTORY.md +268 -911
  30. package/documentation/platform/LEAD.md +2195 -2541
  31. package/documentation/platform/ORDER.md +3750 -5636
  32. package/documentation/platform/PARTNER.md +9 -36
  33. package/documentation/platform/PAYMENT.md +903 -1213
  34. package/documentation/platform/REWARDS.md +183 -347
  35. package/documentation/platform/SHARE.md +120 -213
  36. package/documentation/platform/THEME.md +12956 -13239
  37. package/documentation/platform/USER.md +975 -1120
  38. package/documentation/platform/WEBHOOK.md +78 -184
  39. package/documentation/public/CONFIGURATION.md +95 -222
  40. package/documentation/public/INVENTORY.md +100 -282
  41. package/documentation/public/WEBHOOK.md +27 -133
  42. package/package.json +1 -1
  43. package/sdk/application/ApplicationConfig.js +1 -1
  44. package/sdk/application/Cart/CartApplicationClient.d.ts +243 -243
  45. package/sdk/application/Cart/CartApplicationClient.js +1058 -547
  46. package/sdk/application/Cart/CartApplicationModel.d.ts +64 -63
  47. package/sdk/application/Cart/CartApplicationModel.js +489 -886
  48. package/sdk/application/Cart/CartApplicationValidator.d.ts +17 -17
  49. package/sdk/application/Cart/CartApplicationValidator.js +98 -98
  50. package/sdk/application/Catalog/CatalogApplicationClient.d.ts +358 -358
  51. package/sdk/application/Catalog/CatalogApplicationClient.js +1545 -949
  52. package/sdk/application/Catalog/CatalogApplicationModel.d.ts +90 -90
  53. package/sdk/application/Catalog/CatalogApplicationModel.js +692 -1258
  54. package/sdk/application/Catalog/CatalogApplicationValidator.d.ts +19 -19
  55. package/sdk/application/Catalog/CatalogApplicationValidator.js +110 -110
  56. package/sdk/application/Common/CommonApplicationClient.d.ts +13 -13
  57. package/sdk/application/Common/CommonApplicationClient.js +76 -36
  58. package/sdk/application/Common/CommonApplicationModel.d.ts +12 -12
  59. package/sdk/application/Common/CommonApplicationModel.js +83 -160
  60. package/sdk/application/Common/CommonApplicationValidator.d.ts +1 -1
  61. package/sdk/application/Common/CommonApplicationValidator.js +6 -6
  62. package/sdk/application/Communication/CommunicationApplicationClient.d.ts +11 -11
  63. package/sdk/application/Communication/CommunicationApplicationClient.js +92 -31
  64. package/sdk/application/Communication/CommunicationApplicationModel.d.ts +6 -6
  65. package/sdk/application/Communication/CommunicationApplicationModel.js +38 -83
  66. package/sdk/application/Communication/CommunicationApplicationValidator.d.ts +1 -1
  67. package/sdk/application/Communication/CommunicationApplicationValidator.js +4 -4
  68. package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +116 -116
  69. package/sdk/application/Configuration/ConfigurationApplicationClient.js +638 -312
  70. package/sdk/application/Configuration/ConfigurationApplicationModel.d.ts +85 -85
  71. package/sdk/application/Configuration/ConfigurationApplicationModel.js +480 -851
  72. package/sdk/application/Configuration/ConfigurationApplicationValidator.d.ts +8 -8
  73. package/sdk/application/Configuration/ConfigurationApplicationValidator.js +33 -33
  74. package/sdk/application/Content/ContentApplicationClient.d.ts +67 -67
  75. package/sdk/application/Content/ContentApplicationClient.js +581 -213
  76. package/sdk/application/Content/ContentApplicationModel.d.ts +76 -75
  77. package/sdk/application/Content/ContentApplicationModel.js +468 -875
  78. package/sdk/application/Content/ContentApplicationValidator.d.ts +5 -5
  79. package/sdk/application/Content/ContentApplicationValidator.js +24 -24
  80. package/sdk/application/FileStorage/FileStorageApplicationClient.d.ts +25 -25
  81. package/sdk/application/FileStorage/FileStorageApplicationClient.js +121 -59
  82. package/sdk/application/FileStorage/FileStorageApplicationModel.d.ts +13 -13
  83. package/sdk/application/FileStorage/FileStorageApplicationModel.js +86 -169
  84. package/sdk/application/FileStorage/FileStorageApplicationValidator.d.ts +1 -1
  85. package/sdk/application/FileStorage/FileStorageApplicationValidator.js +7 -7
  86. package/sdk/application/Lead/LeadApplicationClient.d.ts +24 -24
  87. package/sdk/application/Lead/LeadApplicationClient.js +230 -96
  88. package/sdk/application/Lead/LeadApplicationModel.d.ts +35 -35
  89. package/sdk/application/Lead/LeadApplicationModel.js +267 -474
  90. package/sdk/application/Lead/LeadApplicationValidator.d.ts +2 -2
  91. package/sdk/application/Lead/LeadApplicationValidator.js +11 -11
  92. package/sdk/application/Logistic/LogisticApplicationClient.d.ts +30 -19
  93. package/sdk/application/Logistic/LogisticApplicationClient.js +196 -47
  94. package/sdk/application/Logistic/LogisticApplicationModel.d.ts +17 -14
  95. package/sdk/application/Logistic/LogisticApplicationModel.js +133 -201
  96. package/sdk/application/Logistic/LogisticApplicationValidator.d.ts +3 -2
  97. package/sdk/application/Logistic/LogisticApplicationValidator.js +14 -8
  98. package/sdk/application/Order/OrderApplicationClient.d.ts +86 -86
  99. package/sdk/application/Order/OrderApplicationClient.js +448 -215
  100. package/sdk/application/Order/OrderApplicationModel.d.ts +50 -50
  101. package/sdk/application/Order/OrderApplicationModel.js +357 -661
  102. package/sdk/application/Order/OrderApplicationValidator.d.ts +7 -7
  103. package/sdk/application/Order/OrderApplicationValidator.js +28 -28
  104. package/sdk/application/Payment/PaymentApplicationClient.d.ts +318 -318
  105. package/sdk/application/Payment/PaymentApplicationClient.js +1525 -750
  106. package/sdk/application/Payment/PaymentApplicationModel.d.ts +72 -72
  107. package/sdk/application/Payment/PaymentApplicationModel.js +565 -1033
  108. package/sdk/application/Payment/PaymentApplicationValidator.d.ts +28 -28
  109. package/sdk/application/Payment/PaymentApplicationValidator.js +107 -107
  110. package/sdk/application/PosCart/PosCartApplicationClient.d.ts +254 -254
  111. package/sdk/application/PosCart/PosCartApplicationClient.js +1137 -606
  112. package/sdk/application/PosCart/PosCartApplicationModel.d.ts +61 -60
  113. package/sdk/application/PosCart/PosCartApplicationModel.js +477 -873
  114. package/sdk/application/PosCart/PosCartApplicationValidator.d.ts +18 -18
  115. package/sdk/application/PosCart/PosCartApplicationValidator.js +103 -103
  116. package/sdk/application/Rewards/RewardsApplicationClient.d.ts +27 -27
  117. package/sdk/application/Rewards/RewardsApplicationClient.js +253 -113
  118. package/sdk/application/Rewards/RewardsApplicationModel.d.ts +14 -14
  119. package/sdk/application/Rewards/RewardsApplicationModel.js +96 -191
  120. package/sdk/application/Rewards/RewardsApplicationValidator.d.ts +3 -3
  121. package/sdk/application/Rewards/RewardsApplicationValidator.js +12 -12
  122. package/sdk/application/Share/ShareApplicationClient.d.ts +37 -37
  123. package/sdk/application/Share/ShareApplicationClient.js +221 -96
  124. package/sdk/application/Share/ShareApplicationModel.d.ts +8 -8
  125. package/sdk/application/Share/ShareApplicationModel.js +63 -123
  126. package/sdk/application/Share/ShareApplicationValidator.d.ts +4 -4
  127. package/sdk/application/Share/ShareApplicationValidator.js +12 -12
  128. package/sdk/application/Theme/ThemeApplicationClient.d.ts +8 -8
  129. package/sdk/application/Theme/ThemeApplicationClient.js +115 -37
  130. package/sdk/application/Theme/ThemeApplicationModel.d.ts +34 -34
  131. package/sdk/application/Theme/ThemeApplicationModel.js +190 -336
  132. package/sdk/application/Theme/ThemeApplicationValidator.d.ts +1 -1
  133. package/sdk/application/Theme/ThemeApplicationValidator.js +4 -4
  134. package/sdk/application/User/UserApplicationClient.d.ts +280 -280
  135. package/sdk/application/User/UserApplicationClient.js +1201 -543
  136. package/sdk/application/User/UserApplicationModel.d.ts +79 -72
  137. package/sdk/application/User/UserApplicationModel.js +440 -689
  138. package/sdk/application/User/UserApplicationValidator.d.ts +24 -24
  139. package/sdk/application/User/UserApplicationValidator.js +89 -89
  140. package/sdk/common/AxiosHelper.js +1 -1
  141. package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.d.ts +55 -47
  142. package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.js +308 -151
  143. package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.d.ts +6 -6
  144. package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.js +20 -20
  145. package/sdk/platform/Analytics/AnalyticsPlatformClient.d.ts +8 -4
  146. package/sdk/platform/Analytics/AnalyticsPlatformClient.js +103 -16
  147. package/sdk/platform/Analytics/AnalyticsPlatformModel.d.ts +11 -11
  148. package/sdk/platform/Analytics/AnalyticsPlatformModel.js +95 -178
  149. package/sdk/platform/AuditTrail/AuditTrailPlatformClient.d.ts +16 -12
  150. package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +131 -44
  151. package/sdk/platform/AuditTrail/AuditTrailPlatformModel.d.ts +10 -10
  152. package/sdk/platform/AuditTrail/AuditTrailPlatformModel.js +50 -89
  153. package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.d.ts +1 -1
  154. package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.js +6 -6
  155. package/sdk/platform/Billing/BillingPlatformClient.d.ts +68 -56
  156. package/sdk/platform/Billing/BillingPlatformClient.js +416 -171
  157. package/sdk/platform/Billing/BillingPlatformModel.d.ts +40 -40
  158. package/sdk/platform/Billing/BillingPlatformModel.js +342 -668
  159. package/sdk/platform/Billing/BillingPlatformValidator.d.ts +8 -8
  160. package/sdk/platform/Billing/BillingPlatformValidator.js +25 -25
  161. package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +176 -159
  162. package/sdk/platform/Cart/CartPlatformApplicationClient.js +837 -500
  163. package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +11 -11
  164. package/sdk/platform/Cart/CartPlatformApplicationValidator.js +63 -63
  165. package/sdk/platform/Cart/CartPlatformModel.d.ts +86 -85
  166. package/sdk/platform/Cart/CartPlatformModel.js +677 -1211
  167. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +582 -529
  168. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +2642 -1533
  169. package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +40 -40
  170. package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +175 -175
  171. package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +708 -590
  172. package/sdk/platform/Catalog/CatalogPlatformClient.js +3103 -1362
  173. package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +293 -284
  174. package/sdk/platform/Catalog/CatalogPlatformModel.js +2149 -3660
  175. package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +66 -64
  176. package/sdk/platform/Catalog/CatalogPlatformValidator.js +235 -216
  177. package/sdk/platform/Common/CommonPlatformClient.d.ts +14 -12
  178. package/sdk/platform/Common/CommonPlatformClient.js +80 -37
  179. package/sdk/platform/Common/CommonPlatformModel.d.ts +12 -12
  180. package/sdk/platform/Common/CommonPlatformModel.js +83 -160
  181. package/sdk/platform/Common/CommonPlatformValidator.d.ts +1 -1
  182. package/sdk/platform/Common/CommonPlatformValidator.js +6 -6
  183. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +333 -293
  184. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +1687 -855
  185. package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.d.ts +30 -30
  186. package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.js +87 -87
  187. package/sdk/platform/Communication/CommunicationPlatformClient.d.ts +2 -1
  188. package/sdk/platform/Communication/CommunicationPlatformClient.js +28 -4
  189. package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +67 -67
  190. package/sdk/platform/Communication/CommunicationPlatformModel.js +522 -974
  191. package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +70 -57
  192. package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +463 -182
  193. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +28 -28
  194. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +294 -557
  195. package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.d.ts +7 -7
  196. package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.js +24 -24
  197. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +175 -137
  198. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +1168 -521
  199. package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.d.ts +22 -21
  200. package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.js +69 -63
  201. package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +137 -119
  202. package/sdk/platform/Configuration/ConfigurationPlatformClient.js +691 -316
  203. package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +148 -146
  204. package/sdk/platform/Configuration/ConfigurationPlatformModel.js +854 -1508
  205. package/sdk/platform/Configuration/ConfigurationPlatformValidator.d.ts +9 -9
  206. package/sdk/platform/Configuration/ConfigurationPlatformValidator.js +38 -38
  207. package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +542 -461
  208. package/sdk/platform/Content/ContentPlatformApplicationClient.js +2600 -1160
  209. package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +50 -49
  210. package/sdk/platform/Content/ContentPlatformApplicationValidator.js +159 -152
  211. package/sdk/platform/Content/ContentPlatformModel.d.ts +79 -75
  212. package/sdk/platform/Content/ContentPlatformModel.js +486 -867
  213. package/sdk/platform/Discount/DiscountPlatformClient.d.ts +72 -61
  214. package/sdk/platform/Discount/DiscountPlatformClient.js +424 -198
  215. package/sdk/platform/Discount/DiscountPlatformModel.d.ts +7 -7
  216. package/sdk/platform/Discount/DiscountPlatformModel.js +60 -121
  217. package/sdk/platform/Discount/DiscountPlatformValidator.d.ts +6 -6
  218. package/sdk/platform/Discount/DiscountPlatformValidator.js +29 -29
  219. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +26 -22
  220. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +145 -59
  221. package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.d.ts +1 -1
  222. package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.js +8 -8
  223. package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +58 -52
  224. package/sdk/platform/FileStorage/FileStoragePlatformClient.js +240 -114
  225. package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +13 -13
  226. package/sdk/platform/FileStorage/FileStoragePlatformModel.js +86 -169
  227. package/sdk/platform/FileStorage/FileStoragePlatformValidator.d.ts +3 -3
  228. package/sdk/platform/FileStorage/FileStoragePlatformValidator.js +11 -11
  229. package/sdk/platform/Inventory/InventoryPlatformClient.d.ts +76 -63
  230. package/sdk/platform/Inventory/InventoryPlatformClient.js +461 -197
  231. package/sdk/platform/Inventory/InventoryPlatformModel.d.ts +30 -30
  232. package/sdk/platform/Inventory/InventoryPlatformModel.js +497 -964
  233. package/sdk/platform/Inventory/InventoryPlatformValidator.d.ts +7 -7
  234. package/sdk/platform/Inventory/InventoryPlatformValidator.js +28 -28
  235. package/sdk/platform/Lead/LeadPlatformApplicationClient.d.ts +84 -71
  236. package/sdk/platform/Lead/LeadPlatformApplicationClient.js +441 -182
  237. package/sdk/platform/Lead/LeadPlatformApplicationValidator.d.ts +7 -7
  238. package/sdk/platform/Lead/LeadPlatformApplicationValidator.js +28 -28
  239. package/sdk/platform/Lead/LeadPlatformClient.d.ts +86 -75
  240. package/sdk/platform/Lead/LeadPlatformClient.js +434 -212
  241. package/sdk/platform/Lead/LeadPlatformModel.d.ts +35 -35
  242. package/sdk/platform/Lead/LeadPlatformModel.js +267 -474
  243. package/sdk/platform/Lead/LeadPlatformValidator.d.ts +6 -6
  244. package/sdk/platform/Lead/LeadPlatformValidator.js +24 -24
  245. package/sdk/platform/OAuthClient.js +8 -8
  246. package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +14 -11
  247. package/sdk/platform/Order/OrderPlatformApplicationClient.js +113 -49
  248. package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +1 -1
  249. package/sdk/platform/Order/OrderPlatformApplicationValidator.js +6 -6
  250. package/sdk/platform/Order/OrderPlatformClient.d.ts +367 -315
  251. package/sdk/platform/Order/OrderPlatformClient.js +1775 -893
  252. package/sdk/platform/Order/OrderPlatformModel.d.ts +198 -192
  253. package/sdk/platform/Order/OrderPlatformModel.js +1591 -2822
  254. package/sdk/platform/Order/OrderPlatformValidator.d.ts +32 -32
  255. package/sdk/platform/Order/OrderPlatformValidator.js +160 -155
  256. package/sdk/platform/Partner/PartnerPlatformApplicationClient.d.ts +4 -2
  257. package/sdk/platform/Partner/PartnerPlatformApplicationClient.js +52 -8
  258. package/sdk/platform/Partner/PartnerPlatformModel.js +6 -22
  259. package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +65 -54
  260. package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +395 -164
  261. package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +6 -6
  262. package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +23 -23
  263. package/sdk/platform/Payment/PaymentPlatformClient.d.ts +55 -45
  264. package/sdk/platform/Payment/PaymentPlatformClient.js +362 -147
  265. package/sdk/platform/Payment/PaymentPlatformModel.d.ts +27 -27
  266. package/sdk/platform/Payment/PaymentPlatformModel.js +220 -408
  267. package/sdk/platform/Payment/PaymentPlatformValidator.d.ts +4 -4
  268. package/sdk/platform/Payment/PaymentPlatformValidator.js +21 -21
  269. package/sdk/platform/PlatformApplicationClient.d.ts +1496 -10153
  270. package/sdk/platform/PlatformApplicationClient.js +1584 -13691
  271. package/sdk/platform/PlatformClient.d.ts +7918 -7666
  272. package/sdk/platform/PlatformClient.js +8701 -9926
  273. package/sdk/platform/Rewards/RewardsPlatformApplicationClient.d.ts +91 -78
  274. package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +507 -253
  275. package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.d.ts +8 -8
  276. package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.js +34 -34
  277. package/sdk/platform/Rewards/RewardsPlatformModel.d.ts +15 -15
  278. package/sdk/platform/Rewards/RewardsPlatformModel.js +92 -194
  279. package/sdk/platform/Share/SharePlatformApplicationClient.d.ts +16 -12
  280. package/sdk/platform/Share/SharePlatformApplicationClient.js +130 -52
  281. package/sdk/platform/Share/SharePlatformApplicationValidator.d.ts +1 -1
  282. package/sdk/platform/Share/SharePlatformApplicationValidator.js +6 -6
  283. package/sdk/platform/Share/SharePlatformModel.d.ts +8 -8
  284. package/sdk/platform/Share/SharePlatformModel.js +60 -118
  285. package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +148 -124
  286. package/sdk/platform/Theme/ThemePlatformApplicationClient.js +770 -295
  287. package/sdk/platform/Theme/ThemePlatformApplicationValidator.d.ts +15 -15
  288. package/sdk/platform/Theme/ThemePlatformApplicationValidator.js +44 -44
  289. package/sdk/platform/Theme/ThemePlatformModel.d.ts +34 -34
  290. package/sdk/platform/Theme/ThemePlatformModel.js +190 -336
  291. package/sdk/platform/User/UserPlatformApplicationClient.d.ts +146 -67
  292. package/sdk/platform/User/UserPlatformApplicationClient.js +742 -155
  293. package/sdk/platform/User/UserPlatformApplicationValidator.d.ts +12 -7
  294. package/sdk/platform/User/UserPlatformApplicationValidator.js +61 -23
  295. package/sdk/platform/User/UserPlatformModel.d.ts +79 -72
  296. package/sdk/platform/User/UserPlatformModel.js +440 -689
  297. package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +35 -29
  298. package/sdk/platform/Webhook/WebhookPlatformClient.js +218 -91
  299. package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +7 -7
  300. package/sdk/platform/Webhook/WebhookPlatformModel.js +68 -136
  301. package/sdk/platform/Webhook/WebhookPlatformValidator.d.ts +3 -3
  302. package/sdk/platform/Webhook/WebhookPlatformValidator.js +14 -14
  303. package/sdk/public/Configuration/ConfigurationPublicClient.d.ts +13 -13
  304. package/sdk/public/Configuration/ConfigurationPublicClient.js +81 -38
  305. package/sdk/public/Configuration/ConfigurationPublicModel.d.ts +12 -12
  306. package/sdk/public/Configuration/ConfigurationPublicModel.js +85 -162
  307. package/sdk/public/Configuration/ConfigurationPublicValidator.d.ts +1 -1
  308. package/sdk/public/Configuration/ConfigurationPublicValidator.js +6 -6
  309. package/sdk/public/Inventory/InventoryPublicClient.d.ts +34 -34
  310. package/sdk/public/Inventory/InventoryPublicClient.js +228 -105
  311. package/sdk/public/Inventory/InventoryPublicModel.d.ts +10 -10
  312. package/sdk/public/Inventory/InventoryPublicModel.js +119 -245
  313. package/sdk/public/Inventory/InventoryPublicValidator.d.ts +3 -3
  314. package/sdk/public/Inventory/InventoryPublicValidator.js +15 -15
  315. package/sdk/public/Webhook/WebhookPublicClient.js +51 -10
  316. package/sdk/public/Webhook/WebhookPublicModel.d.ts +7 -7
  317. package/sdk/public/Webhook/WebhookPublicModel.js +68 -136
  318. package/tests/application/catalog.spec.js +7 -0
@@ -3,61 +3,63 @@ const constructUrl = require("../constructUrl");
3
3
  const Paginator = require("../../common/Paginator");
4
4
  const { FDKClientValidationError } = require("../../common/FDKError");
5
5
  const CatalogValidator = require("./CatalogApplicationValidator");
6
+ const CatalogModel = require("./CatalogApplicationModel");
7
+ const { Logger } = require("./../../common/Logger");
6
8
 
7
9
  class Catalog {
8
10
  constructor(_conf) {
9
11
  this._conf = _conf;
10
12
  this._relativeUrls = {
11
- getProductDetailBySlug:
12
- "/service/application/catalog/v1.0/products/{slug}/",
13
- getProductSizesBySlug:
14
- "/service/application/catalog/v1.0/products/{slug}/sizes/",
15
- getProductComparisonBySlugs:
16
- "/service/application/catalog/v1.0/products/compare/",
17
- getSimilarComparisonProductBySlug:
18
- "/service/application/catalog/v1.0/products/{slug}/similar/compare/",
19
- getComparedFrequentlyProductBySlug:
20
- "/service/application/catalog/v1.0/products/{slug}/similar/compared-frequently/",
21
- getProductVariantsBySlug:
22
- "/service/application/catalog/v1.0/products/{slug}/variants/",
23
- getProductStockByIds:
24
- "/service/application/catalog/v1.0/products/stock-status/",
25
- getProductStockForTimeByIds:
26
- "/service/application/catalog/v1.0/products/stock-status/poll/",
27
- getProducts: "/service/application/catalog/v1.0/products/",
28
- getBrands: "/service/application/catalog/v1.0/brands/",
13
+ followById:
14
+ "/service/application/catalog/v1.0/follow/{collection_type}/{collection_id}/",
29
15
  getBrandDetailBySlug: "/service/application/catalog/v1.0/brands/{slug}/",
16
+ getBrands: "/service/application/catalog/v1.0/brands/",
30
17
  getCategories: "/service/application/catalog/v1.0/categories/",
31
18
  getCategoryDetailBySlug:
32
19
  "/service/application/catalog/v1.0/categories/{slug}/",
33
- getHomeProducts: "/service/application/catalog/v1.0/home/listing/",
34
- getDepartments: "/service/application/catalog/v1.0/departments/",
35
- getSearchResults: "/service/application/catalog/v1.0/auto-complete/",
36
- getCollections: "/service/application/catalog/v1.0/collections/",
37
- getCollectionItemsBySlug:
38
- "/service/application/catalog/v1.0/collections/{slug}/items/",
39
20
  getCollectionDetailBySlug:
40
21
  "/service/application/catalog/v1.0/collections/{slug}/",
22
+ getCollectionItemsBySlug:
23
+ "/service/application/catalog/v1.0/collections/{slug}/items/",
24
+ getCollections: "/service/application/catalog/v1.0/collections/",
25
+ getComparedFrequentlyProductBySlug:
26
+ "/service/application/catalog/v1.0/products/{slug}/similar/compared-frequently/",
27
+ getDepartments: "/service/application/catalog/v1.0/departments/",
28
+ getFollowIds: "/service/application/catalog/v1.0/follow/ids/",
41
29
  getFollowedListing:
42
30
  "/service/application/catalog/v1.0/follow/{collection_type}/",
43
- followById:
44
- "/service/application/catalog/v1.0/follow/{collection_type}/{collection_id}/",
45
- unfollowById:
46
- "/service/application/catalog/v1.0/follow/{collection_type}/{collection_id}/",
47
31
  getFollowerCountById:
48
32
  "/service/application/catalog/v1.0/follow/{collection_type}/{collection_id}/count/",
49
- getFollowIds: "/service/application/catalog/v1.0/follow/ids/",
50
- getStores: "/service/application/catalog/v1.0/locations/",
33
+ getHomeProducts: "/service/application/catalog/v1.0/home/listing/",
51
34
  getInStockLocations:
52
35
  "/service/application/catalog/v1.0/in-stock/locations/",
53
36
  getLocationDetailsById:
54
37
  "/service/application/catalog/v1.0/locations/{location_id}/",
55
38
  getProductBundlesBySlug:
56
39
  "/service/application/catalog/v1.0/product-grouping/",
40
+ getProductComparisonBySlugs:
41
+ "/service/application/catalog/v1.0/products/compare/",
42
+ getProductDetailBySlug:
43
+ "/service/application/catalog/v1.0/products/{slug}/",
57
44
  getProductPriceBySlug:
58
45
  "/service/application/catalog/v3.0/products/{slug}/sizes/{size}/price/",
59
46
  getProductSellersBySlug:
60
47
  "/service/application/catalog/v3.0/products/{slug}/sizes/{size}/sellers/",
48
+ getProductSizesBySlug:
49
+ "/service/application/catalog/v1.0/products/{slug}/sizes/",
50
+ getProductStockByIds:
51
+ "/service/application/catalog/v1.0/products/stock-status/",
52
+ getProductStockForTimeByIds:
53
+ "/service/application/catalog/v1.0/products/stock-status/poll/",
54
+ getProductVariantsBySlug:
55
+ "/service/application/catalog/v1.0/products/{slug}/variants/",
56
+ getProducts: "/service/application/catalog/v1.0/products/",
57
+ getSearchResults: "/service/application/catalog/v1.0/auto-complete/",
58
+ getSimilarComparisonProductBySlug:
59
+ "/service/application/catalog/v1.0/products/{slug}/similar/compare/",
60
+ getStores: "/service/application/catalog/v1.0/locations/",
61
+ unfollowById:
62
+ "/service/application/catalog/v1.0/follow/{collection_type}/{collection_id}/",
61
63
  };
62
64
  this._urls = Object.entries(this._relativeUrls).reduce(
63
65
  (urls, [method, relativeUrl]) => {
@@ -77,16 +79,16 @@ class Catalog {
77
79
 
78
80
  /**
79
81
  * @param {Object} arg - Arg object.
80
- * @param {string} arg.slug - A short, human-readable, URL-friendly
81
- * identifier of a product. You can get slug value from the endpoint
82
- * /service/application/catalog/v1.0/products/
83
- * @returns {Promise<ProductDetail>} - Success response
84
- * @summary: Get a product
85
- * @description: Use this API to retrieve a product by its slug value.
82
+ * @param {string} arg.collectionType - Type of collection followed, i.e.
83
+ * products, brands, or collections.
84
+ * @param {string} arg.collectionId - The ID of the collection type.
85
+ * @returns {Promise<FollowPostResponse>} - Success response
86
+ * @summary: Follow an entity (product/brand/collection)
87
+ * @description: Follow a particular entity such as product, brand, collection specified by its ID.
86
88
  */
87
- getProductDetailBySlug({ slug } = {}) {
88
- const { error } = CatalogValidator.getProductDetailBySlug().validate(
89
- { slug },
89
+ async followById({ collectionType, collectionId } = {}) {
90
+ const { error } = CatalogValidator.followById().validate(
91
+ { collectionType, collectionId },
90
92
  { abortEarly: false, allowUnknown: true }
91
93
  );
92
94
  if (error) {
@@ -94,48 +96,64 @@ class Catalog {
94
96
  }
95
97
 
96
98
  // Showing warrnings if extra unknown parameters are found
97
- const {
98
- error: warrning,
99
- } = CatalogValidator.getProductDetailBySlug().validate(
100
- { slug },
99
+ const { error: warrning } = CatalogValidator.followById().validate(
100
+ { collectionType, collectionId },
101
101
  { abortEarly: false, allowUnknown: false }
102
102
  );
103
103
  if (warrning) {
104
- console.log("Parameter Validation warrnings for getProductDetailBySlug");
105
- console.log(warrning);
104
+ Logger({
105
+ level: "WARN",
106
+ message: "Parameter Validation warrnings for followById",
107
+ });
108
+ Logger({ level: "WARN", message: warrning });
106
109
  }
107
110
 
108
111
  const query_params = {};
109
112
 
110
113
  const xHeaders = {};
111
114
 
112
- return APIClient.execute(
115
+ const response = await APIClient.execute(
113
116
  this._conf,
114
- "get",
117
+ "post",
115
118
  constructUrl({
116
- url: this._urls["getProductDetailBySlug"],
117
- params: { slug },
119
+ url: this._urls["followById"],
120
+ params: { collectionType, collectionId },
118
121
  }),
119
122
  query_params,
120
123
  undefined,
121
124
  xHeaders
122
125
  );
126
+
127
+ const {
128
+ error: res_error,
129
+ } = CatalogModel.FollowPostResponse().validate(response, {
130
+ abortEarly: false,
131
+ allowUnknown: false,
132
+ });
133
+
134
+ if (res_error) {
135
+ Logger({
136
+ level: "WARN",
137
+ message: "Response Validation Warnnings for followById",
138
+ });
139
+ Logger({ level: "WARN", message: res_error });
140
+ }
141
+
142
+ return response;
123
143
  }
124
144
 
125
145
  /**
126
146
  * @param {Object} arg - Arg object.
127
147
  * @param {string} arg.slug - A short, human-readable, URL-friendly
128
- * identifier of a product. You can get slug value from the endpoint
129
- * /service/application/catalog/v1.0/products/
130
- * @param {number} [arg.storeId] - The ID of the store that is selling the
131
- * product, e.g. 1,2,3.
132
- * @returns {Promise<ProductSizes>} - Success response
133
- * @summary: Get the sizes of a product
134
- * @description: A product can have multiple sizes. Use this API to fetch all the available sizes of a product.
148
+ * identifier of a brand. You can get slug value from the endpoint
149
+ * /service/application/catalog/v1.0/brands/.
150
+ * @returns {Promise<BrandDetailResponse>} - Success response
151
+ * @summary: Get metadata of a brand
152
+ * @description: Fetch metadata of a brand such as name, information, logo, banner, etc.
135
153
  */
136
- getProductSizesBySlug({ slug, storeId } = {}) {
137
- const { error } = CatalogValidator.getProductSizesBySlug().validate(
138
- { slug, storeId },
154
+ async getBrandDetailBySlug({ slug } = {}) {
155
+ const { error } = CatalogValidator.getBrandDetailBySlug().validate(
156
+ { slug },
139
157
  { abortEarly: false, allowUnknown: true }
140
158
  );
141
159
  if (error) {
@@ -145,45 +163,68 @@ class Catalog {
145
163
  // Showing warrnings if extra unknown parameters are found
146
164
  const {
147
165
  error: warrning,
148
- } = CatalogValidator.getProductSizesBySlug().validate(
149
- { slug, storeId },
166
+ } = CatalogValidator.getBrandDetailBySlug().validate(
167
+ { slug },
150
168
  { abortEarly: false, allowUnknown: false }
151
169
  );
152
170
  if (warrning) {
153
- console.log("Parameter Validation warrnings for getProductSizesBySlug");
154
- console.log(warrning);
171
+ Logger({
172
+ level: "WARN",
173
+ message: "Parameter Validation warrnings for getBrandDetailBySlug",
174
+ });
175
+ Logger({ level: "WARN", message: warrning });
155
176
  }
156
177
 
157
178
  const query_params = {};
158
- query_params["store_id"] = storeId;
159
179
 
160
180
  const xHeaders = {};
161
181
 
162
- return APIClient.execute(
182
+ const response = await APIClient.execute(
163
183
  this._conf,
164
184
  "get",
165
185
  constructUrl({
166
- url: this._urls["getProductSizesBySlug"],
186
+ url: this._urls["getBrandDetailBySlug"],
167
187
  params: { slug },
168
188
  }),
169
189
  query_params,
170
190
  undefined,
171
191
  xHeaders
172
192
  );
193
+
194
+ const {
195
+ error: res_error,
196
+ } = CatalogModel.BrandDetailResponse().validate(response, {
197
+ abortEarly: false,
198
+ allowUnknown: false,
199
+ });
200
+
201
+ if (res_error) {
202
+ Logger({
203
+ level: "WARN",
204
+ message: "Response Validation Warnnings for getBrandDetailBySlug",
205
+ });
206
+ Logger({ level: "WARN", message: res_error });
207
+ }
208
+
209
+ return response;
173
210
  }
174
211
 
175
212
  /**
176
213
  * @param {Object} arg - Arg object.
177
- * @param {string[]} arg.slug - A short, human-readable, URL-friendly
178
- * identifier of a product. You can get slug value from the endpoint
179
- * /service/application/catalog/v1.0/products/.
180
- * @returns {Promise<ProductsComparisonResponse>} - Success response
181
- * @summary: Compare products
182
- * @description: Use this API to compare the features of products belonging to the same category. Note that at least one slug is mandatory in the request query.
214
+ * @param {string} [arg.department] - The name of the department. Use this
215
+ * parameter to filter products by a particular department. See the list
216
+ * of available departments below. Also, you can get available departments
217
+ * from the endpoint /service/application/catalog/v1.0/departments/
218
+ * @param {number} [arg.pageNo] - The page number to navigate through the
219
+ * given set of results.
220
+ * @param {number} [arg.pageSize] - The number of items to retrieve in each page.
221
+ * @returns {Promise<BrandListingResponse>} - Success response
222
+ * @summary: Get all the brands
223
+ * @description: A brand is the name under which a product is sold. Use this API to list all the brands. You can also filter the brands by department.
183
224
  */
184
- getProductComparisonBySlugs({ slug } = {}) {
185
- const { error } = CatalogValidator.getProductComparisonBySlugs().validate(
186
- { slug },
225
+ async getBrands({ department, pageNo, pageSize } = {}) {
226
+ const { error } = CatalogValidator.getBrands().validate(
227
+ { department, pageNo, pageSize },
187
228
  { abortEarly: false, allowUnknown: true }
188
229
  );
189
230
  if (error) {
@@ -191,51 +232,99 @@ class Catalog {
191
232
  }
192
233
 
193
234
  // Showing warrnings if extra unknown parameters are found
194
- const {
195
- error: warrning,
196
- } = CatalogValidator.getProductComparisonBySlugs().validate(
197
- { slug },
235
+ const { error: warrning } = CatalogValidator.getBrands().validate(
236
+ { department, pageNo, pageSize },
198
237
  { abortEarly: false, allowUnknown: false }
199
238
  );
200
239
  if (warrning) {
201
- console.log(
202
- "Parameter Validation warrnings for getProductComparisonBySlugs"
203
- );
204
- console.log(warrning);
240
+ Logger({
241
+ level: "WARN",
242
+ message: "Parameter Validation warrnings for getBrands",
243
+ });
244
+ Logger({ level: "WARN", message: warrning });
205
245
  }
206
246
 
207
247
  const query_params = {};
208
- query_params["slug"] = slug;
248
+ query_params["department"] = department;
249
+ query_params["page_no"] = pageNo;
250
+ query_params["page_size"] = pageSize;
209
251
 
210
252
  const xHeaders = {};
211
253
 
212
- return APIClient.execute(
254
+ const response = await APIClient.execute(
213
255
  this._conf,
214
256
  "get",
215
257
  constructUrl({
216
- url: this._urls["getProductComparisonBySlugs"],
258
+ url: this._urls["getBrands"],
217
259
  params: {},
218
260
  }),
219
261
  query_params,
220
262
  undefined,
221
263
  xHeaders
222
264
  );
265
+
266
+ const {
267
+ error: res_error,
268
+ } = CatalogModel.BrandListingResponse().validate(response, {
269
+ abortEarly: false,
270
+ allowUnknown: false,
271
+ });
272
+
273
+ if (res_error) {
274
+ Logger({
275
+ level: "WARN",
276
+ message: "Response Validation Warnnings for getBrands",
277
+ });
278
+ Logger({ level: "WARN", message: res_error });
279
+ }
280
+
281
+ return response;
223
282
  }
224
283
 
225
284
  /**
226
285
  * @param {Object} arg - Arg object.
227
- * @param {string} arg.slug - A short, human-readable, URL-friendly
228
- * identifier of a product. You can get slug value from the endpoint
229
- * /service/application/catalog/v1.0/products/
230
- * @returns {Promise<ProductCompareResponse>} - Success response
231
- * @summary: Get comparison between similar products
232
- * @description: Use this API to compare a given product automatically with similar products. Only one slug is needed.
286
+ * @param {string} [arg.department] - The name of the department. Use this
287
+ * parameter to filter products by a particular department. See the list
288
+ * of available departments below. Also, you can get available departments
289
+ * from the endpoint /service/application/catalog/v1.0/departments/
290
+ * @param {number} [arg.pageSize] - The number of items to retrieve in each page.
291
+ * @summary: Get all the brands
292
+ * @description: A brand is the name under which a product is sold. Use this API to list all the brands. You can also filter the brands by department.
233
293
  */
234
- getSimilarComparisonProductBySlug({ slug } = {}) {
235
- const {
236
- error,
237
- } = CatalogValidator.getSimilarComparisonProductBySlug().validate(
238
- { slug },
294
+ getBrandsPaginator({ department, pageSize } = {}) {
295
+ const paginator = new Paginator();
296
+ const callback = async () => {
297
+ const pageId = paginator.nextId;
298
+ const pageNo = paginator.pageNo;
299
+ const pageType = "number";
300
+ const data = await this.getBrands({
301
+ department: department,
302
+ pageNo: pageNo,
303
+ pageSize: pageSize,
304
+ });
305
+ paginator.setPaginator({
306
+ hasNext: data.page.has_next ? true : false,
307
+ nextId: data.page.next_id,
308
+ });
309
+ return data;
310
+ };
311
+ paginator.setCallback(callback);
312
+ return paginator;
313
+ }
314
+
315
+ /**
316
+ * @param {Object} arg - Arg object.
317
+ * @param {string} [arg.department] - The name of the department. Use this
318
+ * parameter to filter products by a particular department. See the list
319
+ * of available departments below. Also, you can get available departments
320
+ * from the endpoint /service/application/catalog/v1.0/departments/
321
+ * @returns {Promise<CategoryListingResponse>} - Success response
322
+ * @summary: List all the categories
323
+ * @description: Use this API to list all the categories. You can also filter the categories by department.
324
+ */
325
+ async getCategories({ department } = {}) {
326
+ const { error } = CatalogValidator.getCategories().validate(
327
+ { department },
239
328
  { abortEarly: false, allowUnknown: true }
240
329
  );
241
330
  if (error) {
@@ -243,49 +332,64 @@ class Catalog {
243
332
  }
244
333
 
245
334
  // Showing warrnings if extra unknown parameters are found
246
- const {
247
- error: warrning,
248
- } = CatalogValidator.getSimilarComparisonProductBySlug().validate(
249
- { slug },
335
+ const { error: warrning } = CatalogValidator.getCategories().validate(
336
+ { department },
250
337
  { abortEarly: false, allowUnknown: false }
251
338
  );
252
339
  if (warrning) {
253
- console.log(
254
- "Parameter Validation warrnings for getSimilarComparisonProductBySlug"
255
- );
256
- console.log(warrning);
340
+ Logger({
341
+ level: "WARN",
342
+ message: "Parameter Validation warrnings for getCategories",
343
+ });
344
+ Logger({ level: "WARN", message: warrning });
257
345
  }
258
346
 
259
347
  const query_params = {};
348
+ query_params["department"] = department;
260
349
 
261
350
  const xHeaders = {};
262
351
 
263
- return APIClient.execute(
352
+ const response = await APIClient.execute(
264
353
  this._conf,
265
354
  "get",
266
355
  constructUrl({
267
- url: this._urls["getSimilarComparisonProductBySlug"],
268
- params: { slug },
356
+ url: this._urls["getCategories"],
357
+ params: {},
269
358
  }),
270
359
  query_params,
271
360
  undefined,
272
361
  xHeaders
273
362
  );
363
+
364
+ const {
365
+ error: res_error,
366
+ } = CatalogModel.CategoryListingResponse().validate(response, {
367
+ abortEarly: false,
368
+ allowUnknown: false,
369
+ });
370
+
371
+ if (res_error) {
372
+ Logger({
373
+ level: "WARN",
374
+ message: "Response Validation Warnnings for getCategories",
375
+ });
376
+ Logger({ level: "WARN", message: res_error });
377
+ }
378
+
379
+ return response;
274
380
  }
275
381
 
276
382
  /**
277
383
  * @param {Object} arg - Arg object.
278
384
  * @param {string} arg.slug - A short, human-readable, URL-friendly
279
- * identifier of a product. You can get slug value from the endpoint
280
- * /service/application/catalog/v1.0/products/
281
- * @returns {Promise<ProductFrequentlyComparedSimilarResponse>} - Success response
282
- * @summary: Get comparison between frequently compared products with the given product
283
- * @description: Use this API to compare a given product automatically with products that are frequently compared with it. Only one slug is needed.
385
+ * identifier of a brand. You can get slug value from the endpoint
386
+ * /service/application/catalog/v1.0/brands/.
387
+ * @returns {Promise<CategoryMetaResponse>} - Success response
388
+ * @summary: Get metadata of a category
389
+ * @description: Fetch metadata of a category such as name, information, logo, banner, etc.
284
390
  */
285
- getComparedFrequentlyProductBySlug({ slug } = {}) {
286
- const {
287
- error,
288
- } = CatalogValidator.getComparedFrequentlyProductBySlug().validate(
391
+ async getCategoryDetailBySlug({ slug } = {}) {
392
+ const { error } = CatalogValidator.getCategoryDetailBySlug().validate(
289
393
  { slug },
290
394
  { abortEarly: false, allowUnknown: true }
291
395
  );
@@ -296,45 +400,63 @@ class Catalog {
296
400
  // Showing warrnings if extra unknown parameters are found
297
401
  const {
298
402
  error: warrning,
299
- } = CatalogValidator.getComparedFrequentlyProductBySlug().validate(
403
+ } = CatalogValidator.getCategoryDetailBySlug().validate(
300
404
  { slug },
301
405
  { abortEarly: false, allowUnknown: false }
302
406
  );
303
407
  if (warrning) {
304
- console.log(
305
- "Parameter Validation warrnings for getComparedFrequentlyProductBySlug"
306
- );
307
- console.log(warrning);
408
+ Logger({
409
+ level: "WARN",
410
+ message: "Parameter Validation warrnings for getCategoryDetailBySlug",
411
+ });
412
+ Logger({ level: "WARN", message: warrning });
308
413
  }
309
414
 
310
415
  const query_params = {};
311
416
 
312
417
  const xHeaders = {};
313
418
 
314
- return APIClient.execute(
419
+ const response = await APIClient.execute(
315
420
  this._conf,
316
421
  "get",
317
422
  constructUrl({
318
- url: this._urls["getComparedFrequentlyProductBySlug"],
423
+ url: this._urls["getCategoryDetailBySlug"],
319
424
  params: { slug },
320
425
  }),
321
426
  query_params,
322
427
  undefined,
323
428
  xHeaders
324
429
  );
430
+
431
+ const {
432
+ error: res_error,
433
+ } = CatalogModel.CategoryMetaResponse().validate(response, {
434
+ abortEarly: false,
435
+ allowUnknown: false,
436
+ });
437
+
438
+ if (res_error) {
439
+ Logger({
440
+ level: "WARN",
441
+ message: "Response Validation Warnnings for getCategoryDetailBySlug",
442
+ });
443
+ Logger({ level: "WARN", message: res_error });
444
+ }
445
+
446
+ return response;
325
447
  }
326
448
 
327
449
  /**
328
450
  * @param {Object} arg - Arg object.
329
451
  * @param {string} arg.slug - A short, human-readable, URL-friendly
330
- * identifier of a product. You can get slug value from the endpoint
331
- * /service/application/catalog/v1.0/products/
332
- * @returns {Promise<ProductVariantsResponse>} - Success response
333
- * @summary: Get variant of a particular product
334
- * @description: A product can have a different type of variants such as colour, shade, memory. Use this API to fetch all the available variants of a product using its slug.
452
+ * identifier of a collection. You can get slug value from the endpoint
453
+ * /service/application/catalog/v1.0/collections/.
454
+ * @returns {Promise<CollectionDetailResponse>} - Success response
455
+ * @summary: Get a particular collection
456
+ * @description: Get the details of a collection by its `slug`.
335
457
  */
336
- getProductVariantsBySlug({ slug } = {}) {
337
- const { error } = CatalogValidator.getProductVariantsBySlug().validate(
458
+ async getCollectionDetailBySlug({ slug } = {}) {
459
+ const { error } = CatalogValidator.getCollectionDetailBySlug().validate(
338
460
  { slug },
339
461
  { abortEarly: false, allowUnknown: true }
340
462
  );
@@ -345,176 +467,57 @@ class Catalog {
345
467
  // Showing warrnings if extra unknown parameters are found
346
468
  const {
347
469
  error: warrning,
348
- } = CatalogValidator.getProductVariantsBySlug().validate(
470
+ } = CatalogValidator.getCollectionDetailBySlug().validate(
349
471
  { slug },
350
472
  { abortEarly: false, allowUnknown: false }
351
473
  );
352
474
  if (warrning) {
353
- console.log(
354
- "Parameter Validation warrnings for getProductVariantsBySlug"
355
- );
356
- console.log(warrning);
475
+ Logger({
476
+ level: "WARN",
477
+ message: "Parameter Validation warrnings for getCollectionDetailBySlug",
478
+ });
479
+ Logger({ level: "WARN", message: warrning });
357
480
  }
358
481
 
359
482
  const query_params = {};
360
483
 
361
484
  const xHeaders = {};
362
485
 
363
- return APIClient.execute(
486
+ const response = await APIClient.execute(
364
487
  this._conf,
365
488
  "get",
366
489
  constructUrl({
367
- url: this._urls["getProductVariantsBySlug"],
490
+ url: this._urls["getCollectionDetailBySlug"],
368
491
  params: { slug },
369
492
  }),
370
493
  query_params,
371
494
  undefined,
372
495
  xHeaders
373
496
  );
374
- }
375
-
376
- /**
377
- * @param {Object} arg - Arg object.
378
- * @param {string} [arg.itemId] - The Item ID of the product (Max. 50 allowed)
379
- * @param {string} [arg.alu] - ALU of the product (limited upto 50 ALU
380
- * identifier in a single request)
381
- * @param {string} [arg.skuCode] - Stock-keeping Unit of the product
382
- * (limited upto 50 SKU Code in a single request)
383
- * @param {string} [arg.ean] - European Article Number of the product
384
- * (limited upto 50 EAN identifier in a single request)
385
- * @param {string} [arg.upc] - Universal Product Code of the product
386
- * (limited upto 50 UPC identifier in a single request)
387
- * @returns {Promise<ProductStockStatusResponse>} - Success response
388
- * @summary: Get the stock of a product
389
- * @description: Retrieve the available stock of the products. Use this API to retrieve stock of multiple products (up to 50) at a time.
390
- */
391
- getProductStockByIds({ itemId, alu, skuCode, ean, upc } = {}) {
392
- const { error } = CatalogValidator.getProductStockByIds().validate(
393
- { itemId, alu, skuCode, ean, upc },
394
- { abortEarly: false, allowUnknown: true }
395
- );
396
- if (error) {
397
- return Promise.reject(new FDKClientValidationError(error));
398
- }
399
-
400
- // Showing warrnings if extra unknown parameters are found
401
- const {
402
- error: warrning,
403
- } = CatalogValidator.getProductStockByIds().validate(
404
- { itemId, alu, skuCode, ean, upc },
405
- { abortEarly: false, allowUnknown: false }
406
- );
407
- if (warrning) {
408
- console.log("Parameter Validation warrnings for getProductStockByIds");
409
- console.log(warrning);
410
- }
411
-
412
- const query_params = {};
413
- query_params["item_id"] = itemId;
414
- query_params["alu"] = alu;
415
- query_params["sku_code"] = skuCode;
416
- query_params["ean"] = ean;
417
- query_params["upc"] = upc;
418
-
419
- const xHeaders = {};
420
-
421
- return APIClient.execute(
422
- this._conf,
423
- "get",
424
- constructUrl({
425
- url: this._urls["getProductStockByIds"],
426
- params: {},
427
- }),
428
- query_params,
429
- undefined,
430
- xHeaders
431
- );
432
- }
433
-
434
- /**
435
- * @param {Object} arg - Arg object.
436
- * @param {string} arg.timestamp - Timestamp in UTC format (2020-07-23T10:27:50Z)
437
- * @param {number} [arg.pageSize] - The number of items to retrieve in each page.
438
- * @param {string} [arg.pageId] - Page ID to retrieve next set of results.
439
- * @returns {Promise<ProductStockPolling>} - Success response
440
- * @summary: Get the stock of a product
441
- * @description: Retrieve the available stock of the products. Use this API to get the stock status of products whose inventory is updated at the specified time
442
- */
443
- getProductStockForTimeByIds({ timestamp, pageSize, pageId } = {}) {
444
- const { error } = CatalogValidator.getProductStockForTimeByIds().validate(
445
- { timestamp, pageSize, pageId },
446
- { abortEarly: false, allowUnknown: true }
447
- );
448
- if (error) {
449
- return Promise.reject(new FDKClientValidationError(error));
450
- }
451
497
 
452
- // Showing warrnings if extra unknown parameters are found
453
498
  const {
454
- error: warrning,
455
- } = CatalogValidator.getProductStockForTimeByIds().validate(
456
- { timestamp, pageSize, pageId },
457
- { abortEarly: false, allowUnknown: false }
458
- );
459
- if (warrning) {
460
- console.log(
461
- "Parameter Validation warrnings for getProductStockForTimeByIds"
462
- );
463
- console.log(warrning);
499
+ error: res_error,
500
+ } = CatalogModel.CollectionDetailResponse().validate(response, {
501
+ abortEarly: false,
502
+ allowUnknown: false,
503
+ });
504
+
505
+ if (res_error) {
506
+ Logger({
507
+ level: "WARN",
508
+ message: "Response Validation Warnnings for getCollectionDetailBySlug",
509
+ });
510
+ Logger({ level: "WARN", message: res_error });
464
511
  }
465
512
 
466
- const query_params = {};
467
- query_params["timestamp"] = timestamp;
468
- query_params["page_size"] = pageSize;
469
- query_params["page_id"] = pageId;
470
-
471
- const xHeaders = {};
472
-
473
- return APIClient.execute(
474
- this._conf,
475
- "get",
476
- constructUrl({
477
- url: this._urls["getProductStockForTimeByIds"],
478
- params: {},
479
- }),
480
- query_params,
481
- undefined,
482
- xHeaders
483
- );
484
- }
485
-
486
- /**
487
- * @param {Object} arg - Arg object.
488
- * @param {string} arg.timestamp - Timestamp in UTC format (2020-07-23T10:27:50Z)
489
- * @param {number} [arg.pageSize] - The number of items to retrieve in each page.
490
- * @summary: Get the stock of a product
491
- * @description: Retrieve the available stock of the products. Use this API to get the stock status of products whose inventory is updated at the specified time
492
- */
493
- getProductStockForTimeByIdsPaginator({ timestamp, pageSize } = {}) {
494
- const paginator = new Paginator();
495
- const callback = async () => {
496
- const pageId = paginator.nextId;
497
- const pageNo = paginator.pageNo;
498
- const pageType = "cursor";
499
- const data = await this.getProductStockForTimeByIds({
500
- timestamp: timestamp,
501
- pageSize: pageSize,
502
- pageId: pageId,
503
- });
504
- paginator.setPaginator({
505
- hasNext: data.page.has_next ? true : false,
506
- nextId: data.page.next_id,
507
- });
508
- return data;
509
- };
510
- paginator.setCallback(callback);
511
- return paginator;
513
+ return response;
512
514
  }
513
515
 
514
516
  /**
515
517
  * @param {Object} arg - Arg object.
516
- * @param {string} [arg.q] - The search query for entering partial or full
517
- * name of product, brand, category, or collection.
518
+ * @param {string} arg.slug - A short, human-readable, URL-friendly
519
+ * identifier of a collection. You can get slug value from the endpoint
520
+ * /service/application/catalog/v1.0/collections/.
518
521
  * @param {string} [arg.f] - The search filter parameters. Filter parameters
519
522
  * will be passed in f parameter as shown in the example below. Double
520
523
  * Pipe (||) denotes the OR condition, whereas Triple-colon (:::)
@@ -526,25 +529,20 @@ class Catalog {
526
529
  * either ascending or descending order. See the supported values below.
527
530
  * @param {string} [arg.pageId] - Page ID to retrieve next set of results.
528
531
  * @param {number} [arg.pageSize] - The number of items to retrieve in each page.
529
- * @param {number} [arg.pageNo] - The page number to navigate through the
530
- * given set of results.
531
- * @param {string} [arg.pageType] - Available pagination types are cursor or number.
532
532
  * @returns {Promise<ProductListingResponse>} - Success response
533
- * @summary: Get all the products
534
- * @description: Use this API to list all the products. You may choose a sort order or make arbitrary search queries by entering the product name, brand, category or collection.
533
+ * @summary: Get the items in a collection
534
+ * @description: Get items in a collection specified by its `slug`.
535
535
  */
536
- getProducts({
537
- q,
536
+ async getCollectionItemsBySlug({
537
+ slug,
538
538
  f,
539
539
  filters,
540
540
  sortOn,
541
541
  pageId,
542
542
  pageSize,
543
- pageNo,
544
- pageType,
545
543
  } = {}) {
546
- const { error } = CatalogValidator.getProducts().validate(
547
- { q, f, filters, sortOn, pageId, pageSize, pageNo, pageType },
544
+ const { error } = CatalogValidator.getCollectionItemsBySlug().validate(
545
+ { slug, f, filters, sortOn, pageId, pageSize },
548
546
  { abortEarly: false, allowUnknown: true }
549
547
  );
550
548
  if (error) {
@@ -552,44 +550,64 @@ class Catalog {
552
550
  }
553
551
 
554
552
  // Showing warrnings if extra unknown parameters are found
555
- const { error: warrning } = CatalogValidator.getProducts().validate(
556
- { q, f, filters, sortOn, pageId, pageSize, pageNo, pageType },
553
+ const {
554
+ error: warrning,
555
+ } = CatalogValidator.getCollectionItemsBySlug().validate(
556
+ { slug, f, filters, sortOn, pageId, pageSize },
557
557
  { abortEarly: false, allowUnknown: false }
558
558
  );
559
559
  if (warrning) {
560
- console.log("Parameter Validation warrnings for getProducts");
561
- console.log(warrning);
560
+ Logger({
561
+ level: "WARN",
562
+ message: "Parameter Validation warrnings for getCollectionItemsBySlug",
563
+ });
564
+ Logger({ level: "WARN", message: warrning });
562
565
  }
563
566
 
564
567
  const query_params = {};
565
- query_params["q"] = q;
566
568
  query_params["f"] = f;
567
569
  query_params["filters"] = filters;
568
570
  query_params["sort_on"] = sortOn;
569
571
  query_params["page_id"] = pageId;
570
572
  query_params["page_size"] = pageSize;
571
- query_params["page_no"] = pageNo;
572
- query_params["page_type"] = pageType;
573
573
 
574
574
  const xHeaders = {};
575
575
 
576
- return APIClient.execute(
576
+ const response = await APIClient.execute(
577
577
  this._conf,
578
578
  "get",
579
579
  constructUrl({
580
- url: this._urls["getProducts"],
581
- params: {},
580
+ url: this._urls["getCollectionItemsBySlug"],
581
+ params: { slug },
582
582
  }),
583
583
  query_params,
584
584
  undefined,
585
585
  xHeaders
586
586
  );
587
+
588
+ const {
589
+ error: res_error,
590
+ } = CatalogModel.ProductListingResponse().validate(response, {
591
+ abortEarly: false,
592
+ allowUnknown: false,
593
+ });
594
+
595
+ if (res_error) {
596
+ Logger({
597
+ level: "WARN",
598
+ message: "Response Validation Warnnings for getCollectionItemsBySlug",
599
+ });
600
+ Logger({ level: "WARN", message: res_error });
601
+ }
602
+
603
+ return response;
587
604
  }
588
605
 
589
606
  /**
590
607
  * @param {Object} arg - Arg object.
591
- * @param {string} [arg.q] - The search query for entering partial or full
592
- * name of product, brand, category, or collection.
608
+ * @param {string} arg.slug - A short, human-readable, URL-friendly
609
+ * identifier of a collection. You can get slug value from the endpoint
610
+ * /service/application/catalog/v1.0/collections/.
593
611
  * @param {string} [arg.f] - The search filter parameters. Filter parameters
594
612
  * will be passed in f parameter as shown in the example below. Double
595
613
  * Pipe (||) denotes the OR condition, whereas Triple-colon (:::)
@@ -600,24 +618,28 @@ class Catalog {
600
618
  * should be sorted, e.g. popularity, price, latest and discount, in
601
619
  * either ascending or descending order. See the supported values below.
602
620
  * @param {number} [arg.pageSize] - The number of items to retrieve in each page.
603
- * @summary: Get all the products
604
- * @description: Use this API to list all the products. You may choose a sort order or make arbitrary search queries by entering the product name, brand, category or collection.
621
+ * @summary: Get the items in a collection
622
+ * @description: Get items in a collection specified by its `slug`.
605
623
  */
606
- getProductsPaginator({ q, f, filters, sortOn, pageSize } = {}) {
624
+ getCollectionItemsBySlugPaginator({
625
+ slug,
626
+ f,
627
+ filters,
628
+ sortOn,
629
+ pageSize,
630
+ } = {}) {
607
631
  const paginator = new Paginator();
608
632
  const callback = async () => {
609
633
  const pageId = paginator.nextId;
610
634
  const pageNo = paginator.pageNo;
611
635
  const pageType = "cursor";
612
- const data = await this.getProducts({
613
- q: q,
636
+ const data = await this.getCollectionItemsBySlug({
637
+ slug: slug,
614
638
  f: f,
615
639
  filters: filters,
616
640
  sortOn: sortOn,
617
641
  pageId: pageId,
618
642
  pageSize: pageSize,
619
- pageNo: pageNo,
620
- pageType: pageType,
621
643
  });
622
644
  paginator.setPaginator({
623
645
  hasNext: data.page.has_next ? true : false,
@@ -631,20 +653,17 @@ class Catalog {
631
653
 
632
654
  /**
633
655
  * @param {Object} arg - Arg object.
634
- * @param {string} [arg.department] - The name of the department. Use this
635
- * parameter to filter products by a particular department. See the list
636
- * of available departments below. Also, you can get available departments
637
- * from the endpoint /service/application/catalog/v1.0/departments/
638
656
  * @param {number} [arg.pageNo] - The page number to navigate through the
639
657
  * given set of results.
640
658
  * @param {number} [arg.pageSize] - The number of items to retrieve in each page.
641
- * @returns {Promise<BrandListingResponse>} - Success response
642
- * @summary: Get all the brands
643
- * @description: A brand is the name under which a product is sold. Use this API to list all the brands. You can also filter the brands by department.
659
+ * @param {string[]} [arg.tag] - List of tags to filter collections
660
+ * @returns {Promise<GetCollectionListingResponse>} - Success response
661
+ * @summary: List all the collections
662
+ * @description: Collections are a great way to organize your products and can improve the ability for customers to find items quickly and efficiently.
644
663
  */
645
- getBrands({ department, pageNo, pageSize } = {}) {
646
- const { error } = CatalogValidator.getBrands().validate(
647
- { department, pageNo, pageSize },
664
+ async getCollections({ pageNo, pageSize, tag } = {}) {
665
+ const { error } = CatalogValidator.getCollections().validate(
666
+ { pageNo, pageSize, tag },
648
667
  { abortEarly: false, allowUnknown: true }
649
668
  );
650
669
  if (error) {
@@ -652,55 +671,72 @@ class Catalog {
652
671
  }
653
672
 
654
673
  // Showing warrnings if extra unknown parameters are found
655
- const { error: warrning } = CatalogValidator.getBrands().validate(
656
- { department, pageNo, pageSize },
674
+ const { error: warrning } = CatalogValidator.getCollections().validate(
675
+ { pageNo, pageSize, tag },
657
676
  { abortEarly: false, allowUnknown: false }
658
677
  );
659
678
  if (warrning) {
660
- console.log("Parameter Validation warrnings for getBrands");
661
- console.log(warrning);
679
+ Logger({
680
+ level: "WARN",
681
+ message: "Parameter Validation warrnings for getCollections",
682
+ });
683
+ Logger({ level: "WARN", message: warrning });
662
684
  }
663
685
 
664
686
  const query_params = {};
665
- query_params["department"] = department;
666
687
  query_params["page_no"] = pageNo;
667
688
  query_params["page_size"] = pageSize;
689
+ query_params["tag"] = tag;
668
690
 
669
691
  const xHeaders = {};
670
692
 
671
- return APIClient.execute(
693
+ const response = await APIClient.execute(
672
694
  this._conf,
673
695
  "get",
674
696
  constructUrl({
675
- url: this._urls["getBrands"],
697
+ url: this._urls["getCollections"],
676
698
  params: {},
677
699
  }),
678
700
  query_params,
679
701
  undefined,
680
702
  xHeaders
681
703
  );
704
+
705
+ const {
706
+ error: res_error,
707
+ } = CatalogModel.GetCollectionListingResponse().validate(response, {
708
+ abortEarly: false,
709
+ allowUnknown: false,
710
+ });
711
+
712
+ if (res_error) {
713
+ Logger({
714
+ level: "WARN",
715
+ message: "Response Validation Warnnings for getCollections",
716
+ });
717
+ Logger({ level: "WARN", message: res_error });
718
+ }
719
+
720
+ return response;
682
721
  }
683
722
 
684
723
  /**
685
724
  * @param {Object} arg - Arg object.
686
- * @param {string} [arg.department] - The name of the department. Use this
687
- * parameter to filter products by a particular department. See the list
688
- * of available departments below. Also, you can get available departments
689
- * from the endpoint /service/application/catalog/v1.0/departments/
690
725
  * @param {number} [arg.pageSize] - The number of items to retrieve in each page.
691
- * @summary: Get all the brands
692
- * @description: A brand is the name under which a product is sold. Use this API to list all the brands. You can also filter the brands by department.
726
+ * @param {string[]} [arg.tag] - List of tags to filter collections
727
+ * @summary: List all the collections
728
+ * @description: Collections are a great way to organize your products and can improve the ability for customers to find items quickly and efficiently.
693
729
  */
694
- getBrandsPaginator({ department, pageSize } = {}) {
730
+ getCollectionsPaginator({ pageSize, tag } = {}) {
695
731
  const paginator = new Paginator();
696
732
  const callback = async () => {
697
733
  const pageId = paginator.nextId;
698
734
  const pageNo = paginator.pageNo;
699
735
  const pageType = "number";
700
- const data = await this.getBrands({
701
- department: department,
736
+ const data = await this.getCollections({
702
737
  pageNo: pageNo,
703
738
  pageSize: pageSize,
739
+ tag: tag,
704
740
  });
705
741
  paginator.setPaginator({
706
742
  hasNext: data.page.has_next ? true : false,
@@ -715,15 +751,17 @@ class Catalog {
715
751
  /**
716
752
  * @param {Object} arg - Arg object.
717
753
  * @param {string} arg.slug - A short, human-readable, URL-friendly
718
- * identifier of a brand. You can get slug value from the endpoint
719
- * /service/application/catalog/v1.0/brands/.
720
- * @returns {Promise<BrandDetailResponse>} - Success response
721
- * @summary: Get metadata of a brand
722
- * @description: Fetch metadata of a brand such as name, information, logo, banner, etc.
754
+ * identifier of a product. You can get slug value from the endpoint
755
+ * /service/application/catalog/v1.0/products/
756
+ * @returns {Promise<ProductFrequentlyComparedSimilarResponse>} - Success response
757
+ * @summary: Get comparison between frequently compared products with the given product
758
+ * @description: Use this API to compare a given product automatically with products that are frequently compared with it. Only one slug is needed.
723
759
  */
724
- getBrandDetailBySlug({ slug } = {}) {
725
- const { error } = CatalogValidator.getBrandDetailBySlug().validate(
726
- { slug },
760
+ async getComparedFrequentlyProductBySlug({ slug } = {}) {
761
+ const {
762
+ error,
763
+ } = CatalogValidator.getComparedFrequentlyProductBySlug().validate(
764
+ { slug },
727
765
  { abortEarly: false, allowUnknown: true }
728
766
  );
729
767
  if (error) {
@@ -733,45 +771,63 @@ class Catalog {
733
771
  // Showing warrnings if extra unknown parameters are found
734
772
  const {
735
773
  error: warrning,
736
- } = CatalogValidator.getBrandDetailBySlug().validate(
774
+ } = CatalogValidator.getComparedFrequentlyProductBySlug().validate(
737
775
  { slug },
738
776
  { abortEarly: false, allowUnknown: false }
739
777
  );
740
778
  if (warrning) {
741
- console.log("Parameter Validation warrnings for getBrandDetailBySlug");
742
- console.log(warrning);
779
+ Logger({
780
+ level: "WARN",
781
+ message:
782
+ "Parameter Validation warrnings for getComparedFrequentlyProductBySlug",
783
+ });
784
+ Logger({ level: "WARN", message: warrning });
743
785
  }
744
786
 
745
787
  const query_params = {};
746
788
 
747
789
  const xHeaders = {};
748
790
 
749
- return APIClient.execute(
791
+ const response = await APIClient.execute(
750
792
  this._conf,
751
793
  "get",
752
794
  constructUrl({
753
- url: this._urls["getBrandDetailBySlug"],
795
+ url: this._urls["getComparedFrequentlyProductBySlug"],
754
796
  params: { slug },
755
797
  }),
756
798
  query_params,
757
799
  undefined,
758
800
  xHeaders
759
801
  );
802
+
803
+ const {
804
+ error: res_error,
805
+ } = CatalogModel.ProductFrequentlyComparedSimilarResponse().validate(
806
+ response,
807
+ { abortEarly: false, allowUnknown: false }
808
+ );
809
+
810
+ if (res_error) {
811
+ Logger({
812
+ level: "WARN",
813
+ message:
814
+ "Response Validation Warnnings for getComparedFrequentlyProductBySlug",
815
+ });
816
+ Logger({ level: "WARN", message: res_error });
817
+ }
818
+
819
+ return response;
760
820
  }
761
821
 
762
822
  /**
763
823
  * @param {Object} arg - Arg object.
764
- * @param {string} [arg.department] - The name of the department. Use this
765
- * parameter to filter products by a particular department. See the list
766
- * of available departments below. Also, you can get available departments
767
- * from the endpoint /service/application/catalog/v1.0/departments/
768
- * @returns {Promise<CategoryListingResponse>} - Success response
769
- * @summary: List all the categories
770
- * @description: Use this API to list all the categories. You can also filter the categories by department.
824
+ * @returns {Promise<DepartmentResponse>} - Success response
825
+ * @summary: List all the departments
826
+ * @description: Departments are a way to categorise similar products. A product can lie in multiple departments. For example, a skirt can below to the 'Women's Fashion' Department while a handbag can lie in 'Women's Accessories' Department. Use this API to list all the departments. If successful, returns the list of departments specified in `DepartmentResponse`
771
827
  */
772
- getCategories({ department } = {}) {
773
- const { error } = CatalogValidator.getCategories().validate(
774
- { department },
828
+ async getDepartments({} = {}) {
829
+ const { error } = CatalogValidator.getDepartments().validate(
830
+ {},
775
831
  { abortEarly: false, allowUnknown: true }
776
832
  );
777
833
  if (error) {
@@ -779,45 +835,63 @@ class Catalog {
779
835
  }
780
836
 
781
837
  // Showing warrnings if extra unknown parameters are found
782
- const { error: warrning } = CatalogValidator.getCategories().validate(
783
- { department },
838
+ const { error: warrning } = CatalogValidator.getDepartments().validate(
839
+ {},
784
840
  { abortEarly: false, allowUnknown: false }
785
841
  );
786
842
  if (warrning) {
787
- console.log("Parameter Validation warrnings for getCategories");
788
- console.log(warrning);
843
+ Logger({
844
+ level: "WARN",
845
+ message: "Parameter Validation warrnings for getDepartments",
846
+ });
847
+ Logger({ level: "WARN", message: warrning });
789
848
  }
790
849
 
791
850
  const query_params = {};
792
- query_params["department"] = department;
793
851
 
794
852
  const xHeaders = {};
795
853
 
796
- return APIClient.execute(
854
+ const response = await APIClient.execute(
797
855
  this._conf,
798
856
  "get",
799
857
  constructUrl({
800
- url: this._urls["getCategories"],
858
+ url: this._urls["getDepartments"],
801
859
  params: {},
802
860
  }),
803
861
  query_params,
804
862
  undefined,
805
863
  xHeaders
806
864
  );
865
+
866
+ const {
867
+ error: res_error,
868
+ } = CatalogModel.DepartmentResponse().validate(response, {
869
+ abortEarly: false,
870
+ allowUnknown: false,
871
+ });
872
+
873
+ if (res_error) {
874
+ Logger({
875
+ level: "WARN",
876
+ message: "Response Validation Warnnings for getDepartments",
877
+ });
878
+ Logger({ level: "WARN", message: res_error });
879
+ }
880
+
881
+ return response;
807
882
  }
808
883
 
809
884
  /**
810
885
  * @param {Object} arg - Arg object.
811
- * @param {string} arg.slug - A short, human-readable, URL-friendly
812
- * identifier of a brand. You can get slug value from the endpoint
813
- * /service/application/catalog/v1.0/brands/.
814
- * @returns {Promise<CategoryMetaResponse>} - Success response
815
- * @summary: Get metadata of a category
816
- * @description: Fetch metadata of a category such as name, information, logo, banner, etc.
886
+ * @param {string} [arg.collectionType] - Type of collection, i.e. products,
887
+ * brands, collections.
888
+ * @returns {Promise<FollowIdsResponse>} - Success response
889
+ * @summary: Get the IDs of followed products, brands and collections.
890
+ * @description: You can get the IDs of all the followed Products, Brands and Collections. Pass collection_type as query parameter to fetch specific Ids
817
891
  */
818
- getCategoryDetailBySlug({ slug } = {}) {
819
- const { error } = CatalogValidator.getCategoryDetailBySlug().validate(
820
- { slug },
892
+ async getFollowIds({ collectionType } = {}) {
893
+ const { error } = CatalogValidator.getFollowIds().validate(
894
+ { collectionType },
821
895
  { abortEarly: false, allowUnknown: true }
822
896
  );
823
897
  if (error) {
@@ -825,48 +899,66 @@ class Catalog {
825
899
  }
826
900
 
827
901
  // Showing warrnings if extra unknown parameters are found
828
- const {
829
- error: warrning,
830
- } = CatalogValidator.getCategoryDetailBySlug().validate(
831
- { slug },
902
+ const { error: warrning } = CatalogValidator.getFollowIds().validate(
903
+ { collectionType },
832
904
  { abortEarly: false, allowUnknown: false }
833
905
  );
834
906
  if (warrning) {
835
- console.log("Parameter Validation warrnings for getCategoryDetailBySlug");
836
- console.log(warrning);
907
+ Logger({
908
+ level: "WARN",
909
+ message: "Parameter Validation warrnings for getFollowIds",
910
+ });
911
+ Logger({ level: "WARN", message: warrning });
837
912
  }
838
913
 
839
914
  const query_params = {};
915
+ query_params["collection_type"] = collectionType;
840
916
 
841
917
  const xHeaders = {};
842
918
 
843
- return APIClient.execute(
919
+ const response = await APIClient.execute(
844
920
  this._conf,
845
921
  "get",
846
922
  constructUrl({
847
- url: this._urls["getCategoryDetailBySlug"],
848
- params: { slug },
923
+ url: this._urls["getFollowIds"],
924
+ params: {},
849
925
  }),
850
926
  query_params,
851
927
  undefined,
852
928
  xHeaders
853
929
  );
930
+
931
+ const {
932
+ error: res_error,
933
+ } = CatalogModel.FollowIdsResponse().validate(response, {
934
+ abortEarly: false,
935
+ allowUnknown: false,
936
+ });
937
+
938
+ if (res_error) {
939
+ Logger({
940
+ level: "WARN",
941
+ message: "Response Validation Warnnings for getFollowIds",
942
+ });
943
+ Logger({ level: "WARN", message: res_error });
944
+ }
945
+
946
+ return response;
854
947
  }
855
948
 
856
949
  /**
857
950
  * @param {Object} arg - Arg object.
858
- * @param {string} [arg.sortOn] - The order in which the list of products
859
- * should be sorted, e.g. popularity, price, latest and discount, in
860
- * either ascending or descending order.
951
+ * @param {string} arg.collectionType - Type of collection followed, i.e.
952
+ * products, brands, or collections.
861
953
  * @param {string} [arg.pageId] - Page ID to retrieve next set of results.
862
- * @param {number} [arg.pageSize] - The number of items to retrieve in each page.
863
- * @returns {Promise<HomeListingResponse>} - Success response
864
- * @summary: List the products
865
- * @description: List all the products associated with a brand, collection or category in a random order.
954
+ * @param {number} [arg.pageSize] - Page ID to retrieve next set of results.
955
+ * @returns {Promise<GetFollowListingResponse>} - Success response
956
+ * @summary: Get a list of followed Products, Brands, Collections
957
+ * @description: Users can follow a product they like. This API retrieves the products the user have followed.
866
958
  */
867
- getHomeProducts({ sortOn, pageId, pageSize } = {}) {
868
- const { error } = CatalogValidator.getHomeProducts().validate(
869
- { sortOn, pageId, pageSize },
959
+ async getFollowedListing({ collectionType, pageId, pageSize } = {}) {
960
+ const { error } = CatalogValidator.getFollowedListing().validate(
961
+ { collectionType, pageId, pageSize },
870
962
  { abortEarly: false, allowUnknown: true }
871
963
  );
872
964
  if (error) {
@@ -874,52 +966,70 @@ class Catalog {
874
966
  }
875
967
 
876
968
  // Showing warrnings if extra unknown parameters are found
877
- const { error: warrning } = CatalogValidator.getHomeProducts().validate(
878
- { sortOn, pageId, pageSize },
969
+ const { error: warrning } = CatalogValidator.getFollowedListing().validate(
970
+ { collectionType, pageId, pageSize },
879
971
  { abortEarly: false, allowUnknown: false }
880
972
  );
881
973
  if (warrning) {
882
- console.log("Parameter Validation warrnings for getHomeProducts");
883
- console.log(warrning);
974
+ Logger({
975
+ level: "WARN",
976
+ message: "Parameter Validation warrnings for getFollowedListing",
977
+ });
978
+ Logger({ level: "WARN", message: warrning });
884
979
  }
885
980
 
886
981
  const query_params = {};
887
- query_params["sort_on"] = sortOn;
888
982
  query_params["page_id"] = pageId;
889
983
  query_params["page_size"] = pageSize;
890
984
 
891
985
  const xHeaders = {};
892
986
 
893
- return APIClient.execute(
987
+ const response = await APIClient.execute(
894
988
  this._conf,
895
989
  "get",
896
990
  constructUrl({
897
- url: this._urls["getHomeProducts"],
898
- params: {},
991
+ url: this._urls["getFollowedListing"],
992
+ params: { collectionType },
899
993
  }),
900
994
  query_params,
901
995
  undefined,
902
996
  xHeaders
903
997
  );
998
+
999
+ const {
1000
+ error: res_error,
1001
+ } = CatalogModel.GetFollowListingResponse().validate(response, {
1002
+ abortEarly: false,
1003
+ allowUnknown: false,
1004
+ });
1005
+
1006
+ if (res_error) {
1007
+ Logger({
1008
+ level: "WARN",
1009
+ message: "Response Validation Warnnings for getFollowedListing",
1010
+ });
1011
+ Logger({ level: "WARN", message: res_error });
1012
+ }
1013
+
1014
+ return response;
904
1015
  }
905
1016
 
906
1017
  /**
907
1018
  * @param {Object} arg - Arg object.
908
- * @param {string} [arg.sortOn] - The order in which the list of products
909
- * should be sorted, e.g. popularity, price, latest and discount, in
910
- * either ascending or descending order.
911
- * @param {number} [arg.pageSize] - The number of items to retrieve in each page.
912
- * @summary: List the products
913
- * @description: List all the products associated with a brand, collection or category in a random order.
1019
+ * @param {string} arg.collectionType - Type of collection followed, i.e.
1020
+ * products, brands, or collections.
1021
+ * @param {number} [arg.pageSize] - Page ID to retrieve next set of results.
1022
+ * @summary: Get a list of followed Products, Brands, Collections
1023
+ * @description: Users can follow a product they like. This API retrieves the products the user have followed.
914
1024
  */
915
- getHomeProductsPaginator({ sortOn, pageSize } = {}) {
1025
+ getFollowedListingPaginator({ collectionType, pageSize } = {}) {
916
1026
  const paginator = new Paginator();
917
1027
  const callback = async () => {
918
1028
  const pageId = paginator.nextId;
919
1029
  const pageNo = paginator.pageNo;
920
1030
  const pageType = "cursor";
921
- const data = await this.getHomeProducts({
922
- sortOn: sortOn,
1031
+ const data = await this.getFollowedListing({
1032
+ collectionType: collectionType,
923
1033
  pageId: pageId,
924
1034
  pageSize: pageSize,
925
1035
  });
@@ -935,13 +1045,16 @@ class Catalog {
935
1045
 
936
1046
  /**
937
1047
  * @param {Object} arg - Arg object.
938
- * @returns {Promise<DepartmentResponse>} - Success response
939
- * @summary: List all the departments
940
- * @description: Departments are a way to categorise similar products. A product can lie in multiple departments. For example, a skirt can below to the 'Women's Fashion' Department while a handbag can lie in 'Women's Accessories' Department. Use this API to list all the departments. If successful, returns the list of departments specified in `DepartmentResponse`
1048
+ * @param {string} arg.collectionType - Type of collection, i.e. products,
1049
+ * brands, or collections.
1050
+ * @param {string} arg.collectionId - The ID of the collection type.
1051
+ * @returns {Promise<FollowerCountResponse>} - Success response
1052
+ * @summary: Get Follow Count
1053
+ * @description: Get the total count of followers for a given collection type and collection ID.
941
1054
  */
942
- getDepartments({} = {}) {
943
- const { error } = CatalogValidator.getDepartments().validate(
944
- {},
1055
+ async getFollowerCountById({ collectionType, collectionId } = {}) {
1056
+ const { error } = CatalogValidator.getFollowerCountById().validate(
1057
+ { collectionType, collectionId },
945
1058
  { abortEarly: false, allowUnknown: true }
946
1059
  );
947
1060
  if (error) {
@@ -949,92 +1062,68 @@ class Catalog {
949
1062
  }
950
1063
 
951
1064
  // Showing warrnings if extra unknown parameters are found
952
- const { error: warrning } = CatalogValidator.getDepartments().validate(
953
- {},
1065
+ const {
1066
+ error: warrning,
1067
+ } = CatalogValidator.getFollowerCountById().validate(
1068
+ { collectionType, collectionId },
954
1069
  { abortEarly: false, allowUnknown: false }
955
1070
  );
956
1071
  if (warrning) {
957
- console.log("Parameter Validation warrnings for getDepartments");
958
- console.log(warrning);
1072
+ Logger({
1073
+ level: "WARN",
1074
+ message: "Parameter Validation warrnings for getFollowerCountById",
1075
+ });
1076
+ Logger({ level: "WARN", message: warrning });
959
1077
  }
960
1078
 
961
1079
  const query_params = {};
962
1080
 
963
1081
  const xHeaders = {};
964
1082
 
965
- return APIClient.execute(
1083
+ const response = await APIClient.execute(
966
1084
  this._conf,
967
1085
  "get",
968
1086
  constructUrl({
969
- url: this._urls["getDepartments"],
970
- params: {},
1087
+ url: this._urls["getFollowerCountById"],
1088
+ params: { collectionType, collectionId },
971
1089
  }),
972
1090
  query_params,
973
1091
  undefined,
974
1092
  xHeaders
975
1093
  );
976
- }
977
-
978
- /**
979
- * @param {Object} arg - Arg object.
980
- * @param {string} arg.q - The search query for entering partial or full
981
- * name of a product, brand or category. For example, if the given search
982
- * query `q` is _ski_, the relevant search suggestions could be _skirt_,
983
- * _ski shoes_, __skin cream_ etc.
984
- * @returns {Promise<AutoCompleteResponse>} - Success response
985
- * @summary: Get relevant suggestions for a search query
986
- * @description: Retrieves a list of suggestions for a given search query. Each suggestion is a valid search term that's generated on the basis of query. This is particularly useful to enhance the user experience while using the search tool.
987
- */
988
- getSearchResults({ q } = {}) {
989
- const { error } = CatalogValidator.getSearchResults().validate(
990
- { q },
991
- { abortEarly: false, allowUnknown: true }
992
- );
993
- if (error) {
994
- return Promise.reject(new FDKClientValidationError(error));
995
- }
996
1094
 
997
- // Showing warrnings if extra unknown parameters are found
998
- const { error: warrning } = CatalogValidator.getSearchResults().validate(
999
- { q },
1000
- { abortEarly: false, allowUnknown: false }
1001
- );
1002
- if (warrning) {
1003
- console.log("Parameter Validation warrnings for getSearchResults");
1004
- console.log(warrning);
1095
+ const {
1096
+ error: res_error,
1097
+ } = CatalogModel.FollowerCountResponse().validate(response, {
1098
+ abortEarly: false,
1099
+ allowUnknown: false,
1100
+ });
1101
+
1102
+ if (res_error) {
1103
+ Logger({
1104
+ level: "WARN",
1105
+ message: "Response Validation Warnnings for getFollowerCountById",
1106
+ });
1107
+ Logger({ level: "WARN", message: res_error });
1005
1108
  }
1006
1109
 
1007
- const query_params = {};
1008
- query_params["q"] = q;
1009
-
1010
- const xHeaders = {};
1011
-
1012
- return APIClient.execute(
1013
- this._conf,
1014
- "get",
1015
- constructUrl({
1016
- url: this._urls["getSearchResults"],
1017
- params: {},
1018
- }),
1019
- query_params,
1020
- undefined,
1021
- xHeaders
1022
- );
1110
+ return response;
1023
1111
  }
1024
1112
 
1025
1113
  /**
1026
1114
  * @param {Object} arg - Arg object.
1027
- * @param {number} [arg.pageNo] - The page number to navigate through the
1028
- * given set of results.
1115
+ * @param {string} [arg.sortOn] - The order in which the list of products
1116
+ * should be sorted, e.g. popularity, price, latest and discount, in
1117
+ * either ascending or descending order.
1118
+ * @param {string} [arg.pageId] - Page ID to retrieve next set of results.
1029
1119
  * @param {number} [arg.pageSize] - The number of items to retrieve in each page.
1030
- * @param {string[]} [arg.tag] - List of tags to filter collections
1031
- * @returns {Promise<GetCollectionListingResponse>} - Success response
1032
- * @summary: List all the collections
1033
- * @description: Collections are a great way to organize your products and can improve the ability for customers to find items quickly and efficiently.
1120
+ * @returns {Promise<HomeListingResponse>} - Success response
1121
+ * @summary: List the products
1122
+ * @description: List all the products associated with a brand, collection or category in a random order.
1034
1123
  */
1035
- getCollections({ pageNo, pageSize, tag } = {}) {
1036
- const { error } = CatalogValidator.getCollections().validate(
1037
- { pageNo, pageSize, tag },
1124
+ async getHomeProducts({ sortOn, pageId, pageSize } = {}) {
1125
+ const { error } = CatalogValidator.getHomeProducts().validate(
1126
+ { sortOn, pageId, pageSize },
1038
1127
  { abortEarly: false, allowUnknown: true }
1039
1128
  );
1040
1129
  if (error) {
@@ -1042,52 +1131,74 @@ class Catalog {
1042
1131
  }
1043
1132
 
1044
1133
  // Showing warrnings if extra unknown parameters are found
1045
- const { error: warrning } = CatalogValidator.getCollections().validate(
1046
- { pageNo, pageSize, tag },
1134
+ const { error: warrning } = CatalogValidator.getHomeProducts().validate(
1135
+ { sortOn, pageId, pageSize },
1047
1136
  { abortEarly: false, allowUnknown: false }
1048
1137
  );
1049
1138
  if (warrning) {
1050
- console.log("Parameter Validation warrnings for getCollections");
1051
- console.log(warrning);
1139
+ Logger({
1140
+ level: "WARN",
1141
+ message: "Parameter Validation warrnings for getHomeProducts",
1142
+ });
1143
+ Logger({ level: "WARN", message: warrning });
1052
1144
  }
1053
1145
 
1054
1146
  const query_params = {};
1055
- query_params["page_no"] = pageNo;
1147
+ query_params["sort_on"] = sortOn;
1148
+ query_params["page_id"] = pageId;
1056
1149
  query_params["page_size"] = pageSize;
1057
- query_params["tag"] = tag;
1058
1150
 
1059
1151
  const xHeaders = {};
1060
1152
 
1061
- return APIClient.execute(
1153
+ const response = await APIClient.execute(
1062
1154
  this._conf,
1063
1155
  "get",
1064
1156
  constructUrl({
1065
- url: this._urls["getCollections"],
1157
+ url: this._urls["getHomeProducts"],
1066
1158
  params: {},
1067
1159
  }),
1068
1160
  query_params,
1069
1161
  undefined,
1070
1162
  xHeaders
1071
1163
  );
1164
+
1165
+ const {
1166
+ error: res_error,
1167
+ } = CatalogModel.HomeListingResponse().validate(response, {
1168
+ abortEarly: false,
1169
+ allowUnknown: false,
1170
+ });
1171
+
1172
+ if (res_error) {
1173
+ Logger({
1174
+ level: "WARN",
1175
+ message: "Response Validation Warnnings for getHomeProducts",
1176
+ });
1177
+ Logger({ level: "WARN", message: res_error });
1178
+ }
1179
+
1180
+ return response;
1072
1181
  }
1073
1182
 
1074
1183
  /**
1075
1184
  * @param {Object} arg - Arg object.
1185
+ * @param {string} [arg.sortOn] - The order in which the list of products
1186
+ * should be sorted, e.g. popularity, price, latest and discount, in
1187
+ * either ascending or descending order.
1076
1188
  * @param {number} [arg.pageSize] - The number of items to retrieve in each page.
1077
- * @param {string[]} [arg.tag] - List of tags to filter collections
1078
- * @summary: List all the collections
1079
- * @description: Collections are a great way to organize your products and can improve the ability for customers to find items quickly and efficiently.
1189
+ * @summary: List the products
1190
+ * @description: List all the products associated with a brand, collection or category in a random order.
1080
1191
  */
1081
- getCollectionsPaginator({ pageSize, tag } = {}) {
1192
+ getHomeProductsPaginator({ sortOn, pageSize } = {}) {
1082
1193
  const paginator = new Paginator();
1083
1194
  const callback = async () => {
1084
1195
  const pageId = paginator.nextId;
1085
1196
  const pageNo = paginator.pageNo;
1086
- const pageType = "number";
1087
- const data = await this.getCollections({
1088
- pageNo: pageNo,
1197
+ const pageType = "cursor";
1198
+ const data = await this.getHomeProducts({
1199
+ sortOn: sortOn,
1200
+ pageId: pageId,
1089
1201
  pageSize: pageSize,
1090
- tag: tag,
1091
1202
  });
1092
1203
  paginator.setPaginator({
1093
1204
  hasNext: data.page.has_next ? true : false,
@@ -1101,34 +1212,32 @@ class Catalog {
1101
1212
 
1102
1213
  /**
1103
1214
  * @param {Object} arg - Arg object.
1104
- * @param {string} arg.slug - A short, human-readable, URL-friendly
1105
- * identifier of a collection. You can get slug value from the endpoint
1106
- * /service/application/catalog/v1.0/collections/.
1107
- * @param {string} [arg.f] - The search filter parameters. Filter parameters
1108
- * will be passed in f parameter as shown in the example below. Double
1109
- * Pipe (||) denotes the OR condition, whereas Triple-colon (:::)
1110
- * indicates a new filter paramater applied as an AND condition.
1111
- * @param {boolean} [arg.filters] - This is a boolean value, True for
1112
- * fetching all filter parameters and False for disabling the filter parameters.
1113
- * @param {string} [arg.sortOn] - The order in which the list of products
1114
- * should be sorted, e.g. popularity, price, latest and discount, in
1115
- * either ascending or descending order. See the supported values below.
1116
- * @param {string} [arg.pageId] - Page ID to retrieve next set of results.
1117
- * @param {number} [arg.pageSize] - The number of items to retrieve in each page.
1118
- * @returns {Promise<ProductListingResponse>} - Success response
1119
- * @summary: Get the items in a collection
1120
- * @description: Get items in a collection specified by its `slug`.
1215
+ * @param {number} [arg.pageNo] - The page number to navigate through the
1216
+ * given set of results.
1217
+ * @param {number} [arg.pageSize] - Number of items to retrieve in each page.
1218
+ * @param {string} [arg.q] - Search a store by its name or store_code.
1219
+ * @param {string} [arg.city] - Search stores by the city in which they are situated.
1220
+ * @param {number} [arg.range] - Use this to retrieve stores within a
1221
+ * particular range in meters, e.g. 10000, to indicate a 10km range
1222
+ * @param {number} [arg.latitude] - Latitude of the location from where one
1223
+ * wants to retreive the nearest stores, e.g. 72.8691788
1224
+ * @param {number} [arg.longitude] - Longitude of the location from where
1225
+ * one wants to retreive the nearest stores, e.g. 19.1174114
1226
+ * @returns {Promise<ApplicationStoreListing>} - Success response
1227
+ * @summary: Get store meta information.
1228
+ * @description: Use this API to get a list of stores in a specific application.
1121
1229
  */
1122
- getCollectionItemsBySlug({
1123
- slug,
1124
- f,
1125
- filters,
1126
- sortOn,
1127
- pageId,
1230
+ async getInStockLocations({
1231
+ pageNo,
1128
1232
  pageSize,
1233
+ q,
1234
+ city,
1235
+ range,
1236
+ latitude,
1237
+ longitude,
1129
1238
  } = {}) {
1130
- const { error } = CatalogValidator.getCollectionItemsBySlug().validate(
1131
- { slug, f, filters, sortOn, pageId, pageSize },
1239
+ const { error } = CatalogValidator.getInStockLocations().validate(
1240
+ { pageNo, pageSize, q, city, range, latitude, longitude },
1132
1241
  { abortEarly: false, allowUnknown: true }
1133
1242
  );
1134
1243
  if (error) {
@@ -1136,78 +1245,94 @@ class Catalog {
1136
1245
  }
1137
1246
 
1138
1247
  // Showing warrnings if extra unknown parameters are found
1139
- const {
1140
- error: warrning,
1141
- } = CatalogValidator.getCollectionItemsBySlug().validate(
1142
- { slug, f, filters, sortOn, pageId, pageSize },
1248
+ const { error: warrning } = CatalogValidator.getInStockLocations().validate(
1249
+ { pageNo, pageSize, q, city, range, latitude, longitude },
1143
1250
  { abortEarly: false, allowUnknown: false }
1144
1251
  );
1145
1252
  if (warrning) {
1146
- console.log(
1147
- "Parameter Validation warrnings for getCollectionItemsBySlug"
1148
- );
1149
- console.log(warrning);
1253
+ Logger({
1254
+ level: "WARN",
1255
+ message: "Parameter Validation warrnings for getInStockLocations",
1256
+ });
1257
+ Logger({ level: "WARN", message: warrning });
1150
1258
  }
1151
1259
 
1152
1260
  const query_params = {};
1153
- query_params["f"] = f;
1154
- query_params["filters"] = filters;
1155
- query_params["sort_on"] = sortOn;
1156
- query_params["page_id"] = pageId;
1261
+ query_params["page_no"] = pageNo;
1157
1262
  query_params["page_size"] = pageSize;
1263
+ query_params["q"] = q;
1264
+ query_params["city"] = city;
1265
+ query_params["range"] = range;
1266
+ query_params["latitude"] = latitude;
1267
+ query_params["longitude"] = longitude;
1158
1268
 
1159
1269
  const xHeaders = {};
1160
1270
 
1161
- return APIClient.execute(
1271
+ const response = await APIClient.execute(
1162
1272
  this._conf,
1163
1273
  "get",
1164
1274
  constructUrl({
1165
- url: this._urls["getCollectionItemsBySlug"],
1166
- params: { slug },
1275
+ url: this._urls["getInStockLocations"],
1276
+ params: {},
1167
1277
  }),
1168
1278
  query_params,
1169
1279
  undefined,
1170
1280
  xHeaders
1171
1281
  );
1282
+
1283
+ const {
1284
+ error: res_error,
1285
+ } = CatalogModel.ApplicationStoreListing().validate(response, {
1286
+ abortEarly: false,
1287
+ allowUnknown: false,
1288
+ });
1289
+
1290
+ if (res_error) {
1291
+ Logger({
1292
+ level: "WARN",
1293
+ message: "Response Validation Warnnings for getInStockLocations",
1294
+ });
1295
+ Logger({ level: "WARN", message: res_error });
1296
+ }
1297
+
1298
+ return response;
1172
1299
  }
1173
1300
 
1174
1301
  /**
1175
1302
  * @param {Object} arg - Arg object.
1176
- * @param {string} arg.slug - A short, human-readable, URL-friendly
1177
- * identifier of a collection. You can get slug value from the endpoint
1178
- * /service/application/catalog/v1.0/collections/.
1179
- * @param {string} [arg.f] - The search filter parameters. Filter parameters
1180
- * will be passed in f parameter as shown in the example below. Double
1181
- * Pipe (||) denotes the OR condition, whereas Triple-colon (:::)
1182
- * indicates a new filter paramater applied as an AND condition.
1183
- * @param {boolean} [arg.filters] - This is a boolean value, True for
1184
- * fetching all filter parameters and False for disabling the filter parameters.
1185
- * @param {string} [arg.sortOn] - The order in which the list of products
1186
- * should be sorted, e.g. popularity, price, latest and discount, in
1187
- * either ascending or descending order. See the supported values below.
1188
- * @param {number} [arg.pageSize] - The number of items to retrieve in each page.
1189
- * @summary: Get the items in a collection
1190
- * @description: Get items in a collection specified by its `slug`.
1303
+ * @param {number} [arg.pageSize] - Number of items to retrieve in each page.
1304
+ * @param {string} [arg.q] - Search a store by its name or store_code.
1305
+ * @param {string} [arg.city] - Search stores by the city in which they are situated.
1306
+ * @param {number} [arg.range] - Use this to retrieve stores within a
1307
+ * particular range in meters, e.g. 10000, to indicate a 10km range
1308
+ * @param {number} [arg.latitude] - Latitude of the location from where one
1309
+ * wants to retreive the nearest stores, e.g. 72.8691788
1310
+ * @param {number} [arg.longitude] - Longitude of the location from where
1311
+ * one wants to retreive the nearest stores, e.g. 19.1174114
1312
+ * @summary: Get store meta information.
1313
+ * @description: Use this API to get a list of stores in a specific application.
1191
1314
  */
1192
- getCollectionItemsBySlugPaginator({
1193
- slug,
1194
- f,
1195
- filters,
1196
- sortOn,
1315
+ getInStockLocationsPaginator({
1197
1316
  pageSize,
1317
+ q,
1318
+ city,
1319
+ range,
1320
+ latitude,
1321
+ longitude,
1198
1322
  } = {}) {
1199
1323
  const paginator = new Paginator();
1200
1324
  const callback = async () => {
1201
1325
  const pageId = paginator.nextId;
1202
1326
  const pageNo = paginator.pageNo;
1203
- const pageType = "cursor";
1204
- const data = await this.getCollectionItemsBySlug({
1205
- slug: slug,
1206
- f: f,
1207
- filters: filters,
1208
- sortOn: sortOn,
1209
- pageId: pageId,
1327
+ const pageType = "number";
1328
+ const data = await this.getInStockLocations({
1329
+ pageNo: pageNo,
1210
1330
  pageSize: pageSize,
1331
+ q: q,
1332
+ city: city,
1333
+ range: range,
1334
+ latitude: latitude,
1335
+ longitude: longitude,
1211
1336
  });
1212
1337
  paginator.setPaginator({
1213
1338
  hasNext: data.page.has_next ? true : false,
@@ -1221,16 +1346,14 @@ class Catalog {
1221
1346
 
1222
1347
  /**
1223
1348
  * @param {Object} arg - Arg object.
1224
- * @param {string} arg.slug - A short, human-readable, URL-friendly
1225
- * identifier of a collection. You can get slug value from the endpoint
1226
- * /service/application/catalog/v1.0/collections/.
1227
- * @returns {Promise<CollectionDetailResponse>} - Success response
1228
- * @summary: Get a particular collection
1229
- * @description: Get the details of a collection by its `slug`.
1349
+ * @param {number} arg.locationId - Unique Location ID.
1350
+ * @returns {Promise<StoreDetails>} - Success response
1351
+ * @summary: Get store meta information.
1352
+ * @description: Use this API to get meta details for a store.
1230
1353
  */
1231
- getCollectionDetailBySlug({ slug } = {}) {
1232
- const { error } = CatalogValidator.getCollectionDetailBySlug().validate(
1233
- { slug },
1354
+ async getLocationDetailsById({ locationId } = {}) {
1355
+ const { error } = CatalogValidator.getLocationDetailsById().validate(
1356
+ { locationId },
1234
1357
  { abortEarly: false, allowUnknown: true }
1235
1358
  );
1236
1359
  if (error) {
@@ -1240,47 +1363,61 @@ class Catalog {
1240
1363
  // Showing warrnings if extra unknown parameters are found
1241
1364
  const {
1242
1365
  error: warrning,
1243
- } = CatalogValidator.getCollectionDetailBySlug().validate(
1244
- { slug },
1366
+ } = CatalogValidator.getLocationDetailsById().validate(
1367
+ { locationId },
1245
1368
  { abortEarly: false, allowUnknown: false }
1246
1369
  );
1247
1370
  if (warrning) {
1248
- console.log(
1249
- "Parameter Validation warrnings for getCollectionDetailBySlug"
1250
- );
1251
- console.log(warrning);
1371
+ Logger({
1372
+ level: "WARN",
1373
+ message: "Parameter Validation warrnings for getLocationDetailsById",
1374
+ });
1375
+ Logger({ level: "WARN", message: warrning });
1252
1376
  }
1253
1377
 
1254
1378
  const query_params = {};
1255
1379
 
1256
1380
  const xHeaders = {};
1257
1381
 
1258
- return APIClient.execute(
1382
+ const response = await APIClient.execute(
1259
1383
  this._conf,
1260
1384
  "get",
1261
1385
  constructUrl({
1262
- url: this._urls["getCollectionDetailBySlug"],
1263
- params: { slug },
1386
+ url: this._urls["getLocationDetailsById"],
1387
+ params: { locationId },
1264
1388
  }),
1265
1389
  query_params,
1266
1390
  undefined,
1267
1391
  xHeaders
1268
1392
  );
1393
+
1394
+ const { error: res_error } = CatalogModel.StoreDetails().validate(
1395
+ response,
1396
+ { abortEarly: false, allowUnknown: false }
1397
+ );
1398
+
1399
+ if (res_error) {
1400
+ Logger({
1401
+ level: "WARN",
1402
+ message: "Response Validation Warnnings for getLocationDetailsById",
1403
+ });
1404
+ Logger({ level: "WARN", message: res_error });
1405
+ }
1406
+
1407
+ return response;
1269
1408
  }
1270
1409
 
1271
1410
  /**
1272
1411
  * @param {Object} arg - Arg object.
1273
- * @param {string} arg.collectionType - Type of collection followed, i.e.
1274
- * products, brands, or collections.
1275
- * @param {string} [arg.pageId] - Page ID to retrieve next set of results.
1276
- * @param {number} [arg.pageSize] - Page ID to retrieve next set of results.
1277
- * @returns {Promise<GetFollowListingResponse>} - Success response
1278
- * @summary: Get a list of followed Products, Brands, Collections
1279
- * @description: Users can follow a product they like. This API retrieves the products the user have followed.
1412
+ * @param {string} [arg.slug] - Product slug for which bundles need to be fetched.
1413
+ * @param {string} [arg.id] - Product uid
1414
+ * @returns {Promise<ProductBundle>} - Success response
1415
+ * @summary: Get product bundles
1416
+ * @description: Use this API to retrieve products bundles to the one specified by its slug.
1280
1417
  */
1281
- getFollowedListing({ collectionType, pageId, pageSize } = {}) {
1282
- const { error } = CatalogValidator.getFollowedListing().validate(
1283
- { collectionType, pageId, pageSize },
1418
+ async getProductBundlesBySlug({ slug, id } = {}) {
1419
+ const { error } = CatalogValidator.getProductBundlesBySlug().validate(
1420
+ { slug, id },
1284
1421
  { abortEarly: false, allowUnknown: true }
1285
1422
  );
1286
1423
  if (error) {
@@ -1288,75 +1425,66 @@ class Catalog {
1288
1425
  }
1289
1426
 
1290
1427
  // Showing warrnings if extra unknown parameters are found
1291
- const { error: warrning } = CatalogValidator.getFollowedListing().validate(
1292
- { collectionType, pageId, pageSize },
1428
+ const {
1429
+ error: warrning,
1430
+ } = CatalogValidator.getProductBundlesBySlug().validate(
1431
+ { slug, id },
1293
1432
  { abortEarly: false, allowUnknown: false }
1294
1433
  );
1295
1434
  if (warrning) {
1296
- console.log("Parameter Validation warrnings for getFollowedListing");
1297
- console.log(warrning);
1435
+ Logger({
1436
+ level: "WARN",
1437
+ message: "Parameter Validation warrnings for getProductBundlesBySlug",
1438
+ });
1439
+ Logger({ level: "WARN", message: warrning });
1298
1440
  }
1299
1441
 
1300
1442
  const query_params = {};
1301
- query_params["page_id"] = pageId;
1302
- query_params["page_size"] = pageSize;
1443
+ query_params["slug"] = slug;
1444
+ query_params["id"] = id;
1303
1445
 
1304
1446
  const xHeaders = {};
1305
1447
 
1306
- return APIClient.execute(
1448
+ const response = await APIClient.execute(
1307
1449
  this._conf,
1308
1450
  "get",
1309
1451
  constructUrl({
1310
- url: this._urls["getFollowedListing"],
1311
- params: { collectionType },
1452
+ url: this._urls["getProductBundlesBySlug"],
1453
+ params: {},
1312
1454
  }),
1313
1455
  query_params,
1314
1456
  undefined,
1315
1457
  xHeaders
1316
1458
  );
1317
- }
1318
1459
 
1319
- /**
1320
- * @param {Object} arg - Arg object.
1321
- * @param {string} arg.collectionType - Type of collection followed, i.e.
1322
- * products, brands, or collections.
1323
- * @param {number} [arg.pageSize] - Page ID to retrieve next set of results.
1324
- * @summary: Get a list of followed Products, Brands, Collections
1325
- * @description: Users can follow a product they like. This API retrieves the products the user have followed.
1326
- */
1327
- getFollowedListingPaginator({ collectionType, pageSize } = {}) {
1328
- const paginator = new Paginator();
1329
- const callback = async () => {
1330
- const pageId = paginator.nextId;
1331
- const pageNo = paginator.pageNo;
1332
- const pageType = "cursor";
1333
- const data = await this.getFollowedListing({
1334
- collectionType: collectionType,
1335
- pageId: pageId,
1336
- pageSize: pageSize,
1337
- });
1338
- paginator.setPaginator({
1339
- hasNext: data.page.has_next ? true : false,
1340
- nextId: data.page.next_id,
1460
+ const { error: res_error } = CatalogModel.ProductBundle().validate(
1461
+ response,
1462
+ { abortEarly: false, allowUnknown: false }
1463
+ );
1464
+
1465
+ if (res_error) {
1466
+ Logger({
1467
+ level: "WARN",
1468
+ message: "Response Validation Warnnings for getProductBundlesBySlug",
1341
1469
  });
1342
- return data;
1343
- };
1344
- paginator.setCallback(callback);
1345
- return paginator;
1470
+ Logger({ level: "WARN", message: res_error });
1471
+ }
1472
+
1473
+ return response;
1346
1474
  }
1347
1475
 
1348
1476
  /**
1349
1477
  * @param {Object} arg - Arg object.
1350
- * @param {string} arg.collectionType - Type of collection followed, i.e.
1351
- * products, brands, or collections.
1352
- * @param {string} arg.collectionId - The ID of the collection type.
1353
- * @returns {Promise<FollowPostResponse>} - Success response
1354
- * @summary: Follow an entity (product/brand/collection)
1355
- * @description: Follow a particular entity such as product, brand, collection specified by its ID.
1478
+ * @param {string[]} arg.slug - A short, human-readable, URL-friendly
1479
+ * identifier of a product. You can get slug value from the endpoint
1480
+ * /service/application/catalog/v1.0/products/.
1481
+ * @returns {Promise<ProductsComparisonResponse>} - Success response
1482
+ * @summary: Compare products
1483
+ * @description: Use this API to compare the features of products belonging to the same category. Note that at least one slug is mandatory in the request query.
1356
1484
  */
1357
- followById({ collectionType, collectionId } = {}) {
1358
- const { error } = CatalogValidator.followById().validate(
1359
- { collectionType, collectionId },
1485
+ async getProductComparisonBySlugs({ slug } = {}) {
1486
+ const { error } = CatalogValidator.getProductComparisonBySlugs().validate(
1487
+ { slug },
1360
1488
  { abortEarly: false, allowUnknown: true }
1361
1489
  );
1362
1490
  if (error) {
@@ -1364,44 +1492,69 @@ class Catalog {
1364
1492
  }
1365
1493
 
1366
1494
  // Showing warrnings if extra unknown parameters are found
1367
- const { error: warrning } = CatalogValidator.followById().validate(
1368
- { collectionType, collectionId },
1495
+ const {
1496
+ error: warrning,
1497
+ } = CatalogValidator.getProductComparisonBySlugs().validate(
1498
+ { slug },
1369
1499
  { abortEarly: false, allowUnknown: false }
1370
1500
  );
1371
1501
  if (warrning) {
1372
- console.log("Parameter Validation warrnings for followById");
1373
- console.log(warrning);
1502
+ Logger({
1503
+ level: "WARN",
1504
+ message:
1505
+ "Parameter Validation warrnings for getProductComparisonBySlugs",
1506
+ });
1507
+ Logger({ level: "WARN", message: warrning });
1374
1508
  }
1375
1509
 
1376
1510
  const query_params = {};
1511
+ query_params["slug"] = slug;
1377
1512
 
1378
1513
  const xHeaders = {};
1379
1514
 
1380
- return APIClient.execute(
1515
+ const response = await APIClient.execute(
1381
1516
  this._conf,
1382
- "post",
1517
+ "get",
1383
1518
  constructUrl({
1384
- url: this._urls["followById"],
1385
- params: { collectionType, collectionId },
1519
+ url: this._urls["getProductComparisonBySlugs"],
1520
+ params: {},
1386
1521
  }),
1387
1522
  query_params,
1388
1523
  undefined,
1389
1524
  xHeaders
1390
1525
  );
1526
+
1527
+ const {
1528
+ error: res_error,
1529
+ } = CatalogModel.ProductsComparisonResponse().validate(response, {
1530
+ abortEarly: false,
1531
+ allowUnknown: false,
1532
+ });
1533
+
1534
+ if (res_error) {
1535
+ Logger({
1536
+ level: "WARN",
1537
+ message:
1538
+ "Response Validation Warnnings for getProductComparisonBySlugs",
1539
+ });
1540
+ Logger({ level: "WARN", message: res_error });
1541
+ }
1542
+
1543
+ return response;
1391
1544
  }
1392
1545
 
1393
1546
  /**
1394
1547
  * @param {Object} arg - Arg object.
1395
- * @param {string} arg.collectionType - Type of collection followed, i.e.
1396
- * products, brands, or collections.
1397
- * @param {string} arg.collectionId - The ID of the collection type.
1398
- * @returns {Promise<FollowPostResponse>} - Success response
1399
- * @summary: Unfollow an entity (product/brand/collection)
1400
- * @description: You can undo a followed product, brand or collection by its ID. This action is referred as _unfollow_.
1548
+ * @param {string} arg.slug - A short, human-readable, URL-friendly
1549
+ * identifier of a product. You can get slug value from the endpoint
1550
+ * /service/application/catalog/v1.0/products/
1551
+ * @returns {Promise<ProductDetail>} - Success response
1552
+ * @summary: Get a product
1553
+ * @description: Use this API to retrieve a product by its slug value.
1401
1554
  */
1402
- unfollowById({ collectionType, collectionId } = {}) {
1403
- const { error } = CatalogValidator.unfollowById().validate(
1404
- { collectionType, collectionId },
1555
+ async getProductDetailBySlug({ slug } = {}) {
1556
+ const { error } = CatalogValidator.getProductDetailBySlug().validate(
1557
+ { slug },
1405
1558
  { abortEarly: false, allowUnknown: true }
1406
1559
  );
1407
1560
  if (error) {
@@ -1409,90 +1562,73 @@ class Catalog {
1409
1562
  }
1410
1563
 
1411
1564
  // Showing warrnings if extra unknown parameters are found
1412
- const { error: warrning } = CatalogValidator.unfollowById().validate(
1413
- { collectionType, collectionId },
1565
+ const {
1566
+ error: warrning,
1567
+ } = CatalogValidator.getProductDetailBySlug().validate(
1568
+ { slug },
1414
1569
  { abortEarly: false, allowUnknown: false }
1415
1570
  );
1416
1571
  if (warrning) {
1417
- console.log("Parameter Validation warrnings for unfollowById");
1418
- console.log(warrning);
1572
+ Logger({
1573
+ level: "WARN",
1574
+ message: "Parameter Validation warrnings for getProductDetailBySlug",
1575
+ });
1576
+ Logger({ level: "WARN", message: warrning });
1419
1577
  }
1420
1578
 
1421
1579
  const query_params = {};
1422
1580
 
1423
1581
  const xHeaders = {};
1424
1582
 
1425
- return APIClient.execute(
1583
+ const response = await APIClient.execute(
1426
1584
  this._conf,
1427
- "delete",
1585
+ "get",
1428
1586
  constructUrl({
1429
- url: this._urls["unfollowById"],
1430
- params: { collectionType, collectionId },
1587
+ url: this._urls["getProductDetailBySlug"],
1588
+ params: { slug },
1431
1589
  }),
1432
1590
  query_params,
1433
1591
  undefined,
1434
1592
  xHeaders
1435
1593
  );
1436
- }
1437
-
1438
- /**
1439
- * @param {Object} arg - Arg object.
1440
- * @param {string} arg.collectionType - Type of collection, i.e. products,
1441
- * brands, or collections.
1442
- * @param {string} arg.collectionId - The ID of the collection type.
1443
- * @returns {Promise<FollowerCountResponse>} - Success response
1444
- * @summary: Get Follow Count
1445
- * @description: Get the total count of followers for a given collection type and collection ID.
1446
- */
1447
- getFollowerCountById({ collectionType, collectionId } = {}) {
1448
- const { error } = CatalogValidator.getFollowerCountById().validate(
1449
- { collectionType, collectionId },
1450
- { abortEarly: false, allowUnknown: true }
1451
- );
1452
- if (error) {
1453
- return Promise.reject(new FDKClientValidationError(error));
1454
- }
1455
1594
 
1456
- // Showing warrnings if extra unknown parameters are found
1457
- const {
1458
- error: warrning,
1459
- } = CatalogValidator.getFollowerCountById().validate(
1460
- { collectionType, collectionId },
1595
+ const { error: res_error } = CatalogModel.ProductDetail().validate(
1596
+ response,
1461
1597
  { abortEarly: false, allowUnknown: false }
1462
1598
  );
1463
- if (warrning) {
1464
- console.log("Parameter Validation warrnings for getFollowerCountById");
1465
- console.log(warrning);
1466
- }
1467
1599
 
1468
- const query_params = {};
1469
-
1470
- const xHeaders = {};
1600
+ if (res_error) {
1601
+ Logger({
1602
+ level: "WARN",
1603
+ message: "Response Validation Warnnings for getProductDetailBySlug",
1604
+ });
1605
+ Logger({ level: "WARN", message: res_error });
1606
+ }
1471
1607
 
1472
- return APIClient.execute(
1473
- this._conf,
1474
- "get",
1475
- constructUrl({
1476
- url: this._urls["getFollowerCountById"],
1477
- params: { collectionType, collectionId },
1478
- }),
1479
- query_params,
1480
- undefined,
1481
- xHeaders
1482
- );
1608
+ return response;
1483
1609
  }
1484
1610
 
1485
1611
  /**
1486
1612
  * @param {Object} arg - Arg object.
1487
- * @param {string} [arg.collectionType] - Type of collection, i.e. products,
1488
- * brands, collections.
1489
- * @returns {Promise<FollowIdsResponse>} - Success response
1490
- * @summary: Get the IDs of followed products, brands and collections.
1491
- * @description: You can get the IDs of all the followed Products, Brands and Collections. Pass collection_type as query parameter to fetch specific Ids
1613
+ * @param {string} arg.slug - A short, human-readable, URL-friendly
1614
+ * identifier of a product. You can get slug value from the endpoint
1615
+ * /service/application/catalog/v1.0/products/
1616
+ * @param {string} arg.size - A string indicating the size of the product,
1617
+ * e.g. S, M, XL. You can get slug value from the endpoint
1618
+ * /service/application/catalog/v1.0/products/sizes
1619
+ * @param {number} [arg.storeId] - The ID of the store that is selling the
1620
+ * product, e.g. 1,2,3.
1621
+ * @param {string} [arg.pincode] - The PIN Code of the area near which the
1622
+ * selling locations should be searched, e.g. 400059.
1623
+ * @param {number} [arg.moq] - An Integer indication the Minimum Order
1624
+ * Quantity of a product, e.g. 100.
1625
+ * @returns {Promise<ProductSizePriceResponseV3>} - Success response
1626
+ * @summary: Get the price of a product size at a PIN Code
1627
+ * @description: Prices may vary for different sizes of a product. Use this API to retrieve the price of a product size at all the selling locations near to a PIN Code.
1492
1628
  */
1493
- getFollowIds({ collectionType } = {}) {
1494
- const { error } = CatalogValidator.getFollowIds().validate(
1495
- { collectionType },
1629
+ async getProductPriceBySlug({ slug, size, storeId, pincode, moq } = {}) {
1630
+ const { error } = CatalogValidator.getProductPriceBySlug().validate(
1631
+ { slug, size, storeId, pincode, moq },
1496
1632
  { abortEarly: false, allowUnknown: true }
1497
1633
  );
1498
1634
  if (error) {
@@ -1500,53 +1636,86 @@ class Catalog {
1500
1636
  }
1501
1637
 
1502
1638
  // Showing warrnings if extra unknown parameters are found
1503
- const { error: warrning } = CatalogValidator.getFollowIds().validate(
1504
- { collectionType },
1639
+ const {
1640
+ error: warrning,
1641
+ } = CatalogValidator.getProductPriceBySlug().validate(
1642
+ { slug, size, storeId, pincode, moq },
1505
1643
  { abortEarly: false, allowUnknown: false }
1506
1644
  );
1507
1645
  if (warrning) {
1508
- console.log("Parameter Validation warrnings for getFollowIds");
1509
- console.log(warrning);
1646
+ Logger({
1647
+ level: "WARN",
1648
+ message: "Parameter Validation warrnings for getProductPriceBySlug",
1649
+ });
1650
+ Logger({ level: "WARN", message: warrning });
1510
1651
  }
1511
1652
 
1512
1653
  const query_params = {};
1513
- query_params["collection_type"] = collectionType;
1654
+ query_params["store_id"] = storeId;
1655
+ query_params["pincode"] = pincode;
1656
+ query_params["moq"] = moq;
1514
1657
 
1515
1658
  const xHeaders = {};
1516
1659
 
1517
- return APIClient.execute(
1660
+ const response = await APIClient.execute(
1518
1661
  this._conf,
1519
1662
  "get",
1520
1663
  constructUrl({
1521
- url: this._urls["getFollowIds"],
1522
- params: {},
1664
+ url: this._urls["getProductPriceBySlug"],
1665
+ params: { slug, size },
1523
1666
  }),
1524
1667
  query_params,
1525
1668
  undefined,
1526
1669
  xHeaders
1527
1670
  );
1671
+
1672
+ const {
1673
+ error: res_error,
1674
+ } = CatalogModel.ProductSizePriceResponseV3().validate(response, {
1675
+ abortEarly: false,
1676
+ allowUnknown: false,
1677
+ });
1678
+
1679
+ if (res_error) {
1680
+ Logger({
1681
+ level: "WARN",
1682
+ message: "Response Validation Warnnings for getProductPriceBySlug",
1683
+ });
1684
+ Logger({ level: "WARN", message: res_error });
1685
+ }
1686
+
1687
+ return response;
1528
1688
  }
1529
1689
 
1530
1690
  /**
1531
1691
  * @param {Object} arg - Arg object.
1692
+ * @param {string} arg.slug - A short, human-readable, URL-friendly
1693
+ * identifier of a product. You can get slug value from the endpoint
1694
+ * /service/application/catalog/v1.0/products/
1695
+ * @param {string} arg.size - A string indicating the size of the product,
1696
+ * e.g. S, M, XL. You can get slug value from the endpoint
1697
+ * /service/application/catalog/v1.0/products/sizes
1698
+ * @param {string} [arg.pincode] - The 6-digit PIN Code of the area near
1699
+ * which the selling locations should be searched, e.g. 400059
1700
+ * @param {string} [arg.strategy] - Sort stores on the basis of strategy.
1701
+ * eg, fast-delivery, low-price, optimal.
1532
1702
  * @param {number} [arg.pageNo] - The page number to navigate through the
1533
1703
  * given set of results.
1534
- * @param {number} [arg.pageSize] - Number of items to retrieve in each page.
1535
- * @param {string} [arg.q] - Search a store by its name or store_code.
1536
- * @param {string} [arg.city] - Search stores by the city in which they are situated.
1537
- * @param {number} [arg.range] - Use this to retrieve stores within a
1538
- * particular range in meters, e.g. 10000, to indicate a 10km range
1539
- * @param {number} [arg.latitude] - Latitude of the location from where one
1540
- * wants to retreive the nearest stores, e.g. 72.8691788
1541
- * @param {number} [arg.longitude] - Longitude of the location from where
1542
- * one wants to retreive the nearest stores, e.g. 19.1174114
1543
- * @returns {Promise<StoreListingResponse>} - Success response
1544
- * @summary: Get store meta information.
1545
- * @description: Use this API to get a list of stores in a specific application.
1704
+ * @param {number} [arg.pageSize] - The number of items to retrieve in each page.
1705
+ * @returns {Promise<ProductSizeSellersResponseV3>} - Success response
1706
+ * @summary: Get the sellers of a product size at a PIN Code
1707
+ * @description: A product of a particular size may be sold by multiple sellers. Use this API to fetch the sellers having the stock of a particular size at a given PIN Code.
1546
1708
  */
1547
- getStores({ pageNo, pageSize, q, city, range, latitude, longitude } = {}) {
1548
- const { error } = CatalogValidator.getStores().validate(
1549
- { pageNo, pageSize, q, city, range, latitude, longitude },
1709
+ async getProductSellersBySlug({
1710
+ slug,
1711
+ size,
1712
+ pincode,
1713
+ strategy,
1714
+ pageNo,
1715
+ pageSize,
1716
+ } = {}) {
1717
+ const { error } = CatalogValidator.getProductSellersBySlug().validate(
1718
+ { slug, size, pincode, strategy, pageNo, pageSize },
1550
1719
  { abortEarly: false, allowUnknown: true }
1551
1720
  );
1552
1721
  if (error) {
@@ -1554,67 +1723,93 @@ class Catalog {
1554
1723
  }
1555
1724
 
1556
1725
  // Showing warrnings if extra unknown parameters are found
1557
- const { error: warrning } = CatalogValidator.getStores().validate(
1558
- { pageNo, pageSize, q, city, range, latitude, longitude },
1726
+ const {
1727
+ error: warrning,
1728
+ } = CatalogValidator.getProductSellersBySlug().validate(
1729
+ { slug, size, pincode, strategy, pageNo, pageSize },
1559
1730
  { abortEarly: false, allowUnknown: false }
1560
1731
  );
1561
1732
  if (warrning) {
1562
- console.log("Parameter Validation warrnings for getStores");
1563
- console.log(warrning);
1733
+ Logger({
1734
+ level: "WARN",
1735
+ message: "Parameter Validation warrnings for getProductSellersBySlug",
1736
+ });
1737
+ Logger({ level: "WARN", message: warrning });
1564
1738
  }
1565
1739
 
1566
1740
  const query_params = {};
1741
+ query_params["pincode"] = pincode;
1742
+ query_params["strategy"] = strategy;
1567
1743
  query_params["page_no"] = pageNo;
1568
1744
  query_params["page_size"] = pageSize;
1569
- query_params["q"] = q;
1570
- query_params["city"] = city;
1571
- query_params["range"] = range;
1572
- query_params["latitude"] = latitude;
1573
- query_params["longitude"] = longitude;
1574
1745
 
1575
1746
  const xHeaders = {};
1576
1747
 
1577
- return APIClient.execute(
1748
+ const response = await APIClient.execute(
1578
1749
  this._conf,
1579
1750
  "get",
1580
1751
  constructUrl({
1581
- url: this._urls["getStores"],
1582
- params: {},
1752
+ url: this._urls["getProductSellersBySlug"],
1753
+ params: { slug, size },
1583
1754
  }),
1584
1755
  query_params,
1585
1756
  undefined,
1586
1757
  xHeaders
1587
1758
  );
1759
+
1760
+ const {
1761
+ error: res_error,
1762
+ } = CatalogModel.ProductSizeSellersResponseV3().validate(response, {
1763
+ abortEarly: false,
1764
+ allowUnknown: false,
1765
+ });
1766
+
1767
+ if (res_error) {
1768
+ Logger({
1769
+ level: "WARN",
1770
+ message: "Response Validation Warnnings for getProductSellersBySlug",
1771
+ });
1772
+ Logger({ level: "WARN", message: res_error });
1773
+ }
1774
+
1775
+ return response;
1588
1776
  }
1589
1777
 
1590
1778
  /**
1591
1779
  * @param {Object} arg - Arg object.
1592
- * @param {number} [arg.pageSize] - Number of items to retrieve in each page.
1593
- * @param {string} [arg.q] - Search a store by its name or store_code.
1594
- * @param {string} [arg.city] - Search stores by the city in which they are situated.
1595
- * @param {number} [arg.range] - Use this to retrieve stores within a
1596
- * particular range in meters, e.g. 10000, to indicate a 10km range
1597
- * @param {number} [arg.latitude] - Latitude of the location from where one
1598
- * wants to retreive the nearest stores, e.g. 72.8691788
1599
- * @param {number} [arg.longitude] - Longitude of the location from where
1600
- * one wants to retreive the nearest stores, e.g. 19.1174114
1601
- * @summary: Get store meta information.
1602
- * @description: Use this API to get a list of stores in a specific application.
1780
+ * @param {string} arg.slug - A short, human-readable, URL-friendly
1781
+ * identifier of a product. You can get slug value from the endpoint
1782
+ * /service/application/catalog/v1.0/products/
1783
+ * @param {string} arg.size - A string indicating the size of the product,
1784
+ * e.g. S, M, XL. You can get slug value from the endpoint
1785
+ * /service/application/catalog/v1.0/products/sizes
1786
+ * @param {string} [arg.pincode] - The 6-digit PIN Code of the area near
1787
+ * which the selling locations should be searched, e.g. 400059
1788
+ * @param {string} [arg.strategy] - Sort stores on the basis of strategy.
1789
+ * eg, fast-delivery, low-price, optimal.
1790
+ * @param {number} [arg.pageSize] - The number of items to retrieve in each page.
1791
+ * @summary: Get the sellers of a product size at a PIN Code
1792
+ * @description: A product of a particular size may be sold by multiple sellers. Use this API to fetch the sellers having the stock of a particular size at a given PIN Code.
1603
1793
  */
1604
- getStoresPaginator({ pageSize, q, city, range, latitude, longitude } = {}) {
1794
+ getProductSellersBySlugPaginator({
1795
+ slug,
1796
+ size,
1797
+ pincode,
1798
+ strategy,
1799
+ pageSize,
1800
+ } = {}) {
1605
1801
  const paginator = new Paginator();
1606
1802
  const callback = async () => {
1607
1803
  const pageId = paginator.nextId;
1608
1804
  const pageNo = paginator.pageNo;
1609
1805
  const pageType = "number";
1610
- const data = await this.getStores({
1806
+ const data = await this.getProductSellersBySlug({
1807
+ slug: slug,
1808
+ size: size,
1809
+ pincode: pincode,
1810
+ strategy: strategy,
1611
1811
  pageNo: pageNo,
1612
1812
  pageSize: pageSize,
1613
- q: q,
1614
- city: city,
1615
- range: range,
1616
- latitude: latitude,
1617
- longitude: longitude,
1618
1813
  });
1619
1814
  paginator.setPaginator({
1620
1815
  hasNext: data.page.has_next ? true : false,
@@ -1628,32 +1823,18 @@ class Catalog {
1628
1823
 
1629
1824
  /**
1630
1825
  * @param {Object} arg - Arg object.
1631
- * @param {number} [arg.pageNo] - The page number to navigate through the
1632
- * given set of results.
1633
- * @param {number} [arg.pageSize] - Number of items to retrieve in each page.
1634
- * @param {string} [arg.q] - Search a store by its name or store_code.
1635
- * @param {string} [arg.city] - Search stores by the city in which they are situated.
1636
- * @param {number} [arg.range] - Use this to retrieve stores within a
1637
- * particular range in meters, e.g. 10000, to indicate a 10km range
1638
- * @param {number} [arg.latitude] - Latitude of the location from where one
1639
- * wants to retreive the nearest stores, e.g. 72.8691788
1640
- * @param {number} [arg.longitude] - Longitude of the location from where
1641
- * one wants to retreive the nearest stores, e.g. 19.1174114
1642
- * @returns {Promise<ApplicationStoreListing>} - Success response
1643
- * @summary: Get store meta information.
1644
- * @description: Use this API to get a list of stores in a specific application.
1826
+ * @param {string} arg.slug - A short, human-readable, URL-friendly
1827
+ * identifier of a product. You can get slug value from the endpoint
1828
+ * /service/application/catalog/v1.0/products/
1829
+ * @param {number} [arg.storeId] - The ID of the store that is selling the
1830
+ * product, e.g. 1,2,3.
1831
+ * @returns {Promise<ProductSizes>} - Success response
1832
+ * @summary: Get the sizes of a product
1833
+ * @description: A product can have multiple sizes. Use this API to fetch all the available sizes of a product.
1645
1834
  */
1646
- getInStockLocations({
1647
- pageNo,
1648
- pageSize,
1649
- q,
1650
- city,
1651
- range,
1652
- latitude,
1653
- longitude,
1654
- } = {}) {
1655
- const { error } = CatalogValidator.getInStockLocations().validate(
1656
- { pageNo, pageSize, q, city, range, latitude, longitude },
1835
+ async getProductSizesBySlug({ slug, storeId } = {}) {
1836
+ const { error } = CatalogValidator.getProductSizesBySlug().validate(
1837
+ { slug, storeId },
1657
1838
  { abortEarly: false, allowUnknown: true }
1658
1839
  );
1659
1840
  if (error) {
@@ -1661,95 +1842,71 @@ class Catalog {
1661
1842
  }
1662
1843
 
1663
1844
  // Showing warrnings if extra unknown parameters are found
1664
- const { error: warrning } = CatalogValidator.getInStockLocations().validate(
1665
- { pageNo, pageSize, q, city, range, latitude, longitude },
1845
+ const {
1846
+ error: warrning,
1847
+ } = CatalogValidator.getProductSizesBySlug().validate(
1848
+ { slug, storeId },
1666
1849
  { abortEarly: false, allowUnknown: false }
1667
1850
  );
1668
1851
  if (warrning) {
1669
- console.log("Parameter Validation warrnings for getInStockLocations");
1670
- console.log(warrning);
1852
+ Logger({
1853
+ level: "WARN",
1854
+ message: "Parameter Validation warrnings for getProductSizesBySlug",
1855
+ });
1856
+ Logger({ level: "WARN", message: warrning });
1671
1857
  }
1672
1858
 
1673
1859
  const query_params = {};
1674
- query_params["page_no"] = pageNo;
1675
- query_params["page_size"] = pageSize;
1676
- query_params["q"] = q;
1677
- query_params["city"] = city;
1678
- query_params["range"] = range;
1679
- query_params["latitude"] = latitude;
1680
- query_params["longitude"] = longitude;
1860
+ query_params["store_id"] = storeId;
1681
1861
 
1682
1862
  const xHeaders = {};
1683
1863
 
1684
- return APIClient.execute(
1864
+ const response = await APIClient.execute(
1685
1865
  this._conf,
1686
1866
  "get",
1687
1867
  constructUrl({
1688
- url: this._urls["getInStockLocations"],
1689
- params: {},
1868
+ url: this._urls["getProductSizesBySlug"],
1869
+ params: { slug },
1690
1870
  }),
1691
1871
  query_params,
1692
1872
  undefined,
1693
1873
  xHeaders
1694
1874
  );
1695
- }
1696
1875
 
1697
- /**
1698
- * @param {Object} arg - Arg object.
1699
- * @param {number} [arg.pageSize] - Number of items to retrieve in each page.
1700
- * @param {string} [arg.q] - Search a store by its name or store_code.
1701
- * @param {string} [arg.city] - Search stores by the city in which they are situated.
1702
- * @param {number} [arg.range] - Use this to retrieve stores within a
1703
- * particular range in meters, e.g. 10000, to indicate a 10km range
1704
- * @param {number} [arg.latitude] - Latitude of the location from where one
1705
- * wants to retreive the nearest stores, e.g. 72.8691788
1706
- * @param {number} [arg.longitude] - Longitude of the location from where
1707
- * one wants to retreive the nearest stores, e.g. 19.1174114
1708
- * @summary: Get store meta information.
1709
- * @description: Use this API to get a list of stores in a specific application.
1710
- */
1711
- getInStockLocationsPaginator({
1712
- pageSize,
1713
- q,
1714
- city,
1715
- range,
1716
- latitude,
1717
- longitude,
1718
- } = {}) {
1719
- const paginator = new Paginator();
1720
- const callback = async () => {
1721
- const pageId = paginator.nextId;
1722
- const pageNo = paginator.pageNo;
1723
- const pageType = "number";
1724
- const data = await this.getInStockLocations({
1725
- pageNo: pageNo,
1726
- pageSize: pageSize,
1727
- q: q,
1728
- city: city,
1729
- range: range,
1730
- latitude: latitude,
1731
- longitude: longitude,
1732
- });
1733
- paginator.setPaginator({
1734
- hasNext: data.page.has_next ? true : false,
1735
- nextId: data.page.next_id,
1876
+ const { error: res_error } = CatalogModel.ProductSizes().validate(
1877
+ response,
1878
+ { abortEarly: false, allowUnknown: false }
1879
+ );
1880
+
1881
+ if (res_error) {
1882
+ Logger({
1883
+ level: "WARN",
1884
+ message: "Response Validation Warnnings for getProductSizesBySlug",
1736
1885
  });
1737
- return data;
1738
- };
1739
- paginator.setCallback(callback);
1740
- return paginator;
1886
+ Logger({ level: "WARN", message: res_error });
1887
+ }
1888
+
1889
+ return response;
1741
1890
  }
1742
1891
 
1743
1892
  /**
1744
1893
  * @param {Object} arg - Arg object.
1745
- * @param {number} arg.locationId - Unique Location ID.
1746
- * @returns {Promise<StoreDetails>} - Success response
1747
- * @summary: Get store meta information.
1748
- * @description: Use this API to get meta details for a store.
1894
+ * @param {string} [arg.itemId] - The Item ID of the product (Max. 50 allowed)
1895
+ * @param {string} [arg.alu] - ALU of the product (limited upto 50 ALU
1896
+ * identifier in a single request)
1897
+ * @param {string} [arg.skuCode] - Stock-keeping Unit of the product
1898
+ * (limited upto 50 SKU Code in a single request)
1899
+ * @param {string} [arg.ean] - European Article Number of the product
1900
+ * (limited upto 50 EAN identifier in a single request)
1901
+ * @param {string} [arg.upc] - Universal Product Code of the product
1902
+ * (limited upto 50 UPC identifier in a single request)
1903
+ * @returns {Promise<ProductStockStatusResponse>} - Success response
1904
+ * @summary: Get the stock of a product
1905
+ * @description: Retrieve the available stock of the products. Use this API to retrieve stock of multiple products (up to 50) at a time.
1749
1906
  */
1750
- getLocationDetailsById({ locationId } = {}) {
1751
- const { error } = CatalogValidator.getLocationDetailsById().validate(
1752
- { locationId },
1907
+ async getProductStockByIds({ itemId, alu, skuCode, ean, upc } = {}) {
1908
+ const { error } = CatalogValidator.getProductStockByIds().validate(
1909
+ { itemId, alu, skuCode, ean, upc },
1753
1910
  { abortEarly: false, allowUnknown: true }
1754
1911
  );
1755
1912
  if (error) {
@@ -1759,43 +1916,69 @@ class Catalog {
1759
1916
  // Showing warrnings if extra unknown parameters are found
1760
1917
  const {
1761
1918
  error: warrning,
1762
- } = CatalogValidator.getLocationDetailsById().validate(
1763
- { locationId },
1919
+ } = CatalogValidator.getProductStockByIds().validate(
1920
+ { itemId, alu, skuCode, ean, upc },
1764
1921
  { abortEarly: false, allowUnknown: false }
1765
1922
  );
1766
1923
  if (warrning) {
1767
- console.log("Parameter Validation warrnings for getLocationDetailsById");
1768
- console.log(warrning);
1924
+ Logger({
1925
+ level: "WARN",
1926
+ message: "Parameter Validation warrnings for getProductStockByIds",
1927
+ });
1928
+ Logger({ level: "WARN", message: warrning });
1769
1929
  }
1770
1930
 
1771
1931
  const query_params = {};
1932
+ query_params["item_id"] = itemId;
1933
+ query_params["alu"] = alu;
1934
+ query_params["sku_code"] = skuCode;
1935
+ query_params["ean"] = ean;
1936
+ query_params["upc"] = upc;
1772
1937
 
1773
1938
  const xHeaders = {};
1774
1939
 
1775
- return APIClient.execute(
1940
+ const response = await APIClient.execute(
1776
1941
  this._conf,
1777
1942
  "get",
1778
1943
  constructUrl({
1779
- url: this._urls["getLocationDetailsById"],
1780
- params: { locationId },
1944
+ url: this._urls["getProductStockByIds"],
1945
+ params: {},
1781
1946
  }),
1782
1947
  query_params,
1783
1948
  undefined,
1784
1949
  xHeaders
1785
1950
  );
1951
+
1952
+ const {
1953
+ error: res_error,
1954
+ } = CatalogModel.ProductStockStatusResponse().validate(response, {
1955
+ abortEarly: false,
1956
+ allowUnknown: false,
1957
+ });
1958
+
1959
+ if (res_error) {
1960
+ Logger({
1961
+ level: "WARN",
1962
+ message: "Response Validation Warnnings for getProductStockByIds",
1963
+ });
1964
+ Logger({ level: "WARN", message: res_error });
1965
+ }
1966
+
1967
+ return response;
1786
1968
  }
1787
1969
 
1788
1970
  /**
1789
1971
  * @param {Object} arg - Arg object.
1790
- * @param {string} [arg.slug] - Product slug for which bundles need to be fetched.
1791
- * @param {string} [arg.id] - Product uid
1792
- * @returns {Promise<ProductBundle>} - Success response
1793
- * @summary: Get product bundles
1794
- * @description: Use this API to retrieve products bundles to the one specified by its slug.
1972
+ * @param {string} arg.timestamp - Timestamp in UTC format (2020-07-23T10:27:50Z)
1973
+ * @param {number} [arg.pageSize] - The number of items to retrieve in each page.
1974
+ * @param {string} [arg.pageId] - Page ID to retrieve next set of results.
1975
+ * @returns {Promise<ProductStockPolling>} - Success response
1976
+ * @summary: Get the stock of a product
1977
+ * @description: Retrieve the available stock of the products. Use this API to get the stock status of products whose inventory is updated at the specified time
1795
1978
  */
1796
- getProductBundlesBySlug({ slug, id } = {}) {
1797
- const { error } = CatalogValidator.getProductBundlesBySlug().validate(
1798
- { slug, id },
1979
+ async getProductStockForTimeByIds({ timestamp, pageSize, pageId } = {}) {
1980
+ const { error } = CatalogValidator.getProductStockForTimeByIds().validate(
1981
+ { timestamp, pageSize, pageId },
1799
1982
  { abortEarly: false, allowUnknown: true }
1800
1983
  );
1801
1984
  if (error) {
@@ -1805,32 +1988,83 @@ class Catalog {
1805
1988
  // Showing warrnings if extra unknown parameters are found
1806
1989
  const {
1807
1990
  error: warrning,
1808
- } = CatalogValidator.getProductBundlesBySlug().validate(
1809
- { slug, id },
1991
+ } = CatalogValidator.getProductStockForTimeByIds().validate(
1992
+ { timestamp, pageSize, pageId },
1810
1993
  { abortEarly: false, allowUnknown: false }
1811
1994
  );
1812
1995
  if (warrning) {
1813
- console.log("Parameter Validation warrnings for getProductBundlesBySlug");
1814
- console.log(warrning);
1996
+ Logger({
1997
+ level: "WARN",
1998
+ message:
1999
+ "Parameter Validation warrnings for getProductStockForTimeByIds",
2000
+ });
2001
+ Logger({ level: "WARN", message: warrning });
1815
2002
  }
1816
2003
 
1817
2004
  const query_params = {};
1818
- query_params["slug"] = slug;
1819
- query_params["id"] = id;
2005
+ query_params["timestamp"] = timestamp;
2006
+ query_params["page_size"] = pageSize;
2007
+ query_params["page_id"] = pageId;
1820
2008
 
1821
2009
  const xHeaders = {};
1822
2010
 
1823
- return APIClient.execute(
2011
+ const response = await APIClient.execute(
1824
2012
  this._conf,
1825
2013
  "get",
1826
2014
  constructUrl({
1827
- url: this._urls["getProductBundlesBySlug"],
2015
+ url: this._urls["getProductStockForTimeByIds"],
1828
2016
  params: {},
1829
2017
  }),
1830
2018
  query_params,
1831
2019
  undefined,
1832
2020
  xHeaders
1833
2021
  );
2022
+
2023
+ const {
2024
+ error: res_error,
2025
+ } = CatalogModel.ProductStockPolling().validate(response, {
2026
+ abortEarly: false,
2027
+ allowUnknown: false,
2028
+ });
2029
+
2030
+ if (res_error) {
2031
+ Logger({
2032
+ level: "WARN",
2033
+ message:
2034
+ "Response Validation Warnnings for getProductStockForTimeByIds",
2035
+ });
2036
+ Logger({ level: "WARN", message: res_error });
2037
+ }
2038
+
2039
+ return response;
2040
+ }
2041
+
2042
+ /**
2043
+ * @param {Object} arg - Arg object.
2044
+ * @param {string} arg.timestamp - Timestamp in UTC format (2020-07-23T10:27:50Z)
2045
+ * @param {number} [arg.pageSize] - The number of items to retrieve in each page.
2046
+ * @summary: Get the stock of a product
2047
+ * @description: Retrieve the available stock of the products. Use this API to get the stock status of products whose inventory is updated at the specified time
2048
+ */
2049
+ getProductStockForTimeByIdsPaginator({ timestamp, pageSize } = {}) {
2050
+ const paginator = new Paginator();
2051
+ const callback = async () => {
2052
+ const pageId = paginator.nextId;
2053
+ const pageNo = paginator.pageNo;
2054
+ const pageType = "cursor";
2055
+ const data = await this.getProductStockForTimeByIds({
2056
+ timestamp: timestamp,
2057
+ pageSize: pageSize,
2058
+ pageId: pageId,
2059
+ });
2060
+ paginator.setPaginator({
2061
+ hasNext: data.page.has_next ? true : false,
2062
+ nextId: data.page.next_id,
2063
+ });
2064
+ return data;
2065
+ };
2066
+ paginator.setCallback(callback);
2067
+ return paginator;
1834
2068
  }
1835
2069
 
1836
2070
  /**
@@ -1838,22 +2072,13 @@ class Catalog {
1838
2072
  * @param {string} arg.slug - A short, human-readable, URL-friendly
1839
2073
  * identifier of a product. You can get slug value from the endpoint
1840
2074
  * /service/application/catalog/v1.0/products/
1841
- * @param {string} arg.size - A string indicating the size of the product,
1842
- * e.g. S, M, XL. You can get slug value from the endpoint
1843
- * /service/application/catalog/v1.0/products/sizes
1844
- * @param {number} [arg.storeId] - The ID of the store that is selling the
1845
- * product, e.g. 1,2,3.
1846
- * @param {string} [arg.pincode] - The PIN Code of the area near which the
1847
- * selling locations should be searched, e.g. 400059.
1848
- * @param {number} [arg.moq] - An Integer indication the Minimum Order
1849
- * Quantity of a product, e.g. 100.
1850
- * @returns {Promise<ProductSizePriceResponseV3>} - Success response
1851
- * @summary: Get the price of a product size at a PIN Code
1852
- * @description: Prices may vary for different sizes of a product. Use this API to retrieve the price of a product size at all the selling locations near to a PIN Code.
2075
+ * @returns {Promise<ProductVariantsResponse>} - Success response
2076
+ * @summary: Get variant of a particular product
2077
+ * @description: A product can have a different type of variants such as colour, shade, memory. Use this API to fetch all the available variants of a product using its slug.
1853
2078
  */
1854
- getProductPriceBySlug({ slug, size, storeId, pincode, moq } = {}) {
1855
- const { error } = CatalogValidator.getProductPriceBySlug().validate(
1856
- { slug, size, storeId, pincode, moq },
2079
+ async getProductVariantsBySlug({ slug } = {}) {
2080
+ const { error } = CatalogValidator.getProductVariantsBySlug().validate(
2081
+ { slug },
1857
2082
  { abortEarly: false, allowUnknown: true }
1858
2083
  );
1859
2084
  if (error) {
@@ -1863,64 +2088,86 @@ class Catalog {
1863
2088
  // Showing warrnings if extra unknown parameters are found
1864
2089
  const {
1865
2090
  error: warrning,
1866
- } = CatalogValidator.getProductPriceBySlug().validate(
1867
- { slug, size, storeId, pincode, moq },
2091
+ } = CatalogValidator.getProductVariantsBySlug().validate(
2092
+ { slug },
1868
2093
  { abortEarly: false, allowUnknown: false }
1869
2094
  );
1870
2095
  if (warrning) {
1871
- console.log("Parameter Validation warrnings for getProductPriceBySlug");
1872
- console.log(warrning);
2096
+ Logger({
2097
+ level: "WARN",
2098
+ message: "Parameter Validation warrnings for getProductVariantsBySlug",
2099
+ });
2100
+ Logger({ level: "WARN", message: warrning });
1873
2101
  }
1874
2102
 
1875
2103
  const query_params = {};
1876
- query_params["store_id"] = storeId;
1877
- query_params["pincode"] = pincode;
1878
- query_params["moq"] = moq;
1879
2104
 
1880
2105
  const xHeaders = {};
1881
2106
 
1882
- return APIClient.execute(
2107
+ const response = await APIClient.execute(
1883
2108
  this._conf,
1884
2109
  "get",
1885
2110
  constructUrl({
1886
- url: this._urls["getProductPriceBySlug"],
1887
- params: { slug, size },
2111
+ url: this._urls["getProductVariantsBySlug"],
2112
+ params: { slug },
1888
2113
  }),
1889
2114
  query_params,
1890
2115
  undefined,
1891
2116
  xHeaders
1892
2117
  );
2118
+
2119
+ const {
2120
+ error: res_error,
2121
+ } = CatalogModel.ProductVariantsResponse().validate(response, {
2122
+ abortEarly: false,
2123
+ allowUnknown: false,
2124
+ });
2125
+
2126
+ if (res_error) {
2127
+ Logger({
2128
+ level: "WARN",
2129
+ message: "Response Validation Warnnings for getProductVariantsBySlug",
2130
+ });
2131
+ Logger({ level: "WARN", message: res_error });
2132
+ }
2133
+
2134
+ return response;
1893
2135
  }
1894
2136
 
1895
2137
  /**
1896
2138
  * @param {Object} arg - Arg object.
1897
- * @param {string} arg.slug - A short, human-readable, URL-friendly
1898
- * identifier of a product. You can get slug value from the endpoint
1899
- * /service/application/catalog/v1.0/products/
1900
- * @param {string} arg.size - A string indicating the size of the product,
1901
- * e.g. S, M, XL. You can get slug value from the endpoint
1902
- * /service/application/catalog/v1.0/products/sizes
1903
- * @param {string} [arg.pincode] - The 6-digit PIN Code of the area near
1904
- * which the selling locations should be searched, e.g. 400059
1905
- * @param {string} [arg.strategy] - Sort stores on the basis of strategy.
1906
- * eg, fast-delivery, low-price, optimal.
2139
+ * @param {string} [arg.q] - The search query for entering partial or full
2140
+ * name of product, brand, category, or collection.
2141
+ * @param {string} [arg.f] - The search filter parameters. Filter parameters
2142
+ * will be passed in f parameter as shown in the example below. Double
2143
+ * Pipe (||) denotes the OR condition, whereas Triple-colon (:::)
2144
+ * indicates a new filter paramater applied as an AND condition.
2145
+ * @param {boolean} [arg.filters] - This is a boolean value, True for
2146
+ * fetching all filter parameters and False for disabling the filter parameters.
2147
+ * @param {string} [arg.sortOn] - The order in which the list of products
2148
+ * should be sorted, e.g. popularity, price, latest and discount, in
2149
+ * either ascending or descending order. See the supported values below.
2150
+ * @param {string} [arg.pageId] - Page ID to retrieve next set of results.
2151
+ * @param {number} [arg.pageSize] - The number of items to retrieve in each page.
1907
2152
  * @param {number} [arg.pageNo] - The page number to navigate through the
1908
2153
  * given set of results.
1909
- * @param {number} [arg.pageSize] - The number of items to retrieve in each page.
1910
- * @returns {Promise<ProductSizeSellersResponseV3>} - Success response
1911
- * @summary: Get the sellers of a product size at a PIN Code
1912
- * @description: A product of a particular size may be sold by multiple sellers. Use this API to fetch the sellers having the stock of a particular size at a given PIN Code.
2154
+ * @param {string} [arg.pageType] - Available pagination types are cursor or number.
2155
+ * @returns {Promise<ProductListingResponse>} - Success response
2156
+ * @summary: Get all the products
2157
+ * @description: Use this API to list all the products. You may choose a sort order or make arbitrary search queries by entering the product name, brand, category or collection.
1913
2158
  */
1914
- getProductSellersBySlug({
1915
- slug,
1916
- size,
1917
- pincode,
1918
- strategy,
1919
- pageNo,
2159
+ async getProducts({
2160
+ q,
2161
+ f,
2162
+ filters,
2163
+ sortOn,
2164
+ pageId,
1920
2165
  pageSize,
2166
+ pageNo,
2167
+ pageType,
1921
2168
  } = {}) {
1922
- const { error } = CatalogValidator.getProductSellersBySlug().validate(
1923
- { slug, size, pincode, strategy, pageNo, pageSize },
2169
+ const { error } = CatalogValidator.getProducts().validate(
2170
+ { q, f, filters, sortOn, pageId, pageSize, pageNo, pageType },
1924
2171
  { abortEarly: false, allowUnknown: true }
1925
2172
  );
1926
2173
  if (error) {
@@ -1928,73 +2175,357 @@ class Catalog {
1928
2175
  }
1929
2176
 
1930
2177
  // Showing warrnings if extra unknown parameters are found
1931
- const {
1932
- error: warrning,
1933
- } = CatalogValidator.getProductSellersBySlug().validate(
1934
- { slug, size, pincode, strategy, pageNo, pageSize },
2178
+ const { error: warrning } = CatalogValidator.getProducts().validate(
2179
+ { q, f, filters, sortOn, pageId, pageSize, pageNo, pageType },
1935
2180
  { abortEarly: false, allowUnknown: false }
1936
2181
  );
1937
2182
  if (warrning) {
1938
- console.log("Parameter Validation warrnings for getProductSellersBySlug");
1939
- console.log(warrning);
2183
+ Logger({
2184
+ level: "WARN",
2185
+ message: "Parameter Validation warrnings for getProducts",
2186
+ });
2187
+ Logger({ level: "WARN", message: warrning });
1940
2188
  }
1941
2189
 
1942
2190
  const query_params = {};
1943
- query_params["pincode"] = pincode;
1944
- query_params["strategy"] = strategy;
1945
- query_params["page_no"] = pageNo;
2191
+ query_params["q"] = q;
2192
+ query_params["f"] = f;
2193
+ query_params["filters"] = filters;
2194
+ query_params["sort_on"] = sortOn;
2195
+ query_params["page_id"] = pageId;
1946
2196
  query_params["page_size"] = pageSize;
2197
+ query_params["page_no"] = pageNo;
2198
+ query_params["page_type"] = pageType;
1947
2199
 
1948
2200
  const xHeaders = {};
1949
2201
 
1950
- return APIClient.execute(
2202
+ const response = await APIClient.execute(
1951
2203
  this._conf,
1952
2204
  "get",
1953
2205
  constructUrl({
1954
- url: this._urls["getProductSellersBySlug"],
1955
- params: { slug, size },
2206
+ url: this._urls["getProducts"],
2207
+ params: {},
1956
2208
  }),
1957
2209
  query_params,
1958
2210
  undefined,
1959
2211
  xHeaders
1960
2212
  );
2213
+
2214
+ const {
2215
+ error: res_error,
2216
+ } = CatalogModel.ProductListingResponse().validate(response, {
2217
+ abortEarly: false,
2218
+ allowUnknown: false,
2219
+ });
2220
+
2221
+ if (res_error) {
2222
+ Logger({
2223
+ level: "WARN",
2224
+ message: "Response Validation Warnnings for getProducts",
2225
+ });
2226
+ Logger({ level: "WARN", message: res_error });
2227
+ }
2228
+
2229
+ return response;
1961
2230
  }
1962
2231
 
1963
2232
  /**
1964
2233
  * @param {Object} arg - Arg object.
1965
- * @param {string} arg.slug - A short, human-readable, URL-friendly
1966
- * identifier of a product. You can get slug value from the endpoint
1967
- * /service/application/catalog/v1.0/products/
1968
- * @param {string} arg.size - A string indicating the size of the product,
1969
- * e.g. S, M, XL. You can get slug value from the endpoint
1970
- * /service/application/catalog/v1.0/products/sizes
1971
- * @param {string} [arg.pincode] - The 6-digit PIN Code of the area near
1972
- * which the selling locations should be searched, e.g. 400059
1973
- * @param {string} [arg.strategy] - Sort stores on the basis of strategy.
1974
- * eg, fast-delivery, low-price, optimal.
2234
+ * @param {string} [arg.q] - The search query for entering partial or full
2235
+ * name of product, brand, category, or collection.
2236
+ * @param {string} [arg.f] - The search filter parameters. Filter parameters
2237
+ * will be passed in f parameter as shown in the example below. Double
2238
+ * Pipe (||) denotes the OR condition, whereas Triple-colon (:::)
2239
+ * indicates a new filter paramater applied as an AND condition.
2240
+ * @param {boolean} [arg.filters] - This is a boolean value, True for
2241
+ * fetching all filter parameters and False for disabling the filter parameters.
2242
+ * @param {string} [arg.sortOn] - The order in which the list of products
2243
+ * should be sorted, e.g. popularity, price, latest and discount, in
2244
+ * either ascending or descending order. See the supported values below.
1975
2245
  * @param {number} [arg.pageSize] - The number of items to retrieve in each page.
1976
- * @summary: Get the sellers of a product size at a PIN Code
1977
- * @description: A product of a particular size may be sold by multiple sellers. Use this API to fetch the sellers having the stock of a particular size at a given PIN Code.
2246
+ * @summary: Get all the products
2247
+ * @description: Use this API to list all the products. You may choose a sort order or make arbitrary search queries by entering the product name, brand, category or collection.
1978
2248
  */
1979
- getProductSellersBySlugPaginator({
1980
- slug,
1981
- size,
1982
- pincode,
1983
- strategy,
2249
+ getProductsPaginator({ q, f, filters, sortOn, pageSize } = {}) {
2250
+ const paginator = new Paginator();
2251
+ const callback = async () => {
2252
+ const pageId = paginator.nextId;
2253
+ const pageNo = paginator.pageNo;
2254
+ const pageType = "cursor";
2255
+ const data = await this.getProducts({
2256
+ q: q,
2257
+ f: f,
2258
+ filters: filters,
2259
+ sortOn: sortOn,
2260
+ pageId: pageId,
2261
+ pageSize: pageSize,
2262
+ pageNo: pageNo,
2263
+ pageType: pageType,
2264
+ });
2265
+ paginator.setPaginator({
2266
+ hasNext: data.page.has_next ? true : false,
2267
+ nextId: data.page.next_id,
2268
+ });
2269
+ return data;
2270
+ };
2271
+ paginator.setCallback(callback);
2272
+ return paginator;
2273
+ }
2274
+
2275
+ /**
2276
+ * @param {Object} arg - Arg object.
2277
+ * @param {string} arg.q - The search query for entering partial or full
2278
+ * name of a product, brand or category. For example, if the given search
2279
+ * query `q` is _ski_, the relevant search suggestions could be _skirt_,
2280
+ * _ski shoes_, __skin cream_ etc.
2281
+ * @returns {Promise<AutoCompleteResponse>} - Success response
2282
+ * @summary: Get relevant suggestions for a search query
2283
+ * @description: Retrieves a list of suggestions for a given search query. Each suggestion is a valid search term that's generated on the basis of query. This is particularly useful to enhance the user experience while using the search tool.
2284
+ */
2285
+ async getSearchResults({ q } = {}) {
2286
+ const { error } = CatalogValidator.getSearchResults().validate(
2287
+ { q },
2288
+ { abortEarly: false, allowUnknown: true }
2289
+ );
2290
+ if (error) {
2291
+ return Promise.reject(new FDKClientValidationError(error));
2292
+ }
2293
+
2294
+ // Showing warrnings if extra unknown parameters are found
2295
+ const { error: warrning } = CatalogValidator.getSearchResults().validate(
2296
+ { q },
2297
+ { abortEarly: false, allowUnknown: false }
2298
+ );
2299
+ if (warrning) {
2300
+ Logger({
2301
+ level: "WARN",
2302
+ message: "Parameter Validation warrnings for getSearchResults",
2303
+ });
2304
+ Logger({ level: "WARN", message: warrning });
2305
+ }
2306
+
2307
+ const query_params = {};
2308
+ query_params["q"] = q;
2309
+
2310
+ const xHeaders = {};
2311
+
2312
+ const response = await APIClient.execute(
2313
+ this._conf,
2314
+ "get",
2315
+ constructUrl({
2316
+ url: this._urls["getSearchResults"],
2317
+ params: {},
2318
+ }),
2319
+ query_params,
2320
+ undefined,
2321
+ xHeaders
2322
+ );
2323
+
2324
+ const {
2325
+ error: res_error,
2326
+ } = CatalogModel.AutoCompleteResponse().validate(response, {
2327
+ abortEarly: false,
2328
+ allowUnknown: false,
2329
+ });
2330
+
2331
+ if (res_error) {
2332
+ Logger({
2333
+ level: "WARN",
2334
+ message: "Response Validation Warnnings for getSearchResults",
2335
+ });
2336
+ Logger({ level: "WARN", message: res_error });
2337
+ }
2338
+
2339
+ return response;
2340
+ }
2341
+
2342
+ /**
2343
+ * @param {Object} arg - Arg object.
2344
+ * @param {string} arg.slug - A short, human-readable, URL-friendly
2345
+ * identifier of a product. You can get slug value from the endpoint
2346
+ * /service/application/catalog/v1.0/products/
2347
+ * @returns {Promise<ProductCompareResponse>} - Success response
2348
+ * @summary: Get comparison between similar products
2349
+ * @description: Use this API to compare a given product automatically with similar products. Only one slug is needed.
2350
+ */
2351
+ async getSimilarComparisonProductBySlug({ slug } = {}) {
2352
+ const {
2353
+ error,
2354
+ } = CatalogValidator.getSimilarComparisonProductBySlug().validate(
2355
+ { slug },
2356
+ { abortEarly: false, allowUnknown: true }
2357
+ );
2358
+ if (error) {
2359
+ return Promise.reject(new FDKClientValidationError(error));
2360
+ }
2361
+
2362
+ // Showing warrnings if extra unknown parameters are found
2363
+ const {
2364
+ error: warrning,
2365
+ } = CatalogValidator.getSimilarComparisonProductBySlug().validate(
2366
+ { slug },
2367
+ { abortEarly: false, allowUnknown: false }
2368
+ );
2369
+ if (warrning) {
2370
+ Logger({
2371
+ level: "WARN",
2372
+ message:
2373
+ "Parameter Validation warrnings for getSimilarComparisonProductBySlug",
2374
+ });
2375
+ Logger({ level: "WARN", message: warrning });
2376
+ }
2377
+
2378
+ const query_params = {};
2379
+
2380
+ const xHeaders = {};
2381
+
2382
+ const response = await APIClient.execute(
2383
+ this._conf,
2384
+ "get",
2385
+ constructUrl({
2386
+ url: this._urls["getSimilarComparisonProductBySlug"],
2387
+ params: { slug },
2388
+ }),
2389
+ query_params,
2390
+ undefined,
2391
+ xHeaders
2392
+ );
2393
+
2394
+ const {
2395
+ error: res_error,
2396
+ } = CatalogModel.ProductCompareResponse().validate(response, {
2397
+ abortEarly: false,
2398
+ allowUnknown: false,
2399
+ });
2400
+
2401
+ if (res_error) {
2402
+ Logger({
2403
+ level: "WARN",
2404
+ message:
2405
+ "Response Validation Warnnings for getSimilarComparisonProductBySlug",
2406
+ });
2407
+ Logger({ level: "WARN", message: res_error });
2408
+ }
2409
+
2410
+ return response;
2411
+ }
2412
+
2413
+ /**
2414
+ * @param {Object} arg - Arg object.
2415
+ * @param {number} [arg.pageNo] - The page number to navigate through the
2416
+ * given set of results.
2417
+ * @param {number} [arg.pageSize] - Number of items to retrieve in each page.
2418
+ * @param {string} [arg.q] - Search a store by its name or store_code.
2419
+ * @param {string} [arg.city] - Search stores by the city in which they are situated.
2420
+ * @param {number} [arg.range] - Use this to retrieve stores within a
2421
+ * particular range in meters, e.g. 10000, to indicate a 10km range
2422
+ * @param {number} [arg.latitude] - Latitude of the location from where one
2423
+ * wants to retreive the nearest stores, e.g. 72.8691788
2424
+ * @param {number} [arg.longitude] - Longitude of the location from where
2425
+ * one wants to retreive the nearest stores, e.g. 19.1174114
2426
+ * @returns {Promise<StoreListingResponse>} - Success response
2427
+ * @summary: Get store meta information.
2428
+ * @description: Use this API to get a list of stores in a specific application.
2429
+ */
2430
+ async getStores({
2431
+ pageNo,
1984
2432
  pageSize,
2433
+ q,
2434
+ city,
2435
+ range,
2436
+ latitude,
2437
+ longitude,
1985
2438
  } = {}) {
2439
+ const { error } = CatalogValidator.getStores().validate(
2440
+ { pageNo, pageSize, q, city, range, latitude, longitude },
2441
+ { abortEarly: false, allowUnknown: true }
2442
+ );
2443
+ if (error) {
2444
+ return Promise.reject(new FDKClientValidationError(error));
2445
+ }
2446
+
2447
+ // Showing warrnings if extra unknown parameters are found
2448
+ const { error: warrning } = CatalogValidator.getStores().validate(
2449
+ { pageNo, pageSize, q, city, range, latitude, longitude },
2450
+ { abortEarly: false, allowUnknown: false }
2451
+ );
2452
+ if (warrning) {
2453
+ Logger({
2454
+ level: "WARN",
2455
+ message: "Parameter Validation warrnings for getStores",
2456
+ });
2457
+ Logger({ level: "WARN", message: warrning });
2458
+ }
2459
+
2460
+ const query_params = {};
2461
+ query_params["page_no"] = pageNo;
2462
+ query_params["page_size"] = pageSize;
2463
+ query_params["q"] = q;
2464
+ query_params["city"] = city;
2465
+ query_params["range"] = range;
2466
+ query_params["latitude"] = latitude;
2467
+ query_params["longitude"] = longitude;
2468
+
2469
+ const xHeaders = {};
2470
+
2471
+ const response = await APIClient.execute(
2472
+ this._conf,
2473
+ "get",
2474
+ constructUrl({
2475
+ url: this._urls["getStores"],
2476
+ params: {},
2477
+ }),
2478
+ query_params,
2479
+ undefined,
2480
+ xHeaders
2481
+ );
2482
+
2483
+ const {
2484
+ error: res_error,
2485
+ } = CatalogModel.StoreListingResponse().validate(response, {
2486
+ abortEarly: false,
2487
+ allowUnknown: false,
2488
+ });
2489
+
2490
+ if (res_error) {
2491
+ Logger({
2492
+ level: "WARN",
2493
+ message: "Response Validation Warnnings for getStores",
2494
+ });
2495
+ Logger({ level: "WARN", message: res_error });
2496
+ }
2497
+
2498
+ return response;
2499
+ }
2500
+
2501
+ /**
2502
+ * @param {Object} arg - Arg object.
2503
+ * @param {number} [arg.pageSize] - Number of items to retrieve in each page.
2504
+ * @param {string} [arg.q] - Search a store by its name or store_code.
2505
+ * @param {string} [arg.city] - Search stores by the city in which they are situated.
2506
+ * @param {number} [arg.range] - Use this to retrieve stores within a
2507
+ * particular range in meters, e.g. 10000, to indicate a 10km range
2508
+ * @param {number} [arg.latitude] - Latitude of the location from where one
2509
+ * wants to retreive the nearest stores, e.g. 72.8691788
2510
+ * @param {number} [arg.longitude] - Longitude of the location from where
2511
+ * one wants to retreive the nearest stores, e.g. 19.1174114
2512
+ * @summary: Get store meta information.
2513
+ * @description: Use this API to get a list of stores in a specific application.
2514
+ */
2515
+ getStoresPaginator({ pageSize, q, city, range, latitude, longitude } = {}) {
1986
2516
  const paginator = new Paginator();
1987
2517
  const callback = async () => {
1988
2518
  const pageId = paginator.nextId;
1989
2519
  const pageNo = paginator.pageNo;
1990
2520
  const pageType = "number";
1991
- const data = await this.getProductSellersBySlug({
1992
- slug: slug,
1993
- size: size,
1994
- pincode: pincode,
1995
- strategy: strategy,
2521
+ const data = await this.getStores({
1996
2522
  pageNo: pageNo,
1997
2523
  pageSize: pageSize,
2524
+ q: q,
2525
+ city: city,
2526
+ range: range,
2527
+ latitude: latitude,
2528
+ longitude: longitude,
1998
2529
  });
1999
2530
  paginator.setPaginator({
2000
2531
  hasNext: data.page.has_next ? true : false,
@@ -2005,6 +2536,71 @@ class Catalog {
2005
2536
  paginator.setCallback(callback);
2006
2537
  return paginator;
2007
2538
  }
2539
+
2540
+ /**
2541
+ * @param {Object} arg - Arg object.
2542
+ * @param {string} arg.collectionType - Type of collection followed, i.e.
2543
+ * products, brands, or collections.
2544
+ * @param {string} arg.collectionId - The ID of the collection type.
2545
+ * @returns {Promise<FollowPostResponse>} - Success response
2546
+ * @summary: Unfollow an entity (product/brand/collection)
2547
+ * @description: You can undo a followed product, brand or collection by its ID. This action is referred as _unfollow_.
2548
+ */
2549
+ async unfollowById({ collectionType, collectionId } = {}) {
2550
+ const { error } = CatalogValidator.unfollowById().validate(
2551
+ { collectionType, collectionId },
2552
+ { abortEarly: false, allowUnknown: true }
2553
+ );
2554
+ if (error) {
2555
+ return Promise.reject(new FDKClientValidationError(error));
2556
+ }
2557
+
2558
+ // Showing warrnings if extra unknown parameters are found
2559
+ const { error: warrning } = CatalogValidator.unfollowById().validate(
2560
+ { collectionType, collectionId },
2561
+ { abortEarly: false, allowUnknown: false }
2562
+ );
2563
+ if (warrning) {
2564
+ Logger({
2565
+ level: "WARN",
2566
+ message: "Parameter Validation warrnings for unfollowById",
2567
+ });
2568
+ Logger({ level: "WARN", message: warrning });
2569
+ }
2570
+
2571
+ const query_params = {};
2572
+
2573
+ const xHeaders = {};
2574
+
2575
+ const response = await APIClient.execute(
2576
+ this._conf,
2577
+ "delete",
2578
+ constructUrl({
2579
+ url: this._urls["unfollowById"],
2580
+ params: { collectionType, collectionId },
2581
+ }),
2582
+ query_params,
2583
+ undefined,
2584
+ xHeaders
2585
+ );
2586
+
2587
+ const {
2588
+ error: res_error,
2589
+ } = CatalogModel.FollowPostResponse().validate(response, {
2590
+ abortEarly: false,
2591
+ allowUnknown: false,
2592
+ });
2593
+
2594
+ if (res_error) {
2595
+ Logger({
2596
+ level: "WARN",
2597
+ message: "Response Validation Warnnings for unfollowById",
2598
+ });
2599
+ Logger({ level: "WARN", message: res_error });
2600
+ }
2601
+
2602
+ return response;
2603
+ }
2008
2604
  }
2009
2605
 
2010
2606
  module.exports = Catalog;