@gofynd/fdk-client-javascript 1.1.6 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (348) hide show
  1. package/README.md +52 -3
  2. package/index.js +0 -3
  3. package/package.json +1 -2
  4. package/sdk/application/ApplicationAPIClient.d.ts +15 -1
  5. package/sdk/application/ApplicationAPIClient.js +12 -3
  6. package/sdk/application/ApplicationClient.d.ts +36 -6
  7. package/sdk/application/ApplicationClient.js +30 -43
  8. package/sdk/application/ApplicationConfig.d.ts +92 -12
  9. package/sdk/application/ApplicationConfig.js +48 -14
  10. package/sdk/application/Cart/CartApplicationClient.d.ts +200 -357
  11. package/sdk/application/Cart/CartApplicationClient.js +711 -483
  12. package/sdk/application/Cart/CartApplicationModel.d.ts +2054 -96
  13. package/sdk/application/Cart/CartApplicationModel.js +1224 -93
  14. package/sdk/application/Cart/CartApplicationValidator.d.ts +508 -30
  15. package/sdk/application/Cart/CartApplicationValidator.js +270 -15
  16. package/sdk/application/Catalog/CatalogApplicationClient.d.ts +274 -422
  17. package/sdk/application/Catalog/CatalogApplicationClient.js +865 -630
  18. package/sdk/application/Catalog/CatalogApplicationModel.d.ts +2320 -117
  19. package/sdk/application/Catalog/CatalogApplicationModel.js +1566 -172
  20. package/sdk/application/Catalog/CatalogApplicationValidator.d.ts +798 -31
  21. package/sdk/application/Catalog/CatalogApplicationValidator.js +318 -3
  22. package/sdk/application/Common/CommonApplicationClient.d.ts +16 -21
  23. package/sdk/application/Common/CommonApplicationClient.js +52 -33
  24. package/sdk/application/Common/CommonApplicationModel.d.ts +368 -19
  25. package/sdk/application/Common/CommonApplicationModel.js +192 -40
  26. package/sdk/application/Common/CommonApplicationValidator.d.ts +42 -4
  27. package/sdk/application/Common/CommonApplicationValidator.js +21 -3
  28. package/sdk/application/Communication/CommunicationApplicationClient.d.ts +31 -18
  29. package/sdk/application/Communication/CommunicationApplicationClient.js +86 -47
  30. package/sdk/application/Communication/CommunicationApplicationModel.d.ts +157 -14
  31. package/sdk/application/Communication/CommunicationApplicationModel.js +104 -23
  32. package/sdk/application/Communication/CommunicationApplicationValidator.d.ts +27 -4
  33. package/sdk/application/Communication/CommunicationApplicationValidator.js +21 -5
  34. package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +149 -118
  35. package/sdk/application/Configuration/ConfigurationApplicationClient.js +457 -260
  36. package/sdk/application/Configuration/ConfigurationApplicationModel.d.ts +2235 -110
  37. package/sdk/application/Configuration/ConfigurationApplicationModel.js +1113 -193
  38. package/sdk/application/Configuration/ConfigurationApplicationValidator.d.ts +160 -8
  39. package/sdk/application/Configuration/ConfigurationApplicationValidator.js +88 -4
  40. package/sdk/application/Content/ContentApplicationClient.d.ts +149 -139
  41. package/sdk/application/Content/ContentApplicationClient.js +489 -278
  42. package/sdk/application/Content/ContentApplicationModel.d.ts +1010 -105
  43. package/sdk/application/Content/ContentApplicationModel.js +737 -396
  44. package/sdk/application/Content/ContentApplicationValidator.d.ts +214 -12
  45. package/sdk/application/Content/ContentApplicationValidator.js +113 -3
  46. package/sdk/application/FileStorage/FileStorageApplicationClient.d.ts +23 -29
  47. package/sdk/application/FileStorage/FileStorageApplicationClient.js +74 -47
  48. package/sdk/application/FileStorage/FileStorageApplicationModel.d.ts +148 -20
  49. package/sdk/application/FileStorage/FileStorageApplicationModel.js +100 -87
  50. package/sdk/application/FileStorage/FileStorageApplicationValidator.d.ts +55 -5
  51. package/sdk/application/FileStorage/FileStorageApplicationValidator.js +33 -6
  52. package/sdk/application/Lead/LeadApplicationClient.d.ts +57 -53
  53. package/sdk/application/Lead/LeadApplicationClient.js +188 -103
  54. package/sdk/application/Lead/LeadApplicationModel.d.ts +686 -54
  55. package/sdk/application/Lead/LeadApplicationModel.js +330 -244
  56. package/sdk/application/Lead/LeadApplicationValidator.d.ts +91 -9
  57. package/sdk/application/Lead/LeadApplicationValidator.js +51 -6
  58. package/sdk/application/Logistic/LogisticApplicationClient.d.ts +40 -33
  59. package/sdk/application/Logistic/LogisticApplicationClient.js +131 -73
  60. package/sdk/application/Logistic/LogisticApplicationModel.d.ts +399 -28
  61. package/sdk/application/Logistic/LogisticApplicationModel.js +293 -24
  62. package/sdk/application/Logistic/LogisticApplicationValidator.d.ts +48 -6
  63. package/sdk/application/Logistic/LogisticApplicationValidator.js +34 -6
  64. package/sdk/application/Order/OrderApplicationClient.d.ts +93 -133
  65. package/sdk/application/Order/OrderApplicationClient.js +329 -217
  66. package/sdk/application/Order/OrderApplicationModel.d.ts +1101 -66
  67. package/sdk/application/Order/OrderApplicationModel.js +776 -57
  68. package/sdk/application/Order/OrderApplicationValidator.d.ts +249 -14
  69. package/sdk/application/Order/OrderApplicationValidator.js +114 -5
  70. package/sdk/application/Payment/PaymentApplicationClient.d.ts +400 -366
  71. package/sdk/application/Payment/PaymentApplicationClient.js +1176 -703
  72. package/sdk/application/Payment/PaymentApplicationModel.d.ts +3125 -99
  73. package/sdk/application/Payment/PaymentApplicationModel.js +1158 -62
  74. package/sdk/application/Payment/PaymentApplicationValidator.d.ts +494 -41
  75. package/sdk/application/Payment/PaymentApplicationValidator.js +297 -25
  76. package/sdk/application/PosCart/PosCartApplicationClient.d.ts +205 -350
  77. package/sdk/application/PosCart/PosCartApplicationClient.js +720 -491
  78. package/sdk/application/PosCart/PosCartApplicationModel.d.ts +1823 -89
  79. package/sdk/application/PosCart/PosCartApplicationModel.js +1117 -85
  80. package/sdk/application/PosCart/PosCartApplicationValidator.d.ts +480 -29
  81. package/sdk/application/PosCart/PosCartApplicationValidator.js +262 -15
  82. package/sdk/application/Rewards/RewardsApplicationClient.d.ts +58 -47
  83. package/sdk/application/Rewards/RewardsApplicationClient.js +187 -102
  84. package/sdk/application/Rewards/RewardsApplicationModel.d.ts +343 -22
  85. package/sdk/application/Rewards/RewardsApplicationModel.js +230 -15
  86. package/sdk/application/Rewards/RewardsApplicationValidator.d.ts +70 -7
  87. package/sdk/application/Rewards/RewardsApplicationValidator.js +45 -6
  88. package/sdk/application/Share/ShareApplicationClient.d.ts +52 -50
  89. package/sdk/application/Share/ShareApplicationClient.js +185 -97
  90. package/sdk/application/Share/ShareApplicationModel.d.ts +198 -15
  91. package/sdk/application/Share/ShareApplicationModel.js +131 -31
  92. package/sdk/application/Share/ShareApplicationValidator.d.ts +86 -8
  93. package/sdk/application/Share/ShareApplicationValidator.js +48 -4
  94. package/sdk/application/Theme/ThemeApplicationClient.d.ts +30 -27
  95. package/sdk/application/Theme/ThemeApplicationClient.js +102 -56
  96. package/sdk/application/Theme/ThemeApplicationModel.d.ts +1291 -48
  97. package/sdk/application/Theme/ThemeApplicationModel.js +895 -134
  98. package/sdk/application/Theme/ThemeApplicationValidator.d.ts +49 -5
  99. package/sdk/application/Theme/ThemeApplicationValidator.js +26 -3
  100. package/sdk/application/User/UserApplicationClient.d.ts +260 -305
  101. package/sdk/application/User/UserApplicationClient.js +910 -522
  102. package/sdk/application/User/UserApplicationModel.d.ts +992 -101
  103. package/sdk/application/User/UserApplicationModel.js +699 -248
  104. package/sdk/application/User/UserApplicationValidator.d.ts +457 -33
  105. package/sdk/application/User/UserApplicationValidator.js +265 -31
  106. package/sdk/common/AxiosHelper.js +7 -2
  107. package/sdk/common/FDKError.d.ts +3 -0
  108. package/sdk/common/FDKError.js +8 -0
  109. package/sdk/common/Paginator.d.ts +27 -12
  110. package/sdk/common/Paginator.js +15 -0
  111. package/sdk/common/RequestSigner.js +0 -1
  112. package/sdk/common/utils.d.ts +3 -0
  113. package/sdk/common/utils.js +29 -0
  114. package/sdk/partner/PartnerAPIClient.d.ts +16 -1
  115. package/sdk/partner/PartnerAPIClient.js +12 -2
  116. package/sdk/partner/PartnerClient.d.ts +22 -3
  117. package/sdk/partner/PartnerClient.js +20 -0
  118. package/sdk/partner/PartnerConfig.d.ts +40 -14
  119. package/sdk/partner/PartnerConfig.js +31 -6
  120. package/sdk/partner/Theme/ThemePartnerClient.d.ts +299 -0
  121. package/sdk/partner/Theme/ThemePartnerClient.js +768 -0
  122. package/sdk/partner/Theme/ThemePartnerModel.d.ts +1706 -0
  123. package/sdk/partner/Theme/ThemePartnerModel.js +1409 -0
  124. package/sdk/partner/Theme/ThemePartnerValidator.d.ts +22 -0
  125. package/sdk/partner/Theme/ThemePartnerValidator.js +157 -0
  126. package/sdk/partner/index.d.ts +3 -1
  127. package/sdk/partner/index.js +3 -1
  128. package/sdk/platform/AuditTrail/AuditTrailPlatformClient.d.ts +30 -25
  129. package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +104 -53
  130. package/sdk/platform/AuditTrail/AuditTrailPlatformModel.d.ts +190 -17
  131. package/sdk/platform/AuditTrail/AuditTrailPlatformModel.js +132 -15
  132. package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.d.ts +52 -5
  133. package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.js +30 -4
  134. package/sdk/platform/Billing/BillingPlatformClient.d.ts +133 -97
  135. package/sdk/platform/Billing/BillingPlatformClient.js +561 -191
  136. package/sdk/platform/Billing/BillingPlatformModel.d.ts +1071 -68
  137. package/sdk/platform/Billing/BillingPlatformModel.js +762 -151
  138. package/sdk/platform/Billing/BillingPlatformValidator.d.ts +175 -12
  139. package/sdk/platform/Billing/BillingPlatformValidator.js +118 -8
  140. package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +454 -635
  141. package/sdk/platform/Cart/CartPlatformApplicationClient.js +1646 -957
  142. package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +827 -57
  143. package/sdk/platform/Cart/CartPlatformApplicationValidator.js +492 -34
  144. package/sdk/platform/Cart/CartPlatformModel.d.ts +3839 -175
  145. package/sdk/platform/Cart/CartPlatformModel.js +2423 -217
  146. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +528 -638
  147. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +1600 -984
  148. package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +1081 -49
  149. package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +482 -23
  150. package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +652 -826
  151. package/sdk/platform/Catalog/CatalogPlatformClient.js +1979 -1264
  152. package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +6869 -326
  153. package/sdk/platform/Catalog/CatalogPlatformModel.js +4215 -351
  154. package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +1361 -71
  155. package/sdk/platform/Catalog/CatalogPlatformValidator.js +624 -30
  156. package/sdk/platform/Common/CommonPlatformClient.d.ts +16 -21
  157. package/sdk/platform/Common/CommonPlatformClient.js +50 -33
  158. package/sdk/platform/Common/CommonPlatformModel.d.ts +423 -19
  159. package/sdk/platform/Common/CommonPlatformModel.js +214 -40
  160. package/sdk/platform/Common/CommonPlatformValidator.d.ts +37 -4
  161. package/sdk/platform/Common/CommonPlatformValidator.js +20 -3
  162. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +731 -303
  163. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +3095 -785
  164. package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.d.ts +699 -41
  165. package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.js +463 -27
  166. package/sdk/platform/Communication/CommunicationPlatformClient.d.ts +19 -5
  167. package/sdk/platform/Communication/CommunicationPlatformClient.js +59 -19
  168. package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +1708 -102
  169. package/sdk/platform/Communication/CommunicationPlatformModel.js +1360 -235
  170. package/sdk/platform/Communication/CommunicationPlatformValidator.d.ts +16 -3
  171. package/sdk/platform/Communication/CommunicationPlatformValidator.js +11 -3
  172. package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +127 -111
  173. package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +435 -225
  174. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +882 -43
  175. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +666 -78
  176. package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.d.ts +184 -13
  177. package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.js +105 -10
  178. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +327 -240
  179. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +922 -438
  180. package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.d.ts +297 -22
  181. package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.js +191 -17
  182. package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +184 -178
  183. package/sdk/platform/Configuration/ConfigurationPlatformClient.js +555 -311
  184. package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +4337 -188
  185. package/sdk/platform/Configuration/ConfigurationPlatformModel.js +2178 -248
  186. package/sdk/platform/Configuration/ConfigurationPlatformValidator.d.ts +332 -19
  187. package/sdk/platform/Configuration/ConfigurationPlatformValidator.js +153 -10
  188. package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +605 -578
  189. package/sdk/platform/Content/ContentPlatformApplicationClient.js +1996 -987
  190. package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +872 -62
  191. package/sdk/platform/Content/ContentPlatformApplicationValidator.js +487 -35
  192. package/sdk/platform/Content/ContentPlatformModel.d.ts +1472 -108
  193. package/sdk/platform/Content/ContentPlatformModel.js +1085 -204
  194. package/sdk/platform/Discount/DiscountPlatformClient.d.ts +85 -82
  195. package/sdk/platform/Discount/DiscountPlatformClient.js +333 -175
  196. package/sdk/platform/Discount/DiscountPlatformModel.d.ts +281 -15
  197. package/sdk/platform/Discount/DiscountPlatformModel.js +189 -10
  198. package/sdk/platform/Discount/DiscountPlatformValidator.d.ts +185 -13
  199. package/sdk/platform/Discount/DiscountPlatformValidator.js +88 -8
  200. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +109 -52
  201. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +570 -105
  202. package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.d.ts +141 -6
  203. package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.js +118 -7
  204. package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +43 -63
  205. package/sdk/platform/FileStorage/FileStoragePlatformClient.js +153 -135
  206. package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +426 -20
  207. package/sdk/platform/FileStorage/FileStoragePlatformModel.js +379 -40
  208. package/sdk/platform/FileStorage/FileStoragePlatformValidator.d.ts +106 -8
  209. package/sdk/platform/FileStorage/FileStoragePlatformValidator.js +60 -8
  210. package/sdk/platform/Finance/FinancePlatformClient.d.ts +260 -129
  211. package/sdk/platform/Finance/FinancePlatformClient.js +1182 -194
  212. package/sdk/platform/Finance/FinancePlatformModel.d.ts +1267 -50
  213. package/sdk/platform/Finance/FinancePlatformModel.js +1252 -38
  214. package/sdk/platform/Finance/FinancePlatformValidator.d.ts +233 -15
  215. package/sdk/platform/Finance/FinancePlatformValidator.js +229 -16
  216. package/sdk/platform/Inventory/InventoryPlatformClient.d.ts +111 -97
  217. package/sdk/platform/Inventory/InventoryPlatformClient.js +330 -199
  218. package/sdk/platform/Inventory/InventoryPlatformModel.d.ts +1354 -61
  219. package/sdk/platform/Inventory/InventoryPlatformModel.js +916 -83
  220. package/sdk/platform/Inventory/InventoryPlatformValidator.d.ts +168 -12
  221. package/sdk/platform/Inventory/InventoryPlatformValidator.js +82 -6
  222. package/sdk/platform/Lead/LeadPlatformApplicationClient.d.ts +100 -106
  223. package/sdk/platform/Lead/LeadPlatformApplicationClient.js +372 -186
  224. package/sdk/platform/Lead/LeadPlatformApplicationValidator.d.ts +180 -14
  225. package/sdk/platform/Lead/LeadPlatformApplicationValidator.js +94 -9
  226. package/sdk/platform/Lead/LeadPlatformClient.d.ts +89 -104
  227. package/sdk/platform/Lead/LeadPlatformClient.js +305 -180
  228. package/sdk/platform/Lead/LeadPlatformModel.d.ts +1045 -54
  229. package/sdk/platform/Lead/LeadPlatformModel.js +504 -142
  230. package/sdk/platform/Lead/LeadPlatformValidator.d.ts +173 -12
  231. package/sdk/platform/Lead/LeadPlatformValidator.js +92 -15
  232. package/sdk/platform/OAuthClient.js +6 -2
  233. package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +20 -14
  234. package/sdk/platform/Order/OrderPlatformApplicationClient.js +58 -29
  235. package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +26 -4
  236. package/sdk/platform/Order/OrderPlatformApplicationValidator.js +16 -3
  237. package/sdk/platform/Order/OrderPlatformClient.d.ts +437 -556
  238. package/sdk/platform/Order/OrderPlatformClient.js +1500 -760
  239. package/sdk/platform/Order/OrderPlatformModel.d.ts +5225 -247
  240. package/sdk/platform/Order/OrderPlatformModel.js +3473 -260
  241. package/sdk/platform/Order/OrderPlatformValidator.d.ts +859 -37
  242. package/sdk/platform/Order/OrderPlatformValidator.js +435 -23
  243. package/sdk/platform/Partner/PartnerPlatformApplicationClient.d.ts +16 -42
  244. package/sdk/platform/Partner/PartnerPlatformApplicationClient.js +52 -155
  245. package/sdk/platform/Partner/PartnerPlatformApplicationValidator.d.ts +37 -6
  246. package/sdk/platform/Partner/PartnerPlatformApplicationValidator.js +19 -17
  247. package/sdk/platform/Partner/PartnerPlatformModel.d.ts +78 -45
  248. package/sdk/platform/Partner/PartnerPlatformModel.js +43 -369
  249. package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +418 -288
  250. package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +1509 -505
  251. package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +438 -30
  252. package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +312 -19
  253. package/sdk/platform/Payment/PaymentPlatformClient.d.ts +83 -73
  254. package/sdk/platform/Payment/PaymentPlatformClient.js +259 -154
  255. package/sdk/platform/Payment/PaymentPlatformModel.d.ts +3200 -93
  256. package/sdk/platform/Payment/PaymentPlatformModel.js +1334 -36
  257. package/sdk/platform/Payment/PaymentPlatformValidator.d.ts +111 -11
  258. package/sdk/platform/Payment/PaymentPlatformValidator.js +68 -7
  259. package/sdk/platform/PlatformAPIClient.d.ts +16 -1
  260. package/sdk/platform/PlatformAPIClient.js +9 -1
  261. package/sdk/platform/PlatformApplicationClient.d.ts +22 -1798
  262. package/sdk/platform/PlatformApplicationClient.js +17 -1899
  263. package/sdk/platform/PlatformClient.d.ts +31 -12581
  264. package/sdk/platform/PlatformClient.js +30 -15089
  265. package/sdk/platform/PlatformConfig.d.ts +37 -11
  266. package/sdk/platform/PlatformConfig.js +32 -6
  267. package/sdk/platform/Rewards/RewardsPlatformApplicationClient.d.ts +96 -92
  268. package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +344 -177
  269. package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.d.ts +149 -12
  270. package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.js +82 -8
  271. package/sdk/platform/Rewards/RewardsPlatformModel.d.ts +360 -23
  272. package/sdk/platform/Rewards/RewardsPlatformModel.js +238 -22
  273. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.d.ts +159 -92
  274. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.js +473 -208
  275. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.d.ts +138 -13
  276. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.js +100 -14
  277. package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +166 -178
  278. package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +518 -329
  279. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +1408 -96
  280. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +1034 -71
  281. package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.d.ts +280 -18
  282. package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.js +134 -11
  283. package/sdk/platform/Share/SharePlatformApplicationClient.d.ts +41 -66
  284. package/sdk/platform/Share/SharePlatformApplicationClient.js +149 -116
  285. package/sdk/platform/Share/SharePlatformApplicationValidator.d.ts +87 -7
  286. package/sdk/platform/Share/SharePlatformApplicationValidator.js +42 -5
  287. package/sdk/platform/Share/SharePlatformModel.d.ts +250 -16
  288. package/sdk/platform/Share/SharePlatformModel.js +167 -19
  289. package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +229 -193
  290. package/sdk/platform/Theme/ThemePlatformApplicationClient.js +976 -352
  291. package/sdk/platform/Theme/ThemePlatformApplicationValidator.d.ts +345 -24
  292. package/sdk/platform/Theme/ThemePlatformApplicationValidator.js +206 -14
  293. package/sdk/platform/Theme/ThemePlatformClient.d.ts +37 -0
  294. package/sdk/platform/Theme/ThemePlatformClient.js +235 -0
  295. package/sdk/platform/Theme/ThemePlatformModel.d.ts +1527 -48
  296. package/sdk/platform/Theme/ThemePlatformModel.js +1099 -118
  297. package/sdk/platform/Theme/ThemePlatformValidator.d.ts +32 -0
  298. package/sdk/platform/Theme/ThemePlatformValidator.js +38 -0
  299. package/sdk/platform/User/UserPlatformApplicationClient.d.ts +138 -152
  300. package/sdk/platform/User/UserPlatformApplicationClient.js +470 -244
  301. package/sdk/platform/User/UserPlatformApplicationValidator.d.ts +242 -18
  302. package/sdk/platform/User/UserPlatformApplicationValidator.js +129 -12
  303. package/sdk/platform/User/UserPlatformModel.d.ts +653 -101
  304. package/sdk/platform/User/UserPlatformModel.js +467 -424
  305. package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +153 -49
  306. package/sdk/platform/Webhook/WebhookPlatformClient.js +896 -88
  307. package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +632 -16
  308. package/sdk/platform/Webhook/WebhookPlatformModel.js +502 -54
  309. package/sdk/platform/Webhook/WebhookPlatformValidator.d.ts +170 -7
  310. package/sdk/platform/Webhook/WebhookPlatformValidator.js +157 -7
  311. package/sdk/public/Configuration/ConfigurationPublicClient.d.ts +16 -21
  312. package/sdk/public/Configuration/ConfigurationPublicClient.js +48 -33
  313. package/sdk/public/Configuration/ConfigurationPublicModel.d.ts +370 -19
  314. package/sdk/public/Configuration/ConfigurationPublicModel.js +191 -40
  315. package/sdk/public/Configuration/ConfigurationPublicValidator.d.ts +42 -4
  316. package/sdk/public/Configuration/ConfigurationPublicValidator.js +21 -3
  317. package/sdk/public/Inventory/InventoryPublicClient.d.ts +54 -48
  318. package/sdk/public/Inventory/InventoryPublicClient.js +161 -98
  319. package/sdk/public/Inventory/InventoryPublicModel.d.ts +392 -21
  320. package/sdk/public/Inventory/InventoryPublicModel.js +267 -27
  321. package/sdk/public/Inventory/InventoryPublicValidator.d.ts +90 -8
  322. package/sdk/public/Inventory/InventoryPublicValidator.js +44 -4
  323. package/sdk/public/Partner/PartnerPublicClient.d.ts +22 -0
  324. package/sdk/public/Partner/PartnerPublicClient.js +110 -0
  325. package/sdk/public/Partner/PartnerPublicModel.d.ts +240 -0
  326. package/sdk/public/Partner/PartnerPublicModel.js +280 -0
  327. package/sdk/public/Partner/PartnerPublicValidator.d.ts +18 -0
  328. package/sdk/public/Partner/PartnerPublicValidator.js +19 -0
  329. package/sdk/public/PublicAPIClient.d.ts +14 -1
  330. package/sdk/public/PublicAPIClient.js +7 -1
  331. package/sdk/public/PublicClient.d.ts +21 -3
  332. package/sdk/public/PublicClient.js +20 -0
  333. package/sdk/public/PublicConfig.d.ts +27 -6
  334. package/sdk/public/PublicConfig.js +17 -1
  335. package/sdk/public/Webhook/WebhookPublicClient.d.ts +16 -11
  336. package/sdk/public/Webhook/WebhookPublicClient.js +48 -27
  337. package/sdk/public/Webhook/WebhookPublicModel.d.ts +52 -16
  338. package/sdk/public/Webhook/WebhookPublicModel.js +33 -113
  339. package/sdk/public/Webhook/WebhookPublicValidator.d.ts +18 -3
  340. package/sdk/public/Webhook/WebhookPublicValidator.js +14 -4
  341. package/sdk/public/index.d.ts +1 -0
  342. package/sdk/public/index.js +2 -0
  343. package/sdk/application/ApplicationModels.d.ts +0 -3
  344. package/sdk/application/ApplicationModels.js +0 -20
  345. package/sdk/platform/Partner/PartnerPlatformClient.d.ts +0 -145
  346. package/sdk/platform/Partner/PartnerPlatformClient.js +0 -799
  347. package/sdk/platform/Partner/PartnerPlatformValidator.d.ts +0 -14
  348. package/sdk/platform/Partner/PartnerPlatformValidator.js +0 -87
@@ -1,8 +1,8 @@
1
1
  const PlatformAPIClient = require("../PlatformAPIClient");
2
2
  const { FDKClientValidationError } = require("../../common/FDKError");
3
3
  const Paginator = require("../../common/Paginator");
4
- const ThemeValidator = require("./ThemePlatformApplicationValidator");
5
- const ThemeModel = require("./ThemePlatformModel");
4
+ const ThemePlatformApplicationValidator = require("./ThemePlatformApplicationValidator");
5
+ const ThemePlatformModel = require("./ThemePlatformModel");
6
6
  const { Logger } = require("./../../common/Logger");
7
7
  const Joi = require("joi");
8
8
 
@@ -13,14 +13,23 @@ class Theme {
13
13
  }
14
14
 
15
15
  /**
16
- * @param {Object} arg - Arg object.
17
- * @param {AddThemeRequestSchema} arg.body
18
- * @returns {Promise<ThemesSchema>} - Success response
19
- * @summary: Add a theme to the theme library
20
- * @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.
16
+ * @param {ThemePlatformApplicationValidator.AddThemeToApplicationParam} arg
17
+ * - Arg object
18
+ *
19
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
20
+ * @param {import("../PlatformAPIClient").Options} - Options
21
+ * @returns {Promise<ThemePlatformModel.ThemesSchema>} - Success response
22
+ * @name addThemeToApplication
23
+ * @summary: Add a theme to an application
24
+ * @description: Add a theme to an application by providing the marketplace theme ID. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/theme/addThemeToApplication/).
21
25
  */
22
- async addToThemeLibrary({ body } = {}) {
23
- const { error } = ThemeValidator.addToThemeLibrary().validate(
26
+ async addThemeToApplication(
27
+ { body, requestHeaders } = { requestHeaders: {} },
28
+ { responseHeaders } = { responseHeaders: false }
29
+ ) {
30
+ const {
31
+ error,
32
+ } = ThemePlatformApplicationValidator.addThemeToApplication().validate(
24
33
  {
25
34
  body,
26
35
  },
@@ -31,7 +40,9 @@ class Theme {
31
40
  }
32
41
 
33
42
  // Showing warrnings if extra unknown parameters are found
34
- const { error: warrning } = ThemeValidator.addToThemeLibrary().validate(
43
+ const {
44
+ error: warrning,
45
+ } = ThemePlatformApplicationValidator.addThemeToApplication().validate(
35
46
  {
36
47
  body,
37
48
  },
@@ -40,9 +51,8 @@ class Theme {
40
51
  if (warrning) {
41
52
  Logger({
42
53
  level: "WARN",
43
- message: "Parameter Validation warrnings for addToThemeLibrary",
54
+ message: `Parameter Validation warrnings for platform > Theme > addThemeToApplication \n ${warrning}`,
44
55
  });
45
- Logger({ level: "WARN", message: warrning });
46
56
  }
47
57
 
48
58
  const query_params = {};
@@ -50,12 +60,21 @@ class Theme {
50
60
  const response = await PlatformAPIClient.execute(
51
61
  this.config,
52
62
  "post",
53
- `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/library`,
63
+ `/service/platform/theme/v2.0/company/${this.config.companyId}/application/${this.applicationId}/`,
54
64
  query_params,
55
- body
65
+ body,
66
+ requestHeaders,
67
+ { responseHeaders }
56
68
  );
57
69
 
58
- const { error: res_error } = ThemeModel.ThemesSchema().validate(response, {
70
+ let responseData = response;
71
+ if (responseHeaders) {
72
+ responseData = response[0];
73
+ }
74
+
75
+ const {
76
+ error: res_error,
77
+ } = ThemePlatformModel.ThemesSchema().validate(responseData, {
59
78
  abortEarly: false,
60
79
  allowUnknown: false,
61
80
  });
@@ -63,23 +82,29 @@ class Theme {
63
82
  if (res_error) {
64
83
  Logger({
65
84
  level: "WARN",
66
- message: "Response Validation Warnnings for addToThemeLibrary",
85
+ message: `Response Validation Warnnings for platform > Theme > addThemeToApplication \n ${res_error}`,
67
86
  });
68
- Logger({ level: "WARN", message: res_error });
69
87
  }
70
88
 
71
89
  return response;
72
90
  }
73
91
 
74
92
  /**
75
- * @param {Object} arg - Arg object.
76
- * @param {AddThemeRequestSchema} arg.body
77
- * @returns {Promise<ThemesSchema>} - Success response
78
- * @summary: Apply a theme
79
- * @description: Use this API to apply a theme to the website.
93
+ * @param {ThemePlatformApplicationValidator.AddToThemeLibraryParam} arg - Arg object
94
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
95
+ * @param {import("../PlatformAPIClient").Options} - Options
96
+ * @returns {Promise<ThemePlatformModel.DummyResponse>} - Success response
97
+ * @name addToThemeLibrary
98
+ * @summary: Add a theme to the theme library
99
+ * @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. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/theme/addToThemeLibrary/).
80
100
  */
81
- async applyTheme({ body } = {}) {
82
- const { error } = ThemeValidator.applyTheme().validate(
101
+ async addToThemeLibrary(
102
+ { body, requestHeaders } = { requestHeaders: {} },
103
+ { responseHeaders } = { responseHeaders: false }
104
+ ) {
105
+ const {
106
+ error,
107
+ } = ThemePlatformApplicationValidator.addToThemeLibrary().validate(
83
108
  {
84
109
  body,
85
110
  },
@@ -90,7 +115,9 @@ class Theme {
90
115
  }
91
116
 
92
117
  // Showing warrnings if extra unknown parameters are found
93
- const { error: warrning } = ThemeValidator.applyTheme().validate(
118
+ const {
119
+ error: warrning,
120
+ } = ThemePlatformApplicationValidator.addToThemeLibrary().validate(
94
121
  {
95
122
  body,
96
123
  },
@@ -99,9 +126,8 @@ class Theme {
99
126
  if (warrning) {
100
127
  Logger({
101
128
  level: "WARN",
102
- message: "Parameter Validation warrnings for applyTheme",
129
+ message: `Parameter Validation warrnings for platform > Theme > addToThemeLibrary \n ${warrning}`,
103
130
  });
104
- Logger({ level: "WARN", message: warrning });
105
131
  }
106
132
 
107
133
  const query_params = {};
@@ -109,12 +135,21 @@ class Theme {
109
135
  const response = await PlatformAPIClient.execute(
110
136
  this.config,
111
137
  "post",
112
- `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/apply`,
138
+ `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/library`,
113
139
  query_params,
114
- body
140
+ body,
141
+ requestHeaders,
142
+ { responseHeaders }
115
143
  );
116
144
 
117
- const { error: res_error } = ThemeModel.ThemesSchema().validate(response, {
145
+ let responseData = response;
146
+ if (responseHeaders) {
147
+ responseData = response[0];
148
+ }
149
+
150
+ const {
151
+ error: res_error,
152
+ } = ThemePlatformModel.DummyResponse().validate(responseData, {
118
153
  abortEarly: false,
119
154
  allowUnknown: false,
120
155
  });
@@ -122,23 +157,27 @@ class Theme {
122
157
  if (res_error) {
123
158
  Logger({
124
159
  level: "WARN",
125
- message: "Response Validation Warnnings for applyTheme",
160
+ message: `Response Validation Warnnings for platform > Theme > addToThemeLibrary \n ${res_error}`,
126
161
  });
127
- Logger({ level: "WARN", message: res_error });
128
162
  }
129
163
 
130
164
  return response;
131
165
  }
132
166
 
133
167
  /**
134
- * @param {Object} arg - Arg object.
135
- * @param {string} arg.themeId - ID allotted to the theme.
136
- * @returns {Promise<ThemesSchema>} - Success response
137
- * @summary: Archive a theme
138
- * @description: Use this API to store an existing theme but not delete it so that it can be used in future if required.
168
+ * @param {ThemePlatformApplicationValidator.ApplyThemeParam} arg - Arg object
169
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
170
+ * @param {import("../PlatformAPIClient").Options} - Options
171
+ * @returns {Promise<ThemePlatformModel.ThemesSchema>} - Success response
172
+ * @name applyTheme
173
+ * @summary: Apply theme to a specific application
174
+ * @description: Apply theme to a specific application by providing company_id, application_id, and theme_id. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/theme/applyTheme/).
139
175
  */
140
- async archiveTheme({ themeId } = {}) {
141
- const { error } = ThemeValidator.archiveTheme().validate(
176
+ async applyTheme(
177
+ { themeId, requestHeaders } = { requestHeaders: {} },
178
+ { responseHeaders } = { responseHeaders: false }
179
+ ) {
180
+ const { error } = ThemePlatformApplicationValidator.applyTheme().validate(
142
181
  {
143
182
  themeId,
144
183
  },
@@ -149,7 +188,9 @@ class Theme {
149
188
  }
150
189
 
151
190
  // Showing warrnings if extra unknown parameters are found
152
- const { error: warrning } = ThemeValidator.archiveTheme().validate(
191
+ const {
192
+ error: warrning,
193
+ } = ThemePlatformApplicationValidator.applyTheme().validate(
153
194
  {
154
195
  themeId,
155
196
  },
@@ -158,22 +199,30 @@ class Theme {
158
199
  if (warrning) {
159
200
  Logger({
160
201
  level: "WARN",
161
- message: "Parameter Validation warrnings for archiveTheme",
202
+ message: `Parameter Validation warrnings for platform > Theme > applyTheme \n ${warrning}`,
162
203
  });
163
- Logger({ level: "WARN", message: warrning });
164
204
  }
165
205
 
166
206
  const query_params = {};
167
207
 
168
208
  const response = await PlatformAPIClient.execute(
169
209
  this.config,
170
- "put",
171
- `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/archive`,
210
+ "patch",
211
+ `/service/platform/theme/v2.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/apply`,
172
212
  query_params,
173
- undefined
213
+ undefined,
214
+ requestHeaders,
215
+ { responseHeaders }
174
216
  );
175
217
 
176
- const { error: res_error } = ThemeModel.ThemesSchema().validate(response, {
218
+ let responseData = response;
219
+ if (responseHeaders) {
220
+ responseData = response[0];
221
+ }
222
+
223
+ const {
224
+ error: res_error,
225
+ } = ThemePlatformModel.ThemesSchema().validate(responseData, {
177
226
  abortEarly: false,
178
227
  allowUnknown: false,
179
228
  });
@@ -181,27 +230,29 @@ class Theme {
181
230
  if (res_error) {
182
231
  Logger({
183
232
  level: "WARN",
184
- message: "Response Validation Warnnings for archiveTheme",
233
+ message: `Response Validation Warnnings for platform > Theme > applyTheme \n ${res_error}`,
185
234
  });
186
- Logger({ level: "WARN", message: res_error });
187
235
  }
188
236
 
189
237
  return response;
190
238
  }
191
239
 
192
240
  /**
193
- * @param {Object} arg - Arg object.
194
- * @param {string} arg.themeId - ID of the theme
195
- * @param {AvailablePageSchema} arg.body
196
- * @returns {Promise<AvailablePageSchema>} - Success response
197
- * @summary: Create a page
198
- * @description: Use this API to create a page for a theme by its ID.
241
+ * @param {ThemePlatformApplicationValidator.ArchiveThemeParam} arg - Arg object
242
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
243
+ * @param {import("../PlatformAPIClient").Options} - Options
244
+ * @returns {Promise<ThemePlatformModel.DummyResponse>} - Success response
245
+ * @name archiveTheme
246
+ * @summary: Archive a theme
247
+ * @description: Use this API to store an existing theme but not delete it so that it can be used in future if required. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/theme/archiveTheme/).
199
248
  */
200
- async createPage({ themeId, body } = {}) {
201
- const { error } = ThemeValidator.createPage().validate(
249
+ async archiveTheme(
250
+ { themeId, requestHeaders } = { requestHeaders: {} },
251
+ { responseHeaders } = { responseHeaders: false }
252
+ ) {
253
+ const { error } = ThemePlatformApplicationValidator.archiveTheme().validate(
202
254
  {
203
255
  themeId,
204
- body,
205
256
  },
206
257
  { abortEarly: false, allowUnknown: true }
207
258
  );
@@ -210,34 +261,41 @@ class Theme {
210
261
  }
211
262
 
212
263
  // Showing warrnings if extra unknown parameters are found
213
- const { error: warrning } = ThemeValidator.createPage().validate(
264
+ const {
265
+ error: warrning,
266
+ } = ThemePlatformApplicationValidator.archiveTheme().validate(
214
267
  {
215
268
  themeId,
216
- body,
217
269
  },
218
270
  { abortEarly: false, allowUnknown: false }
219
271
  );
220
272
  if (warrning) {
221
273
  Logger({
222
274
  level: "WARN",
223
- message: "Parameter Validation warrnings for createPage",
275
+ message: `Parameter Validation warrnings for platform > Theme > archiveTheme \n ${warrning}`,
224
276
  });
225
- Logger({ level: "WARN", message: warrning });
226
277
  }
227
278
 
228
279
  const query_params = {};
229
280
 
230
281
  const response = await PlatformAPIClient.execute(
231
282
  this.config,
232
- "post",
233
- `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/page`,
283
+ "put",
284
+ `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/archive`,
234
285
  query_params,
235
- body
286
+ undefined,
287
+ requestHeaders,
288
+ { responseHeaders }
236
289
  );
237
290
 
291
+ let responseData = response;
292
+ if (responseHeaders) {
293
+ responseData = response[0];
294
+ }
295
+
238
296
  const {
239
297
  error: res_error,
240
- } = ThemeModel.AvailablePageSchema().validate(response, {
298
+ } = ThemePlatformModel.DummyResponse().validate(responseData, {
241
299
  abortEarly: false,
242
300
  allowUnknown: false,
243
301
  });
@@ -245,24 +303,29 @@ class Theme {
245
303
  if (res_error) {
246
304
  Logger({
247
305
  level: "WARN",
248
- message: "Response Validation Warnnings for createPage",
306
+ message: `Response Validation Warnnings for platform > Theme > archiveTheme \n ${res_error}`,
249
307
  });
250
- Logger({ level: "WARN", message: res_error });
251
308
  }
252
309
 
253
310
  return response;
254
311
  }
255
312
 
256
313
  /**
257
- * @param {Object} arg - Arg object.
258
- * @param {ThemesSchema} arg.body
259
- * @returns {Promise<ThemesSchema>} - Success response
260
- * @summary: Create a new theme
261
- * @description: Themes improve the look and appearance of a website. Use this API to create a theme.
314
+ * @param {ThemePlatformApplicationValidator.CreatePageParam} arg - Arg object
315
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
316
+ * @param {import("../PlatformAPIClient").Options} - Options
317
+ * @returns {Promise<ThemePlatformModel.AvailablePageSchema>} - Success response
318
+ * @name createPage
319
+ * @summary: Create a page
320
+ * @description: Use this API to create a page for a theme by its ID. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/theme/createPage/).
262
321
  */
263
- async createTheme({ body } = {}) {
264
- const { error } = ThemeValidator.createTheme().validate(
322
+ async createPage(
323
+ { themeId, body, requestHeaders } = { requestHeaders: {} },
324
+ { responseHeaders } = { responseHeaders: false }
325
+ ) {
326
+ const { error } = ThemePlatformApplicationValidator.createPage().validate(
265
327
  {
328
+ themeId,
266
329
  body,
267
330
  },
268
331
  { abortEarly: false, allowUnknown: true }
@@ -272,8 +335,11 @@ class Theme {
272
335
  }
273
336
 
274
337
  // Showing warrnings if extra unknown parameters are found
275
- const { error: warrning } = ThemeValidator.createTheme().validate(
338
+ const {
339
+ error: warrning,
340
+ } = ThemePlatformApplicationValidator.createPage().validate(
276
341
  {
342
+ themeId,
277
343
  body,
278
344
  },
279
345
  { abortEarly: false, allowUnknown: false }
@@ -281,9 +347,8 @@ class Theme {
281
347
  if (warrning) {
282
348
  Logger({
283
349
  level: "WARN",
284
- message: "Parameter Validation warrnings for createTheme",
350
+ message: `Parameter Validation warrnings for platform > Theme > createPage \n ${warrning}`,
285
351
  });
286
- Logger({ level: "WARN", message: warrning });
287
352
  }
288
353
 
289
354
  const query_params = {};
@@ -291,12 +356,21 @@ class Theme {
291
356
  const response = await PlatformAPIClient.execute(
292
357
  this.config,
293
358
  "post",
294
- `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/`,
359
+ `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/page`,
295
360
  query_params,
296
- body
361
+ body,
362
+ requestHeaders,
363
+ { responseHeaders }
297
364
  );
298
365
 
299
- const { error: res_error } = ThemeModel.ThemesSchema().validate(response, {
366
+ let responseData = response;
367
+ if (responseHeaders) {
368
+ responseData = response[0];
369
+ }
370
+
371
+ const {
372
+ error: res_error,
373
+ } = ThemePlatformModel.AvailablePageSchema().validate(responseData, {
300
374
  abortEarly: false,
301
375
  allowUnknown: false,
302
376
  });
@@ -304,24 +378,27 @@ class Theme {
304
378
  if (res_error) {
305
379
  Logger({
306
380
  level: "WARN",
307
- message: "Response Validation Warnnings for createTheme",
381
+ message: `Response Validation Warnnings for platform > Theme > createPage \n ${res_error}`,
308
382
  });
309
- Logger({ level: "WARN", message: res_error });
310
383
  }
311
384
 
312
385
  return response;
313
386
  }
314
387
 
315
388
  /**
316
- * @param {Object} arg - Arg object.
317
- * @param {string} arg.themeId - ID of the theme
318
- * @param {string} arg.pageValue - Value of the page to be updated
319
- * @returns {Promise<AvailablePageSchema>} - Success response
389
+ * @param {ThemePlatformApplicationValidator.DeletePageParam} arg - Arg object
390
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
391
+ * @param {import("../PlatformAPIClient").Options} - Options
392
+ * @returns {Promise<ThemePlatformModel.AvailablePageSchema>} - Success response
393
+ * @name deletePage
320
394
  * @summary: Deletes a page
321
- * @description: Use this API to delete a page for a theme by its ID and page_value.
395
+ * @description: Use this API to delete a page for a theme by its ID and page_value. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/theme/deletePage/).
322
396
  */
323
- async deletePage({ themeId, pageValue } = {}) {
324
- const { error } = ThemeValidator.deletePage().validate(
397
+ async deletePage(
398
+ { themeId, pageValue, requestHeaders } = { requestHeaders: {} },
399
+ { responseHeaders } = { responseHeaders: false }
400
+ ) {
401
+ const { error } = ThemePlatformApplicationValidator.deletePage().validate(
325
402
  {
326
403
  themeId,
327
404
  pageValue,
@@ -333,7 +410,9 @@ class Theme {
333
410
  }
334
411
 
335
412
  // Showing warrnings if extra unknown parameters are found
336
- const { error: warrning } = ThemeValidator.deletePage().validate(
413
+ const {
414
+ error: warrning,
415
+ } = ThemePlatformApplicationValidator.deletePage().validate(
337
416
  {
338
417
  themeId,
339
418
  pageValue,
@@ -343,9 +422,8 @@ class Theme {
343
422
  if (warrning) {
344
423
  Logger({
345
424
  level: "WARN",
346
- message: "Parameter Validation warrnings for deletePage",
425
+ message: `Parameter Validation warrnings for platform > Theme > deletePage \n ${warrning}`,
347
426
  });
348
- Logger({ level: "WARN", message: warrning });
349
427
  }
350
428
 
351
429
  const query_params = {};
@@ -355,12 +433,19 @@ class Theme {
355
433
  "delete",
356
434
  `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/${pageValue}`,
357
435
  query_params,
358
- undefined
436
+ undefined,
437
+ requestHeaders,
438
+ { responseHeaders }
359
439
  );
360
440
 
441
+ let responseData = response;
442
+ if (responseHeaders) {
443
+ responseData = response[0];
444
+ }
445
+
361
446
  const {
362
447
  error: res_error,
363
- } = ThemeModel.AvailablePageSchema().validate(response, {
448
+ } = ThemePlatformModel.AvailablePageSchema().validate(responseData, {
364
449
  abortEarly: false,
365
450
  allowUnknown: false,
366
451
  });
@@ -368,23 +453,27 @@ class Theme {
368
453
  if (res_error) {
369
454
  Logger({
370
455
  level: "WARN",
371
- message: "Response Validation Warnnings for deletePage",
456
+ message: `Response Validation Warnnings for platform > Theme > deletePage \n ${res_error}`,
372
457
  });
373
- Logger({ level: "WARN", message: res_error });
374
458
  }
375
459
 
376
460
  return response;
377
461
  }
378
462
 
379
463
  /**
380
- * @param {Object} arg - Arg object.
381
- * @param {string} arg.themeId - ID allotted to the theme.
382
- * @returns {Promise<ThemesSchema>} - Success response
464
+ * @param {ThemePlatformApplicationValidator.DeleteThemeParam} arg - Arg object
465
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
466
+ * @param {import("../PlatformAPIClient").Options} - Options
467
+ * @returns {Promise<ThemePlatformModel.ThemesSchema>} - Success response
468
+ * @name deleteTheme
383
469
  * @summary: Delete a theme
384
- * @description: Use this API to delete a theme from the theme library.
470
+ * @description: This endpoint is used to delete a theme from the specified company and application. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/theme/deleteTheme/).
385
471
  */
386
- async deleteTheme({ themeId } = {}) {
387
- const { error } = ThemeValidator.deleteTheme().validate(
472
+ async deleteTheme(
473
+ { themeId, requestHeaders } = { requestHeaders: {} },
474
+ { responseHeaders } = { responseHeaders: false }
475
+ ) {
476
+ const { error } = ThemePlatformApplicationValidator.deleteTheme().validate(
388
477
  {
389
478
  themeId,
390
479
  },
@@ -395,7 +484,9 @@ class Theme {
395
484
  }
396
485
 
397
486
  // Showing warrnings if extra unknown parameters are found
398
- const { error: warrning } = ThemeValidator.deleteTheme().validate(
487
+ const {
488
+ error: warrning,
489
+ } = ThemePlatformApplicationValidator.deleteTheme().validate(
399
490
  {
400
491
  themeId,
401
492
  },
@@ -404,9 +495,8 @@ class Theme {
404
495
  if (warrning) {
405
496
  Logger({
406
497
  level: "WARN",
407
- message: "Parameter Validation warrnings for deleteTheme",
498
+ message: `Parameter Validation warrnings for platform > Theme > deleteTheme \n ${warrning}`,
408
499
  });
409
- Logger({ level: "WARN", message: warrning });
410
500
  }
411
501
 
412
502
  const query_params = {};
@@ -414,12 +504,96 @@ class Theme {
414
504
  const response = await PlatformAPIClient.execute(
415
505
  this.config,
416
506
  "delete",
417
- `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}`,
507
+ `/service/platform/theme/v2.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}`,
508
+ query_params,
509
+ undefined,
510
+ requestHeaders,
511
+ { responseHeaders }
512
+ );
513
+
514
+ let responseData = response;
515
+ if (responseHeaders) {
516
+ responseData = response[0];
517
+ }
518
+
519
+ const {
520
+ error: res_error,
521
+ } = ThemePlatformModel.ThemesSchema().validate(responseData, {
522
+ abortEarly: false,
523
+ allowUnknown: false,
524
+ });
525
+
526
+ if (res_error) {
527
+ Logger({
528
+ level: "WARN",
529
+ message: `Response Validation Warnnings for platform > Theme > deleteTheme \n ${res_error}`,
530
+ });
531
+ }
532
+
533
+ return response;
534
+ }
535
+
536
+ /**
537
+ * @param {ThemePlatformApplicationValidator.DuplicateThemeParam} arg - Arg object
538
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
539
+ * @param {import("../PlatformAPIClient").Options} - Options
540
+ * @returns {Promise<ThemePlatformModel.ThemesSchema>} - Success response
541
+ * @name duplicateTheme
542
+ * @summary: Duplicate a Theme
543
+ * @description: This endpoint duplicates a Theme in the specified application. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/theme/duplicateTheme/).
544
+ */
545
+ async duplicateTheme(
546
+ { themeId, requestHeaders } = { requestHeaders: {} },
547
+ { responseHeaders } = { responseHeaders: false }
548
+ ) {
549
+ const {
550
+ error,
551
+ } = ThemePlatformApplicationValidator.duplicateTheme().validate(
552
+ {
553
+ themeId,
554
+ },
555
+ { abortEarly: false, allowUnknown: true }
556
+ );
557
+ if (error) {
558
+ return Promise.reject(new FDKClientValidationError(error));
559
+ }
560
+
561
+ // Showing warrnings if extra unknown parameters are found
562
+ const {
563
+ error: warrning,
564
+ } = ThemePlatformApplicationValidator.duplicateTheme().validate(
565
+ {
566
+ themeId,
567
+ },
568
+ { abortEarly: false, allowUnknown: false }
569
+ );
570
+ if (warrning) {
571
+ Logger({
572
+ level: "WARN",
573
+ message: `Parameter Validation warrnings for platform > Theme > duplicateTheme \n ${warrning}`,
574
+ });
575
+ }
576
+
577
+ const query_params = {};
578
+
579
+ const response = await PlatformAPIClient.execute(
580
+ this.config,
581
+ "post",
582
+ `/service/platform/theme/v2.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/duplicate`,
418
583
  query_params,
419
- undefined
584
+ undefined,
585
+ requestHeaders,
586
+ { responseHeaders }
420
587
  );
421
588
 
422
- const { error: res_error } = ThemeModel.ThemesSchema().validate(response, {
589
+ let responseData = response;
590
+ if (responseHeaders) {
591
+ responseData = response[0];
592
+ }
593
+
594
+ const {
595
+ error: res_error,
596
+ } = ThemePlatformModel.ThemesSchema().validate(responseData, {
423
597
  abortEarly: false,
424
598
  allowUnknown: false,
425
599
  });
@@ -427,23 +601,27 @@ class Theme {
427
601
  if (res_error) {
428
602
  Logger({
429
603
  level: "WARN",
430
- message: "Response Validation Warnnings for deleteTheme",
604
+ message: `Response Validation Warnnings for platform > Theme > duplicateTheme \n ${res_error}`,
431
605
  });
432
- Logger({ level: "WARN", message: res_error });
433
606
  }
434
607
 
435
608
  return response;
436
609
  }
437
610
 
438
611
  /**
439
- * @param {Object} arg - Arg object.
440
- * @param {string} arg.themeId - ID of the theme to be retrieved
441
- * @returns {Promise<AllAvailablePageSchema>} - Success response
612
+ * @param {ThemePlatformApplicationValidator.GetAllPagesParam} arg - Arg object
613
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
614
+ * @param {import("../PlatformAPIClient").Options} - Options
615
+ * @returns {Promise<ThemePlatformModel.AllAvailablePageSchema>} - Success response
616
+ * @name getAllPages
442
617
  * @summary: Get all pages of a theme
443
- * @description: Use this API to retrieve all the available pages of a theme by its ID.
618
+ * @description: Use this API to retrieve all the available pages of a theme by its ID. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/theme/getAllPages/).
444
619
  */
445
- async getAllPages({ themeId } = {}) {
446
- const { error } = ThemeValidator.getAllPages().validate(
620
+ async getAllPages(
621
+ { themeId, requestHeaders } = { requestHeaders: {} },
622
+ { responseHeaders } = { responseHeaders: false }
623
+ ) {
624
+ const { error } = ThemePlatformApplicationValidator.getAllPages().validate(
447
625
  {
448
626
  themeId,
449
627
  },
@@ -454,7 +632,9 @@ class Theme {
454
632
  }
455
633
 
456
634
  // Showing warrnings if extra unknown parameters are found
457
- const { error: warrning } = ThemeValidator.getAllPages().validate(
635
+ const {
636
+ error: warrning,
637
+ } = ThemePlatformApplicationValidator.getAllPages().validate(
458
638
  {
459
639
  themeId,
460
640
  },
@@ -463,9 +643,8 @@ class Theme {
463
643
  if (warrning) {
464
644
  Logger({
465
645
  level: "WARN",
466
- message: "Parameter Validation warrnings for getAllPages",
646
+ message: `Parameter Validation warrnings for platform > Theme > getAllPages \n ${warrning}`,
467
647
  });
468
- Logger({ level: "WARN", message: warrning });
469
648
  }
470
649
 
471
650
  const query_params = {};
@@ -475,12 +654,19 @@ class Theme {
475
654
  "get",
476
655
  `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/page`,
477
656
  query_params,
478
- undefined
657
+ undefined,
658
+ requestHeaders,
659
+ { responseHeaders }
479
660
  );
480
661
 
662
+ let responseData = response;
663
+ if (responseHeaders) {
664
+ responseData = response[0];
665
+ }
666
+
481
667
  const {
482
668
  error: res_error,
483
- } = ThemeModel.AllAvailablePageSchema().validate(response, {
669
+ } = ThemePlatformModel.AllAvailablePageSchema().validate(responseData, {
484
670
  abortEarly: false,
485
671
  allowUnknown: false,
486
672
  });
@@ -488,22 +674,31 @@ class Theme {
488
674
  if (res_error) {
489
675
  Logger({
490
676
  level: "WARN",
491
- message: "Response Validation Warnnings for getAllPages",
677
+ message: `Response Validation Warnnings for platform > Theme > getAllPages \n ${res_error}`,
492
678
  });
493
- Logger({ level: "WARN", message: res_error });
494
679
  }
495
680
 
496
681
  return response;
497
682
  }
498
683
 
499
684
  /**
500
- * @param {Object} arg - Arg object.
501
- * @returns {Promise<ThemesSchema>} - Success response
502
- * @summary: Get the applied theme
503
- * @description: Use this API to retrieve the theme that is currently applied to the website along with its details.
685
+ * @param {ThemePlatformApplicationValidator.GetApplicationThemesParam} arg
686
+ * - Arg object
687
+ *
688
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
689
+ * @param {import("../PlatformAPIClient").Options} - Options
690
+ * @returns {Promise<ThemePlatformModel.ThemesSchema[]>} - Success response
691
+ * @name getApplicationThemes
692
+ * @summary: Get all the themes for a specific application
693
+ * @description: Get all the themes for a specific application - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/theme/getApplicationThemes/).
504
694
  */
505
- async getAppliedTheme({} = {}) {
506
- const { error } = ThemeValidator.getAppliedTheme().validate(
695
+ async getApplicationThemes(
696
+ { requestHeaders } = { requestHeaders: {} },
697
+ { responseHeaders } = { responseHeaders: false }
698
+ ) {
699
+ const {
700
+ error,
701
+ } = ThemePlatformApplicationValidator.getApplicationThemes().validate(
507
702
  {},
508
703
  { abortEarly: false, allowUnknown: true }
509
704
  );
@@ -512,16 +707,17 @@ class Theme {
512
707
  }
513
708
 
514
709
  // Showing warrnings if extra unknown parameters are found
515
- const { error: warrning } = ThemeValidator.getAppliedTheme().validate(
710
+ const {
711
+ error: warrning,
712
+ } = ThemePlatformApplicationValidator.getApplicationThemes().validate(
516
713
  {},
517
714
  { abortEarly: false, allowUnknown: false }
518
715
  );
519
716
  if (warrning) {
520
717
  Logger({
521
718
  level: "WARN",
522
- message: "Parameter Validation warrnings for getAppliedTheme",
719
+ message: `Parameter Validation warrnings for platform > Theme > getApplicationThemes \n ${warrning}`,
523
720
  });
524
- Logger({ level: "WARN", message: warrning });
525
721
  }
526
722
 
527
723
  const query_params = {};
@@ -529,12 +725,89 @@ class Theme {
529
725
  const response = await PlatformAPIClient.execute(
530
726
  this.config,
531
727
  "get",
532
- `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/`,
728
+ `/service/platform/theme/v2.0/company/${this.config.companyId}/application/${this.applicationId}/themes`,
533
729
  query_params,
534
- undefined
730
+ undefined,
731
+ requestHeaders,
732
+ { responseHeaders }
535
733
  );
536
734
 
537
- const { error: res_error } = ThemeModel.ThemesSchema().validate(response, {
735
+ let responseData = response;
736
+ if (responseHeaders) {
737
+ responseData = response[0];
738
+ }
739
+
740
+ const { error: res_error } = Joi.array()
741
+ .items(ThemePlatformModel.ThemesSchema())
742
+ .validate(responseData, { abortEarly: false, allowUnknown: false });
743
+
744
+ if (res_error) {
745
+ Logger({
746
+ level: "WARN",
747
+ message: `Response Validation Warnnings for platform > Theme > getApplicationThemes \n ${res_error}`,
748
+ });
749
+ }
750
+
751
+ return response;
752
+ }
753
+
754
+ /**
755
+ * @param {ThemePlatformApplicationValidator.GetApplicationThemesCountParam} arg
756
+ * - Arg object
757
+ *
758
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
759
+ * @param {import("../PlatformAPIClient").Options} - Options
760
+ * @returns {Promise<Object>} - Success response
761
+ * @name getApplicationThemesCount
762
+ * @summary: Get the count of themes for a specific application
763
+ * @description: Get the count of themes for a specific application - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/theme/getApplicationThemesCount/).
764
+ */
765
+ async getApplicationThemesCount(
766
+ { requestHeaders } = { requestHeaders: {} },
767
+ { responseHeaders } = { responseHeaders: false }
768
+ ) {
769
+ const {
770
+ error,
771
+ } = ThemePlatformApplicationValidator.getApplicationThemesCount().validate(
772
+ {},
773
+ { abortEarly: false, allowUnknown: true }
774
+ );
775
+ if (error) {
776
+ return Promise.reject(new FDKClientValidationError(error));
777
+ }
778
+
779
+ // Showing warrnings if extra unknown parameters are found
780
+ const {
781
+ error: warrning,
782
+ } = ThemePlatformApplicationValidator.getApplicationThemesCount().validate(
783
+ {},
784
+ { abortEarly: false, allowUnknown: false }
785
+ );
786
+ if (warrning) {
787
+ Logger({
788
+ level: "WARN",
789
+ message: `Parameter Validation warrnings for platform > Theme > getApplicationThemesCount \n ${warrning}`,
790
+ });
791
+ }
792
+
793
+ const query_params = {};
794
+
795
+ const response = await PlatformAPIClient.execute(
796
+ this.config,
797
+ "get",
798
+ `/service/platform/theme/v2.0/company/${this.config.companyId}/application/${this.applicationId}/application_themes_count`,
799
+ query_params,
800
+ undefined,
801
+ requestHeaders,
802
+ { responseHeaders }
803
+ );
804
+
805
+ let responseData = response;
806
+ if (responseHeaders) {
807
+ responseData = response[0];
808
+ }
809
+
810
+ const { error: res_error } = Joi.any().validate(responseData, {
538
811
  abortEarly: false,
539
812
  allowUnknown: false,
540
813
  });
@@ -542,22 +815,98 @@ class Theme {
542
815
  if (res_error) {
543
816
  Logger({
544
817
  level: "WARN",
545
- message: "Response Validation Warnnings for getAppliedTheme",
818
+ message: `Response Validation Warnnings for platform > Theme > getApplicationThemesCount \n ${res_error}`,
546
819
  });
547
- Logger({ level: "WARN", message: res_error });
548
820
  }
549
821
 
550
822
  return response;
551
823
  }
552
824
 
553
825
  /**
554
- * @param {Object} arg - Arg object.
555
- * @returns {Promise<FontsSchema>} - Success response
826
+ * @param {ThemePlatformApplicationValidator.GetAppliedThemeParam} arg - Arg object
827
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
828
+ * @param {import("../PlatformAPIClient").Options} - Options
829
+ * @returns {Promise<ThemePlatformModel.ThemesSchema>} - Success response
830
+ * @name getAppliedTheme
831
+ * @summary: Get the Applied theme of an Application
832
+ * @description: Get Applied Theme of an Application by Application Id - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/theme/getAppliedTheme/).
833
+ */
834
+ async getAppliedTheme(
835
+ { requestHeaders } = { requestHeaders: {} },
836
+ { responseHeaders } = { responseHeaders: false }
837
+ ) {
838
+ const {
839
+ error,
840
+ } = ThemePlatformApplicationValidator.getAppliedTheme().validate(
841
+ {},
842
+ { abortEarly: false, allowUnknown: true }
843
+ );
844
+ if (error) {
845
+ return Promise.reject(new FDKClientValidationError(error));
846
+ }
847
+
848
+ // Showing warrnings if extra unknown parameters are found
849
+ const {
850
+ error: warrning,
851
+ } = ThemePlatformApplicationValidator.getAppliedTheme().validate(
852
+ {},
853
+ { abortEarly: false, allowUnknown: false }
854
+ );
855
+ if (warrning) {
856
+ Logger({
857
+ level: "WARN",
858
+ message: `Parameter Validation warrnings for platform > Theme > getAppliedTheme \n ${warrning}`,
859
+ });
860
+ }
861
+
862
+ const query_params = {};
863
+
864
+ const response = await PlatformAPIClient.execute(
865
+ this.config,
866
+ "get",
867
+ `/service/platform/theme/v2.0/company/${this.config.companyId}/application/${this.applicationId}`,
868
+ query_params,
869
+ undefined,
870
+ requestHeaders,
871
+ { responseHeaders }
872
+ );
873
+
874
+ let responseData = response;
875
+ if (responseHeaders) {
876
+ responseData = response[0];
877
+ }
878
+
879
+ const {
880
+ error: res_error,
881
+ } = ThemePlatformModel.ThemesSchema().validate(responseData, {
882
+ abortEarly: false,
883
+ allowUnknown: false,
884
+ });
885
+
886
+ if (res_error) {
887
+ Logger({
888
+ level: "WARN",
889
+ message: `Response Validation Warnnings for platform > Theme > getAppliedTheme \n ${res_error}`,
890
+ });
891
+ }
892
+
893
+ return response;
894
+ }
895
+
896
+ /**
897
+ * @param {ThemePlatformApplicationValidator.GetFontsParam} arg - Arg object
898
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
899
+ * @param {import("../PlatformAPIClient").Options} - Options
900
+ * @returns {Promise<ThemePlatformModel.FontsSchema>} - Success response
901
+ * @name getFonts
556
902
  * @summary: Get all the supported fonts in a theme
557
- * @description: Font is a collection of characters with a similar design. Use this API to retrieve a list of website fonts.
903
+ * @description: Font is a collection of characters with a similar design. Use this API to retrieve a list of website fonts. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/theme/getFonts/).
558
904
  */
559
- async getFonts({} = {}) {
560
- const { error } = ThemeValidator.getFonts().validate(
905
+ async getFonts(
906
+ { requestHeaders } = { requestHeaders: {} },
907
+ { responseHeaders } = { responseHeaders: false }
908
+ ) {
909
+ const { error } = ThemePlatformApplicationValidator.getFonts().validate(
561
910
  {},
562
911
  { abortEarly: false, allowUnknown: true }
563
912
  );
@@ -566,16 +915,17 @@ class Theme {
566
915
  }
567
916
 
568
917
  // Showing warrnings if extra unknown parameters are found
569
- const { error: warrning } = ThemeValidator.getFonts().validate(
918
+ const {
919
+ error: warrning,
920
+ } = ThemePlatformApplicationValidator.getFonts().validate(
570
921
  {},
571
922
  { abortEarly: false, allowUnknown: false }
572
923
  );
573
924
  if (warrning) {
574
925
  Logger({
575
926
  level: "WARN",
576
- message: "Parameter Validation warrnings for getFonts",
927
+ message: `Parameter Validation warrnings for platform > Theme > getFonts \n ${warrning}`,
577
928
  });
578
- Logger({ level: "WARN", message: warrning });
579
929
  }
580
930
 
581
931
  const query_params = {};
@@ -585,10 +935,19 @@ class Theme {
585
935
  "get",
586
936
  `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/fonts`,
587
937
  query_params,
588
- undefined
938
+ undefined,
939
+ requestHeaders,
940
+ { responseHeaders }
589
941
  );
590
942
 
591
- const { error: res_error } = ThemeModel.FontsSchema().validate(response, {
943
+ let responseData = response;
944
+ if (responseHeaders) {
945
+ responseData = response[0];
946
+ }
947
+
948
+ const {
949
+ error: res_error,
950
+ } = ThemePlatformModel.FontsSchema().validate(responseData, {
592
951
  abortEarly: false,
593
952
  allowUnknown: false,
594
953
  });
@@ -596,24 +955,27 @@ class Theme {
596
955
  if (res_error) {
597
956
  Logger({
598
957
  level: "WARN",
599
- message: "Response Validation Warnnings for getFonts",
958
+ message: `Response Validation Warnnings for platform > Theme > getFonts \n ${res_error}`,
600
959
  });
601
- Logger({ level: "WARN", message: res_error });
602
960
  }
603
961
 
604
962
  return response;
605
963
  }
606
964
 
607
965
  /**
608
- * @param {Object} arg - Arg object.
609
- * @param {string} arg.themeId - ID of the theme to be retrieved
610
- * @param {string} arg.pageValue - Value of the page to be retrieved
611
- * @returns {Promise<AvailablePageSchema>} - Success response
966
+ * @param {ThemePlatformApplicationValidator.GetPageParam} arg - Arg object
967
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
968
+ * @param {import("../PlatformAPIClient").Options} - Options
969
+ * @returns {Promise<ThemePlatformModel.AvailablePageSchema>} - Success response
970
+ * @name getPage
612
971
  * @summary: Get page of a theme
613
- * @description: Use this API to retrieve a page of a theme.
972
+ * @description: Use this API to retrieve a page of a theme. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/theme/getPage/).
614
973
  */
615
- async getPage({ themeId, pageValue } = {}) {
616
- const { error } = ThemeValidator.getPage().validate(
974
+ async getPage(
975
+ { themeId, pageValue, requestHeaders } = { requestHeaders: {} },
976
+ { responseHeaders } = { responseHeaders: false }
977
+ ) {
978
+ const { error } = ThemePlatformApplicationValidator.getPage().validate(
617
979
  {
618
980
  themeId,
619
981
  pageValue,
@@ -625,7 +987,9 @@ class Theme {
625
987
  }
626
988
 
627
989
  // Showing warrnings if extra unknown parameters are found
628
- const { error: warrning } = ThemeValidator.getPage().validate(
990
+ const {
991
+ error: warrning,
992
+ } = ThemePlatformApplicationValidator.getPage().validate(
629
993
  {
630
994
  themeId,
631
995
  pageValue,
@@ -635,9 +999,8 @@ class Theme {
635
999
  if (warrning) {
636
1000
  Logger({
637
1001
  level: "WARN",
638
- message: "Parameter Validation warrnings for getPage",
1002
+ message: `Parameter Validation warrnings for platform > Theme > getPage \n ${warrning}`,
639
1003
  });
640
- Logger({ level: "WARN", message: warrning });
641
1004
  }
642
1005
 
643
1006
  const query_params = {};
@@ -647,12 +1010,19 @@ class Theme {
647
1010
  "get",
648
1011
  `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/${pageValue}`,
649
1012
  query_params,
650
- undefined
1013
+ undefined,
1014
+ requestHeaders,
1015
+ { responseHeaders }
651
1016
  );
652
1017
 
1018
+ let responseData = response;
1019
+ if (responseHeaders) {
1020
+ responseData = response[0];
1021
+ }
1022
+
653
1023
  const {
654
1024
  error: res_error,
655
- } = ThemeModel.AvailablePageSchema().validate(response, {
1025
+ } = ThemePlatformModel.AvailablePageSchema().validate(responseData, {
656
1026
  abortEarly: false,
657
1027
  allowUnknown: false,
658
1028
  });
@@ -660,26 +1030,29 @@ class Theme {
660
1030
  if (res_error) {
661
1031
  Logger({
662
1032
  level: "WARN",
663
- message: "Response Validation Warnnings for getPage",
1033
+ message: `Response Validation Warnnings for platform > Theme > getPage \n ${res_error}`,
664
1034
  });
665
- Logger({ level: "WARN", message: res_error });
666
1035
  }
667
1036
 
668
1037
  return response;
669
1038
  }
670
1039
 
671
1040
  /**
672
- * @param {Object} arg - Arg object.
673
- * @param {number} [arg.pageSize] - The number of items to retrieve in each
674
- * page. Default value is 10.
675
- * @param {number} [arg.pageNo] - The page number to navigate through the
676
- * given set of results. Default value is 1.
677
- * @returns {Promise<ThemesListingResponseSchema>} - Success response
1041
+ * @param {ThemePlatformApplicationValidator.GetPublicThemesParam} arg - Arg object
1042
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1043
+ * @param {import("../PlatformAPIClient").Options} - Options
1044
+ * @returns {Promise<ThemePlatformModel.DummyResponse>} - Success response
1045
+ * @name getPublicThemes
678
1046
  * @summary: Get all public themes
679
- * @description: Use this API to get a list of free themes that you can apply to your website.
1047
+ * @description: Use this API to get a list of free themes that you can apply to your website. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/theme/getPublicThemes/).
680
1048
  */
681
- async getPublicThemes({ pageSize, pageNo } = {}) {
682
- const { error } = ThemeValidator.getPublicThemes().validate(
1049
+ async getPublicThemes(
1050
+ { pageSize, pageNo, requestHeaders } = { requestHeaders: {} },
1051
+ { responseHeaders } = { responseHeaders: false }
1052
+ ) {
1053
+ const {
1054
+ error,
1055
+ } = ThemePlatformApplicationValidator.getPublicThemes().validate(
683
1056
  {
684
1057
  pageSize,
685
1058
  pageNo,
@@ -691,7 +1064,9 @@ class Theme {
691
1064
  }
692
1065
 
693
1066
  // Showing warrnings if extra unknown parameters are found
694
- const { error: warrning } = ThemeValidator.getPublicThemes().validate(
1067
+ const {
1068
+ error: warrning,
1069
+ } = ThemePlatformApplicationValidator.getPublicThemes().validate(
695
1070
  {
696
1071
  pageSize,
697
1072
  pageNo,
@@ -701,9 +1076,8 @@ class Theme {
701
1076
  if (warrning) {
702
1077
  Logger({
703
1078
  level: "WARN",
704
- message: "Parameter Validation warrnings for getPublicThemes",
1079
+ message: `Parameter Validation warrnings for platform > Theme > getPublicThemes \n ${warrning}`,
705
1080
  });
706
- Logger({ level: "WARN", message: warrning });
707
1081
  }
708
1082
 
709
1083
  const query_params = {};
@@ -715,12 +1089,19 @@ class Theme {
715
1089
  "get",
716
1090
  `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/list/public`,
717
1091
  query_params,
718
- undefined
1092
+ undefined,
1093
+ requestHeaders,
1094
+ { responseHeaders }
719
1095
  );
720
1096
 
1097
+ let responseData = response;
1098
+ if (responseHeaders) {
1099
+ responseData = response[0];
1100
+ }
1101
+
721
1102
  const {
722
1103
  error: res_error,
723
- } = ThemeModel.ThemesListingResponseSchema().validate(response, {
1104
+ } = ThemePlatformModel.DummyResponse().validate(responseData, {
724
1105
  abortEarly: false,
725
1106
  allowUnknown: false,
726
1107
  });
@@ -728,23 +1109,27 @@ class Theme {
728
1109
  if (res_error) {
729
1110
  Logger({
730
1111
  level: "WARN",
731
- message: "Response Validation Warnnings for getPublicThemes",
1112
+ message: `Response Validation Warnnings for platform > Theme > getPublicThemes \n ${res_error}`,
732
1113
  });
733
- Logger({ level: "WARN", message: res_error });
734
1114
  }
735
1115
 
736
1116
  return response;
737
1117
  }
738
1118
 
739
1119
  /**
740
- * @param {Object} arg - Arg object.
741
- * @param {string} arg.themeId - ID allotted to the theme.
742
- * @returns {Promise<ThemesSchema>} - Success response
743
- * @summary: Gets theme by id
744
- * @description: Use this API to retrieve the details of a specific theme by using its ID.
1120
+ * @param {ThemePlatformApplicationValidator.GetThemeByIdParam} arg - Arg object
1121
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1122
+ * @param {import("../PlatformAPIClient").Options} - Options
1123
+ * @returns {Promise<ThemePlatformModel.ThemesSchema>} - Success response
1124
+ * @name getThemeById
1125
+ * @summary: Get Theme By Theme Id
1126
+ * @description: Get Theme By Theme Id - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/theme/getThemeById/).
745
1127
  */
746
- async getThemeById({ themeId } = {}) {
747
- const { error } = ThemeValidator.getThemeById().validate(
1128
+ async getThemeById(
1129
+ { themeId, requestHeaders } = { requestHeaders: {} },
1130
+ { responseHeaders } = { responseHeaders: false }
1131
+ ) {
1132
+ const { error } = ThemePlatformApplicationValidator.getThemeById().validate(
748
1133
  {
749
1134
  themeId,
750
1135
  },
@@ -755,7 +1140,9 @@ class Theme {
755
1140
  }
756
1141
 
757
1142
  // Showing warrnings if extra unknown parameters are found
758
- const { error: warrning } = ThemeValidator.getThemeById().validate(
1143
+ const {
1144
+ error: warrning,
1145
+ } = ThemePlatformApplicationValidator.getThemeById().validate(
759
1146
  {
760
1147
  themeId,
761
1148
  },
@@ -764,9 +1151,8 @@ class Theme {
764
1151
  if (warrning) {
765
1152
  Logger({
766
1153
  level: "WARN",
767
- message: "Parameter Validation warrnings for getThemeById",
1154
+ message: `Parameter Validation warrnings for platform > Theme > getThemeById \n ${warrning}`,
768
1155
  });
769
- Logger({ level: "WARN", message: warrning });
770
1156
  }
771
1157
 
772
1158
  const query_params = {};
@@ -774,12 +1160,21 @@ class Theme {
774
1160
  const response = await PlatformAPIClient.execute(
775
1161
  this.config,
776
1162
  "get",
777
- `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}`,
1163
+ `/service/platform/theme/v2.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}`,
778
1164
  query_params,
779
- undefined
1165
+ undefined,
1166
+ requestHeaders,
1167
+ { responseHeaders }
780
1168
  );
781
1169
 
782
- const { error: res_error } = ThemeModel.ThemesSchema().validate(response, {
1170
+ let responseData = response;
1171
+ if (responseHeaders) {
1172
+ responseData = response[0];
1173
+ }
1174
+
1175
+ const {
1176
+ error: res_error,
1177
+ } = ThemePlatformModel.ThemesSchema().validate(responseData, {
783
1178
  abortEarly: false,
784
1179
  allowUnknown: false,
785
1180
  });
@@ -787,23 +1182,29 @@ class Theme {
787
1182
  if (res_error) {
788
1183
  Logger({
789
1184
  level: "WARN",
790
- message: "Response Validation Warnnings for getThemeById",
1185
+ message: `Response Validation Warnnings for platform > Theme > getThemeById \n ${res_error}`,
791
1186
  });
792
- Logger({ level: "WARN", message: res_error });
793
1187
  }
794
1188
 
795
1189
  return response;
796
1190
  }
797
1191
 
798
1192
  /**
799
- * @param {Object} arg - Arg object.
800
- * @param {string} arg.themeId - ID allotted to the theme.
801
- * @returns {Promise<ThemesSchema>} - Success response
802
- * @summary: Get a theme preview
803
- * @description: A theme can be previewed before applying it. Use this API to retrieve the theme preview by using its ID.
1193
+ * @param {ThemePlatformApplicationValidator.GetThemeForPreviewParam} arg - Arg object
1194
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1195
+ * @param {import("../PlatformAPIClient").Options} - Options
1196
+ * @returns {Promise<ThemePlatformModel.ThemesSchema>} - Success response
1197
+ * @name getThemeForPreview
1198
+ * @summary: Get Theme Preview By Theme Id
1199
+ * @description: Get Theme Preview By Theme Id - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/theme/getThemeForPreview/).
804
1200
  */
805
- async getThemeForPreview({ themeId } = {}) {
806
- const { error } = ThemeValidator.getThemeForPreview().validate(
1201
+ async getThemeForPreview(
1202
+ { themeId, requestHeaders } = { requestHeaders: {} },
1203
+ { responseHeaders } = { responseHeaders: false }
1204
+ ) {
1205
+ const {
1206
+ error,
1207
+ } = ThemePlatformApplicationValidator.getThemeForPreview().validate(
807
1208
  {
808
1209
  themeId,
809
1210
  },
@@ -814,7 +1215,9 @@ class Theme {
814
1215
  }
815
1216
 
816
1217
  // Showing warrnings if extra unknown parameters are found
817
- const { error: warrning } = ThemeValidator.getThemeForPreview().validate(
1218
+ const {
1219
+ error: warrning,
1220
+ } = ThemePlatformApplicationValidator.getThemeForPreview().validate(
818
1221
  {
819
1222
  themeId,
820
1223
  },
@@ -823,9 +1226,8 @@ class Theme {
823
1226
  if (warrning) {
824
1227
  Logger({
825
1228
  level: "WARN",
826
- message: "Parameter Validation warrnings for getThemeForPreview",
1229
+ message: `Parameter Validation warrnings for platform > Theme > getThemeForPreview \n ${warrning}`,
827
1230
  });
828
- Logger({ level: "WARN", message: warrning });
829
1231
  }
830
1232
 
831
1233
  const query_params = {};
@@ -833,12 +1235,21 @@ class Theme {
833
1235
  const response = await PlatformAPIClient.execute(
834
1236
  this.config,
835
1237
  "get",
836
- `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/preview`,
1238
+ `/service/platform/theme/v2.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/preview`,
837
1239
  query_params,
838
- undefined
1240
+ undefined,
1241
+ requestHeaders,
1242
+ { responseHeaders }
839
1243
  );
840
1244
 
841
- const { error: res_error } = ThemeModel.ThemesSchema().validate(response, {
1245
+ let responseData = response;
1246
+ if (responseHeaders) {
1247
+ responseData = response[0];
1248
+ }
1249
+
1250
+ const {
1251
+ error: res_error,
1252
+ } = ThemePlatformModel.ThemesSchema().validate(responseData, {
842
1253
  abortEarly: false,
843
1254
  allowUnknown: false,
844
1255
  });
@@ -846,23 +1257,31 @@ class Theme {
846
1257
  if (res_error) {
847
1258
  Logger({
848
1259
  level: "WARN",
849
- message: "Response Validation Warnnings for getThemeForPreview",
1260
+ message: `Response Validation Warnnings for platform > Theme > getThemeForPreview \n ${res_error}`,
850
1261
  });
851
- Logger({ level: "WARN", message: res_error });
852
1262
  }
853
1263
 
854
1264
  return response;
855
1265
  }
856
1266
 
857
1267
  /**
858
- * @param {Object} arg - Arg object.
859
- * @param {string} arg.themeId - ID allotted to the theme.
1268
+ * @param {ThemePlatformApplicationValidator.GetThemeLastModifiedParam} arg
1269
+ * - Arg object
1270
+ *
1271
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1272
+ * @param {import("../PlatformAPIClient").Options} - Options
860
1273
  * @returns {Promise<any>} - Success response
1274
+ * @name getThemeLastModified
861
1275
  * @summary: Fetch last modified timestamp
862
- * @description: Use this API to fetch Last-Modified timestamp in header metadata.
1276
+ * @description: Use this API to fetch Last-Modified timestamp in header metadata. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/theme/getThemeLastModified/).
863
1277
  */
864
- async getThemeLastModified({ themeId } = {}) {
865
- const { error } = ThemeValidator.getThemeLastModified().validate(
1278
+ async getThemeLastModified(
1279
+ { themeId, requestHeaders } = { requestHeaders: {} },
1280
+ { responseHeaders } = { responseHeaders: false }
1281
+ ) {
1282
+ const {
1283
+ error,
1284
+ } = ThemePlatformApplicationValidator.getThemeLastModified().validate(
866
1285
  {
867
1286
  themeId,
868
1287
  },
@@ -873,7 +1292,9 @@ class Theme {
873
1292
  }
874
1293
 
875
1294
  // Showing warrnings if extra unknown parameters are found
876
- const { error: warrning } = ThemeValidator.getThemeLastModified().validate(
1295
+ const {
1296
+ error: warrning,
1297
+ } = ThemePlatformApplicationValidator.getThemeLastModified().validate(
877
1298
  {
878
1299
  themeId,
879
1300
  },
@@ -882,9 +1303,8 @@ class Theme {
882
1303
  if (warrning) {
883
1304
  Logger({
884
1305
  level: "WARN",
885
- message: "Parameter Validation warrnings for getThemeLastModified",
1306
+ message: `Parameter Validation warrnings for platform > Theme > getThemeLastModified \n ${warrning}`,
886
1307
  });
887
- Logger({ level: "WARN", message: warrning });
888
1308
  }
889
1309
 
890
1310
  const query_params = {};
@@ -892,38 +1312,48 @@ class Theme {
892
1312
  const response = await PlatformAPIClient.execute(
893
1313
  this.config,
894
1314
  "head",
895
- `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/polling`,
1315
+ `/service/platform/theme/v2.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/polling`,
896
1316
  query_params,
897
- undefined
1317
+ undefined,
1318
+ requestHeaders,
1319
+ { responseHeaders }
898
1320
  );
899
1321
 
1322
+ let responseData = response;
1323
+ if (responseHeaders) {
1324
+ responseData = response[0];
1325
+ }
1326
+
900
1327
  const { error: res_error } = Joi.string()
901
1328
  .allow("")
902
- .validate(response, { abortEarly: false, allowUnknown: false });
1329
+ .validate(responseData, { abortEarly: false, allowUnknown: false });
903
1330
 
904
1331
  if (res_error) {
905
1332
  Logger({
906
1333
  level: "WARN",
907
- message: "Response Validation Warnnings for getThemeLastModified",
1334
+ message: `Response Validation Warnnings for platform > Theme > getThemeLastModified \n ${res_error}`,
908
1335
  });
909
- Logger({ level: "WARN", message: res_error });
910
1336
  }
911
1337
 
912
1338
  return response;
913
1339
  }
914
1340
 
915
1341
  /**
916
- * @param {Object} arg - Arg object.
917
- * @param {number} [arg.pageSize] - The number of items to retrieve in each
918
- * page. Default value is 10.
919
- * @param {number} [arg.pageNo] - The page number to navigate through the
920
- * given set of results. Default value is 1.
921
- * @returns {Promise<ThemesListingResponseSchema>} - Success response
1342
+ * @param {ThemePlatformApplicationValidator.GetThemeLibraryParam} arg - Arg object
1343
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1344
+ * @param {import("../PlatformAPIClient").Options} - Options
1345
+ * @returns {Promise<ThemePlatformModel.DummyResponse>} - Success response
1346
+ * @name getThemeLibrary
922
1347
  * @summary: Get a list of themes from the theme library
923
- * @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.
1348
+ * @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. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/theme/getThemeLibrary/).
924
1349
  */
925
- async getThemeLibrary({ pageSize, pageNo } = {}) {
926
- const { error } = ThemeValidator.getThemeLibrary().validate(
1350
+ async getThemeLibrary(
1351
+ { pageSize, pageNo, requestHeaders } = { requestHeaders: {} },
1352
+ { responseHeaders } = { responseHeaders: false }
1353
+ ) {
1354
+ const {
1355
+ error,
1356
+ } = ThemePlatformApplicationValidator.getThemeLibrary().validate(
927
1357
  {
928
1358
  pageSize,
929
1359
  pageNo,
@@ -935,7 +1365,9 @@ class Theme {
935
1365
  }
936
1366
 
937
1367
  // Showing warrnings if extra unknown parameters are found
938
- const { error: warrning } = ThemeValidator.getThemeLibrary().validate(
1368
+ const {
1369
+ error: warrning,
1370
+ } = ThemePlatformApplicationValidator.getThemeLibrary().validate(
939
1371
  {
940
1372
  pageSize,
941
1373
  pageNo,
@@ -945,9 +1377,8 @@ class Theme {
945
1377
  if (warrning) {
946
1378
  Logger({
947
1379
  level: "WARN",
948
- message: "Parameter Validation warrnings for getThemeLibrary",
1380
+ message: `Parameter Validation warrnings for platform > Theme > getThemeLibrary \n ${warrning}`,
949
1381
  });
950
- Logger({ level: "WARN", message: warrning });
951
1382
  }
952
1383
 
953
1384
  const query_params = {};
@@ -959,12 +1390,19 @@ class Theme {
959
1390
  "get",
960
1391
  `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/library`,
961
1392
  query_params,
962
- undefined
1393
+ undefined,
1394
+ requestHeaders,
1395
+ { responseHeaders }
963
1396
  );
964
1397
 
1398
+ let responseData = response;
1399
+ if (responseHeaders) {
1400
+ responseData = response[0];
1401
+ }
1402
+
965
1403
  const {
966
1404
  error: res_error,
967
- } = ThemeModel.ThemesListingResponseSchema().validate(response, {
1405
+ } = ThemePlatformModel.DummyResponse().validate(responseData, {
968
1406
  abortEarly: false,
969
1407
  allowUnknown: false,
970
1408
  });
@@ -972,23 +1410,27 @@ class Theme {
972
1410
  if (res_error) {
973
1411
  Logger({
974
1412
  level: "WARN",
975
- message: "Response Validation Warnnings for getThemeLibrary",
1413
+ message: `Response Validation Warnnings for platform > Theme > getThemeLibrary \n ${res_error}`,
976
1414
  });
977
- Logger({ level: "WARN", message: res_error });
978
1415
  }
979
1416
 
980
1417
  return response;
981
1418
  }
982
1419
 
983
1420
  /**
984
- * @param {Object} arg - Arg object.
985
- * @param {string} arg.themeId - Theme ID
986
- * @returns {Promise<UpgradableThemeSchema>} - Success response
987
- * @summary: Checks if theme is upgradable
988
- * @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.
1421
+ * @param {ThemePlatformApplicationValidator.IsUpgradableParam} arg - Arg object
1422
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1423
+ * @param {import("../PlatformAPIClient").Options} - Options
1424
+ * @returns {Promise<ThemePlatformModel.ThemeUpgradableResponse>} - Success response
1425
+ * @name isUpgradable
1426
+ * @summary: Check if the theme is upgradable
1427
+ * @description: This API endpoint checks if the theme is upgradable for a specific company and application. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/theme/isUpgradable/).
989
1428
  */
990
- async isUpgradable({ themeId } = {}) {
991
- const { error } = ThemeValidator.isUpgradable().validate(
1429
+ async isUpgradable(
1430
+ { themeId, requestHeaders } = { requestHeaders: {} },
1431
+ { responseHeaders } = { responseHeaders: false }
1432
+ ) {
1433
+ const { error } = ThemePlatformApplicationValidator.isUpgradable().validate(
992
1434
  {
993
1435
  themeId,
994
1436
  },
@@ -999,7 +1441,9 @@ class Theme {
999
1441
  }
1000
1442
 
1001
1443
  // Showing warrnings if extra unknown parameters are found
1002
- const { error: warrning } = ThemeValidator.isUpgradable().validate(
1444
+ const {
1445
+ error: warrning,
1446
+ } = ThemePlatformApplicationValidator.isUpgradable().validate(
1003
1447
  {
1004
1448
  themeId,
1005
1449
  },
@@ -1008,9 +1452,8 @@ class Theme {
1008
1452
  if (warrning) {
1009
1453
  Logger({
1010
1454
  level: "WARN",
1011
- message: "Parameter Validation warrnings for isUpgradable",
1455
+ message: `Parameter Validation warrnings for platform > Theme > isUpgradable \n ${warrning}`,
1012
1456
  });
1013
- Logger({ level: "WARN", message: warrning });
1014
1457
  }
1015
1458
 
1016
1459
  const query_params = {};
@@ -1018,14 +1461,21 @@ class Theme {
1018
1461
  const response = await PlatformAPIClient.execute(
1019
1462
  this.config,
1020
1463
  "get",
1021
- `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/upgradable`,
1464
+ `/service/platform/theme/v2.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/upgradable`,
1022
1465
  query_params,
1023
- undefined
1466
+ undefined,
1467
+ requestHeaders,
1468
+ { responseHeaders }
1024
1469
  );
1025
1470
 
1471
+ let responseData = response;
1472
+ if (responseHeaders) {
1473
+ responseData = response[0];
1474
+ }
1475
+
1026
1476
  const {
1027
1477
  error: res_error,
1028
- } = ThemeModel.UpgradableThemeSchema().validate(response, {
1478
+ } = ThemePlatformModel.ThemeUpgradableResponse().validate(responseData, {
1029
1479
  abortEarly: false,
1030
1480
  allowUnknown: false,
1031
1481
  });
@@ -1033,23 +1483,27 @@ class Theme {
1033
1483
  if (res_error) {
1034
1484
  Logger({
1035
1485
  level: "WARN",
1036
- message: "Response Validation Warnnings for isUpgradable",
1486
+ message: `Response Validation Warnnings for platform > Theme > isUpgradable \n ${res_error}`,
1037
1487
  });
1038
- Logger({ level: "WARN", message: res_error });
1039
1488
  }
1040
1489
 
1041
1490
  return response;
1042
1491
  }
1043
1492
 
1044
1493
  /**
1045
- * @param {Object} arg - Arg object.
1046
- * @param {string} arg.themeId - ID allotted to the theme.
1047
- * @returns {Promise<ThemesSchema>} - Success response
1494
+ * @param {ThemePlatformApplicationValidator.PublishThemeParam} arg - Arg object
1495
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1496
+ * @param {import("../PlatformAPIClient").Options} - Options
1497
+ * @returns {Promise<ThemePlatformModel.DummyResponse>} - Success response
1498
+ * @name publishTheme
1048
1499
  * @summary: Publish a theme
1049
- * @description: Use this API to publish a theme that is either newly created or edited.
1500
+ * @description: Use this API to publish a theme that is either newly created or edited. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/theme/publishTheme/).
1050
1501
  */
1051
- async publishTheme({ themeId } = {}) {
1052
- const { error } = ThemeValidator.publishTheme().validate(
1502
+ async publishTheme(
1503
+ { themeId, requestHeaders } = { requestHeaders: {} },
1504
+ { responseHeaders } = { responseHeaders: false }
1505
+ ) {
1506
+ const { error } = ThemePlatformApplicationValidator.publishTheme().validate(
1053
1507
  {
1054
1508
  themeId,
1055
1509
  },
@@ -1060,7 +1514,9 @@ class Theme {
1060
1514
  }
1061
1515
 
1062
1516
  // Showing warrnings if extra unknown parameters are found
1063
- const { error: warrning } = ThemeValidator.publishTheme().validate(
1517
+ const {
1518
+ error: warrning,
1519
+ } = ThemePlatformApplicationValidator.publishTheme().validate(
1064
1520
  {
1065
1521
  themeId,
1066
1522
  },
@@ -1069,9 +1525,8 @@ class Theme {
1069
1525
  if (warrning) {
1070
1526
  Logger({
1071
1527
  level: "WARN",
1072
- message: "Parameter Validation warrnings for publishTheme",
1528
+ message: `Parameter Validation warrnings for platform > Theme > publishTheme \n ${warrning}`,
1073
1529
  });
1074
- Logger({ level: "WARN", message: warrning });
1075
1530
  }
1076
1531
 
1077
1532
  const query_params = {};
@@ -1081,10 +1536,19 @@ class Theme {
1081
1536
  "put",
1082
1537
  `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/publish`,
1083
1538
  query_params,
1084
- undefined
1539
+ undefined,
1540
+ requestHeaders,
1541
+ { responseHeaders }
1085
1542
  );
1086
1543
 
1087
- const { error: res_error } = ThemeModel.ThemesSchema().validate(response, {
1544
+ let responseData = response;
1545
+ if (responseHeaders) {
1546
+ responseData = response[0];
1547
+ }
1548
+
1549
+ const {
1550
+ error: res_error,
1551
+ } = ThemePlatformModel.DummyResponse().validate(responseData, {
1088
1552
  abortEarly: false,
1089
1553
  allowUnknown: false,
1090
1554
  });
@@ -1092,23 +1556,29 @@ class Theme {
1092
1556
  if (res_error) {
1093
1557
  Logger({
1094
1558
  level: "WARN",
1095
- message: "Response Validation Warnnings for publishTheme",
1559
+ message: `Response Validation Warnnings for platform > Theme > publishTheme \n ${res_error}`,
1096
1560
  });
1097
- Logger({ level: "WARN", message: res_error });
1098
1561
  }
1099
1562
 
1100
1563
  return response;
1101
1564
  }
1102
1565
 
1103
1566
  /**
1104
- * @param {Object} arg - Arg object.
1105
- * @param {string} arg.themeId - ID allotted to the theme.
1106
- * @returns {Promise<ThemesSchema>} - Success response
1567
+ * @param {ThemePlatformApplicationValidator.UnarchiveThemeParam} arg - Arg object
1568
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1569
+ * @param {import("../PlatformAPIClient").Options} - Options
1570
+ * @returns {Promise<ThemePlatformModel.DummyResponse>} - Success response
1571
+ * @name unarchiveTheme
1107
1572
  * @summary: Unarchive a theme
1108
- * @description: Use this API to restore an archived theme and bring it back for editing or publishing.
1573
+ * @description: Use this API to restore an archived theme and bring it back for editing or publishing. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/theme/unarchiveTheme/).
1109
1574
  */
1110
- async unarchiveTheme({ themeId } = {}) {
1111
- const { error } = ThemeValidator.unarchiveTheme().validate(
1575
+ async unarchiveTheme(
1576
+ { themeId, requestHeaders } = { requestHeaders: {} },
1577
+ { responseHeaders } = { responseHeaders: false }
1578
+ ) {
1579
+ const {
1580
+ error,
1581
+ } = ThemePlatformApplicationValidator.unarchiveTheme().validate(
1112
1582
  {
1113
1583
  themeId,
1114
1584
  },
@@ -1119,7 +1589,9 @@ class Theme {
1119
1589
  }
1120
1590
 
1121
1591
  // Showing warrnings if extra unknown parameters are found
1122
- const { error: warrning } = ThemeValidator.unarchiveTheme().validate(
1592
+ const {
1593
+ error: warrning,
1594
+ } = ThemePlatformApplicationValidator.unarchiveTheme().validate(
1123
1595
  {
1124
1596
  themeId,
1125
1597
  },
@@ -1128,9 +1600,8 @@ class Theme {
1128
1600
  if (warrning) {
1129
1601
  Logger({
1130
1602
  level: "WARN",
1131
- message: "Parameter Validation warrnings for unarchiveTheme",
1603
+ message: `Parameter Validation warrnings for platform > Theme > unarchiveTheme \n ${warrning}`,
1132
1604
  });
1133
- Logger({ level: "WARN", message: warrning });
1134
1605
  }
1135
1606
 
1136
1607
  const query_params = {};
@@ -1140,10 +1611,19 @@ class Theme {
1140
1611
  "put",
1141
1612
  `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/unarchive`,
1142
1613
  query_params,
1143
- undefined
1614
+ undefined,
1615
+ requestHeaders,
1616
+ { responseHeaders }
1144
1617
  );
1145
1618
 
1146
- const { error: res_error } = ThemeModel.ThemesSchema().validate(response, {
1619
+ let responseData = response;
1620
+ if (responseHeaders) {
1621
+ responseData = response[0];
1622
+ }
1623
+
1624
+ const {
1625
+ error: res_error,
1626
+ } = ThemePlatformModel.DummyResponse().validate(responseData, {
1147
1627
  abortEarly: false,
1148
1628
  allowUnknown: false,
1149
1629
  });
@@ -1151,23 +1631,29 @@ class Theme {
1151
1631
  if (res_error) {
1152
1632
  Logger({
1153
1633
  level: "WARN",
1154
- message: "Response Validation Warnnings for unarchiveTheme",
1634
+ message: `Response Validation Warnnings for platform > Theme > unarchiveTheme \n ${res_error}`,
1155
1635
  });
1156
- Logger({ level: "WARN", message: res_error });
1157
1636
  }
1158
1637
 
1159
1638
  return response;
1160
1639
  }
1161
1640
 
1162
1641
  /**
1163
- * @param {Object} arg - Arg object.
1164
- * @param {string} arg.themeId - ID allotted to the theme.
1165
- * @returns {Promise<ThemesSchema>} - Success response
1642
+ * @param {ThemePlatformApplicationValidator.UnpublishThemeParam} arg - Arg object
1643
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1644
+ * @param {import("../PlatformAPIClient").Options} - Options
1645
+ * @returns {Promise<ThemePlatformModel.DummyResponse>} - Success response
1646
+ * @name unpublishTheme
1166
1647
  * @summary: Unpublish a theme
1167
- * @description: Use this API to remove an existing theme from the list of available themes.
1648
+ * @description: Use this API to remove an existing theme from the list of available themes. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/theme/unpublishTheme/).
1168
1649
  */
1169
- async unpublishTheme({ themeId } = {}) {
1170
- const { error } = ThemeValidator.unpublishTheme().validate(
1650
+ async unpublishTheme(
1651
+ { themeId, requestHeaders } = { requestHeaders: {} },
1652
+ { responseHeaders } = { responseHeaders: false }
1653
+ ) {
1654
+ const {
1655
+ error,
1656
+ } = ThemePlatformApplicationValidator.unpublishTheme().validate(
1171
1657
  {
1172
1658
  themeId,
1173
1659
  },
@@ -1178,7 +1664,9 @@ class Theme {
1178
1664
  }
1179
1665
 
1180
1666
  // Showing warrnings if extra unknown parameters are found
1181
- const { error: warrning } = ThemeValidator.unpublishTheme().validate(
1667
+ const {
1668
+ error: warrning,
1669
+ } = ThemePlatformApplicationValidator.unpublishTheme().validate(
1182
1670
  {
1183
1671
  themeId,
1184
1672
  },
@@ -1187,9 +1675,8 @@ class Theme {
1187
1675
  if (warrning) {
1188
1676
  Logger({
1189
1677
  level: "WARN",
1190
- message: "Parameter Validation warrnings for unpublishTheme",
1678
+ message: `Parameter Validation warrnings for platform > Theme > unpublishTheme \n ${warrning}`,
1191
1679
  });
1192
- Logger({ level: "WARN", message: warrning });
1193
1680
  }
1194
1681
 
1195
1682
  const query_params = {};
@@ -1199,10 +1686,19 @@ class Theme {
1199
1686
  "put",
1200
1687
  `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/unpublish`,
1201
1688
  query_params,
1202
- undefined
1689
+ undefined,
1690
+ requestHeaders,
1691
+ { responseHeaders }
1203
1692
  );
1204
1693
 
1205
- const { error: res_error } = ThemeModel.ThemesSchema().validate(response, {
1694
+ let responseData = response;
1695
+ if (responseHeaders) {
1696
+ responseData = response[0];
1697
+ }
1698
+
1699
+ const {
1700
+ error: res_error,
1701
+ } = ThemePlatformModel.DummyResponse().validate(responseData, {
1206
1702
  abortEarly: false,
1207
1703
  allowUnknown: false,
1208
1704
  });
@@ -1210,24 +1706,31 @@ class Theme {
1210
1706
  if (res_error) {
1211
1707
  Logger({
1212
1708
  level: "WARN",
1213
- message: "Response Validation Warnnings for unpublishTheme",
1709
+ message: `Response Validation Warnnings for platform > Theme > unpublishTheme \n ${res_error}`,
1214
1710
  });
1215
- Logger({ level: "WARN", message: res_error });
1216
1711
  }
1217
1712
 
1218
1713
  return response;
1219
1714
  }
1220
1715
 
1221
1716
  /**
1222
- * @param {Object} arg - Arg object.
1223
- * @param {string} arg.themeId - ID of the theme to be retrieved
1224
- * @param {AllAvailablePageSchema} arg.body
1225
- * @returns {Promise<AllAvailablePageSchema>} - Success response
1717
+ * @param {ThemePlatformApplicationValidator.UpdateMultiplePagesParam} arg
1718
+ * - Arg object
1719
+ *
1720
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1721
+ * @param {import("../PlatformAPIClient").Options} - Options
1722
+ * @returns {Promise<ThemePlatformModel.AllAvailablePageSchema>} - Success response
1723
+ * @name updateMultiplePages
1226
1724
  * @summary: Update multiple pages of a theme
1227
- * @description: Use this API to update multiple pages of a theme by its ID.
1725
+ * @description: Use this API to update multiple pages of a theme by its ID. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/theme/updateMultiplePages/).
1228
1726
  */
1229
- async updateMultiplePages({ themeId, body } = {}) {
1230
- const { error } = ThemeValidator.updateMultiplePages().validate(
1727
+ async updateMultiplePages(
1728
+ { themeId, body, requestHeaders } = { requestHeaders: {} },
1729
+ { responseHeaders } = { responseHeaders: false }
1730
+ ) {
1731
+ const {
1732
+ error,
1733
+ } = ThemePlatformApplicationValidator.updateMultiplePages().validate(
1231
1734
  {
1232
1735
  themeId,
1233
1736
  body,
@@ -1239,7 +1742,9 @@ class Theme {
1239
1742
  }
1240
1743
 
1241
1744
  // Showing warrnings if extra unknown parameters are found
1242
- const { error: warrning } = ThemeValidator.updateMultiplePages().validate(
1745
+ const {
1746
+ error: warrning,
1747
+ } = ThemePlatformApplicationValidator.updateMultiplePages().validate(
1243
1748
  {
1244
1749
  themeId,
1245
1750
  body,
@@ -1249,9 +1754,8 @@ class Theme {
1249
1754
  if (warrning) {
1250
1755
  Logger({
1251
1756
  level: "WARN",
1252
- message: "Parameter Validation warrnings for updateMultiplePages",
1757
+ message: `Parameter Validation warrnings for platform > Theme > updateMultiplePages \n ${warrning}`,
1253
1758
  });
1254
- Logger({ level: "WARN", message: warrning });
1255
1759
  }
1256
1760
 
1257
1761
  const query_params = {};
@@ -1261,12 +1765,19 @@ class Theme {
1261
1765
  "put",
1262
1766
  `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/page`,
1263
1767
  query_params,
1264
- body
1768
+ body,
1769
+ requestHeaders,
1770
+ { responseHeaders }
1265
1771
  );
1266
1772
 
1773
+ let responseData = response;
1774
+ if (responseHeaders) {
1775
+ responseData = response[0];
1776
+ }
1777
+
1267
1778
  const {
1268
1779
  error: res_error,
1269
- } = ThemeModel.AllAvailablePageSchema().validate(response, {
1780
+ } = ThemePlatformModel.AllAvailablePageSchema().validate(responseData, {
1270
1781
  abortEarly: false,
1271
1782
  allowUnknown: false,
1272
1783
  });
@@ -1274,25 +1785,27 @@ class Theme {
1274
1785
  if (res_error) {
1275
1786
  Logger({
1276
1787
  level: "WARN",
1277
- message: "Response Validation Warnnings for updateMultiplePages",
1788
+ message: `Response Validation Warnnings for platform > Theme > updateMultiplePages \n ${res_error}`,
1278
1789
  });
1279
- Logger({ level: "WARN", message: res_error });
1280
1790
  }
1281
1791
 
1282
1792
  return response;
1283
1793
  }
1284
1794
 
1285
1795
  /**
1286
- * @param {Object} arg - Arg object.
1287
- * @param {string} arg.themeId - ID of the theme
1288
- * @param {string} arg.pageValue - Value of the page to be updated
1289
- * @param {AvailablePageSchema} arg.body
1290
- * @returns {Promise<AvailablePageSchema>} - Success response
1796
+ * @param {ThemePlatformApplicationValidator.UpdatePageParam} arg - Arg object
1797
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1798
+ * @param {import("../PlatformAPIClient").Options} - Options
1799
+ * @returns {Promise<ThemePlatformModel.AvailablePageSchema>} - Success response
1800
+ * @name updatePage
1291
1801
  * @summary: Updates a page
1292
- * @description: Use this API to update a page for a theme by its ID.
1802
+ * @description: Use this API to update a page for a theme by its ID. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/theme/updatePage/).
1293
1803
  */
1294
- async updatePage({ themeId, pageValue, body } = {}) {
1295
- const { error } = ThemeValidator.updatePage().validate(
1804
+ async updatePage(
1805
+ { themeId, pageValue, body, requestHeaders } = { requestHeaders: {} },
1806
+ { responseHeaders } = { responseHeaders: false }
1807
+ ) {
1808
+ const { error } = ThemePlatformApplicationValidator.updatePage().validate(
1296
1809
  {
1297
1810
  themeId,
1298
1811
  pageValue,
@@ -1305,7 +1818,9 @@ class Theme {
1305
1818
  }
1306
1819
 
1307
1820
  // Showing warrnings if extra unknown parameters are found
1308
- const { error: warrning } = ThemeValidator.updatePage().validate(
1821
+ const {
1822
+ error: warrning,
1823
+ } = ThemePlatformApplicationValidator.updatePage().validate(
1309
1824
  {
1310
1825
  themeId,
1311
1826
  pageValue,
@@ -1316,9 +1831,8 @@ class Theme {
1316
1831
  if (warrning) {
1317
1832
  Logger({
1318
1833
  level: "WARN",
1319
- message: "Parameter Validation warrnings for updatePage",
1834
+ message: `Parameter Validation warrnings for platform > Theme > updatePage \n ${warrning}`,
1320
1835
  });
1321
- Logger({ level: "WARN", message: warrning });
1322
1836
  }
1323
1837
 
1324
1838
  const query_params = {};
@@ -1328,12 +1842,19 @@ class Theme {
1328
1842
  "put",
1329
1843
  `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/${pageValue}`,
1330
1844
  query_params,
1331
- body
1845
+ body,
1846
+ requestHeaders,
1847
+ { responseHeaders }
1332
1848
  );
1333
1849
 
1850
+ let responseData = response;
1851
+ if (responseHeaders) {
1852
+ responseData = response[0];
1853
+ }
1854
+
1334
1855
  const {
1335
1856
  error: res_error,
1336
- } = ThemeModel.AvailablePageSchema().validate(response, {
1857
+ } = ThemePlatformModel.AvailablePageSchema().validate(responseData, {
1337
1858
  abortEarly: false,
1338
1859
  allowUnknown: false,
1339
1860
  });
@@ -1341,24 +1862,27 @@ class Theme {
1341
1862
  if (res_error) {
1342
1863
  Logger({
1343
1864
  level: "WARN",
1344
- message: "Response Validation Warnnings for updatePage",
1865
+ message: `Response Validation Warnnings for platform > Theme > updatePage \n ${res_error}`,
1345
1866
  });
1346
- Logger({ level: "WARN", message: res_error });
1347
1867
  }
1348
1868
 
1349
1869
  return response;
1350
1870
  }
1351
1871
 
1352
1872
  /**
1353
- * @param {Object} arg - Arg object.
1354
- * @param {string} arg.themeId - ID allotted to the theme.
1355
- * @param {ThemesSchema} arg.body
1356
- * @returns {Promise<ThemesSchema>} - Success response
1357
- * @summary: Update a theme
1358
- * @description: Use this API to edit an existing theme. You can customize the website font, sections, images, styles, and many more.
1873
+ * @param {ThemePlatformApplicationValidator.UpdateThemeParam} arg - Arg object
1874
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1875
+ * @param {import("../PlatformAPIClient").Options} - Options
1876
+ * @returns {Promise<ThemePlatformModel.ThemesSchema>} - Success response
1877
+ * @name updateTheme
1878
+ * @summary: Update theme for a specific company and application
1879
+ * @description: Update theme for a specific company and application - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/theme/updateTheme/).
1359
1880
  */
1360
- async updateTheme({ themeId, body } = {}) {
1361
- const { error } = ThemeValidator.updateTheme().validate(
1881
+ async updateTheme(
1882
+ { themeId, body, requestHeaders } = { requestHeaders: {} },
1883
+ { responseHeaders } = { responseHeaders: false }
1884
+ ) {
1885
+ const { error } = ThemePlatformApplicationValidator.updateTheme().validate(
1362
1886
  {
1363
1887
  themeId,
1364
1888
  body,
@@ -1370,7 +1894,9 @@ class Theme {
1370
1894
  }
1371
1895
 
1372
1896
  // Showing warrnings if extra unknown parameters are found
1373
- const { error: warrning } = ThemeValidator.updateTheme().validate(
1897
+ const {
1898
+ error: warrning,
1899
+ } = ThemePlatformApplicationValidator.updateTheme().validate(
1374
1900
  {
1375
1901
  themeId,
1376
1902
  body,
@@ -1380,9 +1906,8 @@ class Theme {
1380
1906
  if (warrning) {
1381
1907
  Logger({
1382
1908
  level: "WARN",
1383
- message: "Parameter Validation warrnings for updateTheme",
1909
+ message: `Parameter Validation warrnings for platform > Theme > updateTheme \n ${warrning}`,
1384
1910
  });
1385
- Logger({ level: "WARN", message: warrning });
1386
1911
  }
1387
1912
 
1388
1913
  const query_params = {};
@@ -1390,12 +1915,98 @@ class Theme {
1390
1915
  const response = await PlatformAPIClient.execute(
1391
1916
  this.config,
1392
1917
  "put",
1393
- `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}`,
1918
+ `/service/platform/theme/v2.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}`,
1919
+ query_params,
1920
+ body,
1921
+ requestHeaders,
1922
+ { responseHeaders }
1923
+ );
1924
+
1925
+ let responseData = response;
1926
+ if (responseHeaders) {
1927
+ responseData = response[0];
1928
+ }
1929
+
1930
+ const {
1931
+ error: res_error,
1932
+ } = ThemePlatformModel.ThemesSchema().validate(responseData, {
1933
+ abortEarly: false,
1934
+ allowUnknown: false,
1935
+ });
1936
+
1937
+ if (res_error) {
1938
+ Logger({
1939
+ level: "WARN",
1940
+ message: `Response Validation Warnnings for platform > Theme > updateTheme \n ${res_error}`,
1941
+ });
1942
+ }
1943
+
1944
+ return response;
1945
+ }
1946
+
1947
+ /**
1948
+ * @param {ThemePlatformApplicationValidator.UpdateThemeNameParam} arg - Arg object
1949
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1950
+ * @param {import("../PlatformAPIClient").Options} - Options
1951
+ * @returns {Promise<ThemePlatformModel.ThemesSchema>} - Success response
1952
+ * @name updateThemeName
1953
+ * @summary: Update Theme Name
1954
+ * @description: Update the name of a theme for a specific company and application. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/theme/updateThemeName/).
1955
+ */
1956
+ async updateThemeName(
1957
+ { themeId, body, requestHeaders } = { requestHeaders: {} },
1958
+ { responseHeaders } = { responseHeaders: false }
1959
+ ) {
1960
+ const {
1961
+ error,
1962
+ } = ThemePlatformApplicationValidator.updateThemeName().validate(
1963
+ {
1964
+ themeId,
1965
+ body,
1966
+ },
1967
+ { abortEarly: false, allowUnknown: true }
1968
+ );
1969
+ if (error) {
1970
+ return Promise.reject(new FDKClientValidationError(error));
1971
+ }
1972
+
1973
+ // Showing warrnings if extra unknown parameters are found
1974
+ const {
1975
+ error: warrning,
1976
+ } = ThemePlatformApplicationValidator.updateThemeName().validate(
1977
+ {
1978
+ themeId,
1979
+ body,
1980
+ },
1981
+ { abortEarly: false, allowUnknown: false }
1982
+ );
1983
+ if (warrning) {
1984
+ Logger({
1985
+ level: "WARN",
1986
+ message: `Parameter Validation warrnings for platform > Theme > updateThemeName \n ${warrning}`,
1987
+ });
1988
+ }
1989
+
1990
+ const query_params = {};
1991
+
1992
+ const response = await PlatformAPIClient.execute(
1993
+ this.config,
1994
+ "patch",
1995
+ `/service/platform/theme/v2.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/name`,
1394
1996
  query_params,
1395
- body
1997
+ body,
1998
+ requestHeaders,
1999
+ { responseHeaders }
1396
2000
  );
1397
2001
 
1398
- const { error: res_error } = ThemeModel.ThemesSchema().validate(response, {
2002
+ let responseData = response;
2003
+ if (responseHeaders) {
2004
+ responseData = response[0];
2005
+ }
2006
+
2007
+ const {
2008
+ error: res_error,
2009
+ } = ThemePlatformModel.ThemesSchema().validate(responseData, {
1399
2010
  abortEarly: false,
1400
2011
  allowUnknown: false,
1401
2012
  });
@@ -1403,23 +2014,27 @@ class Theme {
1403
2014
  if (res_error) {
1404
2015
  Logger({
1405
2016
  level: "WARN",
1406
- message: "Response Validation Warnnings for updateTheme",
2017
+ message: `Response Validation Warnnings for platform > Theme > updateThemeName \n ${res_error}`,
1407
2018
  });
1408
- Logger({ level: "WARN", message: res_error });
1409
2019
  }
1410
2020
 
1411
2021
  return response;
1412
2022
  }
1413
2023
 
1414
2024
  /**
1415
- * @param {Object} arg - Arg object.
1416
- * @param {string} arg.themeId - ID allotted to the theme.
1417
- * @returns {Promise<ThemesSchema>} - Success response
1418
- * @summary: Upgrade a theme
1419
- * @description: Use this API to upgrade the current theme to its latest version.
2025
+ * @param {ThemePlatformApplicationValidator.UpgradeThemeParam} arg - Arg object
2026
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
2027
+ * @param {import("../PlatformAPIClient").Options} - Options
2028
+ * @returns {Promise<ThemePlatformModel.ThemesSchema>} - Success response
2029
+ * @name upgradeTheme
2030
+ * @summary: Upgrade an application
2031
+ * @description: This endpoint allows you to upgrade an application. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/theme/upgradeTheme/).
1420
2032
  */
1421
- async upgradeTheme({ themeId } = {}) {
1422
- const { error } = ThemeValidator.upgradeTheme().validate(
2033
+ async upgradeTheme(
2034
+ { themeId, requestHeaders } = { requestHeaders: {} },
2035
+ { responseHeaders } = { responseHeaders: false }
2036
+ ) {
2037
+ const { error } = ThemePlatformApplicationValidator.upgradeTheme().validate(
1423
2038
  {
1424
2039
  themeId,
1425
2040
  },
@@ -1430,7 +2045,9 @@ class Theme {
1430
2045
  }
1431
2046
 
1432
2047
  // Showing warrnings if extra unknown parameters are found
1433
- const { error: warrning } = ThemeValidator.upgradeTheme().validate(
2048
+ const {
2049
+ error: warrning,
2050
+ } = ThemePlatformApplicationValidator.upgradeTheme().validate(
1434
2051
  {
1435
2052
  themeId,
1436
2053
  },
@@ -1439,9 +2056,8 @@ class Theme {
1439
2056
  if (warrning) {
1440
2057
  Logger({
1441
2058
  level: "WARN",
1442
- message: "Parameter Validation warrnings for upgradeTheme",
2059
+ message: `Parameter Validation warrnings for platform > Theme > upgradeTheme \n ${warrning}`,
1443
2060
  });
1444
- Logger({ level: "WARN", message: warrning });
1445
2061
  }
1446
2062
 
1447
2063
  const query_params = {};
@@ -1449,12 +2065,21 @@ class Theme {
1449
2065
  const response = await PlatformAPIClient.execute(
1450
2066
  this.config,
1451
2067
  "put",
1452
- `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/upgrade`,
2068
+ `/service/platform/theme/v2.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/upgrade`,
1453
2069
  query_params,
1454
- undefined
2070
+ undefined,
2071
+ requestHeaders,
2072
+ { responseHeaders }
1455
2073
  );
1456
2074
 
1457
- const { error: res_error } = ThemeModel.ThemesSchema().validate(response, {
2075
+ let responseData = response;
2076
+ if (responseHeaders) {
2077
+ responseData = response[0];
2078
+ }
2079
+
2080
+ const {
2081
+ error: res_error,
2082
+ } = ThemePlatformModel.ThemesSchema().validate(responseData, {
1458
2083
  abortEarly: false,
1459
2084
  allowUnknown: false,
1460
2085
  });
@@ -1462,9 +2087,8 @@ class Theme {
1462
2087
  if (res_error) {
1463
2088
  Logger({
1464
2089
  level: "WARN",
1465
- message: "Response Validation Warnnings for upgradeTheme",
2090
+ message: `Response Validation Warnnings for platform > Theme > upgradeTheme \n ${res_error}`,
1466
2091
  });
1467
- Logger({ level: "WARN", message: res_error });
1468
2092
  }
1469
2093
 
1470
2094
  return response;