@gofynd/fdk-client-javascript 0.1.37 → 1.0.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 (353) hide show
  1. package/README.md +24 -0
  2. package/application.d.ts +2 -1
  3. package/application.js +2 -1
  4. package/documentation/application/CART.md +315 -289
  5. package/documentation/application/CATALOG.md +427 -404
  6. package/documentation/application/FILESTORAGE.md +2 -0
  7. package/documentation/application/LEAD.md +18 -18
  8. package/documentation/application/LOGISTIC.md +45 -45
  9. package/documentation/application/ORDER.md +287 -287
  10. package/documentation/application/PAYMENT.md +278 -278
  11. package/documentation/application/POSCART.md +318 -292
  12. package/documentation/application/REWARDS.md +1 -0
  13. package/documentation/application/USER.md +19 -14
  14. package/documentation/platform/CART.md +465 -462
  15. package/documentation/platform/CATALOG.md +2691 -2624
  16. package/documentation/platform/COMPANYPROFILE.md +186 -348
  17. package/documentation/platform/DISCOUNT.md +86 -0
  18. package/documentation/platform/FILESTORAGE.md +2 -0
  19. package/documentation/platform/LEAD.md +60 -60
  20. package/documentation/platform/ORDER.md +1299 -1621
  21. package/documentation/platform/PAYMENT.md +89 -89
  22. package/documentation/platform/REWARDS.md +145 -0
  23. package/documentation/platform/USER.md +24 -14
  24. package/index.d.ts +4 -1
  25. package/index.js +6 -3
  26. package/package.json +9 -9
  27. package/platform.d.ts +2 -1
  28. package/platform.js +3 -2
  29. package/public.d.ts +1 -0
  30. package/public.js +3 -2
  31. package/sdk/application/ApplicationAPIClient.js +3 -1
  32. package/sdk/application/ApplicationClient.d.ts +16 -16
  33. package/sdk/application/ApplicationClient.js +32 -16
  34. package/sdk/application/ApplicationConfig.js +3 -2
  35. package/sdk/application/ApplicationModels.d.ts +0 -832
  36. package/sdk/application/ApplicationModels.js +3 -10574
  37. package/sdk/application/{client → Cart}/CartApplicationClient.d.ts +9 -3
  38. package/sdk/application/{client → Cart}/CartApplicationClient.js +14 -8
  39. package/sdk/application/Cart/CartApplicationModel.d.ts +81 -0
  40. package/sdk/application/Cart/CartApplicationModel.js +1136 -0
  41. package/sdk/application/{models/CartValidator.js → Cart/CartApplicationValidator.js} +16 -12
  42. package/sdk/application/{client → Catalog}/CatalogApplicationClient.d.ts +8 -5
  43. package/sdk/application/{client → Catalog}/CatalogApplicationClient.js +11 -8
  44. package/sdk/application/Catalog/CatalogApplicationModel.d.ts +117 -0
  45. package/sdk/application/Catalog/CatalogApplicationModel.js +1606 -0
  46. package/sdk/application/{models/CatalogValidator.js → Catalog/CatalogApplicationValidator.js} +3 -1
  47. package/sdk/application/{client → Common}/CommonApplicationClient.js +2 -2
  48. package/sdk/application/Common/CommonApplicationModel.d.ts +20 -0
  49. package/sdk/application/Common/CommonApplicationModel.js +228 -0
  50. package/sdk/{platform/models/CommonValidator.js → application/Common/CommonApplicationValidator.js} +2 -1
  51. package/sdk/application/{client → Communication}/CommunicationApplicationClient.js +2 -2
  52. package/sdk/application/Communication/CommunicationApplicationModel.d.ts +15 -0
  53. package/sdk/application/Communication/CommunicationApplicationModel.js +144 -0
  54. package/sdk/application/{models/CommunicationValidator.js → Communication/CommunicationApplicationValidator.js} +4 -3
  55. package/sdk/application/{client → Configuration}/ConfigurationApplicationClient.js +2 -2
  56. package/sdk/application/Configuration/ConfigurationApplicationModel.d.ts +111 -0
  57. package/sdk/application/Configuration/ConfigurationApplicationModel.js +1182 -0
  58. package/sdk/application/{models/ConfigurationValidator.js → Configuration/ConfigurationApplicationValidator.js} +3 -2
  59. package/sdk/application/{client → Content}/ContentApplicationClient.js +2 -2
  60. package/sdk/application/Content/ContentApplicationModel.d.ts +105 -0
  61. package/sdk/application/Content/ContentApplicationModel.js +1349 -0
  62. package/sdk/application/{models/ContentValidator.js → Content/ContentApplicationValidator.js} +2 -1
  63. package/sdk/application/{client → FileStorage}/FileStorageApplicationClient.js +2 -2
  64. package/sdk/application/FileStorage/FileStorageApplicationModel.d.ts +21 -0
  65. package/sdk/application/FileStorage/FileStorageApplicationModel.js +244 -0
  66. package/sdk/application/{models/FileStorageValidator.js → FileStorage/FileStorageApplicationValidator.js} +5 -4
  67. package/sdk/application/{client → Lead}/LeadApplicationClient.js +2 -2
  68. package/sdk/application/Lead/LeadApplicationModel.d.ts +55 -0
  69. package/sdk/application/Lead/LeadApplicationModel.js +690 -0
  70. package/sdk/application/{models/LeadValidator.js → Lead/LeadApplicationValidator.js} +5 -4
  71. package/sdk/application/{client → Logistic}/LogisticApplicationClient.js +2 -2
  72. package/sdk/application/Logistic/LogisticApplicationModel.d.ts +26 -0
  73. package/sdk/application/Logistic/LogisticApplicationModel.js +286 -0
  74. package/sdk/application/{models/LogisticValidator.js → Logistic/LogisticApplicationValidator.js} +4 -3
  75. package/sdk/application/{client → Order}/OrderApplicationClient.js +2 -2
  76. package/sdk/application/Order/OrderApplicationModel.d.ts +67 -0
  77. package/sdk/application/Order/OrderApplicationModel.js +872 -0
  78. package/sdk/application/{models/OrderValidator.js → Order/OrderApplicationValidator.js} +4 -3
  79. package/sdk/application/{client → Payment}/PaymentApplicationClient.js +2 -2
  80. package/sdk/application/Payment/PaymentApplicationModel.d.ts +96 -0
  81. package/sdk/application/Payment/PaymentApplicationModel.js +1318 -0
  82. package/sdk/application/{models/PaymentValidator.js → Payment/PaymentApplicationValidator.js} +24 -23
  83. package/sdk/application/{client → PosCart}/PosCartApplicationClient.d.ts +9 -3
  84. package/sdk/application/{client → PosCart}/PosCartApplicationClient.js +14 -8
  85. package/sdk/application/PosCart/PosCartApplicationModel.d.ts +79 -0
  86. package/sdk/application/PosCart/PosCartApplicationModel.js +1132 -0
  87. package/sdk/application/{models/PosCartValidator.js → PosCart/PosCartApplicationValidator.js} +17 -13
  88. package/sdk/application/{client → Rewards}/RewardsApplicationClient.js +2 -2
  89. package/sdk/application/Rewards/RewardsApplicationModel.d.ts +23 -0
  90. package/sdk/application/Rewards/RewardsApplicationModel.js +276 -0
  91. package/sdk/application/{models/RewardsValidator.js → Rewards/RewardsApplicationValidator.js} +5 -4
  92. package/sdk/application/{client → Share}/ShareApplicationClient.js +2 -2
  93. package/sdk/application/Share/ShareApplicationModel.d.ts +16 -0
  94. package/sdk/application/Share/ShareApplicationModel.js +178 -0
  95. package/sdk/application/{models/ShareValidator.js → Share/ShareApplicationValidator.js} +3 -2
  96. package/sdk/application/{client → Theme}/ThemeApplicationClient.js +2 -2
  97. package/sdk/application/Theme/ThemeApplicationModel.d.ts +49 -0
  98. package/sdk/application/Theme/ThemeApplicationModel.js +486 -0
  99. package/sdk/application/{models/ThemeValidator.js → Theme/ThemeApplicationValidator.js} +2 -1
  100. package/sdk/application/{client → User}/UserApplicationClient.js +2 -2
  101. package/sdk/application/User/UserApplicationModel.d.ts +95 -0
  102. package/sdk/application/User/UserApplicationModel.js +998 -0
  103. package/sdk/application/{models/UserValidator.js → User/UserApplicationValidator.js} +30 -29
  104. package/sdk/application/index.d.ts +18 -0
  105. package/sdk/application/index.js +33 -0
  106. package/sdk/common/AxiosHelper.js +23 -10
  107. package/sdk/common/Logger.d.ts +2 -0
  108. package/sdk/common/Logger.js +6 -0
  109. package/sdk/common/curlHelper.d.ts +2 -0
  110. package/sdk/common/curlHelper.js +95 -0
  111. package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.d.ts +101 -0
  112. package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.js +285 -0
  113. package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.d.ts +11 -0
  114. package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.js +56 -0
  115. package/sdk/platform/{client → Analytics}/AnalyticsPlatformClient.js +2 -2
  116. package/sdk/platform/Analytics/AnalyticsPlatformModel.d.ts +23 -0
  117. package/sdk/platform/Analytics/AnalyticsPlatformModel.js +252 -0
  118. package/sdk/platform/{models/AnalyticsValidator.js → Analytics/AnalyticsPlatformValidator.js} +5 -4
  119. package/sdk/platform/{client → AuditTrail}/AuditTrailPlatformClient.js +2 -2
  120. package/sdk/platform/AuditTrail/AuditTrailPlatformModel.d.ts +18 -0
  121. package/sdk/platform/AuditTrail/AuditTrailPlatformModel.js +144 -0
  122. package/sdk/platform/{models/AuditTrailValidator.js → AuditTrail/AuditTrailPlatformValidator.js} +3 -2
  123. package/sdk/platform/{client → Billing}/BillingPlatformClient.js +2 -2
  124. package/sdk/platform/Billing/BillingPlatformModel.d.ts +65 -0
  125. package/sdk/platform/Billing/BillingPlatformModel.js +906 -0
  126. package/sdk/platform/{models/BillingValidator.js → Billing/BillingPlatformValidator.js} +6 -5
  127. package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +293 -0
  128. package/sdk/platform/Cart/CartPlatformApplicationClient.js +755 -0
  129. package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +20 -0
  130. package/sdk/platform/Cart/CartPlatformApplicationValidator.js +138 -0
  131. package/sdk/platform/Cart/CartPlatformModel.d.ts +104 -0
  132. package/sdk/platform/Cart/CartPlatformModel.js +1516 -0
  133. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +856 -0
  134. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +2136 -0
  135. package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +56 -0
  136. package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +389 -0
  137. package/sdk/platform/{client → Catalog}/CatalogPlatformClient.js +338 -338
  138. package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +316 -0
  139. package/sdk/platform/Catalog/CatalogPlatformModel.js +4690 -0
  140. package/sdk/platform/{models/CatalogValidator.js → Catalog/CatalogPlatformValidator.js} +89 -88
  141. package/sdk/platform/{client → Common}/CommonPlatformClient.js +2 -2
  142. package/sdk/platform/Common/CommonPlatformModel.d.ts +20 -0
  143. package/sdk/platform/Common/CommonPlatformModel.js +228 -0
  144. package/sdk/{application/models/CommonValidator.js → platform/Common/CommonPlatformValidator.js} +2 -1
  145. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +611 -0
  146. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +1656 -0
  147. package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.d.ts +43 -0
  148. package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.js +277 -0
  149. package/sdk/platform/{client → Communication}/CommunicationPlatformClient.js +2 -2
  150. package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +102 -0
  151. package/sdk/platform/Communication/CommunicationPlatformModel.js +1312 -0
  152. package/sdk/platform/{models/CommunicationValidator.js → Communication/CommunicationPlatformValidator.js} +2 -1
  153. package/sdk/platform/{client → CompanyProfile}/CompanyProfilePlatformClient.d.ts +0 -9
  154. package/sdk/platform/{client → CompanyProfile}/CompanyProfilePlatformClient.js +2 -33
  155. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +44 -0
  156. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +706 -0
  157. package/sdk/platform/{models/CompanyProfileValidator.d.ts → CompanyProfile/CompanyProfilePlatformValidator.d.ts} +0 -1
  158. package/sdk/platform/{models/CompanyProfileValidator.js → CompanyProfile/CompanyProfilePlatformValidator.js} +9 -14
  159. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +309 -0
  160. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +940 -0
  161. package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.d.ts +31 -0
  162. package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.js +164 -0
  163. package/sdk/platform/{client → Configuration}/ConfigurationPlatformClient.js +2 -2
  164. package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +185 -0
  165. package/sdk/platform/Configuration/ConfigurationPlatformModel.js +2072 -0
  166. package/sdk/platform/{models/ConfigurationValidator.js → Configuration/ConfigurationPlatformValidator.js} +9 -8
  167. package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +781 -0
  168. package/sdk/platform/Content/ContentPlatformApplicationClient.js +2208 -0
  169. package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +71 -0
  170. package/sdk/platform/Content/ContentPlatformApplicationValidator.js +422 -0
  171. package/sdk/platform/Content/ContentPlatformModel.d.ts +105 -0
  172. package/sdk/platform/Content/ContentPlatformModel.js +1349 -0
  173. package/sdk/platform/{client → Discount}/DiscountPlatformClient.d.ts +11 -0
  174. package/sdk/platform/{client → Discount}/DiscountPlatformClient.js +35 -2
  175. package/sdk/platform/Discount/DiscountPlatformModel.d.ts +15 -0
  176. package/sdk/platform/Discount/DiscountPlatformModel.js +176 -0
  177. package/sdk/platform/{models/DiscountValidator.d.ts → Discount/DiscountPlatformValidator.d.ts} +1 -0
  178. package/sdk/platform/{models/DiscountValidator.js → Discount/DiscountPlatformValidator.js} +13 -5
  179. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +114 -0
  180. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +247 -0
  181. package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.d.ts +7 -0
  182. package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.js +38 -0
  183. package/sdk/platform/{client → FileStorage}/FileStoragePlatformClient.js +2 -2
  184. package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +21 -0
  185. package/sdk/platform/FileStorage/FileStoragePlatformModel.js +244 -0
  186. package/sdk/platform/{models/FileStorageValidator.js → FileStorage/FileStoragePlatformValidator.js} +6 -5
  187. package/sdk/platform/{client → Inventory}/InventoryPlatformClient.js +2 -2
  188. package/sdk/platform/Inventory/InventoryPlatformModel.d.ts +62 -0
  189. package/sdk/platform/Inventory/InventoryPlatformModel.js +1178 -0
  190. package/sdk/platform/{models/InventoryValidator.js → Inventory/InventoryPlatformValidator.js} +5 -4
  191. package/sdk/platform/Lead/LeadPlatformApplicationClient.d.ts +138 -0
  192. package/sdk/platform/Lead/LeadPlatformApplicationClient.js +397 -0
  193. package/sdk/platform/Lead/LeadPlatformApplicationValidator.d.ts +16 -0
  194. package/sdk/platform/Lead/LeadPlatformApplicationValidator.js +90 -0
  195. package/sdk/platform/{client → Lead}/LeadPlatformClient.js +2 -2
  196. package/sdk/platform/Lead/LeadPlatformModel.d.ts +55 -0
  197. package/sdk/platform/Lead/LeadPlatformModel.js +690 -0
  198. package/sdk/platform/{models/LeadValidator.js → Lead/LeadPlatformValidator.js} +7 -6
  199. package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +59 -0
  200. package/sdk/platform/Order/OrderPlatformApplicationClient.js +152 -0
  201. package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +6 -0
  202. package/sdk/platform/Order/OrderPlatformApplicationValidator.js +37 -0
  203. package/sdk/platform/{client → Order}/OrderPlatformClient.d.ts +9 -49
  204. package/sdk/platform/{client → Order}/OrderPlatformClient.js +18 -130
  205. package/sdk/platform/Order/OrderPlatformModel.d.ts +215 -0
  206. package/sdk/platform/Order/OrderPlatformModel.js +3530 -0
  207. package/sdk/platform/{models/OrderValidator.d.ts → Order/OrderPlatformValidator.d.ts} +0 -2
  208. package/sdk/platform/{models/OrderValidator.js → Order/OrderPlatformValidator.js} +22 -44
  209. package/sdk/platform/Partner/PartnerPlatformApplicationClient.d.ts +30 -0
  210. package/sdk/platform/Partner/PartnerPlatformApplicationClient.js +74 -0
  211. package/sdk/platform/Partner/PartnerPlatformApplicationValidator.d.ts +5 -0
  212. package/sdk/platform/Partner/PartnerPlatformApplicationValidator.js +20 -0
  213. package/sdk/platform/Partner/PartnerPlatformModel.d.ts +7 -0
  214. package/sdk/platform/Partner/PartnerPlatformModel.js +54 -0
  215. package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +108 -0
  216. package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +333 -0
  217. package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +14 -0
  218. package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +73 -0
  219. package/sdk/platform/{client → Payment}/PaymentPlatformClient.js +2 -2
  220. package/sdk/platform/Payment/PaymentPlatformModel.d.ts +44 -0
  221. package/sdk/platform/Payment/PaymentPlatformModel.js +552 -0
  222. package/sdk/platform/{models/PaymentValidator.js → Payment/PaymentPlatformValidator.js} +6 -5
  223. package/sdk/platform/PlatformAPIClient.js +2 -1
  224. package/sdk/platform/PlatformApplicationClient.d.ts +2979 -18615
  225. package/sdk/platform/PlatformApplicationClient.js +3811 -13957
  226. package/sdk/platform/PlatformClient.d.ts +2982 -3013
  227. package/sdk/platform/PlatformClient.js +3806 -3231
  228. package/sdk/platform/PlatformConfig.js +2 -1
  229. package/sdk/platform/Rewards/RewardsPlatformApplicationClient.d.ts +150 -0
  230. package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +428 -0
  231. package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.d.ts +16 -0
  232. package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.js +91 -0
  233. package/sdk/platform/Rewards/RewardsPlatformModel.d.ts +24 -0
  234. package/sdk/platform/Rewards/RewardsPlatformModel.js +294 -0
  235. package/sdk/platform/Share/SharePlatformApplicationClient.d.ts +72 -0
  236. package/sdk/platform/Share/SharePlatformApplicationClient.js +182 -0
  237. package/sdk/platform/Share/SharePlatformApplicationValidator.d.ts +7 -0
  238. package/sdk/platform/Share/SharePlatformApplicationValidator.js +35 -0
  239. package/sdk/platform/Share/SharePlatformModel.d.ts +15 -0
  240. package/sdk/platform/Share/SharePlatformModel.js +170 -0
  241. package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +238 -0
  242. package/sdk/platform/Theme/ThemePlatformApplicationClient.js +704 -0
  243. package/sdk/platform/Theme/ThemePlatformApplicationValidator.d.ts +27 -0
  244. package/sdk/platform/Theme/ThemePlatformApplicationValidator.js +155 -0
  245. package/sdk/platform/Theme/ThemePlatformModel.d.ts +49 -0
  246. package/sdk/platform/Theme/ThemePlatformModel.js +486 -0
  247. package/sdk/platform/User/UserPlatformApplicationClient.d.ts +121 -0
  248. package/sdk/platform/User/UserPlatformApplicationClient.js +361 -0
  249. package/sdk/platform/User/UserPlatformApplicationValidator.d.ts +15 -0
  250. package/sdk/platform/User/UserPlatformApplicationValidator.js +79 -0
  251. package/sdk/platform/User/UserPlatformModel.d.ts +95 -0
  252. package/sdk/platform/User/UserPlatformModel.js +998 -0
  253. package/sdk/platform/{client → Webhook}/WebhookPlatformClient.js +2 -2
  254. package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +17 -0
  255. package/sdk/platform/Webhook/WebhookPlatformModel.js +208 -0
  256. package/sdk/platform/{models/WebhookValidator.js → Webhook/WebhookPlatformValidator.js} +4 -3
  257. package/sdk/platform/index.d.ts +24 -0
  258. package/sdk/platform/index.js +45 -0
  259. package/sdk/public/{client → Configuration}/ConfigurationPublicClient.js +1 -1
  260. package/sdk/public/Configuration/ConfigurationPublicModel.d.ts +20 -0
  261. package/sdk/public/Configuration/ConfigurationPublicModel.js +230 -0
  262. package/sdk/public/{models/ConfigurationValidator.js → Configuration/ConfigurationPublicValidator.js} +1 -1
  263. package/sdk/public/{client → Inventory}/InventoryPublicClient.js +1 -1
  264. package/sdk/public/Inventory/InventoryPublicModel.d.ts +22 -0
  265. package/sdk/public/Inventory/InventoryPublicModel.js +334 -0
  266. package/sdk/public/{models/InventoryValidator.js → Inventory/InventoryPublicValidator.js} +2 -2
  267. package/sdk/public/PublicClient.d.ts +3 -3
  268. package/sdk/public/PublicClient.js +8 -3
  269. package/sdk/public/{client → Webhook}/WebhookPublicClient.js +1 -1
  270. package/sdk/public/Webhook/WebhookPublicModel.d.ts +17 -0
  271. package/sdk/public/Webhook/WebhookPublicModel.js +208 -0
  272. package/sdk/public/{models/WebhookValidator.js → Webhook/WebhookPublicValidator.js} +2 -2
  273. package/sdk/public/index.d.ts +5 -0
  274. package/sdk/public/index.js +7 -0
  275. package/sdk/platform/PlatformApplicationModels.d.ts +0 -328
  276. package/sdk/platform/PlatformApplicationModels.js +0 -22658
  277. package/sdk/platform/PlatformModels.d.ts +0 -1477
  278. package/sdk/platform/PlatformModels.js +0 -20646
  279. package/sdk/platform/models/CartValidator.d.ts +0 -0
  280. package/sdk/platform/models/CartValidator.js +0 -0
  281. package/sdk/platform/models/ContentValidator.d.ts +0 -0
  282. package/sdk/platform/models/ContentValidator.js +0 -0
  283. package/sdk/platform/models/PartnerValidator.d.ts +0 -0
  284. package/sdk/platform/models/PartnerValidator.js +0 -0
  285. package/sdk/platform/models/RewardsValidator.d.ts +0 -0
  286. package/sdk/platform/models/RewardsValidator.js +0 -0
  287. package/sdk/platform/models/ShareValidator.d.ts +0 -0
  288. package/sdk/platform/models/ShareValidator.js +0 -0
  289. package/sdk/platform/models/ThemeValidator.d.ts +0 -0
  290. package/sdk/platform/models/ThemeValidator.js +0 -0
  291. package/sdk/platform/models/UserValidator.d.ts +0 -0
  292. package/sdk/platform/models/UserValidator.js +0 -0
  293. package/sdk/public/PublicModels.d.ts +0 -50
  294. package/sdk/public/PublicModels.js +0 -712
  295. package/sdk/application/{models/CartValidator.d.ts → Cart/CartApplicationValidator.d.ts} +0 -0
  296. package/sdk/application/{models/CatalogValidator.d.ts → Catalog/CatalogApplicationValidator.d.ts} +0 -0
  297. package/sdk/application/{client → Common}/CommonApplicationClient.d.ts +0 -0
  298. package/sdk/application/{models/CommonValidator.d.ts → Common/CommonApplicationValidator.d.ts} +0 -0
  299. package/sdk/application/{client → Communication}/CommunicationApplicationClient.d.ts +0 -0
  300. package/sdk/application/{models/CommunicationValidator.d.ts → Communication/CommunicationApplicationValidator.d.ts} +0 -0
  301. package/sdk/application/{client → Configuration}/ConfigurationApplicationClient.d.ts +0 -0
  302. package/sdk/application/{models/ConfigurationValidator.d.ts → Configuration/ConfigurationApplicationValidator.d.ts} +0 -0
  303. package/sdk/application/{client → Content}/ContentApplicationClient.d.ts +0 -0
  304. package/sdk/application/{models/ContentValidator.d.ts → Content/ContentApplicationValidator.d.ts} +0 -0
  305. package/sdk/application/{client → FileStorage}/FileStorageApplicationClient.d.ts +0 -0
  306. package/sdk/application/{models/FileStorageValidator.d.ts → FileStorage/FileStorageApplicationValidator.d.ts} +0 -0
  307. package/sdk/application/{client → Lead}/LeadApplicationClient.d.ts +0 -0
  308. package/sdk/application/{models/LeadValidator.d.ts → Lead/LeadApplicationValidator.d.ts} +0 -0
  309. package/sdk/application/{client → Logistic}/LogisticApplicationClient.d.ts +0 -0
  310. package/sdk/application/{models/LogisticValidator.d.ts → Logistic/LogisticApplicationValidator.d.ts} +0 -0
  311. package/sdk/application/{client → Order}/OrderApplicationClient.d.ts +0 -0
  312. package/sdk/application/{models/OrderValidator.d.ts → Order/OrderApplicationValidator.d.ts} +0 -0
  313. package/sdk/application/{client → Payment}/PaymentApplicationClient.d.ts +0 -0
  314. package/sdk/application/{models/PaymentValidator.d.ts → Payment/PaymentApplicationValidator.d.ts} +0 -0
  315. package/sdk/application/{models/PosCartValidator.d.ts → PosCart/PosCartApplicationValidator.d.ts} +0 -0
  316. package/sdk/application/{client → Rewards}/RewardsApplicationClient.d.ts +0 -0
  317. package/sdk/application/{models/RewardsValidator.d.ts → Rewards/RewardsApplicationValidator.d.ts} +0 -0
  318. package/sdk/application/{client → Share}/ShareApplicationClient.d.ts +0 -0
  319. package/sdk/application/{models/ShareValidator.d.ts → Share/ShareApplicationValidator.d.ts} +0 -0
  320. package/sdk/application/{client → Theme}/ThemeApplicationClient.d.ts +0 -0
  321. package/sdk/application/{models/ThemeValidator.d.ts → Theme/ThemeApplicationValidator.d.ts} +0 -0
  322. package/sdk/application/{client → User}/UserApplicationClient.d.ts +0 -0
  323. package/sdk/application/{models/UserValidator.d.ts → User/UserApplicationValidator.d.ts} +0 -0
  324. package/sdk/platform/{client → Analytics}/AnalyticsPlatformClient.d.ts +0 -0
  325. package/sdk/platform/{models/AnalyticsValidator.d.ts → Analytics/AnalyticsPlatformValidator.d.ts} +0 -0
  326. package/sdk/platform/{client → AuditTrail}/AuditTrailPlatformClient.d.ts +0 -0
  327. package/sdk/platform/{models/AuditTrailValidator.d.ts → AuditTrail/AuditTrailPlatformValidator.d.ts} +0 -0
  328. package/sdk/platform/{client → Billing}/BillingPlatformClient.d.ts +0 -0
  329. package/sdk/platform/{models/BillingValidator.d.ts → Billing/BillingPlatformValidator.d.ts} +0 -0
  330. package/sdk/platform/{client → Catalog}/CatalogPlatformClient.d.ts +126 -126
  331. package/sdk/platform/{models/CatalogValidator.d.ts → Catalog/CatalogPlatformValidator.d.ts} +15 -15
  332. /package/sdk/platform/{client → Common}/CommonPlatformClient.d.ts +0 -0
  333. /package/sdk/platform/{models/CommonValidator.d.ts → Common/CommonPlatformValidator.d.ts} +0 -0
  334. /package/sdk/platform/{client → Communication}/CommunicationPlatformClient.d.ts +0 -0
  335. /package/sdk/platform/{models/CommunicationValidator.d.ts → Communication/CommunicationPlatformValidator.d.ts} +0 -0
  336. /package/sdk/platform/{client → Configuration}/ConfigurationPlatformClient.d.ts +0 -0
  337. /package/sdk/platform/{models/ConfigurationValidator.d.ts → Configuration/ConfigurationPlatformValidator.d.ts} +0 -0
  338. /package/sdk/platform/{client → FileStorage}/FileStoragePlatformClient.d.ts +0 -0
  339. /package/sdk/platform/{models/FileStorageValidator.d.ts → FileStorage/FileStoragePlatformValidator.d.ts} +0 -0
  340. /package/sdk/platform/{client → Inventory}/InventoryPlatformClient.d.ts +0 -0
  341. /package/sdk/platform/{models/InventoryValidator.d.ts → Inventory/InventoryPlatformValidator.d.ts} +0 -0
  342. /package/sdk/platform/{client → Lead}/LeadPlatformClient.d.ts +0 -0
  343. /package/sdk/platform/{models/LeadValidator.d.ts → Lead/LeadPlatformValidator.d.ts} +0 -0
  344. /package/sdk/platform/{client → Payment}/PaymentPlatformClient.d.ts +0 -0
  345. /package/sdk/platform/{models/PaymentValidator.d.ts → Payment/PaymentPlatformValidator.d.ts} +0 -0
  346. /package/sdk/platform/{client → Webhook}/WebhookPlatformClient.d.ts +0 -0
  347. /package/sdk/platform/{models/WebhookValidator.d.ts → Webhook/WebhookPlatformValidator.d.ts} +0 -0
  348. /package/sdk/public/{client → Configuration}/ConfigurationPublicClient.d.ts +0 -0
  349. /package/sdk/public/{models/ConfigurationValidator.d.ts → Configuration/ConfigurationPublicValidator.d.ts} +0 -0
  350. /package/sdk/public/{client → Inventory}/InventoryPublicClient.d.ts +0 -0
  351. /package/sdk/public/{models/InventoryValidator.d.ts → Inventory/InventoryPublicValidator.d.ts} +0 -0
  352. /package/sdk/public/{client → Webhook}/WebhookPublicClient.d.ts +0 -0
  353. /package/sdk/public/{models/WebhookValidator.d.ts → Webhook/WebhookPublicValidator.d.ts} +0 -0
@@ -0,0 +1,1656 @@
1
+ const Paginator = require("../../common/Paginator");
2
+ const PlatformAPIClient = require("../PlatformAPIClient");
3
+ const { FDKClientValidationError } = require("../../common/FDKError");
4
+ const CommunicationValidator = require("./CommunicationPlatformApplicationValidator");
5
+
6
+ class Communication {
7
+ constructor(config, applicationId) {
8
+ this.config = config;
9
+ this.applicationId = applicationId;
10
+ }
11
+
12
+ /**
13
+ * @param {Object} arg - Arg object.
14
+ * @param {number} [arg.pageNo] - Current page no
15
+ * @param {number} [arg.pageSize] - Current request items count
16
+ * @param {Object} [arg.sort] - To sort based on created_at
17
+ * @summary: Get campaigns
18
+ * @description: Get campaigns
19
+ */
20
+ getCampaigns({ pageNo, pageSize, sort } = {}) {
21
+ const { error } = CommunicationValidator.getCampaigns().validate(
22
+ {
23
+ pageNo,
24
+ pageSize,
25
+ sort,
26
+ },
27
+ { abortEarly: false, allowUnknown: true }
28
+ );
29
+ if (error) {
30
+ return Promise.reject(new FDKClientValidationError(error));
31
+ }
32
+
33
+ const query_params = {};
34
+ query_params["page_no"] = pageNo;
35
+ query_params["page_size"] = pageSize;
36
+ query_params["sort"] = sort;
37
+
38
+ return PlatformAPIClient.execute(
39
+ this.config,
40
+ "get",
41
+ `/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/campaigns/campaigns`,
42
+ query_params,
43
+ undefined
44
+ );
45
+ }
46
+
47
+ /**
48
+ * @param {Object} arg - Arg object.
49
+ * @param {string} arg.companyId - Company id
50
+ * @param {string} arg.applicationId - Application id
51
+ * @param {number} [arg.pageSize] - Current request items count
52
+ * @param {Object} [arg.sort] - To sort based on created_at
53
+ * @summary: Get campaigns
54
+ * @description: Get campaigns
55
+ */
56
+ getCampaignsPaginator({ companyId, applicationId, pageSize, sort } = {}) {
57
+ const paginator = new Paginator();
58
+ const callback = async () => {
59
+ const pageId = paginator.nextId;
60
+ const pageNo = paginator.pageNo;
61
+ const pageType = "number";
62
+ const data = await this.getCampaigns({
63
+ companyId: companyId,
64
+ applicationId: applicationId,
65
+ pageNo: pageNo,
66
+ pageSize: pageSize,
67
+ sort: sort,
68
+ });
69
+ paginator.setPaginator({
70
+ hasNext: data.page.has_next ? true : false,
71
+ nextId: data.page.next_id,
72
+ });
73
+ return data;
74
+ };
75
+ paginator.setCallback(callback.bind(this));
76
+ return paginator;
77
+ }
78
+
79
+ /**
80
+ * @param {Object} arg - Arg object.
81
+ * @param {CampaignReq} arg.body
82
+ * @summary: Create campaign
83
+ * @description: Create campaign
84
+ */
85
+ createCampaign({ body } = {}) {
86
+ const { error } = CommunicationValidator.createCampaign().validate(
87
+ {
88
+ body,
89
+ },
90
+ { abortEarly: false, allowUnknown: true }
91
+ );
92
+ if (error) {
93
+ return Promise.reject(new FDKClientValidationError(error));
94
+ }
95
+
96
+ const query_params = {};
97
+
98
+ return PlatformAPIClient.execute(
99
+ this.config,
100
+ "post",
101
+ `/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/campaigns/campaigns`,
102
+ query_params,
103
+ body
104
+ );
105
+ }
106
+
107
+ /**
108
+ * @param {Object} arg - Arg object.
109
+ * @param {string} arg.id - Campaign id
110
+ * @summary: Get campaign by id
111
+ * @description: Get campaign by id
112
+ */
113
+ getCampaignById({ id } = {}) {
114
+ const { error } = CommunicationValidator.getCampaignById().validate(
115
+ {
116
+ id,
117
+ },
118
+ { abortEarly: false, allowUnknown: true }
119
+ );
120
+ if (error) {
121
+ return Promise.reject(new FDKClientValidationError(error));
122
+ }
123
+
124
+ const query_params = {};
125
+
126
+ return PlatformAPIClient.execute(
127
+ this.config,
128
+ "get",
129
+ `/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/campaigns/campaigns/${id}`,
130
+ query_params,
131
+ undefined
132
+ );
133
+ }
134
+
135
+ /**
136
+ * @param {Object} arg - Arg object.
137
+ * @param {string} arg.id - Campaign id
138
+ * @param {CampaignReq} arg.body
139
+ * @summary: Update campaign by id
140
+ * @description: Update campaign by id
141
+ */
142
+ updateCampaignById({ id, body } = {}) {
143
+ const { error } = CommunicationValidator.updateCampaignById().validate(
144
+ {
145
+ id,
146
+ body,
147
+ },
148
+ { abortEarly: false, allowUnknown: true }
149
+ );
150
+ if (error) {
151
+ return Promise.reject(new FDKClientValidationError(error));
152
+ }
153
+
154
+ const query_params = {};
155
+
156
+ return PlatformAPIClient.execute(
157
+ this.config,
158
+ "put",
159
+ `/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/campaigns/campaigns/${id}`,
160
+ query_params,
161
+ body
162
+ );
163
+ }
164
+
165
+ /**
166
+ * @param {Object} arg - Arg object.
167
+ * @param {string} arg.id - Campaign id
168
+ * @summary: Get stats of campaign by id
169
+ * @description: Get stats of campaign by id
170
+ */
171
+ getStatsOfCampaignById({ id } = {}) {
172
+ const { error } = CommunicationValidator.getStatsOfCampaignById().validate(
173
+ {
174
+ id,
175
+ },
176
+ { abortEarly: false, allowUnknown: true }
177
+ );
178
+ if (error) {
179
+ return Promise.reject(new FDKClientValidationError(error));
180
+ }
181
+
182
+ const query_params = {};
183
+
184
+ return PlatformAPIClient.execute(
185
+ this.config,
186
+ "get",
187
+ `/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/campaigns/get-stats/${id}`,
188
+ query_params,
189
+ undefined
190
+ );
191
+ }
192
+
193
+ /**
194
+ * @param {Object} arg - Arg object.
195
+ * @param {number} [arg.pageNo] - Current page no
196
+ * @param {number} [arg.pageSize] - Current request items count
197
+ * @param {Object} [arg.sort] - To sort based on created_at
198
+ * @summary: Get audiences
199
+ * @description: Get audiences
200
+ */
201
+ getAudiences({ pageNo, pageSize, sort } = {}) {
202
+ const { error } = CommunicationValidator.getAudiences().validate(
203
+ {
204
+ pageNo,
205
+ pageSize,
206
+ sort,
207
+ },
208
+ { abortEarly: false, allowUnknown: true }
209
+ );
210
+ if (error) {
211
+ return Promise.reject(new FDKClientValidationError(error));
212
+ }
213
+
214
+ const query_params = {};
215
+ query_params["page_no"] = pageNo;
216
+ query_params["page_size"] = pageSize;
217
+ query_params["sort"] = sort;
218
+
219
+ return PlatformAPIClient.execute(
220
+ this.config,
221
+ "get",
222
+ `/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/sources/datasources`,
223
+ query_params,
224
+ undefined
225
+ );
226
+ }
227
+
228
+ /**
229
+ * @param {Object} arg - Arg object.
230
+ * @param {string} arg.companyId - Company id
231
+ * @param {string} arg.applicationId - Application id
232
+ * @param {number} [arg.pageSize] - Current request items count
233
+ * @param {Object} [arg.sort] - To sort based on created_at
234
+ * @summary: Get audiences
235
+ * @description: Get audiences
236
+ */
237
+ getAudiencesPaginator({ companyId, applicationId, pageSize, sort } = {}) {
238
+ const paginator = new Paginator();
239
+ const callback = async () => {
240
+ const pageId = paginator.nextId;
241
+ const pageNo = paginator.pageNo;
242
+ const pageType = "number";
243
+ const data = await this.getAudiences({
244
+ companyId: companyId,
245
+ applicationId: applicationId,
246
+ pageNo: pageNo,
247
+ pageSize: pageSize,
248
+ sort: sort,
249
+ });
250
+ paginator.setPaginator({
251
+ hasNext: data.page.has_next ? true : false,
252
+ nextId: data.page.next_id,
253
+ });
254
+ return data;
255
+ };
256
+ paginator.setCallback(callback.bind(this));
257
+ return paginator;
258
+ }
259
+
260
+ /**
261
+ * @param {Object} arg - Arg object.
262
+ * @param {AudienceReq} arg.body
263
+ * @summary: Create audience
264
+ * @description: Create audience
265
+ */
266
+ createAudience({ body } = {}) {
267
+ const { error } = CommunicationValidator.createAudience().validate(
268
+ {
269
+ body,
270
+ },
271
+ { abortEarly: false, allowUnknown: true }
272
+ );
273
+ if (error) {
274
+ return Promise.reject(new FDKClientValidationError(error));
275
+ }
276
+
277
+ const query_params = {};
278
+
279
+ return PlatformAPIClient.execute(
280
+ this.config,
281
+ "post",
282
+ `/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/sources/datasources`,
283
+ query_params,
284
+ body
285
+ );
286
+ }
287
+
288
+ /**
289
+ * @param {Object} arg - Arg object.
290
+ * @param {BigqueryHeadersReq} arg.body
291
+ * @summary: Get bigquery headers
292
+ * @description: Get bigquery headers
293
+ */
294
+ getBigqueryHeaders({ body } = {}) {
295
+ const { error } = CommunicationValidator.getBigqueryHeaders().validate(
296
+ {
297
+ body,
298
+ },
299
+ { abortEarly: false, allowUnknown: true }
300
+ );
301
+ if (error) {
302
+ return Promise.reject(new FDKClientValidationError(error));
303
+ }
304
+
305
+ const query_params = {};
306
+
307
+ return PlatformAPIClient.execute(
308
+ this.config,
309
+ "post",
310
+ `/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/sources/bigquery-headers`,
311
+ query_params,
312
+ body
313
+ );
314
+ }
315
+
316
+ /**
317
+ * @param {Object} arg - Arg object.
318
+ * @param {string} arg.id - Audience id
319
+ * @summary: Get audience by id
320
+ * @description: Get audience by id
321
+ */
322
+ getAudienceById({ id } = {}) {
323
+ const { error } = CommunicationValidator.getAudienceById().validate(
324
+ {
325
+ id,
326
+ },
327
+ { abortEarly: false, allowUnknown: true }
328
+ );
329
+ if (error) {
330
+ return Promise.reject(new FDKClientValidationError(error));
331
+ }
332
+
333
+ const query_params = {};
334
+
335
+ return PlatformAPIClient.execute(
336
+ this.config,
337
+ "get",
338
+ `/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/sources/datasources/${id}`,
339
+ query_params,
340
+ undefined
341
+ );
342
+ }
343
+
344
+ /**
345
+ * @param {Object} arg - Arg object.
346
+ * @param {string} arg.id - Audience id
347
+ * @param {AudienceReq} arg.body
348
+ * @summary: Update audience by id
349
+ * @description: Update audience by id
350
+ */
351
+ updateAudienceById({ id, body } = {}) {
352
+ const { error } = CommunicationValidator.updateAudienceById().validate(
353
+ {
354
+ id,
355
+ body,
356
+ },
357
+ { abortEarly: false, allowUnknown: true }
358
+ );
359
+ if (error) {
360
+ return Promise.reject(new FDKClientValidationError(error));
361
+ }
362
+
363
+ const query_params = {};
364
+
365
+ return PlatformAPIClient.execute(
366
+ this.config,
367
+ "put",
368
+ `/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/sources/datasources/${id}`,
369
+ query_params,
370
+ body
371
+ );
372
+ }
373
+
374
+ /**
375
+ * @param {Object} arg - Arg object.
376
+ * @param {GetNRecordsCsvReq} arg.body
377
+ * @summary: Get n sample records from csv
378
+ * @description: Get n sample records from csv
379
+ */
380
+ getNSampleRecordsFromCsv({ body } = {}) {
381
+ const {
382
+ error,
383
+ } = CommunicationValidator.getNSampleRecordsFromCsv().validate(
384
+ {
385
+ body,
386
+ },
387
+ { abortEarly: false, allowUnknown: true }
388
+ );
389
+ if (error) {
390
+ return Promise.reject(new FDKClientValidationError(error));
391
+ }
392
+
393
+ const query_params = {};
394
+
395
+ return PlatformAPIClient.execute(
396
+ this.config,
397
+ "post",
398
+ `/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/sources/get-n-records`,
399
+ query_params,
400
+ body
401
+ );
402
+ }
403
+
404
+ /**
405
+ * @param {Object} arg - Arg object.
406
+ * @param {number} [arg.pageNo] - Current page no
407
+ * @param {number} [arg.pageSize] - Current request items count
408
+ * @param {Object} [arg.sort] - To sort based on created_at
409
+ * @summary: Get email providers
410
+ * @description: Get email providers
411
+ */
412
+ getEmailProviders({ pageNo, pageSize, sort } = {}) {
413
+ const { error } = CommunicationValidator.getEmailProviders().validate(
414
+ {
415
+ pageNo,
416
+ pageSize,
417
+ sort,
418
+ },
419
+ { abortEarly: false, allowUnknown: true }
420
+ );
421
+ if (error) {
422
+ return Promise.reject(new FDKClientValidationError(error));
423
+ }
424
+
425
+ const query_params = {};
426
+ query_params["page_no"] = pageNo;
427
+ query_params["page_size"] = pageSize;
428
+ query_params["sort"] = sort;
429
+
430
+ return PlatformAPIClient.execute(
431
+ this.config,
432
+ "get",
433
+ `/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/email/providers`,
434
+ query_params,
435
+ undefined
436
+ );
437
+ }
438
+
439
+ /**
440
+ * @param {Object} arg - Arg object.
441
+ * @param {string} arg.companyId - Company id
442
+ * @param {string} arg.applicationId - Application id
443
+ * @param {number} [arg.pageSize] - Current request items count
444
+ * @param {Object} [arg.sort] - To sort based on created_at
445
+ * @summary: Get email providers
446
+ * @description: Get email providers
447
+ */
448
+ getEmailProvidersPaginator({
449
+ companyId,
450
+ applicationId,
451
+ pageSize,
452
+ sort,
453
+ } = {}) {
454
+ const paginator = new Paginator();
455
+ const callback = async () => {
456
+ const pageId = paginator.nextId;
457
+ const pageNo = paginator.pageNo;
458
+ const pageType = "number";
459
+ const data = await this.getEmailProviders({
460
+ companyId: companyId,
461
+ applicationId: applicationId,
462
+ pageNo: pageNo,
463
+ pageSize: pageSize,
464
+ sort: sort,
465
+ });
466
+ paginator.setPaginator({
467
+ hasNext: data.page.has_next ? true : false,
468
+ nextId: data.page.next_id,
469
+ });
470
+ return data;
471
+ };
472
+ paginator.setCallback(callback.bind(this));
473
+ return paginator;
474
+ }
475
+
476
+ /**
477
+ * @param {Object} arg - Arg object.
478
+ * @param {EmailProviderReq} arg.body
479
+ * @summary: Create email provider
480
+ * @description: Create email provider
481
+ */
482
+ createEmailProvider({ body } = {}) {
483
+ const { error } = CommunicationValidator.createEmailProvider().validate(
484
+ {
485
+ body,
486
+ },
487
+ { abortEarly: false, allowUnknown: true }
488
+ );
489
+ if (error) {
490
+ return Promise.reject(new FDKClientValidationError(error));
491
+ }
492
+
493
+ const query_params = {};
494
+
495
+ return PlatformAPIClient.execute(
496
+ this.config,
497
+ "post",
498
+ `/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/email/providers`,
499
+ query_params,
500
+ body
501
+ );
502
+ }
503
+
504
+ /**
505
+ * @param {Object} arg - Arg object.
506
+ * @param {string} arg.id - Email provider id
507
+ * @summary: Get email provider by id
508
+ * @description: Get email provider by id
509
+ */
510
+ getEmailProviderById({ id } = {}) {
511
+ const { error } = CommunicationValidator.getEmailProviderById().validate(
512
+ {
513
+ id,
514
+ },
515
+ { abortEarly: false, allowUnknown: true }
516
+ );
517
+ if (error) {
518
+ return Promise.reject(new FDKClientValidationError(error));
519
+ }
520
+
521
+ const query_params = {};
522
+
523
+ return PlatformAPIClient.execute(
524
+ this.config,
525
+ "get",
526
+ `/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/email/providers/${id}`,
527
+ query_params,
528
+ undefined
529
+ );
530
+ }
531
+
532
+ /**
533
+ * @param {Object} arg - Arg object.
534
+ * @param {string} arg.id - Email provider id
535
+ * @param {EmailProviderReq} arg.body
536
+ * @summary: Update email provider by id
537
+ * @description: Update email provider by id
538
+ */
539
+ updateEmailProviderById({ id, body } = {}) {
540
+ const { error } = CommunicationValidator.updateEmailProviderById().validate(
541
+ {
542
+ id,
543
+ body,
544
+ },
545
+ { abortEarly: false, allowUnknown: true }
546
+ );
547
+ if (error) {
548
+ return Promise.reject(new FDKClientValidationError(error));
549
+ }
550
+
551
+ const query_params = {};
552
+
553
+ return PlatformAPIClient.execute(
554
+ this.config,
555
+ "put",
556
+ `/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/email/providers/${id}`,
557
+ query_params,
558
+ body
559
+ );
560
+ }
561
+
562
+ /**
563
+ * @param {Object} arg - Arg object.
564
+ * @param {number} [arg.pageNo] - Current page no
565
+ * @param {number} [arg.pageSize] - Current request items count
566
+ * @param {Object} [arg.sort] - To sort based on created_at
567
+ * @summary: Get email templates
568
+ * @description: Get email templates
569
+ */
570
+ getEmailTemplates({ pageNo, pageSize, sort } = {}) {
571
+ const { error } = CommunicationValidator.getEmailTemplates().validate(
572
+ {
573
+ pageNo,
574
+ pageSize,
575
+ sort,
576
+ },
577
+ { abortEarly: false, allowUnknown: true }
578
+ );
579
+ if (error) {
580
+ return Promise.reject(new FDKClientValidationError(error));
581
+ }
582
+
583
+ const query_params = {};
584
+ query_params["page_no"] = pageNo;
585
+ query_params["page_size"] = pageSize;
586
+ query_params["sort"] = sort;
587
+
588
+ return PlatformAPIClient.execute(
589
+ this.config,
590
+ "get",
591
+ `/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/email/templates`,
592
+ query_params,
593
+ undefined
594
+ );
595
+ }
596
+
597
+ /**
598
+ * @param {Object} arg - Arg object.
599
+ * @param {string} arg.companyId - Company id
600
+ * @param {string} arg.applicationId - Application id
601
+ * @param {number} [arg.pageSize] - Current request items count
602
+ * @param {Object} [arg.sort] - To sort based on created_at
603
+ * @summary: Get email templates
604
+ * @description: Get email templates
605
+ */
606
+ getEmailTemplatesPaginator({
607
+ companyId,
608
+ applicationId,
609
+ pageSize,
610
+ sort,
611
+ } = {}) {
612
+ const paginator = new Paginator();
613
+ const callback = async () => {
614
+ const pageId = paginator.nextId;
615
+ const pageNo = paginator.pageNo;
616
+ const pageType = "number";
617
+ const data = await this.getEmailTemplates({
618
+ companyId: companyId,
619
+ applicationId: applicationId,
620
+ pageNo: pageNo,
621
+ pageSize: pageSize,
622
+ sort: sort,
623
+ });
624
+ paginator.setPaginator({
625
+ hasNext: data.page.has_next ? true : false,
626
+ nextId: data.page.next_id,
627
+ });
628
+ return data;
629
+ };
630
+ paginator.setCallback(callback.bind(this));
631
+ return paginator;
632
+ }
633
+
634
+ /**
635
+ * @param {Object} arg - Arg object.
636
+ * @param {EmailTemplateReq} arg.body
637
+ * @summary: Create email template
638
+ * @description: Create email template
639
+ */
640
+ createEmailTemplate({ body } = {}) {
641
+ const { error } = CommunicationValidator.createEmailTemplate().validate(
642
+ {
643
+ body,
644
+ },
645
+ { abortEarly: false, allowUnknown: true }
646
+ );
647
+ if (error) {
648
+ return Promise.reject(new FDKClientValidationError(error));
649
+ }
650
+
651
+ const query_params = {};
652
+
653
+ return PlatformAPIClient.execute(
654
+ this.config,
655
+ "post",
656
+ `/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/email/templates`,
657
+ query_params,
658
+ body
659
+ );
660
+ }
661
+
662
+ /**
663
+ * @param {Object} arg - Arg object.
664
+ * @param {number} [arg.pageNo] - Current page no
665
+ * @param {number} [arg.pageSize] - Current request items count
666
+ * @param {Object} [arg.sort] - To sort based on created_at
667
+ * @summary: Get system email templates
668
+ * @description: Get system email templates
669
+ */
670
+ getSystemEmailTemplates({ pageNo, pageSize, sort } = {}) {
671
+ const { error } = CommunicationValidator.getSystemEmailTemplates().validate(
672
+ {
673
+ pageNo,
674
+ pageSize,
675
+ sort,
676
+ },
677
+ { abortEarly: false, allowUnknown: true }
678
+ );
679
+ if (error) {
680
+ return Promise.reject(new FDKClientValidationError(error));
681
+ }
682
+
683
+ const query_params = {};
684
+ query_params["page_no"] = pageNo;
685
+ query_params["page_size"] = pageSize;
686
+ query_params["sort"] = sort;
687
+
688
+ return PlatformAPIClient.execute(
689
+ this.config,
690
+ "get",
691
+ `/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/email/system-templates`,
692
+ query_params,
693
+ undefined
694
+ );
695
+ }
696
+
697
+ /**
698
+ * @param {Object} arg - Arg object.
699
+ * @param {string} arg.companyId - Company id
700
+ * @param {string} arg.applicationId - Application id
701
+ * @param {number} [arg.pageSize] - Current request items count
702
+ * @param {Object} [arg.sort] - To sort based on created_at
703
+ * @summary: Get system email templates
704
+ * @description: Get system email templates
705
+ */
706
+ getSystemEmailTemplatesPaginator({
707
+ companyId,
708
+ applicationId,
709
+ pageSize,
710
+ sort,
711
+ } = {}) {
712
+ const paginator = new Paginator();
713
+ const callback = async () => {
714
+ const pageId = paginator.nextId;
715
+ const pageNo = paginator.pageNo;
716
+ const pageType = "number";
717
+ const data = await this.getSystemEmailTemplates({
718
+ companyId: companyId,
719
+ applicationId: applicationId,
720
+ pageNo: pageNo,
721
+ pageSize: pageSize,
722
+ sort: sort,
723
+ });
724
+ paginator.setPaginator({
725
+ hasNext: data.page.has_next ? true : false,
726
+ nextId: data.page.next_id,
727
+ });
728
+ return data;
729
+ };
730
+ paginator.setCallback(callback.bind(this));
731
+ return paginator;
732
+ }
733
+
734
+ /**
735
+ * @param {Object} arg - Arg object.
736
+ * @param {string} arg.id - Email template id
737
+ * @summary: Get email template by id
738
+ * @description: Get email template by id
739
+ */
740
+ getEmailTemplateById({ id } = {}) {
741
+ const { error } = CommunicationValidator.getEmailTemplateById().validate(
742
+ {
743
+ id,
744
+ },
745
+ { abortEarly: false, allowUnknown: true }
746
+ );
747
+ if (error) {
748
+ return Promise.reject(new FDKClientValidationError(error));
749
+ }
750
+
751
+ const query_params = {};
752
+
753
+ return PlatformAPIClient.execute(
754
+ this.config,
755
+ "get",
756
+ `/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/email/templates/${id}`,
757
+ query_params,
758
+ undefined
759
+ );
760
+ }
761
+
762
+ /**
763
+ * @param {Object} arg - Arg object.
764
+ * @param {string} arg.id - Email template id
765
+ * @param {EmailTemplateReq} arg.body
766
+ * @summary: Update email template by id
767
+ * @description: Update email template by id
768
+ */
769
+ updateEmailTemplateById({ id, body } = {}) {
770
+ const { error } = CommunicationValidator.updateEmailTemplateById().validate(
771
+ {
772
+ id,
773
+ body,
774
+ },
775
+ { abortEarly: false, allowUnknown: true }
776
+ );
777
+ if (error) {
778
+ return Promise.reject(new FDKClientValidationError(error));
779
+ }
780
+
781
+ const query_params = {};
782
+
783
+ return PlatformAPIClient.execute(
784
+ this.config,
785
+ "put",
786
+ `/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/email/templates/${id}`,
787
+ query_params,
788
+ body
789
+ );
790
+ }
791
+
792
+ /**
793
+ * @param {Object} arg - Arg object.
794
+ * @param {string} arg.id - Email template id
795
+ * @summary: Delete email template by id
796
+ * @description: Delete email template by id
797
+ */
798
+ deleteEmailTemplateById({ id } = {}) {
799
+ const { error } = CommunicationValidator.deleteEmailTemplateById().validate(
800
+ {
801
+ id,
802
+ },
803
+ { abortEarly: false, allowUnknown: true }
804
+ );
805
+ if (error) {
806
+ return Promise.reject(new FDKClientValidationError(error));
807
+ }
808
+
809
+ const query_params = {};
810
+
811
+ return PlatformAPIClient.execute(
812
+ this.config,
813
+ "delete",
814
+ `/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/email/templates/${id}`,
815
+ query_params,
816
+ undefined
817
+ );
818
+ }
819
+
820
+ /**
821
+ * @param {Object} arg - Arg object.
822
+ * @param {EngineRequest} arg.body
823
+ * @summary: Send email or sms synchronously
824
+ * @description: Send email or sms synchronously
825
+ */
826
+ sendCommunicationSynchronously({ body } = {}) {
827
+ const {
828
+ error,
829
+ } = CommunicationValidator.sendCommunicationSynchronously().validate(
830
+ {
831
+ body,
832
+ },
833
+ { abortEarly: false, allowUnknown: true }
834
+ );
835
+ if (error) {
836
+ return Promise.reject(new FDKClientValidationError(error));
837
+ }
838
+
839
+ const query_params = {};
840
+
841
+ return PlatformAPIClient.execute(
842
+ this.config,
843
+ "post",
844
+ `/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/engine/send-instant`,
845
+ query_params,
846
+ body
847
+ );
848
+ }
849
+
850
+ /**
851
+ * @param {Object} arg - Arg object.
852
+ * @param {EngineRequest} arg.body
853
+ * @summary: Send email or sms asynchronously
854
+ * @description: Send email or sms asynchronously
855
+ */
856
+ sendCommunicationAsynchronously({ body } = {}) {
857
+ const {
858
+ error,
859
+ } = CommunicationValidator.sendCommunicationAsynchronously().validate(
860
+ {
861
+ body,
862
+ },
863
+ { abortEarly: false, allowUnknown: true }
864
+ );
865
+ if (error) {
866
+ return Promise.reject(new FDKClientValidationError(error));
867
+ }
868
+
869
+ const query_params = {};
870
+
871
+ return PlatformAPIClient.execute(
872
+ this.config,
873
+ "post",
874
+ `/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/engine/send-async`,
875
+ query_params,
876
+ body
877
+ );
878
+ }
879
+
880
+ /**
881
+ * @param {Object} arg - Arg object.
882
+ * @param {number} [arg.pageNo] - Current page no
883
+ * @param {number} [arg.pageSize] - Current request items count
884
+ * @param {string} [arg.populate] - Populate fields
885
+ * @summary: Get event subscriptions
886
+ * @description: Get event subscriptions
887
+ */
888
+ getEventSubscriptions({ pageNo, pageSize, populate } = {}) {
889
+ const { error } = CommunicationValidator.getEventSubscriptions().validate(
890
+ {
891
+ pageNo,
892
+ pageSize,
893
+ populate,
894
+ },
895
+ { abortEarly: false, allowUnknown: true }
896
+ );
897
+ if (error) {
898
+ return Promise.reject(new FDKClientValidationError(error));
899
+ }
900
+
901
+ const query_params = {};
902
+ query_params["page_no"] = pageNo;
903
+ query_params["page_size"] = pageSize;
904
+ query_params["populate"] = populate;
905
+
906
+ return PlatformAPIClient.execute(
907
+ this.config,
908
+ "get",
909
+ `/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/event/event-subscriptions`,
910
+ query_params,
911
+ undefined
912
+ );
913
+ }
914
+
915
+ /**
916
+ * @param {Object} arg - Arg object.
917
+ * @param {string} arg.companyId - Company id
918
+ * @param {string} arg.applicationId - Application id
919
+ * @param {number} [arg.pageSize] - Current request items count
920
+ * @param {string} [arg.populate] - Populate fields
921
+ * @summary: Get event subscriptions
922
+ * @description: Get event subscriptions
923
+ */
924
+ getEventSubscriptionsPaginator({
925
+ companyId,
926
+ applicationId,
927
+ pageSize,
928
+ populate,
929
+ } = {}) {
930
+ const paginator = new Paginator();
931
+ const callback = async () => {
932
+ const pageId = paginator.nextId;
933
+ const pageNo = paginator.pageNo;
934
+ const pageType = "number";
935
+ const data = await this.getEventSubscriptions({
936
+ companyId: companyId,
937
+ applicationId: applicationId,
938
+ pageNo: pageNo,
939
+ pageSize: pageSize,
940
+ populate: populate,
941
+ });
942
+ paginator.setPaginator({
943
+ hasNext: data.page.has_next ? true : false,
944
+ nextId: data.page.next_id,
945
+ });
946
+ return data;
947
+ };
948
+ paginator.setCallback(callback.bind(this));
949
+ return paginator;
950
+ }
951
+
952
+ /**
953
+ * @param {Object} arg - Arg object.
954
+ * @param {number} [arg.pageNo] - Current page no
955
+ * @param {number} [arg.pageSize] - Current request items count
956
+ * @param {Object} [arg.sort] - To sort based on created_at
957
+ * @summary: Get jobs
958
+ * @description: Get jobs
959
+ */
960
+ getJobs({ pageNo, pageSize, sort } = {}) {
961
+ const { error } = CommunicationValidator.getJobs().validate(
962
+ {
963
+ pageNo,
964
+ pageSize,
965
+ sort,
966
+ },
967
+ { abortEarly: false, allowUnknown: true }
968
+ );
969
+ if (error) {
970
+ return Promise.reject(new FDKClientValidationError(error));
971
+ }
972
+
973
+ const query_params = {};
974
+ query_params["page_no"] = pageNo;
975
+ query_params["page_size"] = pageSize;
976
+ query_params["sort"] = sort;
977
+
978
+ return PlatformAPIClient.execute(
979
+ this.config,
980
+ "get",
981
+ `/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/jobs/jobs`,
982
+ query_params,
983
+ undefined
984
+ );
985
+ }
986
+
987
+ /**
988
+ * @param {Object} arg - Arg object.
989
+ * @param {string} arg.companyId - Company id
990
+ * @param {string} arg.applicationId - Application id
991
+ * @param {number} [arg.pageSize] - Current request items count
992
+ * @param {Object} [arg.sort] - To sort based on created_at
993
+ * @summary: Get jobs
994
+ * @description: Get jobs
995
+ */
996
+ getJobsPaginator({ companyId, applicationId, pageSize, sort } = {}) {
997
+ const paginator = new Paginator();
998
+ const callback = async () => {
999
+ const pageId = paginator.nextId;
1000
+ const pageNo = paginator.pageNo;
1001
+ const pageType = "number";
1002
+ const data = await this.getJobs({
1003
+ companyId: companyId,
1004
+ applicationId: applicationId,
1005
+ pageNo: pageNo,
1006
+ pageSize: pageSize,
1007
+ sort: sort,
1008
+ });
1009
+ paginator.setPaginator({
1010
+ hasNext: data.page.has_next ? true : false,
1011
+ nextId: data.page.next_id,
1012
+ });
1013
+ return data;
1014
+ };
1015
+ paginator.setCallback(callback.bind(this));
1016
+ return paginator;
1017
+ }
1018
+
1019
+ /**
1020
+ * @param {Object} arg - Arg object.
1021
+ * @param {TriggerJobRequest} arg.body
1022
+ * @summary: Trigger campaign job
1023
+ * @description: Trigger campaign job
1024
+ */
1025
+ triggerCampaignJob({ body } = {}) {
1026
+ const { error } = CommunicationValidator.triggerCampaignJob().validate(
1027
+ {
1028
+ body,
1029
+ },
1030
+ { abortEarly: false, allowUnknown: true }
1031
+ );
1032
+ if (error) {
1033
+ return Promise.reject(new FDKClientValidationError(error));
1034
+ }
1035
+
1036
+ const query_params = {};
1037
+
1038
+ return PlatformAPIClient.execute(
1039
+ this.config,
1040
+ "post",
1041
+ `/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/jobs/trigger-job`,
1042
+ query_params,
1043
+ body
1044
+ );
1045
+ }
1046
+
1047
+ /**
1048
+ * @param {Object} arg - Arg object.
1049
+ * @param {number} [arg.pageNo] - Current page no
1050
+ * @param {number} [arg.pageSize] - Current request items count
1051
+ * @param {Object} [arg.sort] - To sort based on created_at
1052
+ * @summary: Get job logs
1053
+ * @description: Get job logs
1054
+ */
1055
+ getJobLogs({ pageNo, pageSize, sort } = {}) {
1056
+ const { error } = CommunicationValidator.getJobLogs().validate(
1057
+ {
1058
+ pageNo,
1059
+ pageSize,
1060
+ sort,
1061
+ },
1062
+ { abortEarly: false, allowUnknown: true }
1063
+ );
1064
+ if (error) {
1065
+ return Promise.reject(new FDKClientValidationError(error));
1066
+ }
1067
+
1068
+ const query_params = {};
1069
+ query_params["page_no"] = pageNo;
1070
+ query_params["page_size"] = pageSize;
1071
+ query_params["sort"] = sort;
1072
+
1073
+ return PlatformAPIClient.execute(
1074
+ this.config,
1075
+ "get",
1076
+ `/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/jobs/logs`,
1077
+ query_params,
1078
+ undefined
1079
+ );
1080
+ }
1081
+
1082
+ /**
1083
+ * @param {Object} arg - Arg object.
1084
+ * @param {string} arg.companyId - Company id
1085
+ * @param {string} arg.applicationId - Application id
1086
+ * @param {number} [arg.pageSize] - Current request items count
1087
+ * @param {Object} [arg.sort] - To sort based on created_at
1088
+ * @summary: Get job logs
1089
+ * @description: Get job logs
1090
+ */
1091
+ getJobLogsPaginator({ companyId, applicationId, pageSize, sort } = {}) {
1092
+ const paginator = new Paginator();
1093
+ const callback = async () => {
1094
+ const pageId = paginator.nextId;
1095
+ const pageNo = paginator.pageNo;
1096
+ const pageType = "number";
1097
+ const data = await this.getJobLogs({
1098
+ companyId: companyId,
1099
+ applicationId: applicationId,
1100
+ pageNo: pageNo,
1101
+ pageSize: pageSize,
1102
+ sort: sort,
1103
+ });
1104
+ paginator.setPaginator({
1105
+ hasNext: data.page.has_next ? true : false,
1106
+ nextId: data.page.next_id,
1107
+ });
1108
+ return data;
1109
+ };
1110
+ paginator.setCallback(callback.bind(this));
1111
+ return paginator;
1112
+ }
1113
+
1114
+ /**
1115
+ * @param {Object} arg - Arg object.
1116
+ * @param {string} [arg.pageId] - Current page no
1117
+ * @param {number} [arg.pageSize] - Current request items count
1118
+ * @param {Object} [arg.sort] - To sort based on _id
1119
+ * @param {Object} [arg.query] -
1120
+ * @summary: Get communication logs
1121
+ * @description: Get communication logs
1122
+ */
1123
+ getCommunicationLogs({ pageId, pageSize, sort, query } = {}) {
1124
+ const { error } = CommunicationValidator.getCommunicationLogs().validate(
1125
+ {
1126
+ pageId,
1127
+ pageSize,
1128
+ sort,
1129
+ query,
1130
+ },
1131
+ { abortEarly: false, allowUnknown: true }
1132
+ );
1133
+ if (error) {
1134
+ return Promise.reject(new FDKClientValidationError(error));
1135
+ }
1136
+
1137
+ const query_params = {};
1138
+ query_params["page_id"] = pageId;
1139
+ query_params["page_size"] = pageSize;
1140
+ query_params["sort"] = sort;
1141
+ query_params["query"] = query;
1142
+
1143
+ return PlatformAPIClient.execute(
1144
+ this.config,
1145
+ "get",
1146
+ `/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/log`,
1147
+ query_params,
1148
+ undefined
1149
+ );
1150
+ }
1151
+
1152
+ /**
1153
+ * @param {Object} arg - Arg object.
1154
+ * @param {string} arg.companyId - Company id
1155
+ * @param {string} arg.applicationId - Application id
1156
+ * @param {number} [arg.pageSize] - Current request items count
1157
+ * @param {Object} [arg.sort] - To sort based on _id
1158
+ * @param {Object} [arg.query] -
1159
+ * @summary: Get communication logs
1160
+ * @description: Get communication logs
1161
+ */
1162
+ getCommunicationLogsPaginator({
1163
+ companyId,
1164
+ applicationId,
1165
+ pageSize,
1166
+ sort,
1167
+ query,
1168
+ } = {}) {
1169
+ const paginator = new Paginator();
1170
+ const callback = async () => {
1171
+ const pageId = paginator.nextId;
1172
+ const pageNo = paginator.pageNo;
1173
+ const pageType = "cursor";
1174
+ const data = await this.getCommunicationLogs({
1175
+ companyId: companyId,
1176
+ applicationId: applicationId,
1177
+ pageId: pageId,
1178
+ pageSize: pageSize,
1179
+ sort: sort,
1180
+ query: query,
1181
+ });
1182
+ paginator.setPaginator({
1183
+ hasNext: data.page.has_next ? true : false,
1184
+ nextId: data.page.next_id,
1185
+ });
1186
+ return data;
1187
+ };
1188
+ paginator.setCallback(callback.bind(this));
1189
+ return paginator;
1190
+ }
1191
+
1192
+ /**
1193
+ * @param {Object} arg - Arg object.
1194
+ * @param {SendOtpCommsReq} arg.body
1195
+ * @summary: Send OTP using email and sms
1196
+ * @description: Send OTP Comms via email and sms
1197
+ */
1198
+ sendOtp({ body } = {}) {
1199
+ const { error } = CommunicationValidator.sendOtp().validate(
1200
+ {
1201
+ body,
1202
+ },
1203
+ { abortEarly: false, allowUnknown: true }
1204
+ );
1205
+ if (error) {
1206
+ return Promise.reject(new FDKClientValidationError(error));
1207
+ }
1208
+
1209
+ const query_params = {};
1210
+
1211
+ return PlatformAPIClient.execute(
1212
+ this.config,
1213
+ "post",
1214
+ `/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/otp/send-otp-comms`,
1215
+ query_params,
1216
+ body
1217
+ );
1218
+ }
1219
+
1220
+ /**
1221
+ * @param {Object} arg - Arg object.
1222
+ * @param {VerifyOtpCommsReq} arg.body
1223
+ * @summary: Verify OTP sent via email and sms
1224
+ * @description: Verify OTP sent via email and sms
1225
+ */
1226
+ verfiyOtp({ body } = {}) {
1227
+ const { error } = CommunicationValidator.verfiyOtp().validate(
1228
+ {
1229
+ body,
1230
+ },
1231
+ { abortEarly: false, allowUnknown: true }
1232
+ );
1233
+ if (error) {
1234
+ return Promise.reject(new FDKClientValidationError(error));
1235
+ }
1236
+
1237
+ const query_params = {};
1238
+
1239
+ return PlatformAPIClient.execute(
1240
+ this.config,
1241
+ "post",
1242
+ `/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/otp/verify-otp-comms`,
1243
+ query_params,
1244
+ body
1245
+ );
1246
+ }
1247
+
1248
+ /**
1249
+ * @param {Object} arg - Arg object.
1250
+ * @param {number} [arg.pageNo] - Current page no
1251
+ * @param {number} [arg.pageSize] - Current request items count
1252
+ * @param {Object} [arg.sort] - To sort based on created_at
1253
+ * @summary: Get sms providers
1254
+ * @description: Get sms providers
1255
+ */
1256
+ getSmsProviders({ pageNo, pageSize, sort } = {}) {
1257
+ const { error } = CommunicationValidator.getSmsProviders().validate(
1258
+ {
1259
+ pageNo,
1260
+ pageSize,
1261
+ sort,
1262
+ },
1263
+ { abortEarly: false, allowUnknown: true }
1264
+ );
1265
+ if (error) {
1266
+ return Promise.reject(new FDKClientValidationError(error));
1267
+ }
1268
+
1269
+ const query_params = {};
1270
+ query_params["page_no"] = pageNo;
1271
+ query_params["page_size"] = pageSize;
1272
+ query_params["sort"] = sort;
1273
+
1274
+ return PlatformAPIClient.execute(
1275
+ this.config,
1276
+ "get",
1277
+ `/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/sms/providers`,
1278
+ query_params,
1279
+ undefined
1280
+ );
1281
+ }
1282
+
1283
+ /**
1284
+ * @param {Object} arg - Arg object.
1285
+ * @param {string} arg.companyId - Company id
1286
+ * @param {string} arg.applicationId - Application id
1287
+ * @param {number} [arg.pageSize] - Current request items count
1288
+ * @param {Object} [arg.sort] - To sort based on created_at
1289
+ * @summary: Get sms providers
1290
+ * @description: Get sms providers
1291
+ */
1292
+ getSmsProvidersPaginator({ companyId, applicationId, pageSize, sort } = {}) {
1293
+ const paginator = new Paginator();
1294
+ const callback = async () => {
1295
+ const pageId = paginator.nextId;
1296
+ const pageNo = paginator.pageNo;
1297
+ const pageType = "number";
1298
+ const data = await this.getSmsProviders({
1299
+ companyId: companyId,
1300
+ applicationId: applicationId,
1301
+ pageNo: pageNo,
1302
+ pageSize: pageSize,
1303
+ sort: sort,
1304
+ });
1305
+ paginator.setPaginator({
1306
+ hasNext: data.page.has_next ? true : false,
1307
+ nextId: data.page.next_id,
1308
+ });
1309
+ return data;
1310
+ };
1311
+ paginator.setCallback(callback.bind(this));
1312
+ return paginator;
1313
+ }
1314
+
1315
+ /**
1316
+ * @param {Object} arg - Arg object.
1317
+ * @param {SmsProviderReq} arg.body
1318
+ * @summary: Create sms provider
1319
+ * @description: Create sms provider
1320
+ */
1321
+ createSmsProvider({ body } = {}) {
1322
+ const { error } = CommunicationValidator.createSmsProvider().validate(
1323
+ {
1324
+ body,
1325
+ },
1326
+ { abortEarly: false, allowUnknown: true }
1327
+ );
1328
+ if (error) {
1329
+ return Promise.reject(new FDKClientValidationError(error));
1330
+ }
1331
+
1332
+ const query_params = {};
1333
+
1334
+ return PlatformAPIClient.execute(
1335
+ this.config,
1336
+ "post",
1337
+ `/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/sms/providers`,
1338
+ query_params,
1339
+ body
1340
+ );
1341
+ }
1342
+
1343
+ /**
1344
+ * @param {Object} arg - Arg object.
1345
+ * @param {string} arg.id - Sms provider id
1346
+ * @summary: Get sms provider by id
1347
+ * @description: Get sms provider by id
1348
+ */
1349
+ getSmsProviderById({ id } = {}) {
1350
+ const { error } = CommunicationValidator.getSmsProviderById().validate(
1351
+ {
1352
+ id,
1353
+ },
1354
+ { abortEarly: false, allowUnknown: true }
1355
+ );
1356
+ if (error) {
1357
+ return Promise.reject(new FDKClientValidationError(error));
1358
+ }
1359
+
1360
+ const query_params = {};
1361
+
1362
+ return PlatformAPIClient.execute(
1363
+ this.config,
1364
+ "get",
1365
+ `/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/sms/providers/${id}`,
1366
+ query_params,
1367
+ undefined
1368
+ );
1369
+ }
1370
+
1371
+ /**
1372
+ * @param {Object} arg - Arg object.
1373
+ * @param {string} arg.id - Sms provider id
1374
+ * @param {SmsProviderReq} arg.body
1375
+ * @summary: Update sms provider by id
1376
+ * @description: Update sms provider by id
1377
+ */
1378
+ updateSmsProviderById({ id, body } = {}) {
1379
+ const { error } = CommunicationValidator.updateSmsProviderById().validate(
1380
+ {
1381
+ id,
1382
+ body,
1383
+ },
1384
+ { abortEarly: false, allowUnknown: true }
1385
+ );
1386
+ if (error) {
1387
+ return Promise.reject(new FDKClientValidationError(error));
1388
+ }
1389
+
1390
+ const query_params = {};
1391
+
1392
+ return PlatformAPIClient.execute(
1393
+ this.config,
1394
+ "put",
1395
+ `/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/sms/providers/${id}`,
1396
+ query_params,
1397
+ body
1398
+ );
1399
+ }
1400
+
1401
+ /**
1402
+ * @param {Object} arg - Arg object.
1403
+ * @param {number} [arg.pageNo] - Current page no
1404
+ * @param {number} [arg.pageSize] - Current request items count
1405
+ * @param {Object} [arg.sort] - To sort based on created_at
1406
+ * @summary: Get sms templates
1407
+ * @description: Get sms templates
1408
+ */
1409
+ getSmsTemplates({ pageNo, pageSize, sort } = {}) {
1410
+ const { error } = CommunicationValidator.getSmsTemplates().validate(
1411
+ {
1412
+ pageNo,
1413
+ pageSize,
1414
+ sort,
1415
+ },
1416
+ { abortEarly: false, allowUnknown: true }
1417
+ );
1418
+ if (error) {
1419
+ return Promise.reject(new FDKClientValidationError(error));
1420
+ }
1421
+
1422
+ const query_params = {};
1423
+ query_params["page_no"] = pageNo;
1424
+ query_params["page_size"] = pageSize;
1425
+ query_params["sort"] = sort;
1426
+
1427
+ return PlatformAPIClient.execute(
1428
+ this.config,
1429
+ "get",
1430
+ `/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/sms/templates`,
1431
+ query_params,
1432
+ undefined
1433
+ );
1434
+ }
1435
+
1436
+ /**
1437
+ * @param {Object} arg - Arg object.
1438
+ * @param {string} arg.companyId - Company id
1439
+ * @param {string} arg.applicationId - Application id
1440
+ * @param {number} [arg.pageSize] - Current request items count
1441
+ * @param {Object} [arg.sort] - To sort based on created_at
1442
+ * @summary: Get sms templates
1443
+ * @description: Get sms templates
1444
+ */
1445
+ getSmsTemplatesPaginator({ companyId, applicationId, pageSize, sort } = {}) {
1446
+ const paginator = new Paginator();
1447
+ const callback = async () => {
1448
+ const pageId = paginator.nextId;
1449
+ const pageNo = paginator.pageNo;
1450
+ const pageType = "number";
1451
+ const data = await this.getSmsTemplates({
1452
+ companyId: companyId,
1453
+ applicationId: applicationId,
1454
+ pageNo: pageNo,
1455
+ pageSize: pageSize,
1456
+ sort: sort,
1457
+ });
1458
+ paginator.setPaginator({
1459
+ hasNext: data.page.has_next ? true : false,
1460
+ nextId: data.page.next_id,
1461
+ });
1462
+ return data;
1463
+ };
1464
+ paginator.setCallback(callback.bind(this));
1465
+ return paginator;
1466
+ }
1467
+
1468
+ /**
1469
+ * @param {Object} arg - Arg object.
1470
+ * @param {SmsTemplateReq} arg.body
1471
+ * @summary: Create sms template
1472
+ * @description: Create sms template
1473
+ */
1474
+ createSmsTemplate({ body } = {}) {
1475
+ const { error } = CommunicationValidator.createSmsTemplate().validate(
1476
+ {
1477
+ body,
1478
+ },
1479
+ { abortEarly: false, allowUnknown: true }
1480
+ );
1481
+ if (error) {
1482
+ return Promise.reject(new FDKClientValidationError(error));
1483
+ }
1484
+
1485
+ const query_params = {};
1486
+
1487
+ return PlatformAPIClient.execute(
1488
+ this.config,
1489
+ "post",
1490
+ `/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/sms/templates`,
1491
+ query_params,
1492
+ body
1493
+ );
1494
+ }
1495
+
1496
+ /**
1497
+ * @param {Object} arg - Arg object.
1498
+ * @param {string} arg.id - Sms template id
1499
+ * @summary: Get sms template by id
1500
+ * @description: Get sms template by id
1501
+ */
1502
+ getSmsTemplateById({ id } = {}) {
1503
+ const { error } = CommunicationValidator.getSmsTemplateById().validate(
1504
+ {
1505
+ id,
1506
+ },
1507
+ { abortEarly: false, allowUnknown: true }
1508
+ );
1509
+ if (error) {
1510
+ return Promise.reject(new FDKClientValidationError(error));
1511
+ }
1512
+
1513
+ const query_params = {};
1514
+
1515
+ return PlatformAPIClient.execute(
1516
+ this.config,
1517
+ "get",
1518
+ `/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/sms/templates/${id}`,
1519
+ query_params,
1520
+ undefined
1521
+ );
1522
+ }
1523
+
1524
+ /**
1525
+ * @param {Object} arg - Arg object.
1526
+ * @param {string} arg.id - Sms template id
1527
+ * @param {SmsTemplateReq} arg.body
1528
+ * @summary: Update sms template by id
1529
+ * @description: Update sms template by id
1530
+ */
1531
+ updateSmsTemplateById({ id, body } = {}) {
1532
+ const { error } = CommunicationValidator.updateSmsTemplateById().validate(
1533
+ {
1534
+ id,
1535
+ body,
1536
+ },
1537
+ { abortEarly: false, allowUnknown: true }
1538
+ );
1539
+ if (error) {
1540
+ return Promise.reject(new FDKClientValidationError(error));
1541
+ }
1542
+
1543
+ const query_params = {};
1544
+
1545
+ return PlatformAPIClient.execute(
1546
+ this.config,
1547
+ "put",
1548
+ `/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/sms/templates/${id}`,
1549
+ query_params,
1550
+ body
1551
+ );
1552
+ }
1553
+
1554
+ /**
1555
+ * @param {Object} arg - Arg object.
1556
+ * @param {string} arg.id - Sms template id
1557
+ * @summary: Delete sms template by id
1558
+ * @description: Delete sms template by id
1559
+ */
1560
+ deleteSmsTemplateById({ id } = {}) {
1561
+ const { error } = CommunicationValidator.deleteSmsTemplateById().validate(
1562
+ {
1563
+ id,
1564
+ },
1565
+ { abortEarly: false, allowUnknown: true }
1566
+ );
1567
+ if (error) {
1568
+ return Promise.reject(new FDKClientValidationError(error));
1569
+ }
1570
+
1571
+ const query_params = {};
1572
+
1573
+ return PlatformAPIClient.execute(
1574
+ this.config,
1575
+ "delete",
1576
+ `/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/sms/templates/${id}`,
1577
+ query_params,
1578
+ undefined
1579
+ );
1580
+ }
1581
+
1582
+ /**
1583
+ * @param {Object} arg - Arg object.
1584
+ * @param {number} [arg.pageNo] - Current page no
1585
+ * @param {number} [arg.pageSize] - Current request items count
1586
+ * @param {Object} [arg.sort] - To sort based on created_at
1587
+ * @summary: Get system sms templates
1588
+ * @description: Get system sms templates
1589
+ */
1590
+ getSystemSystemTemplates({ pageNo, pageSize, sort } = {}) {
1591
+ const {
1592
+ error,
1593
+ } = CommunicationValidator.getSystemSystemTemplates().validate(
1594
+ {
1595
+ pageNo,
1596
+ pageSize,
1597
+ sort,
1598
+ },
1599
+ { abortEarly: false, allowUnknown: true }
1600
+ );
1601
+ if (error) {
1602
+ return Promise.reject(new FDKClientValidationError(error));
1603
+ }
1604
+
1605
+ const query_params = {};
1606
+ query_params["page_no"] = pageNo;
1607
+ query_params["page_size"] = pageSize;
1608
+ query_params["sort"] = sort;
1609
+
1610
+ return PlatformAPIClient.execute(
1611
+ this.config,
1612
+ "get",
1613
+ `/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/sms/system-templates`,
1614
+ query_params,
1615
+ undefined
1616
+ );
1617
+ }
1618
+
1619
+ /**
1620
+ * @param {Object} arg - Arg object.
1621
+ * @param {string} arg.companyId - Company id
1622
+ * @param {string} arg.applicationId - Application id
1623
+ * @param {number} [arg.pageSize] - Current request items count
1624
+ * @param {Object} [arg.sort] - To sort based on created_at
1625
+ * @summary: Get system sms templates
1626
+ * @description: Get system sms templates
1627
+ */
1628
+ getSystemSystemTemplatesPaginator({
1629
+ companyId,
1630
+ applicationId,
1631
+ pageSize,
1632
+ sort,
1633
+ } = {}) {
1634
+ const paginator = new Paginator();
1635
+ const callback = async () => {
1636
+ const pageId = paginator.nextId;
1637
+ const pageNo = paginator.pageNo;
1638
+ const pageType = "number";
1639
+ const data = await this.getSystemSystemTemplates({
1640
+ companyId: companyId,
1641
+ applicationId: applicationId,
1642
+ pageNo: pageNo,
1643
+ pageSize: pageSize,
1644
+ sort: sort,
1645
+ });
1646
+ paginator.setPaginator({
1647
+ hasNext: data.page.has_next ? true : false,
1648
+ nextId: data.page.next_id,
1649
+ });
1650
+ return data;
1651
+ };
1652
+ paginator.setCallback(callback.bind(this));
1653
+ return paginator;
1654
+ }
1655
+ }
1656
+ module.exports = Communication;