@gofynd/fdk-client-javascript 0.1.36 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (357) 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 +313 -281
  5. package/documentation/application/CATALOG.md +458 -435
  6. package/documentation/application/FILESTORAGE.md +2 -0
  7. package/documentation/application/LEAD.md +18 -18
  8. package/documentation/application/LOGISTIC.md +424 -102
  9. package/documentation/application/ORDER.md +293 -293
  10. package/documentation/application/PAYMENT.md +278 -278
  11. package/documentation/application/POSCART.md +350 -318
  12. package/documentation/application/README.md +1 -1
  13. package/documentation/application/REWARDS.md +1 -0
  14. package/documentation/application/USER.md +19 -14
  15. package/documentation/platform/AUDITTRAIL.md +2 -2
  16. package/documentation/platform/CART.md +442 -439
  17. package/documentation/platform/CATALOG.md +2925 -2641
  18. package/documentation/platform/COMPANYPROFILE.md +228 -369
  19. package/documentation/platform/DISCOUNT.md +86 -0
  20. package/documentation/platform/FILESTORAGE.md +2 -0
  21. package/documentation/platform/LEAD.md +60 -60
  22. package/documentation/platform/ORDER.md +1296 -1618
  23. package/documentation/platform/PAYMENT.md +89 -89
  24. package/documentation/platform/REWARDS.md +145 -0
  25. package/documentation/platform/USER.md +24 -14
  26. package/index.d.ts +4 -1
  27. package/index.js +6 -3
  28. package/package.json +9 -9
  29. package/platform.d.ts +2 -1
  30. package/platform.js +3 -2
  31. package/public.d.ts +1 -0
  32. package/public.js +3 -2
  33. package/sdk/application/ApplicationAPIClient.js +6 -1
  34. package/sdk/application/ApplicationClient.d.ts +17 -16
  35. package/sdk/application/ApplicationClient.js +43 -17
  36. package/sdk/application/ApplicationConfig.d.ts +1 -0
  37. package/sdk/application/ApplicationConfig.js +4 -2
  38. package/sdk/application/ApplicationModels.d.ts +0 -827
  39. package/sdk/application/ApplicationModels.js +6 -10486
  40. package/sdk/application/{client → Cart}/CartApplicationClient.d.ts +9 -3
  41. package/sdk/application/{client → Cart}/CartApplicationClient.js +14 -8
  42. package/sdk/application/Cart/CartApplicationModel.d.ts +81 -0
  43. package/sdk/application/Cart/CartApplicationModel.js +1136 -0
  44. package/sdk/application/{models/CartValidator.js → Cart/CartApplicationValidator.js} +16 -12
  45. package/sdk/application/{client → Catalog}/CatalogApplicationClient.d.ts +8 -5
  46. package/sdk/application/{client → Catalog}/CatalogApplicationClient.js +11 -8
  47. package/sdk/application/Catalog/CatalogApplicationModel.d.ts +117 -0
  48. package/sdk/application/Catalog/CatalogApplicationModel.js +1606 -0
  49. package/sdk/application/{models/CatalogValidator.js → Catalog/CatalogApplicationValidator.js} +3 -1
  50. package/sdk/application/{client → Common}/CommonApplicationClient.js +2 -2
  51. package/sdk/application/Common/CommonApplicationModel.d.ts +20 -0
  52. package/sdk/application/Common/CommonApplicationModel.js +228 -0
  53. package/sdk/{platform/models/CommonValidator.js → application/Common/CommonApplicationValidator.js} +2 -1
  54. package/sdk/application/{client → Communication}/CommunicationApplicationClient.js +2 -2
  55. package/sdk/application/Communication/CommunicationApplicationModel.d.ts +15 -0
  56. package/sdk/application/Communication/CommunicationApplicationModel.js +144 -0
  57. package/sdk/application/{models/CommunicationValidator.js → Communication/CommunicationApplicationValidator.js} +4 -3
  58. package/sdk/application/{client → Configuration}/ConfigurationApplicationClient.js +2 -2
  59. package/sdk/application/Configuration/ConfigurationApplicationModel.d.ts +111 -0
  60. package/sdk/application/Configuration/ConfigurationApplicationModel.js +1182 -0
  61. package/sdk/application/{models/ConfigurationValidator.js → Configuration/ConfigurationApplicationValidator.js} +3 -2
  62. package/sdk/application/{client → Content}/ContentApplicationClient.js +2 -2
  63. package/sdk/application/Content/ContentApplicationModel.d.ts +105 -0
  64. package/sdk/application/Content/ContentApplicationModel.js +1349 -0
  65. package/sdk/application/{models/ContentValidator.js → Content/ContentApplicationValidator.js} +2 -1
  66. package/sdk/application/{client → FileStorage}/FileStorageApplicationClient.js +2 -2
  67. package/sdk/application/FileStorage/FileStorageApplicationModel.d.ts +21 -0
  68. package/sdk/application/FileStorage/FileStorageApplicationModel.js +244 -0
  69. package/sdk/application/{models/FileStorageValidator.js → FileStorage/FileStorageApplicationValidator.js} +5 -4
  70. package/sdk/application/{client → Lead}/LeadApplicationClient.js +2 -2
  71. package/sdk/application/Lead/LeadApplicationModel.d.ts +55 -0
  72. package/sdk/application/Lead/LeadApplicationModel.js +690 -0
  73. package/sdk/application/{models/LeadValidator.js → Lead/LeadApplicationValidator.js} +5 -4
  74. package/sdk/application/Logistic/LogisticApplicationClient.d.ts +53 -0
  75. package/sdk/application/{client → Logistic}/LogisticApplicationClient.js +64 -29
  76. package/sdk/application/Logistic/LogisticApplicationModel.d.ts +26 -0
  77. package/sdk/application/Logistic/LogisticApplicationModel.js +286 -0
  78. package/sdk/application/{models/LogisticValidator.d.ts → Logistic/LogisticApplicationValidator.d.ts} +2 -1
  79. package/sdk/application/{models/LogisticValidator.js → Logistic/LogisticApplicationValidator.js} +13 -7
  80. package/sdk/application/{client → Order}/OrderApplicationClient.js +2 -2
  81. package/sdk/application/Order/OrderApplicationModel.d.ts +67 -0
  82. package/sdk/application/Order/OrderApplicationModel.js +872 -0
  83. package/sdk/application/{models/OrderValidator.js → Order/OrderApplicationValidator.js} +4 -3
  84. package/sdk/application/{client → Payment}/PaymentApplicationClient.js +2 -2
  85. package/sdk/application/Payment/PaymentApplicationModel.d.ts +96 -0
  86. package/sdk/application/Payment/PaymentApplicationModel.js +1318 -0
  87. package/sdk/application/{models/PaymentValidator.js → Payment/PaymentApplicationValidator.js} +24 -23
  88. package/sdk/application/{client → PosCart}/PosCartApplicationClient.d.ts +9 -3
  89. package/sdk/application/{client → PosCart}/PosCartApplicationClient.js +14 -8
  90. package/sdk/application/PosCart/PosCartApplicationModel.d.ts +79 -0
  91. package/sdk/application/PosCart/PosCartApplicationModel.js +1132 -0
  92. package/sdk/application/{models/PosCartValidator.js → PosCart/PosCartApplicationValidator.js} +17 -13
  93. package/sdk/application/{client → Rewards}/RewardsApplicationClient.js +2 -2
  94. package/sdk/application/Rewards/RewardsApplicationModel.d.ts +23 -0
  95. package/sdk/application/Rewards/RewardsApplicationModel.js +276 -0
  96. package/sdk/application/{models/RewardsValidator.js → Rewards/RewardsApplicationValidator.js} +5 -4
  97. package/sdk/application/{client → Share}/ShareApplicationClient.js +2 -2
  98. package/sdk/application/Share/ShareApplicationModel.d.ts +16 -0
  99. package/sdk/application/Share/ShareApplicationModel.js +178 -0
  100. package/sdk/application/{models/ShareValidator.js → Share/ShareApplicationValidator.js} +3 -2
  101. package/sdk/application/{client → Theme}/ThemeApplicationClient.js +2 -2
  102. package/sdk/application/Theme/ThemeApplicationModel.d.ts +49 -0
  103. package/sdk/application/Theme/ThemeApplicationModel.js +486 -0
  104. package/sdk/application/{models/ThemeValidator.js → Theme/ThemeApplicationValidator.js} +2 -1
  105. package/sdk/application/{client → User}/UserApplicationClient.js +2 -2
  106. package/sdk/application/User/UserApplicationModel.d.ts +95 -0
  107. package/sdk/application/User/UserApplicationModel.js +998 -0
  108. package/sdk/application/{models/UserValidator.js → User/UserApplicationValidator.js} +30 -29
  109. package/sdk/application/index.d.ts +18 -0
  110. package/sdk/application/index.js +33 -0
  111. package/sdk/common/AxiosHelper.js +23 -10
  112. package/sdk/common/Logger.d.ts +2 -0
  113. package/sdk/common/Logger.js +6 -0
  114. package/sdk/common/curlHelper.d.ts +2 -0
  115. package/sdk/common/curlHelper.js +95 -0
  116. package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.d.ts +101 -0
  117. package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.js +285 -0
  118. package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.d.ts +11 -0
  119. package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.js +56 -0
  120. package/sdk/platform/{client → Analytics}/AnalyticsPlatformClient.js +2 -2
  121. package/sdk/platform/Analytics/AnalyticsPlatformModel.d.ts +23 -0
  122. package/sdk/platform/Analytics/AnalyticsPlatformModel.js +252 -0
  123. package/sdk/platform/{models/AnalyticsValidator.js → Analytics/AnalyticsPlatformValidator.js} +5 -4
  124. package/sdk/platform/{client → AuditTrail}/AuditTrailPlatformClient.js +2 -2
  125. package/sdk/platform/AuditTrail/AuditTrailPlatformModel.d.ts +18 -0
  126. package/sdk/platform/AuditTrail/AuditTrailPlatformModel.js +144 -0
  127. package/sdk/platform/{models/AuditTrailValidator.js → AuditTrail/AuditTrailPlatformValidator.js} +3 -2
  128. package/sdk/platform/{client → Billing}/BillingPlatformClient.js +2 -2
  129. package/sdk/platform/Billing/BillingPlatformModel.d.ts +65 -0
  130. package/sdk/platform/Billing/BillingPlatformModel.js +906 -0
  131. package/sdk/platform/{models/BillingValidator.js → Billing/BillingPlatformValidator.js} +6 -5
  132. package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +293 -0
  133. package/sdk/platform/Cart/CartPlatformApplicationClient.js +755 -0
  134. package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +20 -0
  135. package/sdk/platform/Cart/CartPlatformApplicationValidator.js +138 -0
  136. package/sdk/platform/Cart/CartPlatformModel.d.ts +104 -0
  137. package/sdk/platform/Cart/CartPlatformModel.js +1516 -0
  138. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +856 -0
  139. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +2136 -0
  140. package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +56 -0
  141. package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +389 -0
  142. package/sdk/platform/{client → Catalog}/CatalogPlatformClient.d.ts +132 -123
  143. package/sdk/platform/{client → Catalog}/CatalogPlatformClient.js +354 -323
  144. package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +316 -0
  145. package/sdk/platform/Catalog/CatalogPlatformModel.js +4690 -0
  146. package/sdk/platform/{models/CatalogValidator.d.ts → Catalog/CatalogPlatformValidator.d.ts} +15 -14
  147. package/sdk/platform/{models/CatalogValidator.js → Catalog/CatalogPlatformValidator.js} +91 -84
  148. package/sdk/platform/{client → Common}/CommonPlatformClient.js +2 -2
  149. package/sdk/platform/Common/CommonPlatformModel.d.ts +20 -0
  150. package/sdk/platform/Common/CommonPlatformModel.js +228 -0
  151. package/sdk/{application/models/CommonValidator.js → platform/Common/CommonPlatformValidator.js} +2 -1
  152. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +611 -0
  153. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +1656 -0
  154. package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.d.ts +43 -0
  155. package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.js +277 -0
  156. package/sdk/platform/{client → Communication}/CommunicationPlatformClient.js +2 -2
  157. package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +102 -0
  158. package/sdk/platform/Communication/CommunicationPlatformModel.js +1312 -0
  159. package/sdk/platform/{models/CommunicationValidator.js → Communication/CommunicationPlatformValidator.js} +2 -1
  160. package/sdk/platform/{client → CompanyProfile}/CompanyProfilePlatformClient.d.ts +0 -9
  161. package/sdk/platform/{client → CompanyProfile}/CompanyProfilePlatformClient.js +2 -33
  162. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +44 -0
  163. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +706 -0
  164. package/sdk/platform/{models/CompanyProfileValidator.d.ts → CompanyProfile/CompanyProfilePlatformValidator.d.ts} +0 -1
  165. package/sdk/platform/{models/CompanyProfileValidator.js → CompanyProfile/CompanyProfilePlatformValidator.js} +9 -14
  166. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +309 -0
  167. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +940 -0
  168. package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.d.ts +31 -0
  169. package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.js +164 -0
  170. package/sdk/platform/{client → Configuration}/ConfigurationPlatformClient.js +2 -2
  171. package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +185 -0
  172. package/sdk/platform/Configuration/ConfigurationPlatformModel.js +2072 -0
  173. package/sdk/platform/{models/ConfigurationValidator.js → Configuration/ConfigurationPlatformValidator.js} +9 -8
  174. package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +781 -0
  175. package/sdk/platform/Content/ContentPlatformApplicationClient.js +2208 -0
  176. package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +71 -0
  177. package/sdk/platform/Content/ContentPlatformApplicationValidator.js +422 -0
  178. package/sdk/platform/Content/ContentPlatformModel.d.ts +105 -0
  179. package/sdk/platform/Content/ContentPlatformModel.js +1349 -0
  180. package/sdk/platform/{client → Discount}/DiscountPlatformClient.d.ts +11 -0
  181. package/sdk/platform/{client → Discount}/DiscountPlatformClient.js +35 -2
  182. package/sdk/platform/Discount/DiscountPlatformModel.d.ts +15 -0
  183. package/sdk/platform/Discount/DiscountPlatformModel.js +176 -0
  184. package/sdk/platform/{models/DiscountValidator.d.ts → Discount/DiscountPlatformValidator.d.ts} +1 -0
  185. package/sdk/platform/{models/DiscountValidator.js → Discount/DiscountPlatformValidator.js} +13 -5
  186. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +114 -0
  187. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +247 -0
  188. package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.d.ts +7 -0
  189. package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.js +38 -0
  190. package/sdk/platform/{client → FileStorage}/FileStoragePlatformClient.js +2 -2
  191. package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +21 -0
  192. package/sdk/platform/FileStorage/FileStoragePlatformModel.js +244 -0
  193. package/sdk/platform/{models/FileStorageValidator.js → FileStorage/FileStoragePlatformValidator.js} +6 -5
  194. package/sdk/platform/{client → Inventory}/InventoryPlatformClient.js +2 -2
  195. package/sdk/platform/Inventory/InventoryPlatformModel.d.ts +62 -0
  196. package/sdk/platform/Inventory/InventoryPlatformModel.js +1178 -0
  197. package/sdk/platform/{models/InventoryValidator.js → Inventory/InventoryPlatformValidator.js} +5 -4
  198. package/sdk/platform/Lead/LeadPlatformApplicationClient.d.ts +138 -0
  199. package/sdk/platform/Lead/LeadPlatformApplicationClient.js +397 -0
  200. package/sdk/platform/Lead/LeadPlatformApplicationValidator.d.ts +16 -0
  201. package/sdk/platform/Lead/LeadPlatformApplicationValidator.js +90 -0
  202. package/sdk/platform/{client → Lead}/LeadPlatformClient.js +2 -2
  203. package/sdk/platform/Lead/LeadPlatformModel.d.ts +55 -0
  204. package/sdk/platform/Lead/LeadPlatformModel.js +690 -0
  205. package/sdk/platform/{models/LeadValidator.js → Lead/LeadPlatformValidator.js} +7 -6
  206. package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +59 -0
  207. package/sdk/platform/Order/OrderPlatformApplicationClient.js +152 -0
  208. package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +6 -0
  209. package/sdk/platform/Order/OrderPlatformApplicationValidator.js +37 -0
  210. package/sdk/platform/{client → Order}/OrderPlatformClient.d.ts +9 -49
  211. package/sdk/platform/{client → Order}/OrderPlatformClient.js +18 -130
  212. package/sdk/platform/Order/OrderPlatformModel.d.ts +215 -0
  213. package/sdk/platform/Order/OrderPlatformModel.js +3530 -0
  214. package/sdk/platform/{models/OrderValidator.d.ts → Order/OrderPlatformValidator.d.ts} +0 -2
  215. package/sdk/platform/{models/OrderValidator.js → Order/OrderPlatformValidator.js} +22 -44
  216. package/sdk/platform/Partner/PartnerPlatformApplicationClient.d.ts +30 -0
  217. package/sdk/platform/Partner/PartnerPlatformApplicationClient.js +74 -0
  218. package/sdk/platform/Partner/PartnerPlatformApplicationValidator.d.ts +5 -0
  219. package/sdk/platform/Partner/PartnerPlatformApplicationValidator.js +20 -0
  220. package/sdk/platform/Partner/PartnerPlatformModel.d.ts +7 -0
  221. package/sdk/platform/Partner/PartnerPlatformModel.js +54 -0
  222. package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +108 -0
  223. package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +333 -0
  224. package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +14 -0
  225. package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +73 -0
  226. package/sdk/platform/{client → Payment}/PaymentPlatformClient.js +2 -2
  227. package/sdk/platform/Payment/PaymentPlatformModel.d.ts +44 -0
  228. package/sdk/platform/Payment/PaymentPlatformModel.js +552 -0
  229. package/sdk/platform/{models/PaymentValidator.js → Payment/PaymentPlatformValidator.js} +6 -5
  230. package/sdk/platform/PlatformAPIClient.js +2 -1
  231. package/sdk/platform/PlatformApplicationClient.d.ts +2884 -18377
  232. package/sdk/platform/PlatformApplicationClient.js +3750 -13814
  233. package/sdk/platform/PlatformClient.d.ts +2898 -2861
  234. package/sdk/platform/PlatformClient.js +3714 -3057
  235. package/sdk/platform/PlatformConfig.js +2 -1
  236. package/sdk/platform/Rewards/RewardsPlatformApplicationClient.d.ts +150 -0
  237. package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +428 -0
  238. package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.d.ts +16 -0
  239. package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.js +91 -0
  240. package/sdk/platform/Rewards/RewardsPlatformModel.d.ts +24 -0
  241. package/sdk/platform/Rewards/RewardsPlatformModel.js +294 -0
  242. package/sdk/platform/Share/SharePlatformApplicationClient.d.ts +72 -0
  243. package/sdk/platform/Share/SharePlatformApplicationClient.js +182 -0
  244. package/sdk/platform/Share/SharePlatformApplicationValidator.d.ts +7 -0
  245. package/sdk/platform/Share/SharePlatformApplicationValidator.js +35 -0
  246. package/sdk/platform/Share/SharePlatformModel.d.ts +15 -0
  247. package/sdk/platform/Share/SharePlatformModel.js +170 -0
  248. package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +238 -0
  249. package/sdk/platform/Theme/ThemePlatformApplicationClient.js +704 -0
  250. package/sdk/platform/Theme/ThemePlatformApplicationValidator.d.ts +27 -0
  251. package/sdk/platform/Theme/ThemePlatformApplicationValidator.js +155 -0
  252. package/sdk/platform/Theme/ThemePlatformModel.d.ts +49 -0
  253. package/sdk/platform/Theme/ThemePlatformModel.js +486 -0
  254. package/sdk/platform/User/UserPlatformApplicationClient.d.ts +121 -0
  255. package/sdk/platform/User/UserPlatformApplicationClient.js +361 -0
  256. package/sdk/platform/User/UserPlatformApplicationValidator.d.ts +15 -0
  257. package/sdk/platform/User/UserPlatformApplicationValidator.js +79 -0
  258. package/sdk/platform/User/UserPlatformModel.d.ts +95 -0
  259. package/sdk/platform/User/UserPlatformModel.js +998 -0
  260. package/sdk/platform/{client → Webhook}/WebhookPlatformClient.js +2 -2
  261. package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +17 -0
  262. package/sdk/platform/Webhook/WebhookPlatformModel.js +208 -0
  263. package/sdk/platform/{models/WebhookValidator.js → Webhook/WebhookPlatformValidator.js} +4 -3
  264. package/sdk/platform/index.d.ts +24 -0
  265. package/sdk/platform/index.js +45 -0
  266. package/sdk/public/{client → Configuration}/ConfigurationPublicClient.js +1 -1
  267. package/sdk/public/Configuration/ConfigurationPublicModel.d.ts +20 -0
  268. package/sdk/public/Configuration/ConfigurationPublicModel.js +230 -0
  269. package/sdk/public/{models/ConfigurationValidator.js → Configuration/ConfigurationPublicValidator.js} +1 -1
  270. package/sdk/public/{client → Inventory}/InventoryPublicClient.js +1 -1
  271. package/sdk/public/Inventory/InventoryPublicModel.d.ts +22 -0
  272. package/sdk/public/Inventory/InventoryPublicModel.js +334 -0
  273. package/sdk/public/{models/InventoryValidator.js → Inventory/InventoryPublicValidator.js} +2 -2
  274. package/sdk/public/PublicClient.d.ts +3 -3
  275. package/sdk/public/PublicClient.js +8 -3
  276. package/sdk/public/{client → Webhook}/WebhookPublicClient.js +1 -1
  277. package/sdk/public/Webhook/WebhookPublicModel.d.ts +17 -0
  278. package/sdk/public/Webhook/WebhookPublicModel.js +208 -0
  279. package/sdk/public/{models/WebhookValidator.js → Webhook/WebhookPublicValidator.js} +2 -2
  280. package/sdk/public/index.d.ts +5 -0
  281. package/sdk/public/index.js +7 -0
  282. package/sdk/application/client/LogisticApplicationClient.d.ts +0 -42
  283. package/sdk/platform/PlatformApplicationModels.d.ts +0 -328
  284. package/sdk/platform/PlatformApplicationModels.js +0 -22522
  285. package/sdk/platform/PlatformModels.d.ts +0 -1470
  286. package/sdk/platform/PlatformModels.js +0 -20510
  287. package/sdk/platform/models/CartValidator.d.ts +0 -0
  288. package/sdk/platform/models/CartValidator.js +0 -0
  289. package/sdk/platform/models/ContentValidator.d.ts +0 -0
  290. package/sdk/platform/models/ContentValidator.js +0 -0
  291. package/sdk/platform/models/PartnerValidator.d.ts +0 -0
  292. package/sdk/platform/models/PartnerValidator.js +0 -0
  293. package/sdk/platform/models/RewardsValidator.d.ts +0 -0
  294. package/sdk/platform/models/RewardsValidator.js +0 -0
  295. package/sdk/platform/models/ShareValidator.d.ts +0 -0
  296. package/sdk/platform/models/ShareValidator.js +0 -0
  297. package/sdk/platform/models/ThemeValidator.d.ts +0 -0
  298. package/sdk/platform/models/ThemeValidator.js +0 -0
  299. package/sdk/platform/models/UserValidator.d.ts +0 -0
  300. package/sdk/platform/models/UserValidator.js +0 -0
  301. package/sdk/public/PublicModels.d.ts +0 -50
  302. package/sdk/public/PublicModels.js +0 -712
  303. /package/sdk/application/{models/CartValidator.d.ts → Cart/CartApplicationValidator.d.ts} +0 -0
  304. /package/sdk/application/{models/CatalogValidator.d.ts → Catalog/CatalogApplicationValidator.d.ts} +0 -0
  305. /package/sdk/application/{client → Common}/CommonApplicationClient.d.ts +0 -0
  306. /package/sdk/application/{models/CommonValidator.d.ts → Common/CommonApplicationValidator.d.ts} +0 -0
  307. /package/sdk/application/{client → Communication}/CommunicationApplicationClient.d.ts +0 -0
  308. /package/sdk/application/{models/CommunicationValidator.d.ts → Communication/CommunicationApplicationValidator.d.ts} +0 -0
  309. /package/sdk/application/{client → Configuration}/ConfigurationApplicationClient.d.ts +0 -0
  310. /package/sdk/application/{models/ConfigurationValidator.d.ts → Configuration/ConfigurationApplicationValidator.d.ts} +0 -0
  311. /package/sdk/application/{client → Content}/ContentApplicationClient.d.ts +0 -0
  312. /package/sdk/application/{models/ContentValidator.d.ts → Content/ContentApplicationValidator.d.ts} +0 -0
  313. /package/sdk/application/{client → FileStorage}/FileStorageApplicationClient.d.ts +0 -0
  314. /package/sdk/application/{models/FileStorageValidator.d.ts → FileStorage/FileStorageApplicationValidator.d.ts} +0 -0
  315. /package/sdk/application/{client → Lead}/LeadApplicationClient.d.ts +0 -0
  316. /package/sdk/application/{models/LeadValidator.d.ts → Lead/LeadApplicationValidator.d.ts} +0 -0
  317. /package/sdk/application/{client → Order}/OrderApplicationClient.d.ts +0 -0
  318. /package/sdk/application/{models/OrderValidator.d.ts → Order/OrderApplicationValidator.d.ts} +0 -0
  319. /package/sdk/application/{client → Payment}/PaymentApplicationClient.d.ts +0 -0
  320. /package/sdk/application/{models/PaymentValidator.d.ts → Payment/PaymentApplicationValidator.d.ts} +0 -0
  321. /package/sdk/application/{models/PosCartValidator.d.ts → PosCart/PosCartApplicationValidator.d.ts} +0 -0
  322. /package/sdk/application/{client → Rewards}/RewardsApplicationClient.d.ts +0 -0
  323. /package/sdk/application/{models/RewardsValidator.d.ts → Rewards/RewardsApplicationValidator.d.ts} +0 -0
  324. /package/sdk/application/{client → Share}/ShareApplicationClient.d.ts +0 -0
  325. /package/sdk/application/{models/ShareValidator.d.ts → Share/ShareApplicationValidator.d.ts} +0 -0
  326. /package/sdk/application/{client → Theme}/ThemeApplicationClient.d.ts +0 -0
  327. /package/sdk/application/{models/ThemeValidator.d.ts → Theme/ThemeApplicationValidator.d.ts} +0 -0
  328. /package/sdk/application/{client → User}/UserApplicationClient.d.ts +0 -0
  329. /package/sdk/application/{models/UserValidator.d.ts → User/UserApplicationValidator.d.ts} +0 -0
  330. /package/sdk/platform/{client → Analytics}/AnalyticsPlatformClient.d.ts +0 -0
  331. /package/sdk/platform/{models/AnalyticsValidator.d.ts → Analytics/AnalyticsPlatformValidator.d.ts} +0 -0
  332. /package/sdk/platform/{client → AuditTrail}/AuditTrailPlatformClient.d.ts +0 -0
  333. /package/sdk/platform/{models/AuditTrailValidator.d.ts → AuditTrail/AuditTrailPlatformValidator.d.ts} +0 -0
  334. /package/sdk/platform/{client → Billing}/BillingPlatformClient.d.ts +0 -0
  335. /package/sdk/platform/{models/BillingValidator.d.ts → Billing/BillingPlatformValidator.d.ts} +0 -0
  336. /package/sdk/platform/{client → Common}/CommonPlatformClient.d.ts +0 -0
  337. /package/sdk/platform/{models/CommonValidator.d.ts → Common/CommonPlatformValidator.d.ts} +0 -0
  338. /package/sdk/platform/{client → Communication}/CommunicationPlatformClient.d.ts +0 -0
  339. /package/sdk/platform/{models/CommunicationValidator.d.ts → Communication/CommunicationPlatformValidator.d.ts} +0 -0
  340. /package/sdk/platform/{client → Configuration}/ConfigurationPlatformClient.d.ts +0 -0
  341. /package/sdk/platform/{models/ConfigurationValidator.d.ts → Configuration/ConfigurationPlatformValidator.d.ts} +0 -0
  342. /package/sdk/platform/{client → FileStorage}/FileStoragePlatformClient.d.ts +0 -0
  343. /package/sdk/platform/{models/FileStorageValidator.d.ts → FileStorage/FileStoragePlatformValidator.d.ts} +0 -0
  344. /package/sdk/platform/{client → Inventory}/InventoryPlatformClient.d.ts +0 -0
  345. /package/sdk/platform/{models/InventoryValidator.d.ts → Inventory/InventoryPlatformValidator.d.ts} +0 -0
  346. /package/sdk/platform/{client → Lead}/LeadPlatformClient.d.ts +0 -0
  347. /package/sdk/platform/{models/LeadValidator.d.ts → Lead/LeadPlatformValidator.d.ts} +0 -0
  348. /package/sdk/platform/{client → Payment}/PaymentPlatformClient.d.ts +0 -0
  349. /package/sdk/platform/{models/PaymentValidator.d.ts → Payment/PaymentPlatformValidator.d.ts} +0 -0
  350. /package/sdk/platform/{client → Webhook}/WebhookPlatformClient.d.ts +0 -0
  351. /package/sdk/platform/{models/WebhookValidator.d.ts → Webhook/WebhookPlatformValidator.d.ts} +0 -0
  352. /package/sdk/public/{client → Configuration}/ConfigurationPublicClient.d.ts +0 -0
  353. /package/sdk/public/{models/ConfigurationValidator.d.ts → Configuration/ConfigurationPublicValidator.d.ts} +0 -0
  354. /package/sdk/public/{client → Inventory}/InventoryPublicClient.d.ts +0 -0
  355. /package/sdk/public/{models/InventoryValidator.d.ts → Inventory/InventoryPublicValidator.d.ts} +0 -0
  356. /package/sdk/public/{client → Webhook}/WebhookPublicClient.d.ts +0 -0
  357. /package/sdk/public/{models/WebhookValidator.d.ts → Webhook/WebhookPublicValidator.d.ts} +0 -0
@@ -0,0 +1,2208 @@
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
+ const query_params = {};
34
+ query_params["page_no"] = pageNo;
35
+ query_params["page_size"] = pageSize;
36
+
37
+ return PlatformAPIClient.execute(
38
+ this.config,
39
+ "get",
40
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/announcements`,
41
+ query_params,
42
+ undefined
43
+ );
44
+ }
45
+
46
+ /**
47
+ * @param {Object} arg - Arg object.
48
+ * @param {string} arg.companyId - Numeric ID allotted to a business account
49
+ * on Fynd Platform
50
+ * @param {string} arg.applicationId - Numeric ID allotted to an application
51
+ * created within a business account.
52
+ * @param {number} [arg.pageSize] - The number of items to retrieve in each
53
+ * page. Default value is 10.
54
+ * @summary: Get a list of announcements
55
+ * @description: Announcements are useful to highlight a message or information on top of a webpage. Use this API to retrieve a list of announcements.
56
+ */
57
+ getAnnouncementsListPaginator({ companyId, applicationId, pageSize } = {}) {
58
+ const paginator = new Paginator();
59
+ const callback = async () => {
60
+ const pageId = paginator.nextId;
61
+ const pageNo = paginator.pageNo;
62
+ const pageType = "number";
63
+ const data = await this.getAnnouncementsList({
64
+ companyId: companyId,
65
+ applicationId: applicationId,
66
+ pageNo: pageNo,
67
+ pageSize: pageSize,
68
+ });
69
+ paginator.setPaginator({
70
+ hasNext: data.page.has_next ? true : false,
71
+ nextId: data.page.next_id,
72
+ });
73
+ return data;
74
+ };
75
+ paginator.setCallback(callback.bind(this));
76
+ return paginator;
77
+ }
78
+
79
+ /**
80
+ * @param {Object} arg - Arg object.
81
+ * @param {AdminAnnouncementSchema} arg.body
82
+ * @summary: Create an announcement
83
+ * @description: Announcements are useful to highlight a message or information on top of a webpage. Use this API to create an announcement.
84
+ */
85
+ createAnnouncement({ body } = {}) {
86
+ const { error } = ContentValidator.createAnnouncement().validate(
87
+ {
88
+ body,
89
+ },
90
+ { abortEarly: false, allowUnknown: true }
91
+ );
92
+ if (error) {
93
+ return Promise.reject(new FDKClientValidationError(error));
94
+ }
95
+
96
+ const query_params = {};
97
+
98
+ return PlatformAPIClient.execute(
99
+ this.config,
100
+ "post",
101
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/announcements`,
102
+ query_params,
103
+ body
104
+ );
105
+ }
106
+
107
+ /**
108
+ * @param {Object} arg - Arg object.
109
+ * @param {string} arg.announcementId - ID allotted to the announcement.
110
+ * @summary: Get announcement by ID
111
+ * @description: Use this API to retrieve an announcement and its details such as the target platform and pages on which it's applicable
112
+ */
113
+ getAnnouncementById({ announcementId } = {}) {
114
+ const { error } = ContentValidator.getAnnouncementById().validate(
115
+ {
116
+ announcementId,
117
+ },
118
+ { abortEarly: false, allowUnknown: true }
119
+ );
120
+ if (error) {
121
+ return Promise.reject(new FDKClientValidationError(error));
122
+ }
123
+
124
+ const query_params = {};
125
+
126
+ return PlatformAPIClient.execute(
127
+ this.config,
128
+ "get",
129
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/announcements/${announcementId}`,
130
+ query_params,
131
+ undefined
132
+ );
133
+ }
134
+
135
+ /**
136
+ * @param {Object} arg - Arg object.
137
+ * @param {string} arg.announcementId - ID allotted to the announcement.
138
+ * @param {AdminAnnouncementSchema} arg.body
139
+ * @summary: Update an announcement
140
+ * @description: Use this API to edit an existing announcement and its details such as the target platform and pages on which it's applicable
141
+ */
142
+ updateAnnouncement({ announcementId, body } = {}) {
143
+ const { error } = ContentValidator.updateAnnouncement().validate(
144
+ {
145
+ announcementId,
146
+ body,
147
+ },
148
+ { abortEarly: false, allowUnknown: true }
149
+ );
150
+ if (error) {
151
+ return Promise.reject(new FDKClientValidationError(error));
152
+ }
153
+
154
+ const query_params = {};
155
+
156
+ return PlatformAPIClient.execute(
157
+ this.config,
158
+ "put",
159
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/announcements/${announcementId}`,
160
+ query_params,
161
+ body
162
+ );
163
+ }
164
+
165
+ /**
166
+ * @param {Object} arg - Arg object.
167
+ * @param {string} arg.announcementId - ID allotted to the announcement.
168
+ * @param {ScheduleSchema} arg.body
169
+ * @summary: Update the schedule and the publish status of an announcement
170
+ * @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.
171
+ */
172
+ updateAnnouncementSchedule({ announcementId, body } = {}) {
173
+ const { error } = ContentValidator.updateAnnouncementSchedule().validate(
174
+ {
175
+ announcementId,
176
+ body,
177
+ },
178
+ { abortEarly: false, allowUnknown: true }
179
+ );
180
+ if (error) {
181
+ return Promise.reject(new FDKClientValidationError(error));
182
+ }
183
+
184
+ const query_params = {};
185
+
186
+ return PlatformAPIClient.execute(
187
+ this.config,
188
+ "patch",
189
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/announcements/${announcementId}`,
190
+ query_params,
191
+ body
192
+ );
193
+ }
194
+
195
+ /**
196
+ * @param {Object} arg - Arg object.
197
+ * @param {string} arg.announcementId - ID allotted to the announcement.
198
+ * @summary: Delete announcement by id
199
+ * @description: Use this API to delete an existing announcement.
200
+ */
201
+ deleteAnnouncement({ announcementId } = {}) {
202
+ const { error } = ContentValidator.deleteAnnouncement().validate(
203
+ {
204
+ announcementId,
205
+ },
206
+ { abortEarly: false, allowUnknown: true }
207
+ );
208
+ if (error) {
209
+ return Promise.reject(new FDKClientValidationError(error));
210
+ }
211
+
212
+ const query_params = {};
213
+
214
+ return PlatformAPIClient.execute(
215
+ this.config,
216
+ "delete",
217
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/announcements/${announcementId}`,
218
+ query_params,
219
+ undefined
220
+ );
221
+ }
222
+
223
+ /**
224
+ * @param {Object} arg - Arg object.
225
+ * @param {BlogRequest} arg.body
226
+ * @summary: Create a blog
227
+ * @description: Use this API to create a blog.
228
+ */
229
+ createBlog({ body } = {}) {
230
+ const { error } = ContentValidator.createBlog().validate(
231
+ {
232
+ body,
233
+ },
234
+ { abortEarly: false, allowUnknown: true }
235
+ );
236
+ if (error) {
237
+ return Promise.reject(new FDKClientValidationError(error));
238
+ }
239
+
240
+ const query_params = {};
241
+
242
+ return PlatformAPIClient.execute(
243
+ this.config,
244
+ "post",
245
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/blogs/`,
246
+ query_params,
247
+ body
248
+ );
249
+ }
250
+
251
+ /**
252
+ * @param {Object} arg - Arg object.
253
+ * @param {number} [arg.pageNo] - The page number to navigate through the
254
+ * given set of results. Default value is 1.
255
+ * @param {number} [arg.pageSize] - The number of items to retrieve in each
256
+ * page. Default value is 10.
257
+ * @summary: Get blogs
258
+ * @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.
259
+ */
260
+ getBlogs({ pageNo, pageSize } = {}) {
261
+ const { error } = ContentValidator.getBlogs().validate(
262
+ {
263
+ pageNo,
264
+ pageSize,
265
+ },
266
+ { abortEarly: false, allowUnknown: true }
267
+ );
268
+ if (error) {
269
+ return Promise.reject(new FDKClientValidationError(error));
270
+ }
271
+
272
+ const query_params = {};
273
+ query_params["page_no"] = pageNo;
274
+ query_params["page_size"] = pageSize;
275
+
276
+ return PlatformAPIClient.execute(
277
+ this.config,
278
+ "get",
279
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/blogs/`,
280
+ query_params,
281
+ undefined
282
+ );
283
+ }
284
+
285
+ /**
286
+ * @param {Object} arg - Arg object.
287
+ * @param {string} arg.companyId - Numeric ID allotted to a business account
288
+ * on Fynd Platform
289
+ * @param {string} arg.applicationId - Numeric ID allotted to an application
290
+ * created within a business account.
291
+ * @param {number} [arg.pageSize] - The number of items to retrieve in each
292
+ * page. Default value is 10.
293
+ * @summary: Get blogs
294
+ * @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.
295
+ */
296
+ getBlogsPaginator({ companyId, applicationId, pageSize } = {}) {
297
+ const paginator = new Paginator();
298
+ const callback = async () => {
299
+ const pageId = paginator.nextId;
300
+ const pageNo = paginator.pageNo;
301
+ const pageType = "number";
302
+ const data = await this.getBlogs({
303
+ companyId: companyId,
304
+ applicationId: applicationId,
305
+ pageNo: pageNo,
306
+ pageSize: pageSize,
307
+ });
308
+ paginator.setPaginator({
309
+ hasNext: data.page.has_next ? true : false,
310
+ nextId: data.page.next_id,
311
+ });
312
+ return data;
313
+ };
314
+ paginator.setCallback(callback.bind(this));
315
+ return paginator;
316
+ }
317
+
318
+ /**
319
+ * @param {Object} arg - Arg object.
320
+ * @param {string} arg.id - ID allotted to the blog.
321
+ * @param {BlogRequest} arg.body
322
+ * @summary: Update a blog
323
+ * @description: Use this API to update the details of an existing blog which includes title, feature image, content, SEO details, expiry, etc.
324
+ */
325
+ updateBlog({ id, body } = {}) {
326
+ const { error } = ContentValidator.updateBlog().validate(
327
+ {
328
+ id,
329
+ body,
330
+ },
331
+ { abortEarly: false, allowUnknown: true }
332
+ );
333
+ if (error) {
334
+ return Promise.reject(new FDKClientValidationError(error));
335
+ }
336
+
337
+ const query_params = {};
338
+
339
+ return PlatformAPIClient.execute(
340
+ this.config,
341
+ "put",
342
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/blogs/${id}`,
343
+ query_params,
344
+ body
345
+ );
346
+ }
347
+
348
+ /**
349
+ * @param {Object} arg - Arg object.
350
+ * @param {string} arg.id - ID allotted to the blog.
351
+ * @summary: Delete blogs
352
+ * @description: Use this API to delete a blog.
353
+ */
354
+ deleteBlog({ id } = {}) {
355
+ const { error } = ContentValidator.deleteBlog().validate(
356
+ {
357
+ id,
358
+ },
359
+ { abortEarly: false, allowUnknown: true }
360
+ );
361
+ if (error) {
362
+ return Promise.reject(new FDKClientValidationError(error));
363
+ }
364
+
365
+ const query_params = {};
366
+
367
+ return PlatformAPIClient.execute(
368
+ this.config,
369
+ "delete",
370
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/blogs/${id}`,
371
+ query_params,
372
+ undefined
373
+ );
374
+ }
375
+
376
+ /**
377
+ * @param {Object} arg - Arg object.
378
+ * @param {string} arg.slug - A short, human-readable, URL-friendly
379
+ * identifier of a blog page. You can get slug value of a blog from `getBlogs` API.
380
+ * @summary: Get components of a blog
381
+ * @description: Use this API to retrieve the components of a blog, such as title, slug, feature image, content, schedule, publish status, author, etc.
382
+ */
383
+ getComponentById({ slug } = {}) {
384
+ const { error } = ContentValidator.getComponentById().validate(
385
+ {
386
+ slug,
387
+ },
388
+ { abortEarly: false, allowUnknown: true }
389
+ );
390
+ if (error) {
391
+ return Promise.reject(new FDKClientValidationError(error));
392
+ }
393
+
394
+ const query_params = {};
395
+
396
+ return PlatformAPIClient.execute(
397
+ this.config,
398
+ "get",
399
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/blogs/${slug}`,
400
+ query_params,
401
+ undefined
402
+ );
403
+ }
404
+
405
+ /**
406
+ * @param {Object} arg - Arg object.
407
+ * @param {DataLoaderSchema} arg.body
408
+ * @summary: Adds a data loader
409
+ * @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.
410
+ */
411
+ addDataLoader({ body } = {}) {
412
+ const { error } = ContentValidator.addDataLoader().validate(
413
+ {
414
+ body,
415
+ },
416
+ { abortEarly: false, allowUnknown: true }
417
+ );
418
+ if (error) {
419
+ return Promise.reject(new FDKClientValidationError(error));
420
+ }
421
+
422
+ const query_params = {};
423
+
424
+ return PlatformAPIClient.execute(
425
+ this.config,
426
+ "post",
427
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/data-loader`,
428
+ query_params,
429
+ body
430
+ );
431
+ }
432
+
433
+ /**
434
+ * @param {Object} arg - Arg object.
435
+ * @summary: Get all the data loaders in an application
436
+ * @description: Use this to get all data loaders of an application
437
+ */
438
+ getDataLoaders({} = {}) {
439
+ const { error } = ContentValidator.getDataLoaders().validate(
440
+ {},
441
+ { abortEarly: false, allowUnknown: true }
442
+ );
443
+ if (error) {
444
+ return Promise.reject(new FDKClientValidationError(error));
445
+ }
446
+
447
+ const query_params = {};
448
+
449
+ return PlatformAPIClient.execute(
450
+ this.config,
451
+ "get",
452
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/data-loader`,
453
+ query_params,
454
+ undefined
455
+ );
456
+ }
457
+
458
+ /**
459
+ * @param {Object} arg - Arg object.
460
+ * @param {string} arg.dataLoaderId - ID allotted to the data loader.
461
+ * @summary: Delete data loader in application
462
+ * @description: Use this API to delete data loader.
463
+ */
464
+ deleteDataLoader({ dataLoaderId } = {}) {
465
+ const { error } = ContentValidator.deleteDataLoader().validate(
466
+ {
467
+ dataLoaderId,
468
+ },
469
+ { abortEarly: false, allowUnknown: true }
470
+ );
471
+ if (error) {
472
+ return Promise.reject(new FDKClientValidationError(error));
473
+ }
474
+
475
+ const query_params = {};
476
+
477
+ return PlatformAPIClient.execute(
478
+ this.config,
479
+ "delete",
480
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/data-loader/${dataLoaderId}`,
481
+ query_params,
482
+ undefined
483
+ );
484
+ }
485
+
486
+ /**
487
+ * @param {Object} arg - Arg object.
488
+ * @param {string} arg.dataLoaderId - ID allotted to the data loader.
489
+ * @param {DataLoaderSchema} arg.body
490
+ * @summary: Edit a data loader by id
491
+ * @description: Use this API to edit the details of an existing data loader by its ID.
492
+ */
493
+ editDataLoader({ dataLoaderId, body } = {}) {
494
+ const { error } = ContentValidator.editDataLoader().validate(
495
+ {
496
+ dataLoaderId,
497
+ body,
498
+ },
499
+ { abortEarly: false, allowUnknown: true }
500
+ );
501
+ if (error) {
502
+ return Promise.reject(new FDKClientValidationError(error));
503
+ }
504
+
505
+ const query_params = {};
506
+
507
+ return PlatformAPIClient.execute(
508
+ this.config,
509
+ "put",
510
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/data-loader/${dataLoaderId}`,
511
+ query_params,
512
+ body
513
+ );
514
+ }
515
+
516
+ /**
517
+ * @param {Object} arg - Arg object.
518
+ * @param {string} arg.dataLoaderId - ID allotted to the data loader.
519
+ * @summary: Select a data loader by id
520
+ * @description: Use this API to select a data loader to be used in applications.
521
+ */
522
+ selectDataLoader({ dataLoaderId } = {}) {
523
+ const { error } = ContentValidator.selectDataLoader().validate(
524
+ {
525
+ dataLoaderId,
526
+ },
527
+ { abortEarly: false, allowUnknown: true }
528
+ );
529
+ if (error) {
530
+ return Promise.reject(new FDKClientValidationError(error));
531
+ }
532
+
533
+ const query_params = {};
534
+
535
+ return PlatformAPIClient.execute(
536
+ this.config,
537
+ "put",
538
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/data-loader/${dataLoaderId}/select`,
539
+ query_params,
540
+ undefined
541
+ );
542
+ }
543
+
544
+ /**
545
+ * @param {Object} arg - Arg object.
546
+ * @param {string} arg.service - Name of service.
547
+ * @param {string} arg.operationId - Name of operation id of the service.
548
+ * @summary: Reset a data loader by serive name and operation Id
549
+ * @description: Use this API to reselect a data loader.
550
+ */
551
+ resetDataLoader({ service, operationId } = {}) {
552
+ const { error } = ContentValidator.resetDataLoader().validate(
553
+ {
554
+ service,
555
+ operationId,
556
+ },
557
+ { abortEarly: false, allowUnknown: true }
558
+ );
559
+ if (error) {
560
+ return Promise.reject(new FDKClientValidationError(error));
561
+ }
562
+
563
+ const query_params = {};
564
+
565
+ return PlatformAPIClient.execute(
566
+ this.config,
567
+ "put",
568
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/data-loader/${service}/${operationId}/reset`,
569
+ query_params,
570
+ undefined
571
+ );
572
+ }
573
+
574
+ /**
575
+ * @param {Object} arg - Arg object.
576
+ * @summary: Get a list of FAQ categories
577
+ * @description: FAQs can be divided into categories. Use this API to get a list of FAQ categories.
578
+ */
579
+ getFaqCategories({} = {}) {
580
+ const { error } = ContentValidator.getFaqCategories().validate(
581
+ {},
582
+ { abortEarly: false, allowUnknown: true }
583
+ );
584
+ if (error) {
585
+ return Promise.reject(new FDKClientValidationError(error));
586
+ }
587
+
588
+ const query_params = {};
589
+
590
+ return PlatformAPIClient.execute(
591
+ this.config,
592
+ "get",
593
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/faq/categories`,
594
+ query_params,
595
+ undefined
596
+ );
597
+ }
598
+
599
+ /**
600
+ * @param {Object} arg - Arg object.
601
+ * @param {string} arg.idOrSlug - ID or the slug allotted to an FAQ
602
+ * category. Slug is a short, human-readable, URL-friendly identifier of
603
+ * an object. You can get slug value of an FAQ category from
604
+ * `getFaqCategories` API.
605
+ * @summary: Get an FAQ category by slug or id
606
+ * @description: FAQs can be divided into categories. Use this API to get an FAQ categories using its slug or ID.
607
+ */
608
+ getFaqCategoryBySlugOrId({ idOrSlug } = {}) {
609
+ const { error } = ContentValidator.getFaqCategoryBySlugOrId().validate(
610
+ {
611
+ idOrSlug,
612
+ },
613
+ { abortEarly: false, allowUnknown: true }
614
+ );
615
+ if (error) {
616
+ return Promise.reject(new FDKClientValidationError(error));
617
+ }
618
+
619
+ const query_params = {};
620
+
621
+ return PlatformAPIClient.execute(
622
+ this.config,
623
+ "get",
624
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/faq/category/${idOrSlug}`,
625
+ query_params,
626
+ undefined
627
+ );
628
+ }
629
+
630
+ /**
631
+ * @param {Object} arg - Arg object.
632
+ * @param {CreateFaqCategoryRequestSchema} arg.body
633
+ * @summary: Create an FAQ category
634
+ * @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.
635
+ */
636
+ createFaqCategory({ body } = {}) {
637
+ const { error } = ContentValidator.createFaqCategory().validate(
638
+ {
639
+ body,
640
+ },
641
+ { abortEarly: false, allowUnknown: true }
642
+ );
643
+ if (error) {
644
+ return Promise.reject(new FDKClientValidationError(error));
645
+ }
646
+
647
+ const query_params = {};
648
+
649
+ return PlatformAPIClient.execute(
650
+ this.config,
651
+ "post",
652
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/faq/category`,
653
+ query_params,
654
+ body
655
+ );
656
+ }
657
+
658
+ /**
659
+ * @param {Object} arg - Arg object.
660
+ * @param {string} arg.id - ID allotted to an FAQ category.
661
+ * @param {UpdateFaqCategoryRequestSchema} arg.body
662
+ * @summary: Update an FAQ category
663
+ * @description: Use this API to edit an existing FAQ category.
664
+ */
665
+ updateFaqCategory({ id, body } = {}) {
666
+ const { error } = ContentValidator.updateFaqCategory().validate(
667
+ {
668
+ id,
669
+ body,
670
+ },
671
+ { abortEarly: false, allowUnknown: true }
672
+ );
673
+ if (error) {
674
+ return Promise.reject(new FDKClientValidationError(error));
675
+ }
676
+
677
+ const query_params = {};
678
+
679
+ return PlatformAPIClient.execute(
680
+ this.config,
681
+ "put",
682
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/faq/category/${id}`,
683
+ query_params,
684
+ body
685
+ );
686
+ }
687
+
688
+ /**
689
+ * @param {Object} arg - Arg object.
690
+ * @param {string} arg.id - ID allotted to an FAQ category.
691
+ * @summary: Delete an FAQ category
692
+ * @description: Use this API to delete an FAQ category.
693
+ */
694
+ deleteFaqCategory({ id } = {}) {
695
+ const { error } = ContentValidator.deleteFaqCategory().validate(
696
+ {
697
+ id,
698
+ },
699
+ { abortEarly: false, allowUnknown: true }
700
+ );
701
+ if (error) {
702
+ return Promise.reject(new FDKClientValidationError(error));
703
+ }
704
+
705
+ const query_params = {};
706
+
707
+ return PlatformAPIClient.execute(
708
+ this.config,
709
+ "delete",
710
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/faq/category/${id}`,
711
+ query_params,
712
+ undefined
713
+ );
714
+ }
715
+
716
+ /**
717
+ * @param {Object} arg - Arg object.
718
+ * @param {string} arg.idOrSlug - ID or the slug allotted to an FAQ
719
+ * category. Slug is a short, human-readable, URL-friendly identifier of
720
+ * an object. You can get slug value of an FAQ category from
721
+ * `getFaqCategories` API.
722
+ * @summary: Get question and answers within an FAQ category
723
+ * @description: Use this API to retrieve all the commonly asked question and answers belonging to an FAQ category.
724
+ */
725
+ getFaqsByCategoryIdOrSlug({ idOrSlug } = {}) {
726
+ const { error } = ContentValidator.getFaqsByCategoryIdOrSlug().validate(
727
+ {
728
+ idOrSlug,
729
+ },
730
+ { abortEarly: false, allowUnknown: true }
731
+ );
732
+ if (error) {
733
+ return Promise.reject(new FDKClientValidationError(error));
734
+ }
735
+
736
+ const query_params = {};
737
+
738
+ return PlatformAPIClient.execute(
739
+ this.config,
740
+ "get",
741
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/faq/category/${idOrSlug}/faqs`,
742
+ query_params,
743
+ undefined
744
+ );
745
+ }
746
+
747
+ /**
748
+ * @param {Object} arg - Arg object.
749
+ * @param {string} arg.categoryId - ID allotted to an FAQ category.
750
+ * @param {CreateFaqSchema} arg.body
751
+ * @summary: Create an FAQ
752
+ * @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.
753
+ */
754
+ addFaq({ categoryId, body } = {}) {
755
+ const { error } = ContentValidator.addFaq().validate(
756
+ {
757
+ categoryId,
758
+ body,
759
+ },
760
+ { abortEarly: false, allowUnknown: true }
761
+ );
762
+ if (error) {
763
+ return Promise.reject(new FDKClientValidationError(error));
764
+ }
765
+
766
+ const query_params = {};
767
+
768
+ return PlatformAPIClient.execute(
769
+ this.config,
770
+ "post",
771
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/faq/category/${categoryId}/faqs`,
772
+ query_params,
773
+ body
774
+ );
775
+ }
776
+
777
+ /**
778
+ * @param {Object} arg - Arg object.
779
+ * @param {string} arg.categoryId - ID allotted to an FAQ category.
780
+ * @param {string} arg.faqId - ID allotted to an FAQ.
781
+ * @param {CreateFaqSchema} arg.body
782
+ * @summary: Update an FAQ
783
+ * @description: Use this API to edit an existing FAQ.
784
+ */
785
+ updateFaq({ categoryId, faqId, body } = {}) {
786
+ const { error } = ContentValidator.updateFaq().validate(
787
+ {
788
+ categoryId,
789
+ faqId,
790
+ body,
791
+ },
792
+ { abortEarly: false, allowUnknown: true }
793
+ );
794
+ if (error) {
795
+ return Promise.reject(new FDKClientValidationError(error));
796
+ }
797
+
798
+ const query_params = {};
799
+
800
+ return PlatformAPIClient.execute(
801
+ this.config,
802
+ "put",
803
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/faq/category/${categoryId}/faq/${faqId}`,
804
+ query_params,
805
+ body
806
+ );
807
+ }
808
+
809
+ /**
810
+ * @param {Object} arg - Arg object.
811
+ * @param {string} arg.categoryId - ID allotted to an FAQ category.
812
+ * @param {string} arg.faqId - ID allotted to an FAQ.
813
+ * @summary: Delete an FAQ
814
+ * @description: Use this API to delete an existing FAQ.
815
+ */
816
+ deleteFaq({ categoryId, faqId } = {}) {
817
+ const { error } = ContentValidator.deleteFaq().validate(
818
+ {
819
+ categoryId,
820
+ faqId,
821
+ },
822
+ { abortEarly: false, allowUnknown: true }
823
+ );
824
+ if (error) {
825
+ return Promise.reject(new FDKClientValidationError(error));
826
+ }
827
+
828
+ const query_params = {};
829
+
830
+ return PlatformAPIClient.execute(
831
+ this.config,
832
+ "delete",
833
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/faq/category/${categoryId}/faq/${faqId}`,
834
+ query_params,
835
+ undefined
836
+ );
837
+ }
838
+
839
+ /**
840
+ * @param {Object} arg - Arg object.
841
+ * @param {string} arg.idOrSlug - ID or the slug allotted to an FAQ
842
+ * category. Slug is a short, human-readable, URL-friendly identifier of
843
+ * an object. You can get slug value of an FAQ category from
844
+ * `getFaqCategories` API.
845
+ * @summary: Get an FAQ
846
+ * @description: Use this API to retrieve a specific FAQ. You will get the question and answer of that FAQ.
847
+ */
848
+ getFaqByIdOrSlug({ idOrSlug } = {}) {
849
+ const { error } = ContentValidator.getFaqByIdOrSlug().validate(
850
+ {
851
+ idOrSlug,
852
+ },
853
+ { abortEarly: false, allowUnknown: true }
854
+ );
855
+ if (error) {
856
+ return Promise.reject(new FDKClientValidationError(error));
857
+ }
858
+
859
+ const query_params = {};
860
+
861
+ return PlatformAPIClient.execute(
862
+ this.config,
863
+ "get",
864
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/faq/${idOrSlug}`,
865
+ query_params,
866
+ undefined
867
+ );
868
+ }
869
+
870
+ /**
871
+ * @param {Object} arg - Arg object.
872
+ * @param {number} [arg.pageNo] - The page number to navigate through the
873
+ * given set of results. Default value is 1.
874
+ * @param {number} [arg.pageSize] - The number of items to retrieve in each
875
+ * page. Default value is 10.
876
+ * @summary: Get landing pages
877
+ * @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.
878
+ */
879
+ getLandingPages({ pageNo, pageSize } = {}) {
880
+ const { error } = ContentValidator.getLandingPages().validate(
881
+ {
882
+ pageNo,
883
+ pageSize,
884
+ },
885
+ { abortEarly: false, allowUnknown: true }
886
+ );
887
+ if (error) {
888
+ return Promise.reject(new FDKClientValidationError(error));
889
+ }
890
+
891
+ const query_params = {};
892
+ query_params["page_no"] = pageNo;
893
+ query_params["page_size"] = pageSize;
894
+
895
+ return PlatformAPIClient.execute(
896
+ this.config,
897
+ "get",
898
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/landing-page/`,
899
+ query_params,
900
+ undefined
901
+ );
902
+ }
903
+
904
+ /**
905
+ * @param {Object} arg - Arg object.
906
+ * @param {string} arg.companyId - Numeric ID allotted to a business account
907
+ * on Fynd Platform
908
+ * @param {string} arg.applicationId - Numeric ID allotted to an application
909
+ * created within a business account.
910
+ * @param {number} [arg.pageSize] - The number of items to retrieve in each
911
+ * page. Default value is 10.
912
+ * @summary: Get landing pages
913
+ * @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.
914
+ */
915
+ getLandingPagesPaginator({ companyId, applicationId, pageSize } = {}) {
916
+ const paginator = new Paginator();
917
+ const callback = async () => {
918
+ const pageId = paginator.nextId;
919
+ const pageNo = paginator.pageNo;
920
+ const pageType = "number";
921
+ const data = await this.getLandingPages({
922
+ companyId: companyId,
923
+ applicationId: applicationId,
924
+ pageNo: pageNo,
925
+ pageSize: pageSize,
926
+ });
927
+ paginator.setPaginator({
928
+ hasNext: data.page.has_next ? true : false,
929
+ nextId: data.page.next_id,
930
+ });
931
+ return data;
932
+ };
933
+ paginator.setCallback(callback.bind(this));
934
+ return paginator;
935
+ }
936
+
937
+ /**
938
+ * @param {Object} arg - Arg object.
939
+ * @param {LandingPageSchema} arg.body
940
+ * @summary: Create a landing page
941
+ * @description: Landing page is the first page that a prospect lands upon while visiting a website. Use this API to create a landing page.
942
+ */
943
+ createLandingPage({ body } = {}) {
944
+ const { error } = ContentValidator.createLandingPage().validate(
945
+ {
946
+ body,
947
+ },
948
+ { abortEarly: false, allowUnknown: true }
949
+ );
950
+ if (error) {
951
+ return Promise.reject(new FDKClientValidationError(error));
952
+ }
953
+
954
+ const query_params = {};
955
+
956
+ return PlatformAPIClient.execute(
957
+ this.config,
958
+ "post",
959
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/landing-page/`,
960
+ query_params,
961
+ body
962
+ );
963
+ }
964
+
965
+ /**
966
+ * @param {Object} arg - Arg object.
967
+ * @param {string} arg.id - ID allotted to a landing page.
968
+ * @param {LandingPageSchema} arg.body
969
+ * @summary: Update a landing page
970
+ * @description: Use this API to edit the details of an existing landing page.
971
+ */
972
+ updateLandingPage({ id, body } = {}) {
973
+ const { error } = ContentValidator.updateLandingPage().validate(
974
+ {
975
+ id,
976
+ body,
977
+ },
978
+ { abortEarly: false, allowUnknown: true }
979
+ );
980
+ if (error) {
981
+ return Promise.reject(new FDKClientValidationError(error));
982
+ }
983
+
984
+ const query_params = {};
985
+
986
+ return PlatformAPIClient.execute(
987
+ this.config,
988
+ "put",
989
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/landing-page/${id}`,
990
+ query_params,
991
+ body
992
+ );
993
+ }
994
+
995
+ /**
996
+ * @param {Object} arg - Arg object.
997
+ * @param {string} arg.id - ID allotted to a landing page.
998
+ * @summary: Delete a landing page
999
+ * @description: Use this API to delete an existing landing page.
1000
+ */
1001
+ deleteLandingPage({ id } = {}) {
1002
+ const { error } = ContentValidator.deleteLandingPage().validate(
1003
+ {
1004
+ id,
1005
+ },
1006
+ { abortEarly: false, allowUnknown: true }
1007
+ );
1008
+ if (error) {
1009
+ return Promise.reject(new FDKClientValidationError(error));
1010
+ }
1011
+
1012
+ const query_params = {};
1013
+
1014
+ return PlatformAPIClient.execute(
1015
+ this.config,
1016
+ "delete",
1017
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/landing-page/${id}`,
1018
+ query_params,
1019
+ undefined
1020
+ );
1021
+ }
1022
+
1023
+ /**
1024
+ * @param {Object} arg - Arg object.
1025
+ * @summary: Get legal information
1026
+ * @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.
1027
+ */
1028
+ getLegalInformation({} = {}) {
1029
+ const { error } = ContentValidator.getLegalInformation().validate(
1030
+ {},
1031
+ { abortEarly: false, allowUnknown: true }
1032
+ );
1033
+ if (error) {
1034
+ return Promise.reject(new FDKClientValidationError(error));
1035
+ }
1036
+
1037
+ const query_params = {};
1038
+
1039
+ return PlatformAPIClient.execute(
1040
+ this.config,
1041
+ "get",
1042
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/legal`,
1043
+ query_params,
1044
+ undefined
1045
+ );
1046
+ }
1047
+
1048
+ /**
1049
+ * @param {Object} arg - Arg object.
1050
+ * @param {ApplicationLegal} arg.body
1051
+ * @summary: Save legal information
1052
+ * @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.
1053
+ */
1054
+ updateLegalInformation({ body } = {}) {
1055
+ const { error } = ContentValidator.updateLegalInformation().validate(
1056
+ {
1057
+ body,
1058
+ },
1059
+ { abortEarly: false, allowUnknown: true }
1060
+ );
1061
+ if (error) {
1062
+ return Promise.reject(new FDKClientValidationError(error));
1063
+ }
1064
+
1065
+ const query_params = {};
1066
+
1067
+ return PlatformAPIClient.execute(
1068
+ this.config,
1069
+ "post",
1070
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/legal`,
1071
+ query_params,
1072
+ body
1073
+ );
1074
+ }
1075
+
1076
+ /**
1077
+ * @param {Object} arg - Arg object.
1078
+ * @param {string} arg.devicePlatform - Filter navigations by platform.
1079
+ * Acceptable values are: web, android, ios, all
1080
+ * @param {number} [arg.pageNo] - The page number to navigate through the
1081
+ * given set of results. Default value is 1.
1082
+ * @param {number} [arg.pageSize] - The number of items to retrieve in each
1083
+ * page. Default value is 10.
1084
+ * @summary: Get navigations
1085
+ * @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.
1086
+ */
1087
+ getNavigations({ devicePlatform, pageNo, pageSize } = {}) {
1088
+ const { error } = ContentValidator.getNavigations().validate(
1089
+ {
1090
+ devicePlatform,
1091
+ pageNo,
1092
+ pageSize,
1093
+ },
1094
+ { abortEarly: false, allowUnknown: true }
1095
+ );
1096
+ if (error) {
1097
+ return Promise.reject(new FDKClientValidationError(error));
1098
+ }
1099
+
1100
+ const query_params = {};
1101
+ query_params["device_platform"] = devicePlatform;
1102
+ query_params["page_no"] = pageNo;
1103
+ query_params["page_size"] = pageSize;
1104
+
1105
+ return PlatformAPIClient.execute(
1106
+ this.config,
1107
+ "get",
1108
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/navigations/`,
1109
+ query_params,
1110
+ undefined
1111
+ );
1112
+ }
1113
+
1114
+ /**
1115
+ * @param {Object} arg - Arg object.
1116
+ * @param {string} arg.companyId - Numeric ID allotted to a business account
1117
+ * on Fynd Platform
1118
+ * @param {string} arg.applicationId - Numeric ID allotted to an application
1119
+ * created within a business account.
1120
+ * @param {string} arg.devicePlatform - Filter navigations by platform.
1121
+ * Acceptable values are: web, android, ios, all
1122
+ * @param {number} [arg.pageSize] - The number of items to retrieve in each
1123
+ * page. Default value is 10.
1124
+ * @summary: Get navigations
1125
+ * @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.
1126
+ */
1127
+ getNavigationsPaginator({
1128
+ companyId,
1129
+ applicationId,
1130
+ devicePlatform,
1131
+ pageSize,
1132
+ } = {}) {
1133
+ const paginator = new Paginator();
1134
+ const callback = async () => {
1135
+ const pageId = paginator.nextId;
1136
+ const pageNo = paginator.pageNo;
1137
+ const pageType = "number";
1138
+ const data = await this.getNavigations({
1139
+ companyId: companyId,
1140
+ applicationId: applicationId,
1141
+ devicePlatform: devicePlatform,
1142
+ pageNo: pageNo,
1143
+ pageSize: pageSize,
1144
+ });
1145
+ paginator.setPaginator({
1146
+ hasNext: data.page.has_next ? true : false,
1147
+ nextId: data.page.next_id,
1148
+ });
1149
+ return data;
1150
+ };
1151
+ paginator.setCallback(callback.bind(this));
1152
+ return paginator;
1153
+ }
1154
+
1155
+ /**
1156
+ * @param {Object} arg - Arg object.
1157
+ * @param {NavigationRequest} arg.body
1158
+ * @summary: Create a navigation
1159
+ * @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.
1160
+ */
1161
+ createNavigation({ body } = {}) {
1162
+ const { error } = ContentValidator.createNavigation().validate(
1163
+ {
1164
+ body,
1165
+ },
1166
+ { abortEarly: false, allowUnknown: true }
1167
+ );
1168
+ if (error) {
1169
+ return Promise.reject(new FDKClientValidationError(error));
1170
+ }
1171
+
1172
+ const query_params = {};
1173
+
1174
+ return PlatformAPIClient.execute(
1175
+ this.config,
1176
+ "post",
1177
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/navigations/`,
1178
+ query_params,
1179
+ body
1180
+ );
1181
+ }
1182
+
1183
+ /**
1184
+ * @param {Object} arg - Arg object.
1185
+ * @summary: Get default navigations
1186
+ * @description: On any website (application), there are navigations that are present by default. Use this API to retrieve those default navigations.
1187
+ */
1188
+ getDefaultNavigations({} = {}) {
1189
+ const { error } = ContentValidator.getDefaultNavigations().validate(
1190
+ {},
1191
+ { abortEarly: false, allowUnknown: true }
1192
+ );
1193
+ if (error) {
1194
+ return Promise.reject(new FDKClientValidationError(error));
1195
+ }
1196
+
1197
+ const query_params = {};
1198
+
1199
+ return PlatformAPIClient.execute(
1200
+ this.config,
1201
+ "get",
1202
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/navigations/default`,
1203
+ query_params,
1204
+ undefined
1205
+ );
1206
+ }
1207
+
1208
+ /**
1209
+ * @param {Object} arg - Arg object.
1210
+ * @param {string} arg.slug - A short, human-readable, URL-friendly
1211
+ * identifier of a navigation. You can get slug value of a navigation from
1212
+ * `getNavigations` API.
1213
+ * @param {string} arg.devicePlatform - Filter navigations by platform.
1214
+ * Acceptable values are: web, android, ios, all
1215
+ * @summary: Get a navigation by slug
1216
+ * @description: Use this API to retrieve a navigation by its slug.
1217
+ */
1218
+ getNavigationBySlug({ slug, devicePlatform } = {}) {
1219
+ const { error } = ContentValidator.getNavigationBySlug().validate(
1220
+ {
1221
+ slug,
1222
+ devicePlatform,
1223
+ },
1224
+ { abortEarly: false, allowUnknown: true }
1225
+ );
1226
+ if (error) {
1227
+ return Promise.reject(new FDKClientValidationError(error));
1228
+ }
1229
+
1230
+ const query_params = {};
1231
+ query_params["device_platform"] = devicePlatform;
1232
+
1233
+ return PlatformAPIClient.execute(
1234
+ this.config,
1235
+ "get",
1236
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/navigations/${slug}`,
1237
+ query_params,
1238
+ undefined
1239
+ );
1240
+ }
1241
+
1242
+ /**
1243
+ * @param {Object} arg - Arg object.
1244
+ * @param {string} arg.id - ID allotted to the navigation.
1245
+ * @param {NavigationRequest} arg.body
1246
+ * @summary: Update a navigation
1247
+ * @description: Use this API to edit the details of an existing navigation.
1248
+ */
1249
+ updateNavigation({ id, body } = {}) {
1250
+ const { error } = ContentValidator.updateNavigation().validate(
1251
+ {
1252
+ id,
1253
+ body,
1254
+ },
1255
+ { abortEarly: false, allowUnknown: true }
1256
+ );
1257
+ if (error) {
1258
+ return Promise.reject(new FDKClientValidationError(error));
1259
+ }
1260
+
1261
+ const query_params = {};
1262
+
1263
+ return PlatformAPIClient.execute(
1264
+ this.config,
1265
+ "put",
1266
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/navigations/${id}`,
1267
+ query_params,
1268
+ body
1269
+ );
1270
+ }
1271
+
1272
+ /**
1273
+ * @param {Object} arg - Arg object.
1274
+ * @param {string} arg.id - ID allotted to the navigation.
1275
+ * @summary: Delete a navigation
1276
+ * @description: Use this API to delete an existing navigation.
1277
+ */
1278
+ deleteNavigation({ id } = {}) {
1279
+ const { error } = ContentValidator.deleteNavigation().validate(
1280
+ {
1281
+ id,
1282
+ },
1283
+ { abortEarly: false, allowUnknown: true }
1284
+ );
1285
+ if (error) {
1286
+ return Promise.reject(new FDKClientValidationError(error));
1287
+ }
1288
+
1289
+ const query_params = {};
1290
+
1291
+ return PlatformAPIClient.execute(
1292
+ this.config,
1293
+ "delete",
1294
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/navigations/${id}`,
1295
+ query_params,
1296
+ undefined
1297
+ );
1298
+ }
1299
+
1300
+ /**
1301
+ * @param {Object} arg - Arg object.
1302
+ * @summary: Get page meta
1303
+ * @description: Use this API to get the meta of custom pages (blog, page) and default system pages (e.g. home/brand/category/collection).
1304
+ */
1305
+ getPageMeta({} = {}) {
1306
+ const { error } = ContentValidator.getPageMeta().validate(
1307
+ {},
1308
+ { abortEarly: false, allowUnknown: true }
1309
+ );
1310
+ if (error) {
1311
+ return Promise.reject(new FDKClientValidationError(error));
1312
+ }
1313
+
1314
+ const query_params = {};
1315
+
1316
+ return PlatformAPIClient.execute(
1317
+ this.config,
1318
+ "get",
1319
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/pages/meta`,
1320
+ query_params,
1321
+ undefined
1322
+ );
1323
+ }
1324
+
1325
+ /**
1326
+ * @param {Object} arg - Arg object.
1327
+ * @summary: Get page spec
1328
+ * @description: Use this API to get the specifications of a page, such as page type, display name, params and query.
1329
+ */
1330
+ getPageSpec({} = {}) {
1331
+ const { error } = ContentValidator.getPageSpec().validate(
1332
+ {},
1333
+ { abortEarly: false, allowUnknown: true }
1334
+ );
1335
+ if (error) {
1336
+ return Promise.reject(new FDKClientValidationError(error));
1337
+ }
1338
+
1339
+ const query_params = {};
1340
+
1341
+ return PlatformAPIClient.execute(
1342
+ this.config,
1343
+ "get",
1344
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/pages/spec`,
1345
+ query_params,
1346
+ undefined
1347
+ );
1348
+ }
1349
+
1350
+ /**
1351
+ * @param {Object} arg - Arg object.
1352
+ * @param {PageRequest} arg.body
1353
+ * @summary: Create a page preview
1354
+ * @description: Use this API to create a page preview to check the appearance of a custom page.
1355
+ */
1356
+ createPagePreview({ body } = {}) {
1357
+ const { error } = ContentValidator.createPagePreview().validate(
1358
+ {
1359
+ body,
1360
+ },
1361
+ { abortEarly: false, allowUnknown: true }
1362
+ );
1363
+ if (error) {
1364
+ return Promise.reject(new FDKClientValidationError(error));
1365
+ }
1366
+
1367
+ const query_params = {};
1368
+
1369
+ return PlatformAPIClient.execute(
1370
+ this.config,
1371
+ "post",
1372
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/pages/preview/`,
1373
+ query_params,
1374
+ body
1375
+ );
1376
+ }
1377
+
1378
+ /**
1379
+ * @param {Object} arg - Arg object.
1380
+ * @param {string} arg.slug - A short, human-readable, URL-friendly
1381
+ * identifier of a page. You can get slug value of a page from `getPages` API.
1382
+ * @param {PagePublishRequest} arg.body
1383
+ * @summary: Change the publish status of a page
1384
+ * @description: Use this API to change the publish status of an existing page. Allows you to publish and unpublish the page.
1385
+ */
1386
+ updatePagePreview({ slug, body } = {}) {
1387
+ const { error } = ContentValidator.updatePagePreview().validate(
1388
+ {
1389
+ slug,
1390
+ body,
1391
+ },
1392
+ { abortEarly: false, allowUnknown: true }
1393
+ );
1394
+ if (error) {
1395
+ return Promise.reject(new FDKClientValidationError(error));
1396
+ }
1397
+
1398
+ const query_params = {};
1399
+
1400
+ return PlatformAPIClient.execute(
1401
+ this.config,
1402
+ "put",
1403
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/pages/publish/${slug}`,
1404
+ query_params,
1405
+ body
1406
+ );
1407
+ }
1408
+
1409
+ /**
1410
+ * @param {Object} arg - Arg object.
1411
+ * @param {string} arg.id - ID allotted to the page.
1412
+ * @summary: Delete a page
1413
+ * @description: Use this API to delete an existing page.
1414
+ */
1415
+ deletePage({ id } = {}) {
1416
+ const { error } = ContentValidator.deletePage().validate(
1417
+ {
1418
+ id,
1419
+ },
1420
+ { abortEarly: false, allowUnknown: true }
1421
+ );
1422
+ if (error) {
1423
+ return Promise.reject(new FDKClientValidationError(error));
1424
+ }
1425
+
1426
+ const query_params = {};
1427
+
1428
+ return PlatformAPIClient.execute(
1429
+ this.config,
1430
+ "delete",
1431
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/pages/${id}`,
1432
+ query_params,
1433
+ undefined
1434
+ );
1435
+ }
1436
+
1437
+ /**
1438
+ * @param {Object} arg - Arg object.
1439
+ * @param {PathMappingSchema} arg.body
1440
+ * @summary: Save path based redirection rules
1441
+ * @description: Use this API to add redirection rules
1442
+ */
1443
+ addPathRedirectionRules({ body } = {}) {
1444
+ const { error } = ContentValidator.addPathRedirectionRules().validate(
1445
+ {
1446
+ body,
1447
+ },
1448
+ { abortEarly: false, allowUnknown: true }
1449
+ );
1450
+ if (error) {
1451
+ return Promise.reject(new FDKClientValidationError(error));
1452
+ }
1453
+
1454
+ const query_params = {};
1455
+
1456
+ return PlatformAPIClient.execute(
1457
+ this.config,
1458
+ "post",
1459
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/path-mappings`,
1460
+ query_params,
1461
+ body
1462
+ );
1463
+ }
1464
+
1465
+ /**
1466
+ * @param {Object} arg - Arg object.
1467
+ * @param {number} [arg.pageSize] - The number of items to retrieve in each
1468
+ * page. Default value is 5.
1469
+ * @param {number} [arg.pageNo] - The page number to navigate through the
1470
+ * given set of results. Default value is 1.
1471
+ * @summary: Get path based redirection rules
1472
+ * @description: Use this API to get path based redirection rules.
1473
+ */
1474
+ getPathRedirectionRules({ pageSize, pageNo } = {}) {
1475
+ const { error } = ContentValidator.getPathRedirectionRules().validate(
1476
+ {
1477
+ pageSize,
1478
+ pageNo,
1479
+ },
1480
+ { abortEarly: false, allowUnknown: true }
1481
+ );
1482
+ if (error) {
1483
+ return Promise.reject(new FDKClientValidationError(error));
1484
+ }
1485
+
1486
+ const query_params = {};
1487
+ query_params["page_size"] = pageSize;
1488
+ query_params["page_no"] = pageNo;
1489
+
1490
+ return PlatformAPIClient.execute(
1491
+ this.config,
1492
+ "get",
1493
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/path-mappings`,
1494
+ query_params,
1495
+ undefined
1496
+ );
1497
+ }
1498
+
1499
+ /**
1500
+ * @param {Object} arg - Arg object.
1501
+ * @param {string} arg.pathId - ID allotted to the path redirection rule.
1502
+ * @summary: Get path based redirection rule
1503
+ * @description: Use this API to get path based redirection rule.
1504
+ */
1505
+ getPathRedirectionRule({ pathId } = {}) {
1506
+ const { error } = ContentValidator.getPathRedirectionRule().validate(
1507
+ {
1508
+ pathId,
1509
+ },
1510
+ { abortEarly: false, allowUnknown: true }
1511
+ );
1512
+ if (error) {
1513
+ return Promise.reject(new FDKClientValidationError(error));
1514
+ }
1515
+
1516
+ const query_params = {};
1517
+
1518
+ return PlatformAPIClient.execute(
1519
+ this.config,
1520
+ "get",
1521
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/path-mappings/${pathId}`,
1522
+ query_params,
1523
+ undefined
1524
+ );
1525
+ }
1526
+
1527
+ /**
1528
+ * @param {Object} arg - Arg object.
1529
+ * @param {string} arg.pathId - ID allotted to the path redirection rule.
1530
+ * @param {PathMappingSchema} arg.body
1531
+ * @summary: Update path based redirection rules
1532
+ * @description: Use this API to update redirection rules
1533
+ */
1534
+ updatePathRedirectionRules({ pathId, body } = {}) {
1535
+ const { error } = ContentValidator.updatePathRedirectionRules().validate(
1536
+ {
1537
+ pathId,
1538
+ body,
1539
+ },
1540
+ { abortEarly: false, allowUnknown: true }
1541
+ );
1542
+ if (error) {
1543
+ return Promise.reject(new FDKClientValidationError(error));
1544
+ }
1545
+
1546
+ const query_params = {};
1547
+
1548
+ return PlatformAPIClient.execute(
1549
+ this.config,
1550
+ "put",
1551
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/path-mappings/${pathId}`,
1552
+ query_params,
1553
+ body
1554
+ );
1555
+ }
1556
+
1557
+ /**
1558
+ * @param {Object} arg - Arg object.
1559
+ * @param {string} arg.pathId - ID allotted to the path redirection rule.
1560
+ * @summary: Delete path based redirection rules
1561
+ * @description: Use this API to delete redirection rules
1562
+ */
1563
+ deletePathRedirectionRules({ pathId } = {}) {
1564
+ const { error } = ContentValidator.deletePathRedirectionRules().validate(
1565
+ {
1566
+ pathId,
1567
+ },
1568
+ { abortEarly: false, allowUnknown: true }
1569
+ );
1570
+ if (error) {
1571
+ return Promise.reject(new FDKClientValidationError(error));
1572
+ }
1573
+
1574
+ const query_params = {};
1575
+
1576
+ return PlatformAPIClient.execute(
1577
+ this.config,
1578
+ "delete",
1579
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/path-mappings/${pathId}`,
1580
+ query_params,
1581
+ undefined
1582
+ );
1583
+ }
1584
+
1585
+ /**
1586
+ * @param {Object} arg - Arg object.
1587
+ * @summary: Get SEO configuration of an application
1588
+ * @description: Use this API to know how the SEO is configured in the application. This includes the sitemap, robot.txt, custom meta tags, etc.
1589
+ */
1590
+ getSEOConfiguration({} = {}) {
1591
+ const { error } = ContentValidator.getSEOConfiguration().validate(
1592
+ {},
1593
+ { abortEarly: false, allowUnknown: true }
1594
+ );
1595
+ if (error) {
1596
+ return Promise.reject(new FDKClientValidationError(error));
1597
+ }
1598
+
1599
+ const query_params = {};
1600
+
1601
+ return PlatformAPIClient.execute(
1602
+ this.config,
1603
+ "get",
1604
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/seo`,
1605
+ query_params,
1606
+ undefined
1607
+ );
1608
+ }
1609
+
1610
+ /**
1611
+ * @param {Object} arg - Arg object.
1612
+ * @param {SeoComponent} arg.body
1613
+ * @summary: Update SEO of application
1614
+ * @description: Use this API to edit the SEO details of an application. This includes the sitemap, robot.txt, custom meta tags, etc.
1615
+ */
1616
+ updateSEOConfiguration({ body } = {}) {
1617
+ const { error } = ContentValidator.updateSEOConfiguration().validate(
1618
+ {
1619
+ body,
1620
+ },
1621
+ { abortEarly: false, allowUnknown: true }
1622
+ );
1623
+ if (error) {
1624
+ return Promise.reject(new FDKClientValidationError(error));
1625
+ }
1626
+
1627
+ const query_params = {};
1628
+
1629
+ return PlatformAPIClient.execute(
1630
+ this.config,
1631
+ "post",
1632
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/seo`,
1633
+ query_params,
1634
+ body
1635
+ );
1636
+ }
1637
+
1638
+ /**
1639
+ * @param {Object} arg - Arg object.
1640
+ * @param {string} arg.devicePlatform - Filter slideshows by platform.
1641
+ * Acceptable values are: web, android, ios and all
1642
+ * @param {number} [arg.pageNo] - The page number to navigate through the
1643
+ * given set of results. Default value is 1.
1644
+ * @param {number} [arg.pageSize] - The number of items to retrieve in each
1645
+ * page. Default value is 10.
1646
+ * @summary: Get slideshows
1647
+ * @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.
1648
+ */
1649
+ getSlideshows({ devicePlatform, pageNo, pageSize } = {}) {
1650
+ const { error } = ContentValidator.getSlideshows().validate(
1651
+ {
1652
+ devicePlatform,
1653
+ pageNo,
1654
+ pageSize,
1655
+ },
1656
+ { abortEarly: false, allowUnknown: true }
1657
+ );
1658
+ if (error) {
1659
+ return Promise.reject(new FDKClientValidationError(error));
1660
+ }
1661
+
1662
+ const query_params = {};
1663
+ query_params["device_platform"] = devicePlatform;
1664
+ query_params["page_no"] = pageNo;
1665
+ query_params["page_size"] = pageSize;
1666
+
1667
+ return PlatformAPIClient.execute(
1668
+ this.config,
1669
+ "get",
1670
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/slideshows/`,
1671
+ query_params,
1672
+ undefined
1673
+ );
1674
+ }
1675
+
1676
+ /**
1677
+ * @param {Object} arg - Arg object.
1678
+ * @param {string} arg.companyId - Numeric ID allotted to a business account
1679
+ * on Fynd Platform
1680
+ * @param {string} arg.applicationId - Numeric ID allotted to an application
1681
+ * created within a business account.
1682
+ * @param {string} arg.devicePlatform - Filter slideshows by platform.
1683
+ * Acceptable values are: web, android, ios and all
1684
+ * @param {number} [arg.pageSize] - The number of items to retrieve in each
1685
+ * page. Default value is 10.
1686
+ * @summary: Get slideshows
1687
+ * @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.
1688
+ */
1689
+ getSlideshowsPaginator({
1690
+ companyId,
1691
+ applicationId,
1692
+ devicePlatform,
1693
+ pageSize,
1694
+ } = {}) {
1695
+ const paginator = new Paginator();
1696
+ const callback = async () => {
1697
+ const pageId = paginator.nextId;
1698
+ const pageNo = paginator.pageNo;
1699
+ const pageType = "number";
1700
+ const data = await this.getSlideshows({
1701
+ companyId: companyId,
1702
+ applicationId: applicationId,
1703
+ devicePlatform: devicePlatform,
1704
+ pageNo: pageNo,
1705
+ pageSize: pageSize,
1706
+ });
1707
+ paginator.setPaginator({
1708
+ hasNext: data.page.has_next ? true : false,
1709
+ nextId: data.page.next_id,
1710
+ });
1711
+ return data;
1712
+ };
1713
+ paginator.setCallback(callback.bind(this));
1714
+ return paginator;
1715
+ }
1716
+
1717
+ /**
1718
+ * @param {Object} arg - Arg object.
1719
+ * @param {SlideshowRequest} arg.body
1720
+ * @summary: Create a slideshow
1721
+ * @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.
1722
+ */
1723
+ createSlideshow({ body } = {}) {
1724
+ const { error } = ContentValidator.createSlideshow().validate(
1725
+ {
1726
+ body,
1727
+ },
1728
+ { abortEarly: false, allowUnknown: true }
1729
+ );
1730
+ if (error) {
1731
+ return Promise.reject(new FDKClientValidationError(error));
1732
+ }
1733
+
1734
+ const query_params = {};
1735
+
1736
+ return PlatformAPIClient.execute(
1737
+ this.config,
1738
+ "post",
1739
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/slideshows/`,
1740
+ query_params,
1741
+ body
1742
+ );
1743
+ }
1744
+
1745
+ /**
1746
+ * @param {Object} arg - Arg object.
1747
+ * @param {string} arg.slug - A short, human-readable, URL-friendly
1748
+ * identifier of a slideshow. You can get slug value of a page from
1749
+ * `getSlideshows` API.
1750
+ * @param {string} arg.devicePlatform - Filter slideshows by platform.
1751
+ * Acceptable values are: web, android, ios and all
1752
+ * @summary: Get slideshow by slug
1753
+ * @description: Use this API to retrieve the details of a slideshow by its slug.
1754
+ */
1755
+ getSlideshowBySlug({ slug, devicePlatform } = {}) {
1756
+ const { error } = ContentValidator.getSlideshowBySlug().validate(
1757
+ {
1758
+ slug,
1759
+ devicePlatform,
1760
+ },
1761
+ { abortEarly: false, allowUnknown: true }
1762
+ );
1763
+ if (error) {
1764
+ return Promise.reject(new FDKClientValidationError(error));
1765
+ }
1766
+
1767
+ const query_params = {};
1768
+ query_params["device_platform"] = devicePlatform;
1769
+
1770
+ return PlatformAPIClient.execute(
1771
+ this.config,
1772
+ "get",
1773
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/slideshows/${slug}`,
1774
+ query_params,
1775
+ undefined
1776
+ );
1777
+ }
1778
+
1779
+ /**
1780
+ * @param {Object} arg - Arg object.
1781
+ * @param {string} arg.id - ID allotted to the slideshow.
1782
+ * @param {SlideshowRequest} arg.body
1783
+ * @summary: Update a slideshow
1784
+ * @description: Use this API to edit the details of an existing slideshow.
1785
+ */
1786
+ updateSlideshow({ id, body } = {}) {
1787
+ const { error } = ContentValidator.updateSlideshow().validate(
1788
+ {
1789
+ id,
1790
+ body,
1791
+ },
1792
+ { abortEarly: false, allowUnknown: true }
1793
+ );
1794
+ if (error) {
1795
+ return Promise.reject(new FDKClientValidationError(error));
1796
+ }
1797
+
1798
+ const query_params = {};
1799
+
1800
+ return PlatformAPIClient.execute(
1801
+ this.config,
1802
+ "put",
1803
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/slideshows/${id}`,
1804
+ query_params,
1805
+ body
1806
+ );
1807
+ }
1808
+
1809
+ /**
1810
+ * @param {Object} arg - Arg object.
1811
+ * @param {string} arg.id - ID allotted to the slideshow.
1812
+ * @summary: Delete a slideshow
1813
+ * @description: Use this API to delete an existing slideshow.
1814
+ */
1815
+ deleteSlideshow({ id } = {}) {
1816
+ const { error } = ContentValidator.deleteSlideshow().validate(
1817
+ {
1818
+ id,
1819
+ },
1820
+ { abortEarly: false, allowUnknown: true }
1821
+ );
1822
+ if (error) {
1823
+ return Promise.reject(new FDKClientValidationError(error));
1824
+ }
1825
+
1826
+ const query_params = {};
1827
+
1828
+ return PlatformAPIClient.execute(
1829
+ this.config,
1830
+ "delete",
1831
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/slideshows/${id}`,
1832
+ query_params,
1833
+ undefined
1834
+ );
1835
+ }
1836
+
1837
+ /**
1838
+ * @param {Object} arg - Arg object.
1839
+ * @summary: Get support information
1840
+ * @description: Use this API to get the contact details for customer support, including emails and phone numbers.
1841
+ */
1842
+ getSupportInformation({} = {}) {
1843
+ const { error } = ContentValidator.getSupportInformation().validate(
1844
+ {},
1845
+ { abortEarly: false, allowUnknown: true }
1846
+ );
1847
+ if (error) {
1848
+ return Promise.reject(new FDKClientValidationError(error));
1849
+ }
1850
+
1851
+ const query_params = {};
1852
+
1853
+ return PlatformAPIClient.execute(
1854
+ this.config,
1855
+ "get",
1856
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/support`,
1857
+ query_params,
1858
+ undefined
1859
+ );
1860
+ }
1861
+
1862
+ /**
1863
+ * @param {Object} arg - Arg object.
1864
+ * @param {Support} arg.body
1865
+ * @summary: Update the support data of an application
1866
+ * @description: Use this API to edit the existing contact details for customer support, including emails and phone numbers.
1867
+ */
1868
+ updateSupportInformation({ body } = {}) {
1869
+ const { error } = ContentValidator.updateSupportInformation().validate(
1870
+ {
1871
+ body,
1872
+ },
1873
+ { abortEarly: false, allowUnknown: true }
1874
+ );
1875
+ if (error) {
1876
+ return Promise.reject(new FDKClientValidationError(error));
1877
+ }
1878
+
1879
+ const query_params = {};
1880
+
1881
+ return PlatformAPIClient.execute(
1882
+ this.config,
1883
+ "post",
1884
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/support`,
1885
+ query_params,
1886
+ body
1887
+ );
1888
+ }
1889
+
1890
+ /**
1891
+ * @param {Object} arg - Arg object.
1892
+ * @param {CreateTagRequestSchema} arg.body
1893
+ * @summary: Update a tag
1894
+ * @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.
1895
+ */
1896
+ updateInjectableTag({ body } = {}) {
1897
+ const { error } = ContentValidator.updateInjectableTag().validate(
1898
+ {
1899
+ body,
1900
+ },
1901
+ { abortEarly: false, allowUnknown: true }
1902
+ );
1903
+ if (error) {
1904
+ return Promise.reject(new FDKClientValidationError(error));
1905
+ }
1906
+
1907
+ const query_params = {};
1908
+
1909
+ return PlatformAPIClient.execute(
1910
+ this.config,
1911
+ "put",
1912
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/tags`,
1913
+ query_params,
1914
+ body
1915
+ );
1916
+ }
1917
+
1918
+ /**
1919
+ * @param {Object} arg - Arg object.
1920
+ * @summary: Delete tags in application
1921
+ * @description: Use this API to delete all the existing tags at once.
1922
+ */
1923
+ deleteAllInjectableTags({} = {}) {
1924
+ const { error } = ContentValidator.deleteAllInjectableTags().validate(
1925
+ {},
1926
+ { abortEarly: false, allowUnknown: true }
1927
+ );
1928
+ if (error) {
1929
+ return Promise.reject(new FDKClientValidationError(error));
1930
+ }
1931
+
1932
+ const query_params = {};
1933
+
1934
+ return PlatformAPIClient.execute(
1935
+ this.config,
1936
+ "delete",
1937
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/tags`,
1938
+ query_params,
1939
+ undefined
1940
+ );
1941
+ }
1942
+
1943
+ /**
1944
+ * @param {Object} arg - Arg object.
1945
+ * @summary: Get all the tags in an application
1946
+ * @description: Use this API to get all the CSS and JS injected in the application in the form of tags.
1947
+ */
1948
+ getInjectableTags({} = {}) {
1949
+ const { error } = ContentValidator.getInjectableTags().validate(
1950
+ {},
1951
+ { abortEarly: false, allowUnknown: true }
1952
+ );
1953
+ if (error) {
1954
+ return Promise.reject(new FDKClientValidationError(error));
1955
+ }
1956
+
1957
+ const query_params = {};
1958
+
1959
+ return PlatformAPIClient.execute(
1960
+ this.config,
1961
+ "get",
1962
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/tags`,
1963
+ query_params,
1964
+ undefined
1965
+ );
1966
+ }
1967
+
1968
+ /**
1969
+ * @param {Object} arg - Arg object.
1970
+ * @param {CreateTagRequestSchema} arg.body
1971
+ * @summary: Add a tag
1972
+ * @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.
1973
+ */
1974
+ addInjectableTag({ body } = {}) {
1975
+ const { error } = ContentValidator.addInjectableTag().validate(
1976
+ {
1977
+ body,
1978
+ },
1979
+ { abortEarly: false, allowUnknown: true }
1980
+ );
1981
+ if (error) {
1982
+ return Promise.reject(new FDKClientValidationError(error));
1983
+ }
1984
+
1985
+ const query_params = {};
1986
+
1987
+ return PlatformAPIClient.execute(
1988
+ this.config,
1989
+ "put",
1990
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/tags/add`,
1991
+ query_params,
1992
+ body
1993
+ );
1994
+ }
1995
+
1996
+ /**
1997
+ * @param {Object} arg - Arg object.
1998
+ * @param {RemoveHandpickedSchema} arg.body
1999
+ * @summary: Remove a tag
2000
+ * @description: Use this API to delete an existing tag.
2001
+ */
2002
+ removeInjectableTag({ body } = {}) {
2003
+ const { error } = ContentValidator.removeInjectableTag().validate(
2004
+ {
2005
+ body,
2006
+ },
2007
+ { abortEarly: false, allowUnknown: true }
2008
+ );
2009
+ if (error) {
2010
+ return Promise.reject(new FDKClientValidationError(error));
2011
+ }
2012
+
2013
+ const query_params = {};
2014
+
2015
+ return PlatformAPIClient.execute(
2016
+ this.config,
2017
+ "put",
2018
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/tags/remove/handpicked`,
2019
+ query_params,
2020
+ body
2021
+ );
2022
+ }
2023
+
2024
+ /**
2025
+ * @param {Object} arg - Arg object.
2026
+ * @param {string} arg.tagId - ID allotted to the tag.
2027
+ * @param {UpdateHandpickedSchema} arg.body
2028
+ * @summary: Edit a tag by id
2029
+ * @description: Use this API to edit the details of an existing tag by its ID.
2030
+ */
2031
+ editInjectableTag({ tagId, body } = {}) {
2032
+ const { error } = ContentValidator.editInjectableTag().validate(
2033
+ {
2034
+ tagId,
2035
+ body,
2036
+ },
2037
+ { abortEarly: false, allowUnknown: true }
2038
+ );
2039
+ if (error) {
2040
+ return Promise.reject(new FDKClientValidationError(error));
2041
+ }
2042
+
2043
+ const query_params = {};
2044
+
2045
+ return PlatformAPIClient.execute(
2046
+ this.config,
2047
+ "put",
2048
+ `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/tags/edit/handpicked/${tagId}`,
2049
+ query_params,
2050
+ body
2051
+ );
2052
+ }
2053
+
2054
+ /**
2055
+ * @param {Object} arg - Arg object.
2056
+ * @param {PageRequest} arg.body
2057
+ * @summary: Create a page
2058
+ * @description: Use this API to create a custom page using a title, seo, publish status, feature image, tags, meta, etc.
2059
+ */
2060
+ createPage({ body } = {}) {
2061
+ const { error } = ContentValidator.createPage().validate(
2062
+ {
2063
+ body,
2064
+ },
2065
+ { abortEarly: false, allowUnknown: true }
2066
+ );
2067
+ if (error) {
2068
+ return Promise.reject(new FDKClientValidationError(error));
2069
+ }
2070
+
2071
+ const query_params = {};
2072
+
2073
+ return PlatformAPIClient.execute(
2074
+ this.config,
2075
+ "post",
2076
+ `/service/platform/content/v2.0/company/${this.config.companyId}/application/${this.applicationId}/pages/`,
2077
+ query_params,
2078
+ body
2079
+ );
2080
+ }
2081
+
2082
+ /**
2083
+ * @param {Object} arg - Arg object.
2084
+ * @param {number} [arg.pageNo] - The page number to navigate through the
2085
+ * given set of results. Default value is 1.
2086
+ * @param {number} [arg.pageSize] - The number of items to retrieve in each
2087
+ * page. Default value is 10.
2088
+ * @summary: Get a list of pages
2089
+ * @description: Use this API to retrieve a list of pages.
2090
+ */
2091
+ getPages({ pageNo, pageSize } = {}) {
2092
+ const { error } = ContentValidator.getPages().validate(
2093
+ {
2094
+ pageNo,
2095
+ pageSize,
2096
+ },
2097
+ { abortEarly: false, allowUnknown: true }
2098
+ );
2099
+ if (error) {
2100
+ return Promise.reject(new FDKClientValidationError(error));
2101
+ }
2102
+
2103
+ const query_params = {};
2104
+ query_params["page_no"] = pageNo;
2105
+ query_params["page_size"] = pageSize;
2106
+
2107
+ return PlatformAPIClient.execute(
2108
+ this.config,
2109
+ "get",
2110
+ `/service/platform/content/v2.0/company/${this.config.companyId}/application/${this.applicationId}/pages/`,
2111
+ query_params,
2112
+ undefined
2113
+ );
2114
+ }
2115
+
2116
+ /**
2117
+ * @param {Object} arg - Arg object.
2118
+ * @param {string} arg.companyId - Numeric ID allotted to a business account
2119
+ * on Fynd Platform
2120
+ * @param {string} arg.applicationId - Numeric ID allotted to an application
2121
+ * created within a business account.
2122
+ * @param {number} [arg.pageSize] - The number of items to retrieve in each
2123
+ * page. Default value is 10.
2124
+ * @summary: Get a list of pages
2125
+ * @description: Use this API to retrieve a list of pages.
2126
+ */
2127
+ getPagesPaginator({ companyId, applicationId, pageSize } = {}) {
2128
+ const paginator = new Paginator();
2129
+ const callback = async () => {
2130
+ const pageId = paginator.nextId;
2131
+ const pageNo = paginator.pageNo;
2132
+ const pageType = "number";
2133
+ const data = await this.getPages({
2134
+ companyId: companyId,
2135
+ applicationId: applicationId,
2136
+ pageNo: pageNo,
2137
+ pageSize: pageSize,
2138
+ });
2139
+ paginator.setPaginator({
2140
+ hasNext: data.page.has_next ? true : false,
2141
+ nextId: data.page.next_id,
2142
+ });
2143
+ return data;
2144
+ };
2145
+ paginator.setCallback(callback.bind(this));
2146
+ return paginator;
2147
+ }
2148
+
2149
+ /**
2150
+ * @param {Object} arg - Arg object.
2151
+ * @param {string} arg.id - ID allotted to the page.
2152
+ * @param {PageSchema} arg.body
2153
+ * @summary: Update a page
2154
+ * @description: Use this API to edit the details of an existing page, such as its title, seo, publish status, feature image, tags, schedule, etc.
2155
+ */
2156
+ updatePage({ id, body } = {}) {
2157
+ const { error } = ContentValidator.updatePage().validate(
2158
+ {
2159
+ id,
2160
+ body,
2161
+ },
2162
+ { abortEarly: false, allowUnknown: true }
2163
+ );
2164
+ if (error) {
2165
+ return Promise.reject(new FDKClientValidationError(error));
2166
+ }
2167
+
2168
+ const query_params = {};
2169
+
2170
+ return PlatformAPIClient.execute(
2171
+ this.config,
2172
+ "put",
2173
+ `/service/platform/content/v2.0/company/${this.config.companyId}/application/${this.applicationId}/pages/${id}`,
2174
+ query_params,
2175
+ body
2176
+ );
2177
+ }
2178
+
2179
+ /**
2180
+ * @param {Object} arg - Arg object.
2181
+ * @param {string} arg.slug - A short, human-readable, URL-friendly
2182
+ * identifier of a page. You can get slug value of a page from `getPages` API.
2183
+ * @summary: Get pages by component Id
2184
+ * @description: Use this API to retrieve the components of a page, such as its title, seo, publish status, feature image, tags, schedule, etc.
2185
+ */
2186
+ getPageBySlug({ slug } = {}) {
2187
+ const { error } = ContentValidator.getPageBySlug().validate(
2188
+ {
2189
+ slug,
2190
+ },
2191
+ { abortEarly: false, allowUnknown: true }
2192
+ );
2193
+ if (error) {
2194
+ return Promise.reject(new FDKClientValidationError(error));
2195
+ }
2196
+
2197
+ const query_params = {};
2198
+
2199
+ return PlatformAPIClient.execute(
2200
+ this.config,
2201
+ "get",
2202
+ `/service/platform/content/v2.0/company/${this.config.companyId}/application/${this.applicationId}/pages/${slug}`,
2203
+ query_params,
2204
+ undefined
2205
+ );
2206
+ }
2207
+ }
2208
+ module.exports = Content;