@gofynd/fdk-client-javascript 1.4.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 +990 -1589
  191. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +986 -1702
  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,225 +1,225 @@
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
11
- * @property {string[]} [subscribers]
4
+ * @typedef TicketHistoryPayload
5
+ * @property {Object} value - Details of history event
6
+ * @property {HistoryTypeEnum} type
12
7
  */
13
8
 
14
9
  /**
15
- * @typedef CreatedOn
16
- * @property {string} user_agent - Useragent details
10
+ * @typedef CustomFormSubmissionPayload
11
+ * @property {Object[]} response - Form response
12
+ * @property {TicketAsset[]} [attachments] - List of all attachments related to the form
17
13
  */
18
14
 
19
15
  /**
20
- * @typedef CustomForm
21
- * @property {string} _id - Unique identifier for the form
22
- * @property {string} application_id - Application ID for form
23
- * @property {CreatedOn} [created_on]
24
- * @property {string} [description] - Form description that will be shown to the user
25
- * @property {string} [header_image] - Form header image that will be shown to the user
26
- * @property {Object[]} inputs - List of all the form fields
27
- * @property {boolean} login_required - Denotes if login is required to make a
28
- * form response submission
29
- * @property {PollForAssignment} [poll_for_assignment]
30
- * @property {Priority} priority
31
- * @property {boolean} should_notify - Denotes if new response submission for
32
- * the form should be notified to the assignees
33
- * @property {string} slug - Slug for the form, which is to be used for accessing the form
34
- * @property {SubmitButton} [submit_button]
35
- * @property {string} [success_message] - Message that is to be shown on
36
- * succesfull form response submission
37
- * @property {string} title - Form title that will be shown to the user
16
+ * @typedef GetTokenForVideoRoomResponse
17
+ * @property {string} access_token - Access token to be used for video room
38
18
  */
39
19
 
40
20
  /**
41
- * @typedef CustomFormSubmissionPayload
42
- * @property {TicketAsset[]} [attachments] - List of all attachments related to the form
43
- * @property {Object[]} response - Form response
21
+ * @typedef GetParticipantsInsideVideoRoomResponse
22
+ * @property {Participant[]} participants - List of participants of the video room
44
23
  */
45
24
 
46
25
  /**
47
- * @typedef Debug
48
- * @property {string} [platform] - Platform of user
49
- * @property {string} [source] - Source of user
26
+ * @typedef Participant
27
+ * @property {UserSchema} [user]
28
+ * @property {string} [identity] - Unique identifier of participant
29
+ * @property {string} [status] - Status of participant
30
+ */
31
+
32
+ /**
33
+ * @typedef UserSchema
34
+ * @property {string} [application_id]
35
+ * @property {string} [user_id]
36
+ * @property {string} [first_name]
37
+ * @property {Object} [meta]
38
+ * @property {string} [last_name]
39
+ * @property {PhoneNumber[]} [phone_numbers]
40
+ * @property {Email[]} [emails]
41
+ * @property {string} [gender]
42
+ * @property {string} [dob]
43
+ * @property {boolean} [active]
44
+ * @property {string} [profile_pic_url]
45
+ * @property {string} [username]
46
+ * @property {string} [account_type]
47
+ * @property {string} [_id]
48
+ * @property {string} [created_at]
49
+ * @property {string} [updated_at]
50
+ */
51
+
52
+ /**
53
+ * @typedef PhoneNumber
54
+ * @property {boolean} [active] - Denotes if the phone number is active
55
+ * @property {boolean} [primary] - Denotes it's the primary phone number for the account
56
+ * @property {boolean} [verified] - Denotes it's a verified phone number
57
+ * @property {string} [phone] - Phone number
58
+ * @property {number} [country_code] - Country code
50
59
  */
51
60
 
52
61
  /**
53
62
  * @typedef Email
54
- * @property {boolean} [active] - Denotes if the email is active
55
- * @property {string} [email] - Email Address
56
63
  * @property {boolean} [primary] - Denotes it's the primary email for the account
57
64
  * @property {boolean} [verified] - Denotes it's a verified email
65
+ * @property {string} [email] - Email Address
66
+ * @property {boolean} [active] - Denotes if the email is active
58
67
  */
59
68
 
60
69
  /**
61
- * @typedef FeedbackForm
62
- * @property {Object} [inputs] - Input details for the feed back form
63
- * @property {Object} [timestamps] - Gives details of category releted data
64
- * @property {string} [title] - Title for the feed back form
70
+ * @typedef Debug
71
+ * @property {string} [source] - Source of user
72
+ * @property {string} [platform] - Platform of user
65
73
  */
66
74
 
67
75
  /**
68
- * @typedef GetParticipantsInsideVideoRoomResponse
69
- * @property {Participant[]} participants - List of participants of the video room
76
+ * @typedef SubmitCustomFormResponse
77
+ * @property {string} message - Success message for form submission
78
+ * @property {Ticket} [ticket]
70
79
  */
71
80
 
72
81
  /**
73
- * @typedef GetTokenForVideoRoomResponse
74
- * @property {string} access_token - Access token to be used for video room
82
+ * @typedef TicketContext
83
+ * @property {string} [application_id] - Application ID related to the ticket
84
+ * @property {string} company_id - Company ID related to the ticket
75
85
  */
76
86
 
77
87
  /**
78
- * @typedef Participant
79
- * @property {string} [identity] - Unique identifier of participant
80
- * @property {string} [status] - Status of participant
81
- * @property {UserSchema} [user]
88
+ * @typedef CreatedOn
89
+ * @property {string} user_agent - Useragent details
82
90
  */
83
91
 
84
92
  /**
85
- * @typedef PhoneNumber
86
- * @property {boolean} [active] - Denotes if the phone number is active
87
- * @property {number} [country_code] - Country code
88
- * @property {string} [phone] - Phone number
89
- * @property {boolean} [primary] - Denotes it's the primary phone number for the account
90
- * @property {boolean} [verified] - Denotes it's a verified phone number
93
+ * @typedef TicketAsset
94
+ * @property {string} [display] - Display text for asset
95
+ * @property {string} value - To be used for details
96
+ * @property {TicketAssetTypeEnum} type
91
97
  */
92
98
 
93
99
  /**
94
- * @typedef PollForAssignment
95
- * @property {number} duration - Duration for polling of staff
96
- * @property {string} failure_message - Message if polling failed
97
- * @property {string} message - Message for polling
98
- * @property {string} success_message - Message for successful polling
100
+ * @typedef TicketContent
101
+ * @property {string} title - Title for ticket
102
+ * @property {string} [description] - Long description of issue
103
+ * @property {TicketAsset[]} [attachments] - List of all attachments related to the ticket
104
+ */
105
+
106
+ /**
107
+ * @typedef AddTicketPayload
108
+ * @property {Object} [created_by] - Creator of the ticket
109
+ * @property {string} [status] - Status of the ticket
110
+ * @property {PriorityEnum} [priority]
111
+ * @property {string} category - Category of the ticket
112
+ * @property {TicketContent} content
113
+ * @property {Object} [_custom_json] - Optional custom data that needs to be sent
114
+ * @property {string[]} [subscribers]
99
115
  */
100
116
 
101
117
  /**
102
118
  * @typedef Priority
103
- * @property {string} color - Color for priority
104
- * @property {string} display - Display text for priority
105
119
  * @property {PriorityEnum} key
120
+ * @property {string} display - Display text for priority
121
+ * @property {string} color - Color for priority
106
122
  */
107
123
 
108
124
  /**
109
125
  * @typedef Status
110
- * @property {string} color - Color for status
111
- * @property {string} display - Display text for status
112
126
  * @property {string} key - Key for status
127
+ * @property {string} display - Display text for status
128
+ * @property {string} color - Color for status
113
129
  */
114
130
 
115
131
  /**
116
132
  * @typedef SubmitButton
117
- * @property {string} background_color - Color for submit button
118
133
  * @property {string} title - Title for submit button
119
134
  * @property {string} title_color - Title color submit button
135
+ * @property {string} background_color - Color for submit button
120
136
  */
121
137
 
122
138
  /**
123
- * @typedef SubmitCustomFormResponse
124
- * @property {string} message - Success message for form submission
125
- * @property {Ticket} [ticket]
139
+ * @typedef PollForAssignment
140
+ * @property {number} duration - Duration for polling of staff
141
+ * @property {string} message - Message for polling
142
+ * @property {string} success_message - Message for successful polling
143
+ * @property {string} failure_message - Message if polling failed
126
144
  */
127
145
 
128
146
  /**
129
- * @typedef Ticket
130
- * @property {Object} [_custom_json] - Custom json relevant to the ticket
131
- * @property {string} _id - Unique identifier for the ticket
132
- * @property {Object} [assigned_to] - Details of support staff to whom ticket is assigned
133
- * @property {TicketCategory} category
134
- * @property {TicketContent} [content]
135
- * @property {TicketContext} [context]
136
- * @property {string} [created_at] - Time when the ticket was created
137
- * @property {Object} [created_by] - User details of ticket creator
138
- * @property {CreatedOn} [created_on]
139
- * @property {Object} [integration] - Integration type and its details of the ticket
140
- * @property {boolean} [is_feedback_pending] - Denotes if feedback submission is
141
- * pending for the ticket
147
+ * @typedef CustomForm
148
+ * @property {string} application_id - Application ID for form
149
+ * @property {string} slug - Slug for the form, which is to be used for accessing the form
150
+ * @property {string} [header_image] - Form header image that will be shown to the user
151
+ * @property {string} title - Form title that will be shown to the user
152
+ * @property {string} [description] - Form description that will be shown to the user
142
153
  * @property {Priority} priority
143
- * @property {string} [response_id] - Details of company and application
144
- * realated to the ticket
145
- * @property {TicketSourceEnum} source
146
- * @property {Status} status
147
- * @property {string} [sub_category] - Sub-category assigned to the ticket
148
- * @property {string[]} [tags] - Tags relevant to ticket
149
- * @property {string} [updated_at] - Time when the ticket was last updated
154
+ * @property {boolean} login_required - Denotes if login is required to make a
155
+ * form response submission
156
+ * @property {boolean} should_notify - Denotes if new response submission for
157
+ * the form should be notified to the assignees
158
+ * @property {string} [success_message] - Message that is to be shown on
159
+ * succesfull form response submission
160
+ * @property {SubmitButton} [submit_button]
161
+ * @property {Object[]} inputs - List of all the form fields
162
+ * @property {CreatedOn} [created_on]
163
+ * @property {PollForAssignment} [poll_for_assignment]
164
+ * @property {string} _id - Unique identifier for the form
150
165
  */
151
166
 
152
167
  /**
153
- * @typedef TicketAsset
154
- * @property {string} [display] - Display text for asset
155
- * @property {TicketAssetTypeEnum} type
156
- * @property {string} value - To be used for details
168
+ * @typedef FeedbackForm
169
+ * @property {Object} [inputs] - Input details for the feed back form
170
+ * @property {string} [title] - Title for the feed back form
171
+ * @property {Object} [timestamps] - Gives details of category releted data
157
172
  */
158
173
 
159
174
  /**
160
175
  * @typedef TicketCategory
161
176
  * @property {string} display - Category display value identifier
162
- * @property {FeedbackForm} [feedback_form]
163
- * @property {number} [group_id] - Group id of category releted data
164
177
  * @property {string} key - Category key value identifier
165
178
  * @property {TicketCategory} [sub_categories]
166
- */
167
-
168
- /**
169
- * @typedef TicketContent
170
- * @property {TicketAsset[]} [attachments] - List of all attachments related to the ticket
171
- * @property {string} [description] - Long description of issue
172
- * @property {string} title - Title for ticket
173
- */
174
-
175
- /**
176
- * @typedef TicketContext
177
- * @property {string} [application_id] - Application ID related to the ticket
178
- * @property {string} company_id - Company ID related to the ticket
179
+ * @property {number} [group_id] - Group id of category releted data
180
+ * @property {FeedbackForm} [feedback_form]
179
181
  */
180
182
 
181
183
  /**
182
184
  * @typedef TicketHistory
183
- * @property {string} _id - Unique identifier of the history event
184
- * @property {string} [created_at] - Time of creation of the history event
185
- * @property {Object} [created_by] - User who created the history event
186
- * @property {CreatedOn} [created_on]
187
- * @property {string} ticket_id - Readable ticket number
188
185
  * @property {string} type - Type of the history event
189
- * @property {string} [updated_at] - Time of last update of the history event
190
186
  * @property {Object} value - Data of the history event
187
+ * @property {string} ticket_id - Readable ticket number
188
+ * @property {CreatedOn} [created_on]
189
+ * @property {Object} [created_by] - User who created the history event
190
+ * @property {string} _id - Unique identifier of the history event
191
+ * @property {string} [updated_at] - Time of last update of the history event
192
+ * @property {string} [created_at] - Time of creation of the history event
191
193
  */
192
194
 
193
195
  /**
194
- * @typedef TicketHistoryPayload
195
- * @property {HistoryTypeEnum} type
196
- * @property {Object} value - Details of history event
196
+ * @typedef Ticket
197
+ * @property {TicketContext} [context]
198
+ * @property {CreatedOn} [created_on]
199
+ * @property {string} [response_id] - Details of company and application
200
+ * realated to the ticket
201
+ * @property {TicketContent} [content]
202
+ * @property {TicketCategory} category
203
+ * @property {string} [sub_category] - Sub-category assigned to the ticket
204
+ * @property {TicketSourceEnum} source
205
+ * @property {Status} status
206
+ * @property {Priority} priority
207
+ * @property {Object} [created_by] - User details of ticket creator
208
+ * @property {Object} [assigned_to] - Details of support staff to whom ticket is assigned
209
+ * @property {string[]} [tags] - Tags relevant to ticket
210
+ * @property {Object} [_custom_json] - Custom json relevant to the ticket
211
+ * @property {boolean} [is_feedback_pending] - Denotes if feedback submission is
212
+ * pending for the ticket
213
+ * @property {Object} [integration] - Integration type and its details of the ticket
214
+ * @property {string} _id - Unique identifier for the ticket
215
+ * @property {string} [updated_at] - Time when the ticket was last updated
216
+ * @property {string} [created_at] - Time when the ticket was created
197
217
  */
198
218
 
199
- /**
200
- * @typedef UserSchema
201
- * @property {string} [_id]
202
- * @property {string} [account_type]
203
- * @property {boolean} [active]
204
- * @property {string} [application_id]
205
- * @property {string} [created_at]
206
- * @property {string} [dob]
207
- * @property {Email[]} [emails]
208
- * @property {string} [first_name]
209
- * @property {string} [gender]
210
- * @property {string} [last_name]
211
- * @property {Object} [meta]
212
- * @property {PhoneNumber[]} [phone_numbers]
213
- * @property {string} [profile_pic_url]
214
- * @property {string} [updated_at]
215
- * @property {string} [user_id]
216
- * @property {string} [username]
217
- */
219
+ /** @typedef {"low" | "medium" | "high" | "urgent"} PriorityEnum */
218
220
 
219
221
  /** @typedef {"rating" | "log" | "comment" | "thread"} HistoryTypeEnum */
220
222
 
221
- /** @typedef {"low" | "medium" | "high" | "urgent"} PriorityEnum */
222
-
223
223
  /**
224
224
  * @typedef {| "image"
225
225
  * | "video"
@@ -235,192 +235,215 @@ const Joi = require("joi");
235
235
  /** @typedef {"platform_panel" | "sales_channel"} TicketSourceEnum */
236
236
 
237
237
  class LeadApplicationModel {
238
- /** @returns {AddTicketPayload} */
239
- static AddTicketPayload() {
238
+ /** @returns {TicketHistoryPayload} */
239
+ static TicketHistoryPayload() {
240
240
  return Joi.object({
241
- _custom_json: Joi.any(),
242
- category: Joi.string().allow("").required(),
243
- content: LeadApplicationModel.TicketContent().required(),
244
- created_by: Joi.any(),
245
- priority: LeadApplicationModel.PriorityEnum(),
246
- status: Joi.string().allow(""),
247
- subscribers: Joi.array().items(Joi.string().allow("")),
241
+ value: Joi.any().required(),
242
+ type: LeadApplicationModel.HistoryTypeEnum().required(),
248
243
  });
249
244
  }
250
245
 
251
- /** @returns {CreatedOn} */
252
- static CreatedOn() {
246
+ /** @returns {CustomFormSubmissionPayload} */
247
+ static CustomFormSubmissionPayload() {
253
248
  return Joi.object({
254
- user_agent: Joi.string().allow("").required(),
249
+ response: Joi.array().items(Joi.any()).required(),
250
+ attachments: Joi.array().items(LeadApplicationModel.TicketAsset()),
255
251
  });
256
252
  }
257
253
 
258
- /** @returns {CustomForm} */
259
- static CustomForm() {
254
+ /** @returns {GetTokenForVideoRoomResponse} */
255
+ static GetTokenForVideoRoomResponse() {
260
256
  return Joi.object({
261
- _id: Joi.string().allow("").required(),
262
- application_id: Joi.string().allow("").required(),
263
- created_on: LeadApplicationModel.CreatedOn(),
264
- description: Joi.string().allow(""),
265
- header_image: Joi.string().allow(""),
266
- inputs: Joi.array().items(Joi.any()).required(),
267
- login_required: Joi.boolean().required(),
268
- poll_for_assignment: LeadApplicationModel.PollForAssignment(),
269
- priority: LeadApplicationModel.Priority().required(),
270
- should_notify: Joi.boolean().required(),
271
- slug: Joi.string().allow("").required(),
272
- submit_button: LeadApplicationModel.SubmitButton(),
273
- success_message: Joi.string().allow(""),
274
- title: Joi.string().allow("").required(),
257
+ access_token: Joi.string().allow("").required(),
275
258
  });
276
259
  }
277
260
 
278
- /** @returns {CustomFormSubmissionPayload} */
279
- static CustomFormSubmissionPayload() {
261
+ /** @returns {GetParticipantsInsideVideoRoomResponse} */
262
+ static GetParticipantsInsideVideoRoomResponse() {
280
263
  return Joi.object({
281
- attachments: Joi.array().items(LeadApplicationModel.TicketAsset()),
282
- response: Joi.array().items(Joi.any()).required(),
264
+ participants: Joi.array()
265
+ .items(LeadApplicationModel.Participant())
266
+ .required(),
267
+ });
268
+ }
269
+
270
+ /** @returns {Participant} */
271
+ static Participant() {
272
+ return Joi.object({
273
+ user: LeadApplicationModel.UserSchema(),
274
+ identity: Joi.string().allow(""),
275
+ status: Joi.string().allow(""),
276
+ });
277
+ }
278
+
279
+ /** @returns {UserSchema} */
280
+ static UserSchema() {
281
+ return Joi.object({
282
+ application_id: Joi.string().allow(""),
283
+ user_id: Joi.string().allow(""),
284
+ first_name: Joi.string().allow(""),
285
+ meta: Joi.any(),
286
+ last_name: Joi.string().allow(""),
287
+ phone_numbers: Joi.array().items(LeadApplicationModel.PhoneNumber()),
288
+ emails: Joi.array().items(LeadApplicationModel.Email()),
289
+ gender: Joi.string().allow(""),
290
+ dob: Joi.string().allow(""),
291
+ active: Joi.boolean(),
292
+ profile_pic_url: Joi.string().allow(""),
293
+ username: Joi.string().allow(""),
294
+ account_type: Joi.string().allow(""),
295
+ _id: Joi.string().allow(""),
296
+ created_at: Joi.string().allow(""),
297
+ updated_at: Joi.string().allow(""),
283
298
  });
284
299
  }
285
300
 
286
- /** @returns {Debug} */
287
- static Debug() {
301
+ /** @returns {PhoneNumber} */
302
+ static PhoneNumber() {
288
303
  return Joi.object({
289
- platform: Joi.string().allow(""),
290
- source: Joi.string().allow(""),
304
+ active: Joi.boolean(),
305
+ primary: Joi.boolean(),
306
+ verified: Joi.boolean(),
307
+ phone: Joi.string().allow(""),
308
+ country_code: Joi.number(),
291
309
  });
292
310
  }
293
311
 
294
312
  /** @returns {Email} */
295
313
  static Email() {
296
314
  return Joi.object({
297
- active: Joi.boolean(),
298
- email: Joi.string().allow(""),
299
315
  primary: Joi.boolean(),
300
316
  verified: Joi.boolean(),
317
+ email: Joi.string().allow(""),
318
+ active: Joi.boolean(),
301
319
  });
302
320
  }
303
321
 
304
- /** @returns {FeedbackForm} */
305
- static FeedbackForm() {
322
+ /** @returns {Debug} */
323
+ static Debug() {
306
324
  return Joi.object({
307
- inputs: Joi.any(),
308
- timestamps: Joi.any(),
309
- title: Joi.string().allow(""),
325
+ source: Joi.string().allow(""),
326
+ platform: Joi.string().allow(""),
310
327
  });
311
328
  }
312
329
 
313
- /** @returns {GetParticipantsInsideVideoRoomResponse} */
314
- static GetParticipantsInsideVideoRoomResponse() {
330
+ /** @returns {SubmitCustomFormResponse} */
331
+ static SubmitCustomFormResponse() {
315
332
  return Joi.object({
316
- participants: Joi.array()
317
- .items(LeadApplicationModel.Participant())
318
- .required(),
333
+ message: Joi.string().allow("").required(),
334
+ ticket: LeadApplicationModel.Ticket(),
319
335
  });
320
336
  }
321
337
 
322
- /** @returns {GetTokenForVideoRoomResponse} */
323
- static GetTokenForVideoRoomResponse() {
338
+ /** @returns {TicketContext} */
339
+ static TicketContext() {
324
340
  return Joi.object({
325
- access_token: Joi.string().allow("").required(),
341
+ application_id: Joi.string().allow(""),
342
+ company_id: Joi.string().allow("").required(),
326
343
  });
327
344
  }
328
345
 
329
- /** @returns {Participant} */
330
- static Participant() {
346
+ /** @returns {CreatedOn} */
347
+ static CreatedOn() {
331
348
  return Joi.object({
332
- identity: Joi.string().allow(""),
333
- status: Joi.string().allow(""),
334
- user: LeadApplicationModel.UserSchema(),
349
+ user_agent: Joi.string().allow("").required(),
335
350
  });
336
351
  }
337
352
 
338
- /** @returns {PhoneNumber} */
339
- static PhoneNumber() {
353
+ /** @returns {TicketAsset} */
354
+ static TicketAsset() {
340
355
  return Joi.object({
341
- active: Joi.boolean(),
342
- country_code: Joi.number(),
343
- phone: Joi.string().allow(""),
344
- primary: Joi.boolean(),
345
- verified: Joi.boolean(),
356
+ display: Joi.string().allow(""),
357
+ value: Joi.string().allow("").required(),
358
+ type: LeadApplicationModel.TicketAssetTypeEnum().required(),
346
359
  });
347
360
  }
348
361
 
349
- /** @returns {PollForAssignment} */
350
- static PollForAssignment() {
362
+ /** @returns {TicketContent} */
363
+ static TicketContent() {
351
364
  return Joi.object({
352
- duration: Joi.number().required(),
353
- failure_message: Joi.string().allow("").required(),
354
- message: Joi.string().allow("").required(),
355
- success_message: Joi.string().allow("").required(),
365
+ title: Joi.string().allow("").required(),
366
+ description: Joi.string().allow(""),
367
+ attachments: Joi.array().items(LeadApplicationModel.TicketAsset()),
368
+ });
369
+ }
370
+
371
+ /** @returns {AddTicketPayload} */
372
+ static AddTicketPayload() {
373
+ return Joi.object({
374
+ created_by: Joi.any(),
375
+ status: Joi.string().allow(""),
376
+ priority: LeadApplicationModel.PriorityEnum(),
377
+ category: Joi.string().allow("").required(),
378
+ content: LeadApplicationModel.TicketContent().required(),
379
+ _custom_json: Joi.any(),
380
+ subscribers: Joi.array().items(Joi.string().allow("")),
356
381
  });
357
382
  }
358
383
 
359
384
  /** @returns {Priority} */
360
385
  static Priority() {
361
386
  return Joi.object({
362
- color: Joi.string().allow("").required(),
363
- display: Joi.string().allow("").required(),
364
387
  key: LeadApplicationModel.PriorityEnum().required(),
388
+ display: Joi.string().allow("").required(),
389
+ color: Joi.string().allow("").required(),
365
390
  });
366
391
  }
367
392
 
368
393
  /** @returns {Status} */
369
394
  static Status() {
370
395
  return Joi.object({
371
- color: Joi.string().allow("").required(),
372
- display: Joi.string().allow("").required(),
373
396
  key: Joi.string().allow("").required(),
397
+ display: Joi.string().allow("").required(),
398
+ color: Joi.string().allow("").required(),
374
399
  });
375
400
  }
376
401
 
377
402
  /** @returns {SubmitButton} */
378
403
  static SubmitButton() {
379
404
  return Joi.object({
380
- background_color: Joi.string().allow("").required(),
381
405
  title: Joi.string().allow("").required(),
382
406
  title_color: Joi.string().allow("").required(),
407
+ background_color: Joi.string().allow("").required(),
383
408
  });
384
409
  }
385
410
 
386
- /** @returns {SubmitCustomFormResponse} */
387
- static SubmitCustomFormResponse() {
411
+ /** @returns {PollForAssignment} */
412
+ static PollForAssignment() {
388
413
  return Joi.object({
414
+ duration: Joi.number().required(),
389
415
  message: Joi.string().allow("").required(),
390
- ticket: LeadApplicationModel.Ticket(),
416
+ success_message: Joi.string().allow("").required(),
417
+ failure_message: Joi.string().allow("").required(),
391
418
  });
392
419
  }
393
420
 
394
- /** @returns {Ticket} */
395
- static Ticket() {
421
+ /** @returns {CustomForm} */
422
+ static CustomForm() {
396
423
  return Joi.object({
397
- _custom_json: Joi.any(),
398
- _id: Joi.string().allow("").required(),
399
- assigned_to: Joi.any(),
400
- category: LeadApplicationModel.TicketCategory().required(),
401
- content: LeadApplicationModel.TicketContent(),
402
- context: LeadApplicationModel.TicketContext(),
403
- created_at: Joi.string().allow(""),
404
- created_by: Joi.any(),
405
- created_on: LeadApplicationModel.CreatedOn(),
406
- integration: Joi.any(),
407
- is_feedback_pending: Joi.boolean(),
424
+ application_id: Joi.string().allow("").required(),
425
+ slug: Joi.string().allow("").required(),
426
+ header_image: Joi.string().allow(""),
427
+ title: Joi.string().allow("").required(),
428
+ description: Joi.string().allow(""),
408
429
  priority: LeadApplicationModel.Priority().required(),
409
- response_id: Joi.string().allow(""),
410
- source: LeadApplicationModel.TicketSourceEnum().required(),
411
- status: LeadApplicationModel.Status().required(),
412
- sub_category: Joi.string().allow(""),
413
- tags: Joi.array().items(Joi.string().allow("")),
414
- updated_at: Joi.string().allow(""),
430
+ login_required: Joi.boolean().required(),
431
+ should_notify: Joi.boolean().required(),
432
+ success_message: Joi.string().allow(""),
433
+ submit_button: LeadApplicationModel.SubmitButton(),
434
+ inputs: Joi.array().items(Joi.any()).required(),
435
+ created_on: LeadApplicationModel.CreatedOn(),
436
+ poll_for_assignment: LeadApplicationModel.PollForAssignment(),
437
+ _id: Joi.string().allow("").required(),
415
438
  });
416
439
  }
417
440
 
418
- /** @returns {TicketAsset} */
419
- static TicketAsset() {
441
+ /** @returns {FeedbackForm} */
442
+ static FeedbackForm() {
420
443
  return Joi.object({
421
- display: Joi.string().allow(""),
422
- type: LeadApplicationModel.TicketAssetTypeEnum().required(),
423
- value: Joi.string().allow("").required(),
444
+ inputs: Joi.any(),
445
+ title: Joi.string().allow(""),
446
+ timestamps: Joi.any(),
424
447
  });
425
448
  }
426
449
 
@@ -428,105 +451,82 @@ class LeadApplicationModel {
428
451
  static TicketCategory() {
429
452
  return Joi.object({
430
453
  display: Joi.string().allow("").required(),
431
- feedback_form: LeadApplicationModel.FeedbackForm(),
432
- group_id: Joi.number(),
433
454
  key: Joi.string().allow("").required(),
434
455
  sub_categories: Joi.link("#TicketCategory"),
456
+ group_id: Joi.number(),
457
+ feedback_form: LeadApplicationModel.FeedbackForm(),
435
458
  }).id("TicketCategory");
436
459
  }
437
460
 
438
- /** @returns {TicketContent} */
439
- static TicketContent() {
440
- return Joi.object({
441
- attachments: Joi.array().items(LeadApplicationModel.TicketAsset()),
442
- description: Joi.string().allow(""),
443
- title: Joi.string().allow("").required(),
444
- });
445
- }
446
-
447
- /** @returns {TicketContext} */
448
- static TicketContext() {
449
- return Joi.object({
450
- application_id: Joi.string().allow(""),
451
- company_id: Joi.string().allow("").required(),
452
- });
453
- }
454
-
455
461
  /** @returns {TicketHistory} */
456
462
  static TicketHistory() {
457
463
  return Joi.object({
458
- _id: Joi.string().allow("").required(),
459
- created_at: Joi.string().allow(""),
460
- created_by: Joi.any(),
461
- created_on: LeadApplicationModel.CreatedOn(),
462
- ticket_id: Joi.string().allow("").required(),
463
464
  type: Joi.string().allow("").required(),
464
- updated_at: Joi.string().allow(""),
465
- value: Joi.any().required(),
466
- });
467
- }
468
-
469
- /** @returns {TicketHistoryPayload} */
470
- static TicketHistoryPayload() {
471
- return Joi.object({
472
- type: LeadApplicationModel.HistoryTypeEnum().required(),
473
465
  value: Joi.any().required(),
466
+ ticket_id: Joi.string().allow("").required(),
467
+ created_on: LeadApplicationModel.CreatedOn(),
468
+ created_by: Joi.any(),
469
+ _id: Joi.string().allow("").required(),
470
+ updated_at: Joi.string().allow(""),
471
+ created_at: Joi.string().allow(""),
474
472
  });
475
473
  }
476
474
 
477
- /** @returns {UserSchema} */
478
- static UserSchema() {
475
+ /** @returns {Ticket} */
476
+ static Ticket() {
479
477
  return Joi.object({
480
- _id: Joi.string().allow(""),
481
- account_type: Joi.string().allow(""),
482
- active: Joi.boolean(),
483
- application_id: Joi.string().allow(""),
484
- created_at: Joi.string().allow(""),
485
- dob: Joi.string().allow(""),
486
- emails: Joi.array().items(LeadApplicationModel.Email()),
487
- first_name: Joi.string().allow(""),
488
- gender: Joi.string().allow(""),
489
- last_name: Joi.string().allow(""),
490
- meta: Joi.any(),
491
- phone_numbers: Joi.array().items(LeadApplicationModel.PhoneNumber()),
492
- profile_pic_url: Joi.string().allow(""),
478
+ context: LeadApplicationModel.TicketContext(),
479
+ created_on: LeadApplicationModel.CreatedOn(),
480
+ response_id: Joi.string().allow(""),
481
+ content: LeadApplicationModel.TicketContent(),
482
+ category: LeadApplicationModel.TicketCategory().required(),
483
+ sub_category: Joi.string().allow(""),
484
+ source: LeadApplicationModel.TicketSourceEnum().required(),
485
+ status: LeadApplicationModel.Status().required(),
486
+ priority: LeadApplicationModel.Priority().required(),
487
+ created_by: Joi.any(),
488
+ assigned_to: Joi.any(),
489
+ tags: Joi.array().items(Joi.string().allow("")),
490
+ _custom_json: Joi.any(),
491
+ is_feedback_pending: Joi.boolean(),
492
+ integration: Joi.any(),
493
+ _id: Joi.string().allow("").required(),
493
494
  updated_at: Joi.string().allow(""),
494
- user_id: Joi.string().allow(""),
495
- username: Joi.string().allow(""),
495
+ created_at: Joi.string().allow(""),
496
496
  });
497
497
  }
498
498
 
499
499
  /**
500
- * Enum: HistoryTypeEnum Used By: Lead
500
+ * Enum: PriorityEnum Used By: Lead
501
501
  *
502
- * @returns {HistoryTypeEnum}
502
+ * @returns {PriorityEnum}
503
503
  */
504
- static HistoryTypeEnum() {
504
+ static PriorityEnum() {
505
505
  return Joi.string().valid(
506
- "rating",
506
+ "low",
507
507
 
508
- "log",
508
+ "medium",
509
509
 
510
- "comment",
510
+ "high",
511
511
 
512
- "thread"
512
+ "urgent"
513
513
  );
514
514
  }
515
515
 
516
516
  /**
517
- * Enum: PriorityEnum Used By: Lead
517
+ * Enum: HistoryTypeEnum Used By: Lead
518
518
  *
519
- * @returns {PriorityEnum}
519
+ * @returns {HistoryTypeEnum}
520
520
  */
521
- static PriorityEnum() {
521
+ static HistoryTypeEnum() {
522
522
  return Joi.string().valid(
523
- "low",
523
+ "rating",
524
524
 
525
- "medium",
525
+ "log",
526
526
 
527
- "high",
527
+ "comment",
528
528
 
529
- "urgent"
529
+ "thread"
530
530
  );
531
531
  }
532
532