@gofynd/fdk-client-javascript 1.4.2-beta.2 → 1.4.2-beta.4

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