@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,33 +3,35 @@ const constructUrl = require("../constructUrl");
3
3
  const Paginator = require("../../common/Paginator");
4
4
  const { FDKClientValidationError } = require("../../common/FDKError");
5
5
  const OrderValidator = require("./OrderApplicationValidator");
6
+ const OrderModel = require("./OrderApplicationModel");
7
+ const { Logger } = require("./../../common/Logger");
6
8
 
7
9
  class Order {
8
10
  constructor(_conf) {
9
11
  this._conf = _conf;
10
12
  this._relativeUrls = {
11
- getOrders: "/service/application/order/v1.0/orders",
13
+ getCustomerDetailsByShipmentId:
14
+ "/service/application/order/v1.0/orders/{order_id}/shipments/{shipment_id}/customer-details",
15
+ getInvoiceByShipmentId:
16
+ "/service/application/order/v1.0/orders/shipments/{shipment_id}/invoice",
12
17
  getOrderById: "/service/application/order/v1.0/orders/{order_id}",
18
+ getOrders: "/service/application/order/v1.0/orders",
13
19
  getPosOrderById:
14
20
  "/service/application/order/v1.0/orders/pos-order/{order_id}",
15
- getShipmentById:
16
- "/service/application/order/v1.0/orders/shipments/{shipment_id}",
17
- getInvoiceByShipmentId:
18
- "/service/application/order/v1.0/orders/shipments/{shipment_id}/invoice",
19
- trackShipment:
20
- "/service/application/order/v1.0/orders/shipments/{shipment_id}/track",
21
- getCustomerDetailsByShipmentId:
22
- "/service/application/order/v1.0/orders/{order_id}/shipments/{shipment_id}/customer-details",
23
- sendOtpToShipmentCustomer:
24
- "/service/application/order/v1.0/orders/{order_id}/shipments/{shipment_id}/otp/send/",
25
- verifyOtpShipmentCustomer:
26
- "/service/application/order/v1.0/orders/{order_id}/shipments/{shipment_id}/otp/verify/",
27
21
  getShipmentBagReasons:
28
22
  "/service/application/order/v1.0/orders/shipments/{shipment_id}/bags/{bag_id}/reasons",
23
+ getShipmentById:
24
+ "/service/application/order/v1.0/orders/shipments/{shipment_id}",
29
25
  getShipmentReasons:
30
26
  "/service/application/order/v1.0/orders/shipments/{shipment_id}/reasons",
27
+ sendOtpToShipmentCustomer:
28
+ "/service/application/order/v1.0/orders/{order_id}/shipments/{shipment_id}/otp/send/",
29
+ trackShipment:
30
+ "/service/application/order/v1.0/orders/shipments/{shipment_id}/track",
31
31
  updateShipmentStatus:
32
32
  "/service/application/order/v1.0/orders/shipments/{shipment_id}/status",
33
+ verifyOtpShipmentCustomer:
34
+ "/service/application/order/v1.0/orders/{order_id}/shipments/{shipment_id}/otp/verify/",
33
35
  };
34
36
  this._urls = Object.entries(this._relativeUrls).reduce(
35
37
  (urls, [method, relativeUrl]) => {
@@ -49,24 +51,18 @@ class Order {
49
51
 
50
52
  /**
51
53
  * @param {Object} arg - Arg object.
52
- * @param {number} [arg.status] - A filter to retrieve orders by their
53
- * current status such as _placed_, _delivered_, etc.
54
- * @param {number} [arg.pageNo] - The page number to navigate through the
55
- * given set of results. Default value is 1.
56
- * @param {number} [arg.pageSize] - The number of items to retrieve in each
57
- * page. Default value is 10.
58
- * @param {string} [arg.fromDate] - The date from which the orders should be
59
- * retrieved.
60
- * @param {string} [arg.toDate] - The date till which the orders should be retrieved.
61
- * @param {string} [arg.customMeta] - A filter and retrieve data using
62
- * special fields included for special use-cases
63
- * @returns {Promise<OrderList>} - Success response
64
- * @summary: Get all orders
65
- * @description: Use this API to retrieve all the orders.
54
+ * @param {string} arg.orderId - ID of the shipment. An order may contain
55
+ * multiple items and may get divided into one or more shipment, each
56
+ * having its own ID.
57
+ * @param {string} arg.shipmentId - A unique number used for identifying and
58
+ * tracking your orders.
59
+ * @returns {Promise<CustomerDetailsResponse>} - Success response
60
+ * @summary: Get Customer Details by Shipment Id
61
+ * @description: Use this API to retrieve customer details such as mobileno using Shipment ID.
66
62
  */
67
- getOrders({ status, pageNo, pageSize, fromDate, toDate, customMeta } = {}) {
68
- const { error } = OrderValidator.getOrders().validate(
69
- { status, pageNo, pageSize, fromDate, toDate, customMeta },
63
+ async getCustomerDetailsByShipmentId({ orderId, shipmentId } = {}) {
64
+ const { error } = OrderValidator.getCustomerDetailsByShipmentId().validate(
65
+ { orderId, shipmentId },
70
66
  { abortEarly: false, allowUnknown: true }
71
67
  );
72
68
  if (error) {
@@ -74,49 +70,66 @@ class Order {
74
70
  }
75
71
 
76
72
  // Showing warrnings if extra unknown parameters are found
77
- const { error: warrning } = OrderValidator.getOrders().validate(
78
- { status, pageNo, pageSize, fromDate, toDate, customMeta },
73
+ const {
74
+ error: warrning,
75
+ } = OrderValidator.getCustomerDetailsByShipmentId().validate(
76
+ { orderId, shipmentId },
79
77
  { abortEarly: false, allowUnknown: false }
80
78
  );
81
79
  if (warrning) {
82
- console.log("Parameter Validation warrnings for getOrders");
83
- console.log(warrning);
80
+ Logger({
81
+ level: "WARN",
82
+ message:
83
+ "Parameter Validation warrnings for getCustomerDetailsByShipmentId",
84
+ });
85
+ Logger({ level: "WARN", message: warrning });
84
86
  }
85
87
 
86
88
  const query_params = {};
87
- query_params["status"] = status;
88
- query_params["page_no"] = pageNo;
89
- query_params["page_size"] = pageSize;
90
- query_params["from_date"] = fromDate;
91
- query_params["to_date"] = toDate;
92
- query_params["custom_meta"] = customMeta;
93
89
 
94
90
  const xHeaders = {};
95
91
 
96
- return APIClient.execute(
92
+ const response = await APIClient.execute(
97
93
  this._conf,
98
94
  "get",
99
95
  constructUrl({
100
- url: this._urls["getOrders"],
101
- params: {},
96
+ url: this._urls["getCustomerDetailsByShipmentId"],
97
+ params: { orderId, shipmentId },
102
98
  }),
103
99
  query_params,
104
100
  undefined,
105
101
  xHeaders
106
102
  );
103
+
104
+ const {
105
+ error: res_error,
106
+ } = OrderModel.CustomerDetailsResponse().validate(response, {
107
+ abortEarly: false,
108
+ allowUnknown: false,
109
+ });
110
+
111
+ if (res_error) {
112
+ Logger({
113
+ level: "WARN",
114
+ message:
115
+ "Response Validation Warnnings for getCustomerDetailsByShipmentId",
116
+ });
117
+ Logger({ level: "WARN", message: res_error });
118
+ }
119
+
120
+ return response;
107
121
  }
108
122
 
109
123
  /**
110
124
  * @param {Object} arg - Arg object.
111
- * @param {string} arg.orderId - A unique number used for identifying and
112
- * tracking your orders.
113
- * @returns {Promise<OrderById>} - Success response
114
- * @summary: Get details of an order
115
- * @description: Use this API to retrieve order details such as tracking details, shipment, store information using Fynd Order ID.
125
+ * @param {string} arg.shipmentId - ID of the shipment.
126
+ * @returns {Promise<ResponseGetInvoiceShipment>} - Success response
127
+ * @summary: Get Invoice of a shipment
128
+ * @description: Use this API to retrieve shipment invoice.
116
129
  */
117
- getOrderById({ orderId } = {}) {
118
- const { error } = OrderValidator.getOrderById().validate(
119
- { orderId },
130
+ async getInvoiceByShipmentId({ shipmentId } = {}) {
131
+ const { error } = OrderValidator.getInvoiceByShipmentId().validate(
132
+ { shipmentId },
120
133
  { abortEarly: false, allowUnknown: true }
121
134
  );
122
135
  if (error) {
@@ -124,42 +137,64 @@ class Order {
124
137
  }
125
138
 
126
139
  // Showing warrnings if extra unknown parameters are found
127
- const { error: warrning } = OrderValidator.getOrderById().validate(
128
- { orderId },
140
+ const {
141
+ error: warrning,
142
+ } = OrderValidator.getInvoiceByShipmentId().validate(
143
+ { shipmentId },
129
144
  { abortEarly: false, allowUnknown: false }
130
145
  );
131
146
  if (warrning) {
132
- console.log("Parameter Validation warrnings for getOrderById");
133
- console.log(warrning);
147
+ Logger({
148
+ level: "WARN",
149
+ message: "Parameter Validation warrnings for getInvoiceByShipmentId",
150
+ });
151
+ Logger({ level: "WARN", message: warrning });
134
152
  }
135
153
 
136
154
  const query_params = {};
137
155
 
138
156
  const xHeaders = {};
139
157
 
140
- return APIClient.execute(
158
+ const response = await APIClient.execute(
141
159
  this._conf,
142
160
  "get",
143
161
  constructUrl({
144
- url: this._urls["getOrderById"],
145
- params: { orderId },
162
+ url: this._urls["getInvoiceByShipmentId"],
163
+ params: { shipmentId },
146
164
  }),
147
165
  query_params,
148
166
  undefined,
149
167
  xHeaders
150
168
  );
169
+
170
+ const {
171
+ error: res_error,
172
+ } = OrderModel.ResponseGetInvoiceShipment().validate(response, {
173
+ abortEarly: false,
174
+ allowUnknown: false,
175
+ });
176
+
177
+ if (res_error) {
178
+ Logger({
179
+ level: "WARN",
180
+ message: "Response Validation Warnnings for getInvoiceByShipmentId",
181
+ });
182
+ Logger({ level: "WARN", message: res_error });
183
+ }
184
+
185
+ return response;
151
186
  }
152
187
 
153
188
  /**
154
189
  * @param {Object} arg - Arg object.
155
190
  * @param {string} arg.orderId - A unique number used for identifying and
156
191
  * tracking your orders.
157
- * @returns {Promise<OrderList>} - Success response
158
- * @summary: Get POS Order
159
- * @description: Use this API to retrieve a POS order and all its details such as tracking details, shipment, store information using Fynd Order ID.
192
+ * @returns {Promise<OrderById>} - Success response
193
+ * @summary: Get details of an order
194
+ * @description: Use this API to retrieve order details such as tracking details, shipment, store information using Fynd Order ID.
160
195
  */
161
- getPosOrderById({ orderId } = {}) {
162
- const { error } = OrderValidator.getPosOrderById().validate(
196
+ async getOrderById({ orderId } = {}) {
197
+ const { error } = OrderValidator.getOrderById().validate(
163
198
  { orderId },
164
199
  { abortEarly: false, allowUnknown: true }
165
200
  );
@@ -168,44 +203,77 @@ class Order {
168
203
  }
169
204
 
170
205
  // Showing warrnings if extra unknown parameters are found
171
- const { error: warrning } = OrderValidator.getPosOrderById().validate(
206
+ const { error: warrning } = OrderValidator.getOrderById().validate(
172
207
  { orderId },
173
208
  { abortEarly: false, allowUnknown: false }
174
209
  );
175
210
  if (warrning) {
176
- console.log("Parameter Validation warrnings for getPosOrderById");
177
- console.log(warrning);
211
+ Logger({
212
+ level: "WARN",
213
+ message: "Parameter Validation warrnings for getOrderById",
214
+ });
215
+ Logger({ level: "WARN", message: warrning });
178
216
  }
179
217
 
180
218
  const query_params = {};
181
219
 
182
220
  const xHeaders = {};
183
221
 
184
- return APIClient.execute(
222
+ const response = await APIClient.execute(
185
223
  this._conf,
186
224
  "get",
187
225
  constructUrl({
188
- url: this._urls["getPosOrderById"],
226
+ url: this._urls["getOrderById"],
189
227
  params: { orderId },
190
228
  }),
191
229
  query_params,
192
230
  undefined,
193
231
  xHeaders
194
232
  );
233
+
234
+ const { error: res_error } = OrderModel.OrderById().validate(response, {
235
+ abortEarly: false,
236
+ allowUnknown: false,
237
+ });
238
+
239
+ if (res_error) {
240
+ Logger({
241
+ level: "WARN",
242
+ message: "Response Validation Warnnings for getOrderById",
243
+ });
244
+ Logger({ level: "WARN", message: res_error });
245
+ }
246
+
247
+ return response;
195
248
  }
196
249
 
197
250
  /**
198
251
  * @param {Object} arg - Arg object.
199
- * @param {string} arg.shipmentId - ID of the shipment. An order may contain
200
- * multiple items and may get divided into one or more shipment, each
201
- * having its own ID.
202
- * @returns {Promise<ShipmentById>} - Success response
203
- * @summary: Get details of a shipment
204
- * @description: Use this API to retrieve shipment details such as price breakup, tracking details, store information, etc. using Shipment ID.
252
+ * @param {number} [arg.status] - A filter to retrieve orders by their
253
+ * current status such as _placed_, _delivered_, etc.
254
+ * @param {number} [arg.pageNo] - The page number to navigate through the
255
+ * given set of results. Default value is 1.
256
+ * @param {number} [arg.pageSize] - The number of items to retrieve in each
257
+ * page. Default value is 10.
258
+ * @param {string} [arg.fromDate] - The date from which the orders should be
259
+ * retrieved.
260
+ * @param {string} [arg.toDate] - The date till which the orders should be retrieved.
261
+ * @param {string} [arg.customMeta] - A filter and retrieve data using
262
+ * special fields included for special use-cases
263
+ * @returns {Promise<OrderList>} - Success response
264
+ * @summary: Get all orders
265
+ * @description: Use this API to retrieve all the orders.
205
266
  */
206
- getShipmentById({ shipmentId } = {}) {
207
- const { error } = OrderValidator.getShipmentById().validate(
208
- { shipmentId },
267
+ async getOrders({
268
+ status,
269
+ pageNo,
270
+ pageSize,
271
+ fromDate,
272
+ toDate,
273
+ customMeta,
274
+ } = {}) {
275
+ const { error } = OrderValidator.getOrders().validate(
276
+ { status, pageNo, pageSize, fromDate, toDate, customMeta },
209
277
  { abortEarly: false, allowUnknown: true }
210
278
  );
211
279
  if (error) {
@@ -213,42 +281,67 @@ class Order {
213
281
  }
214
282
 
215
283
  // Showing warrnings if extra unknown parameters are found
216
- const { error: warrning } = OrderValidator.getShipmentById().validate(
217
- { shipmentId },
284
+ const { error: warrning } = OrderValidator.getOrders().validate(
285
+ { status, pageNo, pageSize, fromDate, toDate, customMeta },
218
286
  { abortEarly: false, allowUnknown: false }
219
287
  );
220
288
  if (warrning) {
221
- console.log("Parameter Validation warrnings for getShipmentById");
222
- console.log(warrning);
289
+ Logger({
290
+ level: "WARN",
291
+ message: "Parameter Validation warrnings for getOrders",
292
+ });
293
+ Logger({ level: "WARN", message: warrning });
223
294
  }
224
295
 
225
296
  const query_params = {};
297
+ query_params["status"] = status;
298
+ query_params["page_no"] = pageNo;
299
+ query_params["page_size"] = pageSize;
300
+ query_params["from_date"] = fromDate;
301
+ query_params["to_date"] = toDate;
302
+ query_params["custom_meta"] = customMeta;
226
303
 
227
304
  const xHeaders = {};
228
305
 
229
- return APIClient.execute(
306
+ const response = await APIClient.execute(
230
307
  this._conf,
231
308
  "get",
232
309
  constructUrl({
233
- url: this._urls["getShipmentById"],
234
- params: { shipmentId },
310
+ url: this._urls["getOrders"],
311
+ params: {},
235
312
  }),
236
313
  query_params,
237
314
  undefined,
238
315
  xHeaders
239
316
  );
317
+
318
+ const { error: res_error } = OrderModel.OrderList().validate(response, {
319
+ abortEarly: false,
320
+ allowUnknown: false,
321
+ });
322
+
323
+ if (res_error) {
324
+ Logger({
325
+ level: "WARN",
326
+ message: "Response Validation Warnnings for getOrders",
327
+ });
328
+ Logger({ level: "WARN", message: res_error });
329
+ }
330
+
331
+ return response;
240
332
  }
241
333
 
242
334
  /**
243
335
  * @param {Object} arg - Arg object.
244
- * @param {string} arg.shipmentId - ID of the shipment.
245
- * @returns {Promise<ResponseGetInvoiceShipment>} - Success response
246
- * @summary: Get Invoice of a shipment
247
- * @description: Use this API to retrieve shipment invoice.
336
+ * @param {string} arg.orderId - A unique number used for identifying and
337
+ * tracking your orders.
338
+ * @returns {Promise<OrderList>} - Success response
339
+ * @summary: Get POS Order
340
+ * @description: Use this API to retrieve a POS order and all its details such as tracking details, shipment, store information using Fynd Order ID.
248
341
  */
249
- getInvoiceByShipmentId({ shipmentId } = {}) {
250
- const { error } = OrderValidator.getInvoiceByShipmentId().validate(
251
- { shipmentId },
342
+ async getPosOrderById({ orderId } = {}) {
343
+ const { error } = OrderValidator.getPosOrderById().validate(
344
+ { orderId },
252
345
  { abortEarly: false, allowUnknown: true }
253
346
  );
254
347
  if (error) {
@@ -256,46 +349,64 @@ class Order {
256
349
  }
257
350
 
258
351
  // Showing warrnings if extra unknown parameters are found
259
- const {
260
- error: warrning,
261
- } = OrderValidator.getInvoiceByShipmentId().validate(
262
- { shipmentId },
352
+ const { error: warrning } = OrderValidator.getPosOrderById().validate(
353
+ { orderId },
263
354
  { abortEarly: false, allowUnknown: false }
264
355
  );
265
356
  if (warrning) {
266
- console.log("Parameter Validation warrnings for getInvoiceByShipmentId");
267
- console.log(warrning);
357
+ Logger({
358
+ level: "WARN",
359
+ message: "Parameter Validation warrnings for getPosOrderById",
360
+ });
361
+ Logger({ level: "WARN", message: warrning });
268
362
  }
269
363
 
270
364
  const query_params = {};
271
365
 
272
366
  const xHeaders = {};
273
367
 
274
- return APIClient.execute(
368
+ const response = await APIClient.execute(
275
369
  this._conf,
276
370
  "get",
277
371
  constructUrl({
278
- url: this._urls["getInvoiceByShipmentId"],
279
- params: { shipmentId },
372
+ url: this._urls["getPosOrderById"],
373
+ params: { orderId },
280
374
  }),
281
375
  query_params,
282
376
  undefined,
283
377
  xHeaders
284
378
  );
379
+
380
+ const { error: res_error } = OrderModel.OrderList().validate(response, {
381
+ abortEarly: false,
382
+ allowUnknown: false,
383
+ });
384
+
385
+ if (res_error) {
386
+ Logger({
387
+ level: "WARN",
388
+ message: "Response Validation Warnnings for getPosOrderById",
389
+ });
390
+ Logger({ level: "WARN", message: res_error });
391
+ }
392
+
393
+ return response;
285
394
  }
286
395
 
287
396
  /**
288
397
  * @param {Object} arg - Arg object.
289
- * @param {string} arg.shipmentId - ID of the shipment. An order may contain
398
+ * @param {string} arg.shipmentId - ID of the bag. An order may contain
290
399
  * multiple items and may get divided into one or more shipment, each
291
400
  * having its own ID.
292
- * @returns {Promise<ShipmentTrack>} - Success response
293
- * @summary: Track shipment
294
- * @description: Track Shipment by shipment id, for application based on application Id
401
+ * @param {string} arg.bagId - ID of the bag. An order may contain multiple
402
+ * items and may get divided into one or more shipment, each having its own ID.
403
+ * @returns {Promise<ShipmentBagReasons>} - Success response
404
+ * @summary: Get reasons behind full or partial cancellation of a shipment
405
+ * @description: Use this API to retrieve the issues that led to the cancellation of bags within a shipment.
295
406
  */
296
- trackShipment({ shipmentId } = {}) {
297
- const { error } = OrderValidator.trackShipment().validate(
298
- { shipmentId },
407
+ async getShipmentBagReasons({ shipmentId, bagId } = {}) {
408
+ const { error } = OrderValidator.getShipmentBagReasons().validate(
409
+ { shipmentId, bagId },
299
410
  { abortEarly: false, allowUnknown: true }
300
411
  );
301
412
  if (error) {
@@ -303,46 +414,64 @@ class Order {
303
414
  }
304
415
 
305
416
  // Showing warrnings if extra unknown parameters are found
306
- const { error: warrning } = OrderValidator.trackShipment().validate(
307
- { shipmentId },
417
+ const { error: warrning } = OrderValidator.getShipmentBagReasons().validate(
418
+ { shipmentId, bagId },
308
419
  { abortEarly: false, allowUnknown: false }
309
420
  );
310
421
  if (warrning) {
311
- console.log("Parameter Validation warrnings for trackShipment");
312
- console.log(warrning);
422
+ Logger({
423
+ level: "WARN",
424
+ message: "Parameter Validation warrnings for getShipmentBagReasons",
425
+ });
426
+ Logger({ level: "WARN", message: warrning });
313
427
  }
314
428
 
315
429
  const query_params = {};
316
430
 
317
431
  const xHeaders = {};
318
432
 
319
- return APIClient.execute(
433
+ const response = await APIClient.execute(
320
434
  this._conf,
321
435
  "get",
322
436
  constructUrl({
323
- url: this._urls["trackShipment"],
324
- params: { shipmentId },
437
+ url: this._urls["getShipmentBagReasons"],
438
+ params: { shipmentId, bagId },
325
439
  }),
326
440
  query_params,
327
441
  undefined,
328
442
  xHeaders
329
443
  );
444
+
445
+ const {
446
+ error: res_error,
447
+ } = OrderModel.ShipmentBagReasons().validate(response, {
448
+ abortEarly: false,
449
+ allowUnknown: false,
450
+ });
451
+
452
+ if (res_error) {
453
+ Logger({
454
+ level: "WARN",
455
+ message: "Response Validation Warnnings for getShipmentBagReasons",
456
+ });
457
+ Logger({ level: "WARN", message: res_error });
458
+ }
459
+
460
+ return response;
330
461
  }
331
462
 
332
463
  /**
333
464
  * @param {Object} arg - Arg object.
334
- * @param {string} arg.orderId - ID of the shipment. An order may contain
465
+ * @param {string} arg.shipmentId - ID of the shipment. An order may contain
335
466
  * multiple items and may get divided into one or more shipment, each
336
467
  * having its own ID.
337
- * @param {string} arg.shipmentId - A unique number used for identifying and
338
- * tracking your orders.
339
- * @returns {Promise<CustomerDetailsResponse>} - Success response
340
- * @summary: Get Customer Details by Shipment Id
341
- * @description: Use this API to retrieve customer details such as mobileno using Shipment ID.
468
+ * @returns {Promise<ShipmentById>} - Success response
469
+ * @summary: Get details of a shipment
470
+ * @description: Use this API to retrieve shipment details such as price breakup, tracking details, store information, etc. using Shipment ID.
342
471
  */
343
- getCustomerDetailsByShipmentId({ orderId, shipmentId } = {}) {
344
- const { error } = OrderValidator.getCustomerDetailsByShipmentId().validate(
345
- { orderId, shipmentId },
472
+ async getShipmentById({ shipmentId } = {}) {
473
+ const { error } = OrderValidator.getShipmentById().validate(
474
+ { shipmentId },
346
475
  { abortEarly: false, allowUnknown: true }
347
476
  );
348
477
  if (error) {
@@ -350,50 +479,62 @@ class Order {
350
479
  }
351
480
 
352
481
  // Showing warrnings if extra unknown parameters are found
353
- const {
354
- error: warrning,
355
- } = OrderValidator.getCustomerDetailsByShipmentId().validate(
356
- { orderId, shipmentId },
482
+ const { error: warrning } = OrderValidator.getShipmentById().validate(
483
+ { shipmentId },
357
484
  { abortEarly: false, allowUnknown: false }
358
485
  );
359
486
  if (warrning) {
360
- console.log(
361
- "Parameter Validation warrnings for getCustomerDetailsByShipmentId"
362
- );
363
- console.log(warrning);
487
+ Logger({
488
+ level: "WARN",
489
+ message: "Parameter Validation warrnings for getShipmentById",
490
+ });
491
+ Logger({ level: "WARN", message: warrning });
364
492
  }
365
493
 
366
494
  const query_params = {};
367
495
 
368
496
  const xHeaders = {};
369
497
 
370
- return APIClient.execute(
498
+ const response = await APIClient.execute(
371
499
  this._conf,
372
500
  "get",
373
501
  constructUrl({
374
- url: this._urls["getCustomerDetailsByShipmentId"],
375
- params: { orderId, shipmentId },
502
+ url: this._urls["getShipmentById"],
503
+ params: { shipmentId },
376
504
  }),
377
505
  query_params,
378
506
  undefined,
379
507
  xHeaders
380
508
  );
509
+
510
+ const { error: res_error } = OrderModel.ShipmentById().validate(response, {
511
+ abortEarly: false,
512
+ allowUnknown: false,
513
+ });
514
+
515
+ if (res_error) {
516
+ Logger({
517
+ level: "WARN",
518
+ message: "Response Validation Warnnings for getShipmentById",
519
+ });
520
+ Logger({ level: "WARN", message: res_error });
521
+ }
522
+
523
+ return response;
381
524
  }
382
525
 
383
526
  /**
384
527
  * @param {Object} arg - Arg object.
385
- * @param {string} arg.orderId - A unique number used for identifying and
386
- * tracking your orders.
387
528
  * @param {string} arg.shipmentId - ID of the shipment. An order may contain
388
529
  * multiple items and may get divided into one or more shipment, each
389
530
  * having its own ID.
390
- * @returns {Promise<SendOtpToCustomerResponse>} - Success response
391
- * @summary: Send and Resend Otp code to Order-Shipment customer
392
- * @description: Use this API to send OTP to the customer of the mapped Shipment.
531
+ * @returns {Promise<ShipmentReasons>} - Success response
532
+ * @summary: Get reasons behind full or partial cancellation of a shipment
533
+ * @description: Use this API to retrieve the issues that led to the cancellation of bags within a shipment.
393
534
  */
394
- sendOtpToShipmentCustomer({ orderId, shipmentId } = {}) {
395
- const { error } = OrderValidator.sendOtpToShipmentCustomer().validate(
396
- { orderId, shipmentId },
535
+ async getShipmentReasons({ shipmentId } = {}) {
536
+ const { error } = OrderValidator.getShipmentReasons().validate(
537
+ { shipmentId },
397
538
  { abortEarly: false, allowUnknown: true }
398
539
  );
399
540
  if (error) {
@@ -401,34 +542,48 @@ class Order {
401
542
  }
402
543
 
403
544
  // Showing warrnings if extra unknown parameters are found
404
- const {
405
- error: warrning,
406
- } = OrderValidator.sendOtpToShipmentCustomer().validate(
407
- { orderId, shipmentId },
545
+ const { error: warrning } = OrderValidator.getShipmentReasons().validate(
546
+ { shipmentId },
408
547
  { abortEarly: false, allowUnknown: false }
409
548
  );
410
549
  if (warrning) {
411
- console.log(
412
- "Parameter Validation warrnings for sendOtpToShipmentCustomer"
413
- );
414
- console.log(warrning);
550
+ Logger({
551
+ level: "WARN",
552
+ message: "Parameter Validation warrnings for getShipmentReasons",
553
+ });
554
+ Logger({ level: "WARN", message: warrning });
415
555
  }
416
556
 
417
557
  const query_params = {};
418
558
 
419
559
  const xHeaders = {};
420
560
 
421
- return APIClient.execute(
561
+ const response = await APIClient.execute(
422
562
  this._conf,
423
- "post",
563
+ "get",
424
564
  constructUrl({
425
- url: this._urls["sendOtpToShipmentCustomer"],
426
- params: { orderId, shipmentId },
565
+ url: this._urls["getShipmentReasons"],
566
+ params: { shipmentId },
427
567
  }),
428
568
  query_params,
429
569
  undefined,
430
570
  xHeaders
431
571
  );
572
+
573
+ const { error: res_error } = OrderModel.ShipmentReasons().validate(
574
+ response,
575
+ { abortEarly: false, allowUnknown: false }
576
+ );
577
+
578
+ if (res_error) {
579
+ Logger({
580
+ level: "WARN",
581
+ message: "Response Validation Warnnings for getShipmentReasons",
582
+ });
583
+ Logger({ level: "WARN", message: res_error });
584
+ }
585
+
586
+ return response;
432
587
  }
433
588
 
434
589
  /**
@@ -438,14 +593,13 @@ class Order {
438
593
  * @param {string} arg.shipmentId - ID of the shipment. An order may contain
439
594
  * multiple items and may get divided into one or more shipment, each
440
595
  * having its own ID.
441
- * @param {VerifyOtp} arg.body
442
- * @returns {Promise<VerifyOtpResponse>} - Success response
443
- * @summary: Verify Otp code
444
- * @description: Use this API to verify OTP and create a session token with custom payload.
596
+ * @returns {Promise<SendOtpToCustomerResponse>} - Success response
597
+ * @summary: Send and Resend Otp code to Order-Shipment customer
598
+ * @description: Use this API to send OTP to the customer of the mapped Shipment.
445
599
  */
446
- verifyOtpShipmentCustomer({ orderId, shipmentId, body } = {}) {
447
- const { error } = OrderValidator.verifyOtpShipmentCustomer().validate(
448
- { orderId, shipmentId, body },
600
+ async sendOtpToShipmentCustomer({ orderId, shipmentId } = {}) {
601
+ const { error } = OrderValidator.sendOtpToShipmentCustomer().validate(
602
+ { orderId, shipmentId },
449
603
  { abortEarly: false, allowUnknown: true }
450
604
  );
451
605
  if (error) {
@@ -455,48 +609,64 @@ class Order {
455
609
  // Showing warrnings if extra unknown parameters are found
456
610
  const {
457
611
  error: warrning,
458
- } = OrderValidator.verifyOtpShipmentCustomer().validate(
459
- { orderId, shipmentId, body },
612
+ } = OrderValidator.sendOtpToShipmentCustomer().validate(
613
+ { orderId, shipmentId },
460
614
  { abortEarly: false, allowUnknown: false }
461
615
  );
462
616
  if (warrning) {
463
- console.log(
464
- "Parameter Validation warrnings for verifyOtpShipmentCustomer"
465
- );
466
- console.log(warrning);
617
+ Logger({
618
+ level: "WARN",
619
+ message: "Parameter Validation warrnings for sendOtpToShipmentCustomer",
620
+ });
621
+ Logger({ level: "WARN", message: warrning });
467
622
  }
468
623
 
469
624
  const query_params = {};
470
625
 
471
626
  const xHeaders = {};
472
627
 
473
- return APIClient.execute(
628
+ const response = await APIClient.execute(
474
629
  this._conf,
475
630
  "post",
476
631
  constructUrl({
477
- url: this._urls["verifyOtpShipmentCustomer"],
632
+ url: this._urls["sendOtpToShipmentCustomer"],
478
633
  params: { orderId, shipmentId },
479
634
  }),
480
635
  query_params,
481
- body,
636
+ undefined,
482
637
  xHeaders
483
638
  );
639
+
640
+ const {
641
+ error: res_error,
642
+ } = OrderModel.SendOtpToCustomerResponse().validate(response, {
643
+ abortEarly: false,
644
+ allowUnknown: false,
645
+ });
646
+
647
+ if (res_error) {
648
+ Logger({
649
+ level: "WARN",
650
+ message: "Response Validation Warnnings for sendOtpToShipmentCustomer",
651
+ });
652
+ Logger({ level: "WARN", message: res_error });
653
+ }
654
+
655
+ return response;
484
656
  }
485
657
 
486
658
  /**
487
659
  * @param {Object} arg - Arg object.
488
- * @param {string} arg.shipmentId - ID of the bag. An order may contain
660
+ * @param {string} arg.shipmentId - ID of the shipment. An order may contain
489
661
  * multiple items and may get divided into one or more shipment, each
490
662
  * having its own ID.
491
- * @param {string} arg.bagId - ID of the bag. An order may contain multiple
492
- * items and may get divided into one or more shipment, each having its own ID.
493
- * @returns {Promise<ShipmentBagReasons>} - Success response
494
- * @summary: Get reasons behind full or partial cancellation of a shipment
495
- * @description: Use this API to retrieve the issues that led to the cancellation of bags within a shipment.
663
+ * @returns {Promise<ShipmentTrack>} - Success response
664
+ * @summary: Track shipment
665
+ * @description: Track Shipment by shipment id, for application based on application Id
496
666
  */
497
- getShipmentBagReasons({ shipmentId, bagId } = {}) {
498
- const { error } = OrderValidator.getShipmentBagReasons().validate(
499
- { shipmentId, bagId },
667
+ async trackShipment({ shipmentId } = {}) {
668
+ const { error } = OrderValidator.trackShipment().validate(
669
+ { shipmentId },
500
670
  { abortEarly: false, allowUnknown: true }
501
671
  );
502
672
  if (error) {
@@ -504,30 +674,48 @@ class Order {
504
674
  }
505
675
 
506
676
  // Showing warrnings if extra unknown parameters are found
507
- const { error: warrning } = OrderValidator.getShipmentBagReasons().validate(
508
- { shipmentId, bagId },
677
+ const { error: warrning } = OrderValidator.trackShipment().validate(
678
+ { shipmentId },
509
679
  { abortEarly: false, allowUnknown: false }
510
680
  );
511
681
  if (warrning) {
512
- console.log("Parameter Validation warrnings for getShipmentBagReasons");
513
- console.log(warrning);
682
+ Logger({
683
+ level: "WARN",
684
+ message: "Parameter Validation warrnings for trackShipment",
685
+ });
686
+ Logger({ level: "WARN", message: warrning });
514
687
  }
515
688
 
516
689
  const query_params = {};
517
690
 
518
691
  const xHeaders = {};
519
692
 
520
- return APIClient.execute(
693
+ const response = await APIClient.execute(
521
694
  this._conf,
522
695
  "get",
523
696
  constructUrl({
524
- url: this._urls["getShipmentBagReasons"],
525
- params: { shipmentId, bagId },
697
+ url: this._urls["trackShipment"],
698
+ params: { shipmentId },
526
699
  }),
527
700
  query_params,
528
701
  undefined,
529
702
  xHeaders
530
703
  );
704
+
705
+ const { error: res_error } = OrderModel.ShipmentTrack().validate(response, {
706
+ abortEarly: false,
707
+ allowUnknown: false,
708
+ });
709
+
710
+ if (res_error) {
711
+ Logger({
712
+ level: "WARN",
713
+ message: "Response Validation Warnnings for trackShipment",
714
+ });
715
+ Logger({ level: "WARN", message: res_error });
716
+ }
717
+
718
+ return response;
531
719
  }
532
720
 
533
721
  /**
@@ -535,13 +723,14 @@ class Order {
535
723
  * @param {string} arg.shipmentId - ID of the shipment. An order may contain
536
724
  * multiple items and may get divided into one or more shipment, each
537
725
  * having its own ID.
538
- * @returns {Promise<ShipmentReasons>} - Success response
539
- * @summary: Get reasons behind full or partial cancellation of a shipment
540
- * @description: Use this API to retrieve the issues that led to the cancellation of bags within a shipment.
726
+ * @param {UpdateShipmentStatusRequest} arg.body
727
+ * @returns {Promise<ShipmentApplicationStatusResponse>} - Success response
728
+ * @summary: Update the shipment status
729
+ * @description: Use this API to update the status of a shipment using its shipment ID.
541
730
  */
542
- getShipmentReasons({ shipmentId } = {}) {
543
- const { error } = OrderValidator.getShipmentReasons().validate(
544
- { shipmentId },
731
+ async updateShipmentStatus({ shipmentId, body } = {}) {
732
+ const { error } = OrderValidator.updateShipmentStatus().validate(
733
+ { shipmentId, body },
545
734
  { abortEarly: false, allowUnknown: true }
546
735
  );
547
736
  if (error) {
@@ -549,45 +738,67 @@ class Order {
549
738
  }
550
739
 
551
740
  // Showing warrnings if extra unknown parameters are found
552
- const { error: warrning } = OrderValidator.getShipmentReasons().validate(
553
- { shipmentId },
741
+ const { error: warrning } = OrderValidator.updateShipmentStatus().validate(
742
+ { shipmentId, body },
554
743
  { abortEarly: false, allowUnknown: false }
555
744
  );
556
745
  if (warrning) {
557
- console.log("Parameter Validation warrnings for getShipmentReasons");
558
- console.log(warrning);
746
+ Logger({
747
+ level: "WARN",
748
+ message: "Parameter Validation warrnings for updateShipmentStatus",
749
+ });
750
+ Logger({ level: "WARN", message: warrning });
559
751
  }
560
752
 
561
753
  const query_params = {};
562
754
 
563
755
  const xHeaders = {};
564
756
 
565
- return APIClient.execute(
757
+ const response = await APIClient.execute(
566
758
  this._conf,
567
- "get",
759
+ "put",
568
760
  constructUrl({
569
- url: this._urls["getShipmentReasons"],
761
+ url: this._urls["updateShipmentStatus"],
570
762
  params: { shipmentId },
571
763
  }),
572
764
  query_params,
573
- undefined,
765
+ body,
574
766
  xHeaders
575
767
  );
768
+
769
+ const {
770
+ error: res_error,
771
+ } = OrderModel.ShipmentApplicationStatusResponse().validate(response, {
772
+ abortEarly: false,
773
+ allowUnknown: false,
774
+ });
775
+
776
+ if (res_error) {
777
+ Logger({
778
+ level: "WARN",
779
+ message: "Response Validation Warnnings for updateShipmentStatus",
780
+ });
781
+ Logger({ level: "WARN", message: res_error });
782
+ }
783
+
784
+ return response;
576
785
  }
577
786
 
578
787
  /**
579
788
  * @param {Object} arg - Arg object.
789
+ * @param {string} arg.orderId - A unique number used for identifying and
790
+ * tracking your orders.
580
791
  * @param {string} arg.shipmentId - ID of the shipment. An order may contain
581
792
  * multiple items and may get divided into one or more shipment, each
582
793
  * having its own ID.
583
- * @param {UpdateShipmentStatusRequest} arg.body
584
- * @returns {Promise<ShipmentApplicationStatusResponse>} - Success response
585
- * @summary: Update the shipment status
586
- * @description: Use this API to update the status of a shipment using its shipment ID.
794
+ * @param {VerifyOtp} arg.body
795
+ * @returns {Promise<VerifyOtpResponse>} - Success response
796
+ * @summary: Verify Otp code
797
+ * @description: Use this API to verify OTP and create a session token with custom payload.
587
798
  */
588
- updateShipmentStatus({ shipmentId, body } = {}) {
589
- const { error } = OrderValidator.updateShipmentStatus().validate(
590
- { shipmentId, body },
799
+ async verifyOtpShipmentCustomer({ orderId, shipmentId, body } = {}) {
800
+ const { error } = OrderValidator.verifyOtpShipmentCustomer().validate(
801
+ { orderId, shipmentId, body },
591
802
  { abortEarly: false, allowUnknown: true }
592
803
  );
593
804
  if (error) {
@@ -595,30 +806,52 @@ class Order {
595
806
  }
596
807
 
597
808
  // Showing warrnings if extra unknown parameters are found
598
- const { error: warrning } = OrderValidator.updateShipmentStatus().validate(
599
- { shipmentId, body },
809
+ const {
810
+ error: warrning,
811
+ } = OrderValidator.verifyOtpShipmentCustomer().validate(
812
+ { orderId, shipmentId, body },
600
813
  { abortEarly: false, allowUnknown: false }
601
814
  );
602
815
  if (warrning) {
603
- console.log("Parameter Validation warrnings for updateShipmentStatus");
604
- console.log(warrning);
816
+ Logger({
817
+ level: "WARN",
818
+ message: "Parameter Validation warrnings for verifyOtpShipmentCustomer",
819
+ });
820
+ Logger({ level: "WARN", message: warrning });
605
821
  }
606
822
 
607
823
  const query_params = {};
608
824
 
609
825
  const xHeaders = {};
610
826
 
611
- return APIClient.execute(
827
+ const response = await APIClient.execute(
612
828
  this._conf,
613
- "put",
829
+ "post",
614
830
  constructUrl({
615
- url: this._urls["updateShipmentStatus"],
616
- params: { shipmentId },
831
+ url: this._urls["verifyOtpShipmentCustomer"],
832
+ params: { orderId, shipmentId },
617
833
  }),
618
834
  query_params,
619
835
  body,
620
836
  xHeaders
621
837
  );
838
+
839
+ const {
840
+ error: res_error,
841
+ } = OrderModel.VerifyOtpResponse().validate(response, {
842
+ abortEarly: false,
843
+ allowUnknown: false,
844
+ });
845
+
846
+ if (res_error) {
847
+ Logger({
848
+ level: "WARN",
849
+ message: "Response Validation Warnnings for verifyOtpShipmentCustomer",
850
+ });
851
+ Logger({ level: "WARN", message: res_error });
852
+ }
853
+
854
+ return response;
622
855
  }
623
856
  }
624
857