@gofynd/fdk-client-javascript 0.1.35

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 (277) hide show
  1. package/.github/workflows/on_create_release.yml +23 -0
  2. package/.github/workflows/on_merge_main.yml +38 -0
  3. package/.github/workflows/on_pull_request.yml +35 -0
  4. package/.prettierrc +5 -0
  5. package/LICENSE +21 -0
  6. package/README.md +118 -0
  7. package/application.d.ts +3 -0
  8. package/application.js +6 -0
  9. package/common.d.ts +4 -0
  10. package/common.js +9 -0
  11. package/documentation/application/CART.md +7290 -0
  12. package/documentation/application/CATALOG.md +9570 -0
  13. package/documentation/application/COMMON.md +448 -0
  14. package/documentation/application/COMMUNICATION.md +463 -0
  15. package/documentation/application/CONFIGURATION.md +2902 -0
  16. package/documentation/application/CONTENT.md +3350 -0
  17. package/documentation/application/FILESTORAGE.md +491 -0
  18. package/documentation/application/LEAD.md +1891 -0
  19. package/documentation/application/LOGISTIC.md +439 -0
  20. package/documentation/application/ORDER.md +3428 -0
  21. package/documentation/application/PAYMENT.md +5035 -0
  22. package/documentation/application/POSCART.md +7889 -0
  23. package/documentation/application/README.md +21 -0
  24. package/documentation/application/REWARDS.md +714 -0
  25. package/documentation/application/SHARE.md +729 -0
  26. package/documentation/application/THEME.md +5796 -0
  27. package/documentation/application/USER.md +4326 -0
  28. package/documentation/platform/ANALYTICS.md +1150 -0
  29. package/documentation/platform/AUDITTRAIL.md +572 -0
  30. package/documentation/platform/BILLING.md +2396 -0
  31. package/documentation/platform/CART.md +5539 -0
  32. package/documentation/platform/CATALOG.md +21624 -0
  33. package/documentation/platform/COMMON.md +448 -0
  34. package/documentation/platform/COMMUNICATION.md +5714 -0
  35. package/documentation/platform/COMPANYPROFILE.md +2141 -0
  36. package/documentation/platform/CONFIGURATION.md +7335 -0
  37. package/documentation/platform/CONTENT.md +8989 -0
  38. package/documentation/platform/DISCOUNT.md +773 -0
  39. package/documentation/platform/FILESTORAGE.md +994 -0
  40. package/documentation/platform/INVENTORY.md +1775 -0
  41. package/documentation/platform/LEAD.md +4736 -0
  42. package/documentation/platform/ORDER.md +3764 -0
  43. package/documentation/platform/PARTNER.md +216 -0
  44. package/documentation/platform/PAYMENT.md +3444 -0
  45. package/documentation/platform/README.md +27 -0
  46. package/documentation/platform/REWARDS.md +871 -0
  47. package/documentation/platform/SHARE.md +602 -0
  48. package/documentation/platform/THEME.md +35725 -0
  49. package/documentation/platform/USER.md +2305 -0
  50. package/documentation/platform/WEBHOOK.md +587 -0
  51. package/documentation/public/CONFIGURATION.md +448 -0
  52. package/documentation/public/INVENTORY.md +686 -0
  53. package/documentation/public/WEBHOOK.md +348 -0
  54. package/index.d.ts +10 -0
  55. package/index.js +18 -0
  56. package/jest.config.d.ts +4 -0
  57. package/jest.config.js +6 -0
  58. package/package.json +35 -0
  59. package/platform.d.ts +3 -0
  60. package/platform.js +6 -0
  61. package/public.d.ts +3 -0
  62. package/public.js +6 -0
  63. package/sdk/application/ApplicationAPIClient.d.ts +11 -0
  64. package/sdk/application/ApplicationAPIClient.js +44 -0
  65. package/sdk/application/ApplicationClient.d.ts +40 -0
  66. package/sdk/application/ApplicationClient.js +84 -0
  67. package/sdk/application/ApplicationConfig.d.ts +19 -0
  68. package/sdk/application/ApplicationConfig.js +55 -0
  69. package/sdk/application/ApplicationModels.d.ts +826 -0
  70. package/sdk/application/ApplicationModels.js +10474 -0
  71. package/sdk/application/client/CartApplicationClient.d.ts +432 -0
  72. package/sdk/application/client/CartApplicationClient.js +1066 -0
  73. package/sdk/application/client/CatalogApplicationClient.d.ts +694 -0
  74. package/sdk/application/client/CatalogApplicationClient.js +1629 -0
  75. package/sdk/application/client/CommonApplicationClient.d.ts +38 -0
  76. package/sdk/application/client/CommonApplicationClient.js +105 -0
  77. package/sdk/application/client/CommunicationApplicationClient.d.ts +39 -0
  78. package/sdk/application/client/CommunicationApplicationClient.js +131 -0
  79. package/sdk/application/client/ConfigurationApplicationClient.d.ts +210 -0
  80. package/sdk/application/client/ConfigurationApplicationClient.js +649 -0
  81. package/sdk/application/client/ContentApplicationClient.d.ts +256 -0
  82. package/sdk/application/client/ContentApplicationClient.js +785 -0
  83. package/sdk/application/client/FileStorageApplicationClient.d.ts +88 -0
  84. package/sdk/application/client/FileStorageApplicationClient.js +214 -0
  85. package/sdk/application/client/LeadApplicationClient.d.ts +90 -0
  86. package/sdk/application/client/LeadApplicationClient.js +264 -0
  87. package/sdk/application/client/LogisticApplicationClient.d.ts +42 -0
  88. package/sdk/application/client/LogisticApplicationClient.js +128 -0
  89. package/sdk/application/client/OrderApplicationClient.d.ts +190 -0
  90. package/sdk/application/client/OrderApplicationClient.js +479 -0
  91. package/sdk/application/client/PaymentApplicationClient.d.ts +454 -0
  92. package/sdk/application/client/PaymentApplicationClient.js +1378 -0
  93. package/sdk/application/client/PosCartApplicationClient.d.ts +449 -0
  94. package/sdk/application/client/PosCartApplicationClient.js +1123 -0
  95. package/sdk/application/client/RewardsApplicationClient.d.ts +93 -0
  96. package/sdk/application/client/RewardsApplicationClient.js +293 -0
  97. package/sdk/application/client/ShareApplicationClient.d.ts +87 -0
  98. package/sdk/application/client/ShareApplicationClient.js +268 -0
  99. package/sdk/application/client/ThemeApplicationClient.d.ts +52 -0
  100. package/sdk/application/client/ThemeApplicationClient.js +161 -0
  101. package/sdk/application/client/UserApplicationClient.d.ts +446 -0
  102. package/sdk/application/client/UserApplicationClient.js +1275 -0
  103. package/sdk/application/constructUrl.d.ts +5 -0
  104. package/sdk/application/constructUrl.js +13 -0
  105. package/sdk/application/index.d.ts +2 -0
  106. package/sdk/application/index.js +4 -0
  107. package/sdk/application/models/CartValidator.d.ts +29 -0
  108. package/sdk/application/models/CartValidator.js +223 -0
  109. package/sdk/application/models/CatalogValidator.d.ts +33 -0
  110. package/sdk/application/models/CatalogValidator.js +233 -0
  111. package/sdk/application/models/CommonValidator.d.ts +5 -0
  112. package/sdk/application/models/CommonValidator.js +18 -0
  113. package/sdk/application/models/CommunicationValidator.d.ts +6 -0
  114. package/sdk/application/models/CommunicationValidator.js +20 -0
  115. package/sdk/application/models/ConfigurationValidator.d.ts +19 -0
  116. package/sdk/application/models/ConfigurationValidator.js +88 -0
  117. package/sdk/application/models/ContentValidator.d.ts +22 -0
  118. package/sdk/application/models/ContentValidator.js +106 -0
  119. package/sdk/application/models/FileStorageValidator.d.ts +6 -0
  120. package/sdk/application/models/FileStorageValidator.js +24 -0
  121. package/sdk/application/models/LeadValidator.d.ts +10 -0
  122. package/sdk/application/models/LeadValidator.js +48 -0
  123. package/sdk/application/models/LogisticValidator.d.ts +6 -0
  124. package/sdk/application/models/LogisticValidator.js +22 -0
  125. package/sdk/application/models/OrderValidator.d.ts +15 -0
  126. package/sdk/application/models/OrderValidator.js +87 -0
  127. package/sdk/application/models/PaymentValidator.d.ts +40 -0
  128. package/sdk/application/models/PaymentValidator.js +235 -0
  129. package/sdk/application/models/PosCartValidator.d.ts +30 -0
  130. package/sdk/application/models/PosCartValidator.js +232 -0
  131. package/sdk/application/models/RewardsValidator.d.ts +10 -0
  132. package/sdk/application/models/RewardsValidator.js +43 -0
  133. package/sdk/application/models/ShareValidator.d.ts +10 -0
  134. package/sdk/application/models/ShareValidator.js +44 -0
  135. package/sdk/application/models/ThemeValidator.d.ts +7 -0
  136. package/sdk/application/models/ThemeValidator.js +27 -0
  137. package/sdk/application/models/UserValidator.d.ts +38 -0
  138. package/sdk/application/models/UserValidator.js +233 -0
  139. package/sdk/common/AxiosHelper.d.ts +1 -0
  140. package/sdk/common/AxiosHelper.js +141 -0
  141. package/sdk/common/Constant.d.ts +294 -0
  142. package/sdk/common/Constant.js +332 -0
  143. package/sdk/common/FDKError.d.ts +26 -0
  144. package/sdk/common/FDKError.js +51 -0
  145. package/sdk/common/Logger.d.ts +2 -0
  146. package/sdk/common/Logger.js +85 -0
  147. package/sdk/common/Paginator.d.ts +16 -0
  148. package/sdk/common/Paginator.js +26 -0
  149. package/sdk/common/RequestSigner.d.ts +1 -0
  150. package/sdk/common/RequestSigner.js +306 -0
  151. package/sdk/common/Utility.d.ts +9 -0
  152. package/sdk/common/Utility.js +86 -0
  153. package/sdk/common/utils.d.ts +14 -0
  154. package/sdk/common/utils.js +165 -0
  155. package/sdk/platform/OAuthClient.d.ts +26 -0
  156. package/sdk/platform/OAuthClient.js +221 -0
  157. package/sdk/platform/PlatformAPIClient.d.ts +12 -0
  158. package/sdk/platform/PlatformAPIClient.js +43 -0
  159. package/sdk/platform/PlatformApplicationClient.d.ts +24398 -0
  160. package/sdk/platform/PlatformApplicationClient.js +23185 -0
  161. package/sdk/platform/PlatformApplicationModels.d.ts +333 -0
  162. package/sdk/platform/PlatformApplicationModels.js +21262 -0
  163. package/sdk/platform/PlatformClient.d.ts +9535 -0
  164. package/sdk/platform/PlatformClient.js +12336 -0
  165. package/sdk/platform/PlatformConfig.d.ts +29 -0
  166. package/sdk/platform/PlatformConfig.js +36 -0
  167. package/sdk/platform/PlatformModels.d.ts +1396 -0
  168. package/sdk/platform/PlatformModels.js +19222 -0
  169. package/sdk/platform/client/AnalyticsPlatformClient.d.ts +84 -0
  170. package/sdk/platform/client/AnalyticsPlatformClient.js +215 -0
  171. package/sdk/platform/client/AuditTrailPlatformClient.d.ts +38 -0
  172. package/sdk/platform/client/AuditTrailPlatformClient.js +133 -0
  173. package/sdk/platform/client/BillingPlatformClient.d.ts +109 -0
  174. package/sdk/platform/client/BillingPlatformClient.js +381 -0
  175. package/sdk/platform/client/CatalogPlatformClient.d.ts +806 -0
  176. package/sdk/platform/client/CatalogPlatformClient.js +2462 -0
  177. package/sdk/platform/client/CommonPlatformClient.d.ts +30 -0
  178. package/sdk/platform/client/CommonPlatformClient.js +84 -0
  179. package/sdk/platform/client/CommunicationPlatformClient.d.ts +26 -0
  180. package/sdk/platform/client/CommunicationPlatformClient.js +72 -0
  181. package/sdk/platform/client/CompanyProfilePlatformClient.d.ts +182 -0
  182. package/sdk/platform/client/CompanyProfilePlatformClient.js +540 -0
  183. package/sdk/platform/client/ConfigurationPlatformClient.d.ts +277 -0
  184. package/sdk/platform/client/ConfigurationPlatformClient.js +806 -0
  185. package/sdk/platform/client/DiscountPlatformClient.d.ts +118 -0
  186. package/sdk/platform/client/DiscountPlatformClient.js +364 -0
  187. package/sdk/platform/client/FileStoragePlatformClient.d.ts +111 -0
  188. package/sdk/platform/client/FileStoragePlatformClient.js +268 -0
  189. package/sdk/platform/client/InventoryPlatformClient.d.ts +125 -0
  190. package/sdk/platform/client/InventoryPlatformClient.js +409 -0
  191. package/sdk/platform/client/LeadPlatformClient.d.ts +150 -0
  192. package/sdk/platform/client/LeadPlatformClient.js +439 -0
  193. package/sdk/platform/client/OrderPlatformClient.d.ts +190 -0
  194. package/sdk/platform/client/OrderPlatformClient.js +521 -0
  195. package/sdk/platform/client/PaymentPlatformClient.d.ts +98 -0
  196. package/sdk/platform/client/PaymentPlatformClient.js +331 -0
  197. package/sdk/platform/client/WebhookPlatformClient.d.ts +64 -0
  198. package/sdk/platform/client/WebhookPlatformClient.js +207 -0
  199. package/sdk/platform/index.d.ts +2 -0
  200. package/sdk/platform/index.js +4 -0
  201. package/sdk/platform/models/AnalyticsValidator.d.ts +7 -0
  202. package/sdk/platform/models/AnalyticsValidator.js +36 -0
  203. package/sdk/platform/models/AuditTrailValidator.d.ts +7 -0
  204. package/sdk/platform/models/AuditTrailValidator.js +26 -0
  205. package/sdk/platform/models/BillingValidator.d.ts +15 -0
  206. package/sdk/platform/models/BillingValidator.js +72 -0
  207. package/sdk/platform/models/CartValidator.d.ts +0 -0
  208. package/sdk/platform/models/CartValidator.js +0 -0
  209. package/sdk/platform/models/CatalogValidator.d.ts +74 -0
  210. package/sdk/platform/models/CatalogValidator.js +484 -0
  211. package/sdk/platform/models/CommonValidator.d.ts +5 -0
  212. package/sdk/platform/models/CommonValidator.js +18 -0
  213. package/sdk/platform/models/CommunicationValidator.d.ts +4 -0
  214. package/sdk/platform/models/CommunicationValidator.js +11 -0
  215. package/sdk/platform/models/CompanyProfileValidator.d.ts +17 -0
  216. package/sdk/platform/models/CompanyProfileValidator.js +93 -0
  217. package/sdk/platform/models/ConfigurationValidator.d.ts +21 -0
  218. package/sdk/platform/models/ConfigurationValidator.js +134 -0
  219. package/sdk/platform/models/ContentValidator.d.ts +0 -0
  220. package/sdk/platform/models/ContentValidator.js +0 -0
  221. package/sdk/platform/models/DiscountValidator.d.ts +13 -0
  222. package/sdk/platform/models/DiscountValidator.js +75 -0
  223. package/sdk/platform/models/FileStorageValidator.d.ts +9 -0
  224. package/sdk/platform/models/FileStorageValidator.js +44 -0
  225. package/sdk/platform/models/InventoryValidator.d.ts +15 -0
  226. package/sdk/platform/models/InventoryValidator.js +81 -0
  227. package/sdk/platform/models/LeadValidator.d.ts +14 -0
  228. package/sdk/platform/models/LeadValidator.js +78 -0
  229. package/sdk/platform/models/OrderValidator.d.ts +14 -0
  230. package/sdk/platform/models/OrderValidator.js +110 -0
  231. package/sdk/platform/models/PartnerValidator.d.ts +0 -0
  232. package/sdk/platform/models/PartnerValidator.js +0 -0
  233. package/sdk/platform/models/PaymentValidator.d.ts +13 -0
  234. package/sdk/platform/models/PaymentValidator.js +65 -0
  235. package/sdk/platform/models/RewardsValidator.d.ts +0 -0
  236. package/sdk/platform/models/RewardsValidator.js +0 -0
  237. package/sdk/platform/models/ShareValidator.d.ts +0 -0
  238. package/sdk/platform/models/ShareValidator.js +0 -0
  239. package/sdk/platform/models/ThemeValidator.d.ts +0 -0
  240. package/sdk/platform/models/ThemeValidator.js +0 -0
  241. package/sdk/platform/models/UserValidator.d.ts +0 -0
  242. package/sdk/platform/models/UserValidator.js +0 -0
  243. package/sdk/platform/models/WebhookValidator.d.ts +9 -0
  244. package/sdk/platform/models/WebhookValidator.js +42 -0
  245. package/sdk/public/PublicAPIClient.d.ts +11 -0
  246. package/sdk/public/PublicAPIClient.js +38 -0
  247. package/sdk/public/PublicClient.d.ts +12 -0
  248. package/sdk/public/PublicClient.js +24 -0
  249. package/sdk/public/PublicConfig.d.ts +10 -0
  250. package/sdk/public/PublicConfig.js +12 -0
  251. package/sdk/public/PublicModels.d.ts +50 -0
  252. package/sdk/public/PublicModels.js +712 -0
  253. package/sdk/public/client/ConfigurationPublicClient.d.ts +38 -0
  254. package/sdk/public/client/ConfigurationPublicClient.js +102 -0
  255. package/sdk/public/client/InventoryPublicClient.d.ts +81 -0
  256. package/sdk/public/client/InventoryPublicClient.js +239 -0
  257. package/sdk/public/client/WebhookPublicClient.d.ts +28 -0
  258. package/sdk/public/client/WebhookPublicClient.js +92 -0
  259. package/sdk/public/constructUrl.d.ts +5 -0
  260. package/sdk/public/constructUrl.js +13 -0
  261. package/sdk/public/index.d.ts +2 -0
  262. package/sdk/public/index.js +4 -0
  263. package/sdk/public/models/ConfigurationValidator.d.ts +5 -0
  264. package/sdk/public/models/ConfigurationValidator.js +18 -0
  265. package/sdk/public/models/InventoryValidator.d.ts +9 -0
  266. package/sdk/public/models/InventoryValidator.js +43 -0
  267. package/sdk/public/models/WebhookValidator.d.ts +5 -0
  268. package/sdk/public/models/WebhookValidator.js +14 -0
  269. package/tests/application/catalog.spec.js +47 -0
  270. package/tests/common/action-url.spec.js +35 -0
  271. package/tests/common/schema/action-url.json +163 -0
  272. package/tests/common/schema/url-action.json +667 -0
  273. package/tests/common/url-action.spec.js +48 -0
  274. package/tests/helpers/cookie.helper.js +31 -0
  275. package/tests/helpers/oauth.helper.js +43 -0
  276. package/tests/platform/catalog.spec.js +49 -0
  277. package/tests/public/location.spec.js +39 -0
@@ -0,0 +1,785 @@
1
+ const APIClient = require("../ApplicationAPIClient");
2
+ const Paginator = require("../../common/Paginator");
3
+ const constructUrl = require("../constructUrl");
4
+ const { FDKClientValidationError } = require("../../common/FDKError");
5
+ const ContentValidator = require("../models/ContentValidator");
6
+
7
+ class Content {
8
+ constructor(_conf) {
9
+ this._conf = _conf;
10
+ this._relativeUrls = {
11
+ getAnnouncements: "/service/application/content/v1.0/announcements",
12
+ getBlog: "/service/application/content/v1.0/blogs/{slug}",
13
+ getBlogs: "/service/application/content/v1.0/blogs/",
14
+ getDataLoaders: "/service/application/content/v1.0/data-loader",
15
+ getFaqs: "/service/application/content/v1.0/faq",
16
+ getFaqCategories: "/service/application/content/v1.0/faq/categories",
17
+ getFaqBySlug: "/service/application/content/v1.0/faq/{slug}",
18
+ getFaqCategoryBySlug:
19
+ "/service/application/content/v1.0/faq/category/{slug}",
20
+ getFaqsByCategorySlug:
21
+ "/service/application/content/v1.0/faq/category/{slug}/faqs",
22
+ getLandingPage: "/service/application/content/v1.0/landing-page",
23
+ getLegalInformation: "/service/application/content/v1.0/legal",
24
+ getNavigations: "/service/application/content/v1.0/navigations/",
25
+ getSEOConfiguration: "/service/application/content/v1.0/seo",
26
+ getSlideshows: "/service/application/content/v1.0/slideshow/",
27
+ getSlideshow: "/service/application/content/v1.0/slideshow/{slug}",
28
+ getSupportInformation: "/service/application/content/v1.0/support",
29
+ getTags: "/service/application/content/v1.0/tags",
30
+ getPage: "/service/application/content/v2.0/pages/{slug}",
31
+ getPages: "/service/application/content/v2.0/pages/",
32
+ };
33
+ this._urls = Object.entries(this._relativeUrls).reduce(
34
+ (urls, [method, relativeUrl]) => {
35
+ urls[method] = `${_conf.domain}${relativeUrl}`;
36
+ return urls;
37
+ },
38
+ {}
39
+ );
40
+ }
41
+
42
+ updateUrls(urls) {
43
+ this._urls = {
44
+ ...this._urls,
45
+ ...urls,
46
+ };
47
+ }
48
+
49
+ /**
50
+ * @param {Object} arg - Arg object.
51
+ * @returns {Promise<AnnouncementsResponseSchema>} - Success response
52
+ * @summary: Get live announcements
53
+ * @description: Announcements are useful to highlight a message or information on top of a webpage. Use this API to retrieve live announcements. Get announcements on individual pages or for all pages.
54
+ */
55
+ getAnnouncements({} = {}) {
56
+ const { error } = ContentValidator.getAnnouncements().validate(
57
+ {},
58
+ { abortEarly: false, allowUnknown: true }
59
+ );
60
+ if (error) {
61
+ return Promise.reject(new FDKClientValidationError(error));
62
+ }
63
+ const query_params = {};
64
+
65
+ const xHeaders = {};
66
+
67
+ return APIClient.execute(
68
+ this._conf,
69
+ "get",
70
+ constructUrl({
71
+ url: this._urls["getAnnouncements"],
72
+ params: {},
73
+ }),
74
+ query_params,
75
+ undefined,
76
+ xHeaders
77
+ );
78
+ }
79
+
80
+ /**
81
+ * @param {Object} arg - Arg object.
82
+ * @param {string} arg.slug - A short, human-readable, URL-friendly
83
+ * identifier of a blog. You can get slug value from the endpoint
84
+ * /service/application/content/v1.0/blogs/.
85
+ * @param {string} [arg.rootId] - ID given to the HTML element
86
+ * @returns {Promise<BlogSchema>} - Success response
87
+ * @summary: Get a blog
88
+ * @description: Use this API to get the details of a blog using its slug. Details include the title, reading time, publish status, feature image, tags, author, etc.
89
+ */
90
+ getBlog({ slug, rootId } = {}) {
91
+ const { error } = ContentValidator.getBlog().validate(
92
+ { slug, rootId },
93
+ { abortEarly: false, allowUnknown: true }
94
+ );
95
+ if (error) {
96
+ return Promise.reject(new FDKClientValidationError(error));
97
+ }
98
+ const query_params = {};
99
+ query_params["root_id"] = rootId;
100
+
101
+ const xHeaders = {};
102
+
103
+ return APIClient.execute(
104
+ this._conf,
105
+ "get",
106
+ constructUrl({
107
+ url: this._urls["getBlog"],
108
+ params: { slug },
109
+ }),
110
+ query_params,
111
+ undefined,
112
+ xHeaders
113
+ );
114
+ }
115
+
116
+ /**
117
+ * @param {Object} arg - Arg object.
118
+ * @param {number} [arg.pageNo] - The page number to navigate through the
119
+ * given set of results. Default value is 1.
120
+ * @param {number} [arg.pageSize] - The number of items to retrieve in each page.
121
+ * @returns {Promise<BlogGetResponse>} - Success response
122
+ * @summary: Get a list of blogs
123
+ * @description: Use this API to get all the blogs.
124
+ */
125
+ getBlogs({ pageNo, pageSize } = {}) {
126
+ const { error } = ContentValidator.getBlogs().validate(
127
+ { pageNo, pageSize },
128
+ { abortEarly: false, allowUnknown: true }
129
+ );
130
+ if (error) {
131
+ return Promise.reject(new FDKClientValidationError(error));
132
+ }
133
+ const query_params = {};
134
+ query_params["page_no"] = pageNo;
135
+ query_params["page_size"] = pageSize;
136
+
137
+ const xHeaders = {};
138
+
139
+ return APIClient.execute(
140
+ this._conf,
141
+ "get",
142
+ constructUrl({
143
+ url: this._urls["getBlogs"],
144
+ params: {},
145
+ }),
146
+ query_params,
147
+ undefined,
148
+ xHeaders
149
+ );
150
+ }
151
+
152
+ /**
153
+ * @param {Object} arg - Arg object.
154
+ * @param {number} [arg.pageSize] - The number of items to retrieve in each page.
155
+ * @summary: Get a list of blogs
156
+ * @description: Use this API to get all the blogs.
157
+ */
158
+ getBlogsPaginator({ pageSize } = {}) {
159
+ const paginator = new Paginator();
160
+ const callback = async () => {
161
+ const pageId = paginator.nextId;
162
+ const pageNo = paginator.pageNo;
163
+ const pageType = "number";
164
+ const data = await this.getBlogs({
165
+ pageNo: pageNo,
166
+ pageSize: pageSize,
167
+ });
168
+ paginator.setPaginator({
169
+ hasNext: data.page.has_next ? true : false,
170
+ nextId: data.page.next_id,
171
+ });
172
+ return data;
173
+ };
174
+ paginator.setCallback(callback);
175
+ return paginator;
176
+ }
177
+
178
+ /**
179
+ * @param {Object} arg - Arg object.
180
+ * @returns {Promise<DataLoadersSchema>} - Success response
181
+ * @summary: Get the data loaders associated with an application
182
+ * @description: Use this API to get all selected data loaders of the application in the form of tags.
183
+ */
184
+ getDataLoaders({} = {}) {
185
+ const { error } = ContentValidator.getDataLoaders().validate(
186
+ {},
187
+ { abortEarly: false, allowUnknown: true }
188
+ );
189
+ if (error) {
190
+ return Promise.reject(new FDKClientValidationError(error));
191
+ }
192
+ const query_params = {};
193
+
194
+ const xHeaders = {};
195
+
196
+ return APIClient.execute(
197
+ this._conf,
198
+ "get",
199
+ constructUrl({
200
+ url: this._urls["getDataLoaders"],
201
+ params: {},
202
+ }),
203
+ query_params,
204
+ undefined,
205
+ xHeaders
206
+ );
207
+ }
208
+
209
+ /**
210
+ * @param {Object} arg - Arg object.
211
+ * @returns {Promise<FaqResponseSchema>} - Success response
212
+ * @summary: Get a list of FAQs
213
+ * @description: Use this API to get a list of frequently asked questions. Users will benefit from it when facing any issue with the website.
214
+ */
215
+ getFaqs({} = {}) {
216
+ const { error } = ContentValidator.getFaqs().validate(
217
+ {},
218
+ { abortEarly: false, allowUnknown: true }
219
+ );
220
+ if (error) {
221
+ return Promise.reject(new FDKClientValidationError(error));
222
+ }
223
+ const query_params = {};
224
+
225
+ const xHeaders = {};
226
+
227
+ return APIClient.execute(
228
+ this._conf,
229
+ "get",
230
+ constructUrl({
231
+ url: this._urls["getFaqs"],
232
+ params: {},
233
+ }),
234
+ query_params,
235
+ undefined,
236
+ xHeaders
237
+ );
238
+ }
239
+
240
+ /**
241
+ * @param {Object} arg - Arg object.
242
+ * @returns {Promise<GetFaqCategoriesSchema>} - Success response
243
+ * @summary: Get a list of FAQ categories
244
+ * @description: FAQs can be divided into categories. Use this API to get a list of FAQ categories.
245
+ */
246
+ getFaqCategories({} = {}) {
247
+ const { error } = ContentValidator.getFaqCategories().validate(
248
+ {},
249
+ { abortEarly: false, allowUnknown: true }
250
+ );
251
+ if (error) {
252
+ return Promise.reject(new FDKClientValidationError(error));
253
+ }
254
+ const query_params = {};
255
+
256
+ const xHeaders = {};
257
+
258
+ return APIClient.execute(
259
+ this._conf,
260
+ "get",
261
+ constructUrl({
262
+ url: this._urls["getFaqCategories"],
263
+ params: {},
264
+ }),
265
+ query_params,
266
+ undefined,
267
+ xHeaders
268
+ );
269
+ }
270
+
271
+ /**
272
+ * @param {Object} arg - Arg object.
273
+ * @param {string} arg.slug - A short, human-readable, URL-friendly
274
+ * identifier of an FAQ. You can get slug value from the endpoint
275
+ * /service/application/content/v1.0/faq.
276
+ * @returns {Promise<FaqSchema>} - Success response
277
+ * @summary: Get an FAQ
278
+ * @description: Use this API to get a particular FAQ by its slug.
279
+ */
280
+ getFaqBySlug({ slug } = {}) {
281
+ const { error } = ContentValidator.getFaqBySlug().validate(
282
+ { slug },
283
+ { abortEarly: false, allowUnknown: true }
284
+ );
285
+ if (error) {
286
+ return Promise.reject(new FDKClientValidationError(error));
287
+ }
288
+ const query_params = {};
289
+
290
+ const xHeaders = {};
291
+
292
+ return APIClient.execute(
293
+ this._conf,
294
+ "get",
295
+ constructUrl({
296
+ url: this._urls["getFaqBySlug"],
297
+ params: { slug },
298
+ }),
299
+ query_params,
300
+ undefined,
301
+ xHeaders
302
+ );
303
+ }
304
+
305
+ /**
306
+ * @param {Object} arg - Arg object.
307
+ * @param {string} arg.slug - A short, human-readable, URL-friendly
308
+ * identifier of an FAQ category. You can get slug value from the endpoint
309
+ * /service/application/content/v1.0/faq/categories.
310
+ * @returns {Promise<GetFaqCategoryBySlugSchema>} - Success response
311
+ * @summary: Get the FAQ category
312
+ * @description: FAQs can be divided into categories. Use this API to get the category to which an FAQ belongs.
313
+ */
314
+ getFaqCategoryBySlug({ slug } = {}) {
315
+ const { error } = ContentValidator.getFaqCategoryBySlug().validate(
316
+ { slug },
317
+ { abortEarly: false, allowUnknown: true }
318
+ );
319
+ if (error) {
320
+ return Promise.reject(new FDKClientValidationError(error));
321
+ }
322
+ const query_params = {};
323
+
324
+ const xHeaders = {};
325
+
326
+ return APIClient.execute(
327
+ this._conf,
328
+ "get",
329
+ constructUrl({
330
+ url: this._urls["getFaqCategoryBySlug"],
331
+ params: { slug },
332
+ }),
333
+ query_params,
334
+ undefined,
335
+ xHeaders
336
+ );
337
+ }
338
+
339
+ /**
340
+ * @param {Object} arg - Arg object.
341
+ * @param {string} arg.slug - A short, human-readable, URL-friendly
342
+ * identifier of an FAQ category. You can get slug value from the endpoint
343
+ * /service/application/content/v1.0/faq/categories.
344
+ * @returns {Promise<GetFaqSchema>} - Success response
345
+ * @summary: Get FAQs using the slug of FAQ category
346
+ * @description: FAQs can be divided into categories. Use this API to get all the FAQs belonging to a category by using the category slug.
347
+ */
348
+ getFaqsByCategorySlug({ slug } = {}) {
349
+ const { error } = ContentValidator.getFaqsByCategorySlug().validate(
350
+ { slug },
351
+ { abortEarly: false, allowUnknown: true }
352
+ );
353
+ if (error) {
354
+ return Promise.reject(new FDKClientValidationError(error));
355
+ }
356
+ const query_params = {};
357
+
358
+ const xHeaders = {};
359
+
360
+ return APIClient.execute(
361
+ this._conf,
362
+ "get",
363
+ constructUrl({
364
+ url: this._urls["getFaqsByCategorySlug"],
365
+ params: { slug },
366
+ }),
367
+ query_params,
368
+ undefined,
369
+ xHeaders
370
+ );
371
+ }
372
+
373
+ /**
374
+ * @param {Object} arg - Arg object.
375
+ * @returns {Promise<LandingPageSchema>} - Success response
376
+ * @summary: Get the landing page
377
+ * @description: Landing page is the first page that a prospect lands upon while visiting a website. Use this API to fetch the details of a landing page.
378
+ */
379
+ getLandingPage({} = {}) {
380
+ const { error } = ContentValidator.getLandingPage().validate(
381
+ {},
382
+ { abortEarly: false, allowUnknown: true }
383
+ );
384
+ if (error) {
385
+ return Promise.reject(new FDKClientValidationError(error));
386
+ }
387
+ const query_params = {};
388
+
389
+ const xHeaders = {};
390
+
391
+ return APIClient.execute(
392
+ this._conf,
393
+ "get",
394
+ constructUrl({
395
+ url: this._urls["getLandingPage"],
396
+ params: {},
397
+ }),
398
+ query_params,
399
+ undefined,
400
+ xHeaders
401
+ );
402
+ }
403
+
404
+ /**
405
+ * @param {Object} arg - Arg object.
406
+ * @returns {Promise<ApplicationLegal>} - Success response
407
+ * @summary: Get legal information
408
+ * @description: Use this API to get the legal information of an application, which includes Privacy Policy, Terms and Conditions, Shipping Policy and FAQs regarding the usage of the application.
409
+ */
410
+ getLegalInformation({} = {}) {
411
+ const { error } = ContentValidator.getLegalInformation().validate(
412
+ {},
413
+ { abortEarly: false, allowUnknown: true }
414
+ );
415
+ if (error) {
416
+ return Promise.reject(new FDKClientValidationError(error));
417
+ }
418
+ const query_params = {};
419
+
420
+ const xHeaders = {};
421
+
422
+ return APIClient.execute(
423
+ this._conf,
424
+ "get",
425
+ constructUrl({
426
+ url: this._urls["getLegalInformation"],
427
+ params: {},
428
+ }),
429
+ query_params,
430
+ undefined,
431
+ xHeaders
432
+ );
433
+ }
434
+
435
+ /**
436
+ * @param {Object} arg - Arg object.
437
+ * @param {number} [arg.pageNo] - The page number to navigate through the
438
+ * given set of results. Default value is 1.
439
+ * @param {number} [arg.pageSize] - The number of items to retrieve in each page.
440
+ * @returns {Promise<NavigationGetResponse>} - Success response
441
+ * @summary: Get the navigation
442
+ * @description: Use this API to fetch the navigations details which includes the items of the navigation pane. It also shows the links and sub-navigations.
443
+ */
444
+ getNavigations({ pageNo, pageSize } = {}) {
445
+ const { error } = ContentValidator.getNavigations().validate(
446
+ { pageNo, pageSize },
447
+ { abortEarly: false, allowUnknown: true }
448
+ );
449
+ if (error) {
450
+ return Promise.reject(new FDKClientValidationError(error));
451
+ }
452
+ const query_params = {};
453
+ query_params["page_no"] = pageNo;
454
+ query_params["page_size"] = pageSize;
455
+
456
+ const xHeaders = {};
457
+
458
+ return APIClient.execute(
459
+ this._conf,
460
+ "get",
461
+ constructUrl({
462
+ url: this._urls["getNavigations"],
463
+ params: {},
464
+ }),
465
+ query_params,
466
+ undefined,
467
+ xHeaders
468
+ );
469
+ }
470
+
471
+ /**
472
+ * @param {Object} arg - Arg object.
473
+ * @param {number} [arg.pageSize] - The number of items to retrieve in each page.
474
+ * @summary: Get the navigation
475
+ * @description: Use this API to fetch the navigations details which includes the items of the navigation pane. It also shows the links and sub-navigations.
476
+ */
477
+ getNavigationsPaginator({ pageSize } = {}) {
478
+ const paginator = new Paginator();
479
+ const callback = async () => {
480
+ const pageId = paginator.nextId;
481
+ const pageNo = paginator.pageNo;
482
+ const pageType = "number";
483
+ const data = await this.getNavigations({
484
+ pageNo: pageNo,
485
+ pageSize: pageSize,
486
+ });
487
+ paginator.setPaginator({
488
+ hasNext: data.page.has_next ? true : false,
489
+ nextId: data.page.next_id,
490
+ });
491
+ return data;
492
+ };
493
+ paginator.setCallback(callback);
494
+ return paginator;
495
+ }
496
+
497
+ /**
498
+ * @param {Object} arg - Arg object.
499
+ * @returns {Promise<SeoComponent>} - Success response
500
+ * @summary: Get the SEO of an application
501
+ * @description: Use this API to get the SEO details of an application, which includes a robot.txt, meta-tags and sitemap.
502
+ */
503
+ getSEOConfiguration({} = {}) {
504
+ const { error } = ContentValidator.getSEOConfiguration().validate(
505
+ {},
506
+ { abortEarly: false, allowUnknown: true }
507
+ );
508
+ if (error) {
509
+ return Promise.reject(new FDKClientValidationError(error));
510
+ }
511
+ const query_params = {};
512
+
513
+ const xHeaders = {};
514
+
515
+ return APIClient.execute(
516
+ this._conf,
517
+ "get",
518
+ constructUrl({
519
+ url: this._urls["getSEOConfiguration"],
520
+ params: {},
521
+ }),
522
+ query_params,
523
+ undefined,
524
+ xHeaders
525
+ );
526
+ }
527
+
528
+ /**
529
+ * @param {Object} arg - Arg object.
530
+ * @param {number} [arg.pageNo] - The page number to navigate through the
531
+ * given set of results. Default value is 1.
532
+ * @param {number} [arg.pageSize] - The number of items to retrieve in each page.
533
+ * @returns {Promise<SlideshowGetResponse>} - Success response
534
+ * @summary: Get the slideshows
535
+ * @description: Use this API to get a list of slideshows along with their details.
536
+ */
537
+ getSlideshows({ pageNo, pageSize } = {}) {
538
+ const { error } = ContentValidator.getSlideshows().validate(
539
+ { pageNo, pageSize },
540
+ { abortEarly: false, allowUnknown: true }
541
+ );
542
+ if (error) {
543
+ return Promise.reject(new FDKClientValidationError(error));
544
+ }
545
+ const query_params = {};
546
+ query_params["page_no"] = pageNo;
547
+ query_params["page_size"] = pageSize;
548
+
549
+ const xHeaders = {};
550
+
551
+ return APIClient.execute(
552
+ this._conf,
553
+ "get",
554
+ constructUrl({
555
+ url: this._urls["getSlideshows"],
556
+ params: {},
557
+ }),
558
+ query_params,
559
+ undefined,
560
+ xHeaders
561
+ );
562
+ }
563
+
564
+ /**
565
+ * @param {Object} arg - Arg object.
566
+ * @param {number} [arg.pageSize] - The number of items to retrieve in each page.
567
+ * @summary: Get the slideshows
568
+ * @description: Use this API to get a list of slideshows along with their details.
569
+ */
570
+ getSlideshowsPaginator({ pageSize } = {}) {
571
+ const paginator = new Paginator();
572
+ const callback = async () => {
573
+ const pageId = paginator.nextId;
574
+ const pageNo = paginator.pageNo;
575
+ const pageType = "number";
576
+ const data = await this.getSlideshows({
577
+ pageNo: pageNo,
578
+ pageSize: pageSize,
579
+ });
580
+ paginator.setPaginator({
581
+ hasNext: data.page.has_next ? true : false,
582
+ nextId: data.page.next_id,
583
+ });
584
+ return data;
585
+ };
586
+ paginator.setCallback(callback);
587
+ return paginator;
588
+ }
589
+
590
+ /**
591
+ * @param {Object} arg - Arg object.
592
+ * @param {string} arg.slug - A short, human-readable, URL-friendly
593
+ * identifier of a slideshow. You can get slug value from the endpoint
594
+ * /service/application/content/v1.0/slideshow/.
595
+ * @returns {Promise<SlideshowSchema>} - Success response
596
+ * @summary: Get a slideshow
597
+ * @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 slideshow using its `slug`.
598
+ */
599
+ getSlideshow({ slug } = {}) {
600
+ const { error } = ContentValidator.getSlideshow().validate(
601
+ { slug },
602
+ { abortEarly: false, allowUnknown: true }
603
+ );
604
+ if (error) {
605
+ return Promise.reject(new FDKClientValidationError(error));
606
+ }
607
+ const query_params = {};
608
+
609
+ const xHeaders = {};
610
+
611
+ return APIClient.execute(
612
+ this._conf,
613
+ "get",
614
+ constructUrl({
615
+ url: this._urls["getSlideshow"],
616
+ params: { slug },
617
+ }),
618
+ query_params,
619
+ undefined,
620
+ xHeaders
621
+ );
622
+ }
623
+
624
+ /**
625
+ * @param {Object} arg - Arg object.
626
+ * @returns {Promise<Support>} - Success response
627
+ * @summary: Get the support information
628
+ * @description: Use this API to get contact details for customer support including emails and phone numbers.
629
+ */
630
+ getSupportInformation({} = {}) {
631
+ const { error } = ContentValidator.getSupportInformation().validate(
632
+ {},
633
+ { abortEarly: false, allowUnknown: true }
634
+ );
635
+ if (error) {
636
+ return Promise.reject(new FDKClientValidationError(error));
637
+ }
638
+ const query_params = {};
639
+
640
+ const xHeaders = {};
641
+
642
+ return APIClient.execute(
643
+ this._conf,
644
+ "get",
645
+ constructUrl({
646
+ url: this._urls["getSupportInformation"],
647
+ params: {},
648
+ }),
649
+ query_params,
650
+ undefined,
651
+ xHeaders
652
+ );
653
+ }
654
+
655
+ /**
656
+ * @param {Object} arg - Arg object.
657
+ * @returns {Promise<TagsSchema>} - Success response
658
+ * @summary: Get the tags associated with an application
659
+ * @description: Use this API to get all the CSS and JS injected in the application in the form of tags.
660
+ */
661
+ getTags({} = {}) {
662
+ const { error } = ContentValidator.getTags().validate(
663
+ {},
664
+ { abortEarly: false, allowUnknown: true }
665
+ );
666
+ if (error) {
667
+ return Promise.reject(new FDKClientValidationError(error));
668
+ }
669
+ const query_params = {};
670
+
671
+ const xHeaders = {};
672
+
673
+ return APIClient.execute(
674
+ this._conf,
675
+ "get",
676
+ constructUrl({
677
+ url: this._urls["getTags"],
678
+ params: {},
679
+ }),
680
+ query_params,
681
+ undefined,
682
+ xHeaders
683
+ );
684
+ }
685
+
686
+ /**
687
+ * @param {Object} arg - Arg object.
688
+ * @param {string} arg.slug - A short, human-readable, URL-friendly
689
+ * identifier of a page. You can get slug value from the endpoint
690
+ * /service/application/content/v2.0/pages/.
691
+ * @param {string} [arg.rootId] - ID given to the HTML element
692
+ * @returns {Promise<PageSchema>} - Success response
693
+ * @summary: Get a page
694
+ * @description: Use this API to get the details of a page using its slug. Details include the title, seo, publish status, feature image, tags, meta, etc.
695
+ */
696
+ getPage({ slug, rootId } = {}) {
697
+ const { error } = ContentValidator.getPage().validate(
698
+ { slug, rootId },
699
+ { abortEarly: false, allowUnknown: true }
700
+ );
701
+ if (error) {
702
+ return Promise.reject(new FDKClientValidationError(error));
703
+ }
704
+ const query_params = {};
705
+ query_params["root_id"] = rootId;
706
+
707
+ const xHeaders = {};
708
+
709
+ return APIClient.execute(
710
+ this._conf,
711
+ "get",
712
+ constructUrl({
713
+ url: this._urls["getPage"],
714
+ params: { slug },
715
+ }),
716
+ query_params,
717
+ undefined,
718
+ xHeaders
719
+ );
720
+ }
721
+
722
+ /**
723
+ * @param {Object} arg - Arg object.
724
+ * @param {number} [arg.pageNo] - The page number to navigate through the
725
+ * given set of results. Default value is 1.
726
+ * @param {number} [arg.pageSize] - The number of items to retrieve in each page.
727
+ * @returns {Promise<PageGetResponse>} - Success response
728
+ * @summary: Get all pages
729
+ * @description: Use this API to get a list of pages.
730
+ */
731
+ getPages({ pageNo, pageSize } = {}) {
732
+ const { error } = ContentValidator.getPages().validate(
733
+ { pageNo, pageSize },
734
+ { abortEarly: false, allowUnknown: true }
735
+ );
736
+ if (error) {
737
+ return Promise.reject(new FDKClientValidationError(error));
738
+ }
739
+ const query_params = {};
740
+ query_params["page_no"] = pageNo;
741
+ query_params["page_size"] = pageSize;
742
+
743
+ const xHeaders = {};
744
+
745
+ return APIClient.execute(
746
+ this._conf,
747
+ "get",
748
+ constructUrl({
749
+ url: this._urls["getPages"],
750
+ params: {},
751
+ }),
752
+ query_params,
753
+ undefined,
754
+ xHeaders
755
+ );
756
+ }
757
+
758
+ /**
759
+ * @param {Object} arg - Arg object.
760
+ * @param {number} [arg.pageSize] - The number of items to retrieve in each page.
761
+ * @summary: Get all pages
762
+ * @description: Use this API to get a list of pages.
763
+ */
764
+ getPagesPaginator({ pageSize } = {}) {
765
+ const paginator = new Paginator();
766
+ const callback = async () => {
767
+ const pageId = paginator.nextId;
768
+ const pageNo = paginator.pageNo;
769
+ const pageType = "number";
770
+ const data = await this.getPages({
771
+ pageNo: pageNo,
772
+ pageSize: pageSize,
773
+ });
774
+ paginator.setPaginator({
775
+ hasNext: data.page.has_next ? true : false,
776
+ nextId: data.page.next_id,
777
+ });
778
+ return data;
779
+ };
780
+ paginator.setCallback(callback);
781
+ return paginator;
782
+ }
783
+ }
784
+
785
+ module.exports = Content;