@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,9 +1,10 @@
1
- const Paginator = require("../../common/Paginator");
2
- const { FDKClientValidationError } = require("../../common/FDKError");
3
1
  const PlatformAPIClient = require("../PlatformAPIClient");
2
+ const { FDKClientValidationError } = require("../../common/FDKError");
3
+ const Paginator = require("../../common/Paginator");
4
4
  const DiscountValidator = require("./DiscountPlatformValidator");
5
5
  const DiscountModel = require("./DiscountPlatformModel");
6
6
  const { Logger } = require("./../../common/Logger");
7
+ const Joi = require("joi");
7
8
 
8
9
  class Discount {
9
10
  constructor(config) {
@@ -12,42 +13,15 @@ class Discount {
12
13
 
13
14
  /**
14
15
  * @param {Object} arg - Arg object.
15
- * @param {string} [arg.view] - Listing or calender. Default is listing.
16
- * @param {string} [arg.q] - The search query. This can be a partial or
17
- * complete name of a discount.
18
- * @param {number} [arg.pageNo] - Page number. Default is 1.
19
- * @param {number} [arg.pageSize] - Page size. Default is 12.
20
- * @param {boolean} [arg.archived] - Archived. Default is false.
21
- * @param {number} [arg.month] - Month. Default is current month.
22
- * @param {number} [arg.year] - Year. Default is current year.
23
- * @param {string} [arg.type] - Basic or custom.
24
- * @param {string[]} [arg.appIds] - Application ids.
25
- * @returns {Promise<ListOrCalender>} - Success response
26
- * @summary: Fetch discount list.
27
- * @description: Fetch discount list.
16
+ * @param {string} arg.id - Id
17
+ * @returns {Promise<CancelJobResponse>} - Success response
18
+ * @summary: Cancel Download Job.
19
+ * @description: Cancel Download Job.
28
20
  */
29
- async getDiscounts({
30
- view,
31
- q,
32
- pageNo,
33
- pageSize,
34
- archived,
35
- month,
36
- year,
37
- type,
38
- appIds,
39
- } = {}) {
40
- const { error } = DiscountValidator.getDiscounts().validate(
21
+ async cancelDownloadJob({ id } = {}) {
22
+ const { error } = DiscountValidator.cancelDownloadJob().validate(
41
23
  {
42
- view,
43
- q,
44
- pageNo,
45
- pageSize,
46
- archived,
47
- month,
48
- year,
49
- type,
50
- appIds,
24
+ id,
51
25
  },
52
26
  { abortEarly: false, allowUnknown: true }
53
27
  );
@@ -56,45 +30,28 @@ class Discount {
56
30
  }
57
31
 
58
32
  // Showing warrnings if extra unknown parameters are found
59
- const { error: warrning } = DiscountValidator.getDiscounts().validate(
33
+ const { error: warrning } = DiscountValidator.cancelDownloadJob().validate(
60
34
  {
61
- view,
62
- q,
63
- pageNo,
64
- pageSize,
65
- archived,
66
- month,
67
- year,
68
- type,
69
- appIds,
35
+ id,
70
36
  },
71
37
  { abortEarly: false, allowUnknown: false }
72
38
  );
73
39
  if (warrning) {
74
40
  Logger({
75
41
  level: "WARN",
76
- message: "Parameter Validation warrnings for getDiscounts",
42
+ message: "Parameter Validation warrnings for cancelDownloadJob",
77
43
  });
78
44
  Logger({ level: "WARN", message: warrning });
79
45
  }
80
46
 
81
47
  const query_params = {};
82
- query_params["view"] = view;
83
- query_params["q"] = q;
84
- query_params["page_no"] = pageNo;
85
- query_params["page_size"] = pageSize;
86
- query_params["archived"] = archived;
87
- query_params["month"] = month;
88
- query_params["year"] = year;
89
- query_params["type"] = type;
90
- query_params["app_ids"] = appIds;
91
48
 
92
49
  const xHeaders = {};
93
50
 
94
51
  const response = await PlatformAPIClient.execute(
95
52
  this.config,
96
- "get",
97
- `/service/platform/discount/v1.0/company/${this.config.companyId}/job/`,
53
+ "delete",
54
+ `/service/platform/discount/v1.0/company/${this.config.companyId}/file/download/${id}/`,
98
55
  query_params,
99
56
  undefined,
100
57
  xHeaders
@@ -102,7 +59,7 @@ class Discount {
102
59
 
103
60
  const {
104
61
  error: res_error,
105
- } = DiscountModel.ListOrCalender().validate(response, {
62
+ } = DiscountModel.CancelJobResponse().validate(response, {
106
63
  abortEarly: false,
107
64
  allowUnknown: false,
108
65
  });
@@ -110,7 +67,7 @@ class Discount {
110
67
  if (res_error) {
111
68
  Logger({
112
69
  level: "WARN",
113
- message: "Response Validation Warnnings for getDiscounts",
70
+ message: "Response Validation Warnnings for cancelDownloadJob",
114
71
  });
115
72
  Logger({ level: "WARN", message: res_error });
116
73
  }
@@ -120,15 +77,15 @@ class Discount {
120
77
 
121
78
  /**
122
79
  * @param {Object} arg - Arg object.
123
- * @param {CreateUpdateDiscount} arg.body
124
- * @returns {Promise<DiscountJob>} - Success response
125
- * @summary: Create Discount.
126
- * @description: Create Discount.
80
+ * @param {string} arg.id - Id
81
+ * @returns {Promise<CancelJobResponse>} - Success response
82
+ * @summary: Cancel Validation Job.
83
+ * @description: Cancel Validation Job.
127
84
  */
128
- async createDiscount({ body } = {}) {
129
- const { error } = DiscountValidator.createDiscount().validate(
85
+ async cancelValidationJob({ id } = {}) {
86
+ const { error } = DiscountValidator.cancelValidationJob().validate(
130
87
  {
131
- body,
88
+ id,
132
89
  },
133
90
  { abortEarly: false, allowUnknown: true }
134
91
  );
@@ -137,16 +94,18 @@ class Discount {
137
94
  }
138
95
 
139
96
  // Showing warrnings if extra unknown parameters are found
140
- const { error: warrning } = DiscountValidator.createDiscount().validate(
97
+ const {
98
+ error: warrning,
99
+ } = DiscountValidator.cancelValidationJob().validate(
141
100
  {
142
- body,
101
+ id,
143
102
  },
144
103
  { abortEarly: false, allowUnknown: false }
145
104
  );
146
105
  if (warrning) {
147
106
  Logger({
148
107
  level: "WARN",
149
- message: "Parameter Validation warrnings for createDiscount",
108
+ message: "Parameter Validation warrnings for cancelValidationJob",
150
109
  });
151
110
  Logger({ level: "WARN", message: warrning });
152
111
  }
@@ -157,22 +116,24 @@ class Discount {
157
116
 
158
117
  const response = await PlatformAPIClient.execute(
159
118
  this.config,
160
- "post",
161
- `/service/platform/discount/v1.0/company/${this.config.companyId}/job/`,
119
+ "delete",
120
+ `/service/platform/discount/v1.0/company/${this.config.companyId}/file/validation/${id}/`,
162
121
  query_params,
163
- body,
122
+ undefined,
164
123
  xHeaders
165
124
  );
166
125
 
167
- const { error: res_error } = DiscountModel.DiscountJob().validate(
168
- response,
169
- { abortEarly: false, allowUnknown: false }
170
- );
126
+ const {
127
+ error: res_error,
128
+ } = DiscountModel.CancelJobResponse().validate(response, {
129
+ abortEarly: false,
130
+ allowUnknown: false,
131
+ });
171
132
 
172
133
  if (res_error) {
173
134
  Logger({
174
135
  level: "WARN",
175
- message: "Response Validation Warnnings for createDiscount",
136
+ message: "Response Validation Warnnings for cancelValidationJob",
176
137
  });
177
138
  Logger({ level: "WARN", message: res_error });
178
139
  }
@@ -182,15 +143,15 @@ class Discount {
182
143
 
183
144
  /**
184
145
  * @param {Object} arg - Arg object.
185
- * @param {string} arg.id - Unique id.
146
+ * @param {CreateUpdateDiscount} arg.body
186
147
  * @returns {Promise<DiscountJob>} - Success response
187
- * @summary: Fetch discount.
188
- * @description: Fetch discount.
148
+ * @summary: Create Discount.
149
+ * @description: Create Discount.
189
150
  */
190
- async getDiscount({ id } = {}) {
191
- const { error } = DiscountValidator.getDiscount().validate(
151
+ async createDiscount({ body } = {}) {
152
+ const { error } = DiscountValidator.createDiscount().validate(
192
153
  {
193
- id,
154
+ body,
194
155
  },
195
156
  { abortEarly: false, allowUnknown: true }
196
157
  );
@@ -199,16 +160,16 @@ class Discount {
199
160
  }
200
161
 
201
162
  // Showing warrnings if extra unknown parameters are found
202
- const { error: warrning } = DiscountValidator.getDiscount().validate(
163
+ const { error: warrning } = DiscountValidator.createDiscount().validate(
203
164
  {
204
- id,
165
+ body,
205
166
  },
206
167
  { abortEarly: false, allowUnknown: false }
207
168
  );
208
169
  if (warrning) {
209
170
  Logger({
210
171
  level: "WARN",
211
- message: "Parameter Validation warrnings for getDiscount",
172
+ message: "Parameter Validation warrnings for createDiscount",
212
173
  });
213
174
  Logger({ level: "WARN", message: warrning });
214
175
  }
@@ -219,10 +180,10 @@ class Discount {
219
180
 
220
181
  const response = await PlatformAPIClient.execute(
221
182
  this.config,
222
- "get",
223
- `/service/platform/discount/v1.0/company/${this.config.companyId}/job/${id}/`,
183
+ "post",
184
+ `/service/platform/discount/v1.0/company/${this.config.companyId}/job/`,
224
185
  query_params,
225
- undefined,
186
+ body,
226
187
  xHeaders
227
188
  );
228
189
 
@@ -234,7 +195,7 @@ class Discount {
234
195
  if (res_error) {
235
196
  Logger({
236
197
  level: "WARN",
237
- message: "Response Validation Warnnings for getDiscount",
198
+ message: "Response Validation Warnnings for createDiscount",
238
199
  });
239
200
  Logger({ level: "WARN", message: res_error });
240
201
  }
@@ -244,16 +205,16 @@ class Discount {
244
205
 
245
206
  /**
246
207
  * @param {Object} arg - Arg object.
247
- * @param {string} arg.id - Id
248
- * @param {CreateUpdateDiscount} arg.body
249
- * @returns {Promise<DiscountJob>} - Success response
250
- * @summary: Create Discount.
251
- * @description: Create Discount.
208
+ * @param {string} arg.type - Type
209
+ * @param {DownloadFileJob} arg.body
210
+ * @returns {Promise<FileJobResponse>} - Success response
211
+ * @summary: Validate File.
212
+ * @description: Validate File.
252
213
  */
253
- async updateDiscount({ id, body } = {}) {
254
- const { error } = DiscountValidator.updateDiscount().validate(
214
+ async downloadDiscountFile({ type, body } = {}) {
215
+ const { error } = DiscountValidator.downloadDiscountFile().validate(
255
216
  {
256
- id,
217
+ type,
257
218
  body,
258
219
  },
259
220
  { abortEarly: false, allowUnknown: true }
@@ -263,9 +224,11 @@ class Discount {
263
224
  }
264
225
 
265
226
  // Showing warrnings if extra unknown parameters are found
266
- const { error: warrning } = DiscountValidator.updateDiscount().validate(
227
+ const {
228
+ error: warrning,
229
+ } = DiscountValidator.downloadDiscountFile().validate(
267
230
  {
268
- id,
231
+ type,
269
232
  body,
270
233
  },
271
234
  { abortEarly: false, allowUnknown: false }
@@ -273,7 +236,7 @@ class Discount {
273
236
  if (warrning) {
274
237
  Logger({
275
238
  level: "WARN",
276
- message: "Parameter Validation warrnings for updateDiscount",
239
+ message: "Parameter Validation warrnings for downloadDiscountFile",
277
240
  });
278
241
  Logger({ level: "WARN", message: warrning });
279
242
  }
@@ -284,22 +247,24 @@ class Discount {
284
247
 
285
248
  const response = await PlatformAPIClient.execute(
286
249
  this.config,
287
- "put",
288
- `/service/platform/discount/v1.0/company/${this.config.companyId}/job/${id}/`,
250
+ "post",
251
+ `/service/platform/discount/v1.0/company/${this.config.companyId}/file/${type}/download/`,
289
252
  query_params,
290
253
  body,
291
254
  xHeaders
292
255
  );
293
256
 
294
- const { error: res_error } = DiscountModel.DiscountJob().validate(
295
- response,
296
- { abortEarly: false, allowUnknown: false }
297
- );
257
+ const {
258
+ error: res_error,
259
+ } = DiscountModel.FileJobResponse().validate(response, {
260
+ abortEarly: false,
261
+ allowUnknown: false,
262
+ });
298
263
 
299
264
  if (res_error) {
300
265
  Logger({
301
266
  level: "WARN",
302
- message: "Response Validation Warnnings for updateDiscount",
267
+ message: "Response Validation Warnnings for downloadDiscountFile",
303
268
  });
304
269
  Logger({ level: "WARN", message: res_error });
305
270
  }
@@ -309,17 +274,15 @@ class Discount {
309
274
 
310
275
  /**
311
276
  * @param {Object} arg - Arg object.
312
- * @param {string} arg.id - Job ID of the discount.
313
- * @param {BulkDiscount} arg.body
314
- * @returns {Promise<Object>} - Success response
315
- * @summary: Create custom discount from bulk.
316
- * @description: Create custom discounts through API.
277
+ * @param {string} arg.id - Unique id.
278
+ * @returns {Promise<DiscountJob>} - Success response
279
+ * @summary: Fetch discount.
280
+ * @description: Fetch discount.
317
281
  */
318
- async upsertDiscountItems({ id, body } = {}) {
319
- const { error } = DiscountValidator.upsertDiscountItems().validate(
282
+ async getDiscount({ id } = {}) {
283
+ const { error } = DiscountValidator.getDiscount().validate(
320
284
  {
321
285
  id,
322
- body,
323
286
  },
324
287
  { abortEarly: false, allowUnknown: true }
325
288
  );
@@ -328,19 +291,16 @@ class Discount {
328
291
  }
329
292
 
330
293
  // Showing warrnings if extra unknown parameters are found
331
- const {
332
- error: warrning,
333
- } = DiscountValidator.upsertDiscountItems().validate(
294
+ const { error: warrning } = DiscountValidator.getDiscount().validate(
334
295
  {
335
296
  id,
336
- body,
337
297
  },
338
298
  { abortEarly: false, allowUnknown: false }
339
299
  );
340
300
  if (warrning) {
341
301
  Logger({
342
302
  level: "WARN",
343
- message: "Parameter Validation warrnings for upsertDiscountItems",
303
+ message: "Parameter Validation warrnings for getDiscount",
344
304
  });
345
305
  Logger({ level: "WARN", message: warrning });
346
306
  }
@@ -351,22 +311,22 @@ class Discount {
351
311
 
352
312
  const response = await PlatformAPIClient.execute(
353
313
  this.config,
354
- "post",
355
- `/service/platform/discount/v1.0/company/${this.config.companyId}/job/${id}/items/`,
314
+ "get",
315
+ `/service/platform/discount/v1.0/company/${this.config.companyId}/job/${id}/`,
356
316
  query_params,
357
- body,
317
+ undefined,
358
318
  xHeaders
359
319
  );
360
320
 
361
- const { error: res_error } = Joi.any().validate(response, {
362
- abortEarly: false,
363
- allowUnknown: false,
364
- });
321
+ const { error: res_error } = DiscountModel.DiscountJob().validate(
322
+ response,
323
+ { abortEarly: false, allowUnknown: false }
324
+ );
365
325
 
366
326
  if (res_error) {
367
327
  Logger({
368
328
  level: "WARN",
369
- message: "Response Validation Warnnings for upsertDiscountItems",
329
+ message: "Response Validation Warnnings for getDiscount",
370
330
  });
371
331
  Logger({ level: "WARN", message: res_error });
372
332
  }
@@ -376,17 +336,42 @@ class Discount {
376
336
 
377
337
  /**
378
338
  * @param {Object} arg - Arg object.
379
- * @param {string} [arg.discount] - Discount
380
- * @param {DiscountJob} arg.body
381
- * @returns {Promise<FileJobResponse>} - Success response
382
- * @summary: Validate File.
383
- * @description: Validate File.
339
+ * @param {string} [arg.view] - Listing or calender. Default is listing.
340
+ * @param {string} [arg.q] - The search query. This can be a partial or
341
+ * complete name of a discount.
342
+ * @param {number} [arg.pageNo] - Page number. Default is 1.
343
+ * @param {number} [arg.pageSize] - Page size. Default is 12.
344
+ * @param {boolean} [arg.archived] - Archived. Default is false.
345
+ * @param {number} [arg.month] - Month. Default is current month.
346
+ * @param {number} [arg.year] - Year. Default is current year.
347
+ * @param {string} [arg.type] - Basic or custom.
348
+ * @param {string[]} [arg.appIds] - Application ids.
349
+ * @returns {Promise<ListOrCalender>} - Success response
350
+ * @summary: Fetch discount list.
351
+ * @description: Fetch discount list.
384
352
  */
385
- async validateDiscountFile({ body, discount } = {}) {
386
- const { error } = DiscountValidator.validateDiscountFile().validate(
353
+ async getDiscounts({
354
+ view,
355
+ q,
356
+ pageNo,
357
+ pageSize,
358
+ archived,
359
+ month,
360
+ year,
361
+ type,
362
+ appIds,
363
+ } = {}) {
364
+ const { error } = DiscountValidator.getDiscounts().validate(
387
365
  {
388
- body,
389
- discount,
366
+ view,
367
+ q,
368
+ pageNo,
369
+ pageSize,
370
+ archived,
371
+ month,
372
+ year,
373
+ type,
374
+ appIds,
390
375
  },
391
376
  { abortEarly: false, allowUnknown: true }
392
377
  );
@@ -395,40 +380,53 @@ class Discount {
395
380
  }
396
381
 
397
382
  // Showing warrnings if extra unknown parameters are found
398
- const {
399
- error: warrning,
400
- } = DiscountValidator.validateDiscountFile().validate(
383
+ const { error: warrning } = DiscountValidator.getDiscounts().validate(
401
384
  {
402
- body,
403
- discount,
385
+ view,
386
+ q,
387
+ pageNo,
388
+ pageSize,
389
+ archived,
390
+ month,
391
+ year,
392
+ type,
393
+ appIds,
404
394
  },
405
395
  { abortEarly: false, allowUnknown: false }
406
396
  );
407
397
  if (warrning) {
408
398
  Logger({
409
399
  level: "WARN",
410
- message: "Parameter Validation warrnings for validateDiscountFile",
400
+ message: "Parameter Validation warrnings for getDiscounts",
411
401
  });
412
402
  Logger({ level: "WARN", message: warrning });
413
403
  }
414
404
 
415
405
  const query_params = {};
416
- query_params["discount"] = discount;
406
+ query_params["view"] = view;
407
+ query_params["q"] = q;
408
+ query_params["page_no"] = pageNo;
409
+ query_params["page_size"] = pageSize;
410
+ query_params["archived"] = archived;
411
+ query_params["month"] = month;
412
+ query_params["year"] = year;
413
+ query_params["type"] = type;
414
+ query_params["app_ids"] = appIds;
417
415
 
418
416
  const xHeaders = {};
419
417
 
420
418
  const response = await PlatformAPIClient.execute(
421
419
  this.config,
422
- "post",
423
- `/service/platform/discount/v1.0/company/${this.config.companyId}/file/validation/`,
420
+ "get",
421
+ `/service/platform/discount/v1.0/company/${this.config.companyId}/job/`,
424
422
  query_params,
425
- body,
423
+ undefined,
426
424
  xHeaders
427
425
  );
428
426
 
429
427
  const {
430
428
  error: res_error,
431
- } = DiscountModel.FileJobResponse().validate(response, {
429
+ } = DiscountModel.ListOrCalender().validate(response, {
432
430
  abortEarly: false,
433
431
  allowUnknown: false,
434
432
  });
@@ -436,7 +434,7 @@ class Discount {
436
434
  if (res_error) {
437
435
  Logger({
438
436
  level: "WARN",
439
- message: "Response Validation Warnnings for validateDiscountFile",
437
+ message: "Response Validation Warnnings for getDiscounts",
440
438
  });
441
439
  Logger({ level: "WARN", message: res_error });
442
440
  }
@@ -446,17 +444,15 @@ class Discount {
446
444
 
447
445
  /**
448
446
  * @param {Object} arg - Arg object.
449
- * @param {string} arg.type - Type
450
- * @param {DownloadFileJob} arg.body
447
+ * @param {string} arg.id - Id
451
448
  * @returns {Promise<FileJobResponse>} - Success response
452
- * @summary: Validate File.
453
- * @description: Validate File.
449
+ * @summary: Download File Job.
450
+ * @description: Download File Job.
454
451
  */
455
- async downloadDiscountFile({ type, body } = {}) {
456
- const { error } = DiscountValidator.downloadDiscountFile().validate(
452
+ async getDownloadJob({ id } = {}) {
453
+ const { error } = DiscountValidator.getDownloadJob().validate(
457
454
  {
458
- type,
459
- body,
455
+ id,
460
456
  },
461
457
  { abortEarly: false, allowUnknown: true }
462
458
  );
@@ -465,19 +461,16 @@ class Discount {
465
461
  }
466
462
 
467
463
  // Showing warrnings if extra unknown parameters are found
468
- const {
469
- error: warrning,
470
- } = DiscountValidator.downloadDiscountFile().validate(
464
+ const { error: warrning } = DiscountValidator.getDownloadJob().validate(
471
465
  {
472
- type,
473
- body,
466
+ id,
474
467
  },
475
468
  { abortEarly: false, allowUnknown: false }
476
469
  );
477
470
  if (warrning) {
478
471
  Logger({
479
472
  level: "WARN",
480
- message: "Parameter Validation warrnings for downloadDiscountFile",
473
+ message: "Parameter Validation warrnings for getDownloadJob",
481
474
  });
482
475
  Logger({ level: "WARN", message: warrning });
483
476
  }
@@ -488,10 +481,10 @@ class Discount {
488
481
 
489
482
  const response = await PlatformAPIClient.execute(
490
483
  this.config,
491
- "post",
492
- `/service/platform/discount/v1.0/company/${this.config.companyId}/file/${type}/download/`,
484
+ "get",
485
+ `/service/platform/discount/v1.0/company/${this.config.companyId}/file/download/${id}/`,
493
486
  query_params,
494
- body,
487
+ undefined,
495
488
  xHeaders
496
489
  );
497
490
 
@@ -505,7 +498,7 @@ class Discount {
505
498
  if (res_error) {
506
499
  Logger({
507
500
  level: "WARN",
508
- message: "Response Validation Warnnings for downloadDiscountFile",
501
+ message: "Response Validation Warnnings for getDownloadJob",
509
502
  });
510
503
  Logger({ level: "WARN", message: res_error });
511
504
  }
@@ -580,14 +573,16 @@ class Discount {
580
573
  /**
581
574
  * @param {Object} arg - Arg object.
582
575
  * @param {string} arg.id - Id
583
- * @returns {Promise<CancelJobResponse>} - Success response
584
- * @summary: Cancel Validation Job.
585
- * @description: Cancel Validation Job.
576
+ * @param {CreateUpdateDiscount} arg.body
577
+ * @returns {Promise<DiscountJob>} - Success response
578
+ * @summary: Create Discount.
579
+ * @description: Create Discount.
586
580
  */
587
- async cancelValidationJob({ id } = {}) {
588
- const { error } = DiscountValidator.cancelValidationJob().validate(
581
+ async updateDiscount({ id, body } = {}) {
582
+ const { error } = DiscountValidator.updateDiscount().validate(
589
583
  {
590
584
  id,
585
+ body,
591
586
  },
592
587
  { abortEarly: false, allowUnknown: true }
593
588
  );
@@ -596,18 +591,17 @@ class Discount {
596
591
  }
597
592
 
598
593
  // Showing warrnings if extra unknown parameters are found
599
- const {
600
- error: warrning,
601
- } = DiscountValidator.cancelValidationJob().validate(
594
+ const { error: warrning } = DiscountValidator.updateDiscount().validate(
602
595
  {
603
596
  id,
597
+ body,
604
598
  },
605
599
  { abortEarly: false, allowUnknown: false }
606
600
  );
607
601
  if (warrning) {
608
602
  Logger({
609
603
  level: "WARN",
610
- message: "Parameter Validation warrnings for cancelValidationJob",
604
+ message: "Parameter Validation warrnings for updateDiscount",
611
605
  });
612
606
  Logger({ level: "WARN", message: warrning });
613
607
  }
@@ -618,24 +612,22 @@ class Discount {
618
612
 
619
613
  const response = await PlatformAPIClient.execute(
620
614
  this.config,
621
- "delete",
622
- `/service/platform/discount/v1.0/company/${this.config.companyId}/file/validation/${id}/`,
615
+ "put",
616
+ `/service/platform/discount/v1.0/company/${this.config.companyId}/job/${id}/`,
623
617
  query_params,
624
- undefined,
618
+ body,
625
619
  xHeaders
626
620
  );
627
621
 
628
- const {
629
- error: res_error,
630
- } = DiscountModel.CancelJobResponse().validate(response, {
631
- abortEarly: false,
632
- allowUnknown: false,
633
- });
622
+ const { error: res_error } = DiscountModel.DiscountJob().validate(
623
+ response,
624
+ { abortEarly: false, allowUnknown: false }
625
+ );
634
626
 
635
627
  if (res_error) {
636
628
  Logger({
637
629
  level: "WARN",
638
- message: "Response Validation Warnnings for cancelValidationJob",
630
+ message: "Response Validation Warnnings for updateDiscount",
639
631
  });
640
632
  Logger({ level: "WARN", message: res_error });
641
633
  }
@@ -645,15 +637,17 @@ class Discount {
645
637
 
646
638
  /**
647
639
  * @param {Object} arg - Arg object.
648
- * @param {string} arg.id - Id
649
- * @returns {Promise<FileJobResponse>} - Success response
650
- * @summary: Download File Job.
651
- * @description: Download File Job.
640
+ * @param {string} arg.id - Job ID of the discount.
641
+ * @param {BulkDiscount} arg.body
642
+ * @returns {Promise<Object>} - Success response
643
+ * @summary: Create custom discount from bulk.
644
+ * @description: Create custom discounts through API.
652
645
  */
653
- async getDownloadJob({ id } = {}) {
654
- const { error } = DiscountValidator.getDownloadJob().validate(
646
+ async upsertDiscountItems({ id, body } = {}) {
647
+ const { error } = DiscountValidator.upsertDiscountItems().validate(
655
648
  {
656
649
  id,
650
+ body,
657
651
  },
658
652
  { abortEarly: false, allowUnknown: true }
659
653
  );
@@ -662,16 +656,19 @@ class Discount {
662
656
  }
663
657
 
664
658
  // Showing warrnings if extra unknown parameters are found
665
- const { error: warrning } = DiscountValidator.getDownloadJob().validate(
659
+ const {
660
+ error: warrning,
661
+ } = DiscountValidator.upsertDiscountItems().validate(
666
662
  {
667
663
  id,
664
+ body,
668
665
  },
669
666
  { abortEarly: false, allowUnknown: false }
670
667
  );
671
668
  if (warrning) {
672
669
  Logger({
673
670
  level: "WARN",
674
- message: "Parameter Validation warrnings for getDownloadJob",
671
+ message: "Parameter Validation warrnings for upsertDiscountItems",
675
672
  });
676
673
  Logger({ level: "WARN", message: warrning });
677
674
  }
@@ -682,16 +679,14 @@ class Discount {
682
679
 
683
680
  const response = await PlatformAPIClient.execute(
684
681
  this.config,
685
- "get",
686
- `/service/platform/discount/v1.0/company/${this.config.companyId}/file/download/${id}/`,
682
+ "post",
683
+ `/service/platform/discount/v1.0/company/${this.config.companyId}/job/${id}/items/`,
687
684
  query_params,
688
- undefined,
685
+ body,
689
686
  xHeaders
690
687
  );
691
688
 
692
- const {
693
- error: res_error,
694
- } = DiscountModel.FileJobResponse().validate(response, {
689
+ const { error: res_error } = Joi.any().validate(response, {
695
690
  abortEarly: false,
696
691
  allowUnknown: false,
697
692
  });
@@ -699,7 +694,7 @@ class Discount {
699
694
  if (res_error) {
700
695
  Logger({
701
696
  level: "WARN",
702
- message: "Response Validation Warnnings for getDownloadJob",
697
+ message: "Response Validation Warnnings for upsertDiscountItems",
703
698
  });
704
699
  Logger({ level: "WARN", message: res_error });
705
700
  }
@@ -709,15 +704,17 @@ class Discount {
709
704
 
710
705
  /**
711
706
  * @param {Object} arg - Arg object.
712
- * @param {string} arg.id - Id
713
- * @returns {Promise<CancelJobResponse>} - Success response
714
- * @summary: Cancel Download Job.
715
- * @description: Cancel Download Job.
707
+ * @param {string} [arg.discount] - Discount
708
+ * @param {DiscountJob} arg.body
709
+ * @returns {Promise<FileJobResponse>} - Success response
710
+ * @summary: Validate File.
711
+ * @description: Validate File.
716
712
  */
717
- async cancelDownloadJob({ id } = {}) {
718
- const { error } = DiscountValidator.cancelDownloadJob().validate(
713
+ async validateDiscountFile({ body, discount } = {}) {
714
+ const { error } = DiscountValidator.validateDiscountFile().validate(
719
715
  {
720
- id,
716
+ body,
717
+ discount,
721
718
  },
722
719
  { abortEarly: false, allowUnknown: true }
723
720
  );
@@ -726,36 +723,40 @@ class Discount {
726
723
  }
727
724
 
728
725
  // Showing warrnings if extra unknown parameters are found
729
- const { error: warrning } = DiscountValidator.cancelDownloadJob().validate(
726
+ const {
727
+ error: warrning,
728
+ } = DiscountValidator.validateDiscountFile().validate(
730
729
  {
731
- id,
730
+ body,
731
+ discount,
732
732
  },
733
733
  { abortEarly: false, allowUnknown: false }
734
734
  );
735
735
  if (warrning) {
736
736
  Logger({
737
737
  level: "WARN",
738
- message: "Parameter Validation warrnings for cancelDownloadJob",
738
+ message: "Parameter Validation warrnings for validateDiscountFile",
739
739
  });
740
740
  Logger({ level: "WARN", message: warrning });
741
741
  }
742
742
 
743
743
  const query_params = {};
744
+ query_params["discount"] = discount;
744
745
 
745
746
  const xHeaders = {};
746
747
 
747
748
  const response = await PlatformAPIClient.execute(
748
749
  this.config,
749
- "delete",
750
- `/service/platform/discount/v1.0/company/${this.config.companyId}/file/download/${id}/`,
750
+ "post",
751
+ `/service/platform/discount/v1.0/company/${this.config.companyId}/file/validation/`,
751
752
  query_params,
752
- undefined,
753
+ body,
753
754
  xHeaders
754
755
  );
755
756
 
756
757
  const {
757
758
  error: res_error,
758
- } = DiscountModel.CancelJobResponse().validate(response, {
759
+ } = DiscountModel.FileJobResponse().validate(response, {
759
760
  abortEarly: false,
760
761
  allowUnknown: false,
761
762
  });
@@ -763,7 +764,7 @@ class Discount {
763
764
  if (res_error) {
764
765
  Logger({
765
766
  level: "WARN",
766
- message: "Response Validation Warnnings for cancelDownloadJob",
767
+ message: "Response Validation Warnnings for validateDiscountFile",
767
768
  });
768
769
  Logger({ level: "WARN", message: res_error });
769
770
  }