@gofynd/fdk-client-javascript 1.3.11-beta.7 → 1.3.11-beta.8

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