@gofynd/fdk-client-javascript 1.4.2-beta.2 → 1.4.2-beta.3
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.
- package/README.md +1 -1
- package/package.json +1 -1
- package/sdk/application/Cart/CartApplicationModel.d.ts +1742 -1726
- package/sdk/application/Cart/CartApplicationModel.js +1497 -1481
- package/sdk/application/Catalog/CatalogApplicationModel.d.ts +1917 -1917
- package/sdk/application/Catalog/CatalogApplicationModel.js +1611 -1611
- package/sdk/application/Common/CommonApplicationModel.d.ts +235 -235
- package/sdk/application/Common/CommonApplicationModel.js +172 -172
- package/sdk/application/Communication/CommunicationApplicationModel.d.ts +72 -72
- package/sdk/application/Communication/CommunicationApplicationModel.js +64 -64
- package/sdk/application/Configuration/ConfigurationApplicationModel.d.ts +1614 -1614
- package/sdk/application/Configuration/ConfigurationApplicationModel.js +1151 -1151
- package/sdk/application/Content/ContentApplicationModel.d.ts +797 -797
- package/sdk/application/Content/ContentApplicationModel.js +757 -757
- package/sdk/application/FileStorage/FileStorageApplicationModel.d.ts +79 -79
- package/sdk/application/FileStorage/FileStorageApplicationModel.js +84 -84
- package/sdk/application/Lead/LeadApplicationModel.d.ts +417 -417
- package/sdk/application/Lead/LeadApplicationModel.js +301 -301
- package/sdk/application/Logistic/LogisticApplicationModel.d.ts +666 -666
- package/sdk/application/Logistic/LogisticApplicationModel.js +601 -601
- package/sdk/application/Order/OrderApplicationModel.d.ts +846 -846
- package/sdk/application/Order/OrderApplicationModel.js +822 -822
- package/sdk/application/Payment/PaymentApplicationClient.d.ts +5 -5
- package/sdk/application/Payment/PaymentApplicationClient.js +10 -10
- package/sdk/application/Payment/PaymentApplicationModel.d.ts +2155 -2150
- package/sdk/application/Payment/PaymentApplicationModel.js +1460 -1458
- package/sdk/application/Payment/PaymentApplicationValidator.d.ts +5 -5
- package/sdk/application/Payment/PaymentApplicationValidator.js +3 -3
- package/sdk/application/PosCart/PosCartApplicationModel.d.ts +1462 -1462
- package/sdk/application/PosCart/PosCartApplicationModel.js +1260 -1260
- package/sdk/application/Rewards/RewardsApplicationModel.d.ts +214 -214
- package/sdk/application/Rewards/RewardsApplicationModel.js +211 -211
- package/sdk/application/Share/ShareApplicationModel.d.ts +114 -114
- package/sdk/application/Share/ShareApplicationModel.js +121 -121
- package/sdk/application/Theme/ThemeApplicationModel.d.ts +895 -895
- package/sdk/application/Theme/ThemeApplicationModel.js +684 -684
- package/sdk/application/User/UserApplicationModel.d.ts +762 -762
- package/sdk/application/User/UserApplicationModel.js +738 -738
- package/sdk/partner/FileStorage/FileStoragePartnerModel.d.ts +63 -63
- package/sdk/partner/FileStorage/FileStoragePartnerModel.js +65 -65
- package/sdk/partner/Lead/LeadPartnerModel.d.ts +661 -661
- package/sdk/partner/Lead/LeadPartnerModel.js +491 -491
- package/sdk/partner/Logistics/LogisticsPartnerModel.d.ts +223 -223
- package/sdk/partner/Logistics/LogisticsPartnerModel.js +235 -235
- package/sdk/partner/Theme/ThemePartnerModel.d.ts +1087 -1087
- package/sdk/partner/Theme/ThemePartnerModel.js +819 -819
- package/sdk/partner/Webhook/WebhookPartnerModel.d.ts +386 -386
- package/sdk/partner/Webhook/WebhookPartnerModel.js +342 -342
- package/sdk/platform/AuditTrail/AuditTrailPlatformModel.d.ts +123 -123
- package/sdk/platform/AuditTrail/AuditTrailPlatformModel.js +109 -109
- package/sdk/platform/Billing/BillingPlatformModel.d.ts +801 -801
- package/sdk/platform/Billing/BillingPlatformModel.js +783 -783
- package/sdk/platform/Cart/CartPlatformModel.d.ts +3333 -3317
- package/sdk/platform/Cart/CartPlatformModel.js +2936 -2920
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +1013 -1013
- package/sdk/platform/Catalog/CatalogPlatformModel.js +923 -923
- package/sdk/platform/Common/CommonPlatformModel.d.ts +255 -255
- package/sdk/platform/Common/CommonPlatformModel.js +187 -187
- package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +1238 -1238
- package/sdk/platform/Communication/CommunicationPlatformModel.js +1273 -1273
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +661 -661
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +692 -692
- package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +3198 -3198
- package/sdk/platform/Configuration/ConfigurationPlatformModel.js +2247 -2247
- package/sdk/platform/Content/ContentPlatformModel.d.ts +1833 -1833
- package/sdk/platform/Content/ContentPlatformModel.js +1837 -1837
- package/sdk/platform/Discount/DiscountPlatformModel.d.ts +245 -245
- package/sdk/platform/Discount/DiscountPlatformModel.js +248 -248
- package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +865 -865
- package/sdk/platform/FileStorage/FileStoragePlatformModel.js +877 -877
- package/sdk/platform/Finance/FinancePlatformModel.d.ts +1044 -1044
- package/sdk/platform/Finance/FinancePlatformModel.js +974 -974
- package/sdk/platform/Inventory/InventoryPlatformModel.d.ts +942 -942
- package/sdk/platform/Inventory/InventoryPlatformModel.js +1003 -1003
- package/sdk/platform/Lead/LeadPlatformModel.d.ts +608 -608
- package/sdk/platform/Lead/LeadPlatformModel.js +465 -465
- package/sdk/platform/Order/OrderPlatformModel.d.ts +5180 -5176
- package/sdk/platform/Order/OrderPlatformModel.js +4740 -4736
- package/sdk/platform/Partner/PartnerPlatformModel.d.ts +22 -22
- package/sdk/platform/Partner/PartnerPlatformModel.js +22 -22
- package/sdk/platform/Payment/PaymentPlatformModel.d.ts +2670 -2660
- package/sdk/platform/Payment/PaymentPlatformModel.js +1831 -1827
- package/sdk/platform/Rewards/RewardsPlatformModel.d.ts +204 -204
- package/sdk/platform/Rewards/RewardsPlatformModel.js +199 -199
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +1505 -1507
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +1532 -1536
- package/sdk/platform/Share/SharePlatformModel.d.ts +147 -147
- package/sdk/platform/Share/SharePlatformModel.js +139 -139
- package/sdk/platform/Theme/ThemePlatformModel.d.ts +1046 -1046
- package/sdk/platform/Theme/ThemePlatformModel.js +789 -789
- package/sdk/platform/User/UserPlatformModel.d.ts +758 -758
- package/sdk/platform/User/UserPlatformModel.js +643 -643
- package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +439 -439
- package/sdk/platform/Webhook/WebhookPlatformModel.js +364 -364
- package/sdk/public/Billing/BillingPublicModel.d.ts +55 -55
- package/sdk/public/Billing/BillingPublicModel.js +51 -51
- package/sdk/public/Configuration/ConfigurationPublicModel.d.ts +237 -237
- package/sdk/public/Configuration/ConfigurationPublicModel.js +174 -174
- package/sdk/public/Content/ContentPublicModel.d.ts +26 -26
- package/sdk/public/Content/ContentPublicModel.js +28 -28
- package/sdk/public/Inventory/InventoryPublicModel.d.ts +237 -237
- package/sdk/public/Inventory/InventoryPublicModel.js +257 -257
- package/sdk/public/Partner/PartnerPublicModel.d.ts +104 -104
- package/sdk/public/Partner/PartnerPublicModel.js +113 -113
- package/sdk/public/Webhook/WebhookPublicModel.d.ts +87 -87
- package/sdk/public/Webhook/WebhookPublicModel.js +93 -93
|
@@ -1,154 +1,116 @@
|
|
|
1
1
|
const Joi = require("joi");
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* @typedef
|
|
5
|
-
* @property {
|
|
6
|
-
* @property {
|
|
7
|
-
* @property {
|
|
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
|
|
15
|
-
* @property {
|
|
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
|
|
20
|
-
* @property {
|
|
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}
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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
|
|
116
|
-
* @property {
|
|
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
|
|
124
|
-
* @property {string}
|
|
81
|
+
* @typedef CreateVideoRoomResponse
|
|
82
|
+
* @property {string} unique_name - Video Room's unique name
|
|
125
83
|
*/
|
|
126
84
|
|
|
127
85
|
/**
|
|
128
|
-
* @typedef
|
|
129
|
-
* @property {
|
|
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
|
|
136
|
-
* @property {string}
|
|
137
|
-
* @property {
|
|
138
|
-
|
|
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
|
|
151
|
-
* @property {
|
|
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
|
|
161
|
-
* @property {
|
|
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
|
-
|
|
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
|
|
194
|
-
* @property {
|
|
195
|
-
* @property {
|
|
196
|
-
* @property {string}
|
|
197
|
-
* @property {
|
|
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
|
|
209
|
-
* @property {string}
|
|
210
|
-
* @property {string}
|
|
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
|
|
216
|
-
* @property {string}
|
|
217
|
-
* @property {string}
|
|
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
|
|
223
|
-
* @property {
|
|
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
|
|
254
|
-
* @property {string}
|
|
255
|
-
* @property {
|
|
256
|
-
* @property {
|
|
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
|
|
263
|
-
* @property {
|
|
264
|
-
* @property {string} [
|
|
265
|
-
* @property {
|
|
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
|
|
270
|
-
* @property {
|
|
271
|
-
* @property {string}
|
|
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
|
|
276
|
-
* @property {string}
|
|
277
|
-
* @property {string}
|
|
278
|
-
* @property {string}
|
|
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
|
|
299
|
-
* @property {string}
|
|
300
|
-
* @property {string}
|
|
301
|
-
* @property {
|
|
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 {
|
|
304
|
-
* @property {string}
|
|
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
|
|
311
|
-
* @property {
|
|
312
|
-
* @property {
|
|
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
|
|
317
|
-
* @property {
|
|
318
|
-
* @property {
|
|
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
|
|
323
|
-
* @property {
|
|
324
|
-
* @property {
|
|
325
|
-
* @property {
|
|
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
|
|
330
|
-
* @property {string}
|
|
331
|
-
* @property {string}
|
|
332
|
-
* @property {
|
|
333
|
-
* @property {
|
|
334
|
-
* @property {string} [
|
|
335
|
-
* @property {
|
|
336
|
-
* @property {
|
|
337
|
-
* @property {string} [
|
|
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
|
-
/**
|
|
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 {
|
|
369
|
-
static
|
|
368
|
+
/** @returns {TicketList} */
|
|
369
|
+
static TicketList() {
|
|
370
370
|
return Joi.object({
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
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 {
|
|
381
|
-
static
|
|
377
|
+
/** @returns {Page} */
|
|
378
|
+
static Page() {
|
|
382
379
|
return Joi.object({
|
|
383
|
-
|
|
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 {
|
|
388
|
-
static
|
|
390
|
+
/** @returns {TicketHistoryList} */
|
|
391
|
+
static TicketHistoryList() {
|
|
389
392
|
return Joi.object({
|
|
390
|
-
|
|
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 {
|
|
410
|
-
static
|
|
436
|
+
/** @returns {EditTicketPayload} */
|
|
437
|
+
static EditTicketPayload() {
|
|
411
438
|
return Joi.object({
|
|
412
|
-
|
|
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 {
|
|
417
|
-
static
|
|
450
|
+
/** @returns {AgentChangePayload} */
|
|
451
|
+
static AgentChangePayload() {
|
|
418
452
|
return Joi.object({
|
|
419
|
-
|
|
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 {
|
|
432
|
-
static
|
|
464
|
+
/** @returns {CloseVideoRoomResponse} */
|
|
465
|
+
static CloseVideoRoomResponse() {
|
|
433
466
|
return Joi.object({
|
|
434
|
-
|
|
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 {
|
|
452
|
-
static
|
|
471
|
+
/** @returns {CreateVideoRoomPayload} */
|
|
472
|
+
static CreateVideoRoomPayload() {
|
|
453
473
|
return Joi.object({
|
|
454
|
-
|
|
455
|
-
|
|
474
|
+
unique_name: Joi.string().allow("").required(),
|
|
475
|
+
notify: Joi.array().items(LeadPlatformModel.NotifyUser()),
|
|
456
476
|
});
|
|
457
477
|
}
|
|
458
478
|
|
|
459
|
-
/** @returns {
|
|
460
|
-
static
|
|
479
|
+
/** @returns {NotifyUser} */
|
|
480
|
+
static NotifyUser() {
|
|
461
481
|
return Joi.object({
|
|
462
|
-
|
|
463
|
-
|
|
482
|
+
country_code: Joi.string().allow("").required(),
|
|
483
|
+
phone_number: Joi.string().allow("").required(),
|
|
464
484
|
});
|
|
465
485
|
}
|
|
466
486
|
|
|
467
|
-
/** @returns {
|
|
468
|
-
static
|
|
487
|
+
/** @returns {Filter} */
|
|
488
|
+
static Filter() {
|
|
469
489
|
return Joi.object({
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
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 {
|
|
483
|
-
static
|
|
497
|
+
/** @returns {TicketHistoryPayload} */
|
|
498
|
+
static TicketHistoryPayload() {
|
|
484
499
|
return Joi.object({
|
|
485
|
-
|
|
486
|
-
|
|
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 {
|
|
497
|
-
static
|
|
505
|
+
/** @returns {GetTokenForVideoRoomResponse} */
|
|
506
|
+
static GetTokenForVideoRoomResponse() {
|
|
498
507
|
return Joi.object({
|
|
499
|
-
|
|
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 {
|
|
507
|
-
static
|
|
512
|
+
/** @returns {GetParticipantsInsideVideoRoomResponse} */
|
|
513
|
+
static GetParticipantsInsideVideoRoomResponse() {
|
|
508
514
|
return Joi.object({
|
|
509
|
-
|
|
515
|
+
participants: Joi.array()
|
|
516
|
+
.items(LeadPlatformModel.Participant())
|
|
517
|
+
.required(),
|
|
510
518
|
});
|
|
511
519
|
}
|
|
512
520
|
|
|
513
|
-
/** @returns {
|
|
514
|
-
static
|
|
521
|
+
/** @returns {Participant} */
|
|
522
|
+
static Participant() {
|
|
515
523
|
return Joi.object({
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
524
|
+
user: LeadPlatformModel.UserSchema(),
|
|
525
|
+
identity: Joi.string().allow(""),
|
|
526
|
+
status: Joi.string().allow(""),
|
|
519
527
|
});
|
|
520
528
|
}
|
|
521
529
|
|
|
522
|
-
/** @returns {
|
|
523
|
-
static
|
|
530
|
+
/** @returns {UserSchema} */
|
|
531
|
+
static UserSchema() {
|
|
524
532
|
return Joi.object({
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
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 {
|
|
532
|
-
static
|
|
553
|
+
/** @returns {PhoneNumber} */
|
|
554
|
+
static PhoneNumber() {
|
|
533
555
|
return Joi.object({
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
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 {
|
|
542
|
-
static
|
|
564
|
+
/** @returns {Email} */
|
|
565
|
+
static Email() {
|
|
543
566
|
return Joi.object({
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
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 {
|
|
551
|
-
static
|
|
574
|
+
/** @returns {Debug} */
|
|
575
|
+
static Debug() {
|
|
552
576
|
return Joi.object({
|
|
553
|
-
|
|
577
|
+
source: Joi.string().allow(""),
|
|
578
|
+
platform: Joi.string().allow(""),
|
|
554
579
|
});
|
|
555
580
|
}
|
|
556
581
|
|
|
557
|
-
/** @returns {
|
|
558
|
-
static
|
|
582
|
+
/** @returns {TicketContext} */
|
|
583
|
+
static TicketContext() {
|
|
559
584
|
return Joi.object({
|
|
560
|
-
|
|
561
|
-
|
|
585
|
+
application_id: Joi.string().allow(""),
|
|
586
|
+
company_id: Joi.string().allow("").required(),
|
|
562
587
|
});
|
|
563
588
|
}
|
|
564
589
|
|
|
565
|
-
/** @returns {
|
|
566
|
-
static
|
|
590
|
+
/** @returns {CreatedOn} */
|
|
591
|
+
static CreatedOn() {
|
|
567
592
|
return Joi.object({
|
|
568
|
-
|
|
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 {
|
|
579
|
-
static
|
|
597
|
+
/** @returns {TicketAsset} */
|
|
598
|
+
static TicketAsset() {
|
|
580
599
|
return Joi.object({
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
600
|
+
display: Joi.string().allow(""),
|
|
601
|
+
value: Joi.string().allow("").required(),
|
|
602
|
+
type: LeadPlatformModel.TicketAssetTypeEnum().required(),
|
|
584
603
|
});
|
|
585
604
|
}
|
|
586
605
|
|
|
587
|
-
/** @returns {
|
|
588
|
-
static
|
|
606
|
+
/** @returns {TicketContent} */
|
|
607
|
+
static TicketContent() {
|
|
589
608
|
return Joi.object({
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
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 {
|
|
599
|
-
static
|
|
615
|
+
/** @returns {AddTicketPayload} */
|
|
616
|
+
static AddTicketPayload() {
|
|
600
617
|
return Joi.object({
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
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 {
|
|
636
|
-
static
|
|
668
|
+
/** @returns {PollForAssignment} */
|
|
669
|
+
static PollForAssignment() {
|
|
637
670
|
return Joi.object({
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
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
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
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 {
|
|
660
|
-
static
|
|
698
|
+
/** @returns {FeedbackForm} */
|
|
699
|
+
static FeedbackForm() {
|
|
661
700
|
return Joi.object({
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
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
|
-
|
|
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 {
|
|
689
|
-
static
|
|
718
|
+
/** @returns {FeedbackResponseItem} */
|
|
719
|
+
static FeedbackResponseItem() {
|
|
690
720
|
return Joi.object({
|
|
691
|
-
|
|
692
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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 {
|
|
757
|
-
static
|
|
757
|
+
/** @returns {Ticket} */
|
|
758
|
+
static Ticket() {
|
|
758
759
|
return Joi.object({
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
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 {
|
|
766
|
-
static
|
|
781
|
+
/** @returns {ErrorMessage} */
|
|
782
|
+
static ErrorMessage() {
|
|
767
783
|
return Joi.object({
|
|
768
|
-
|
|
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:
|
|
789
|
+
* Enum: PriorityEnum Used By: Lead
|
|
790
790
|
*
|
|
791
|
-
* @returns {
|
|
791
|
+
* @returns {PriorityEnum}
|
|
792
792
|
*/
|
|
793
|
-
static
|
|
793
|
+
static PriorityEnum() {
|
|
794
794
|
return Joi.string().valid(
|
|
795
|
-
"
|
|
795
|
+
"low",
|
|
796
796
|
|
|
797
|
-
"
|
|
797
|
+
"medium",
|
|
798
798
|
|
|
799
|
-
"
|
|
799
|
+
"high",
|
|
800
800
|
|
|
801
|
-
"
|
|
801
|
+
"urgent"
|
|
802
802
|
);
|
|
803
803
|
}
|
|
804
804
|
|
|
805
805
|
/**
|
|
806
|
-
* Enum:
|
|
806
|
+
* Enum: HistoryTypeEnum Used By: Lead
|
|
807
807
|
*
|
|
808
|
-
* @returns {
|
|
808
|
+
* @returns {HistoryTypeEnum}
|
|
809
809
|
*/
|
|
810
|
-
static
|
|
810
|
+
static HistoryTypeEnum() {
|
|
811
811
|
return Joi.string().valid(
|
|
812
|
-
"
|
|
812
|
+
"rating",
|
|
813
813
|
|
|
814
|
-
"
|
|
814
|
+
"log",
|
|
815
815
|
|
|
816
|
-
"
|
|
816
|
+
"comment",
|
|
817
817
|
|
|
818
|
-
"
|
|
818
|
+
"thread"
|
|
819
819
|
);
|
|
820
820
|
}
|
|
821
821
|
|