@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,29 +1,65 @@
1
1
  const Joi = require("joi");
2
2
 
3
3
  /**
4
- * @typedef AppProvider
5
- * @property {number} [__v]
4
+ * @typedef EventSubscriptionsBulkUpdateRequest
5
+ * @property {SubscriptionsObject[]} [subscriptions]
6
+ */
7
+
8
+ /**
9
+ * @typedef EventSubscriptionsBulkUpdateResponse
10
+ * @property {EventSubscriptionTemplate} [template]
6
11
  * @property {string} [_id]
7
12
  * @property {string} [application]
13
+ * @property {string} [event]
14
+ * @property {string} [slug]
15
+ * @property {string} [category]
8
16
  * @property {string} [created_at]
9
- * @property {AppProviderRes} [email]
10
- * @property {AppProviderRes} [sms]
11
17
  * @property {string} [updated_at]
12
- * @property {AppProviderResVoice} [voice]
18
+ * @property {number} [__v]
13
19
  */
14
20
 
15
21
  /**
16
- * @typedef AppProviderReq
22
+ * @typedef SubscriptionsObject
23
+ * @property {string} [_id] - Subscription ID
24
+ * @property {TemplateObject} [template]
25
+ */
26
+
27
+ /**
28
+ * @typedef TemplateObject
29
+ * @property {CommunicationTemplate} [sms]
30
+ * @property {CommunicationTemplate} [email]
31
+ * @property {CommunicationTemplate} [pushnotification]
32
+ */
33
+
34
+ /**
35
+ * @typedef CommunicationTemplate
36
+ * @property {boolean} [subscribed] - Whether the user is subscribed or not
37
+ * @property {string} [template] - Template ID
38
+ */
39
+
40
+ /**
41
+ * @typedef AppProvider
17
42
  * @property {AppProviderRes} [email]
18
43
  * @property {AppProviderRes} [sms]
19
44
  * @property {AppProviderResVoice} [voice]
45
+ * @property {string} [_id]
46
+ * @property {string} [application]
47
+ * @property {string} [created_at]
48
+ * @property {string} [updated_at]
49
+ * @property {number} [__v]
20
50
  */
21
51
 
22
52
  /**
23
53
  * @typedef AppProviderRes
24
- * @property {AppProviderResObj} [otp]
54
+ * @property {AppProviderResObj} [transaction]
25
55
  * @property {AppProviderResObj} [promotional]
56
+ * @property {AppProviderResObj} [otp]
57
+ */
58
+
59
+ /**
60
+ * @typedef AppProviderResVoice
26
61
  * @property {AppProviderResObj} [transaction]
62
+ * @property {AppProviderResObj} [otp]
27
63
  */
28
64
 
29
65
  /**
@@ -32,74 +68,78 @@ const Joi = require("joi");
32
68
  */
33
69
 
34
70
  /**
35
- * @typedef AppProviderResVoice
36
- * @property {AppProviderResObj} [otp]
37
- * @property {AppProviderResObj} [transaction]
71
+ * @typedef GlobalProviders
72
+ * @property {GlobalProvidersResObj[]} [email]
73
+ * @property {GlobalProvidersResObj[]} [sms]
74
+ * @property {GlobalProvidersResObj[]} [voice]
38
75
  */
39
76
 
40
77
  /**
41
- * @typedef Audience
42
- * @property {number} [__v]
78
+ * @typedef GlobalProvidersResObj
43
79
  * @property {string} [_id]
44
- * @property {string} [application]
45
- * @property {string} [created_at]
46
- * @property {string} [description]
47
- * @property {string} [file_url]
48
- * @property {string[]} [headers]
49
- * @property {boolean} [is_active]
50
80
  * @property {string} [name]
51
- * @property {number} [records_count]
52
- * @property {string} [slug]
53
- * @property {string[]} [tags]
54
- * @property {string} [type]
55
- * @property {string} [updated_at]
56
81
  */
57
82
 
58
83
  /**
59
- * @typedef AudienceReq
60
- * @property {string} [description]
61
- * @property {string} [file_url]
62
- * @property {string[]} [headers]
63
- * @property {string} [name]
64
- * @property {number} [records_count]
65
- * @property {string[]} [tags]
66
- * @property {string} [type]
84
+ * @typedef AppProviderReq
85
+ * @property {AppProviderRes} [email]
86
+ * @property {AppProviderRes} [sms]
87
+ * @property {AppProviderResVoice} [voice]
67
88
  */
68
89
 
69
90
  /**
70
- * @typedef Audiences
71
- * @property {Audience[]} [items]
72
- * @property {Page} [page]
91
+ * @typedef StatsImported
92
+ * @property {number} [count]
73
93
  */
74
94
 
75
95
  /**
76
- * @typedef BadRequestSchema
77
- * @property {string} [message] - Failure message.
78
- * @property {string} [status] - Response status.
96
+ * @typedef StatsProcessedEmail
97
+ * @property {number} [success]
98
+ * @property {number} [failed]
99
+ * @property {number} [suppressed]
79
100
  */
80
101
 
81
102
  /**
82
- * @typedef Campaign
83
- * @property {number} [__v]
103
+ * @typedef StatsProcessedSms
104
+ * @property {number} [success]
105
+ * @property {number} [failed]
106
+ * @property {number} [suppressed]
107
+ */
108
+
109
+ /**
110
+ * @typedef StatsProcessed
111
+ * @property {StatsProcessedEmail} [email]
112
+ * @property {StatsProcessedSms} [sms]
113
+ */
114
+
115
+ /**
116
+ * @typedef Stats
84
117
  * @property {string} [_id]
85
- * @property {string} [application]
86
- * @property {string} [created_at]
87
- * @property {string} [datasource]
118
+ * @property {Object} [imported]
119
+ * @property {Object} [processed]
120
+ */
121
+
122
+ /**
123
+ * @typedef GetStats
124
+ * @property {Stats[]} [items]
125
+ */
126
+
127
+ /**
128
+ * @typedef CampaignReq
88
129
  * @property {string} [description]
89
- * @property {CampaignEmail} [email]
130
+ * @property {string[]} [tags]
131
+ * @property {string[]} [headers]
90
132
  * @property {boolean} [is_active]
91
133
  * @property {string} [name]
92
- * @property {RecipientHeaders} [recipient_headers]
93
- * @property {string} [slug]
94
- * @property {Object[]} [tags]
134
+ * @property {string} [file_url]
95
135
  * @property {string} [type]
96
- * @property {string} [updated_at]
136
+ * @property {number} [records_count]
137
+ * @property {string} [application]
97
138
  */
98
139
 
99
140
  /**
100
- * @typedef CampaignEmail
101
- * @property {CampignEmailProvider} [provider]
102
- * @property {CampaignEmailTemplate} [template]
141
+ * @typedef RecipientHeaders
142
+ * @property {string} [email]
103
143
  */
104
144
 
105
145
  /**
@@ -109,16 +149,34 @@ const Joi = require("joi");
109
149
  */
110
150
 
111
151
  /**
112
- * @typedef CampaignReq
113
- * @property {string} [application]
152
+ * @typedef CampignEmailProvider
153
+ * @property {string} [_id]
154
+ * @property {string} [from_name]
155
+ * @property {string} [from_email]
156
+ */
157
+
158
+ /**
159
+ * @typedef CampaignEmail
160
+ * @property {CampaignEmailTemplate} [template]
161
+ * @property {CampignEmailProvider} [provider]
162
+ */
163
+
164
+ /**
165
+ * @typedef Campaign
166
+ * @property {RecipientHeaders} [recipient_headers]
167
+ * @property {CampaignEmail} [email]
114
168
  * @property {string} [description]
115
- * @property {string} [file_url]
116
- * @property {string[]} [headers]
169
+ * @property {Object[]} [tags]
117
170
  * @property {boolean} [is_active]
118
- * @property {string} [name]
119
- * @property {number} [records_count]
120
- * @property {string[]} [tags]
171
+ * @property {string} [_id]
172
+ * @property {string} [datasource]
121
173
  * @property {string} [type]
174
+ * @property {string} [name]
175
+ * @property {string} [application]
176
+ * @property {string} [created_at]
177
+ * @property {string} [updated_at]
178
+ * @property {string} [slug]
179
+ * @property {number} [__v]
122
180
  */
123
181
 
124
182
  /**
@@ -128,40 +186,70 @@ const Joi = require("joi");
128
186
  */
129
187
 
130
188
  /**
131
- * @typedef CampignEmailProvider
132
- * @property {string} [_id]
133
- * @property {string} [from_email]
134
- * @property {string} [from_name]
189
+ * @typedef BadRequestSchema
190
+ * @property {string} [status] - Response status.
191
+ * @property {string} [message] - Failure message.
135
192
  */
136
193
 
137
194
  /**
138
- * @typedef CommunicationTemplate
139
- * @property {boolean} [subscribed] - Whether the user is subscribed or not
140
- * @property {string} [template] - Template ID
195
+ * @typedef NotFound
196
+ * @property {string} [message] - Failure message.
141
197
  */
142
198
 
143
199
  /**
144
- * @typedef CreateJobsReq
145
- * @property {string} [campaign]
200
+ * @typedef AudienceReq
201
+ * @property {string} [name]
202
+ * @property {string} [description]
203
+ * @property {string[]} [tags]
204
+ * @property {string} [file_url]
205
+ * @property {string} [type]
206
+ * @property {number} [records_count]
207
+ * @property {string[]} [headers]
146
208
  */
147
209
 
148
210
  /**
149
- * @typedef CreateJobsRes
150
- * @property {number} [__v]
211
+ * @typedef Audience
151
212
  * @property {string} [_id]
152
213
  * @property {string} [application]
153
- * @property {string} [campaign]
154
- * @property {boolean} [completed]
155
- * @property {string} [created_at]
214
+ * @property {string} [name]
215
+ * @property {string} [description]
216
+ * @property {number} [records_count]
217
+ * @property {string} [type]
218
+ * @property {string[]} [tags]
219
+ * @property {string[]} [headers]
220
+ * @property {string} [file_url]
156
221
  * @property {boolean} [is_active]
222
+ * @property {string} [created_at]
157
223
  * @property {string} [updated_at]
224
+ * @property {string} [slug]
225
+ * @property {number} [__v]
158
226
  */
159
227
 
160
228
  /**
161
- * @typedef DefaultSmsProviders
162
- * @property {string} [_id]
163
- * @property {boolean} [is_default]
164
- * @property {string} [name]
229
+ * @typedef Audiences
230
+ * @property {Audience[]} [items]
231
+ * @property {Page} [page]
232
+ */
233
+
234
+ /**
235
+ * @typedef GetNRecordsCsvReq
236
+ * @property {string} [url]
237
+ * @property {boolean} [header]
238
+ * @property {number} [count]
239
+ */
240
+
241
+ /**
242
+ * @typedef GetNRecordsCsvResItems
243
+ * @property {string} [phone_number]
244
+ * @property {string} [email]
245
+ * @property {string} [firstname]
246
+ * @property {string} [lastname]
247
+ * @property {string} [orderid]
248
+ */
249
+
250
+ /**
251
+ * @typedef GetNRecordsCsvRes
252
+ * @property {GetNRecordsCsvResItems[]} [items]
165
253
  */
166
254
 
167
255
  /**
@@ -172,8 +260,8 @@ const Joi = require("joi");
172
260
 
173
261
  /**
174
262
  * @typedef DummyDatasourcesMeta
175
- * @property {DummyDatasourcesMetaObj} [data]
176
263
  * @property {number} [id]
264
+ * @property {DummyDatasourcesMetaObj} [data]
177
265
  */
178
266
 
179
267
  /**
@@ -182,36 +270,36 @@ const Joi = require("joi");
182
270
  */
183
271
 
184
272
  /**
185
- * @typedef EmailProvider
186
- * @property {number} [__v]
187
- * @property {string} [_id]
188
- * @property {string} [api_key]
189
- * @property {string} [application]
190
- * @property {string} [created_at]
191
- * @property {string} [description]
192
- * @property {EmailProviderReqFrom[]} [from_address]
273
+ * @typedef EmailProviderReqFrom
193
274
  * @property {string} [name]
194
- * @property {string} [provider]
195
- * @property {string} [slug]
196
- * @property {string} [type]
197
- * @property {string} [updated_at]
275
+ * @property {string} [email]
276
+ * @property {boolean} [is_default]
198
277
  */
199
278
 
200
279
  /**
201
280
  * @typedef EmailProviderReq
202
- * @property {string} [api_key]
203
- * @property {string} [description]
204
- * @property {EmailProviderReqFrom[]} [from_address]
205
281
  * @property {string} [name]
206
- * @property {string} [provider]
282
+ * @property {string} [description]
283
+ * @property {string} [api_key]
207
284
  * @property {string} [type]
285
+ * @property {string} [provider]
286
+ * @property {EmailProviderReqFrom[]} [from_address]
208
287
  */
209
288
 
210
289
  /**
211
- * @typedef EmailProviderReqFrom
212
- * @property {string} [email]
213
- * @property {boolean} [is_default]
290
+ * @typedef EmailProvider
291
+ * @property {string} [type]
292
+ * @property {string} [provider]
293
+ * @property {EmailProviderReqFrom[]} [from_address]
294
+ * @property {string} [_id]
214
295
  * @property {string} [name]
296
+ * @property {string} [description]
297
+ * @property {string} [api_key]
298
+ * @property {string} [application]
299
+ * @property {string} [created_at]
300
+ * @property {string} [updated_at]
301
+ * @property {string} [slug]
302
+ * @property {number} [__v]
215
303
  */
216
304
 
217
305
  /**
@@ -221,35 +309,10 @@ const Joi = require("joi");
221
309
  */
222
310
 
223
311
  /**
224
- * @typedef EmailTemplate
225
- * @property {number} [__v]
226
- * @property {string} [_id]
227
- * @property {string} [application]
228
- * @property {number[]} [attachments]
229
- * @property {string} [category]
230
- * @property {string} [created_at]
231
- * @property {string} [description]
232
- * @property {string} [editor_meta]
233
- * @property {string} [editor_type]
234
- * @property {string} [from_name]
235
- * @property {EmailTemplateHeaders[]} [headers]
236
- * @property {TemplateAndType} [html]
237
- * @property {boolean} [is_internal]
238
- * @property {boolean} [is_system]
239
- * @property {string} [name]
240
- * @property {string} [priority]
241
- * @property {boolean} [published]
242
- * @property {string} [reply_to]
243
- * @property {string} [slug]
244
- * @property {string[]} [static_bcc]
245
- * @property {string[]} [static_cc]
246
- * @property {string[]} [static_to]
247
- * @property {TemplateAndType} [subject]
248
- * @property {string[]} [tags]
249
- * @property {Object} [template_variables]
250
- * @property {TemplateAndType} [text]
251
- * @property {string} [updated_at]
252
- * @property {EnabledObj} [url_shorten]
312
+ * @typedef EmailTemplateKeys
313
+ * @property {string} [to]
314
+ * @property {string} [cc]
315
+ * @property {string} [bcc]
253
316
  */
254
317
 
255
318
  /**
@@ -259,32 +322,90 @@ const Joi = require("joi");
259
322
  */
260
323
 
261
324
  /**
262
- * @typedef EmailTemplateKeys
263
- * @property {string} [bcc]
264
- * @property {string} [cc]
265
- * @property {string} [to]
325
+ * @typedef EmailTemplateReq
326
+ * @property {string} name
327
+ * @property {string} [description]
328
+ * @property {string} [from_name]
329
+ * @property {string[]} [static_to]
330
+ * @property {string[]} [static_cc]
331
+ * @property {string[]} [static_bcc]
332
+ * @property {string} [reply_to]
333
+ * @property {string} [priority]
334
+ * @property {string[]} [tags]
335
+ * @property {Object} [template_variables]
336
+ * @property {boolean} [published]
337
+ * @property {TemplateAndType} [subject]
338
+ * @property {TemplateAndType} [html]
339
+ * @property {string} [editor_type]
340
+ * @property {string} [editor_meta]
341
+ * @property {number[]} [attachments]
342
+ * @property {EmailTemplateHeaders[]} [headers]
343
+ * @property {EmailTemplateKeys} [keys]
344
+ * @property {TemplateAndType} [text]
266
345
  */
267
346
 
268
347
  /**
269
- * @typedef EmailTemplateReq
270
- * @property {number[]} [attachments]
348
+ * @typedef TemplateAndType
349
+ * @property {string} [template_type]
350
+ * @property {string} [template]
351
+ */
352
+
353
+ /**
354
+ * @typedef EmailTemplate
355
+ * @property {string} [application]
356
+ * @property {boolean} [is_system]
357
+ * @property {boolean} [is_internal]
358
+ * @property {string} [name]
271
359
  * @property {string} [description]
272
- * @property {string} [editor_meta]
273
360
  * @property {string} [editor_type]
274
- * @property {string} [from_name]
275
- * @property {EmailTemplateHeaders[]} [headers]
361
+ * @property {string} [editor_meta]
362
+ * @property {string[]} [static_to]
363
+ * @property {string[]} [static_cc]
364
+ * @property {string[]} [static_bcc]
365
+ * @property {string} [reply_to]
366
+ * @property {string[]} [tags]
367
+ * @property {TemplateAndType} [subject]
276
368
  * @property {TemplateAndType} [html]
277
- * @property {EmailTemplateKeys} [keys]
278
- * @property {string} name
369
+ * @property {EnabledObj} [url_shorten]
279
370
  * @property {string} [priority]
371
+ * @property {Object} [template_variables]
280
372
  * @property {boolean} [published]
281
- * @property {string} [reply_to]
282
- * @property {string[]} [static_bcc]
283
- * @property {string[]} [static_cc]
373
+ * @property {string} [category]
374
+ * @property {string} [_id]
375
+ * @property {EmailTemplateHeaders[]} [headers]
376
+ * @property {number[]} [attachments]
377
+ * @property {string} [created_at]
378
+ * @property {string} [updated_at]
379
+ * @property {string} [slug]
380
+ * @property {number} [__v]
381
+ * @property {string} [from_name]
382
+ * @property {TemplateAndType} [text]
383
+ */
384
+
385
+ /**
386
+ * @typedef SystemEmailTemplate
387
+ * @property {boolean} [is_system]
388
+ * @property {boolean} [is_internal]
389
+ * @property {string} [name]
390
+ * @property {string} [description]
284
391
  * @property {string[]} [static_to]
285
- * @property {TemplateAndType} [subject]
392
+ * @property {string[]} [static_cc]
393
+ * @property {string[]} [static_bcc]
286
394
  * @property {string[]} [tags]
395
+ * @property {TemplateAndType} [subject]
396
+ * @property {TemplateAndType} [html]
397
+ * @property {EnabledObj} [url_shorten]
398
+ * @property {string} [priority]
287
399
  * @property {Object} [template_variables]
400
+ * @property {boolean} [published]
401
+ * @property {string} [category]
402
+ * @property {string} [_id]
403
+ * @property {EmailTemplateHeaders[]} [headers]
404
+ * @property {number[]} [attachments]
405
+ * @property {string} [created_at]
406
+ * @property {string} [updated_at]
407
+ * @property {string} [slug]
408
+ * @property {number} [__v]
288
409
  * @property {TemplateAndType} [text]
289
410
  */
290
411
 
@@ -295,142 +416,131 @@ const Joi = require("joi");
295
416
  */
296
417
 
297
418
  /**
298
- * @typedef EnabledObj
299
- * @property {boolean} [enabled]
419
+ * @typedef SystemEmailTemplates
420
+ * @property {SystemEmailTemplate[]} [items]
300
421
  */
301
422
 
302
423
  /**
303
- * @typedef EngineRequest
304
- * @property {MetaStructure} [meta]
305
- * @property {PayloadStructure} [payload]
424
+ * @typedef PayloadEmailTemplateStructure
425
+ * @property {string} [key]
426
+ * @property {Object} [value]
306
427
  */
307
428
 
308
429
  /**
309
- * @typedef EngineResponse
310
- * @property {boolean} [success]
430
+ * @typedef PayloadEmailProviderStructure
431
+ * @property {string} [_id]
311
432
  */
312
433
 
313
434
  /**
314
- * @typedef EventSubscription
315
- * @property {number} [__v]
316
- * @property {string} [_id]
317
- * @property {string} [application]
318
- * @property {string} [created_at]
319
- * @property {string} [event]
320
- * @property {boolean} [is_default]
321
- * @property {string} [slug]
322
- * @property {EventSubscriptionTemplate} [template]
323
- * @property {string} [updated_at]
435
+ * @typedef PayloadEmailStructure
436
+ * @property {PayloadEmailTemplateStructure} [template]
437
+ * @property {PayloadEmailProviderStructure} [provider]
324
438
  */
325
439
 
326
440
  /**
327
- * @typedef EventSubscriptions
328
- * @property {EventSubscription[]} [items]
329
- * @property {Page} [page]
441
+ * @typedef PayloadSmsTemplateStructure
442
+ * @property {string} [key]
443
+ * @property {Object} [value]
330
444
  */
331
445
 
332
446
  /**
333
- * @typedef EventSubscriptionsBulkUpdateRequest
334
- * @property {SubscriptionsObject[]} [subscriptions]
447
+ * @typedef PayloadSmsProviderStructure
448
+ * @property {string} [_id]
335
449
  */
336
450
 
337
451
  /**
338
- * @typedef EventSubscriptionsBulkUpdateResponse
339
- * @property {number} [__v]
340
- * @property {string} [_id]
452
+ * @typedef PayloadSmsStructure
453
+ * @property {PayloadSmsTemplateStructure} [template]
454
+ * @property {PayloadSmsProviderStructure} [provider]
455
+ */
456
+
457
+ /**
458
+ * @typedef PayloadStructure
459
+ * @property {Object[]} [data]
460
+ * @property {PayloadEmailStructure} [email]
461
+ * @property {PayloadSmsStructure} [sms]
341
462
  * @property {string} [application]
342
- * @property {string} [category]
343
- * @property {string} [created_at]
344
- * @property {string} [event]
345
- * @property {string} [slug]
346
- * @property {EventSubscriptionTemplate} [template]
347
- * @property {string} [updated_at]
348
463
  */
349
464
 
350
465
  /**
351
- * @typedef EventSubscriptionTemplate
352
- * @property {EventSubscriptionTemplateEmail} [email]
353
- * @property {EventSubscriptionTemplateSms} [sms]
466
+ * @typedef MetaStructure
467
+ * @property {string} [job_type]
468
+ * @property {string} [action]
469
+ * @property {string} [trace]
470
+ * @property {string} [timestamp]
354
471
  */
355
472
 
356
473
  /**
357
- * @typedef EventSubscriptionTemplateEmail
474
+ * @typedef EngineRequest
475
+ * @property {PayloadStructure} [payload]
476
+ * @property {MetaStructure} [meta]
477
+ */
478
+
479
+ /**
480
+ * @typedef EngineResponse
481
+ * @property {boolean} [success]
482
+ */
483
+
484
+ /**
485
+ * @typedef EventSubscriptionTemplateSms
358
486
  * @property {boolean} [subscribed]
359
487
  * @property {string} [template]
360
488
  */
361
489
 
362
490
  /**
363
- * @typedef EventSubscriptionTemplateSms
491
+ * @typedef EventSubscriptionTemplateEmail
364
492
  * @property {boolean} [subscribed]
365
493
  * @property {string} [template]
366
494
  */
367
495
 
368
496
  /**
369
- * @typedef GenericDelete
370
- * @property {boolean} [acknowledged]
371
- * @property {number} [affected]
372
- * @property {string} [message]
373
- * @property {string} [operation]
497
+ * @typedef EventSubscriptionTemplate
498
+ * @property {EventSubscriptionTemplateSms} [sms]
499
+ * @property {EventSubscriptionTemplateEmail} [email]
374
500
  */
375
501
 
376
502
  /**
377
- * @typedef GenericError
378
- * @property {Message} [message]
379
- * @property {string} [sentry]
503
+ * @typedef EventSubscription
504
+ * @property {EventSubscriptionTemplate} [template]
505
+ * @property {boolean} [is_default]
506
+ * @property {string} [_id]
507
+ * @property {string} [application]
508
+ * @property {string} [event]
509
+ * @property {string} [slug]
510
+ * @property {string} [created_at]
511
+ * @property {string} [updated_at]
512
+ * @property {number} [__v]
380
513
  */
381
514
 
382
515
  /**
383
- * @typedef GetNRecordsCsvReq
384
- * @property {number} [count]
385
- * @property {boolean} [header]
386
- * @property {string} [url]
516
+ * @typedef EventSubscriptions
517
+ * @property {EventSubscription[]} [items]
518
+ * @property {Page} [page]
387
519
  */
388
520
 
389
521
  /**
390
- * @typedef GetNRecordsCsvRes
391
- * @property {GetNRecordsCsvResItems[]} [items]
522
+ * @typedef TriggerJobResponse
523
+ * @property {number} [status]
392
524
  */
393
525
 
394
526
  /**
395
- * @typedef GetNRecordsCsvResItems
396
- * @property {string} [email]
397
- * @property {string} [firstname]
398
- * @property {string} [lastname]
399
- * @property {string} [orderid]
400
- * @property {string} [phone_number]
401
- */
402
-
403
- /**
404
- * @typedef GetStats
405
- * @property {Stats[]} [items]
406
- */
407
-
408
- /**
409
- * @typedef GlobalProviders
410
- * @property {GlobalProvidersResObj[]} [email]
411
- * @property {GlobalProvidersResObj[]} [sms]
412
- * @property {GlobalProvidersResObj[]} [voice]
413
- */
414
-
415
- /**
416
- * @typedef GlobalProvidersResObj
417
- * @property {string} [_id]
418
- * @property {string} [name]
527
+ * @typedef TriggerJobRequest
528
+ * @property {string} [job_id]
419
529
  */
420
530
 
421
531
  /**
422
532
  * @typedef GlobalVariablesGetResponse
423
- * @property {Object} [editable]
424
533
  * @property {Object} [read_only]
534
+ * @property {Object} [editable]
425
535
  */
426
536
 
427
537
  /**
428
538
  * @typedef GlobalVariablesPostResponse
429
539
  * @property {string} [_id]
430
- * @property {string} [application]
431
540
  * @property {string} [category]
432
- * @property {string} [created_at]
541
+ * @property {string} [application]
433
542
  * @property {Object} [global_variables]
543
+ * @property {string} [created_at]
434
544
  */
435
545
 
436
546
  /**
@@ -440,26 +550,49 @@ const Joi = require("joi");
440
550
 
441
551
  /**
442
552
  * @typedef Job
443
- * @property {number} [__v]
553
+ * @property {boolean} [completed]
554
+ * @property {boolean} [is_active]
444
555
  * @property {string} [_id]
556
+ * @property {string} [campaign]
557
+ * @property {string} [application]
558
+ * @property {string} [created_at]
559
+ * @property {string} [updated_at]
560
+ * @property {number} [__v]
561
+ */
562
+
563
+ /**
564
+ * @typedef Jobs
565
+ * @property {Job[]} [items]
566
+ * @property {Page} [page]
567
+ */
568
+
569
+ /**
570
+ * @typedef CreateJobsRes
445
571
  * @property {string} [application]
446
572
  * @property {string} [campaign]
447
573
  * @property {boolean} [completed]
448
- * @property {string} [created_at]
449
574
  * @property {boolean} [is_active]
575
+ * @property {string} [_id]
576
+ * @property {string} [created_at]
450
577
  * @property {string} [updated_at]
578
+ * @property {number} [__v]
579
+ */
580
+
581
+ /**
582
+ * @typedef CreateJobsReq
583
+ * @property {string} [campaign]
451
584
  */
452
585
 
453
586
  /**
454
587
  * @typedef JobLog
455
- * @property {number} [__v]
588
+ * @property {Object} [imported]
589
+ * @property {Object} [processed]
456
590
  * @property {string} [_id]
591
+ * @property {string} [job]
457
592
  * @property {string} [campaign]
458
593
  * @property {string} [created_at]
459
- * @property {Object} [imported]
460
- * @property {string} [job]
461
- * @property {Object} [processed]
462
594
  * @property {string} [updated_at]
595
+ * @property {number} [__v]
463
596
  */
464
597
 
465
598
  /**
@@ -469,44 +602,38 @@ const Joi = require("joi");
469
602
  */
470
603
 
471
604
  /**
472
- * @typedef Jobs
473
- * @property {Job[]} [items]
474
- * @property {Page} [page]
475
- */
476
-
477
- /**
478
- * @typedef Log
479
- * @property {string} [_id]
480
- * @property {string} [application]
481
- * @property {string} [created_at]
482
- * @property {Object} [data]
483
- * @property {LogEmail} [email]
484
- * @property {string} [expire_at]
485
- * @property {LogMeta} [meta]
486
- * @property {LogPushnotification} [pushnotification]
487
- * @property {string} [service]
488
- * @property {string} [status]
489
- * @property {string} [step]
605
+ * @typedef LogEmail
606
+ * @property {string} [template]
490
607
  */
491
608
 
492
609
  /**
493
- * @typedef LogEmail
494
- * @property {string} [template]
610
+ * @typedef LogPushnotification
611
+ * @property {string[]} [pushtokens]
495
612
  */
496
613
 
497
614
  /**
498
615
  * @typedef LogMeta
616
+ * @property {string} [type]
499
617
  * @property {string} [identifier]
500
618
  * @property {string} [key]
501
619
  * @property {string} [offset]
502
620
  * @property {string} [partition]
503
621
  * @property {string} [topic]
504
- * @property {string} [type]
505
622
  */
506
623
 
507
624
  /**
508
- * @typedef LogPushnotification
509
- * @property {string[]} [pushtokens]
625
+ * @typedef Log
626
+ * @property {LogEmail} [email]
627
+ * @property {LogPushnotification} [pushnotification]
628
+ * @property {LogMeta} [meta]
629
+ * @property {string} [_id]
630
+ * @property {string} [application]
631
+ * @property {string} [service]
632
+ * @property {string} [step]
633
+ * @property {string} [status]
634
+ * @property {Object} [data]
635
+ * @property {string} [expire_at]
636
+ * @property {string} [created_at]
510
637
  */
511
638
 
512
639
  /**
@@ -516,374 +643,258 @@ const Joi = require("joi");
516
643
  */
517
644
 
518
645
  /**
519
- * @typedef Message
520
- * @property {string} [info]
521
- * @property {string} [message]
522
- * @property {string} [operation]
523
- * @property {boolean} [success]
646
+ * @typedef SendOtpSmsCommsTemplate
647
+ * @property {string} [key]
648
+ * @property {Object} [value]
524
649
  */
525
650
 
526
651
  /**
527
- * @typedef metaObj
528
- * @property {boolean} [is_system]
529
- * @property {string} [template]
530
- * @property {string} [type]
652
+ * @typedef SendOtpSmsCommsProvider
653
+ * @property {string} [slug]
654
+ * @property {string} [_id]
531
655
  */
532
656
 
533
657
  /**
534
- * @typedef MetaStructure
535
- * @property {string} [action]
536
- * @property {string} [job_type]
537
- * @property {string} [timestamp]
538
- * @property {string} [trace]
658
+ * @typedef SendOtpEmailCommsProvider
659
+ * @property {string} [slug]
660
+ * @property {string} [_id]
539
661
  */
540
662
 
541
663
  /**
542
- * @typedef NotFound
543
- * @property {string} [message] - Failure message.
664
+ * @typedef SendOtpEmailCommsTemplate
665
+ * @property {string} [key]
666
+ * @property {Object} [value]
544
667
  */
545
668
 
546
669
  /**
547
- * @typedef Notification
548
- * @property {string} [body]
549
- * @property {string} [click_action]
550
- * @property {string} [deeplink]
551
- * @property {string} [icon]
552
- * @property {string} [subtitle]
553
- * @property {string} [title]
670
+ * @typedef SendOtpCommsReqData
671
+ * @property {boolean} [send_same_otp_to_channel]
672
+ * @property {string} [mobile]
673
+ * @property {string} [country_code]
674
+ * @property {string} [to]
554
675
  */
555
676
 
556
677
  /**
557
- * @typedef OtpConfiguration
558
- * @property {string} [application_id]
559
- * @property {string} [company_id]
560
- * @property {OtpConfigurationExpiry} expiry
561
- * @property {number} otp_length
562
- * @property {string} type
678
+ * @typedef SendOtpCommsReqSms
679
+ * @property {number} [otp_length]
680
+ * @property {number} [expiry]
681
+ * @property {SendOtpSmsCommsTemplate} [template]
682
+ * @property {SendOtpSmsCommsProvider} [provider]
563
683
  */
564
684
 
565
685
  /**
566
- * @typedef OtpConfigurationExpiry
567
- * @property {OtpConfigurationExpiryDuration} duration
568
- * @property {string} type
686
+ * @typedef SendOtpCommsReqEmail
687
+ * @property {number} [otp_length]
688
+ * @property {number} [expiry]
689
+ * @property {SendOtpEmailCommsTemplate} [template]
690
+ * @property {SendOtpEmailCommsProvider} [provider]
569
691
  */
570
692
 
571
693
  /**
572
- * @typedef OtpConfigurationExpiryDuration
573
- * @property {string} denomination
574
- * @property {number} time
694
+ * @typedef SendOtpCommsResSms
695
+ * @property {boolean} [success]
696
+ * @property {string} [request_id]
697
+ * @property {string} [message]
698
+ * @property {string} [mobile]
699
+ * @property {string} [country_code]
700
+ * @property {number} [resend_timer]
575
701
  */
576
702
 
577
703
  /**
578
- * @typedef Page
579
- * @property {number} [current]
580
- * @property {boolean} [has_next]
581
- * @property {boolean} [has_previous]
582
- * @property {number} [item_total]
583
- * @property {string} [next_id]
584
- * @property {number} [size]
585
- * @property {string} type
704
+ * @typedef SendOtpCommsResEmail
705
+ * @property {boolean} [success]
706
+ * @property {string} [request_id]
707
+ * @property {string} [message]
708
+ * @property {string} [to]
709
+ * @property {number} [resend_timer]
586
710
  */
587
711
 
588
712
  /**
589
- * @typedef PayloadEmailProviderStructure
590
- * @property {string} [_id]
713
+ * @typedef SendOtpCommsReq
714
+ * @property {SendOtpCommsReqData} [data]
715
+ * @property {SendOtpCommsReqSms} [sms]
716
+ * @property {SendOtpCommsReqEmail} [email]
591
717
  */
592
718
 
593
719
  /**
594
- * @typedef PayloadEmailStructure
595
- * @property {PayloadEmailProviderStructure} [provider]
596
- * @property {PayloadEmailTemplateStructure} [template]
720
+ * @typedef SendOtpCommsRes
721
+ * @property {SendOtpCommsResSms} [sms]
722
+ * @property {SendOtpCommsResEmail} [email]
597
723
  */
598
724
 
599
725
  /**
600
- * @typedef PayloadEmailTemplateStructure
601
- * @property {string} [key]
602
- * @property {Object} [value]
726
+ * @typedef VerifyOtpCommsReq
727
+ * @property {string} [request_id]
728
+ * @property {string} [otp]
603
729
  */
604
730
 
605
731
  /**
606
- * @typedef PayloadSmsProviderStructure
607
- * @property {string} [_id]
732
+ * @typedef VerifyOtpCommsSuccessRes
733
+ * @property {boolean} [success]
734
+ * @property {string} [mobile]
735
+ * @property {string} [country_code]
736
+ * @property {string} [message]
608
737
  */
609
738
 
610
739
  /**
611
- * @typedef PayloadSmsStructure
612
- * @property {PayloadSmsProviderStructure} [provider]
613
- * @property {PayloadSmsTemplateStructure} [template]
740
+ * @typedef VerifyOtpCommsErrorRes
741
+ * @property {boolean} [success]
742
+ * @property {string} [message]
614
743
  */
615
744
 
616
745
  /**
617
- * @typedef PayloadSmsTemplateStructure
618
- * @property {string} [key]
619
- * @property {Object} [value]
746
+ * @typedef SmsProviderReq
747
+ * @property {string} [name]
748
+ * @property {string} [description]
749
+ * @property {string} [sender]
750
+ * @property {string} [username]
751
+ * @property {string} [authkey]
752
+ * @property {string} [type]
753
+ * @property {string} [provider]
754
+ * @property {string} [password] - The password for the test.
755
+ * @property {string} [senderid] - The sender ID for the test.
756
+ * @property {string} [feedid] - The feed ID for the test.
757
+ * @property {string} [entityid] - The entity ID for the test.
758
+ * @property {boolean} [override_dnd] - Whether to override Do Not Disturb.
759
+ * @property {string} [host] - The host for the test.
760
+ * @property {number} [port] - The port for the test.
761
+ * @property {string} [entity_id] - The entity ID for the test.
762
+ * @property {string} [apikey] - The apikey for the test.
763
+ * @property {number} [version_id] - The version ID for the test.
764
+ * @property {string} [sender_id] - The sender ID for the test.
765
+ * @property {string} [api_key] - The api_key for the test.
620
766
  */
621
767
 
622
768
  /**
623
- * @typedef PayloadStructure
769
+ * @typedef SmsProvider
770
+ * @property {number} [rpt]
771
+ * @property {string} [type]
772
+ * @property {string} [provider]
773
+ * @property {string} [_id]
774
+ * @property {string} [name]
775
+ * @property {string} [description]
776
+ * @property {string} [sender]
777
+ * @property {string} [username]
778
+ * @property {string} [authkey]
624
779
  * @property {string} [application]
625
- * @property {Object[]} [data]
626
- * @property {PayloadEmailStructure} [email]
627
- * @property {PayloadSmsStructure} [sms]
628
- */
629
-
630
- /**
631
- * @typedef RecipientHeaders
632
- * @property {string} [email]
633
- */
634
-
635
- /**
636
- * @typedef SendOtpCommsReq
637
- * @property {SendOtpCommsReqData} [data]
638
- * @property {SendOtpCommsReqEmail} [email]
639
- * @property {SendOtpCommsReqSms} [sms]
640
- */
641
-
642
- /**
643
- * @typedef SendOtpCommsReqData
644
- * @property {string} [country_code]
645
- * @property {string} [mobile]
646
- * @property {boolean} [send_same_otp_to_channel]
647
- * @property {string} [to]
648
- */
649
-
650
- /**
651
- * @typedef SendOtpCommsReqEmail
652
- * @property {number} [expiry]
653
- * @property {number} [otp_length]
654
- * @property {SendOtpEmailCommsProvider} [provider]
655
- * @property {SendOtpEmailCommsTemplate} [template]
656
- */
657
-
658
- /**
659
- * @typedef SendOtpCommsReqSms
660
- * @property {number} [expiry]
661
- * @property {number} [otp_length]
662
- * @property {SendOtpSmsCommsProvider} [provider]
663
- * @property {SendOtpSmsCommsTemplate} [template]
664
- */
665
-
666
- /**
667
- * @typedef SendOtpCommsRes
668
- * @property {SendOtpCommsResEmail} [email]
669
- * @property {SendOtpCommsResSms} [sms]
670
- */
671
-
672
- /**
673
- * @typedef SendOtpCommsResEmail
674
- * @property {string} [message]
675
- * @property {string} [request_id]
676
- * @property {number} [resend_timer]
677
- * @property {boolean} [success]
678
- * @property {string} [to]
679
- */
680
-
681
- /**
682
- * @typedef SendOtpCommsResSms
683
- * @property {string} [country_code]
684
- * @property {string} [message]
685
- * @property {string} [mobile]
686
- * @property {string} [request_id]
687
- * @property {number} [resend_timer]
688
- * @property {boolean} [success]
689
- */
690
-
691
- /**
692
- * @typedef SendOtpEmailCommsProvider
693
- * @property {string} [_id]
694
- * @property {string} [slug]
695
- */
696
-
697
- /**
698
- * @typedef SendOtpEmailCommsTemplate
699
- * @property {string} [key]
700
- * @property {Object} [value]
701
- */
702
-
703
- /**
704
- * @typedef SendOtpSmsCommsProvider
705
- * @property {string} [_id]
780
+ * @property {string} [created_at]
781
+ * @property {string} [updated_at]
706
782
  * @property {string} [slug]
783
+ * @property {number} [__v]
707
784
  */
708
785
 
709
786
  /**
710
- * @typedef SendOtpSmsCommsTemplate
711
- * @property {string} [key]
712
- * @property {Object} [value]
787
+ * @typedef SmsProviders
788
+ * @property {SmsProvider[]} [items]
789
+ * @property {Page} [page]
713
790
  */
714
791
 
715
792
  /**
716
- * @typedef SmsProvider
717
- * @property {number} [__v]
793
+ * @typedef DefaultSmsProviders
718
794
  * @property {string} [_id]
719
- * @property {string} [application]
720
- * @property {string} [authkey]
721
- * @property {string} [created_at]
722
- * @property {string} [description]
723
795
  * @property {string} [name]
724
- * @property {string} [provider]
725
- * @property {number} [rpt]
726
- * @property {string} [sender]
727
- * @property {string} [slug]
728
- * @property {string} [type]
729
- * @property {string} [updated_at]
730
- * @property {string} [username]
796
+ * @property {boolean} [is_default]
731
797
  */
732
798
 
733
799
  /**
734
- * @typedef SmsProviderReq
735
- * @property {string} [api_key] - The api_key for the test.
736
- * @property {string} [apikey] - The apikey for the test.
737
- * @property {string} [authkey]
738
- * @property {string} [description]
739
- * @property {string} [entity_id] - The entity ID for the test.
740
- * @property {string} [entityid] - The entity ID for the test.
741
- * @property {string} [feedid] - The feed ID for the test.
742
- * @property {string} [host] - The host for the test.
743
- * @property {string} [name]
744
- * @property {boolean} [override_dnd] - Whether to override Do Not Disturb.
745
- * @property {string} [password] - The password for the test.
746
- * @property {number} [port] - The port for the test.
747
- * @property {string} [provider]
748
- * @property {string} [sender]
749
- * @property {string} [sender_id] - The sender ID for the test.
750
- * @property {string} [senderid] - The sender ID for the test.
751
- * @property {string} [type]
752
- * @property {string} [username]
753
- * @property {number} [version_id] - The version ID for the test.
800
+ * @typedef SmsTemplateMessage
801
+ * @property {string} [template_type]
802
+ * @property {string} [template]
754
803
  */
755
804
 
756
805
  /**
757
- * @typedef SmsProviders
758
- * @property {SmsProvider[]} [items]
806
+ * @typedef SmsTemplates
807
+ * @property {SmsTemplate[]} [items]
759
808
  * @property {Page} [page]
760
809
  */
761
810
 
762
811
  /**
763
812
  * @typedef SmsTemplate
764
- * @property {number} [__v]
813
+ * @property {EnabledObj} [url_shorten]
765
814
  * @property {string} [_id]
766
815
  * @property {string} [application]
767
- * @property {string} [category]
768
- * @property {string} [created_at]
769
- * @property {string} [description]
770
- * @property {boolean} [is_internal]
771
816
  * @property {boolean} [is_system]
772
- * @property {SmsTemplateMessage} [message]
817
+ * @property {boolean} [is_internal]
773
818
  * @property {metaObj} [meta]
774
819
  * @property {string} [name]
820
+ * @property {string} [description]
821
+ * @property {SmsTemplateMessage} [message]
775
822
  * @property {string} [priority]
823
+ * @property {string[]} [tags]
824
+ * @property {Object} [template_variables]
825
+ * @property {string} [template_id]
776
826
  * @property {boolean} [published]
827
+ * @property {string} [category]
828
+ * @property {string} [created_at]
829
+ * @property {string} [updated_at]
777
830
  * @property {string} [slug]
831
+ * @property {number} [__v]
832
+ */
833
+
834
+ /**
835
+ * @typedef SystemSmsTemplates
836
+ * @property {EnabledObj} [url_shorten]
837
+ * @property {string} [_id]
838
+ * @property {boolean} [is_system]
839
+ * @property {boolean} [is_internal]
840
+ * @property {string} [name]
841
+ * @property {string} [description]
842
+ * @property {SmsTemplateMessage} [message]
843
+ * @property {string} [priority]
778
844
  * @property {string[]} [tags]
779
- * @property {string} [template_id]
780
845
  * @property {Object} [template_variables]
846
+ * @property {string} [template_id]
847
+ * @property {boolean} [published]
848
+ * @property {string} [category]
849
+ * @property {string} [created_at]
781
850
  * @property {string} [updated_at]
782
- * @property {EnabledObj} [url_shorten]
851
+ * @property {string} [slug]
852
+ * @property {number} [__v]
783
853
  */
784
854
 
785
855
  /**
786
- * @typedef SmsTemplateMessage
856
+ * @typedef metaObj
857
+ * @property {string} [type]
858
+ * @property {boolean} [is_system]
787
859
  * @property {string} [template]
788
- * @property {string} [template_type]
789
860
  */
790
861
 
791
862
  /**
792
863
  * @typedef SmsTemplateReq
793
- * @property {string} [description]
794
- * @property {SmsTemplateMessage} [message]
795
- * @property {metaObj} [meta]
796
864
  * @property {string} name
865
+ * @property {string} [description]
797
866
  * @property {string} [priority]
798
- * @property {boolean} [published]
799
867
  * @property {string} [template_id]
868
+ * @property {metaObj} [meta]
800
869
  * @property {Object} [template_variables]
870
+ * @property {boolean} [published]
871
+ * @property {SmsTemplateMessage} [message]
801
872
  */
802
873
 
803
874
  /**
804
- * @typedef SmsTemplates
805
- * @property {SmsTemplate[]} [items]
806
- * @property {Page} [page]
807
- */
808
-
809
- /**
810
- * @typedef Stats
811
- * @property {string} [_id]
812
- * @property {Object} [imported]
813
- * @property {Object} [processed]
814
- */
815
-
816
- /**
817
- * @typedef StatsImported
818
- * @property {number} [count]
819
- */
820
-
821
- /**
822
- * @typedef StatsProcessed
823
- * @property {StatsProcessedEmail} [email]
824
- * @property {StatsProcessedSms} [sms]
825
- */
826
-
827
- /**
828
- * @typedef StatsProcessedEmail
829
- * @property {number} [failed]
830
- * @property {number} [success]
831
- * @property {number} [suppressed]
832
- */
833
-
834
- /**
835
- * @typedef StatsProcessedSms
836
- * @property {number} [failed]
837
- * @property {number} [success]
838
- * @property {number} [suppressed]
839
- */
840
-
841
- /**
842
- * @typedef SubscriptionsObject
843
- * @property {string} [_id] - Subscription ID
844
- * @property {TemplateObject} [template]
845
- */
846
-
847
- /**
848
- * @typedef SystemEmailTemplate
849
- * @property {number} [__v]
850
- * @property {string} [_id]
851
- * @property {number[]} [attachments]
852
- * @property {string} [category]
853
- * @property {string} [created_at]
854
- * @property {string} [description]
855
- * @property {EmailTemplateHeaders[]} [headers]
856
- * @property {TemplateAndType} [html]
857
- * @property {boolean} [is_internal]
858
- * @property {boolean} [is_system]
859
- * @property {string} [name]
860
- * @property {string} [priority]
861
- * @property {boolean} [published]
862
- * @property {string} [slug]
863
- * @property {string[]} [static_bcc]
864
- * @property {string[]} [static_cc]
865
- * @property {string[]} [static_to]
866
- * @property {TemplateAndType} [subject]
867
- * @property {string[]} [tags]
868
- * @property {Object} [template_variables]
869
- * @property {TemplateAndType} [text]
870
- * @property {string} [updated_at]
871
- * @property {EnabledObj} [url_shorten]
875
+ * @typedef Notification
876
+ * @property {string} [title]
877
+ * @property {string} [body]
878
+ * @property {string} [subtitle]
879
+ * @property {string} [icon]
880
+ * @property {string} [deeplink]
881
+ * @property {string} [click_action]
872
882
  */
873
883
 
874
884
  /**
875
- * @typedef SystemEmailTemplates
876
- * @property {SystemEmailTemplate[]} [items]
885
+ * @typedef SystemNotificationUser
886
+ * @property {string} [type]
887
+ * @property {string} [value]
877
888
  */
878
889
 
879
890
  /**
880
891
  * @typedef SystemNotification
881
- * @property {string} [_id]
882
- * @property {string} [created_at]
883
- * @property {string} [group]
884
892
  * @property {Notification} [notification]
885
- * @property {SystemNotificationUser} [settings]
886
893
  * @property {SystemNotificationUser} [user]
894
+ * @property {SystemNotificationUser} [settings]
895
+ * @property {string} [_id]
896
+ * @property {string} [group]
897
+ * @property {string} [created_at]
887
898
  */
888
899
 
889
900
  /**
@@ -894,1200 +905,1173 @@ const Joi = require("joi");
894
905
  */
895
906
 
896
907
  /**
897
- * @typedef SystemNotificationUser
898
- * @property {string} [type]
899
- * @property {string} [value]
900
- */
901
-
902
- /**
903
- * @typedef SystemSmsTemplates
904
- * @property {number} [__v]
905
- * @property {string} [_id]
906
- * @property {string} [category]
907
- * @property {string} [created_at]
908
- * @property {string} [description]
909
- * @property {boolean} [is_internal]
910
- * @property {boolean} [is_system]
911
- * @property {SmsTemplateMessage} [message]
912
- * @property {string} [name]
913
- * @property {string} [priority]
914
- * @property {boolean} [published]
915
- * @property {string} [slug]
916
- * @property {string[]} [tags]
917
- * @property {string} [template_id]
918
- * @property {Object} [template_variables]
919
- * @property {string} [updated_at]
920
- * @property {EnabledObj} [url_shorten]
908
+ * @typedef Page
909
+ * @property {number} [item_total]
910
+ * @property {string} [next_id]
911
+ * @property {boolean} [has_previous]
912
+ * @property {boolean} [has_next]
913
+ * @property {number} [current]
914
+ * @property {string} type
915
+ * @property {number} [size]
921
916
  */
922
917
 
923
918
  /**
924
- * @typedef TemplateAndType
925
- * @property {string} [template]
926
- * @property {string} [template_type]
919
+ * @typedef GenericError
920
+ * @property {Message} [message]
921
+ * @property {string} [sentry]
927
922
  */
928
923
 
929
924
  /**
930
- * @typedef TemplateObject
931
- * @property {CommunicationTemplate} [email]
932
- * @property {CommunicationTemplate} [pushnotification]
933
- * @property {CommunicationTemplate} [sms]
925
+ * @typedef GenericDelete
926
+ * @property {string} [message]
927
+ * @property {boolean} [acknowledged]
928
+ * @property {number} [affected]
929
+ * @property {string} [operation]
934
930
  */
935
931
 
936
932
  /**
937
- * @typedef TriggerJobRequest
938
- * @property {string} [job_id]
933
+ * @typedef Message
934
+ * @property {string} [message]
935
+ * @property {boolean} [success]
936
+ * @property {string} [info]
937
+ * @property {string} [operation]
939
938
  */
940
939
 
941
940
  /**
942
- * @typedef TriggerJobResponse
943
- * @property {number} [status]
941
+ * @typedef EnabledObj
942
+ * @property {boolean} [enabled]
944
943
  */
945
944
 
946
945
  /**
947
- * @typedef VerifyOtpCommsErrorRes
948
- * @property {string} [message]
949
- * @property {boolean} [success]
946
+ * @typedef OtpConfigurationExpiryDuration
947
+ * @property {number} time
948
+ * @property {string} denomination
950
949
  */
951
950
 
952
951
  /**
953
- * @typedef VerifyOtpCommsReq
954
- * @property {string} [otp]
955
- * @property {string} [request_id]
952
+ * @typedef OtpConfigurationExpiry
953
+ * @property {OtpConfigurationExpiryDuration} duration
954
+ * @property {string} type
956
955
  */
957
956
 
958
957
  /**
959
- * @typedef VerifyOtpCommsSuccessRes
960
- * @property {string} [country_code]
961
- * @property {string} [message]
962
- * @property {string} [mobile]
963
- * @property {boolean} [success]
958
+ * @typedef OtpConfiguration
959
+ * @property {number} otp_length
960
+ * @property {string} type
961
+ * @property {OtpConfigurationExpiry} expiry
962
+ * @property {string} [application_id]
963
+ * @property {string} [company_id]
964
964
  */
965
965
 
966
966
  class CommunicationPlatformModel {
967
- /** @returns {AppProvider} */
968
- static AppProvider() {
967
+ /** @returns {EventSubscriptionsBulkUpdateRequest} */
968
+ static EventSubscriptionsBulkUpdateRequest() {
969
969
  return Joi.object({
970
- __v: Joi.number(),
971
- _id: Joi.string().allow(""),
972
- application: Joi.string().allow(""),
973
- created_at: Joi.string().allow(""),
974
- email: CommunicationPlatformModel.AppProviderRes(),
975
- sms: CommunicationPlatformModel.AppProviderRes(),
976
- updated_at: Joi.string().allow(""),
977
- voice: CommunicationPlatformModel.AppProviderResVoice(),
970
+ subscriptions: Joi.array().items(
971
+ CommunicationPlatformModel.SubscriptionsObject()
972
+ ),
978
973
  });
979
974
  }
980
975
 
981
- /** @returns {AppProviderReq} */
982
- static AppProviderReq() {
976
+ /** @returns {EventSubscriptionsBulkUpdateResponse} */
977
+ static EventSubscriptionsBulkUpdateResponse() {
983
978
  return Joi.object({
984
- email: CommunicationPlatformModel.AppProviderRes(),
985
- sms: CommunicationPlatformModel.AppProviderRes(),
986
- voice: CommunicationPlatformModel.AppProviderResVoice(),
979
+ template: CommunicationPlatformModel.EventSubscriptionTemplate(),
980
+ _id: Joi.string().allow(""),
981
+ application: Joi.string().allow(""),
982
+ event: Joi.string().allow(""),
983
+ slug: Joi.string().allow(""),
984
+ category: Joi.string().allow(""),
985
+ created_at: Joi.string().allow(""),
986
+ updated_at: Joi.string().allow(""),
987
+ __v: Joi.number(),
987
988
  });
988
989
  }
989
990
 
990
- /** @returns {AppProviderRes} */
991
- static AppProviderRes() {
991
+ /** @returns {SubscriptionsObject} */
992
+ static SubscriptionsObject() {
992
993
  return Joi.object({
993
- otp: CommunicationPlatformModel.AppProviderResObj(),
994
- promotional: CommunicationPlatformModel.AppProviderResObj(),
995
- transaction: CommunicationPlatformModel.AppProviderResObj(),
994
+ _id: Joi.string().allow(""),
995
+ template: CommunicationPlatformModel.TemplateObject(),
996
996
  });
997
997
  }
998
998
 
999
- /** @returns {AppProviderResObj} */
1000
- static AppProviderResObj() {
999
+ /** @returns {TemplateObject} */
1000
+ static TemplateObject() {
1001
1001
  return Joi.object({
1002
- provider: Joi.string().allow(""),
1002
+ sms: CommunicationPlatformModel.CommunicationTemplate(),
1003
+ email: CommunicationPlatformModel.CommunicationTemplate(),
1004
+ pushnotification: CommunicationPlatformModel.CommunicationTemplate(),
1003
1005
  });
1004
1006
  }
1005
1007
 
1006
- /** @returns {AppProviderResVoice} */
1007
- static AppProviderResVoice() {
1008
+ /** @returns {CommunicationTemplate} */
1009
+ static CommunicationTemplate() {
1008
1010
  return Joi.object({
1009
- otp: CommunicationPlatformModel.AppProviderResObj(),
1010
- transaction: CommunicationPlatformModel.AppProviderResObj(),
1011
+ subscribed: Joi.boolean(),
1012
+ template: Joi.string().allow(""),
1011
1013
  });
1012
1014
  }
1013
1015
 
1014
- /** @returns {Audience} */
1015
- static Audience() {
1016
+ /** @returns {AppProvider} */
1017
+ static AppProvider() {
1016
1018
  return Joi.object({
1017
- __v: Joi.number(),
1019
+ email: CommunicationPlatformModel.AppProviderRes(),
1020
+ sms: CommunicationPlatformModel.AppProviderRes(),
1021
+ voice: CommunicationPlatformModel.AppProviderResVoice(),
1018
1022
  _id: Joi.string().allow(""),
1019
1023
  application: Joi.string().allow(""),
1020
1024
  created_at: Joi.string().allow(""),
1021
- description: Joi.string().allow(""),
1022
- file_url: Joi.string().allow(""),
1023
- headers: Joi.array().items(Joi.string().allow("")),
1024
- is_active: Joi.boolean(),
1025
- name: Joi.string().allow(""),
1026
- records_count: Joi.number(),
1027
- slug: Joi.string().allow(""),
1028
- tags: Joi.array().items(Joi.string().allow("")),
1029
- type: Joi.string().allow(""),
1030
1025
  updated_at: Joi.string().allow(""),
1026
+ __v: Joi.number(),
1031
1027
  });
1032
1028
  }
1033
1029
 
1034
- /** @returns {AudienceReq} */
1035
- static AudienceReq() {
1030
+ /** @returns {AppProviderRes} */
1031
+ static AppProviderRes() {
1036
1032
  return Joi.object({
1037
- description: Joi.string().allow(""),
1038
- file_url: Joi.string().allow(""),
1039
- headers: Joi.array().items(Joi.string().allow("")),
1040
- name: Joi.string().allow(""),
1041
- records_count: Joi.number(),
1042
- tags: Joi.array().items(Joi.string().allow("")),
1043
- type: Joi.string().allow(""),
1033
+ transaction: CommunicationPlatformModel.AppProviderResObj(),
1034
+ promotional: CommunicationPlatformModel.AppProviderResObj(),
1035
+ otp: CommunicationPlatformModel.AppProviderResObj(),
1044
1036
  });
1045
1037
  }
1046
1038
 
1047
- /** @returns {Audiences} */
1048
- static Audiences() {
1039
+ /** @returns {AppProviderResVoice} */
1040
+ static AppProviderResVoice() {
1049
1041
  return Joi.object({
1050
- items: Joi.array().items(CommunicationPlatformModel.Audience()),
1051
- page: CommunicationPlatformModel.Page(),
1042
+ transaction: CommunicationPlatformModel.AppProviderResObj(),
1043
+ otp: CommunicationPlatformModel.AppProviderResObj(),
1052
1044
  });
1053
1045
  }
1054
1046
 
1055
- /** @returns {BadRequestSchema} */
1056
- static BadRequestSchema() {
1047
+ /** @returns {AppProviderResObj} */
1048
+ static AppProviderResObj() {
1057
1049
  return Joi.object({
1058
- message: Joi.string().allow(""),
1059
- status: Joi.string().allow(""),
1050
+ provider: Joi.string().allow(""),
1060
1051
  });
1061
1052
  }
1062
1053
 
1063
- /** @returns {Campaign} */
1064
- static Campaign() {
1054
+ /** @returns {GlobalProviders} */
1055
+ static GlobalProviders() {
1056
+ return Joi.object({
1057
+ email: Joi.array().items(
1058
+ CommunicationPlatformModel.GlobalProvidersResObj()
1059
+ ),
1060
+ sms: Joi.array().items(
1061
+ CommunicationPlatformModel.GlobalProvidersResObj()
1062
+ ),
1063
+ voice: Joi.array().items(
1064
+ CommunicationPlatformModel.GlobalProvidersResObj()
1065
+ ),
1066
+ });
1067
+ }
1068
+
1069
+ /** @returns {GlobalProvidersResObj} */
1070
+ static GlobalProvidersResObj() {
1065
1071
  return Joi.object({
1066
- __v: Joi.number(),
1067
1072
  _id: Joi.string().allow(""),
1068
- application: Joi.string().allow(""),
1069
- created_at: Joi.string().allow(""),
1070
- datasource: Joi.string().allow(""),
1071
- description: Joi.string().allow(""),
1072
- email: CommunicationPlatformModel.CampaignEmail(),
1073
- is_active: Joi.boolean(),
1074
1073
  name: Joi.string().allow(""),
1075
- recipient_headers: CommunicationPlatformModel.RecipientHeaders(),
1076
- slug: Joi.string().allow(""),
1077
- tags: Joi.array().items(Joi.any()),
1078
- type: Joi.string().allow(""),
1079
- updated_at: Joi.string().allow(""),
1080
1074
  });
1081
1075
  }
1082
1076
 
1083
- /** @returns {CampaignEmail} */
1084
- static CampaignEmail() {
1077
+ /** @returns {AppProviderReq} */
1078
+ static AppProviderReq() {
1085
1079
  return Joi.object({
1086
- provider: CommunicationPlatformModel.CampignEmailProvider(),
1087
- template: CommunicationPlatformModel.CampaignEmailTemplate(),
1080
+ email: CommunicationPlatformModel.AppProviderRes(),
1081
+ sms: CommunicationPlatformModel.AppProviderRes(),
1082
+ voice: CommunicationPlatformModel.AppProviderResVoice(),
1088
1083
  });
1089
1084
  }
1090
1085
 
1091
- /** @returns {CampaignEmailTemplate} */
1092
- static CampaignEmailTemplate() {
1086
+ /** @returns {StatsImported} */
1087
+ static StatsImported() {
1093
1088
  return Joi.object({
1094
- key: Joi.string().allow(""),
1095
- value: Joi.string().allow(""),
1089
+ count: Joi.number(),
1096
1090
  });
1097
1091
  }
1098
1092
 
1099
- /** @returns {CampaignReq} */
1100
- static CampaignReq() {
1093
+ /** @returns {StatsProcessedEmail} */
1094
+ static StatsProcessedEmail() {
1101
1095
  return Joi.object({
1102
- application: Joi.string().allow(""),
1103
- description: Joi.string().allow(""),
1104
- file_url: Joi.string().allow(""),
1105
- headers: Joi.array().items(Joi.string().allow("")),
1106
- is_active: Joi.boolean(),
1107
- name: Joi.string().allow(""),
1108
- records_count: Joi.number(),
1109
- tags: Joi.array().items(Joi.string().allow("")),
1110
- type: Joi.string().allow(""),
1096
+ success: Joi.number(),
1097
+ failed: Joi.number(),
1098
+ suppressed: Joi.number(),
1111
1099
  });
1112
1100
  }
1113
1101
 
1114
- /** @returns {Campaigns} */
1115
- static Campaigns() {
1102
+ /** @returns {StatsProcessedSms} */
1103
+ static StatsProcessedSms() {
1116
1104
  return Joi.object({
1117
- items: Joi.array().items(CommunicationPlatformModel.Campaign()),
1118
- page: CommunicationPlatformModel.Page(),
1105
+ success: Joi.number(),
1106
+ failed: Joi.number(),
1107
+ suppressed: Joi.number(),
1119
1108
  });
1120
1109
  }
1121
1110
 
1122
- /** @returns {CampignEmailProvider} */
1123
- static CampignEmailProvider() {
1111
+ /** @returns {StatsProcessed} */
1112
+ static StatsProcessed() {
1124
1113
  return Joi.object({
1125
- _id: Joi.string().allow(""),
1126
- from_email: Joi.string().allow(""),
1127
- from_name: Joi.string().allow(""),
1114
+ email: CommunicationPlatformModel.StatsProcessedEmail(),
1115
+ sms: CommunicationPlatformModel.StatsProcessedSms(),
1128
1116
  });
1129
1117
  }
1130
1118
 
1131
- /** @returns {CommunicationTemplate} */
1132
- static CommunicationTemplate() {
1119
+ /** @returns {Stats} */
1120
+ static Stats() {
1133
1121
  return Joi.object({
1134
- subscribed: Joi.boolean(),
1135
- template: Joi.string().allow(""),
1122
+ _id: Joi.string().allow(""),
1123
+ imported: Joi.any(),
1124
+ processed: Joi.any(),
1136
1125
  });
1137
1126
  }
1138
1127
 
1139
- /** @returns {CreateJobsReq} */
1140
- static CreateJobsReq() {
1128
+ /** @returns {GetStats} */
1129
+ static GetStats() {
1141
1130
  return Joi.object({
1142
- campaign: Joi.string().allow(""),
1131
+ items: Joi.array().items(CommunicationPlatformModel.Stats()),
1143
1132
  });
1144
1133
  }
1145
1134
 
1146
- /** @returns {CreateJobsRes} */
1147
- static CreateJobsRes() {
1135
+ /** @returns {CampaignReq} */
1136
+ static CampaignReq() {
1148
1137
  return Joi.object({
1149
- __v: Joi.number(),
1150
- _id: Joi.string().allow(""),
1151
- application: Joi.string().allow(""),
1152
- campaign: Joi.string().allow(""),
1153
- completed: Joi.boolean(),
1154
- created_at: Joi.string().allow(""),
1138
+ description: Joi.string().allow(""),
1139
+ tags: Joi.array().items(Joi.string().allow("")),
1140
+ headers: Joi.array().items(Joi.string().allow("")),
1155
1141
  is_active: Joi.boolean(),
1156
- updated_at: Joi.string().allow(""),
1142
+ name: Joi.string().allow(""),
1143
+ file_url: Joi.string().allow(""),
1144
+ type: Joi.string().allow(""),
1145
+ records_count: Joi.number(),
1146
+ application: Joi.string().allow(""),
1157
1147
  });
1158
1148
  }
1159
1149
 
1160
- /** @returns {DefaultSmsProviders} */
1161
- static DefaultSmsProviders() {
1150
+ /** @returns {RecipientHeaders} */
1151
+ static RecipientHeaders() {
1162
1152
  return Joi.object({
1163
- _id: Joi.string().allow(""),
1164
- is_default: Joi.boolean(),
1165
- name: Joi.string().allow(""),
1153
+ email: Joi.string().allow(""),
1166
1154
  });
1167
1155
  }
1168
1156
 
1169
- /** @returns {DummyDatasources} */
1170
- static DummyDatasources() {
1157
+ /** @returns {CampaignEmailTemplate} */
1158
+ static CampaignEmailTemplate() {
1171
1159
  return Joi.object({
1172
- id: Joi.number(),
1173
- name: Joi.string().allow(""),
1160
+ key: Joi.string().allow(""),
1161
+ value: Joi.string().allow(""),
1174
1162
  });
1175
1163
  }
1176
1164
 
1177
- /** @returns {DummyDatasourcesMeta} */
1178
- static DummyDatasourcesMeta() {
1165
+ /** @returns {CampignEmailProvider} */
1166
+ static CampignEmailProvider() {
1179
1167
  return Joi.object({
1180
- data: CommunicationPlatformModel.DummyDatasourcesMetaObj(),
1181
- id: Joi.number(),
1168
+ _id: Joi.string().allow(""),
1169
+ from_name: Joi.string().allow(""),
1170
+ from_email: Joi.string().allow(""),
1182
1171
  });
1183
1172
  }
1184
1173
 
1185
- /** @returns {DummyDatasourcesMetaObj} */
1186
- static DummyDatasourcesMetaObj() {
1174
+ /** @returns {CampaignEmail} */
1175
+ static CampaignEmail() {
1187
1176
  return Joi.object({
1188
- b: Joi.number(),
1177
+ template: CommunicationPlatformModel.CampaignEmailTemplate(),
1178
+ provider: CommunicationPlatformModel.CampignEmailProvider(),
1189
1179
  });
1190
1180
  }
1191
1181
 
1192
- /** @returns {EmailProvider} */
1193
- static EmailProvider() {
1182
+ /** @returns {Campaign} */
1183
+ static Campaign() {
1194
1184
  return Joi.object({
1195
- __v: Joi.number(),
1185
+ recipient_headers: CommunicationPlatformModel.RecipientHeaders(),
1186
+ email: CommunicationPlatformModel.CampaignEmail(),
1187
+ description: Joi.string().allow(""),
1188
+ tags: Joi.array().items(Joi.any()),
1189
+ is_active: Joi.boolean(),
1196
1190
  _id: Joi.string().allow(""),
1197
- api_key: Joi.string().allow(""),
1191
+ datasource: Joi.string().allow(""),
1192
+ type: Joi.string().allow(""),
1193
+ name: Joi.string().allow(""),
1198
1194
  application: Joi.string().allow(""),
1199
1195
  created_at: Joi.string().allow(""),
1200
- description: Joi.string().allow(""),
1201
- from_address: Joi.array().items(
1202
- CommunicationPlatformModel.EmailProviderReqFrom()
1203
- ),
1204
- name: Joi.string().allow(""),
1205
- provider: Joi.string().allow(""),
1206
- slug: Joi.string().allow(""),
1207
- type: Joi.string().allow(""),
1208
1196
  updated_at: Joi.string().allow(""),
1197
+ slug: Joi.string().allow(""),
1198
+ __v: Joi.number(),
1209
1199
  });
1210
1200
  }
1211
1201
 
1212
- /** @returns {EmailProviderReq} */
1213
- static EmailProviderReq() {
1202
+ /** @returns {Campaigns} */
1203
+ static Campaigns() {
1214
1204
  return Joi.object({
1215
- api_key: Joi.string().allow(""),
1216
- description: Joi.string().allow(""),
1217
- from_address: Joi.array().items(
1218
- CommunicationPlatformModel.EmailProviderReqFrom()
1219
- ),
1220
- name: Joi.string().allow(""),
1221
- provider: Joi.string().allow(""),
1222
- type: Joi.string().allow(""),
1205
+ items: Joi.array().items(CommunicationPlatformModel.Campaign()),
1206
+ page: CommunicationPlatformModel.Page(),
1223
1207
  });
1224
1208
  }
1225
1209
 
1226
- /** @returns {EmailProviderReqFrom} */
1227
- static EmailProviderReqFrom() {
1210
+ /** @returns {BadRequestSchema} */
1211
+ static BadRequestSchema() {
1228
1212
  return Joi.object({
1229
- email: Joi.string().allow(""),
1230
- is_default: Joi.boolean(),
1231
- name: Joi.string().allow(""),
1213
+ status: Joi.string().allow(""),
1214
+ message: Joi.string().allow(""),
1232
1215
  });
1233
1216
  }
1234
1217
 
1235
- /** @returns {EmailProviders} */
1236
- static EmailProviders() {
1218
+ /** @returns {NotFound} */
1219
+ static NotFound() {
1237
1220
  return Joi.object({
1238
- items: Joi.array().items(CommunicationPlatformModel.EmailProvider()),
1239
- page: CommunicationPlatformModel.Page(),
1221
+ message: Joi.string().allow(""),
1240
1222
  });
1241
1223
  }
1242
1224
 
1243
- /** @returns {EmailTemplate} */
1244
- static EmailTemplate() {
1225
+ /** @returns {AudienceReq} */
1226
+ static AudienceReq() {
1245
1227
  return Joi.object({
1246
- __v: Joi.number(),
1247
- _id: Joi.string().allow(""),
1248
- application: Joi.string().allow(""),
1249
- attachments: Joi.array().items(Joi.number()),
1250
- category: Joi.string().allow(""),
1251
- created_at: Joi.string().allow(""),
1252
- description: Joi.string().allow(""),
1253
- editor_meta: Joi.string().allow(""),
1254
- editor_type: Joi.string().allow(""),
1255
- from_name: Joi.string().allow(""),
1256
- headers: Joi.array().items(
1257
- CommunicationPlatformModel.EmailTemplateHeaders()
1258
- ),
1259
- html: CommunicationPlatformModel.TemplateAndType(),
1260
- is_internal: Joi.boolean(),
1261
- is_system: Joi.boolean(),
1262
1228
  name: Joi.string().allow(""),
1263
- priority: Joi.string().allow(""),
1264
- published: Joi.boolean(),
1265
- reply_to: Joi.string().allow(""),
1266
- slug: Joi.string().allow(""),
1267
- static_bcc: Joi.array().items(Joi.string().allow("")),
1268
- static_cc: Joi.array().items(Joi.string().allow("")),
1269
- static_to: Joi.array().items(Joi.string().allow("")),
1270
- subject: CommunicationPlatformModel.TemplateAndType(),
1229
+ description: Joi.string().allow(""),
1271
1230
  tags: Joi.array().items(Joi.string().allow("")),
1272
- template_variables: Joi.any(),
1273
- text: CommunicationPlatformModel.TemplateAndType(),
1274
- updated_at: Joi.string().allow(""),
1275
- url_shorten: CommunicationPlatformModel.EnabledObj(),
1231
+ file_url: Joi.string().allow(""),
1232
+ type: Joi.string().allow(""),
1233
+ records_count: Joi.number(),
1234
+ headers: Joi.array().items(Joi.string().allow("")),
1276
1235
  });
1277
1236
  }
1278
1237
 
1279
- /** @returns {EmailTemplateHeaders} */
1280
- static EmailTemplateHeaders() {
1238
+ /** @returns {Audience} */
1239
+ static Audience() {
1281
1240
  return Joi.object({
1282
- key: Joi.string().allow(""),
1283
- value: Joi.string().allow(""),
1241
+ _id: Joi.string().allow(""),
1242
+ application: Joi.string().allow(""),
1243
+ name: Joi.string().allow(""),
1244
+ description: Joi.string().allow(""),
1245
+ records_count: Joi.number(),
1246
+ type: Joi.string().allow(""),
1247
+ tags: Joi.array().items(Joi.string().allow("")),
1248
+ headers: Joi.array().items(Joi.string().allow("")),
1249
+ file_url: Joi.string().allow(""),
1250
+ is_active: Joi.boolean(),
1251
+ created_at: Joi.string().allow(""),
1252
+ updated_at: Joi.string().allow(""),
1253
+ slug: Joi.string().allow(""),
1254
+ __v: Joi.number(),
1284
1255
  });
1285
1256
  }
1286
1257
 
1287
- /** @returns {EmailTemplateKeys} */
1288
- static EmailTemplateKeys() {
1258
+ /** @returns {Audiences} */
1259
+ static Audiences() {
1289
1260
  return Joi.object({
1290
- bcc: Joi.string().allow(""),
1291
- cc: Joi.string().allow(""),
1292
- to: Joi.string().allow(""),
1261
+ items: Joi.array().items(CommunicationPlatformModel.Audience()),
1262
+ page: CommunicationPlatformModel.Page(),
1293
1263
  });
1294
1264
  }
1295
1265
 
1296
- /** @returns {EmailTemplateReq} */
1297
- static EmailTemplateReq() {
1266
+ /** @returns {GetNRecordsCsvReq} */
1267
+ static GetNRecordsCsvReq() {
1298
1268
  return Joi.object({
1299
- attachments: Joi.array().items(Joi.number()),
1300
- description: Joi.string().allow(""),
1301
- editor_meta: Joi.string().allow(""),
1302
- editor_type: Joi.string().allow(""),
1303
- from_name: Joi.string().allow(""),
1304
- headers: Joi.array().items(
1305
- CommunicationPlatformModel.EmailTemplateHeaders()
1306
- ),
1307
- html: CommunicationPlatformModel.TemplateAndType(),
1308
- keys: CommunicationPlatformModel.EmailTemplateKeys(),
1309
- name: Joi.string().allow("").required(),
1310
- priority: Joi.string().allow(""),
1311
- published: Joi.boolean(),
1312
- reply_to: Joi.string().allow(""),
1313
- static_bcc: Joi.array().items(Joi.string().allow("")),
1314
- static_cc: Joi.array().items(Joi.string().allow("")),
1315
- static_to: Joi.array().items(Joi.string().allow("")),
1316
- subject: CommunicationPlatformModel.TemplateAndType(),
1317
- tags: Joi.array().items(Joi.string().allow("")),
1318
- template_variables: Joi.any(),
1319
- text: CommunicationPlatformModel.TemplateAndType(),
1269
+ url: Joi.string().allow(""),
1270
+ header: Joi.boolean(),
1271
+ count: Joi.number(),
1320
1272
  });
1321
1273
  }
1322
1274
 
1323
- /** @returns {EmailTemplates} */
1324
- static EmailTemplates() {
1275
+ /** @returns {GetNRecordsCsvResItems} */
1276
+ static GetNRecordsCsvResItems() {
1325
1277
  return Joi.object({
1326
- items: Joi.array().items(CommunicationPlatformModel.EmailTemplate()),
1327
- page: CommunicationPlatformModel.Page(),
1278
+ phone_number: Joi.string().allow(""),
1279
+ email: Joi.string().allow(""),
1280
+ firstname: Joi.string().allow(""),
1281
+ lastname: Joi.string().allow(""),
1282
+ orderid: Joi.string().allow(""),
1328
1283
  });
1329
1284
  }
1330
1285
 
1331
- /** @returns {EnabledObj} */
1332
- static EnabledObj() {
1286
+ /** @returns {GetNRecordsCsvRes} */
1287
+ static GetNRecordsCsvRes() {
1333
1288
  return Joi.object({
1334
- enabled: Joi.boolean(),
1289
+ items: Joi.array().items(
1290
+ CommunicationPlatformModel.GetNRecordsCsvResItems()
1291
+ ),
1335
1292
  });
1336
1293
  }
1337
1294
 
1338
- /** @returns {EngineRequest} */
1339
- static EngineRequest() {
1295
+ /** @returns {DummyDatasources} */
1296
+ static DummyDatasources() {
1340
1297
  return Joi.object({
1341
- meta: CommunicationPlatformModel.MetaStructure(),
1342
- payload: CommunicationPlatformModel.PayloadStructure(),
1298
+ id: Joi.number(),
1299
+ name: Joi.string().allow(""),
1343
1300
  });
1344
1301
  }
1345
1302
 
1346
- /** @returns {EngineResponse} */
1347
- static EngineResponse() {
1303
+ /** @returns {DummyDatasourcesMeta} */
1304
+ static DummyDatasourcesMeta() {
1348
1305
  return Joi.object({
1349
- success: Joi.boolean(),
1306
+ id: Joi.number(),
1307
+ data: CommunicationPlatformModel.DummyDatasourcesMetaObj(),
1350
1308
  });
1351
1309
  }
1352
1310
 
1353
- /** @returns {EventSubscription} */
1354
- static EventSubscription() {
1311
+ /** @returns {DummyDatasourcesMetaObj} */
1312
+ static DummyDatasourcesMetaObj() {
1355
1313
  return Joi.object({
1356
- __v: Joi.number(),
1357
- _id: Joi.string().allow(""),
1358
- application: Joi.string().allow(""),
1359
- created_at: Joi.string().allow(""),
1360
- event: Joi.string().allow(""),
1361
- is_default: Joi.boolean(),
1362
- slug: Joi.string().allow(""),
1363
- template: CommunicationPlatformModel.EventSubscriptionTemplate(),
1364
- updated_at: Joi.string().allow(""),
1314
+ b: Joi.number(),
1365
1315
  });
1366
1316
  }
1367
1317
 
1368
- /** @returns {EventSubscriptions} */
1369
- static EventSubscriptions() {
1318
+ /** @returns {EmailProviderReqFrom} */
1319
+ static EmailProviderReqFrom() {
1370
1320
  return Joi.object({
1371
- items: Joi.array().items(CommunicationPlatformModel.EventSubscription()),
1372
- page: CommunicationPlatformModel.Page(),
1321
+ name: Joi.string().allow(""),
1322
+ email: Joi.string().allow(""),
1323
+ is_default: Joi.boolean(),
1373
1324
  });
1374
1325
  }
1375
1326
 
1376
- /** @returns {EventSubscriptionsBulkUpdateRequest} */
1377
- static EventSubscriptionsBulkUpdateRequest() {
1327
+ /** @returns {EmailProviderReq} */
1328
+ static EmailProviderReq() {
1378
1329
  return Joi.object({
1379
- subscriptions: Joi.array().items(
1380
- CommunicationPlatformModel.SubscriptionsObject()
1330
+ name: Joi.string().allow(""),
1331
+ description: Joi.string().allow(""),
1332
+ api_key: Joi.string().allow(""),
1333
+ type: Joi.string().allow(""),
1334
+ provider: Joi.string().allow(""),
1335
+ from_address: Joi.array().items(
1336
+ CommunicationPlatformModel.EmailProviderReqFrom()
1381
1337
  ),
1382
1338
  });
1383
1339
  }
1384
1340
 
1385
- /** @returns {EventSubscriptionsBulkUpdateResponse} */
1386
- static EventSubscriptionsBulkUpdateResponse() {
1341
+ /** @returns {EmailProvider} */
1342
+ static EmailProvider() {
1387
1343
  return Joi.object({
1388
- __v: Joi.number(),
1344
+ type: Joi.string().allow(""),
1345
+ provider: Joi.string().allow(""),
1346
+ from_address: Joi.array().items(
1347
+ CommunicationPlatformModel.EmailProviderReqFrom()
1348
+ ),
1389
1349
  _id: Joi.string().allow(""),
1350
+ name: Joi.string().allow(""),
1351
+ description: Joi.string().allow(""),
1352
+ api_key: Joi.string().allow(""),
1390
1353
  application: Joi.string().allow(""),
1391
- category: Joi.string().allow(""),
1392
1354
  created_at: Joi.string().allow(""),
1393
- event: Joi.string().allow(""),
1394
- slug: Joi.string().allow(""),
1395
- template: CommunicationPlatformModel.EventSubscriptionTemplate(),
1396
1355
  updated_at: Joi.string().allow(""),
1356
+ slug: Joi.string().allow(""),
1357
+ __v: Joi.number(),
1397
1358
  });
1398
1359
  }
1399
1360
 
1400
- /** @returns {EventSubscriptionTemplate} */
1401
- static EventSubscriptionTemplate() {
1361
+ /** @returns {EmailProviders} */
1362
+ static EmailProviders() {
1402
1363
  return Joi.object({
1403
- email: CommunicationPlatformModel.EventSubscriptionTemplateEmail(),
1404
- sms: CommunicationPlatformModel.EventSubscriptionTemplateSms(),
1364
+ items: Joi.array().items(CommunicationPlatformModel.EmailProvider()),
1365
+ page: CommunicationPlatformModel.Page(),
1405
1366
  });
1406
1367
  }
1407
1368
 
1408
- /** @returns {EventSubscriptionTemplateEmail} */
1409
- static EventSubscriptionTemplateEmail() {
1369
+ /** @returns {EmailTemplateKeys} */
1370
+ static EmailTemplateKeys() {
1410
1371
  return Joi.object({
1411
- subscribed: Joi.boolean(),
1412
- template: Joi.string().allow(""),
1372
+ to: Joi.string().allow(""),
1373
+ cc: Joi.string().allow(""),
1374
+ bcc: Joi.string().allow(""),
1413
1375
  });
1414
1376
  }
1415
1377
 
1416
- /** @returns {EventSubscriptionTemplateSms} */
1417
- static EventSubscriptionTemplateSms() {
1378
+ /** @returns {EmailTemplateHeaders} */
1379
+ static EmailTemplateHeaders() {
1418
1380
  return Joi.object({
1419
- subscribed: Joi.boolean(),
1420
- template: Joi.string().allow(""),
1381
+ key: Joi.string().allow(""),
1382
+ value: Joi.string().allow(""),
1421
1383
  });
1422
1384
  }
1423
1385
 
1424
- /** @returns {GenericDelete} */
1425
- static GenericDelete() {
1386
+ /** @returns {EmailTemplateReq} */
1387
+ static EmailTemplateReq() {
1426
1388
  return Joi.object({
1427
- acknowledged: Joi.boolean(),
1428
- affected: Joi.number(),
1429
- message: Joi.string().allow(""),
1430
- operation: Joi.string().allow(""),
1389
+ name: Joi.string().allow("").required(),
1390
+ description: Joi.string().allow(""),
1391
+ from_name: Joi.string().allow(""),
1392
+ static_to: Joi.array().items(Joi.string().allow("")),
1393
+ static_cc: Joi.array().items(Joi.string().allow("")),
1394
+ static_bcc: Joi.array().items(Joi.string().allow("")),
1395
+ reply_to: Joi.string().allow(""),
1396
+ priority: Joi.string().allow(""),
1397
+ tags: Joi.array().items(Joi.string().allow("")),
1398
+ template_variables: Joi.any(),
1399
+ published: Joi.boolean(),
1400
+ subject: CommunicationPlatformModel.TemplateAndType(),
1401
+ html: CommunicationPlatformModel.TemplateAndType(),
1402
+ editor_type: Joi.string().allow(""),
1403
+ editor_meta: Joi.string().allow(""),
1404
+ attachments: Joi.array().items(Joi.number()),
1405
+ headers: Joi.array().items(
1406
+ CommunicationPlatformModel.EmailTemplateHeaders()
1407
+ ),
1408
+ keys: CommunicationPlatformModel.EmailTemplateKeys(),
1409
+ text: CommunicationPlatformModel.TemplateAndType(),
1431
1410
  });
1432
1411
  }
1433
1412
 
1434
- /** @returns {GenericError} */
1435
- static GenericError() {
1413
+ /** @returns {TemplateAndType} */
1414
+ static TemplateAndType() {
1436
1415
  return Joi.object({
1437
- message: CommunicationPlatformModel.Message(),
1438
- sentry: Joi.string().allow(""),
1416
+ template_type: Joi.string().allow(""),
1417
+ template: Joi.string().allow(""),
1439
1418
  });
1440
1419
  }
1441
1420
 
1442
- /** @returns {GetNRecordsCsvReq} */
1443
- static GetNRecordsCsvReq() {
1421
+ /** @returns {EmailTemplate} */
1422
+ static EmailTemplate() {
1444
1423
  return Joi.object({
1445
- count: Joi.number(),
1446
- header: Joi.boolean(),
1447
- url: Joi.string().allow(""),
1424
+ application: Joi.string().allow(""),
1425
+ is_system: Joi.boolean(),
1426
+ is_internal: Joi.boolean(),
1427
+ name: Joi.string().allow(""),
1428
+ description: Joi.string().allow(""),
1429
+ editor_type: Joi.string().allow(""),
1430
+ editor_meta: Joi.string().allow(""),
1431
+ static_to: Joi.array().items(Joi.string().allow("")),
1432
+ static_cc: Joi.array().items(Joi.string().allow("")),
1433
+ static_bcc: Joi.array().items(Joi.string().allow("")),
1434
+ reply_to: Joi.string().allow(""),
1435
+ tags: Joi.array().items(Joi.string().allow("")),
1436
+ subject: CommunicationPlatformModel.TemplateAndType(),
1437
+ html: CommunicationPlatformModel.TemplateAndType(),
1438
+ url_shorten: CommunicationPlatformModel.EnabledObj(),
1439
+ priority: Joi.string().allow(""),
1440
+ template_variables: Joi.any(),
1441
+ published: Joi.boolean(),
1442
+ category: Joi.string().allow(""),
1443
+ _id: Joi.string().allow(""),
1444
+ headers: Joi.array().items(
1445
+ CommunicationPlatformModel.EmailTemplateHeaders()
1446
+ ),
1447
+ attachments: Joi.array().items(Joi.number()),
1448
+ created_at: Joi.string().allow(""),
1449
+ updated_at: Joi.string().allow(""),
1450
+ slug: Joi.string().allow(""),
1451
+ __v: Joi.number(),
1452
+ from_name: Joi.string().allow(""),
1453
+ text: CommunicationPlatformModel.TemplateAndType(),
1448
1454
  });
1449
1455
  }
1450
1456
 
1451
- /** @returns {GetNRecordsCsvRes} */
1452
- static GetNRecordsCsvRes() {
1457
+ /** @returns {SystemEmailTemplate} */
1458
+ static SystemEmailTemplate() {
1453
1459
  return Joi.object({
1454
- items: Joi.array().items(
1455
- CommunicationPlatformModel.GetNRecordsCsvResItems()
1460
+ is_system: Joi.boolean(),
1461
+ is_internal: Joi.boolean(),
1462
+ name: Joi.string().allow(""),
1463
+ description: Joi.string().allow(""),
1464
+ static_to: Joi.array().items(Joi.string().allow("")),
1465
+ static_cc: Joi.array().items(Joi.string().allow("")),
1466
+ static_bcc: Joi.array().items(Joi.string().allow("")),
1467
+ tags: Joi.array().items(Joi.string().allow("")),
1468
+ subject: CommunicationPlatformModel.TemplateAndType(),
1469
+ html: CommunicationPlatformModel.TemplateAndType(),
1470
+ url_shorten: CommunicationPlatformModel.EnabledObj(),
1471
+ priority: Joi.string().allow(""),
1472
+ template_variables: Joi.any(),
1473
+ published: Joi.boolean(),
1474
+ category: Joi.string().allow(""),
1475
+ _id: Joi.string().allow(""),
1476
+ headers: Joi.array().items(
1477
+ CommunicationPlatformModel.EmailTemplateHeaders()
1456
1478
  ),
1479
+ attachments: Joi.array().items(Joi.number()),
1480
+ created_at: Joi.string().allow(""),
1481
+ updated_at: Joi.string().allow(""),
1482
+ slug: Joi.string().allow(""),
1483
+ __v: Joi.number(),
1484
+ text: CommunicationPlatformModel.TemplateAndType(),
1457
1485
  });
1458
1486
  }
1459
1487
 
1460
- /** @returns {GetNRecordsCsvResItems} */
1461
- static GetNRecordsCsvResItems() {
1488
+ /** @returns {EmailTemplates} */
1489
+ static EmailTemplates() {
1462
1490
  return Joi.object({
1463
- email: Joi.string().allow(""),
1464
- firstname: Joi.string().allow(""),
1465
- lastname: Joi.string().allow(""),
1466
- orderid: Joi.string().allow(""),
1467
- phone_number: Joi.string().allow(""),
1491
+ items: Joi.array().items(CommunicationPlatformModel.EmailTemplate()),
1492
+ page: CommunicationPlatformModel.Page(),
1468
1493
  });
1469
1494
  }
1470
1495
 
1471
- /** @returns {GetStats} */
1472
- static GetStats() {
1496
+ /** @returns {SystemEmailTemplates} */
1497
+ static SystemEmailTemplates() {
1473
1498
  return Joi.object({
1474
- items: Joi.array().items(CommunicationPlatformModel.Stats()),
1499
+ items: Joi.array().items(
1500
+ CommunicationPlatformModel.SystemEmailTemplate()
1501
+ ),
1475
1502
  });
1476
1503
  }
1477
1504
 
1478
- /** @returns {GlobalProviders} */
1479
- static GlobalProviders() {
1505
+ /** @returns {PayloadEmailTemplateStructure} */
1506
+ static PayloadEmailTemplateStructure() {
1480
1507
  return Joi.object({
1481
- email: Joi.array().items(
1482
- CommunicationPlatformModel.GlobalProvidersResObj()
1483
- ),
1484
- sms: Joi.array().items(
1485
- CommunicationPlatformModel.GlobalProvidersResObj()
1486
- ),
1487
- voice: Joi.array().items(
1488
- CommunicationPlatformModel.GlobalProvidersResObj()
1489
- ),
1508
+ key: Joi.string().allow(""),
1509
+ value: Joi.any(),
1490
1510
  });
1491
1511
  }
1492
1512
 
1493
- /** @returns {GlobalProvidersResObj} */
1494
- static GlobalProvidersResObj() {
1513
+ /** @returns {PayloadEmailProviderStructure} */
1514
+ static PayloadEmailProviderStructure() {
1495
1515
  return Joi.object({
1496
1516
  _id: Joi.string().allow(""),
1497
- name: Joi.string().allow(""),
1498
1517
  });
1499
1518
  }
1500
1519
 
1501
- /** @returns {GlobalVariablesGetResponse} */
1502
- static GlobalVariablesGetResponse() {
1520
+ /** @returns {PayloadEmailStructure} */
1521
+ static PayloadEmailStructure() {
1522
+ return Joi.object({
1523
+ template: CommunicationPlatformModel.PayloadEmailTemplateStructure(),
1524
+ provider: CommunicationPlatformModel.PayloadEmailProviderStructure(),
1525
+ });
1526
+ }
1527
+
1528
+ /** @returns {PayloadSmsTemplateStructure} */
1529
+ static PayloadSmsTemplateStructure() {
1503
1530
  return Joi.object({
1504
- editable: Joi.any(),
1505
- read_only: Joi.any(),
1531
+ key: Joi.string().allow(""),
1532
+ value: Joi.any(),
1506
1533
  });
1507
1534
  }
1508
1535
 
1509
- /** @returns {GlobalVariablesPostResponse} */
1510
- static GlobalVariablesPostResponse() {
1536
+ /** @returns {PayloadSmsProviderStructure} */
1537
+ static PayloadSmsProviderStructure() {
1511
1538
  return Joi.object({
1512
1539
  _id: Joi.string().allow(""),
1513
- application: Joi.string().allow(""),
1514
- category: Joi.string().allow(""),
1515
- created_at: Joi.string().allow(""),
1516
- global_variables: Joi.any(),
1517
1540
  });
1518
1541
  }
1519
1542
 
1520
- /** @returns {GlobalVariablesReq} */
1521
- static GlobalVariablesReq() {
1543
+ /** @returns {PayloadSmsStructure} */
1544
+ static PayloadSmsStructure() {
1522
1545
  return Joi.object({
1523
- global_variables: Joi.any(),
1546
+ template: CommunicationPlatformModel.PayloadSmsTemplateStructure(),
1547
+ provider: CommunicationPlatformModel.PayloadSmsProviderStructure(),
1524
1548
  });
1525
1549
  }
1526
1550
 
1527
- /** @returns {Job} */
1528
- static Job() {
1551
+ /** @returns {PayloadStructure} */
1552
+ static PayloadStructure() {
1529
1553
  return Joi.object({
1530
- __v: Joi.number(),
1531
- _id: Joi.string().allow(""),
1554
+ data: Joi.array().items(Joi.any()),
1555
+ email: CommunicationPlatformModel.PayloadEmailStructure(),
1556
+ sms: CommunicationPlatformModel.PayloadSmsStructure(),
1532
1557
  application: Joi.string().allow(""),
1533
- campaign: Joi.string().allow(""),
1534
- completed: Joi.boolean(),
1535
- created_at: Joi.string().allow(""),
1536
- is_active: Joi.boolean(),
1537
- updated_at: Joi.string().allow(""),
1538
1558
  });
1539
1559
  }
1540
1560
 
1541
- /** @returns {JobLog} */
1542
- static JobLog() {
1561
+ /** @returns {MetaStructure} */
1562
+ static MetaStructure() {
1543
1563
  return Joi.object({
1544
- __v: Joi.number(),
1545
- _id: Joi.string().allow(""),
1546
- campaign: Joi.string().allow(""),
1547
- created_at: Joi.string().allow(""),
1548
- imported: Joi.any(),
1549
- job: Joi.string().allow(""),
1550
- processed: Joi.any(),
1551
- updated_at: Joi.string().allow(""),
1564
+ job_type: Joi.string().allow(""),
1565
+ action: Joi.string().allow(""),
1566
+ trace: Joi.string().allow(""),
1567
+ timestamp: Joi.string().allow(""),
1552
1568
  });
1553
1569
  }
1554
1570
 
1555
- /** @returns {JobLogs} */
1556
- static JobLogs() {
1571
+ /** @returns {EngineRequest} */
1572
+ static EngineRequest() {
1557
1573
  return Joi.object({
1558
- items: Joi.array().items(CommunicationPlatformModel.JobLog()),
1559
- page: CommunicationPlatformModel.Page(),
1574
+ payload: CommunicationPlatformModel.PayloadStructure(),
1575
+ meta: CommunicationPlatformModel.MetaStructure(),
1560
1576
  });
1561
1577
  }
1562
1578
 
1563
- /** @returns {Jobs} */
1564
- static Jobs() {
1579
+ /** @returns {EngineResponse} */
1580
+ static EngineResponse() {
1565
1581
  return Joi.object({
1566
- items: Joi.array().items(CommunicationPlatformModel.Job()),
1567
- page: CommunicationPlatformModel.Page(),
1582
+ success: Joi.boolean(),
1568
1583
  });
1569
1584
  }
1570
1585
 
1571
- /** @returns {Log} */
1572
- static Log() {
1586
+ /** @returns {EventSubscriptionTemplateSms} */
1587
+ static EventSubscriptionTemplateSms() {
1573
1588
  return Joi.object({
1574
- _id: Joi.string().allow(""),
1575
- application: Joi.string().allow(""),
1576
- created_at: Joi.string().allow(""),
1577
- data: Joi.any(),
1578
- email: CommunicationPlatformModel.LogEmail(),
1579
- expire_at: Joi.string().allow(""),
1580
- meta: CommunicationPlatformModel.LogMeta(),
1581
- pushnotification: CommunicationPlatformModel.LogPushnotification(),
1582
- service: Joi.string().allow(""),
1583
- status: Joi.string().allow(""),
1584
- step: Joi.string().allow(""),
1589
+ subscribed: Joi.boolean(),
1590
+ template: Joi.string().allow(""),
1585
1591
  });
1586
1592
  }
1587
1593
 
1588
- /** @returns {LogEmail} */
1589
- static LogEmail() {
1594
+ /** @returns {EventSubscriptionTemplateEmail} */
1595
+ static EventSubscriptionTemplateEmail() {
1590
1596
  return Joi.object({
1597
+ subscribed: Joi.boolean(),
1591
1598
  template: Joi.string().allow(""),
1592
1599
  });
1593
1600
  }
1594
1601
 
1595
- /** @returns {LogMeta} */
1596
- static LogMeta() {
1602
+ /** @returns {EventSubscriptionTemplate} */
1603
+ static EventSubscriptionTemplate() {
1597
1604
  return Joi.object({
1598
- identifier: Joi.string().allow(""),
1599
- key: Joi.string().allow(""),
1600
- offset: Joi.string().allow(""),
1601
- partition: Joi.string().allow(""),
1602
- topic: Joi.string().allow(""),
1603
- type: Joi.string().allow(""),
1605
+ sms: CommunicationPlatformModel.EventSubscriptionTemplateSms(),
1606
+ email: CommunicationPlatformModel.EventSubscriptionTemplateEmail(),
1604
1607
  });
1605
1608
  }
1606
1609
 
1607
- /** @returns {LogPushnotification} */
1608
- static LogPushnotification() {
1610
+ /** @returns {EventSubscription} */
1611
+ static EventSubscription() {
1609
1612
  return Joi.object({
1610
- pushtokens: Joi.array().items(Joi.string().allow("")),
1613
+ template: CommunicationPlatformModel.EventSubscriptionTemplate(),
1614
+ is_default: Joi.boolean(),
1615
+ _id: Joi.string().allow(""),
1616
+ application: Joi.string().allow(""),
1617
+ event: Joi.string().allow(""),
1618
+ slug: Joi.string().allow(""),
1619
+ created_at: Joi.string().allow(""),
1620
+ updated_at: Joi.string().allow(""),
1621
+ __v: Joi.number(),
1611
1622
  });
1612
1623
  }
1613
1624
 
1614
- /** @returns {Logs} */
1615
- static Logs() {
1625
+ /** @returns {EventSubscriptions} */
1626
+ static EventSubscriptions() {
1616
1627
  return Joi.object({
1617
- items: Joi.array().items(CommunicationPlatformModel.Log()),
1628
+ items: Joi.array().items(CommunicationPlatformModel.EventSubscription()),
1618
1629
  page: CommunicationPlatformModel.Page(),
1619
1630
  });
1620
1631
  }
1621
1632
 
1622
- /** @returns {Message} */
1623
- static Message() {
1633
+ /** @returns {TriggerJobResponse} */
1634
+ static TriggerJobResponse() {
1624
1635
  return Joi.object({
1625
- info: Joi.string().allow(""),
1626
- message: Joi.string().allow(""),
1627
- operation: Joi.string().allow(""),
1628
- success: Joi.boolean(),
1636
+ status: Joi.number(),
1629
1637
  });
1630
1638
  }
1631
1639
 
1632
- /** @returns {metaObj} */
1633
- static metaObj() {
1640
+ /** @returns {TriggerJobRequest} */
1641
+ static TriggerJobRequest() {
1634
1642
  return Joi.object({
1635
- is_system: Joi.boolean(),
1636
- template: Joi.string().allow(""),
1637
- type: Joi.string().allow(""),
1643
+ job_id: Joi.string().allow(""),
1638
1644
  });
1639
1645
  }
1640
1646
 
1641
- /** @returns {MetaStructure} */
1642
- static MetaStructure() {
1647
+ /** @returns {GlobalVariablesGetResponse} */
1648
+ static GlobalVariablesGetResponse() {
1643
1649
  return Joi.object({
1644
- action: Joi.string().allow(""),
1645
- job_type: Joi.string().allow(""),
1646
- timestamp: Joi.string().allow(""),
1647
- trace: Joi.string().allow(""),
1650
+ read_only: Joi.any(),
1651
+ editable: Joi.any(),
1648
1652
  });
1649
1653
  }
1650
1654
 
1651
- /** @returns {NotFound} */
1652
- static NotFound() {
1655
+ /** @returns {GlobalVariablesPostResponse} */
1656
+ static GlobalVariablesPostResponse() {
1653
1657
  return Joi.object({
1654
- message: Joi.string().allow(""),
1658
+ _id: Joi.string().allow(""),
1659
+ category: Joi.string().allow(""),
1660
+ application: Joi.string().allow(""),
1661
+ global_variables: Joi.any(),
1662
+ created_at: Joi.string().allow(""),
1655
1663
  });
1656
1664
  }
1657
1665
 
1658
- /** @returns {Notification} */
1659
- static Notification() {
1666
+ /** @returns {GlobalVariablesReq} */
1667
+ static GlobalVariablesReq() {
1660
1668
  return Joi.object({
1661
- body: Joi.string().allow(""),
1662
- click_action: Joi.string().allow(""),
1663
- deeplink: Joi.string().allow(""),
1664
- icon: Joi.string().allow(""),
1665
- subtitle: Joi.string().allow(""),
1666
- title: Joi.string().allow(""),
1669
+ global_variables: Joi.any(),
1667
1670
  });
1668
1671
  }
1669
1672
 
1670
- /** @returns {OtpConfiguration} */
1671
- static OtpConfiguration() {
1673
+ /** @returns {Job} */
1674
+ static Job() {
1672
1675
  return Joi.object({
1673
- application_id: Joi.string().allow(""),
1674
- company_id: Joi.string().allow(""),
1675
- expiry: CommunicationPlatformModel.OtpConfigurationExpiry().required(),
1676
- otp_length: Joi.number().required(),
1677
- type: Joi.string().allow("").required(),
1676
+ completed: Joi.boolean(),
1677
+ is_active: Joi.boolean(),
1678
+ _id: Joi.string().allow(""),
1679
+ campaign: Joi.string().allow(""),
1680
+ application: Joi.string().allow(""),
1681
+ created_at: Joi.string().allow(""),
1682
+ updated_at: Joi.string().allow(""),
1683
+ __v: Joi.number(),
1678
1684
  });
1679
1685
  }
1680
1686
 
1681
- /** @returns {OtpConfigurationExpiry} */
1682
- static OtpConfigurationExpiry() {
1687
+ /** @returns {Jobs} */
1688
+ static Jobs() {
1683
1689
  return Joi.object({
1684
- duration: CommunicationPlatformModel.OtpConfigurationExpiryDuration().required(),
1685
- type: Joi.string().allow("").required(),
1690
+ items: Joi.array().items(CommunicationPlatformModel.Job()),
1691
+ page: CommunicationPlatformModel.Page(),
1686
1692
  });
1687
1693
  }
1688
1694
 
1689
- /** @returns {OtpConfigurationExpiryDuration} */
1690
- static OtpConfigurationExpiryDuration() {
1695
+ /** @returns {CreateJobsRes} */
1696
+ static CreateJobsRes() {
1691
1697
  return Joi.object({
1692
- denomination: Joi.string().allow("").required(),
1693
- time: Joi.number().required(),
1698
+ application: Joi.string().allow(""),
1699
+ campaign: Joi.string().allow(""),
1700
+ completed: Joi.boolean(),
1701
+ is_active: Joi.boolean(),
1702
+ _id: Joi.string().allow(""),
1703
+ created_at: Joi.string().allow(""),
1704
+ updated_at: Joi.string().allow(""),
1705
+ __v: Joi.number(),
1694
1706
  });
1695
1707
  }
1696
1708
 
1697
- /** @returns {Page} */
1698
- static Page() {
1709
+ /** @returns {CreateJobsReq} */
1710
+ static CreateJobsReq() {
1699
1711
  return Joi.object({
1700
- current: Joi.number(),
1701
- has_next: Joi.boolean(),
1702
- has_previous: Joi.boolean(),
1703
- item_total: Joi.number(),
1704
- next_id: Joi.string().allow(""),
1705
- size: Joi.number(),
1706
- type: Joi.string().allow("").required(),
1712
+ campaign: Joi.string().allow(""),
1707
1713
  });
1708
1714
  }
1709
1715
 
1710
- /** @returns {PayloadEmailProviderStructure} */
1711
- static PayloadEmailProviderStructure() {
1716
+ /** @returns {JobLog} */
1717
+ static JobLog() {
1712
1718
  return Joi.object({
1719
+ imported: Joi.any(),
1720
+ processed: Joi.any(),
1713
1721
  _id: Joi.string().allow(""),
1722
+ job: Joi.string().allow(""),
1723
+ campaign: Joi.string().allow(""),
1724
+ created_at: Joi.string().allow(""),
1725
+ updated_at: Joi.string().allow(""),
1726
+ __v: Joi.number(),
1714
1727
  });
1715
1728
  }
1716
1729
 
1717
- /** @returns {PayloadEmailStructure} */
1718
- static PayloadEmailStructure() {
1730
+ /** @returns {JobLogs} */
1731
+ static JobLogs() {
1719
1732
  return Joi.object({
1720
- provider: CommunicationPlatformModel.PayloadEmailProviderStructure(),
1721
- template: CommunicationPlatformModel.PayloadEmailTemplateStructure(),
1733
+ items: Joi.array().items(CommunicationPlatformModel.JobLog()),
1734
+ page: CommunicationPlatformModel.Page(),
1722
1735
  });
1723
1736
  }
1724
1737
 
1725
- /** @returns {PayloadEmailTemplateStructure} */
1726
- static PayloadEmailTemplateStructure() {
1738
+ /** @returns {LogEmail} */
1739
+ static LogEmail() {
1740
+ return Joi.object({
1741
+ template: Joi.string().allow(""),
1742
+ });
1743
+ }
1744
+
1745
+ /** @returns {LogPushnotification} */
1746
+ static LogPushnotification() {
1747
+ return Joi.object({
1748
+ pushtokens: Joi.array().items(Joi.string().allow("")),
1749
+ });
1750
+ }
1751
+
1752
+ /** @returns {LogMeta} */
1753
+ static LogMeta() {
1727
1754
  return Joi.object({
1755
+ type: Joi.string().allow(""),
1756
+ identifier: Joi.string().allow(""),
1728
1757
  key: Joi.string().allow(""),
1729
- value: Joi.any(),
1758
+ offset: Joi.string().allow(""),
1759
+ partition: Joi.string().allow(""),
1760
+ topic: Joi.string().allow(""),
1730
1761
  });
1731
1762
  }
1732
1763
 
1733
- /** @returns {PayloadSmsProviderStructure} */
1734
- static PayloadSmsProviderStructure() {
1764
+ /** @returns {Log} */
1765
+ static Log() {
1735
1766
  return Joi.object({
1767
+ email: CommunicationPlatformModel.LogEmail(),
1768
+ pushnotification: CommunicationPlatformModel.LogPushnotification(),
1769
+ meta: CommunicationPlatformModel.LogMeta(),
1736
1770
  _id: Joi.string().allow(""),
1771
+ application: Joi.string().allow(""),
1772
+ service: Joi.string().allow(""),
1773
+ step: Joi.string().allow(""),
1774
+ status: Joi.string().allow(""),
1775
+ data: Joi.any(),
1776
+ expire_at: Joi.string().allow(""),
1777
+ created_at: Joi.string().allow(""),
1737
1778
  });
1738
1779
  }
1739
1780
 
1740
- /** @returns {PayloadSmsStructure} */
1741
- static PayloadSmsStructure() {
1781
+ /** @returns {Logs} */
1782
+ static Logs() {
1742
1783
  return Joi.object({
1743
- provider: CommunicationPlatformModel.PayloadSmsProviderStructure(),
1744
- template: CommunicationPlatformModel.PayloadSmsTemplateStructure(),
1784
+ items: Joi.array().items(CommunicationPlatformModel.Log()),
1785
+ page: CommunicationPlatformModel.Page(),
1745
1786
  });
1746
1787
  }
1747
1788
 
1748
- /** @returns {PayloadSmsTemplateStructure} */
1749
- static PayloadSmsTemplateStructure() {
1789
+ /** @returns {SendOtpSmsCommsTemplate} */
1790
+ static SendOtpSmsCommsTemplate() {
1750
1791
  return Joi.object({
1751
1792
  key: Joi.string().allow(""),
1752
1793
  value: Joi.any(),
1753
1794
  });
1754
1795
  }
1755
1796
 
1756
- /** @returns {PayloadStructure} */
1757
- static PayloadStructure() {
1797
+ /** @returns {SendOtpSmsCommsProvider} */
1798
+ static SendOtpSmsCommsProvider() {
1758
1799
  return Joi.object({
1759
- application: Joi.string().allow(""),
1760
- data: Joi.array().items(Joi.any()),
1761
- email: CommunicationPlatformModel.PayloadEmailStructure(),
1762
- sms: CommunicationPlatformModel.PayloadSmsStructure(),
1800
+ slug: Joi.string().allow(""),
1801
+ _id: Joi.string().allow(""),
1763
1802
  });
1764
1803
  }
1765
1804
 
1766
- /** @returns {RecipientHeaders} */
1767
- static RecipientHeaders() {
1805
+ /** @returns {SendOtpEmailCommsProvider} */
1806
+ static SendOtpEmailCommsProvider() {
1768
1807
  return Joi.object({
1769
- email: Joi.string().allow(""),
1808
+ slug: Joi.string().allow(""),
1809
+ _id: Joi.string().allow(""),
1770
1810
  });
1771
1811
  }
1772
1812
 
1773
- /** @returns {SendOtpCommsReq} */
1774
- static SendOtpCommsReq() {
1813
+ /** @returns {SendOtpEmailCommsTemplate} */
1814
+ static SendOtpEmailCommsTemplate() {
1775
1815
  return Joi.object({
1776
- data: CommunicationPlatformModel.SendOtpCommsReqData(),
1777
- email: CommunicationPlatformModel.SendOtpCommsReqEmail(),
1778
- sms: CommunicationPlatformModel.SendOtpCommsReqSms(),
1816
+ key: Joi.string().allow(""),
1817
+ value: Joi.any(),
1779
1818
  });
1780
1819
  }
1781
1820
 
1782
1821
  /** @returns {SendOtpCommsReqData} */
1783
1822
  static SendOtpCommsReqData() {
1784
1823
  return Joi.object({
1785
- country_code: Joi.string().allow(""),
1786
- mobile: Joi.string().allow(""),
1787
1824
  send_same_otp_to_channel: Joi.boolean(),
1825
+ mobile: Joi.string().allow(""),
1826
+ country_code: Joi.string().allow(""),
1788
1827
  to: Joi.string().allow(""),
1789
1828
  });
1790
1829
  }
1791
1830
 
1792
- /** @returns {SendOtpCommsReqEmail} */
1793
- static SendOtpCommsReqEmail() {
1794
- return Joi.object({
1795
- expiry: Joi.number(),
1796
- otp_length: Joi.number(),
1797
- provider: CommunicationPlatformModel.SendOtpEmailCommsProvider(),
1798
- template: CommunicationPlatformModel.SendOtpEmailCommsTemplate(),
1799
- });
1800
- }
1801
-
1802
1831
  /** @returns {SendOtpCommsReqSms} */
1803
1832
  static SendOtpCommsReqSms() {
1804
1833
  return Joi.object({
1805
- expiry: Joi.number(),
1806
1834
  otp_length: Joi.number(),
1807
- provider: CommunicationPlatformModel.SendOtpSmsCommsProvider(),
1835
+ expiry: Joi.number(),
1808
1836
  template: CommunicationPlatformModel.SendOtpSmsCommsTemplate(),
1837
+ provider: CommunicationPlatformModel.SendOtpSmsCommsProvider(),
1809
1838
  });
1810
1839
  }
1811
1840
 
1812
- /** @returns {SendOtpCommsRes} */
1813
- static SendOtpCommsRes() {
1841
+ /** @returns {SendOtpCommsReqEmail} */
1842
+ static SendOtpCommsReqEmail() {
1814
1843
  return Joi.object({
1815
- email: CommunicationPlatformModel.SendOtpCommsResEmail(),
1816
- sms: CommunicationPlatformModel.SendOtpCommsResSms(),
1844
+ otp_length: Joi.number(),
1845
+ expiry: Joi.number(),
1846
+ template: CommunicationPlatformModel.SendOtpEmailCommsTemplate(),
1847
+ provider: CommunicationPlatformModel.SendOtpEmailCommsProvider(),
1817
1848
  });
1818
1849
  }
1819
1850
 
1820
- /** @returns {SendOtpCommsResEmail} */
1821
- static SendOtpCommsResEmail() {
1851
+ /** @returns {SendOtpCommsResSms} */
1852
+ static SendOtpCommsResSms() {
1822
1853
  return Joi.object({
1823
- message: Joi.string().allow(""),
1854
+ success: Joi.boolean(),
1824
1855
  request_id: Joi.string().allow(""),
1856
+ message: Joi.string().allow(""),
1857
+ mobile: Joi.string().allow(""),
1858
+ country_code: Joi.string().allow(""),
1825
1859
  resend_timer: Joi.number(),
1826
- success: Joi.boolean(),
1827
- to: Joi.string().allow(""),
1828
1860
  });
1829
1861
  }
1830
1862
 
1831
- /** @returns {SendOtpCommsResSms} */
1832
- static SendOtpCommsResSms() {
1863
+ /** @returns {SendOtpCommsResEmail} */
1864
+ static SendOtpCommsResEmail() {
1833
1865
  return Joi.object({
1834
- country_code: Joi.string().allow(""),
1835
- message: Joi.string().allow(""),
1836
- mobile: Joi.string().allow(""),
1866
+ success: Joi.boolean(),
1837
1867
  request_id: Joi.string().allow(""),
1868
+ message: Joi.string().allow(""),
1869
+ to: Joi.string().allow(""),
1838
1870
  resend_timer: Joi.number(),
1839
- success: Joi.boolean(),
1840
1871
  });
1841
1872
  }
1842
1873
 
1843
- /** @returns {SendOtpEmailCommsProvider} */
1844
- static SendOtpEmailCommsProvider() {
1874
+ /** @returns {SendOtpCommsReq} */
1875
+ static SendOtpCommsReq() {
1845
1876
  return Joi.object({
1846
- _id: Joi.string().allow(""),
1847
- slug: Joi.string().allow(""),
1877
+ data: CommunicationPlatformModel.SendOtpCommsReqData(),
1878
+ sms: CommunicationPlatformModel.SendOtpCommsReqSms(),
1879
+ email: CommunicationPlatformModel.SendOtpCommsReqEmail(),
1848
1880
  });
1849
1881
  }
1850
1882
 
1851
- /** @returns {SendOtpEmailCommsTemplate} */
1852
- static SendOtpEmailCommsTemplate() {
1883
+ /** @returns {SendOtpCommsRes} */
1884
+ static SendOtpCommsRes() {
1853
1885
  return Joi.object({
1854
- key: Joi.string().allow(""),
1855
- value: Joi.any(),
1886
+ sms: CommunicationPlatformModel.SendOtpCommsResSms(),
1887
+ email: CommunicationPlatformModel.SendOtpCommsResEmail(),
1856
1888
  });
1857
1889
  }
1858
1890
 
1859
- /** @returns {SendOtpSmsCommsProvider} */
1860
- static SendOtpSmsCommsProvider() {
1891
+ /** @returns {VerifyOtpCommsReq} */
1892
+ static VerifyOtpCommsReq() {
1861
1893
  return Joi.object({
1862
- _id: Joi.string().allow(""),
1863
- slug: Joi.string().allow(""),
1894
+ request_id: Joi.string().allow(""),
1895
+ otp: Joi.string().allow(""),
1864
1896
  });
1865
1897
  }
1866
1898
 
1867
- /** @returns {SendOtpSmsCommsTemplate} */
1868
- static SendOtpSmsCommsTemplate() {
1899
+ /** @returns {VerifyOtpCommsSuccessRes} */
1900
+ static VerifyOtpCommsSuccessRes() {
1869
1901
  return Joi.object({
1870
- key: Joi.string().allow(""),
1871
- value: Joi.any(),
1902
+ success: Joi.boolean(),
1903
+ mobile: Joi.string().allow(""),
1904
+ country_code: Joi.string().allow(""),
1905
+ message: Joi.string().allow(""),
1872
1906
  });
1873
1907
  }
1874
1908
 
1875
- /** @returns {SmsProvider} */
1876
- static SmsProvider() {
1909
+ /** @returns {VerifyOtpCommsErrorRes} */
1910
+ static VerifyOtpCommsErrorRes() {
1877
1911
  return Joi.object({
1878
- __v: Joi.number(),
1879
- _id: Joi.string().allow(""),
1880
- application: Joi.string().allow(""),
1881
- authkey: Joi.string().allow(""),
1882
- created_at: Joi.string().allow(""),
1883
- description: Joi.string().allow(""),
1884
- name: Joi.string().allow(""),
1885
- provider: Joi.string().allow(""),
1886
- rpt: Joi.number(),
1887
- sender: Joi.string().allow(""),
1888
- slug: Joi.string().allow(""),
1889
- type: Joi.string().allow(""),
1890
- updated_at: Joi.string().allow(""),
1891
- username: Joi.string().allow(""),
1912
+ success: Joi.boolean(),
1913
+ message: Joi.string().allow(""),
1892
1914
  });
1893
1915
  }
1894
1916
 
1895
1917
  /** @returns {SmsProviderReq} */
1896
1918
  static SmsProviderReq() {
1897
1919
  return Joi.object({
1898
- api_key: Joi.string().allow(""),
1899
- apikey: Joi.string().allow(""),
1900
- authkey: Joi.string().allow(""),
1920
+ name: Joi.string().allow(""),
1901
1921
  description: Joi.string().allow(""),
1902
- entity_id: Joi.string().allow(""),
1903
- entityid: Joi.string().allow(""),
1922
+ sender: Joi.string().allow(""),
1923
+ username: Joi.string().allow(""),
1924
+ authkey: Joi.string().allow(""),
1925
+ type: Joi.string().allow(""),
1926
+ provider: Joi.string().allow(""),
1927
+ password: Joi.string().allow(""),
1928
+ senderid: Joi.string().allow(""),
1904
1929
  feedid: Joi.string().allow(""),
1905
- host: Joi.string().allow(""),
1906
- name: Joi.string().allow(""),
1930
+ entityid: Joi.string().allow(""),
1907
1931
  override_dnd: Joi.boolean(),
1908
- password: Joi.string().allow(""),
1932
+ host: Joi.string().allow(""),
1909
1933
  port: Joi.number(),
1910
- provider: Joi.string().allow(""),
1911
- sender: Joi.string().allow(""),
1912
- sender_id: Joi.string().allow(""),
1913
- senderid: Joi.string().allow(""),
1914
- type: Joi.string().allow(""),
1915
- username: Joi.string().allow(""),
1916
- version_id: Joi.number(),
1917
- });
1918
- }
1919
-
1920
- /** @returns {SmsProviders} */
1921
- static SmsProviders() {
1922
- return Joi.object({
1923
- items: Joi.array().items(CommunicationPlatformModel.SmsProvider()),
1924
- page: CommunicationPlatformModel.Page(),
1925
- });
1926
- }
1927
-
1928
- /** @returns {SmsTemplate} */
1929
- static SmsTemplate() {
1930
- return Joi.object({
1931
- __v: Joi.number(),
1932
- _id: Joi.string().allow(""),
1933
- application: Joi.string().allow(""),
1934
- category: Joi.string().allow(""),
1935
- created_at: Joi.string().allow(""),
1936
- description: Joi.string().allow(""),
1937
- is_internal: Joi.boolean(),
1938
- is_system: Joi.boolean(),
1939
- message: CommunicationPlatformModel.SmsTemplateMessage(),
1940
- meta: CommunicationPlatformModel.metaObj(),
1941
- name: Joi.string().allow(""),
1942
- priority: Joi.string().allow(""),
1943
- published: Joi.boolean(),
1944
- slug: Joi.string().allow(""),
1945
- tags: Joi.array().items(Joi.string().allow("")),
1946
- template_id: Joi.string().allow(""),
1947
- template_variables: Joi.any(),
1948
- updated_at: Joi.string().allow(""),
1949
- url_shorten: CommunicationPlatformModel.EnabledObj(),
1950
- });
1951
- }
1952
-
1953
- /** @returns {SmsTemplateMessage} */
1954
- static SmsTemplateMessage() {
1955
- return Joi.object({
1956
- template: Joi.string().allow(""),
1957
- template_type: Joi.string().allow(""),
1958
- });
1959
- }
1960
-
1961
- /** @returns {SmsTemplateReq} */
1962
- static SmsTemplateReq() {
1963
- return Joi.object({
1964
- description: Joi.string().allow(""),
1965
- message: CommunicationPlatformModel.SmsTemplateMessage(),
1966
- meta: CommunicationPlatformModel.metaObj(),
1967
- name: Joi.string().allow("").required(),
1968
- priority: Joi.string().allow(""),
1969
- published: Joi.boolean(),
1970
- template_id: Joi.string().allow(""),
1971
- template_variables: Joi.any(),
1972
- });
1973
- }
1974
-
1975
- /** @returns {SmsTemplates} */
1976
- static SmsTemplates() {
1977
- return Joi.object({
1978
- items: Joi.array().items(CommunicationPlatformModel.SmsTemplate()),
1979
- page: CommunicationPlatformModel.Page(),
1934
+ entity_id: Joi.string().allow(""),
1935
+ apikey: Joi.string().allow(""),
1936
+ version_id: Joi.number(),
1937
+ sender_id: Joi.string().allow(""),
1938
+ api_key: Joi.string().allow(""),
1980
1939
  });
1981
1940
  }
1982
1941
 
1983
- /** @returns {Stats} */
1984
- static Stats() {
1942
+ /** @returns {SmsProvider} */
1943
+ static SmsProvider() {
1985
1944
  return Joi.object({
1945
+ rpt: Joi.number(),
1946
+ type: Joi.string().allow(""),
1947
+ provider: Joi.string().allow(""),
1986
1948
  _id: Joi.string().allow(""),
1987
- imported: Joi.any(),
1988
- processed: Joi.any(),
1949
+ name: Joi.string().allow(""),
1950
+ description: Joi.string().allow(""),
1951
+ sender: Joi.string().allow(""),
1952
+ username: Joi.string().allow(""),
1953
+ authkey: Joi.string().allow(""),
1954
+ application: Joi.string().allow(""),
1955
+ created_at: Joi.string().allow(""),
1956
+ updated_at: Joi.string().allow(""),
1957
+ slug: Joi.string().allow(""),
1958
+ __v: Joi.number(),
1989
1959
  });
1990
1960
  }
1991
1961
 
1992
- /** @returns {StatsImported} */
1993
- static StatsImported() {
1962
+ /** @returns {SmsProviders} */
1963
+ static SmsProviders() {
1994
1964
  return Joi.object({
1995
- count: Joi.number(),
1965
+ items: Joi.array().items(CommunicationPlatformModel.SmsProvider()),
1966
+ page: CommunicationPlatformModel.Page(),
1996
1967
  });
1997
1968
  }
1998
1969
 
1999
- /** @returns {StatsProcessed} */
2000
- static StatsProcessed() {
1970
+ /** @returns {DefaultSmsProviders} */
1971
+ static DefaultSmsProviders() {
2001
1972
  return Joi.object({
2002
- email: CommunicationPlatformModel.StatsProcessedEmail(),
2003
- sms: CommunicationPlatformModel.StatsProcessedSms(),
1973
+ _id: Joi.string().allow(""),
1974
+ name: Joi.string().allow(""),
1975
+ is_default: Joi.boolean(),
2004
1976
  });
2005
1977
  }
2006
1978
 
2007
- /** @returns {StatsProcessedEmail} */
2008
- static StatsProcessedEmail() {
1979
+ /** @returns {SmsTemplateMessage} */
1980
+ static SmsTemplateMessage() {
2009
1981
  return Joi.object({
2010
- failed: Joi.number(),
2011
- success: Joi.number(),
2012
- suppressed: Joi.number(),
1982
+ template_type: Joi.string().allow(""),
1983
+ template: Joi.string().allow(""),
2013
1984
  });
2014
1985
  }
2015
1986
 
2016
- /** @returns {StatsProcessedSms} */
2017
- static StatsProcessedSms() {
1987
+ /** @returns {SmsTemplates} */
1988
+ static SmsTemplates() {
2018
1989
  return Joi.object({
2019
- failed: Joi.number(),
2020
- success: Joi.number(),
2021
- suppressed: Joi.number(),
1990
+ items: Joi.array().items(CommunicationPlatformModel.SmsTemplate()),
1991
+ page: CommunicationPlatformModel.Page(),
2022
1992
  });
2023
1993
  }
2024
1994
 
2025
- /** @returns {SubscriptionsObject} */
2026
- static SubscriptionsObject() {
1995
+ /** @returns {SmsTemplate} */
1996
+ static SmsTemplate() {
2027
1997
  return Joi.object({
1998
+ url_shorten: CommunicationPlatformModel.EnabledObj(),
2028
1999
  _id: Joi.string().allow(""),
2029
- template: CommunicationPlatformModel.TemplateObject(),
2000
+ application: Joi.string().allow(""),
2001
+ is_system: Joi.boolean(),
2002
+ is_internal: Joi.boolean(),
2003
+ meta: CommunicationPlatformModel.metaObj(),
2004
+ name: Joi.string().allow(""),
2005
+ description: Joi.string().allow(""),
2006
+ message: CommunicationPlatformModel.SmsTemplateMessage(),
2007
+ priority: Joi.string().allow(""),
2008
+ tags: Joi.array().items(Joi.string().allow("")),
2009
+ template_variables: Joi.any(),
2010
+ template_id: Joi.string().allow(""),
2011
+ published: Joi.boolean(),
2012
+ category: Joi.string().allow(""),
2013
+ created_at: Joi.string().allow(""),
2014
+ updated_at: Joi.string().allow(""),
2015
+ slug: Joi.string().allow(""),
2016
+ __v: Joi.number(),
2030
2017
  });
2031
2018
  }
2032
2019
 
2033
- /** @returns {SystemEmailTemplate} */
2034
- static SystemEmailTemplate() {
2020
+ /** @returns {SystemSmsTemplates} */
2021
+ static SystemSmsTemplates() {
2035
2022
  return Joi.object({
2036
- __v: Joi.number(),
2023
+ url_shorten: CommunicationPlatformModel.EnabledObj(),
2037
2024
  _id: Joi.string().allow(""),
2038
- attachments: Joi.array().items(Joi.number()),
2039
- category: Joi.string().allow(""),
2040
- created_at: Joi.string().allow(""),
2041
- description: Joi.string().allow(""),
2042
- headers: Joi.array().items(
2043
- CommunicationPlatformModel.EmailTemplateHeaders()
2044
- ),
2045
- html: CommunicationPlatformModel.TemplateAndType(),
2046
- is_internal: Joi.boolean(),
2047
2025
  is_system: Joi.boolean(),
2026
+ is_internal: Joi.boolean(),
2048
2027
  name: Joi.string().allow(""),
2028
+ description: Joi.string().allow(""),
2029
+ message: CommunicationPlatformModel.SmsTemplateMessage(),
2049
2030
  priority: Joi.string().allow(""),
2050
- published: Joi.boolean(),
2051
- slug: Joi.string().allow(""),
2052
- static_bcc: Joi.array().items(Joi.string().allow("")),
2053
- static_cc: Joi.array().items(Joi.string().allow("")),
2054
- static_to: Joi.array().items(Joi.string().allow("")),
2055
- subject: CommunicationPlatformModel.TemplateAndType(),
2056
2031
  tags: Joi.array().items(Joi.string().allow("")),
2057
2032
  template_variables: Joi.any(),
2058
- text: CommunicationPlatformModel.TemplateAndType(),
2033
+ template_id: Joi.string().allow(""),
2034
+ published: Joi.boolean(),
2035
+ category: Joi.string().allow(""),
2036
+ created_at: Joi.string().allow(""),
2059
2037
  updated_at: Joi.string().allow(""),
2060
- url_shorten: CommunicationPlatformModel.EnabledObj(),
2038
+ slug: Joi.string().allow(""),
2039
+ __v: Joi.number(),
2061
2040
  });
2062
2041
  }
2063
2042
 
2064
- /** @returns {SystemEmailTemplates} */
2065
- static SystemEmailTemplates() {
2043
+ /** @returns {metaObj} */
2044
+ static metaObj() {
2066
2045
  return Joi.object({
2067
- items: Joi.array().items(
2068
- CommunicationPlatformModel.SystemEmailTemplate()
2069
- ),
2046
+ type: Joi.string().allow(""),
2047
+ is_system: Joi.boolean(),
2048
+ template: Joi.string().allow(""),
2070
2049
  });
2071
2050
  }
2072
2051
 
2073
- /** @returns {SystemNotification} */
2074
- static SystemNotification() {
2052
+ /** @returns {SmsTemplateReq} */
2053
+ static SmsTemplateReq() {
2075
2054
  return Joi.object({
2076
- _id: Joi.string().allow(""),
2077
- created_at: Joi.string().allow(""),
2078
- group: Joi.string().allow(""),
2079
- notification: CommunicationPlatformModel.Notification(),
2080
- settings: CommunicationPlatformModel.SystemNotificationUser(),
2081
- user: CommunicationPlatformModel.SystemNotificationUser(),
2055
+ name: Joi.string().allow("").required(),
2056
+ description: Joi.string().allow(""),
2057
+ priority: Joi.string().allow(""),
2058
+ template_id: Joi.string().allow(""),
2059
+ meta: CommunicationPlatformModel.metaObj(),
2060
+ template_variables: Joi.any(),
2061
+ published: Joi.boolean(),
2062
+ message: CommunicationPlatformModel.SmsTemplateMessage(),
2082
2063
  });
2083
2064
  }
2084
2065
 
2085
- /** @returns {SystemNotifications} */
2086
- static SystemNotifications() {
2066
+ /** @returns {Notification} */
2067
+ static Notification() {
2087
2068
  return Joi.object({
2088
- items: Joi.array().items(CommunicationPlatformModel.SystemNotification()),
2089
- last_read_anchor: Joi.number(),
2090
- page: CommunicationPlatformModel.Page(),
2069
+ title: Joi.string().allow(""),
2070
+ body: Joi.string().allow(""),
2071
+ subtitle: Joi.string().allow(""),
2072
+ icon: Joi.string().allow(""),
2073
+ deeplink: Joi.string().allow(""),
2074
+ click_action: Joi.string().allow(""),
2091
2075
  });
2092
2076
  }
2093
2077
 
@@ -2099,83 +2083,99 @@ class CommunicationPlatformModel {
2099
2083
  });
2100
2084
  }
2101
2085
 
2102
- /** @returns {SystemSmsTemplates} */
2103
- static SystemSmsTemplates() {
2086
+ /** @returns {SystemNotification} */
2087
+ static SystemNotification() {
2104
2088
  return Joi.object({
2105
- __v: Joi.number(),
2089
+ notification: CommunicationPlatformModel.Notification(),
2090
+ user: CommunicationPlatformModel.SystemNotificationUser(),
2091
+ settings: CommunicationPlatformModel.SystemNotificationUser(),
2106
2092
  _id: Joi.string().allow(""),
2107
- category: Joi.string().allow(""),
2093
+ group: Joi.string().allow(""),
2108
2094
  created_at: Joi.string().allow(""),
2109
- description: Joi.string().allow(""),
2110
- is_internal: Joi.boolean(),
2111
- is_system: Joi.boolean(),
2112
- message: CommunicationPlatformModel.SmsTemplateMessage(),
2113
- name: Joi.string().allow(""),
2114
- priority: Joi.string().allow(""),
2115
- published: Joi.boolean(),
2116
- slug: Joi.string().allow(""),
2117
- tags: Joi.array().items(Joi.string().allow("")),
2118
- template_id: Joi.string().allow(""),
2119
- template_variables: Joi.any(),
2120
- updated_at: Joi.string().allow(""),
2121
- url_shorten: CommunicationPlatformModel.EnabledObj(),
2122
2095
  });
2123
2096
  }
2124
2097
 
2125
- /** @returns {TemplateAndType} */
2126
- static TemplateAndType() {
2098
+ /** @returns {SystemNotifications} */
2099
+ static SystemNotifications() {
2127
2100
  return Joi.object({
2128
- template: Joi.string().allow(""),
2129
- template_type: Joi.string().allow(""),
2101
+ items: Joi.array().items(CommunicationPlatformModel.SystemNotification()),
2102
+ last_read_anchor: Joi.number(),
2103
+ page: CommunicationPlatformModel.Page(),
2130
2104
  });
2131
2105
  }
2132
2106
 
2133
- /** @returns {TemplateObject} */
2134
- static TemplateObject() {
2107
+ /** @returns {Page} */
2108
+ static Page() {
2135
2109
  return Joi.object({
2136
- email: CommunicationPlatformModel.CommunicationTemplate(),
2137
- pushnotification: CommunicationPlatformModel.CommunicationTemplate(),
2138
- sms: CommunicationPlatformModel.CommunicationTemplate(),
2110
+ item_total: Joi.number(),
2111
+ next_id: Joi.string().allow(""),
2112
+ has_previous: Joi.boolean(),
2113
+ has_next: Joi.boolean(),
2114
+ current: Joi.number(),
2115
+ type: Joi.string().allow("").required(),
2116
+ size: Joi.number(),
2139
2117
  });
2140
2118
  }
2141
2119
 
2142
- /** @returns {TriggerJobRequest} */
2143
- static TriggerJobRequest() {
2120
+ /** @returns {GenericError} */
2121
+ static GenericError() {
2144
2122
  return Joi.object({
2145
- job_id: Joi.string().allow(""),
2123
+ message: CommunicationPlatformModel.Message(),
2124
+ sentry: Joi.string().allow(""),
2146
2125
  });
2147
2126
  }
2148
2127
 
2149
- /** @returns {TriggerJobResponse} */
2150
- static TriggerJobResponse() {
2128
+ /** @returns {GenericDelete} */
2129
+ static GenericDelete() {
2151
2130
  return Joi.object({
2152
- status: Joi.number(),
2131
+ message: Joi.string().allow(""),
2132
+ acknowledged: Joi.boolean(),
2133
+ affected: Joi.number(),
2134
+ operation: Joi.string().allow(""),
2153
2135
  });
2154
2136
  }
2155
2137
 
2156
- /** @returns {VerifyOtpCommsErrorRes} */
2157
- static VerifyOtpCommsErrorRes() {
2138
+ /** @returns {Message} */
2139
+ static Message() {
2158
2140
  return Joi.object({
2159
2141
  message: Joi.string().allow(""),
2160
2142
  success: Joi.boolean(),
2143
+ info: Joi.string().allow(""),
2144
+ operation: Joi.string().allow(""),
2161
2145
  });
2162
2146
  }
2163
2147
 
2164
- /** @returns {VerifyOtpCommsReq} */
2165
- static VerifyOtpCommsReq() {
2148
+ /** @returns {EnabledObj} */
2149
+ static EnabledObj() {
2166
2150
  return Joi.object({
2167
- otp: Joi.string().allow(""),
2168
- request_id: Joi.string().allow(""),
2151
+ enabled: Joi.boolean(),
2169
2152
  });
2170
2153
  }
2171
2154
 
2172
- /** @returns {VerifyOtpCommsSuccessRes} */
2173
- static VerifyOtpCommsSuccessRes() {
2155
+ /** @returns {OtpConfigurationExpiryDuration} */
2156
+ static OtpConfigurationExpiryDuration() {
2174
2157
  return Joi.object({
2175
- country_code: Joi.string().allow(""),
2176
- message: Joi.string().allow(""),
2177
- mobile: Joi.string().allow(""),
2178
- success: Joi.boolean(),
2158
+ time: Joi.number().required(),
2159
+ denomination: Joi.string().allow("").required(),
2160
+ });
2161
+ }
2162
+
2163
+ /** @returns {OtpConfigurationExpiry} */
2164
+ static OtpConfigurationExpiry() {
2165
+ return Joi.object({
2166
+ duration: CommunicationPlatformModel.OtpConfigurationExpiryDuration().required(),
2167
+ type: Joi.string().allow("").required(),
2168
+ });
2169
+ }
2170
+
2171
+ /** @returns {OtpConfiguration} */
2172
+ static OtpConfiguration() {
2173
+ return Joi.object({
2174
+ otp_length: Joi.number().required(),
2175
+ type: Joi.string().allow("").required(),
2176
+ expiry: CommunicationPlatformModel.OtpConfigurationExpiry().required(),
2177
+ application_id: Joi.string().allow(""),
2178
+ company_id: Joi.string().allow(""),
2179
2179
  });
2180
2180
  }
2181
2181
  }