@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 LeadValidator = require("./LeadPlatformValidator");
5
5
  const LeadModel = require("./LeadPlatformModel");
6
6
  const { Logger } = require("./../../common/Logger");
7
+ const Joi = require("joi");
7
8
 
8
9
  class Lead {
9
10
  constructor(config) {
@@ -12,42 +13,17 @@ class Lead {
12
13
 
13
14
  /**
14
15
  * @param {Object} arg - Arg object.
15
- * @param {boolean} [arg.items] - Decides that the reponse will contain the
16
- * list of tickets
17
- * @param {boolean} [arg.filters] - Decides that the reponse will contain
18
- * the ticket filters
19
- * @param {string} [arg.q] - Search through ticket titles and description
20
- * @param {string} [arg.status] - Filter tickets on status
21
- * @param {PriorityEnum} [arg.priority] - Filter tickets on priority
22
- * @param {string} [arg.category] - Filter tickets on category
23
- * @param {number} [arg.pageNo] - The page number to navigate through the
24
- * given set of results.
25
- * @param {number} [arg.pageSize] - Number of items to retrieve in each
26
- * page. Default is 12.
27
- * @returns {Promise<TicketList>} - Success response
28
- * @summary: Gets the list of company level tickets and/or ticket filters depending on query params
29
- * @description: Gets the list of company level tickets and/or ticket filters
16
+ * @param {string} arg.id - Ticket ID for which history is created
17
+ * @param {TicketHistoryPayload} arg.body
18
+ * @returns {Promise<TicketHistory>} - Success response
19
+ * @summary: Create history for specific company level ticket
20
+ * @description: Create history for specific company level ticket, this history is seen on ticket detail page, this can be comment, log or rating.
30
21
  */
31
- async getTickets({
32
- items,
33
- filters,
34
- q,
35
- status,
36
- priority,
37
- category,
38
- pageNo,
39
- pageSize,
40
- } = {}) {
41
- const { error } = LeadValidator.getTickets().validate(
22
+ async createHistory({ id, body } = {}) {
23
+ const { error } = LeadValidator.createHistory().validate(
42
24
  {
43
- items,
44
- filters,
45
- q,
46
- status,
47
- priority,
48
- category,
49
- pageNo,
50
- pageSize,
25
+ id,
26
+ body,
51
27
  },
52
28
  { abortEarly: false, allowUnknown: true }
53
29
  );
@@ -56,49 +32,35 @@ class Lead {
56
32
  }
57
33
 
58
34
  // Showing warrnings if extra unknown parameters are found
59
- const { error: warrning } = LeadValidator.getTickets().validate(
35
+ const { error: warrning } = LeadValidator.createHistory().validate(
60
36
  {
61
- items,
62
- filters,
63
- q,
64
- status,
65
- priority,
66
- category,
67
- pageNo,
68
- pageSize,
37
+ id,
38
+ body,
69
39
  },
70
40
  { abortEarly: false, allowUnknown: false }
71
41
  );
72
42
  if (warrning) {
73
43
  Logger({
74
44
  level: "WARN",
75
- message: "Parameter Validation warrnings for getTickets",
45
+ message: "Parameter Validation warrnings for createHistory",
76
46
  });
77
47
  Logger({ level: "WARN", message: warrning });
78
48
  }
79
49
 
80
50
  const query_params = {};
81
- query_params["items"] = items;
82
- query_params["filters"] = filters;
83
- query_params["q"] = q;
84
- query_params["status"] = status;
85
- query_params["priority"] = priority;
86
- query_params["category"] = category;
87
- query_params["page_no"] = pageNo;
88
- query_params["page_size"] = pageSize;
89
51
 
90
52
  const xHeaders = {};
91
53
 
92
54
  const response = await PlatformAPIClient.execute(
93
55
  this.config,
94
- "get",
95
- `/service/platform/lead/v1.0/company/${this.config.companyId}/ticket`,
56
+ "post",
57
+ `/service/platform/lead/v1.0/company/${this.config.companyId}/ticket/${id}/history`,
96
58
  query_params,
97
- undefined,
59
+ body,
98
60
  xHeaders
99
61
  );
100
62
 
101
- const { error: res_error } = LeadModel.TicketList().validate(response, {
63
+ const { error: res_error } = LeadModel.TicketHistory().validate(response, {
102
64
  abortEarly: false,
103
65
  allowUnknown: false,
104
66
  });
@@ -106,7 +68,7 @@ class Lead {
106
68
  if (res_error) {
107
69
  Logger({
108
70
  level: "WARN",
109
- message: "Response Validation Warnnings for getTickets",
71
+ message: "Response Validation Warnnings for createHistory",
110
72
  });
111
73
  Logger({ level: "WARN", message: res_error });
112
74
  }
@@ -114,55 +76,6 @@ class Lead {
114
76
  return response;
115
77
  }
116
78
 
117
- /**
118
- * @param {Object} arg - Arg object.
119
- * @param {boolean} [arg.items] - Decides that the reponse will contain the
120
- * list of tickets
121
- * @param {boolean} [arg.filters] - Decides that the reponse will contain
122
- * the ticket filters
123
- * @param {string} [arg.q] - Search through ticket titles and description
124
- * @param {string} [arg.status] - Filter tickets on status
125
- * @param {PriorityEnum} [arg.priority] - Filter tickets on priority
126
- * @param {string} [arg.category] - Filter tickets on category
127
- * @param {number} [arg.pageSize] - Number of items to retrieve in each
128
- * page. Default is 12.
129
- * @summary: Gets the list of company level tickets and/or ticket filters depending on query params
130
- * @description: Gets the list of company level tickets and/or ticket filters
131
- */
132
- getTicketsPaginator({
133
- items,
134
- filters,
135
- q,
136
- status,
137
- priority,
138
- category,
139
- pageSize,
140
- } = {}) {
141
- const paginator = new Paginator();
142
- const callback = async () => {
143
- const pageId = paginator.nextId;
144
- const pageNo = paginator.pageNo;
145
- const pageType = "number";
146
- const data = await this.getTickets({
147
- items: items,
148
- filters: filters,
149
- q: q,
150
- status: status,
151
- priority: priority,
152
- category: category,
153
- pageNo: pageNo,
154
- pageSize: pageSize,
155
- });
156
- paginator.setPaginator({
157
- hasNext: data.page.has_next ? true : false,
158
- nextId: data.page.next_id,
159
- });
160
- return data;
161
- };
162
- paginator.setCallback(callback);
163
- return paginator;
164
- }
165
-
166
79
  /**
167
80
  * @param {Object} arg - Arg object.
168
81
  * @param {AddTicketPayload} arg.body
@@ -227,15 +140,17 @@ class Lead {
227
140
 
228
141
  /**
229
142
  * @param {Object} arg - Arg object.
230
- * @param {string} arg.id - Tiket ID of the ticket to be fetched
143
+ * @param {string} arg.id - Ticket ID of ticket to be edited
144
+ * @param {EditTicketPayload} arg.body
231
145
  * @returns {Promise<Ticket>} - Success response
232
- * @summary: Retreives ticket details of a company level ticket with ticket ID
233
- * @description: Retreives ticket details of a company level ticket
146
+ * @summary: Edits ticket details of a company level ticket
147
+ * @description: Edits ticket details of a company level ticket such as status, priority, category, tags, attachments, assigne & ticket content changes
234
148
  */
235
- async getTicket({ id } = {}) {
236
- const { error } = LeadValidator.getTicket().validate(
149
+ async editTicket({ id, body } = {}) {
150
+ const { error } = LeadValidator.editTicket().validate(
237
151
  {
238
152
  id,
153
+ body,
239
154
  },
240
155
  { abortEarly: false, allowUnknown: true }
241
156
  );
@@ -244,16 +159,17 @@ class Lead {
244
159
  }
245
160
 
246
161
  // Showing warrnings if extra unknown parameters are found
247
- const { error: warrning } = LeadValidator.getTicket().validate(
162
+ const { error: warrning } = LeadValidator.editTicket().validate(
248
163
  {
249
164
  id,
165
+ body,
250
166
  },
251
167
  { abortEarly: false, allowUnknown: false }
252
168
  );
253
169
  if (warrning) {
254
170
  Logger({
255
171
  level: "WARN",
256
- message: "Parameter Validation warrnings for getTicket",
172
+ message: "Parameter Validation warrnings for editTicket",
257
173
  });
258
174
  Logger({ level: "WARN", message: warrning });
259
175
  }
@@ -264,10 +180,10 @@ class Lead {
264
180
 
265
181
  const response = await PlatformAPIClient.execute(
266
182
  this.config,
267
- "get",
183
+ "put",
268
184
  `/service/platform/lead/v1.0/company/${this.config.companyId}/ticket/${id}`,
269
185
  query_params,
270
- undefined,
186
+ body,
271
187
  xHeaders
272
188
  );
273
189
 
@@ -279,7 +195,7 @@ class Lead {
279
195
  if (res_error) {
280
196
  Logger({
281
197
  level: "WARN",
282
- message: "Response Validation Warnnings for getTicket",
198
+ message: "Response Validation Warnnings for editTicket",
283
199
  });
284
200
  Logger({ level: "WARN", message: res_error });
285
201
  }
@@ -289,17 +205,15 @@ class Lead {
289
205
 
290
206
  /**
291
207
  * @param {Object} arg - Arg object.
292
- * @param {string} arg.id - Ticket ID of ticket to be edited
293
- * @param {EditTicketPayload} arg.body
294
- * @returns {Promise<Ticket>} - Success response
295
- * @summary: Edits ticket details of a company level ticket
296
- * @description: Edits ticket details of a company level ticket such as status, priority, category, tags, attachments, assigne & ticket content changes
208
+ * @param {string} arg.id - Ticket ID for which feedbacks are to be fetched
209
+ * @returns {Promise<TicketFeedbackList>} - Success response
210
+ * @summary: Gets a list of feedback submitted against that ticket
211
+ * @description: Gets a list of feedback submitted against that ticket
297
212
  */
298
- async editTicket({ id, body } = {}) {
299
- const { error } = LeadValidator.editTicket().validate(
213
+ async getFeedbacks({ id } = {}) {
214
+ const { error } = LeadValidator.getFeedbacks().validate(
300
215
  {
301
216
  id,
302
- body,
303
217
  },
304
218
  { abortEarly: false, allowUnknown: true }
305
219
  );
@@ -308,17 +222,16 @@ class Lead {
308
222
  }
309
223
 
310
224
  // Showing warrnings if extra unknown parameters are found
311
- const { error: warrning } = LeadValidator.editTicket().validate(
225
+ const { error: warrning } = LeadValidator.getFeedbacks().validate(
312
226
  {
313
227
  id,
314
- body,
315
228
  },
316
229
  { abortEarly: false, allowUnknown: false }
317
230
  );
318
231
  if (warrning) {
319
232
  Logger({
320
233
  level: "WARN",
321
- message: "Parameter Validation warrnings for editTicket",
234
+ message: "Parameter Validation warrnings for getFeedbacks",
322
235
  });
323
236
  Logger({ level: "WARN", message: warrning });
324
237
  }
@@ -329,14 +242,16 @@ class Lead {
329
242
 
330
243
  const response = await PlatformAPIClient.execute(
331
244
  this.config,
332
- "put",
333
- `/service/platform/lead/v1.0/company/${this.config.companyId}/ticket/${id}`,
245
+ "get",
246
+ `/service/platform/lead/v1.0/company/${this.config.companyId}/ticket/${id}/feedback`,
334
247
  query_params,
335
- body,
248
+ undefined,
336
249
  xHeaders
337
250
  );
338
251
 
339
- const { error: res_error } = LeadModel.Ticket().validate(response, {
252
+ const {
253
+ error: res_error,
254
+ } = LeadModel.TicketFeedbackList().validate(response, {
340
255
  abortEarly: false,
341
256
  allowUnknown: false,
342
257
  });
@@ -344,7 +259,7 @@ class Lead {
344
259
  if (res_error) {
345
260
  Logger({
346
261
  level: "WARN",
347
- message: "Response Validation Warnnings for editTicket",
262
+ message: "Response Validation Warnnings for getFeedbacks",
348
263
  });
349
264
  Logger({ level: "WARN", message: res_error });
350
265
  }
@@ -354,18 +269,13 @@ class Lead {
354
269
 
355
270
  /**
356
271
  * @param {Object} arg - Arg object.
357
- * @param {string} arg.id - Ticket ID for which history is created
358
- * @param {TicketHistoryPayload} arg.body
359
- * @returns {Promise<TicketHistory>} - Success response
360
- * @summary: Create history for specific company level ticket
361
- * @description: Create history for specific company level ticket, this history is seen on ticket detail page, this can be comment, log or rating.
272
+ * @returns {Promise<CloseVideoRoomResponse>} - Success response
273
+ * @summary: Get general support configuration.
274
+ * @description: Get general support configuration.
362
275
  */
363
- async createHistory({ id, body } = {}) {
364
- const { error } = LeadValidator.createHistory().validate(
365
- {
366
- id,
367
- body,
368
- },
276
+ async getGeneralConfig({} = {}) {
277
+ const { error } = LeadValidator.getGeneralConfig().validate(
278
+ {},
369
279
  { abortEarly: false, allowUnknown: true }
370
280
  );
371
281
  if (error) {
@@ -373,17 +283,14 @@ class Lead {
373
283
  }
374
284
 
375
285
  // Showing warrnings if extra unknown parameters are found
376
- const { error: warrning } = LeadValidator.createHistory().validate(
377
- {
378
- id,
379
- body,
380
- },
286
+ const { error: warrning } = LeadValidator.getGeneralConfig().validate(
287
+ {},
381
288
  { abortEarly: false, allowUnknown: false }
382
289
  );
383
290
  if (warrning) {
384
291
  Logger({
385
292
  level: "WARN",
386
- message: "Parameter Validation warrnings for createHistory",
293
+ message: "Parameter Validation warrnings for getGeneralConfig",
387
294
  });
388
295
  Logger({ level: "WARN", message: warrning });
389
296
  }
@@ -394,14 +301,16 @@ class Lead {
394
301
 
395
302
  const response = await PlatformAPIClient.execute(
396
303
  this.config,
397
- "post",
398
- `/service/platform/lead/v1.0/company/${this.config.companyId}/ticket/${id}/history`,
304
+ "get",
305
+ `/service/platform/lead/v1.0/company/${this.config.companyId}/general-config`,
399
306
  query_params,
400
- body,
307
+ undefined,
401
308
  xHeaders
402
309
  );
403
310
 
404
- const { error: res_error } = LeadModel.TicketHistory().validate(response, {
311
+ const {
312
+ error: res_error,
313
+ } = LeadModel.CloseVideoRoomResponse().validate(response, {
405
314
  abortEarly: false,
406
315
  allowUnknown: false,
407
316
  });
@@ -409,7 +318,7 @@ class Lead {
409
318
  if (res_error) {
410
319
  Logger({
411
320
  level: "WARN",
412
- message: "Response Validation Warnnings for createHistory",
321
+ message: "Response Validation Warnnings for getGeneralConfig",
413
322
  });
414
323
  Logger({ level: "WARN", message: res_error });
415
324
  }
@@ -419,13 +328,13 @@ class Lead {
419
328
 
420
329
  /**
421
330
  * @param {Object} arg - Arg object.
422
- * @param {string} arg.id - Ticket ID for which history is to be fetched
423
- * @returns {Promise<TicketHistoryList>} - Success response
424
- * @summary: Gets history list for specific company level ticket
425
- * @description: Gets history list for specific company level ticket, this history is seen on ticket detail page, this can be comment, log or rating.
331
+ * @param {string} arg.id - Tiket ID of the ticket to be fetched
332
+ * @returns {Promise<Ticket>} - Success response
333
+ * @summary: Retreives ticket details of a company level ticket with ticket ID
334
+ * @description: Retreives ticket details of a company level ticket
426
335
  */
427
- async getTicketHistory({ id } = {}) {
428
- const { error } = LeadValidator.getTicketHistory().validate(
336
+ async getTicket({ id } = {}) {
337
+ const { error } = LeadValidator.getTicket().validate(
429
338
  {
430
339
  id,
431
340
  },
@@ -436,7 +345,7 @@ class Lead {
436
345
  }
437
346
 
438
347
  // Showing warrnings if extra unknown parameters are found
439
- const { error: warrning } = LeadValidator.getTicketHistory().validate(
348
+ const { error: warrning } = LeadValidator.getTicket().validate(
440
349
  {
441
350
  id,
442
351
  },
@@ -445,7 +354,7 @@ class Lead {
445
354
  if (warrning) {
446
355
  Logger({
447
356
  level: "WARN",
448
- message: "Parameter Validation warrnings for getTicketHistory",
357
+ message: "Parameter Validation warrnings for getTicket",
449
358
  });
450
359
  Logger({ level: "WARN", message: warrning });
451
360
  }
@@ -457,15 +366,13 @@ class Lead {
457
366
  const response = await PlatformAPIClient.execute(
458
367
  this.config,
459
368
  "get",
460
- `/service/platform/lead/v1.0/company/${this.config.companyId}/ticket/${id}/history`,
369
+ `/service/platform/lead/v1.0/company/${this.config.companyId}/ticket/${id}`,
461
370
  query_params,
462
371
  undefined,
463
372
  xHeaders
464
373
  );
465
374
 
466
- const {
467
- error: res_error,
468
- } = LeadModel.TicketHistoryList().validate(response, {
375
+ const { error: res_error } = LeadModel.Ticket().validate(response, {
469
376
  abortEarly: false,
470
377
  allowUnknown: false,
471
378
  });
@@ -473,7 +380,7 @@ class Lead {
473
380
  if (res_error) {
474
381
  Logger({
475
382
  level: "WARN",
476
- message: "Response Validation Warnnings for getTicketHistory",
383
+ message: "Response Validation Warnnings for getTicket",
477
384
  });
478
385
  Logger({ level: "WARN", message: res_error });
479
386
  }
@@ -483,13 +390,13 @@ class Lead {
483
390
 
484
391
  /**
485
392
  * @param {Object} arg - Arg object.
486
- * @param {string} arg.id - Ticket ID for which feedbacks are to be fetched
487
- * @returns {Promise<TicketFeedbackList>} - Success response
488
- * @summary: Gets a list of feedback submitted against that ticket
489
- * @description: Gets a list of feedback submitted against that ticket
393
+ * @param {string} arg.id - Ticket ID for which history is to be fetched
394
+ * @returns {Promise<TicketHistoryList>} - Success response
395
+ * @summary: Gets history list for specific company level ticket
396
+ * @description: Gets history list for specific company level ticket, this history is seen on ticket detail page, this can be comment, log or rating.
490
397
  */
491
- async getFeedbacks({ id } = {}) {
492
- const { error } = LeadValidator.getFeedbacks().validate(
398
+ async getTicketHistory({ id } = {}) {
399
+ const { error } = LeadValidator.getTicketHistory().validate(
493
400
  {
494
401
  id,
495
402
  },
@@ -500,7 +407,7 @@ class Lead {
500
407
  }
501
408
 
502
409
  // Showing warrnings if extra unknown parameters are found
503
- const { error: warrning } = LeadValidator.getFeedbacks().validate(
410
+ const { error: warrning } = LeadValidator.getTicketHistory().validate(
504
411
  {
505
412
  id,
506
413
  },
@@ -509,7 +416,7 @@ class Lead {
509
416
  if (warrning) {
510
417
  Logger({
511
418
  level: "WARN",
512
- message: "Parameter Validation warrnings for getFeedbacks",
419
+ message: "Parameter Validation warrnings for getTicketHistory",
513
420
  });
514
421
  Logger({ level: "WARN", message: warrning });
515
422
  }
@@ -521,7 +428,7 @@ class Lead {
521
428
  const response = await PlatformAPIClient.execute(
522
429
  this.config,
523
430
  "get",
524
- `/service/platform/lead/v1.0/company/${this.config.companyId}/ticket/${id}/feedback`,
431
+ `/service/platform/lead/v1.0/company/${this.config.companyId}/ticket/${id}/history`,
525
432
  query_params,
526
433
  undefined,
527
434
  xHeaders
@@ -529,7 +436,7 @@ class Lead {
529
436
 
530
437
  const {
531
438
  error: res_error,
532
- } = LeadModel.TicketFeedbackList().validate(response, {
439
+ } = LeadModel.TicketHistoryList().validate(response, {
533
440
  abortEarly: false,
534
441
  allowUnknown: false,
535
442
  });
@@ -537,7 +444,7 @@ class Lead {
537
444
  if (res_error) {
538
445
  Logger({
539
446
  level: "WARN",
540
- message: "Response Validation Warnnings for getFeedbacks",
447
+ message: "Response Validation Warnnings for getTicketHistory",
541
448
  });
542
449
  Logger({ level: "WARN", message: res_error });
543
450
  }
@@ -547,17 +454,42 @@ class Lead {
547
454
 
548
455
  /**
549
456
  * @param {Object} arg - Arg object.
550
- * @param {string} arg.id - Ticket ID for which feedback is to be submitted
551
- * @param {TicketFeedbackPayload} arg.body
552
- * @returns {Promise<TicketFeedback>} - Success response
553
- * @summary: Submit a response for feeback form against that ticket
554
- * @description: Submit a response for feeback form against that ticket
457
+ * @param {boolean} [arg.items] - Decides that the reponse will contain the
458
+ * list of tickets
459
+ * @param {boolean} [arg.filters] - Decides that the reponse will contain
460
+ * the ticket filters
461
+ * @param {string} [arg.q] - Search through ticket titles and description
462
+ * @param {string} [arg.status] - Filter tickets on status
463
+ * @param {PriorityEnum} [arg.priority] - Filter tickets on priority
464
+ * @param {string} [arg.category] - Filter tickets on category
465
+ * @param {number} [arg.pageNo] - The page number to navigate through the
466
+ * given set of results.
467
+ * @param {number} [arg.pageSize] - Number of items to retrieve in each
468
+ * page. Default is 12.
469
+ * @returns {Promise<TicketList>} - Success response
470
+ * @summary: Gets the list of company level tickets and/or ticket filters depending on query params
471
+ * @description: Gets the list of company level tickets and/or ticket filters
555
472
  */
556
- async submitFeedback({ id, body } = {}) {
557
- const { error } = LeadValidator.submitFeedback().validate(
473
+ async getTickets({
474
+ items,
475
+ filters,
476
+ q,
477
+ status,
478
+ priority,
479
+ category,
480
+ pageNo,
481
+ pageSize,
482
+ } = {}) {
483
+ const { error } = LeadValidator.getTickets().validate(
558
484
  {
559
- id,
560
- body,
485
+ items,
486
+ filters,
487
+ q,
488
+ status,
489
+ priority,
490
+ category,
491
+ pageNo,
492
+ pageSize,
561
493
  },
562
494
  { abortEarly: false, allowUnknown: true }
563
495
  );
@@ -566,35 +498,49 @@ class Lead {
566
498
  }
567
499
 
568
500
  // Showing warrnings if extra unknown parameters are found
569
- const { error: warrning } = LeadValidator.submitFeedback().validate(
501
+ const { error: warrning } = LeadValidator.getTickets().validate(
570
502
  {
571
- id,
572
- body,
503
+ items,
504
+ filters,
505
+ q,
506
+ status,
507
+ priority,
508
+ category,
509
+ pageNo,
510
+ pageSize,
573
511
  },
574
512
  { abortEarly: false, allowUnknown: false }
575
513
  );
576
514
  if (warrning) {
577
515
  Logger({
578
516
  level: "WARN",
579
- message: "Parameter Validation warrnings for submitFeedback",
517
+ message: "Parameter Validation warrnings for getTickets",
580
518
  });
581
519
  Logger({ level: "WARN", message: warrning });
582
520
  }
583
521
 
584
522
  const query_params = {};
523
+ query_params["items"] = items;
524
+ query_params["filters"] = filters;
525
+ query_params["q"] = q;
526
+ query_params["status"] = status;
527
+ query_params["priority"] = priority;
528
+ query_params["category"] = category;
529
+ query_params["page_no"] = pageNo;
530
+ query_params["page_size"] = pageSize;
585
531
 
586
532
  const xHeaders = {};
587
533
 
588
534
  const response = await PlatformAPIClient.execute(
589
535
  this.config,
590
- "post",
591
- `/service/platform/lead/v1.0/company/${this.config.companyId}/ticket/${id}/feedback`,
536
+ "get",
537
+ `/service/platform/lead/v1.0/company/${this.config.companyId}/ticket`,
592
538
  query_params,
593
- body,
539
+ undefined,
594
540
  xHeaders
595
541
  );
596
542
 
597
- const { error: res_error } = LeadModel.TicketFeedback().validate(response, {
543
+ const { error: res_error } = LeadModel.TicketList().validate(response, {
598
544
  abortEarly: false,
599
545
  allowUnknown: false,
600
546
  });
@@ -602,7 +548,7 @@ class Lead {
602
548
  if (res_error) {
603
549
  Logger({
604
550
  level: "WARN",
605
- message: "Response Validation Warnnings for submitFeedback",
551
+ message: "Response Validation Warnnings for getTickets",
606
552
  });
607
553
  Logger({ level: "WARN", message: res_error });
608
554
  }
@@ -610,6 +556,55 @@ class Lead {
610
556
  return response;
611
557
  }
612
558
 
559
+ /**
560
+ * @param {Object} arg - Arg object.
561
+ * @param {boolean} [arg.items] - Decides that the reponse will contain the
562
+ * list of tickets
563
+ * @param {boolean} [arg.filters] - Decides that the reponse will contain
564
+ * the ticket filters
565
+ * @param {string} [arg.q] - Search through ticket titles and description
566
+ * @param {string} [arg.status] - Filter tickets on status
567
+ * @param {PriorityEnum} [arg.priority] - Filter tickets on priority
568
+ * @param {string} [arg.category] - Filter tickets on category
569
+ * @param {number} [arg.pageSize] - Number of items to retrieve in each
570
+ * page. Default is 12.
571
+ * @summary: Gets the list of company level tickets and/or ticket filters depending on query params
572
+ * @description: Gets the list of company level tickets and/or ticket filters
573
+ */
574
+ getTicketsPaginator({
575
+ items,
576
+ filters,
577
+ q,
578
+ status,
579
+ priority,
580
+ category,
581
+ pageSize,
582
+ } = {}) {
583
+ const paginator = new Paginator();
584
+ const callback = async () => {
585
+ const pageId = paginator.nextId;
586
+ const pageNo = paginator.pageNo;
587
+ const pageType = "number";
588
+ const data = await this.getTickets({
589
+ items: items,
590
+ filters: filters,
591
+ q: q,
592
+ status: status,
593
+ priority: priority,
594
+ category: category,
595
+ pageNo: pageNo,
596
+ pageSize: pageSize,
597
+ });
598
+ paginator.setPaginator({
599
+ hasNext: data.page.has_next ? true : false,
600
+ nextId: data.page.next_id,
601
+ });
602
+ return data;
603
+ };
604
+ paginator.setCallback(callback.bind(this));
605
+ return paginator;
606
+ }
607
+
613
608
  /**
614
609
  * @param {Object} arg - Arg object.
615
610
  * @param {string} arg.uniqueName - Unique name of video room
@@ -740,13 +735,18 @@ class Lead {
740
735
 
741
736
  /**
742
737
  * @param {Object} arg - Arg object.
743
- * @returns {Promise<CloseVideoRoomResponse>} - Success response
744
- * @summary: Get general support configuration.
745
- * @description: Get general support configuration.
738
+ * @param {string} arg.id - Ticket ID for which feedback is to be submitted
739
+ * @param {TicketFeedbackPayload} arg.body
740
+ * @returns {Promise<TicketFeedback>} - Success response
741
+ * @summary: Submit a response for feeback form against that ticket
742
+ * @description: Submit a response for feeback form against that ticket
746
743
  */
747
- async getGeneralConfig({} = {}) {
748
- const { error } = LeadValidator.getGeneralConfig().validate(
749
- {},
744
+ async submitFeedback({ id, body } = {}) {
745
+ const { error } = LeadValidator.submitFeedback().validate(
746
+ {
747
+ id,
748
+ body,
749
+ },
750
750
  { abortEarly: false, allowUnknown: true }
751
751
  );
752
752
  if (error) {
@@ -754,14 +754,17 @@ class Lead {
754
754
  }
755
755
 
756
756
  // Showing warrnings if extra unknown parameters are found
757
- const { error: warrning } = LeadValidator.getGeneralConfig().validate(
758
- {},
757
+ const { error: warrning } = LeadValidator.submitFeedback().validate(
758
+ {
759
+ id,
760
+ body,
761
+ },
759
762
  { abortEarly: false, allowUnknown: false }
760
763
  );
761
764
  if (warrning) {
762
765
  Logger({
763
766
  level: "WARN",
764
- message: "Parameter Validation warrnings for getGeneralConfig",
767
+ message: "Parameter Validation warrnings for submitFeedback",
765
768
  });
766
769
  Logger({ level: "WARN", message: warrning });
767
770
  }
@@ -772,16 +775,14 @@ class Lead {
772
775
 
773
776
  const response = await PlatformAPIClient.execute(
774
777
  this.config,
775
- "get",
776
- `/service/platform/lead/v1.0/company/${this.config.companyId}/general-config`,
778
+ "post",
779
+ `/service/platform/lead/v1.0/company/${this.config.companyId}/ticket/${id}/feedback`,
777
780
  query_params,
778
- undefined,
781
+ body,
779
782
  xHeaders
780
783
  );
781
784
 
782
- const {
783
- error: res_error,
784
- } = LeadModel.CloseVideoRoomResponse().validate(response, {
785
+ const { error: res_error } = LeadModel.TicketFeedback().validate(response, {
785
786
  abortEarly: false,
786
787
  allowUnknown: false,
787
788
  });
@@ -789,7 +790,7 @@ class Lead {
789
790
  if (res_error) {
790
791
  Logger({
791
792
  level: "WARN",
792
- message: "Response Validation Warnnings for getGeneralConfig",
793
+ message: "Response Validation Warnnings for submitFeedback",
793
794
  });
794
795
  Logger({ level: "WARN", message: res_error });
795
796
  }