@gofynd/fdk-client-javascript 1.4.15-beta.1 → 1.4.15-beta.11

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 (150) hide show
  1. package/README.md +2 -2
  2. package/application.d.ts +1 -2
  3. package/application.js +2 -3
  4. package/index.d.ts +1 -2
  5. package/index.js +7 -1
  6. package/package.json +3 -4
  7. package/sdk/application/ApplicationClient.js +0 -18
  8. package/sdk/application/Cart/CartApplicationClient.d.ts +55 -90
  9. package/sdk/application/Cart/CartApplicationClient.js +60 -1185
  10. package/sdk/application/Catalog/CatalogApplicationClient.d.ts +90 -142
  11. package/sdk/application/Catalog/CatalogApplicationClient.js +187 -1293
  12. package/sdk/application/Common/CommonApplicationClient.d.ts +4 -8
  13. package/sdk/application/Common/CommonApplicationClient.js +5 -89
  14. package/sdk/application/Communication/CommunicationApplicationClient.d.ts +6 -19
  15. package/sdk/application/Communication/CommunicationApplicationClient.js +6 -145
  16. package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +32 -73
  17. package/sdk/application/Configuration/ConfigurationApplicationClient.js +31 -718
  18. package/sdk/application/Content/ContentApplicationClient.d.ts +46 -78
  19. package/sdk/application/Content/ContentApplicationClient.js +77 -914
  20. package/sdk/application/FileStorage/FileStorageApplicationClient.d.ts +6 -11
  21. package/sdk/application/FileStorage/FileStorageApplicationClient.js +19 -125
  22. package/sdk/application/Lead/LeadApplicationClient.d.ts +10 -18
  23. package/sdk/application/Lead/LeadApplicationClient.js +32 -202
  24. package/sdk/application/Logistic/LogisticApplicationClient.d.ts +22 -39
  25. package/sdk/application/Logistic/LogisticApplicationClient.js +50 -478
  26. package/sdk/application/Order/OrderApplicationClient.d.ts +22 -42
  27. package/sdk/application/Order/OrderApplicationClient.js +86 -472
  28. package/sdk/application/Payment/PaymentApplicationClient.d.ts +92 -212
  29. package/sdk/application/Payment/PaymentApplicationClient.js +57 -2102
  30. package/sdk/application/Rewards/RewardsApplicationClient.d.ts +14 -28
  31. package/sdk/application/Rewards/RewardsApplicationClient.js +16 -305
  32. package/sdk/application/Share/ShareApplicationClient.d.ts +14 -24
  33. package/sdk/application/Share/ShareApplicationClient.js +34 -294
  34. package/sdk/application/Theme/ThemeApplicationClient.d.ts +8 -14
  35. package/sdk/application/Theme/ThemeApplicationClient.js +28 -162
  36. package/sdk/application/User/UserApplicationClient.d.ts +85 -136
  37. package/sdk/application/User/UserApplicationClient.js +45 -1815
  38. package/sdk/application/Webhook/WebhookApplicationClient.d.ts +2 -5
  39. package/sdk/application/Webhook/WebhookApplicationClient.js +4 -47
  40. package/sdk/application/index.d.ts +0 -18
  41. package/sdk/application/index.js +0 -33
  42. package/sdk/common/Utility.d.ts +1 -1
  43. package/sdk/common/Utility.js +10 -7
  44. package/sdk/common/Validator.d.ts +1 -0
  45. package/sdk/common/Validator.js +20 -0
  46. package/sdk/common/utils.d.ts +0 -1
  47. package/sdk/common/utils.js +0 -14
  48. package/sdk/partner/OAuthClient.js +1 -0
  49. package/sdk/partner/Theme/ThemePartnerModel.d.ts +3 -40
  50. package/sdk/partner/Theme/ThemePartnerModel.js +2 -24
  51. package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +39 -1
  52. package/sdk/platform/Cart/CartPlatformApplicationClient.js +247 -1
  53. package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +33 -1
  54. package/sdk/platform/Cart/CartPlatformApplicationValidator.js +37 -0
  55. package/sdk/platform/Cart/CartPlatformModel.d.ts +193 -1
  56. package/sdk/platform/Cart/CartPlatformModel.js +132 -0
  57. package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +0 -7
  58. package/sdk/platform/Catalog/CatalogPlatformModel.js +1 -4
  59. package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +14 -0
  60. package/sdk/platform/Configuration/ConfigurationPlatformModel.js +6 -0
  61. package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +0 -10
  62. package/sdk/platform/Order/OrderPlatformApplicationClient.js +0 -92
  63. package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +1 -28
  64. package/sdk/platform/Order/OrderPlatformApplicationValidator.js +0 -18
  65. package/sdk/platform/Order/OrderPlatformClient.d.ts +10 -0
  66. package/sdk/platform/Order/OrderPlatformClient.js +99 -0
  67. package/sdk/platform/Order/OrderPlatformModel.d.ts +7 -0
  68. package/sdk/platform/Order/OrderPlatformModel.js +3 -0
  69. package/sdk/platform/Order/OrderPlatformValidator.d.ts +33 -1
  70. package/sdk/platform/Order/OrderPlatformValidator.js +20 -0
  71. package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +1 -1
  72. package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +4 -4
  73. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +56 -19
  74. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +42 -18
  75. package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.d.ts +3 -3
  76. package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.js +2 -2
  77. package/sdk/platform/Theme/ThemePlatformModel.d.ts +3 -40
  78. package/sdk/platform/Theme/ThemePlatformModel.js +2 -24
  79. package/sdk/public/Configuration/ConfigurationPublicClient.js +5 -2
  80. package/sdk/public/Content/ContentPublicClient.d.ts +1 -1
  81. package/sdk/public/Content/ContentPublicClient.js +14 -2
  82. package/sdk/public/Partner/PartnerPublicClient.d.ts +1 -1
  83. package/sdk/public/Partner/PartnerPublicClient.js +14 -2
  84. package/sdk/public/Webhook/WebhookPublicClient.js +5 -2
  85. package/sdk/application/Cart/CartApplicationModel.d.ts +0 -3994
  86. package/sdk/application/Cart/CartApplicationModel.js +0 -2497
  87. package/sdk/application/Cart/CartApplicationValidator.d.ts +0 -769
  88. package/sdk/application/Cart/CartApplicationValidator.js +0 -530
  89. package/sdk/application/Catalog/CatalogApplicationModel.d.ts +0 -3857
  90. package/sdk/application/Catalog/CatalogApplicationModel.js +0 -2629
  91. package/sdk/application/Catalog/CatalogApplicationValidator.d.ts +0 -791
  92. package/sdk/application/Catalog/CatalogApplicationValidator.js +0 -551
  93. package/sdk/application/Common/CommonApplicationModel.d.ts +0 -449
  94. package/sdk/application/Common/CommonApplicationModel.js +0 -308
  95. package/sdk/application/Common/CommonApplicationValidator.d.ts +0 -46
  96. package/sdk/application/Common/CommonApplicationValidator.js +0 -38
  97. package/sdk/application/Communication/CommunicationApplicationModel.d.ts +0 -293
  98. package/sdk/application/Communication/CommunicationApplicationModel.js +0 -201
  99. package/sdk/application/Communication/CommunicationApplicationValidator.d.ts +0 -29
  100. package/sdk/application/Communication/CommunicationApplicationValidator.js +0 -38
  101. package/sdk/application/Configuration/ConfigurationApplicationModel.d.ts +0 -2556
  102. package/sdk/application/Configuration/ConfigurationApplicationModel.js +0 -1887
  103. package/sdk/application/Configuration/ConfigurationApplicationValidator.d.ts +0 -179
  104. package/sdk/application/Configuration/ConfigurationApplicationValidator.js +0 -176
  105. package/sdk/application/Content/ContentApplicationModel.d.ts +0 -2133
  106. package/sdk/application/Content/ContentApplicationModel.js +0 -1589
  107. package/sdk/application/Content/ContentApplicationValidator.d.ts +0 -284
  108. package/sdk/application/Content/ContentApplicationValidator.js +0 -264
  109. package/sdk/application/FileStorage/FileStorageApplicationModel.d.ts +0 -272
  110. package/sdk/application/FileStorage/FileStorageApplicationModel.js +0 -190
  111. package/sdk/application/FileStorage/FileStorageApplicationValidator.d.ts +0 -56
  112. package/sdk/application/FileStorage/FileStorageApplicationValidator.js +0 -53
  113. package/sdk/application/Lead/LeadApplicationModel.d.ts +0 -590
  114. package/sdk/application/Lead/LeadApplicationModel.js +0 -480
  115. package/sdk/application/Lead/LeadApplicationValidator.d.ts +0 -68
  116. package/sdk/application/Lead/LeadApplicationValidator.js +0 -71
  117. package/sdk/application/Logistic/LogisticApplicationModel.d.ts +0 -1675
  118. package/sdk/application/Logistic/LogisticApplicationModel.js +0 -1121
  119. package/sdk/application/Logistic/LogisticApplicationValidator.d.ts +0 -254
  120. package/sdk/application/Logistic/LogisticApplicationValidator.js +0 -190
  121. package/sdk/application/Order/OrderApplicationModel.d.ts +0 -2296
  122. package/sdk/application/Order/OrderApplicationModel.js +0 -1471
  123. package/sdk/application/Order/OrderApplicationValidator.d.ts +0 -265
  124. package/sdk/application/Order/OrderApplicationValidator.js +0 -197
  125. package/sdk/application/Payment/PaymentApplicationModel.d.ts +0 -4058
  126. package/sdk/application/Payment/PaymentApplicationModel.js +0 -2630
  127. package/sdk/application/Payment/PaymentApplicationValidator.d.ts +0 -576
  128. package/sdk/application/Payment/PaymentApplicationValidator.js +0 -594
  129. package/sdk/application/Rewards/RewardsApplicationModel.d.ts +0 -365
  130. package/sdk/application/Rewards/RewardsApplicationModel.js +0 -396
  131. package/sdk/application/Rewards/RewardsApplicationValidator.d.ts +0 -73
  132. package/sdk/application/Rewards/RewardsApplicationValidator.js +0 -84
  133. package/sdk/application/Share/ShareApplicationModel.d.ts +0 -339
  134. package/sdk/application/Share/ShareApplicationModel.js +0 -234
  135. package/sdk/application/Share/ShareApplicationValidator.d.ts +0 -90
  136. package/sdk/application/Share/ShareApplicationValidator.js +0 -91
  137. package/sdk/application/Theme/ThemeApplicationModel.d.ts +0 -1713
  138. package/sdk/application/Theme/ThemeApplicationModel.js +0 -1426
  139. package/sdk/application/Theme/ThemeApplicationValidator.d.ts +0 -66
  140. package/sdk/application/Theme/ThemeApplicationValidator.js +0 -58
  141. package/sdk/application/User/UserApplicationModel.d.ts +0 -1943
  142. package/sdk/application/User/UserApplicationModel.js +0 -1382
  143. package/sdk/application/User/UserApplicationValidator.d.ts +0 -560
  144. package/sdk/application/User/UserApplicationValidator.js +0 -573
  145. package/sdk/application/Webhook/WebhookApplicationModel.d.ts +0 -52
  146. package/sdk/application/Webhook/WebhookApplicationModel.js +0 -46
  147. package/sdk/application/Webhook/WebhookApplicationValidator.d.ts +0 -16
  148. package/sdk/application/Webhook/WebhookApplicationValidator.js +0 -19
  149. package/sdk/common/Clickstream.d.ts +0 -1
  150. package/sdk/common/Clickstream.js +0 -464
@@ -1,480 +0,0 @@
1
- const Joi = require("joi");
2
-
3
- /**
4
- * @typedef TicketHistoryPayload
5
- * @property {Object} value - Details of history event.
6
- * @property {HistoryTypeEnum} type
7
- */
8
-
9
- /**
10
- * @typedef CustomFormSubmissionPayload
11
- * @property {Object[]} response - Custom form response.
12
- * @property {TicketAsset[]} [attachments] - List of all attachments related to the form.
13
- */
14
-
15
- /**
16
- * @typedef SubmitCustomFormResponse
17
- * @property {string} message - Success message for form submission.
18
- * @property {Ticket} [ticket]
19
- * @property {FormFieldResponse} [response]
20
- */
21
-
22
- /**
23
- * @typedef FormFieldResponse
24
- * @property {string} [_id] - Unique identifier for a custom form response.
25
- * @property {number} [__v] - Version of the form.
26
- * @property {string} [application_id] - Unique identifier for a Sales channel.
27
- * @property {string} [form_slug] - A short, human-readable, URL-friendly unique
28
- * identifier for a custom form.
29
- * @property {CreatedOn} [created_on]
30
- * @property {FormFieldResponseValues[]} [response] - Data related to
31
- * acknowledgement on submission of custom form.
32
- */
33
-
34
- /**
35
- * @typedef FormFieldResponseValues
36
- * @property {string} [key] - Keyname of field against which the input was
37
- * filled in custom form.
38
- */
39
-
40
- /**
41
- * @typedef TicketContext
42
- * @property {string} [application_id] - Unique identifier for a Sales channel.
43
- * @property {string} company_id - Company ID related to the ticket.
44
- */
45
-
46
- /**
47
- * @typedef CreatedOn
48
- * @property {string} user_agent - Useragent details.
49
- */
50
-
51
- /**
52
- * @typedef TicketAsset
53
- * @property {string} [display] - Display text for asset.
54
- * @property {string} value - To be used for details.
55
- * @property {TicketAssetTypeEnum} type
56
- */
57
-
58
- /**
59
- * @typedef TicketContent
60
- * @property {string} title - Title for ticket.
61
- * @property {string} [description] - Long description of issue.
62
- * @property {TicketAsset[]} [attachments] - List of all attachments related to
63
- * the ticket.
64
- */
65
-
66
- /**
67
- * @typedef AddTicketPayload
68
- * @property {Object} [created_by] - Creator of the ticket.
69
- * @property {string} [status] - Status of the ticket.
70
- * @property {PriorityEnum} [priority]
71
- * @property {string} category - Category of the ticket.
72
- * @property {TicketContent} content
73
- * @property {Object} [_custom_json] - Optional custom data that needs to be sent.
74
- * @property {string[]} [subscribers] - List of emails to be informed for ticket updates.
75
- */
76
-
77
- /**
78
- * @typedef Priority
79
- * @property {PriorityEnum} key
80
- * @property {string} display - Display text for priority.
81
- * @property {string} color - Color for priority.
82
- */
83
-
84
- /**
85
- * @typedef Status
86
- * @property {string} key - Key for status.
87
- * @property {string} display - Display text for status.
88
- * @property {string} color - Color for status.
89
- */
90
-
91
- /**
92
- * @typedef SubmitButton
93
- * @property {string} title - Title for submit button.
94
- * @property {string} title_color - Title color submit button.
95
- * @property {string} background_color - Color for submit button.
96
- */
97
-
98
- /**
99
- * @typedef PollForAssignment
100
- * @property {number} duration - Duration for polling of staff.
101
- * @property {string} message - Message for polling.
102
- * @property {string} success_message - Message for successful polling.
103
- * @property {string} failure_message - Message if polling failed.
104
- */
105
-
106
- /**
107
- * @typedef CustomForm
108
- * @property {string} application_id - Application ID - Identifier for a Sales channel.
109
- * @property {string} slug - Slug for the form, which is to be used for
110
- * accessing the form.
111
- * @property {string} [header_image] - Form header image that will be shown to the user.
112
- * @property {string} title - Form title that will be shown to the user.
113
- * @property {string} [description] - Form description that will be shown to the user.
114
- * @property {Priority} priority
115
- * @property {boolean} login_required - If login is required to make a form
116
- * response submission.
117
- * @property {boolean} should_notify - If new response submission for the form
118
- * should be notified to the assignees.
119
- * @property {string} [success_message] - Message that is to be shown on
120
- * successful form response submission.
121
- * @property {SubmitButton} [submit_button]
122
- * @property {Object[]} inputs - List of all the form fields.
123
- * @property {CreatedOn} [created_on]
124
- * @property {PollForAssignment} [poll_for_assignment]
125
- * @property {string} _id - Unique identifier for the form.
126
- */
127
-
128
- /**
129
- * @typedef FeedbackForm
130
- * @property {Object} [inputs] - Input details for the feedback form.
131
- * @property {string} [title] - Title for the feedback form.
132
- * @property {Object} [timestamps] - Timestamp details of feedback form.
133
- */
134
-
135
- /**
136
- * @typedef TicketCategory
137
- * @property {string} display - Category display value identifier.
138
- * @property {string} key - Category key value identifier.
139
- * @property {TicketCategory} [sub_categories]
140
- * @property {number} [group_id] - Group id of category related data.
141
- * @property {FeedbackForm} [feedback_form]
142
- */
143
-
144
- /**
145
- * @typedef TicketHistory
146
- * @property {string} type - Type of the history event.
147
- * @property {Object} value - Data of the history event.
148
- * @property {string} ticket_id - Readable ticket number.
149
- * @property {CreatedOn} [created_on]
150
- * @property {Object} [created_by] - User who created the history event.
151
- * @property {string} _id - Unique identifier of the history event.
152
- * @property {string} [updated_at] - Time of last update of the history event.
153
- * @property {string} [created_at] - Time of creation of the history event.
154
- */
155
-
156
- /**
157
- * @typedef Ticket
158
- * @property {TicketContext} [context]
159
- * @property {CreatedOn} [created_on]
160
- * @property {string} [response_id] - Details of company and application related
161
- * to the ticket.
162
- * @property {TicketContent} [content]
163
- * @property {TicketCategory} category
164
- * @property {string} [sub_category] - Sub-category assigned to the ticket.
165
- * @property {TicketSourceEnum} source
166
- * @property {Status} status
167
- * @property {Priority} priority
168
- * @property {Object} [created_by] - User details of ticket creator.
169
- * @property {Object} [assigned_to] - Details of support staff to whom ticket is assigned.
170
- * @property {string[]} [tags] - Tags relevant to ticket.
171
- * @property {Object} [_custom_json] - Custom json relevant to the ticket.
172
- * @property {boolean} [is_feedback_pending] - If feedback submission is pending
173
- * for the ticket.
174
- * @property {Object} [integration] - Integration type and its details of the ticket.
175
- * @property {string} _id - Unique identifier for the ticket.
176
- * @property {string} [updated_at] - Time when the ticket was last updated.
177
- * @property {string} [created_at] - Time when the ticket was created.
178
- */
179
-
180
- /** @typedef {"low" | "medium" | "high" | "urgent"} PriorityEnum */
181
-
182
- /** @typedef {"rating" | "log" | "comment" | "thread"} HistoryTypeEnum */
183
-
184
- /**
185
- * @typedef {| "image"
186
- * | "video"
187
- * | "file"
188
- * | "youtube"
189
- * | "product"
190
- * | "collection"
191
- * | "brand"
192
- * | "shipment"
193
- * | "order"} TicketAssetTypeEnum
194
- */
195
-
196
- /** @typedef {"platform_panel" | "sales_channel"} TicketSourceEnum */
197
-
198
- class LeadApplicationModel {
199
- /** @returns {TicketHistoryPayload} */
200
- static TicketHistoryPayload() {
201
- return Joi.object({
202
- value: Joi.any().required(),
203
- type: LeadApplicationModel.HistoryTypeEnum().required(),
204
- });
205
- }
206
-
207
- /** @returns {CustomFormSubmissionPayload} */
208
- static CustomFormSubmissionPayload() {
209
- return Joi.object({
210
- response: Joi.array().items(Joi.any()).required(),
211
- attachments: Joi.array().items(LeadApplicationModel.TicketAsset()),
212
- });
213
- }
214
-
215
- /** @returns {SubmitCustomFormResponse} */
216
- static SubmitCustomFormResponse() {
217
- return Joi.object({
218
- message: Joi.string().allow("").required(),
219
- ticket: LeadApplicationModel.Ticket(),
220
- response: LeadApplicationModel.FormFieldResponse(),
221
- });
222
- }
223
-
224
- /** @returns {FormFieldResponse} */
225
- static FormFieldResponse() {
226
- return Joi.object({
227
- _id: Joi.string().allow(""),
228
- __v: Joi.number(),
229
- application_id: Joi.string().allow(""),
230
- form_slug: Joi.string().allow(""),
231
- created_on: LeadApplicationModel.CreatedOn(),
232
- response: Joi.array().items(
233
- LeadApplicationModel.FormFieldResponseValues()
234
- ),
235
- });
236
- }
237
-
238
- /** @returns {FormFieldResponseValues} */
239
- static FormFieldResponseValues() {
240
- return Joi.object({
241
- key: Joi.string().allow(""),
242
- });
243
- }
244
-
245
- /** @returns {TicketContext} */
246
- static TicketContext() {
247
- return Joi.object({
248
- application_id: Joi.string().allow(""),
249
- company_id: Joi.string().allow("").required(),
250
- });
251
- }
252
-
253
- /** @returns {CreatedOn} */
254
- static CreatedOn() {
255
- return Joi.object({
256
- user_agent: Joi.string().allow("").required(),
257
- });
258
- }
259
-
260
- /** @returns {TicketAsset} */
261
- static TicketAsset() {
262
- return Joi.object({
263
- display: Joi.string().allow(""),
264
- value: Joi.string().allow("").required(),
265
- type: LeadApplicationModel.TicketAssetTypeEnum().required(),
266
- });
267
- }
268
-
269
- /** @returns {TicketContent} */
270
- static TicketContent() {
271
- return Joi.object({
272
- title: Joi.string().allow("").required(),
273
- description: Joi.string().allow(""),
274
- attachments: Joi.array().items(LeadApplicationModel.TicketAsset()),
275
- });
276
- }
277
-
278
- /** @returns {AddTicketPayload} */
279
- static AddTicketPayload() {
280
- return Joi.object({
281
- created_by: Joi.any(),
282
- status: Joi.string().allow(""),
283
- priority: LeadApplicationModel.PriorityEnum(),
284
- category: Joi.string().allow("").required(),
285
- content: LeadApplicationModel.TicketContent().required(),
286
- _custom_json: Joi.any(),
287
- subscribers: Joi.array().items(Joi.string().allow("")),
288
- });
289
- }
290
-
291
- /** @returns {Priority} */
292
- static Priority() {
293
- return Joi.object({
294
- key: LeadApplicationModel.PriorityEnum().required(),
295
- display: Joi.string().allow("").required(),
296
- color: Joi.string().allow("").required(),
297
- });
298
- }
299
-
300
- /** @returns {Status} */
301
- static Status() {
302
- return Joi.object({
303
- key: Joi.string().allow("").required(),
304
- display: Joi.string().allow("").required(),
305
- color: Joi.string().allow("").required(),
306
- });
307
- }
308
-
309
- /** @returns {SubmitButton} */
310
- static SubmitButton() {
311
- return Joi.object({
312
- title: Joi.string().allow("").required(),
313
- title_color: Joi.string().allow("").required(),
314
- background_color: Joi.string().allow("").required(),
315
- });
316
- }
317
-
318
- /** @returns {PollForAssignment} */
319
- static PollForAssignment() {
320
- return Joi.object({
321
- duration: Joi.number().required(),
322
- message: Joi.string().allow("").required(),
323
- success_message: Joi.string().allow("").required(),
324
- failure_message: Joi.string().allow("").required(),
325
- });
326
- }
327
-
328
- /** @returns {CustomForm} */
329
- static CustomForm() {
330
- return Joi.object({
331
- application_id: Joi.string().allow("").required(),
332
- slug: Joi.string().allow("").required(),
333
- header_image: Joi.string().allow(""),
334
- title: Joi.string().allow("").required(),
335
- description: Joi.string().allow(""),
336
- priority: LeadApplicationModel.Priority().required(),
337
- login_required: Joi.boolean().required(),
338
- should_notify: Joi.boolean().required(),
339
- success_message: Joi.string().allow(""),
340
- submit_button: LeadApplicationModel.SubmitButton(),
341
- inputs: Joi.array().items(Joi.any()).required(),
342
- created_on: LeadApplicationModel.CreatedOn(),
343
- poll_for_assignment: LeadApplicationModel.PollForAssignment(),
344
- _id: Joi.string().allow("").required(),
345
- });
346
- }
347
-
348
- /** @returns {FeedbackForm} */
349
- static FeedbackForm() {
350
- return Joi.object({
351
- inputs: Joi.any(),
352
- title: Joi.string().allow(""),
353
- timestamps: Joi.any(),
354
- });
355
- }
356
-
357
- /** @returns {TicketCategory} */
358
- static TicketCategory() {
359
- return Joi.object({
360
- display: Joi.string().allow("").required(),
361
- key: Joi.string().allow("").required(),
362
- sub_categories: Joi.link("#TicketCategory"),
363
- group_id: Joi.number(),
364
- feedback_form: LeadApplicationModel.FeedbackForm(),
365
- }).id("TicketCategory");
366
- }
367
-
368
- /** @returns {TicketHistory} */
369
- static TicketHistory() {
370
- return Joi.object({
371
- type: Joi.string().allow("").required(),
372
- value: Joi.any().required(),
373
- ticket_id: Joi.string().allow("").required(),
374
- created_on: LeadApplicationModel.CreatedOn(),
375
- created_by: Joi.any(),
376
- _id: Joi.string().allow("").required(),
377
- updated_at: Joi.string().allow(""),
378
- created_at: Joi.string().allow(""),
379
- });
380
- }
381
-
382
- /** @returns {Ticket} */
383
- static Ticket() {
384
- return Joi.object({
385
- context: LeadApplicationModel.TicketContext(),
386
- created_on: LeadApplicationModel.CreatedOn(),
387
- response_id: Joi.string().allow(""),
388
- content: LeadApplicationModel.TicketContent(),
389
- category: LeadApplicationModel.TicketCategory().required(),
390
- sub_category: Joi.string().allow(""),
391
- source: LeadApplicationModel.TicketSourceEnum().required(),
392
- status: LeadApplicationModel.Status().required(),
393
- priority: LeadApplicationModel.Priority().required(),
394
- created_by: Joi.any(),
395
- assigned_to: Joi.any(),
396
- tags: Joi.array().items(Joi.string().allow("")),
397
- _custom_json: Joi.any(),
398
- is_feedback_pending: Joi.boolean(),
399
- integration: Joi.any(),
400
- _id: Joi.string().allow("").required(),
401
- updated_at: Joi.string().allow(""),
402
- created_at: Joi.string().allow(""),
403
- });
404
- }
405
-
406
- /**
407
- * Enum: PriorityEnum Used By: Lead
408
- *
409
- * @returns {PriorityEnum}
410
- */
411
- static PriorityEnum() {
412
- return Joi.string().valid(
413
- "low",
414
-
415
- "medium",
416
-
417
- "high",
418
-
419
- "urgent"
420
- );
421
- }
422
-
423
- /**
424
- * Enum: HistoryTypeEnum Used By: Lead
425
- *
426
- * @returns {HistoryTypeEnum}
427
- */
428
- static HistoryTypeEnum() {
429
- return Joi.string().valid(
430
- "rating",
431
-
432
- "log",
433
-
434
- "comment",
435
-
436
- "thread"
437
- );
438
- }
439
-
440
- /**
441
- * Enum: TicketAssetTypeEnum Used By: Lead
442
- *
443
- * @returns {TicketAssetTypeEnum}
444
- */
445
- static TicketAssetTypeEnum() {
446
- return Joi.string().valid(
447
- "image",
448
-
449
- "video",
450
-
451
- "file",
452
-
453
- "youtube",
454
-
455
- "product",
456
-
457
- "collection",
458
-
459
- "brand",
460
-
461
- "shipment",
462
-
463
- "order"
464
- );
465
- }
466
-
467
- /**
468
- * Enum: TicketSourceEnum Used By: Lead
469
- *
470
- * @returns {TicketSourceEnum}
471
- */
472
- static TicketSourceEnum() {
473
- return Joi.string().valid(
474
- "platform_panel",
475
-
476
- "sales_channel"
477
- );
478
- }
479
- }
480
- module.exports = LeadApplicationModel;
@@ -1,68 +0,0 @@
1
- export = LeadApplicationValidator;
2
- /**
3
- * @typedef CreateHistoryParam
4
- * @property {string} id - Ticket ID for which history is created.
5
- * @property {LeadApplicationModel.TicketHistoryPayload} body
6
- */
7
- /**
8
- * @typedef CreateTicketParam
9
- * @property {LeadApplicationModel.AddTicketPayload} body
10
- */
11
- /**
12
- * @typedef GetCustomFormParam
13
- * @property {string} slug - Slug of form whose response is getting submitted.
14
- */
15
- /**
16
- * @typedef GetTicketParam
17
- * @property {string} id - ID of ticket to be retrieved.
18
- */
19
- /**
20
- * @typedef SubmitCustomFormParam
21
- * @property {string} slug - Slug of form whose response is getting submitted.
22
- * @property {LeadApplicationModel.CustomFormSubmissionPayload} body
23
- */
24
- declare class LeadApplicationValidator {
25
- /** @returns {CreateHistoryParam} */
26
- static createHistory(): CreateHistoryParam;
27
- /** @returns {CreateTicketParam} */
28
- static createTicket(): CreateTicketParam;
29
- /** @returns {GetCustomFormParam} */
30
- static getCustomForm(): GetCustomFormParam;
31
- /** @returns {GetTicketParam} */
32
- static getTicket(): GetTicketParam;
33
- /** @returns {SubmitCustomFormParam} */
34
- static submitCustomForm(): SubmitCustomFormParam;
35
- }
36
- declare namespace LeadApplicationValidator {
37
- export { CreateHistoryParam, CreateTicketParam, GetCustomFormParam, GetTicketParam, SubmitCustomFormParam };
38
- }
39
- type CreateHistoryParam = {
40
- /**
41
- * - Ticket ID for which history is created.
42
- */
43
- id: string;
44
- body: LeadApplicationModel.TicketHistoryPayload;
45
- };
46
- type CreateTicketParam = {
47
- body: LeadApplicationModel.AddTicketPayload;
48
- };
49
- type GetCustomFormParam = {
50
- /**
51
- * - Slug of form whose response is getting submitted.
52
- */
53
- slug: string;
54
- };
55
- type GetTicketParam = {
56
- /**
57
- * - ID of ticket to be retrieved.
58
- */
59
- id: string;
60
- };
61
- type SubmitCustomFormParam = {
62
- /**
63
- * - Slug of form whose response is getting submitted.
64
- */
65
- slug: string;
66
- body: LeadApplicationModel.CustomFormSubmissionPayload;
67
- };
68
- import LeadApplicationModel = require("./LeadApplicationModel");
@@ -1,71 +0,0 @@
1
- const Joi = require("joi");
2
-
3
- const LeadApplicationModel = require("./LeadApplicationModel");
4
-
5
- /**
6
- * @typedef CreateHistoryParam
7
- * @property {string} id - Ticket ID for which history is created.
8
- * @property {LeadApplicationModel.TicketHistoryPayload} body
9
- */
10
-
11
- /**
12
- * @typedef CreateTicketParam
13
- * @property {LeadApplicationModel.AddTicketPayload} body
14
- */
15
-
16
- /**
17
- * @typedef GetCustomFormParam
18
- * @property {string} slug - Slug of form whose response is getting submitted.
19
- */
20
-
21
- /**
22
- * @typedef GetTicketParam
23
- * @property {string} id - ID of ticket to be retrieved.
24
- */
25
-
26
- /**
27
- * @typedef SubmitCustomFormParam
28
- * @property {string} slug - Slug of form whose response is getting submitted.
29
- * @property {LeadApplicationModel.CustomFormSubmissionPayload} body
30
- */
31
-
32
- class LeadApplicationValidator {
33
- /** @returns {CreateHistoryParam} */
34
- static createHistory() {
35
- return Joi.object({
36
- id: Joi.string().allow("").required(),
37
- body: LeadApplicationModel.TicketHistoryPayload().required(),
38
- }).required();
39
- }
40
-
41
- /** @returns {CreateTicketParam} */
42
- static createTicket() {
43
- return Joi.object({
44
- body: LeadApplicationModel.AddTicketPayload().required(),
45
- }).required();
46
- }
47
-
48
- /** @returns {GetCustomFormParam} */
49
- static getCustomForm() {
50
- return Joi.object({
51
- slug: Joi.string().allow("").required(),
52
- }).required();
53
- }
54
-
55
- /** @returns {GetTicketParam} */
56
- static getTicket() {
57
- return Joi.object({
58
- id: Joi.string().allow("").required(),
59
- }).required();
60
- }
61
-
62
- /** @returns {SubmitCustomFormParam} */
63
- static submitCustomForm() {
64
- return Joi.object({
65
- slug: Joi.string().allow("").required(),
66
- body: LeadApplicationModel.CustomFormSubmissionPayload().required(),
67
- }).required();
68
- }
69
- }
70
-
71
- module.exports = LeadApplicationValidator;