@gofynd/fdk-client-javascript 1.0.2 → 1.0.4

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 (346) hide show
  1. package/README.md +31 -2
  2. package/index.d.ts +4 -4
  3. package/index.js +9 -10
  4. package/package.json +14 -14
  5. package/sdk/APIClient.d.ts +11 -0
  6. package/sdk/APIClient.js +35 -0
  7. package/sdk/Client.d.ts +6 -0
  8. package/sdk/Client.js +17 -0
  9. package/sdk/Config.d.ts +9 -0
  10. package/sdk/Config.js +17 -0
  11. package/sdk/application/Cart/CartApplicationClient.d.ts +243 -243
  12. package/sdk/application/Cart/CartApplicationClient.js +595 -594
  13. package/sdk/application/Cart/CartApplicationModel.d.ts +64 -63
  14. package/sdk/application/Cart/CartApplicationModel.js +490 -885
  15. package/sdk/application/Cart/CartApplicationValidator.d.ts +17 -17
  16. package/sdk/application/Cart/CartApplicationValidator.js +98 -98
  17. package/sdk/application/Catalog/CatalogApplicationClient.d.ts +358 -358
  18. package/sdk/application/Catalog/CatalogApplicationClient.js +1079 -1078
  19. package/sdk/application/Catalog/CatalogApplicationModel.d.ts +90 -90
  20. package/sdk/application/Catalog/CatalogApplicationModel.js +683 -1249
  21. package/sdk/application/Catalog/CatalogApplicationValidator.d.ts +19 -19
  22. package/sdk/application/Catalog/CatalogApplicationValidator.js +110 -110
  23. package/sdk/application/Common/CommonApplicationClient.d.ts +13 -13
  24. package/sdk/application/Common/CommonApplicationClient.js +43 -42
  25. package/sdk/application/Common/CommonApplicationModel.d.ts +12 -12
  26. package/sdk/application/Common/CommonApplicationModel.js +83 -160
  27. package/sdk/application/Common/CommonApplicationValidator.d.ts +1 -1
  28. package/sdk/application/Common/CommonApplicationValidator.js +6 -6
  29. package/sdk/application/Communication/CommunicationApplicationClient.d.ts +11 -11
  30. package/sdk/application/Communication/CommunicationApplicationClient.js +32 -31
  31. package/sdk/application/Communication/CommunicationApplicationModel.d.ts +6 -6
  32. package/sdk/application/Communication/CommunicationApplicationModel.js +38 -83
  33. package/sdk/application/Communication/CommunicationApplicationValidator.d.ts +1 -1
  34. package/sdk/application/Communication/CommunicationApplicationValidator.js +4 -4
  35. package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +116 -116
  36. package/sdk/application/Configuration/ConfigurationApplicationClient.js +350 -349
  37. package/sdk/application/Configuration/ConfigurationApplicationModel.d.ts +85 -85
  38. package/sdk/application/Configuration/ConfigurationApplicationModel.js +480 -851
  39. package/sdk/application/Configuration/ConfigurationApplicationValidator.d.ts +8 -8
  40. package/sdk/application/Configuration/ConfigurationApplicationValidator.js +33 -33
  41. package/sdk/application/Content/ContentApplicationClient.d.ts +67 -67
  42. package/sdk/application/Content/ContentApplicationClient.js +216 -215
  43. package/sdk/application/Content/ContentApplicationModel.d.ts +76 -76
  44. package/sdk/application/Content/ContentApplicationModel.js +468 -884
  45. package/sdk/application/Content/ContentApplicationValidator.d.ts +5 -5
  46. package/sdk/application/Content/ContentApplicationValidator.js +24 -24
  47. package/sdk/application/FileStorage/FileStorageApplicationClient.d.ts +25 -25
  48. package/sdk/application/FileStorage/FileStorageApplicationClient.js +65 -64
  49. package/sdk/application/FileStorage/FileStorageApplicationModel.d.ts +13 -13
  50. package/sdk/application/FileStorage/FileStorageApplicationModel.js +86 -169
  51. package/sdk/application/FileStorage/FileStorageApplicationValidator.d.ts +1 -1
  52. package/sdk/application/FileStorage/FileStorageApplicationValidator.js +7 -7
  53. package/sdk/application/Lead/LeadApplicationClient.d.ts +24 -24
  54. package/sdk/application/Lead/LeadApplicationClient.js +109 -108
  55. package/sdk/application/Lead/LeadApplicationModel.d.ts +35 -35
  56. package/sdk/application/Lead/LeadApplicationModel.js +267 -474
  57. package/sdk/application/Lead/LeadApplicationValidator.d.ts +2 -2
  58. package/sdk/application/Lead/LeadApplicationValidator.js +11 -11
  59. package/sdk/application/Logistic/LogisticApplicationClient.d.ts +31 -22
  60. package/sdk/application/Logistic/LogisticApplicationClient.js +115 -49
  61. package/sdk/application/Logistic/LogisticApplicationModel.d.ts +17 -14
  62. package/sdk/application/Logistic/LogisticApplicationModel.js +133 -201
  63. package/sdk/application/Logistic/LogisticApplicationValidator.d.ts +3 -2
  64. package/sdk/application/Logistic/LogisticApplicationValidator.js +14 -9
  65. package/sdk/application/Order/OrderApplicationClient.d.ts +85 -85
  66. package/sdk/application/Order/OrderApplicationClient.js +247 -246
  67. package/sdk/application/Order/OrderApplicationModel.d.ts +50 -50
  68. package/sdk/application/Order/OrderApplicationModel.js +361 -656
  69. package/sdk/application/Order/OrderApplicationValidator.d.ts +7 -7
  70. package/sdk/application/Order/OrderApplicationValidator.js +28 -28
  71. package/sdk/application/Payment/PaymentApplicationClient.d.ts +318 -318
  72. package/sdk/application/Payment/PaymentApplicationClient.js +781 -780
  73. package/sdk/application/Payment/PaymentApplicationModel.d.ts +72 -72
  74. package/sdk/application/Payment/PaymentApplicationModel.js +570 -1038
  75. package/sdk/application/Payment/PaymentApplicationValidator.d.ts +28 -28
  76. package/sdk/application/Payment/PaymentApplicationValidator.js +107 -107
  77. package/sdk/application/PosCart/PosCartApplicationClient.d.ts +254 -254
  78. package/sdk/application/PosCart/PosCartApplicationClient.js +646 -645
  79. package/sdk/application/PosCart/PosCartApplicationModel.d.ts +64 -63
  80. package/sdk/application/PosCart/PosCartApplicationModel.js +476 -870
  81. package/sdk/application/PosCart/PosCartApplicationValidator.d.ts +18 -18
  82. package/sdk/application/PosCart/PosCartApplicationValidator.js +103 -103
  83. package/sdk/application/Rewards/RewardsApplicationClient.d.ts +27 -27
  84. package/sdk/application/Rewards/RewardsApplicationClient.js +122 -121
  85. package/sdk/application/Rewards/RewardsApplicationModel.d.ts +14 -14
  86. package/sdk/application/Rewards/RewardsApplicationModel.js +96 -191
  87. package/sdk/application/Rewards/RewardsApplicationValidator.d.ts +3 -3
  88. package/sdk/application/Rewards/RewardsApplicationValidator.js +12 -12
  89. package/sdk/application/Share/ShareApplicationClient.d.ts +37 -37
  90. package/sdk/application/Share/ShareApplicationClient.js +94 -93
  91. package/sdk/application/Share/ShareApplicationModel.d.ts +8 -8
  92. package/sdk/application/Share/ShareApplicationModel.js +63 -123
  93. package/sdk/application/Share/ShareApplicationValidator.d.ts +4 -4
  94. package/sdk/application/Share/ShareApplicationValidator.js +12 -12
  95. package/sdk/application/Theme/ThemeApplicationClient.d.ts +8 -8
  96. package/sdk/application/Theme/ThemeApplicationClient.js +38 -37
  97. package/sdk/application/Theme/ThemeApplicationModel.d.ts +34 -34
  98. package/sdk/application/Theme/ThemeApplicationModel.js +190 -336
  99. package/sdk/application/Theme/ThemeApplicationValidator.d.ts +1 -1
  100. package/sdk/application/Theme/ThemeApplicationValidator.js +4 -4
  101. package/sdk/application/User/UserApplicationClient.d.ts +280 -280
  102. package/sdk/application/User/UserApplicationClient.js +619 -618
  103. package/sdk/application/User/UserApplicationModel.d.ts +79 -72
  104. package/sdk/application/User/UserApplicationModel.js +440 -689
  105. package/sdk/application/User/UserApplicationValidator.d.ts +24 -24
  106. package/sdk/application/User/UserApplicationValidator.js +89 -89
  107. package/sdk/common/AxiosHelper.js +18 -7
  108. package/sdk/constructUrl.d.ts +5 -0
  109. package/sdk/constructUrl.js +13 -0
  110. package/sdk/index.d.ts +3 -0
  111. package/sdk/index.js +5 -0
  112. package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.d.ts +51 -51
  113. package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.js +182 -180
  114. package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.d.ts +6 -6
  115. package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.js +21 -21
  116. package/sdk/platform/Analytics/AnalyticsPlatformClient.js +5 -4
  117. package/sdk/platform/Analytics/AnalyticsPlatformModel.d.ts +11 -11
  118. package/sdk/platform/Analytics/AnalyticsPlatformModel.js +95 -178
  119. package/sdk/platform/Analytics/AnalyticsPlatformValidator.js +1 -0
  120. package/sdk/platform/AuditTrail/AuditTrailPlatformClient.d.ts +10 -10
  121. package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +44 -43
  122. package/sdk/platform/AuditTrail/AuditTrailPlatformModel.d.ts +10 -10
  123. package/sdk/platform/AuditTrail/AuditTrailPlatformModel.js +50 -89
  124. package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.d.ts +1 -1
  125. package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.js +7 -6
  126. package/sdk/platform/Billing/BillingPlatformClient.d.ts +60 -60
  127. package/sdk/platform/Billing/BillingPlatformClient.js +184 -183
  128. package/sdk/platform/Billing/BillingPlatformModel.d.ts +40 -40
  129. package/sdk/platform/Billing/BillingPlatformModel.js +342 -668
  130. package/sdk/platform/Billing/BillingPlatformValidator.d.ts +8 -8
  131. package/sdk/platform/Billing/BillingPlatformValidator.js +26 -25
  132. package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +192 -165
  133. package/sdk/platform/Cart/CartPlatformApplicationClient.js +686 -510
  134. package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +14 -11
  135. package/sdk/platform/Cart/CartPlatformApplicationValidator.js +77 -61
  136. package/sdk/platform/Cart/CartPlatformModel.d.ts +84 -83
  137. package/sdk/platform/Cart/CartPlatformModel.js +676 -1206
  138. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +632 -632
  139. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +1558 -1556
  140. package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +40 -40
  141. package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +175 -175
  142. package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +688 -688
  143. package/sdk/platform/Catalog/CatalogPlatformClient.js +1556 -1559
  144. package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +291 -291
  145. package/sdk/platform/Catalog/CatalogPlatformModel.js +2133 -3910
  146. package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +66 -66
  147. package/sdk/platform/Catalog/CatalogPlatformValidator.js +229 -228
  148. package/sdk/platform/Common/CommonPlatformClient.d.ts +12 -12
  149. package/sdk/platform/Common/CommonPlatformClient.js +40 -51
  150. package/sdk/platform/Common/CommonPlatformModel.d.ts +12 -12
  151. package/sdk/platform/Common/CommonPlatformModel.js +83 -160
  152. package/sdk/platform/Common/CommonPlatformValidator.d.ts +1 -1
  153. package/sdk/platform/Common/CommonPlatformValidator.js +7 -6
  154. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +326 -326
  155. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +945 -943
  156. package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.d.ts +30 -30
  157. package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.js +88 -88
  158. package/sdk/platform/Communication/CommunicationPlatformClient.js +4 -3
  159. package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +67 -67
  160. package/sdk/platform/Communication/CommunicationPlatformModel.js +522 -974
  161. package/sdk/platform/Communication/CommunicationPlatformValidator.js +1 -0
  162. package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +55 -55
  163. package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +217 -216
  164. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +27 -27
  165. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +279 -542
  166. package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.d.ts +7 -7
  167. package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.js +25 -24
  168. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +163 -153
  169. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +617 -552
  170. package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.d.ts +22 -21
  171. package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.js +70 -64
  172. package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +125 -125
  173. package/sdk/platform/Configuration/ConfigurationPlatformClient.js +348 -347
  174. package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +148 -146
  175. package/sdk/platform/Configuration/ConfigurationPlatformModel.js +854 -1508
  176. package/sdk/platform/Configuration/ConfigurationPlatformValidator.d.ts +9 -9
  177. package/sdk/platform/Configuration/ConfigurationPlatformValidator.js +39 -38
  178. package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +524 -534
  179. package/sdk/platform/Content/ContentPlatformApplicationClient.js +1287 -1346
  180. package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +49 -50
  181. package/sdk/platform/Content/ContentPlatformApplicationValidator.js +153 -159
  182. package/sdk/platform/Content/ContentPlatformModel.d.ts +78 -78
  183. package/sdk/platform/Content/ContentPlatformModel.js +485 -907
  184. package/sdk/platform/Discount/DiscountPlatformClient.d.ts +65 -65
  185. package/sdk/platform/Discount/DiscountPlatformClient.js +219 -218
  186. package/sdk/platform/Discount/DiscountPlatformModel.d.ts +7 -7
  187. package/sdk/platform/Discount/DiscountPlatformModel.js +60 -121
  188. package/sdk/platform/Discount/DiscountPlatformValidator.d.ts +6 -6
  189. package/sdk/platform/Discount/DiscountPlatformValidator.js +30 -29
  190. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +25 -25
  191. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +83 -61
  192. package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.d.ts +1 -1
  193. package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.js +9 -9
  194. package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +53 -53
  195. package/sdk/platform/FileStorage/FileStoragePlatformClient.js +147 -125
  196. package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +13 -13
  197. package/sdk/platform/FileStorage/FileStoragePlatformModel.js +86 -169
  198. package/sdk/platform/FileStorage/FileStoragePlatformValidator.d.ts +3 -3
  199. package/sdk/platform/FileStorage/FileStoragePlatformValidator.js +12 -11
  200. package/sdk/platform/Inventory/InventoryPlatformClient.d.ts +63 -63
  201. package/sdk/platform/Inventory/InventoryPlatformClient.js +231 -230
  202. package/sdk/platform/Inventory/InventoryPlatformModel.d.ts +30 -30
  203. package/sdk/platform/Inventory/InventoryPlatformModel.js +497 -964
  204. package/sdk/platform/Inventory/InventoryPlatformValidator.d.ts +7 -7
  205. package/sdk/platform/Inventory/InventoryPlatformValidator.js +29 -28
  206. package/sdk/platform/Lead/LeadPlatformApplicationClient.d.ts +73 -73
  207. package/sdk/platform/Lead/LeadPlatformApplicationClient.js +203 -201
  208. package/sdk/platform/Lead/LeadPlatformApplicationValidator.d.ts +7 -7
  209. package/sdk/platform/Lead/LeadPlatformApplicationValidator.js +29 -29
  210. package/sdk/platform/Lead/LeadPlatformClient.d.ts +80 -80
  211. package/sdk/platform/Lead/LeadPlatformClient.js +215 -214
  212. package/sdk/platform/Lead/LeadPlatformModel.d.ts +35 -35
  213. package/sdk/platform/Lead/LeadPlatformModel.js +267 -474
  214. package/sdk/platform/Lead/LeadPlatformValidator.d.ts +6 -6
  215. package/sdk/platform/Lead/LeadPlatformValidator.js +25 -24
  216. package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +10 -10
  217. package/sdk/platform/Order/OrderPlatformApplicationClient.js +68 -66
  218. package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +1 -1
  219. package/sdk/platform/Order/OrderPlatformApplicationValidator.js +7 -7
  220. package/sdk/platform/Order/OrderPlatformClient.d.ts +357 -357
  221. package/sdk/platform/Order/OrderPlatformClient.js +1046 -1033
  222. package/sdk/platform/Order/OrderPlatformModel.d.ts +198 -196
  223. package/sdk/platform/Order/OrderPlatformModel.js +1575 -2861
  224. package/sdk/platform/Order/OrderPlatformValidator.d.ts +32 -32
  225. package/sdk/platform/Order/OrderPlatformValidator.js +161 -160
  226. package/sdk/platform/Partner/PartnerPlatformApplicationClient.js +3 -1
  227. package/sdk/platform/Partner/PartnerPlatformApplicationValidator.js +1 -1
  228. package/sdk/platform/Partner/PartnerPlatformModel.d.ts +1 -1
  229. package/sdk/platform/Partner/PartnerPlatformModel.js +10 -26
  230. package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +58 -58
  231. package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +178 -178
  232. package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +6 -6
  233. package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +24 -24
  234. package/sdk/platform/Payment/PaymentPlatformClient.d.ts +42 -42
  235. package/sdk/platform/Payment/PaymentPlatformClient.js +156 -155
  236. package/sdk/platform/Payment/PaymentPlatformModel.d.ts +27 -27
  237. package/sdk/platform/Payment/PaymentPlatformModel.js +222 -410
  238. package/sdk/platform/Payment/PaymentPlatformValidator.d.ts +4 -4
  239. package/sdk/platform/Payment/PaymentPlatformValidator.js +22 -21
  240. package/sdk/platform/PlatformApplicationClient.d.ts +1496 -10325
  241. package/sdk/platform/PlatformApplicationClient.js +1584 -13899
  242. package/sdk/platform/PlatformClient.d.ts +7972 -7888
  243. package/sdk/platform/PlatformClient.js +8678 -10107
  244. package/sdk/platform/Rewards/RewardsPlatformApplicationClient.d.ts +85 -85
  245. package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +299 -280
  246. package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.d.ts +8 -8
  247. package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.js +35 -35
  248. package/sdk/platform/Rewards/RewardsPlatformModel.d.ts +15 -15
  249. package/sdk/platform/Rewards/RewardsPlatformModel.js +92 -194
  250. package/sdk/platform/Share/SharePlatformApplicationClient.d.ts +10 -10
  251. package/sdk/platform/Share/SharePlatformApplicationClient.js +62 -60
  252. package/sdk/platform/Share/SharePlatformApplicationValidator.d.ts +1 -1
  253. package/sdk/platform/Share/SharePlatformApplicationValidator.js +7 -7
  254. package/sdk/platform/Share/SharePlatformModel.d.ts +8 -8
  255. package/sdk/platform/Share/SharePlatformModel.js +60 -118
  256. package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +132 -132
  257. package/sdk/platform/Theme/ThemePlatformApplicationClient.js +314 -312
  258. package/sdk/platform/Theme/ThemePlatformApplicationValidator.d.ts +15 -15
  259. package/sdk/platform/Theme/ThemePlatformApplicationValidator.js +45 -45
  260. package/sdk/platform/Theme/ThemePlatformModel.d.ts +34 -34
  261. package/sdk/platform/Theme/ThemePlatformModel.js +190 -336
  262. package/sdk/platform/User/UserPlatformApplicationClient.d.ts +136 -69
  263. package/sdk/platform/User/UserPlatformApplicationClient.js +507 -166
  264. package/sdk/platform/User/UserPlatformApplicationValidator.d.ts +12 -7
  265. package/sdk/platform/User/UserPlatformApplicationValidator.js +62 -24
  266. package/sdk/platform/User/UserPlatformModel.d.ts +79 -72
  267. package/sdk/platform/User/UserPlatformModel.js +440 -689
  268. package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +31 -31
  269. package/sdk/platform/Webhook/WebhookPlatformClient.js +91 -90
  270. package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +7 -7
  271. package/sdk/platform/Webhook/WebhookPlatformModel.js +68 -136
  272. package/sdk/platform/Webhook/WebhookPlatformValidator.d.ts +3 -3
  273. package/sdk/platform/Webhook/WebhookPlatformValidator.js +15 -14
  274. package/sdk/public/Configuration/ConfigurationPublicClient.d.ts +13 -13
  275. package/sdk/public/Configuration/ConfigurationPublicClient.js +40 -38
  276. package/sdk/public/Configuration/ConfigurationPublicModel.d.ts +12 -12
  277. package/sdk/public/Configuration/ConfigurationPublicModel.js +85 -162
  278. package/sdk/public/Configuration/ConfigurationPublicValidator.d.ts +1 -1
  279. package/sdk/public/Configuration/ConfigurationPublicValidator.js +6 -6
  280. package/sdk/public/Inventory/InventoryPublicClient.d.ts +34 -34
  281. package/sdk/public/Inventory/InventoryPublicClient.js +115 -113
  282. package/sdk/public/Inventory/InventoryPublicModel.d.ts +10 -10
  283. package/sdk/public/Inventory/InventoryPublicModel.js +119 -245
  284. package/sdk/public/Inventory/InventoryPublicValidator.d.ts +3 -3
  285. package/sdk/public/Inventory/InventoryPublicValidator.js +15 -15
  286. package/sdk/public/Webhook/WebhookPublicClient.js +2 -0
  287. package/sdk/public/Webhook/WebhookPublicModel.d.ts +7 -7
  288. package/sdk/public/Webhook/WebhookPublicModel.js +68 -136
  289. package/.github/workflows/on_create_release.yml +0 -23
  290. package/.github/workflows/on_merge_main.yml +0 -38
  291. package/.github/workflows/on_pull_request.yml +0 -35
  292. package/.prettierrc +0 -5
  293. package/documentation/application/CART.md +0 -7339
  294. package/documentation/application/CATALOG.md +0 -9597
  295. package/documentation/application/COMMON.md +0 -452
  296. package/documentation/application/COMMUNICATION.md +0 -467
  297. package/documentation/application/CONFIGURATION.md +0 -2906
  298. package/documentation/application/CONTENT.md +0 -3351
  299. package/documentation/application/FILESTORAGE.md +0 -578
  300. package/documentation/application/LEAD.md +0 -1895
  301. package/documentation/application/LOGISTIC.md +0 -765
  302. package/documentation/application/ORDER.md +0 -3432
  303. package/documentation/application/PAYMENT.md +0 -5221
  304. package/documentation/application/POSCART.md +0 -7938
  305. package/documentation/application/README.md +0 -21
  306. package/documentation/application/REWARDS.md +0 -708
  307. package/documentation/application/SHARE.md +0 -733
  308. package/documentation/application/THEME.md +0 -5800
  309. package/documentation/application/USER.md +0 -4335
  310. package/documentation/platform/ANALYTICS.md +0 -1154
  311. package/documentation/platform/AUDITTRAIL.md +0 -576
  312. package/documentation/platform/BILLING.md +0 -2400
  313. package/documentation/platform/CART.md +0 -5559
  314. package/documentation/platform/CATALOG.md +0 -23261
  315. package/documentation/platform/COMMON.md +0 -452
  316. package/documentation/platform/COMMUNICATION.md +0 -5718
  317. package/documentation/platform/COMPANYPROFILE.md +0 -2031
  318. package/documentation/platform/CONFIGURATION.md +0 -7339
  319. package/documentation/platform/CONTENT.md +0 -9098
  320. package/documentation/platform/DISCOUNT.md +0 -863
  321. package/documentation/platform/FILESTORAGE.md +0 -1081
  322. package/documentation/platform/INVENTORY.md +0 -1779
  323. package/documentation/platform/LEAD.md +0 -4740
  324. package/documentation/platform/ORDER.md +0 -8486
  325. package/documentation/platform/PARTNER.md +0 -220
  326. package/documentation/platform/PAYMENT.md +0 -3448
  327. package/documentation/platform/README.md +0 -27
  328. package/documentation/platform/REWARDS.md +0 -1083
  329. package/documentation/platform/SHARE.md +0 -606
  330. package/documentation/platform/THEME.md +0 -35729
  331. package/documentation/platform/USER.md +0 -2319
  332. package/documentation/platform/WEBHOOK.md +0 -591
  333. package/documentation/public/CONFIGURATION.md +0 -452
  334. package/documentation/public/INVENTORY.md +0 -690
  335. package/documentation/public/WEBHOOK.md +0 -352
  336. package/jest.config.d.ts +0 -4
  337. package/jest.config.js +0 -6
  338. package/tests/application/catalog.spec.js +0 -47
  339. package/tests/common/action-url.spec.js +0 -35
  340. package/tests/common/schema/action-url.json +0 -178
  341. package/tests/common/schema/url-action.json +0 -683
  342. package/tests/common/url-action.spec.js +0 -48
  343. package/tests/helpers/cookie.helper.js +0 -31
  344. package/tests/helpers/oauth.helper.js +0 -43
  345. package/tests/platform/catalog.spec.js +0 -49
  346. package/tests/public/location.spec.js +0 -39
@@ -1,37 +1,38 @@
1
- const APIClient = require("../ApplicationAPIClient");
1
+ const ApplicationAPIClient = require("../ApplicationAPIClient");
2
+ const { FDKClientValidationError } = require("../../common/FDKError");
2
3
  const constructUrl = require("../constructUrl");
3
4
  const Paginator = require("../../common/Paginator");
4
- const { FDKClientValidationError } = require("../../common/FDKError");
5
5
  const OrderValidator = require("./OrderApplicationValidator");
6
6
  const OrderModel = require("./OrderApplicationModel");
7
7
  const { Logger } = require("./../../common/Logger");
8
+ const Joi = require("joi");
8
9
 
9
10
  class Order {
10
11
  constructor(_conf) {
11
12
  this._conf = _conf;
12
13
  this._relativeUrls = {
13
- getOrders: "/service/application/order/v1.0/orders",
14
+ getCustomerDetailsByShipmentId:
15
+ "/service/application/order/v1.0/orders/{order_id}/shipments/{shipment_id}/customer-details",
16
+ getInvoiceByShipmentId:
17
+ "/service/application/order/v1.0/orders/shipments/{shipment_id}/invoice",
14
18
  getOrderById: "/service/application/order/v1.0/orders/{order_id}",
19
+ getOrders: "/service/application/order/v1.0/orders",
15
20
  getPosOrderById:
16
21
  "/service/application/order/v1.0/orders/pos-order/{order_id}",
17
- getShipmentById:
18
- "/service/application/order/v1.0/orders/shipments/{shipment_id}",
19
- getInvoiceByShipmentId:
20
- "/service/application/order/v1.0/orders/shipments/{shipment_id}/invoice",
21
- trackShipment:
22
- "/service/application/order/v1.0/orders/shipments/{shipment_id}/track",
23
- getCustomerDetailsByShipmentId:
24
- "/service/application/order/v1.0/orders/{order_id}/shipments/{shipment_id}/customer-details",
25
- sendOtpToShipmentCustomer:
26
- "/service/application/order/v1.0/orders/{order_id}/shipments/{shipment_id}/otp/send/",
27
- verifyOtpShipmentCustomer:
28
- "/service/application/order/v1.0/orders/{order_id}/shipments/{shipment_id}/otp/verify/",
29
22
  getShipmentBagReasons:
30
23
  "/service/application/order/v1.0/orders/shipments/{shipment_id}/bags/{bag_id}/reasons",
24
+ getShipmentById:
25
+ "/service/application/order/v1.0/orders/shipments/{shipment_id}",
31
26
  getShipmentReasons:
32
27
  "/service/application/order/v1.0/orders/shipments/{shipment_id}/reasons",
28
+ sendOtpToShipmentCustomer:
29
+ "/service/application/order/v1.0/orders/{order_id}/shipments/{shipment_id}/otp/send/",
30
+ trackShipment:
31
+ "/service/application/order/v1.0/orders/shipments/{shipment_id}/track",
33
32
  updateShipmentStatus:
34
33
  "/service/application/order/v1.0/orders/shipments/{shipment_id}/status",
34
+ verifyOtpShipmentCustomer:
35
+ "/service/application/order/v1.0/orders/{order_id}/shipments/{shipment_id}/otp/verify/",
35
36
  };
36
37
  this._urls = Object.entries(this._relativeUrls).reduce(
37
38
  (urls, [method, relativeUrl]) => {
@@ -51,31 +52,18 @@ class Order {
51
52
 
52
53
  /**
53
54
  * @param {Object} arg - Arg object.
54
- * @param {number} [arg.status] - A filter to retrieve orders by their
55
- * current status such as _placed_, _delivered_, etc.
56
- * @param {number} [arg.pageNo] - The page number to navigate through the
57
- * given set of results. Default value is 1.
58
- * @param {number} [arg.pageSize] - The number of items to retrieve in each
59
- * page. Default value is 10.
60
- * @param {string} [arg.fromDate] - The date from which the orders should be
61
- * retrieved.
62
- * @param {string} [arg.toDate] - The date till which the orders should be retrieved.
63
- * @param {string} [arg.customMeta] - A filter and retrieve data using
64
- * special fields included for special use-cases
65
- * @returns {Promise<OrderList>} - Success response
66
- * @summary: Get all orders
67
- * @description: Use this API to retrieve all the orders.
55
+ * @param {string} arg.orderId - ID of the shipment. An order may contain
56
+ * multiple items and may get divided into one or more shipment, each
57
+ * having its own ID.
58
+ * @param {string} arg.shipmentId - A unique number used for identifying and
59
+ * tracking your orders.
60
+ * @returns {Promise<CustomerDetailsResponse>} - Success response
61
+ * @summary: Get Customer Details by Shipment Id
62
+ * @description: Use this API to retrieve customer details such as mobileno using Shipment ID.
68
63
  */
69
- async getOrders({
70
- status,
71
- pageNo,
72
- pageSize,
73
- fromDate,
74
- toDate,
75
- customMeta,
76
- } = {}) {
77
- const { error } = OrderValidator.getOrders().validate(
78
- { status, pageNo, pageSize, fromDate, toDate, customMeta },
64
+ async getCustomerDetailsByShipmentId({ orderId, shipmentId } = {}) {
65
+ const { error } = OrderValidator.getCustomerDetailsByShipmentId().validate(
66
+ { orderId, shipmentId },
79
67
  { abortEarly: false, allowUnknown: true }
80
68
  );
81
69
  if (error) {
@@ -83,41 +71,40 @@ class Order {
83
71
  }
84
72
 
85
73
  // Showing warrnings if extra unknown parameters are found
86
- const { error: warrning } = OrderValidator.getOrders().validate(
87
- { status, pageNo, pageSize, fromDate, toDate, customMeta },
74
+ const {
75
+ error: warrning,
76
+ } = OrderValidator.getCustomerDetailsByShipmentId().validate(
77
+ { orderId, shipmentId },
88
78
  { abortEarly: false, allowUnknown: false }
89
79
  );
90
80
  if (warrning) {
91
81
  Logger({
92
82
  level: "WARN",
93
- message: "Parameter Validation warrnings for getOrders",
83
+ message:
84
+ "Parameter Validation warrnings for getCustomerDetailsByShipmentId",
94
85
  });
95
86
  Logger({ level: "WARN", message: warrning });
96
87
  }
97
88
 
98
89
  const query_params = {};
99
- query_params["status"] = status;
100
- query_params["page_no"] = pageNo;
101
- query_params["page_size"] = pageSize;
102
- query_params["from_date"] = fromDate;
103
- query_params["to_date"] = toDate;
104
- query_params["custom_meta"] = customMeta;
105
90
 
106
91
  const xHeaders = {};
107
92
 
108
- const response = await APIClient.execute(
93
+ const response = await ApplicationAPIClient.execute(
109
94
  this._conf,
110
95
  "get",
111
96
  constructUrl({
112
- url: this._urls["getOrders"],
113
- params: {},
97
+ url: this._urls["getCustomerDetailsByShipmentId"],
98
+ params: { orderId, shipmentId },
114
99
  }),
115
100
  query_params,
116
101
  undefined,
117
102
  xHeaders
118
103
  );
119
104
 
120
- const { error: res_error } = OrderModel.OrderList().validate(response, {
105
+ const {
106
+ error: res_error,
107
+ } = OrderModel.CustomerDetailsResponse().validate(response, {
121
108
  abortEarly: false,
122
109
  allowUnknown: false,
123
110
  });
@@ -125,7 +112,8 @@ class Order {
125
112
  if (res_error) {
126
113
  Logger({
127
114
  level: "WARN",
128
- message: "Response Validation Warnnings for getOrders",
115
+ message:
116
+ "Response Validation Warnnings for getCustomerDetailsByShipmentId",
129
117
  });
130
118
  Logger({ level: "WARN", message: res_error });
131
119
  }
@@ -135,15 +123,14 @@ class Order {
135
123
 
136
124
  /**
137
125
  * @param {Object} arg - Arg object.
138
- * @param {string} arg.orderId - A unique number used for identifying and
139
- * tracking your orders.
140
- * @returns {Promise<OrderById>} - Success response
141
- * @summary: Get details of an order
142
- * @description: Use this API to retrieve order details such as tracking details, shipment, store information using Fynd Order ID.
126
+ * @param {string} arg.shipmentId - ID of the shipment.
127
+ * @returns {Promise<ResponseGetInvoiceShipment>} - Success response
128
+ * @summary: Get Invoice of a shipment
129
+ * @description: Use this API to retrieve shipment invoice.
143
130
  */
144
- async getOrderById({ orderId } = {}) {
145
- const { error } = OrderValidator.getOrderById().validate(
146
- { orderId },
131
+ async getInvoiceByShipmentId({ shipmentId } = {}) {
132
+ const { error } = OrderValidator.getInvoiceByShipmentId().validate(
133
+ { shipmentId },
147
134
  { abortEarly: false, allowUnknown: true }
148
135
  );
149
136
  if (error) {
@@ -151,14 +138,16 @@ class Order {
151
138
  }
152
139
 
153
140
  // Showing warrnings if extra unknown parameters are found
154
- const { error: warrning } = OrderValidator.getOrderById().validate(
155
- { orderId },
141
+ const {
142
+ error: warrning,
143
+ } = OrderValidator.getInvoiceByShipmentId().validate(
144
+ { shipmentId },
156
145
  { abortEarly: false, allowUnknown: false }
157
146
  );
158
147
  if (warrning) {
159
148
  Logger({
160
149
  level: "WARN",
161
- message: "Parameter Validation warrnings for getOrderById",
150
+ message: "Parameter Validation warrnings for getInvoiceByShipmentId",
162
151
  });
163
152
  Logger({ level: "WARN", message: warrning });
164
153
  }
@@ -167,19 +156,21 @@ class Order {
167
156
 
168
157
  const xHeaders = {};
169
158
 
170
- const response = await APIClient.execute(
159
+ const response = await ApplicationAPIClient.execute(
171
160
  this._conf,
172
161
  "get",
173
162
  constructUrl({
174
- url: this._urls["getOrderById"],
175
- params: { orderId },
163
+ url: this._urls["getInvoiceByShipmentId"],
164
+ params: { shipmentId },
176
165
  }),
177
166
  query_params,
178
167
  undefined,
179
168
  xHeaders
180
169
  );
181
170
 
182
- const { error: res_error } = OrderModel.OrderById().validate(response, {
171
+ const {
172
+ error: res_error,
173
+ } = OrderModel.ResponseGetInvoiceShipment().validate(response, {
183
174
  abortEarly: false,
184
175
  allowUnknown: false,
185
176
  });
@@ -187,7 +178,7 @@ class Order {
187
178
  if (res_error) {
188
179
  Logger({
189
180
  level: "WARN",
190
- message: "Response Validation Warnnings for getOrderById",
181
+ message: "Response Validation Warnnings for getInvoiceByShipmentId",
191
182
  });
192
183
  Logger({ level: "WARN", message: res_error });
193
184
  }
@@ -199,12 +190,12 @@ class Order {
199
190
  * @param {Object} arg - Arg object.
200
191
  * @param {string} arg.orderId - A unique number used for identifying and
201
192
  * tracking your orders.
202
- * @returns {Promise<OrderList>} - Success response
203
- * @summary: Get POS Order
204
- * @description: Use this API to retrieve a POS order and all its details such as tracking details, shipment, store information using Fynd Order ID.
193
+ * @returns {Promise<OrderById>} - Success response
194
+ * @summary: Get details of an order
195
+ * @description: Use this API to retrieve order details such as tracking details, shipment, store information using Fynd Order ID.
205
196
  */
206
- async getPosOrderById({ orderId } = {}) {
207
- const { error } = OrderValidator.getPosOrderById().validate(
197
+ async getOrderById({ orderId } = {}) {
198
+ const { error } = OrderValidator.getOrderById().validate(
208
199
  { orderId },
209
200
  { abortEarly: false, allowUnknown: true }
210
201
  );
@@ -213,14 +204,14 @@ class Order {
213
204
  }
214
205
 
215
206
  // Showing warrnings if extra unknown parameters are found
216
- const { error: warrning } = OrderValidator.getPosOrderById().validate(
207
+ const { error: warrning } = OrderValidator.getOrderById().validate(
217
208
  { orderId },
218
209
  { abortEarly: false, allowUnknown: false }
219
210
  );
220
211
  if (warrning) {
221
212
  Logger({
222
213
  level: "WARN",
223
- message: "Parameter Validation warrnings for getPosOrderById",
214
+ message: "Parameter Validation warrnings for getOrderById",
224
215
  });
225
216
  Logger({ level: "WARN", message: warrning });
226
217
  }
@@ -229,11 +220,11 @@ class Order {
229
220
 
230
221
  const xHeaders = {};
231
222
 
232
- const response = await APIClient.execute(
223
+ const response = await ApplicationAPIClient.execute(
233
224
  this._conf,
234
225
  "get",
235
226
  constructUrl({
236
- url: this._urls["getPosOrderById"],
227
+ url: this._urls["getOrderById"],
237
228
  params: { orderId },
238
229
  }),
239
230
  query_params,
@@ -241,7 +232,7 @@ class Order {
241
232
  xHeaders
242
233
  );
243
234
 
244
- const { error: res_error } = OrderModel.OrderList().validate(response, {
235
+ const { error: res_error } = OrderModel.OrderById().validate(response, {
245
236
  abortEarly: false,
246
237
  allowUnknown: false,
247
238
  });
@@ -249,7 +240,7 @@ class Order {
249
240
  if (res_error) {
250
241
  Logger({
251
242
  level: "WARN",
252
- message: "Response Validation Warnnings for getPosOrderById",
243
+ message: "Response Validation Warnnings for getOrderById",
253
244
  });
254
245
  Logger({ level: "WARN", message: res_error });
255
246
  }
@@ -259,16 +250,31 @@ class Order {
259
250
 
260
251
  /**
261
252
  * @param {Object} arg - Arg object.
262
- * @param {string} arg.shipmentId - ID of the shipment. An order may contain
263
- * multiple items and may get divided into one or more shipment, each
264
- * having its own ID.
265
- * @returns {Promise<ShipmentById>} - Success response
266
- * @summary: Get details of a shipment
267
- * @description: Use this API to retrieve shipment details such as price breakup, tracking details, store information, etc. using Shipment ID.
253
+ * @param {number} [arg.status] - A filter to retrieve orders by their
254
+ * current status such as _placed_, _delivered_, etc.
255
+ * @param {number} [arg.pageNo] - The page number to navigate through the
256
+ * given set of results. Default value is 1.
257
+ * @param {number} [arg.pageSize] - The number of items to retrieve in each
258
+ * page. Default value is 10.
259
+ * @param {string} [arg.fromDate] - The date from which the orders should be
260
+ * retrieved.
261
+ * @param {string} [arg.toDate] - The date till which the orders should be retrieved.
262
+ * @param {string} [arg.customMeta] - A filter and retrieve data using
263
+ * special fields included for special use-cases
264
+ * @returns {Promise<OrderList>} - Success response
265
+ * @summary: Get all orders
266
+ * @description: Use this API to retrieve all the orders.
268
267
  */
269
- async getShipmentById({ shipmentId } = {}) {
270
- const { error } = OrderValidator.getShipmentById().validate(
271
- { shipmentId },
268
+ async getOrders({
269
+ status,
270
+ pageNo,
271
+ pageSize,
272
+ fromDate,
273
+ toDate,
274
+ customMeta,
275
+ } = {}) {
276
+ const { error } = OrderValidator.getOrders().validate(
277
+ { status, pageNo, pageSize, fromDate, toDate, customMeta },
272
278
  { abortEarly: false, allowUnknown: true }
273
279
  );
274
280
  if (error) {
@@ -276,35 +282,41 @@ class Order {
276
282
  }
277
283
 
278
284
  // Showing warrnings if extra unknown parameters are found
279
- const { error: warrning } = OrderValidator.getShipmentById().validate(
280
- { shipmentId },
285
+ const { error: warrning } = OrderValidator.getOrders().validate(
286
+ { status, pageNo, pageSize, fromDate, toDate, customMeta },
281
287
  { abortEarly: false, allowUnknown: false }
282
288
  );
283
289
  if (warrning) {
284
290
  Logger({
285
291
  level: "WARN",
286
- message: "Parameter Validation warrnings for getShipmentById",
292
+ message: "Parameter Validation warrnings for getOrders",
287
293
  });
288
294
  Logger({ level: "WARN", message: warrning });
289
295
  }
290
296
 
291
297
  const query_params = {};
298
+ query_params["status"] = status;
299
+ query_params["page_no"] = pageNo;
300
+ query_params["page_size"] = pageSize;
301
+ query_params["from_date"] = fromDate;
302
+ query_params["to_date"] = toDate;
303
+ query_params["custom_meta"] = customMeta;
292
304
 
293
305
  const xHeaders = {};
294
306
 
295
- const response = await APIClient.execute(
307
+ const response = await ApplicationAPIClient.execute(
296
308
  this._conf,
297
309
  "get",
298
310
  constructUrl({
299
- url: this._urls["getShipmentById"],
300
- params: { shipmentId },
311
+ url: this._urls["getOrders"],
312
+ params: {},
301
313
  }),
302
314
  query_params,
303
315
  undefined,
304
316
  xHeaders
305
317
  );
306
318
 
307
- const { error: res_error } = OrderModel.ShipmentById().validate(response, {
319
+ const { error: res_error } = OrderModel.OrderList().validate(response, {
308
320
  abortEarly: false,
309
321
  allowUnknown: false,
310
322
  });
@@ -312,7 +324,7 @@ class Order {
312
324
  if (res_error) {
313
325
  Logger({
314
326
  level: "WARN",
315
- message: "Response Validation Warnnings for getShipmentById",
327
+ message: "Response Validation Warnnings for getOrders",
316
328
  });
317
329
  Logger({ level: "WARN", message: res_error });
318
330
  }
@@ -322,14 +334,15 @@ class Order {
322
334
 
323
335
  /**
324
336
  * @param {Object} arg - Arg object.
325
- * @param {string} arg.shipmentId - ID of the shipment.
326
- * @returns {Promise<ResponseGetInvoiceShipment>} - Success response
327
- * @summary: Get Invoice of a shipment
328
- * @description: Use this API to retrieve shipment invoice.
337
+ * @param {string} arg.orderId - A unique number used for identifying and
338
+ * tracking your orders.
339
+ * @returns {Promise<OrderList>} - Success response
340
+ * @summary: Get POS Order
341
+ * @description: Use this API to retrieve a POS order and all its details such as tracking details, shipment, store information using Fynd Order ID.
329
342
  */
330
- async getInvoiceByShipmentId({ shipmentId } = {}) {
331
- const { error } = OrderValidator.getInvoiceByShipmentId().validate(
332
- { shipmentId },
343
+ async getPosOrderById({ orderId } = {}) {
344
+ const { error } = OrderValidator.getPosOrderById().validate(
345
+ { orderId },
333
346
  { abortEarly: false, allowUnknown: true }
334
347
  );
335
348
  if (error) {
@@ -337,16 +350,14 @@ class Order {
337
350
  }
338
351
 
339
352
  // Showing warrnings if extra unknown parameters are found
340
- const {
341
- error: warrning,
342
- } = OrderValidator.getInvoiceByShipmentId().validate(
343
- { shipmentId },
353
+ const { error: warrning } = OrderValidator.getPosOrderById().validate(
354
+ { orderId },
344
355
  { abortEarly: false, allowUnknown: false }
345
356
  );
346
357
  if (warrning) {
347
358
  Logger({
348
359
  level: "WARN",
349
- message: "Parameter Validation warrnings for getInvoiceByShipmentId",
360
+ message: "Parameter Validation warrnings for getPosOrderById",
350
361
  });
351
362
  Logger({ level: "WARN", message: warrning });
352
363
  }
@@ -355,21 +366,19 @@ class Order {
355
366
 
356
367
  const xHeaders = {};
357
368
 
358
- const response = await APIClient.execute(
369
+ const response = await ApplicationAPIClient.execute(
359
370
  this._conf,
360
371
  "get",
361
372
  constructUrl({
362
- url: this._urls["getInvoiceByShipmentId"],
363
- params: { shipmentId },
373
+ url: this._urls["getPosOrderById"],
374
+ params: { orderId },
364
375
  }),
365
376
  query_params,
366
377
  undefined,
367
378
  xHeaders
368
379
  );
369
380
 
370
- const {
371
- error: res_error,
372
- } = OrderModel.ResponseGetInvoiceShipment().validate(response, {
381
+ const { error: res_error } = OrderModel.OrderList().validate(response, {
373
382
  abortEarly: false,
374
383
  allowUnknown: false,
375
384
  });
@@ -377,7 +386,7 @@ class Order {
377
386
  if (res_error) {
378
387
  Logger({
379
388
  level: "WARN",
380
- message: "Response Validation Warnnings for getInvoiceByShipmentId",
389
+ message: "Response Validation Warnnings for getPosOrderById",
381
390
  });
382
391
  Logger({ level: "WARN", message: res_error });
383
392
  }
@@ -387,16 +396,18 @@ class Order {
387
396
 
388
397
  /**
389
398
  * @param {Object} arg - Arg object.
390
- * @param {string} arg.shipmentId - ID of the shipment. An order may contain
399
+ * @param {string} arg.shipmentId - ID of the bag. An order may contain
391
400
  * multiple items and may get divided into one or more shipment, each
392
401
  * having its own ID.
393
- * @returns {Promise<ShipmentTrack>} - Success response
394
- * @summary: Track shipment
395
- * @description: Track Shipment by shipment id, for application based on application Id
402
+ * @param {string} arg.bagId - ID of the bag. An order may contain multiple
403
+ * items and may get divided into one or more shipment, each having its own ID.
404
+ * @returns {Promise<ShipmentBagReasons>} - Success response
405
+ * @summary: Get reasons behind full or partial cancellation of a shipment
406
+ * @description: Use this API to retrieve the issues that led to the cancellation of bags within a shipment.
396
407
  */
397
- async trackShipment({ shipmentId } = {}) {
398
- const { error } = OrderValidator.trackShipment().validate(
399
- { shipmentId },
408
+ async getShipmentBagReasons({ shipmentId, bagId } = {}) {
409
+ const { error } = OrderValidator.getShipmentBagReasons().validate(
410
+ { shipmentId, bagId },
400
411
  { abortEarly: false, allowUnknown: true }
401
412
  );
402
413
  if (error) {
@@ -404,14 +415,14 @@ class Order {
404
415
  }
405
416
 
406
417
  // Showing warrnings if extra unknown parameters are found
407
- const { error: warrning } = OrderValidator.trackShipment().validate(
408
- { shipmentId },
418
+ const { error: warrning } = OrderValidator.getShipmentBagReasons().validate(
419
+ { shipmentId, bagId },
409
420
  { abortEarly: false, allowUnknown: false }
410
421
  );
411
422
  if (warrning) {
412
423
  Logger({
413
424
  level: "WARN",
414
- message: "Parameter Validation warrnings for trackShipment",
425
+ message: "Parameter Validation warrnings for getShipmentBagReasons",
415
426
  });
416
427
  Logger({ level: "WARN", message: warrning });
417
428
  }
@@ -420,19 +431,21 @@ class Order {
420
431
 
421
432
  const xHeaders = {};
422
433
 
423
- const response = await APIClient.execute(
434
+ const response = await ApplicationAPIClient.execute(
424
435
  this._conf,
425
436
  "get",
426
437
  constructUrl({
427
- url: this._urls["trackShipment"],
428
- params: { shipmentId },
438
+ url: this._urls["getShipmentBagReasons"],
439
+ params: { shipmentId, bagId },
429
440
  }),
430
441
  query_params,
431
442
  undefined,
432
443
  xHeaders
433
444
  );
434
445
 
435
- const { error: res_error } = OrderModel.ShipmentTrack().validate(response, {
446
+ const {
447
+ error: res_error,
448
+ } = OrderModel.ShipmentBagReasons().validate(response, {
436
449
  abortEarly: false,
437
450
  allowUnknown: false,
438
451
  });
@@ -440,7 +453,7 @@ class Order {
440
453
  if (res_error) {
441
454
  Logger({
442
455
  level: "WARN",
443
- message: "Response Validation Warnnings for trackShipment",
456
+ message: "Response Validation Warnnings for getShipmentBagReasons",
444
457
  });
445
458
  Logger({ level: "WARN", message: res_error });
446
459
  }
@@ -450,18 +463,16 @@ class Order {
450
463
 
451
464
  /**
452
465
  * @param {Object} arg - Arg object.
453
- * @param {string} arg.orderId - ID of the shipment. An order may contain
466
+ * @param {string} arg.shipmentId - ID of the shipment. An order may contain
454
467
  * multiple items and may get divided into one or more shipment, each
455
468
  * having its own ID.
456
- * @param {string} arg.shipmentId - A unique number used for identifying and
457
- * tracking your orders.
458
- * @returns {Promise<CustomerDetailsResponse>} - Success response
459
- * @summary: Get Customer Details by Shipment Id
460
- * @description: Use this API to retrieve customer details such as mobileno using Shipment ID.
469
+ * @returns {Promise<ShipmentById>} - Success response
470
+ * @summary: Get details of a shipment
471
+ * @description: Use this API to retrieve shipment details such as price breakup, tracking details, store information, etc. using Shipment ID.
461
472
  */
462
- async getCustomerDetailsByShipmentId({ orderId, shipmentId } = {}) {
463
- const { error } = OrderValidator.getCustomerDetailsByShipmentId().validate(
464
- { orderId, shipmentId },
473
+ async getShipmentById({ shipmentId } = {}) {
474
+ const { error } = OrderValidator.getShipmentById().validate(
475
+ { shipmentId },
465
476
  { abortEarly: false, allowUnknown: true }
466
477
  );
467
478
  if (error) {
@@ -469,17 +480,14 @@ class Order {
469
480
  }
470
481
 
471
482
  // Showing warrnings if extra unknown parameters are found
472
- const {
473
- error: warrning,
474
- } = OrderValidator.getCustomerDetailsByShipmentId().validate(
475
- { orderId, shipmentId },
483
+ const { error: warrning } = OrderValidator.getShipmentById().validate(
484
+ { shipmentId },
476
485
  { abortEarly: false, allowUnknown: false }
477
486
  );
478
487
  if (warrning) {
479
488
  Logger({
480
489
  level: "WARN",
481
- message:
482
- "Parameter Validation warrnings for getCustomerDetailsByShipmentId",
490
+ message: "Parameter Validation warrnings for getShipmentById",
483
491
  });
484
492
  Logger({ level: "WARN", message: warrning });
485
493
  }
@@ -488,21 +496,19 @@ class Order {
488
496
 
489
497
  const xHeaders = {};
490
498
 
491
- const response = await APIClient.execute(
499
+ const response = await ApplicationAPIClient.execute(
492
500
  this._conf,
493
501
  "get",
494
502
  constructUrl({
495
- url: this._urls["getCustomerDetailsByShipmentId"],
496
- params: { orderId, shipmentId },
503
+ url: this._urls["getShipmentById"],
504
+ params: { shipmentId },
497
505
  }),
498
506
  query_params,
499
507
  undefined,
500
508
  xHeaders
501
509
  );
502
510
 
503
- const {
504
- error: res_error,
505
- } = OrderModel.CustomerDetailsResponse().validate(response, {
511
+ const { error: res_error } = OrderModel.ShipmentById().validate(response, {
506
512
  abortEarly: false,
507
513
  allowUnknown: false,
508
514
  });
@@ -510,8 +516,7 @@ class Order {
510
516
  if (res_error) {
511
517
  Logger({
512
518
  level: "WARN",
513
- message:
514
- "Response Validation Warnnings for getCustomerDetailsByShipmentId",
519
+ message: "Response Validation Warnnings for getShipmentById",
515
520
  });
516
521
  Logger({ level: "WARN", message: res_error });
517
522
  }
@@ -521,18 +526,16 @@ class Order {
521
526
 
522
527
  /**
523
528
  * @param {Object} arg - Arg object.
524
- * @param {string} arg.orderId - A unique number used for identifying and
525
- * tracking your orders.
526
529
  * @param {string} arg.shipmentId - ID of the shipment. An order may contain
527
530
  * multiple items and may get divided into one or more shipment, each
528
531
  * having its own ID.
529
- * @returns {Promise<SendOtpToCustomerResponse>} - Success response
530
- * @summary: Send and Resend Otp code to Order-Shipment customer
531
- * @description: Use this API to send OTP to the customer of the mapped Shipment.
532
+ * @returns {Promise<ShipmentReasons>} - Success response
533
+ * @summary: Get reasons behind full or partial cancellation of a shipment
534
+ * @description: Use this API to retrieve the issues that led to the cancellation of bags within a shipment.
532
535
  */
533
- async sendOtpToShipmentCustomer({ orderId, shipmentId } = {}) {
534
- const { error } = OrderValidator.sendOtpToShipmentCustomer().validate(
535
- { orderId, shipmentId },
536
+ async getShipmentReasons({ shipmentId } = {}) {
537
+ const { error } = OrderValidator.getShipmentReasons().validate(
538
+ { shipmentId },
536
539
  { abortEarly: false, allowUnknown: true }
537
540
  );
538
541
  if (error) {
@@ -540,16 +543,14 @@ class Order {
540
543
  }
541
544
 
542
545
  // Showing warrnings if extra unknown parameters are found
543
- const {
544
- error: warrning,
545
- } = OrderValidator.sendOtpToShipmentCustomer().validate(
546
- { orderId, shipmentId },
546
+ const { error: warrning } = OrderValidator.getShipmentReasons().validate(
547
+ { shipmentId },
547
548
  { abortEarly: false, allowUnknown: false }
548
549
  );
549
550
  if (warrning) {
550
551
  Logger({
551
552
  level: "WARN",
552
- message: "Parameter Validation warrnings for sendOtpToShipmentCustomer",
553
+ message: "Parameter Validation warrnings for getShipmentReasons",
553
554
  });
554
555
  Logger({ level: "WARN", message: warrning });
555
556
  }
@@ -558,29 +559,27 @@ class Order {
558
559
 
559
560
  const xHeaders = {};
560
561
 
561
- const response = await APIClient.execute(
562
+ const response = await ApplicationAPIClient.execute(
562
563
  this._conf,
563
- "post",
564
+ "get",
564
565
  constructUrl({
565
- url: this._urls["sendOtpToShipmentCustomer"],
566
- params: { orderId, shipmentId },
566
+ url: this._urls["getShipmentReasons"],
567
+ params: { shipmentId },
567
568
  }),
568
569
  query_params,
569
570
  undefined,
570
571
  xHeaders
571
572
  );
572
573
 
573
- const {
574
- error: res_error,
575
- } = OrderModel.SendOtpToCustomerResponse().validate(response, {
576
- abortEarly: false,
577
- allowUnknown: false,
578
- });
574
+ const { error: res_error } = OrderModel.ShipmentReasons().validate(
575
+ response,
576
+ { abortEarly: false, allowUnknown: false }
577
+ );
579
578
 
580
579
  if (res_error) {
581
580
  Logger({
582
581
  level: "WARN",
583
- message: "Response Validation Warnnings for sendOtpToShipmentCustomer",
582
+ message: "Response Validation Warnnings for getShipmentReasons",
584
583
  });
585
584
  Logger({ level: "WARN", message: res_error });
586
585
  }
@@ -595,14 +594,13 @@ class Order {
595
594
  * @param {string} arg.shipmentId - ID of the shipment. An order may contain
596
595
  * multiple items and may get divided into one or more shipment, each
597
596
  * having its own ID.
598
- * @param {VerifyOtp} arg.body
599
- * @returns {Promise<VerifyOtpResponse>} - Success response
600
- * @summary: Verify Otp code
601
- * @description: Use this API to verify OTP and create a session token with custom payload.
597
+ * @returns {Promise<SendOtpToCustomerResponse>} - Success response
598
+ * @summary: Send and Resend Otp code to Order-Shipment customer
599
+ * @description: Use this API to send OTP to the customer of the mapped Shipment.
602
600
  */
603
- async verifyOtpShipmentCustomer({ orderId, shipmentId, body } = {}) {
604
- const { error } = OrderValidator.verifyOtpShipmentCustomer().validate(
605
- { orderId, shipmentId, body },
601
+ async sendOtpToShipmentCustomer({ orderId, shipmentId } = {}) {
602
+ const { error } = OrderValidator.sendOtpToShipmentCustomer().validate(
603
+ { orderId, shipmentId },
606
604
  { abortEarly: false, allowUnknown: true }
607
605
  );
608
606
  if (error) {
@@ -612,14 +610,14 @@ class Order {
612
610
  // Showing warrnings if extra unknown parameters are found
613
611
  const {
614
612
  error: warrning,
615
- } = OrderValidator.verifyOtpShipmentCustomer().validate(
616
- { orderId, shipmentId, body },
613
+ } = OrderValidator.sendOtpToShipmentCustomer().validate(
614
+ { orderId, shipmentId },
617
615
  { abortEarly: false, allowUnknown: false }
618
616
  );
619
617
  if (warrning) {
620
618
  Logger({
621
619
  level: "WARN",
622
- message: "Parameter Validation warrnings for verifyOtpShipmentCustomer",
620
+ message: "Parameter Validation warrnings for sendOtpToShipmentCustomer",
623
621
  });
624
622
  Logger({ level: "WARN", message: warrning });
625
623
  }
@@ -628,21 +626,21 @@ class Order {
628
626
 
629
627
  const xHeaders = {};
630
628
 
631
- const response = await APIClient.execute(
629
+ const response = await ApplicationAPIClient.execute(
632
630
  this._conf,
633
631
  "post",
634
632
  constructUrl({
635
- url: this._urls["verifyOtpShipmentCustomer"],
633
+ url: this._urls["sendOtpToShipmentCustomer"],
636
634
  params: { orderId, shipmentId },
637
635
  }),
638
636
  query_params,
639
- body,
637
+ undefined,
640
638
  xHeaders
641
639
  );
642
640
 
643
641
  const {
644
642
  error: res_error,
645
- } = OrderModel.VerifyOtpResponse().validate(response, {
643
+ } = OrderModel.SendOtpToCustomerResponse().validate(response, {
646
644
  abortEarly: false,
647
645
  allowUnknown: false,
648
646
  });
@@ -650,7 +648,7 @@ class Order {
650
648
  if (res_error) {
651
649
  Logger({
652
650
  level: "WARN",
653
- message: "Response Validation Warnnings for verifyOtpShipmentCustomer",
651
+ message: "Response Validation Warnnings for sendOtpToShipmentCustomer",
654
652
  });
655
653
  Logger({ level: "WARN", message: res_error });
656
654
  }
@@ -660,18 +658,16 @@ class Order {
660
658
 
661
659
  /**
662
660
  * @param {Object} arg - Arg object.
663
- * @param {string} arg.shipmentId - ID of the bag. An order may contain
661
+ * @param {string} arg.shipmentId - ID of the shipment. An order may contain
664
662
  * multiple items and may get divided into one or more shipment, each
665
663
  * having its own ID.
666
- * @param {string} arg.bagId - ID of the bag. An order may contain multiple
667
- * items and may get divided into one or more shipment, each having its own ID.
668
- * @returns {Promise<ShipmentBagReasons>} - Success response
669
- * @summary: Get reasons behind full or partial cancellation of a shipment
670
- * @description: Use this API to retrieve the issues that led to the cancellation of bags within a shipment.
664
+ * @returns {Promise<ShipmentTrack>} - Success response
665
+ * @summary: Track shipment
666
+ * @description: Track Shipment by shipment id, for application based on application Id
671
667
  */
672
- async getShipmentBagReasons({ shipmentId, bagId } = {}) {
673
- const { error } = OrderValidator.getShipmentBagReasons().validate(
674
- { shipmentId, bagId },
668
+ async trackShipment({ shipmentId } = {}) {
669
+ const { error } = OrderValidator.trackShipment().validate(
670
+ { shipmentId },
675
671
  { abortEarly: false, allowUnknown: true }
676
672
  );
677
673
  if (error) {
@@ -679,14 +675,14 @@ class Order {
679
675
  }
680
676
 
681
677
  // Showing warrnings if extra unknown parameters are found
682
- const { error: warrning } = OrderValidator.getShipmentBagReasons().validate(
683
- { shipmentId, bagId },
678
+ const { error: warrning } = OrderValidator.trackShipment().validate(
679
+ { shipmentId },
684
680
  { abortEarly: false, allowUnknown: false }
685
681
  );
686
682
  if (warrning) {
687
683
  Logger({
688
684
  level: "WARN",
689
- message: "Parameter Validation warrnings for getShipmentBagReasons",
685
+ message: "Parameter Validation warrnings for trackShipment",
690
686
  });
691
687
  Logger({ level: "WARN", message: warrning });
692
688
  }
@@ -695,21 +691,19 @@ class Order {
695
691
 
696
692
  const xHeaders = {};
697
693
 
698
- const response = await APIClient.execute(
694
+ const response = await ApplicationAPIClient.execute(
699
695
  this._conf,
700
696
  "get",
701
697
  constructUrl({
702
- url: this._urls["getShipmentBagReasons"],
703
- params: { shipmentId, bagId },
698
+ url: this._urls["trackShipment"],
699
+ params: { shipmentId },
704
700
  }),
705
701
  query_params,
706
702
  undefined,
707
703
  xHeaders
708
704
  );
709
705
 
710
- const {
711
- error: res_error,
712
- } = OrderModel.ShipmentBagReasons().validate(response, {
706
+ const { error: res_error } = OrderModel.ShipmentTrack().validate(response, {
713
707
  abortEarly: false,
714
708
  allowUnknown: false,
715
709
  });
@@ -717,7 +711,7 @@ class Order {
717
711
  if (res_error) {
718
712
  Logger({
719
713
  level: "WARN",
720
- message: "Response Validation Warnnings for getShipmentBagReasons",
714
+ message: "Response Validation Warnnings for trackShipment",
721
715
  });
722
716
  Logger({ level: "WARN", message: res_error });
723
717
  }
@@ -730,13 +724,14 @@ class Order {
730
724
  * @param {string} arg.shipmentId - ID of the shipment. An order may contain
731
725
  * multiple items and may get divided into one or more shipment, each
732
726
  * having its own ID.
733
- * @returns {Promise<ShipmentReasons>} - Success response
734
- * @summary: Get reasons behind full or partial cancellation of a shipment
735
- * @description: Use this API to retrieve the issues that led to the cancellation of bags within a shipment.
727
+ * @param {UpdateShipmentStatusRequest} arg.body
728
+ * @returns {Promise<ShipmentApplicationStatusResponse>} - Success response
729
+ * @summary: Update the shipment status
730
+ * @description: Use this API to update the status of a shipment using its shipment ID.
736
731
  */
737
- async getShipmentReasons({ shipmentId } = {}) {
738
- const { error } = OrderValidator.getShipmentReasons().validate(
739
- { shipmentId },
732
+ async updateShipmentStatus({ shipmentId, body } = {}) {
733
+ const { error } = OrderValidator.updateShipmentStatus().validate(
734
+ { shipmentId, body },
740
735
  { abortEarly: false, allowUnknown: true }
741
736
  );
742
737
  if (error) {
@@ -744,14 +739,14 @@ class Order {
744
739
  }
745
740
 
746
741
  // Showing warrnings if extra unknown parameters are found
747
- const { error: warrning } = OrderValidator.getShipmentReasons().validate(
748
- { shipmentId },
742
+ const { error: warrning } = OrderValidator.updateShipmentStatus().validate(
743
+ { shipmentId, body },
749
744
  { abortEarly: false, allowUnknown: false }
750
745
  );
751
746
  if (warrning) {
752
747
  Logger({
753
748
  level: "WARN",
754
- message: "Parameter Validation warrnings for getShipmentReasons",
749
+ message: "Parameter Validation warrnings for updateShipmentStatus",
755
750
  });
756
751
  Logger({ level: "WARN", message: warrning });
757
752
  }
@@ -760,27 +755,29 @@ class Order {
760
755
 
761
756
  const xHeaders = {};
762
757
 
763
- const response = await APIClient.execute(
758
+ const response = await ApplicationAPIClient.execute(
764
759
  this._conf,
765
- "get",
760
+ "put",
766
761
  constructUrl({
767
- url: this._urls["getShipmentReasons"],
762
+ url: this._urls["updateShipmentStatus"],
768
763
  params: { shipmentId },
769
764
  }),
770
765
  query_params,
771
- undefined,
766
+ body,
772
767
  xHeaders
773
768
  );
774
769
 
775
- const { error: res_error } = OrderModel.ShipmentReasons().validate(
776
- response,
777
- { abortEarly: false, allowUnknown: false }
778
- );
770
+ const {
771
+ error: res_error,
772
+ } = OrderModel.ShipmentApplicationStatusResponse().validate(response, {
773
+ abortEarly: false,
774
+ allowUnknown: false,
775
+ });
779
776
 
780
777
  if (res_error) {
781
778
  Logger({
782
779
  level: "WARN",
783
- message: "Response Validation Warnnings for getShipmentReasons",
780
+ message: "Response Validation Warnnings for updateShipmentStatus",
784
781
  });
785
782
  Logger({ level: "WARN", message: res_error });
786
783
  }
@@ -790,17 +787,19 @@ class Order {
790
787
 
791
788
  /**
792
789
  * @param {Object} arg - Arg object.
790
+ * @param {string} arg.orderId - A unique number used for identifying and
791
+ * tracking your orders.
793
792
  * @param {string} arg.shipmentId - ID of the shipment. An order may contain
794
793
  * multiple items and may get divided into one or more shipment, each
795
794
  * having its own ID.
796
- * @param {UpdateShipmentStatusRequest} arg.body
797
- * @returns {Promise<ShipmentApplicationStatusResponse>} - Success response
798
- * @summary: Update the shipment status
799
- * @description: Use this API to update the status of a shipment using its shipment ID.
795
+ * @param {VerifyOtp} arg.body
796
+ * @returns {Promise<VerifyOtpResponse>} - Success response
797
+ * @summary: Verify Otp code
798
+ * @description: Use this API to verify OTP and create a session token with custom payload.
800
799
  */
801
- async updateShipmentStatus({ shipmentId, body } = {}) {
802
- const { error } = OrderValidator.updateShipmentStatus().validate(
803
- { shipmentId, body },
800
+ async verifyOtpShipmentCustomer({ orderId, shipmentId, body } = {}) {
801
+ const { error } = OrderValidator.verifyOtpShipmentCustomer().validate(
802
+ { orderId, shipmentId, body },
804
803
  { abortEarly: false, allowUnknown: true }
805
804
  );
806
805
  if (error) {
@@ -808,14 +807,16 @@ class Order {
808
807
  }
809
808
 
810
809
  // Showing warrnings if extra unknown parameters are found
811
- const { error: warrning } = OrderValidator.updateShipmentStatus().validate(
812
- { shipmentId, body },
810
+ const {
811
+ error: warrning,
812
+ } = OrderValidator.verifyOtpShipmentCustomer().validate(
813
+ { orderId, shipmentId, body },
813
814
  { abortEarly: false, allowUnknown: false }
814
815
  );
815
816
  if (warrning) {
816
817
  Logger({
817
818
  level: "WARN",
818
- message: "Parameter Validation warrnings for updateShipmentStatus",
819
+ message: "Parameter Validation warrnings for verifyOtpShipmentCustomer",
819
820
  });
820
821
  Logger({ level: "WARN", message: warrning });
821
822
  }
@@ -824,12 +825,12 @@ class Order {
824
825
 
825
826
  const xHeaders = {};
826
827
 
827
- const response = await APIClient.execute(
828
+ const response = await ApplicationAPIClient.execute(
828
829
  this._conf,
829
- "put",
830
+ "post",
830
831
  constructUrl({
831
- url: this._urls["updateShipmentStatus"],
832
- params: { shipmentId },
832
+ url: this._urls["verifyOtpShipmentCustomer"],
833
+ params: { orderId, shipmentId },
833
834
  }),
834
835
  query_params,
835
836
  body,
@@ -838,7 +839,7 @@ class Order {
838
839
 
839
840
  const {
840
841
  error: res_error,
841
- } = OrderModel.ShipmentApplicationStatusResponse().validate(response, {
842
+ } = OrderModel.VerifyOtpResponse().validate(response, {
842
843
  abortEarly: false,
843
844
  allowUnknown: false,
844
845
  });
@@ -846,7 +847,7 @@ class Order {
846
847
  if (res_error) {
847
848
  Logger({
848
849
  level: "WARN",
849
- message: "Response Validation Warnnings for updateShipmentStatus",
850
+ message: "Response Validation Warnnings for verifyOtpShipmentCustomer",
850
851
  });
851
852
  Logger({ level: "WARN", message: res_error });
852
853
  }