@gofynd/fdk-client-javascript 1.0.1 → 1.0.3

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 (318) hide show
  1. package/documentation/application/CART.md +5934 -4502
  2. package/documentation/application/CATALOG.md +6338 -7245
  3. package/documentation/application/COMMON.md +95 -222
  4. package/documentation/application/COMMUNICATION.md +106 -186
  5. package/documentation/application/CONFIGURATION.md +903 -1597
  6. package/documentation/application/CONTENT.md +562 -1270
  7. package/documentation/application/FILESTORAGE.md +84 -220
  8. package/documentation/application/LEAD.md +314 -660
  9. package/documentation/application/LOGISTIC.md +229 -305
  10. package/documentation/application/ORDER.md +642 -1137
  11. package/documentation/application/PAYMENT.md +2285 -3031
  12. package/documentation/application/POSCART.md +6079 -4642
  13. package/documentation/application/REWARDS.md +94 -248
  14. package/documentation/application/SHARE.md +152 -250
  15. package/documentation/application/THEME.md +952 -1235
  16. package/documentation/application/USER.md +1228 -1765
  17. package/documentation/platform/ANALYTICS.md +207 -349
  18. package/documentation/platform/AUDITTRAIL.md +121 -204
  19. package/documentation/platform/BILLING.md +865 -1376
  20. package/documentation/platform/CART.md +2814 -3662
  21. package/documentation/platform/CATALOG.md +15266 -17619
  22. package/documentation/platform/COMMON.md +95 -222
  23. package/documentation/platform/COMMUNICATION.md +1632 -2380
  24. package/documentation/platform/COMPANYPROFILE.md +572 -957
  25. package/documentation/platform/CONFIGURATION.md +3050 -4073
  26. package/documentation/platform/CONTENT.md +3509 -4121
  27. package/documentation/platform/DISCOUNT.md +140 -236
  28. package/documentation/platform/FILESTORAGE.md +187 -323
  29. package/documentation/platform/INVENTORY.md +268 -911
  30. package/documentation/platform/LEAD.md +2195 -2541
  31. package/documentation/platform/ORDER.md +3750 -5636
  32. package/documentation/platform/PARTNER.md +9 -36
  33. package/documentation/platform/PAYMENT.md +903 -1213
  34. package/documentation/platform/REWARDS.md +183 -347
  35. package/documentation/platform/SHARE.md +120 -213
  36. package/documentation/platform/THEME.md +12956 -13239
  37. package/documentation/platform/USER.md +975 -1120
  38. package/documentation/platform/WEBHOOK.md +78 -184
  39. package/documentation/public/CONFIGURATION.md +95 -222
  40. package/documentation/public/INVENTORY.md +100 -282
  41. package/documentation/public/WEBHOOK.md +27 -133
  42. package/package.json +1 -1
  43. package/sdk/application/ApplicationConfig.js +1 -1
  44. package/sdk/application/Cart/CartApplicationClient.d.ts +243 -243
  45. package/sdk/application/Cart/CartApplicationClient.js +1058 -547
  46. package/sdk/application/Cart/CartApplicationModel.d.ts +64 -63
  47. package/sdk/application/Cart/CartApplicationModel.js +489 -886
  48. package/sdk/application/Cart/CartApplicationValidator.d.ts +17 -17
  49. package/sdk/application/Cart/CartApplicationValidator.js +98 -98
  50. package/sdk/application/Catalog/CatalogApplicationClient.d.ts +358 -358
  51. package/sdk/application/Catalog/CatalogApplicationClient.js +1545 -949
  52. package/sdk/application/Catalog/CatalogApplicationModel.d.ts +90 -90
  53. package/sdk/application/Catalog/CatalogApplicationModel.js +692 -1258
  54. package/sdk/application/Catalog/CatalogApplicationValidator.d.ts +19 -19
  55. package/sdk/application/Catalog/CatalogApplicationValidator.js +110 -110
  56. package/sdk/application/Common/CommonApplicationClient.d.ts +13 -13
  57. package/sdk/application/Common/CommonApplicationClient.js +76 -36
  58. package/sdk/application/Common/CommonApplicationModel.d.ts +12 -12
  59. package/sdk/application/Common/CommonApplicationModel.js +83 -160
  60. package/sdk/application/Common/CommonApplicationValidator.d.ts +1 -1
  61. package/sdk/application/Common/CommonApplicationValidator.js +6 -6
  62. package/sdk/application/Communication/CommunicationApplicationClient.d.ts +11 -11
  63. package/sdk/application/Communication/CommunicationApplicationClient.js +92 -31
  64. package/sdk/application/Communication/CommunicationApplicationModel.d.ts +6 -6
  65. package/sdk/application/Communication/CommunicationApplicationModel.js +38 -83
  66. package/sdk/application/Communication/CommunicationApplicationValidator.d.ts +1 -1
  67. package/sdk/application/Communication/CommunicationApplicationValidator.js +4 -4
  68. package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +116 -116
  69. package/sdk/application/Configuration/ConfigurationApplicationClient.js +638 -312
  70. package/sdk/application/Configuration/ConfigurationApplicationModel.d.ts +85 -85
  71. package/sdk/application/Configuration/ConfigurationApplicationModel.js +480 -851
  72. package/sdk/application/Configuration/ConfigurationApplicationValidator.d.ts +8 -8
  73. package/sdk/application/Configuration/ConfigurationApplicationValidator.js +33 -33
  74. package/sdk/application/Content/ContentApplicationClient.d.ts +67 -67
  75. package/sdk/application/Content/ContentApplicationClient.js +581 -213
  76. package/sdk/application/Content/ContentApplicationModel.d.ts +76 -75
  77. package/sdk/application/Content/ContentApplicationModel.js +468 -875
  78. package/sdk/application/Content/ContentApplicationValidator.d.ts +5 -5
  79. package/sdk/application/Content/ContentApplicationValidator.js +24 -24
  80. package/sdk/application/FileStorage/FileStorageApplicationClient.d.ts +25 -25
  81. package/sdk/application/FileStorage/FileStorageApplicationClient.js +121 -59
  82. package/sdk/application/FileStorage/FileStorageApplicationModel.d.ts +13 -13
  83. package/sdk/application/FileStorage/FileStorageApplicationModel.js +86 -169
  84. package/sdk/application/FileStorage/FileStorageApplicationValidator.d.ts +1 -1
  85. package/sdk/application/FileStorage/FileStorageApplicationValidator.js +7 -7
  86. package/sdk/application/Lead/LeadApplicationClient.d.ts +24 -24
  87. package/sdk/application/Lead/LeadApplicationClient.js +230 -96
  88. package/sdk/application/Lead/LeadApplicationModel.d.ts +35 -35
  89. package/sdk/application/Lead/LeadApplicationModel.js +267 -474
  90. package/sdk/application/Lead/LeadApplicationValidator.d.ts +2 -2
  91. package/sdk/application/Lead/LeadApplicationValidator.js +11 -11
  92. package/sdk/application/Logistic/LogisticApplicationClient.d.ts +30 -19
  93. package/sdk/application/Logistic/LogisticApplicationClient.js +196 -47
  94. package/sdk/application/Logistic/LogisticApplicationModel.d.ts +17 -14
  95. package/sdk/application/Logistic/LogisticApplicationModel.js +133 -201
  96. package/sdk/application/Logistic/LogisticApplicationValidator.d.ts +3 -2
  97. package/sdk/application/Logistic/LogisticApplicationValidator.js +14 -8
  98. package/sdk/application/Order/OrderApplicationClient.d.ts +86 -86
  99. package/sdk/application/Order/OrderApplicationClient.js +448 -215
  100. package/sdk/application/Order/OrderApplicationModel.d.ts +50 -50
  101. package/sdk/application/Order/OrderApplicationModel.js +357 -661
  102. package/sdk/application/Order/OrderApplicationValidator.d.ts +7 -7
  103. package/sdk/application/Order/OrderApplicationValidator.js +28 -28
  104. package/sdk/application/Payment/PaymentApplicationClient.d.ts +318 -318
  105. package/sdk/application/Payment/PaymentApplicationClient.js +1525 -750
  106. package/sdk/application/Payment/PaymentApplicationModel.d.ts +72 -72
  107. package/sdk/application/Payment/PaymentApplicationModel.js +565 -1033
  108. package/sdk/application/Payment/PaymentApplicationValidator.d.ts +28 -28
  109. package/sdk/application/Payment/PaymentApplicationValidator.js +107 -107
  110. package/sdk/application/PosCart/PosCartApplicationClient.d.ts +254 -254
  111. package/sdk/application/PosCart/PosCartApplicationClient.js +1137 -606
  112. package/sdk/application/PosCart/PosCartApplicationModel.d.ts +61 -60
  113. package/sdk/application/PosCart/PosCartApplicationModel.js +477 -873
  114. package/sdk/application/PosCart/PosCartApplicationValidator.d.ts +18 -18
  115. package/sdk/application/PosCart/PosCartApplicationValidator.js +103 -103
  116. package/sdk/application/Rewards/RewardsApplicationClient.d.ts +27 -27
  117. package/sdk/application/Rewards/RewardsApplicationClient.js +253 -113
  118. package/sdk/application/Rewards/RewardsApplicationModel.d.ts +14 -14
  119. package/sdk/application/Rewards/RewardsApplicationModel.js +96 -191
  120. package/sdk/application/Rewards/RewardsApplicationValidator.d.ts +3 -3
  121. package/sdk/application/Rewards/RewardsApplicationValidator.js +12 -12
  122. package/sdk/application/Share/ShareApplicationClient.d.ts +37 -37
  123. package/sdk/application/Share/ShareApplicationClient.js +221 -96
  124. package/sdk/application/Share/ShareApplicationModel.d.ts +8 -8
  125. package/sdk/application/Share/ShareApplicationModel.js +63 -123
  126. package/sdk/application/Share/ShareApplicationValidator.d.ts +4 -4
  127. package/sdk/application/Share/ShareApplicationValidator.js +12 -12
  128. package/sdk/application/Theme/ThemeApplicationClient.d.ts +8 -8
  129. package/sdk/application/Theme/ThemeApplicationClient.js +115 -37
  130. package/sdk/application/Theme/ThemeApplicationModel.d.ts +34 -34
  131. package/sdk/application/Theme/ThemeApplicationModel.js +190 -336
  132. package/sdk/application/Theme/ThemeApplicationValidator.d.ts +1 -1
  133. package/sdk/application/Theme/ThemeApplicationValidator.js +4 -4
  134. package/sdk/application/User/UserApplicationClient.d.ts +280 -280
  135. package/sdk/application/User/UserApplicationClient.js +1201 -543
  136. package/sdk/application/User/UserApplicationModel.d.ts +79 -72
  137. package/sdk/application/User/UserApplicationModel.js +440 -689
  138. package/sdk/application/User/UserApplicationValidator.d.ts +24 -24
  139. package/sdk/application/User/UserApplicationValidator.js +89 -89
  140. package/sdk/common/AxiosHelper.js +1 -1
  141. package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.d.ts +55 -47
  142. package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.js +308 -151
  143. package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.d.ts +6 -6
  144. package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.js +20 -20
  145. package/sdk/platform/Analytics/AnalyticsPlatformClient.d.ts +8 -4
  146. package/sdk/platform/Analytics/AnalyticsPlatformClient.js +103 -16
  147. package/sdk/platform/Analytics/AnalyticsPlatformModel.d.ts +11 -11
  148. package/sdk/platform/Analytics/AnalyticsPlatformModel.js +95 -178
  149. package/sdk/platform/AuditTrail/AuditTrailPlatformClient.d.ts +16 -12
  150. package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +131 -44
  151. package/sdk/platform/AuditTrail/AuditTrailPlatformModel.d.ts +10 -10
  152. package/sdk/platform/AuditTrail/AuditTrailPlatformModel.js +50 -89
  153. package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.d.ts +1 -1
  154. package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.js +6 -6
  155. package/sdk/platform/Billing/BillingPlatformClient.d.ts +68 -56
  156. package/sdk/platform/Billing/BillingPlatformClient.js +416 -171
  157. package/sdk/platform/Billing/BillingPlatformModel.d.ts +40 -40
  158. package/sdk/platform/Billing/BillingPlatformModel.js +342 -668
  159. package/sdk/platform/Billing/BillingPlatformValidator.d.ts +8 -8
  160. package/sdk/platform/Billing/BillingPlatformValidator.js +25 -25
  161. package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +176 -159
  162. package/sdk/platform/Cart/CartPlatformApplicationClient.js +837 -500
  163. package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +11 -11
  164. package/sdk/platform/Cart/CartPlatformApplicationValidator.js +63 -63
  165. package/sdk/platform/Cart/CartPlatformModel.d.ts +86 -85
  166. package/sdk/platform/Cart/CartPlatformModel.js +677 -1211
  167. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +582 -529
  168. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +2642 -1533
  169. package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +40 -40
  170. package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +175 -175
  171. package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +708 -590
  172. package/sdk/platform/Catalog/CatalogPlatformClient.js +3103 -1362
  173. package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +293 -284
  174. package/sdk/platform/Catalog/CatalogPlatformModel.js +2149 -3660
  175. package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +66 -64
  176. package/sdk/platform/Catalog/CatalogPlatformValidator.js +235 -216
  177. package/sdk/platform/Common/CommonPlatformClient.d.ts +14 -12
  178. package/sdk/platform/Common/CommonPlatformClient.js +80 -37
  179. package/sdk/platform/Common/CommonPlatformModel.d.ts +12 -12
  180. package/sdk/platform/Common/CommonPlatformModel.js +83 -160
  181. package/sdk/platform/Common/CommonPlatformValidator.d.ts +1 -1
  182. package/sdk/platform/Common/CommonPlatformValidator.js +6 -6
  183. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +333 -293
  184. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +1687 -855
  185. package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.d.ts +30 -30
  186. package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.js +87 -87
  187. package/sdk/platform/Communication/CommunicationPlatformClient.d.ts +2 -1
  188. package/sdk/platform/Communication/CommunicationPlatformClient.js +28 -4
  189. package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +67 -67
  190. package/sdk/platform/Communication/CommunicationPlatformModel.js +522 -974
  191. package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +70 -57
  192. package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +463 -182
  193. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +28 -28
  194. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +294 -557
  195. package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.d.ts +7 -7
  196. package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.js +24 -24
  197. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +175 -137
  198. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +1168 -521
  199. package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.d.ts +22 -21
  200. package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.js +69 -63
  201. package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +137 -119
  202. package/sdk/platform/Configuration/ConfigurationPlatformClient.js +691 -316
  203. package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +148 -146
  204. package/sdk/platform/Configuration/ConfigurationPlatformModel.js +854 -1508
  205. package/sdk/platform/Configuration/ConfigurationPlatformValidator.d.ts +9 -9
  206. package/sdk/platform/Configuration/ConfigurationPlatformValidator.js +38 -38
  207. package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +542 -461
  208. package/sdk/platform/Content/ContentPlatformApplicationClient.js +2600 -1160
  209. package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +50 -49
  210. package/sdk/platform/Content/ContentPlatformApplicationValidator.js +159 -152
  211. package/sdk/platform/Content/ContentPlatformModel.d.ts +79 -75
  212. package/sdk/platform/Content/ContentPlatformModel.js +486 -867
  213. package/sdk/platform/Discount/DiscountPlatformClient.d.ts +72 -61
  214. package/sdk/platform/Discount/DiscountPlatformClient.js +424 -198
  215. package/sdk/platform/Discount/DiscountPlatformModel.d.ts +7 -7
  216. package/sdk/platform/Discount/DiscountPlatformModel.js +60 -121
  217. package/sdk/platform/Discount/DiscountPlatformValidator.d.ts +6 -6
  218. package/sdk/platform/Discount/DiscountPlatformValidator.js +29 -29
  219. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +26 -22
  220. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +145 -59
  221. package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.d.ts +1 -1
  222. package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.js +8 -8
  223. package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +58 -52
  224. package/sdk/platform/FileStorage/FileStoragePlatformClient.js +240 -114
  225. package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +13 -13
  226. package/sdk/platform/FileStorage/FileStoragePlatformModel.js +86 -169
  227. package/sdk/platform/FileStorage/FileStoragePlatformValidator.d.ts +3 -3
  228. package/sdk/platform/FileStorage/FileStoragePlatformValidator.js +11 -11
  229. package/sdk/platform/Inventory/InventoryPlatformClient.d.ts +76 -63
  230. package/sdk/platform/Inventory/InventoryPlatformClient.js +461 -197
  231. package/sdk/platform/Inventory/InventoryPlatformModel.d.ts +30 -30
  232. package/sdk/platform/Inventory/InventoryPlatformModel.js +497 -964
  233. package/sdk/platform/Inventory/InventoryPlatformValidator.d.ts +7 -7
  234. package/sdk/platform/Inventory/InventoryPlatformValidator.js +28 -28
  235. package/sdk/platform/Lead/LeadPlatformApplicationClient.d.ts +84 -71
  236. package/sdk/platform/Lead/LeadPlatformApplicationClient.js +441 -182
  237. package/sdk/platform/Lead/LeadPlatformApplicationValidator.d.ts +7 -7
  238. package/sdk/platform/Lead/LeadPlatformApplicationValidator.js +28 -28
  239. package/sdk/platform/Lead/LeadPlatformClient.d.ts +86 -75
  240. package/sdk/platform/Lead/LeadPlatformClient.js +434 -212
  241. package/sdk/platform/Lead/LeadPlatformModel.d.ts +35 -35
  242. package/sdk/platform/Lead/LeadPlatformModel.js +267 -474
  243. package/sdk/platform/Lead/LeadPlatformValidator.d.ts +6 -6
  244. package/sdk/platform/Lead/LeadPlatformValidator.js +24 -24
  245. package/sdk/platform/OAuthClient.js +8 -8
  246. package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +14 -11
  247. package/sdk/platform/Order/OrderPlatformApplicationClient.js +113 -49
  248. package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +1 -1
  249. package/sdk/platform/Order/OrderPlatformApplicationValidator.js +6 -6
  250. package/sdk/platform/Order/OrderPlatformClient.d.ts +367 -315
  251. package/sdk/platform/Order/OrderPlatformClient.js +1775 -893
  252. package/sdk/platform/Order/OrderPlatformModel.d.ts +198 -192
  253. package/sdk/platform/Order/OrderPlatformModel.js +1591 -2822
  254. package/sdk/platform/Order/OrderPlatformValidator.d.ts +32 -32
  255. package/sdk/platform/Order/OrderPlatformValidator.js +160 -155
  256. package/sdk/platform/Partner/PartnerPlatformApplicationClient.d.ts +4 -2
  257. package/sdk/platform/Partner/PartnerPlatformApplicationClient.js +52 -8
  258. package/sdk/platform/Partner/PartnerPlatformModel.js +6 -22
  259. package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +65 -54
  260. package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +395 -164
  261. package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +6 -6
  262. package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +23 -23
  263. package/sdk/platform/Payment/PaymentPlatformClient.d.ts +55 -45
  264. package/sdk/platform/Payment/PaymentPlatformClient.js +362 -147
  265. package/sdk/platform/Payment/PaymentPlatformModel.d.ts +27 -27
  266. package/sdk/platform/Payment/PaymentPlatformModel.js +220 -408
  267. package/sdk/platform/Payment/PaymentPlatformValidator.d.ts +4 -4
  268. package/sdk/platform/Payment/PaymentPlatformValidator.js +21 -21
  269. package/sdk/platform/PlatformApplicationClient.d.ts +1496 -10153
  270. package/sdk/platform/PlatformApplicationClient.js +1584 -13691
  271. package/sdk/platform/PlatformClient.d.ts +7918 -7666
  272. package/sdk/platform/PlatformClient.js +8701 -9926
  273. package/sdk/platform/Rewards/RewardsPlatformApplicationClient.d.ts +91 -78
  274. package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +507 -253
  275. package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.d.ts +8 -8
  276. package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.js +34 -34
  277. package/sdk/platform/Rewards/RewardsPlatformModel.d.ts +15 -15
  278. package/sdk/platform/Rewards/RewardsPlatformModel.js +92 -194
  279. package/sdk/platform/Share/SharePlatformApplicationClient.d.ts +16 -12
  280. package/sdk/platform/Share/SharePlatformApplicationClient.js +130 -52
  281. package/sdk/platform/Share/SharePlatformApplicationValidator.d.ts +1 -1
  282. package/sdk/platform/Share/SharePlatformApplicationValidator.js +6 -6
  283. package/sdk/platform/Share/SharePlatformModel.d.ts +8 -8
  284. package/sdk/platform/Share/SharePlatformModel.js +60 -118
  285. package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +148 -124
  286. package/sdk/platform/Theme/ThemePlatformApplicationClient.js +770 -295
  287. package/sdk/platform/Theme/ThemePlatformApplicationValidator.d.ts +15 -15
  288. package/sdk/platform/Theme/ThemePlatformApplicationValidator.js +44 -44
  289. package/sdk/platform/Theme/ThemePlatformModel.d.ts +34 -34
  290. package/sdk/platform/Theme/ThemePlatformModel.js +190 -336
  291. package/sdk/platform/User/UserPlatformApplicationClient.d.ts +146 -67
  292. package/sdk/platform/User/UserPlatformApplicationClient.js +742 -155
  293. package/sdk/platform/User/UserPlatformApplicationValidator.d.ts +12 -7
  294. package/sdk/platform/User/UserPlatformApplicationValidator.js +61 -23
  295. package/sdk/platform/User/UserPlatformModel.d.ts +79 -72
  296. package/sdk/platform/User/UserPlatformModel.js +440 -689
  297. package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +35 -29
  298. package/sdk/platform/Webhook/WebhookPlatformClient.js +218 -91
  299. package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +7 -7
  300. package/sdk/platform/Webhook/WebhookPlatformModel.js +68 -136
  301. package/sdk/platform/Webhook/WebhookPlatformValidator.d.ts +3 -3
  302. package/sdk/platform/Webhook/WebhookPlatformValidator.js +14 -14
  303. package/sdk/public/Configuration/ConfigurationPublicClient.d.ts +13 -13
  304. package/sdk/public/Configuration/ConfigurationPublicClient.js +81 -38
  305. package/sdk/public/Configuration/ConfigurationPublicModel.d.ts +12 -12
  306. package/sdk/public/Configuration/ConfigurationPublicModel.js +85 -162
  307. package/sdk/public/Configuration/ConfigurationPublicValidator.d.ts +1 -1
  308. package/sdk/public/Configuration/ConfigurationPublicValidator.js +6 -6
  309. package/sdk/public/Inventory/InventoryPublicClient.d.ts +34 -34
  310. package/sdk/public/Inventory/InventoryPublicClient.js +228 -105
  311. package/sdk/public/Inventory/InventoryPublicModel.d.ts +10 -10
  312. package/sdk/public/Inventory/InventoryPublicModel.js +119 -245
  313. package/sdk/public/Inventory/InventoryPublicValidator.d.ts +3 -3
  314. package/sdk/public/Inventory/InventoryPublicValidator.js +15 -15
  315. package/sdk/public/Webhook/WebhookPublicClient.js +51 -10
  316. package/sdk/public/Webhook/WebhookPublicModel.d.ts +7 -7
  317. package/sdk/public/Webhook/WebhookPublicModel.js +68 -136
  318. package/tests/application/catalog.spec.js +7 -0
@@ -2,6 +2,8 @@ const Paginator = require("../../common/Paginator");
2
2
  const PlatformAPIClient = require("../PlatformAPIClient");
3
3
  const { FDKClientValidationError } = require("../../common/FDKError");
4
4
  const ThemeValidator = require("./ThemePlatformApplicationValidator");
5
+ const ThemeModel = require("./ThemePlatformModel");
6
+ const { Logger } = require("./../../common/Logger");
5
7
 
6
8
  class Theme {
7
9
  constructor(config, applicationId) {
@@ -11,14 +13,15 @@ class Theme {
11
13
 
12
14
  /**
13
15
  * @param {Object} arg - Arg object.
14
- * @param {string} arg.themeId - ID of the theme to be retrieved
15
- * @summary: Get all pages of a theme
16
- * @description: Use this API to retrieve all the available pages of a theme by its ID.
16
+ * @param {AddThemeRequestSchema} arg.body
17
+ * @returns {Promise<ThemesSchema>} - Success response
18
+ * @summary: Add a theme to the theme library
19
+ * @description: Theme library is a personalized collection of themes that are chosen and added from the available themes. Use this API to choose a theme and add it to the theme library.
17
20
  */
18
- getAllPages({ themeId } = {}) {
19
- const { error } = ThemeValidator.getAllPages().validate(
21
+ async addToThemeLibrary({ body } = {}) {
22
+ const { error } = ThemeValidator.addToThemeLibrary().validate(
20
23
  {
21
- themeId,
24
+ body,
22
25
  },
23
26
  { abortEarly: false, allowUnknown: true }
24
27
  );
@@ -27,39 +30,56 @@ class Theme {
27
30
  }
28
31
 
29
32
  // Showing warrnings if extra unknown parameters are found
30
- const { error: warrning } = ThemeValidator.getAllPages().validate(
33
+ const { error: warrning } = ThemeValidator.addToThemeLibrary().validate(
31
34
  {
32
- themeId,
35
+ body,
33
36
  },
34
37
  { abortEarly: false, allowUnknown: false }
35
38
  );
36
39
  if (warrning) {
37
- console.log("Parameter Validation warrnings for getAllPages");
38
- console.log(warrning);
40
+ Logger({
41
+ level: "WARN",
42
+ message: "Parameter Validation warrnings for addToThemeLibrary",
43
+ });
44
+ Logger({ level: "WARN", message: warrning });
39
45
  }
40
46
 
41
47
  const query_params = {};
42
48
 
43
- return PlatformAPIClient.execute(
49
+ const response = await PlatformAPIClient.execute(
44
50
  this.config,
45
- "get",
46
- `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/page`,
51
+ "post",
52
+ `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/library`,
47
53
  query_params,
48
- undefined
54
+ body
49
55
  );
56
+
57
+ const { error: res_error } = ThemeModel.ThemesSchema().validate(response, {
58
+ abortEarly: false,
59
+ allowUnknown: false,
60
+ });
61
+
62
+ if (res_error) {
63
+ Logger({
64
+ level: "WARN",
65
+ message: "Response Validation Warnnings for addToThemeLibrary",
66
+ });
67
+ Logger({ level: "WARN", message: res_error });
68
+ }
69
+
70
+ return response;
50
71
  }
51
72
 
52
73
  /**
53
74
  * @param {Object} arg - Arg object.
54
- * @param {string} arg.themeId - ID of the theme
55
- * @param {AvailablePageSchema} arg.body
56
- * @summary: Create a page
57
- * @description: Use this API to create a page for a theme by its ID.
75
+ * @param {AddThemeRequestSchema} arg.body
76
+ * @returns {Promise<ThemesSchema>} - Success response
77
+ * @summary: Apply a theme
78
+ * @description: Use this API to apply a theme to the website.
58
79
  */
59
- createPage({ themeId, body } = {}) {
60
- const { error } = ThemeValidator.createPage().validate(
80
+ async applyTheme({ body } = {}) {
81
+ const { error } = ThemeValidator.applyTheme().validate(
61
82
  {
62
- themeId,
63
83
  body,
64
84
  },
65
85
  { abortEarly: false, allowUnknown: true }
@@ -69,41 +89,57 @@ class Theme {
69
89
  }
70
90
 
71
91
  // Showing warrnings if extra unknown parameters are found
72
- const { error: warrning } = ThemeValidator.createPage().validate(
92
+ const { error: warrning } = ThemeValidator.applyTheme().validate(
73
93
  {
74
- themeId,
75
94
  body,
76
95
  },
77
96
  { abortEarly: false, allowUnknown: false }
78
97
  );
79
98
  if (warrning) {
80
- console.log("Parameter Validation warrnings for createPage");
81
- console.log(warrning);
99
+ Logger({
100
+ level: "WARN",
101
+ message: "Parameter Validation warrnings for applyTheme",
102
+ });
103
+ Logger({ level: "WARN", message: warrning });
82
104
  }
83
105
 
84
106
  const query_params = {};
85
107
 
86
- return PlatformAPIClient.execute(
108
+ const response = await PlatformAPIClient.execute(
87
109
  this.config,
88
110
  "post",
89
- `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/page`,
111
+ `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/apply`,
90
112
  query_params,
91
113
  body
92
114
  );
115
+
116
+ const { error: res_error } = ThemeModel.ThemesSchema().validate(response, {
117
+ abortEarly: false,
118
+ allowUnknown: false,
119
+ });
120
+
121
+ if (res_error) {
122
+ Logger({
123
+ level: "WARN",
124
+ message: "Response Validation Warnnings for applyTheme",
125
+ });
126
+ Logger({ level: "WARN", message: res_error });
127
+ }
128
+
129
+ return response;
93
130
  }
94
131
 
95
132
  /**
96
133
  * @param {Object} arg - Arg object.
97
- * @param {string} arg.themeId - ID of the theme to be retrieved
98
- * @param {AllAvailablePageSchema} arg.body
99
- * @summary: Update multiple pages of a theme
100
- * @description: Use this API to update multiple pages of a theme by its ID.
134
+ * @param {string} arg.themeId - ID allotted to the theme.
135
+ * @returns {Promise<ThemesSchema>} - Success response
136
+ * @summary: Archive a theme
137
+ * @description: Use this API to store an existing theme but not delete it so that it can be used in future if required.
101
138
  */
102
- updateMultiplePages({ themeId, body } = {}) {
103
- const { error } = ThemeValidator.updateMultiplePages().validate(
139
+ async archiveTheme({ themeId } = {}) {
140
+ const { error } = ThemeValidator.archiveTheme().validate(
104
141
  {
105
142
  themeId,
106
- body,
107
143
  },
108
144
  { abortEarly: false, allowUnknown: true }
109
145
  );
@@ -112,41 +148,59 @@ class Theme {
112
148
  }
113
149
 
114
150
  // Showing warrnings if extra unknown parameters are found
115
- const { error: warrning } = ThemeValidator.updateMultiplePages().validate(
151
+ const { error: warrning } = ThemeValidator.archiveTheme().validate(
116
152
  {
117
153
  themeId,
118
- body,
119
154
  },
120
155
  { abortEarly: false, allowUnknown: false }
121
156
  );
122
157
  if (warrning) {
123
- console.log("Parameter Validation warrnings for updateMultiplePages");
124
- console.log(warrning);
158
+ Logger({
159
+ level: "WARN",
160
+ message: "Parameter Validation warrnings for archiveTheme",
161
+ });
162
+ Logger({ level: "WARN", message: warrning });
125
163
  }
126
164
 
127
165
  const query_params = {};
128
166
 
129
- return PlatformAPIClient.execute(
167
+ const response = await PlatformAPIClient.execute(
130
168
  this.config,
131
169
  "put",
132
- `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/page`,
170
+ `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/archive`,
133
171
  query_params,
134
- body
172
+ undefined
135
173
  );
174
+
175
+ const { error: res_error } = ThemeModel.ThemesSchema().validate(response, {
176
+ abortEarly: false,
177
+ allowUnknown: false,
178
+ });
179
+
180
+ if (res_error) {
181
+ Logger({
182
+ level: "WARN",
183
+ message: "Response Validation Warnnings for archiveTheme",
184
+ });
185
+ Logger({ level: "WARN", message: res_error });
186
+ }
187
+
188
+ return response;
136
189
  }
137
190
 
138
191
  /**
139
192
  * @param {Object} arg - Arg object.
140
- * @param {string} arg.themeId - ID of the theme to be retrieved
141
- * @param {string} arg.pageValue - Value of the page to be retrieved
142
- * @summary: Get page of a theme
143
- * @description: Use this API to retrieve a page of a theme.
193
+ * @param {string} arg.themeId - ID of the theme
194
+ * @param {AvailablePageSchema} arg.body
195
+ * @returns {Promise<AvailablePageSchema>} - Success response
196
+ * @summary: Create a page
197
+ * @description: Use this API to create a page for a theme by its ID.
144
198
  */
145
- getPage({ themeId, pageValue } = {}) {
146
- const { error } = ThemeValidator.getPage().validate(
199
+ async createPage({ themeId, body } = {}) {
200
+ const { error } = ThemeValidator.createPage().validate(
147
201
  {
148
202
  themeId,
149
- pageValue,
203
+ body,
150
204
  },
151
205
  { abortEarly: false, allowUnknown: true }
152
206
  );
@@ -155,42 +209,59 @@ class Theme {
155
209
  }
156
210
 
157
211
  // Showing warrnings if extra unknown parameters are found
158
- const { error: warrning } = ThemeValidator.getPage().validate(
212
+ const { error: warrning } = ThemeValidator.createPage().validate(
159
213
  {
160
214
  themeId,
161
- pageValue,
215
+ body,
162
216
  },
163
217
  { abortEarly: false, allowUnknown: false }
164
218
  );
165
219
  if (warrning) {
166
- console.log("Parameter Validation warrnings for getPage");
167
- console.log(warrning);
220
+ Logger({
221
+ level: "WARN",
222
+ message: "Parameter Validation warrnings for createPage",
223
+ });
224
+ Logger({ level: "WARN", message: warrning });
168
225
  }
169
226
 
170
227
  const query_params = {};
171
228
 
172
- return PlatformAPIClient.execute(
229
+ const response = await PlatformAPIClient.execute(
173
230
  this.config,
174
- "get",
175
- `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/${pageValue}`,
231
+ "post",
232
+ `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/page`,
176
233
  query_params,
177
- undefined
234
+ body
178
235
  );
236
+
237
+ const {
238
+ error: res_error,
239
+ } = ThemeModel.AvailablePageSchema().validate(response, {
240
+ abortEarly: false,
241
+ allowUnknown: false,
242
+ });
243
+
244
+ if (res_error) {
245
+ Logger({
246
+ level: "WARN",
247
+ message: "Response Validation Warnnings for createPage",
248
+ });
249
+ Logger({ level: "WARN", message: res_error });
250
+ }
251
+
252
+ return response;
179
253
  }
180
254
 
181
255
  /**
182
256
  * @param {Object} arg - Arg object.
183
- * @param {string} arg.themeId - ID of the theme
184
- * @param {string} arg.pageValue - Value of the page to be updated
185
- * @param {AvailablePageSchema} arg.body
186
- * @summary: Updates a page
187
- * @description: Use this API to update a page for a theme by its ID.
257
+ * @param {ThemesSchema} arg.body
258
+ * @returns {Promise<ThemesSchema>} - Success response
259
+ * @summary: Create a new theme
260
+ * @description: Themes improve the look and appearance of a website. Use this API to create a theme.
188
261
  */
189
- updatePage({ themeId, pageValue, body } = {}) {
190
- const { error } = ThemeValidator.updatePage().validate(
262
+ async createTheme({ body } = {}) {
263
+ const { error } = ThemeValidator.createTheme().validate(
191
264
  {
192
- themeId,
193
- pageValue,
194
265
  body,
195
266
  },
196
267
  { abortEarly: false, allowUnknown: true }
@@ -200,38 +271,55 @@ class Theme {
200
271
  }
201
272
 
202
273
  // Showing warrnings if extra unknown parameters are found
203
- const { error: warrning } = ThemeValidator.updatePage().validate(
274
+ const { error: warrning } = ThemeValidator.createTheme().validate(
204
275
  {
205
- themeId,
206
- pageValue,
207
276
  body,
208
277
  },
209
278
  { abortEarly: false, allowUnknown: false }
210
279
  );
211
280
  if (warrning) {
212
- console.log("Parameter Validation warrnings for updatePage");
213
- console.log(warrning);
281
+ Logger({
282
+ level: "WARN",
283
+ message: "Parameter Validation warrnings for createTheme",
284
+ });
285
+ Logger({ level: "WARN", message: warrning });
214
286
  }
215
287
 
216
288
  const query_params = {};
217
289
 
218
- return PlatformAPIClient.execute(
290
+ const response = await PlatformAPIClient.execute(
219
291
  this.config,
220
- "put",
221
- `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/${pageValue}`,
292
+ "post",
293
+ `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/`,
222
294
  query_params,
223
295
  body
224
296
  );
297
+
298
+ const { error: res_error } = ThemeModel.ThemesSchema().validate(response, {
299
+ abortEarly: false,
300
+ allowUnknown: false,
301
+ });
302
+
303
+ if (res_error) {
304
+ Logger({
305
+ level: "WARN",
306
+ message: "Response Validation Warnnings for createTheme",
307
+ });
308
+ Logger({ level: "WARN", message: res_error });
309
+ }
310
+
311
+ return response;
225
312
  }
226
313
 
227
314
  /**
228
315
  * @param {Object} arg - Arg object.
229
316
  * @param {string} arg.themeId - ID of the theme
230
317
  * @param {string} arg.pageValue - Value of the page to be updated
318
+ * @returns {Promise<AvailablePageSchema>} - Success response
231
319
  * @summary: Deletes a page
232
320
  * @description: Use this API to delete a page for a theme by its ID and page_value.
233
321
  */
234
- deletePage({ themeId, pageValue } = {}) {
322
+ async deletePage({ themeId, pageValue } = {}) {
235
323
  const { error } = ThemeValidator.deletePage().validate(
236
324
  {
237
325
  themeId,
@@ -252,35 +340,52 @@ class Theme {
252
340
  { abortEarly: false, allowUnknown: false }
253
341
  );
254
342
  if (warrning) {
255
- console.log("Parameter Validation warrnings for deletePage");
256
- console.log(warrning);
343
+ Logger({
344
+ level: "WARN",
345
+ message: "Parameter Validation warrnings for deletePage",
346
+ });
347
+ Logger({ level: "WARN", message: warrning });
257
348
  }
258
349
 
259
350
  const query_params = {};
260
351
 
261
- return PlatformAPIClient.execute(
352
+ const response = await PlatformAPIClient.execute(
262
353
  this.config,
263
354
  "delete",
264
355
  `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/${pageValue}`,
265
356
  query_params,
266
357
  undefined
267
358
  );
359
+
360
+ const {
361
+ error: res_error,
362
+ } = ThemeModel.AvailablePageSchema().validate(response, {
363
+ abortEarly: false,
364
+ allowUnknown: false,
365
+ });
366
+
367
+ if (res_error) {
368
+ Logger({
369
+ level: "WARN",
370
+ message: "Response Validation Warnnings for deletePage",
371
+ });
372
+ Logger({ level: "WARN", message: res_error });
373
+ }
374
+
375
+ return response;
268
376
  }
269
377
 
270
378
  /**
271
379
  * @param {Object} arg - Arg object.
272
- * @param {number} [arg.pageSize] - The number of items to retrieve in each
273
- * page. Default value is 10.
274
- * @param {number} [arg.pageNo] - The page number to navigate through the
275
- * given set of results. Default value is 1.
276
- * @summary: Get a list of themes from the theme library
277
- * @description: Theme library is a personalized collection of themes that are chosen and added from the available themes. Use this API to fetch a list of themes from the library along with their configuration details.
380
+ * @param {string} arg.themeId - ID allotted to the theme.
381
+ * @returns {Promise<ThemesSchema>} - Success response
382
+ * @summary: Delete a theme
383
+ * @description: Use this API to delete a theme from the theme library.
278
384
  */
279
- getThemeLibrary({ pageSize, pageNo } = {}) {
280
- const { error } = ThemeValidator.getThemeLibrary().validate(
385
+ async deleteTheme({ themeId } = {}) {
386
+ const { error } = ThemeValidator.deleteTheme().validate(
281
387
  {
282
- pageSize,
283
- pageNo,
388
+ themeId,
284
389
  },
285
390
  { abortEarly: false, allowUnknown: true }
286
391
  );
@@ -289,41 +394,57 @@ class Theme {
289
394
  }
290
395
 
291
396
  // Showing warrnings if extra unknown parameters are found
292
- const { error: warrning } = ThemeValidator.getThemeLibrary().validate(
397
+ const { error: warrning } = ThemeValidator.deleteTheme().validate(
293
398
  {
294
- pageSize,
295
- pageNo,
399
+ themeId,
296
400
  },
297
401
  { abortEarly: false, allowUnknown: false }
298
402
  );
299
403
  if (warrning) {
300
- console.log("Parameter Validation warrnings for getThemeLibrary");
301
- console.log(warrning);
404
+ Logger({
405
+ level: "WARN",
406
+ message: "Parameter Validation warrnings for deleteTheme",
407
+ });
408
+ Logger({ level: "WARN", message: warrning });
302
409
  }
303
410
 
304
411
  const query_params = {};
305
- query_params["page_size"] = pageSize;
306
- query_params["page_no"] = pageNo;
307
412
 
308
- return PlatformAPIClient.execute(
413
+ const response = await PlatformAPIClient.execute(
309
414
  this.config,
310
- "get",
311
- `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/library`,
415
+ "delete",
416
+ `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}`,
312
417
  query_params,
313
418
  undefined
314
419
  );
420
+
421
+ const { error: res_error } = ThemeModel.ThemesSchema().validate(response, {
422
+ abortEarly: false,
423
+ allowUnknown: false,
424
+ });
425
+
426
+ if (res_error) {
427
+ Logger({
428
+ level: "WARN",
429
+ message: "Response Validation Warnnings for deleteTheme",
430
+ });
431
+ Logger({ level: "WARN", message: res_error });
432
+ }
433
+
434
+ return response;
315
435
  }
316
436
 
317
437
  /**
318
438
  * @param {Object} arg - Arg object.
319
- * @param {AddThemeRequestSchema} arg.body
320
- * @summary: Add a theme to the theme library
321
- * @description: Theme library is a personalized collection of themes that are chosen and added from the available themes. Use this API to choose a theme and add it to the theme library.
439
+ * @param {string} arg.themeId - ID of the theme to be retrieved
440
+ * @returns {Promise<AllAvailablePageSchema>} - Success response
441
+ * @summary: Get all pages of a theme
442
+ * @description: Use this API to retrieve all the available pages of a theme by its ID.
322
443
  */
323
- addToThemeLibrary({ body } = {}) {
324
- const { error } = ThemeValidator.addToThemeLibrary().validate(
444
+ async getAllPages({ themeId } = {}) {
445
+ const { error } = ThemeValidator.getAllPages().validate(
325
446
  {
326
- body,
447
+ themeId,
327
448
  },
328
449
  { abortEarly: false, allowUnknown: true }
329
450
  );
@@ -332,39 +453,57 @@ class Theme {
332
453
  }
333
454
 
334
455
  // Showing warrnings if extra unknown parameters are found
335
- const { error: warrning } = ThemeValidator.addToThemeLibrary().validate(
456
+ const { error: warrning } = ThemeValidator.getAllPages().validate(
336
457
  {
337
- body,
458
+ themeId,
338
459
  },
339
460
  { abortEarly: false, allowUnknown: false }
340
461
  );
341
462
  if (warrning) {
342
- console.log("Parameter Validation warrnings for addToThemeLibrary");
343
- console.log(warrning);
463
+ Logger({
464
+ level: "WARN",
465
+ message: "Parameter Validation warrnings for getAllPages",
466
+ });
467
+ Logger({ level: "WARN", message: warrning });
344
468
  }
345
469
 
346
470
  const query_params = {};
347
471
 
348
- return PlatformAPIClient.execute(
472
+ const response = await PlatformAPIClient.execute(
349
473
  this.config,
350
- "post",
351
- `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/library`,
474
+ "get",
475
+ `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/page`,
352
476
  query_params,
353
- body
477
+ undefined
354
478
  );
479
+
480
+ const {
481
+ error: res_error,
482
+ } = ThemeModel.AllAvailablePageSchema().validate(response, {
483
+ abortEarly: false,
484
+ allowUnknown: false,
485
+ });
486
+
487
+ if (res_error) {
488
+ Logger({
489
+ level: "WARN",
490
+ message: "Response Validation Warnnings for getAllPages",
491
+ });
492
+ Logger({ level: "WARN", message: res_error });
493
+ }
494
+
495
+ return response;
355
496
  }
356
497
 
357
498
  /**
358
499
  * @param {Object} arg - Arg object.
359
- * @param {AddThemeRequestSchema} arg.body
360
- * @summary: Apply a theme
361
- * @description: Use this API to apply a theme to the website.
500
+ * @returns {Promise<ThemesSchema>} - Success response
501
+ * @summary: Get the applied theme
502
+ * @description: Use this API to retrieve the theme that is currently applied to the website along with its details.
362
503
  */
363
- applyTheme({ body } = {}) {
364
- const { error } = ThemeValidator.applyTheme().validate(
365
- {
366
- body,
367
- },
504
+ async getAppliedTheme({} = {}) {
505
+ const { error } = ThemeValidator.getAppliedTheme().validate(
506
+ {},
368
507
  { abortEarly: false, allowUnknown: true }
369
508
  );
370
509
  if (error) {
@@ -372,39 +511,53 @@ class Theme {
372
511
  }
373
512
 
374
513
  // Showing warrnings if extra unknown parameters are found
375
- const { error: warrning } = ThemeValidator.applyTheme().validate(
376
- {
377
- body,
378
- },
514
+ const { error: warrning } = ThemeValidator.getAppliedTheme().validate(
515
+ {},
379
516
  { abortEarly: false, allowUnknown: false }
380
517
  );
381
518
  if (warrning) {
382
- console.log("Parameter Validation warrnings for applyTheme");
383
- console.log(warrning);
519
+ Logger({
520
+ level: "WARN",
521
+ message: "Parameter Validation warrnings for getAppliedTheme",
522
+ });
523
+ Logger({ level: "WARN", message: warrning });
384
524
  }
385
525
 
386
526
  const query_params = {};
387
527
 
388
- return PlatformAPIClient.execute(
528
+ const response = await PlatformAPIClient.execute(
389
529
  this.config,
390
- "post",
391
- `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/apply`,
530
+ "get",
531
+ `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/`,
392
532
  query_params,
393
- body
533
+ undefined
394
534
  );
535
+
536
+ const { error: res_error } = ThemeModel.ThemesSchema().validate(response, {
537
+ abortEarly: false,
538
+ allowUnknown: false,
539
+ });
540
+
541
+ if (res_error) {
542
+ Logger({
543
+ level: "WARN",
544
+ message: "Response Validation Warnnings for getAppliedTheme",
545
+ });
546
+ Logger({ level: "WARN", message: res_error });
547
+ }
548
+
549
+ return response;
395
550
  }
396
551
 
397
552
  /**
398
553
  * @param {Object} arg - Arg object.
399
- * @param {string} arg.themeId - Theme ID
400
- * @summary: Checks if theme is upgradable
401
- * @description: There's always a possibility that new features get added to a theme. Use this API to check if the applied theme has an upgrade available.
554
+ * @returns {Promise<FontsSchema>} - Success response
555
+ * @summary: Get all the supported fonts in a theme
556
+ * @description: Font is a collection of characters with a similar design. Use this API to retrieve a list of website fonts.
402
557
  */
403
- isUpgradable({ themeId } = {}) {
404
- const { error } = ThemeValidator.isUpgradable().validate(
405
- {
406
- themeId,
407
- },
558
+ async getFonts({} = {}) {
559
+ const { error } = ThemeValidator.getFonts().validate(
560
+ {},
408
561
  { abortEarly: false, allowUnknown: true }
409
562
  );
410
563
  if (error) {
@@ -412,38 +565,57 @@ class Theme {
412
565
  }
413
566
 
414
567
  // Showing warrnings if extra unknown parameters are found
415
- const { error: warrning } = ThemeValidator.isUpgradable().validate(
416
- {
417
- themeId,
418
- },
568
+ const { error: warrning } = ThemeValidator.getFonts().validate(
569
+ {},
419
570
  { abortEarly: false, allowUnknown: false }
420
571
  );
421
572
  if (warrning) {
422
- console.log("Parameter Validation warrnings for isUpgradable");
423
- console.log(warrning);
573
+ Logger({
574
+ level: "WARN",
575
+ message: "Parameter Validation warrnings for getFonts",
576
+ });
577
+ Logger({ level: "WARN", message: warrning });
424
578
  }
425
579
 
426
580
  const query_params = {};
427
581
 
428
- return PlatformAPIClient.execute(
582
+ const response = await PlatformAPIClient.execute(
429
583
  this.config,
430
584
  "get",
431
- `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/upgradable`,
585
+ `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/fonts`,
432
586
  query_params,
433
587
  undefined
434
588
  );
589
+
590
+ const { error: res_error } = ThemeModel.FontsSchema().validate(response, {
591
+ abortEarly: false,
592
+ allowUnknown: false,
593
+ });
594
+
595
+ if (res_error) {
596
+ Logger({
597
+ level: "WARN",
598
+ message: "Response Validation Warnnings for getFonts",
599
+ });
600
+ Logger({ level: "WARN", message: res_error });
601
+ }
602
+
603
+ return response;
435
604
  }
436
605
 
437
606
  /**
438
607
  * @param {Object} arg - Arg object.
439
- * @param {string} arg.themeId - ID allotted to the theme.
440
- * @summary: Upgrade a theme
441
- * @description: Use this API to upgrade the current theme to its latest version.
608
+ * @param {string} arg.themeId - ID of the theme to be retrieved
609
+ * @param {string} arg.pageValue - Value of the page to be retrieved
610
+ * @returns {Promise<AvailablePageSchema>} - Success response
611
+ * @summary: Get page of a theme
612
+ * @description: Use this API to retrieve a page of a theme.
442
613
  */
443
- upgradeTheme({ themeId } = {}) {
444
- const { error } = ThemeValidator.upgradeTheme().validate(
614
+ async getPage({ themeId, pageValue } = {}) {
615
+ const { error } = ThemeValidator.getPage().validate(
445
616
  {
446
617
  themeId,
618
+ pageValue,
447
619
  },
448
620
  { abortEarly: false, allowUnknown: true }
449
621
  );
@@ -452,26 +624,47 @@ class Theme {
452
624
  }
453
625
 
454
626
  // Showing warrnings if extra unknown parameters are found
455
- const { error: warrning } = ThemeValidator.upgradeTheme().validate(
627
+ const { error: warrning } = ThemeValidator.getPage().validate(
456
628
  {
457
629
  themeId,
630
+ pageValue,
458
631
  },
459
632
  { abortEarly: false, allowUnknown: false }
460
633
  );
461
634
  if (warrning) {
462
- console.log("Parameter Validation warrnings for upgradeTheme");
463
- console.log(warrning);
635
+ Logger({
636
+ level: "WARN",
637
+ message: "Parameter Validation warrnings for getPage",
638
+ });
639
+ Logger({ level: "WARN", message: warrning });
464
640
  }
465
641
 
466
642
  const query_params = {};
467
643
 
468
- return PlatformAPIClient.execute(
644
+ const response = await PlatformAPIClient.execute(
469
645
  this.config,
470
- "put",
471
- `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/upgrade`,
646
+ "get",
647
+ `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/${pageValue}`,
472
648
  query_params,
473
649
  undefined
474
650
  );
651
+
652
+ const {
653
+ error: res_error,
654
+ } = ThemeModel.AvailablePageSchema().validate(response, {
655
+ abortEarly: false,
656
+ allowUnknown: false,
657
+ });
658
+
659
+ if (res_error) {
660
+ Logger({
661
+ level: "WARN",
662
+ message: "Response Validation Warnnings for getPage",
663
+ });
664
+ Logger({ level: "WARN", message: res_error });
665
+ }
666
+
667
+ return response;
475
668
  }
476
669
 
477
670
  /**
@@ -480,10 +673,11 @@ class Theme {
480
673
  * page. Default value is 10.
481
674
  * @param {number} [arg.pageNo] - The page number to navigate through the
482
675
  * given set of results. Default value is 1.
676
+ * @returns {Promise<ThemesListingResponseSchema>} - Success response
483
677
  * @summary: Get all public themes
484
678
  * @description: Use this API to get a list of free themes that you can apply to your website.
485
679
  */
486
- getPublicThemes({ pageSize, pageNo } = {}) {
680
+ async getPublicThemes({ pageSize, pageNo } = {}) {
487
681
  const { error } = ThemeValidator.getPublicThemes().validate(
488
682
  {
489
683
  pageSize,
@@ -504,33 +698,54 @@ class Theme {
504
698
  { abortEarly: false, allowUnknown: false }
505
699
  );
506
700
  if (warrning) {
507
- console.log("Parameter Validation warrnings for getPublicThemes");
508
- console.log(warrning);
701
+ Logger({
702
+ level: "WARN",
703
+ message: "Parameter Validation warrnings for getPublicThemes",
704
+ });
705
+ Logger({ level: "WARN", message: warrning });
509
706
  }
510
707
 
511
708
  const query_params = {};
512
709
  query_params["page_size"] = pageSize;
513
710
  query_params["page_no"] = pageNo;
514
711
 
515
- return PlatformAPIClient.execute(
712
+ const response = await PlatformAPIClient.execute(
516
713
  this.config,
517
714
  "get",
518
715
  `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/list/public`,
519
716
  query_params,
520
717
  undefined
521
718
  );
719
+
720
+ const {
721
+ error: res_error,
722
+ } = ThemeModel.ThemesListingResponseSchema().validate(response, {
723
+ abortEarly: false,
724
+ allowUnknown: false,
725
+ });
726
+
727
+ if (res_error) {
728
+ Logger({
729
+ level: "WARN",
730
+ message: "Response Validation Warnnings for getPublicThemes",
731
+ });
732
+ Logger({ level: "WARN", message: res_error });
733
+ }
734
+
735
+ return response;
522
736
  }
523
737
 
524
738
  /**
525
739
  * @param {Object} arg - Arg object.
526
- * @param {ThemesSchema} arg.body
527
- * @summary: Create a new theme
528
- * @description: Themes improve the look and appearance of a website. Use this API to create a theme.
740
+ * @param {string} arg.themeId - ID allotted to the theme.
741
+ * @returns {Promise<ThemesSchema>} - Success response
742
+ * @summary: Gets theme by id
743
+ * @description: Use this API to retrieve the details of a specific theme by using its ID.
529
744
  */
530
- createTheme({ body } = {}) {
531
- const { error } = ThemeValidator.createTheme().validate(
745
+ async getThemeById({ themeId } = {}) {
746
+ const { error } = ThemeValidator.getThemeById().validate(
532
747
  {
533
- body,
748
+ themeId,
534
749
  },
535
750
  { abortEarly: false, allowUnknown: true }
536
751
  );
@@ -539,36 +754,58 @@ class Theme {
539
754
  }
540
755
 
541
756
  // Showing warrnings if extra unknown parameters are found
542
- const { error: warrning } = ThemeValidator.createTheme().validate(
757
+ const { error: warrning } = ThemeValidator.getThemeById().validate(
543
758
  {
544
- body,
759
+ themeId,
545
760
  },
546
761
  { abortEarly: false, allowUnknown: false }
547
762
  );
548
763
  if (warrning) {
549
- console.log("Parameter Validation warrnings for createTheme");
550
- console.log(warrning);
764
+ Logger({
765
+ level: "WARN",
766
+ message: "Parameter Validation warrnings for getThemeById",
767
+ });
768
+ Logger({ level: "WARN", message: warrning });
551
769
  }
552
770
 
553
771
  const query_params = {};
554
772
 
555
- return PlatformAPIClient.execute(
773
+ const response = await PlatformAPIClient.execute(
556
774
  this.config,
557
- "post",
558
- `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/`,
775
+ "get",
776
+ `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}`,
559
777
  query_params,
560
- body
778
+ undefined
561
779
  );
780
+
781
+ const { error: res_error } = ThemeModel.ThemesSchema().validate(response, {
782
+ abortEarly: false,
783
+ allowUnknown: false,
784
+ });
785
+
786
+ if (res_error) {
787
+ Logger({
788
+ level: "WARN",
789
+ message: "Response Validation Warnnings for getThemeById",
790
+ });
791
+ Logger({ level: "WARN", message: res_error });
792
+ }
793
+
794
+ return response;
562
795
  }
563
796
 
564
797
  /**
565
798
  * @param {Object} arg - Arg object.
566
- * @summary: Get the applied theme
567
- * @description: Use this API to retrieve the theme that is currently applied to the website along with its details.
799
+ * @param {string} arg.themeId - ID allotted to the theme.
800
+ * @returns {Promise<ThemesSchema>} - Success response
801
+ * @summary: Get a theme preview
802
+ * @description: A theme can be previewed before applying it. Use this API to retrieve the theme preview by using its ID.
568
803
  */
569
- getAppliedTheme({} = {}) {
570
- const { error } = ThemeValidator.getAppliedTheme().validate(
571
- {},
804
+ async getThemeForPreview({ themeId } = {}) {
805
+ const { error } = ThemeValidator.getThemeForPreview().validate(
806
+ {
807
+ themeId,
808
+ },
572
809
  { abortEarly: false, allowUnknown: true }
573
810
  );
574
811
  if (error) {
@@ -576,34 +813,58 @@ class Theme {
576
813
  }
577
814
 
578
815
  // Showing warrnings if extra unknown parameters are found
579
- const { error: warrning } = ThemeValidator.getAppliedTheme().validate(
580
- {},
816
+ const { error: warrning } = ThemeValidator.getThemeForPreview().validate(
817
+ {
818
+ themeId,
819
+ },
581
820
  { abortEarly: false, allowUnknown: false }
582
821
  );
583
822
  if (warrning) {
584
- console.log("Parameter Validation warrnings for getAppliedTheme");
585
- console.log(warrning);
823
+ Logger({
824
+ level: "WARN",
825
+ message: "Parameter Validation warrnings for getThemeForPreview",
826
+ });
827
+ Logger({ level: "WARN", message: warrning });
586
828
  }
587
829
 
588
830
  const query_params = {};
589
831
 
590
- return PlatformAPIClient.execute(
832
+ const response = await PlatformAPIClient.execute(
591
833
  this.config,
592
834
  "get",
593
- `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/`,
835
+ `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/preview`,
594
836
  query_params,
595
837
  undefined
596
838
  );
839
+
840
+ const { error: res_error } = ThemeModel.ThemesSchema().validate(response, {
841
+ abortEarly: false,
842
+ allowUnknown: false,
843
+ });
844
+
845
+ if (res_error) {
846
+ Logger({
847
+ level: "WARN",
848
+ message: "Response Validation Warnnings for getThemeForPreview",
849
+ });
850
+ Logger({ level: "WARN", message: res_error });
851
+ }
852
+
853
+ return response;
597
854
  }
598
855
 
599
856
  /**
600
857
  * @param {Object} arg - Arg object.
601
- * @summary: Get all the supported fonts in a theme
602
- * @description: Font is a collection of characters with a similar design. Use this API to retrieve a list of website fonts.
858
+ * @param {string} arg.themeId - ID allotted to the theme.
859
+ * @returns {Promise<any>} - Success response
860
+ * @summary: Fetch last modified timestamp
861
+ * @description: Use this API to fetch Last-Modified timestamp in header metadata.
603
862
  */
604
- getFonts({} = {}) {
605
- const { error } = ThemeValidator.getFonts().validate(
606
- {},
863
+ async getThemeLastModified({ themeId } = {}) {
864
+ const { error } = ThemeValidator.getThemeLastModified().validate(
865
+ {
866
+ themeId,
867
+ },
607
868
  { abortEarly: false, allowUnknown: true }
608
869
  );
609
870
  if (error) {
@@ -611,36 +872,60 @@ class Theme {
611
872
  }
612
873
 
613
874
  // Showing warrnings if extra unknown parameters are found
614
- const { error: warrning } = ThemeValidator.getFonts().validate(
615
- {},
875
+ const { error: warrning } = ThemeValidator.getThemeLastModified().validate(
876
+ {
877
+ themeId,
878
+ },
616
879
  { abortEarly: false, allowUnknown: false }
617
880
  );
618
881
  if (warrning) {
619
- console.log("Parameter Validation warrnings for getFonts");
620
- console.log(warrning);
882
+ Logger({
883
+ level: "WARN",
884
+ message: "Parameter Validation warrnings for getThemeLastModified",
885
+ });
886
+ Logger({ level: "WARN", message: warrning });
621
887
  }
622
888
 
623
889
  const query_params = {};
624
890
 
625
- return PlatformAPIClient.execute(
891
+ const response = await PlatformAPIClient.execute(
626
892
  this.config,
627
- "get",
628
- `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/fonts`,
893
+ "head",
894
+ `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/polling`,
629
895
  query_params,
630
896
  undefined
631
897
  );
898
+
899
+ const { error: res_error } = Joi.string()
900
+ .allow("")
901
+ .validate(response, { abortEarly: false, allowUnknown: false });
902
+
903
+ if (res_error) {
904
+ Logger({
905
+ level: "WARN",
906
+ message: "Response Validation Warnnings for getThemeLastModified",
907
+ });
908
+ Logger({ level: "WARN", message: res_error });
909
+ }
910
+
911
+ return response;
632
912
  }
633
913
 
634
914
  /**
635
915
  * @param {Object} arg - Arg object.
636
- * @param {string} arg.themeId - ID allotted to the theme.
637
- * @summary: Gets theme by id
638
- * @description: Use this API to retrieve the details of a specific theme by using its ID.
916
+ * @param {number} [arg.pageSize] - The number of items to retrieve in each
917
+ * page. Default value is 10.
918
+ * @param {number} [arg.pageNo] - The page number to navigate through the
919
+ * given set of results. Default value is 1.
920
+ * @returns {Promise<ThemesListingResponseSchema>} - Success response
921
+ * @summary: Get a list of themes from the theme library
922
+ * @description: Theme library is a personalized collection of themes that are chosen and added from the available themes. Use this API to fetch a list of themes from the library along with their configuration details.
639
923
  */
640
- getThemeById({ themeId } = {}) {
641
- const { error } = ThemeValidator.getThemeById().validate(
924
+ async getThemeLibrary({ pageSize, pageNo } = {}) {
925
+ const { error } = ThemeValidator.getThemeLibrary().validate(
642
926
  {
643
- themeId,
927
+ pageSize,
928
+ pageNo,
644
929
  },
645
930
  { abortEarly: false, allowUnknown: true }
646
931
  );
@@ -649,40 +934,62 @@ class Theme {
649
934
  }
650
935
 
651
936
  // Showing warrnings if extra unknown parameters are found
652
- const { error: warrning } = ThemeValidator.getThemeById().validate(
937
+ const { error: warrning } = ThemeValidator.getThemeLibrary().validate(
653
938
  {
654
- themeId,
939
+ pageSize,
940
+ pageNo,
655
941
  },
656
942
  { abortEarly: false, allowUnknown: false }
657
943
  );
658
944
  if (warrning) {
659
- console.log("Parameter Validation warrnings for getThemeById");
660
- console.log(warrning);
945
+ Logger({
946
+ level: "WARN",
947
+ message: "Parameter Validation warrnings for getThemeLibrary",
948
+ });
949
+ Logger({ level: "WARN", message: warrning });
661
950
  }
662
951
 
663
952
  const query_params = {};
953
+ query_params["page_size"] = pageSize;
954
+ query_params["page_no"] = pageNo;
664
955
 
665
- return PlatformAPIClient.execute(
956
+ const response = await PlatformAPIClient.execute(
666
957
  this.config,
667
958
  "get",
668
- `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}`,
959
+ `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/library`,
669
960
  query_params,
670
961
  undefined
671
962
  );
963
+
964
+ const {
965
+ error: res_error,
966
+ } = ThemeModel.ThemesListingResponseSchema().validate(response, {
967
+ abortEarly: false,
968
+ allowUnknown: false,
969
+ });
970
+
971
+ if (res_error) {
972
+ Logger({
973
+ level: "WARN",
974
+ message: "Response Validation Warnnings for getThemeLibrary",
975
+ });
976
+ Logger({ level: "WARN", message: res_error });
977
+ }
978
+
979
+ return response;
672
980
  }
673
981
 
674
982
  /**
675
983
  * @param {Object} arg - Arg object.
676
- * @param {string} arg.themeId - ID allotted to the theme.
677
- * @param {ThemesSchema} arg.body
678
- * @summary: Update a theme
679
- * @description: Use this API to edit an existing theme. You can customize the website font, sections, images, styles, and many more.
984
+ * @param {string} arg.themeId - Theme ID
985
+ * @returns {Promise<UpgradableThemeSchema>} - Success response
986
+ * @summary: Checks if theme is upgradable
987
+ * @description: There's always a possibility that new features get added to a theme. Use this API to check if the applied theme has an upgrade available.
680
988
  */
681
- updateTheme({ themeId, body } = {}) {
682
- const { error } = ThemeValidator.updateTheme().validate(
989
+ async isUpgradable({ themeId } = {}) {
990
+ const { error } = ThemeValidator.isUpgradable().validate(
683
991
  {
684
992
  themeId,
685
- body,
686
993
  },
687
994
  { abortEarly: false, allowUnknown: true }
688
995
  );
@@ -691,37 +998,57 @@ class Theme {
691
998
  }
692
999
 
693
1000
  // Showing warrnings if extra unknown parameters are found
694
- const { error: warrning } = ThemeValidator.updateTheme().validate(
1001
+ const { error: warrning } = ThemeValidator.isUpgradable().validate(
695
1002
  {
696
1003
  themeId,
697
- body,
698
1004
  },
699
1005
  { abortEarly: false, allowUnknown: false }
700
1006
  );
701
1007
  if (warrning) {
702
- console.log("Parameter Validation warrnings for updateTheme");
703
- console.log(warrning);
1008
+ Logger({
1009
+ level: "WARN",
1010
+ message: "Parameter Validation warrnings for isUpgradable",
1011
+ });
1012
+ Logger({ level: "WARN", message: warrning });
704
1013
  }
705
1014
 
706
1015
  const query_params = {};
707
1016
 
708
- return PlatformAPIClient.execute(
1017
+ const response = await PlatformAPIClient.execute(
709
1018
  this.config,
710
- "put",
711
- `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}`,
1019
+ "get",
1020
+ `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/upgradable`,
712
1021
  query_params,
713
- body
1022
+ undefined
714
1023
  );
1024
+
1025
+ const {
1026
+ error: res_error,
1027
+ } = ThemeModel.UpgradableThemeSchema().validate(response, {
1028
+ abortEarly: false,
1029
+ allowUnknown: false,
1030
+ });
1031
+
1032
+ if (res_error) {
1033
+ Logger({
1034
+ level: "WARN",
1035
+ message: "Response Validation Warnnings for isUpgradable",
1036
+ });
1037
+ Logger({ level: "WARN", message: res_error });
1038
+ }
1039
+
1040
+ return response;
715
1041
  }
716
1042
 
717
1043
  /**
718
1044
  * @param {Object} arg - Arg object.
719
1045
  * @param {string} arg.themeId - ID allotted to the theme.
720
- * @summary: Delete a theme
721
- * @description: Use this API to delete a theme from the theme library.
1046
+ * @returns {Promise<ThemesSchema>} - Success response
1047
+ * @summary: Publish a theme
1048
+ * @description: Use this API to publish a theme that is either newly created or edited.
722
1049
  */
723
- deleteTheme({ themeId } = {}) {
724
- const { error } = ThemeValidator.deleteTheme().validate(
1050
+ async publishTheme({ themeId } = {}) {
1051
+ const { error } = ThemeValidator.publishTheme().validate(
725
1052
  {
726
1053
  themeId,
727
1054
  },
@@ -732,36 +1059,55 @@ class Theme {
732
1059
  }
733
1060
 
734
1061
  // Showing warrnings if extra unknown parameters are found
735
- const { error: warrning } = ThemeValidator.deleteTheme().validate(
1062
+ const { error: warrning } = ThemeValidator.publishTheme().validate(
736
1063
  {
737
1064
  themeId,
738
1065
  },
739
1066
  { abortEarly: false, allowUnknown: false }
740
1067
  );
741
1068
  if (warrning) {
742
- console.log("Parameter Validation warrnings for deleteTheme");
743
- console.log(warrning);
1069
+ Logger({
1070
+ level: "WARN",
1071
+ message: "Parameter Validation warrnings for publishTheme",
1072
+ });
1073
+ Logger({ level: "WARN", message: warrning });
744
1074
  }
745
1075
 
746
1076
  const query_params = {};
747
1077
 
748
- return PlatformAPIClient.execute(
1078
+ const response = await PlatformAPIClient.execute(
749
1079
  this.config,
750
- "delete",
751
- `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}`,
1080
+ "put",
1081
+ `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/publish`,
752
1082
  query_params,
753
1083
  undefined
754
1084
  );
1085
+
1086
+ const { error: res_error } = ThemeModel.ThemesSchema().validate(response, {
1087
+ abortEarly: false,
1088
+ allowUnknown: false,
1089
+ });
1090
+
1091
+ if (res_error) {
1092
+ Logger({
1093
+ level: "WARN",
1094
+ message: "Response Validation Warnnings for publishTheme",
1095
+ });
1096
+ Logger({ level: "WARN", message: res_error });
1097
+ }
1098
+
1099
+ return response;
755
1100
  }
756
1101
 
757
1102
  /**
758
1103
  * @param {Object} arg - Arg object.
759
1104
  * @param {string} arg.themeId - ID allotted to the theme.
760
- * @summary: Get a theme preview
761
- * @description: A theme can be previewed before applying it. Use this API to retrieve the theme preview by using its ID.
1105
+ * @returns {Promise<ThemesSchema>} - Success response
1106
+ * @summary: Unarchive a theme
1107
+ * @description: Use this API to restore an archived theme and bring it back for editing or publishing.
762
1108
  */
763
- getThemeForPreview({ themeId } = {}) {
764
- const { error } = ThemeValidator.getThemeForPreview().validate(
1109
+ async unarchiveTheme({ themeId } = {}) {
1110
+ const { error } = ThemeValidator.unarchiveTheme().validate(
765
1111
  {
766
1112
  themeId,
767
1113
  },
@@ -772,36 +1118,55 @@ class Theme {
772
1118
  }
773
1119
 
774
1120
  // Showing warrnings if extra unknown parameters are found
775
- const { error: warrning } = ThemeValidator.getThemeForPreview().validate(
1121
+ const { error: warrning } = ThemeValidator.unarchiveTheme().validate(
776
1122
  {
777
1123
  themeId,
778
1124
  },
779
1125
  { abortEarly: false, allowUnknown: false }
780
1126
  );
781
1127
  if (warrning) {
782
- console.log("Parameter Validation warrnings for getThemeForPreview");
783
- console.log(warrning);
1128
+ Logger({
1129
+ level: "WARN",
1130
+ message: "Parameter Validation warrnings for unarchiveTheme",
1131
+ });
1132
+ Logger({ level: "WARN", message: warrning });
784
1133
  }
785
1134
 
786
1135
  const query_params = {};
787
1136
 
788
- return PlatformAPIClient.execute(
1137
+ const response = await PlatformAPIClient.execute(
789
1138
  this.config,
790
- "get",
791
- `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/preview`,
1139
+ "put",
1140
+ `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/unarchive`,
792
1141
  query_params,
793
1142
  undefined
794
1143
  );
1144
+
1145
+ const { error: res_error } = ThemeModel.ThemesSchema().validate(response, {
1146
+ abortEarly: false,
1147
+ allowUnknown: false,
1148
+ });
1149
+
1150
+ if (res_error) {
1151
+ Logger({
1152
+ level: "WARN",
1153
+ message: "Response Validation Warnnings for unarchiveTheme",
1154
+ });
1155
+ Logger({ level: "WARN", message: res_error });
1156
+ }
1157
+
1158
+ return response;
795
1159
  }
796
1160
 
797
1161
  /**
798
1162
  * @param {Object} arg - Arg object.
799
1163
  * @param {string} arg.themeId - ID allotted to the theme.
800
- * @summary: Publish a theme
801
- * @description: Use this API to publish a theme that is either newly created or edited.
1164
+ * @returns {Promise<ThemesSchema>} - Success response
1165
+ * @summary: Unpublish a theme
1166
+ * @description: Use this API to remove an existing theme from the list of available themes.
802
1167
  */
803
- publishTheme({ themeId } = {}) {
804
- const { error } = ThemeValidator.publishTheme().validate(
1168
+ async unpublishTheme({ themeId } = {}) {
1169
+ const { error } = ThemeValidator.unpublishTheme().validate(
805
1170
  {
806
1171
  themeId,
807
1172
  },
@@ -812,38 +1177,59 @@ class Theme {
812
1177
  }
813
1178
 
814
1179
  // Showing warrnings if extra unknown parameters are found
815
- const { error: warrning } = ThemeValidator.publishTheme().validate(
1180
+ const { error: warrning } = ThemeValidator.unpublishTheme().validate(
816
1181
  {
817
1182
  themeId,
818
1183
  },
819
1184
  { abortEarly: false, allowUnknown: false }
820
1185
  );
821
1186
  if (warrning) {
822
- console.log("Parameter Validation warrnings for publishTheme");
823
- console.log(warrning);
1187
+ Logger({
1188
+ level: "WARN",
1189
+ message: "Parameter Validation warrnings for unpublishTheme",
1190
+ });
1191
+ Logger({ level: "WARN", message: warrning });
824
1192
  }
825
1193
 
826
1194
  const query_params = {};
827
1195
 
828
- return PlatformAPIClient.execute(
1196
+ const response = await PlatformAPIClient.execute(
829
1197
  this.config,
830
1198
  "put",
831
- `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/publish`,
1199
+ `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/unpublish`,
832
1200
  query_params,
833
1201
  undefined
834
1202
  );
1203
+
1204
+ const { error: res_error } = ThemeModel.ThemesSchema().validate(response, {
1205
+ abortEarly: false,
1206
+ allowUnknown: false,
1207
+ });
1208
+
1209
+ if (res_error) {
1210
+ Logger({
1211
+ level: "WARN",
1212
+ message: "Response Validation Warnnings for unpublishTheme",
1213
+ });
1214
+ Logger({ level: "WARN", message: res_error });
1215
+ }
1216
+
1217
+ return response;
835
1218
  }
836
1219
 
837
1220
  /**
838
1221
  * @param {Object} arg - Arg object.
839
- * @param {string} arg.themeId - ID allotted to the theme.
840
- * @summary: Unpublish a theme
841
- * @description: Use this API to remove an existing theme from the list of available themes.
1222
+ * @param {string} arg.themeId - ID of the theme to be retrieved
1223
+ * @param {AllAvailablePageSchema} arg.body
1224
+ * @returns {Promise<AllAvailablePageSchema>} - Success response
1225
+ * @summary: Update multiple pages of a theme
1226
+ * @description: Use this API to update multiple pages of a theme by its ID.
842
1227
  */
843
- unpublishTheme({ themeId } = {}) {
844
- const { error } = ThemeValidator.unpublishTheme().validate(
1228
+ async updateMultiplePages({ themeId, body } = {}) {
1229
+ const { error } = ThemeValidator.updateMultiplePages().validate(
845
1230
  {
846
1231
  themeId,
1232
+ body,
847
1233
  },
848
1234
  { abortEarly: false, allowUnknown: true }
849
1235
  );
@@ -852,38 +1238,64 @@ class Theme {
852
1238
  }
853
1239
 
854
1240
  // Showing warrnings if extra unknown parameters are found
855
- const { error: warrning } = ThemeValidator.unpublishTheme().validate(
1241
+ const { error: warrning } = ThemeValidator.updateMultiplePages().validate(
856
1242
  {
857
1243
  themeId,
1244
+ body,
858
1245
  },
859
1246
  { abortEarly: false, allowUnknown: false }
860
1247
  );
861
1248
  if (warrning) {
862
- console.log("Parameter Validation warrnings for unpublishTheme");
863
- console.log(warrning);
1249
+ Logger({
1250
+ level: "WARN",
1251
+ message: "Parameter Validation warrnings for updateMultiplePages",
1252
+ });
1253
+ Logger({ level: "WARN", message: warrning });
864
1254
  }
865
1255
 
866
1256
  const query_params = {};
867
1257
 
868
- return PlatformAPIClient.execute(
1258
+ const response = await PlatformAPIClient.execute(
869
1259
  this.config,
870
1260
  "put",
871
- `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/unpublish`,
1261
+ `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/page`,
872
1262
  query_params,
873
- undefined
1263
+ body
874
1264
  );
1265
+
1266
+ const {
1267
+ error: res_error,
1268
+ } = ThemeModel.AllAvailablePageSchema().validate(response, {
1269
+ abortEarly: false,
1270
+ allowUnknown: false,
1271
+ });
1272
+
1273
+ if (res_error) {
1274
+ Logger({
1275
+ level: "WARN",
1276
+ message: "Response Validation Warnnings for updateMultiplePages",
1277
+ });
1278
+ Logger({ level: "WARN", message: res_error });
1279
+ }
1280
+
1281
+ return response;
875
1282
  }
876
1283
 
877
1284
  /**
878
1285
  * @param {Object} arg - Arg object.
879
- * @param {string} arg.themeId - ID allotted to the theme.
880
- * @summary: Archive a theme
881
- * @description: Use this API to store an existing theme but not delete it so that it can be used in future if required.
1286
+ * @param {string} arg.themeId - ID of the theme
1287
+ * @param {string} arg.pageValue - Value of the page to be updated
1288
+ * @param {AvailablePageSchema} arg.body
1289
+ * @returns {Promise<AvailablePageSchema>} - Success response
1290
+ * @summary: Updates a page
1291
+ * @description: Use this API to update a page for a theme by its ID.
882
1292
  */
883
- archiveTheme({ themeId } = {}) {
884
- const { error } = ThemeValidator.archiveTheme().validate(
1293
+ async updatePage({ themeId, pageValue, body } = {}) {
1294
+ const { error } = ThemeValidator.updatePage().validate(
885
1295
  {
886
1296
  themeId,
1297
+ pageValue,
1298
+ body,
887
1299
  },
888
1300
  { abortEarly: false, allowUnknown: true }
889
1301
  );
@@ -892,38 +1304,63 @@ class Theme {
892
1304
  }
893
1305
 
894
1306
  // Showing warrnings if extra unknown parameters are found
895
- const { error: warrning } = ThemeValidator.archiveTheme().validate(
1307
+ const { error: warrning } = ThemeValidator.updatePage().validate(
896
1308
  {
897
1309
  themeId,
1310
+ pageValue,
1311
+ body,
898
1312
  },
899
1313
  { abortEarly: false, allowUnknown: false }
900
1314
  );
901
1315
  if (warrning) {
902
- console.log("Parameter Validation warrnings for archiveTheme");
903
- console.log(warrning);
1316
+ Logger({
1317
+ level: "WARN",
1318
+ message: "Parameter Validation warrnings for updatePage",
1319
+ });
1320
+ Logger({ level: "WARN", message: warrning });
904
1321
  }
905
1322
 
906
1323
  const query_params = {};
907
1324
 
908
- return PlatformAPIClient.execute(
1325
+ const response = await PlatformAPIClient.execute(
909
1326
  this.config,
910
1327
  "put",
911
- `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/archive`,
1328
+ `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/${pageValue}`,
912
1329
  query_params,
913
- undefined
1330
+ body
914
1331
  );
1332
+
1333
+ const {
1334
+ error: res_error,
1335
+ } = ThemeModel.AvailablePageSchema().validate(response, {
1336
+ abortEarly: false,
1337
+ allowUnknown: false,
1338
+ });
1339
+
1340
+ if (res_error) {
1341
+ Logger({
1342
+ level: "WARN",
1343
+ message: "Response Validation Warnnings for updatePage",
1344
+ });
1345
+ Logger({ level: "WARN", message: res_error });
1346
+ }
1347
+
1348
+ return response;
915
1349
  }
916
1350
 
917
1351
  /**
918
1352
  * @param {Object} arg - Arg object.
919
1353
  * @param {string} arg.themeId - ID allotted to the theme.
920
- * @summary: Unarchive a theme
921
- * @description: Use this API to restore an archived theme and bring it back for editing or publishing.
1354
+ * @param {ThemesSchema} arg.body
1355
+ * @returns {Promise<ThemesSchema>} - Success response
1356
+ * @summary: Update a theme
1357
+ * @description: Use this API to edit an existing theme. You can customize the website font, sections, images, styles, and many more.
922
1358
  */
923
- unarchiveTheme({ themeId } = {}) {
924
- const { error } = ThemeValidator.unarchiveTheme().validate(
1359
+ async updateTheme({ themeId, body } = {}) {
1360
+ const { error } = ThemeValidator.updateTheme().validate(
925
1361
  {
926
1362
  themeId,
1363
+ body,
927
1364
  },
928
1365
  { abortEarly: false, allowUnknown: true }
929
1366
  );
@@ -932,36 +1369,56 @@ class Theme {
932
1369
  }
933
1370
 
934
1371
  // Showing warrnings if extra unknown parameters are found
935
- const { error: warrning } = ThemeValidator.unarchiveTheme().validate(
1372
+ const { error: warrning } = ThemeValidator.updateTheme().validate(
936
1373
  {
937
1374
  themeId,
1375
+ body,
938
1376
  },
939
1377
  { abortEarly: false, allowUnknown: false }
940
1378
  );
941
1379
  if (warrning) {
942
- console.log("Parameter Validation warrnings for unarchiveTheme");
943
- console.log(warrning);
1380
+ Logger({
1381
+ level: "WARN",
1382
+ message: "Parameter Validation warrnings for updateTheme",
1383
+ });
1384
+ Logger({ level: "WARN", message: warrning });
944
1385
  }
945
1386
 
946
1387
  const query_params = {};
947
1388
 
948
- return PlatformAPIClient.execute(
1389
+ const response = await PlatformAPIClient.execute(
949
1390
  this.config,
950
1391
  "put",
951
- `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/unarchive`,
1392
+ `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}`,
952
1393
  query_params,
953
- undefined
1394
+ body
954
1395
  );
1396
+
1397
+ const { error: res_error } = ThemeModel.ThemesSchema().validate(response, {
1398
+ abortEarly: false,
1399
+ allowUnknown: false,
1400
+ });
1401
+
1402
+ if (res_error) {
1403
+ Logger({
1404
+ level: "WARN",
1405
+ message: "Response Validation Warnnings for updateTheme",
1406
+ });
1407
+ Logger({ level: "WARN", message: res_error });
1408
+ }
1409
+
1410
+ return response;
955
1411
  }
956
1412
 
957
1413
  /**
958
1414
  * @param {Object} arg - Arg object.
959
1415
  * @param {string} arg.themeId - ID allotted to the theme.
960
- * @summary: Fetch last modified timestamp
961
- * @description: Use this API to fetch Last-Modified timestamp in header metadata.
1416
+ * @returns {Promise<ThemesSchema>} - Success response
1417
+ * @summary: Upgrade a theme
1418
+ * @description: Use this API to upgrade the current theme to its latest version.
962
1419
  */
963
- getThemeLastModified({ themeId } = {}) {
964
- const { error } = ThemeValidator.getThemeLastModified().validate(
1420
+ async upgradeTheme({ themeId } = {}) {
1421
+ const { error } = ThemeValidator.upgradeTheme().validate(
965
1422
  {
966
1423
  themeId,
967
1424
  },
@@ -972,26 +1429,44 @@ class Theme {
972
1429
  }
973
1430
 
974
1431
  // Showing warrnings if extra unknown parameters are found
975
- const { error: warrning } = ThemeValidator.getThemeLastModified().validate(
1432
+ const { error: warrning } = ThemeValidator.upgradeTheme().validate(
976
1433
  {
977
1434
  themeId,
978
1435
  },
979
1436
  { abortEarly: false, allowUnknown: false }
980
1437
  );
981
1438
  if (warrning) {
982
- console.log("Parameter Validation warrnings for getThemeLastModified");
983
- console.log(warrning);
1439
+ Logger({
1440
+ level: "WARN",
1441
+ message: "Parameter Validation warrnings for upgradeTheme",
1442
+ });
1443
+ Logger({ level: "WARN", message: warrning });
984
1444
  }
985
1445
 
986
1446
  const query_params = {};
987
1447
 
988
- return PlatformAPIClient.execute(
1448
+ const response = await PlatformAPIClient.execute(
989
1449
  this.config,
990
- "head",
991
- `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/polling`,
1450
+ "put",
1451
+ `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/upgrade`,
992
1452
  query_params,
993
1453
  undefined
994
1454
  );
1455
+
1456
+ const { error: res_error } = ThemeModel.ThemesSchema().validate(response, {
1457
+ abortEarly: false,
1458
+ allowUnknown: false,
1459
+ });
1460
+
1461
+ if (res_error) {
1462
+ Logger({
1463
+ level: "WARN",
1464
+ message: "Response Validation Warnnings for upgradeTheme",
1465
+ });
1466
+ Logger({ level: "WARN", message: res_error });
1467
+ }
1468
+
1469
+ return response;
995
1470
  }
996
1471
  }
997
1472
  module.exports = Theme;