@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,167 +1,118 @@
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 partner 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
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
76
+ * @typedef AgentChangePayload
77
+ * @property {string} agent_id - Agent's unique ID
127
78
  */
128
79
 
129
80
  /**
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
81
+ * @typedef CreateVideoRoomResponse
82
+ * @property {string} unique_name - Video Room's unique name
134
83
  */
135
84
 
136
85
  /**
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
86
+ * @typedef CloseVideoRoomResponse
87
+ * @property {boolean} success - Denotes if operation was successfully
142
88
  */
143
89
 
144
90
  /**
145
- * @typedef GeneralConfigIntegrationSchema
91
+ * @typedef GeneralConfigResponse
92
+ * @property {SupportCommunicationSchema[]} [support_communication]
146
93
  * @property {string} [type]
94
+ * @property {GeneralConfigIntegrationSchema} [integration]
95
+ * @property {string[]} [available_integration]
147
96
  */
148
97
 
149
98
  /**
150
- * @typedef GeneralConfigResponse
151
- * @property {string[]} [available_integration]
152
- * @property {GeneralConfigIntegrationSchema} [integration]
153
- * @property {SupportCommunicationSchema[]} [support_communication]
99
+ * @typedef SupportCommunicationSchema
154
100
  * @property {string} [type]
101
+ * @property {string} [title]
102
+ * @property {Object} [value]
103
+ * @property {string} [description]
104
+ * @property {boolean} [enabled]
155
105
  */
156
106
 
157
107
  /**
158
- * @typedef GetParticipantsInsideVideoRoomResponse
159
- * @property {Participant[]} participants - List of participants of the video room
108
+ * @typedef GeneralConfigIntegrationSchema
109
+ * @property {string} [type]
160
110
  */
161
111
 
162
112
  /**
163
- * @typedef GetTokenForVideoRoomResponse
164
- * @property {string} access_token - Access token to be used for video room
113
+ * @typedef CreateVideoRoomPayload
114
+ * @property {string} unique_name - Ticket id
115
+ * @property {NotifyUser[]} [notify] - List of people to be notified
165
116
  */
166
117
 
167
118
  /**
@@ -171,133 +122,125 @@ const Joi = require("joi");
171
122
  */
172
123
 
173
124
  /**
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
125
+ * @typedef Filter
126
+ * @property {Priority[]} priorities - List of possible priorities for tickets
127
+ * @property {TicketCategory[]} [categories] - List of possible categories for tickets
128
+ * @property {Status[]} statuses - List of possible statuses for tickets
129
+ * @property {Object[]} assignees - List of support staff availble for tickets assignment
130
+ */
131
+
132
+ /**
133
+ * @typedef TicketHistoryPayload
134
+ * @property {Object} value - Details of history event
135
+ * @property {HistoryTypeEnum} type
136
+ */
137
+
138
+ /**
139
+ * @typedef GetTokenForVideoRoomResponse
140
+ * @property {string} access_token - Access token to be used for video room
141
+ */
142
+
143
+ /**
144
+ * @typedef GetParticipantsInsideVideoRoomResponse
145
+ * @property {Participant[]} participants - List of participants of the video room
182
146
  */
183
147
 
184
148
  /**
185
149
  * @typedef Participant
150
+ * @property {UserSchema} [user]
186
151
  * @property {string} [identity] - Unique identifier of participant
187
152
  * @property {string} [status] - Status of participant
188
- * @property {UserSchema} [user]
153
+ */
154
+
155
+ /**
156
+ * @typedef UserSchema
157
+ * @property {string} [first_name] - First name
158
+ * @property {string} [last_name] - Last name
159
+ * @property {PhoneNumber[]} [phone_numbers] - List of phone numbers
160
+ * @property {Email[]} [emails] - List of email addresses
161
+ * @property {string} [gender] - Gender of user
162
+ * @property {boolean} [active] - Is account active
163
+ * @property {string} [profile_pic_url] - URL for profile pic
164
+ * @property {string} [username] - Username of user
165
+ * @property {string} [account_type] - Type of account
166
+ * @property {string} [uid] - Unique identifier of user
167
+ * @property {Debug} [debug]
168
+ * @property {boolean} [has_old_password_hash] - Denotes if user has old password hash
169
+ * @property {string} [_id] - Unique identifier of user
170
+ * @property {string} [created_at] - Time of user creation
171
+ * @property {string} [updated_at] - Last time of user details update
189
172
  */
190
173
 
191
174
  /**
192
175
  * @typedef PhoneNumber
193
176
  * @property {boolean} [active] - Denotes if the phone number is active
194
- * @property {number} [country_code] - Country code
195
- * @property {string} [phone] - Phone number
196
177
  * @property {boolean} [primary] - Denotes it's the primary phone number for the account
197
178
  * @property {boolean} [verified] - Denotes it's a verified phone number
179
+ * @property {string} [phone] - Phone number
180
+ * @property {number} [country_code] - Country code
198
181
  */
199
182
 
200
183
  /**
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
184
+ * @typedef Email
185
+ * @property {boolean} [primary] - Denotes it's the primary email for the account
186
+ * @property {boolean} [verified] - Denotes it's a verified email
187
+ * @property {string} [email] - Email Address
188
+ * @property {boolean} [active] - Denotes if the email is active
220
189
  */
221
190
 
222
191
  /**
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
192
+ * @typedef Debug
193
+ * @property {string} [source] - Source of user
194
+ * @property {string} [platform] - Platform of user
227
195
  */
228
196
 
229
197
  /**
230
- * @typedef SupportCommunicationSchema
231
- * @property {string} [description]
232
- * @property {boolean} [enabled]
233
- * @property {string} [title]
234
- * @property {string} [type]
235
- * @property {Object} [value]
198
+ * @typedef TicketContext
199
+ * @property {string} [application_id] - Application ID related to the ticket
200
+ * @property {string} partner_id - Partner ID related to the ticket
236
201
  */
237
202
 
238
203
  /**
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
204
+ * @typedef CreatedOn
205
+ * @property {string} user_agent - Useragent details
260
206
  */
261
207
 
262
208
  /**
263
209
  * @typedef TicketAsset
264
210
  * @property {string} [display] - Display text for asset
265
- * @property {TicketAssetTypeEnum} type
266
211
  * @property {string} value - To be used for details
212
+ * @property {TicketAssetTypeEnum} type
267
213
  */
268
214
 
269
215
  /**
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]
216
+ * @typedef TicketContent
217
+ * @property {string} title - Title for ticket
218
+ * @property {string} [description] - Long description of issue
219
+ * @property {TicketAsset[]} [attachments] - List of all attachments related to the ticket
276
220
  */
277
221
 
278
222
  /**
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
223
+ * @typedef AddTicketPayload
224
+ * @property {Object} [created_by] - Creator of the ticket
225
+ * @property {string} [status] - Status of the ticket
226
+ * @property {PriorityEnum} [priority]
227
+ * @property {string} category - Category of the ticket
228
+ * @property {TicketContent} content
229
+ * @property {Object} [_custom_json] - Optional custom data that needs to be sent
283
230
  */
284
231
 
285
232
  /**
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
233
+ * @typedef Priority
234
+ * @property {PriorityEnum} key
235
+ * @property {string} display - Display text for priority
236
+ * @property {string} color - Color for priority
289
237
  */
290
238
 
291
239
  /**
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
240
+ * @typedef Status
241
+ * @property {string} key - Key for status
242
+ * @property {string} display - Display text for status
243
+ * @property {string} color - Color for status
301
244
  */
302
245
 
303
246
  /**
@@ -312,59 +255,116 @@ const Joi = require("joi");
312
255
  */
313
256
 
314
257
  /**
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
258
+ * @typedef SubmitButton
259
+ * @property {string} title - Title for submit button
260
+ * @property {string} title_color - Title color submit button
261
+ * @property {string} background_color - Color for submit button
262
+ */
263
+
264
+ /**
265
+ * @typedef PollForAssignment
266
+ * @property {number} duration - Duration for polling of staff
267
+ * @property {string} message - Message for polling
268
+ * @property {string} success_message - Message for successful polling
269
+ * @property {string} failure_message - Message if polling failed
270
+ */
271
+
272
+ /**
273
+ * @typedef CustomForm
274
+ * @property {string} application_id - Application ID for form
275
+ * @property {string} slug - Slug for the form, which is to be used for accessing the form
276
+ * @property {string} [header_image] - Form header image that will be shown to the user
277
+ * @property {string} title - Form title that will be shown to the user
278
+ * @property {string} [description] - Form description that will be shown to the user
279
+ * @property {Priority} priority
280
+ * @property {boolean} login_required - Denotes if login is required to make a
281
+ * form response submission
282
+ * @property {boolean} should_notify - Denotes if new response submission for
283
+ * the form should be notified to the assignees
284
+ * @property {string} [success_message] - Message that is to be shown on
285
+ * succesfull form response submission
286
+ * @property {SubmitButton} [submit_button]
287
+ * @property {Object[]} inputs - List of all the form fields
319
288
  * @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
289
+ * @property {PollForAssignment} [poll_for_assignment]
290
+ * @property {string} _id - Unique identifier for the form
324
291
  */
325
292
 
326
293
  /**
327
- * @typedef TicketHistoryList
328
- * @property {TicketHistory[]} [items] - List of ticket history
329
- * @property {Page} [page]
294
+ * @typedef FeedbackForm
295
+ * @property {Object} [inputs] - Input details for the feed back form
296
+ * @property {string} [title] - Title for the feed back form
297
+ * @property {Object} [timestamps] - Gives details of category releted data
330
298
  */
331
299
 
332
300
  /**
333
- * @typedef TicketHistoryPayload
334
- * @property {HistoryTypeEnum} type
335
- * @property {Object} value - Details of history event
301
+ * @typedef TicketCategory
302
+ * @property {string} display - Category display value identifier
303
+ * @property {string} key - Category key value identifier
304
+ * @property {TicketCategory} [sub_categories]
305
+ * @property {number} [group_id] - Group id of category releted data
306
+ * @property {FeedbackForm} [feedback_form]
336
307
  */
337
308
 
338
309
  /**
339
- * @typedef TicketList
340
- * @property {Filter} [filters]
341
- * @property {Ticket[]} [items] - List of tickets
342
- * @property {Page} [page]
310
+ * @typedef FeedbackResponseItem
311
+ * @property {string} display - Question/Title of the form field
312
+ * @property {string} key - Key of the form field
313
+ * @property {string} value - User response value for the form field
343
314
  */
344
315
 
345
316
  /**
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
317
+ * @typedef TicketFeedback
318
+ * @property {string} _id - Unique identifier for the feedback
319
+ * @property {string} ticket_id - Readable ticket number
320
+ * @property {string} partner_id - Partner id for which ticket was raised
321
+ * @property {FeedbackResponseItem[]} response
322
+ * @property {string} [category] - Category of the ticket
323
+ * @property {Object} [user] - User who submitted the feedback
324
+ * @property {string} [updated_at] - Time when the feedback was last updated
325
+ * @property {string} [created_at] - Time when the feedback was created
362
326
  */
363
327
 
364
- /** @typedef {"rating" | "log" | "comment"} HistoryTypeEnum */
328
+ /**
329
+ * @typedef TicketHistory
330
+ * @property {string} type - Type of the history event
331
+ * @property {Object} value - Data of the history event
332
+ * @property {string} ticket_id - Readable ticket number
333
+ * @property {CreatedOn} [created_on]
334
+ * @property {Object} [created_by] - User who created the history event
335
+ * @property {string} _id - Unique identifier of the history event
336
+ * @property {string} [updated_at] - Time of last update of the history event
337
+ * @property {string} [created_at] - Time of creation of the history event
338
+ */
339
+
340
+ /**
341
+ * @typedef Ticket
342
+ * @property {TicketContext} [context]
343
+ * @property {CreatedOn} [created_on]
344
+ * @property {string} [response_id] - Details of partner and application
345
+ * realated to the ticket
346
+ * @property {TicketContent} [content]
347
+ * @property {TicketCategory} category
348
+ * @property {string} [sub_category] - Sub-category assigned to the ticket
349
+ * @property {TicketSourceEnum} source
350
+ * @property {Status} status
351
+ * @property {Priority} priority
352
+ * @property {Object} [created_by] - User details of ticket creator
353
+ * @property {Object} [assigned_to] - Details of support staff to whom ticket is assigned
354
+ * @property {string[]} [tags] - Tags relevant to ticket
355
+ * @property {Object} [_custom_json] - Custom json relevant to the ticket
356
+ * @property {boolean} [is_feedback_pending] - Denotes if feedback submission is
357
+ * pending for the ticket
358
+ * @property {Object} [integration] - Integration type and its details of the ticket
359
+ * @property {string} _id - Unique identifier for the ticket
360
+ * @property {string} [updated_at] - Time when the ticket was last updated
361
+ * @property {string} [created_at] - Time when the ticket was created
362
+ */
365
363
 
366
364
  /** @typedef {"low" | "medium" | "high" | "urgent"} PriorityEnum */
367
365
 
366
+ /** @typedef {"rating" | "log" | "comment"} HistoryTypeEnum */
367
+
368
368
  /**
369
369
  * @typedef {| "image"
370
370
  * | "video"
@@ -380,188 +380,177 @@ const Joi = require("joi");
380
380
  /** @typedef {"platform_panel" | "sales_channel"} TicketSourceEnum */
381
381
 
382
382
  class LeadPartnerModel {
383
- /** @returns {AddTicketPayload} */
384
- static AddTicketPayload() {
383
+ /** @returns {TicketList} */
384
+ static TicketList() {
385
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(""),
386
+ items: Joi.array().items(LeadPartnerModel.Ticket()),
387
+ filters: LeadPartnerModel.Filter(),
388
+ page: LeadPartnerModel.Page(),
389
+ });
390
+ }
391
+
392
+ /** @returns {Page} */
393
+ static Page() {
394
+ return Joi.object({
395
+ item_total: Joi.number(),
396
+ next_id: Joi.string().allow(""),
397
+ has_previous: Joi.boolean(),
398
+ has_next: Joi.boolean(),
399
+ current: Joi.number(),
400
+ type: Joi.string().allow("").required(),
401
+ size: Joi.number(),
392
402
  });
393
403
  }
394
404
 
395
- /** @returns {AgentChangePayload} */
396
- static AgentChangePayload() {
405
+ /** @returns {TicketHistoryList} */
406
+ static TicketHistoryList() {
397
407
  return Joi.object({
398
- agent_id: Joi.string().allow("").required(),
408
+ items: Joi.array().items(LeadPartnerModel.TicketHistory()),
409
+ page: LeadPartnerModel.Page(),
399
410
  });
400
411
  }
401
412
 
402
- /** @returns {CloseVideoRoomResponse} */
403
- static CloseVideoRoomResponse() {
413
+ /** @returns {CustomFormList} */
414
+ static CustomFormList() {
404
415
  return Joi.object({
405
- success: Joi.boolean().required(),
416
+ items: Joi.array().items(LeadPartnerModel.CustomForm()),
417
+ page: LeadPartnerModel.Page(),
406
418
  });
407
419
  }
408
420
 
409
421
  /** @returns {CreateCustomFormPayload} */
410
422
  static CreateCustomFormPayload() {
411
423
  return Joi.object({
424
+ slug: Joi.string().allow("").required(),
425
+ title: Joi.string().allow("").required(),
426
+ inputs: Joi.array().items(Joi.any()).required(),
412
427
  description: Joi.string().allow(""),
413
428
  header_image: Joi.string().allow(""),
414
- inputs: Joi.array().items(Joi.any()).required(),
415
- poll_for_assignment: LeadPartnerModel.PollForAssignment(),
416
429
  priority: LeadPartnerModel.PriorityEnum().required(),
417
430
  should_notify: Joi.boolean(),
418
- slug: Joi.string().allow("").required(),
419
431
  success_message: Joi.string().allow(""),
420
- title: Joi.string().allow("").required(),
432
+ poll_for_assignment: LeadPartnerModel.PollForAssignment(),
421
433
  });
422
434
  }
423
435
 
424
- /** @returns {CreatedOn} */
425
- static CreatedOn() {
436
+ /** @returns {EditCustomFormPayload} */
437
+ static EditCustomFormPayload() {
426
438
  return Joi.object({
427
- user_agent: Joi.string().allow("").required(),
439
+ title: Joi.string().allow("").required(),
440
+ inputs: Joi.array().items(Joi.any()).required(),
441
+ description: Joi.string().allow(""),
442
+ priority: LeadPartnerModel.PriorityEnum().required(),
443
+ header_image: Joi.string().allow(""),
444
+ should_notify: Joi.boolean(),
445
+ login_required: Joi.boolean(),
446
+ success_message: Joi.string().allow(""),
447
+ poll_for_assignment: LeadPartnerModel.PollForAssignment(),
428
448
  });
429
449
  }
430
450
 
431
- /** @returns {CreateVideoRoomPayload} */
432
- static CreateVideoRoomPayload() {
451
+ /** @returns {EditTicketPayload} */
452
+ static EditTicketPayload() {
433
453
  return Joi.object({
434
- notify: Joi.array().items(LeadPartnerModel.NotifyUser()),
435
- unique_name: Joi.string().allow("").required(),
454
+ content: LeadPartnerModel.TicketContent(),
455
+ category: Joi.string().allow(""),
456
+ sub_category: Joi.string().allow(""),
457
+ source: Joi.string().allow(""),
458
+ status: Joi.string().allow(""),
459
+ priority: LeadPartnerModel.PriorityEnum(),
460
+ assigned_to: LeadPartnerModel.AgentChangePayload(),
461
+ tags: Joi.array().items(Joi.string().allow("")),
436
462
  });
437
463
  }
438
464
 
439
- /** @returns {CreateVideoRoomResponse} */
440
- static CreateVideoRoomResponse() {
465
+ /** @returns {AgentChangePayload} */
466
+ static AgentChangePayload() {
441
467
  return Joi.object({
442
- unique_name: Joi.string().allow("").required(),
468
+ agent_id: Joi.string().allow("").required(),
443
469
  });
444
470
  }
445
471
 
446
- /** @returns {CustomForm} */
447
- static CustomForm() {
472
+ /** @returns {CreateVideoRoomResponse} */
473
+ static CreateVideoRoomResponse() {
448
474
  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(),
475
+ unique_name: Joi.string().allow("").required(),
463
476
  });
464
477
  }
465
478
 
466
- /** @returns {CustomFormList} */
467
- static CustomFormList() {
479
+ /** @returns {CloseVideoRoomResponse} */
480
+ static CloseVideoRoomResponse() {
468
481
  return Joi.object({
469
- items: Joi.array().items(LeadPartnerModel.CustomForm()),
470
- page: LeadPartnerModel.Page(),
482
+ success: Joi.boolean().required(),
471
483
  });
472
484
  }
473
485
 
474
- /** @returns {Debug} */
475
- static Debug() {
486
+ /** @returns {GeneralConfigResponse} */
487
+ static GeneralConfigResponse() {
476
488
  return Joi.object({
477
- platform: Joi.string().allow(""),
478
- source: Joi.string().allow(""),
489
+ support_communication: Joi.array().items(
490
+ LeadPartnerModel.SupportCommunicationSchema()
491
+ ),
492
+ type: Joi.string().allow(""),
493
+ integration: LeadPartnerModel.GeneralConfigIntegrationSchema(),
494
+ available_integration: Joi.array().items(Joi.string().allow("")),
479
495
  });
480
496
  }
481
497
 
482
- /** @returns {EditCustomFormPayload} */
483
- static EditCustomFormPayload() {
498
+ /** @returns {SupportCommunicationSchema} */
499
+ static SupportCommunicationSchema() {
484
500
  return Joi.object({
501
+ type: Joi.string().allow(""),
502
+ title: Joi.string().allow(""),
503
+ value: Joi.any(),
485
504
  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("")),
505
+ enabled: Joi.boolean(),
508
506
  });
509
507
  }
510
508
 
511
- /** @returns {Email} */
512
- static Email() {
509
+ /** @returns {GeneralConfigIntegrationSchema} */
510
+ static GeneralConfigIntegrationSchema() {
513
511
  return Joi.object({
514
- active: Joi.boolean(),
515
- email: Joi.string().allow(""),
516
- primary: Joi.boolean(),
517
- verified: Joi.boolean(),
512
+ type: Joi.string().allow(""),
518
513
  });
519
514
  }
520
515
 
521
- /** @returns {FeedbackForm} */
522
- static FeedbackForm() {
516
+ /** @returns {CreateVideoRoomPayload} */
517
+ static CreateVideoRoomPayload() {
523
518
  return Joi.object({
524
- inputs: Joi.any(),
525
- timestamps: Joi.any(),
526
- title: Joi.string().allow(""),
519
+ unique_name: Joi.string().allow("").required(),
520
+ notify: Joi.array().items(LeadPartnerModel.NotifyUser()),
527
521
  });
528
522
  }
529
523
 
530
- /** @returns {FeedbackResponseItem} */
531
- static FeedbackResponseItem() {
524
+ /** @returns {NotifyUser} */
525
+ static NotifyUser() {
532
526
  return Joi.object({
533
- display: Joi.string().allow("").required(),
534
- key: Joi.string().allow("").required(),
535
- value: Joi.string().allow("").required(),
527
+ country_code: Joi.string().allow("").required(),
528
+ phone_number: Joi.string().allow("").required(),
536
529
  });
537
530
  }
538
531
 
539
532
  /** @returns {Filter} */
540
533
  static Filter() {
541
534
  return Joi.object({
542
- assignees: Joi.array().items(Joi.any()).required(),
543
- categories: Joi.array().items(LeadPartnerModel.TicketCategory()),
544
535
  priorities: Joi.array().items(LeadPartnerModel.Priority()).required(),
536
+ categories: Joi.array().items(LeadPartnerModel.TicketCategory()),
545
537
  statuses: Joi.array().items(LeadPartnerModel.Status()).required(),
538
+ assignees: Joi.array().items(Joi.any()).required(),
546
539
  });
547
540
  }
548
541
 
549
- /** @returns {GeneralConfigIntegrationSchema} */
550
- static GeneralConfigIntegrationSchema() {
542
+ /** @returns {TicketHistoryPayload} */
543
+ static TicketHistoryPayload() {
551
544
  return Joi.object({
552
- type: Joi.string().allow(""),
545
+ value: Joi.any().required(),
546
+ type: LeadPartnerModel.HistoryTypeEnum().required(),
553
547
  });
554
548
  }
555
549
 
556
- /** @returns {GeneralConfigResponse} */
557
- static GeneralConfigResponse() {
550
+ /** @returns {GetTokenForVideoRoomResponse} */
551
+ static GetTokenForVideoRoomResponse() {
558
552
  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(""),
553
+ access_token: Joi.string().allow("").required(),
565
554
  });
566
555
  }
567
556
 
@@ -574,132 +563,187 @@ class LeadPartnerModel {
574
563
  });
575
564
  }
576
565
 
577
- /** @returns {GetTokenForVideoRoomResponse} */
578
- static GetTokenForVideoRoomResponse() {
566
+ /** @returns {Participant} */
567
+ static Participant() {
579
568
  return Joi.object({
580
- access_token: Joi.string().allow("").required(),
569
+ user: LeadPartnerModel.UserSchema(),
570
+ identity: Joi.string().allow(""),
571
+ status: Joi.string().allow(""),
581
572
  });
582
573
  }
583
574
 
584
- /** @returns {NotifyUser} */
585
- static NotifyUser() {
575
+ /** @returns {UserSchema} */
576
+ static UserSchema() {
586
577
  return Joi.object({
587
- country_code: Joi.string().allow("").required(),
588
- phone_number: Joi.string().allow("").required(),
578
+ first_name: Joi.string().allow(""),
579
+ last_name: Joi.string().allow(""),
580
+ phone_numbers: Joi.array().items(LeadPartnerModel.PhoneNumber()),
581
+ emails: Joi.array().items(LeadPartnerModel.Email()),
582
+ gender: Joi.string().allow(""),
583
+ active: Joi.boolean(),
584
+ profile_pic_url: Joi.string().allow(""),
585
+ username: Joi.string().allow(""),
586
+ account_type: Joi.string().allow(""),
587
+ uid: Joi.string().allow(""),
588
+ debug: LeadPartnerModel.Debug(),
589
+ has_old_password_hash: Joi.boolean(),
590
+ _id: Joi.string().allow(""),
591
+ created_at: Joi.string().allow(""),
592
+ updated_at: Joi.string().allow(""),
589
593
  });
590
594
  }
591
595
 
592
- /** @returns {Page} */
593
- static Page() {
596
+ /** @returns {PhoneNumber} */
597
+ static PhoneNumber() {
594
598
  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(),
599
+ active: Joi.boolean(),
600
+ primary: Joi.boolean(),
601
+ verified: Joi.boolean(),
602
+ phone: Joi.string().allow(""),
603
+ country_code: Joi.number(),
602
604
  });
603
605
  }
604
606
 
605
- /** @returns {Participant} */
606
- static Participant() {
607
+ /** @returns {Email} */
608
+ static Email() {
609
+ return Joi.object({
610
+ primary: Joi.boolean(),
611
+ verified: Joi.boolean(),
612
+ email: Joi.string().allow(""),
613
+ active: Joi.boolean(),
614
+ });
615
+ }
616
+
617
+ /** @returns {Debug} */
618
+ static Debug() {
619
+ return Joi.object({
620
+ source: Joi.string().allow(""),
621
+ platform: Joi.string().allow(""),
622
+ });
623
+ }
624
+
625
+ /** @returns {TicketContext} */
626
+ static TicketContext() {
627
+ return Joi.object({
628
+ application_id: Joi.string().allow(""),
629
+ partner_id: Joi.string().allow("").required(),
630
+ });
631
+ }
632
+
633
+ /** @returns {CreatedOn} */
634
+ static CreatedOn() {
635
+ return Joi.object({
636
+ user_agent: Joi.string().allow("").required(),
637
+ });
638
+ }
639
+
640
+ /** @returns {TicketAsset} */
641
+ static TicketAsset() {
607
642
  return Joi.object({
608
- identity: Joi.string().allow(""),
609
- status: Joi.string().allow(""),
610
- user: LeadPartnerModel.UserSchema(),
643
+ display: Joi.string().allow(""),
644
+ value: Joi.string().allow("").required(),
645
+ type: LeadPartnerModel.TicketAssetTypeEnum().required(),
611
646
  });
612
647
  }
613
648
 
614
- /** @returns {PhoneNumber} */
615
- static PhoneNumber() {
649
+ /** @returns {TicketContent} */
650
+ static TicketContent() {
616
651
  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(),
652
+ title: Joi.string().allow("").required(),
653
+ description: Joi.string().allow(""),
654
+ attachments: Joi.array().items(LeadPartnerModel.TicketAsset()),
622
655
  });
623
656
  }
624
657
 
625
- /** @returns {PollForAssignment} */
626
- static PollForAssignment() {
658
+ /** @returns {AddTicketPayload} */
659
+ static AddTicketPayload() {
627
660
  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(),
661
+ created_by: Joi.any(),
662
+ status: Joi.string().allow(""),
663
+ priority: LeadPartnerModel.PriorityEnum(),
664
+ category: Joi.string().allow("").required(),
665
+ content: LeadPartnerModel.TicketContent().required(),
666
+ _custom_json: Joi.any(),
632
667
  });
633
668
  }
634
669
 
635
670
  /** @returns {Priority} */
636
671
  static Priority() {
637
672
  return Joi.object({
638
- color: Joi.string().allow("").required(),
639
- display: Joi.string().allow("").required(),
640
673
  key: LeadPartnerModel.PriorityEnum().required(),
674
+ display: Joi.string().allow("").required(),
675
+ color: Joi.string().allow("").required(),
641
676
  });
642
677
  }
643
678
 
644
679
  /** @returns {Status} */
645
680
  static Status() {
646
681
  return Joi.object({
647
- color: Joi.string().allow("").required(),
648
- display: Joi.string().allow("").required(),
649
682
  key: Joi.string().allow("").required(),
683
+ display: Joi.string().allow("").required(),
684
+ color: Joi.string().allow("").required(),
685
+ });
686
+ }
687
+
688
+ /** @returns {TicketFeedbackList} */
689
+ static TicketFeedbackList() {
690
+ return Joi.object({
691
+ items: Joi.array().items(LeadPartnerModel.TicketFeedback()),
692
+ });
693
+ }
694
+
695
+ /** @returns {TicketFeedbackPayload} */
696
+ static TicketFeedbackPayload() {
697
+ return Joi.object({
698
+ form_response: Joi.any(),
650
699
  });
651
700
  }
652
701
 
653
702
  /** @returns {SubmitButton} */
654
703
  static SubmitButton() {
655
704
  return Joi.object({
656
- background_color: Joi.string().allow("").required(),
657
705
  title: Joi.string().allow("").required(),
658
706
  title_color: Joi.string().allow("").required(),
707
+ background_color: Joi.string().allow("").required(),
659
708
  });
660
709
  }
661
710
 
662
- /** @returns {SupportCommunicationSchema} */
663
- static SupportCommunicationSchema() {
711
+ /** @returns {PollForAssignment} */
712
+ static PollForAssignment() {
664
713
  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(),
714
+ duration: Joi.number().required(),
715
+ message: Joi.string().allow("").required(),
716
+ success_message: Joi.string().allow("").required(),
717
+ failure_message: Joi.string().allow("").required(),
670
718
  });
671
719
  }
672
720
 
673
- /** @returns {Ticket} */
674
- static Ticket() {
721
+ /** @returns {CustomForm} */
722
+ static CustomForm() {
675
723
  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(),
724
+ application_id: Joi.string().allow("").required(),
725
+ slug: Joi.string().allow("").required(),
726
+ header_image: Joi.string().allow(""),
727
+ title: Joi.string().allow("").required(),
728
+ description: Joi.string().allow(""),
687
729
  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(""),
730
+ login_required: Joi.boolean().required(),
731
+ should_notify: Joi.boolean().required(),
732
+ success_message: Joi.string().allow(""),
733
+ submit_button: LeadPartnerModel.SubmitButton(),
734
+ inputs: Joi.array().items(Joi.any()).required(),
735
+ created_on: LeadPartnerModel.CreatedOn(),
736
+ poll_for_assignment: LeadPartnerModel.PollForAssignment(),
737
+ _id: Joi.string().allow("").required(),
694
738
  });
695
739
  }
696
740
 
697
- /** @returns {TicketAsset} */
698
- static TicketAsset() {
741
+ /** @returns {FeedbackForm} */
742
+ static FeedbackForm() {
699
743
  return Joi.object({
700
- display: Joi.string().allow(""),
701
- type: LeadPartnerModel.TicketAssetTypeEnum().required(),
702
- value: Joi.string().allow("").required(),
744
+ inputs: Joi.any(),
745
+ title: Joi.string().allow(""),
746
+ timestamps: Joi.any(),
703
747
  });
704
748
  }
705
749
 
@@ -707,27 +751,19 @@ class LeadPartnerModel {
707
751
  static TicketCategory() {
708
752
  return Joi.object({
709
753
  display: Joi.string().allow("").required(),
710
- feedback_form: LeadPartnerModel.FeedbackForm(),
711
- group_id: Joi.number(),
712
754
  key: Joi.string().allow("").required(),
713
755
  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(),
756
+ group_id: Joi.number(),
757
+ feedback_form: LeadPartnerModel.FeedbackForm(),
723
758
  });
724
759
  }
725
760
 
726
- /** @returns {TicketContext} */
727
- static TicketContext() {
761
+ /** @returns {FeedbackResponseItem} */
762
+ static FeedbackResponseItem() {
728
763
  return Joi.object({
729
- application_id: Joi.string().allow(""),
730
- partner_id: Joi.string().allow("").required(),
764
+ display: Joi.string().allow("").required(),
765
+ key: Joi.string().allow("").required(),
766
+ value: Joi.string().allow("").required(),
731
767
  });
732
768
  }
733
769
 
@@ -735,121 +771,85 @@ class LeadPartnerModel {
735
771
  static TicketFeedback() {
736
772
  return Joi.object({
737
773
  _id: Joi.string().allow("").required(),
738
- category: Joi.string().allow(""),
739
- created_at: Joi.string().allow(""),
774
+ ticket_id: Joi.string().allow("").required(),
740
775
  partner_id: Joi.string().allow("").required(),
741
776
  response: Joi.array()
742
777
  .items(LeadPartnerModel.FeedbackResponseItem())
743
778
  .required(),
744
- ticket_id: Joi.string().allow("").required(),
745
- updated_at: Joi.string().allow(""),
779
+ category: Joi.string().allow(""),
746
780
  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(),
781
+ updated_at: Joi.string().allow(""),
782
+ created_at: Joi.string().allow(""),
761
783
  });
762
784
  }
763
785
 
764
786
  /** @returns {TicketHistory} */
765
787
  static TicketHistory() {
766
788
  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
789
  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
790
  value: Joi.any().required(),
791
+ ticket_id: Joi.string().allow("").required(),
792
+ created_on: LeadPartnerModel.CreatedOn(),
793
+ created_by: Joi.any(),
794
+ _id: Joi.string().allow("").required(),
795
+ updated_at: Joi.string().allow(""),
796
+ created_at: Joi.string().allow(""),
791
797
  });
792
798
  }
793
799
 
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() {
800
+ /** @returns {Ticket} */
801
+ static Ticket() {
805
802
  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(""),
803
+ context: LeadPartnerModel.TicketContext(),
804
+ created_on: LeadPartnerModel.CreatedOn(),
805
+ response_id: Joi.string().allow(""),
806
+ content: LeadPartnerModel.TicketContent(),
807
+ category: LeadPartnerModel.TicketCategory().required(),
808
+ sub_category: Joi.string().allow(""),
809
+ source: LeadPartnerModel.TicketSourceEnum().required(),
810
+ status: LeadPartnerModel.Status().required(),
811
+ priority: LeadPartnerModel.Priority().required(),
812
+ created_by: Joi.any(),
813
+ assigned_to: Joi.any(),
814
+ tags: Joi.array().items(Joi.string().allow("")),
815
+ _custom_json: Joi.any(),
816
+ is_feedback_pending: Joi.boolean(),
817
+ integration: Joi.any(),
818
+ _id: Joi.string().allow("").required(),
819
819
  updated_at: Joi.string().allow(""),
820
- username: Joi.string().allow(""),
820
+ created_at: Joi.string().allow(""),
821
821
  });
822
822
  }
823
823
 
824
824
  /**
825
- * Enum: HistoryTypeEnum Used By: Lead
825
+ * Enum: PriorityEnum Used By: Lead
826
826
  *
827
- * @returns {HistoryTypeEnum}
827
+ * @returns {PriorityEnum}
828
828
  */
829
- static HistoryTypeEnum() {
829
+ static PriorityEnum() {
830
830
  return Joi.string().valid(
831
- "rating",
831
+ "low",
832
832
 
833
- "log",
833
+ "medium",
834
834
 
835
- "comment"
835
+ "high",
836
+
837
+ "urgent"
836
838
  );
837
839
  }
838
840
 
839
841
  /**
840
- * Enum: PriorityEnum Used By: Lead
842
+ * Enum: HistoryTypeEnum Used By: Lead
841
843
  *
842
- * @returns {PriorityEnum}
844
+ * @returns {HistoryTypeEnum}
843
845
  */
844
- static PriorityEnum() {
846
+ static HistoryTypeEnum() {
845
847
  return Joi.string().valid(
846
- "low",
847
-
848
- "medium",
848
+ "rating",
849
849
 
850
- "high",
850
+ "log",
851
851
 
852
- "urgent"
852
+ "comment"
853
853
  );
854
854
  }
855
855