@gofynd/fdk-client-javascript 1.4.2-beta.1 → 1.4.2-beta.10

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 (265) hide show
  1. package/README.md +1 -1
  2. package/package.json +3 -2
  3. package/sdk/application/ApplicationClient.js +20 -0
  4. package/sdk/application/Cart/CartApplicationClient.d.ts +1 -1
  5. package/sdk/application/Cart/CartApplicationClient.js +3 -5
  6. package/sdk/application/Cart/CartApplicationModel.d.ts +1634 -1742
  7. package/sdk/application/Cart/CartApplicationModel.js +1388 -1464
  8. package/sdk/application/Cart/CartApplicationValidator.d.ts +0 -4
  9. package/sdk/application/Cart/CartApplicationValidator.js +0 -4
  10. package/sdk/application/Catalog/CatalogApplicationClient.d.ts +6 -3
  11. package/sdk/application/Catalog/CatalogApplicationClient.js +20 -7
  12. package/sdk/application/Catalog/CatalogApplicationModel.d.ts +1917 -1917
  13. package/sdk/application/Catalog/CatalogApplicationModel.js +1613 -1613
  14. package/sdk/application/Catalog/CatalogApplicationValidator.d.ts +14 -0
  15. package/sdk/application/Catalog/CatalogApplicationValidator.js +6 -0
  16. package/sdk/application/Common/CommonApplicationModel.d.ts +235 -235
  17. package/sdk/application/Common/CommonApplicationModel.js +172 -172
  18. package/sdk/application/Communication/CommunicationApplicationModel.d.ts +72 -72
  19. package/sdk/application/Communication/CommunicationApplicationModel.js +64 -64
  20. package/sdk/application/Configuration/ConfigurationApplicationModel.d.ts +1492 -1626
  21. package/sdk/application/Configuration/ConfigurationApplicationModel.js +1038 -1180
  22. package/sdk/application/Content/ContentApplicationClient.d.ts +0 -36
  23. package/sdk/application/Content/ContentApplicationClient.js +0 -246
  24. package/sdk/application/Content/ContentApplicationModel.d.ts +546 -753
  25. package/sdk/application/Content/ContentApplicationModel.js +565 -817
  26. package/sdk/application/Content/ContentApplicationValidator.d.ts +1 -40
  27. package/sdk/application/Content/ContentApplicationValidator.js +0 -41
  28. package/sdk/application/FileStorage/FileStorageApplicationModel.d.ts +79 -79
  29. package/sdk/application/FileStorage/FileStorageApplicationModel.js +84 -84
  30. package/sdk/application/Lead/LeadApplicationModel.d.ts +417 -417
  31. package/sdk/application/Lead/LeadApplicationModel.js +301 -301
  32. package/sdk/application/Logistic/LogisticApplicationClient.d.ts +0 -67
  33. package/sdk/application/Logistic/LogisticApplicationClient.js +0 -547
  34. package/sdk/application/Logistic/LogisticApplicationModel.d.ts +257 -712
  35. package/sdk/application/Logistic/LogisticApplicationModel.js +267 -755
  36. package/sdk/application/Logistic/LogisticApplicationValidator.d.ts +1 -211
  37. package/sdk/application/Logistic/LogisticApplicationValidator.js +0 -131
  38. package/sdk/application/Order/OrderApplicationClient.d.ts +3 -3
  39. package/sdk/application/Order/OrderApplicationClient.js +8 -32
  40. package/sdk/application/Order/OrderApplicationModel.d.ts +845 -853
  41. package/sdk/application/Order/OrderApplicationModel.js +816 -824
  42. package/sdk/application/Order/OrderApplicationValidator.d.ts +0 -20
  43. package/sdk/application/Order/OrderApplicationValidator.js +0 -8
  44. package/sdk/application/Payment/PaymentApplicationClient.d.ts +2 -46
  45. package/sdk/application/Payment/PaymentApplicationClient.js +10 -341
  46. package/sdk/application/Payment/PaymentApplicationModel.d.ts +1892 -2199
  47. package/sdk/application/Payment/PaymentApplicationModel.js +1235 -1506
  48. package/sdk/application/Payment/PaymentApplicationValidator.d.ts +14 -59
  49. package/sdk/application/Payment/PaymentApplicationValidator.js +10 -64
  50. package/sdk/application/PosCart/PosCartApplicationModel.d.ts +1396 -1429
  51. package/sdk/application/PosCart/PosCartApplicationModel.js +1233 -1257
  52. package/sdk/application/Rewards/RewardsApplicationModel.d.ts +214 -214
  53. package/sdk/application/Rewards/RewardsApplicationModel.js +211 -211
  54. package/sdk/application/Share/ShareApplicationModel.d.ts +114 -114
  55. package/sdk/application/Share/ShareApplicationModel.js +121 -121
  56. package/sdk/application/Theme/ThemeApplicationClient.d.ts +1 -1
  57. package/sdk/application/Theme/ThemeApplicationClient.js +3 -7
  58. package/sdk/application/Theme/ThemeApplicationModel.d.ts +783 -969
  59. package/sdk/application/Theme/ThemeApplicationModel.js +571 -867
  60. package/sdk/application/Theme/ThemeApplicationValidator.d.ts +0 -10
  61. package/sdk/application/Theme/ThemeApplicationValidator.js +0 -4
  62. package/sdk/application/User/UserApplicationClient.d.ts +0 -33
  63. package/sdk/application/User/UserApplicationClient.js +0 -239
  64. package/sdk/application/User/UserApplicationModel.d.ts +753 -768
  65. package/sdk/application/User/UserApplicationModel.js +731 -755
  66. package/sdk/application/User/UserApplicationValidator.d.ts +1 -34
  67. package/sdk/application/User/UserApplicationValidator.js +0 -36
  68. package/sdk/common/Clickstream.d.ts +1 -0
  69. package/sdk/common/Clickstream.js +254 -0
  70. package/sdk/common/Utility.js +1 -4
  71. package/sdk/partner/FileStorage/FileStoragePartnerModel.d.ts +72 -60
  72. package/sdk/partner/FileStorage/FileStoragePartnerModel.js +70 -58
  73. package/sdk/partner/PartnerClient.d.ts +0 -6
  74. package/sdk/partner/PartnerClient.js +0 -9
  75. package/sdk/partner/Theme/ThemePartnerClient.d.ts +0 -10
  76. package/sdk/partner/Theme/ThemePartnerClient.js +0 -80
  77. package/sdk/partner/Theme/ThemePartnerModel.d.ts +1178 -1153
  78. package/sdk/partner/Theme/ThemePartnerModel.js +830 -974
  79. package/sdk/partner/Theme/ThemePartnerValidator.d.ts +0 -1
  80. package/sdk/partner/Theme/ThemePartnerValidator.js +0 -9
  81. package/sdk/partner/index.d.ts +0 -3
  82. package/sdk/partner/index.js +0 -6
  83. package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +2 -2
  84. package/sdk/platform/AuditTrail/AuditTrailPlatformModel.d.ts +123 -123
  85. package/sdk/platform/AuditTrail/AuditTrailPlatformModel.js +109 -109
  86. package/sdk/platform/Billing/BillingPlatformClient.d.ts +1 -11
  87. package/sdk/platform/Billing/BillingPlatformClient.js +3 -110
  88. package/sdk/platform/Billing/BillingPlatformModel.d.ts +734 -800
  89. package/sdk/platform/Billing/BillingPlatformModel.js +732 -810
  90. package/sdk/platform/Billing/BillingPlatformValidator.d.ts +4 -43
  91. package/sdk/platform/Billing/BillingPlatformValidator.js +2 -29
  92. package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +11 -1
  93. package/sdk/platform/Cart/CartPlatformApplicationClient.js +81 -7
  94. package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +13 -5
  95. package/sdk/platform/Cart/CartPlatformApplicationValidator.js +12 -4
  96. package/sdk/platform/Cart/CartPlatformModel.d.ts +3223 -3328
  97. package/sdk/platform/Cart/CartPlatformModel.js +2875 -2946
  98. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +11 -15
  99. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +21 -52
  100. package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +0 -27
  101. package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +0 -11
  102. package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +15 -27
  103. package/sdk/platform/Catalog/CatalogPlatformClient.js +93 -189
  104. package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +617 -920
  105. package/sdk/platform/Catalog/CatalogPlatformModel.js +584 -919
  106. package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +27 -41
  107. package/sdk/platform/Catalog/CatalogPlatformValidator.js +19 -31
  108. package/sdk/platform/Common/CommonPlatformModel.d.ts +255 -255
  109. package/sdk/platform/Common/CommonPlatformModel.js +187 -187
  110. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +37 -139
  111. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +52 -737
  112. package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.d.ts +3 -133
  113. package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.js +1 -113
  114. package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +1079 -1228
  115. package/sdk/platform/Communication/CommunicationPlatformModel.js +1090 -1262
  116. package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +2 -8
  117. package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +4 -32
  118. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +629 -658
  119. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +641 -675
  120. package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.d.ts +0 -14
  121. package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.js +0 -6
  122. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +8 -8
  123. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +4 -4
  124. package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +2992 -3231
  125. package/sdk/platform/Configuration/ConfigurationPlatformModel.js +2092 -2303
  126. package/sdk/platform/Configuration/ConfigurationPlatformValidator.d.ts +2 -2
  127. package/sdk/platform/Configuration/ConfigurationPlatformValidator.js +2 -2
  128. package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +0 -391
  129. package/sdk/platform/Content/ContentPlatformApplicationClient.js +1074 -3656
  130. package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +1 -351
  131. package/sdk/platform/Content/ContentPlatformApplicationValidator.js +0 -410
  132. package/sdk/platform/Content/ContentPlatformModel.d.ts +972 -2071
  133. package/sdk/platform/Content/ContentPlatformModel.js +1039 -2355
  134. package/sdk/platform/Discount/DiscountPlatformClient.d.ts +2 -2
  135. package/sdk/platform/Discount/DiscountPlatformClient.js +2 -2
  136. package/sdk/platform/Discount/DiscountPlatformModel.d.ts +174 -259
  137. package/sdk/platform/Discount/DiscountPlatformModel.js +163 -257
  138. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +6 -16
  139. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +8 -117
  140. package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.d.ts +4 -55
  141. package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.js +2 -39
  142. package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +821 -892
  143. package/sdk/platform/FileStorage/FileStoragePlatformModel.js +833 -901
  144. package/sdk/platform/Finance/FinancePlatformClient.d.ts +0 -33
  145. package/sdk/platform/Finance/FinancePlatformClient.js +0 -240
  146. package/sdk/platform/Finance/FinancePlatformModel.d.ts +910 -1056
  147. package/sdk/platform/Finance/FinancePlatformModel.js +884 -1070
  148. package/sdk/platform/Finance/FinancePlatformValidator.d.ts +1 -38
  149. package/sdk/platform/Finance/FinancePlatformValidator.js +0 -38
  150. package/sdk/platform/Inventory/InventoryPlatformModel.d.ts +942 -942
  151. package/sdk/platform/Inventory/InventoryPlatformModel.js +1003 -1003
  152. package/sdk/platform/Lead/LeadPlatformApplicationClient.d.ts +28 -38
  153. package/sdk/platform/Lead/LeadPlatformApplicationClient.js +56 -137
  154. package/sdk/platform/Lead/LeadPlatformApplicationValidator.d.ts +29 -41
  155. package/sdk/platform/Lead/LeadPlatformApplicationValidator.js +21 -33
  156. package/sdk/platform/Lead/LeadPlatformModel.d.ts +601 -610
  157. package/sdk/platform/Lead/LeadPlatformModel.js +457 -471
  158. package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +1 -11
  159. package/sdk/platform/Order/OrderPlatformApplicationClient.js +1 -93
  160. package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +1 -28
  161. package/sdk/platform/Order/OrderPlatformApplicationValidator.js +0 -18
  162. package/sdk/platform/Order/OrderPlatformClient.d.ts +22 -143
  163. package/sdk/platform/Order/OrderPlatformClient.js +160 -1190
  164. package/sdk/platform/Order/OrderPlatformModel.d.ts +4451 -5275
  165. package/sdk/platform/Order/OrderPlatformModel.js +4039 -4994
  166. package/sdk/platform/Order/OrderPlatformValidator.d.ts +21 -257
  167. package/sdk/platform/Order/OrderPlatformValidator.js +15 -216
  168. package/sdk/platform/Partner/PartnerPlatformModel.d.ts +22 -22
  169. package/sdk/platform/Partner/PartnerPlatformModel.js +22 -22
  170. package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +13 -119
  171. package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +40 -750
  172. package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +7 -143
  173. package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +6 -133
  174. package/sdk/platform/Payment/PaymentPlatformClient.d.ts +1 -1
  175. package/sdk/platform/Payment/PaymentPlatformClient.js +1 -1
  176. package/sdk/platform/Payment/PaymentPlatformModel.d.ts +2067 -2929
  177. package/sdk/platform/Payment/PaymentPlatformModel.js +1427 -2090
  178. package/sdk/platform/PlatformApplicationClient.d.ts +2 -2
  179. package/sdk/platform/PlatformApplicationClient.js +4 -4
  180. package/sdk/platform/PlatformClient.d.ts +2 -4
  181. package/sdk/platform/PlatformClient.js +4 -8
  182. package/sdk/platform/Rewards/RewardsPlatformModel.d.ts +204 -204
  183. package/sdk/platform/Rewards/RewardsPlatformModel.js +199 -199
  184. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.d.ts +66 -142
  185. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.js +147 -645
  186. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.d.ts +63 -131
  187. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.js +47 -126
  188. package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +105 -217
  189. package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +349 -1138
  190. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +989 -1588
  191. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +977 -1695
  192. package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.d.ts +133 -382
  193. package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.js +102 -266
  194. package/sdk/platform/Share/SharePlatformModel.d.ts +147 -147
  195. package/sdk/platform/Share/SharePlatformModel.js +139 -139
  196. package/sdk/platform/Theme/ThemePlatformClient.d.ts +1 -11
  197. package/sdk/platform/Theme/ThemePlatformClient.js +3 -87
  198. package/sdk/platform/Theme/ThemePlatformModel.d.ts +765 -1133
  199. package/sdk/platform/Theme/ThemePlatformModel.js +561 -1009
  200. package/sdk/platform/Theme/ThemePlatformValidator.d.ts +4 -28
  201. package/sdk/platform/Theme/ThemePlatformValidator.js +2 -21
  202. package/sdk/platform/User/UserPlatformApplicationClient.d.ts +1 -116
  203. package/sdk/platform/User/UserPlatformApplicationClient.js +86 -932
  204. package/sdk/platform/User/UserPlatformApplicationValidator.d.ts +7 -224
  205. package/sdk/platform/User/UserPlatformApplicationValidator.js +5 -173
  206. package/sdk/platform/User/UserPlatformModel.d.ts +428 -765
  207. package/sdk/platform/User/UserPlatformModel.js +428 -679
  208. package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +37 -45
  209. package/sdk/platform/Webhook/WebhookPlatformClient.js +57 -61
  210. package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +403 -448
  211. package/sdk/platform/Webhook/WebhookPlatformModel.js +309 -369
  212. package/sdk/platform/Webhook/WebhookPlatformValidator.d.ts +10 -7
  213. package/sdk/platform/Webhook/WebhookPlatformValidator.js +6 -6
  214. package/sdk/platform/index.d.ts +1 -1
  215. package/sdk/platform/index.js +2 -2
  216. package/sdk/public/Configuration/ConfigurationPublicModel.d.ts +237 -237
  217. package/sdk/public/Configuration/ConfigurationPublicModel.js +174 -174
  218. package/sdk/public/Inventory/InventoryPublicModel.d.ts +237 -237
  219. package/sdk/public/Inventory/InventoryPublicModel.js +257 -257
  220. package/sdk/public/Partner/PartnerPublicModel.d.ts +104 -104
  221. package/sdk/public/Partner/PartnerPublicModel.js +113 -113
  222. package/sdk/public/PublicClient.d.ts +0 -4
  223. package/sdk/public/PublicClient.js +0 -8
  224. package/sdk/public/Webhook/WebhookPublicClient.d.ts +0 -33
  225. package/sdk/public/Webhook/WebhookPublicClient.js +0 -242
  226. package/sdk/public/Webhook/WebhookPublicModel.d.ts +15 -161
  227. package/sdk/public/Webhook/WebhookPublicModel.js +13 -189
  228. package/sdk/public/Webhook/WebhookPublicValidator.d.ts +1 -23
  229. package/sdk/public/Webhook/WebhookPublicValidator.js +0 -31
  230. package/sdk/public/index.d.ts +0 -2
  231. package/sdk/public/index.js +0 -4
  232. package/sdk/partner/Lead/LeadPartnerClient.d.ts +0 -125
  233. package/sdk/partner/Lead/LeadPartnerClient.js +0 -785
  234. package/sdk/partner/Lead/LeadPartnerModel.d.ts +0 -1127
  235. package/sdk/partner/Lead/LeadPartnerModel.js +0 -896
  236. package/sdk/partner/Lead/LeadPartnerValidator.d.ts +0 -12
  237. package/sdk/partner/Lead/LeadPartnerValidator.js +0 -67
  238. package/sdk/partner/Logistics/LogisticsPartnerClient.d.ts +0 -155
  239. package/sdk/partner/Logistics/LogisticsPartnerClient.js +0 -1195
  240. package/sdk/partner/Logistics/LogisticsPartnerModel.d.ts +0 -372
  241. package/sdk/partner/Logistics/LogisticsPartnerModel.js +0 -442
  242. package/sdk/partner/Logistics/LogisticsPartnerValidator.d.ts +0 -16
  243. package/sdk/partner/Logistics/LogisticsPartnerValidator.js +0 -123
  244. package/sdk/partner/Webhook/WebhookPartnerClient.d.ts +0 -99
  245. package/sdk/partner/Webhook/WebhookPartnerClient.js +0 -753
  246. package/sdk/partner/Webhook/WebhookPartnerModel.d.ts +0 -566
  247. package/sdk/partner/Webhook/WebhookPartnerModel.js +0 -583
  248. package/sdk/partner/Webhook/WebhookPartnerValidator.d.ts +0 -12
  249. package/sdk/partner/Webhook/WebhookPartnerValidator.js +0 -74
  250. package/sdk/platform/Content/ContentPlatformClient.d.ts +0 -277
  251. package/sdk/platform/Content/ContentPlatformClient.js +0 -2011
  252. package/sdk/platform/Content/ContentPlatformValidator.d.ts +0 -247
  253. package/sdk/platform/Content/ContentPlatformValidator.js +0 -319
  254. package/sdk/public/Billing/BillingPublicClient.d.ts +0 -23
  255. package/sdk/public/Billing/BillingPublicClient.js +0 -116
  256. package/sdk/public/Billing/BillingPublicModel.d.ts +0 -92
  257. package/sdk/public/Billing/BillingPublicModel.js +0 -96
  258. package/sdk/public/Billing/BillingPublicValidator.d.ts +0 -18
  259. package/sdk/public/Billing/BillingPublicValidator.js +0 -19
  260. package/sdk/public/Content/ContentPublicClient.d.ts +0 -22
  261. package/sdk/public/Content/ContentPublicClient.js +0 -114
  262. package/sdk/public/Content/ContentPublicModel.d.ts +0 -53
  263. package/sdk/public/Content/ContentPublicModel.js +0 -60
  264. package/sdk/public/Content/ContentPublicValidator.d.ts +0 -18
  265. package/sdk/public/Content/ContentPublicValidator.js +0 -19
@@ -1,154 +1,116 @@
1
1
  const Joi = require("joi");
2
2
 
3
3
  /**
4
- * @typedef AddTicketPayload
5
- * @property {Object} [_custom_json] - Optional custom data that needs to be sent
6
- * @property {string} category - Category of the ticket
7
- * @property {TicketContent} content
8
- * @property {Object} [created_by] - Creator of the ticket
9
- * @property {PriorityEnum} [priority]
10
- * @property {string} [status] - Status of the ticket
4
+ * @typedef TicketList
5
+ * @property {Ticket[]} [items] - List of tickets
6
+ * @property {Filter} [filters]
7
+ * @property {Page} [page]
11
8
  */
12
9
 
13
10
  /**
14
- * @typedef AgentChangePayload
15
- * @property {string} agent_id - Agent's unique ID
11
+ * @typedef Page
12
+ * @property {number} [item_total]
13
+ * @property {string} [next_id]
14
+ * @property {boolean} [has_previous]
15
+ * @property {boolean} [has_next]
16
+ * @property {number} [current]
17
+ * @property {string} type
18
+ * @property {number} [size]
16
19
  */
17
20
 
18
21
  /**
19
- * @typedef CloseVideoRoomResponse
20
- * @property {boolean} success - Denotes if operation was successfully
22
+ * @typedef TicketHistoryList
23
+ * @property {TicketHistory[]} [items] - List of ticket history
24
+ * @property {Page} [page]
25
+ */
26
+
27
+ /**
28
+ * @typedef CustomFormList
29
+ * @property {CustomForm[]} [items] - List of forms
30
+ * @property {Page} [page]
21
31
  */
22
32
 
23
33
  /**
24
34
  * @typedef CreateCustomFormPayload
35
+ * @property {string} slug - Slug for the form
36
+ * @property {string} title - Title for the form
37
+ * @property {Object[]} inputs - List of all the form components
25
38
  * @property {string} [description] - Description of the form
26
39
  * @property {string} [header_image] - Header image that is to be shown for the form
27
- * @property {Object[]} inputs - List of all the form components
28
- * @property {PollForAssignment} [poll_for_assignment]
29
40
  * @property {PriorityEnum} priority
30
41
  * @property {boolean} [should_notify] - Indicates if staff should be notified
31
42
  * when a response is received
32
- * @property {string} slug - Slug for the form
33
43
  * @property {string} [success_message] - Success message that will be shown on submission
34
- * @property {string} title - Title for the form
35
- */
36
-
37
- /**
38
- * @typedef CreatedOn
39
- * @property {string} user_agent - Useragent details
40
- */
41
-
42
- /**
43
- * @typedef CreateVideoRoomPayload
44
- * @property {NotifyUser[]} [notify] - List of people to be notified
45
- * @property {string} unique_name - Ticket id
46
- */
47
-
48
- /**
49
- * @typedef CreateVideoRoomResponse
50
- * @property {string} unique_name - Video Room's unique name
51
- */
52
-
53
- /**
54
- * @typedef CustomForm
55
- * @property {string} _id - Unique identifier for the form
56
- * @property {string} application_id - Application ID for form
57
- * @property {CreatedOn} [created_on]
58
- * @property {string} [description] - Form description that will be shown to the user
59
- * @property {string} [header_image] - Form header image that will be shown to the user
60
- * @property {Object[]} inputs - List of all the form fields
61
- * @property {boolean} login_required - Denotes if login is required to make a
62
- * form response submission
63
44
  * @property {PollForAssignment} [poll_for_assignment]
64
- * @property {Priority} priority
65
- * @property {boolean} should_notify - Denotes if new response submission for
66
- * the form should be notified to the assignees
67
- * @property {string} slug - Slug for the form, which is to be used for accessing the form
68
- * @property {SubmitButton} [submit_button]
69
- * @property {string} [success_message] - Message that is to be shown on
70
- * succesfull form response submission
71
- * @property {string} title - Form title that will be shown to the user
72
- */
73
-
74
- /**
75
- * @typedef CustomFormList
76
- * @property {CustomForm[]} [items] - List of forms
77
- * @property {Page} [page]
78
- */
79
-
80
- /**
81
- * @typedef Debug
82
- * @property {string} [platform] - Platform of user
83
- * @property {string} [source] - Source of user
84
45
  */
85
46
 
86
47
  /**
87
48
  * @typedef EditCustomFormPayload
88
- * @property {string} [description] - Description of the form
89
- * @property {string} [header_image] - Header image that is to be shown for the form
49
+ * @property {string} title - Title for the form
90
50
  * @property {Object[]} inputs - List of all the form components
91
- * @property {boolean} [login_required] - Denotes if login is required to make a
92
- * form response submission
93
- * @property {PollForAssignment} [poll_for_assignment]
51
+ * @property {string} [description] - Description of the form
94
52
  * @property {PriorityEnum} priority
53
+ * @property {string} [header_image] - Header image that is to be shown for the form
95
54
  * @property {boolean} [should_notify] - Indicates if staff should be notified
96
55
  * when a response is received
56
+ * @property {boolean} [login_required] - Denotes if login is required to make a
57
+ * form response submission
97
58
  * @property {string} [success_message] - Success message that will be shown on submission
98
- * @property {string} title - Title for the form
59
+ * @property {PollForAssignment} [poll_for_assignment]
99
60
  */
100
61
 
101
62
  /**
102
63
  * @typedef EditTicketPayload
103
- * @property {AgentChangePayload} [assigned_to]
104
- * @property {string} [category] - Category assigned to the ticket
105
64
  * @property {TicketContent} [content]
106
- * @property {PriorityEnum} [priority]
65
+ * @property {string} [category] - Category assigned to the ticket
66
+ * @property {string} [sub_category] - Sub-category assigned to the ticket
107
67
  * @property {string} [source] - Denotes if the ticket was created at company or
108
68
  * application level
109
69
  * @property {string} [status] - Denotes in what state is the ticket
110
- * @property {string} [sub_category] - Sub-category assigned to the ticket
70
+ * @property {PriorityEnum} [priority]
71
+ * @property {AgentChangePayload} [assigned_to]
111
72
  * @property {string[]} [tags] - Tags relevant to ticket
112
73
  */
113
74
 
114
75
  /**
115
- * @typedef Email
116
- * @property {boolean} [active] - Denotes if the email is active
117
- * @property {string} [email] - Email Address
118
- * @property {boolean} [primary] - Denotes it's the primary email for the account
119
- * @property {boolean} [verified] - Denotes it's a verified email
76
+ * @typedef AgentChangePayload
77
+ * @property {string} agent_id - Agent's unique ID
120
78
  */
121
79
 
122
80
  /**
123
- * @typedef ErrorMessage
124
- * @property {string} [message]
81
+ * @typedef CreateVideoRoomResponse
82
+ * @property {string} unique_name - Video Room's unique name
125
83
  */
126
84
 
127
85
  /**
128
- * @typedef FeedbackForm
129
- * @property {Object} [inputs] - Input details for the feed back form
130
- * @property {Object} [timestamps] - Gives details of category releted data
131
- * @property {string} [title] - Title for the feed back form
86
+ * @typedef CloseVideoRoomResponse
87
+ * @property {boolean} success - Denotes if operation was successfully
132
88
  */
133
89
 
134
90
  /**
135
- * @typedef FeedbackResponseItem
136
- * @property {string} display - Question/Title of the form field
137
- * @property {string} key - Key of the form field
138
- * @property {string} value - User response value for the form field
91
+ * @typedef CreateVideoRoomPayload
92
+ * @property {string} unique_name - Ticket id
93
+ * @property {NotifyUser[]} [notify] - List of people to be notified
94
+ */
95
+
96
+ /**
97
+ * @typedef NotifyUser
98
+ * @property {string} country_code - Country code
99
+ * @property {string} phone_number - Phone number
139
100
  */
140
101
 
141
102
  /**
142
103
  * @typedef Filter
143
- * @property {Object[]} assignees - List of support staff availble for tickets assignment
144
- * @property {TicketCategory[]} [categories] - List of possible categories for tickets
145
104
  * @property {Priority[]} priorities - List of possible priorities for tickets
105
+ * @property {TicketCategory[]} [categories] - List of possible categories for tickets
146
106
  * @property {Status[]} statuses - List of possible statuses for tickets
107
+ * @property {Object[]} assignees - List of support staff availble for tickets assignment
147
108
  */
148
109
 
149
110
  /**
150
- * @typedef GetParticipantsInsideVideoRoomResponse
151
- * @property {Participant[]} participants - List of participants of the video room
111
+ * @typedef TicketHistoryPayload
112
+ * @property {Object} value - Details of history event
113
+ * @property {HistoryTypeEnum} type
152
114
  */
153
115
 
154
116
  /**
@@ -157,130 +119,108 @@ const Joi = require("joi");
157
119
  */
158
120
 
159
121
  /**
160
- * @typedef NotifyUser
161
- * @property {string} country_code - Country code
162
- * @property {string} phone_number - Phone number
163
- */
164
-
165
- /**
166
- * @typedef Page
167
- * @property {number} [current]
168
- * @property {boolean} [has_next]
169
- * @property {boolean} [has_previous]
170
- * @property {number} [item_total]
171
- * @property {string} [next_id]
172
- * @property {number} [size]
173
- * @property {string} type
122
+ * @typedef GetParticipantsInsideVideoRoomResponse
123
+ * @property {Participant[]} participants - List of participants of the video room
174
124
  */
175
125
 
176
126
  /**
177
127
  * @typedef Participant
128
+ * @property {UserSchema} [user]
178
129
  * @property {string} [identity] - Unique identifier of participant
179
130
  * @property {string} [status] - Status of participant
180
- * @property {UserSchema} [user]
131
+ */
132
+
133
+ /**
134
+ * @typedef UserSchema
135
+ * @property {string} [application_id]
136
+ * @property {string} [user_id]
137
+ * @property {string} [first_name]
138
+ * @property {Object} [meta]
139
+ * @property {string} [last_name]
140
+ * @property {PhoneNumber[]} [phone_numbers]
141
+ * @property {Email[]} [emails]
142
+ * @property {string} [gender]
143
+ * @property {string} [dob]
144
+ * @property {boolean} [active]
145
+ * @property {string} [profile_pic_url]
146
+ * @property {string} [username]
147
+ * @property {string} [account_type]
148
+ * @property {string} [_id]
149
+ * @property {string} [created_at]
150
+ * @property {string} [updated_at]
151
+ * @property {string} [external_id]
181
152
  */
182
153
 
183
154
  /**
184
155
  * @typedef PhoneNumber
185
156
  * @property {boolean} [active] - Denotes if the phone number is active
186
- * @property {number} [country_code] - Country code
187
- * @property {string} [phone] - Phone number
188
157
  * @property {boolean} [primary] - Denotes it's the primary phone number for the account
189
158
  * @property {boolean} [verified] - Denotes it's a verified phone number
159
+ * @property {string} [phone] - Phone number
160
+ * @property {number} [country_code] - Country code
190
161
  */
191
162
 
192
163
  /**
193
- * @typedef PollForAssignment
194
- * @property {number} duration - Duration for polling of staff
195
- * @property {string} failure_message - Message if polling failed
196
- * @property {string} message - Message for polling
197
- * @property {string} success_message - Message for successful polling
198
- */
199
-
200
- /**
201
- * @typedef Priority
202
- * @property {string} color - Color for priority
203
- * @property {string} display - Display text for priority
204
- * @property {PriorityEnum} key
164
+ * @typedef Email
165
+ * @property {boolean} [primary] - Denotes it's the primary email for the account
166
+ * @property {boolean} [verified] - Denotes it's a verified email
167
+ * @property {string} [email] - Email Address
168
+ * @property {boolean} [active] - Denotes if the email is active
205
169
  */
206
170
 
207
171
  /**
208
- * @typedef Status
209
- * @property {string} color - Color for status
210
- * @property {string} display - Display text for status
211
- * @property {string} key - Key for status
172
+ * @typedef Debug
173
+ * @property {string} [source] - Source of user
174
+ * @property {string} [platform] - Platform of user
212
175
  */
213
176
 
214
177
  /**
215
- * @typedef SubmitButton
216
- * @property {string} background_color - Color for submit button
217
- * @property {string} title - Title for submit button
218
- * @property {string} title_color - Title color submit button
178
+ * @typedef TicketContext
179
+ * @property {string} [application_id] - Application ID related to the ticket
180
+ * @property {string} company_id - Company ID related to the ticket
219
181
  */
220
182
 
221
183
  /**
222
- * @typedef Ticket
223
- * @property {Object} [_custom_json] - Custom json relevant to the ticket
224
- * @property {string} _id - Unique identifier for the ticket
225
- * @property {Object} [assigned_to] - Details of support staff to whom ticket is assigned
226
- * @property {TicketCategory} category
227
- * @property {TicketContent} [content]
228
- * @property {TicketContext} [context]
229
- * @property {string} [created_at] - Time when the ticket was created
230
- * @property {Object} [created_by] - User details of ticket creator
231
- * @property {CreatedOn} [created_on]
232
- * @property {Object} [integration] - Integration type and its details of the ticket
233
- * @property {boolean} [is_feedback_pending] - Denotes if feedback submission is
234
- * pending for the ticket
235
- * @property {Priority} priority
236
- * @property {string} [response_id] - Details of company and application
237
- * realated to the ticket
238
- * @property {TicketSourceEnum} source
239
- * @property {Status} status
240
- * @property {string} [sub_category] - Sub-category assigned to the ticket
241
- * @property {string[]} [tags] - Tags relevant to ticket
242
- * @property {string} [updated_at] - Time when the ticket was last updated
184
+ * @typedef CreatedOn
185
+ * @property {string} user_agent - Useragent details
243
186
  */
244
187
 
245
188
  /**
246
189
  * @typedef TicketAsset
247
190
  * @property {string} [display] - Display text for asset
248
- * @property {TicketAssetTypeEnum} type
249
191
  * @property {string} value - To be used for details
250
- */
251
-
252
- /**
253
- * @typedef TicketCategory
254
- * @property {string} display - Category display value identifier
255
- * @property {FeedbackForm} [feedback_form]
256
- * @property {number} [group_id] - Group id of category releted data
257
- * @property {string} key - Category key value identifier
258
- * @property {TicketCategory} [sub_categories]
192
+ * @property {TicketAssetTypeEnum} type
259
193
  */
260
194
 
261
195
  /**
262
196
  * @typedef TicketContent
263
- * @property {TicketAsset[]} [attachments] - List of all attachments related to the ticket
264
- * @property {string} [description] - Long description of issue
265
197
  * @property {string} title - Title for ticket
198
+ * @property {string} [description] - Long description of issue
199
+ * @property {TicketAsset[]} [attachments] - List of all attachments related to the ticket
266
200
  */
267
201
 
268
202
  /**
269
- * @typedef TicketContext
270
- * @property {string} [application_id] - Application ID related to the ticket
271
- * @property {string} company_id - Company ID related to the ticket
203
+ * @typedef AddTicketPayload
204
+ * @property {Object} [created_by] - Creator of the ticket
205
+ * @property {string} [status] - Status of the ticket
206
+ * @property {PriorityEnum} [priority]
207
+ * @property {string} category - Category of the ticket
208
+ * @property {TicketContent} content
209
+ * @property {Object} [_custom_json] - Optional custom data that needs to be sent
272
210
  */
273
211
 
274
212
  /**
275
- * @typedef TicketFeedback
276
- * @property {string} _id - Unique identifier for the feedback
277
- * @property {string} [category] - Category of the ticket
278
- * @property {string} company_id - Company id for which ticket was raised
279
- * @property {string} [created_at] - Time when the feedback was created
280
- * @property {FeedbackResponseItem[]} response
281
- * @property {string} ticket_id - Readable ticket number
282
- * @property {string} [updated_at] - Time when the feedback was last updated
283
- * @property {Object} [user] - User who submitted the feedback
213
+ * @typedef Priority
214
+ * @property {PriorityEnum} key
215
+ * @property {string} display - Display text for priority
216
+ * @property {string} color - Color for priority
217
+ */
218
+
219
+ /**
220
+ * @typedef Status
221
+ * @property {string} key - Key for status
222
+ * @property {string} display - Display text for status
223
+ * @property {string} color - Color for status
284
224
  */
285
225
 
286
226
  /**
@@ -295,61 +235,116 @@ const Joi = require("joi");
295
235
  */
296
236
 
297
237
  /**
298
- * @typedef TicketHistory
299
- * @property {string} _id - Unique identifier of the history event
300
- * @property {string} [created_at] - Time of creation of the history event
301
- * @property {Object} [created_by] - User who created the history event
238
+ * @typedef SubmitButton
239
+ * @property {string} title - Title for submit button
240
+ * @property {string} title_color - Title color submit button
241
+ * @property {string} background_color - Color for submit button
242
+ */
243
+
244
+ /**
245
+ * @typedef PollForAssignment
246
+ * @property {number} duration - Duration for polling of staff
247
+ * @property {string} message - Message for polling
248
+ * @property {string} success_message - Message for successful polling
249
+ * @property {string} failure_message - Message if polling failed
250
+ */
251
+
252
+ /**
253
+ * @typedef CustomForm
254
+ * @property {string} application_id - Application ID for form
255
+ * @property {string} slug - Slug for the form, which is to be used for accessing the form
256
+ * @property {string} [header_image] - Form header image that will be shown to the user
257
+ * @property {string} title - Form title that will be shown to the user
258
+ * @property {string} [description] - Form description that will be shown to the user
259
+ * @property {Priority} priority
260
+ * @property {boolean} login_required - Denotes if login is required to make a
261
+ * form response submission
262
+ * @property {boolean} should_notify - Denotes if new response submission for
263
+ * the form should be notified to the assignees
264
+ * @property {string} [success_message] - Message that is to be shown on
265
+ * succesfull form response submission
266
+ * @property {SubmitButton} [submit_button]
267
+ * @property {Object[]} inputs - List of all the form fields
302
268
  * @property {CreatedOn} [created_on]
303
- * @property {string} ticket_id - Readable ticket number
304
- * @property {string} type - Type of the history event
305
- * @property {string} [updated_at] - Time of last update of the history event
306
- * @property {Object} value - Data of the history event
269
+ * @property {PollForAssignment} [poll_for_assignment]
270
+ * @property {string} _id - Unique identifier for the form
307
271
  */
308
272
 
309
273
  /**
310
- * @typedef TicketHistoryList
311
- * @property {TicketHistory[]} [items] - List of ticket history
312
- * @property {Page} [page]
274
+ * @typedef FeedbackForm
275
+ * @property {Object} [inputs] - Input details for the feed back form
276
+ * @property {string} [title] - Title for the feed back form
277
+ * @property {Object} [timestamps] - Gives details of category releted data
313
278
  */
314
279
 
315
280
  /**
316
- * @typedef TicketHistoryPayload
317
- * @property {HistoryTypeEnum} type
318
- * @property {Object} value - Details of history event
281
+ * @typedef TicketCategory
282
+ * @property {string} display - Category display value identifier
283
+ * @property {string} key - Category key value identifier
284
+ * @property {TicketCategory} [sub_categories]
285
+ * @property {number} [group_id] - Group id of category releted data
286
+ * @property {FeedbackForm} [feedback_form]
319
287
  */
320
288
 
321
289
  /**
322
- * @typedef TicketList
323
- * @property {Filter} [filters]
324
- * @property {Ticket[]} [items] - List of tickets
325
- * @property {Page} [page]
290
+ * @typedef FeedbackResponseItem
291
+ * @property {string} display - Question/Title of the form field
292
+ * @property {string} key - Key of the form field
293
+ * @property {string} value - User response value for the form field
326
294
  */
327
295
 
328
296
  /**
329
- * @typedef UserSchema
330
- * @property {string} [_id]
331
- * @property {string} [account_type]
332
- * @property {boolean} [active]
333
- * @property {string} [application_id]
334
- * @property {string} [created_at]
335
- * @property {string} [dob]
336
- * @property {Email[]} [emails]
337
- * @property {string} [external_id]
338
- * @property {string} [first_name]
339
- * @property {string} [gender]
340
- * @property {string} [last_name]
341
- * @property {Object} [meta]
342
- * @property {PhoneNumber[]} [phone_numbers]
343
- * @property {string} [profile_pic_url]
344
- * @property {string} [updated_at]
345
- * @property {string} [user_id]
346
- * @property {string} [username]
297
+ * @typedef TicketFeedback
298
+ * @property {string} _id - Unique identifier for the feedback
299
+ * @property {string} ticket_id - Readable ticket number
300
+ * @property {string} company_id - Company id for which ticket was raised
301
+ * @property {FeedbackResponseItem[]} response
302
+ * @property {string} [category] - Category of the ticket
303
+ * @property {Object} [user] - User who submitted the feedback
304
+ * @property {string} [updated_at] - Time when the feedback was last updated
305
+ * @property {string} [created_at] - Time when the feedback was created
347
306
  */
348
307
 
349
- /** @typedef {"rating" | "log" | "comment" | "thread"} HistoryTypeEnum */
308
+ /**
309
+ * @typedef TicketHistory
310
+ * @property {string} type - Type of the history event
311
+ * @property {Object} value - Data of the history event
312
+ * @property {string} ticket_id - Readable ticket number
313
+ * @property {CreatedOn} [created_on]
314
+ * @property {Object} [created_by] - User who created the history event
315
+ * @property {string} _id - Unique identifier of the history event
316
+ * @property {string} [updated_at] - Time of last update of the history event
317
+ * @property {string} [created_at] - Time of creation of the history event
318
+ */
319
+
320
+ /**
321
+ * @typedef Ticket
322
+ * @property {TicketContext} [context]
323
+ * @property {CreatedOn} [created_on]
324
+ * @property {string} [response_id] - Details of company and application
325
+ * realated to the ticket
326
+ * @property {TicketContent} [content]
327
+ * @property {TicketCategory} category
328
+ * @property {string} [sub_category] - Sub-category assigned to the ticket
329
+ * @property {TicketSourceEnum} source
330
+ * @property {Status} status
331
+ * @property {Priority} priority
332
+ * @property {Object} [created_by] - User details of ticket creator
333
+ * @property {Object} [assigned_to] - Details of support staff to whom ticket is assigned
334
+ * @property {string[]} [tags] - Tags relevant to ticket
335
+ * @property {Object} [_custom_json] - Custom json relevant to the ticket
336
+ * @property {boolean} [is_feedback_pending] - Denotes if feedback submission is
337
+ * pending for the ticket
338
+ * @property {Object} [integration] - Integration type and its details of the ticket
339
+ * @property {string} _id - Unique identifier for the ticket
340
+ * @property {string} [updated_at] - Time when the ticket was last updated
341
+ * @property {string} [created_at] - Time when the ticket was created
342
+ */
350
343
 
351
344
  /** @typedef {"low" | "medium" | "high" | "urgent"} PriorityEnum */
352
345
 
346
+ /** @typedef {"rating" | "log" | "comment"} HistoryTypeEnum */
347
+
353
348
  /**
354
349
  * @typedef {| "image"
355
350
  * | "video"
@@ -365,59 +360,92 @@ const Joi = require("joi");
365
360
  /** @typedef {"platform_panel" | "sales_channel"} TicketSourceEnum */
366
361
 
367
362
  class LeadPlatformModel {
368
- /** @returns {AddTicketPayload} */
369
- static AddTicketPayload() {
363
+ /** @returns {TicketList} */
364
+ static TicketList() {
370
365
  return Joi.object({
371
- _custom_json: Joi.any(),
372
- category: Joi.string().allow("").required(),
373
- content: LeadPlatformModel.TicketContent().required(),
374
- created_by: Joi.any(),
375
- priority: LeadPlatformModel.PriorityEnum(),
376
- status: Joi.string().allow(""),
366
+ items: Joi.array().items(LeadPlatformModel.Ticket()),
367
+ filters: LeadPlatformModel.Filter(),
368
+ page: LeadPlatformModel.Page(),
377
369
  });
378
370
  }
379
371
 
380
- /** @returns {AgentChangePayload} */
381
- static AgentChangePayload() {
372
+ /** @returns {Page} */
373
+ static Page() {
382
374
  return Joi.object({
383
- agent_id: Joi.string().allow("").required(),
375
+ item_total: Joi.number(),
376
+ next_id: Joi.string().allow(""),
377
+ has_previous: Joi.boolean(),
378
+ has_next: Joi.boolean(),
379
+ current: Joi.number(),
380
+ type: Joi.string().allow("").required(),
381
+ size: Joi.number(),
384
382
  });
385
383
  }
386
384
 
387
- /** @returns {CloseVideoRoomResponse} */
388
- static CloseVideoRoomResponse() {
385
+ /** @returns {TicketHistoryList} */
386
+ static TicketHistoryList() {
389
387
  return Joi.object({
390
- success: Joi.boolean().required(),
388
+ items: Joi.array().items(LeadPlatformModel.TicketHistory()),
389
+ page: LeadPlatformModel.Page(),
390
+ });
391
+ }
392
+
393
+ /** @returns {CustomFormList} */
394
+ static CustomFormList() {
395
+ return Joi.object({
396
+ items: Joi.array().items(LeadPlatformModel.CustomForm()),
397
+ page: LeadPlatformModel.Page(),
391
398
  });
392
399
  }
393
400
 
394
401
  /** @returns {CreateCustomFormPayload} */
395
402
  static CreateCustomFormPayload() {
396
403
  return Joi.object({
404
+ slug: Joi.string().allow("").required(),
405
+ title: Joi.string().allow("").required(),
406
+ inputs: Joi.array().items(Joi.any()).required(),
397
407
  description: Joi.string().allow(""),
398
408
  header_image: Joi.string().allow(""),
399
- inputs: Joi.array().items(Joi.any()).required(),
400
- poll_for_assignment: LeadPlatformModel.PollForAssignment(),
401
409
  priority: LeadPlatformModel.PriorityEnum().required(),
402
410
  should_notify: Joi.boolean(),
403
- slug: Joi.string().allow("").required(),
404
411
  success_message: Joi.string().allow(""),
412
+ poll_for_assignment: LeadPlatformModel.PollForAssignment(),
413
+ });
414
+ }
415
+
416
+ /** @returns {EditCustomFormPayload} */
417
+ static EditCustomFormPayload() {
418
+ return Joi.object({
405
419
  title: Joi.string().allow("").required(),
420
+ inputs: Joi.array().items(Joi.any()).required(),
421
+ description: Joi.string().allow(""),
422
+ priority: LeadPlatformModel.PriorityEnum().required(),
423
+ header_image: Joi.string().allow(""),
424
+ should_notify: Joi.boolean(),
425
+ login_required: Joi.boolean(),
426
+ success_message: Joi.string().allow(""),
427
+ poll_for_assignment: LeadPlatformModel.PollForAssignment(),
406
428
  });
407
429
  }
408
430
 
409
- /** @returns {CreatedOn} */
410
- static CreatedOn() {
431
+ /** @returns {EditTicketPayload} */
432
+ static EditTicketPayload() {
411
433
  return Joi.object({
412
- user_agent: Joi.string().allow("").required(),
434
+ content: LeadPlatformModel.TicketContent(),
435
+ category: Joi.string().allow(""),
436
+ sub_category: Joi.string().allow(""),
437
+ source: Joi.string().allow(""),
438
+ status: Joi.string().allow(""),
439
+ priority: LeadPlatformModel.PriorityEnum(),
440
+ assigned_to: LeadPlatformModel.AgentChangePayload(),
441
+ tags: Joi.array().items(Joi.string().allow("")),
413
442
  });
414
443
  }
415
444
 
416
- /** @returns {CreateVideoRoomPayload} */
417
- static CreateVideoRoomPayload() {
445
+ /** @returns {AgentChangePayload} */
446
+ static AgentChangePayload() {
418
447
  return Joi.object({
419
- notify: Joi.array().items(LeadPlatformModel.NotifyUser()),
420
- unique_name: Joi.string().allow("").required(),
448
+ agent_id: Joi.string().allow("").required(),
421
449
  });
422
450
  }
423
451
 
@@ -428,240 +456,246 @@ class LeadPlatformModel {
428
456
  });
429
457
  }
430
458
 
431
- /** @returns {CustomForm} */
432
- static CustomForm() {
459
+ /** @returns {CloseVideoRoomResponse} */
460
+ static CloseVideoRoomResponse() {
433
461
  return Joi.object({
434
- _id: Joi.string().allow("").required(),
435
- application_id: Joi.string().allow("").required(),
436
- created_on: LeadPlatformModel.CreatedOn(),
437
- description: Joi.string().allow(""),
438
- header_image: Joi.string().allow(""),
439
- inputs: Joi.array().items(Joi.any()).required(),
440
- login_required: Joi.boolean().required(),
441
- poll_for_assignment: LeadPlatformModel.PollForAssignment(),
442
- priority: LeadPlatformModel.Priority().required(),
443
- should_notify: Joi.boolean().required(),
444
- slug: Joi.string().allow("").required(),
445
- submit_button: LeadPlatformModel.SubmitButton(),
446
- success_message: Joi.string().allow(""),
447
- title: Joi.string().allow("").required(),
462
+ success: Joi.boolean().required(),
448
463
  });
449
464
  }
450
465
 
451
- /** @returns {CustomFormList} */
452
- static CustomFormList() {
466
+ /** @returns {CreateVideoRoomPayload} */
467
+ static CreateVideoRoomPayload() {
453
468
  return Joi.object({
454
- items: Joi.array().items(LeadPlatformModel.CustomForm()),
455
- page: LeadPlatformModel.Page(),
469
+ unique_name: Joi.string().allow("").required(),
470
+ notify: Joi.array().items(LeadPlatformModel.NotifyUser()),
456
471
  });
457
472
  }
458
473
 
459
- /** @returns {Debug} */
460
- static Debug() {
474
+ /** @returns {NotifyUser} */
475
+ static NotifyUser() {
461
476
  return Joi.object({
462
- platform: Joi.string().allow(""),
463
- source: Joi.string().allow(""),
477
+ country_code: Joi.string().allow("").required(),
478
+ phone_number: Joi.string().allow("").required(),
464
479
  });
465
480
  }
466
481
 
467
- /** @returns {EditCustomFormPayload} */
468
- static EditCustomFormPayload() {
482
+ /** @returns {Filter} */
483
+ static Filter() {
469
484
  return Joi.object({
470
- description: Joi.string().allow(""),
471
- header_image: Joi.string().allow(""),
472
- inputs: Joi.array().items(Joi.any()).required(),
473
- login_required: Joi.boolean(),
474
- poll_for_assignment: LeadPlatformModel.PollForAssignment(),
475
- priority: LeadPlatformModel.PriorityEnum().required(),
476
- should_notify: Joi.boolean(),
477
- success_message: Joi.string().allow(""),
478
- title: Joi.string().allow("").required(),
485
+ priorities: Joi.array().items(LeadPlatformModel.Priority()).required(),
486
+ categories: Joi.array().items(LeadPlatformModel.TicketCategory()),
487
+ statuses: Joi.array().items(LeadPlatformModel.Status()).required(),
488
+ assignees: Joi.array().items(Joi.any()).required(),
479
489
  });
480
490
  }
481
491
 
482
- /** @returns {EditTicketPayload} */
483
- static EditTicketPayload() {
492
+ /** @returns {TicketHistoryPayload} */
493
+ static TicketHistoryPayload() {
484
494
  return Joi.object({
485
- assigned_to: LeadPlatformModel.AgentChangePayload(),
486
- category: Joi.string().allow(""),
487
- content: LeadPlatformModel.TicketContent(),
488
- priority: LeadPlatformModel.PriorityEnum(),
489
- source: Joi.string().allow(""),
490
- status: Joi.string().allow(""),
491
- sub_category: Joi.string().allow(""),
492
- tags: Joi.array().items(Joi.string().allow("")),
495
+ value: Joi.any().required(),
496
+ type: LeadPlatformModel.HistoryTypeEnum().required(),
493
497
  });
494
498
  }
495
499
 
496
- /** @returns {Email} */
497
- static Email() {
500
+ /** @returns {GetTokenForVideoRoomResponse} */
501
+ static GetTokenForVideoRoomResponse() {
498
502
  return Joi.object({
499
- active: Joi.boolean(),
500
- email: Joi.string().allow(""),
501
- primary: Joi.boolean(),
502
- verified: Joi.boolean(),
503
+ access_token: Joi.string().allow("").required(),
503
504
  });
504
505
  }
505
506
 
506
- /** @returns {ErrorMessage} */
507
- static ErrorMessage() {
507
+ /** @returns {GetParticipantsInsideVideoRoomResponse} */
508
+ static GetParticipantsInsideVideoRoomResponse() {
508
509
  return Joi.object({
509
- message: Joi.string().allow(""),
510
+ participants: Joi.array()
511
+ .items(LeadPlatformModel.Participant())
512
+ .required(),
510
513
  });
511
514
  }
512
515
 
513
- /** @returns {FeedbackForm} */
514
- static FeedbackForm() {
516
+ /** @returns {Participant} */
517
+ static Participant() {
515
518
  return Joi.object({
516
- inputs: Joi.any(),
517
- timestamps: Joi.any(),
518
- title: Joi.string().allow(""),
519
+ user: LeadPlatformModel.UserSchema(),
520
+ identity: Joi.string().allow(""),
521
+ status: Joi.string().allow(""),
519
522
  });
520
523
  }
521
524
 
522
- /** @returns {FeedbackResponseItem} */
523
- static FeedbackResponseItem() {
525
+ /** @returns {UserSchema} */
526
+ static UserSchema() {
524
527
  return Joi.object({
525
- display: Joi.string().allow("").required(),
526
- key: Joi.string().allow("").required(),
527
- value: Joi.string().allow("").required(),
528
+ application_id: Joi.string().allow(""),
529
+ user_id: Joi.string().allow(""),
530
+ first_name: Joi.string().allow(""),
531
+ meta: Joi.any(),
532
+ last_name: Joi.string().allow(""),
533
+ phone_numbers: Joi.array().items(LeadPlatformModel.PhoneNumber()),
534
+ emails: Joi.array().items(LeadPlatformModel.Email()),
535
+ gender: Joi.string().allow(""),
536
+ dob: Joi.string().allow(""),
537
+ active: Joi.boolean(),
538
+ profile_pic_url: Joi.string().allow(""),
539
+ username: Joi.string().allow(""),
540
+ account_type: Joi.string().allow(""),
541
+ _id: Joi.string().allow(""),
542
+ created_at: Joi.string().allow(""),
543
+ updated_at: Joi.string().allow(""),
544
+ external_id: Joi.string().allow(""),
528
545
  });
529
546
  }
530
547
 
531
- /** @returns {Filter} */
532
- static Filter() {
548
+ /** @returns {PhoneNumber} */
549
+ static PhoneNumber() {
533
550
  return Joi.object({
534
- assignees: Joi.array().items(Joi.any()).required(),
535
- categories: Joi.array().items(LeadPlatformModel.TicketCategory()),
536
- priorities: Joi.array().items(LeadPlatformModel.Priority()).required(),
537
- statuses: Joi.array().items(LeadPlatformModel.Status()).required(),
551
+ active: Joi.boolean(),
552
+ primary: Joi.boolean(),
553
+ verified: Joi.boolean(),
554
+ phone: Joi.string().allow(""),
555
+ country_code: Joi.number(),
538
556
  });
539
557
  }
540
558
 
541
- /** @returns {GetParticipantsInsideVideoRoomResponse} */
542
- static GetParticipantsInsideVideoRoomResponse() {
559
+ /** @returns {Email} */
560
+ static Email() {
543
561
  return Joi.object({
544
- participants: Joi.array()
545
- .items(LeadPlatformModel.Participant())
546
- .required(),
562
+ primary: Joi.boolean(),
563
+ verified: Joi.boolean(),
564
+ email: Joi.string().allow(""),
565
+ active: Joi.boolean(),
547
566
  });
548
567
  }
549
568
 
550
- /** @returns {GetTokenForVideoRoomResponse} */
551
- static GetTokenForVideoRoomResponse() {
569
+ /** @returns {Debug} */
570
+ static Debug() {
552
571
  return Joi.object({
553
- access_token: Joi.string().allow("").required(),
572
+ source: Joi.string().allow(""),
573
+ platform: Joi.string().allow(""),
554
574
  });
555
575
  }
556
576
 
557
- /** @returns {NotifyUser} */
558
- static NotifyUser() {
577
+ /** @returns {TicketContext} */
578
+ static TicketContext() {
559
579
  return Joi.object({
560
- country_code: Joi.string().allow("").required(),
561
- phone_number: Joi.string().allow("").required(),
580
+ application_id: Joi.string().allow(""),
581
+ company_id: Joi.string().allow("").required(),
562
582
  });
563
583
  }
564
584
 
565
- /** @returns {Page} */
566
- static Page() {
585
+ /** @returns {CreatedOn} */
586
+ static CreatedOn() {
567
587
  return Joi.object({
568
- current: Joi.number(),
569
- has_next: Joi.boolean(),
570
- has_previous: Joi.boolean(),
571
- item_total: Joi.number(),
572
- next_id: Joi.string().allow(""),
573
- size: Joi.number(),
574
- type: Joi.string().allow("").required(),
588
+ user_agent: Joi.string().allow("").required(),
575
589
  });
576
590
  }
577
-
578
- /** @returns {Participant} */
579
- static Participant() {
591
+
592
+ /** @returns {TicketAsset} */
593
+ static TicketAsset() {
580
594
  return Joi.object({
581
- identity: Joi.string().allow(""),
582
- status: Joi.string().allow(""),
583
- user: LeadPlatformModel.UserSchema(),
595
+ display: Joi.string().allow(""),
596
+ value: Joi.string().allow("").required(),
597
+ type: LeadPlatformModel.TicketAssetTypeEnum().required(),
584
598
  });
585
599
  }
586
600
 
587
- /** @returns {PhoneNumber} */
588
- static PhoneNumber() {
601
+ /** @returns {TicketContent} */
602
+ static TicketContent() {
589
603
  return Joi.object({
590
- active: Joi.boolean(),
591
- country_code: Joi.number(),
592
- phone: Joi.string().allow(""),
593
- primary: Joi.boolean(),
594
- verified: Joi.boolean(),
604
+ title: Joi.string().allow("").required(),
605
+ description: Joi.string().allow(""),
606
+ attachments: Joi.array().items(LeadPlatformModel.TicketAsset()),
595
607
  });
596
608
  }
597
609
 
598
- /** @returns {PollForAssignment} */
599
- static PollForAssignment() {
610
+ /** @returns {AddTicketPayload} */
611
+ static AddTicketPayload() {
600
612
  return Joi.object({
601
- duration: Joi.number().required(),
602
- failure_message: Joi.string().allow("").required(),
603
- message: Joi.string().allow("").required(),
604
- success_message: Joi.string().allow("").required(),
613
+ created_by: Joi.any(),
614
+ status: Joi.string().allow(""),
615
+ priority: LeadPlatformModel.PriorityEnum(),
616
+ category: Joi.string().allow("").required(),
617
+ content: LeadPlatformModel.TicketContent().required(),
618
+ _custom_json: Joi.any(),
605
619
  });
606
620
  }
607
621
 
608
622
  /** @returns {Priority} */
609
623
  static Priority() {
610
624
  return Joi.object({
611
- color: Joi.string().allow("").required(),
612
- display: Joi.string().allow("").required(),
613
625
  key: LeadPlatformModel.PriorityEnum().required(),
626
+ display: Joi.string().allow("").required(),
627
+ color: Joi.string().allow("").required(),
614
628
  });
615
629
  }
616
630
 
617
631
  /** @returns {Status} */
618
632
  static Status() {
619
633
  return Joi.object({
620
- color: Joi.string().allow("").required(),
621
- display: Joi.string().allow("").required(),
622
634
  key: Joi.string().allow("").required(),
635
+ display: Joi.string().allow("").required(),
636
+ color: Joi.string().allow("").required(),
637
+ });
638
+ }
639
+
640
+ /** @returns {TicketFeedbackList} */
641
+ static TicketFeedbackList() {
642
+ return Joi.object({
643
+ items: Joi.array().items(LeadPlatformModel.TicketFeedback()),
644
+ });
645
+ }
646
+
647
+ /** @returns {TicketFeedbackPayload} */
648
+ static TicketFeedbackPayload() {
649
+ return Joi.object({
650
+ form_response: Joi.any(),
623
651
  });
624
652
  }
625
653
 
626
654
  /** @returns {SubmitButton} */
627
655
  static SubmitButton() {
628
656
  return Joi.object({
629
- background_color: Joi.string().allow("").required(),
630
657
  title: Joi.string().allow("").required(),
631
658
  title_color: Joi.string().allow("").required(),
659
+ background_color: Joi.string().allow("").required(),
632
660
  });
633
661
  }
634
662
 
635
- /** @returns {Ticket} */
636
- static Ticket() {
663
+ /** @returns {PollForAssignment} */
664
+ static PollForAssignment() {
637
665
  return Joi.object({
638
- _custom_json: Joi.any(),
639
- _id: Joi.string().allow("").required(),
640
- assigned_to: Joi.any(),
641
- category: LeadPlatformModel.TicketCategory().required(),
642
- content: LeadPlatformModel.TicketContent(),
643
- context: LeadPlatformModel.TicketContext(),
644
- created_at: Joi.string().allow(""),
645
- created_by: Joi.any(),
646
- created_on: LeadPlatformModel.CreatedOn(),
647
- integration: Joi.any(),
648
- is_feedback_pending: Joi.boolean(),
666
+ duration: Joi.number().required(),
667
+ message: Joi.string().allow("").required(),
668
+ success_message: Joi.string().allow("").required(),
669
+ failure_message: Joi.string().allow("").required(),
670
+ });
671
+ }
672
+
673
+ /** @returns {CustomForm} */
674
+ static CustomForm() {
675
+ return Joi.object({
676
+ application_id: Joi.string().allow("").required(),
677
+ slug: Joi.string().allow("").required(),
678
+ header_image: Joi.string().allow(""),
679
+ title: Joi.string().allow("").required(),
680
+ description: Joi.string().allow(""),
649
681
  priority: LeadPlatformModel.Priority().required(),
650
- response_id: Joi.string().allow(""),
651
- source: LeadPlatformModel.TicketSourceEnum().required(),
652
- status: LeadPlatformModel.Status().required(),
653
- sub_category: Joi.string().allow(""),
654
- tags: Joi.array().items(Joi.string().allow("")),
655
- updated_at: Joi.string().allow(""),
682
+ login_required: Joi.boolean().required(),
683
+ should_notify: Joi.boolean().required(),
684
+ success_message: Joi.string().allow(""),
685
+ submit_button: LeadPlatformModel.SubmitButton(),
686
+ inputs: Joi.array().items(Joi.any()).required(),
687
+ created_on: LeadPlatformModel.CreatedOn(),
688
+ poll_for_assignment: LeadPlatformModel.PollForAssignment(),
689
+ _id: Joi.string().allow("").required(),
656
690
  });
657
691
  }
658
692
 
659
- /** @returns {TicketAsset} */
660
- static TicketAsset() {
693
+ /** @returns {FeedbackForm} */
694
+ static FeedbackForm() {
661
695
  return Joi.object({
662
- display: Joi.string().allow(""),
663
- type: LeadPlatformModel.TicketAssetTypeEnum().required(),
664
- value: Joi.string().allow("").required(),
696
+ inputs: Joi.any(),
697
+ title: Joi.string().allow(""),
698
+ timestamps: Joi.any(),
665
699
  });
666
700
  }
667
701
 
@@ -669,27 +703,19 @@ class LeadPlatformModel {
669
703
  static TicketCategory() {
670
704
  return Joi.object({
671
705
  display: Joi.string().allow("").required(),
672
- feedback_form: LeadPlatformModel.FeedbackForm(),
673
- group_id: Joi.number(),
674
706
  key: Joi.string().allow("").required(),
675
707
  sub_categories: Joi.link("#TicketCategory"),
708
+ group_id: Joi.number(),
709
+ feedback_form: LeadPlatformModel.FeedbackForm(),
676
710
  }).id("TicketCategory");
677
711
  }
678
712
 
679
- /** @returns {TicketContent} */
680
- static TicketContent() {
681
- return Joi.object({
682
- attachments: Joi.array().items(LeadPlatformModel.TicketAsset()),
683
- description: Joi.string().allow(""),
684
- title: Joi.string().allow("").required(),
685
- });
686
- }
687
-
688
- /** @returns {TicketContext} */
689
- static TicketContext() {
713
+ /** @returns {FeedbackResponseItem} */
714
+ static FeedbackResponseItem() {
690
715
  return Joi.object({
691
- application_id: Joi.string().allow(""),
692
- company_id: Joi.string().allow("").required(),
716
+ display: Joi.string().allow("").required(),
717
+ key: Joi.string().allow("").required(),
718
+ value: Joi.string().allow("").required(),
693
719
  });
694
720
  }
695
721
 
@@ -697,125 +723,85 @@ class LeadPlatformModel {
697
723
  static TicketFeedback() {
698
724
  return Joi.object({
699
725
  _id: Joi.string().allow("").required(),
700
- category: Joi.string().allow(""),
726
+ ticket_id: Joi.string().allow("").required(),
701
727
  company_id: Joi.string().allow("").required(),
702
- created_at: Joi.string().allow(""),
703
728
  response: Joi.array()
704
729
  .items(LeadPlatformModel.FeedbackResponseItem())
705
730
  .required(),
706
- ticket_id: Joi.string().allow("").required(),
707
- updated_at: Joi.string().allow(""),
731
+ category: Joi.string().allow(""),
708
732
  user: Joi.any(),
709
- });
710
- }
711
-
712
- /** @returns {TicketFeedbackList} */
713
- static TicketFeedbackList() {
714
- return Joi.object({
715
- items: Joi.array().items(LeadPlatformModel.TicketFeedback()),
716
- });
717
- }
718
-
719
- /** @returns {TicketFeedbackPayload} */
720
- static TicketFeedbackPayload() {
721
- return Joi.object({
722
- form_response: Joi.any(),
733
+ updated_at: Joi.string().allow(""),
734
+ created_at: Joi.string().allow(""),
723
735
  });
724
736
  }
725
737
 
726
738
  /** @returns {TicketHistory} */
727
739
  static TicketHistory() {
728
740
  return Joi.object({
729
- _id: Joi.string().allow("").required(),
730
- created_at: Joi.string().allow(""),
731
- created_by: Joi.any(),
732
- created_on: LeadPlatformModel.CreatedOn(),
733
- ticket_id: Joi.string().allow("").required(),
734
741
  type: Joi.string().allow("").required(),
735
- updated_at: Joi.string().allow(""),
736
- value: Joi.any().required(),
737
- });
738
- }
739
-
740
- /** @returns {TicketHistoryList} */
741
- static TicketHistoryList() {
742
- return Joi.object({
743
- items: Joi.array().items(LeadPlatformModel.TicketHistory()),
744
- page: LeadPlatformModel.Page(),
745
- });
746
- }
747
-
748
- /** @returns {TicketHistoryPayload} */
749
- static TicketHistoryPayload() {
750
- return Joi.object({
751
- type: LeadPlatformModel.HistoryTypeEnum().required(),
752
742
  value: Joi.any().required(),
743
+ ticket_id: Joi.string().allow("").required(),
744
+ created_on: LeadPlatformModel.CreatedOn(),
745
+ created_by: Joi.any(),
746
+ _id: Joi.string().allow("").required(),
747
+ updated_at: Joi.string().allow(""),
748
+ created_at: Joi.string().allow(""),
753
749
  });
754
750
  }
755
751
 
756
- /** @returns {TicketList} */
757
- static TicketList() {
758
- return Joi.object({
759
- filters: LeadPlatformModel.Filter(),
760
- items: Joi.array().items(LeadPlatformModel.Ticket()),
761
- page: LeadPlatformModel.Page(),
762
- });
763
- }
764
-
765
- /** @returns {UserSchema} */
766
- static UserSchema() {
752
+ /** @returns {Ticket} */
753
+ static Ticket() {
767
754
  return Joi.object({
768
- _id: Joi.string().allow(""),
769
- account_type: Joi.string().allow(""),
770
- active: Joi.boolean(),
771
- application_id: Joi.string().allow(""),
772
- created_at: Joi.string().allow(""),
773
- dob: Joi.string().allow(""),
774
- emails: Joi.array().items(LeadPlatformModel.Email()),
775
- external_id: Joi.string().allow(""),
776
- first_name: Joi.string().allow(""),
777
- gender: Joi.string().allow(""),
778
- last_name: Joi.string().allow(""),
779
- meta: Joi.any(),
780
- phone_numbers: Joi.array().items(LeadPlatformModel.PhoneNumber()),
781
- profile_pic_url: Joi.string().allow(""),
755
+ context: LeadPlatformModel.TicketContext(),
756
+ created_on: LeadPlatformModel.CreatedOn(),
757
+ response_id: Joi.string().allow(""),
758
+ content: LeadPlatformModel.TicketContent(),
759
+ category: LeadPlatformModel.TicketCategory().required(),
760
+ sub_category: Joi.string().allow(""),
761
+ source: LeadPlatformModel.TicketSourceEnum().required(),
762
+ status: LeadPlatformModel.Status().required(),
763
+ priority: LeadPlatformModel.Priority().required(),
764
+ created_by: Joi.any(),
765
+ assigned_to: Joi.any(),
766
+ tags: Joi.array().items(Joi.string().allow("")),
767
+ _custom_json: Joi.any(),
768
+ is_feedback_pending: Joi.boolean(),
769
+ integration: Joi.any(),
770
+ _id: Joi.string().allow("").required(),
782
771
  updated_at: Joi.string().allow(""),
783
- user_id: Joi.string().allow(""),
784
- username: Joi.string().allow(""),
772
+ created_at: Joi.string().allow(""),
785
773
  });
786
774
  }
787
775
 
788
776
  /**
789
- * Enum: HistoryTypeEnum Used By: Lead
777
+ * Enum: PriorityEnum Used By: Lead
790
778
  *
791
- * @returns {HistoryTypeEnum}
779
+ * @returns {PriorityEnum}
792
780
  */
793
- static HistoryTypeEnum() {
781
+ static PriorityEnum() {
794
782
  return Joi.string().valid(
795
- "rating",
783
+ "low",
796
784
 
797
- "log",
785
+ "medium",
798
786
 
799
- "comment",
787
+ "high",
800
788
 
801
- "thread"
789
+ "urgent"
802
790
  );
803
791
  }
804
792
 
805
793
  /**
806
- * Enum: PriorityEnum Used By: Lead
794
+ * Enum: HistoryTypeEnum Used By: Lead
807
795
  *
808
- * @returns {PriorityEnum}
796
+ * @returns {HistoryTypeEnum}
809
797
  */
810
- static PriorityEnum() {
798
+ static HistoryTypeEnum() {
811
799
  return Joi.string().valid(
812
- "low",
813
-
814
- "medium",
800
+ "rating",
815
801
 
816
- "high",
802
+ "log",
817
803
 
818
- "urgent"
804
+ "comment"
819
805
  );
820
806
  }
821
807