@gofynd/fdk-client-javascript 1.1.6 → 1.3.0

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