@gofynd/fdk-client-javascript 1.0.1 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (318) hide show
  1. package/documentation/application/CART.md +5934 -4502
  2. package/documentation/application/CATALOG.md +6338 -7245
  3. package/documentation/application/COMMON.md +95 -222
  4. package/documentation/application/COMMUNICATION.md +106 -186
  5. package/documentation/application/CONFIGURATION.md +903 -1597
  6. package/documentation/application/CONTENT.md +562 -1270
  7. package/documentation/application/FILESTORAGE.md +84 -220
  8. package/documentation/application/LEAD.md +314 -660
  9. package/documentation/application/LOGISTIC.md +229 -305
  10. package/documentation/application/ORDER.md +642 -1137
  11. package/documentation/application/PAYMENT.md +2285 -3031
  12. package/documentation/application/POSCART.md +6079 -4642
  13. package/documentation/application/REWARDS.md +94 -248
  14. package/documentation/application/SHARE.md +152 -250
  15. package/documentation/application/THEME.md +952 -1235
  16. package/documentation/application/USER.md +1228 -1765
  17. package/documentation/platform/ANALYTICS.md +207 -349
  18. package/documentation/platform/AUDITTRAIL.md +121 -204
  19. package/documentation/platform/BILLING.md +865 -1376
  20. package/documentation/platform/CART.md +2814 -3662
  21. package/documentation/platform/CATALOG.md +15266 -17619
  22. package/documentation/platform/COMMON.md +95 -222
  23. package/documentation/platform/COMMUNICATION.md +1632 -2380
  24. package/documentation/platform/COMPANYPROFILE.md +572 -957
  25. package/documentation/platform/CONFIGURATION.md +3050 -4073
  26. package/documentation/platform/CONTENT.md +3509 -4121
  27. package/documentation/platform/DISCOUNT.md +140 -236
  28. package/documentation/platform/FILESTORAGE.md +187 -323
  29. package/documentation/platform/INVENTORY.md +268 -911
  30. package/documentation/platform/LEAD.md +2195 -2541
  31. package/documentation/platform/ORDER.md +3750 -5636
  32. package/documentation/platform/PARTNER.md +9 -36
  33. package/documentation/platform/PAYMENT.md +903 -1213
  34. package/documentation/platform/REWARDS.md +183 -347
  35. package/documentation/platform/SHARE.md +120 -213
  36. package/documentation/platform/THEME.md +12956 -13239
  37. package/documentation/platform/USER.md +975 -1120
  38. package/documentation/platform/WEBHOOK.md +78 -184
  39. package/documentation/public/CONFIGURATION.md +95 -222
  40. package/documentation/public/INVENTORY.md +100 -282
  41. package/documentation/public/WEBHOOK.md +27 -133
  42. package/package.json +1 -1
  43. package/sdk/application/ApplicationConfig.js +1 -1
  44. package/sdk/application/Cart/CartApplicationClient.d.ts +243 -243
  45. package/sdk/application/Cart/CartApplicationClient.js +1058 -547
  46. package/sdk/application/Cart/CartApplicationModel.d.ts +64 -63
  47. package/sdk/application/Cart/CartApplicationModel.js +489 -886
  48. package/sdk/application/Cart/CartApplicationValidator.d.ts +17 -17
  49. package/sdk/application/Cart/CartApplicationValidator.js +98 -98
  50. package/sdk/application/Catalog/CatalogApplicationClient.d.ts +358 -358
  51. package/sdk/application/Catalog/CatalogApplicationClient.js +1545 -949
  52. package/sdk/application/Catalog/CatalogApplicationModel.d.ts +90 -90
  53. package/sdk/application/Catalog/CatalogApplicationModel.js +692 -1258
  54. package/sdk/application/Catalog/CatalogApplicationValidator.d.ts +19 -19
  55. package/sdk/application/Catalog/CatalogApplicationValidator.js +110 -110
  56. package/sdk/application/Common/CommonApplicationClient.d.ts +13 -13
  57. package/sdk/application/Common/CommonApplicationClient.js +76 -36
  58. package/sdk/application/Common/CommonApplicationModel.d.ts +12 -12
  59. package/sdk/application/Common/CommonApplicationModel.js +83 -160
  60. package/sdk/application/Common/CommonApplicationValidator.d.ts +1 -1
  61. package/sdk/application/Common/CommonApplicationValidator.js +6 -6
  62. package/sdk/application/Communication/CommunicationApplicationClient.d.ts +11 -11
  63. package/sdk/application/Communication/CommunicationApplicationClient.js +92 -31
  64. package/sdk/application/Communication/CommunicationApplicationModel.d.ts +6 -6
  65. package/sdk/application/Communication/CommunicationApplicationModel.js +38 -83
  66. package/sdk/application/Communication/CommunicationApplicationValidator.d.ts +1 -1
  67. package/sdk/application/Communication/CommunicationApplicationValidator.js +4 -4
  68. package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +116 -116
  69. package/sdk/application/Configuration/ConfigurationApplicationClient.js +638 -312
  70. package/sdk/application/Configuration/ConfigurationApplicationModel.d.ts +85 -85
  71. package/sdk/application/Configuration/ConfigurationApplicationModel.js +480 -851
  72. package/sdk/application/Configuration/ConfigurationApplicationValidator.d.ts +8 -8
  73. package/sdk/application/Configuration/ConfigurationApplicationValidator.js +33 -33
  74. package/sdk/application/Content/ContentApplicationClient.d.ts +67 -67
  75. package/sdk/application/Content/ContentApplicationClient.js +581 -213
  76. package/sdk/application/Content/ContentApplicationModel.d.ts +76 -75
  77. package/sdk/application/Content/ContentApplicationModel.js +468 -875
  78. package/sdk/application/Content/ContentApplicationValidator.d.ts +5 -5
  79. package/sdk/application/Content/ContentApplicationValidator.js +24 -24
  80. package/sdk/application/FileStorage/FileStorageApplicationClient.d.ts +25 -25
  81. package/sdk/application/FileStorage/FileStorageApplicationClient.js +121 -59
  82. package/sdk/application/FileStorage/FileStorageApplicationModel.d.ts +13 -13
  83. package/sdk/application/FileStorage/FileStorageApplicationModel.js +86 -169
  84. package/sdk/application/FileStorage/FileStorageApplicationValidator.d.ts +1 -1
  85. package/sdk/application/FileStorage/FileStorageApplicationValidator.js +7 -7
  86. package/sdk/application/Lead/LeadApplicationClient.d.ts +24 -24
  87. package/sdk/application/Lead/LeadApplicationClient.js +230 -96
  88. package/sdk/application/Lead/LeadApplicationModel.d.ts +35 -35
  89. package/sdk/application/Lead/LeadApplicationModel.js +267 -474
  90. package/sdk/application/Lead/LeadApplicationValidator.d.ts +2 -2
  91. package/sdk/application/Lead/LeadApplicationValidator.js +11 -11
  92. package/sdk/application/Logistic/LogisticApplicationClient.d.ts +30 -19
  93. package/sdk/application/Logistic/LogisticApplicationClient.js +196 -47
  94. package/sdk/application/Logistic/LogisticApplicationModel.d.ts +17 -14
  95. package/sdk/application/Logistic/LogisticApplicationModel.js +133 -201
  96. package/sdk/application/Logistic/LogisticApplicationValidator.d.ts +3 -2
  97. package/sdk/application/Logistic/LogisticApplicationValidator.js +14 -8
  98. package/sdk/application/Order/OrderApplicationClient.d.ts +86 -86
  99. package/sdk/application/Order/OrderApplicationClient.js +448 -215
  100. package/sdk/application/Order/OrderApplicationModel.d.ts +50 -50
  101. package/sdk/application/Order/OrderApplicationModel.js +357 -661
  102. package/sdk/application/Order/OrderApplicationValidator.d.ts +7 -7
  103. package/sdk/application/Order/OrderApplicationValidator.js +28 -28
  104. package/sdk/application/Payment/PaymentApplicationClient.d.ts +318 -318
  105. package/sdk/application/Payment/PaymentApplicationClient.js +1525 -750
  106. package/sdk/application/Payment/PaymentApplicationModel.d.ts +72 -72
  107. package/sdk/application/Payment/PaymentApplicationModel.js +565 -1033
  108. package/sdk/application/Payment/PaymentApplicationValidator.d.ts +28 -28
  109. package/sdk/application/Payment/PaymentApplicationValidator.js +107 -107
  110. package/sdk/application/PosCart/PosCartApplicationClient.d.ts +254 -254
  111. package/sdk/application/PosCart/PosCartApplicationClient.js +1137 -606
  112. package/sdk/application/PosCart/PosCartApplicationModel.d.ts +61 -60
  113. package/sdk/application/PosCart/PosCartApplicationModel.js +477 -873
  114. package/sdk/application/PosCart/PosCartApplicationValidator.d.ts +18 -18
  115. package/sdk/application/PosCart/PosCartApplicationValidator.js +103 -103
  116. package/sdk/application/Rewards/RewardsApplicationClient.d.ts +27 -27
  117. package/sdk/application/Rewards/RewardsApplicationClient.js +253 -113
  118. package/sdk/application/Rewards/RewardsApplicationModel.d.ts +14 -14
  119. package/sdk/application/Rewards/RewardsApplicationModel.js +96 -191
  120. package/sdk/application/Rewards/RewardsApplicationValidator.d.ts +3 -3
  121. package/sdk/application/Rewards/RewardsApplicationValidator.js +12 -12
  122. package/sdk/application/Share/ShareApplicationClient.d.ts +37 -37
  123. package/sdk/application/Share/ShareApplicationClient.js +221 -96
  124. package/sdk/application/Share/ShareApplicationModel.d.ts +8 -8
  125. package/sdk/application/Share/ShareApplicationModel.js +63 -123
  126. package/sdk/application/Share/ShareApplicationValidator.d.ts +4 -4
  127. package/sdk/application/Share/ShareApplicationValidator.js +12 -12
  128. package/sdk/application/Theme/ThemeApplicationClient.d.ts +8 -8
  129. package/sdk/application/Theme/ThemeApplicationClient.js +115 -37
  130. package/sdk/application/Theme/ThemeApplicationModel.d.ts +34 -34
  131. package/sdk/application/Theme/ThemeApplicationModel.js +190 -336
  132. package/sdk/application/Theme/ThemeApplicationValidator.d.ts +1 -1
  133. package/sdk/application/Theme/ThemeApplicationValidator.js +4 -4
  134. package/sdk/application/User/UserApplicationClient.d.ts +280 -280
  135. package/sdk/application/User/UserApplicationClient.js +1201 -543
  136. package/sdk/application/User/UserApplicationModel.d.ts +79 -72
  137. package/sdk/application/User/UserApplicationModel.js +440 -689
  138. package/sdk/application/User/UserApplicationValidator.d.ts +24 -24
  139. package/sdk/application/User/UserApplicationValidator.js +89 -89
  140. package/sdk/common/AxiosHelper.js +1 -1
  141. package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.d.ts +55 -47
  142. package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.js +308 -151
  143. package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.d.ts +6 -6
  144. package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.js +20 -20
  145. package/sdk/platform/Analytics/AnalyticsPlatformClient.d.ts +8 -4
  146. package/sdk/platform/Analytics/AnalyticsPlatformClient.js +103 -16
  147. package/sdk/platform/Analytics/AnalyticsPlatformModel.d.ts +11 -11
  148. package/sdk/platform/Analytics/AnalyticsPlatformModel.js +95 -178
  149. package/sdk/platform/AuditTrail/AuditTrailPlatformClient.d.ts +16 -12
  150. package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +131 -44
  151. package/sdk/platform/AuditTrail/AuditTrailPlatformModel.d.ts +10 -10
  152. package/sdk/platform/AuditTrail/AuditTrailPlatformModel.js +50 -89
  153. package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.d.ts +1 -1
  154. package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.js +6 -6
  155. package/sdk/platform/Billing/BillingPlatformClient.d.ts +68 -56
  156. package/sdk/platform/Billing/BillingPlatformClient.js +416 -171
  157. package/sdk/platform/Billing/BillingPlatformModel.d.ts +40 -40
  158. package/sdk/platform/Billing/BillingPlatformModel.js +342 -668
  159. package/sdk/platform/Billing/BillingPlatformValidator.d.ts +8 -8
  160. package/sdk/platform/Billing/BillingPlatformValidator.js +25 -25
  161. package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +176 -159
  162. package/sdk/platform/Cart/CartPlatformApplicationClient.js +837 -500
  163. package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +11 -11
  164. package/sdk/platform/Cart/CartPlatformApplicationValidator.js +63 -63
  165. package/sdk/platform/Cart/CartPlatformModel.d.ts +86 -85
  166. package/sdk/platform/Cart/CartPlatformModel.js +677 -1211
  167. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +582 -529
  168. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +2642 -1533
  169. package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +40 -40
  170. package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +175 -175
  171. package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +708 -590
  172. package/sdk/platform/Catalog/CatalogPlatformClient.js +3103 -1362
  173. package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +293 -284
  174. package/sdk/platform/Catalog/CatalogPlatformModel.js +2149 -3660
  175. package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +66 -64
  176. package/sdk/platform/Catalog/CatalogPlatformValidator.js +235 -216
  177. package/sdk/platform/Common/CommonPlatformClient.d.ts +14 -12
  178. package/sdk/platform/Common/CommonPlatformClient.js +80 -37
  179. package/sdk/platform/Common/CommonPlatformModel.d.ts +12 -12
  180. package/sdk/platform/Common/CommonPlatformModel.js +83 -160
  181. package/sdk/platform/Common/CommonPlatformValidator.d.ts +1 -1
  182. package/sdk/platform/Common/CommonPlatformValidator.js +6 -6
  183. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +333 -293
  184. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +1687 -855
  185. package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.d.ts +30 -30
  186. package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.js +87 -87
  187. package/sdk/platform/Communication/CommunicationPlatformClient.d.ts +2 -1
  188. package/sdk/platform/Communication/CommunicationPlatformClient.js +28 -4
  189. package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +67 -67
  190. package/sdk/platform/Communication/CommunicationPlatformModel.js +522 -974
  191. package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +70 -57
  192. package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +463 -182
  193. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +28 -28
  194. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +294 -557
  195. package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.d.ts +7 -7
  196. package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.js +24 -24
  197. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +175 -137
  198. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +1168 -521
  199. package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.d.ts +22 -21
  200. package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.js +69 -63
  201. package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +137 -119
  202. package/sdk/platform/Configuration/ConfigurationPlatformClient.js +691 -316
  203. package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +148 -146
  204. package/sdk/platform/Configuration/ConfigurationPlatformModel.js +854 -1508
  205. package/sdk/platform/Configuration/ConfigurationPlatformValidator.d.ts +9 -9
  206. package/sdk/platform/Configuration/ConfigurationPlatformValidator.js +38 -38
  207. package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +542 -461
  208. package/sdk/platform/Content/ContentPlatformApplicationClient.js +2600 -1160
  209. package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +50 -49
  210. package/sdk/platform/Content/ContentPlatformApplicationValidator.js +159 -152
  211. package/sdk/platform/Content/ContentPlatformModel.d.ts +79 -75
  212. package/sdk/platform/Content/ContentPlatformModel.js +486 -867
  213. package/sdk/platform/Discount/DiscountPlatformClient.d.ts +72 -61
  214. package/sdk/platform/Discount/DiscountPlatformClient.js +424 -198
  215. package/sdk/platform/Discount/DiscountPlatformModel.d.ts +7 -7
  216. package/sdk/platform/Discount/DiscountPlatformModel.js +60 -121
  217. package/sdk/platform/Discount/DiscountPlatformValidator.d.ts +6 -6
  218. package/sdk/platform/Discount/DiscountPlatformValidator.js +29 -29
  219. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +26 -22
  220. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +145 -59
  221. package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.d.ts +1 -1
  222. package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.js +8 -8
  223. package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +58 -52
  224. package/sdk/platform/FileStorage/FileStoragePlatformClient.js +240 -114
  225. package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +13 -13
  226. package/sdk/platform/FileStorage/FileStoragePlatformModel.js +86 -169
  227. package/sdk/platform/FileStorage/FileStoragePlatformValidator.d.ts +3 -3
  228. package/sdk/platform/FileStorage/FileStoragePlatformValidator.js +11 -11
  229. package/sdk/platform/Inventory/InventoryPlatformClient.d.ts +76 -63
  230. package/sdk/platform/Inventory/InventoryPlatformClient.js +461 -197
  231. package/sdk/platform/Inventory/InventoryPlatformModel.d.ts +30 -30
  232. package/sdk/platform/Inventory/InventoryPlatformModel.js +497 -964
  233. package/sdk/platform/Inventory/InventoryPlatformValidator.d.ts +7 -7
  234. package/sdk/platform/Inventory/InventoryPlatformValidator.js +28 -28
  235. package/sdk/platform/Lead/LeadPlatformApplicationClient.d.ts +84 -71
  236. package/sdk/platform/Lead/LeadPlatformApplicationClient.js +441 -182
  237. package/sdk/platform/Lead/LeadPlatformApplicationValidator.d.ts +7 -7
  238. package/sdk/platform/Lead/LeadPlatformApplicationValidator.js +28 -28
  239. package/sdk/platform/Lead/LeadPlatformClient.d.ts +86 -75
  240. package/sdk/platform/Lead/LeadPlatformClient.js +434 -212
  241. package/sdk/platform/Lead/LeadPlatformModel.d.ts +35 -35
  242. package/sdk/platform/Lead/LeadPlatformModel.js +267 -474
  243. package/sdk/platform/Lead/LeadPlatformValidator.d.ts +6 -6
  244. package/sdk/platform/Lead/LeadPlatformValidator.js +24 -24
  245. package/sdk/platform/OAuthClient.js +8 -8
  246. package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +14 -11
  247. package/sdk/platform/Order/OrderPlatformApplicationClient.js +113 -49
  248. package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +1 -1
  249. package/sdk/platform/Order/OrderPlatformApplicationValidator.js +6 -6
  250. package/sdk/platform/Order/OrderPlatformClient.d.ts +367 -315
  251. package/sdk/platform/Order/OrderPlatformClient.js +1775 -893
  252. package/sdk/platform/Order/OrderPlatformModel.d.ts +198 -192
  253. package/sdk/platform/Order/OrderPlatformModel.js +1591 -2822
  254. package/sdk/platform/Order/OrderPlatformValidator.d.ts +32 -32
  255. package/sdk/platform/Order/OrderPlatformValidator.js +160 -155
  256. package/sdk/platform/Partner/PartnerPlatformApplicationClient.d.ts +4 -2
  257. package/sdk/platform/Partner/PartnerPlatformApplicationClient.js +52 -8
  258. package/sdk/platform/Partner/PartnerPlatformModel.js +6 -22
  259. package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +65 -54
  260. package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +395 -164
  261. package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +6 -6
  262. package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +23 -23
  263. package/sdk/platform/Payment/PaymentPlatformClient.d.ts +55 -45
  264. package/sdk/platform/Payment/PaymentPlatformClient.js +362 -147
  265. package/sdk/platform/Payment/PaymentPlatformModel.d.ts +27 -27
  266. package/sdk/platform/Payment/PaymentPlatformModel.js +220 -408
  267. package/sdk/platform/Payment/PaymentPlatformValidator.d.ts +4 -4
  268. package/sdk/platform/Payment/PaymentPlatformValidator.js +21 -21
  269. package/sdk/platform/PlatformApplicationClient.d.ts +1496 -10153
  270. package/sdk/platform/PlatformApplicationClient.js +1584 -13691
  271. package/sdk/platform/PlatformClient.d.ts +7918 -7666
  272. package/sdk/platform/PlatformClient.js +8701 -9926
  273. package/sdk/platform/Rewards/RewardsPlatformApplicationClient.d.ts +91 -78
  274. package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +507 -253
  275. package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.d.ts +8 -8
  276. package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.js +34 -34
  277. package/sdk/platform/Rewards/RewardsPlatformModel.d.ts +15 -15
  278. package/sdk/platform/Rewards/RewardsPlatformModel.js +92 -194
  279. package/sdk/platform/Share/SharePlatformApplicationClient.d.ts +16 -12
  280. package/sdk/platform/Share/SharePlatformApplicationClient.js +130 -52
  281. package/sdk/platform/Share/SharePlatformApplicationValidator.d.ts +1 -1
  282. package/sdk/platform/Share/SharePlatformApplicationValidator.js +6 -6
  283. package/sdk/platform/Share/SharePlatformModel.d.ts +8 -8
  284. package/sdk/platform/Share/SharePlatformModel.js +60 -118
  285. package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +148 -124
  286. package/sdk/platform/Theme/ThemePlatformApplicationClient.js +770 -295
  287. package/sdk/platform/Theme/ThemePlatformApplicationValidator.d.ts +15 -15
  288. package/sdk/platform/Theme/ThemePlatformApplicationValidator.js +44 -44
  289. package/sdk/platform/Theme/ThemePlatformModel.d.ts +34 -34
  290. package/sdk/platform/Theme/ThemePlatformModel.js +190 -336
  291. package/sdk/platform/User/UserPlatformApplicationClient.d.ts +146 -67
  292. package/sdk/platform/User/UserPlatformApplicationClient.js +742 -155
  293. package/sdk/platform/User/UserPlatformApplicationValidator.d.ts +12 -7
  294. package/sdk/platform/User/UserPlatformApplicationValidator.js +61 -23
  295. package/sdk/platform/User/UserPlatformModel.d.ts +79 -72
  296. package/sdk/platform/User/UserPlatformModel.js +440 -689
  297. package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +35 -29
  298. package/sdk/platform/Webhook/WebhookPlatformClient.js +218 -91
  299. package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +7 -7
  300. package/sdk/platform/Webhook/WebhookPlatformModel.js +68 -136
  301. package/sdk/platform/Webhook/WebhookPlatformValidator.d.ts +3 -3
  302. package/sdk/platform/Webhook/WebhookPlatformValidator.js +14 -14
  303. package/sdk/public/Configuration/ConfigurationPublicClient.d.ts +13 -13
  304. package/sdk/public/Configuration/ConfigurationPublicClient.js +81 -38
  305. package/sdk/public/Configuration/ConfigurationPublicModel.d.ts +12 -12
  306. package/sdk/public/Configuration/ConfigurationPublicModel.js +85 -162
  307. package/sdk/public/Configuration/ConfigurationPublicValidator.d.ts +1 -1
  308. package/sdk/public/Configuration/ConfigurationPublicValidator.js +6 -6
  309. package/sdk/public/Inventory/InventoryPublicClient.d.ts +34 -34
  310. package/sdk/public/Inventory/InventoryPublicClient.js +228 -105
  311. package/sdk/public/Inventory/InventoryPublicModel.d.ts +10 -10
  312. package/sdk/public/Inventory/InventoryPublicModel.js +119 -245
  313. package/sdk/public/Inventory/InventoryPublicValidator.d.ts +3 -3
  314. package/sdk/public/Inventory/InventoryPublicValidator.js +15 -15
  315. package/sdk/public/Webhook/WebhookPublicClient.js +51 -10
  316. package/sdk/public/Webhook/WebhookPublicModel.d.ts +7 -7
  317. package/sdk/public/Webhook/WebhookPublicModel.js +68 -136
  318. package/tests/application/catalog.spec.js +7 -0
@@ -2,6 +2,8 @@ const Paginator = require("../../common/Paginator");
2
2
  const PlatformAPIClient = require("../PlatformAPIClient");
3
3
  const { FDKClientValidationError } = require("../../common/FDKError");
4
4
  const LeadValidator = require("./LeadPlatformApplicationValidator");
5
+ const LeadModel = require("./LeadPlatformModel");
6
+ const { Logger } = require("./../../common/Logger");
5
7
 
6
8
  class Lead {
7
9
  constructor(config, applicationId) {
@@ -11,26 +13,15 @@ class Lead {
11
13
 
12
14
  /**
13
15
  * @param {Object} arg - Arg object.
14
- * @param {boolean} [arg.items] - Decides that the reponse will contain the
15
- * list of tickets
16
- * @param {boolean} [arg.filters] - Decides that the reponse will contain
17
- * the ticket filters
18
- * @param {string} [arg.q] - Search through ticket titles and description
19
- * @param {string} [arg.status] - Filter tickets on status
20
- * @param {PriorityEnum} [arg.priority] - Filter tickets on priority
21
- * @param {string} [arg.category] - Filter tickets on category
22
- * @summary: Gets the list of Application level Tickets and/or ticket filters depending on query params
23
- * @description: Gets the list of Application level Tickets and/or ticket filters
16
+ * @param {string} arg.uniqueName - Unique name of Video Room
17
+ * @returns {Promise<CloseVideoRoomResponse>} - Success response
18
+ * @summary: Close the video room and force all participants to leave.
19
+ * @description: Close the video room and force all participants to leave.
24
20
  */
25
- getTickets({ items, filters, q, status, priority, category } = {}) {
26
- const { error } = LeadValidator.getTickets().validate(
21
+ async closeVideoRoom({ uniqueName } = {}) {
22
+ const { error } = LeadValidator.closeVideoRoom().validate(
27
23
  {
28
- items,
29
- filters,
30
- q,
31
- status,
32
- priority,
33
- category,
24
+ uniqueName,
34
25
  },
35
26
  { abortEarly: false, allowUnknown: true }
36
27
  );
@@ -39,49 +30,59 @@ class Lead {
39
30
  }
40
31
 
41
32
  // Showing warrnings if extra unknown parameters are found
42
- const { error: warrning } = LeadValidator.getTickets().validate(
33
+ const { error: warrning } = LeadValidator.closeVideoRoom().validate(
43
34
  {
44
- items,
45
- filters,
46
- q,
47
- status,
48
- priority,
49
- category,
35
+ uniqueName,
50
36
  },
51
37
  { abortEarly: false, allowUnknown: false }
52
38
  );
53
39
  if (warrning) {
54
- console.log("Parameter Validation warrnings for getTickets");
55
- console.log(warrning);
40
+ Logger({
41
+ level: "WARN",
42
+ message: "Parameter Validation warrnings for closeVideoRoom",
43
+ });
44
+ Logger({ level: "WARN", message: warrning });
56
45
  }
57
46
 
58
47
  const query_params = {};
59
- query_params["items"] = items;
60
- query_params["filters"] = filters;
61
- query_params["q"] = q;
62
- query_params["status"] = status;
63
- query_params["priority"] = priority;
64
- query_params["category"] = category;
65
48
 
66
- return PlatformAPIClient.execute(
49
+ const response = await PlatformAPIClient.execute(
67
50
  this.config,
68
- "get",
69
- `/service/platform/lead/v1.0/company/${this.config.companyId}/application/${this.applicationId}/ticket`,
51
+ "delete",
52
+ `/service/platform/lead/v1.0/company/${this.config.companyId}/application/${this.applicationId}/video/room/${uniqueName}`,
70
53
  query_params,
71
54
  undefined
72
55
  );
56
+
57
+ const {
58
+ error: res_error,
59
+ } = LeadModel.CloseVideoRoomResponse().validate(response, {
60
+ abortEarly: false,
61
+ allowUnknown: false,
62
+ });
63
+
64
+ if (res_error) {
65
+ Logger({
66
+ level: "WARN",
67
+ message: "Response Validation Warnnings for closeVideoRoom",
68
+ });
69
+ Logger({ level: "WARN", message: res_error });
70
+ }
71
+
72
+ return response;
73
73
  }
74
74
 
75
75
  /**
76
76
  * @param {Object} arg - Arg object.
77
- * @param {string} arg.id - Tiket ID of the ticket to be fetched
78
- * @summary: Retreives ticket details of a application level ticket
79
- * @description: Retreives ticket details of a application level ticket with ticket ID
77
+ * @param {CreateCustomFormPayload} arg.body
78
+ * @returns {Promise<CustomForm>} - Success response
79
+ * @summary: Creates a new custom form
80
+ * @description: Creates a new custom form for given application
80
81
  */
81
- getTicket({ id } = {}) {
82
- const { error } = LeadValidator.getTicket().validate(
82
+ async createCustomForm({ body } = {}) {
83
+ const { error } = LeadValidator.createCustomForm().validate(
83
84
  {
84
- id,
85
+ body,
85
86
  },
86
87
  { abortEarly: false, allowUnknown: true }
87
88
  );
@@ -90,37 +91,56 @@ class Lead {
90
91
  }
91
92
 
92
93
  // Showing warrnings if extra unknown parameters are found
93
- const { error: warrning } = LeadValidator.getTicket().validate(
94
+ const { error: warrning } = LeadValidator.createCustomForm().validate(
94
95
  {
95
- id,
96
+ body,
96
97
  },
97
98
  { abortEarly: false, allowUnknown: false }
98
99
  );
99
100
  if (warrning) {
100
- console.log("Parameter Validation warrnings for getTicket");
101
- console.log(warrning);
101
+ Logger({
102
+ level: "WARN",
103
+ message: "Parameter Validation warrnings for createCustomForm",
104
+ });
105
+ Logger({ level: "WARN", message: warrning });
102
106
  }
103
107
 
104
108
  const query_params = {};
105
109
 
106
- return PlatformAPIClient.execute(
110
+ const response = await PlatformAPIClient.execute(
107
111
  this.config,
108
- "get",
109
- `/service/platform/lead/v1.0/company/${this.config.companyId}/application/${this.applicationId}/ticket/${id}`,
112
+ "post",
113
+ `/service/platform/lead/v1.0/company/${this.config.companyId}/application/${this.applicationId}/form`,
110
114
  query_params,
111
- undefined
115
+ body
112
116
  );
117
+
118
+ const { error: res_error } = LeadModel.CustomForm().validate(response, {
119
+ abortEarly: false,
120
+ allowUnknown: false,
121
+ });
122
+
123
+ if (res_error) {
124
+ Logger({
125
+ level: "WARN",
126
+ message: "Response Validation Warnnings for createCustomForm",
127
+ });
128
+ Logger({ level: "WARN", message: res_error });
129
+ }
130
+
131
+ return response;
113
132
  }
114
133
 
115
134
  /**
116
135
  * @param {Object} arg - Arg object.
117
- * @param {string} arg.id - Ticket ID of ticket to be edited
118
- * @param {EditTicketPayload} arg.body
119
- * @summary: Edits ticket details of a application level ticket
120
- * @description: Edits ticket details of a application level ticket such as status, priority, category, tags, attachments, assigne & ticket content changes
136
+ * @param {string} arg.id - Ticket ID for which history is created
137
+ * @param {TicketHistoryPayload} arg.body
138
+ * @returns {Promise<TicketHistory>} - Success response
139
+ * @summary: Create history for specific application level ticket
140
+ * @description: Create history for specific application level ticket, this history is seen on ticket detail page, this can be comment, log or rating.
121
141
  */
122
- editTicket({ id, body } = {}) {
123
- const { error } = LeadValidator.editTicket().validate(
142
+ async createHistory({ id, body } = {}) {
143
+ const { error } = LeadValidator.createHistory().validate(
124
144
  {
125
145
  id,
126
146
  body,
@@ -132,7 +152,7 @@ class Lead {
132
152
  }
133
153
 
134
154
  // Showing warrnings if extra unknown parameters are found
135
- const { error: warrning } = LeadValidator.editTicket().validate(
155
+ const { error: warrning } = LeadValidator.createHistory().validate(
136
156
  {
137
157
  id,
138
158
  body,
@@ -140,32 +160,51 @@ class Lead {
140
160
  { abortEarly: false, allowUnknown: false }
141
161
  );
142
162
  if (warrning) {
143
- console.log("Parameter Validation warrnings for editTicket");
144
- console.log(warrning);
163
+ Logger({
164
+ level: "WARN",
165
+ message: "Parameter Validation warrnings for createHistory",
166
+ });
167
+ Logger({ level: "WARN", message: warrning });
145
168
  }
146
169
 
147
170
  const query_params = {};
148
171
 
149
- return PlatformAPIClient.execute(
172
+ const response = await PlatformAPIClient.execute(
150
173
  this.config,
151
- "put",
152
- `/service/platform/lead/v1.0/company/${this.config.companyId}/application/${this.applicationId}/ticket/${id}`,
174
+ "post",
175
+ `/service/platform/lead/v1.0/company/${this.config.companyId}/application/${this.applicationId}/ticket/${id}/history`,
153
176
  query_params,
154
177
  body
155
178
  );
179
+
180
+ const { error: res_error } = LeadModel.TicketHistory().validate(response, {
181
+ abortEarly: false,
182
+ allowUnknown: false,
183
+ });
184
+
185
+ if (res_error) {
186
+ Logger({
187
+ level: "WARN",
188
+ message: "Response Validation Warnnings for createHistory",
189
+ });
190
+ Logger({ level: "WARN", message: res_error });
191
+ }
192
+
193
+ return response;
156
194
  }
157
195
 
158
196
  /**
159
197
  * @param {Object} arg - Arg object.
160
- * @param {string} arg.id - Ticket ID for which history is created
161
- * @param {TicketHistoryPayload} arg.body
162
- * @summary: Create history for specific application level ticket
163
- * @description: Create history for specific application level ticket, this history is seen on ticket detail page, this can be comment, log or rating.
198
+ * @param {string} arg.slug - Slug of form whose response is getting submitted
199
+ * @param {EditCustomFormPayload} arg.body
200
+ * @returns {Promise<CustomForm>} - Success response
201
+ * @summary: Edit the given custom form
202
+ * @description: Edit the given custom form field such as adding or deleting input, assignee, title, decription, notification and polling information.
164
203
  */
165
- createHistory({ id, body } = {}) {
166
- const { error } = LeadValidator.createHistory().validate(
204
+ async editCustomForm({ slug, body } = {}) {
205
+ const { error } = LeadValidator.editCustomForm().validate(
167
206
  {
168
- id,
207
+ slug,
169
208
  body,
170
209
  },
171
210
  { abortEarly: false, allowUnknown: true }
@@ -175,39 +214,60 @@ class Lead {
175
214
  }
176
215
 
177
216
  // Showing warrnings if extra unknown parameters are found
178
- const { error: warrning } = LeadValidator.createHistory().validate(
217
+ const { error: warrning } = LeadValidator.editCustomForm().validate(
179
218
  {
180
- id,
219
+ slug,
181
220
  body,
182
221
  },
183
222
  { abortEarly: false, allowUnknown: false }
184
223
  );
185
224
  if (warrning) {
186
- console.log("Parameter Validation warrnings for createHistory");
187
- console.log(warrning);
225
+ Logger({
226
+ level: "WARN",
227
+ message: "Parameter Validation warrnings for editCustomForm",
228
+ });
229
+ Logger({ level: "WARN", message: warrning });
188
230
  }
189
231
 
190
232
  const query_params = {};
191
233
 
192
- return PlatformAPIClient.execute(
234
+ const response = await PlatformAPIClient.execute(
193
235
  this.config,
194
- "post",
195
- `/service/platform/lead/v1.0/company/${this.config.companyId}/application/${this.applicationId}/ticket/${id}/history`,
236
+ "put",
237
+ `/service/platform/lead/v1.0/company/${this.config.companyId}/application/${this.applicationId}/form/${slug}`,
196
238
  query_params,
197
239
  body
198
240
  );
241
+
242
+ const { error: res_error } = LeadModel.CustomForm().validate(response, {
243
+ abortEarly: false,
244
+ allowUnknown: false,
245
+ });
246
+
247
+ if (res_error) {
248
+ Logger({
249
+ level: "WARN",
250
+ message: "Response Validation Warnnings for editCustomForm",
251
+ });
252
+ Logger({ level: "WARN", message: res_error });
253
+ }
254
+
255
+ return response;
199
256
  }
200
257
 
201
258
  /**
202
259
  * @param {Object} arg - Arg object.
203
- * @param {string} arg.id - Ticket ID for which history is to be fetched
204
- * @summary: Gets history list for specific application level ticket
205
- * @description: Gets history list for specific application level ticket, this history is seen on ticket detail page, this can be comment, log or rating.
260
+ * @param {string} arg.id - Ticket ID of ticket to be edited
261
+ * @param {EditTicketPayload} arg.body
262
+ * @returns {Promise<Ticket>} - Success response
263
+ * @summary: Edits ticket details of a application level ticket
264
+ * @description: Edits ticket details of a application level ticket such as status, priority, category, tags, attachments, assigne & ticket content changes
206
265
  */
207
- getTicketHistory({ id } = {}) {
208
- const { error } = LeadValidator.getTicketHistory().validate(
266
+ async editTicket({ id, body } = {}) {
267
+ const { error } = LeadValidator.editTicket().validate(
209
268
  {
210
269
  id,
270
+ body,
211
271
  },
212
272
  { abortEarly: false, allowUnknown: true }
213
273
  );
@@ -216,35 +276,55 @@ class Lead {
216
276
  }
217
277
 
218
278
  // Showing warrnings if extra unknown parameters are found
219
- const { error: warrning } = LeadValidator.getTicketHistory().validate(
279
+ const { error: warrning } = LeadValidator.editTicket().validate(
220
280
  {
221
281
  id,
282
+ body,
222
283
  },
223
284
  { abortEarly: false, allowUnknown: false }
224
285
  );
225
286
  if (warrning) {
226
- console.log("Parameter Validation warrnings for getTicketHistory");
227
- console.log(warrning);
287
+ Logger({
288
+ level: "WARN",
289
+ message: "Parameter Validation warrnings for editTicket",
290
+ });
291
+ Logger({ level: "WARN", message: warrning });
228
292
  }
229
293
 
230
294
  const query_params = {};
231
295
 
232
- return PlatformAPIClient.execute(
296
+ const response = await PlatformAPIClient.execute(
233
297
  this.config,
234
- "get",
235
- `/service/platform/lead/v1.0/company/${this.config.companyId}/application/${this.applicationId}/ticket/${id}/history`,
298
+ "put",
299
+ `/service/platform/lead/v1.0/company/${this.config.companyId}/application/${this.applicationId}/ticket/${id}`,
236
300
  query_params,
237
- undefined
301
+ body
238
302
  );
303
+
304
+ const { error: res_error } = LeadModel.Ticket().validate(response, {
305
+ abortEarly: false,
306
+ allowUnknown: false,
307
+ });
308
+
309
+ if (res_error) {
310
+ Logger({
311
+ level: "WARN",
312
+ message: "Response Validation Warnnings for editTicket",
313
+ });
314
+ Logger({ level: "WARN", message: res_error });
315
+ }
316
+
317
+ return response;
239
318
  }
240
319
 
241
320
  /**
242
321
  * @param {Object} arg - Arg object.
243
322
  * @param {string} arg.slug - Slug of form whose response is getting submitted
323
+ * @returns {Promise<CustomForm>} - Success response
244
324
  * @summary: Get specific custom form using it's slug
245
325
  * @description: Get specific custom form using it's slug, this is used to view the form.
246
326
  */
247
- getCustomForm({ slug } = {}) {
327
+ async getCustomForm({ slug } = {}) {
248
328
  const { error } = LeadValidator.getCustomForm().validate(
249
329
  {
250
330
  slug,
@@ -263,33 +343,104 @@ class Lead {
263
343
  { abortEarly: false, allowUnknown: false }
264
344
  );
265
345
  if (warrning) {
266
- console.log("Parameter Validation warrnings for getCustomForm");
267
- console.log(warrning);
346
+ Logger({
347
+ level: "WARN",
348
+ message: "Parameter Validation warrnings for getCustomForm",
349
+ });
350
+ Logger({ level: "WARN", message: warrning });
268
351
  }
269
352
 
270
353
  const query_params = {};
271
354
 
272
- return PlatformAPIClient.execute(
355
+ const response = await PlatformAPIClient.execute(
273
356
  this.config,
274
357
  "get",
275
358
  `/service/platform/lead/v1.0/company/${this.config.companyId}/application/${this.applicationId}/form/${slug}`,
276
359
  query_params,
277
360
  undefined
278
361
  );
362
+
363
+ const { error: res_error } = LeadModel.CustomForm().validate(response, {
364
+ abortEarly: false,
365
+ allowUnknown: false,
366
+ });
367
+
368
+ if (res_error) {
369
+ Logger({
370
+ level: "WARN",
371
+ message: "Response Validation Warnnings for getCustomForm",
372
+ });
373
+ Logger({ level: "WARN", message: res_error });
374
+ }
375
+
376
+ return response;
279
377
  }
280
378
 
281
379
  /**
282
380
  * @param {Object} arg - Arg object.
283
- * @param {string} arg.slug - Slug of form whose response is getting submitted
284
- * @param {EditCustomFormPayload} arg.body
285
- * @summary: Edit the given custom form
286
- * @description: Edit the given custom form field such as adding or deleting input, assignee, title, decription, notification and polling information.
381
+ * @returns {Promise<CustomFormList>} - Success response
382
+ * @summary: Get list of custom form
383
+ * @description: Get list of custom form for given application
287
384
  */
288
- editCustomForm({ slug, body } = {}) {
289
- const { error } = LeadValidator.editCustomForm().validate(
385
+ async getCustomForms({} = {}) {
386
+ const { error } = LeadValidator.getCustomForms().validate(
387
+ {},
388
+ { abortEarly: false, allowUnknown: true }
389
+ );
390
+ if (error) {
391
+ return Promise.reject(new FDKClientValidationError(error));
392
+ }
393
+
394
+ // Showing warrnings if extra unknown parameters are found
395
+ const { error: warrning } = LeadValidator.getCustomForms().validate(
396
+ {},
397
+ { abortEarly: false, allowUnknown: false }
398
+ );
399
+ if (warrning) {
400
+ Logger({
401
+ level: "WARN",
402
+ message: "Parameter Validation warrnings for getCustomForms",
403
+ });
404
+ Logger({ level: "WARN", message: warrning });
405
+ }
406
+
407
+ const query_params = {};
408
+
409
+ const response = await PlatformAPIClient.execute(
410
+ this.config,
411
+ "get",
412
+ `/service/platform/lead/v1.0/company/${this.config.companyId}/application/${this.applicationId}/form`,
413
+ query_params,
414
+ undefined
415
+ );
416
+
417
+ const { error: res_error } = LeadModel.CustomFormList().validate(response, {
418
+ abortEarly: false,
419
+ allowUnknown: false,
420
+ });
421
+
422
+ if (res_error) {
423
+ Logger({
424
+ level: "WARN",
425
+ message: "Response Validation Warnnings for getCustomForms",
426
+ });
427
+ Logger({ level: "WARN", message: res_error });
428
+ }
429
+
430
+ return response;
431
+ }
432
+
433
+ /**
434
+ * @param {Object} arg - Arg object.
435
+ * @param {string} arg.id - Tiket ID of the ticket to be fetched
436
+ * @returns {Promise<Ticket>} - Success response
437
+ * @summary: Retreives ticket details of a application level ticket
438
+ * @description: Retreives ticket details of a application level ticket with ticket ID
439
+ */
440
+ async getTicket({ id } = {}) {
441
+ const { error } = LeadValidator.getTicket().validate(
290
442
  {
291
- slug,
292
- body,
443
+ id,
293
444
  },
294
445
  { abortEarly: false, allowUnknown: true }
295
446
  );
@@ -298,37 +449,58 @@ class Lead {
298
449
  }
299
450
 
300
451
  // Showing warrnings if extra unknown parameters are found
301
- const { error: warrning } = LeadValidator.editCustomForm().validate(
452
+ const { error: warrning } = LeadValidator.getTicket().validate(
302
453
  {
303
- slug,
304
- body,
454
+ id,
305
455
  },
306
456
  { abortEarly: false, allowUnknown: false }
307
457
  );
308
458
  if (warrning) {
309
- console.log("Parameter Validation warrnings for editCustomForm");
310
- console.log(warrning);
459
+ Logger({
460
+ level: "WARN",
461
+ message: "Parameter Validation warrnings for getTicket",
462
+ });
463
+ Logger({ level: "WARN", message: warrning });
311
464
  }
312
465
 
313
466
  const query_params = {};
314
467
 
315
- return PlatformAPIClient.execute(
468
+ const response = await PlatformAPIClient.execute(
316
469
  this.config,
317
- "put",
318
- `/service/platform/lead/v1.0/company/${this.config.companyId}/application/${this.applicationId}/form/${slug}`,
470
+ "get",
471
+ `/service/platform/lead/v1.0/company/${this.config.companyId}/application/${this.applicationId}/ticket/${id}`,
319
472
  query_params,
320
- body
473
+ undefined
321
474
  );
475
+
476
+ const { error: res_error } = LeadModel.Ticket().validate(response, {
477
+ abortEarly: false,
478
+ allowUnknown: false,
479
+ });
480
+
481
+ if (res_error) {
482
+ Logger({
483
+ level: "WARN",
484
+ message: "Response Validation Warnnings for getTicket",
485
+ });
486
+ Logger({ level: "WARN", message: res_error });
487
+ }
488
+
489
+ return response;
322
490
  }
323
491
 
324
492
  /**
325
493
  * @param {Object} arg - Arg object.
326
- * @summary: Get list of custom form
327
- * @description: Get list of custom form for given application
494
+ * @param {string} arg.id - Ticket ID for which history is to be fetched
495
+ * @returns {Promise<TicketHistoryList>} - Success response
496
+ * @summary: Gets history list for specific application level ticket
497
+ * @description: Gets history list for specific application level ticket, this history is seen on ticket detail page, this can be comment, log or rating.
328
498
  */
329
- getCustomForms({} = {}) {
330
- const { error } = LeadValidator.getCustomForms().validate(
331
- {},
499
+ async getTicketHistory({ id } = {}) {
500
+ const { error } = LeadValidator.getTicketHistory().validate(
501
+ {
502
+ id,
503
+ },
332
504
  { abortEarly: false, allowUnknown: true }
333
505
  );
334
506
  if (error) {
@@ -336,36 +508,71 @@ class Lead {
336
508
  }
337
509
 
338
510
  // Showing warrnings if extra unknown parameters are found
339
- const { error: warrning } = LeadValidator.getCustomForms().validate(
340
- {},
511
+ const { error: warrning } = LeadValidator.getTicketHistory().validate(
512
+ {
513
+ id,
514
+ },
341
515
  { abortEarly: false, allowUnknown: false }
342
516
  );
343
517
  if (warrning) {
344
- console.log("Parameter Validation warrnings for getCustomForms");
345
- console.log(warrning);
518
+ Logger({
519
+ level: "WARN",
520
+ message: "Parameter Validation warrnings for getTicketHistory",
521
+ });
522
+ Logger({ level: "WARN", message: warrning });
346
523
  }
347
524
 
348
525
  const query_params = {};
349
526
 
350
- return PlatformAPIClient.execute(
527
+ const response = await PlatformAPIClient.execute(
351
528
  this.config,
352
529
  "get",
353
- `/service/platform/lead/v1.0/company/${this.config.companyId}/application/${this.applicationId}/form`,
530
+ `/service/platform/lead/v1.0/company/${this.config.companyId}/application/${this.applicationId}/ticket/${id}/history`,
354
531
  query_params,
355
532
  undefined
356
533
  );
534
+
535
+ const {
536
+ error: res_error,
537
+ } = LeadModel.TicketHistoryList().validate(response, {
538
+ abortEarly: false,
539
+ allowUnknown: false,
540
+ });
541
+
542
+ if (res_error) {
543
+ Logger({
544
+ level: "WARN",
545
+ message: "Response Validation Warnnings for getTicketHistory",
546
+ });
547
+ Logger({ level: "WARN", message: res_error });
548
+ }
549
+
550
+ return response;
357
551
  }
358
552
 
359
553
  /**
360
554
  * @param {Object} arg - Arg object.
361
- * @param {CreateCustomFormPayload} arg.body
362
- * @summary: Creates a new custom form
363
- * @description: Creates a new custom form for given application
555
+ * @param {boolean} [arg.items] - Decides that the reponse will contain the
556
+ * list of tickets
557
+ * @param {boolean} [arg.filters] - Decides that the reponse will contain
558
+ * the ticket filters
559
+ * @param {string} [arg.q] - Search through ticket titles and description
560
+ * @param {string} [arg.status] - Filter tickets on status
561
+ * @param {PriorityEnum} [arg.priority] - Filter tickets on priority
562
+ * @param {string} [arg.category] - Filter tickets on category
563
+ * @returns {Promise<TicketList>} - Success response
564
+ * @summary: Gets the list of Application level Tickets and/or ticket filters depending on query params
565
+ * @description: Gets the list of Application level Tickets and/or ticket filters
364
566
  */
365
- createCustomForm({ body } = {}) {
366
- const { error } = LeadValidator.createCustomForm().validate(
567
+ async getTickets({ items, filters, q, status, priority, category } = {}) {
568
+ const { error } = LeadValidator.getTickets().validate(
367
569
  {
368
- body,
570
+ items,
571
+ filters,
572
+ q,
573
+ status,
574
+ priority,
575
+ category,
369
576
  },
370
577
  { abortEarly: false, allowUnknown: true }
371
578
  );
@@ -374,35 +581,65 @@ class Lead {
374
581
  }
375
582
 
376
583
  // Showing warrnings if extra unknown parameters are found
377
- const { error: warrning } = LeadValidator.createCustomForm().validate(
584
+ const { error: warrning } = LeadValidator.getTickets().validate(
378
585
  {
379
- body,
586
+ items,
587
+ filters,
588
+ q,
589
+ status,
590
+ priority,
591
+ category,
380
592
  },
381
593
  { abortEarly: false, allowUnknown: false }
382
594
  );
383
595
  if (warrning) {
384
- console.log("Parameter Validation warrnings for createCustomForm");
385
- console.log(warrning);
596
+ Logger({
597
+ level: "WARN",
598
+ message: "Parameter Validation warrnings for getTickets",
599
+ });
600
+ Logger({ level: "WARN", message: warrning });
386
601
  }
387
602
 
388
603
  const query_params = {};
604
+ query_params["items"] = items;
605
+ query_params["filters"] = filters;
606
+ query_params["q"] = q;
607
+ query_params["status"] = status;
608
+ query_params["priority"] = priority;
609
+ query_params["category"] = category;
389
610
 
390
- return PlatformAPIClient.execute(
611
+ const response = await PlatformAPIClient.execute(
391
612
  this.config,
392
- "post",
393
- `/service/platform/lead/v1.0/company/${this.config.companyId}/application/${this.applicationId}/form`,
613
+ "get",
614
+ `/service/platform/lead/v1.0/company/${this.config.companyId}/application/${this.applicationId}/ticket`,
394
615
  query_params,
395
- body
616
+ undefined
396
617
  );
618
+
619
+ const { error: res_error } = LeadModel.TicketList().validate(response, {
620
+ abortEarly: false,
621
+ allowUnknown: false,
622
+ });
623
+
624
+ if (res_error) {
625
+ Logger({
626
+ level: "WARN",
627
+ message: "Response Validation Warnnings for getTickets",
628
+ });
629
+ Logger({ level: "WARN", message: res_error });
630
+ }
631
+
632
+ return response;
397
633
  }
398
634
 
399
635
  /**
400
636
  * @param {Object} arg - Arg object.
401
637
  * @param {string} arg.uniqueName - Unique name of video room
638
+ * @returns {Promise<GetTokenForVideoRoomResponse>} - Success response
402
639
  * @summary: Get Token to join a specific Video Room using it's unqiue name
403
640
  * @description: Get Token to join a specific Video Room using it's unqiue name, this Token is your ticket to Room and also creates your identity there.
404
641
  */
405
- getTokenForVideoRoom({ uniqueName } = {}) {
642
+ async getTokenForVideoRoom({ uniqueName } = {}) {
406
643
  const { error } = LeadValidator.getTokenForVideoRoom().validate(
407
644
  {
408
645
  uniqueName,
@@ -421,28 +658,49 @@ class Lead {
421
658
  { abortEarly: false, allowUnknown: false }
422
659
  );
423
660
  if (warrning) {
424
- console.log("Parameter Validation warrnings for getTokenForVideoRoom");
425
- console.log(warrning);
661
+ Logger({
662
+ level: "WARN",
663
+ message: "Parameter Validation warrnings for getTokenForVideoRoom",
664
+ });
665
+ Logger({ level: "WARN", message: warrning });
426
666
  }
427
667
 
428
668
  const query_params = {};
429
669
 
430
- return PlatformAPIClient.execute(
670
+ const response = await PlatformAPIClient.execute(
431
671
  this.config,
432
672
  "get",
433
673
  `/service/platform/lead/v1.0/company/${this.config.companyId}/application/${this.applicationId}/video/room/${uniqueName}/token`,
434
674
  query_params,
435
675
  undefined
436
676
  );
677
+
678
+ const {
679
+ error: res_error,
680
+ } = LeadModel.GetTokenForVideoRoomResponse().validate(response, {
681
+ abortEarly: false,
682
+ allowUnknown: false,
683
+ });
684
+
685
+ if (res_error) {
686
+ Logger({
687
+ level: "WARN",
688
+ message: "Response Validation Warnnings for getTokenForVideoRoom",
689
+ });
690
+ Logger({ level: "WARN", message: res_error });
691
+ }
692
+
693
+ return response;
437
694
  }
438
695
 
439
696
  /**
440
697
  * @param {Object} arg - Arg object.
441
698
  * @param {string} arg.uniqueName - Unique name of Video Room
699
+ * @returns {Promise<GetParticipantsInsideVideoRoomResponse>} - Success response
442
700
  * @summary: Get participants of a specific Video Room using it's unique name
443
701
  * @description: Get participants of a specific Video Room using it's unique name, this can be used to check if people are already there in the room and also to show their names.
444
702
  */
445
- getVideoParticipants({ uniqueName } = {}) {
703
+ async getVideoParticipants({ uniqueName } = {}) {
446
704
  const { error } = LeadValidator.getVideoParticipants().validate(
447
705
  {
448
706
  uniqueName,
@@ -461,28 +719,49 @@ class Lead {
461
719
  { abortEarly: false, allowUnknown: false }
462
720
  );
463
721
  if (warrning) {
464
- console.log("Parameter Validation warrnings for getVideoParticipants");
465
- console.log(warrning);
722
+ Logger({
723
+ level: "WARN",
724
+ message: "Parameter Validation warrnings for getVideoParticipants",
725
+ });
726
+ Logger({ level: "WARN", message: warrning });
466
727
  }
467
728
 
468
729
  const query_params = {};
469
730
 
470
- return PlatformAPIClient.execute(
731
+ const response = await PlatformAPIClient.execute(
471
732
  this.config,
472
733
  "get",
473
734
  `/service/platform/lead/v1.0/company/${this.config.companyId}/application/${this.applicationId}/video/room/${uniqueName}/participants`,
474
735
  query_params,
475
736
  undefined
476
737
  );
738
+
739
+ const {
740
+ error: res_error,
741
+ } = LeadModel.GetParticipantsInsideVideoRoomResponse().validate(response, {
742
+ abortEarly: false,
743
+ allowUnknown: false,
744
+ });
745
+
746
+ if (res_error) {
747
+ Logger({
748
+ level: "WARN",
749
+ message: "Response Validation Warnnings for getVideoParticipants",
750
+ });
751
+ Logger({ level: "WARN", message: res_error });
752
+ }
753
+
754
+ return response;
477
755
  }
478
756
 
479
757
  /**
480
758
  * @param {Object} arg - Arg object.
481
759
  * @param {CreateVideoRoomPayload} arg.body
760
+ * @returns {Promise<CreateVideoRoomResponse>} - Success response
482
761
  * @summary: Open a video room.
483
762
  * @description: Open a video room.
484
763
  */
485
- openVideoRoom({ body } = {}) {
764
+ async openVideoRoom({ body } = {}) {
486
765
  const { error } = LeadValidator.openVideoRoom().validate(
487
766
  {
488
767
  body,
@@ -501,59 +780,39 @@ class Lead {
501
780
  { abortEarly: false, allowUnknown: false }
502
781
  );
503
782
  if (warrning) {
504
- console.log("Parameter Validation warrnings for openVideoRoom");
505
- console.log(warrning);
783
+ Logger({
784
+ level: "WARN",
785
+ message: "Parameter Validation warrnings for openVideoRoom",
786
+ });
787
+ Logger({ level: "WARN", message: warrning });
506
788
  }
507
789
 
508
790
  const query_params = {};
509
791
 
510
- return PlatformAPIClient.execute(
792
+ const response = await PlatformAPIClient.execute(
511
793
  this.config,
512
794
  "post",
513
795
  `/service/platform/lead/v1.0/company/${this.config.companyId}/application/${this.applicationId}/video/room`,
514
796
  query_params,
515
797
  body
516
798
  );
517
- }
518
799
 
519
- /**
520
- * @param {Object} arg - Arg object.
521
- * @param {string} arg.uniqueName - Unique name of Video Room
522
- * @summary: Close the video room and force all participants to leave.
523
- * @description: Close the video room and force all participants to leave.
524
- */
525
- closeVideoRoom({ uniqueName } = {}) {
526
- const { error } = LeadValidator.closeVideoRoom().validate(
527
- {
528
- uniqueName,
529
- },
530
- { abortEarly: false, allowUnknown: true }
531
- );
532
- if (error) {
533
- return Promise.reject(new FDKClientValidationError(error));
534
- }
800
+ const {
801
+ error: res_error,
802
+ } = LeadModel.CreateVideoRoomResponse().validate(response, {
803
+ abortEarly: false,
804
+ allowUnknown: false,
805
+ });
535
806
 
536
- // Showing warrnings if extra unknown parameters are found
537
- const { error: warrning } = LeadValidator.closeVideoRoom().validate(
538
- {
539
- uniqueName,
540
- },
541
- { abortEarly: false, allowUnknown: false }
542
- );
543
- if (warrning) {
544
- console.log("Parameter Validation warrnings for closeVideoRoom");
545
- console.log(warrning);
807
+ if (res_error) {
808
+ Logger({
809
+ level: "WARN",
810
+ message: "Response Validation Warnnings for openVideoRoom",
811
+ });
812
+ Logger({ level: "WARN", message: res_error });
546
813
  }
547
814
 
548
- const query_params = {};
549
-
550
- return PlatformAPIClient.execute(
551
- this.config,
552
- "delete",
553
- `/service/platform/lead/v1.0/company/${this.config.companyId}/application/${this.applicationId}/video/room/${uniqueName}`,
554
- query_params,
555
- undefined
556
- );
815
+ return response;
557
816
  }
558
817
  }
559
818
  module.exports = Lead;