@gofynd/fdk-client-javascript 1.2.0 → 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 (262) hide show
  1. package/README.md +44 -7
  2. package/package.json +1 -2
  3. package/sdk/application/ApplicationAPIClient.d.ts +3 -3
  4. package/sdk/application/ApplicationAPIClient.js +6 -4
  5. package/sdk/application/ApplicationClient.d.ts +2 -3
  6. package/sdk/application/ApplicationClient.js +1 -45
  7. package/sdk/application/ApplicationConfig.d.ts +46 -6
  8. package/sdk/application/ApplicationConfig.js +15 -16
  9. package/sdk/application/Cart/CartApplicationClient.d.ts +61 -33
  10. package/sdk/application/Cart/CartApplicationClient.js +225 -134
  11. package/sdk/application/Cart/CartApplicationModel.d.ts +4 -4
  12. package/sdk/application/Cart/CartApplicationModel.js +4 -4
  13. package/sdk/application/Catalog/CatalogApplicationClient.d.ts +61 -30
  14. package/sdk/application/Catalog/CatalogApplicationClient.js +234 -146
  15. package/sdk/application/Catalog/CatalogApplicationModel.d.ts +115 -13
  16. package/sdk/application/Catalog/CatalogApplicationModel.js +77 -12
  17. package/sdk/application/Common/CommonApplicationClient.d.ts +5 -3
  18. package/sdk/application/Common/CommonApplicationClient.js +13 -11
  19. package/sdk/application/Common/CommonApplicationModel.d.ts +3 -83
  20. package/sdk/application/Common/CommonApplicationModel.js +2 -58
  21. package/sdk/application/Communication/CommunicationApplicationClient.d.ts +9 -3
  22. package/sdk/application/Communication/CommunicationApplicationClient.js +25 -13
  23. package/sdk/application/Communication/CommunicationApplicationModel.d.ts +1 -34
  24. package/sdk/application/Communication/CommunicationApplicationModel.js +0 -36
  25. package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +46 -16
  26. package/sdk/application/Configuration/ConfigurationApplicationClient.js +144 -68
  27. package/sdk/application/Configuration/ConfigurationApplicationModel.d.ts +1 -219
  28. package/sdk/application/Configuration/ConfigurationApplicationModel.js +0 -226
  29. package/sdk/application/Content/ContentApplicationClient.d.ts +49 -21
  30. package/sdk/application/Content/ContentApplicationClient.js +159 -80
  31. package/sdk/application/Content/ContentApplicationModel.d.ts +5 -622
  32. package/sdk/application/Content/ContentApplicationModel.js +11 -763
  33. package/sdk/application/FileStorage/FileStorageApplicationClient.d.ts +6 -3
  34. package/sdk/application/FileStorage/FileStorageApplicationClient.js +20 -14
  35. package/sdk/application/FileStorage/FileStorageApplicationModel.d.ts +1 -152
  36. package/sdk/application/FileStorage/FileStorageApplicationModel.js +0 -180
  37. package/sdk/application/Lead/LeadApplicationClient.d.ts +14 -7
  38. package/sdk/application/Lead/LeadApplicationClient.js +50 -31
  39. package/sdk/application/Lead/LeadApplicationModel.d.ts +22 -741
  40. package/sdk/application/Lead/LeadApplicationModel.js +21 -481
  41. package/sdk/application/Logistic/LogisticApplicationClient.d.ts +11 -5
  42. package/sdk/application/Logistic/LogisticApplicationClient.js +41 -20
  43. package/sdk/application/Order/OrderApplicationClient.d.ts +24 -12
  44. package/sdk/application/Order/OrderApplicationClient.js +88 -56
  45. package/sdk/application/Payment/PaymentApplicationClient.d.ts +91 -42
  46. package/sdk/application/Payment/PaymentApplicationClient.js +293 -194
  47. package/sdk/application/Payment/PaymentApplicationModel.d.ts +36 -36
  48. package/sdk/application/Payment/PaymentApplicationModel.js +36 -36
  49. package/sdk/application/PosCart/PosCartApplicationClient.d.ts +59 -32
  50. package/sdk/application/PosCart/PosCartApplicationClient.js +214 -130
  51. package/sdk/application/PosCart/PosCartApplicationModel.d.ts +2 -2
  52. package/sdk/application/PosCart/PosCartApplicationModel.js +2 -2
  53. package/sdk/application/Rewards/RewardsApplicationClient.d.ts +16 -7
  54. package/sdk/application/Rewards/RewardsApplicationClient.js +56 -29
  55. package/sdk/application/Share/ShareApplicationClient.d.ts +15 -7
  56. package/sdk/application/Share/ShareApplicationClient.js +51 -31
  57. package/sdk/application/Share/ShareApplicationModel.d.ts +1 -33
  58. package/sdk/application/Share/ShareApplicationModel.js +0 -38
  59. package/sdk/application/Theme/ThemeApplicationClient.d.ts +9 -4
  60. package/sdk/application/Theme/ThemeApplicationClient.js +35 -18
  61. package/sdk/application/Theme/ThemeApplicationModel.d.ts +982 -312
  62. package/sdk/application/Theme/ThemeApplicationModel.js +621 -284
  63. package/sdk/application/User/UserApplicationClient.d.ts +74 -35
  64. package/sdk/application/User/UserApplicationClient.js +252 -161
  65. package/sdk/application/User/UserApplicationModel.d.ts +3 -401
  66. package/sdk/application/User/UserApplicationModel.js +2 -490
  67. package/sdk/common/AxiosHelper.js +1 -2
  68. package/sdk/common/FDKError.d.ts +3 -0
  69. package/sdk/common/FDKError.js +8 -0
  70. package/sdk/common/utils.d.ts +3 -0
  71. package/sdk/common/utils.js +29 -0
  72. package/sdk/partner/PartnerAPIClient.d.ts +5 -4
  73. package/sdk/partner/PartnerAPIClient.js +7 -4
  74. package/sdk/partner/PartnerClient.d.ts +2 -0
  75. package/sdk/partner/PartnerClient.js +3 -0
  76. package/sdk/partner/Theme/ThemePartnerClient.d.ts +299 -0
  77. package/sdk/partner/Theme/ThemePartnerClient.js +768 -0
  78. package/sdk/partner/Theme/ThemePartnerModel.d.ts +1706 -0
  79. package/sdk/partner/Theme/ThemePartnerModel.js +1409 -0
  80. package/sdk/partner/Theme/ThemePartnerValidator.d.ts +22 -0
  81. package/sdk/partner/Theme/ThemePartnerValidator.js +157 -0
  82. package/sdk/partner/index.d.ts +3 -1
  83. package/sdk/partner/index.js +3 -1
  84. package/sdk/platform/AuditTrail/AuditTrailPlatformClient.d.ts +8 -4
  85. package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +38 -16
  86. package/sdk/platform/AuditTrail/AuditTrailPlatformModel.d.ts +1 -13
  87. package/sdk/platform/AuditTrail/AuditTrailPlatformModel.js +0 -12
  88. package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.d.ts +10 -0
  89. package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.js +4 -0
  90. package/sdk/platform/Billing/BillingPlatformClient.d.ts +59 -14
  91. package/sdk/platform/Billing/BillingPlatformClient.js +315 -64
  92. package/sdk/platform/Billing/BillingPlatformModel.d.ts +56 -196
  93. package/sdk/platform/Billing/BillingPlatformModel.js +63 -217
  94. package/sdk/platform/Billing/BillingPlatformValidator.d.ts +23 -1
  95. package/sdk/platform/Billing/BillingPlatformValidator.js +31 -0
  96. package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +124 -63
  97. package/sdk/platform/Cart/CartPlatformApplicationClient.js +431 -265
  98. package/sdk/platform/Cart/CartPlatformModel.d.ts +253 -53
  99. package/sdk/platform/Cart/CartPlatformModel.js +104 -54
  100. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +120 -53
  101. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +398 -247
  102. package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +155 -78
  103. package/sdk/platform/Catalog/CatalogPlatformClient.js +561 -355
  104. package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +10 -12
  105. package/sdk/platform/Catalog/CatalogPlatformModel.js +10 -12
  106. package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +30 -0
  107. package/sdk/platform/Catalog/CatalogPlatformValidator.js +13 -0
  108. package/sdk/platform/Common/CommonPlatformClient.d.ts +5 -3
  109. package/sdk/platform/Common/CommonPlatformClient.js +13 -11
  110. package/sdk/platform/Common/CommonPlatformModel.d.ts +39 -64
  111. package/sdk/platform/Common/CommonPlatformModel.js +23 -57
  112. package/sdk/platform/Common/CommonPlatformValidator.d.ts +5 -10
  113. package/sdk/platform/Common/CommonPlatformValidator.js +3 -4
  114. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +370 -120
  115. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +2328 -888
  116. package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.d.ts +143 -24
  117. package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.js +179 -15
  118. package/sdk/platform/Communication/CommunicationPlatformClient.d.ts +2 -1
  119. package/sdk/platform/Communication/CommunicationPlatformClient.js +6 -5
  120. package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +386 -308
  121. package/sdk/platform/Communication/CommunicationPlatformModel.js +415 -355
  122. package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +38 -13
  123. package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +171 -57
  124. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +53 -1
  125. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +54 -0
  126. package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.d.ts +5 -1
  127. package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.js +7 -0
  128. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +96 -29
  129. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +311 -126
  130. package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.d.ts +5 -1
  131. package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.js +7 -0
  132. package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +36 -18
  133. package/sdk/platform/Configuration/ConfigurationPlatformClient.js +121 -86
  134. package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +13 -180
  135. package/sdk/platform/Configuration/ConfigurationPlatformModel.js +5 -113
  136. package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +162 -70
  137. package/sdk/platform/Content/ContentPlatformApplicationClient.js +528 -309
  138. package/sdk/platform/Content/ContentPlatformModel.d.ts +9 -198
  139. package/sdk/platform/Content/ContentPlatformModel.js +8 -231
  140. package/sdk/platform/Discount/DiscountPlatformClient.d.ts +48 -11
  141. package/sdk/platform/Discount/DiscountPlatformClient.js +142 -48
  142. package/sdk/platform/Discount/DiscountPlatformModel.d.ts +40 -1
  143. package/sdk/platform/Discount/DiscountPlatformModel.js +27 -0
  144. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +84 -18
  145. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +486 -53
  146. package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.d.ts +71 -7
  147. package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.js +81 -5
  148. package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +13 -18
  149. package/sdk/platform/FileStorage/FileStoragePlatformClient.js +58 -65
  150. package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +198 -71
  151. package/sdk/platform/FileStorage/FileStoragePlatformModel.js +212 -64
  152. package/sdk/platform/FileStorage/FileStoragePlatformValidator.d.ts +18 -10
  153. package/sdk/platform/FileStorage/FileStoragePlatformValidator.js +11 -6
  154. package/sdk/platform/Finance/FinancePlatformClient.d.ts +177 -40
  155. package/sdk/platform/Finance/FinancePlatformClient.js +1028 -132
  156. package/sdk/platform/Finance/FinancePlatformModel.d.ts +670 -22
  157. package/sdk/platform/Finance/FinancePlatformModel.js +809 -23
  158. package/sdk/platform/Finance/FinancePlatformValidator.d.ts +111 -1
  159. package/sdk/platform/Finance/FinancePlatformValidator.js +134 -0
  160. package/sdk/platform/Inventory/InventoryPlatformClient.d.ts +24 -12
  161. package/sdk/platform/Inventory/InventoryPlatformClient.js +94 -52
  162. package/sdk/platform/Lead/LeadPlatformApplicationClient.d.ts +27 -13
  163. package/sdk/platform/Lead/LeadPlatformApplicationClient.js +101 -55
  164. package/sdk/platform/Lead/LeadPlatformClient.d.ts +50 -39
  165. package/sdk/platform/Lead/LeadPlatformClient.js +171 -112
  166. package/sdk/platform/Lead/LeadPlatformModel.d.ts +32 -390
  167. package/sdk/platform/Lead/LeadPlatformModel.js +31 -214
  168. package/sdk/platform/Lead/LeadPlatformValidator.d.ts +33 -33
  169. package/sdk/platform/Lead/LeadPlatformValidator.js +23 -23
  170. package/sdk/platform/OAuthClient.js +6 -2
  171. package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +4 -2
  172. package/sdk/platform/Order/OrderPlatformApplicationClient.js +12 -10
  173. package/sdk/platform/Order/OrderPlatformClient.d.ts +165 -71
  174. package/sdk/platform/Order/OrderPlatformClient.js +738 -205
  175. package/sdk/platform/Order/OrderPlatformModel.d.ts +261 -3
  176. package/sdk/platform/Order/OrderPlatformModel.js +225 -2
  177. package/sdk/platform/Order/OrderPlatformValidator.d.ts +104 -3
  178. package/sdk/platform/Order/OrderPlatformValidator.js +85 -2
  179. package/sdk/platform/Partner/PartnerPlatformApplicationClient.d.ts +4 -22
  180. package/sdk/platform/Partner/PartnerPlatformApplicationClient.js +12 -159
  181. package/sdk/platform/Partner/PartnerPlatformApplicationValidator.d.ts +1 -30
  182. package/sdk/platform/Partner/PartnerPlatformApplicationValidator.js +0 -26
  183. package/sdk/platform/Partner/PartnerPlatformModel.d.ts +1 -690
  184. package/sdk/platform/Partner/PartnerPlatformModel.js +0 -809
  185. package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +167 -32
  186. package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +793 -145
  187. package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +91 -1
  188. package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +91 -0
  189. package/sdk/platform/Payment/PaymentPlatformClient.d.ts +20 -10
  190. package/sdk/platform/Payment/PaymentPlatformClient.js +68 -47
  191. package/sdk/platform/Payment/PaymentPlatformModel.d.ts +549 -7
  192. package/sdk/platform/Payment/PaymentPlatformModel.js +305 -6
  193. package/sdk/platform/PlatformAPIClient.d.ts +3 -3
  194. package/sdk/platform/PlatformAPIClient.js +2 -2
  195. package/sdk/platform/PlatformClient.d.ts +2 -2
  196. package/sdk/platform/PlatformClient.js +4 -4
  197. package/sdk/platform/Rewards/RewardsPlatformApplicationClient.d.ts +28 -12
  198. package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +90 -53
  199. package/sdk/platform/Rewards/RewardsPlatformModel.d.ts +1 -12
  200. package/sdk/platform/Rewards/RewardsPlatformModel.js +0 -14
  201. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.d.ts +62 -26
  202. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.js +210 -93
  203. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.d.ts +20 -11
  204. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.js +23 -11
  205. package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +36 -18
  206. package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +142 -78
  207. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +12 -3
  208. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +14 -2
  209. package/sdk/platform/Share/SharePlatformApplicationClient.d.ts +10 -26
  210. package/sdk/platform/Share/SharePlatformApplicationClient.js +36 -67
  211. package/sdk/platform/Share/SharePlatformModel.d.ts +4 -4
  212. package/sdk/platform/Share/SharePlatformModel.js +4 -4
  213. package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +127 -57
  214. package/sdk/platform/Theme/ThemePlatformApplicationClient.js +564 -189
  215. package/sdk/platform/Theme/ThemePlatformApplicationValidator.d.ts +63 -26
  216. package/sdk/platform/Theme/ThemePlatformApplicationValidator.js +62 -22
  217. package/sdk/platform/Theme/ThemePlatformClient.d.ts +37 -0
  218. package/sdk/platform/Theme/ThemePlatformClient.js +235 -0
  219. package/sdk/platform/Theme/ThemePlatformModel.d.ts +1167 -261
  220. package/sdk/platform/Theme/ThemePlatformModel.js +801 -244
  221. package/sdk/platform/Theme/ThemePlatformValidator.d.ts +32 -0
  222. package/sdk/platform/Theme/ThemePlatformValidator.js +38 -0
  223. package/sdk/platform/User/UserPlatformApplicationClient.d.ts +35 -17
  224. package/sdk/platform/User/UserPlatformApplicationClient.js +132 -73
  225. package/sdk/platform/User/UserPlatformApplicationValidator.d.ts +7 -0
  226. package/sdk/platform/User/UserPlatformApplicationValidator.js +3 -0
  227. package/sdk/platform/User/UserPlatformModel.d.ts +1 -738
  228. package/sdk/platform/User/UserPlatformModel.js +3 -899
  229. package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +120 -7
  230. package/sdk/platform/Webhook/WebhookPlatformClient.js +799 -41
  231. package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +476 -86
  232. package/sdk/platform/Webhook/WebhookPlatformModel.js +388 -89
  233. package/sdk/platform/Webhook/WebhookPlatformValidator.d.ts +96 -9
  234. package/sdk/platform/Webhook/WebhookPlatformValidator.js +117 -5
  235. package/sdk/public/Configuration/ConfigurationPublicClient.d.ts +5 -3
  236. package/sdk/public/Configuration/ConfigurationPublicClient.js +13 -11
  237. package/sdk/public/Configuration/ConfigurationPublicModel.d.ts +3 -106
  238. package/sdk/public/Configuration/ConfigurationPublicModel.js +2 -59
  239. package/sdk/public/Inventory/InventoryPublicClient.d.ts +12 -6
  240. package/sdk/public/Inventory/InventoryPublicClient.js +42 -27
  241. package/sdk/public/Partner/PartnerPublicClient.d.ts +22 -0
  242. package/sdk/public/Partner/PartnerPublicClient.js +110 -0
  243. package/sdk/public/Partner/PartnerPublicModel.d.ts +240 -0
  244. package/sdk/public/Partner/PartnerPublicModel.js +280 -0
  245. package/sdk/public/Partner/PartnerPublicValidator.d.ts +18 -0
  246. package/sdk/public/Partner/PartnerPublicValidator.js +19 -0
  247. package/sdk/public/PublicAPIClient.d.ts +14 -1
  248. package/sdk/public/PublicAPIClient.js +7 -1
  249. package/sdk/public/PublicClient.d.ts +2 -0
  250. package/sdk/public/PublicClient.js +4 -0
  251. package/sdk/public/Webhook/WebhookPublicClient.d.ts +5 -2
  252. package/sdk/public/Webhook/WebhookPublicClient.js +15 -9
  253. package/sdk/public/Webhook/WebhookPublicModel.d.ts +1 -191
  254. package/sdk/public/Webhook/WebhookPublicModel.js +0 -229
  255. package/sdk/public/index.d.ts +1 -0
  256. package/sdk/public/index.js +2 -0
  257. package/sdk/application/ApplicationModels.d.ts +0 -48
  258. package/sdk/application/ApplicationModels.js +0 -38
  259. package/sdk/platform/Partner/PartnerPlatformClient.d.ts +0 -106
  260. package/sdk/platform/Partner/PartnerPlatformClient.js +0 -878
  261. package/sdk/platform/Partner/PartnerPlatformValidator.d.ts +0 -208
  262. package/sdk/platform/Partner/PartnerPlatformValidator.js +0 -169
@@ -13,14 +13,95 @@ class Theme {
13
13
  }
14
14
 
15
15
  /**
16
- * @param {ThemePlatformApplicationValidator.AddToThemeLibraryParam} arg - Arg object
16
+ * @param {ThemePlatformApplicationValidator.AddThemeToApplicationParam} arg
17
+ * - Arg object
18
+ *
19
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
17
20
  * @param {import("../PlatformAPIClient").Options} - Options
18
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/).
25
+ */
26
+ async addThemeToApplication(
27
+ { body, requestHeaders } = { requestHeaders: {} },
28
+ { responseHeaders } = { responseHeaders: false }
29
+ ) {
30
+ const {
31
+ error,
32
+ } = ThemePlatformApplicationValidator.addThemeToApplication().validate(
33
+ {
34
+ body,
35
+ },
36
+ { abortEarly: false, allowUnknown: true }
37
+ );
38
+ if (error) {
39
+ return Promise.reject(new FDKClientValidationError(error));
40
+ }
41
+
42
+ // Showing warrnings if extra unknown parameters are found
43
+ const {
44
+ error: warrning,
45
+ } = ThemePlatformApplicationValidator.addThemeToApplication().validate(
46
+ {
47
+ body,
48
+ },
49
+ { abortEarly: false, allowUnknown: false }
50
+ );
51
+ if (warrning) {
52
+ Logger({
53
+ level: "WARN",
54
+ message: `Parameter Validation warrnings for platform > Theme > addThemeToApplication \n ${warrning}`,
55
+ });
56
+ }
57
+
58
+ const query_params = {};
59
+
60
+ const response = await PlatformAPIClient.execute(
61
+ this.config,
62
+ "post",
63
+ `/service/platform/theme/v2.0/company/${this.config.companyId}/application/${this.applicationId}/`,
64
+ query_params,
65
+ body,
66
+ requestHeaders,
67
+ { responseHeaders }
68
+ );
69
+
70
+ let responseData = response;
71
+ if (responseHeaders) {
72
+ responseData = response[0];
73
+ }
74
+
75
+ const {
76
+ error: res_error,
77
+ } = ThemePlatformModel.ThemesSchema().validate(responseData, {
78
+ abortEarly: false,
79
+ allowUnknown: false,
80
+ });
81
+
82
+ if (res_error) {
83
+ Logger({
84
+ level: "WARN",
85
+ message: `Response Validation Warnnings for platform > Theme > addThemeToApplication \n ${res_error}`,
86
+ });
87
+ }
88
+
89
+ return response;
90
+ }
91
+
92
+ /**
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
19
97
  * @name addToThemeLibrary
20
98
  * @summary: Add a theme to the theme library
21
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/).
22
100
  */
23
- async addToThemeLibrary({ body } = {}, { headers } = { headers: false }) {
101
+ async addToThemeLibrary(
102
+ { body, requestHeaders } = { requestHeaders: {} },
103
+ { responseHeaders } = { responseHeaders: false }
104
+ ) {
24
105
  const {
25
106
  error,
26
107
  } = ThemePlatformApplicationValidator.addToThemeLibrary().validate(
@@ -57,18 +138,18 @@ class Theme {
57
138
  `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/library`,
58
139
  query_params,
59
140
  body,
60
- undefined,
61
- { headers }
141
+ requestHeaders,
142
+ { responseHeaders }
62
143
  );
63
144
 
64
145
  let responseData = response;
65
- if (headers) {
146
+ if (responseHeaders) {
66
147
  responseData = response[0];
67
148
  }
68
149
 
69
150
  const {
70
151
  error: res_error,
71
- } = ThemePlatformModel.ThemesSchema().validate(responseData, {
152
+ } = ThemePlatformModel.DummyResponse().validate(responseData, {
72
153
  abortEarly: false,
73
154
  allowUnknown: false,
74
155
  });
@@ -85,16 +166,20 @@ class Theme {
85
166
 
86
167
  /**
87
168
  * @param {ThemePlatformApplicationValidator.ApplyThemeParam} arg - Arg object
169
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
88
170
  * @param {import("../PlatformAPIClient").Options} - Options
89
171
  * @returns {Promise<ThemePlatformModel.ThemesSchema>} - Success response
90
172
  * @name applyTheme
91
- * @summary: Apply a theme
92
- * @description: Use this API to apply a theme to the website. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/theme/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/).
93
175
  */
94
- async applyTheme({ body } = {}, { headers } = { headers: false }) {
176
+ async applyTheme(
177
+ { themeId, requestHeaders } = { requestHeaders: {} },
178
+ { responseHeaders } = { responseHeaders: false }
179
+ ) {
95
180
  const { error } = ThemePlatformApplicationValidator.applyTheme().validate(
96
181
  {
97
- body,
182
+ themeId,
98
183
  },
99
184
  { abortEarly: false, allowUnknown: true }
100
185
  );
@@ -107,7 +192,7 @@ class Theme {
107
192
  error: warrning,
108
193
  } = ThemePlatformApplicationValidator.applyTheme().validate(
109
194
  {
110
- body,
195
+ themeId,
111
196
  },
112
197
  { abortEarly: false, allowUnknown: false }
113
198
  );
@@ -122,16 +207,16 @@ class Theme {
122
207
 
123
208
  const response = await PlatformAPIClient.execute(
124
209
  this.config,
125
- "post",
126
- `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/apply`,
210
+ "patch",
211
+ `/service/platform/theme/v2.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/apply`,
127
212
  query_params,
128
- body,
129
213
  undefined,
130
- { headers }
214
+ requestHeaders,
215
+ { responseHeaders }
131
216
  );
132
217
 
133
218
  let responseData = response;
134
- if (headers) {
219
+ if (responseHeaders) {
135
220
  responseData = response[0];
136
221
  }
137
222
 
@@ -154,13 +239,17 @@ class Theme {
154
239
 
155
240
  /**
156
241
  * @param {ThemePlatformApplicationValidator.ArchiveThemeParam} arg - Arg object
242
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
157
243
  * @param {import("../PlatformAPIClient").Options} - Options
158
- * @returns {Promise<ThemePlatformModel.ThemesSchema>} - Success response
244
+ * @returns {Promise<ThemePlatformModel.DummyResponse>} - Success response
159
245
  * @name archiveTheme
160
246
  * @summary: Archive a theme
161
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/).
162
248
  */
163
- async archiveTheme({ themeId } = {}, { headers } = { headers: false }) {
249
+ async archiveTheme(
250
+ { themeId, requestHeaders } = { requestHeaders: {} },
251
+ { responseHeaders } = { responseHeaders: false }
252
+ ) {
164
253
  const { error } = ThemePlatformApplicationValidator.archiveTheme().validate(
165
254
  {
166
255
  themeId,
@@ -195,18 +284,18 @@ class Theme {
195
284
  `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/archive`,
196
285
  query_params,
197
286
  undefined,
198
- undefined,
199
- { headers }
287
+ requestHeaders,
288
+ { responseHeaders }
200
289
  );
201
290
 
202
291
  let responseData = response;
203
- if (headers) {
292
+ if (responseHeaders) {
204
293
  responseData = response[0];
205
294
  }
206
295
 
207
296
  const {
208
297
  error: res_error,
209
- } = ThemePlatformModel.ThemesSchema().validate(responseData, {
298
+ } = ThemePlatformModel.DummyResponse().validate(responseData, {
210
299
  abortEarly: false,
211
300
  allowUnknown: false,
212
301
  });
@@ -223,13 +312,17 @@ class Theme {
223
312
 
224
313
  /**
225
314
  * @param {ThemePlatformApplicationValidator.CreatePageParam} arg - Arg object
315
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
226
316
  * @param {import("../PlatformAPIClient").Options} - Options
227
317
  * @returns {Promise<ThemePlatformModel.AvailablePageSchema>} - Success response
228
318
  * @name createPage
229
319
  * @summary: Create a page
230
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/).
231
321
  */
232
- async createPage({ themeId, body } = {}, { headers } = { headers: false }) {
322
+ async createPage(
323
+ { themeId, body, requestHeaders } = { requestHeaders: {} },
324
+ { responseHeaders } = { responseHeaders: false }
325
+ ) {
233
326
  const { error } = ThemePlatformApplicationValidator.createPage().validate(
234
327
  {
235
328
  themeId,
@@ -266,12 +359,12 @@ class Theme {
266
359
  `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/page`,
267
360
  query_params,
268
361
  body,
269
- undefined,
270
- { headers }
362
+ requestHeaders,
363
+ { responseHeaders }
271
364
  );
272
365
 
273
366
  let responseData = response;
274
- if (headers) {
367
+ if (responseHeaders) {
275
368
  responseData = response[0];
276
369
  }
277
370
 
@@ -293,17 +386,22 @@ class Theme {
293
386
  }
294
387
 
295
388
  /**
296
- * @param {ThemePlatformApplicationValidator.CreateThemeParam} arg - Arg object
389
+ * @param {ThemePlatformApplicationValidator.DeletePageParam} arg - Arg object
390
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
297
391
  * @param {import("../PlatformAPIClient").Options} - Options
298
- * @returns {Promise<ThemePlatformModel.ThemesSchema>} - Success response
299
- * @name createTheme
300
- * @summary: Create a new theme
301
- * @description: Themes improve the look and appearance of a website. Use this API to create a theme. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/theme/createTheme/).
392
+ * @returns {Promise<ThemePlatformModel.AvailablePageSchema>} - Success response
393
+ * @name deletePage
394
+ * @summary: Deletes a page
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/).
302
396
  */
303
- async createTheme({ body } = {}, { headers } = { headers: false }) {
304
- const { error } = ThemePlatformApplicationValidator.createTheme().validate(
397
+ async deletePage(
398
+ { themeId, pageValue, requestHeaders } = { requestHeaders: {} },
399
+ { responseHeaders } = { responseHeaders: false }
400
+ ) {
401
+ const { error } = ThemePlatformApplicationValidator.deletePage().validate(
305
402
  {
306
- body,
403
+ themeId,
404
+ pageValue,
307
405
  },
308
406
  { abortEarly: false, allowUnknown: true }
309
407
  );
@@ -314,16 +412,17 @@ class Theme {
314
412
  // Showing warrnings if extra unknown parameters are found
315
413
  const {
316
414
  error: warrning,
317
- } = ThemePlatformApplicationValidator.createTheme().validate(
415
+ } = ThemePlatformApplicationValidator.deletePage().validate(
318
416
  {
319
- body,
417
+ themeId,
418
+ pageValue,
320
419
  },
321
420
  { abortEarly: false, allowUnknown: false }
322
421
  );
323
422
  if (warrning) {
324
423
  Logger({
325
424
  level: "WARN",
326
- message: `Parameter Validation warrnings for platform > Theme > createTheme \n ${warrning}`,
425
+ message: `Parameter Validation warrnings for platform > Theme > deletePage \n ${warrning}`,
327
426
  });
328
427
  }
329
428
 
@@ -331,22 +430,22 @@ class Theme {
331
430
 
332
431
  const response = await PlatformAPIClient.execute(
333
432
  this.config,
334
- "post",
335
- `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/`,
433
+ "delete",
434
+ `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/${pageValue}`,
336
435
  query_params,
337
- body,
338
436
  undefined,
339
- { headers }
437
+ requestHeaders,
438
+ { responseHeaders }
340
439
  );
341
440
 
342
441
  let responseData = response;
343
- if (headers) {
442
+ if (responseHeaders) {
344
443
  responseData = response[0];
345
444
  }
346
445
 
347
446
  const {
348
447
  error: res_error,
349
- } = ThemePlatformModel.ThemesSchema().validate(responseData, {
448
+ } = ThemePlatformModel.AvailablePageSchema().validate(responseData, {
350
449
  abortEarly: false,
351
450
  allowUnknown: false,
352
451
  });
@@ -354,7 +453,7 @@ class Theme {
354
453
  if (res_error) {
355
454
  Logger({
356
455
  level: "WARN",
357
- message: `Response Validation Warnnings for platform > Theme > createTheme \n ${res_error}`,
456
+ message: `Response Validation Warnnings for platform > Theme > deletePage \n ${res_error}`,
358
457
  });
359
458
  }
360
459
 
@@ -362,21 +461,21 @@ class Theme {
362
461
  }
363
462
 
364
463
  /**
365
- * @param {ThemePlatformApplicationValidator.DeletePageParam} arg - Arg object
464
+ * @param {ThemePlatformApplicationValidator.DeleteThemeParam} arg - Arg object
465
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
366
466
  * @param {import("../PlatformAPIClient").Options} - Options
367
- * @returns {Promise<ThemePlatformModel.AvailablePageSchema>} - Success response
368
- * @name deletePage
369
- * @summary: Deletes a page
370
- * @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/).
467
+ * @returns {Promise<ThemePlatformModel.ThemesSchema>} - Success response
468
+ * @name deleteTheme
469
+ * @summary: Delete a theme
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/).
371
471
  */
372
- async deletePage(
373
- { themeId, pageValue } = {},
374
- { headers } = { headers: false }
472
+ async deleteTheme(
473
+ { themeId, requestHeaders } = { requestHeaders: {} },
474
+ { responseHeaders } = { responseHeaders: false }
375
475
  ) {
376
- const { error } = ThemePlatformApplicationValidator.deletePage().validate(
476
+ const { error } = ThemePlatformApplicationValidator.deleteTheme().validate(
377
477
  {
378
478
  themeId,
379
- pageValue,
380
479
  },
381
480
  { abortEarly: false, allowUnknown: true }
382
481
  );
@@ -387,17 +486,16 @@ class Theme {
387
486
  // Showing warrnings if extra unknown parameters are found
388
487
  const {
389
488
  error: warrning,
390
- } = ThemePlatformApplicationValidator.deletePage().validate(
489
+ } = ThemePlatformApplicationValidator.deleteTheme().validate(
391
490
  {
392
491
  themeId,
393
- pageValue,
394
492
  },
395
493
  { abortEarly: false, allowUnknown: false }
396
494
  );
397
495
  if (warrning) {
398
496
  Logger({
399
497
  level: "WARN",
400
- message: `Parameter Validation warrnings for platform > Theme > deletePage \n ${warrning}`,
498
+ message: `Parameter Validation warrnings for platform > Theme > deleteTheme \n ${warrning}`,
401
499
  });
402
500
  }
403
501
 
@@ -406,21 +504,21 @@ class Theme {
406
504
  const response = await PlatformAPIClient.execute(
407
505
  this.config,
408
506
  "delete",
409
- `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/${pageValue}`,
507
+ `/service/platform/theme/v2.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}`,
410
508
  query_params,
411
509
  undefined,
412
- undefined,
413
- { headers }
510
+ requestHeaders,
511
+ { responseHeaders }
414
512
  );
415
513
 
416
514
  let responseData = response;
417
- if (headers) {
515
+ if (responseHeaders) {
418
516
  responseData = response[0];
419
517
  }
420
518
 
421
519
  const {
422
520
  error: res_error,
423
- } = ThemePlatformModel.AvailablePageSchema().validate(responseData, {
521
+ } = ThemePlatformModel.ThemesSchema().validate(responseData, {
424
522
  abortEarly: false,
425
523
  allowUnknown: false,
426
524
  });
@@ -428,7 +526,7 @@ class Theme {
428
526
  if (res_error) {
429
527
  Logger({
430
528
  level: "WARN",
431
- message: `Response Validation Warnnings for platform > Theme > deletePage \n ${res_error}`,
529
+ message: `Response Validation Warnnings for platform > Theme > deleteTheme \n ${res_error}`,
432
530
  });
433
531
  }
434
532
 
@@ -436,15 +534,21 @@ class Theme {
436
534
  }
437
535
 
438
536
  /**
439
- * @param {ThemePlatformApplicationValidator.DeleteThemeParam} arg - Arg object
537
+ * @param {ThemePlatformApplicationValidator.DuplicateThemeParam} arg - Arg object
538
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
440
539
  * @param {import("../PlatformAPIClient").Options} - Options
441
540
  * @returns {Promise<ThemePlatformModel.ThemesSchema>} - Success response
442
- * @name deleteTheme
443
- * @summary: Delete a theme
444
- * @description: Use this API to delete a theme from the theme library. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/theme/deleteTheme/).
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/).
445
544
  */
446
- async deleteTheme({ themeId } = {}, { headers } = { headers: false }) {
447
- const { error } = ThemePlatformApplicationValidator.deleteTheme().validate(
545
+ async duplicateTheme(
546
+ { themeId, requestHeaders } = { requestHeaders: {} },
547
+ { responseHeaders } = { responseHeaders: false }
548
+ ) {
549
+ const {
550
+ error,
551
+ } = ThemePlatformApplicationValidator.duplicateTheme().validate(
448
552
  {
449
553
  themeId,
450
554
  },
@@ -457,7 +561,7 @@ class Theme {
457
561
  // Showing warrnings if extra unknown parameters are found
458
562
  const {
459
563
  error: warrning,
460
- } = ThemePlatformApplicationValidator.deleteTheme().validate(
564
+ } = ThemePlatformApplicationValidator.duplicateTheme().validate(
461
565
  {
462
566
  themeId,
463
567
  },
@@ -466,7 +570,7 @@ class Theme {
466
570
  if (warrning) {
467
571
  Logger({
468
572
  level: "WARN",
469
- message: `Parameter Validation warrnings for platform > Theme > deleteTheme \n ${warrning}`,
573
+ message: `Parameter Validation warrnings for platform > Theme > duplicateTheme \n ${warrning}`,
470
574
  });
471
575
  }
472
576
 
@@ -474,16 +578,16 @@ class Theme {
474
578
 
475
579
  const response = await PlatformAPIClient.execute(
476
580
  this.config,
477
- "delete",
478
- `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}`,
581
+ "post",
582
+ `/service/platform/theme/v2.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/duplicate`,
479
583
  query_params,
480
584
  undefined,
481
- undefined,
482
- { headers }
585
+ requestHeaders,
586
+ { responseHeaders }
483
587
  );
484
588
 
485
589
  let responseData = response;
486
- if (headers) {
590
+ if (responseHeaders) {
487
591
  responseData = response[0];
488
592
  }
489
593
 
@@ -497,7 +601,7 @@ class Theme {
497
601
  if (res_error) {
498
602
  Logger({
499
603
  level: "WARN",
500
- message: `Response Validation Warnnings for platform > Theme > deleteTheme \n ${res_error}`,
604
+ message: `Response Validation Warnnings for platform > Theme > duplicateTheme \n ${res_error}`,
501
605
  });
502
606
  }
503
607
 
@@ -506,13 +610,17 @@ class Theme {
506
610
 
507
611
  /**
508
612
  * @param {ThemePlatformApplicationValidator.GetAllPagesParam} arg - Arg object
613
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
509
614
  * @param {import("../PlatformAPIClient").Options} - Options
510
615
  * @returns {Promise<ThemePlatformModel.AllAvailablePageSchema>} - Success response
511
616
  * @name getAllPages
512
617
  * @summary: Get all pages of a theme
513
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/).
514
619
  */
515
- async getAllPages({ themeId } = {}, { headers } = { headers: false }) {
620
+ async getAllPages(
621
+ { themeId, requestHeaders } = { requestHeaders: {} },
622
+ { responseHeaders } = { responseHeaders: false }
623
+ ) {
516
624
  const { error } = ThemePlatformApplicationValidator.getAllPages().validate(
517
625
  {
518
626
  themeId,
@@ -547,12 +655,12 @@ class Theme {
547
655
  `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/page`,
548
656
  query_params,
549
657
  undefined,
550
- undefined,
551
- { headers }
658
+ requestHeaders,
659
+ { responseHeaders }
552
660
  );
553
661
 
554
662
  let responseData = response;
555
- if (headers) {
663
+ if (responseHeaders) {
556
664
  responseData = response[0];
557
665
  }
558
666
 
@@ -574,13 +682,159 @@ class Theme {
574
682
  }
575
683
 
576
684
  /**
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/).
694
+ */
695
+ async getApplicationThemes(
696
+ { requestHeaders } = { requestHeaders: {} },
697
+ { responseHeaders } = { responseHeaders: false }
698
+ ) {
699
+ const {
700
+ error,
701
+ } = ThemePlatformApplicationValidator.getApplicationThemes().validate(
702
+ {},
703
+ { abortEarly: false, allowUnknown: true }
704
+ );
705
+ if (error) {
706
+ return Promise.reject(new FDKClientValidationError(error));
707
+ }
708
+
709
+ // Showing warrnings if extra unknown parameters are found
710
+ const {
711
+ error: warrning,
712
+ } = ThemePlatformApplicationValidator.getApplicationThemes().validate(
713
+ {},
714
+ { abortEarly: false, allowUnknown: false }
715
+ );
716
+ if (warrning) {
717
+ Logger({
718
+ level: "WARN",
719
+ message: `Parameter Validation warrnings for platform > Theme > getApplicationThemes \n ${warrning}`,
720
+ });
721
+ }
722
+
723
+ const query_params = {};
724
+
725
+ const response = await PlatformAPIClient.execute(
726
+ this.config,
727
+ "get",
728
+ `/service/platform/theme/v2.0/company/${this.config.companyId}/application/${this.applicationId}/themes`,
729
+ query_params,
730
+ undefined,
731
+ requestHeaders,
732
+ { responseHeaders }
733
+ );
734
+
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, {
811
+ abortEarly: false,
812
+ allowUnknown: false,
813
+ });
814
+
815
+ if (res_error) {
816
+ Logger({
817
+ level: "WARN",
818
+ message: `Response Validation Warnnings for platform > Theme > getApplicationThemesCount \n ${res_error}`,
819
+ });
820
+ }
821
+
822
+ return response;
823
+ }
824
+
825
+ /**
826
+ * @param {ThemePlatformApplicationValidator.GetAppliedThemeParam} arg - Arg object
827
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
577
828
  * @param {import("../PlatformAPIClient").Options} - Options
578
829
  * @returns {Promise<ThemePlatformModel.ThemesSchema>} - Success response
579
830
  * @name getAppliedTheme
580
- * @summary: Get the applied theme
581
- * @description: Use this API to retrieve the theme that is currently applied to the website along with its details. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/theme/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/).
582
833
  */
583
- async getAppliedTheme({ headers } = { headers: false }) {
834
+ async getAppliedTheme(
835
+ { requestHeaders } = { requestHeaders: {} },
836
+ { responseHeaders } = { responseHeaders: false }
837
+ ) {
584
838
  const {
585
839
  error,
586
840
  } = ThemePlatformApplicationValidator.getAppliedTheme().validate(
@@ -610,15 +864,15 @@ class Theme {
610
864
  const response = await PlatformAPIClient.execute(
611
865
  this.config,
612
866
  "get",
613
- `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/`,
867
+ `/service/platform/theme/v2.0/company/${this.config.companyId}/application/${this.applicationId}`,
614
868
  query_params,
615
869
  undefined,
616
- undefined,
617
- { headers }
870
+ requestHeaders,
871
+ { responseHeaders }
618
872
  );
619
873
 
620
874
  let responseData = response;
621
- if (headers) {
875
+ if (responseHeaders) {
622
876
  responseData = response[0];
623
877
  }
624
878
 
@@ -640,13 +894,18 @@ class Theme {
640
894
  }
641
895
 
642
896
  /**
897
+ * @param {ThemePlatformApplicationValidator.GetFontsParam} arg - Arg object
898
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
643
899
  * @param {import("../PlatformAPIClient").Options} - Options
644
900
  * @returns {Promise<ThemePlatformModel.FontsSchema>} - Success response
645
901
  * @name getFonts
646
902
  * @summary: Get all the supported fonts in a theme
647
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/).
648
904
  */
649
- async getFonts({ headers } = { headers: false }) {
905
+ async getFonts(
906
+ { requestHeaders } = { requestHeaders: {} },
907
+ { responseHeaders } = { responseHeaders: false }
908
+ ) {
650
909
  const { error } = ThemePlatformApplicationValidator.getFonts().validate(
651
910
  {},
652
911
  { abortEarly: false, allowUnknown: true }
@@ -677,12 +936,12 @@ class Theme {
677
936
  `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/fonts`,
678
937
  query_params,
679
938
  undefined,
680
- undefined,
681
- { headers }
939
+ requestHeaders,
940
+ { responseHeaders }
682
941
  );
683
942
 
684
943
  let responseData = response;
685
- if (headers) {
944
+ if (responseHeaders) {
686
945
  responseData = response[0];
687
946
  }
688
947
 
@@ -705,13 +964,17 @@ class Theme {
705
964
 
706
965
  /**
707
966
  * @param {ThemePlatformApplicationValidator.GetPageParam} arg - Arg object
967
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
708
968
  * @param {import("../PlatformAPIClient").Options} - Options
709
969
  * @returns {Promise<ThemePlatformModel.AvailablePageSchema>} - Success response
710
970
  * @name getPage
711
971
  * @summary: Get page of a theme
712
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/).
713
973
  */
714
- async getPage({ themeId, pageValue } = {}, { headers } = { headers: false }) {
974
+ async getPage(
975
+ { themeId, pageValue, requestHeaders } = { requestHeaders: {} },
976
+ { responseHeaders } = { responseHeaders: false }
977
+ ) {
715
978
  const { error } = ThemePlatformApplicationValidator.getPage().validate(
716
979
  {
717
980
  themeId,
@@ -748,12 +1011,12 @@ class Theme {
748
1011
  `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/${pageValue}`,
749
1012
  query_params,
750
1013
  undefined,
751
- undefined,
752
- { headers }
1014
+ requestHeaders,
1015
+ { responseHeaders }
753
1016
  );
754
1017
 
755
1018
  let responseData = response;
756
- if (headers) {
1019
+ if (responseHeaders) {
757
1020
  responseData = response[0];
758
1021
  }
759
1022
 
@@ -776,16 +1039,16 @@ class Theme {
776
1039
 
777
1040
  /**
778
1041
  * @param {ThemePlatformApplicationValidator.GetPublicThemesParam} arg - Arg object
1042
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
779
1043
  * @param {import("../PlatformAPIClient").Options} - Options
780
- * @returns {Promise<ThemePlatformModel.ThemesListingResponseSchema>} -
781
- * Success response
1044
+ * @returns {Promise<ThemePlatformModel.DummyResponse>} - Success response
782
1045
  * @name getPublicThemes
783
1046
  * @summary: Get all public themes
784
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/).
785
1048
  */
786
1049
  async getPublicThemes(
787
- { pageSize, pageNo } = {},
788
- { headers } = { headers: false }
1050
+ { pageSize, pageNo, requestHeaders } = { requestHeaders: {} },
1051
+ { responseHeaders } = { responseHeaders: false }
789
1052
  ) {
790
1053
  const {
791
1054
  error,
@@ -827,21 +1090,21 @@ class Theme {
827
1090
  `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/list/public`,
828
1091
  query_params,
829
1092
  undefined,
830
- undefined,
831
- { headers }
1093
+ requestHeaders,
1094
+ { responseHeaders }
832
1095
  );
833
1096
 
834
1097
  let responseData = response;
835
- if (headers) {
1098
+ if (responseHeaders) {
836
1099
  responseData = response[0];
837
1100
  }
838
1101
 
839
1102
  const {
840
1103
  error: res_error,
841
- } = ThemePlatformModel.ThemesListingResponseSchema().validate(
842
- responseData,
843
- { abortEarly: false, allowUnknown: false }
844
- );
1104
+ } = ThemePlatformModel.DummyResponse().validate(responseData, {
1105
+ abortEarly: false,
1106
+ allowUnknown: false,
1107
+ });
845
1108
 
846
1109
  if (res_error) {
847
1110
  Logger({
@@ -855,13 +1118,17 @@ class Theme {
855
1118
 
856
1119
  /**
857
1120
  * @param {ThemePlatformApplicationValidator.GetThemeByIdParam} arg - Arg object
1121
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
858
1122
  * @param {import("../PlatformAPIClient").Options} - Options
859
1123
  * @returns {Promise<ThemePlatformModel.ThemesSchema>} - Success response
860
1124
  * @name getThemeById
861
- * @summary: Gets theme by id
862
- * @description: Use this API to retrieve the details of a specific theme by using its ID. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/theme/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/).
863
1127
  */
864
- async getThemeById({ themeId } = {}, { headers } = { headers: false }) {
1128
+ async getThemeById(
1129
+ { themeId, requestHeaders } = { requestHeaders: {} },
1130
+ { responseHeaders } = { responseHeaders: false }
1131
+ ) {
865
1132
  const { error } = ThemePlatformApplicationValidator.getThemeById().validate(
866
1133
  {
867
1134
  themeId,
@@ -893,15 +1160,15 @@ class Theme {
893
1160
  const response = await PlatformAPIClient.execute(
894
1161
  this.config,
895
1162
  "get",
896
- `/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}`,
897
1164
  query_params,
898
1165
  undefined,
899
- undefined,
900
- { headers }
1166
+ requestHeaders,
1167
+ { responseHeaders }
901
1168
  );
902
1169
 
903
1170
  let responseData = response;
904
- if (headers) {
1171
+ if (responseHeaders) {
905
1172
  responseData = response[0];
906
1173
  }
907
1174
 
@@ -924,13 +1191,17 @@ class Theme {
924
1191
 
925
1192
  /**
926
1193
  * @param {ThemePlatformApplicationValidator.GetThemeForPreviewParam} arg - Arg object
1194
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
927
1195
  * @param {import("../PlatformAPIClient").Options} - Options
928
1196
  * @returns {Promise<ThemePlatformModel.ThemesSchema>} - Success response
929
1197
  * @name getThemeForPreview
930
- * @summary: Get a theme preview
931
- * @description: A theme can be previewed before applying it. Use this API to retrieve the theme preview by using its ID. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/theme/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/).
932
1200
  */
933
- async getThemeForPreview({ themeId } = {}, { headers } = { headers: false }) {
1201
+ async getThemeForPreview(
1202
+ { themeId, requestHeaders } = { requestHeaders: {} },
1203
+ { responseHeaders } = { responseHeaders: false }
1204
+ ) {
934
1205
  const {
935
1206
  error,
936
1207
  } = ThemePlatformApplicationValidator.getThemeForPreview().validate(
@@ -964,15 +1235,15 @@ class Theme {
964
1235
  const response = await PlatformAPIClient.execute(
965
1236
  this.config,
966
1237
  "get",
967
- `/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`,
968
1239
  query_params,
969
1240
  undefined,
970
- undefined,
971
- { headers }
1241
+ requestHeaders,
1242
+ { responseHeaders }
972
1243
  );
973
1244
 
974
1245
  let responseData = response;
975
- if (headers) {
1246
+ if (responseHeaders) {
976
1247
  responseData = response[0];
977
1248
  }
978
1249
 
@@ -997,6 +1268,7 @@ class Theme {
997
1268
  * @param {ThemePlatformApplicationValidator.GetThemeLastModifiedParam} arg
998
1269
  * - Arg object
999
1270
  *
1271
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1000
1272
  * @param {import("../PlatformAPIClient").Options} - Options
1001
1273
  * @returns {Promise<any>} - Success response
1002
1274
  * @name getThemeLastModified
@@ -1004,8 +1276,8 @@ class Theme {
1004
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/).
1005
1277
  */
1006
1278
  async getThemeLastModified(
1007
- { themeId } = {},
1008
- { headers } = { headers: false }
1279
+ { themeId, requestHeaders } = { requestHeaders: {} },
1280
+ { responseHeaders } = { responseHeaders: false }
1009
1281
  ) {
1010
1282
  const {
1011
1283
  error,
@@ -1040,15 +1312,15 @@ class Theme {
1040
1312
  const response = await PlatformAPIClient.execute(
1041
1313
  this.config,
1042
1314
  "head",
1043
- `/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`,
1044
1316
  query_params,
1045
1317
  undefined,
1046
- undefined,
1047
- { headers }
1318
+ requestHeaders,
1319
+ { responseHeaders }
1048
1320
  );
1049
1321
 
1050
1322
  let responseData = response;
1051
- if (headers) {
1323
+ if (responseHeaders) {
1052
1324
  responseData = response[0];
1053
1325
  }
1054
1326
 
@@ -1068,16 +1340,16 @@ class Theme {
1068
1340
 
1069
1341
  /**
1070
1342
  * @param {ThemePlatformApplicationValidator.GetThemeLibraryParam} arg - Arg object
1343
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1071
1344
  * @param {import("../PlatformAPIClient").Options} - Options
1072
- * @returns {Promise<ThemePlatformModel.ThemesListingResponseSchema>} -
1073
- * Success response
1345
+ * @returns {Promise<ThemePlatformModel.DummyResponse>} - Success response
1074
1346
  * @name getThemeLibrary
1075
1347
  * @summary: Get a list of themes from the theme library
1076
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/).
1077
1349
  */
1078
1350
  async getThemeLibrary(
1079
- { pageSize, pageNo } = {},
1080
- { headers } = { headers: false }
1351
+ { pageSize, pageNo, requestHeaders } = { requestHeaders: {} },
1352
+ { responseHeaders } = { responseHeaders: false }
1081
1353
  ) {
1082
1354
  const {
1083
1355
  error,
@@ -1119,21 +1391,21 @@ class Theme {
1119
1391
  `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/library`,
1120
1392
  query_params,
1121
1393
  undefined,
1122
- undefined,
1123
- { headers }
1394
+ requestHeaders,
1395
+ { responseHeaders }
1124
1396
  );
1125
1397
 
1126
1398
  let responseData = response;
1127
- if (headers) {
1399
+ if (responseHeaders) {
1128
1400
  responseData = response[0];
1129
1401
  }
1130
1402
 
1131
1403
  const {
1132
1404
  error: res_error,
1133
- } = ThemePlatformModel.ThemesListingResponseSchema().validate(
1134
- responseData,
1135
- { abortEarly: false, allowUnknown: false }
1136
- );
1405
+ } = ThemePlatformModel.DummyResponse().validate(responseData, {
1406
+ abortEarly: false,
1407
+ allowUnknown: false,
1408
+ });
1137
1409
 
1138
1410
  if (res_error) {
1139
1411
  Logger({
@@ -1147,13 +1419,17 @@ class Theme {
1147
1419
 
1148
1420
  /**
1149
1421
  * @param {ThemePlatformApplicationValidator.IsUpgradableParam} arg - Arg object
1422
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1150
1423
  * @param {import("../PlatformAPIClient").Options} - Options
1151
- * @returns {Promise<ThemePlatformModel.UpgradableThemeSchema>} - Success response
1424
+ * @returns {Promise<ThemePlatformModel.ThemeUpgradableResponse>} - Success response
1152
1425
  * @name isUpgradable
1153
- * @summary: Checks if theme is upgradable
1154
- * @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. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/theme/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/).
1155
1428
  */
1156
- async isUpgradable({ themeId } = {}, { headers } = { headers: false }) {
1429
+ async isUpgradable(
1430
+ { themeId, requestHeaders } = { requestHeaders: {} },
1431
+ { responseHeaders } = { responseHeaders: false }
1432
+ ) {
1157
1433
  const { error } = ThemePlatformApplicationValidator.isUpgradable().validate(
1158
1434
  {
1159
1435
  themeId,
@@ -1185,21 +1461,21 @@ class Theme {
1185
1461
  const response = await PlatformAPIClient.execute(
1186
1462
  this.config,
1187
1463
  "get",
1188
- `/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`,
1189
1465
  query_params,
1190
1466
  undefined,
1191
- undefined,
1192
- { headers }
1467
+ requestHeaders,
1468
+ { responseHeaders }
1193
1469
  );
1194
1470
 
1195
1471
  let responseData = response;
1196
- if (headers) {
1472
+ if (responseHeaders) {
1197
1473
  responseData = response[0];
1198
1474
  }
1199
1475
 
1200
1476
  const {
1201
1477
  error: res_error,
1202
- } = ThemePlatformModel.UpgradableThemeSchema().validate(responseData, {
1478
+ } = ThemePlatformModel.ThemeUpgradableResponse().validate(responseData, {
1203
1479
  abortEarly: false,
1204
1480
  allowUnknown: false,
1205
1481
  });
@@ -1216,13 +1492,17 @@ class Theme {
1216
1492
 
1217
1493
  /**
1218
1494
  * @param {ThemePlatformApplicationValidator.PublishThemeParam} arg - Arg object
1495
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1219
1496
  * @param {import("../PlatformAPIClient").Options} - Options
1220
- * @returns {Promise<ThemePlatformModel.ThemesSchema>} - Success response
1497
+ * @returns {Promise<ThemePlatformModel.DummyResponse>} - Success response
1221
1498
  * @name publishTheme
1222
1499
  * @summary: Publish a theme
1223
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/).
1224
1501
  */
1225
- async publishTheme({ themeId } = {}, { headers } = { headers: false }) {
1502
+ async publishTheme(
1503
+ { themeId, requestHeaders } = { requestHeaders: {} },
1504
+ { responseHeaders } = { responseHeaders: false }
1505
+ ) {
1226
1506
  const { error } = ThemePlatformApplicationValidator.publishTheme().validate(
1227
1507
  {
1228
1508
  themeId,
@@ -1257,18 +1537,18 @@ class Theme {
1257
1537
  `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/publish`,
1258
1538
  query_params,
1259
1539
  undefined,
1260
- undefined,
1261
- { headers }
1540
+ requestHeaders,
1541
+ { responseHeaders }
1262
1542
  );
1263
1543
 
1264
1544
  let responseData = response;
1265
- if (headers) {
1545
+ if (responseHeaders) {
1266
1546
  responseData = response[0];
1267
1547
  }
1268
1548
 
1269
1549
  const {
1270
1550
  error: res_error,
1271
- } = ThemePlatformModel.ThemesSchema().validate(responseData, {
1551
+ } = ThemePlatformModel.DummyResponse().validate(responseData, {
1272
1552
  abortEarly: false,
1273
1553
  allowUnknown: false,
1274
1554
  });
@@ -1285,13 +1565,17 @@ class Theme {
1285
1565
 
1286
1566
  /**
1287
1567
  * @param {ThemePlatformApplicationValidator.UnarchiveThemeParam} arg - Arg object
1568
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1288
1569
  * @param {import("../PlatformAPIClient").Options} - Options
1289
- * @returns {Promise<ThemePlatformModel.ThemesSchema>} - Success response
1570
+ * @returns {Promise<ThemePlatformModel.DummyResponse>} - Success response
1290
1571
  * @name unarchiveTheme
1291
1572
  * @summary: Unarchive a theme
1292
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/).
1293
1574
  */
1294
- async unarchiveTheme({ themeId } = {}, { headers } = { headers: false }) {
1575
+ async unarchiveTheme(
1576
+ { themeId, requestHeaders } = { requestHeaders: {} },
1577
+ { responseHeaders } = { responseHeaders: false }
1578
+ ) {
1295
1579
  const {
1296
1580
  error,
1297
1581
  } = ThemePlatformApplicationValidator.unarchiveTheme().validate(
@@ -1328,18 +1612,18 @@ class Theme {
1328
1612
  `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/unarchive`,
1329
1613
  query_params,
1330
1614
  undefined,
1331
- undefined,
1332
- { headers }
1615
+ requestHeaders,
1616
+ { responseHeaders }
1333
1617
  );
1334
1618
 
1335
1619
  let responseData = response;
1336
- if (headers) {
1620
+ if (responseHeaders) {
1337
1621
  responseData = response[0];
1338
1622
  }
1339
1623
 
1340
1624
  const {
1341
1625
  error: res_error,
1342
- } = ThemePlatformModel.ThemesSchema().validate(responseData, {
1626
+ } = ThemePlatformModel.DummyResponse().validate(responseData, {
1343
1627
  abortEarly: false,
1344
1628
  allowUnknown: false,
1345
1629
  });
@@ -1356,13 +1640,17 @@ class Theme {
1356
1640
 
1357
1641
  /**
1358
1642
  * @param {ThemePlatformApplicationValidator.UnpublishThemeParam} arg - Arg object
1643
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1359
1644
  * @param {import("../PlatformAPIClient").Options} - Options
1360
- * @returns {Promise<ThemePlatformModel.ThemesSchema>} - Success response
1645
+ * @returns {Promise<ThemePlatformModel.DummyResponse>} - Success response
1361
1646
  * @name unpublishTheme
1362
1647
  * @summary: Unpublish a theme
1363
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/).
1364
1649
  */
1365
- async unpublishTheme({ themeId } = {}, { headers } = { headers: false }) {
1650
+ async unpublishTheme(
1651
+ { themeId, requestHeaders } = { requestHeaders: {} },
1652
+ { responseHeaders } = { responseHeaders: false }
1653
+ ) {
1366
1654
  const {
1367
1655
  error,
1368
1656
  } = ThemePlatformApplicationValidator.unpublishTheme().validate(
@@ -1399,18 +1687,18 @@ class Theme {
1399
1687
  `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/unpublish`,
1400
1688
  query_params,
1401
1689
  undefined,
1402
- undefined,
1403
- { headers }
1690
+ requestHeaders,
1691
+ { responseHeaders }
1404
1692
  );
1405
1693
 
1406
1694
  let responseData = response;
1407
- if (headers) {
1695
+ if (responseHeaders) {
1408
1696
  responseData = response[0];
1409
1697
  }
1410
1698
 
1411
1699
  const {
1412
1700
  error: res_error,
1413
- } = ThemePlatformModel.ThemesSchema().validate(responseData, {
1701
+ } = ThemePlatformModel.DummyResponse().validate(responseData, {
1414
1702
  abortEarly: false,
1415
1703
  allowUnknown: false,
1416
1704
  });
@@ -1429,6 +1717,7 @@ class Theme {
1429
1717
  * @param {ThemePlatformApplicationValidator.UpdateMultiplePagesParam} arg
1430
1718
  * - Arg object
1431
1719
  *
1720
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1432
1721
  * @param {import("../PlatformAPIClient").Options} - Options
1433
1722
  * @returns {Promise<ThemePlatformModel.AllAvailablePageSchema>} - Success response
1434
1723
  * @name updateMultiplePages
@@ -1436,8 +1725,8 @@ class Theme {
1436
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/).
1437
1726
  */
1438
1727
  async updateMultiplePages(
1439
- { themeId, body } = {},
1440
- { headers } = { headers: false }
1728
+ { themeId, body, requestHeaders } = { requestHeaders: {} },
1729
+ { responseHeaders } = { responseHeaders: false }
1441
1730
  ) {
1442
1731
  const {
1443
1732
  error,
@@ -1477,12 +1766,12 @@ class Theme {
1477
1766
  `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/page`,
1478
1767
  query_params,
1479
1768
  body,
1480
- undefined,
1481
- { headers }
1769
+ requestHeaders,
1770
+ { responseHeaders }
1482
1771
  );
1483
1772
 
1484
1773
  let responseData = response;
1485
- if (headers) {
1774
+ if (responseHeaders) {
1486
1775
  responseData = response[0];
1487
1776
  }
1488
1777
 
@@ -1505,6 +1794,7 @@ class Theme {
1505
1794
 
1506
1795
  /**
1507
1796
  * @param {ThemePlatformApplicationValidator.UpdatePageParam} arg - Arg object
1797
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1508
1798
  * @param {import("../PlatformAPIClient").Options} - Options
1509
1799
  * @returns {Promise<ThemePlatformModel.AvailablePageSchema>} - Success response
1510
1800
  * @name updatePage
@@ -1512,8 +1802,8 @@ class Theme {
1512
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/).
1513
1803
  */
1514
1804
  async updatePage(
1515
- { themeId, pageValue, body } = {},
1516
- { headers } = { headers: false }
1805
+ { themeId, pageValue, body, requestHeaders } = { requestHeaders: {} },
1806
+ { responseHeaders } = { responseHeaders: false }
1517
1807
  ) {
1518
1808
  const { error } = ThemePlatformApplicationValidator.updatePage().validate(
1519
1809
  {
@@ -1553,12 +1843,12 @@ class Theme {
1553
1843
  `/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/${pageValue}`,
1554
1844
  query_params,
1555
1845
  body,
1556
- undefined,
1557
- { headers }
1846
+ requestHeaders,
1847
+ { responseHeaders }
1558
1848
  );
1559
1849
 
1560
1850
  let responseData = response;
1561
- if (headers) {
1851
+ if (responseHeaders) {
1562
1852
  responseData = response[0];
1563
1853
  }
1564
1854
 
@@ -1581,13 +1871,17 @@ class Theme {
1581
1871
 
1582
1872
  /**
1583
1873
  * @param {ThemePlatformApplicationValidator.UpdateThemeParam} arg - Arg object
1874
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1584
1875
  * @param {import("../PlatformAPIClient").Options} - Options
1585
1876
  * @returns {Promise<ThemePlatformModel.ThemesSchema>} - Success response
1586
1877
  * @name updateTheme
1587
- * @summary: Update a theme
1588
- * @description: Use this API to edit an existing theme. You can customize the website font, sections, images, styles, and many more. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/theme/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/).
1589
1880
  */
1590
- async updateTheme({ themeId, body } = {}, { headers } = { headers: false }) {
1881
+ async updateTheme(
1882
+ { themeId, body, requestHeaders } = { requestHeaders: {} },
1883
+ { responseHeaders } = { responseHeaders: false }
1884
+ ) {
1591
1885
  const { error } = ThemePlatformApplicationValidator.updateTheme().validate(
1592
1886
  {
1593
1887
  themeId,
@@ -1621,15 +1915,15 @@ class Theme {
1621
1915
  const response = await PlatformAPIClient.execute(
1622
1916
  this.config,
1623
1917
  "put",
1624
- `/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}`,
1625
1919
  query_params,
1626
1920
  body,
1627
- undefined,
1628
- { headers }
1921
+ requestHeaders,
1922
+ { responseHeaders }
1629
1923
  );
1630
1924
 
1631
1925
  let responseData = response;
1632
- if (headers) {
1926
+ if (responseHeaders) {
1633
1927
  responseData = response[0];
1634
1928
  }
1635
1929
 
@@ -1650,15 +1944,96 @@ class Theme {
1650
1944
  return response;
1651
1945
  }
1652
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`,
1996
+ query_params,
1997
+ body,
1998
+ requestHeaders,
1999
+ { responseHeaders }
2000
+ );
2001
+
2002
+ let responseData = response;
2003
+ if (responseHeaders) {
2004
+ responseData = response[0];
2005
+ }
2006
+
2007
+ const {
2008
+ error: res_error,
2009
+ } = ThemePlatformModel.ThemesSchema().validate(responseData, {
2010
+ abortEarly: false,
2011
+ allowUnknown: false,
2012
+ });
2013
+
2014
+ if (res_error) {
2015
+ Logger({
2016
+ level: "WARN",
2017
+ message: `Response Validation Warnnings for platform > Theme > updateThemeName \n ${res_error}`,
2018
+ });
2019
+ }
2020
+
2021
+ return response;
2022
+ }
2023
+
1653
2024
  /**
1654
2025
  * @param {ThemePlatformApplicationValidator.UpgradeThemeParam} arg - Arg object
2026
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1655
2027
  * @param {import("../PlatformAPIClient").Options} - Options
1656
2028
  * @returns {Promise<ThemePlatformModel.ThemesSchema>} - Success response
1657
2029
  * @name upgradeTheme
1658
- * @summary: Upgrade a theme
1659
- * @description: Use this API to upgrade the current theme to its latest version. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/theme/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/).
1660
2032
  */
1661
- async upgradeTheme({ themeId } = {}, { headers } = { headers: false }) {
2033
+ async upgradeTheme(
2034
+ { themeId, requestHeaders } = { requestHeaders: {} },
2035
+ { responseHeaders } = { responseHeaders: false }
2036
+ ) {
1662
2037
  const { error } = ThemePlatformApplicationValidator.upgradeTheme().validate(
1663
2038
  {
1664
2039
  themeId,
@@ -1690,15 +2065,15 @@ class Theme {
1690
2065
  const response = await PlatformAPIClient.execute(
1691
2066
  this.config,
1692
2067
  "put",
1693
- `/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`,
1694
2069
  query_params,
1695
2070
  undefined,
1696
- undefined,
1697
- { headers }
2071
+ requestHeaders,
2072
+ { responseHeaders }
1698
2073
  );
1699
2074
 
1700
2075
  let responseData = response;
1701
- if (headers) {
2076
+ if (responseHeaders) {
1702
2077
  responseData = response[0];
1703
2078
  }
1704
2079