@gofynd/fdk-client-javascript 0.1.37 → 1.0.1

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 +438 -415
  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 +277 -277
  10. package/documentation/application/PAYMENT.md +251 -251
  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 +2792 -2711
  16. package/documentation/platform/COMPANYPROFILE.md +200 -362
  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 +1451 -1654
  21. package/documentation/platform/PAYMENT.md +94 -94
  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 +13 -4
  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 +316 -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} +17 -12
  42. package/sdk/application/{client → Catalog}/CatalogApplicationClient.d.ts +8 -5
  43. package/sdk/application/{client → Catalog}/CatalogApplicationClient.js +389 -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} +4 -1
  47. package/sdk/application/{client → Common}/CommonApplicationClient.js +24 -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} +3 -1
  51. package/sdk/application/{client → Communication}/CommunicationApplicationClient.js +43 -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} +5 -3
  55. package/sdk/application/{client → Configuration}/ConfigurationApplicationClient.js +202 -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} +4 -2
  59. package/sdk/application/{client → Content}/ContentApplicationClient.js +217 -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} +3 -1
  63. package/sdk/application/{client → FileStorage}/FileStorageApplicationClient.js +35 -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} +6 -4
  67. package/sdk/application/{client → Lead}/LeadApplicationClient.js +83 -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} +6 -4
  71. package/sdk/application/{client → Logistic}/LogisticApplicationClient.js +46 -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} +5 -3
  75. package/sdk/application/{client → Order}/OrderApplicationClient.js +148 -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} +5 -3
  79. package/sdk/application/{client → Payment}/PaymentApplicationClient.js +530 -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} +25 -23
  83. package/sdk/application/{client → PosCart}/PosCartApplicationClient.d.ts +9 -3
  84. package/sdk/application/{client → PosCart}/PosCartApplicationClient.js +343 -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} +18 -13
  88. package/sdk/application/{client → Rewards}/RewardsApplicationClient.js +83 -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} +6 -4
  92. package/sdk/application/{client → Share}/ShareApplicationClient.js +89 -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} +4 -2
  96. package/sdk/application/{client → Theme}/ThemeApplicationClient.js +46 -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} +3 -1
  100. package/sdk/application/{client → User}/UserApplicationClient.js +407 -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} +31 -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 +399 -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 +60 -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 +48 -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 +162 -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 +1001 -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 +2927 -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 +1402 -349
  138. package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +317 -0
  139. package/sdk/platform/Catalog/CatalogPlatformModel.js +4702 -0
  140. package/sdk/platform/{models/CatalogValidator.js → Catalog/CatalogPlatformValidator.js} +92 -91
  141. package/sdk/platform/{client → Common}/CommonPlatformClient.js +28 -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 +2243 -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 +17 -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 +176 -28
  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 +1322 -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 +284 -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 +3074 -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 +187 -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 +301 -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 +78 -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 +163 -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 +559 -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 +142 -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 +207 -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 +24 -55
  204. package/sdk/platform/{client → Order}/OrderPlatformClient.js +693 -146
  205. package/sdk/platform/Order/OrderPlatformModel.d.ts +222 -0
  206. package/sdk/platform/Order/OrderPlatformModel.js +3466 -0
  207. package/sdk/platform/{models/OrderValidator.d.ts → Order/OrderPlatformValidator.d.ts} +2 -3
  208. package/sdk/platform/{models/OrderValidator.js → Order/OrderPlatformValidator.js} +32 -48
  209. package/sdk/platform/Partner/PartnerPlatformApplicationClient.d.ts +30 -0
  210. package/sdk/platform/Partner/PartnerPlatformApplicationClient.js +100 -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 +498 -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 +141 -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 +2824 -18486
  225. package/sdk/platform/PlatformApplicationClient.js +3772 -13928
  226. package/sdk/platform/PlatformClient.d.ts +2824 -2881
  227. package/sdk/platform/PlatformClient.js +3710 -3145
  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 +597 -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 +235 -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 +997 -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 +506 -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 +92 -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 +26 -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} +3 -1
  263. package/sdk/public/{client → Inventory}/InventoryPublicClient.js +76 -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} +4 -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 +30 -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} +4 -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 +149 -149
  331. package/sdk/platform/{models/CatalogValidator.d.ts → Catalog/CatalogPlatformValidator.d.ts} +21 -21
  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,3074 @@
1
+ const Paginator = require("../../common/Paginator");
2
+ const PlatformAPIClient = require("../PlatformAPIClient");
3
+ const { FDKClientValidationError } = require("../../common/FDKError");
4
+ const ContentValidator = require("./ContentPlatformApplicationValidator");
5
+
6
+ class Content {
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] - The page number to navigate through the
15
+ * given set of results. Default value is 1.
16
+ * @param {number} [arg.pageSize] - The number of items to retrieve in each
17
+ * page. Default value is 10.
18
+ * @summary: Get a list of announcements
19
+ * @description: Announcements are useful to highlight a message or information on top of a webpage. Use this API to retrieve a list of announcements.
20
+ */
21
+ getAnnouncementsList({ pageNo, pageSize } = {}) {
22
+ const { error } = ContentValidator.getAnnouncementsList().validate(
23
+ {
24
+ pageNo,
25
+ pageSize,
26
+ },
27
+ { abortEarly: false, allowUnknown: true }
28
+ );
29
+ if (error) {
30
+ return Promise.reject(new FDKClientValidationError(error));
31
+ }
32
+
33
+ // Showing warrnings if extra unknown parameters are found
34
+ const {
35
+ error: warrning,
36
+ } = ContentValidator.getAnnouncementsList().validate(
37
+ {
38
+ pageNo,
39
+ pageSize,
40
+ },
41
+ { abortEarly: false, allowUnknown: false }
42
+ );
43
+ if (warrning) {
44
+ console.log("Parameter Validation warrnings for getAnnouncementsList");
45
+ console.log(warrning);
46
+ }
47
+
48
+ const query_params = {};
49
+ query_params["page_no"] = pageNo;
50
+ query_params["page_size"] = pageSize;
51
+
52
+ return PlatformAPIClient.execute(
53
+ this.config,
54
+ "get",
55
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/announcements`,
56
+ query_params,
57
+ undefined
58
+ );
59
+ }
60
+
61
+ /**
62
+ * @param {Object} arg - Arg object.
63
+ * @param {string} arg.companyId - Numeric ID allotted to a business account
64
+ * on Fynd Platform
65
+ * @param {string} arg.applicationId - Numeric ID allotted to an application
66
+ * created within a business account.
67
+ * @param {number} [arg.pageSize] - The number of items to retrieve in each
68
+ * page. Default value is 10.
69
+ * @summary: Get a list of announcements
70
+ * @description: Announcements are useful to highlight a message or information on top of a webpage. Use this API to retrieve a list of announcements.
71
+ */
72
+ getAnnouncementsListPaginator({ companyId, applicationId, pageSize } = {}) {
73
+ const paginator = new Paginator();
74
+ const callback = async () => {
75
+ const pageId = paginator.nextId;
76
+ const pageNo = paginator.pageNo;
77
+ const pageType = "number";
78
+ const data = await this.getAnnouncementsList({
79
+ companyId: companyId,
80
+ applicationId: applicationId,
81
+ pageNo: pageNo,
82
+ pageSize: pageSize,
83
+ });
84
+ paginator.setPaginator({
85
+ hasNext: data.page.has_next ? true : false,
86
+ nextId: data.page.next_id,
87
+ });
88
+ return data;
89
+ };
90
+ paginator.setCallback(callback.bind(this));
91
+ return paginator;
92
+ }
93
+
94
+ /**
95
+ * @param {Object} arg - Arg object.
96
+ * @param {AdminAnnouncementSchema} arg.body
97
+ * @summary: Create an announcement
98
+ * @description: Announcements are useful to highlight a message or information on top of a webpage. Use this API to create an announcement.
99
+ */
100
+ createAnnouncement({ body } = {}) {
101
+ const { error } = ContentValidator.createAnnouncement().validate(
102
+ {
103
+ body,
104
+ },
105
+ { abortEarly: false, allowUnknown: true }
106
+ );
107
+ if (error) {
108
+ return Promise.reject(new FDKClientValidationError(error));
109
+ }
110
+
111
+ // Showing warrnings if extra unknown parameters are found
112
+ const { error: warrning } = ContentValidator.createAnnouncement().validate(
113
+ {
114
+ body,
115
+ },
116
+ { abortEarly: false, allowUnknown: false }
117
+ );
118
+ if (warrning) {
119
+ console.log("Parameter Validation warrnings for createAnnouncement");
120
+ console.log(warrning);
121
+ }
122
+
123
+ const query_params = {};
124
+
125
+ return PlatformAPIClient.execute(
126
+ this.config,
127
+ "post",
128
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/announcements`,
129
+ query_params,
130
+ body
131
+ );
132
+ }
133
+
134
+ /**
135
+ * @param {Object} arg - Arg object.
136
+ * @param {string} arg.announcementId - ID allotted to the announcement.
137
+ * @summary: Get announcement by ID
138
+ * @description: Use this API to retrieve an announcement and its details such as the target platform and pages on which it's applicable
139
+ */
140
+ getAnnouncementById({ announcementId } = {}) {
141
+ const { error } = ContentValidator.getAnnouncementById().validate(
142
+ {
143
+ announcementId,
144
+ },
145
+ { abortEarly: false, allowUnknown: true }
146
+ );
147
+ if (error) {
148
+ return Promise.reject(new FDKClientValidationError(error));
149
+ }
150
+
151
+ // Showing warrnings if extra unknown parameters are found
152
+ const { error: warrning } = ContentValidator.getAnnouncementById().validate(
153
+ {
154
+ announcementId,
155
+ },
156
+ { abortEarly: false, allowUnknown: false }
157
+ );
158
+ if (warrning) {
159
+ console.log("Parameter Validation warrnings for getAnnouncementById");
160
+ console.log(warrning);
161
+ }
162
+
163
+ const query_params = {};
164
+
165
+ return PlatformAPIClient.execute(
166
+ this.config,
167
+ "get",
168
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/announcements/${announcementId}`,
169
+ query_params,
170
+ undefined
171
+ );
172
+ }
173
+
174
+ /**
175
+ * @param {Object} arg - Arg object.
176
+ * @param {string} arg.announcementId - ID allotted to the announcement.
177
+ * @param {AdminAnnouncementSchema} arg.body
178
+ * @summary: Update an announcement
179
+ * @description: Use this API to edit an existing announcement and its details such as the target platform and pages on which it's applicable
180
+ */
181
+ updateAnnouncement({ announcementId, body } = {}) {
182
+ const { error } = ContentValidator.updateAnnouncement().validate(
183
+ {
184
+ announcementId,
185
+ body,
186
+ },
187
+ { abortEarly: false, allowUnknown: true }
188
+ );
189
+ if (error) {
190
+ return Promise.reject(new FDKClientValidationError(error));
191
+ }
192
+
193
+ // Showing warrnings if extra unknown parameters are found
194
+ const { error: warrning } = ContentValidator.updateAnnouncement().validate(
195
+ {
196
+ announcementId,
197
+ body,
198
+ },
199
+ { abortEarly: false, allowUnknown: false }
200
+ );
201
+ if (warrning) {
202
+ console.log("Parameter Validation warrnings for updateAnnouncement");
203
+ console.log(warrning);
204
+ }
205
+
206
+ const query_params = {};
207
+
208
+ return PlatformAPIClient.execute(
209
+ this.config,
210
+ "put",
211
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/announcements/${announcementId}`,
212
+ query_params,
213
+ body
214
+ );
215
+ }
216
+
217
+ /**
218
+ * @param {Object} arg - Arg object.
219
+ * @param {string} arg.announcementId - ID allotted to the announcement.
220
+ * @param {ScheduleSchema} arg.body
221
+ * @summary: Update the schedule and the publish status of an announcement
222
+ * @description: Use this API to edit the duration, i.e. start date-time and end date-time of an announcement. Moreover, you can enable/disable an announcement using this API.
223
+ */
224
+ updateAnnouncementSchedule({ announcementId, body } = {}) {
225
+ const { error } = ContentValidator.updateAnnouncementSchedule().validate(
226
+ {
227
+ announcementId,
228
+ body,
229
+ },
230
+ { abortEarly: false, allowUnknown: true }
231
+ );
232
+ if (error) {
233
+ return Promise.reject(new FDKClientValidationError(error));
234
+ }
235
+
236
+ // Showing warrnings if extra unknown parameters are found
237
+ const {
238
+ error: warrning,
239
+ } = ContentValidator.updateAnnouncementSchedule().validate(
240
+ {
241
+ announcementId,
242
+ body,
243
+ },
244
+ { abortEarly: false, allowUnknown: false }
245
+ );
246
+ if (warrning) {
247
+ console.log(
248
+ "Parameter Validation warrnings for updateAnnouncementSchedule"
249
+ );
250
+ console.log(warrning);
251
+ }
252
+
253
+ const query_params = {};
254
+
255
+ return PlatformAPIClient.execute(
256
+ this.config,
257
+ "patch",
258
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/announcements/${announcementId}`,
259
+ query_params,
260
+ body
261
+ );
262
+ }
263
+
264
+ /**
265
+ * @param {Object} arg - Arg object.
266
+ * @param {string} arg.announcementId - ID allotted to the announcement.
267
+ * @summary: Delete announcement by id
268
+ * @description: Use this API to delete an existing announcement.
269
+ */
270
+ deleteAnnouncement({ announcementId } = {}) {
271
+ const { error } = ContentValidator.deleteAnnouncement().validate(
272
+ {
273
+ announcementId,
274
+ },
275
+ { abortEarly: false, allowUnknown: true }
276
+ );
277
+ if (error) {
278
+ return Promise.reject(new FDKClientValidationError(error));
279
+ }
280
+
281
+ // Showing warrnings if extra unknown parameters are found
282
+ const { error: warrning } = ContentValidator.deleteAnnouncement().validate(
283
+ {
284
+ announcementId,
285
+ },
286
+ { abortEarly: false, allowUnknown: false }
287
+ );
288
+ if (warrning) {
289
+ console.log("Parameter Validation warrnings for deleteAnnouncement");
290
+ console.log(warrning);
291
+ }
292
+
293
+ const query_params = {};
294
+
295
+ return PlatformAPIClient.execute(
296
+ this.config,
297
+ "delete",
298
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/announcements/${announcementId}`,
299
+ query_params,
300
+ undefined
301
+ );
302
+ }
303
+
304
+ /**
305
+ * @param {Object} arg - Arg object.
306
+ * @param {BlogRequest} arg.body
307
+ * @summary: Create a blog
308
+ * @description: Use this API to create a blog.
309
+ */
310
+ createBlog({ body } = {}) {
311
+ const { error } = ContentValidator.createBlog().validate(
312
+ {
313
+ body,
314
+ },
315
+ { abortEarly: false, allowUnknown: true }
316
+ );
317
+ if (error) {
318
+ return Promise.reject(new FDKClientValidationError(error));
319
+ }
320
+
321
+ // Showing warrnings if extra unknown parameters are found
322
+ const { error: warrning } = ContentValidator.createBlog().validate(
323
+ {
324
+ body,
325
+ },
326
+ { abortEarly: false, allowUnknown: false }
327
+ );
328
+ if (warrning) {
329
+ console.log("Parameter Validation warrnings for createBlog");
330
+ console.log(warrning);
331
+ }
332
+
333
+ const query_params = {};
334
+
335
+ return PlatformAPIClient.execute(
336
+ this.config,
337
+ "post",
338
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/blogs/`,
339
+ query_params,
340
+ body
341
+ );
342
+ }
343
+
344
+ /**
345
+ * @param {Object} arg - Arg object.
346
+ * @param {number} [arg.pageNo] - The page number to navigate through the
347
+ * given set of results. Default value is 1.
348
+ * @param {number} [arg.pageSize] - The number of items to retrieve in each
349
+ * page. Default value is 10.
350
+ * @summary: Get blogs
351
+ * @description: Use this API to get a list of blogs along with their details, such as the title, reading time, publish status, feature image, tags, author, etc.
352
+ */
353
+ getBlogs({ pageNo, pageSize } = {}) {
354
+ const { error } = ContentValidator.getBlogs().validate(
355
+ {
356
+ pageNo,
357
+ pageSize,
358
+ },
359
+ { abortEarly: false, allowUnknown: true }
360
+ );
361
+ if (error) {
362
+ return Promise.reject(new FDKClientValidationError(error));
363
+ }
364
+
365
+ // Showing warrnings if extra unknown parameters are found
366
+ const { error: warrning } = ContentValidator.getBlogs().validate(
367
+ {
368
+ pageNo,
369
+ pageSize,
370
+ },
371
+ { abortEarly: false, allowUnknown: false }
372
+ );
373
+ if (warrning) {
374
+ console.log("Parameter Validation warrnings for getBlogs");
375
+ console.log(warrning);
376
+ }
377
+
378
+ const query_params = {};
379
+ query_params["page_no"] = pageNo;
380
+ query_params["page_size"] = pageSize;
381
+
382
+ return PlatformAPIClient.execute(
383
+ this.config,
384
+ "get",
385
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/blogs/`,
386
+ query_params,
387
+ undefined
388
+ );
389
+ }
390
+
391
+ /**
392
+ * @param {Object} arg - Arg object.
393
+ * @param {string} arg.companyId - Numeric ID allotted to a business account
394
+ * on Fynd Platform
395
+ * @param {string} arg.applicationId - Numeric ID allotted to an application
396
+ * created within a business account.
397
+ * @param {number} [arg.pageSize] - The number of items to retrieve in each
398
+ * page. Default value is 10.
399
+ * @summary: Get blogs
400
+ * @description: Use this API to get a list of blogs along with their details, such as the title, reading time, publish status, feature image, tags, author, etc.
401
+ */
402
+ getBlogsPaginator({ companyId, applicationId, pageSize } = {}) {
403
+ const paginator = new Paginator();
404
+ const callback = async () => {
405
+ const pageId = paginator.nextId;
406
+ const pageNo = paginator.pageNo;
407
+ const pageType = "number";
408
+ const data = await this.getBlogs({
409
+ companyId: companyId,
410
+ applicationId: applicationId,
411
+ pageNo: pageNo,
412
+ pageSize: pageSize,
413
+ });
414
+ paginator.setPaginator({
415
+ hasNext: data.page.has_next ? true : false,
416
+ nextId: data.page.next_id,
417
+ });
418
+ return data;
419
+ };
420
+ paginator.setCallback(callback.bind(this));
421
+ return paginator;
422
+ }
423
+
424
+ /**
425
+ * @param {Object} arg - Arg object.
426
+ * @param {string} arg.id - ID allotted to the blog.
427
+ * @param {BlogRequest} arg.body
428
+ * @summary: Update a blog
429
+ * @description: Use this API to update the details of an existing blog which includes title, feature image, content, SEO details, expiry, etc.
430
+ */
431
+ updateBlog({ id, body } = {}) {
432
+ const { error } = ContentValidator.updateBlog().validate(
433
+ {
434
+ id,
435
+ body,
436
+ },
437
+ { abortEarly: false, allowUnknown: true }
438
+ );
439
+ if (error) {
440
+ return Promise.reject(new FDKClientValidationError(error));
441
+ }
442
+
443
+ // Showing warrnings if extra unknown parameters are found
444
+ const { error: warrning } = ContentValidator.updateBlog().validate(
445
+ {
446
+ id,
447
+ body,
448
+ },
449
+ { abortEarly: false, allowUnknown: false }
450
+ );
451
+ if (warrning) {
452
+ console.log("Parameter Validation warrnings for updateBlog");
453
+ console.log(warrning);
454
+ }
455
+
456
+ const query_params = {};
457
+
458
+ return PlatformAPIClient.execute(
459
+ this.config,
460
+ "put",
461
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/blogs/${id}`,
462
+ query_params,
463
+ body
464
+ );
465
+ }
466
+
467
+ /**
468
+ * @param {Object} arg - Arg object.
469
+ * @param {string} arg.id - ID allotted to the blog.
470
+ * @summary: Delete blogs
471
+ * @description: Use this API to delete a blog.
472
+ */
473
+ deleteBlog({ id } = {}) {
474
+ const { error } = ContentValidator.deleteBlog().validate(
475
+ {
476
+ id,
477
+ },
478
+ { abortEarly: false, allowUnknown: true }
479
+ );
480
+ if (error) {
481
+ return Promise.reject(new FDKClientValidationError(error));
482
+ }
483
+
484
+ // Showing warrnings if extra unknown parameters are found
485
+ const { error: warrning } = ContentValidator.deleteBlog().validate(
486
+ {
487
+ id,
488
+ },
489
+ { abortEarly: false, allowUnknown: false }
490
+ );
491
+ if (warrning) {
492
+ console.log("Parameter Validation warrnings for deleteBlog");
493
+ console.log(warrning);
494
+ }
495
+
496
+ const query_params = {};
497
+
498
+ return PlatformAPIClient.execute(
499
+ this.config,
500
+ "delete",
501
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/blogs/${id}`,
502
+ query_params,
503
+ undefined
504
+ );
505
+ }
506
+
507
+ /**
508
+ * @param {Object} arg - Arg object.
509
+ * @param {string} arg.slug - A short, human-readable, URL-friendly
510
+ * identifier of a blog page. You can get slug value of a blog from `getBlogs` API.
511
+ * @summary: Get components of a blog
512
+ * @description: Use this API to retrieve the components of a blog, such as title, slug, feature image, content, schedule, publish status, author, etc.
513
+ */
514
+ getComponentById({ slug } = {}) {
515
+ const { error } = ContentValidator.getComponentById().validate(
516
+ {
517
+ slug,
518
+ },
519
+ { abortEarly: false, allowUnknown: true }
520
+ );
521
+ if (error) {
522
+ return Promise.reject(new FDKClientValidationError(error));
523
+ }
524
+
525
+ // Showing warrnings if extra unknown parameters are found
526
+ const { error: warrning } = ContentValidator.getComponentById().validate(
527
+ {
528
+ slug,
529
+ },
530
+ { abortEarly: false, allowUnknown: false }
531
+ );
532
+ if (warrning) {
533
+ console.log("Parameter Validation warrnings for getComponentById");
534
+ console.log(warrning);
535
+ }
536
+
537
+ const query_params = {};
538
+
539
+ return PlatformAPIClient.execute(
540
+ this.config,
541
+ "get",
542
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/blogs/${slug}`,
543
+ query_params,
544
+ undefined
545
+ );
546
+ }
547
+
548
+ /**
549
+ * @param {Object} arg - Arg object.
550
+ * @param {DataLoaderSchema} arg.body
551
+ * @summary: Adds a data loader
552
+ * @description: Use this API to add data loader. This includes the data loader name, operationId, service name and its type (url/function) with corresponding value.
553
+ */
554
+ addDataLoader({ body } = {}) {
555
+ const { error } = ContentValidator.addDataLoader().validate(
556
+ {
557
+ body,
558
+ },
559
+ { abortEarly: false, allowUnknown: true }
560
+ );
561
+ if (error) {
562
+ return Promise.reject(new FDKClientValidationError(error));
563
+ }
564
+
565
+ // Showing warrnings if extra unknown parameters are found
566
+ const { error: warrning } = ContentValidator.addDataLoader().validate(
567
+ {
568
+ body,
569
+ },
570
+ { abortEarly: false, allowUnknown: false }
571
+ );
572
+ if (warrning) {
573
+ console.log("Parameter Validation warrnings for addDataLoader");
574
+ console.log(warrning);
575
+ }
576
+
577
+ const query_params = {};
578
+
579
+ return PlatformAPIClient.execute(
580
+ this.config,
581
+ "post",
582
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/data-loader`,
583
+ query_params,
584
+ body
585
+ );
586
+ }
587
+
588
+ /**
589
+ * @param {Object} arg - Arg object.
590
+ * @summary: Get all the data loaders in an application
591
+ * @description: Use this to get all data loaders of an application
592
+ */
593
+ getDataLoaders({} = {}) {
594
+ const { error } = ContentValidator.getDataLoaders().validate(
595
+ {},
596
+ { abortEarly: false, allowUnknown: true }
597
+ );
598
+ if (error) {
599
+ return Promise.reject(new FDKClientValidationError(error));
600
+ }
601
+
602
+ // Showing warrnings if extra unknown parameters are found
603
+ const { error: warrning } = ContentValidator.getDataLoaders().validate(
604
+ {},
605
+ { abortEarly: false, allowUnknown: false }
606
+ );
607
+ if (warrning) {
608
+ console.log("Parameter Validation warrnings for getDataLoaders");
609
+ console.log(warrning);
610
+ }
611
+
612
+ const query_params = {};
613
+
614
+ return PlatformAPIClient.execute(
615
+ this.config,
616
+ "get",
617
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/data-loader`,
618
+ query_params,
619
+ undefined
620
+ );
621
+ }
622
+
623
+ /**
624
+ * @param {Object} arg - Arg object.
625
+ * @param {string} arg.dataLoaderId - ID allotted to the data loader.
626
+ * @summary: Delete data loader in application
627
+ * @description: Use this API to delete data loader.
628
+ */
629
+ deleteDataLoader({ dataLoaderId } = {}) {
630
+ const { error } = ContentValidator.deleteDataLoader().validate(
631
+ {
632
+ dataLoaderId,
633
+ },
634
+ { abortEarly: false, allowUnknown: true }
635
+ );
636
+ if (error) {
637
+ return Promise.reject(new FDKClientValidationError(error));
638
+ }
639
+
640
+ // Showing warrnings if extra unknown parameters are found
641
+ const { error: warrning } = ContentValidator.deleteDataLoader().validate(
642
+ {
643
+ dataLoaderId,
644
+ },
645
+ { abortEarly: false, allowUnknown: false }
646
+ );
647
+ if (warrning) {
648
+ console.log("Parameter Validation warrnings for deleteDataLoader");
649
+ console.log(warrning);
650
+ }
651
+
652
+ const query_params = {};
653
+
654
+ return PlatformAPIClient.execute(
655
+ this.config,
656
+ "delete",
657
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/data-loader/${dataLoaderId}`,
658
+ query_params,
659
+ undefined
660
+ );
661
+ }
662
+
663
+ /**
664
+ * @param {Object} arg - Arg object.
665
+ * @param {string} arg.dataLoaderId - ID allotted to the data loader.
666
+ * @param {DataLoaderSchema} arg.body
667
+ * @summary: Edit a data loader by id
668
+ * @description: Use this API to edit the details of an existing data loader by its ID.
669
+ */
670
+ editDataLoader({ dataLoaderId, body } = {}) {
671
+ const { error } = ContentValidator.editDataLoader().validate(
672
+ {
673
+ dataLoaderId,
674
+ body,
675
+ },
676
+ { abortEarly: false, allowUnknown: true }
677
+ );
678
+ if (error) {
679
+ return Promise.reject(new FDKClientValidationError(error));
680
+ }
681
+
682
+ // Showing warrnings if extra unknown parameters are found
683
+ const { error: warrning } = ContentValidator.editDataLoader().validate(
684
+ {
685
+ dataLoaderId,
686
+ body,
687
+ },
688
+ { abortEarly: false, allowUnknown: false }
689
+ );
690
+ if (warrning) {
691
+ console.log("Parameter Validation warrnings for editDataLoader");
692
+ console.log(warrning);
693
+ }
694
+
695
+ const query_params = {};
696
+
697
+ return PlatformAPIClient.execute(
698
+ this.config,
699
+ "put",
700
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/data-loader/${dataLoaderId}`,
701
+ query_params,
702
+ body
703
+ );
704
+ }
705
+
706
+ /**
707
+ * @param {Object} arg - Arg object.
708
+ * @param {string} arg.dataLoaderId - ID allotted to the data loader.
709
+ * @summary: Select a data loader by id
710
+ * @description: Use this API to select a data loader to be used in applications.
711
+ */
712
+ selectDataLoader({ dataLoaderId } = {}) {
713
+ const { error } = ContentValidator.selectDataLoader().validate(
714
+ {
715
+ dataLoaderId,
716
+ },
717
+ { abortEarly: false, allowUnknown: true }
718
+ );
719
+ if (error) {
720
+ return Promise.reject(new FDKClientValidationError(error));
721
+ }
722
+
723
+ // Showing warrnings if extra unknown parameters are found
724
+ const { error: warrning } = ContentValidator.selectDataLoader().validate(
725
+ {
726
+ dataLoaderId,
727
+ },
728
+ { abortEarly: false, allowUnknown: false }
729
+ );
730
+ if (warrning) {
731
+ console.log("Parameter Validation warrnings for selectDataLoader");
732
+ console.log(warrning);
733
+ }
734
+
735
+ const query_params = {};
736
+
737
+ return PlatformAPIClient.execute(
738
+ this.config,
739
+ "put",
740
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/data-loader/${dataLoaderId}/select`,
741
+ query_params,
742
+ undefined
743
+ );
744
+ }
745
+
746
+ /**
747
+ * @param {Object} arg - Arg object.
748
+ * @param {string} arg.service - Name of service.
749
+ * @param {string} arg.operationId - Name of operation id of the service.
750
+ * @summary: Reset a data loader by serive name and operation Id
751
+ * @description: Use this API to reselect a data loader.
752
+ */
753
+ resetDataLoader({ service, operationId } = {}) {
754
+ const { error } = ContentValidator.resetDataLoader().validate(
755
+ {
756
+ service,
757
+ operationId,
758
+ },
759
+ { abortEarly: false, allowUnknown: true }
760
+ );
761
+ if (error) {
762
+ return Promise.reject(new FDKClientValidationError(error));
763
+ }
764
+
765
+ // Showing warrnings if extra unknown parameters are found
766
+ const { error: warrning } = ContentValidator.resetDataLoader().validate(
767
+ {
768
+ service,
769
+ operationId,
770
+ },
771
+ { abortEarly: false, allowUnknown: false }
772
+ );
773
+ if (warrning) {
774
+ console.log("Parameter Validation warrnings for resetDataLoader");
775
+ console.log(warrning);
776
+ }
777
+
778
+ const query_params = {};
779
+
780
+ return PlatformAPIClient.execute(
781
+ this.config,
782
+ "put",
783
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/data-loader/${service}/${operationId}/reset`,
784
+ query_params,
785
+ undefined
786
+ );
787
+ }
788
+
789
+ /**
790
+ * @param {Object} arg - Arg object.
791
+ * @summary: Get a list of FAQ categories
792
+ * @description: FAQs can be divided into categories. Use this API to get a list of FAQ categories.
793
+ */
794
+ getFaqCategories({} = {}) {
795
+ const { error } = ContentValidator.getFaqCategories().validate(
796
+ {},
797
+ { abortEarly: false, allowUnknown: true }
798
+ );
799
+ if (error) {
800
+ return Promise.reject(new FDKClientValidationError(error));
801
+ }
802
+
803
+ // Showing warrnings if extra unknown parameters are found
804
+ const { error: warrning } = ContentValidator.getFaqCategories().validate(
805
+ {},
806
+ { abortEarly: false, allowUnknown: false }
807
+ );
808
+ if (warrning) {
809
+ console.log("Parameter Validation warrnings for getFaqCategories");
810
+ console.log(warrning);
811
+ }
812
+
813
+ const query_params = {};
814
+
815
+ return PlatformAPIClient.execute(
816
+ this.config,
817
+ "get",
818
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/faq/categories`,
819
+ query_params,
820
+ undefined
821
+ );
822
+ }
823
+
824
+ /**
825
+ * @param {Object} arg - Arg object.
826
+ * @param {string} arg.idOrSlug - ID or the slug allotted to an FAQ
827
+ * category. Slug is a short, human-readable, URL-friendly identifier of
828
+ * an object. You can get slug value of an FAQ category from
829
+ * `getFaqCategories` API.
830
+ * @summary: Get an FAQ category by slug or id
831
+ * @description: FAQs can be divided into categories. Use this API to get an FAQ categories using its slug or ID.
832
+ */
833
+ getFaqCategoryBySlugOrId({ idOrSlug } = {}) {
834
+ const { error } = ContentValidator.getFaqCategoryBySlugOrId().validate(
835
+ {
836
+ idOrSlug,
837
+ },
838
+ { abortEarly: false, allowUnknown: true }
839
+ );
840
+ if (error) {
841
+ return Promise.reject(new FDKClientValidationError(error));
842
+ }
843
+
844
+ // Showing warrnings if extra unknown parameters are found
845
+ const {
846
+ error: warrning,
847
+ } = ContentValidator.getFaqCategoryBySlugOrId().validate(
848
+ {
849
+ idOrSlug,
850
+ },
851
+ { abortEarly: false, allowUnknown: false }
852
+ );
853
+ if (warrning) {
854
+ console.log(
855
+ "Parameter Validation warrnings for getFaqCategoryBySlugOrId"
856
+ );
857
+ console.log(warrning);
858
+ }
859
+
860
+ const query_params = {};
861
+
862
+ return PlatformAPIClient.execute(
863
+ this.config,
864
+ "get",
865
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/faq/category/${idOrSlug}`,
866
+ query_params,
867
+ undefined
868
+ );
869
+ }
870
+
871
+ /**
872
+ * @param {Object} arg - Arg object.
873
+ * @param {CreateFaqCategoryRequestSchema} arg.body
874
+ * @summary: Create an FAQ category
875
+ * @description: FAQs help users to solve an issue or know more about a process. FAQs can be categorized separately, for e.g. some questions can be related to payment, some could be related to purchase, shipping, navigating, etc. Use this API to create an FAQ category.
876
+ */
877
+ createFaqCategory({ body } = {}) {
878
+ const { error } = ContentValidator.createFaqCategory().validate(
879
+ {
880
+ body,
881
+ },
882
+ { abortEarly: false, allowUnknown: true }
883
+ );
884
+ if (error) {
885
+ return Promise.reject(new FDKClientValidationError(error));
886
+ }
887
+
888
+ // Showing warrnings if extra unknown parameters are found
889
+ const { error: warrning } = ContentValidator.createFaqCategory().validate(
890
+ {
891
+ body,
892
+ },
893
+ { abortEarly: false, allowUnknown: false }
894
+ );
895
+ if (warrning) {
896
+ console.log("Parameter Validation warrnings for createFaqCategory");
897
+ console.log(warrning);
898
+ }
899
+
900
+ const query_params = {};
901
+
902
+ return PlatformAPIClient.execute(
903
+ this.config,
904
+ "post",
905
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/faq/category`,
906
+ query_params,
907
+ body
908
+ );
909
+ }
910
+
911
+ /**
912
+ * @param {Object} arg - Arg object.
913
+ * @param {string} arg.id - ID allotted to an FAQ category.
914
+ * @param {UpdateFaqCategoryRequestSchema} arg.body
915
+ * @summary: Update an FAQ category
916
+ * @description: Use this API to edit an existing FAQ category.
917
+ */
918
+ updateFaqCategory({ id, body } = {}) {
919
+ const { error } = ContentValidator.updateFaqCategory().validate(
920
+ {
921
+ id,
922
+ body,
923
+ },
924
+ { abortEarly: false, allowUnknown: true }
925
+ );
926
+ if (error) {
927
+ return Promise.reject(new FDKClientValidationError(error));
928
+ }
929
+
930
+ // Showing warrnings if extra unknown parameters are found
931
+ const { error: warrning } = ContentValidator.updateFaqCategory().validate(
932
+ {
933
+ id,
934
+ body,
935
+ },
936
+ { abortEarly: false, allowUnknown: false }
937
+ );
938
+ if (warrning) {
939
+ console.log("Parameter Validation warrnings for updateFaqCategory");
940
+ console.log(warrning);
941
+ }
942
+
943
+ const query_params = {};
944
+
945
+ return PlatformAPIClient.execute(
946
+ this.config,
947
+ "put",
948
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/faq/category/${id}`,
949
+ query_params,
950
+ body
951
+ );
952
+ }
953
+
954
+ /**
955
+ * @param {Object} arg - Arg object.
956
+ * @param {string} arg.id - ID allotted to an FAQ category.
957
+ * @summary: Delete an FAQ category
958
+ * @description: Use this API to delete an FAQ category.
959
+ */
960
+ deleteFaqCategory({ id } = {}) {
961
+ const { error } = ContentValidator.deleteFaqCategory().validate(
962
+ {
963
+ id,
964
+ },
965
+ { abortEarly: false, allowUnknown: true }
966
+ );
967
+ if (error) {
968
+ return Promise.reject(new FDKClientValidationError(error));
969
+ }
970
+
971
+ // Showing warrnings if extra unknown parameters are found
972
+ const { error: warrning } = ContentValidator.deleteFaqCategory().validate(
973
+ {
974
+ id,
975
+ },
976
+ { abortEarly: false, allowUnknown: false }
977
+ );
978
+ if (warrning) {
979
+ console.log("Parameter Validation warrnings for deleteFaqCategory");
980
+ console.log(warrning);
981
+ }
982
+
983
+ const query_params = {};
984
+
985
+ return PlatformAPIClient.execute(
986
+ this.config,
987
+ "delete",
988
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/faq/category/${id}`,
989
+ query_params,
990
+ undefined
991
+ );
992
+ }
993
+
994
+ /**
995
+ * @param {Object} arg - Arg object.
996
+ * @param {string} arg.idOrSlug - ID or the slug allotted to an FAQ
997
+ * category. Slug is a short, human-readable, URL-friendly identifier of
998
+ * an object. You can get slug value of an FAQ category from
999
+ * `getFaqCategories` API.
1000
+ * @summary: Get question and answers within an FAQ category
1001
+ * @description: Use this API to retrieve all the commonly asked question and answers belonging to an FAQ category.
1002
+ */
1003
+ getFaqsByCategoryIdOrSlug({ idOrSlug } = {}) {
1004
+ const { error } = ContentValidator.getFaqsByCategoryIdOrSlug().validate(
1005
+ {
1006
+ idOrSlug,
1007
+ },
1008
+ { abortEarly: false, allowUnknown: true }
1009
+ );
1010
+ if (error) {
1011
+ return Promise.reject(new FDKClientValidationError(error));
1012
+ }
1013
+
1014
+ // Showing warrnings if extra unknown parameters are found
1015
+ const {
1016
+ error: warrning,
1017
+ } = ContentValidator.getFaqsByCategoryIdOrSlug().validate(
1018
+ {
1019
+ idOrSlug,
1020
+ },
1021
+ { abortEarly: false, allowUnknown: false }
1022
+ );
1023
+ if (warrning) {
1024
+ console.log(
1025
+ "Parameter Validation warrnings for getFaqsByCategoryIdOrSlug"
1026
+ );
1027
+ console.log(warrning);
1028
+ }
1029
+
1030
+ const query_params = {};
1031
+
1032
+ return PlatformAPIClient.execute(
1033
+ this.config,
1034
+ "get",
1035
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/faq/category/${idOrSlug}/faqs`,
1036
+ query_params,
1037
+ undefined
1038
+ );
1039
+ }
1040
+
1041
+ /**
1042
+ * @param {Object} arg - Arg object.
1043
+ * @param {string} arg.categoryId - ID allotted to an FAQ category.
1044
+ * @param {CreateFaqSchema} arg.body
1045
+ * @summary: Create an FAQ
1046
+ * @description: FAQs help users to solve an issue or know more about a process. Use this API to create an FAQ for a given FAQ category.
1047
+ */
1048
+ addFaq({ categoryId, body } = {}) {
1049
+ const { error } = ContentValidator.addFaq().validate(
1050
+ {
1051
+ categoryId,
1052
+ body,
1053
+ },
1054
+ { abortEarly: false, allowUnknown: true }
1055
+ );
1056
+ if (error) {
1057
+ return Promise.reject(new FDKClientValidationError(error));
1058
+ }
1059
+
1060
+ // Showing warrnings if extra unknown parameters are found
1061
+ const { error: warrning } = ContentValidator.addFaq().validate(
1062
+ {
1063
+ categoryId,
1064
+ body,
1065
+ },
1066
+ { abortEarly: false, allowUnknown: false }
1067
+ );
1068
+ if (warrning) {
1069
+ console.log("Parameter Validation warrnings for addFaq");
1070
+ console.log(warrning);
1071
+ }
1072
+
1073
+ const query_params = {};
1074
+
1075
+ return PlatformAPIClient.execute(
1076
+ this.config,
1077
+ "post",
1078
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/faq/category/${categoryId}/faqs`,
1079
+ query_params,
1080
+ body
1081
+ );
1082
+ }
1083
+
1084
+ /**
1085
+ * @param {Object} arg - Arg object.
1086
+ * @param {string} arg.categoryId - ID allotted to an FAQ category.
1087
+ * @param {string} arg.faqId - ID allotted to an FAQ.
1088
+ * @param {CreateFaqSchema} arg.body
1089
+ * @summary: Update an FAQ
1090
+ * @description: Use this API to edit an existing FAQ.
1091
+ */
1092
+ updateFaq({ categoryId, faqId, body } = {}) {
1093
+ const { error } = ContentValidator.updateFaq().validate(
1094
+ {
1095
+ categoryId,
1096
+ faqId,
1097
+ body,
1098
+ },
1099
+ { abortEarly: false, allowUnknown: true }
1100
+ );
1101
+ if (error) {
1102
+ return Promise.reject(new FDKClientValidationError(error));
1103
+ }
1104
+
1105
+ // Showing warrnings if extra unknown parameters are found
1106
+ const { error: warrning } = ContentValidator.updateFaq().validate(
1107
+ {
1108
+ categoryId,
1109
+ faqId,
1110
+ body,
1111
+ },
1112
+ { abortEarly: false, allowUnknown: false }
1113
+ );
1114
+ if (warrning) {
1115
+ console.log("Parameter Validation warrnings for updateFaq");
1116
+ console.log(warrning);
1117
+ }
1118
+
1119
+ const query_params = {};
1120
+
1121
+ return PlatformAPIClient.execute(
1122
+ this.config,
1123
+ "put",
1124
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/faq/category/${categoryId}/faq/${faqId}`,
1125
+ query_params,
1126
+ body
1127
+ );
1128
+ }
1129
+
1130
+ /**
1131
+ * @param {Object} arg - Arg object.
1132
+ * @param {string} arg.categoryId - ID allotted to an FAQ category.
1133
+ * @param {string} arg.faqId - ID allotted to an FAQ.
1134
+ * @summary: Delete an FAQ
1135
+ * @description: Use this API to delete an existing FAQ.
1136
+ */
1137
+ deleteFaq({ categoryId, faqId } = {}) {
1138
+ const { error } = ContentValidator.deleteFaq().validate(
1139
+ {
1140
+ categoryId,
1141
+ faqId,
1142
+ },
1143
+ { abortEarly: false, allowUnknown: true }
1144
+ );
1145
+ if (error) {
1146
+ return Promise.reject(new FDKClientValidationError(error));
1147
+ }
1148
+
1149
+ // Showing warrnings if extra unknown parameters are found
1150
+ const { error: warrning } = ContentValidator.deleteFaq().validate(
1151
+ {
1152
+ categoryId,
1153
+ faqId,
1154
+ },
1155
+ { abortEarly: false, allowUnknown: false }
1156
+ );
1157
+ if (warrning) {
1158
+ console.log("Parameter Validation warrnings for deleteFaq");
1159
+ console.log(warrning);
1160
+ }
1161
+
1162
+ const query_params = {};
1163
+
1164
+ return PlatformAPIClient.execute(
1165
+ this.config,
1166
+ "delete",
1167
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/faq/category/${categoryId}/faq/${faqId}`,
1168
+ query_params,
1169
+ undefined
1170
+ );
1171
+ }
1172
+
1173
+ /**
1174
+ * @param {Object} arg - Arg object.
1175
+ * @param {string} arg.idOrSlug - ID or the slug allotted to an FAQ
1176
+ * category. Slug is a short, human-readable, URL-friendly identifier of
1177
+ * an object. You can get slug value of an FAQ category from
1178
+ * `getFaqCategories` API.
1179
+ * @summary: Get an FAQ
1180
+ * @description: Use this API to retrieve a specific FAQ. You will get the question and answer of that FAQ.
1181
+ */
1182
+ getFaqByIdOrSlug({ idOrSlug } = {}) {
1183
+ const { error } = ContentValidator.getFaqByIdOrSlug().validate(
1184
+ {
1185
+ idOrSlug,
1186
+ },
1187
+ { abortEarly: false, allowUnknown: true }
1188
+ );
1189
+ if (error) {
1190
+ return Promise.reject(new FDKClientValidationError(error));
1191
+ }
1192
+
1193
+ // Showing warrnings if extra unknown parameters are found
1194
+ const { error: warrning } = ContentValidator.getFaqByIdOrSlug().validate(
1195
+ {
1196
+ idOrSlug,
1197
+ },
1198
+ { abortEarly: false, allowUnknown: false }
1199
+ );
1200
+ if (warrning) {
1201
+ console.log("Parameter Validation warrnings for getFaqByIdOrSlug");
1202
+ console.log(warrning);
1203
+ }
1204
+
1205
+ const query_params = {};
1206
+
1207
+ return PlatformAPIClient.execute(
1208
+ this.config,
1209
+ "get",
1210
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/faq/${idOrSlug}`,
1211
+ query_params,
1212
+ undefined
1213
+ );
1214
+ }
1215
+
1216
+ /**
1217
+ * @param {Object} arg - Arg object.
1218
+ * @param {number} [arg.pageNo] - The page number to navigate through the
1219
+ * given set of results. Default value is 1.
1220
+ * @param {number} [arg.pageSize] - The number of items to retrieve in each
1221
+ * page. Default value is 10.
1222
+ * @summary: Get landing pages
1223
+ * @description: Landing page is the first page that a prospect lands upon while visiting a website. Use this API to fetch a list of landing pages.
1224
+ */
1225
+ getLandingPages({ pageNo, pageSize } = {}) {
1226
+ const { error } = ContentValidator.getLandingPages().validate(
1227
+ {
1228
+ pageNo,
1229
+ pageSize,
1230
+ },
1231
+ { abortEarly: false, allowUnknown: true }
1232
+ );
1233
+ if (error) {
1234
+ return Promise.reject(new FDKClientValidationError(error));
1235
+ }
1236
+
1237
+ // Showing warrnings if extra unknown parameters are found
1238
+ const { error: warrning } = ContentValidator.getLandingPages().validate(
1239
+ {
1240
+ pageNo,
1241
+ pageSize,
1242
+ },
1243
+ { abortEarly: false, allowUnknown: false }
1244
+ );
1245
+ if (warrning) {
1246
+ console.log("Parameter Validation warrnings for getLandingPages");
1247
+ console.log(warrning);
1248
+ }
1249
+
1250
+ const query_params = {};
1251
+ query_params["page_no"] = pageNo;
1252
+ query_params["page_size"] = pageSize;
1253
+
1254
+ return PlatformAPIClient.execute(
1255
+ this.config,
1256
+ "get",
1257
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/landing-page/`,
1258
+ query_params,
1259
+ undefined
1260
+ );
1261
+ }
1262
+
1263
+ /**
1264
+ * @param {Object} arg - Arg object.
1265
+ * @param {string} arg.companyId - Numeric ID allotted to a business account
1266
+ * on Fynd Platform
1267
+ * @param {string} arg.applicationId - Numeric ID allotted to an application
1268
+ * created within a business account.
1269
+ * @param {number} [arg.pageSize] - The number of items to retrieve in each
1270
+ * page. Default value is 10.
1271
+ * @summary: Get landing pages
1272
+ * @description: Landing page is the first page that a prospect lands upon while visiting a website. Use this API to fetch a list of landing pages.
1273
+ */
1274
+ getLandingPagesPaginator({ companyId, applicationId, pageSize } = {}) {
1275
+ const paginator = new Paginator();
1276
+ const callback = async () => {
1277
+ const pageId = paginator.nextId;
1278
+ const pageNo = paginator.pageNo;
1279
+ const pageType = "number";
1280
+ const data = await this.getLandingPages({
1281
+ companyId: companyId,
1282
+ applicationId: applicationId,
1283
+ pageNo: pageNo,
1284
+ pageSize: pageSize,
1285
+ });
1286
+ paginator.setPaginator({
1287
+ hasNext: data.page.has_next ? true : false,
1288
+ nextId: data.page.next_id,
1289
+ });
1290
+ return data;
1291
+ };
1292
+ paginator.setCallback(callback.bind(this));
1293
+ return paginator;
1294
+ }
1295
+
1296
+ /**
1297
+ * @param {Object} arg - Arg object.
1298
+ * @param {LandingPageSchema} arg.body
1299
+ * @summary: Create a landing page
1300
+ * @description: Landing page is the first page that a prospect lands upon while visiting a website. Use this API to create a landing page.
1301
+ */
1302
+ createLandingPage({ body } = {}) {
1303
+ const { error } = ContentValidator.createLandingPage().validate(
1304
+ {
1305
+ body,
1306
+ },
1307
+ { abortEarly: false, allowUnknown: true }
1308
+ );
1309
+ if (error) {
1310
+ return Promise.reject(new FDKClientValidationError(error));
1311
+ }
1312
+
1313
+ // Showing warrnings if extra unknown parameters are found
1314
+ const { error: warrning } = ContentValidator.createLandingPage().validate(
1315
+ {
1316
+ body,
1317
+ },
1318
+ { abortEarly: false, allowUnknown: false }
1319
+ );
1320
+ if (warrning) {
1321
+ console.log("Parameter Validation warrnings for createLandingPage");
1322
+ console.log(warrning);
1323
+ }
1324
+
1325
+ const query_params = {};
1326
+
1327
+ return PlatformAPIClient.execute(
1328
+ this.config,
1329
+ "post",
1330
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/landing-page/`,
1331
+ query_params,
1332
+ body
1333
+ );
1334
+ }
1335
+
1336
+ /**
1337
+ * @param {Object} arg - Arg object.
1338
+ * @param {string} arg.id - ID allotted to a landing page.
1339
+ * @param {LandingPageSchema} arg.body
1340
+ * @summary: Update a landing page
1341
+ * @description: Use this API to edit the details of an existing landing page.
1342
+ */
1343
+ updateLandingPage({ id, body } = {}) {
1344
+ const { error } = ContentValidator.updateLandingPage().validate(
1345
+ {
1346
+ id,
1347
+ body,
1348
+ },
1349
+ { abortEarly: false, allowUnknown: true }
1350
+ );
1351
+ if (error) {
1352
+ return Promise.reject(new FDKClientValidationError(error));
1353
+ }
1354
+
1355
+ // Showing warrnings if extra unknown parameters are found
1356
+ const { error: warrning } = ContentValidator.updateLandingPage().validate(
1357
+ {
1358
+ id,
1359
+ body,
1360
+ },
1361
+ { abortEarly: false, allowUnknown: false }
1362
+ );
1363
+ if (warrning) {
1364
+ console.log("Parameter Validation warrnings for updateLandingPage");
1365
+ console.log(warrning);
1366
+ }
1367
+
1368
+ const query_params = {};
1369
+
1370
+ return PlatformAPIClient.execute(
1371
+ this.config,
1372
+ "put",
1373
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/landing-page/${id}`,
1374
+ query_params,
1375
+ body
1376
+ );
1377
+ }
1378
+
1379
+ /**
1380
+ * @param {Object} arg - Arg object.
1381
+ * @param {string} arg.id - ID allotted to a landing page.
1382
+ * @summary: Delete a landing page
1383
+ * @description: Use this API to delete an existing landing page.
1384
+ */
1385
+ deleteLandingPage({ id } = {}) {
1386
+ const { error } = ContentValidator.deleteLandingPage().validate(
1387
+ {
1388
+ id,
1389
+ },
1390
+ { abortEarly: false, allowUnknown: true }
1391
+ );
1392
+ if (error) {
1393
+ return Promise.reject(new FDKClientValidationError(error));
1394
+ }
1395
+
1396
+ // Showing warrnings if extra unknown parameters are found
1397
+ const { error: warrning } = ContentValidator.deleteLandingPage().validate(
1398
+ {
1399
+ id,
1400
+ },
1401
+ { abortEarly: false, allowUnknown: false }
1402
+ );
1403
+ if (warrning) {
1404
+ console.log("Parameter Validation warrnings for deleteLandingPage");
1405
+ console.log(warrning);
1406
+ }
1407
+
1408
+ const query_params = {};
1409
+
1410
+ return PlatformAPIClient.execute(
1411
+ this.config,
1412
+ "delete",
1413
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/landing-page/${id}`,
1414
+ query_params,
1415
+ undefined
1416
+ );
1417
+ }
1418
+
1419
+ /**
1420
+ * @param {Object} arg - Arg object.
1421
+ * @summary: Get legal information
1422
+ * @description: Use this API to get the legal information of an application, which includes Policy, Terms and Conditions, Shipping Policy and FAQ regarding the application.
1423
+ */
1424
+ getLegalInformation({} = {}) {
1425
+ const { error } = ContentValidator.getLegalInformation().validate(
1426
+ {},
1427
+ { abortEarly: false, allowUnknown: true }
1428
+ );
1429
+ if (error) {
1430
+ return Promise.reject(new FDKClientValidationError(error));
1431
+ }
1432
+
1433
+ // Showing warrnings if extra unknown parameters are found
1434
+ const { error: warrning } = ContentValidator.getLegalInformation().validate(
1435
+ {},
1436
+ { abortEarly: false, allowUnknown: false }
1437
+ );
1438
+ if (warrning) {
1439
+ console.log("Parameter Validation warrnings for getLegalInformation");
1440
+ console.log(warrning);
1441
+ }
1442
+
1443
+ const query_params = {};
1444
+
1445
+ return PlatformAPIClient.execute(
1446
+ this.config,
1447
+ "get",
1448
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/legal`,
1449
+ query_params,
1450
+ undefined
1451
+ );
1452
+ }
1453
+
1454
+ /**
1455
+ * @param {Object} arg - Arg object.
1456
+ * @param {ApplicationLegal} arg.body
1457
+ * @summary: Save legal information
1458
+ * @description: Use this API to edit, update and save the legal information of an application, which includes Policy, Terms and Conditions, Shipping Policy and FAQ regarding the application.
1459
+ */
1460
+ updateLegalInformation({ body } = {}) {
1461
+ const { error } = ContentValidator.updateLegalInformation().validate(
1462
+ {
1463
+ body,
1464
+ },
1465
+ { abortEarly: false, allowUnknown: true }
1466
+ );
1467
+ if (error) {
1468
+ return Promise.reject(new FDKClientValidationError(error));
1469
+ }
1470
+
1471
+ // Showing warrnings if extra unknown parameters are found
1472
+ const {
1473
+ error: warrning,
1474
+ } = ContentValidator.updateLegalInformation().validate(
1475
+ {
1476
+ body,
1477
+ },
1478
+ { abortEarly: false, allowUnknown: false }
1479
+ );
1480
+ if (warrning) {
1481
+ console.log("Parameter Validation warrnings for updateLegalInformation");
1482
+ console.log(warrning);
1483
+ }
1484
+
1485
+ const query_params = {};
1486
+
1487
+ return PlatformAPIClient.execute(
1488
+ this.config,
1489
+ "post",
1490
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/legal`,
1491
+ query_params,
1492
+ body
1493
+ );
1494
+ }
1495
+
1496
+ /**
1497
+ * @param {Object} arg - Arg object.
1498
+ * @param {string} arg.devicePlatform - Filter navigations by platform.
1499
+ * Acceptable values are: web, android, ios, all
1500
+ * @param {number} [arg.pageNo] - The page number to navigate through the
1501
+ * given set of results. Default value is 1.
1502
+ * @param {number} [arg.pageSize] - The number of items to retrieve in each
1503
+ * page. Default value is 10.
1504
+ * @summary: Get navigations
1505
+ * @description: Use this API to fetch the navigations details which includes the items of the navigation pane. It also shows the orientation, links, sub-navigations, etc.
1506
+ */
1507
+ getNavigations({ devicePlatform, pageNo, pageSize } = {}) {
1508
+ const { error } = ContentValidator.getNavigations().validate(
1509
+ {
1510
+ devicePlatform,
1511
+ pageNo,
1512
+ pageSize,
1513
+ },
1514
+ { abortEarly: false, allowUnknown: true }
1515
+ );
1516
+ if (error) {
1517
+ return Promise.reject(new FDKClientValidationError(error));
1518
+ }
1519
+
1520
+ // Showing warrnings if extra unknown parameters are found
1521
+ const { error: warrning } = ContentValidator.getNavigations().validate(
1522
+ {
1523
+ devicePlatform,
1524
+ pageNo,
1525
+ pageSize,
1526
+ },
1527
+ { abortEarly: false, allowUnknown: false }
1528
+ );
1529
+ if (warrning) {
1530
+ console.log("Parameter Validation warrnings for getNavigations");
1531
+ console.log(warrning);
1532
+ }
1533
+
1534
+ const query_params = {};
1535
+ query_params["device_platform"] = devicePlatform;
1536
+ query_params["page_no"] = pageNo;
1537
+ query_params["page_size"] = pageSize;
1538
+
1539
+ return PlatformAPIClient.execute(
1540
+ this.config,
1541
+ "get",
1542
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/navigations/`,
1543
+ query_params,
1544
+ undefined
1545
+ );
1546
+ }
1547
+
1548
+ /**
1549
+ * @param {Object} arg - Arg object.
1550
+ * @param {string} arg.companyId - Numeric ID allotted to a business account
1551
+ * on Fynd Platform
1552
+ * @param {string} arg.applicationId - Numeric ID allotted to an application
1553
+ * created within a business account.
1554
+ * @param {string} arg.devicePlatform - Filter navigations by platform.
1555
+ * Acceptable values are: web, android, ios, all
1556
+ * @param {number} [arg.pageSize] - The number of items to retrieve in each
1557
+ * page. Default value is 10.
1558
+ * @summary: Get navigations
1559
+ * @description: Use this API to fetch the navigations details which includes the items of the navigation pane. It also shows the orientation, links, sub-navigations, etc.
1560
+ */
1561
+ getNavigationsPaginator({
1562
+ companyId,
1563
+ applicationId,
1564
+ devicePlatform,
1565
+ pageSize,
1566
+ } = {}) {
1567
+ const paginator = new Paginator();
1568
+ const callback = async () => {
1569
+ const pageId = paginator.nextId;
1570
+ const pageNo = paginator.pageNo;
1571
+ const pageType = "number";
1572
+ const data = await this.getNavigations({
1573
+ companyId: companyId,
1574
+ applicationId: applicationId,
1575
+ devicePlatform: devicePlatform,
1576
+ pageNo: pageNo,
1577
+ pageSize: pageSize,
1578
+ });
1579
+ paginator.setPaginator({
1580
+ hasNext: data.page.has_next ? true : false,
1581
+ nextId: data.page.next_id,
1582
+ });
1583
+ return data;
1584
+ };
1585
+ paginator.setCallback(callback.bind(this));
1586
+ return paginator;
1587
+ }
1588
+
1589
+ /**
1590
+ * @param {Object} arg - Arg object.
1591
+ * @param {NavigationRequest} arg.body
1592
+ * @summary: Create a navigation
1593
+ * @description: Navigation is the arrangement of navigational items to ease the accessibility of resources for users on a website. Use this API to create a navigation.
1594
+ */
1595
+ createNavigation({ body } = {}) {
1596
+ const { error } = ContentValidator.createNavigation().validate(
1597
+ {
1598
+ body,
1599
+ },
1600
+ { abortEarly: false, allowUnknown: true }
1601
+ );
1602
+ if (error) {
1603
+ return Promise.reject(new FDKClientValidationError(error));
1604
+ }
1605
+
1606
+ // Showing warrnings if extra unknown parameters are found
1607
+ const { error: warrning } = ContentValidator.createNavigation().validate(
1608
+ {
1609
+ body,
1610
+ },
1611
+ { abortEarly: false, allowUnknown: false }
1612
+ );
1613
+ if (warrning) {
1614
+ console.log("Parameter Validation warrnings for createNavigation");
1615
+ console.log(warrning);
1616
+ }
1617
+
1618
+ const query_params = {};
1619
+
1620
+ return PlatformAPIClient.execute(
1621
+ this.config,
1622
+ "post",
1623
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/navigations/`,
1624
+ query_params,
1625
+ body
1626
+ );
1627
+ }
1628
+
1629
+ /**
1630
+ * @param {Object} arg - Arg object.
1631
+ * @summary: Get default navigations
1632
+ * @description: On any website (application), there are navigations that are present by default. Use this API to retrieve those default navigations.
1633
+ */
1634
+ getDefaultNavigations({} = {}) {
1635
+ const { error } = ContentValidator.getDefaultNavigations().validate(
1636
+ {},
1637
+ { abortEarly: false, allowUnknown: true }
1638
+ );
1639
+ if (error) {
1640
+ return Promise.reject(new FDKClientValidationError(error));
1641
+ }
1642
+
1643
+ // Showing warrnings if extra unknown parameters are found
1644
+ const {
1645
+ error: warrning,
1646
+ } = ContentValidator.getDefaultNavigations().validate(
1647
+ {},
1648
+ { abortEarly: false, allowUnknown: false }
1649
+ );
1650
+ if (warrning) {
1651
+ console.log("Parameter Validation warrnings for getDefaultNavigations");
1652
+ console.log(warrning);
1653
+ }
1654
+
1655
+ const query_params = {};
1656
+
1657
+ return PlatformAPIClient.execute(
1658
+ this.config,
1659
+ "get",
1660
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/navigations/default`,
1661
+ query_params,
1662
+ undefined
1663
+ );
1664
+ }
1665
+
1666
+ /**
1667
+ * @param {Object} arg - Arg object.
1668
+ * @param {string} arg.slug - A short, human-readable, URL-friendly
1669
+ * identifier of a navigation. You can get slug value of a navigation from
1670
+ * `getNavigations` API.
1671
+ * @param {string} arg.devicePlatform - Filter navigations by platform.
1672
+ * Acceptable values are: web, android, ios, all
1673
+ * @summary: Get a navigation by slug
1674
+ * @description: Use this API to retrieve a navigation by its slug.
1675
+ */
1676
+ getNavigationBySlug({ slug, devicePlatform } = {}) {
1677
+ const { error } = ContentValidator.getNavigationBySlug().validate(
1678
+ {
1679
+ slug,
1680
+ devicePlatform,
1681
+ },
1682
+ { abortEarly: false, allowUnknown: true }
1683
+ );
1684
+ if (error) {
1685
+ return Promise.reject(new FDKClientValidationError(error));
1686
+ }
1687
+
1688
+ // Showing warrnings if extra unknown parameters are found
1689
+ const { error: warrning } = ContentValidator.getNavigationBySlug().validate(
1690
+ {
1691
+ slug,
1692
+ devicePlatform,
1693
+ },
1694
+ { abortEarly: false, allowUnknown: false }
1695
+ );
1696
+ if (warrning) {
1697
+ console.log("Parameter Validation warrnings for getNavigationBySlug");
1698
+ console.log(warrning);
1699
+ }
1700
+
1701
+ const query_params = {};
1702
+ query_params["device_platform"] = devicePlatform;
1703
+
1704
+ return PlatformAPIClient.execute(
1705
+ this.config,
1706
+ "get",
1707
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/navigations/${slug}`,
1708
+ query_params,
1709
+ undefined
1710
+ );
1711
+ }
1712
+
1713
+ /**
1714
+ * @param {Object} arg - Arg object.
1715
+ * @param {string} arg.id - ID allotted to the navigation.
1716
+ * @param {NavigationRequest} arg.body
1717
+ * @summary: Update a navigation
1718
+ * @description: Use this API to edit the details of an existing navigation.
1719
+ */
1720
+ updateNavigation({ id, body } = {}) {
1721
+ const { error } = ContentValidator.updateNavigation().validate(
1722
+ {
1723
+ id,
1724
+ body,
1725
+ },
1726
+ { abortEarly: false, allowUnknown: true }
1727
+ );
1728
+ if (error) {
1729
+ return Promise.reject(new FDKClientValidationError(error));
1730
+ }
1731
+
1732
+ // Showing warrnings if extra unknown parameters are found
1733
+ const { error: warrning } = ContentValidator.updateNavigation().validate(
1734
+ {
1735
+ id,
1736
+ body,
1737
+ },
1738
+ { abortEarly: false, allowUnknown: false }
1739
+ );
1740
+ if (warrning) {
1741
+ console.log("Parameter Validation warrnings for updateNavigation");
1742
+ console.log(warrning);
1743
+ }
1744
+
1745
+ const query_params = {};
1746
+
1747
+ return PlatformAPIClient.execute(
1748
+ this.config,
1749
+ "put",
1750
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/navigations/${id}`,
1751
+ query_params,
1752
+ body
1753
+ );
1754
+ }
1755
+
1756
+ /**
1757
+ * @param {Object} arg - Arg object.
1758
+ * @param {string} arg.id - ID allotted to the navigation.
1759
+ * @summary: Delete a navigation
1760
+ * @description: Use this API to delete an existing navigation.
1761
+ */
1762
+ deleteNavigation({ id } = {}) {
1763
+ const { error } = ContentValidator.deleteNavigation().validate(
1764
+ {
1765
+ id,
1766
+ },
1767
+ { abortEarly: false, allowUnknown: true }
1768
+ );
1769
+ if (error) {
1770
+ return Promise.reject(new FDKClientValidationError(error));
1771
+ }
1772
+
1773
+ // Showing warrnings if extra unknown parameters are found
1774
+ const { error: warrning } = ContentValidator.deleteNavigation().validate(
1775
+ {
1776
+ id,
1777
+ },
1778
+ { abortEarly: false, allowUnknown: false }
1779
+ );
1780
+ if (warrning) {
1781
+ console.log("Parameter Validation warrnings for deleteNavigation");
1782
+ console.log(warrning);
1783
+ }
1784
+
1785
+ const query_params = {};
1786
+
1787
+ return PlatformAPIClient.execute(
1788
+ this.config,
1789
+ "delete",
1790
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/navigations/${id}`,
1791
+ query_params,
1792
+ undefined
1793
+ );
1794
+ }
1795
+
1796
+ /**
1797
+ * @param {Object} arg - Arg object.
1798
+ * @summary: Get page meta
1799
+ * @description: Use this API to get the meta of custom pages (blog, page) and default system pages (e.g. home/brand/category/collection).
1800
+ */
1801
+ getPageMeta({} = {}) {
1802
+ const { error } = ContentValidator.getPageMeta().validate(
1803
+ {},
1804
+ { abortEarly: false, allowUnknown: true }
1805
+ );
1806
+ if (error) {
1807
+ return Promise.reject(new FDKClientValidationError(error));
1808
+ }
1809
+
1810
+ // Showing warrnings if extra unknown parameters are found
1811
+ const { error: warrning } = ContentValidator.getPageMeta().validate(
1812
+ {},
1813
+ { abortEarly: false, allowUnknown: false }
1814
+ );
1815
+ if (warrning) {
1816
+ console.log("Parameter Validation warrnings for getPageMeta");
1817
+ console.log(warrning);
1818
+ }
1819
+
1820
+ const query_params = {};
1821
+
1822
+ return PlatformAPIClient.execute(
1823
+ this.config,
1824
+ "get",
1825
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/pages/meta`,
1826
+ query_params,
1827
+ undefined
1828
+ );
1829
+ }
1830
+
1831
+ /**
1832
+ * @param {Object} arg - Arg object.
1833
+ * @summary: Get page spec
1834
+ * @description: Use this API to get the specifications of a page, such as page type, display name, params and query.
1835
+ */
1836
+ getPageSpec({} = {}) {
1837
+ const { error } = ContentValidator.getPageSpec().validate(
1838
+ {},
1839
+ { abortEarly: false, allowUnknown: true }
1840
+ );
1841
+ if (error) {
1842
+ return Promise.reject(new FDKClientValidationError(error));
1843
+ }
1844
+
1845
+ // Showing warrnings if extra unknown parameters are found
1846
+ const { error: warrning } = ContentValidator.getPageSpec().validate(
1847
+ {},
1848
+ { abortEarly: false, allowUnknown: false }
1849
+ );
1850
+ if (warrning) {
1851
+ console.log("Parameter Validation warrnings for getPageSpec");
1852
+ console.log(warrning);
1853
+ }
1854
+
1855
+ const query_params = {};
1856
+
1857
+ return PlatformAPIClient.execute(
1858
+ this.config,
1859
+ "get",
1860
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/pages/spec`,
1861
+ query_params,
1862
+ undefined
1863
+ );
1864
+ }
1865
+
1866
+ /**
1867
+ * @param {Object} arg - Arg object.
1868
+ * @param {PageRequest} arg.body
1869
+ * @summary: Create a page preview
1870
+ * @description: Use this API to create a page preview to check the appearance of a custom page.
1871
+ */
1872
+ createPagePreview({ body } = {}) {
1873
+ const { error } = ContentValidator.createPagePreview().validate(
1874
+ {
1875
+ body,
1876
+ },
1877
+ { abortEarly: false, allowUnknown: true }
1878
+ );
1879
+ if (error) {
1880
+ return Promise.reject(new FDKClientValidationError(error));
1881
+ }
1882
+
1883
+ // Showing warrnings if extra unknown parameters are found
1884
+ const { error: warrning } = ContentValidator.createPagePreview().validate(
1885
+ {
1886
+ body,
1887
+ },
1888
+ { abortEarly: false, allowUnknown: false }
1889
+ );
1890
+ if (warrning) {
1891
+ console.log("Parameter Validation warrnings for createPagePreview");
1892
+ console.log(warrning);
1893
+ }
1894
+
1895
+ const query_params = {};
1896
+
1897
+ return PlatformAPIClient.execute(
1898
+ this.config,
1899
+ "post",
1900
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/pages/preview/`,
1901
+ query_params,
1902
+ body
1903
+ );
1904
+ }
1905
+
1906
+ /**
1907
+ * @param {Object} arg - Arg object.
1908
+ * @param {string} arg.slug - A short, human-readable, URL-friendly
1909
+ * identifier of a page. You can get slug value of a page from `getPages` API.
1910
+ * @param {PagePublishRequest} arg.body
1911
+ * @summary: Change the publish status of a page
1912
+ * @description: Use this API to change the publish status of an existing page. Allows you to publish and unpublish the page.
1913
+ */
1914
+ updatePagePreview({ slug, body } = {}) {
1915
+ const { error } = ContentValidator.updatePagePreview().validate(
1916
+ {
1917
+ slug,
1918
+ body,
1919
+ },
1920
+ { abortEarly: false, allowUnknown: true }
1921
+ );
1922
+ if (error) {
1923
+ return Promise.reject(new FDKClientValidationError(error));
1924
+ }
1925
+
1926
+ // Showing warrnings if extra unknown parameters are found
1927
+ const { error: warrning } = ContentValidator.updatePagePreview().validate(
1928
+ {
1929
+ slug,
1930
+ body,
1931
+ },
1932
+ { abortEarly: false, allowUnknown: false }
1933
+ );
1934
+ if (warrning) {
1935
+ console.log("Parameter Validation warrnings for updatePagePreview");
1936
+ console.log(warrning);
1937
+ }
1938
+
1939
+ const query_params = {};
1940
+
1941
+ return PlatformAPIClient.execute(
1942
+ this.config,
1943
+ "put",
1944
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/pages/publish/${slug}`,
1945
+ query_params,
1946
+ body
1947
+ );
1948
+ }
1949
+
1950
+ /**
1951
+ * @param {Object} arg - Arg object.
1952
+ * @param {string} arg.id - ID allotted to the page.
1953
+ * @summary: Delete a page
1954
+ * @description: Use this API to delete an existing page.
1955
+ */
1956
+ deletePage({ id } = {}) {
1957
+ const { error } = ContentValidator.deletePage().validate(
1958
+ {
1959
+ id,
1960
+ },
1961
+ { abortEarly: false, allowUnknown: true }
1962
+ );
1963
+ if (error) {
1964
+ return Promise.reject(new FDKClientValidationError(error));
1965
+ }
1966
+
1967
+ // Showing warrnings if extra unknown parameters are found
1968
+ const { error: warrning } = ContentValidator.deletePage().validate(
1969
+ {
1970
+ id,
1971
+ },
1972
+ { abortEarly: false, allowUnknown: false }
1973
+ );
1974
+ if (warrning) {
1975
+ console.log("Parameter Validation warrnings for deletePage");
1976
+ console.log(warrning);
1977
+ }
1978
+
1979
+ const query_params = {};
1980
+
1981
+ return PlatformAPIClient.execute(
1982
+ this.config,
1983
+ "delete",
1984
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/pages/${id}`,
1985
+ query_params,
1986
+ undefined
1987
+ );
1988
+ }
1989
+
1990
+ /**
1991
+ * @param {Object} arg - Arg object.
1992
+ * @param {PathMappingSchema} arg.body
1993
+ * @summary: Save path based redirection rules
1994
+ * @description: Use this API to add redirection rules
1995
+ */
1996
+ addPathRedirectionRules({ body } = {}) {
1997
+ const { error } = ContentValidator.addPathRedirectionRules().validate(
1998
+ {
1999
+ body,
2000
+ },
2001
+ { abortEarly: false, allowUnknown: true }
2002
+ );
2003
+ if (error) {
2004
+ return Promise.reject(new FDKClientValidationError(error));
2005
+ }
2006
+
2007
+ // Showing warrnings if extra unknown parameters are found
2008
+ const {
2009
+ error: warrning,
2010
+ } = ContentValidator.addPathRedirectionRules().validate(
2011
+ {
2012
+ body,
2013
+ },
2014
+ { abortEarly: false, allowUnknown: false }
2015
+ );
2016
+ if (warrning) {
2017
+ console.log("Parameter Validation warrnings for addPathRedirectionRules");
2018
+ console.log(warrning);
2019
+ }
2020
+
2021
+ const query_params = {};
2022
+
2023
+ return PlatformAPIClient.execute(
2024
+ this.config,
2025
+ "post",
2026
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/path-mappings`,
2027
+ query_params,
2028
+ body
2029
+ );
2030
+ }
2031
+
2032
+ /**
2033
+ * @param {Object} arg - Arg object.
2034
+ * @param {number} [arg.pageSize] - The number of items to retrieve in each
2035
+ * page. Default value is 5.
2036
+ * @param {number} [arg.pageNo] - The page number to navigate through the
2037
+ * given set of results. Default value is 1.
2038
+ * @summary: Get path based redirection rules
2039
+ * @description: Use this API to get path based redirection rules.
2040
+ */
2041
+ getPathRedirectionRules({ pageSize, pageNo } = {}) {
2042
+ const { error } = ContentValidator.getPathRedirectionRules().validate(
2043
+ {
2044
+ pageSize,
2045
+ pageNo,
2046
+ },
2047
+ { abortEarly: false, allowUnknown: true }
2048
+ );
2049
+ if (error) {
2050
+ return Promise.reject(new FDKClientValidationError(error));
2051
+ }
2052
+
2053
+ // Showing warrnings if extra unknown parameters are found
2054
+ const {
2055
+ error: warrning,
2056
+ } = ContentValidator.getPathRedirectionRules().validate(
2057
+ {
2058
+ pageSize,
2059
+ pageNo,
2060
+ },
2061
+ { abortEarly: false, allowUnknown: false }
2062
+ );
2063
+ if (warrning) {
2064
+ console.log("Parameter Validation warrnings for getPathRedirectionRules");
2065
+ console.log(warrning);
2066
+ }
2067
+
2068
+ const query_params = {};
2069
+ query_params["page_size"] = pageSize;
2070
+ query_params["page_no"] = pageNo;
2071
+
2072
+ return PlatformAPIClient.execute(
2073
+ this.config,
2074
+ "get",
2075
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/path-mappings`,
2076
+ query_params,
2077
+ undefined
2078
+ );
2079
+ }
2080
+
2081
+ /**
2082
+ * @param {Object} arg - Arg object.
2083
+ * @param {string} arg.pathId - ID allotted to the path redirection rule.
2084
+ * @summary: Get path based redirection rule
2085
+ * @description: Use this API to get path based redirection rule.
2086
+ */
2087
+ getPathRedirectionRule({ pathId } = {}) {
2088
+ const { error } = ContentValidator.getPathRedirectionRule().validate(
2089
+ {
2090
+ pathId,
2091
+ },
2092
+ { abortEarly: false, allowUnknown: true }
2093
+ );
2094
+ if (error) {
2095
+ return Promise.reject(new FDKClientValidationError(error));
2096
+ }
2097
+
2098
+ // Showing warrnings if extra unknown parameters are found
2099
+ const {
2100
+ error: warrning,
2101
+ } = ContentValidator.getPathRedirectionRule().validate(
2102
+ {
2103
+ pathId,
2104
+ },
2105
+ { abortEarly: false, allowUnknown: false }
2106
+ );
2107
+ if (warrning) {
2108
+ console.log("Parameter Validation warrnings for getPathRedirectionRule");
2109
+ console.log(warrning);
2110
+ }
2111
+
2112
+ const query_params = {};
2113
+
2114
+ return PlatformAPIClient.execute(
2115
+ this.config,
2116
+ "get",
2117
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/path-mappings/${pathId}`,
2118
+ query_params,
2119
+ undefined
2120
+ );
2121
+ }
2122
+
2123
+ /**
2124
+ * @param {Object} arg - Arg object.
2125
+ * @param {string} arg.pathId - ID allotted to the path redirection rule.
2126
+ * @param {PathMappingSchema} arg.body
2127
+ * @summary: Update path based redirection rules
2128
+ * @description: Use this API to update redirection rules
2129
+ */
2130
+ updatePathRedirectionRules({ pathId, body } = {}) {
2131
+ const { error } = ContentValidator.updatePathRedirectionRules().validate(
2132
+ {
2133
+ pathId,
2134
+ body,
2135
+ },
2136
+ { abortEarly: false, allowUnknown: true }
2137
+ );
2138
+ if (error) {
2139
+ return Promise.reject(new FDKClientValidationError(error));
2140
+ }
2141
+
2142
+ // Showing warrnings if extra unknown parameters are found
2143
+ const {
2144
+ error: warrning,
2145
+ } = ContentValidator.updatePathRedirectionRules().validate(
2146
+ {
2147
+ pathId,
2148
+ body,
2149
+ },
2150
+ { abortEarly: false, allowUnknown: false }
2151
+ );
2152
+ if (warrning) {
2153
+ console.log(
2154
+ "Parameter Validation warrnings for updatePathRedirectionRules"
2155
+ );
2156
+ console.log(warrning);
2157
+ }
2158
+
2159
+ const query_params = {};
2160
+
2161
+ return PlatformAPIClient.execute(
2162
+ this.config,
2163
+ "put",
2164
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/path-mappings/${pathId}`,
2165
+ query_params,
2166
+ body
2167
+ );
2168
+ }
2169
+
2170
+ /**
2171
+ * @param {Object} arg - Arg object.
2172
+ * @param {string} arg.pathId - ID allotted to the path redirection rule.
2173
+ * @summary: Delete path based redirection rules
2174
+ * @description: Use this API to delete redirection rules
2175
+ */
2176
+ deletePathRedirectionRules({ pathId } = {}) {
2177
+ const { error } = ContentValidator.deletePathRedirectionRules().validate(
2178
+ {
2179
+ pathId,
2180
+ },
2181
+ { abortEarly: false, allowUnknown: true }
2182
+ );
2183
+ if (error) {
2184
+ return Promise.reject(new FDKClientValidationError(error));
2185
+ }
2186
+
2187
+ // Showing warrnings if extra unknown parameters are found
2188
+ const {
2189
+ error: warrning,
2190
+ } = ContentValidator.deletePathRedirectionRules().validate(
2191
+ {
2192
+ pathId,
2193
+ },
2194
+ { abortEarly: false, allowUnknown: false }
2195
+ );
2196
+ if (warrning) {
2197
+ console.log(
2198
+ "Parameter Validation warrnings for deletePathRedirectionRules"
2199
+ );
2200
+ console.log(warrning);
2201
+ }
2202
+
2203
+ const query_params = {};
2204
+
2205
+ return PlatformAPIClient.execute(
2206
+ this.config,
2207
+ "delete",
2208
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/path-mappings/${pathId}`,
2209
+ query_params,
2210
+ undefined
2211
+ );
2212
+ }
2213
+
2214
+ /**
2215
+ * @param {Object} arg - Arg object.
2216
+ * @summary: Get SEO configuration of an application
2217
+ * @description: Use this API to know how the SEO is configured in the application. This includes the sitemap, robot.txt, custom meta tags, etc.
2218
+ */
2219
+ getSEOConfiguration({} = {}) {
2220
+ const { error } = ContentValidator.getSEOConfiguration().validate(
2221
+ {},
2222
+ { abortEarly: false, allowUnknown: true }
2223
+ );
2224
+ if (error) {
2225
+ return Promise.reject(new FDKClientValidationError(error));
2226
+ }
2227
+
2228
+ // Showing warrnings if extra unknown parameters are found
2229
+ const { error: warrning } = ContentValidator.getSEOConfiguration().validate(
2230
+ {},
2231
+ { abortEarly: false, allowUnknown: false }
2232
+ );
2233
+ if (warrning) {
2234
+ console.log("Parameter Validation warrnings for getSEOConfiguration");
2235
+ console.log(warrning);
2236
+ }
2237
+
2238
+ const query_params = {};
2239
+
2240
+ return PlatformAPIClient.execute(
2241
+ this.config,
2242
+ "get",
2243
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/seo`,
2244
+ query_params,
2245
+ undefined
2246
+ );
2247
+ }
2248
+
2249
+ /**
2250
+ * @param {Object} arg - Arg object.
2251
+ * @param {SeoComponent} arg.body
2252
+ * @summary: Update SEO of application
2253
+ * @description: Use this API to edit the SEO details of an application. This includes the sitemap, robot.txt, custom meta tags, etc.
2254
+ */
2255
+ updateSEOConfiguration({ body } = {}) {
2256
+ const { error } = ContentValidator.updateSEOConfiguration().validate(
2257
+ {
2258
+ body,
2259
+ },
2260
+ { abortEarly: false, allowUnknown: true }
2261
+ );
2262
+ if (error) {
2263
+ return Promise.reject(new FDKClientValidationError(error));
2264
+ }
2265
+
2266
+ // Showing warrnings if extra unknown parameters are found
2267
+ const {
2268
+ error: warrning,
2269
+ } = ContentValidator.updateSEOConfiguration().validate(
2270
+ {
2271
+ body,
2272
+ },
2273
+ { abortEarly: false, allowUnknown: false }
2274
+ );
2275
+ if (warrning) {
2276
+ console.log("Parameter Validation warrnings for updateSEOConfiguration");
2277
+ console.log(warrning);
2278
+ }
2279
+
2280
+ const query_params = {};
2281
+
2282
+ return PlatformAPIClient.execute(
2283
+ this.config,
2284
+ "post",
2285
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/seo`,
2286
+ query_params,
2287
+ body
2288
+ );
2289
+ }
2290
+
2291
+ /**
2292
+ * @param {Object} arg - Arg object.
2293
+ * @param {string} arg.devicePlatform - Filter slideshows by platform.
2294
+ * Acceptable values are: web, android, ios and all
2295
+ * @param {number} [arg.pageNo] - The page number to navigate through the
2296
+ * given set of results. Default value is 1.
2297
+ * @param {number} [arg.pageSize] - The number of items to retrieve in each
2298
+ * page. Default value is 10.
2299
+ * @summary: Get slideshows
2300
+ * @description: A slideshow is a group of images, videos or a combination of both that are shown on the website in the form of slides. Use this API to fetch a list of slideshows.
2301
+ */
2302
+ getSlideshows({ devicePlatform, pageNo, pageSize } = {}) {
2303
+ const { error } = ContentValidator.getSlideshows().validate(
2304
+ {
2305
+ devicePlatform,
2306
+ pageNo,
2307
+ pageSize,
2308
+ },
2309
+ { abortEarly: false, allowUnknown: true }
2310
+ );
2311
+ if (error) {
2312
+ return Promise.reject(new FDKClientValidationError(error));
2313
+ }
2314
+
2315
+ // Showing warrnings if extra unknown parameters are found
2316
+ const { error: warrning } = ContentValidator.getSlideshows().validate(
2317
+ {
2318
+ devicePlatform,
2319
+ pageNo,
2320
+ pageSize,
2321
+ },
2322
+ { abortEarly: false, allowUnknown: false }
2323
+ );
2324
+ if (warrning) {
2325
+ console.log("Parameter Validation warrnings for getSlideshows");
2326
+ console.log(warrning);
2327
+ }
2328
+
2329
+ const query_params = {};
2330
+ query_params["device_platform"] = devicePlatform;
2331
+ query_params["page_no"] = pageNo;
2332
+ query_params["page_size"] = pageSize;
2333
+
2334
+ return PlatformAPIClient.execute(
2335
+ this.config,
2336
+ "get",
2337
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/slideshows/`,
2338
+ query_params,
2339
+ undefined
2340
+ );
2341
+ }
2342
+
2343
+ /**
2344
+ * @param {Object} arg - Arg object.
2345
+ * @param {string} arg.companyId - Numeric ID allotted to a business account
2346
+ * on Fynd Platform
2347
+ * @param {string} arg.applicationId - Numeric ID allotted to an application
2348
+ * created within a business account.
2349
+ * @param {string} arg.devicePlatform - Filter slideshows by platform.
2350
+ * Acceptable values are: web, android, ios and all
2351
+ * @param {number} [arg.pageSize] - The number of items to retrieve in each
2352
+ * page. Default value is 10.
2353
+ * @summary: Get slideshows
2354
+ * @description: A slideshow is a group of images, videos or a combination of both that are shown on the website in the form of slides. Use this API to fetch a list of slideshows.
2355
+ */
2356
+ getSlideshowsPaginator({
2357
+ companyId,
2358
+ applicationId,
2359
+ devicePlatform,
2360
+ pageSize,
2361
+ } = {}) {
2362
+ const paginator = new Paginator();
2363
+ const callback = async () => {
2364
+ const pageId = paginator.nextId;
2365
+ const pageNo = paginator.pageNo;
2366
+ const pageType = "number";
2367
+ const data = await this.getSlideshows({
2368
+ companyId: companyId,
2369
+ applicationId: applicationId,
2370
+ devicePlatform: devicePlatform,
2371
+ pageNo: pageNo,
2372
+ pageSize: pageSize,
2373
+ });
2374
+ paginator.setPaginator({
2375
+ hasNext: data.page.has_next ? true : false,
2376
+ nextId: data.page.next_id,
2377
+ });
2378
+ return data;
2379
+ };
2380
+ paginator.setCallback(callback.bind(this));
2381
+ return paginator;
2382
+ }
2383
+
2384
+ /**
2385
+ * @param {Object} arg - Arg object.
2386
+ * @param {SlideshowRequest} arg.body
2387
+ * @summary: Create a slideshow
2388
+ * @description: A slideshow is a group of images, videos or a combination of both that are shown on the website in the form of slides. Use this API to create a slideshow.
2389
+ */
2390
+ createSlideshow({ body } = {}) {
2391
+ const { error } = ContentValidator.createSlideshow().validate(
2392
+ {
2393
+ body,
2394
+ },
2395
+ { abortEarly: false, allowUnknown: true }
2396
+ );
2397
+ if (error) {
2398
+ return Promise.reject(new FDKClientValidationError(error));
2399
+ }
2400
+
2401
+ // Showing warrnings if extra unknown parameters are found
2402
+ const { error: warrning } = ContentValidator.createSlideshow().validate(
2403
+ {
2404
+ body,
2405
+ },
2406
+ { abortEarly: false, allowUnknown: false }
2407
+ );
2408
+ if (warrning) {
2409
+ console.log("Parameter Validation warrnings for createSlideshow");
2410
+ console.log(warrning);
2411
+ }
2412
+
2413
+ const query_params = {};
2414
+
2415
+ return PlatformAPIClient.execute(
2416
+ this.config,
2417
+ "post",
2418
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/slideshows/`,
2419
+ query_params,
2420
+ body
2421
+ );
2422
+ }
2423
+
2424
+ /**
2425
+ * @param {Object} arg - Arg object.
2426
+ * @param {string} arg.slug - A short, human-readable, URL-friendly
2427
+ * identifier of a slideshow. You can get slug value of a page from
2428
+ * `getSlideshows` API.
2429
+ * @param {string} arg.devicePlatform - Filter slideshows by platform.
2430
+ * Acceptable values are: web, android, ios and all
2431
+ * @summary: Get slideshow by slug
2432
+ * @description: Use this API to retrieve the details of a slideshow by its slug.
2433
+ */
2434
+ getSlideshowBySlug({ slug, devicePlatform } = {}) {
2435
+ const { error } = ContentValidator.getSlideshowBySlug().validate(
2436
+ {
2437
+ slug,
2438
+ devicePlatform,
2439
+ },
2440
+ { abortEarly: false, allowUnknown: true }
2441
+ );
2442
+ if (error) {
2443
+ return Promise.reject(new FDKClientValidationError(error));
2444
+ }
2445
+
2446
+ // Showing warrnings if extra unknown parameters are found
2447
+ const { error: warrning } = ContentValidator.getSlideshowBySlug().validate(
2448
+ {
2449
+ slug,
2450
+ devicePlatform,
2451
+ },
2452
+ { abortEarly: false, allowUnknown: false }
2453
+ );
2454
+ if (warrning) {
2455
+ console.log("Parameter Validation warrnings for getSlideshowBySlug");
2456
+ console.log(warrning);
2457
+ }
2458
+
2459
+ const query_params = {};
2460
+ query_params["device_platform"] = devicePlatform;
2461
+
2462
+ return PlatformAPIClient.execute(
2463
+ this.config,
2464
+ "get",
2465
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/slideshows/${slug}`,
2466
+ query_params,
2467
+ undefined
2468
+ );
2469
+ }
2470
+
2471
+ /**
2472
+ * @param {Object} arg - Arg object.
2473
+ * @param {string} arg.id - ID allotted to the slideshow.
2474
+ * @param {SlideshowRequest} arg.body
2475
+ * @summary: Update a slideshow
2476
+ * @description: Use this API to edit the details of an existing slideshow.
2477
+ */
2478
+ updateSlideshow({ id, body } = {}) {
2479
+ const { error } = ContentValidator.updateSlideshow().validate(
2480
+ {
2481
+ id,
2482
+ body,
2483
+ },
2484
+ { abortEarly: false, allowUnknown: true }
2485
+ );
2486
+ if (error) {
2487
+ return Promise.reject(new FDKClientValidationError(error));
2488
+ }
2489
+
2490
+ // Showing warrnings if extra unknown parameters are found
2491
+ const { error: warrning } = ContentValidator.updateSlideshow().validate(
2492
+ {
2493
+ id,
2494
+ body,
2495
+ },
2496
+ { abortEarly: false, allowUnknown: false }
2497
+ );
2498
+ if (warrning) {
2499
+ console.log("Parameter Validation warrnings for updateSlideshow");
2500
+ console.log(warrning);
2501
+ }
2502
+
2503
+ const query_params = {};
2504
+
2505
+ return PlatformAPIClient.execute(
2506
+ this.config,
2507
+ "put",
2508
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/slideshows/${id}`,
2509
+ query_params,
2510
+ body
2511
+ );
2512
+ }
2513
+
2514
+ /**
2515
+ * @param {Object} arg - Arg object.
2516
+ * @param {string} arg.id - ID allotted to the slideshow.
2517
+ * @summary: Delete a slideshow
2518
+ * @description: Use this API to delete an existing slideshow.
2519
+ */
2520
+ deleteSlideshow({ id } = {}) {
2521
+ const { error } = ContentValidator.deleteSlideshow().validate(
2522
+ {
2523
+ id,
2524
+ },
2525
+ { abortEarly: false, allowUnknown: true }
2526
+ );
2527
+ if (error) {
2528
+ return Promise.reject(new FDKClientValidationError(error));
2529
+ }
2530
+
2531
+ // Showing warrnings if extra unknown parameters are found
2532
+ const { error: warrning } = ContentValidator.deleteSlideshow().validate(
2533
+ {
2534
+ id,
2535
+ },
2536
+ { abortEarly: false, allowUnknown: false }
2537
+ );
2538
+ if (warrning) {
2539
+ console.log("Parameter Validation warrnings for deleteSlideshow");
2540
+ console.log(warrning);
2541
+ }
2542
+
2543
+ const query_params = {};
2544
+
2545
+ return PlatformAPIClient.execute(
2546
+ this.config,
2547
+ "delete",
2548
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/slideshows/${id}`,
2549
+ query_params,
2550
+ undefined
2551
+ );
2552
+ }
2553
+
2554
+ /**
2555
+ * @param {Object} arg - Arg object.
2556
+ * @summary: Get support information
2557
+ * @description: Use this API to get the contact details for customer support, including emails and phone numbers.
2558
+ */
2559
+ getSupportInformation({} = {}) {
2560
+ const { error } = ContentValidator.getSupportInformation().validate(
2561
+ {},
2562
+ { abortEarly: false, allowUnknown: true }
2563
+ );
2564
+ if (error) {
2565
+ return Promise.reject(new FDKClientValidationError(error));
2566
+ }
2567
+
2568
+ // Showing warrnings if extra unknown parameters are found
2569
+ const {
2570
+ error: warrning,
2571
+ } = ContentValidator.getSupportInformation().validate(
2572
+ {},
2573
+ { abortEarly: false, allowUnknown: false }
2574
+ );
2575
+ if (warrning) {
2576
+ console.log("Parameter Validation warrnings for getSupportInformation");
2577
+ console.log(warrning);
2578
+ }
2579
+
2580
+ const query_params = {};
2581
+
2582
+ return PlatformAPIClient.execute(
2583
+ this.config,
2584
+ "get",
2585
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/support`,
2586
+ query_params,
2587
+ undefined
2588
+ );
2589
+ }
2590
+
2591
+ /**
2592
+ * @param {Object} arg - Arg object.
2593
+ * @param {Support} arg.body
2594
+ * @summary: Update the support data of an application
2595
+ * @description: Use this API to edit the existing contact details for customer support, including emails and phone numbers.
2596
+ */
2597
+ updateSupportInformation({ body } = {}) {
2598
+ const { error } = ContentValidator.updateSupportInformation().validate(
2599
+ {
2600
+ body,
2601
+ },
2602
+ { abortEarly: false, allowUnknown: true }
2603
+ );
2604
+ if (error) {
2605
+ return Promise.reject(new FDKClientValidationError(error));
2606
+ }
2607
+
2608
+ // Showing warrnings if extra unknown parameters are found
2609
+ const {
2610
+ error: warrning,
2611
+ } = ContentValidator.updateSupportInformation().validate(
2612
+ {
2613
+ body,
2614
+ },
2615
+ { abortEarly: false, allowUnknown: false }
2616
+ );
2617
+ if (warrning) {
2618
+ console.log(
2619
+ "Parameter Validation warrnings for updateSupportInformation"
2620
+ );
2621
+ console.log(warrning);
2622
+ }
2623
+
2624
+ const query_params = {};
2625
+
2626
+ return PlatformAPIClient.execute(
2627
+ this.config,
2628
+ "post",
2629
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/support`,
2630
+ query_params,
2631
+ body
2632
+ );
2633
+ }
2634
+
2635
+ /**
2636
+ * @param {Object} arg - Arg object.
2637
+ * @param {CreateTagRequestSchema} arg.body
2638
+ * @summary: Update a tag
2639
+ * @description: Use this API to edit the details of an existing tag. This includes the tag name, tag type (css/js), url and position of the tag.
2640
+ */
2641
+ updateInjectableTag({ body } = {}) {
2642
+ const { error } = ContentValidator.updateInjectableTag().validate(
2643
+ {
2644
+ body,
2645
+ },
2646
+ { abortEarly: false, allowUnknown: true }
2647
+ );
2648
+ if (error) {
2649
+ return Promise.reject(new FDKClientValidationError(error));
2650
+ }
2651
+
2652
+ // Showing warrnings if extra unknown parameters are found
2653
+ const { error: warrning } = ContentValidator.updateInjectableTag().validate(
2654
+ {
2655
+ body,
2656
+ },
2657
+ { abortEarly: false, allowUnknown: false }
2658
+ );
2659
+ if (warrning) {
2660
+ console.log("Parameter Validation warrnings for updateInjectableTag");
2661
+ console.log(warrning);
2662
+ }
2663
+
2664
+ const query_params = {};
2665
+
2666
+ return PlatformAPIClient.execute(
2667
+ this.config,
2668
+ "put",
2669
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/tags`,
2670
+ query_params,
2671
+ body
2672
+ );
2673
+ }
2674
+
2675
+ /**
2676
+ * @param {Object} arg - Arg object.
2677
+ * @summary: Delete tags in application
2678
+ * @description: Use this API to delete all the existing tags at once.
2679
+ */
2680
+ deleteAllInjectableTags({} = {}) {
2681
+ const { error } = ContentValidator.deleteAllInjectableTags().validate(
2682
+ {},
2683
+ { abortEarly: false, allowUnknown: true }
2684
+ );
2685
+ if (error) {
2686
+ return Promise.reject(new FDKClientValidationError(error));
2687
+ }
2688
+
2689
+ // Showing warrnings if extra unknown parameters are found
2690
+ const {
2691
+ error: warrning,
2692
+ } = ContentValidator.deleteAllInjectableTags().validate(
2693
+ {},
2694
+ { abortEarly: false, allowUnknown: false }
2695
+ );
2696
+ if (warrning) {
2697
+ console.log("Parameter Validation warrnings for deleteAllInjectableTags");
2698
+ console.log(warrning);
2699
+ }
2700
+
2701
+ const query_params = {};
2702
+
2703
+ return PlatformAPIClient.execute(
2704
+ this.config,
2705
+ "delete",
2706
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/tags`,
2707
+ query_params,
2708
+ undefined
2709
+ );
2710
+ }
2711
+
2712
+ /**
2713
+ * @param {Object} arg - Arg object.
2714
+ * @summary: Get all the tags in an application
2715
+ * @description: Use this API to get all the CSS and JS injected in the application in the form of tags.
2716
+ */
2717
+ getInjectableTags({} = {}) {
2718
+ const { error } = ContentValidator.getInjectableTags().validate(
2719
+ {},
2720
+ { abortEarly: false, allowUnknown: true }
2721
+ );
2722
+ if (error) {
2723
+ return Promise.reject(new FDKClientValidationError(error));
2724
+ }
2725
+
2726
+ // Showing warrnings if extra unknown parameters are found
2727
+ const { error: warrning } = ContentValidator.getInjectableTags().validate(
2728
+ {},
2729
+ { abortEarly: false, allowUnknown: false }
2730
+ );
2731
+ if (warrning) {
2732
+ console.log("Parameter Validation warrnings for getInjectableTags");
2733
+ console.log(warrning);
2734
+ }
2735
+
2736
+ const query_params = {};
2737
+
2738
+ return PlatformAPIClient.execute(
2739
+ this.config,
2740
+ "get",
2741
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/tags`,
2742
+ query_params,
2743
+ undefined
2744
+ );
2745
+ }
2746
+
2747
+ /**
2748
+ * @param {Object} arg - Arg object.
2749
+ * @param {CreateTagRequestSchema} arg.body
2750
+ * @summary: Add a tag
2751
+ * @description: CSS and JS can be injected in the application (website) with the help of tags. Use this API to create such tags by entering the tag name, tag type (css/js), url and position of the tag.
2752
+ */
2753
+ addInjectableTag({ body } = {}) {
2754
+ const { error } = ContentValidator.addInjectableTag().validate(
2755
+ {
2756
+ body,
2757
+ },
2758
+ { abortEarly: false, allowUnknown: true }
2759
+ );
2760
+ if (error) {
2761
+ return Promise.reject(new FDKClientValidationError(error));
2762
+ }
2763
+
2764
+ // Showing warrnings if extra unknown parameters are found
2765
+ const { error: warrning } = ContentValidator.addInjectableTag().validate(
2766
+ {
2767
+ body,
2768
+ },
2769
+ { abortEarly: false, allowUnknown: false }
2770
+ );
2771
+ if (warrning) {
2772
+ console.log("Parameter Validation warrnings for addInjectableTag");
2773
+ console.log(warrning);
2774
+ }
2775
+
2776
+ const query_params = {};
2777
+
2778
+ return PlatformAPIClient.execute(
2779
+ this.config,
2780
+ "put",
2781
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/tags/add`,
2782
+ query_params,
2783
+ body
2784
+ );
2785
+ }
2786
+
2787
+ /**
2788
+ * @param {Object} arg - Arg object.
2789
+ * @param {RemoveHandpickedSchema} arg.body
2790
+ * @summary: Remove a tag
2791
+ * @description: Use this API to delete an existing tag.
2792
+ */
2793
+ removeInjectableTag({ body } = {}) {
2794
+ const { error } = ContentValidator.removeInjectableTag().validate(
2795
+ {
2796
+ body,
2797
+ },
2798
+ { abortEarly: false, allowUnknown: true }
2799
+ );
2800
+ if (error) {
2801
+ return Promise.reject(new FDKClientValidationError(error));
2802
+ }
2803
+
2804
+ // Showing warrnings if extra unknown parameters are found
2805
+ const { error: warrning } = ContentValidator.removeInjectableTag().validate(
2806
+ {
2807
+ body,
2808
+ },
2809
+ { abortEarly: false, allowUnknown: false }
2810
+ );
2811
+ if (warrning) {
2812
+ console.log("Parameter Validation warrnings for removeInjectableTag");
2813
+ console.log(warrning);
2814
+ }
2815
+
2816
+ const query_params = {};
2817
+
2818
+ return PlatformAPIClient.execute(
2819
+ this.config,
2820
+ "put",
2821
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/tags/remove/handpicked`,
2822
+ query_params,
2823
+ body
2824
+ );
2825
+ }
2826
+
2827
+ /**
2828
+ * @param {Object} arg - Arg object.
2829
+ * @param {string} arg.tagId - ID allotted to the tag.
2830
+ * @param {UpdateHandpickedSchema} arg.body
2831
+ * @summary: Edit a tag by id
2832
+ * @description: Use this API to edit the details of an existing tag by its ID.
2833
+ */
2834
+ editInjectableTag({ tagId, body } = {}) {
2835
+ const { error } = ContentValidator.editInjectableTag().validate(
2836
+ {
2837
+ tagId,
2838
+ body,
2839
+ },
2840
+ { abortEarly: false, allowUnknown: true }
2841
+ );
2842
+ if (error) {
2843
+ return Promise.reject(new FDKClientValidationError(error));
2844
+ }
2845
+
2846
+ // Showing warrnings if extra unknown parameters are found
2847
+ const { error: warrning } = ContentValidator.editInjectableTag().validate(
2848
+ {
2849
+ tagId,
2850
+ body,
2851
+ },
2852
+ { abortEarly: false, allowUnknown: false }
2853
+ );
2854
+ if (warrning) {
2855
+ console.log("Parameter Validation warrnings for editInjectableTag");
2856
+ console.log(warrning);
2857
+ }
2858
+
2859
+ const query_params = {};
2860
+
2861
+ return PlatformAPIClient.execute(
2862
+ this.config,
2863
+ "put",
2864
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/tags/edit/handpicked/${tagId}`,
2865
+ query_params,
2866
+ body
2867
+ );
2868
+ }
2869
+
2870
+ /**
2871
+ * @param {Object} arg - Arg object.
2872
+ * @param {PageRequest} arg.body
2873
+ * @summary: Create a page
2874
+ * @description: Use this API to create a custom page using a title, seo, publish status, feature image, tags, meta, etc.
2875
+ */
2876
+ createPage({ body } = {}) {
2877
+ const { error } = ContentValidator.createPage().validate(
2878
+ {
2879
+ body,
2880
+ },
2881
+ { abortEarly: false, allowUnknown: true }
2882
+ );
2883
+ if (error) {
2884
+ return Promise.reject(new FDKClientValidationError(error));
2885
+ }
2886
+
2887
+ // Showing warrnings if extra unknown parameters are found
2888
+ const { error: warrning } = ContentValidator.createPage().validate(
2889
+ {
2890
+ body,
2891
+ },
2892
+ { abortEarly: false, allowUnknown: false }
2893
+ );
2894
+ if (warrning) {
2895
+ console.log("Parameter Validation warrnings for createPage");
2896
+ console.log(warrning);
2897
+ }
2898
+
2899
+ const query_params = {};
2900
+
2901
+ return PlatformAPIClient.execute(
2902
+ this.config,
2903
+ "post",
2904
+ `/service/platform/content/v2.0/company/${this.config.companyId}/application/${this.applicationId}/pages/`,
2905
+ query_params,
2906
+ body
2907
+ );
2908
+ }
2909
+
2910
+ /**
2911
+ * @param {Object} arg - Arg object.
2912
+ * @param {number} [arg.pageNo] - The page number to navigate through the
2913
+ * given set of results. Default value is 1.
2914
+ * @param {number} [arg.pageSize] - The number of items to retrieve in each
2915
+ * page. Default value is 10.
2916
+ * @summary: Get a list of pages
2917
+ * @description: Use this API to retrieve a list of pages.
2918
+ */
2919
+ getPages({ pageNo, pageSize } = {}) {
2920
+ const { error } = ContentValidator.getPages().validate(
2921
+ {
2922
+ pageNo,
2923
+ pageSize,
2924
+ },
2925
+ { abortEarly: false, allowUnknown: true }
2926
+ );
2927
+ if (error) {
2928
+ return Promise.reject(new FDKClientValidationError(error));
2929
+ }
2930
+
2931
+ // Showing warrnings if extra unknown parameters are found
2932
+ const { error: warrning } = ContentValidator.getPages().validate(
2933
+ {
2934
+ pageNo,
2935
+ pageSize,
2936
+ },
2937
+ { abortEarly: false, allowUnknown: false }
2938
+ );
2939
+ if (warrning) {
2940
+ console.log("Parameter Validation warrnings for getPages");
2941
+ console.log(warrning);
2942
+ }
2943
+
2944
+ const query_params = {};
2945
+ query_params["page_no"] = pageNo;
2946
+ query_params["page_size"] = pageSize;
2947
+
2948
+ return PlatformAPIClient.execute(
2949
+ this.config,
2950
+ "get",
2951
+ `/service/platform/content/v2.0/company/${this.config.companyId}/application/${this.applicationId}/pages/`,
2952
+ query_params,
2953
+ undefined
2954
+ );
2955
+ }
2956
+
2957
+ /**
2958
+ * @param {Object} arg - Arg object.
2959
+ * @param {string} arg.companyId - Numeric ID allotted to a business account
2960
+ * on Fynd Platform
2961
+ * @param {string} arg.applicationId - Numeric ID allotted to an application
2962
+ * created within a business account.
2963
+ * @param {number} [arg.pageSize] - The number of items to retrieve in each
2964
+ * page. Default value is 10.
2965
+ * @summary: Get a list of pages
2966
+ * @description: Use this API to retrieve a list of pages.
2967
+ */
2968
+ getPagesPaginator({ companyId, applicationId, pageSize } = {}) {
2969
+ const paginator = new Paginator();
2970
+ const callback = async () => {
2971
+ const pageId = paginator.nextId;
2972
+ const pageNo = paginator.pageNo;
2973
+ const pageType = "number";
2974
+ const data = await this.getPages({
2975
+ companyId: companyId,
2976
+ applicationId: applicationId,
2977
+ pageNo: pageNo,
2978
+ pageSize: pageSize,
2979
+ });
2980
+ paginator.setPaginator({
2981
+ hasNext: data.page.has_next ? true : false,
2982
+ nextId: data.page.next_id,
2983
+ });
2984
+ return data;
2985
+ };
2986
+ paginator.setCallback(callback.bind(this));
2987
+ return paginator;
2988
+ }
2989
+
2990
+ /**
2991
+ * @param {Object} arg - Arg object.
2992
+ * @param {string} arg.id - ID allotted to the page.
2993
+ * @param {PageSchema} arg.body
2994
+ * @summary: Update a page
2995
+ * @description: Use this API to edit the details of an existing page, such as its title, seo, publish status, feature image, tags, schedule, etc.
2996
+ */
2997
+ updatePage({ id, body } = {}) {
2998
+ const { error } = ContentValidator.updatePage().validate(
2999
+ {
3000
+ id,
3001
+ body,
3002
+ },
3003
+ { abortEarly: false, allowUnknown: true }
3004
+ );
3005
+ if (error) {
3006
+ return Promise.reject(new FDKClientValidationError(error));
3007
+ }
3008
+
3009
+ // Showing warrnings if extra unknown parameters are found
3010
+ const { error: warrning } = ContentValidator.updatePage().validate(
3011
+ {
3012
+ id,
3013
+ body,
3014
+ },
3015
+ { abortEarly: false, allowUnknown: false }
3016
+ );
3017
+ if (warrning) {
3018
+ console.log("Parameter Validation warrnings for updatePage");
3019
+ console.log(warrning);
3020
+ }
3021
+
3022
+ const query_params = {};
3023
+
3024
+ return PlatformAPIClient.execute(
3025
+ this.config,
3026
+ "put",
3027
+ `/service/platform/content/v2.0/company/${this.config.companyId}/application/${this.applicationId}/pages/${id}`,
3028
+ query_params,
3029
+ body
3030
+ );
3031
+ }
3032
+
3033
+ /**
3034
+ * @param {Object} arg - Arg object.
3035
+ * @param {string} arg.slug - A short, human-readable, URL-friendly
3036
+ * identifier of a page. You can get slug value of a page from `getPages` API.
3037
+ * @summary: Get pages by component Id
3038
+ * @description: Use this API to retrieve the components of a page, such as its title, seo, publish status, feature image, tags, schedule, etc.
3039
+ */
3040
+ getPageBySlug({ slug } = {}) {
3041
+ const { error } = ContentValidator.getPageBySlug().validate(
3042
+ {
3043
+ slug,
3044
+ },
3045
+ { abortEarly: false, allowUnknown: true }
3046
+ );
3047
+ if (error) {
3048
+ return Promise.reject(new FDKClientValidationError(error));
3049
+ }
3050
+
3051
+ // Showing warrnings if extra unknown parameters are found
3052
+ const { error: warrning } = ContentValidator.getPageBySlug().validate(
3053
+ {
3054
+ slug,
3055
+ },
3056
+ { abortEarly: false, allowUnknown: false }
3057
+ );
3058
+ if (warrning) {
3059
+ console.log("Parameter Validation warrnings for getPageBySlug");
3060
+ console.log(warrning);
3061
+ }
3062
+
3063
+ const query_params = {};
3064
+
3065
+ return PlatformAPIClient.execute(
3066
+ this.config,
3067
+ "get",
3068
+ `/service/platform/content/v2.0/company/${this.config.companyId}/application/${this.applicationId}/pages/${slug}`,
3069
+ query_params,
3070
+ undefined
3071
+ );
3072
+ }
3073
+ }
3074
+ module.exports = Content;