@gofynd/fdk-client-javascript 1.4.15-beta.13 → 1.4.15-beta.15

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 (278) hide show
  1. package/README.md +23 -26
  2. package/package.json +5 -1
  3. package/sdk/application/ApplicationClient.d.ts +5 -6
  4. package/sdk/application/ApplicationClient.js +24 -20
  5. package/sdk/application/Cart/CartApplicationClient.d.ts +133 -83
  6. package/sdk/application/Cart/CartApplicationClient.js +444 -76
  7. package/sdk/application/Catalog/CatalogApplicationClient.d.ts +132 -114
  8. package/sdk/application/Catalog/CatalogApplicationClient.js +209 -126
  9. package/sdk/application/Common/CommonApplicationClient.d.ts +4 -4
  10. package/sdk/application/Common/CommonApplicationClient.js +4 -4
  11. package/sdk/application/Communication/CommunicationApplicationClient.d.ts +3 -3
  12. package/sdk/application/Communication/CommunicationApplicationClient.js +3 -3
  13. package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +58 -36
  14. package/sdk/application/Configuration/ConfigurationApplicationClient.js +73 -29
  15. package/sdk/application/Content/ContentApplicationClient.d.ts +95 -66
  16. package/sdk/application/Content/ContentApplicationClient.js +274 -111
  17. package/sdk/application/FileStorage/FileStorageApplicationClient.d.ts +11 -11
  18. package/sdk/application/FileStorage/FileStorageApplicationClient.js +10 -10
  19. package/sdk/application/Finance/FinanceApplicationClient.d.ts +29 -0
  20. package/sdk/application/Finance/FinanceApplicationClient.js +111 -0
  21. package/sdk/application/Lead/LeadApplicationClient.d.ts +7 -7
  22. package/sdk/application/Lead/LeadApplicationClient.js +6 -6
  23. package/sdk/application/Logistic/LogisticApplicationClient.d.ts +37 -57
  24. package/sdk/application/Logistic/LogisticApplicationClient.js +117 -180
  25. package/sdk/application/Order/OrderApplicationClient.d.ts +63 -21
  26. package/sdk/application/Order/OrderApplicationClient.js +217 -17
  27. package/sdk/application/Payment/PaymentApplicationClient.d.ts +179 -149
  28. package/sdk/application/Payment/PaymentApplicationClient.js +301 -167
  29. package/sdk/application/Share/ShareApplicationClient.d.ts +7 -7
  30. package/sdk/application/Share/ShareApplicationClient.js +7 -7
  31. package/sdk/application/Theme/ThemeApplicationClient.d.ts +7 -7
  32. package/sdk/application/Theme/ThemeApplicationClient.js +10 -6
  33. package/sdk/application/User/UserApplicationClient.d.ts +103 -53
  34. package/sdk/application/User/UserApplicationClient.js +308 -49
  35. package/sdk/common/AxiosHelper.js +11 -4
  36. package/sdk/common/Constant.d.ts +27 -4
  37. package/sdk/common/Constant.js +33 -6
  38. package/sdk/common/utils.d.ts +10 -0
  39. package/sdk/common/utils.js +24 -3
  40. package/sdk/partner/FileStorage/FileStoragePartnerClient.d.ts +46 -16
  41. package/sdk/partner/FileStorage/FileStoragePartnerClient.js +266 -40
  42. package/sdk/partner/FileStorage/FileStoragePartnerModel.d.ts +163 -19
  43. package/sdk/partner/FileStorage/FileStoragePartnerModel.js +158 -14
  44. package/sdk/partner/FileStorage/FileStoragePartnerValidator.d.ts +5 -2
  45. package/sdk/partner/FileStorage/FileStoragePartnerValidator.js +23 -7
  46. package/sdk/partner/Lead/LeadPartnerClient.d.ts +9 -9
  47. package/sdk/partner/Lead/LeadPartnerClient.js +9 -9
  48. package/sdk/partner/Lead/LeadPartnerModel.d.ts +14 -9
  49. package/sdk/partner/Lead/LeadPartnerModel.js +19 -17
  50. package/sdk/partner/Logistics/LogisticsPartnerClient.d.ts +264 -49
  51. package/sdk/partner/Logistics/LogisticsPartnerClient.js +2116 -252
  52. package/sdk/partner/Logistics/LogisticsPartnerModel.d.ts +2256 -258
  53. package/sdk/partner/Logistics/LogisticsPartnerModel.js +1187 -230
  54. package/sdk/partner/Logistics/LogisticsPartnerValidator.d.ts +21 -1
  55. package/sdk/partner/Logistics/LogisticsPartnerValidator.js +218 -13
  56. package/sdk/partner/PartnerClient.d.ts +5 -2
  57. package/sdk/partner/PartnerClient.js +21 -7
  58. package/sdk/partner/Theme/ThemePartnerClient.d.ts +32 -34
  59. package/sdk/partner/Theme/ThemePartnerClient.js +42 -44
  60. package/sdk/partner/Theme/ThemePartnerModel.d.ts +142 -43
  61. package/sdk/partner/Theme/ThemePartnerModel.js +129 -44
  62. package/sdk/partner/Theme/ThemePartnerValidator.js +4 -4
  63. package/sdk/partner/Webhook/WebhookPartnerClient.d.ts +83 -27
  64. package/sdk/partner/Webhook/WebhookPartnerClient.js +446 -27
  65. package/sdk/partner/Webhook/WebhookPartnerModel.d.ts +920 -185
  66. package/sdk/partner/Webhook/WebhookPartnerModel.js +462 -154
  67. package/sdk/partner/Webhook/WebhookPartnerValidator.d.ts +5 -0
  68. package/sdk/partner/Webhook/WebhookPartnerValidator.js +41 -3
  69. package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.d.ts +8 -7
  70. package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.js +17 -11
  71. package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.d.ts +4 -1
  72. package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.js +1 -1
  73. package/sdk/platform/Analytics/AnalyticsPlatformModel.d.ts +68 -13
  74. package/sdk/platform/Analytics/AnalyticsPlatformModel.js +44 -6
  75. package/sdk/platform/AuditTrail/AuditTrailPlatformClient.d.ts +3 -33
  76. package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +4 -244
  77. package/sdk/platform/AuditTrail/AuditTrailPlatformModel.d.ts +49 -145
  78. package/sdk/platform/AuditTrail/AuditTrailPlatformModel.js +20 -171
  79. package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.d.ts +1 -39
  80. package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.js +0 -35
  81. package/sdk/platform/Billing/BillingPlatformClient.d.ts +15 -15
  82. package/sdk/platform/Billing/BillingPlatformClient.js +18 -18
  83. package/sdk/platform/Billing/BillingPlatformModel.d.ts +443 -388
  84. package/sdk/platform/Billing/BillingPlatformModel.js +280 -263
  85. package/sdk/platform/Billing/BillingPlatformValidator.d.ts +16 -18
  86. package/sdk/platform/Billing/BillingPlatformValidator.js +8 -9
  87. package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +266 -203
  88. package/sdk/platform/Cart/CartPlatformApplicationClient.js +1446 -500
  89. package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +729 -100
  90. package/sdk/platform/Cart/CartPlatformApplicationValidator.js +446 -82
  91. package/sdk/platform/Cart/CartPlatformModel.d.ts +6927 -1396
  92. package/sdk/platform/Cart/CartPlatformModel.js +3065 -1316
  93. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +433 -248
  94. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +1662 -559
  95. package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +464 -159
  96. package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +304 -87
  97. package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +383 -234
  98. package/sdk/platform/Catalog/CatalogPlatformClient.js +2475 -1557
  99. package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +9571 -2674
  100. package/sdk/platform/Catalog/CatalogPlatformModel.js +5081 -2019
  101. package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +364 -117
  102. package/sdk/platform/Catalog/CatalogPlatformValidator.js +281 -104
  103. package/sdk/platform/Common/CommonPlatformClient.d.ts +5 -4
  104. package/sdk/platform/Common/CommonPlatformClient.js +6 -5
  105. package/sdk/platform/Common/CommonPlatformModel.d.ts +36 -25
  106. package/sdk/platform/Common/CommonPlatformModel.js +25 -14
  107. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +80 -153
  108. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +102 -541
  109. package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.d.ts +36 -49
  110. package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.js +20 -60
  111. package/sdk/platform/Communication/CommunicationPlatformClient.d.ts +1 -1
  112. package/sdk/platform/Communication/CommunicationPlatformClient.js +1 -1
  113. package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +189 -43
  114. package/sdk/platform/Communication/CommunicationPlatformModel.js +165 -42
  115. package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +58 -81
  116. package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +68 -116
  117. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +291 -249
  118. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +243 -234
  119. package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.d.ts +12 -12
  120. package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.js +12 -12
  121. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +78 -65
  122. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +101 -88
  123. package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.d.ts +20 -20
  124. package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.js +19 -19
  125. package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +68 -34
  126. package/sdk/platform/Configuration/ConfigurationPlatformClient.js +174 -41
  127. package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +667 -244
  128. package/sdk/platform/Configuration/ConfigurationPlatformModel.js +474 -155
  129. package/sdk/platform/Configuration/ConfigurationPlatformValidator.d.ts +37 -9
  130. package/sdk/platform/Configuration/ConfigurationPlatformValidator.js +27 -8
  131. package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +366 -280
  132. package/sdk/platform/Content/ContentPlatformApplicationClient.js +1435 -753
  133. package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +323 -223
  134. package/sdk/platform/Content/ContentPlatformApplicationValidator.js +335 -205
  135. package/sdk/platform/Content/ContentPlatformClient.d.ts +304 -106
  136. package/sdk/platform/Content/ContentPlatformClient.js +1842 -450
  137. package/sdk/platform/Content/ContentPlatformModel.d.ts +2582 -566
  138. package/sdk/platform/Content/ContentPlatformModel.js +1426 -558
  139. package/sdk/platform/Content/ContentPlatformValidator.d.ts +293 -114
  140. package/sdk/platform/Content/ContentPlatformValidator.js +328 -101
  141. package/sdk/platform/Discount/DiscountPlatformClient.d.ts +59 -23
  142. package/sdk/platform/Discount/DiscountPlatformClient.js +84 -23
  143. package/sdk/platform/Discount/DiscountPlatformModel.d.ts +403 -110
  144. package/sdk/platform/Discount/DiscountPlatformModel.js +121 -107
  145. package/sdk/platform/Discount/DiscountPlatformValidator.d.ts +56 -36
  146. package/sdk/platform/Discount/DiscountPlatformValidator.js +29 -19
  147. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +12 -110
  148. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +14 -684
  149. package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.d.ts +5 -94
  150. package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.js +4 -115
  151. package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +20 -20
  152. package/sdk/platform/FileStorage/FileStoragePlatformClient.js +22 -22
  153. package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +90 -920
  154. package/sdk/platform/FileStorage/FileStoragePlatformModel.js +53 -949
  155. package/sdk/platform/FileStorage/FileStoragePlatformValidator.d.ts +6 -6
  156. package/sdk/platform/FileStorage/FileStoragePlatformValidator.js +6 -6
  157. package/sdk/platform/Lead/LeadPlatformApplicationClient.d.ts +10 -10
  158. package/sdk/platform/Lead/LeadPlatformApplicationClient.js +10 -10
  159. package/sdk/platform/Lead/LeadPlatformClient.d.ts +11 -11
  160. package/sdk/platform/Lead/LeadPlatformClient.js +11 -11
  161. package/sdk/platform/Lead/LeadPlatformModel.d.ts +14 -9
  162. package/sdk/platform/Lead/LeadPlatformModel.js +20 -18
  163. package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +56 -9
  164. package/sdk/platform/Order/OrderPlatformApplicationClient.js +340 -10
  165. package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +128 -24
  166. package/sdk/platform/Order/OrderPlatformApplicationValidator.js +81 -19
  167. package/sdk/platform/Order/OrderPlatformClient.d.ts +517 -160
  168. package/sdk/platform/Order/OrderPlatformClient.js +1623 -384
  169. package/sdk/platform/Order/OrderPlatformModel.d.ts +10372 -1587
  170. package/sdk/platform/Order/OrderPlatformModel.js +5726 -1512
  171. package/sdk/platform/Order/OrderPlatformValidator.d.ts +539 -123
  172. package/sdk/platform/Order/OrderPlatformValidator.js +323 -92
  173. package/sdk/platform/Partner/PartnerPlatformApplicationClient.d.ts +8 -6
  174. package/sdk/platform/Partner/PartnerPlatformApplicationClient.js +11 -9
  175. package/sdk/platform/Partner/PartnerPlatformApplicationValidator.d.ts +6 -4
  176. package/sdk/platform/Partner/PartnerPlatformApplicationValidator.js +3 -2
  177. package/sdk/platform/Partner/PartnerPlatformModel.d.ts +77 -25
  178. package/sdk/platform/Partner/PartnerPlatformModel.js +32 -21
  179. package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +144 -219
  180. package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +307 -796
  181. package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +86 -121
  182. package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +80 -138
  183. package/sdk/platform/Payment/PaymentPlatformClient.d.ts +30 -30
  184. package/sdk/platform/Payment/PaymentPlatformClient.js +30 -30
  185. package/sdk/platform/Payment/PaymentPlatformModel.d.ts +901 -761
  186. package/sdk/platform/Payment/PaymentPlatformModel.js +663 -583
  187. package/sdk/platform/Payment/PaymentPlatformValidator.d.ts +8 -8
  188. package/sdk/platform/Payment/PaymentPlatformValidator.js +8 -8
  189. package/sdk/platform/PlatformApplicationClient.d.ts +0 -2
  190. package/sdk/platform/PlatformApplicationClient.js +0 -4
  191. package/sdk/platform/PlatformClient.d.ts +5 -4
  192. package/sdk/platform/PlatformClient.js +32 -22
  193. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.d.ts +526 -69
  194. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.js +3337 -337
  195. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.d.ts +603 -38
  196. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.js +529 -32
  197. package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +184 -133
  198. package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +780 -491
  199. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +9408 -1666
  200. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +5720 -1765
  201. package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.d.ts +257 -180
  202. package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.js +185 -127
  203. package/sdk/platform/Share/SharePlatformApplicationClient.d.ts +7 -7
  204. package/sdk/platform/Share/SharePlatformApplicationClient.js +7 -7
  205. package/sdk/platform/Share/SharePlatformModel.d.ts +45 -9
  206. package/sdk/platform/Share/SharePlatformModel.js +31 -6
  207. package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +26 -26
  208. package/sdk/platform/Theme/ThemePlatformApplicationClient.js +38 -29
  209. package/sdk/platform/Theme/ThemePlatformApplicationValidator.d.ts +18 -3
  210. package/sdk/platform/Theme/ThemePlatformApplicationValidator.js +10 -2
  211. package/sdk/platform/Theme/ThemePlatformClient.d.ts +4 -4
  212. package/sdk/platform/Theme/ThemePlatformClient.js +4 -4
  213. package/sdk/platform/Theme/ThemePlatformModel.d.ts +103 -17
  214. package/sdk/platform/Theme/ThemePlatformModel.js +92 -23
  215. package/sdk/platform/User/UserPlatformApplicationClient.d.ts +167 -45
  216. package/sdk/platform/User/UserPlatformApplicationClient.js +950 -67
  217. package/sdk/platform/User/UserPlatformApplicationValidator.d.ts +189 -3
  218. package/sdk/platform/User/UserPlatformApplicationValidator.js +157 -3
  219. package/sdk/platform/User/UserPlatformModel.d.ts +880 -47
  220. package/sdk/platform/User/UserPlatformModel.js +607 -46
  221. package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +33 -86
  222. package/sdk/platform/Webhook/WebhookPlatformClient.js +79 -474
  223. package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +861 -422
  224. package/sdk/platform/Webhook/WebhookPlatformModel.js +469 -391
  225. package/sdk/platform/Webhook/WebhookPlatformValidator.d.ts +10 -55
  226. package/sdk/platform/Webhook/WebhookPlatformValidator.js +12 -72
  227. package/sdk/platform/index.d.ts +0 -2
  228. package/sdk/platform/index.js +0 -4
  229. package/sdk/public/Catalog/CatalogPublicClient.d.ts +22 -0
  230. package/sdk/public/Catalog/CatalogPublicClient.js +133 -0
  231. package/sdk/public/Catalog/CatalogPublicModel.d.ts +158 -0
  232. package/sdk/public/Catalog/CatalogPublicModel.js +116 -0
  233. package/sdk/public/Catalog/CatalogPublicValidator.d.ts +55 -0
  234. package/sdk/public/Catalog/CatalogPublicValidator.js +35 -0
  235. package/sdk/public/Configuration/ConfigurationPublicClient.d.ts +5 -4
  236. package/sdk/public/Configuration/ConfigurationPublicClient.js +9 -8
  237. package/sdk/public/Configuration/ConfigurationPublicModel.d.ts +41 -21
  238. package/sdk/public/Configuration/ConfigurationPublicModel.js +28 -12
  239. package/sdk/public/Content/ContentPublicClient.d.ts +145 -2
  240. package/sdk/public/Content/ContentPublicClient.js +1067 -17
  241. package/sdk/public/Content/ContentPublicModel.d.ts +704 -3
  242. package/sdk/public/Content/ContentPublicModel.js +751 -3
  243. package/sdk/public/Content/ContentPublicValidator.d.ts +94 -3
  244. package/sdk/public/Content/ContentPublicValidator.js +119 -2
  245. package/sdk/public/Partner/PartnerPublicClient.d.ts +1 -1
  246. package/sdk/public/Partner/PartnerPublicClient.js +1 -1
  247. package/sdk/public/Partner/PartnerPublicModel.d.ts +248 -72
  248. package/sdk/public/Partner/PartnerPublicModel.js +81 -71
  249. package/sdk/public/Partner/PartnerPublicValidator.d.ts +2 -2
  250. package/sdk/public/Partner/PartnerPublicValidator.js +1 -1
  251. package/sdk/public/PublicClient.d.ts +5 -2
  252. package/sdk/public/PublicClient.js +16 -6
  253. package/sdk/public/Webhook/WebhookPublicClient.d.ts +13 -13
  254. package/sdk/public/Webhook/WebhookPublicClient.js +13 -13
  255. package/sdk/public/Webhook/WebhookPublicModel.d.ts +249 -67
  256. package/sdk/public/Webhook/WebhookPublicModel.js +81 -61
  257. package/sdk/public/Webhook/WebhookPublicValidator.d.ts +4 -4
  258. package/sdk/public/Webhook/WebhookPublicValidator.js +4 -4
  259. package/sdk/public/index.d.ts +1 -0
  260. package/sdk/public/index.js +2 -0
  261. package/utility.d.ts +3 -0
  262. package/utility.js +7 -0
  263. package/sdk/application/Rewards/RewardsApplicationClient.d.ts +0 -79
  264. package/sdk/application/Rewards/RewardsApplicationClient.js +0 -315
  265. package/sdk/application/Webhook/WebhookApplicationClient.d.ts +0 -19
  266. package/sdk/application/Webhook/WebhookApplicationClient.js +0 -72
  267. package/sdk/platform/Finance/FinancePlatformClient.d.ts +0 -320
  268. package/sdk/platform/Finance/FinancePlatformClient.js +0 -2333
  269. package/sdk/platform/Finance/FinancePlatformModel.d.ts +0 -2890
  270. package/sdk/platform/Finance/FinancePlatformModel.js +0 -2148
  271. package/sdk/platform/Finance/FinancePlatformValidator.d.ts +0 -284
  272. package/sdk/platform/Finance/FinancePlatformValidator.js +0 -354
  273. package/sdk/platform/Rewards/RewardsPlatformApplicationClient.d.ts +0 -136
  274. package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +0 -976
  275. package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.d.ts +0 -152
  276. package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.js +0 -157
  277. package/sdk/platform/Rewards/RewardsPlatformModel.d.ts +0 -382
  278. package/sdk/platform/Rewards/RewardsPlatformModel.js +0 -408
@@ -15,28 +15,101 @@ class Content {
15
15
  }
16
16
 
17
17
  /**
18
- * @param {ContentPlatformValidator.CreateCustomFieldByResourceIdParam} arg
18
+ * @param {ContentPlatformValidator.AddCompanyLanguageParam} arg - Arg object
19
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
20
+ * @param {import("../PlatformAPIClient").Options} - Options
21
+ * @returns {Promise<Object>} - Success response
22
+ * @name addCompanyLanguage
23
+ * @summary: Add company language
24
+ * @description: Add new languages to company's supported language list. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/content/addCompanyLanguage/).
25
+ */
26
+ async addCompanyLanguage(
27
+ { body, requestHeaders } = { requestHeaders: {} },
28
+ { responseHeaders } = { responseHeaders: false }
29
+ ) {
30
+ const { error } = ContentPlatformValidator.addCompanyLanguage().validate(
31
+ {
32
+ body,
33
+ },
34
+ { abortEarly: false, allowUnknown: true }
35
+ );
36
+ if (error) {
37
+ return Promise.reject(new FDKClientValidationError(error));
38
+ }
39
+
40
+ // Showing warrnings if extra unknown parameters are found
41
+ const {
42
+ error: warrning,
43
+ } = ContentPlatformValidator.addCompanyLanguage().validate(
44
+ {
45
+ body,
46
+ },
47
+ { abortEarly: false, allowUnknown: false }
48
+ );
49
+ if (warrning) {
50
+ Logger({
51
+ level: "WARN",
52
+ message: `Parameter Validation warrnings for platform > Content > addCompanyLanguage \n ${warrning}`,
53
+ });
54
+ }
55
+
56
+ const query_params = {};
57
+
58
+ const xHeaders = {};
59
+
60
+ const response = await PlatformAPIClient.execute(
61
+ this.config,
62
+ "post",
63
+ `/service/platform/content/v1.0/company/${this.config.companyId}/languages`,
64
+ query_params,
65
+ body,
66
+ { ...xHeaders, ...requestHeaders },
67
+ { responseHeaders }
68
+ );
69
+
70
+ let responseData = response;
71
+ if (responseHeaders) {
72
+ responseData = response[0];
73
+ }
74
+
75
+ const { error: res_error } = Joi.any().validate(responseData, {
76
+ abortEarly: false,
77
+ allowUnknown: true,
78
+ });
79
+
80
+ if (res_error) {
81
+ if (this.config.options.strictResponseCheck === true) {
82
+ return Promise.reject(new FDKResponseValidationError(res_error));
83
+ } else {
84
+ Logger({
85
+ level: "WARN",
86
+ message: `Response Validation Warnings for platform > Content > addCompanyLanguage \n ${res_error}`,
87
+ });
88
+ }
89
+ }
90
+
91
+ return response;
92
+ }
93
+
94
+ /**
95
+ * @param {ContentPlatformValidator.CreateCompanyResourceTranslationParam} arg
19
96
  * - Arg object
20
97
  *
21
98
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
22
99
  * @param {import("../PlatformAPIClient").Options} - Options
23
- * @returns {Promise<ContentPlatformModel.CustomFieldsResponseByResourceIdSchema>}
24
- * - Success response
25
- *
26
- * @name createCustomFieldByResourceId
27
- * @summary: Create custom field entries for gives resource and resource_id
28
- * @description: You can add a custom field using this endpoint to any resource by providing the resource ID. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/content/createCustomFieldByResourceId/).
100
+ * @returns {Promise<ContentPlatformModel.ResourceTranslation>} - Success response
101
+ * @name createCompanyResourceTranslation
102
+ * @summary: Add company translation
103
+ * @description: Create new translations for company resources. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/content/createCompanyResourceTranslation/).
29
104
  */
30
- async createCustomFieldByResourceId(
31
- { resource, resourceId, body, requestHeaders } = { requestHeaders: {} },
105
+ async createCompanyResourceTranslation(
106
+ { body, requestHeaders } = { requestHeaders: {} },
32
107
  { responseHeaders } = { responseHeaders: false }
33
108
  ) {
34
109
  const {
35
110
  error,
36
- } = ContentPlatformValidator.createCustomFieldByResourceId().validate(
111
+ } = ContentPlatformValidator.createCompanyResourceTranslation().validate(
37
112
  {
38
- resource,
39
- resourceId,
40
113
  body,
41
114
  },
42
115
  { abortEarly: false, allowUnknown: true }
@@ -48,10 +121,8 @@ class Content {
48
121
  // Showing warrnings if extra unknown parameters are found
49
122
  const {
50
123
  error: warrning,
51
- } = ContentPlatformValidator.createCustomFieldByResourceId().validate(
124
+ } = ContentPlatformValidator.createCompanyResourceTranslation().validate(
52
125
  {
53
- resource,
54
- resourceId,
55
126
  body,
56
127
  },
57
128
  { abortEarly: false, allowUnknown: false }
@@ -59,7 +130,7 @@ class Content {
59
130
  if (warrning) {
60
131
  Logger({
61
132
  level: "WARN",
62
- message: `Parameter Validation warrnings for platform > Content > createCustomFieldByResourceId \n ${warrning}`,
133
+ message: `Parameter Validation warrnings for platform > Content > createCompanyResourceTranslation \n ${warrning}`,
63
134
  });
64
135
  }
65
136
 
@@ -69,8 +140,8 @@ class Content {
69
140
 
70
141
  const response = await PlatformAPIClient.execute(
71
142
  this.config,
72
- "put",
73
- `/service/platform/content/v1.0/company/${this.config.companyId}/metafields/${resource}/${resourceId}`,
143
+ "post",
144
+ `/service/platform/content/v1.0/company/${this.config.companyId}/resource/translations`,
74
145
  query_params,
75
146
  body,
76
147
  { ...xHeaders, ...requestHeaders },
@@ -84,10 +155,10 @@ class Content {
84
155
 
85
156
  const {
86
157
  error: res_error,
87
- } = ContentPlatformModel.CustomFieldsResponseByResourceIdSchema().validate(
88
- responseData,
89
- { abortEarly: false, allowUnknown: true }
90
- );
158
+ } = ContentPlatformModel.ResourceTranslation().validate(responseData, {
159
+ abortEarly: false,
160
+ allowUnknown: true,
161
+ });
91
162
 
92
163
  if (res_error) {
93
164
  if (this.config.options.strictResponseCheck === true) {
@@ -95,7 +166,7 @@ class Content {
95
166
  } else {
96
167
  Logger({
97
168
  level: "WARN",
98
- message: `Response Validation Warnings for platform > Content > createCustomFieldByResourceId \n ${res_error}`,
169
+ message: `Response Validation Warnings for platform > Content > createCompanyResourceTranslation \n ${res_error}`,
99
170
  });
100
171
  }
101
172
  }
@@ -111,17 +182,18 @@ class Content {
111
182
  * - Success response
112
183
  *
113
184
  * @name createCustomFieldDefinition
114
- * @summary: Create custom field definition
115
- * @description: You can create custom fields definition to any resource so you can extend property of resource. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/content/createCustomFieldDefinition/).
185
+ * @summary: Create custom field definition for a given resource type
186
+ * @description: You can create custom fields definition to any resource so you can extend property of resource. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/content/createCustomFieldDefinition/).
116
187
  */
117
188
  async createCustomFieldDefinition(
118
- { body, requestHeaders } = { requestHeaders: {} },
189
+ { resource, body, requestHeaders } = { requestHeaders: {} },
119
190
  { responseHeaders } = { responseHeaders: false }
120
191
  ) {
121
192
  const {
122
193
  error,
123
194
  } = ContentPlatformValidator.createCustomFieldDefinition().validate(
124
195
  {
196
+ resource,
125
197
  body,
126
198
  },
127
199
  { abortEarly: false, allowUnknown: true }
@@ -135,6 +207,7 @@ class Content {
135
207
  error: warrning,
136
208
  } = ContentPlatformValidator.createCustomFieldDefinition().validate(
137
209
  {
210
+ resource,
138
211
  body,
139
212
  },
140
213
  { abortEarly: false, allowUnknown: false }
@@ -153,7 +226,7 @@ class Content {
153
226
  const response = await PlatformAPIClient.execute(
154
227
  this.config,
155
228
  "post",
156
- `/service/platform/content/v1.0/company/${this.config.companyId}/metafields/definitions`,
229
+ `/service/platform/content/v2.0/company/${this.config.companyId}/customfields/resource/${resource}/definition`,
157
230
  query_params,
158
231
  body,
159
232
  { ...xHeaders, ...requestHeaders },
@@ -187,20 +260,23 @@ class Content {
187
260
  }
188
261
 
189
262
  /**
190
- * @param {ContentPlatformValidator.CreateCustomObjectParam} arg - Arg object
263
+ * @param {ContentPlatformValidator.CreateCustomObjectBySlugParam} arg - Arg object
191
264
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
192
265
  * @param {import("../PlatformAPIClient").Options} - Options
193
266
  * @returns {Promise<ContentPlatformModel.CustomObjectSchema>} - Success response
194
- * @name createCustomObject
267
+ * @name createCustomObjectBySlug
195
268
  * @summary: Create custom object entries
196
- * @description: Custom object entries against the custom object definition can be added using this API. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/content/createCustomObject/).
269
+ * @description: Custom object entries against the custom object definition can be added using this API. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/content/createCustomObjectBySlug/).
197
270
  */
198
- async createCustomObject(
199
- { body, requestHeaders } = { requestHeaders: {} },
271
+ async createCustomObjectBySlug(
272
+ { definitionSlug, body, requestHeaders } = { requestHeaders: {} },
200
273
  { responseHeaders } = { responseHeaders: false }
201
274
  ) {
202
- const { error } = ContentPlatformValidator.createCustomObject().validate(
275
+ const {
276
+ error,
277
+ } = ContentPlatformValidator.createCustomObjectBySlug().validate(
203
278
  {
279
+ definitionSlug,
204
280
  body,
205
281
  },
206
282
  { abortEarly: false, allowUnknown: true }
@@ -212,8 +288,9 @@ class Content {
212
288
  // Showing warrnings if extra unknown parameters are found
213
289
  const {
214
290
  error: warrning,
215
- } = ContentPlatformValidator.createCustomObject().validate(
291
+ } = ContentPlatformValidator.createCustomObjectBySlug().validate(
216
292
  {
293
+ definitionSlug,
217
294
  body,
218
295
  },
219
296
  { abortEarly: false, allowUnknown: false }
@@ -221,7 +298,7 @@ class Content {
221
298
  if (warrning) {
222
299
  Logger({
223
300
  level: "WARN",
224
- message: `Parameter Validation warrnings for platform > Content > createCustomObject \n ${warrning}`,
301
+ message: `Parameter Validation warrnings for platform > Content > createCustomObjectBySlug \n ${warrning}`,
225
302
  });
226
303
  }
227
304
 
@@ -232,7 +309,7 @@ class Content {
232
309
  const response = await PlatformAPIClient.execute(
233
310
  this.config,
234
311
  "post",
235
- `/service/platform/content/v1.0/company/${this.config.companyId}/metaobjects`,
312
+ `/service/platform/content/v2.0/company/${this.config.companyId}/customobjects/definition/${definitionSlug}/entries`,
236
313
  query_params,
237
314
  body,
238
315
  { ...xHeaders, ...requestHeaders },
@@ -257,7 +334,7 @@ class Content {
257
334
  } else {
258
335
  Logger({
259
336
  level: "WARN",
260
- message: `Response Validation Warnings for platform > Content > createCustomObject \n ${res_error}`,
337
+ message: `Response Validation Warnings for platform > Content > createCustomObjectBySlug \n ${res_error}`,
261
338
  });
262
339
  }
263
340
  }
@@ -271,11 +348,12 @@ class Content {
271
348
  *
272
349
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
273
350
  * @param {import("../PlatformAPIClient").Options} - Options
274
- * @returns {Promise<ContentPlatformModel.CustomObjectDefinitionSchema>} -
275
- * Success response
351
+ * @returns {Promise<ContentPlatformModel.CustomObjectDefinitionSlugSchema>}
352
+ * - Success response
353
+ *
276
354
  * @name createCustomObjectDefinition
277
355
  * @summary: Create custom object definition
278
- * @description: Create a custom object that will have a collection of custom fields and can be used anywhere in the custom field for any resource. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/content/createCustomObjectDefinition/).
356
+ * @description: Create a custom object that will have a collection of custom fields and can be used anywhere in the custom field for any resource. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/content/createCustomObjectDefinition/).
279
357
  */
280
358
  async createCustomObjectDefinition(
281
359
  { body, requestHeaders } = { requestHeaders: {} },
@@ -316,7 +394,7 @@ class Content {
316
394
  const response = await PlatformAPIClient.execute(
317
395
  this.config,
318
396
  "post",
319
- `/service/platform/content/v1.0/company/${this.config.companyId}/metaobjects/definitions`,
397
+ `/service/platform/content/v2.0/company/${this.config.companyId}/customobjects/definition`,
320
398
  query_params,
321
399
  body,
322
400
  { ...xHeaders, ...requestHeaders },
@@ -330,7 +408,7 @@ class Content {
330
408
 
331
409
  const {
332
410
  error: res_error,
333
- } = ContentPlatformModel.CustomObjectDefinitionSchema().validate(
411
+ } = ContentPlatformModel.CustomObjectDefinitionSlugSchema().validate(
334
412
  responseData,
335
413
  { abortEarly: false, allowUnknown: true }
336
414
  );
@@ -350,23 +428,21 @@ class Content {
350
428
  }
351
429
 
352
430
  /**
353
- * @param {ContentPlatformValidator.DeleteCustomFieldDefinitionParam} arg - Arg object
431
+ * @param {ContentPlatformValidator.DeleteCompanyLanguageParam} arg - Arg object
354
432
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
355
433
  * @param {import("../PlatformAPIClient").Options} - Options
356
- * @returns {Promise<ContentPlatformModel.CustomDataDeleteSchema>} - Success response
357
- * @name deleteCustomFieldDefinition
358
- * @summary: Delete custom fields definition
359
- * @description: Custom field definition and its assosiated custom fields value can be deleted using this api on the basis of definition id. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/content/deleteCustomFieldDefinition/).
434
+ * @returns {Promise<ContentPlatformModel.OperationResponseSchema>} - Success response
435
+ * @name deleteCompanyLanguage
436
+ * @summary: Remove company language
437
+ * @description: Remove a language from company's supported languages list. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/content/deleteCompanyLanguage/).
360
438
  */
361
- async deleteCustomFieldDefinition(
362
- { definitionId, requestHeaders } = { requestHeaders: {} },
439
+ async deleteCompanyLanguage(
440
+ { locale, requestHeaders } = { requestHeaders: {} },
363
441
  { responseHeaders } = { responseHeaders: false }
364
442
  ) {
365
- const {
366
- error,
367
- } = ContentPlatformValidator.deleteCustomFieldDefinition().validate(
443
+ const { error } = ContentPlatformValidator.deleteCompanyLanguage().validate(
368
444
  {
369
- definitionId,
445
+ locale,
370
446
  },
371
447
  { abortEarly: false, allowUnknown: true }
372
448
  );
@@ -377,16 +453,16 @@ class Content {
377
453
  // Showing warrnings if extra unknown parameters are found
378
454
  const {
379
455
  error: warrning,
380
- } = ContentPlatformValidator.deleteCustomFieldDefinition().validate(
456
+ } = ContentPlatformValidator.deleteCompanyLanguage().validate(
381
457
  {
382
- definitionId,
458
+ locale,
383
459
  },
384
460
  { abortEarly: false, allowUnknown: false }
385
461
  );
386
462
  if (warrning) {
387
463
  Logger({
388
464
  level: "WARN",
389
- message: `Parameter Validation warrnings for platform > Content > deleteCustomFieldDefinition \n ${warrning}`,
465
+ message: `Parameter Validation warrnings for platform > Content > deleteCompanyLanguage \n ${warrning}`,
390
466
  });
391
467
  }
392
468
 
@@ -397,7 +473,7 @@ class Content {
397
473
  const response = await PlatformAPIClient.execute(
398
474
  this.config,
399
475
  "delete",
400
- `/service/platform/content/v1.0/company/${this.config.companyId}/metafields/definitions/${definitionId}`,
476
+ `/service/platform/content/v1.0/company/${this.config.companyId}/languages/${locale}`,
401
477
  query_params,
402
478
  undefined,
403
479
  { ...xHeaders, ...requestHeaders },
@@ -411,7 +487,7 @@ class Content {
411
487
 
412
488
  const {
413
489
  error: res_error,
414
- } = ContentPlatformModel.CustomDataDeleteSchema().validate(responseData, {
490
+ } = ContentPlatformModel.OperationResponseSchema().validate(responseData, {
415
491
  abortEarly: false,
416
492
  allowUnknown: true,
417
493
  });
@@ -422,7 +498,7 @@ class Content {
422
498
  } else {
423
499
  Logger({
424
500
  level: "WARN",
425
- message: `Response Validation Warnings for platform > Content > deleteCustomFieldDefinition \n ${res_error}`,
501
+ message: `Response Validation Warnings for platform > Content > deleteCompanyLanguage \n ${res_error}`,
426
502
  });
427
503
  }
428
504
  }
@@ -431,21 +507,25 @@ class Content {
431
507
  }
432
508
 
433
509
  /**
434
- * @param {ContentPlatformValidator.DeleteCustomObjectParam} arg - Arg object
510
+ * @param {ContentPlatformValidator.DeleteCompanyResourceTranslationParam} arg
511
+ * - Arg object
512
+ *
435
513
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
436
514
  * @param {import("../PlatformAPIClient").Options} - Options
437
- * @returns {Promise<ContentPlatformModel.CustomDataDeleteSchema>} - Success response
438
- * @name deleteCustomObject
439
- * @summary: Delete custom object
440
- * @description: Custom object entries can be deleted by providing the delete ID using this endpoint. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/content/deleteCustomObject/).
515
+ * @returns {Promise<ContentPlatformModel.OperationResponseSchema>} - Success response
516
+ * @name deleteCompanyResourceTranslation
517
+ * @summary: Remove company translation
518
+ * @description: Remove translations for company resources. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/content/deleteCompanyResourceTranslation/).
441
519
  */
442
- async deleteCustomObject(
443
- { metaobjectId, requestHeaders } = { requestHeaders: {} },
520
+ async deleteCompanyResourceTranslation(
521
+ { id, requestHeaders } = { requestHeaders: {} },
444
522
  { responseHeaders } = { responseHeaders: false }
445
523
  ) {
446
- const { error } = ContentPlatformValidator.deleteCustomObject().validate(
524
+ const {
525
+ error,
526
+ } = ContentPlatformValidator.deleteCompanyResourceTranslation().validate(
447
527
  {
448
- metaobjectId,
528
+ id,
449
529
  },
450
530
  { abortEarly: false, allowUnknown: true }
451
531
  );
@@ -456,16 +536,16 @@ class Content {
456
536
  // Showing warrnings if extra unknown parameters are found
457
537
  const {
458
538
  error: warrning,
459
- } = ContentPlatformValidator.deleteCustomObject().validate(
539
+ } = ContentPlatformValidator.deleteCompanyResourceTranslation().validate(
460
540
  {
461
- metaobjectId,
541
+ id,
462
542
  },
463
543
  { abortEarly: false, allowUnknown: false }
464
544
  );
465
545
  if (warrning) {
466
546
  Logger({
467
547
  level: "WARN",
468
- message: `Parameter Validation warrnings for platform > Content > deleteCustomObject \n ${warrning}`,
548
+ message: `Parameter Validation warrnings for platform > Content > deleteCompanyResourceTranslation \n ${warrning}`,
469
549
  });
470
550
  }
471
551
 
@@ -476,7 +556,7 @@ class Content {
476
556
  const response = await PlatformAPIClient.execute(
477
557
  this.config,
478
558
  "delete",
479
- `/service/platform/content/v1.0/company/${this.config.companyId}/metaobjects/${metaobjectId}`,
559
+ `/service/platform/content/v1.0/company/${this.config.companyId}/resource/translations/${id}`,
480
560
  query_params,
481
561
  undefined,
482
562
  { ...xHeaders, ...requestHeaders },
@@ -490,7 +570,7 @@ class Content {
490
570
 
491
571
  const {
492
572
  error: res_error,
493
- } = ContentPlatformModel.CustomDataDeleteSchema().validate(responseData, {
573
+ } = ContentPlatformModel.OperationResponseSchema().validate(responseData, {
494
574
  abortEarly: false,
495
575
  allowUnknown: true,
496
576
  });
@@ -501,7 +581,7 @@ class Content {
501
581
  } else {
502
582
  Logger({
503
583
  level: "WARN",
504
- message: `Response Validation Warnings for platform > Content > deleteCustomObject \n ${res_error}`,
584
+ message: `Response Validation Warnings for platform > Content > deleteCompanyResourceTranslation \n ${res_error}`,
505
585
  });
506
586
  }
507
587
  }
@@ -510,27 +590,27 @@ class Content {
510
590
  }
511
591
 
512
592
  /**
513
- * @param {ContentPlatformValidator.DeleteCustomObjectDefinitionParam} arg
593
+ * @param {ContentPlatformValidator.DeleteCustomFieldDefinitionBySlugParam} arg
514
594
  * - Arg object
515
595
  *
516
596
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
517
597
  * @param {import("../PlatformAPIClient").Options} - Options
518
- * @returns {Promise<ContentPlatformModel.CustomObjectDefinitionDeleteResponseSchema>}
519
- * - Success response
520
- *
521
- * @name deleteCustomObjectDefinition
522
- * @summary: delete custom object definition
523
- * @description: Custom object definitions can be deleted using this endpoint by providing the definition ID. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/content/deleteCustomObjectDefinition/).
598
+ * @returns {Promise<ContentPlatformModel.CustomDataDeleteSchema>} - Success response
599
+ * @name deleteCustomFieldDefinitionBySlug
600
+ * @summary: Delete custom fields definition
601
+ * @description: Custom field definition and its assosiated custom fields value can be deleted using this api on the basis of definition id. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/content/deleteCustomFieldDefinitionBySlug/).
524
602
  */
525
- async deleteCustomObjectDefinition(
526
- { definitionId, requestHeaders } = { requestHeaders: {} },
603
+ async deleteCustomFieldDefinitionBySlug(
604
+ { slug, resource, namespace, requestHeaders } = { requestHeaders: {} },
527
605
  { responseHeaders } = { responseHeaders: false }
528
606
  ) {
529
607
  const {
530
608
  error,
531
- } = ContentPlatformValidator.deleteCustomObjectDefinition().validate(
609
+ } = ContentPlatformValidator.deleteCustomFieldDefinitionBySlug().validate(
532
610
  {
533
- definitionId,
611
+ slug,
612
+ resource,
613
+ namespace,
534
614
  },
535
615
  { abortEarly: false, allowUnknown: true }
536
616
  );
@@ -541,16 +621,18 @@ class Content {
541
621
  // Showing warrnings if extra unknown parameters are found
542
622
  const {
543
623
  error: warrning,
544
- } = ContentPlatformValidator.deleteCustomObjectDefinition().validate(
624
+ } = ContentPlatformValidator.deleteCustomFieldDefinitionBySlug().validate(
545
625
  {
546
- definitionId,
626
+ slug,
627
+ resource,
628
+ namespace,
547
629
  },
548
630
  { abortEarly: false, allowUnknown: false }
549
631
  );
550
632
  if (warrning) {
551
633
  Logger({
552
634
  level: "WARN",
553
- message: `Parameter Validation warrnings for platform > Content > deleteCustomObjectDefinition \n ${warrning}`,
635
+ message: `Parameter Validation warrnings for platform > Content > deleteCustomFieldDefinitionBySlug \n ${warrning}`,
554
636
  });
555
637
  }
556
638
 
@@ -561,7 +643,7 @@ class Content {
561
643
  const response = await PlatformAPIClient.execute(
562
644
  this.config,
563
645
  "delete",
564
- `/service/platform/content/v1.0/company/${this.config.companyId}/metaobjects/definitions/${definitionId}`,
646
+ `/service/platform/content/v2.0/company/${this.config.companyId}/customfields/resource/${resource}/namespace/${namespace}/definition/${slug}`,
565
647
  query_params,
566
648
  undefined,
567
649
  { ...xHeaders, ...requestHeaders },
@@ -575,10 +657,10 @@ class Content {
575
657
 
576
658
  const {
577
659
  error: res_error,
578
- } = ContentPlatformModel.CustomObjectDefinitionDeleteResponseSchema().validate(
579
- responseData,
580
- { abortEarly: false, allowUnknown: true }
581
- );
660
+ } = ContentPlatformModel.CustomDataDeleteSchema().validate(responseData, {
661
+ abortEarly: false,
662
+ allowUnknown: true,
663
+ });
582
664
 
583
665
  if (res_error) {
584
666
  if (this.config.options.strictResponseCheck === true) {
@@ -586,7 +668,7 @@ class Content {
586
668
  } else {
587
669
  Logger({
588
670
  level: "WARN",
589
- message: `Response Validation Warnings for platform > Content > deleteCustomObjectDefinition \n ${res_error}`,
671
+ message: `Response Validation Warnings for platform > Content > deleteCustomFieldDefinitionBySlug \n ${res_error}`,
590
672
  });
591
673
  }
592
674
  }
@@ -595,25 +677,28 @@ class Content {
595
677
  }
596
678
 
597
679
  /**
598
- * @param {ContentPlatformValidator.ExportCustomObjectEntriesParam} arg - Arg object
680
+ * @param {ContentPlatformValidator.DeleteCustomFieldsByResourceSlugParam} arg
681
+ * - Arg object
682
+ *
599
683
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
600
684
  * @param {import("../PlatformAPIClient").Options} - Options
601
- * @returns {Promise<ContentPlatformModel.CustomObjectBulkEntryInitiateDownload>}
602
- * - Success response
603
- *
604
- * @name exportCustomObjectEntries
605
- * @summary: Initiate download for bulk custom object entries
606
- * @description: Custom object bulk export of bulk entries can be perform using this endpoint. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/content/exportCustomObjectEntries/).
685
+ * @returns {Promise<ContentPlatformModel.CustomFieldsDeleteSchema>} -
686
+ * Success response
687
+ * @name deleteCustomFieldsByResourceSlug
688
+ * @summary: delete custom fields of given resource and resource slug
689
+ * @description: Use this API to delete the custom fields for given resource in param. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/content/deleteCustomFieldsByResourceSlug/).
607
690
  */
608
- async exportCustomObjectEntries(
609
- { definitionId, requestHeaders } = { requestHeaders: {} },
691
+ async deleteCustomFieldsByResourceSlug(
692
+ { resource, resourceSlug, ids, requestHeaders } = { requestHeaders: {} },
610
693
  { responseHeaders } = { responseHeaders: false }
611
694
  ) {
612
695
  const {
613
696
  error,
614
- } = ContentPlatformValidator.exportCustomObjectEntries().validate(
697
+ } = ContentPlatformValidator.deleteCustomFieldsByResourceSlug().validate(
615
698
  {
616
- definitionId,
699
+ resource,
700
+ resourceSlug,
701
+ ids,
617
702
  },
618
703
  { abortEarly: false, allowUnknown: true }
619
704
  );
@@ -624,27 +709,30 @@ class Content {
624
709
  // Showing warrnings if extra unknown parameters are found
625
710
  const {
626
711
  error: warrning,
627
- } = ContentPlatformValidator.exportCustomObjectEntries().validate(
712
+ } = ContentPlatformValidator.deleteCustomFieldsByResourceSlug().validate(
628
713
  {
629
- definitionId,
714
+ resource,
715
+ resourceSlug,
716
+ ids,
630
717
  },
631
718
  { abortEarly: false, allowUnknown: false }
632
719
  );
633
720
  if (warrning) {
634
721
  Logger({
635
722
  level: "WARN",
636
- message: `Parameter Validation warrnings for platform > Content > exportCustomObjectEntries \n ${warrning}`,
723
+ message: `Parameter Validation warrnings for platform > Content > deleteCustomFieldsByResourceSlug \n ${warrning}`,
637
724
  });
638
725
  }
639
726
 
640
727
  const query_params = {};
728
+ query_params["ids"] = ids;
641
729
 
642
730
  const xHeaders = {};
643
731
 
644
732
  const response = await PlatformAPIClient.execute(
645
733
  this.config,
646
- "get",
647
- `/service/platform/content/v1.0/company/${this.config.companyId}/metaobjects/bulk/${definitionId}/download`,
734
+ "delete",
735
+ `/service/platform/content/v2.0/company/${this.config.companyId}/customfields/resource/${resource}/${resourceSlug}`,
648
736
  query_params,
649
737
  undefined,
650
738
  { ...xHeaders, ...requestHeaders },
@@ -658,10 +746,10 @@ class Content {
658
746
 
659
747
  const {
660
748
  error: res_error,
661
- } = ContentPlatformModel.CustomObjectBulkEntryInitiateDownload().validate(
662
- responseData,
663
- { abortEarly: false, allowUnknown: true }
664
- );
749
+ } = ContentPlatformModel.CustomFieldsDeleteSchema().validate(responseData, {
750
+ abortEarly: false,
751
+ allowUnknown: true,
752
+ });
665
753
 
666
754
  if (res_error) {
667
755
  if (this.config.options.strictResponseCheck === true) {
@@ -669,7 +757,7 @@ class Content {
669
757
  } else {
670
758
  Logger({
671
759
  level: "WARN",
672
- message: `Response Validation Warnings for platform > Content > exportCustomObjectEntries \n ${res_error}`,
760
+ message: `Response Validation Warnings for platform > Content > deleteCustomFieldsByResourceSlug \n ${res_error}`,
673
761
  });
674
762
  }
675
763
  }
@@ -678,25 +766,24 @@ class Content {
678
766
  }
679
767
 
680
768
  /**
681
- * @param {ContentPlatformValidator.GetCustomFieldDefinitionParam} arg - Arg object
769
+ * @param {ContentPlatformValidator.DeleteCustomObjectBySlugParam} arg - Arg object
682
770
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
683
771
  * @param {import("../PlatformAPIClient").Options} - Options
684
- * @returns {Promise<ContentPlatformModel.CustomFieldDefinitionDetailResSchema>}
685
- * - Success response
686
- *
687
- * @name getCustomFieldDefinition
688
- * @summary: Get custom fields definition
689
- * @description: Custom field definitions can be fetch using definition id. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/content/getCustomFieldDefinition/).
772
+ * @returns {Promise<ContentPlatformModel.CustomDataDeleteSchema>} - Success response
773
+ * @name deleteCustomObjectBySlug
774
+ * @summary: Delete custom object
775
+ * @description: Custom object entries can be deleted by providing the delete ID using this endpoint. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/content/deleteCustomObjectBySlug/).
690
776
  */
691
- async getCustomFieldDefinition(
692
- { definitionId, requestHeaders } = { requestHeaders: {} },
777
+ async deleteCustomObjectBySlug(
778
+ { definitionSlug, slug, requestHeaders } = { requestHeaders: {} },
693
779
  { responseHeaders } = { responseHeaders: false }
694
780
  ) {
695
781
  const {
696
782
  error,
697
- } = ContentPlatformValidator.getCustomFieldDefinition().validate(
783
+ } = ContentPlatformValidator.deleteCustomObjectBySlug().validate(
698
784
  {
699
- definitionId,
785
+ definitionSlug,
786
+ slug,
700
787
  },
701
788
  { abortEarly: false, allowUnknown: true }
702
789
  );
@@ -707,16 +794,17 @@ class Content {
707
794
  // Showing warrnings if extra unknown parameters are found
708
795
  const {
709
796
  error: warrning,
710
- } = ContentPlatformValidator.getCustomFieldDefinition().validate(
797
+ } = ContentPlatformValidator.deleteCustomObjectBySlug().validate(
711
798
  {
712
- definitionId,
799
+ definitionSlug,
800
+ slug,
713
801
  },
714
802
  { abortEarly: false, allowUnknown: false }
715
803
  );
716
804
  if (warrning) {
717
805
  Logger({
718
806
  level: "WARN",
719
- message: `Parameter Validation warrnings for platform > Content > getCustomFieldDefinition \n ${warrning}`,
807
+ message: `Parameter Validation warrnings for platform > Content > deleteCustomObjectBySlug \n ${warrning}`,
720
808
  });
721
809
  }
722
810
 
@@ -726,8 +814,8 @@ class Content {
726
814
 
727
815
  const response = await PlatformAPIClient.execute(
728
816
  this.config,
729
- "get",
730
- `/service/platform/content/v1.0/company/${this.config.companyId}/metafields/definitions/${definitionId}`,
817
+ "delete",
818
+ `/service/platform/content/v2.0/company/${this.config.companyId}/customobjects/definition/${definitionSlug}/entries/${slug}`,
731
819
  query_params,
732
820
  undefined,
733
821
  { ...xHeaders, ...requestHeaders },
@@ -741,10 +829,10 @@ class Content {
741
829
 
742
830
  const {
743
831
  error: res_error,
744
- } = ContentPlatformModel.CustomFieldDefinitionDetailResSchema().validate(
745
- responseData,
746
- { abortEarly: false, allowUnknown: true }
747
- );
832
+ } = ContentPlatformModel.CustomDataDeleteSchema().validate(responseData, {
833
+ abortEarly: false,
834
+ allowUnknown: true,
835
+ });
748
836
 
749
837
  if (res_error) {
750
838
  if (this.config.options.strictResponseCheck === true) {
@@ -752,7 +840,7 @@ class Content {
752
840
  } else {
753
841
  Logger({
754
842
  level: "WARN",
755
- message: `Response Validation Warnings for platform > Content > getCustomFieldDefinition \n ${res_error}`,
843
+ message: `Response Validation Warnings for platform > Content > deleteCustomObjectBySlug \n ${res_error}`,
756
844
  });
757
845
  }
758
846
  }
@@ -761,30 +849,27 @@ class Content {
761
849
  }
762
850
 
763
851
  /**
764
- * @param {ContentPlatformValidator.GetCustomFieldDefinitionsParam} arg - Arg object
852
+ * @param {ContentPlatformValidator.DeleteCustomObjectDefinitionBySlugParam} arg
853
+ * - Arg object
854
+ *
765
855
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
766
856
  * @param {import("../PlatformAPIClient").Options} - Options
767
- * @returns {Promise<ContentPlatformModel.CustomFieldDefinitionsSchema>} -
768
- * Success response
769
- * @name getCustomFieldDefinitions
770
- * @summary: Get custom fields definitions
771
- * @description: Custom field definitions enable you to include data validation for custom fields, and enable sellers to add custom fields values for resources. With the help of this seller can retrive list of custom field definitions list. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/content/getCustomFieldDefinitions/).
857
+ * @returns {Promise<ContentPlatformModel.CustomObjectDefinitionDeleteResponseSchema>}
858
+ * - Success response
859
+ *
860
+ * @name deleteCustomObjectDefinitionBySlug
861
+ * @summary: Delete custom object definition
862
+ * @description: Custom object definitions can be deleted using this endpoint by providing the definition ID. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/content/deleteCustomObjectDefinitionBySlug/).
772
863
  */
773
- async getCustomFieldDefinitions(
774
- { pageNo, pageSize, resource, type, search, requestHeaders } = {
775
- requestHeaders: {},
776
- },
864
+ async deleteCustomObjectDefinitionBySlug(
865
+ { slug, requestHeaders } = { requestHeaders: {} },
777
866
  { responseHeaders } = { responseHeaders: false }
778
867
  ) {
779
868
  const {
780
869
  error,
781
- } = ContentPlatformValidator.getCustomFieldDefinitions().validate(
870
+ } = ContentPlatformValidator.deleteCustomObjectDefinitionBySlug().validate(
782
871
  {
783
- pageNo,
784
- pageSize,
785
- resource,
786
- type,
787
- search,
872
+ slug,
788
873
  },
789
874
  { abortEarly: false, allowUnknown: true }
790
875
  );
@@ -795,36 +880,27 @@ class Content {
795
880
  // Showing warrnings if extra unknown parameters are found
796
881
  const {
797
882
  error: warrning,
798
- } = ContentPlatformValidator.getCustomFieldDefinitions().validate(
883
+ } = ContentPlatformValidator.deleteCustomObjectDefinitionBySlug().validate(
799
884
  {
800
- pageNo,
801
- pageSize,
802
- resource,
803
- type,
804
- search,
885
+ slug,
805
886
  },
806
887
  { abortEarly: false, allowUnknown: false }
807
888
  );
808
889
  if (warrning) {
809
890
  Logger({
810
891
  level: "WARN",
811
- message: `Parameter Validation warrnings for platform > Content > getCustomFieldDefinitions \n ${warrning}`,
892
+ message: `Parameter Validation warrnings for platform > Content > deleteCustomObjectDefinitionBySlug \n ${warrning}`,
812
893
  });
813
894
  }
814
895
 
815
896
  const query_params = {};
816
- query_params["page_no"] = pageNo;
817
- query_params["page_size"] = pageSize;
818
- query_params["resource"] = resource;
819
- query_params["type"] = type;
820
- query_params["search"] = search;
821
897
 
822
898
  const xHeaders = {};
823
899
 
824
900
  const response = await PlatformAPIClient.execute(
825
901
  this.config,
826
- "get",
827
- `/service/platform/content/v1.0/company/${this.config.companyId}/metafields/definitions`,
902
+ "delete",
903
+ `/service/platform/content/v2.0/company/${this.config.companyId}/customobjects/definition/${slug}`,
828
904
  query_params,
829
905
  undefined,
830
906
  { ...xHeaders, ...requestHeaders },
@@ -838,7 +914,7 @@ class Content {
838
914
 
839
915
  const {
840
916
  error: res_error,
841
- } = ContentPlatformModel.CustomFieldDefinitionsSchema().validate(
917
+ } = ContentPlatformModel.CustomObjectDefinitionDeleteResponseSchema().validate(
842
918
  responseData,
843
919
  { abortEarly: false, allowUnknown: true }
844
920
  );
@@ -849,7 +925,7 @@ class Content {
849
925
  } else {
850
926
  Logger({
851
927
  level: "WARN",
852
- message: `Response Validation Warnings for platform > Content > getCustomFieldDefinitions \n ${res_error}`,
928
+ message: `Response Validation Warnings for platform > Content > deleteCustomObjectDefinitionBySlug \n ${res_error}`,
853
929
  });
854
930
  }
855
931
  }
@@ -858,20 +934,28 @@ class Content {
858
934
  }
859
935
 
860
936
  /**
861
- * @param {ContentPlatformValidator.GetCustomFieldTypesParam} arg - Arg object
937
+ * @param {ContentPlatformValidator.ExportCustomObjectEntriesBySlugParam} arg
938
+ * - Arg object
939
+ *
862
940
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
863
941
  * @param {import("../PlatformAPIClient").Options} - Options
864
- * @returns {Promise<ContentPlatformModel.CustomObjectByIdSchema>} - Success response
865
- * @name getCustomFieldTypes
866
- * @summary: Get custom field types
867
- * @description: Each custom field and custom field definition has a type, which defines the type of information that it can store. The custom field types have built-in validation. This api will give list of supported custom fields types - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/content/getCustomFieldTypes/).
942
+ * @returns {Promise<ContentPlatformModel.CustomObjectBulkEntryInitiateDownload>}
943
+ * - Success response
944
+ *
945
+ * @name exportCustomObjectEntriesBySlug
946
+ * @summary: Initiate download for bulk custom object entries
947
+ * @description: Custom object bulk export of bulk entries can be perform using this endpoint. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/content/exportCustomObjectEntriesBySlug/).
868
948
  */
869
- async getCustomFieldTypes(
870
- { requestHeaders } = { requestHeaders: {} },
949
+ async exportCustomObjectEntriesBySlug(
950
+ { slug, requestHeaders } = { requestHeaders: {} },
871
951
  { responseHeaders } = { responseHeaders: false }
872
952
  ) {
873
- const { error } = ContentPlatformValidator.getCustomFieldTypes().validate(
874
- {},
953
+ const {
954
+ error,
955
+ } = ContentPlatformValidator.exportCustomObjectEntriesBySlug().validate(
956
+ {
957
+ slug,
958
+ },
875
959
  { abortEarly: false, allowUnknown: true }
876
960
  );
877
961
  if (error) {
@@ -881,14 +965,16 @@ class Content {
881
965
  // Showing warrnings if extra unknown parameters are found
882
966
  const {
883
967
  error: warrning,
884
- } = ContentPlatformValidator.getCustomFieldTypes().validate(
885
- {},
968
+ } = ContentPlatformValidator.exportCustomObjectEntriesBySlug().validate(
969
+ {
970
+ slug,
971
+ },
886
972
  { abortEarly: false, allowUnknown: false }
887
973
  );
888
974
  if (warrning) {
889
975
  Logger({
890
976
  level: "WARN",
891
- message: `Parameter Validation warrnings for platform > Content > getCustomFieldTypes \n ${warrning}`,
977
+ message: `Parameter Validation warrnings for platform > Content > exportCustomObjectEntriesBySlug \n ${warrning}`,
892
978
  });
893
979
  }
894
980
 
@@ -899,7 +985,7 @@ class Content {
899
985
  const response = await PlatformAPIClient.execute(
900
986
  this.config,
901
987
  "get",
902
- `/service/platform/content/v1.0/company/${this.config.companyId}/metafields/types`,
988
+ `/service/platform/content/v2.0/company/${this.config.companyId}/customobjects/definition/${slug}/bulk/download`,
903
989
  query_params,
904
990
  undefined,
905
991
  { ...xHeaders, ...requestHeaders },
@@ -913,10 +999,10 @@ class Content {
913
999
 
914
1000
  const {
915
1001
  error: res_error,
916
- } = ContentPlatformModel.CustomObjectByIdSchema().validate(responseData, {
917
- abortEarly: false,
918
- allowUnknown: true,
919
- });
1002
+ } = ContentPlatformModel.CustomObjectBulkEntryInitiateDownload().validate(
1003
+ responseData,
1004
+ { abortEarly: false, allowUnknown: true }
1005
+ );
920
1006
 
921
1007
  if (res_error) {
922
1008
  if (this.config.options.strictResponseCheck === true) {
@@ -924,7 +1010,7 @@ class Content {
924
1010
  } else {
925
1011
  Logger({
926
1012
  level: "WARN",
927
- message: `Response Validation Warnings for platform > Content > getCustomFieldTypes \n ${res_error}`,
1013
+ message: `Response Validation Warnings for platform > Content > exportCustomObjectEntriesBySlug \n ${res_error}`,
928
1014
  });
929
1015
  }
930
1016
  }
@@ -933,22 +1019,23 @@ class Content {
933
1019
  }
934
1020
 
935
1021
  /**
936
- * @param {ContentPlatformValidator.GetCustomFieldsParam} arg - Arg object
1022
+ * @param {ContentPlatformValidator.GetAllResourceDefinitionsParam} arg - Arg object
937
1023
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
938
1024
  * @param {import("../PlatformAPIClient").Options} - Options
939
- * @returns {Promise<ContentPlatformModel.CustomFieldsResponseSchema>} -
940
- * Success response
941
- * @name getCustomFields
942
- * @summary: Get list of custom fields of given resource
943
- * @description: Retrieves a list of custom fields attached to a particular resource by using the resource. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/content/getCustomFields/).
1025
+ * @returns {Promise<Object>} - Success response
1026
+ * @name getAllResourceDefinitions
1027
+ * @summary: Get all resource defination
1028
+ * @description: Retrieve translation schemas and configurations for resources. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/content/getAllResourceDefinitions/).
944
1029
  */
945
- async getCustomFields(
946
- { resource, requestHeaders } = { requestHeaders: {} },
1030
+ async getAllResourceDefinitions(
1031
+ { translatableResourceId, requestHeaders } = { requestHeaders: {} },
947
1032
  { responseHeaders } = { responseHeaders: false }
948
1033
  ) {
949
- const { error } = ContentPlatformValidator.getCustomFields().validate(
1034
+ const {
1035
+ error,
1036
+ } = ContentPlatformValidator.getAllResourceDefinitions().validate(
950
1037
  {
951
- resource,
1038
+ translatableResourceId,
952
1039
  },
953
1040
  { abortEarly: false, allowUnknown: true }
954
1041
  );
@@ -959,27 +1046,28 @@ class Content {
959
1046
  // Showing warrnings if extra unknown parameters are found
960
1047
  const {
961
1048
  error: warrning,
962
- } = ContentPlatformValidator.getCustomFields().validate(
1049
+ } = ContentPlatformValidator.getAllResourceDefinitions().validate(
963
1050
  {
964
- resource,
1051
+ translatableResourceId,
965
1052
  },
966
1053
  { abortEarly: false, allowUnknown: false }
967
1054
  );
968
1055
  if (warrning) {
969
1056
  Logger({
970
1057
  level: "WARN",
971
- message: `Parameter Validation warrnings for platform > Content > getCustomFields \n ${warrning}`,
1058
+ message: `Parameter Validation warrnings for platform > Content > getAllResourceDefinitions \n ${warrning}`,
972
1059
  });
973
1060
  }
974
1061
 
975
1062
  const query_params = {};
1063
+ query_params["translatable_resource_id"] = translatableResourceId;
976
1064
 
977
1065
  const xHeaders = {};
978
1066
 
979
1067
  const response = await PlatformAPIClient.execute(
980
1068
  this.config,
981
1069
  "get",
982
- `/service/platform/content/v1.0/company/${this.config.companyId}/metafields/${resource}`,
1070
+ `/service/platform/content/v1.0/company/${this.config.companyId}/translatable/resource/definitions`,
983
1071
  query_params,
984
1072
  undefined,
985
1073
  { ...xHeaders, ...requestHeaders },
@@ -991,12 +1079,10 @@ class Content {
991
1079
  responseData = response[0];
992
1080
  }
993
1081
 
994
- const {
995
- error: res_error,
996
- } = ContentPlatformModel.CustomFieldsResponseSchema().validate(
997
- responseData,
998
- { abortEarly: false, allowUnknown: true }
999
- );
1082
+ const { error: res_error } = Joi.any().validate(responseData, {
1083
+ abortEarly: false,
1084
+ allowUnknown: true,
1085
+ });
1000
1086
 
1001
1087
  if (res_error) {
1002
1088
  if (this.config.options.strictResponseCheck === true) {
@@ -1004,7 +1090,7 @@ class Content {
1004
1090
  } else {
1005
1091
  Logger({
1006
1092
  level: "WARN",
1007
- message: `Response Validation Warnings for platform > Content > getCustomFields \n ${res_error}`,
1093
+ message: `Response Validation Warnings for platform > Content > getAllResourceDefinitions \n ${res_error}`,
1008
1094
  });
1009
1095
  }
1010
1096
  }
@@ -1013,27 +1099,20 @@ class Content {
1013
1099
  }
1014
1100
 
1015
1101
  /**
1016
- * @param {ContentPlatformValidator.GetCustomFieldsByResourceIdParam} arg - Arg object
1102
+ * @param {ContentPlatformValidator.GetAllSectionsParam} arg - Arg object
1017
1103
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1018
1104
  * @param {import("../PlatformAPIClient").Options} - Options
1019
- * @returns {Promise<ContentPlatformModel.CustomFieldsResponseByResourceIdSchema>}
1020
- * - Success response
1021
- *
1022
- * @name getCustomFieldsByResourceId
1023
- * @summary: Get list of custom fields of given resource and resource id
1024
- * @description: Retrieves a list of custom fields attached to a particular resource by using the resource and resource id. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/content/getCustomFieldsByResourceId/).
1105
+ * @returns {Promise<Object>} - Success response
1106
+ * @name getAllSections
1107
+ * @summary: List all translatable content sections
1108
+ * @description: Retrieve all translatable content sections for organization. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/content/getAllSections/).
1025
1109
  */
1026
- async getCustomFieldsByResourceId(
1027
- { resource, resourceId, requestHeaders } = { requestHeaders: {} },
1110
+ async getAllSections(
1111
+ { requestHeaders } = { requestHeaders: {} },
1028
1112
  { responseHeaders } = { responseHeaders: false }
1029
1113
  ) {
1030
- const {
1031
- error,
1032
- } = ContentPlatformValidator.getCustomFieldsByResourceId().validate(
1033
- {
1034
- resource,
1035
- resourceId,
1036
- },
1114
+ const { error } = ContentPlatformValidator.getAllSections().validate(
1115
+ {},
1037
1116
  { abortEarly: false, allowUnknown: true }
1038
1117
  );
1039
1118
  if (error) {
@@ -1043,17 +1122,14 @@ class Content {
1043
1122
  // Showing warrnings if extra unknown parameters are found
1044
1123
  const {
1045
1124
  error: warrning,
1046
- } = ContentPlatformValidator.getCustomFieldsByResourceId().validate(
1047
- {
1048
- resource,
1049
- resourceId,
1050
- },
1125
+ } = ContentPlatformValidator.getAllSections().validate(
1126
+ {},
1051
1127
  { abortEarly: false, allowUnknown: false }
1052
1128
  );
1053
1129
  if (warrning) {
1054
1130
  Logger({
1055
1131
  level: "WARN",
1056
- message: `Parameter Validation warrnings for platform > Content > getCustomFieldsByResourceId \n ${warrning}`,
1132
+ message: `Parameter Validation warrnings for platform > Content > getAllSections \n ${warrning}`,
1057
1133
  });
1058
1134
  }
1059
1135
 
@@ -1064,7 +1140,7 @@ class Content {
1064
1140
  const response = await PlatformAPIClient.execute(
1065
1141
  this.config,
1066
1142
  "get",
1067
- `/service/platform/content/v1.0/company/${this.config.companyId}/metafields/${resource}/${resourceId}`,
1143
+ `/service/platform/content/v1.0/company/${this.config.companyId}/translatable/sections`,
1068
1144
  query_params,
1069
1145
  undefined,
1070
1146
  { ...xHeaders, ...requestHeaders },
@@ -1076,12 +1152,10 @@ class Content {
1076
1152
  responseData = response[0];
1077
1153
  }
1078
1154
 
1079
- const {
1080
- error: res_error,
1081
- } = ContentPlatformModel.CustomFieldsResponseByResourceIdSchema().validate(
1082
- responseData,
1083
- { abortEarly: false, allowUnknown: true }
1084
- );
1155
+ const { error: res_error } = Joi.any().validate(responseData, {
1156
+ abortEarly: false,
1157
+ allowUnknown: true,
1158
+ });
1085
1159
 
1086
1160
  if (res_error) {
1087
1161
  if (this.config.options.strictResponseCheck === true) {
@@ -1089,7 +1163,7 @@ class Content {
1089
1163
  } else {
1090
1164
  Logger({
1091
1165
  level: "WARN",
1092
- message: `Response Validation Warnings for platform > Content > getCustomFieldsByResourceId \n ${res_error}`,
1166
+ message: `Response Validation Warnings for platform > Content > getAllSections \n ${res_error}`,
1093
1167
  });
1094
1168
  }
1095
1169
  }
@@ -1098,22 +1172,1240 @@ class Content {
1098
1172
  }
1099
1173
 
1100
1174
  /**
1101
- * @param {ContentPlatformValidator.GetCustomObjectParam} arg - Arg object
1175
+ * @param {ContentPlatformValidator.GetAllTranslatableResourcesParam} arg - Arg object
1102
1176
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1103
1177
  * @param {import("../PlatformAPIClient").Options} - Options
1104
- * @returns {Promise<ContentPlatformModel.CustomObjectByIdSchema>} - Success response
1105
- * @name getCustomObject
1106
- * @summary: Get custom object details
1107
- * @description: Details of custom objects, their field details, definitions, and references can be obtained using this endpoint. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/content/getCustomObject/).
1178
+ * @returns {Promise<Object>} - Success response
1179
+ * @name getAllTranslatableResources
1180
+ * @summary: List all translatable resources
1181
+ * @description: Retrieve all translatable content resources for the company. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/content/getAllTranslatableResources/).
1108
1182
  */
1109
- async getCustomObject(
1110
- { metaobjectId, requestHeaders } = { requestHeaders: {} },
1183
+ async getAllTranslatableResources(
1184
+ { requestHeaders } = { requestHeaders: {} },
1185
+ { responseHeaders } = { responseHeaders: false }
1186
+ ) {
1187
+ const {
1188
+ error,
1189
+ } = ContentPlatformValidator.getAllTranslatableResources().validate(
1190
+ {},
1191
+ { abortEarly: false, allowUnknown: true }
1192
+ );
1193
+ if (error) {
1194
+ return Promise.reject(new FDKClientValidationError(error));
1195
+ }
1196
+
1197
+ // Showing warrnings if extra unknown parameters are found
1198
+ const {
1199
+ error: warrning,
1200
+ } = ContentPlatformValidator.getAllTranslatableResources().validate(
1201
+ {},
1202
+ { abortEarly: false, allowUnknown: false }
1203
+ );
1204
+ if (warrning) {
1205
+ Logger({
1206
+ level: "WARN",
1207
+ message: `Parameter Validation warrnings for platform > Content > getAllTranslatableResources \n ${warrning}`,
1208
+ });
1209
+ }
1210
+
1211
+ const query_params = {};
1212
+
1213
+ const xHeaders = {};
1214
+
1215
+ const response = await PlatformAPIClient.execute(
1216
+ this.config,
1217
+ "get",
1218
+ `/service/platform/content/v1.0/company/${this.config.companyId}/translatable/resources`,
1219
+ query_params,
1220
+ undefined,
1221
+ { ...xHeaders, ...requestHeaders },
1222
+ { responseHeaders }
1223
+ );
1224
+
1225
+ let responseData = response;
1226
+ if (responseHeaders) {
1227
+ responseData = response[0];
1228
+ }
1229
+
1230
+ const { error: res_error } = Joi.any().validate(responseData, {
1231
+ abortEarly: false,
1232
+ allowUnknown: true,
1233
+ });
1234
+
1235
+ if (res_error) {
1236
+ if (this.config.options.strictResponseCheck === true) {
1237
+ return Promise.reject(new FDKResponseValidationError(res_error));
1238
+ } else {
1239
+ Logger({
1240
+ level: "WARN",
1241
+ message: `Response Validation Warnings for platform > Content > getAllTranslatableResources \n ${res_error}`,
1242
+ });
1243
+ }
1244
+ }
1245
+
1246
+ return response;
1247
+ }
1248
+
1249
+ /**
1250
+ * @param {ContentPlatformValidator.GetCompanyLanguagesParam} arg - Arg object
1251
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1252
+ * @param {import("../PlatformAPIClient").Options} - Options
1253
+ * @returns {Promise<Object>} - Success response
1254
+ * @name getCompanyLanguages
1255
+ * @summary: Get company languages
1256
+ * @description: Retrieve language configurations and settings for the specified company. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/content/getCompanyLanguages/).
1257
+ */
1258
+ async getCompanyLanguages(
1259
+ { requestHeaders } = { requestHeaders: {} },
1260
+ { responseHeaders } = { responseHeaders: false }
1261
+ ) {
1262
+ const { error } = ContentPlatformValidator.getCompanyLanguages().validate(
1263
+ {},
1264
+ { abortEarly: false, allowUnknown: true }
1265
+ );
1266
+ if (error) {
1267
+ return Promise.reject(new FDKClientValidationError(error));
1268
+ }
1269
+
1270
+ // Showing warrnings if extra unknown parameters are found
1271
+ const {
1272
+ error: warrning,
1273
+ } = ContentPlatformValidator.getCompanyLanguages().validate(
1274
+ {},
1275
+ { abortEarly: false, allowUnknown: false }
1276
+ );
1277
+ if (warrning) {
1278
+ Logger({
1279
+ level: "WARN",
1280
+ message: `Parameter Validation warrnings for platform > Content > getCompanyLanguages \n ${warrning}`,
1281
+ });
1282
+ }
1283
+
1284
+ const query_params = {};
1285
+
1286
+ const xHeaders = {};
1287
+
1288
+ const response = await PlatformAPIClient.execute(
1289
+ this.config,
1290
+ "get",
1291
+ `/service/platform/content/v1.0/company/${this.config.companyId}/languages`,
1292
+ query_params,
1293
+ undefined,
1294
+ { ...xHeaders, ...requestHeaders },
1295
+ { responseHeaders }
1296
+ );
1297
+
1298
+ let responseData = response;
1299
+ if (responseHeaders) {
1300
+ responseData = response[0];
1301
+ }
1302
+
1303
+ const { error: res_error } = Joi.any().validate(responseData, {
1304
+ abortEarly: false,
1305
+ allowUnknown: true,
1306
+ });
1307
+
1308
+ if (res_error) {
1309
+ if (this.config.options.strictResponseCheck === true) {
1310
+ return Promise.reject(new FDKResponseValidationError(res_error));
1311
+ } else {
1312
+ Logger({
1313
+ level: "WARN",
1314
+ message: `Response Validation Warnings for platform > Content > getCompanyLanguages \n ${res_error}`,
1315
+ });
1316
+ }
1317
+ }
1318
+
1319
+ return response;
1320
+ }
1321
+
1322
+ /**
1323
+ * @param {ContentPlatformValidator.GetCompanyResourceTranslationParam} arg
1324
+ * - Arg object
1325
+ *
1326
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1327
+ * @param {import("../PlatformAPIClient").Options} - Options
1328
+ * @returns {Promise<ContentPlatformModel.ResourceTranslation>} - Success response
1329
+ * @name getCompanyResourceTranslation
1330
+ * @summary: Get company translations
1331
+ * @description: Fetch translations for company-level resources. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/content/getCompanyResourceTranslation/).
1332
+ */
1333
+ async getCompanyResourceTranslation(
1334
+ { locale, type, resourceId, requestHeaders } = { requestHeaders: {} },
1335
+ { responseHeaders } = { responseHeaders: false }
1336
+ ) {
1337
+ const {
1338
+ error,
1339
+ } = ContentPlatformValidator.getCompanyResourceTranslation().validate(
1340
+ {
1341
+ locale,
1342
+ type,
1343
+ resourceId,
1344
+ },
1345
+ { abortEarly: false, allowUnknown: true }
1346
+ );
1347
+ if (error) {
1348
+ return Promise.reject(new FDKClientValidationError(error));
1349
+ }
1350
+
1351
+ // Showing warrnings if extra unknown parameters are found
1352
+ const {
1353
+ error: warrning,
1354
+ } = ContentPlatformValidator.getCompanyResourceTranslation().validate(
1355
+ {
1356
+ locale,
1357
+ type,
1358
+ resourceId,
1359
+ },
1360
+ { abortEarly: false, allowUnknown: false }
1361
+ );
1362
+ if (warrning) {
1363
+ Logger({
1364
+ level: "WARN",
1365
+ message: `Parameter Validation warrnings for platform > Content > getCompanyResourceTranslation \n ${warrning}`,
1366
+ });
1367
+ }
1368
+
1369
+ const query_params = {};
1370
+ query_params["locale"] = locale;
1371
+ query_params["type"] = type;
1372
+ query_params["resource_id"] = resourceId;
1373
+
1374
+ const xHeaders = {};
1375
+
1376
+ const response = await PlatformAPIClient.execute(
1377
+ this.config,
1378
+ "get",
1379
+ `/service/platform/content/v1.0/company/${this.config.companyId}/resource/translations`,
1380
+ query_params,
1381
+ undefined,
1382
+ { ...xHeaders, ...requestHeaders },
1383
+ { responseHeaders }
1384
+ );
1385
+
1386
+ let responseData = response;
1387
+ if (responseHeaders) {
1388
+ responseData = response[0];
1389
+ }
1390
+
1391
+ const {
1392
+ error: res_error,
1393
+ } = ContentPlatformModel.ResourceTranslation().validate(responseData, {
1394
+ abortEarly: false,
1395
+ allowUnknown: true,
1396
+ });
1397
+
1398
+ if (res_error) {
1399
+ if (this.config.options.strictResponseCheck === true) {
1400
+ return Promise.reject(new FDKResponseValidationError(res_error));
1401
+ } else {
1402
+ Logger({
1403
+ level: "WARN",
1404
+ message: `Response Validation Warnings for platform > Content > getCompanyResourceTranslation \n ${res_error}`,
1405
+ });
1406
+ }
1407
+ }
1408
+
1409
+ return response;
1410
+ }
1411
+
1412
+ /**
1413
+ * @param {ContentPlatformValidator.GetCustomFieldDefinitionByResourceParam} arg
1414
+ * - Arg object
1415
+ *
1416
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1417
+ * @param {import("../PlatformAPIClient").Options} - Options
1418
+ * @returns {Promise<ContentPlatformModel.CustomFieldDefinitionsSchema>} -
1419
+ * Success response
1420
+ * @name getCustomFieldDefinitionByResource
1421
+ * @summary: Get custom fields definitions for a given resource type
1422
+ * @description: Custom field definitions enable you to include data validation for custom fields, and enable sellers to add custom fields values for resources. With the help of this seller can retrive list of custom field definitions list. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/content/getCustomFieldDefinitionByResource/).
1423
+ */
1424
+ async getCustomFieldDefinitionByResource(
1425
+ {
1426
+ pageNo,
1427
+ pageSize,
1428
+ resource,
1429
+ types,
1430
+ search,
1431
+ slugs,
1432
+ namespaces,
1433
+ requestHeaders,
1434
+ } = { requestHeaders: {} },
1435
+ { responseHeaders } = { responseHeaders: false }
1436
+ ) {
1437
+ const {
1438
+ error,
1439
+ } = ContentPlatformValidator.getCustomFieldDefinitionByResource().validate(
1440
+ {
1441
+ pageNo,
1442
+ pageSize,
1443
+ resource,
1444
+ types,
1445
+ search,
1446
+ slugs,
1447
+ namespaces,
1448
+ },
1449
+ { abortEarly: false, allowUnknown: true }
1450
+ );
1451
+ if (error) {
1452
+ return Promise.reject(new FDKClientValidationError(error));
1453
+ }
1454
+
1455
+ // Showing warrnings if extra unknown parameters are found
1456
+ const {
1457
+ error: warrning,
1458
+ } = ContentPlatformValidator.getCustomFieldDefinitionByResource().validate(
1459
+ {
1460
+ pageNo,
1461
+ pageSize,
1462
+ resource,
1463
+ types,
1464
+ search,
1465
+ slugs,
1466
+ namespaces,
1467
+ },
1468
+ { abortEarly: false, allowUnknown: false }
1469
+ );
1470
+ if (warrning) {
1471
+ Logger({
1472
+ level: "WARN",
1473
+ message: `Parameter Validation warrnings for platform > Content > getCustomFieldDefinitionByResource \n ${warrning}`,
1474
+ });
1475
+ }
1476
+
1477
+ const query_params = {};
1478
+ query_params["page_no"] = pageNo;
1479
+ query_params["page_size"] = pageSize;
1480
+ query_params["types"] = types;
1481
+ query_params["search"] = search;
1482
+ query_params["slugs"] = slugs;
1483
+ query_params["namespaces"] = namespaces;
1484
+
1485
+ const xHeaders = {};
1486
+
1487
+ const response = await PlatformAPIClient.execute(
1488
+ this.config,
1489
+ "get",
1490
+ `/service/platform/content/v2.0/company/${this.config.companyId}/customfields/resource/${resource}/definition`,
1491
+ query_params,
1492
+ undefined,
1493
+ { ...xHeaders, ...requestHeaders },
1494
+ { responseHeaders }
1495
+ );
1496
+
1497
+ let responseData = response;
1498
+ if (responseHeaders) {
1499
+ responseData = response[0];
1500
+ }
1501
+
1502
+ const {
1503
+ error: res_error,
1504
+ } = ContentPlatformModel.CustomFieldDefinitionsSchema().validate(
1505
+ responseData,
1506
+ { abortEarly: false, allowUnknown: true }
1507
+ );
1508
+
1509
+ if (res_error) {
1510
+ if (this.config.options.strictResponseCheck === true) {
1511
+ return Promise.reject(new FDKResponseValidationError(res_error));
1512
+ } else {
1513
+ Logger({
1514
+ level: "WARN",
1515
+ message: `Response Validation Warnings for platform > Content > getCustomFieldDefinitionByResource \n ${res_error}`,
1516
+ });
1517
+ }
1518
+ }
1519
+
1520
+ return response;
1521
+ }
1522
+
1523
+ /**
1524
+ * @param {ContentPlatformValidator.GetCustomFieldDefinitionBySlugParam} arg
1525
+ * - Arg object
1526
+ *
1527
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1528
+ * @param {import("../PlatformAPIClient").Options} - Options
1529
+ * @returns {Promise<ContentPlatformModel.MetaFieldDefinitionDetailResSchema>}
1530
+ * - Success response
1531
+ *
1532
+ * @name getCustomFieldDefinitionBySlug
1533
+ * @summary: Get custom fields definition by resource, slug and namespace
1534
+ * @description: Custom field definitions can be retrived from this using its slug, namespace and resource - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/content/getCustomFieldDefinitionBySlug/).
1535
+ */
1536
+ async getCustomFieldDefinitionBySlug(
1537
+ { slug, resource, namespace, requestHeaders } = { requestHeaders: {} },
1538
+ { responseHeaders } = { responseHeaders: false }
1539
+ ) {
1540
+ const {
1541
+ error,
1542
+ } = ContentPlatformValidator.getCustomFieldDefinitionBySlug().validate(
1543
+ {
1544
+ slug,
1545
+ resource,
1546
+ namespace,
1547
+ },
1548
+ { abortEarly: false, allowUnknown: true }
1549
+ );
1550
+ if (error) {
1551
+ return Promise.reject(new FDKClientValidationError(error));
1552
+ }
1553
+
1554
+ // Showing warrnings if extra unknown parameters are found
1555
+ const {
1556
+ error: warrning,
1557
+ } = ContentPlatformValidator.getCustomFieldDefinitionBySlug().validate(
1558
+ {
1559
+ slug,
1560
+ resource,
1561
+ namespace,
1562
+ },
1563
+ { abortEarly: false, allowUnknown: false }
1564
+ );
1565
+ if (warrning) {
1566
+ Logger({
1567
+ level: "WARN",
1568
+ message: `Parameter Validation warrnings for platform > Content > getCustomFieldDefinitionBySlug \n ${warrning}`,
1569
+ });
1570
+ }
1571
+
1572
+ const query_params = {};
1573
+
1574
+ const xHeaders = {};
1575
+
1576
+ const response = await PlatformAPIClient.execute(
1577
+ this.config,
1578
+ "get",
1579
+ `/service/platform/content/v2.0/company/${this.config.companyId}/customfields/resource/${resource}/namespace/${namespace}/definition/${slug}`,
1580
+ query_params,
1581
+ undefined,
1582
+ { ...xHeaders, ...requestHeaders },
1583
+ { responseHeaders }
1584
+ );
1585
+
1586
+ let responseData = response;
1587
+ if (responseHeaders) {
1588
+ responseData = response[0];
1589
+ }
1590
+
1591
+ const {
1592
+ error: res_error,
1593
+ } = ContentPlatformModel.MetaFieldDefinitionDetailResSchema().validate(
1594
+ responseData,
1595
+ { abortEarly: false, allowUnknown: true }
1596
+ );
1597
+
1598
+ if (res_error) {
1599
+ if (this.config.options.strictResponseCheck === true) {
1600
+ return Promise.reject(new FDKResponseValidationError(res_error));
1601
+ } else {
1602
+ Logger({
1603
+ level: "WARN",
1604
+ message: `Response Validation Warnings for platform > Content > getCustomFieldDefinitionBySlug \n ${res_error}`,
1605
+ });
1606
+ }
1607
+ }
1608
+
1609
+ return response;
1610
+ }
1611
+
1612
+ /**
1613
+ * @param {ContentPlatformValidator.GetCustomFieldDefinitionsParam} arg - Arg object
1614
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1615
+ * @param {import("../PlatformAPIClient").Options} - Options
1616
+ * @returns {Promise<ContentPlatformModel.CustomFieldDefinitionsSchema>} -
1617
+ * Success response
1618
+ * @name getCustomFieldDefinitions
1619
+ * @summary: Get custom fields definitions
1620
+ * @description: Custom field definitions enable you to include data validation for custom fields, and enable sellers to add custom fields values for resources. With the help of this seller can retrive list of custom field definitions list. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/content/getCustomFieldDefinitions/).
1621
+ */
1622
+ async getCustomFieldDefinitions(
1623
+ {
1624
+ pageNo,
1625
+ pageSize,
1626
+ resources,
1627
+ types,
1628
+ search,
1629
+ slugs,
1630
+ namespaces,
1631
+ requestHeaders,
1632
+ } = { requestHeaders: {} },
1633
+ { responseHeaders } = { responseHeaders: false }
1634
+ ) {
1635
+ const {
1636
+ error,
1637
+ } = ContentPlatformValidator.getCustomFieldDefinitions().validate(
1638
+ {
1639
+ pageNo,
1640
+ pageSize,
1641
+ resources,
1642
+ types,
1643
+ search,
1644
+ slugs,
1645
+ namespaces,
1646
+ },
1647
+ { abortEarly: false, allowUnknown: true }
1648
+ );
1649
+ if (error) {
1650
+ return Promise.reject(new FDKClientValidationError(error));
1651
+ }
1652
+
1653
+ // Showing warrnings if extra unknown parameters are found
1654
+ const {
1655
+ error: warrning,
1656
+ } = ContentPlatformValidator.getCustomFieldDefinitions().validate(
1657
+ {
1658
+ pageNo,
1659
+ pageSize,
1660
+ resources,
1661
+ types,
1662
+ search,
1663
+ slugs,
1664
+ namespaces,
1665
+ },
1666
+ { abortEarly: false, allowUnknown: false }
1667
+ );
1668
+ if (warrning) {
1669
+ Logger({
1670
+ level: "WARN",
1671
+ message: `Parameter Validation warrnings for platform > Content > getCustomFieldDefinitions \n ${warrning}`,
1672
+ });
1673
+ }
1674
+
1675
+ const query_params = {};
1676
+ query_params["page_no"] = pageNo;
1677
+ query_params["page_size"] = pageSize;
1678
+ query_params["resources"] = resources;
1679
+ query_params["types"] = types;
1680
+ query_params["search"] = search;
1681
+ query_params["slugs"] = slugs;
1682
+ query_params["namespaces"] = namespaces;
1683
+
1684
+ const xHeaders = {};
1685
+
1686
+ const response = await PlatformAPIClient.execute(
1687
+ this.config,
1688
+ "get",
1689
+ `/service/platform/content/v2.0/company/${this.config.companyId}/customfields/definition`,
1690
+ query_params,
1691
+ undefined,
1692
+ { ...xHeaders, ...requestHeaders },
1693
+ { responseHeaders }
1694
+ );
1695
+
1696
+ let responseData = response;
1697
+ if (responseHeaders) {
1698
+ responseData = response[0];
1699
+ }
1700
+
1701
+ const {
1702
+ error: res_error,
1703
+ } = ContentPlatformModel.CustomFieldDefinitionsSchema().validate(
1704
+ responseData,
1705
+ { abortEarly: false, allowUnknown: true }
1706
+ );
1707
+
1708
+ if (res_error) {
1709
+ if (this.config.options.strictResponseCheck === true) {
1710
+ return Promise.reject(new FDKResponseValidationError(res_error));
1711
+ } else {
1712
+ Logger({
1713
+ level: "WARN",
1714
+ message: `Response Validation Warnings for platform > Content > getCustomFieldDefinitions \n ${res_error}`,
1715
+ });
1716
+ }
1717
+ }
1718
+
1719
+ return response;
1720
+ }
1721
+
1722
+ /**
1723
+ * @param {ContentPlatformValidator.GetCustomFieldTypesParam} arg - Arg object
1724
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1725
+ * @param {import("../PlatformAPIClient").Options} - Options
1726
+ * @returns {Promise<ContentPlatformModel.MetafieldTypesSchema>} - Success response
1727
+ * @name getCustomFieldTypes
1728
+ * @summary: Get custom field types
1729
+ * @description: Each custom field and custom field definition has a type, which defines the type of information that it can store. The custom field types have built-in validation. This api will give list of supported custom fields types - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/content/getCustomFieldTypes/).
1730
+ */
1731
+ async getCustomFieldTypes(
1732
+ { requestHeaders } = { requestHeaders: {} },
1733
+ { responseHeaders } = { responseHeaders: false }
1734
+ ) {
1735
+ const { error } = ContentPlatformValidator.getCustomFieldTypes().validate(
1736
+ {},
1737
+ { abortEarly: false, allowUnknown: true }
1738
+ );
1739
+ if (error) {
1740
+ return Promise.reject(new FDKClientValidationError(error));
1741
+ }
1742
+
1743
+ // Showing warrnings if extra unknown parameters are found
1744
+ const {
1745
+ error: warrning,
1746
+ } = ContentPlatformValidator.getCustomFieldTypes().validate(
1747
+ {},
1748
+ { abortEarly: false, allowUnknown: false }
1749
+ );
1750
+ if (warrning) {
1751
+ Logger({
1752
+ level: "WARN",
1753
+ message: `Parameter Validation warrnings for platform > Content > getCustomFieldTypes \n ${warrning}`,
1754
+ });
1755
+ }
1756
+
1757
+ const query_params = {};
1758
+
1759
+ const xHeaders = {};
1760
+
1761
+ const response = await PlatformAPIClient.execute(
1762
+ this.config,
1763
+ "get",
1764
+ `/service/platform/content/v1.0/company/${this.config.companyId}/metafields/types`,
1765
+ query_params,
1766
+ undefined,
1767
+ { ...xHeaders, ...requestHeaders },
1768
+ { responseHeaders }
1769
+ );
1770
+
1771
+ let responseData = response;
1772
+ if (responseHeaders) {
1773
+ responseData = response[0];
1774
+ }
1775
+
1776
+ const {
1777
+ error: res_error,
1778
+ } = ContentPlatformModel.MetafieldTypesSchema().validate(responseData, {
1779
+ abortEarly: false,
1780
+ allowUnknown: true,
1781
+ });
1782
+
1783
+ if (res_error) {
1784
+ if (this.config.options.strictResponseCheck === true) {
1785
+ return Promise.reject(new FDKResponseValidationError(res_error));
1786
+ } else {
1787
+ Logger({
1788
+ level: "WARN",
1789
+ message: `Response Validation Warnings for platform > Content > getCustomFieldTypes \n ${res_error}`,
1790
+ });
1791
+ }
1792
+ }
1793
+
1794
+ return response;
1795
+ }
1796
+
1797
+ /**
1798
+ * @param {ContentPlatformValidator.GetCustomFieldsByResourceSlugParam} arg
1799
+ * - Arg object
1800
+ *
1801
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1802
+ * @param {import("../PlatformAPIClient").Options} - Options
1803
+ * @returns {Promise<ContentPlatformModel.CustomFieldsResponseByResourceIdSchema>}
1804
+ * - Success response
1805
+ *
1806
+ * @name getCustomFieldsByResourceSlug
1807
+ * @summary: Get list of custom fields of given resource and resource slug
1808
+ * @description: Retrieves a list of custom fields attached to a particular resource by using the resource and resource slug. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/content/getCustomFieldsByResourceSlug/).
1809
+ */
1810
+ async getCustomFieldsByResourceSlug(
1811
+ { resource, resourceSlug, requestHeaders } = { requestHeaders: {} },
1812
+ { responseHeaders } = { responseHeaders: false }
1813
+ ) {
1814
+ const {
1815
+ error,
1816
+ } = ContentPlatformValidator.getCustomFieldsByResourceSlug().validate(
1817
+ {
1818
+ resource,
1819
+ resourceSlug,
1820
+ },
1821
+ { abortEarly: false, allowUnknown: true }
1822
+ );
1823
+ if (error) {
1824
+ return Promise.reject(new FDKClientValidationError(error));
1825
+ }
1826
+
1827
+ // Showing warrnings if extra unknown parameters are found
1828
+ const {
1829
+ error: warrning,
1830
+ } = ContentPlatformValidator.getCustomFieldsByResourceSlug().validate(
1831
+ {
1832
+ resource,
1833
+ resourceSlug,
1834
+ },
1835
+ { abortEarly: false, allowUnknown: false }
1836
+ );
1837
+ if (warrning) {
1838
+ Logger({
1839
+ level: "WARN",
1840
+ message: `Parameter Validation warrnings for platform > Content > getCustomFieldsByResourceSlug \n ${warrning}`,
1841
+ });
1842
+ }
1843
+
1844
+ const query_params = {};
1845
+
1846
+ const xHeaders = {};
1847
+
1848
+ const response = await PlatformAPIClient.execute(
1849
+ this.config,
1850
+ "get",
1851
+ `/service/platform/content/v2.0/company/${this.config.companyId}/customfields/resource/${resource}/${resourceSlug}`,
1852
+ query_params,
1853
+ undefined,
1854
+ { ...xHeaders, ...requestHeaders },
1855
+ { responseHeaders }
1856
+ );
1857
+
1858
+ let responseData = response;
1859
+ if (responseHeaders) {
1860
+ responseData = response[0];
1861
+ }
1862
+
1863
+ const {
1864
+ error: res_error,
1865
+ } = ContentPlatformModel.CustomFieldsResponseByResourceIdSchema().validate(
1866
+ responseData,
1867
+ { abortEarly: false, allowUnknown: true }
1868
+ );
1869
+
1870
+ if (res_error) {
1871
+ if (this.config.options.strictResponseCheck === true) {
1872
+ return Promise.reject(new FDKResponseValidationError(res_error));
1873
+ } else {
1874
+ Logger({
1875
+ level: "WARN",
1876
+ message: `Response Validation Warnings for platform > Content > getCustomFieldsByResourceSlug \n ${res_error}`,
1877
+ });
1878
+ }
1879
+ }
1880
+
1881
+ return response;
1882
+ }
1883
+
1884
+ /**
1885
+ * @param {ContentPlatformValidator.GetCustomObjectBySlugParam} arg - Arg object
1886
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1887
+ * @param {import("../PlatformAPIClient").Options} - Options
1888
+ * @returns {Promise<ContentPlatformModel.CustomObjectBySlugSchema>} -
1889
+ * Success response
1890
+ * @name getCustomObjectBySlug
1891
+ * @summary: Get custom object details
1892
+ * @description: Details of a custom object entry can be obtained using this endpoint. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/content/getCustomObjectBySlug/).
1893
+ */
1894
+ async getCustomObjectBySlug(
1895
+ { definitionSlug, slug, requestHeaders } = { requestHeaders: {} },
1896
+ { responseHeaders } = { responseHeaders: false }
1897
+ ) {
1898
+ const { error } = ContentPlatformValidator.getCustomObjectBySlug().validate(
1899
+ {
1900
+ definitionSlug,
1901
+ slug,
1902
+ },
1903
+ { abortEarly: false, allowUnknown: true }
1904
+ );
1905
+ if (error) {
1906
+ return Promise.reject(new FDKClientValidationError(error));
1907
+ }
1908
+
1909
+ // Showing warrnings if extra unknown parameters are found
1910
+ const {
1911
+ error: warrning,
1912
+ } = ContentPlatformValidator.getCustomObjectBySlug().validate(
1913
+ {
1914
+ definitionSlug,
1915
+ slug,
1916
+ },
1917
+ { abortEarly: false, allowUnknown: false }
1918
+ );
1919
+ if (warrning) {
1920
+ Logger({
1921
+ level: "WARN",
1922
+ message: `Parameter Validation warrnings for platform > Content > getCustomObjectBySlug \n ${warrning}`,
1923
+ });
1924
+ }
1925
+
1926
+ const query_params = {};
1927
+
1928
+ const xHeaders = {};
1929
+
1930
+ const response = await PlatformAPIClient.execute(
1931
+ this.config,
1932
+ "get",
1933
+ `/service/platform/content/v2.0/company/${this.config.companyId}/customobjects/definition/${definitionSlug}/entries/${slug}`,
1934
+ query_params,
1935
+ undefined,
1936
+ { ...xHeaders, ...requestHeaders },
1937
+ { responseHeaders }
1938
+ );
1939
+
1940
+ let responseData = response;
1941
+ if (responseHeaders) {
1942
+ responseData = response[0];
1943
+ }
1944
+
1945
+ const {
1946
+ error: res_error,
1947
+ } = ContentPlatformModel.CustomObjectBySlugSchema().validate(responseData, {
1948
+ abortEarly: false,
1949
+ allowUnknown: true,
1950
+ });
1951
+
1952
+ if (res_error) {
1953
+ if (this.config.options.strictResponseCheck === true) {
1954
+ return Promise.reject(new FDKResponseValidationError(res_error));
1955
+ } else {
1956
+ Logger({
1957
+ level: "WARN",
1958
+ message: `Response Validation Warnings for platform > Content > getCustomObjectBySlug \n ${res_error}`,
1959
+ });
1960
+ }
1961
+ }
1962
+
1963
+ return response;
1964
+ }
1965
+
1966
+ /**
1967
+ * @param {ContentPlatformValidator.GetCustomObjectDefinitionBySlugParam} arg
1968
+ * - Arg object
1969
+ *
1970
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1971
+ * @param {import("../PlatformAPIClient").Options} - Options
1972
+ * @returns {Promise<ContentPlatformModel.CustomObjectDefinitionSlugSchema>}
1973
+ * - Success response
1974
+ *
1975
+ * @name getCustomObjectDefinitionBySlug
1976
+ * @summary: Get custom object definition
1977
+ * @description: Custom object definitions can be fetched using their custom object definition slug. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/content/getCustomObjectDefinitionBySlug/).
1978
+ */
1979
+ async getCustomObjectDefinitionBySlug(
1980
+ { slug, requestHeaders } = { requestHeaders: {} },
1981
+ { responseHeaders } = { responseHeaders: false }
1982
+ ) {
1983
+ const {
1984
+ error,
1985
+ } = ContentPlatformValidator.getCustomObjectDefinitionBySlug().validate(
1986
+ {
1987
+ slug,
1988
+ },
1989
+ { abortEarly: false, allowUnknown: true }
1990
+ );
1991
+ if (error) {
1992
+ return Promise.reject(new FDKClientValidationError(error));
1993
+ }
1994
+
1995
+ // Showing warrnings if extra unknown parameters are found
1996
+ const {
1997
+ error: warrning,
1998
+ } = ContentPlatformValidator.getCustomObjectDefinitionBySlug().validate(
1999
+ {
2000
+ slug,
2001
+ },
2002
+ { abortEarly: false, allowUnknown: false }
2003
+ );
2004
+ if (warrning) {
2005
+ Logger({
2006
+ level: "WARN",
2007
+ message: `Parameter Validation warrnings for platform > Content > getCustomObjectDefinitionBySlug \n ${warrning}`,
2008
+ });
2009
+ }
2010
+
2011
+ const query_params = {};
2012
+
2013
+ const xHeaders = {};
2014
+
2015
+ const response = await PlatformAPIClient.execute(
2016
+ this.config,
2017
+ "get",
2018
+ `/service/platform/content/v2.0/company/${this.config.companyId}/customobjects/definition/${slug}`,
2019
+ query_params,
2020
+ undefined,
2021
+ { ...xHeaders, ...requestHeaders },
2022
+ { responseHeaders }
2023
+ );
2024
+
2025
+ let responseData = response;
2026
+ if (responseHeaders) {
2027
+ responseData = response[0];
2028
+ }
2029
+
2030
+ const {
2031
+ error: res_error,
2032
+ } = ContentPlatformModel.CustomObjectDefinitionSlugSchema().validate(
2033
+ responseData,
2034
+ { abortEarly: false, allowUnknown: true }
2035
+ );
2036
+
2037
+ if (res_error) {
2038
+ if (this.config.options.strictResponseCheck === true) {
2039
+ return Promise.reject(new FDKResponseValidationError(res_error));
2040
+ } else {
2041
+ Logger({
2042
+ level: "WARN",
2043
+ message: `Response Validation Warnings for platform > Content > getCustomObjectDefinitionBySlug \n ${res_error}`,
2044
+ });
2045
+ }
2046
+ }
2047
+
2048
+ return response;
2049
+ }
2050
+
2051
+ /**
2052
+ * @param {ContentPlatformValidator.GetCustomObjectDefinitionsParam} arg - Arg object
2053
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
2054
+ * @param {import("../PlatformAPIClient").Options} - Options
2055
+ * @returns {Promise<ContentPlatformModel.CustomObjectDefinitionsSchema>} -
2056
+ * Success response
2057
+ * @name getCustomObjectDefinitions
2058
+ * @summary: Get custom object definitions
2059
+ * @description: Custom object definition lists can be obtained using this endpoint. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/content/getCustomObjectDefinitions/).
2060
+ */
2061
+ async getCustomObjectDefinitions(
2062
+ { pageNo, pageSize, search, requestHeaders } = { requestHeaders: {} },
2063
+ { responseHeaders } = { responseHeaders: false }
2064
+ ) {
2065
+ const {
2066
+ error,
2067
+ } = ContentPlatformValidator.getCustomObjectDefinitions().validate(
2068
+ {
2069
+ pageNo,
2070
+ pageSize,
2071
+ search,
2072
+ },
2073
+ { abortEarly: false, allowUnknown: true }
2074
+ );
2075
+ if (error) {
2076
+ return Promise.reject(new FDKClientValidationError(error));
2077
+ }
2078
+
2079
+ // Showing warrnings if extra unknown parameters are found
2080
+ const {
2081
+ error: warrning,
2082
+ } = ContentPlatformValidator.getCustomObjectDefinitions().validate(
2083
+ {
2084
+ pageNo,
2085
+ pageSize,
2086
+ search,
2087
+ },
2088
+ { abortEarly: false, allowUnknown: false }
2089
+ );
2090
+ if (warrning) {
2091
+ Logger({
2092
+ level: "WARN",
2093
+ message: `Parameter Validation warrnings for platform > Content > getCustomObjectDefinitions \n ${warrning}`,
2094
+ });
2095
+ }
2096
+
2097
+ const query_params = {};
2098
+ query_params["page_no"] = pageNo;
2099
+ query_params["page_size"] = pageSize;
2100
+ query_params["search"] = search;
2101
+
2102
+ const xHeaders = {};
2103
+
2104
+ const response = await PlatformAPIClient.execute(
2105
+ this.config,
2106
+ "get",
2107
+ `/service/platform/content/v2.0/company/${this.config.companyId}/customobjects/definition`,
2108
+ query_params,
2109
+ undefined,
2110
+ { ...xHeaders, ...requestHeaders },
2111
+ { responseHeaders }
2112
+ );
2113
+
2114
+ let responseData = response;
2115
+ if (responseHeaders) {
2116
+ responseData = response[0];
2117
+ }
2118
+
2119
+ const {
2120
+ error: res_error,
2121
+ } = ContentPlatformModel.CustomObjectDefinitionsSchema().validate(
2122
+ responseData,
2123
+ { abortEarly: false, allowUnknown: true }
2124
+ );
2125
+
2126
+ if (res_error) {
2127
+ if (this.config.options.strictResponseCheck === true) {
2128
+ return Promise.reject(new FDKResponseValidationError(res_error));
2129
+ } else {
2130
+ Logger({
2131
+ level: "WARN",
2132
+ message: `Response Validation Warnings for platform > Content > getCustomObjectDefinitions \n ${res_error}`,
2133
+ });
2134
+ }
2135
+ }
2136
+
2137
+ return response;
2138
+ }
2139
+
2140
+ /**
2141
+ * @param {ContentPlatformValidator.GetCustomObjectsBySlugParam} arg - Arg object
2142
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
2143
+ * @param {import("../PlatformAPIClient").Options} - Options
2144
+ * @returns {Promise<ContentPlatformModel.CustomObjectsSchema>} - Success response
2145
+ * @name getCustomObjectsBySlug
2146
+ * @summary: Get list of custom objects under a certain custom object definition
2147
+ * @description: Custom object entries can fetch using this endpoint. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/content/getCustomObjectsBySlug/).
2148
+ */
2149
+ async getCustomObjectsBySlug(
2150
+ { pageNo, pageSize, definitionSlug, requestHeaders } = {
2151
+ requestHeaders: {},
2152
+ },
2153
+ { responseHeaders } = { responseHeaders: false }
2154
+ ) {
2155
+ const {
2156
+ error,
2157
+ } = ContentPlatformValidator.getCustomObjectsBySlug().validate(
2158
+ {
2159
+ pageNo,
2160
+ pageSize,
2161
+ definitionSlug,
2162
+ },
2163
+ { abortEarly: false, allowUnknown: true }
2164
+ );
2165
+ if (error) {
2166
+ return Promise.reject(new FDKClientValidationError(error));
2167
+ }
2168
+
2169
+ // Showing warrnings if extra unknown parameters are found
2170
+ const {
2171
+ error: warrning,
2172
+ } = ContentPlatformValidator.getCustomObjectsBySlug().validate(
2173
+ {
2174
+ pageNo,
2175
+ pageSize,
2176
+ definitionSlug,
2177
+ },
2178
+ { abortEarly: false, allowUnknown: false }
2179
+ );
2180
+ if (warrning) {
2181
+ Logger({
2182
+ level: "WARN",
2183
+ message: `Parameter Validation warrnings for platform > Content > getCustomObjectsBySlug \n ${warrning}`,
2184
+ });
2185
+ }
2186
+
2187
+ const query_params = {};
2188
+ query_params["page_no"] = pageNo;
2189
+ query_params["page_size"] = pageSize;
2190
+
2191
+ const xHeaders = {};
2192
+
2193
+ const response = await PlatformAPIClient.execute(
2194
+ this.config,
2195
+ "get",
2196
+ `/service/platform/content/v2.0/company/${this.config.companyId}/customobjects/definition/${definitionSlug}/entries`,
2197
+ query_params,
2198
+ undefined,
2199
+ { ...xHeaders, ...requestHeaders },
2200
+ { responseHeaders }
2201
+ );
2202
+
2203
+ let responseData = response;
2204
+ if (responseHeaders) {
2205
+ responseData = response[0];
2206
+ }
2207
+
2208
+ const {
2209
+ error: res_error,
2210
+ } = ContentPlatformModel.CustomObjectsSchema().validate(responseData, {
2211
+ abortEarly: false,
2212
+ allowUnknown: true,
2213
+ });
2214
+
2215
+ if (res_error) {
2216
+ if (this.config.options.strictResponseCheck === true) {
2217
+ return Promise.reject(new FDKResponseValidationError(res_error));
2218
+ } else {
2219
+ Logger({
2220
+ level: "WARN",
2221
+ message: `Response Validation Warnings for platform > Content > getCustomObjectsBySlug \n ${res_error}`,
2222
+ });
2223
+ }
2224
+ }
2225
+
2226
+ return response;
2227
+ }
2228
+
2229
+ /**
2230
+ * @param {ContentPlatformValidator.GetJobsParam} arg - Arg object
2231
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
2232
+ * @param {import("../PlatformAPIClient").Options} - Options
2233
+ * @returns {Promise<ContentPlatformModel.CustomObjectBulkEntry>} - Success response
2234
+ * @name getJobs
2235
+ * @summary: Get bulk import and export job list
2236
+ * @description: Custom object bulk import and export jobs status and details can be obtained using this endpoint. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/content/getJobs/).
2237
+ */
2238
+ async getJobs(
2239
+ { page, pageSize, actionType, requestHeaders } = { requestHeaders: {} },
2240
+ { responseHeaders } = { responseHeaders: false }
2241
+ ) {
2242
+ const { error } = ContentPlatformValidator.getJobs().validate(
2243
+ {
2244
+ page,
2245
+ pageSize,
2246
+ actionType,
2247
+ },
2248
+ { abortEarly: false, allowUnknown: true }
2249
+ );
2250
+ if (error) {
2251
+ return Promise.reject(new FDKClientValidationError(error));
2252
+ }
2253
+
2254
+ // Showing warrnings if extra unknown parameters are found
2255
+ const { error: warrning } = ContentPlatformValidator.getJobs().validate(
2256
+ {
2257
+ page,
2258
+ pageSize,
2259
+ actionType,
2260
+ },
2261
+ { abortEarly: false, allowUnknown: false }
2262
+ );
2263
+ if (warrning) {
2264
+ Logger({
2265
+ level: "WARN",
2266
+ message: `Parameter Validation warrnings for platform > Content > getJobs \n ${warrning}`,
2267
+ });
2268
+ }
2269
+
2270
+ const query_params = {};
2271
+ query_params["page"] = page;
2272
+ query_params["page_size"] = pageSize;
2273
+ query_params["action_type"] = actionType;
2274
+
2275
+ const xHeaders = {};
2276
+
2277
+ const response = await PlatformAPIClient.execute(
2278
+ this.config,
2279
+ "get",
2280
+ `/service/platform/content/v1.0/company/${this.config.companyId}/metaobjects/jobs`,
2281
+ query_params,
2282
+ undefined,
2283
+ { ...xHeaders, ...requestHeaders },
2284
+ { responseHeaders }
2285
+ );
2286
+
2287
+ let responseData = response;
2288
+ if (responseHeaders) {
2289
+ responseData = response[0];
2290
+ }
2291
+
2292
+ const {
2293
+ error: res_error,
2294
+ } = ContentPlatformModel.CustomObjectBulkEntry().validate(responseData, {
2295
+ abortEarly: false,
2296
+ allowUnknown: true,
2297
+ });
2298
+
2299
+ if (res_error) {
2300
+ if (this.config.options.strictResponseCheck === true) {
2301
+ return Promise.reject(new FDKResponseValidationError(res_error));
2302
+ } else {
2303
+ Logger({
2304
+ level: "WARN",
2305
+ message: `Response Validation Warnings for platform > Content > getJobs \n ${res_error}`,
2306
+ });
2307
+ }
2308
+ }
2309
+
2310
+ return response;
2311
+ }
2312
+
2313
+ /**
2314
+ * @param {ContentPlatformValidator.GetResourceDefinitionByIdParam} arg - Arg object
2315
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
2316
+ * @param {import("../PlatformAPIClient").Options} - Options
2317
+ * @returns {Promise<ContentPlatformModel.ResourceDefinition>} - Success response
2318
+ * @name getResourceDefinitionById
2319
+ * @summary: Get resource definitions details
2320
+ * @description: Fetch specific resource definition and its translation schema. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/content/getResourceDefinitionById/).
2321
+ */
2322
+ async getResourceDefinitionById(
2323
+ { id, requestHeaders } = { requestHeaders: {} },
2324
+ { responseHeaders } = { responseHeaders: false }
2325
+ ) {
2326
+ const {
2327
+ error,
2328
+ } = ContentPlatformValidator.getResourceDefinitionById().validate(
2329
+ {
2330
+ id,
2331
+ },
2332
+ { abortEarly: false, allowUnknown: true }
2333
+ );
2334
+ if (error) {
2335
+ return Promise.reject(new FDKClientValidationError(error));
2336
+ }
2337
+
2338
+ // Showing warrnings if extra unknown parameters are found
2339
+ const {
2340
+ error: warrning,
2341
+ } = ContentPlatformValidator.getResourceDefinitionById().validate(
2342
+ {
2343
+ id,
2344
+ },
2345
+ { abortEarly: false, allowUnknown: false }
2346
+ );
2347
+ if (warrning) {
2348
+ Logger({
2349
+ level: "WARN",
2350
+ message: `Parameter Validation warrnings for platform > Content > getResourceDefinitionById \n ${warrning}`,
2351
+ });
2352
+ }
2353
+
2354
+ const query_params = {};
2355
+
2356
+ const xHeaders = {};
2357
+
2358
+ const response = await PlatformAPIClient.execute(
2359
+ this.config,
2360
+ "get",
2361
+ `/service/platform/content/v1.0/company/${this.config.companyId}/translatable/resource/definitions/${id}`,
2362
+ query_params,
2363
+ undefined,
2364
+ { ...xHeaders, ...requestHeaders },
2365
+ { responseHeaders }
2366
+ );
2367
+
2368
+ let responseData = response;
2369
+ if (responseHeaders) {
2370
+ responseData = response[0];
2371
+ }
2372
+
2373
+ const {
2374
+ error: res_error,
2375
+ } = ContentPlatformModel.ResourceDefinition().validate(responseData, {
2376
+ abortEarly: false,
2377
+ allowUnknown: true,
2378
+ });
2379
+
2380
+ if (res_error) {
2381
+ if (this.config.options.strictResponseCheck === true) {
2382
+ return Promise.reject(new FDKResponseValidationError(res_error));
2383
+ } else {
2384
+ Logger({
2385
+ level: "WARN",
2386
+ message: `Response Validation Warnings for platform > Content > getResourceDefinitionById \n ${res_error}`,
2387
+ });
2388
+ }
2389
+ }
2390
+
2391
+ return response;
2392
+ }
2393
+
2394
+ /**
2395
+ * @param {ContentPlatformValidator.GetResourcesParam} arg - Arg object
2396
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
2397
+ * @param {import("../PlatformAPIClient").Options} - Options
2398
+ * @returns {Promise<ContentPlatformModel.ResourcesSchema>} - Success response
2399
+ * @name getResources
2400
+ * @summary: Get resources
2401
+ * @description: Use this API to retrieve the resources, such as products, collections, customers, selling locations, etc. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/content/getResources/).
2402
+ */
2403
+ async getResources(
2404
+ { requestHeaders } = { requestHeaders: {} },
1111
2405
  { responseHeaders } = { responseHeaders: false }
1112
2406
  ) {
1113
- const { error } = ContentPlatformValidator.getCustomObject().validate(
1114
- {
1115
- metaobjectId,
1116
- },
2407
+ const { error } = ContentPlatformValidator.getResources().validate(
2408
+ {},
1117
2409
  { abortEarly: false, allowUnknown: true }
1118
2410
  );
1119
2411
  if (error) {
@@ -1123,16 +2415,14 @@ class Content {
1123
2415
  // Showing warrnings if extra unknown parameters are found
1124
2416
  const {
1125
2417
  error: warrning,
1126
- } = ContentPlatformValidator.getCustomObject().validate(
1127
- {
1128
- metaobjectId,
1129
- },
2418
+ } = ContentPlatformValidator.getResources().validate(
2419
+ {},
1130
2420
  { abortEarly: false, allowUnknown: false }
1131
2421
  );
1132
2422
  if (warrning) {
1133
2423
  Logger({
1134
2424
  level: "WARN",
1135
- message: `Parameter Validation warrnings for platform > Content > getCustomObject \n ${warrning}`,
2425
+ message: `Parameter Validation warrnings for platform > Content > getResources \n ${warrning}`,
1136
2426
  });
1137
2427
  }
1138
2428
 
@@ -1143,7 +2433,7 @@ class Content {
1143
2433
  const response = await PlatformAPIClient.execute(
1144
2434
  this.config,
1145
2435
  "get",
1146
- `/service/platform/content/v1.0/company/${this.config.companyId}/metaobjects/${metaobjectId}`,
2436
+ `/service/platform/content/v1.0/company/${this.config.companyId}/metafields/resources`,
1147
2437
  query_params,
1148
2438
  undefined,
1149
2439
  { ...xHeaders, ...requestHeaders },
@@ -1157,7 +2447,7 @@ class Content {
1157
2447
 
1158
2448
  const {
1159
2449
  error: res_error,
1160
- } = ContentPlatformModel.CustomObjectByIdSchema().validate(responseData, {
2450
+ } = ContentPlatformModel.ResourcesSchema().validate(responseData, {
1161
2451
  abortEarly: false,
1162
2452
  allowUnknown: true,
1163
2453
  });
@@ -1168,7 +2458,7 @@ class Content {
1168
2458
  } else {
1169
2459
  Logger({
1170
2460
  level: "WARN",
1171
- message: `Response Validation Warnings for platform > Content > getCustomObject \n ${res_error}`,
2461
+ message: `Response Validation Warnings for platform > Content > getResources \n ${res_error}`,
1172
2462
  });
1173
2463
  }
1174
2464
  }
@@ -1177,24 +2467,21 @@ class Content {
1177
2467
  }
1178
2468
 
1179
2469
  /**
1180
- * @param {ContentPlatformValidator.GetCustomObjectDefinitionParam} arg - Arg object
2470
+ * @param {ContentPlatformValidator.GetSectionByIdParam} arg - Arg object
1181
2471
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1182
2472
  * @param {import("../PlatformAPIClient").Options} - Options
1183
- * @returns {Promise<ContentPlatformModel.CustomObjectDefinitionSchema>} -
1184
- * Success response
1185
- * @name getCustomObjectDefinition
1186
- * @summary: Get custom object definition
1187
- * @description: Custom object definitions can be fetched using their definition ID. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/content/getCustomObjectDefinition/).
2473
+ * @returns {Promise<ContentPlatformModel.TranslatableSection>} - Success response
2474
+ * @name getSectionById
2475
+ * @summary: Retrieve details of a specific translatable section by its ID.
2476
+ * @description: Fetch details of a specific translatable section. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/content/getSectionById/).
1188
2477
  */
1189
- async getCustomObjectDefinition(
1190
- { definitionId, requestHeaders } = { requestHeaders: {} },
2478
+ async getSectionById(
2479
+ { id, requestHeaders } = { requestHeaders: {} },
1191
2480
  { responseHeaders } = { responseHeaders: false }
1192
2481
  ) {
1193
- const {
1194
- error,
1195
- } = ContentPlatformValidator.getCustomObjectDefinition().validate(
2482
+ const { error } = ContentPlatformValidator.getSectionById().validate(
1196
2483
  {
1197
- definitionId,
2484
+ id,
1198
2485
  },
1199
2486
  { abortEarly: false, allowUnknown: true }
1200
2487
  );
@@ -1205,16 +2492,16 @@ class Content {
1205
2492
  // Showing warrnings if extra unknown parameters are found
1206
2493
  const {
1207
2494
  error: warrning,
1208
- } = ContentPlatformValidator.getCustomObjectDefinition().validate(
2495
+ } = ContentPlatformValidator.getSectionById().validate(
1209
2496
  {
1210
- definitionId,
2497
+ id,
1211
2498
  },
1212
2499
  { abortEarly: false, allowUnknown: false }
1213
2500
  );
1214
2501
  if (warrning) {
1215
2502
  Logger({
1216
2503
  level: "WARN",
1217
- message: `Parameter Validation warrnings for platform > Content > getCustomObjectDefinition \n ${warrning}`,
2504
+ message: `Parameter Validation warrnings for platform > Content > getSectionById \n ${warrning}`,
1218
2505
  });
1219
2506
  }
1220
2507
 
@@ -1225,7 +2512,7 @@ class Content {
1225
2512
  const response = await PlatformAPIClient.execute(
1226
2513
  this.config,
1227
2514
  "get",
1228
- `/service/platform/content/v1.0/company/${this.config.companyId}/metaobjects/definitions/${definitionId}`,
2515
+ `/service/platform/content/v1.0/company/${this.config.companyId}/translatable/section/${id}`,
1229
2516
  query_params,
1230
2517
  undefined,
1231
2518
  { ...xHeaders, ...requestHeaders },
@@ -1239,10 +2526,10 @@ class Content {
1239
2526
 
1240
2527
  const {
1241
2528
  error: res_error,
1242
- } = ContentPlatformModel.CustomObjectDefinitionSchema().validate(
1243
- responseData,
1244
- { abortEarly: false, allowUnknown: true }
1245
- );
2529
+ } = ContentPlatformModel.TranslatableSection().validate(responseData, {
2530
+ abortEarly: false,
2531
+ allowUnknown: true,
2532
+ });
1246
2533
 
1247
2534
  if (res_error) {
1248
2535
  if (this.config.options.strictResponseCheck === true) {
@@ -1250,7 +2537,7 @@ class Content {
1250
2537
  } else {
1251
2538
  Logger({
1252
2539
  level: "WARN",
1253
- message: `Response Validation Warnings for platform > Content > getCustomObjectDefinition \n ${res_error}`,
2540
+ message: `Response Validation Warnings for platform > Content > getSectionById \n ${res_error}`,
1254
2541
  });
1255
2542
  }
1256
2543
  }
@@ -1259,26 +2546,23 @@ class Content {
1259
2546
  }
1260
2547
 
1261
2548
  /**
1262
- * @param {ContentPlatformValidator.GetCustomObjectDefinitionsParam} arg - Arg object
2549
+ * @param {ContentPlatformValidator.GetTranslatableResourceByIdParam} arg - Arg object
1263
2550
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1264
2551
  * @param {import("../PlatformAPIClient").Options} - Options
1265
- * @returns {Promise<ContentPlatformModel.CustomObjectDefinitionsSchema>} -
1266
- * Success response
1267
- * @name getCustomObjectDefinitions
1268
- * @summary: Get custom object definitions
1269
- * @description: Custom object definition lists can be obtained using this endpoint. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/content/getCustomObjectDefinitions/).
2552
+ * @returns {Promise<ContentPlatformModel.TranslatableResource>} - Success response
2553
+ * @name getTranslatableResourceById
2554
+ * @summary: Get translatable resource details
2555
+ * @description: Fetch details of a specific translatable resource. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/content/getTranslatableResourceById/).
1270
2556
  */
1271
- async getCustomObjectDefinitions(
1272
- { pageNo, pageSize, search, requestHeaders } = { requestHeaders: {} },
2557
+ async getTranslatableResourceById(
2558
+ { id, requestHeaders } = { requestHeaders: {} },
1273
2559
  { responseHeaders } = { responseHeaders: false }
1274
2560
  ) {
1275
2561
  const {
1276
2562
  error,
1277
- } = ContentPlatformValidator.getCustomObjectDefinitions().validate(
2563
+ } = ContentPlatformValidator.getTranslatableResourceById().validate(
1278
2564
  {
1279
- pageNo,
1280
- pageSize,
1281
- search,
2565
+ id,
1282
2566
  },
1283
2567
  { abortEarly: false, allowUnknown: true }
1284
2568
  );
@@ -1289,32 +2573,27 @@ class Content {
1289
2573
  // Showing warrnings if extra unknown parameters are found
1290
2574
  const {
1291
2575
  error: warrning,
1292
- } = ContentPlatformValidator.getCustomObjectDefinitions().validate(
2576
+ } = ContentPlatformValidator.getTranslatableResourceById().validate(
1293
2577
  {
1294
- pageNo,
1295
- pageSize,
1296
- search,
2578
+ id,
1297
2579
  },
1298
2580
  { abortEarly: false, allowUnknown: false }
1299
2581
  );
1300
2582
  if (warrning) {
1301
2583
  Logger({
1302
2584
  level: "WARN",
1303
- message: `Parameter Validation warrnings for platform > Content > getCustomObjectDefinitions \n ${warrning}`,
2585
+ message: `Parameter Validation warrnings for platform > Content > getTranslatableResourceById \n ${warrning}`,
1304
2586
  });
1305
2587
  }
1306
2588
 
1307
2589
  const query_params = {};
1308
- query_params["page_no"] = pageNo;
1309
- query_params["page_size"] = pageSize;
1310
- query_params["search"] = search;
1311
2590
 
1312
2591
  const xHeaders = {};
1313
2592
 
1314
2593
  const response = await PlatformAPIClient.execute(
1315
2594
  this.config,
1316
2595
  "get",
1317
- `/service/platform/content/v1.0/company/${this.config.companyId}/metaobjects/definitions`,
2596
+ `/service/platform/content/v1.0/company/${this.config.companyId}/translatable/resources/${id}`,
1318
2597
  query_params,
1319
2598
  undefined,
1320
2599
  { ...xHeaders, ...requestHeaders },
@@ -1328,10 +2607,10 @@ class Content {
1328
2607
 
1329
2608
  const {
1330
2609
  error: res_error,
1331
- } = ContentPlatformModel.CustomObjectDefinitionsSchema().validate(
1332
- responseData,
1333
- { abortEarly: false, allowUnknown: true }
1334
- );
2610
+ } = ContentPlatformModel.TranslatableResource().validate(responseData, {
2611
+ abortEarly: false,
2612
+ allowUnknown: true,
2613
+ });
1335
2614
 
1336
2615
  if (res_error) {
1337
2616
  if (this.config.options.strictResponseCheck === true) {
@@ -1339,7 +2618,7 @@ class Content {
1339
2618
  } else {
1340
2619
  Logger({
1341
2620
  level: "WARN",
1342
- message: `Response Validation Warnings for platform > Content > getCustomObjectDefinitions \n ${res_error}`,
2621
+ message: `Response Validation Warnings for platform > Content > getTranslatableResourceById \n ${res_error}`,
1343
2622
  });
1344
2623
  }
1345
2624
  }
@@ -1348,23 +2627,25 @@ class Content {
1348
2627
  }
1349
2628
 
1350
2629
  /**
1351
- * @param {ContentPlatformValidator.GetCustomObjectsParam} arg - Arg object
2630
+ * @param {ContentPlatformValidator.GetTranslatableResourcesBySectionIdParam} arg
2631
+ * - Arg object
2632
+ *
1352
2633
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1353
2634
  * @param {import("../PlatformAPIClient").Options} - Options
1354
- * @returns {Promise<ContentPlatformModel.CustomObjectsSchema>} - Success response
1355
- * @name getCustomObjects
1356
- * @summary: Get list of custom objects
1357
- * @description: Custom object entries can fetch using this endpoint. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/content/getCustomObjects/).
2635
+ * @returns {Promise<Object>} - Success response
2636
+ * @name getTranslatableResourcesBySectionId
2637
+ * @summary: Get section resources
2638
+ * @description: Retrieve all resources within a specific section. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/content/getTranslatableResourcesBySectionId/).
1358
2639
  */
1359
- async getCustomObjects(
1360
- { pageNo, pageSize, definitionId, requestHeaders } = { requestHeaders: {} },
2640
+ async getTranslatableResourcesBySectionId(
2641
+ { id, requestHeaders } = { requestHeaders: {} },
1361
2642
  { responseHeaders } = { responseHeaders: false }
1362
2643
  ) {
1363
- const { error } = ContentPlatformValidator.getCustomObjects().validate(
2644
+ const {
2645
+ error,
2646
+ } = ContentPlatformValidator.getTranslatableResourcesBySectionId().validate(
1364
2647
  {
1365
- pageNo,
1366
- pageSize,
1367
- definitionId,
2648
+ id,
1368
2649
  },
1369
2650
  { abortEarly: false, allowUnknown: true }
1370
2651
  );
@@ -1375,32 +2656,27 @@ class Content {
1375
2656
  // Showing warrnings if extra unknown parameters are found
1376
2657
  const {
1377
2658
  error: warrning,
1378
- } = ContentPlatformValidator.getCustomObjects().validate(
2659
+ } = ContentPlatformValidator.getTranslatableResourcesBySectionId().validate(
1379
2660
  {
1380
- pageNo,
1381
- pageSize,
1382
- definitionId,
2661
+ id,
1383
2662
  },
1384
2663
  { abortEarly: false, allowUnknown: false }
1385
2664
  );
1386
2665
  if (warrning) {
1387
2666
  Logger({
1388
2667
  level: "WARN",
1389
- message: `Parameter Validation warrnings for platform > Content > getCustomObjects \n ${warrning}`,
2668
+ message: `Parameter Validation warrnings for platform > Content > getTranslatableResourcesBySectionId \n ${warrning}`,
1390
2669
  });
1391
2670
  }
1392
2671
 
1393
2672
  const query_params = {};
1394
- query_params["definition_id"] = definitionId;
1395
- query_params["page_no"] = pageNo;
1396
- query_params["page_size"] = pageSize;
1397
2673
 
1398
2674
  const xHeaders = {};
1399
2675
 
1400
2676
  const response = await PlatformAPIClient.execute(
1401
2677
  this.config,
1402
2678
  "get",
1403
- `/service/platform/content/v1.0/company/${this.config.companyId}/metaobjects`,
2679
+ `/service/platform/content/v1.0/company/${this.config.companyId}/translatable/section/${id}/resources`,
1404
2680
  query_params,
1405
2681
  undefined,
1406
2682
  { ...xHeaders, ...requestHeaders },
@@ -1412,9 +2688,7 @@ class Content {
1412
2688
  responseData = response[0];
1413
2689
  }
1414
2690
 
1415
- const {
1416
- error: res_error,
1417
- } = ContentPlatformModel.CustomObjectsSchema().validate(responseData, {
2691
+ const { error: res_error } = Joi.any().validate(responseData, {
1418
2692
  abortEarly: false,
1419
2693
  allowUnknown: true,
1420
2694
  });
@@ -1425,7 +2699,7 @@ class Content {
1425
2699
  } else {
1426
2700
  Logger({
1427
2701
  level: "WARN",
1428
- message: `Response Validation Warnings for platform > Content > getCustomObjects \n ${res_error}`,
2702
+ message: `Response Validation Warnings for platform > Content > getTranslatableResourcesBySectionId \n ${res_error}`,
1429
2703
  });
1430
2704
  }
1431
2705
  }
@@ -1434,23 +2708,28 @@ class Content {
1434
2708
  }
1435
2709
 
1436
2710
  /**
1437
- * @param {ContentPlatformValidator.GetJobsParam} arg - Arg object
2711
+ * @param {ContentPlatformValidator.ImportCustomObjectEntriesBySlugParam} arg
2712
+ * - Arg object
2713
+ *
1438
2714
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1439
2715
  * @param {import("../PlatformAPIClient").Options} - Options
1440
- * @returns {Promise<ContentPlatformModel.CustomObjectBulkEntry>} - Success response
1441
- * @name getJobs
1442
- * @summary: Get bulk import and export job list
1443
- * @description: Custom object bulk import and export jobs status and details can be obtained using this endpoint. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/content/getJobs/).
2716
+ * @returns {Promise<ContentPlatformModel.CustomObjectEntryBulkUploadDetails>}
2717
+ * - Success response
2718
+ *
2719
+ * @name importCustomObjectEntriesBySlug
2720
+ * @summary: Bulk custom object entries upload
2721
+ * @description: Custom object bulk import of bulk entries can be performed using this endpoint. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/content/importCustomObjectEntriesBySlug/).
1444
2722
  */
1445
- async getJobs(
1446
- { page, pageSize, actionType, requestHeaders } = { requestHeaders: {} },
2723
+ async importCustomObjectEntriesBySlug(
2724
+ { slug, body, requestHeaders } = { requestHeaders: {} },
1447
2725
  { responseHeaders } = { responseHeaders: false }
1448
2726
  ) {
1449
- const { error } = ContentPlatformValidator.getJobs().validate(
2727
+ const {
2728
+ error,
2729
+ } = ContentPlatformValidator.importCustomObjectEntriesBySlug().validate(
1450
2730
  {
1451
- page,
1452
- pageSize,
1453
- actionType,
2731
+ slug,
2732
+ body,
1454
2733
  },
1455
2734
  { abortEarly: false, allowUnknown: true }
1456
2735
  );
@@ -1459,34 +2738,32 @@ class Content {
1459
2738
  }
1460
2739
 
1461
2740
  // Showing warrnings if extra unknown parameters are found
1462
- const { error: warrning } = ContentPlatformValidator.getJobs().validate(
2741
+ const {
2742
+ error: warrning,
2743
+ } = ContentPlatformValidator.importCustomObjectEntriesBySlug().validate(
1463
2744
  {
1464
- page,
1465
- pageSize,
1466
- actionType,
2745
+ slug,
2746
+ body,
1467
2747
  },
1468
2748
  { abortEarly: false, allowUnknown: false }
1469
2749
  );
1470
2750
  if (warrning) {
1471
2751
  Logger({
1472
2752
  level: "WARN",
1473
- message: `Parameter Validation warrnings for platform > Content > getJobs \n ${warrning}`,
2753
+ message: `Parameter Validation warrnings for platform > Content > importCustomObjectEntriesBySlug \n ${warrning}`,
1474
2754
  });
1475
2755
  }
1476
2756
 
1477
2757
  const query_params = {};
1478
- query_params["page"] = page;
1479
- query_params["page_size"] = pageSize;
1480
- query_params["action_type"] = actionType;
1481
2758
 
1482
2759
  const xHeaders = {};
1483
2760
 
1484
2761
  const response = await PlatformAPIClient.execute(
1485
2762
  this.config,
1486
- "get",
1487
- `/service/platform/content/v1.0/company/${this.config.companyId}/metaobjects/jobs`,
2763
+ "post",
2764
+ `/service/platform/content/v2.0/company/${this.config.companyId}/customobjects/definition/${slug}/bulk/upload`,
1488
2765
  query_params,
1489
- undefined,
2766
+ body,
1490
2767
  { ...xHeaders, ...requestHeaders },
1491
2768
  { responseHeaders }
1492
2769
  );
@@ -1498,10 +2775,10 @@ class Content {
1498
2775
 
1499
2776
  const {
1500
2777
  error: res_error,
1501
- } = ContentPlatformModel.CustomObjectBulkEntry().validate(responseData, {
1502
- abortEarly: false,
1503
- allowUnknown: true,
1504
- });
2778
+ } = ContentPlatformModel.CustomObjectEntryBulkUploadDetails().validate(
2779
+ responseData,
2780
+ { abortEarly: false, allowUnknown: true }
2781
+ );
1505
2782
 
1506
2783
  if (res_error) {
1507
2784
  if (this.config.options.strictResponseCheck === true) {
@@ -1509,7 +2786,7 @@ class Content {
1509
2786
  } else {
1510
2787
  Logger({
1511
2788
  level: "WARN",
1512
- message: `Response Validation Warnings for platform > Content > getJobs \n ${res_error}`,
2789
+ message: `Response Validation Warnings for platform > Content > importCustomObjectEntriesBySlug \n ${res_error}`,
1513
2790
  });
1514
2791
  }
1515
2792
  }
@@ -1518,20 +2795,26 @@ class Content {
1518
2795
  }
1519
2796
 
1520
2797
  /**
1521
- * @param {ContentPlatformValidator.GetResourcesParam} arg - Arg object
2798
+ * @param {ContentPlatformValidator.SampleCustomObjectBulkEntryBySlugParam} arg
2799
+ * - Arg object
2800
+ *
1522
2801
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1523
2802
  * @param {import("../PlatformAPIClient").Options} - Options
1524
- * @returns {Promise<ContentPlatformModel.ResourcesSchema>} - Success response
1525
- * @name getResources
1526
- * @summary: Get resources
1527
- * @description: Each custom fields is assosiated with a resource such as product, promotion, coupon, selling location etc, This will gives list of supported resource list. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/content/getResources/).
2803
+ * @returns {Promise<string>} - Success response
2804
+ * @name sampleCustomObjectBulkEntryBySlug
2805
+ * @summary: Download sample for custom object bulk entry
2806
+ * @description: Sample files for custom object bulk import can be obtained from this endpoint. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/content/sampleCustomObjectBulkEntryBySlug/).
1528
2807
  */
1529
- async getResources(
1530
- { requestHeaders } = { requestHeaders: {} },
2808
+ async sampleCustomObjectBulkEntryBySlug(
2809
+ { slug, requestHeaders } = { requestHeaders: {} },
1531
2810
  { responseHeaders } = { responseHeaders: false }
1532
2811
  ) {
1533
- const { error } = ContentPlatformValidator.getResources().validate(
1534
- {},
2812
+ const {
2813
+ error,
2814
+ } = ContentPlatformValidator.sampleCustomObjectBulkEntryBySlug().validate(
2815
+ {
2816
+ slug,
2817
+ },
1535
2818
  { abortEarly: false, allowUnknown: true }
1536
2819
  );
1537
2820
  if (error) {
@@ -1541,14 +2824,16 @@ class Content {
1541
2824
  // Showing warrnings if extra unknown parameters are found
1542
2825
  const {
1543
2826
  error: warrning,
1544
- } = ContentPlatformValidator.getResources().validate(
1545
- {},
2827
+ } = ContentPlatformValidator.sampleCustomObjectBulkEntryBySlug().validate(
2828
+ {
2829
+ slug,
2830
+ },
1546
2831
  { abortEarly: false, allowUnknown: false }
1547
2832
  );
1548
2833
  if (warrning) {
1549
2834
  Logger({
1550
2835
  level: "WARN",
1551
- message: `Parameter Validation warrnings for platform > Content > getResources \n ${warrning}`,
2836
+ message: `Parameter Validation warrnings for platform > Content > sampleCustomObjectBulkEntryBySlug \n ${warrning}`,
1552
2837
  });
1553
2838
  }
1554
2839
 
@@ -1559,7 +2844,7 @@ class Content {
1559
2844
  const response = await PlatformAPIClient.execute(
1560
2845
  this.config,
1561
2846
  "get",
1562
- `/service/platform/content/v1.0/company/${this.config.companyId}/metafields/resources`,
2847
+ `/service/platform/content/v2.0/company/${this.config.companyId}/customobjects/definition/${slug}/bulk/sample`,
1563
2848
  query_params,
1564
2849
  undefined,
1565
2850
  { ...xHeaders, ...requestHeaders },
@@ -1571,9 +2856,91 @@ class Content {
1571
2856
  responseData = response[0];
1572
2857
  }
1573
2858
 
2859
+ const { error: res_error } = Joi.string()
2860
+ .allow("")
2861
+ .validate(responseData, { abortEarly: false, allowUnknown: true });
2862
+
2863
+ if (res_error) {
2864
+ if (this.config.options.strictResponseCheck === true) {
2865
+ return Promise.reject(new FDKResponseValidationError(res_error));
2866
+ } else {
2867
+ Logger({
2868
+ level: "WARN",
2869
+ message: `Response Validation Warnings for platform > Content > sampleCustomObjectBulkEntryBySlug \n ${res_error}`,
2870
+ });
2871
+ }
2872
+ }
2873
+
2874
+ return response;
2875
+ }
2876
+
2877
+ /**
2878
+ * @param {ContentPlatformValidator.UpdateCompanyLanguageDefaultParam} arg
2879
+ * - Arg object
2880
+ *
2881
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
2882
+ * @param {import("../PlatformAPIClient").Options} - Options
2883
+ * @returns {Promise<ContentPlatformModel.CompanyLanguage>} - Success response
2884
+ * @name updateCompanyLanguageDefault
2885
+ * @summary: Set default language
2886
+ * @description: Update default language settings for the company. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/content/updateCompanyLanguageDefault/).
2887
+ */
2888
+ async updateCompanyLanguageDefault(
2889
+ { locale, body, requestHeaders } = { requestHeaders: {} },
2890
+ { responseHeaders } = { responseHeaders: false }
2891
+ ) {
2892
+ const {
2893
+ error,
2894
+ } = ContentPlatformValidator.updateCompanyLanguageDefault().validate(
2895
+ {
2896
+ locale,
2897
+ body,
2898
+ },
2899
+ { abortEarly: false, allowUnknown: true }
2900
+ );
2901
+ if (error) {
2902
+ return Promise.reject(new FDKClientValidationError(error));
2903
+ }
2904
+
2905
+ // Showing warrnings if extra unknown parameters are found
2906
+ const {
2907
+ error: warrning,
2908
+ } = ContentPlatformValidator.updateCompanyLanguageDefault().validate(
2909
+ {
2910
+ locale,
2911
+ body,
2912
+ },
2913
+ { abortEarly: false, allowUnknown: false }
2914
+ );
2915
+ if (warrning) {
2916
+ Logger({
2917
+ level: "WARN",
2918
+ message: `Parameter Validation warrnings for platform > Content > updateCompanyLanguageDefault \n ${warrning}`,
2919
+ });
2920
+ }
2921
+
2922
+ const query_params = {};
2923
+
2924
+ const xHeaders = {};
2925
+
2926
+ const response = await PlatformAPIClient.execute(
2927
+ this.config,
2928
+ "put",
2929
+ `/service/platform/content/v1.0/company/${this.config.companyId}/languages/${locale}`,
2930
+ query_params,
2931
+ body,
2932
+ { ...xHeaders, ...requestHeaders },
2933
+ { responseHeaders }
2934
+ );
2935
+
2936
+ let responseData = response;
2937
+ if (responseHeaders) {
2938
+ responseData = response[0];
2939
+ }
2940
+
1574
2941
  const {
1575
2942
  error: res_error,
1576
- } = ContentPlatformModel.ResourcesSchema().validate(responseData, {
2943
+ } = ContentPlatformModel.CompanyLanguage().validate(responseData, {
1577
2944
  abortEarly: false,
1578
2945
  allowUnknown: true,
1579
2946
  });
@@ -1584,7 +2951,7 @@ class Content {
1584
2951
  } else {
1585
2952
  Logger({
1586
2953
  level: "WARN",
1587
- message: `Response Validation Warnings for platform > Content > getResources \n ${res_error}`,
2954
+ message: `Response Validation Warnings for platform > Content > updateCompanyLanguageDefault \n ${res_error}`,
1588
2955
  });
1589
2956
  }
1590
2957
  }
@@ -1593,25 +2960,25 @@ class Content {
1593
2960
  }
1594
2961
 
1595
2962
  /**
1596
- * @param {ContentPlatformValidator.ImportCustomObjectEntriesParam} arg - Arg object
2963
+ * @param {ContentPlatformValidator.UpdateCompanyResourceTranslationParam} arg
2964
+ * - Arg object
2965
+ *
1597
2966
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1598
2967
  * @param {import("../PlatformAPIClient").Options} - Options
1599
- * @returns {Promise<ContentPlatformModel.CustomObjectEntryBulkUploadResponse>}
1600
- * - Success response
1601
- *
1602
- * @name importCustomObjectEntries
1603
- * @summary: Bulk custom object entries upload
1604
- * @description: Custom object bulk import of bulk entries can be performed using this endpoint. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/content/importCustomObjectEntries/).
2968
+ * @returns {Promise<ContentPlatformModel.ResourceTranslation>} - Success response
2969
+ * @name updateCompanyResourceTranslation
2970
+ * @summary: Update company translation
2971
+ * @description: Update existing translations for company resources. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/content/updateCompanyResourceTranslation/).
1605
2972
  */
1606
- async importCustomObjectEntries(
1607
- { definitionId, body, requestHeaders } = { requestHeaders: {} },
2973
+ async updateCompanyResourceTranslation(
2974
+ { id, body, requestHeaders } = { requestHeaders: {} },
1608
2975
  { responseHeaders } = { responseHeaders: false }
1609
2976
  ) {
1610
2977
  const {
1611
2978
  error,
1612
- } = ContentPlatformValidator.importCustomObjectEntries().validate(
2979
+ } = ContentPlatformValidator.updateCompanyResourceTranslation().validate(
1613
2980
  {
1614
- definitionId,
2981
+ id,
1615
2982
  body,
1616
2983
  },
1617
2984
  { abortEarly: false, allowUnknown: true }
@@ -1623,9 +2990,9 @@ class Content {
1623
2990
  // Showing warrnings if extra unknown parameters are found
1624
2991
  const {
1625
2992
  error: warrning,
1626
- } = ContentPlatformValidator.importCustomObjectEntries().validate(
2993
+ } = ContentPlatformValidator.updateCompanyResourceTranslation().validate(
1627
2994
  {
1628
- definitionId,
2995
+ id,
1629
2996
  body,
1630
2997
  },
1631
2998
  { abortEarly: false, allowUnknown: false }
@@ -1633,7 +3000,7 @@ class Content {
1633
3000
  if (warrning) {
1634
3001
  Logger({
1635
3002
  level: "WARN",
1636
- message: `Parameter Validation warrnings for platform > Content > importCustomObjectEntries \n ${warrning}`,
3003
+ message: `Parameter Validation warrnings for platform > Content > updateCompanyResourceTranslation \n ${warrning}`,
1637
3004
  });
1638
3005
  }
1639
3006
 
@@ -1643,8 +3010,8 @@ class Content {
1643
3010
 
1644
3011
  const response = await PlatformAPIClient.execute(
1645
3012
  this.config,
1646
- "post",
1647
- `/service/platform/content/v1.0/company/${this.config.companyId}/metaobjects/bulk/${definitionId}/upload`,
3013
+ "put",
3014
+ `/service/platform/content/v1.0/company/${this.config.companyId}/resource/translations/${id}`,
1648
3015
  query_params,
1649
3016
  body,
1650
3017
  { ...xHeaders, ...requestHeaders },
@@ -1658,10 +3025,10 @@ class Content {
1658
3025
 
1659
3026
  const {
1660
3027
  error: res_error,
1661
- } = ContentPlatformModel.CustomObjectEntryBulkUploadResponse().validate(
1662
- responseData,
1663
- { abortEarly: false, allowUnknown: true }
1664
- );
3028
+ } = ContentPlatformModel.ResourceTranslation().validate(responseData, {
3029
+ abortEarly: false,
3030
+ allowUnknown: true,
3031
+ });
1665
3032
 
1666
3033
  if (res_error) {
1667
3034
  if (this.config.options.strictResponseCheck === true) {
@@ -1669,7 +3036,7 @@ class Content {
1669
3036
  } else {
1670
3037
  Logger({
1671
3038
  level: "WARN",
1672
- message: `Response Validation Warnings for platform > Content > importCustomObjectEntries \n ${res_error}`,
3039
+ message: `Response Validation Warnings for platform > Content > updateCompanyResourceTranslation \n ${res_error}`,
1673
3040
  });
1674
3041
  }
1675
3042
  }
@@ -1678,23 +3045,29 @@ class Content {
1678
3045
  }
1679
3046
 
1680
3047
  /**
1681
- * @param {ContentPlatformValidator.SampleCustomObjectBulkEntryParam} arg - Arg object
3048
+ * @param {ContentPlatformValidator.UpdateCustomFieldByResourceSlugParam} arg
3049
+ * - Arg object
3050
+ *
1682
3051
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1683
3052
  * @param {import("../PlatformAPIClient").Options} - Options
1684
- * @returns {Promise<string>} - Success response
1685
- * @name sampleCustomObjectBulkEntry
1686
- * @summary: Download sample for custom object bulk entry
1687
- * @description: Sample files for custom object bulk import can be obtained from this endpoint. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/content/sampleCustomObjectBulkEntry/).
3053
+ * @returns {Promise<ContentPlatformModel.CustomFieldsResponseByResourceIdSchema>}
3054
+ * - Success response
3055
+ *
3056
+ * @name updateCustomFieldByResourceSlug
3057
+ * @summary: Update custom field entries for gives resource and resource slug
3058
+ * @description: You can add a custom field using this endpoint to any resource by providing the resource slug. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/content/updateCustomFieldByResourceSlug/).
1688
3059
  */
1689
- async sampleCustomObjectBulkEntry(
1690
- { definitionId, requestHeaders } = { requestHeaders: {} },
3060
+ async updateCustomFieldByResourceSlug(
3061
+ { resource, resourceSlug, body, requestHeaders } = { requestHeaders: {} },
1691
3062
  { responseHeaders } = { responseHeaders: false }
1692
3063
  ) {
1693
3064
  const {
1694
3065
  error,
1695
- } = ContentPlatformValidator.sampleCustomObjectBulkEntry().validate(
3066
+ } = ContentPlatformValidator.updateCustomFieldByResourceSlug().validate(
1696
3067
  {
1697
- definitionId,
3068
+ resource,
3069
+ resourceSlug,
3070
+ body,
1698
3071
  },
1699
3072
  { abortEarly: false, allowUnknown: true }
1700
3073
  );
@@ -1705,16 +3078,18 @@ class Content {
1705
3078
  // Showing warrnings if extra unknown parameters are found
1706
3079
  const {
1707
3080
  error: warrning,
1708
- } = ContentPlatformValidator.sampleCustomObjectBulkEntry().validate(
3081
+ } = ContentPlatformValidator.updateCustomFieldByResourceSlug().validate(
1709
3082
  {
1710
- definitionId,
3083
+ resource,
3084
+ resourceSlug,
3085
+ body,
1711
3086
  },
1712
3087
  { abortEarly: false, allowUnknown: false }
1713
3088
  );
1714
3089
  if (warrning) {
1715
3090
  Logger({
1716
3091
  level: "WARN",
1717
- message: `Parameter Validation warrnings for platform > Content > sampleCustomObjectBulkEntry \n ${warrning}`,
3092
+ message: `Parameter Validation warrnings for platform > Content > updateCustomFieldByResourceSlug \n ${warrning}`,
1718
3093
  });
1719
3094
  }
1720
3095
 
@@ -1724,10 +3099,10 @@ class Content {
1724
3099
 
1725
3100
  const response = await PlatformAPIClient.execute(
1726
3101
  this.config,
1727
- "get",
1728
- `/service/platform/content/v1.0/company/${this.config.companyId}/metaobjects/bulk/${definitionId}/sample`,
3102
+ "put",
3103
+ `/service/platform/content/v2.0/company/${this.config.companyId}/customfields/resource/${resource}/${resourceSlug}`,
1729
3104
  query_params,
1730
- undefined,
3105
+ body,
1731
3106
  { ...xHeaders, ...requestHeaders },
1732
3107
  { responseHeaders }
1733
3108
  );
@@ -1737,9 +3112,12 @@ class Content {
1737
3112
  responseData = response[0];
1738
3113
  }
1739
3114
 
1740
- const { error: res_error } = Joi.string()
1741
- .allow("")
1742
- .validate(responseData, { abortEarly: false, allowUnknown: true });
3115
+ const {
3116
+ error: res_error,
3117
+ } = ContentPlatformModel.CustomFieldsResponseByResourceIdSchema().validate(
3118
+ responseData,
3119
+ { abortEarly: false, allowUnknown: true }
3120
+ );
1743
3121
 
1744
3122
  if (res_error) {
1745
3123
  if (this.config.options.strictResponseCheck === true) {
@@ -1747,7 +3125,7 @@ class Content {
1747
3125
  } else {
1748
3126
  Logger({
1749
3127
  level: "WARN",
1750
- message: `Response Validation Warnings for platform > Content > sampleCustomObjectBulkEntry \n ${res_error}`,
3128
+ message: `Response Validation Warnings for platform > Content > updateCustomFieldByResourceSlug \n ${res_error}`,
1751
3129
  });
1752
3130
  }
1753
3131
  }
@@ -1756,25 +3134,31 @@ class Content {
1756
3134
  }
1757
3135
 
1758
3136
  /**
1759
- * @param {ContentPlatformValidator.UpdateCustomFieldDefinitionParam} arg - Arg object
3137
+ * @param {ContentPlatformValidator.UpdateCustomFieldDefinitionBySlugParam} arg
3138
+ * - Arg object
3139
+ *
1760
3140
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1761
3141
  * @param {import("../PlatformAPIClient").Options} - Options
1762
3142
  * @returns {Promise<ContentPlatformModel.CustomFieldDefinitionDetailResSchema>}
1763
3143
  * - Success response
1764
3144
  *
1765
- * @name updateCustomFieldDefinition
3145
+ * @name updateCustomFieldDefinitionBySlug
1766
3146
  * @summary: Update custom field definition
1767
- * @description: Custom fields definition can be update using this api, You can update custom field definition name and description. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/content/updateCustomFieldDefinition/).
3147
+ * @description: Custom fields definition can be update using this api, You can update custom field definition name and description. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/content/updateCustomFieldDefinitionBySlug/).
1768
3148
  */
1769
- async updateCustomFieldDefinition(
1770
- { definitionId, body, requestHeaders } = { requestHeaders: {} },
3149
+ async updateCustomFieldDefinitionBySlug(
3150
+ { slug, resource, namespace, body, requestHeaders } = {
3151
+ requestHeaders: {},
3152
+ },
1771
3153
  { responseHeaders } = { responseHeaders: false }
1772
3154
  ) {
1773
3155
  const {
1774
3156
  error,
1775
- } = ContentPlatformValidator.updateCustomFieldDefinition().validate(
3157
+ } = ContentPlatformValidator.updateCustomFieldDefinitionBySlug().validate(
1776
3158
  {
1777
- definitionId,
3159
+ slug,
3160
+ resource,
3161
+ namespace,
1778
3162
  body,
1779
3163
  },
1780
3164
  { abortEarly: false, allowUnknown: true }
@@ -1786,9 +3170,11 @@ class Content {
1786
3170
  // Showing warrnings if extra unknown parameters are found
1787
3171
  const {
1788
3172
  error: warrning,
1789
- } = ContentPlatformValidator.updateCustomFieldDefinition().validate(
3173
+ } = ContentPlatformValidator.updateCustomFieldDefinitionBySlug().validate(
1790
3174
  {
1791
- definitionId,
3175
+ slug,
3176
+ resource,
3177
+ namespace,
1792
3178
  body,
1793
3179
  },
1794
3180
  { abortEarly: false, allowUnknown: false }
@@ -1796,7 +3182,7 @@ class Content {
1796
3182
  if (warrning) {
1797
3183
  Logger({
1798
3184
  level: "WARN",
1799
- message: `Parameter Validation warrnings for platform > Content > updateCustomFieldDefinition \n ${warrning}`,
3185
+ message: `Parameter Validation warrnings for platform > Content > updateCustomFieldDefinitionBySlug \n ${warrning}`,
1800
3186
  });
1801
3187
  }
1802
3188
 
@@ -1807,7 +3193,7 @@ class Content {
1807
3193
  const response = await PlatformAPIClient.execute(
1808
3194
  this.config,
1809
3195
  "put",
1810
- `/service/platform/content/v1.0/company/${this.config.companyId}/metafields/definitions/${definitionId}`,
3196
+ `/service/platform/content/v2.0/company/${this.config.companyId}/customfields/resource/${resource}/namespace/${namespace}/definition/${slug}`,
1811
3197
  query_params,
1812
3198
  body,
1813
3199
  { ...xHeaders, ...requestHeaders },
@@ -1832,7 +3218,7 @@ class Content {
1832
3218
  } else {
1833
3219
  Logger({
1834
3220
  level: "WARN",
1835
- message: `Response Validation Warnings for platform > Content > updateCustomFieldDefinition \n ${res_error}`,
3221
+ message: `Response Validation Warnings for platform > Content > updateCustomFieldDefinitionBySlug \n ${res_error}`,
1836
3222
  });
1837
3223
  }
1838
3224
  }
@@ -1841,21 +3227,25 @@ class Content {
1841
3227
  }
1842
3228
 
1843
3229
  /**
1844
- * @param {ContentPlatformValidator.UpdateCustomObjectParam} arg - Arg object
3230
+ * @param {ContentPlatformValidator.UpdateCustomObjectBySlugParam} arg - Arg object
1845
3231
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1846
3232
  * @param {import("../PlatformAPIClient").Options} - Options
1847
- * @returns {Promise<ContentPlatformModel.CustomObjectByIdSchema>} - Success response
1848
- * @name updateCustomObject
3233
+ * @returns {Promise<ContentPlatformModel.CustomObjectBySlugSchema>} -
3234
+ * Success response
3235
+ * @name updateCustomObjectBySlug
1849
3236
  * @summary: Update custom object details
1850
- * @description: Custom object entries can be updated using this endpoint. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/content/updateCustomObject/).
3237
+ * @description: Custom object entries can be updated using this endpoint. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/content/updateCustomObjectBySlug/).
1851
3238
  */
1852
- async updateCustomObject(
1853
- { metaobjectId, body, requestHeaders } = { requestHeaders: {} },
3239
+ async updateCustomObjectBySlug(
3240
+ { definitionSlug, slug, body, requestHeaders } = { requestHeaders: {} },
1854
3241
  { responseHeaders } = { responseHeaders: false }
1855
3242
  ) {
1856
- const { error } = ContentPlatformValidator.updateCustomObject().validate(
3243
+ const {
3244
+ error,
3245
+ } = ContentPlatformValidator.updateCustomObjectBySlug().validate(
1857
3246
  {
1858
- metaobjectId,
3247
+ definitionSlug,
3248
+ slug,
1859
3249
  body,
1860
3250
  },
1861
3251
  { abortEarly: false, allowUnknown: true }
@@ -1867,9 +3257,10 @@ class Content {
1867
3257
  // Showing warrnings if extra unknown parameters are found
1868
3258
  const {
1869
3259
  error: warrning,
1870
- } = ContentPlatformValidator.updateCustomObject().validate(
3260
+ } = ContentPlatformValidator.updateCustomObjectBySlug().validate(
1871
3261
  {
1872
- metaobjectId,
3262
+ definitionSlug,
3263
+ slug,
1873
3264
  body,
1874
3265
  },
1875
3266
  { abortEarly: false, allowUnknown: false }
@@ -1877,7 +3268,7 @@ class Content {
1877
3268
  if (warrning) {
1878
3269
  Logger({
1879
3270
  level: "WARN",
1880
- message: `Parameter Validation warrnings for platform > Content > updateCustomObject \n ${warrning}`,
3271
+ message: `Parameter Validation warrnings for platform > Content > updateCustomObjectBySlug \n ${warrning}`,
1881
3272
  });
1882
3273
  }
1883
3274
 
@@ -1888,7 +3279,7 @@ class Content {
1888
3279
  const response = await PlatformAPIClient.execute(
1889
3280
  this.config,
1890
3281
  "put",
1891
- `/service/platform/content/v1.0/company/${this.config.companyId}/metaobjects/${metaobjectId}`,
3282
+ `/service/platform/content/v2.0/company/${this.config.companyId}/customobjects/definition/${definitionSlug}/entries/${slug}`,
1892
3283
  query_params,
1893
3284
  body,
1894
3285
  { ...xHeaders, ...requestHeaders },
@@ -1902,7 +3293,7 @@ class Content {
1902
3293
 
1903
3294
  const {
1904
3295
  error: res_error,
1905
- } = ContentPlatformModel.CustomObjectByIdSchema().validate(responseData, {
3296
+ } = ContentPlatformModel.CustomObjectBySlugSchema().validate(responseData, {
1906
3297
  abortEarly: false,
1907
3298
  allowUnknown: true,
1908
3299
  });
@@ -1913,7 +3304,7 @@ class Content {
1913
3304
  } else {
1914
3305
  Logger({
1915
3306
  level: "WARN",
1916
- message: `Response Validation Warnings for platform > Content > updateCustomObject \n ${res_error}`,
3307
+ message: `Response Validation Warnings for platform > Content > updateCustomObjectBySlug \n ${res_error}`,
1917
3308
  });
1918
3309
  }
1919
3310
  }
@@ -1922,26 +3313,27 @@ class Content {
1922
3313
  }
1923
3314
 
1924
3315
  /**
1925
- * @param {ContentPlatformValidator.UpdateCustomObjectDefinitionParam} arg
3316
+ * @param {ContentPlatformValidator.UpdateCustomObjectDefinitionBySlugParam} arg
1926
3317
  * - Arg object
1927
3318
  *
1928
3319
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1929
3320
  * @param {import("../PlatformAPIClient").Options} - Options
1930
- * @returns {Promise<ContentPlatformModel.CustomObjectDefinitionSchema>} -
1931
- * Success response
1932
- * @name updateCustomObjectDefinition
3321
+ * @returns {Promise<ContentPlatformModel.CustomObjectDefinitionSlugSchema>}
3322
+ * - Success response
3323
+ *
3324
+ * @name updateCustomObjectDefinitionBySlug
1933
3325
  * @summary: Update custom object definition
1934
- * @description: Custom object definitions can be updated using this endpoint. You can update the name and description of the custom object and add more custom field definitions to the existing custom object. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/content/updateCustomObjectDefinition/).
3326
+ * @description: Custom object definitions can be updated using this endpoint. You can update the name and description of the custom object and add more custom field definitions to the existing custom object. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/content/updateCustomObjectDefinitionBySlug/).
1935
3327
  */
1936
- async updateCustomObjectDefinition(
1937
- { definitionId, body, requestHeaders } = { requestHeaders: {} },
3328
+ async updateCustomObjectDefinitionBySlug(
3329
+ { slug, body, requestHeaders } = { requestHeaders: {} },
1938
3330
  { responseHeaders } = { responseHeaders: false }
1939
3331
  ) {
1940
3332
  const {
1941
3333
  error,
1942
- } = ContentPlatformValidator.updateCustomObjectDefinition().validate(
3334
+ } = ContentPlatformValidator.updateCustomObjectDefinitionBySlug().validate(
1943
3335
  {
1944
- definitionId,
3336
+ slug,
1945
3337
  body,
1946
3338
  },
1947
3339
  { abortEarly: false, allowUnknown: true }
@@ -1953,9 +3345,9 @@ class Content {
1953
3345
  // Showing warrnings if extra unknown parameters are found
1954
3346
  const {
1955
3347
  error: warrning,
1956
- } = ContentPlatformValidator.updateCustomObjectDefinition().validate(
3348
+ } = ContentPlatformValidator.updateCustomObjectDefinitionBySlug().validate(
1957
3349
  {
1958
- definitionId,
3350
+ slug,
1959
3351
  body,
1960
3352
  },
1961
3353
  { abortEarly: false, allowUnknown: false }
@@ -1963,7 +3355,7 @@ class Content {
1963
3355
  if (warrning) {
1964
3356
  Logger({
1965
3357
  level: "WARN",
1966
- message: `Parameter Validation warrnings for platform > Content > updateCustomObjectDefinition \n ${warrning}`,
3358
+ message: `Parameter Validation warrnings for platform > Content > updateCustomObjectDefinitionBySlug \n ${warrning}`,
1967
3359
  });
1968
3360
  }
1969
3361
 
@@ -1974,7 +3366,7 @@ class Content {
1974
3366
  const response = await PlatformAPIClient.execute(
1975
3367
  this.config,
1976
3368
  "put",
1977
- `/service/platform/content/v1.0/company/${this.config.companyId}/metaobjects/definitions/${definitionId}`,
3369
+ `/service/platform/content/v2.0/company/${this.config.companyId}/customobjects/definition/${slug}`,
1978
3370
  query_params,
1979
3371
  body,
1980
3372
  { ...xHeaders, ...requestHeaders },
@@ -1988,7 +3380,7 @@ class Content {
1988
3380
 
1989
3381
  const {
1990
3382
  error: res_error,
1991
- } = ContentPlatformModel.CustomObjectDefinitionSchema().validate(
3383
+ } = ContentPlatformModel.CustomObjectDefinitionSlugSchema().validate(
1992
3384
  responseData,
1993
3385
  { abortEarly: false, allowUnknown: true }
1994
3386
  );
@@ -1999,7 +3391,7 @@ class Content {
1999
3391
  } else {
2000
3392
  Logger({
2001
3393
  level: "WARN",
2002
- message: `Response Validation Warnings for platform > Content > updateCustomObjectDefinition \n ${res_error}`,
3394
+ message: `Response Validation Warnings for platform > Content > updateCustomObjectDefinitionBySlug \n ${res_error}`,
2003
3395
  });
2004
3396
  }
2005
3397
  }