@gofynd/fdk-client-javascript 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (310) hide show
  1. package/documentation/application/CART.md +5934 -4502
  2. package/documentation/application/CATALOG.md +6338 -7245
  3. package/documentation/application/COMMON.md +95 -222
  4. package/documentation/application/COMMUNICATION.md +106 -186
  5. package/documentation/application/CONFIGURATION.md +903 -1597
  6. package/documentation/application/CONTENT.md +557 -1279
  7. package/documentation/application/FILESTORAGE.md +84 -220
  8. package/documentation/application/LEAD.md +314 -660
  9. package/documentation/application/LOGISTIC.md +229 -305
  10. package/documentation/application/ORDER.md +642 -1137
  11. package/documentation/application/PAYMENT.md +2285 -3031
  12. package/documentation/application/POSCART.md +6079 -4642
  13. package/documentation/application/REWARDS.md +94 -248
  14. package/documentation/application/SHARE.md +152 -250
  15. package/documentation/application/THEME.md +952 -1235
  16. package/documentation/application/USER.md +1228 -1765
  17. package/documentation/platform/ANALYTICS.md +207 -349
  18. package/documentation/platform/AUDITTRAIL.md +121 -204
  19. package/documentation/platform/BILLING.md +865 -1376
  20. package/documentation/platform/CART.md +2814 -3662
  21. package/documentation/platform/CATALOG.md +14453 -17192
  22. package/documentation/platform/COMMON.md +95 -222
  23. package/documentation/platform/COMMUNICATION.md +1632 -2380
  24. package/documentation/platform/COMPANYPROFILE.md +572 -957
  25. package/documentation/platform/CONFIGURATION.md +3050 -4073
  26. package/documentation/platform/CONTENT.md +3438 -4172
  27. package/documentation/platform/DISCOUNT.md +140 -236
  28. package/documentation/platform/FILESTORAGE.md +187 -323
  29. package/documentation/platform/INVENTORY.md +268 -911
  30. package/documentation/platform/LEAD.md +2195 -2541
  31. package/documentation/platform/ORDER.md +3400 -5361
  32. package/documentation/platform/PARTNER.md +9 -36
  33. package/documentation/platform/PAYMENT.md +903 -1213
  34. package/documentation/platform/REWARDS.md +183 -347
  35. package/documentation/platform/SHARE.md +120 -213
  36. package/documentation/platform/THEME.md +12956 -13239
  37. package/documentation/platform/USER.md +975 -1120
  38. package/documentation/platform/WEBHOOK.md +78 -184
  39. package/documentation/public/CONFIGURATION.md +95 -222
  40. package/documentation/public/INVENTORY.md +100 -282
  41. package/documentation/public/WEBHOOK.md +27 -133
  42. package/package.json +1 -1
  43. package/sdk/application/Cart/CartApplicationClient.d.ts +243 -243
  44. package/sdk/application/Cart/CartApplicationClient.js +567 -567
  45. package/sdk/application/Cart/CartApplicationModel.d.ts +64 -63
  46. package/sdk/application/Cart/CartApplicationModel.js +489 -886
  47. package/sdk/application/Cart/CartApplicationValidator.d.ts +17 -17
  48. package/sdk/application/Cart/CartApplicationValidator.js +98 -98
  49. package/sdk/application/Catalog/CatalogApplicationClient.d.ts +358 -358
  50. package/sdk/application/Catalog/CatalogApplicationClient.js +1036 -1036
  51. package/sdk/application/Catalog/CatalogApplicationModel.d.ts +90 -90
  52. package/sdk/application/Catalog/CatalogApplicationModel.js +677 -1243
  53. package/sdk/application/Catalog/CatalogApplicationValidator.d.ts +19 -19
  54. package/sdk/application/Catalog/CatalogApplicationValidator.js +110 -110
  55. package/sdk/application/Common/CommonApplicationClient.d.ts +13 -13
  56. package/sdk/application/Common/CommonApplicationClient.js +38 -38
  57. package/sdk/application/Common/CommonApplicationModel.d.ts +12 -12
  58. package/sdk/application/Common/CommonApplicationModel.js +83 -160
  59. package/sdk/application/Common/CommonApplicationValidator.d.ts +1 -1
  60. package/sdk/application/Common/CommonApplicationValidator.js +6 -6
  61. package/sdk/application/Communication/CommunicationApplicationClient.d.ts +11 -11
  62. package/sdk/application/Communication/CommunicationApplicationClient.js +26 -26
  63. package/sdk/application/Communication/CommunicationApplicationModel.d.ts +6 -6
  64. package/sdk/application/Communication/CommunicationApplicationModel.js +38 -83
  65. package/sdk/application/Communication/CommunicationApplicationValidator.d.ts +1 -1
  66. package/sdk/application/Communication/CommunicationApplicationValidator.js +4 -4
  67. package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +116 -116
  68. package/sdk/application/Configuration/ConfigurationApplicationClient.js +330 -330
  69. package/sdk/application/Configuration/ConfigurationApplicationModel.d.ts +85 -85
  70. package/sdk/application/Configuration/ConfigurationApplicationModel.js +480 -851
  71. package/sdk/application/Configuration/ConfigurationApplicationValidator.d.ts +8 -8
  72. package/sdk/application/Configuration/ConfigurationApplicationValidator.js +33 -33
  73. package/sdk/application/Content/ContentApplicationClient.d.ts +67 -67
  74. package/sdk/application/Content/ContentApplicationClient.js +191 -191
  75. package/sdk/application/Content/ContentApplicationModel.d.ts +76 -76
  76. package/sdk/application/Content/ContentApplicationModel.js +467 -884
  77. package/sdk/application/Content/ContentApplicationValidator.d.ts +5 -5
  78. package/sdk/application/Content/ContentApplicationValidator.js +24 -24
  79. package/sdk/application/FileStorage/FileStorageApplicationClient.d.ts +25 -25
  80. package/sdk/application/FileStorage/FileStorageApplicationClient.js +59 -59
  81. package/sdk/application/FileStorage/FileStorageApplicationModel.d.ts +13 -13
  82. package/sdk/application/FileStorage/FileStorageApplicationModel.js +86 -169
  83. package/sdk/application/FileStorage/FileStorageApplicationValidator.d.ts +1 -1
  84. package/sdk/application/FileStorage/FileStorageApplicationValidator.js +7 -7
  85. package/sdk/application/Lead/LeadApplicationClient.d.ts +24 -24
  86. package/sdk/application/Lead/LeadApplicationClient.js +100 -100
  87. package/sdk/application/Lead/LeadApplicationModel.d.ts +35 -35
  88. package/sdk/application/Lead/LeadApplicationModel.js +267 -474
  89. package/sdk/application/Lead/LeadApplicationValidator.d.ts +2 -2
  90. package/sdk/application/Lead/LeadApplicationValidator.js +11 -11
  91. package/sdk/application/Logistic/LogisticApplicationClient.d.ts +30 -19
  92. package/sdk/application/Logistic/LogisticApplicationClient.js +110 -43
  93. package/sdk/application/Logistic/LogisticApplicationModel.d.ts +17 -14
  94. package/sdk/application/Logistic/LogisticApplicationModel.js +133 -201
  95. package/sdk/application/Logistic/LogisticApplicationValidator.d.ts +3 -2
  96. package/sdk/application/Logistic/LogisticApplicationValidator.js +14 -8
  97. package/sdk/application/Order/OrderApplicationClient.d.ts +85 -85
  98. package/sdk/application/Order/OrderApplicationClient.js +232 -232
  99. package/sdk/application/Order/OrderApplicationModel.d.ts +50 -50
  100. package/sdk/application/Order/OrderApplicationModel.js +352 -656
  101. package/sdk/application/Order/OrderApplicationValidator.d.ts +7 -7
  102. package/sdk/application/Order/OrderApplicationValidator.js +28 -28
  103. package/sdk/application/Payment/PaymentApplicationClient.d.ts +318 -318
  104. package/sdk/application/Payment/PaymentApplicationClient.js +739 -739
  105. package/sdk/application/Payment/PaymentApplicationModel.d.ts +72 -72
  106. package/sdk/application/Payment/PaymentApplicationModel.js +570 -1038
  107. package/sdk/application/Payment/PaymentApplicationValidator.d.ts +28 -28
  108. package/sdk/application/Payment/PaymentApplicationValidator.js +107 -107
  109. package/sdk/application/PosCart/PosCartApplicationClient.d.ts +254 -254
  110. package/sdk/application/PosCart/PosCartApplicationClient.js +617 -617
  111. package/sdk/application/PosCart/PosCartApplicationModel.d.ts +64 -63
  112. package/sdk/application/PosCart/PosCartApplicationModel.js +475 -871
  113. package/sdk/application/PosCart/PosCartApplicationValidator.d.ts +18 -18
  114. package/sdk/application/PosCart/PosCartApplicationValidator.js +103 -103
  115. package/sdk/application/Rewards/RewardsApplicationClient.d.ts +27 -27
  116. package/sdk/application/Rewards/RewardsApplicationClient.js +112 -112
  117. package/sdk/application/Rewards/RewardsApplicationModel.d.ts +14 -14
  118. package/sdk/application/Rewards/RewardsApplicationModel.js +96 -191
  119. package/sdk/application/Rewards/RewardsApplicationValidator.d.ts +3 -3
  120. package/sdk/application/Rewards/RewardsApplicationValidator.js +12 -12
  121. package/sdk/application/Share/ShareApplicationClient.d.ts +37 -37
  122. package/sdk/application/Share/ShareApplicationClient.js +84 -84
  123. package/sdk/application/Share/ShareApplicationModel.d.ts +8 -8
  124. package/sdk/application/Share/ShareApplicationModel.js +63 -123
  125. package/sdk/application/Share/ShareApplicationValidator.d.ts +4 -4
  126. package/sdk/application/Share/ShareApplicationValidator.js +12 -12
  127. package/sdk/application/Theme/ThemeApplicationClient.d.ts +8 -8
  128. package/sdk/application/Theme/ThemeApplicationClient.js +31 -31
  129. package/sdk/application/Theme/ThemeApplicationModel.d.ts +34 -34
  130. package/sdk/application/Theme/ThemeApplicationModel.js +190 -336
  131. package/sdk/application/Theme/ThemeApplicationValidator.d.ts +1 -1
  132. package/sdk/application/Theme/ThemeApplicationValidator.js +4 -4
  133. package/sdk/application/User/UserApplicationClient.d.ts +280 -280
  134. package/sdk/application/User/UserApplicationClient.js +581 -581
  135. package/sdk/application/User/UserApplicationModel.d.ts +79 -72
  136. package/sdk/application/User/UserApplicationModel.js +440 -689
  137. package/sdk/application/User/UserApplicationValidator.d.ts +24 -24
  138. package/sdk/application/User/UserApplicationValidator.js +89 -89
  139. package/sdk/common/AxiosHelper.js +1 -1
  140. package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.d.ts +51 -51
  141. package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.js +179 -179
  142. package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.d.ts +6 -6
  143. package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.js +20 -20
  144. package/sdk/platform/Analytics/AnalyticsPlatformModel.d.ts +11 -11
  145. package/sdk/platform/Analytics/AnalyticsPlatformModel.js +95 -178
  146. package/sdk/platform/AuditTrail/AuditTrailPlatformClient.d.ts +10 -10
  147. package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +41 -41
  148. package/sdk/platform/AuditTrail/AuditTrailPlatformModel.d.ts +10 -10
  149. package/sdk/platform/AuditTrail/AuditTrailPlatformModel.js +50 -89
  150. package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.d.ts +1 -1
  151. package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.js +6 -6
  152. package/sdk/platform/Billing/BillingPlatformClient.d.ts +60 -60
  153. package/sdk/platform/Billing/BillingPlatformClient.js +181 -181
  154. package/sdk/platform/Billing/BillingPlatformModel.d.ts +40 -40
  155. package/sdk/platform/Billing/BillingPlatformModel.js +342 -668
  156. package/sdk/platform/Billing/BillingPlatformValidator.d.ts +8 -8
  157. package/sdk/platform/Billing/BillingPlatformValidator.js +25 -25
  158. package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +168 -168
  159. package/sdk/platform/Cart/CartPlatformApplicationClient.js +553 -553
  160. package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +11 -11
  161. package/sdk/platform/Cart/CartPlatformApplicationValidator.js +63 -63
  162. package/sdk/platform/Cart/CartPlatformModel.d.ts +84 -83
  163. package/sdk/platform/Cart/CartPlatformModel.js +671 -1205
  164. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +632 -632
  165. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +1525 -1525
  166. package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +40 -40
  167. package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +174 -174
  168. package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +682 -682
  169. package/sdk/platform/Catalog/CatalogPlatformClient.js +1557 -1557
  170. package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +291 -291
  171. package/sdk/platform/Catalog/CatalogPlatformModel.js +2127 -3904
  172. package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +66 -66
  173. package/sdk/platform/Catalog/CatalogPlatformValidator.js +229 -229
  174. package/sdk/platform/Common/CommonPlatformClient.d.ts +12 -12
  175. package/sdk/platform/Common/CommonPlatformClient.js +41 -41
  176. package/sdk/platform/Common/CommonPlatformModel.d.ts +12 -12
  177. package/sdk/platform/Common/CommonPlatformModel.js +83 -160
  178. package/sdk/platform/Common/CommonPlatformValidator.d.ts +1 -1
  179. package/sdk/platform/Common/CommonPlatformValidator.js +6 -6
  180. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +326 -326
  181. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +943 -943
  182. package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.d.ts +30 -30
  183. package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.js +87 -87
  184. package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +67 -67
  185. package/sdk/platform/Communication/CommunicationPlatformModel.js +522 -974
  186. package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +55 -55
  187. package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +212 -212
  188. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +27 -27
  189. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +279 -542
  190. package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.d.ts +7 -7
  191. package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.js +24 -24
  192. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +163 -153
  193. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +615 -552
  194. package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.d.ts +22 -21
  195. package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.js +69 -63
  196. package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +125 -125
  197. package/sdk/platform/Configuration/ConfigurationPlatformClient.js +342 -342
  198. package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +148 -146
  199. package/sdk/platform/Configuration/ConfigurationPlatformModel.js +854 -1508
  200. package/sdk/platform/Configuration/ConfigurationPlatformValidator.d.ts +9 -9
  201. package/sdk/platform/Configuration/ConfigurationPlatformValidator.js +38 -38
  202. package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +534 -534
  203. package/sdk/platform/Content/ContentPlatformApplicationClient.js +1324 -1324
  204. package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +50 -50
  205. package/sdk/platform/Content/ContentPlatformApplicationValidator.js +156 -156
  206. package/sdk/platform/Content/ContentPlatformModel.d.ts +78 -78
  207. package/sdk/platform/Content/ContentPlatformModel.js +484 -907
  208. package/sdk/platform/Discount/DiscountPlatformClient.d.ts +65 -65
  209. package/sdk/platform/Discount/DiscountPlatformClient.js +216 -216
  210. package/sdk/platform/Discount/DiscountPlatformModel.d.ts +7 -7
  211. package/sdk/platform/Discount/DiscountPlatformModel.js +60 -121
  212. package/sdk/platform/Discount/DiscountPlatformValidator.d.ts +6 -6
  213. package/sdk/platform/Discount/DiscountPlatformValidator.js +29 -29
  214. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +24 -24
  215. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +58 -58
  216. package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.d.ts +1 -1
  217. package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.js +8 -8
  218. package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +52 -52
  219. package/sdk/platform/FileStorage/FileStoragePlatformClient.js +123 -123
  220. package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +13 -13
  221. package/sdk/platform/FileStorage/FileStoragePlatformModel.js +86 -169
  222. package/sdk/platform/FileStorage/FileStoragePlatformValidator.d.ts +3 -3
  223. package/sdk/platform/FileStorage/FileStoragePlatformValidator.js +11 -11
  224. package/sdk/platform/Inventory/InventoryPlatformClient.d.ts +63 -63
  225. package/sdk/platform/Inventory/InventoryPlatformClient.js +228 -228
  226. package/sdk/platform/Inventory/InventoryPlatformModel.d.ts +30 -30
  227. package/sdk/platform/Inventory/InventoryPlatformModel.js +497 -964
  228. package/sdk/platform/Inventory/InventoryPlatformValidator.d.ts +7 -7
  229. package/sdk/platform/Inventory/InventoryPlatformValidator.js +28 -28
  230. package/sdk/platform/Lead/LeadPlatformApplicationClient.d.ts +73 -73
  231. package/sdk/platform/Lead/LeadPlatformApplicationClient.js +200 -200
  232. package/sdk/platform/Lead/LeadPlatformApplicationValidator.d.ts +7 -7
  233. package/sdk/platform/Lead/LeadPlatformApplicationValidator.js +28 -28
  234. package/sdk/platform/Lead/LeadPlatformClient.d.ts +80 -80
  235. package/sdk/platform/Lead/LeadPlatformClient.js +212 -212
  236. package/sdk/platform/Lead/LeadPlatformModel.d.ts +35 -35
  237. package/sdk/platform/Lead/LeadPlatformModel.js +267 -474
  238. package/sdk/platform/Lead/LeadPlatformValidator.d.ts +6 -6
  239. package/sdk/platform/Lead/LeadPlatformValidator.js +24 -24
  240. package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +10 -10
  241. package/sdk/platform/Order/OrderPlatformApplicationClient.js +65 -65
  242. package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +1 -1
  243. package/sdk/platform/Order/OrderPlatformApplicationValidator.js +6 -6
  244. package/sdk/platform/Order/OrderPlatformClient.d.ts +357 -357
  245. package/sdk/platform/Order/OrderPlatformClient.js +1035 -1035
  246. package/sdk/platform/Order/OrderPlatformModel.d.ts +198 -196
  247. package/sdk/platform/Order/OrderPlatformModel.js +1574 -2861
  248. package/sdk/platform/Order/OrderPlatformValidator.d.ts +32 -32
  249. package/sdk/platform/Order/OrderPlatformValidator.js +160 -160
  250. package/sdk/platform/Partner/PartnerPlatformModel.d.ts +1 -1
  251. package/sdk/platform/Partner/PartnerPlatformModel.js +10 -26
  252. package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +57 -57
  253. package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +167 -167
  254. package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +6 -6
  255. package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +23 -23
  256. package/sdk/platform/Payment/PaymentPlatformClient.d.ts +42 -42
  257. package/sdk/platform/Payment/PaymentPlatformClient.js +153 -153
  258. package/sdk/platform/Payment/PaymentPlatformModel.d.ts +27 -27
  259. package/sdk/platform/Payment/PaymentPlatformModel.js +222 -410
  260. package/sdk/platform/Payment/PaymentPlatformValidator.d.ts +4 -4
  261. package/sdk/platform/Payment/PaymentPlatformValidator.js +21 -21
  262. package/sdk/platform/PlatformApplicationClient.d.ts +1496 -10325
  263. package/sdk/platform/PlatformApplicationClient.js +1584 -13899
  264. package/sdk/platform/PlatformClient.d.ts +7965 -7885
  265. package/sdk/platform/PlatformClient.js +8672 -10105
  266. package/sdk/platform/Rewards/RewardsPlatformApplicationClient.d.ts +83 -83
  267. package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +275 -275
  268. package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.d.ts +8 -8
  269. package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.js +34 -34
  270. package/sdk/platform/Rewards/RewardsPlatformModel.d.ts +15 -15
  271. package/sdk/platform/Rewards/RewardsPlatformModel.js +92 -194
  272. package/sdk/platform/Share/SharePlatformApplicationClient.d.ts +10 -10
  273. package/sdk/platform/Share/SharePlatformApplicationClient.js +59 -59
  274. package/sdk/platform/Share/SharePlatformApplicationValidator.d.ts +1 -1
  275. package/sdk/platform/Share/SharePlatformApplicationValidator.js +6 -6
  276. package/sdk/platform/Share/SharePlatformModel.d.ts +8 -8
  277. package/sdk/platform/Share/SharePlatformModel.js +60 -118
  278. package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +132 -132
  279. package/sdk/platform/Theme/ThemePlatformApplicationClient.js +310 -310
  280. package/sdk/platform/Theme/ThemePlatformApplicationValidator.d.ts +15 -15
  281. package/sdk/platform/Theme/ThemePlatformApplicationValidator.js +44 -44
  282. package/sdk/platform/Theme/ThemePlatformModel.d.ts +34 -34
  283. package/sdk/platform/Theme/ThemePlatformModel.js +190 -336
  284. package/sdk/platform/User/UserPlatformApplicationClient.d.ts +136 -69
  285. package/sdk/platform/User/UserPlatformApplicationClient.js +505 -166
  286. package/sdk/platform/User/UserPlatformApplicationValidator.d.ts +12 -7
  287. package/sdk/platform/User/UserPlatformApplicationValidator.js +61 -23
  288. package/sdk/platform/User/UserPlatformModel.d.ts +79 -72
  289. package/sdk/platform/User/UserPlatformModel.js +440 -689
  290. package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +31 -31
  291. package/sdk/platform/Webhook/WebhookPlatformClient.js +88 -88
  292. package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +7 -7
  293. package/sdk/platform/Webhook/WebhookPlatformModel.js +68 -136
  294. package/sdk/platform/Webhook/WebhookPlatformValidator.d.ts +3 -3
  295. package/sdk/platform/Webhook/WebhookPlatformValidator.js +14 -14
  296. package/sdk/public/Configuration/ConfigurationPublicClient.d.ts +13 -13
  297. package/sdk/public/Configuration/ConfigurationPublicClient.js +38 -38
  298. package/sdk/public/Configuration/ConfigurationPublicModel.d.ts +12 -12
  299. package/sdk/public/Configuration/ConfigurationPublicModel.js +85 -162
  300. package/sdk/public/Configuration/ConfigurationPublicValidator.d.ts +1 -1
  301. package/sdk/public/Configuration/ConfigurationPublicValidator.js +6 -6
  302. package/sdk/public/Inventory/InventoryPublicClient.d.ts +34 -34
  303. package/sdk/public/Inventory/InventoryPublicClient.js +113 -113
  304. package/sdk/public/Inventory/InventoryPublicModel.d.ts +10 -10
  305. package/sdk/public/Inventory/InventoryPublicModel.js +119 -245
  306. package/sdk/public/Inventory/InventoryPublicValidator.d.ts +3 -3
  307. package/sdk/public/Inventory/InventoryPublicValidator.js +15 -15
  308. package/sdk/public/Webhook/WebhookPublicModel.d.ts +7 -7
  309. package/sdk/public/Webhook/WebhookPublicModel.js +68 -136
  310. package/tests/application/catalog.spec.js +7 -0
@@ -13,17 +13,15 @@ class Rewards {
13
13
 
14
14
  /**
15
15
  * @param {Object} arg - Arg object.
16
- * @param {string} arg.pageId - Pagination page id
17
- * @param {number} arg.pageSize - Pagination page size
18
- * @returns {Promise<GiveawayResponse>} - Success response
19
- * @summary: List of giveaways of the current application.
20
- * @description: List of giveaways of the current application.
16
+ * @param {string} arg.audienceId - Audience id
17
+ * @returns {Promise<GiveawayAudience>} - Success response
18
+ * @summary: Get the Giveaway audience status
19
+ * @description: Get giveaway audience status
21
20
  */
22
- async showGiveaways({ pageId, pageSize } = {}) {
23
- const { error } = RewardsValidator.showGiveaways().validate(
21
+ async getGiveawayAudienceStatus({ audienceId } = {}) {
22
+ const { error } = RewardsValidator.getGiveawayAudienceStatus().validate(
24
23
  {
25
- pageId,
26
- pageSize,
24
+ audienceId,
27
25
  },
28
26
  { abortEarly: false, allowUnknown: true }
29
27
  );
@@ -32,36 +30,35 @@ class Rewards {
32
30
  }
33
31
 
34
32
  // Showing warrnings if extra unknown parameters are found
35
- const { error: warrning } = RewardsValidator.showGiveaways().validate(
33
+ const {
34
+ error: warrning,
35
+ } = RewardsValidator.getGiveawayAudienceStatus().validate(
36
36
  {
37
- pageId,
38
- pageSize,
37
+ audienceId,
39
38
  },
40
39
  { abortEarly: false, allowUnknown: false }
41
40
  );
42
41
  if (warrning) {
43
42
  Logger({
44
43
  level: "WARN",
45
- message: "Parameter Validation warrnings for showGiveaways",
44
+ message: "Parameter Validation warrnings for getGiveawayAudienceStatus",
46
45
  });
47
46
  Logger({ level: "WARN", message: warrning });
48
47
  }
49
48
 
50
49
  const query_params = {};
51
- query_params["page_id"] = pageId;
52
- query_params["page_size"] = pageSize;
53
50
 
54
51
  const response = await PlatformAPIClient.execute(
55
52
  this.config,
56
53
  "get",
57
- `/service/platform/rewards/v1.0/company/${this.config.companyId}/application/${this.applicationId}/giveaways`,
54
+ `/service/platform/rewards/v1.0/company/${this.config.companyId}/application/${this.applicationId}/giveaways/audience/${audienceId}/status`,
58
55
  query_params,
59
56
  undefined
60
57
  );
61
58
 
62
59
  const {
63
60
  error: res_error,
64
- } = RewardsModel.GiveawayResponse().validate(response, {
61
+ } = RewardsModel.GiveawayAudience().validate(response, {
65
62
  abortEarly: false,
66
63
  allowUnknown: false,
67
64
  });
@@ -69,7 +66,7 @@ class Rewards {
69
66
  if (res_error) {
70
67
  Logger({
71
68
  level: "WARN",
72
- message: "Response Validation Warnnings for showGiveaways",
69
+ message: "Response Validation Warnnings for getGiveawayAudienceStatus",
73
70
  });
74
71
  Logger({ level: "WARN", message: res_error });
75
72
  }
@@ -79,15 +76,15 @@ class Rewards {
79
76
 
80
77
  /**
81
78
  * @param {Object} arg - Arg object.
82
- * @param {Giveaway} arg.body
79
+ * @param {string} arg.id - Giveaway ID
83
80
  * @returns {Promise<Giveaway>} - Success response
84
- * @summary: List of giveaways of the current application.
85
- * @description: Adds a new giveaway.
81
+ * @summary: Get giveaway by ID.
82
+ * @description: Get giveaway by ID.
86
83
  */
87
- async saveGiveAway({ body } = {}) {
88
- const { error } = RewardsValidator.saveGiveAway().validate(
84
+ async getGiveawayById({ id } = {}) {
85
+ const { error } = RewardsValidator.getGiveawayById().validate(
89
86
  {
90
- body,
87
+ id,
91
88
  },
92
89
  { abortEarly: false, allowUnknown: true }
93
90
  );
@@ -96,16 +93,16 @@ class Rewards {
96
93
  }
97
94
 
98
95
  // Showing warrnings if extra unknown parameters are found
99
- const { error: warrning } = RewardsValidator.saveGiveAway().validate(
96
+ const { error: warrning } = RewardsValidator.getGiveawayById().validate(
100
97
  {
101
- body,
98
+ id,
102
99
  },
103
100
  { abortEarly: false, allowUnknown: false }
104
101
  );
105
102
  if (warrning) {
106
103
  Logger({
107
104
  level: "WARN",
108
- message: "Parameter Validation warrnings for saveGiveAway",
105
+ message: "Parameter Validation warrnings for getGiveawayById",
109
106
  });
110
107
  Logger({ level: "WARN", message: warrning });
111
108
  }
@@ -114,10 +111,10 @@ class Rewards {
114
111
 
115
112
  const response = await PlatformAPIClient.execute(
116
113
  this.config,
117
- "post",
118
- `/service/platform/rewards/v1.0/company/${this.config.companyId}/application/${this.applicationId}/giveaways`,
114
+ "get",
115
+ `/service/platform/rewards/v1.0/company/${this.config.companyId}/application/${this.applicationId}/giveaways/${id}`,
119
116
  query_params,
120
- body
117
+ undefined
121
118
  );
122
119
 
123
120
  const { error: res_error } = RewardsModel.Giveaway().validate(response, {
@@ -128,7 +125,7 @@ class Rewards {
128
125
  if (res_error) {
129
126
  Logger({
130
127
  level: "WARN",
131
- message: "Response Validation Warnnings for saveGiveAway",
128
+ message: "Response Validation Warnnings for getGiveawayById",
132
129
  });
133
130
  Logger({ level: "WARN", message: res_error });
134
131
  }
@@ -138,15 +135,19 @@ class Rewards {
138
135
 
139
136
  /**
140
137
  * @param {Object} arg - Arg object.
141
- * @param {string} arg.id - Giveaway ID
142
- * @returns {Promise<Giveaway>} - Success response
143
- * @summary: Get giveaway by ID.
144
- * @description: Get giveaway by ID.
138
+ * @param {string} arg.name - The name given to the offer.
139
+ * @param {string} arg.cookie - User's session cookie. This cookie is set in
140
+ * browser cookie when logged-in to fynd's authentication system i.e.
141
+ * `Grimlock` or by using grimlock-backend SDK for backend implementation.
142
+ * @returns {Promise<Offer>} - Success response
143
+ * @summary: Get offer by name
144
+ * @description: Use this API to get the offer details and configuration by entering the name of the offer.
145
145
  */
146
- async getGiveawayById({ id } = {}) {
147
- const { error } = RewardsValidator.getGiveawayById().validate(
146
+ async getOfferByName({ name, cookie } = {}) {
147
+ const { error } = RewardsValidator.getOfferByName().validate(
148
148
  {
149
- id,
149
+ name,
150
+ cookie,
150
151
  },
151
152
  { abortEarly: false, allowUnknown: true }
152
153
  );
@@ -155,16 +156,17 @@ class Rewards {
155
156
  }
156
157
 
157
158
  // Showing warrnings if extra unknown parameters are found
158
- const { error: warrning } = RewardsValidator.getGiveawayById().validate(
159
+ const { error: warrning } = RewardsValidator.getOfferByName().validate(
159
160
  {
160
- id,
161
+ name,
162
+ cookie,
161
163
  },
162
164
  { abortEarly: false, allowUnknown: false }
163
165
  );
164
166
  if (warrning) {
165
167
  Logger({
166
168
  level: "WARN",
167
- message: "Parameter Validation warrnings for getGiveawayById",
169
+ message: "Parameter Validation warrnings for getOfferByName",
168
170
  });
169
171
  Logger({ level: "WARN", message: warrning });
170
172
  }
@@ -174,12 +176,12 @@ class Rewards {
174
176
  const response = await PlatformAPIClient.execute(
175
177
  this.config,
176
178
  "get",
177
- `/service/platform/rewards/v1.0/company/${this.config.companyId}/application/${this.applicationId}/giveaways/${id}`,
179
+ `/service/platform/rewards/v1.0/company/${this.config.companyId}/application/${this.applicationId}/offers/${name}/`,
178
180
  query_params,
179
181
  undefined
180
182
  );
181
183
 
182
- const { error: res_error } = RewardsModel.Giveaway().validate(response, {
184
+ const { error: res_error } = RewardsModel.Offer().validate(response, {
183
185
  abortEarly: false,
184
186
  allowUnknown: false,
185
187
  });
@@ -187,7 +189,7 @@ class Rewards {
187
189
  if (res_error) {
188
190
  Logger({
189
191
  level: "WARN",
190
- message: "Response Validation Warnnings for getGiveawayById",
192
+ message: "Response Validation Warnnings for getOfferByName",
191
193
  });
192
194
  Logger({ level: "WARN", message: res_error });
193
195
  }
@@ -197,18 +199,13 @@ class Rewards {
197
199
 
198
200
  /**
199
201
  * @param {Object} arg - Arg object.
200
- * @param {string} arg.id - Giveaway ID
201
- * @param {Giveaway} arg.body
202
- * @returns {Promise<Giveaway>} - Success response
203
- * @summary: Updates the giveaway by it's ID.
204
- * @description: Updates the giveaway by it's ID.
202
+ * @returns {Promise<ConfigurationRes>} - Success response
203
+ * @summary: Get all valid android paths
204
+ * @description: Use this API to get a list of valid android paths required by the Rewards INIT API to validate a fradualent device.
205
205
  */
206
- async updateGiveAway({ id, body } = {}) {
207
- const { error } = RewardsValidator.updateGiveAway().validate(
208
- {
209
- id,
210
- body,
211
- },
206
+ async getRewardsConfiguration({} = {}) {
207
+ const { error } = RewardsValidator.getRewardsConfiguration().validate(
208
+ {},
212
209
  { abortEarly: false, allowUnknown: true }
213
210
  );
214
211
  if (error) {
@@ -216,17 +213,16 @@ class Rewards {
216
213
  }
217
214
 
218
215
  // Showing warrnings if extra unknown parameters are found
219
- const { error: warrning } = RewardsValidator.updateGiveAway().validate(
220
- {
221
- id,
222
- body,
223
- },
216
+ const {
217
+ error: warrning,
218
+ } = RewardsValidator.getRewardsConfiguration().validate(
219
+ {},
224
220
  { abortEarly: false, allowUnknown: false }
225
221
  );
226
222
  if (warrning) {
227
223
  Logger({
228
224
  level: "WARN",
229
- message: "Parameter Validation warrnings for updateGiveAway",
225
+ message: "Parameter Validation warrnings for getRewardsConfiguration",
230
226
  });
231
227
  Logger({ level: "WARN", message: warrning });
232
228
  }
@@ -235,13 +231,15 @@ class Rewards {
235
231
 
236
232
  const response = await PlatformAPIClient.execute(
237
233
  this.config,
238
- "put",
239
- `/service/platform/rewards/v1.0/company/${this.config.companyId}/application/${this.applicationId}/giveaways/${id}`,
234
+ "get",
235
+ `/service/platform/rewards/v1.0/company/${this.config.companyId}/application/${this.applicationId}/configuration/`,
240
236
  query_params,
241
- body
237
+ undefined
242
238
  );
243
239
 
244
- const { error: res_error } = RewardsModel.Giveaway().validate(response, {
240
+ const {
241
+ error: res_error,
242
+ } = RewardsModel.ConfigurationRes().validate(response, {
245
243
  abortEarly: false,
246
244
  allowUnknown: false,
247
245
  });
@@ -249,7 +247,7 @@ class Rewards {
249
247
  if (res_error) {
250
248
  Logger({
251
249
  level: "WARN",
252
- message: "Response Validation Warnnings for updateGiveAway",
250
+ message: "Response Validation Warnnings for getRewardsConfiguration",
253
251
  });
254
252
  Logger({ level: "WARN", message: res_error });
255
253
  }
@@ -259,15 +257,20 @@ class Rewards {
259
257
 
260
258
  /**
261
259
  * @param {Object} arg - Arg object.
262
- * @param {string} arg.audienceId - Audience id
263
- * @returns {Promise<GiveawayAudience>} - Success response
264
- * @summary: Get the Giveaway audience status
265
- * @description: Get giveaway audience status
260
+ * @param {string} arg.userId - User id
261
+ * @param {string} [arg.pageId] - PageID is the ID of the requested page.
262
+ * For first request it should be kept empty.
263
+ * @param {number} [arg.pageSize] - The number of items to retrieve in each page.
264
+ * @returns {Promise<HistoryRes>} - Success response
265
+ * @summary: Get all transactions of reward points
266
+ * @description: Use this API to get a list of points transactions.
266
267
  */
267
- async getGiveawayAudienceStatus({ audienceId } = {}) {
268
- const { error } = RewardsValidator.getGiveawayAudienceStatus().validate(
268
+ async getUserPointsHistory({ userId, pageId, pageSize } = {}) {
269
+ const { error } = RewardsValidator.getUserPointsHistory().validate(
269
270
  {
270
- audienceId,
271
+ userId,
272
+ pageId,
273
+ pageSize,
271
274
  },
272
275
  { abortEarly: false, allowUnknown: true }
273
276
  );
@@ -278,33 +281,35 @@ class Rewards {
278
281
  // Showing warrnings if extra unknown parameters are found
279
282
  const {
280
283
  error: warrning,
281
- } = RewardsValidator.getGiveawayAudienceStatus().validate(
284
+ } = RewardsValidator.getUserPointsHistory().validate(
282
285
  {
283
- audienceId,
286
+ userId,
287
+ pageId,
288
+ pageSize,
284
289
  },
285
290
  { abortEarly: false, allowUnknown: false }
286
291
  );
287
292
  if (warrning) {
288
293
  Logger({
289
294
  level: "WARN",
290
- message: "Parameter Validation warrnings for getGiveawayAudienceStatus",
295
+ message: "Parameter Validation warrnings for getUserPointsHistory",
291
296
  });
292
297
  Logger({ level: "WARN", message: warrning });
293
298
  }
294
299
 
295
300
  const query_params = {};
301
+ query_params["page_id"] = pageId;
302
+ query_params["page_size"] = pageSize;
296
303
 
297
304
  const response = await PlatformAPIClient.execute(
298
305
  this.config,
299
306
  "get",
300
- `/service/platform/rewards/v1.0/company/${this.config.companyId}/application/${this.applicationId}/giveaways/audience/${audienceId}/status`,
307
+ `/service/platform/rewards/v1.0/company/${this.config.companyId}/application/${this.applicationId}/users/${userId}/points/history/`,
301
308
  query_params,
302
309
  undefined
303
310
  );
304
311
 
305
- const {
306
- error: res_error,
307
- } = RewardsModel.GiveawayAudience().validate(response, {
312
+ const { error: res_error } = RewardsModel.HistoryRes().validate(response, {
308
313
  abortEarly: false,
309
314
  allowUnknown: false,
310
315
  });
@@ -312,7 +317,7 @@ class Rewards {
312
317
  if (res_error) {
313
318
  Logger({
314
319
  level: "WARN",
315
- message: "Response Validation Warnnings for getGiveawayAudienceStatus",
320
+ message: "Response Validation Warnnings for getUserPointsHistory",
316
321
  });
317
322
  Logger({ level: "WARN", message: res_error });
318
323
  }
@@ -322,13 +327,53 @@ class Rewards {
322
327
 
323
328
  /**
324
329
  * @param {Object} arg - Arg object.
325
- * @returns {Promise<Offer[]>} - Success response
326
- * @summary: List of offers of the current application.
327
- * @description: List of offers of the current application.
330
+ * @param {string} arg.userId - User id
331
+ * @param {string} arg.companyId - Company id
332
+ * @param {string} arg.applicationId - Application id
333
+ * @param {number} [arg.pageSize] - The number of items to retrieve in each page.
334
+ * @summary: Get all transactions of reward points
335
+ * @description: Use this API to get a list of points transactions.
328
336
  */
329
- async showOffers({} = {}) {
330
- const { error } = RewardsValidator.showOffers().validate(
331
- {},
337
+ getUserPointsHistoryPaginator({
338
+ userId,
339
+ companyId,
340
+ applicationId,
341
+ pageSize,
342
+ } = {}) {
343
+ const paginator = new Paginator();
344
+ const callback = async () => {
345
+ const pageId = paginator.nextId;
346
+ const pageNo = paginator.pageNo;
347
+ const pageType = "cursor";
348
+ const data = await this.getUserPointsHistory({
349
+ userId: userId,
350
+ companyId: companyId,
351
+ applicationId: applicationId,
352
+ pageId: pageId,
353
+ pageSize: pageSize,
354
+ });
355
+ paginator.setPaginator({
356
+ hasNext: data.page.has_next ? true : false,
357
+ nextId: data.page.next_id,
358
+ });
359
+ return data;
360
+ };
361
+ paginator.setCallback(callback.bind(this));
362
+ return paginator;
363
+ }
364
+
365
+ /**
366
+ * @param {Object} arg - Arg object.
367
+ * @param {Giveaway} arg.body
368
+ * @returns {Promise<Giveaway>} - Success response
369
+ * @summary: List of giveaways of the current application.
370
+ * @description: Adds a new giveaway.
371
+ */
372
+ async saveGiveAway({ body } = {}) {
373
+ const { error } = RewardsValidator.saveGiveAway().validate(
374
+ {
375
+ body,
376
+ },
332
377
  { abortEarly: false, allowUnknown: true }
333
378
  );
334
379
  if (error) {
@@ -336,14 +381,16 @@ class Rewards {
336
381
  }
337
382
 
338
383
  // Showing warrnings if extra unknown parameters are found
339
- const { error: warrning } = RewardsValidator.showOffers().validate(
340
- {},
384
+ const { error: warrning } = RewardsValidator.saveGiveAway().validate(
385
+ {
386
+ body,
387
+ },
341
388
  { abortEarly: false, allowUnknown: false }
342
389
  );
343
390
  if (warrning) {
344
391
  Logger({
345
392
  level: "WARN",
346
- message: "Parameter Validation warrnings for showOffers",
393
+ message: "Parameter Validation warrnings for saveGiveAway",
347
394
  });
348
395
  Logger({ level: "WARN", message: warrning });
349
396
  }
@@ -352,20 +399,21 @@ class Rewards {
352
399
 
353
400
  const response = await PlatformAPIClient.execute(
354
401
  this.config,
355
- "get",
356
- `/service/platform/rewards/v1.0/company/${this.config.companyId}/application/${this.applicationId}/offers/`,
402
+ "post",
403
+ `/service/platform/rewards/v1.0/company/${this.config.companyId}/application/${this.applicationId}/giveaways`,
357
404
  query_params,
358
- undefined
405
+ body
359
406
  );
360
407
 
361
- const { error: res_error } = Joi.array()
362
- .items(RewardsModel.Offer())
363
- .validate(response, { abortEarly: false, allowUnknown: false });
408
+ const { error: res_error } = RewardsModel.Giveaway().validate(response, {
409
+ abortEarly: false,
410
+ allowUnknown: false,
411
+ });
364
412
 
365
413
  if (res_error) {
366
414
  Logger({
367
415
  level: "WARN",
368
- message: "Response Validation Warnnings for showOffers",
416
+ message: "Response Validation Warnnings for saveGiveAway",
369
417
  });
370
418
  Logger({ level: "WARN", message: res_error });
371
419
  }
@@ -375,19 +423,15 @@ class Rewards {
375
423
 
376
424
  /**
377
425
  * @param {Object} arg - Arg object.
378
- * @param {string} arg.name - The name given to the offer.
379
- * @param {string} arg.cookie - User's session cookie. This cookie is set in
380
- * browser cookie when logged-in to fynd's authentication system i.e.
381
- * `Grimlock` or by using grimlock-backend SDK for backend implementation.
382
- * @returns {Promise<Offer>} - Success response
383
- * @summary: Get offer by name
384
- * @description: Use this API to get the offer details and configuration by entering the name of the offer.
426
+ * @param {ConfigurationRequest} arg.body
427
+ * @returns {Promise<SetConfigurationRes>} - Success response
428
+ * @summary: Updates the collection with given android paths.
429
+ * @description: Updates the configuration or inserts new records.
385
430
  */
386
- async getOfferByName({ name, cookie } = {}) {
387
- const { error } = RewardsValidator.getOfferByName().validate(
388
- {
389
- name,
390
- cookie,
431
+ async setRewardsConfiguration({ body } = {}) {
432
+ const { error } = RewardsValidator.setRewardsConfiguration().validate(
433
+ {
434
+ body,
391
435
  },
392
436
  { abortEarly: false, allowUnknown: true }
393
437
  );
@@ -396,17 +440,18 @@ class Rewards {
396
440
  }
397
441
 
398
442
  // Showing warrnings if extra unknown parameters are found
399
- const { error: warrning } = RewardsValidator.getOfferByName().validate(
443
+ const {
444
+ error: warrning,
445
+ } = RewardsValidator.setRewardsConfiguration().validate(
400
446
  {
401
- name,
402
- cookie,
447
+ body,
403
448
  },
404
449
  { abortEarly: false, allowUnknown: false }
405
450
  );
406
451
  if (warrning) {
407
452
  Logger({
408
453
  level: "WARN",
409
- message: "Parameter Validation warrnings for getOfferByName",
454
+ message: "Parameter Validation warrnings for setRewardsConfiguration",
410
455
  });
411
456
  Logger({ level: "WARN", message: warrning });
412
457
  }
@@ -415,13 +460,15 @@ class Rewards {
415
460
 
416
461
  const response = await PlatformAPIClient.execute(
417
462
  this.config,
418
- "get",
419
- `/service/platform/rewards/v1.0/company/${this.config.companyId}/application/${this.applicationId}/offers/${name}/`,
463
+ "post",
464
+ `/service/platform/rewards/v1.0/company/${this.config.companyId}/application/${this.applicationId}/configuration/`,
420
465
  query_params,
421
- undefined
466
+ body
422
467
  );
423
468
 
424
- const { error: res_error } = RewardsModel.Offer().validate(response, {
469
+ const {
470
+ error: res_error,
471
+ } = RewardsModel.SetConfigurationRes().validate(response, {
425
472
  abortEarly: false,
426
473
  allowUnknown: false,
427
474
  });
@@ -429,7 +476,7 @@ class Rewards {
429
476
  if (res_error) {
430
477
  Logger({
431
478
  level: "WARN",
432
- message: "Response Validation Warnnings for getOfferByName",
479
+ message: "Response Validation Warnnings for setRewardsConfiguration",
433
480
  });
434
481
  Logger({ level: "WARN", message: res_error });
435
482
  }
@@ -439,17 +486,17 @@ class Rewards {
439
486
 
440
487
  /**
441
488
  * @param {Object} arg - Arg object.
442
- * @param {string} arg.name - The name given to the offer.
443
- * @param {Offer} arg.body
444
- * @returns {Promise<Offer>} - Success response
445
- * @summary: Update offer by name
446
- * @description: Use this API to update the offer details
489
+ * @param {string} arg.pageId - Pagination page id
490
+ * @param {number} arg.pageSize - Pagination page size
491
+ * @returns {Promise<GiveawayResponse>} - Success response
492
+ * @summary: List of giveaways of the current application.
493
+ * @description: List of giveaways of the current application.
447
494
  */
448
- async updateOfferByName({ name, body } = {}) {
449
- const { error } = RewardsValidator.updateOfferByName().validate(
495
+ async showGiveaways({ pageId, pageSize } = {}) {
496
+ const { error } = RewardsValidator.showGiveaways().validate(
450
497
  {
451
- name,
452
- body,
498
+ pageId,
499
+ pageSize,
453
500
  },
454
501
  { abortEarly: false, allowUnknown: true }
455
502
  );
@@ -458,32 +505,36 @@ class Rewards {
458
505
  }
459
506
 
460
507
  // Showing warrnings if extra unknown parameters are found
461
- const { error: warrning } = RewardsValidator.updateOfferByName().validate(
508
+ const { error: warrning } = RewardsValidator.showGiveaways().validate(
462
509
  {
463
- name,
464
- body,
510
+ pageId,
511
+ pageSize,
465
512
  },
466
513
  { abortEarly: false, allowUnknown: false }
467
514
  );
468
515
  if (warrning) {
469
516
  Logger({
470
517
  level: "WARN",
471
- message: "Parameter Validation warrnings for updateOfferByName",
518
+ message: "Parameter Validation warrnings for showGiveaways",
472
519
  });
473
520
  Logger({ level: "WARN", message: warrning });
474
521
  }
475
522
 
476
523
  const query_params = {};
524
+ query_params["page_id"] = pageId;
525
+ query_params["page_size"] = pageSize;
477
526
 
478
527
  const response = await PlatformAPIClient.execute(
479
528
  this.config,
480
- "put",
481
- `/service/platform/rewards/v1.0/company/${this.config.companyId}/application/${this.applicationId}/offers/${name}/`,
529
+ "get",
530
+ `/service/platform/rewards/v1.0/company/${this.config.companyId}/application/${this.applicationId}/giveaways`,
482
531
  query_params,
483
- body
532
+ undefined
484
533
  );
485
534
 
486
- const { error: res_error } = RewardsModel.Offer().validate(response, {
535
+ const {
536
+ error: res_error,
537
+ } = RewardsModel.GiveawayResponse().validate(response, {
487
538
  abortEarly: false,
488
539
  allowUnknown: false,
489
540
  });
@@ -491,7 +542,7 @@ class Rewards {
491
542
  if (res_error) {
492
543
  Logger({
493
544
  level: "WARN",
494
- message: "Response Validation Warnnings for updateOfferByName",
545
+ message: "Response Validation Warnnings for showGiveaways",
495
546
  });
496
547
  Logger({ level: "WARN", message: res_error });
497
548
  }
@@ -501,18 +552,13 @@ class Rewards {
501
552
 
502
553
  /**
503
554
  * @param {Object} arg - Arg object.
504
- * @param {string} arg.userId - User id
505
- * @param {AppUser} arg.body
506
- * @returns {Promise<AppUser>} - Success response
507
- * @summary: Update user status
508
- * @description: Use this API to update the user status active/archive
555
+ * @returns {Promise<Offer[]>} - Success response
556
+ * @summary: List of offers of the current application.
557
+ * @description: List of offers of the current application.
509
558
  */
510
- async updateUserStatus({ userId, body } = {}) {
511
- const { error } = RewardsValidator.updateUserStatus().validate(
512
- {
513
- userId,
514
- body,
515
- },
559
+ async showOffers({} = {}) {
560
+ const { error } = RewardsValidator.showOffers().validate(
561
+ {},
516
562
  { abortEarly: false, allowUnknown: true }
517
563
  );
518
564
  if (error) {
@@ -520,17 +566,14 @@ class Rewards {
520
566
  }
521
567
 
522
568
  // Showing warrnings if extra unknown parameters are found
523
- const { error: warrning } = RewardsValidator.updateUserStatus().validate(
524
- {
525
- userId,
526
- body,
527
- },
569
+ const { error: warrning } = RewardsValidator.showOffers().validate(
570
+ {},
528
571
  { abortEarly: false, allowUnknown: false }
529
572
  );
530
573
  if (warrning) {
531
574
  Logger({
532
575
  level: "WARN",
533
- message: "Parameter Validation warrnings for updateUserStatus",
576
+ message: "Parameter Validation warrnings for showOffers",
534
577
  });
535
578
  Logger({ level: "WARN", message: warrning });
536
579
  }
@@ -539,21 +582,20 @@ class Rewards {
539
582
 
540
583
  const response = await PlatformAPIClient.execute(
541
584
  this.config,
542
- "patch",
543
- `/service/platform/rewards/v1.0/company/${this.config.companyId}/application/${this.applicationId}/users/${userId}/`,
585
+ "get",
586
+ `/service/platform/rewards/v1.0/company/${this.config.companyId}/application/${this.applicationId}/offers/`,
544
587
  query_params,
545
- body
588
+ undefined
546
589
  );
547
590
 
548
- const { error: res_error } = RewardsModel.AppUser().validate(response, {
549
- abortEarly: false,
550
- allowUnknown: false,
551
- });
591
+ const { error: res_error } = Joi.array()
592
+ .items(RewardsModel.Offer())
593
+ .validate(response, { abortEarly: false, allowUnknown: false });
552
594
 
553
595
  if (res_error) {
554
596
  Logger({
555
597
  level: "WARN",
556
- message: "Response Validation Warnnings for updateUserStatus",
598
+ message: "Response Validation Warnnings for showOffers",
557
599
  });
558
600
  Logger({ level: "WARN", message: res_error });
559
601
  }
@@ -563,15 +605,17 @@ class Rewards {
563
605
 
564
606
  /**
565
607
  * @param {Object} arg - Arg object.
566
- * @param {string} arg.userId - User id
567
- * @returns {Promise<UserRes>} - Success response
568
- * @summary: Get user reward details
569
- * @description: Use this API to get the user reward details
608
+ * @param {string} arg.id - Giveaway ID
609
+ * @param {Giveaway} arg.body
610
+ * @returns {Promise<Giveaway>} - Success response
611
+ * @summary: Updates the giveaway by it's ID.
612
+ * @description: Updates the giveaway by it's ID.
570
613
  */
571
- async user({ userId } = {}) {
572
- const { error } = RewardsValidator.user().validate(
614
+ async updateGiveAway({ id, body } = {}) {
615
+ const { error } = RewardsValidator.updateGiveAway().validate(
573
616
  {
574
- userId,
617
+ id,
618
+ body,
575
619
  },
576
620
  { abortEarly: false, allowUnknown: true }
577
621
  );
@@ -580,16 +624,17 @@ class Rewards {
580
624
  }
581
625
 
582
626
  // Showing warrnings if extra unknown parameters are found
583
- const { error: warrning } = RewardsValidator.user().validate(
627
+ const { error: warrning } = RewardsValidator.updateGiveAway().validate(
584
628
  {
585
- userId,
629
+ id,
630
+ body,
586
631
  },
587
632
  { abortEarly: false, allowUnknown: false }
588
633
  );
589
634
  if (warrning) {
590
635
  Logger({
591
636
  level: "WARN",
592
- message: "Parameter Validation warrnings for user",
637
+ message: "Parameter Validation warrnings for updateGiveAway",
593
638
  });
594
639
  Logger({ level: "WARN", message: warrning });
595
640
  }
@@ -598,13 +643,13 @@ class Rewards {
598
643
 
599
644
  const response = await PlatformAPIClient.execute(
600
645
  this.config,
601
- "get",
602
- `/service/platform/rewards/v1.0/company/${this.config.companyId}/application/${this.applicationId}/users/${userId}/`,
646
+ "put",
647
+ `/service/platform/rewards/v1.0/company/${this.config.companyId}/application/${this.applicationId}/giveaways/${id}`,
603
648
  query_params,
604
- undefined
649
+ body
605
650
  );
606
651
 
607
- const { error: res_error } = RewardsModel.UserRes().validate(response, {
652
+ const { error: res_error } = RewardsModel.Giveaway().validate(response, {
608
653
  abortEarly: false,
609
654
  allowUnknown: false,
610
655
  });
@@ -612,7 +657,7 @@ class Rewards {
612
657
  if (res_error) {
613
658
  Logger({
614
659
  level: "WARN",
615
- message: "Response Validation Warnnings for user",
660
+ message: "Response Validation Warnnings for updateGiveAway",
616
661
  });
617
662
  Logger({ level: "WARN", message: res_error });
618
663
  }
@@ -622,20 +667,17 @@ class Rewards {
622
667
 
623
668
  /**
624
669
  * @param {Object} arg - Arg object.
625
- * @param {string} arg.userId - User id
626
- * @param {string} [arg.pageId] - PageID is the ID of the requested page.
627
- * For first request it should be kept empty.
628
- * @param {number} [arg.pageSize] - The number of items to retrieve in each page.
629
- * @returns {Promise<HistoryRes>} - Success response
630
- * @summary: Get all transactions of reward points
631
- * @description: Use this API to get a list of points transactions.
670
+ * @param {string} arg.name - The name given to the offer.
671
+ * @param {Offer} arg.body
672
+ * @returns {Promise<Offer>} - Success response
673
+ * @summary: Update offer by name
674
+ * @description: Use this API to update the offer details
632
675
  */
633
- async getUserPointsHistory({ userId, pageId, pageSize } = {}) {
634
- const { error } = RewardsValidator.getUserPointsHistory().validate(
676
+ async updateOfferByName({ name, body } = {}) {
677
+ const { error } = RewardsValidator.updateOfferByName().validate(
635
678
  {
636
- userId,
637
- pageId,
638
- pageSize,
679
+ name,
680
+ body,
639
681
  },
640
682
  { abortEarly: false, allowUnknown: true }
641
683
  );
@@ -644,37 +686,32 @@ class Rewards {
644
686
  }
645
687
 
646
688
  // Showing warrnings if extra unknown parameters are found
647
- const {
648
- error: warrning,
649
- } = RewardsValidator.getUserPointsHistory().validate(
689
+ const { error: warrning } = RewardsValidator.updateOfferByName().validate(
650
690
  {
651
- userId,
652
- pageId,
653
- pageSize,
691
+ name,
692
+ body,
654
693
  },
655
694
  { abortEarly: false, allowUnknown: false }
656
695
  );
657
696
  if (warrning) {
658
697
  Logger({
659
698
  level: "WARN",
660
- message: "Parameter Validation warrnings for getUserPointsHistory",
699
+ message: "Parameter Validation warrnings for updateOfferByName",
661
700
  });
662
701
  Logger({ level: "WARN", message: warrning });
663
702
  }
664
703
 
665
704
  const query_params = {};
666
- query_params["page_id"] = pageId;
667
- query_params["page_size"] = pageSize;
668
705
 
669
706
  const response = await PlatformAPIClient.execute(
670
707
  this.config,
671
- "get",
672
- `/service/platform/rewards/v1.0/company/${this.config.companyId}/application/${this.applicationId}/users/${userId}/points/history/`,
708
+ "put",
709
+ `/service/platform/rewards/v1.0/company/${this.config.companyId}/application/${this.applicationId}/offers/${name}/`,
673
710
  query_params,
674
- undefined
711
+ body
675
712
  );
676
713
 
677
- const { error: res_error } = RewardsModel.HistoryRes().validate(response, {
714
+ const { error: res_error } = RewardsModel.Offer().validate(response, {
678
715
  abortEarly: false,
679
716
  allowUnknown: false,
680
717
  });
@@ -682,7 +719,7 @@ class Rewards {
682
719
  if (res_error) {
683
720
  Logger({
684
721
  level: "WARN",
685
- message: "Response Validation Warnnings for getUserPointsHistory",
722
+ message: "Response Validation Warnnings for updateOfferByName",
686
723
  });
687
724
  Logger({ level: "WARN", message: res_error });
688
725
  }
@@ -693,49 +730,17 @@ class Rewards {
693
730
  /**
694
731
  * @param {Object} arg - Arg object.
695
732
  * @param {string} arg.userId - User id
696
- * @param {string} arg.companyId - Company id
697
- * @param {string} arg.applicationId - Application id
698
- * @param {number} [arg.pageSize] - The number of items to retrieve in each page.
699
- * @summary: Get all transactions of reward points
700
- * @description: Use this API to get a list of points transactions.
701
- */
702
- getUserPointsHistoryPaginator({
703
- userId,
704
- companyId,
705
- applicationId,
706
- pageSize,
707
- } = {}) {
708
- const paginator = new Paginator();
709
- const callback = async () => {
710
- const pageId = paginator.nextId;
711
- const pageNo = paginator.pageNo;
712
- const pageType = "cursor";
713
- const data = await this.getUserPointsHistory({
714
- userId: userId,
715
- companyId: companyId,
716
- applicationId: applicationId,
717
- pageId: pageId,
718
- pageSize: pageSize,
719
- });
720
- paginator.setPaginator({
721
- hasNext: data.page.has_next ? true : false,
722
- nextId: data.page.next_id,
723
- });
724
- return data;
725
- };
726
- paginator.setCallback(callback.bind(this));
727
- return paginator;
728
- }
729
-
730
- /**
731
- * @param {Object} arg - Arg object.
732
- * @returns {Promise<ConfigurationRes>} - Success response
733
- * @summary: Get all valid android paths
734
- * @description: Use this API to get a list of valid android paths required by the Rewards INIT API to validate a fradualent device.
733
+ * @param {AppUser} arg.body
734
+ * @returns {Promise<AppUser>} - Success response
735
+ * @summary: Update user status
736
+ * @description: Use this API to update the user status active/archive
735
737
  */
736
- async getRewardsConfiguration({} = {}) {
737
- const { error } = RewardsValidator.getRewardsConfiguration().validate(
738
- {},
738
+ async updateUserStatus({ userId, body } = {}) {
739
+ const { error } = RewardsValidator.updateUserStatus().validate(
740
+ {
741
+ userId,
742
+ body,
743
+ },
739
744
  { abortEarly: false, allowUnknown: true }
740
745
  );
741
746
  if (error) {
@@ -743,16 +748,17 @@ class Rewards {
743
748
  }
744
749
 
745
750
  // Showing warrnings if extra unknown parameters are found
746
- const {
747
- error: warrning,
748
- } = RewardsValidator.getRewardsConfiguration().validate(
749
- {},
751
+ const { error: warrning } = RewardsValidator.updateUserStatus().validate(
752
+ {
753
+ userId,
754
+ body,
755
+ },
750
756
  { abortEarly: false, allowUnknown: false }
751
757
  );
752
758
  if (warrning) {
753
759
  Logger({
754
760
  level: "WARN",
755
- message: "Parameter Validation warrnings for getRewardsConfiguration",
761
+ message: "Parameter Validation warrnings for updateUserStatus",
756
762
  });
757
763
  Logger({ level: "WARN", message: warrning });
758
764
  }
@@ -761,15 +767,13 @@ class Rewards {
761
767
 
762
768
  const response = await PlatformAPIClient.execute(
763
769
  this.config,
764
- "get",
765
- `/service/platform/rewards/v1.0/company/${this.config.companyId}/application/${this.applicationId}/configuration/`,
770
+ "patch",
771
+ `/service/platform/rewards/v1.0/company/${this.config.companyId}/application/${this.applicationId}/users/${userId}/`,
766
772
  query_params,
767
- undefined
773
+ body
768
774
  );
769
775
 
770
- const {
771
- error: res_error,
772
- } = RewardsModel.ConfigurationRes().validate(response, {
776
+ const { error: res_error } = RewardsModel.AppUser().validate(response, {
773
777
  abortEarly: false,
774
778
  allowUnknown: false,
775
779
  });
@@ -777,7 +781,7 @@ class Rewards {
777
781
  if (res_error) {
778
782
  Logger({
779
783
  level: "WARN",
780
- message: "Response Validation Warnnings for getRewardsConfiguration",
784
+ message: "Response Validation Warnnings for updateUserStatus",
781
785
  });
782
786
  Logger({ level: "WARN", message: res_error });
783
787
  }
@@ -787,15 +791,15 @@ class Rewards {
787
791
 
788
792
  /**
789
793
  * @param {Object} arg - Arg object.
790
- * @param {ConfigurationRequest} arg.body
791
- * @returns {Promise<SetConfigurationRes>} - Success response
792
- * @summary: Updates the collection with given android paths.
793
- * @description: Updates the configuration or inserts new records.
794
+ * @param {string} arg.userId - User id
795
+ * @returns {Promise<UserRes>} - Success response
796
+ * @summary: Get user reward details
797
+ * @description: Use this API to get the user reward details
794
798
  */
795
- async setRewardsConfiguration({ body } = {}) {
796
- const { error } = RewardsValidator.setRewardsConfiguration().validate(
799
+ async user({ userId } = {}) {
800
+ const { error } = RewardsValidator.user().validate(
797
801
  {
798
- body,
802
+ userId,
799
803
  },
800
804
  { abortEarly: false, allowUnknown: true }
801
805
  );
@@ -804,18 +808,16 @@ class Rewards {
804
808
  }
805
809
 
806
810
  // Showing warrnings if extra unknown parameters are found
807
- const {
808
- error: warrning,
809
- } = RewardsValidator.setRewardsConfiguration().validate(
811
+ const { error: warrning } = RewardsValidator.user().validate(
810
812
  {
811
- body,
813
+ userId,
812
814
  },
813
815
  { abortEarly: false, allowUnknown: false }
814
816
  );
815
817
  if (warrning) {
816
818
  Logger({
817
819
  level: "WARN",
818
- message: "Parameter Validation warrnings for setRewardsConfiguration",
820
+ message: "Parameter Validation warrnings for user",
819
821
  });
820
822
  Logger({ level: "WARN", message: warrning });
821
823
  }
@@ -824,15 +826,13 @@ class Rewards {
824
826
 
825
827
  const response = await PlatformAPIClient.execute(
826
828
  this.config,
827
- "post",
828
- `/service/platform/rewards/v1.0/company/${this.config.companyId}/application/${this.applicationId}/configuration/`,
829
+ "get",
830
+ `/service/platform/rewards/v1.0/company/${this.config.companyId}/application/${this.applicationId}/users/${userId}/`,
829
831
  query_params,
830
- body
832
+ undefined
831
833
  );
832
834
 
833
- const {
834
- error: res_error,
835
- } = RewardsModel.SetConfigurationRes().validate(response, {
835
+ const { error: res_error } = RewardsModel.UserRes().validate(response, {
836
836
  abortEarly: false,
837
837
  allowUnknown: false,
838
838
  });
@@ -840,7 +840,7 @@ class Rewards {
840
840
  if (res_error) {
841
841
  Logger({
842
842
  level: "WARN",
843
- message: "Response Validation Warnnings for setRewardsConfiguration",
843
+ message: "Response Validation Warnnings for user",
844
844
  });
845
845
  Logger({ level: "WARN", message: res_error });
846
846
  }