@gofynd/fdk-client-javascript 1.6.4 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (146) hide show
  1. package/README.md +1 -1
  2. package/package.json +1 -1
  3. package/sdk/application/Cart/CartApplicationClient.d.ts +5 -5
  4. package/sdk/application/Cart/CartApplicationClient.js +26 -268
  5. package/sdk/application/Catalog/CatalogApplicationClient.d.ts +20 -20
  6. package/sdk/application/Catalog/CatalogApplicationClient.js +98 -347
  7. package/sdk/application/Common/CommonApplicationClient.js +1 -16
  8. package/sdk/application/Communication/CommunicationApplicationClient.js +1 -24
  9. package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +24 -2
  10. package/sdk/application/Configuration/ConfigurationApplicationClient.js +58 -137
  11. package/sdk/application/Content/ContentApplicationClient.d.ts +47 -7
  12. package/sdk/application/Content/ContentApplicationClient.js +222 -191
  13. package/sdk/application/FileStorage/FileStorageApplicationClient.d.ts +2 -2
  14. package/sdk/application/FileStorage/FileStorageApplicationClient.js +11 -30
  15. package/sdk/application/Finance/FinanceApplicationClient.js +1 -16
  16. package/sdk/application/Lead/LeadApplicationClient.d.ts +4 -4
  17. package/sdk/application/Lead/LeadApplicationClient.js +21 -52
  18. package/sdk/application/Logistic/LogisticApplicationClient.d.ts +16 -56
  19. package/sdk/application/Logistic/LogisticApplicationClient.js +57 -332
  20. package/sdk/application/Order/OrderApplicationClient.d.ts +11 -11
  21. package/sdk/application/Order/OrderApplicationClient.js +68 -153
  22. package/sdk/application/Payment/PaymentApplicationClient.d.ts +2 -12
  23. package/sdk/application/Payment/PaymentApplicationClient.js +7 -487
  24. package/sdk/application/Rewards/RewardsApplicationClient.d.ts +1 -1
  25. package/sdk/application/Rewards/RewardsApplicationClient.js +6 -59
  26. package/sdk/application/Share/ShareApplicationClient.d.ts +4 -4
  27. package/sdk/application/Share/ShareApplicationClient.js +21 -75
  28. package/sdk/application/Theme/ThemeApplicationClient.d.ts +3 -3
  29. package/sdk/application/Theme/ThemeApplicationClient.js +19 -47
  30. package/sdk/application/User/UserApplicationClient.js +1 -407
  31. package/sdk/application/Webhook/WebhookApplicationClient.js +1 -8
  32. package/sdk/common/Utility.d.ts +1 -1
  33. package/sdk/common/Utility.js +4 -4
  34. package/sdk/common/Validator.d.ts +1 -0
  35. package/sdk/common/Validator.js +20 -0
  36. package/sdk/partner/FileStorage/FileStoragePartnerClient.d.ts +1 -55
  37. package/sdk/partner/FileStorage/FileStoragePartnerClient.js +1 -408
  38. package/sdk/partner/FileStorage/FileStoragePartnerValidator.d.ts +0 -5
  39. package/sdk/partner/FileStorage/FileStoragePartnerValidator.js +0 -37
  40. package/sdk/partner/Lead/LeadPartnerModel.d.ts +5 -0
  41. package/sdk/partner/Lead/LeadPartnerModel.js +2 -0
  42. package/sdk/partner/Logistics/LogisticsPartnerClient.d.ts +29 -25
  43. package/sdk/partner/Logistics/LogisticsPartnerClient.js +65 -42
  44. package/sdk/partner/Logistics/LogisticsPartnerModel.d.ts +1008 -794
  45. package/sdk/partner/Logistics/LogisticsPartnerModel.js +573 -460
  46. package/sdk/partner/Logistics/LogisticsPartnerValidator.js +10 -5
  47. package/sdk/partner/Webhook/WebhookPartnerModel.d.ts +5 -0
  48. package/sdk/partner/Webhook/WebhookPartnerModel.js +2 -0
  49. package/sdk/platform/Analytics/AnalyticsPlatformModel.d.ts +5 -0
  50. package/sdk/platform/Analytics/AnalyticsPlatformModel.js +2 -0
  51. package/sdk/platform/Cart/CartPlatformModel.d.ts +67 -9
  52. package/sdk/platform/Cart/CartPlatformModel.js +38 -5
  53. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +1 -1
  54. package/sdk/platform/Catalog/CatalogPlatformClient.js +4 -4
  55. package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +47 -13
  56. package/sdk/platform/Catalog/CatalogPlatformModel.js +29 -7
  57. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +2 -2
  58. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +7 -4
  59. package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +71 -7
  60. package/sdk/platform/Communication/CommunicationPlatformModel.js +70 -6
  61. package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +0 -27
  62. package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +8 -60
  63. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +31 -20
  64. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +18 -18
  65. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +1 -1
  66. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +3 -3
  67. package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +13 -0
  68. package/sdk/platform/Configuration/ConfigurationPlatformClient.js +30 -1
  69. package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +68 -11
  70. package/sdk/platform/Configuration/ConfigurationPlatformModel.js +49 -7
  71. package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +169 -0
  72. package/sdk/platform/Content/ContentPlatformApplicationClient.js +1279 -132
  73. package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +156 -1
  74. package/sdk/platform/Content/ContentPlatformApplicationValidator.js +180 -0
  75. package/sdk/platform/Content/ContentPlatformClient.d.ts +162 -0
  76. package/sdk/platform/Content/ContentPlatformClient.js +1697 -497
  77. package/sdk/platform/Content/ContentPlatformModel.d.ts +1053 -35
  78. package/sdk/platform/Content/ContentPlatformModel.js +717 -34
  79. package/sdk/platform/Content/ContentPlatformValidator.d.ts +127 -1
  80. package/sdk/platform/Content/ContentPlatformValidator.js +171 -0
  81. package/sdk/platform/Discount/DiscountPlatformClient.d.ts +34 -0
  82. package/sdk/platform/Discount/DiscountPlatformClient.js +59 -0
  83. package/sdk/platform/Discount/DiscountPlatformModel.d.ts +365 -93
  84. package/sdk/platform/Discount/DiscountPlatformModel.js +98 -93
  85. package/sdk/platform/Discount/DiscountPlatformValidator.d.ts +54 -34
  86. package/sdk/platform/Discount/DiscountPlatformValidator.js +27 -17
  87. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +0 -156
  88. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +0 -1072
  89. package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.d.ts +1 -137
  90. package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.js +0 -173
  91. package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +1 -1105
  92. package/sdk/platform/FileStorage/FileStoragePlatformModel.js +0 -1125
  93. package/sdk/platform/Lead/LeadPlatformModel.d.ts +5 -0
  94. package/sdk/platform/Lead/LeadPlatformModel.js +2 -0
  95. package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +0 -10
  96. package/sdk/platform/Order/OrderPlatformApplicationClient.js +0 -92
  97. package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +1 -28
  98. package/sdk/platform/Order/OrderPlatformApplicationValidator.js +0 -18
  99. package/sdk/platform/Order/OrderPlatformClient.d.ts +212 -0
  100. package/sdk/platform/Order/OrderPlatformClient.js +397 -0
  101. package/sdk/platform/Order/OrderPlatformModel.d.ts +41 -9
  102. package/sdk/platform/Order/OrderPlatformModel.js +20 -7
  103. package/sdk/platform/Order/OrderPlatformValidator.d.ts +33 -1
  104. package/sdk/platform/Order/OrderPlatformValidator.js +20 -0
  105. package/sdk/platform/Partner/PartnerPlatformModel.d.ts +58 -10
  106. package/sdk/platform/Partner/PartnerPlatformModel.js +19 -10
  107. package/sdk/platform/Payment/PaymentPlatformModel.d.ts +12 -2
  108. package/sdk/platform/Payment/PaymentPlatformModel.js +8 -2
  109. package/sdk/platform/Rewards/RewardsPlatformModel.d.ts +5 -0
  110. package/sdk/platform/Rewards/RewardsPlatformModel.js +2 -0
  111. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.d.ts +240 -24
  112. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.js +1753 -277
  113. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.d.ts +320 -22
  114. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.js +269 -19
  115. package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +53 -104
  116. package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +201 -629
  117. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +5720 -2891
  118. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +3414 -2181
  119. package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.d.ts +138 -216
  120. package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.js +81 -148
  121. package/sdk/platform/Share/SharePlatformModel.d.ts +5 -0
  122. package/sdk/platform/Share/SharePlatformModel.js +2 -0
  123. package/sdk/platform/User/UserPlatformApplicationClient.d.ts +10 -0
  124. package/sdk/platform/User/UserPlatformApplicationClient.js +79 -0
  125. package/sdk/platform/User/UserPlatformApplicationValidator.d.ts +13 -1
  126. package/sdk/platform/User/UserPlatformApplicationValidator.js +12 -0
  127. package/sdk/platform/User/UserPlatformModel.d.ts +52 -1
  128. package/sdk/platform/User/UserPlatformModel.js +36 -0
  129. package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +5 -0
  130. package/sdk/platform/Webhook/WebhookPlatformModel.js +2 -0
  131. package/sdk/public/Catalog/CatalogPublicClient.d.ts +1 -1
  132. package/sdk/public/Catalog/CatalogPublicClient.js +6 -11
  133. package/sdk/public/Configuration/ConfigurationPublicClient.js +1 -16
  134. package/sdk/public/Content/ContentPublicClient.d.ts +36 -3
  135. package/sdk/public/Content/ContentPublicClient.js +261 -104
  136. package/sdk/public/Content/ContentPublicModel.d.ts +155 -1
  137. package/sdk/public/Content/ContentPublicModel.js +102 -0
  138. package/sdk/public/Content/ContentPublicValidator.d.ts +18 -1
  139. package/sdk/public/Content/ContentPublicValidator.js +26 -0
  140. package/sdk/public/Partner/PartnerPublicClient.d.ts +1 -1
  141. package/sdk/public/Partner/PartnerPublicClient.js +6 -11
  142. package/sdk/public/Partner/PartnerPublicModel.d.ts +248 -72
  143. package/sdk/public/Partner/PartnerPublicModel.js +81 -71
  144. package/sdk/public/Partner/PartnerPublicValidator.d.ts +2 -2
  145. package/sdk/public/Partner/PartnerPublicValidator.js +1 -1
  146. package/sdk/public/Webhook/WebhookPublicClient.js +1 -40
@@ -15,25 +15,20 @@ class Content {
15
15
  }
16
16
 
17
17
  /**
18
- * @param {ContentPlatformValidator.CreateCustomFieldDefinitionParam} arg - Arg object
18
+ * @param {ContentPlatformValidator.AddCompanyLanguageParam} arg - Arg object
19
19
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
20
20
  * @param {import("../PlatformAPIClient").Options} - Options
21
- * @returns {Promise<ContentPlatformModel.CustomFieldDefinitionDetailResSchema>}
22
- * - Success response
23
- *
24
- * @name createCustomFieldDefinition
25
- * @summary: Create custom field definition for a given resource type
26
- * @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/).
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://partners.fynd.com/help/docs/sdk/platform/content/addCompanyLanguage/).
27
25
  */
28
- async createCustomFieldDefinition(
29
- { resource, body, requestHeaders } = { requestHeaders: {} },
26
+ async addCompanyLanguage(
27
+ { body, requestHeaders } = { requestHeaders: {} },
30
28
  { responseHeaders } = { responseHeaders: false }
31
29
  ) {
32
- const {
33
- error,
34
- } = ContentPlatformValidator.createCustomFieldDefinition().validate(
30
+ const { error } = ContentPlatformValidator.addCompanyLanguage().validate(
35
31
  {
36
- resource,
37
32
  body,
38
33
  },
39
34
  { abortEarly: false, allowUnknown: true }
@@ -45,9 +40,8 @@ class Content {
45
40
  // Showing warrnings if extra unknown parameters are found
46
41
  const {
47
42
  error: warrning,
48
- } = ContentPlatformValidator.createCustomFieldDefinition().validate(
43
+ } = ContentPlatformValidator.addCompanyLanguage().validate(
49
44
  {
50
- resource,
51
45
  body,
52
46
  },
53
47
  { abortEarly: false, allowUnknown: false }
@@ -55,7 +49,7 @@ class Content {
55
49
  if (warrning) {
56
50
  Logger({
57
51
  level: "WARN",
58
- message: `Parameter Validation warrnings for platform > Content > createCustomFieldDefinition \n ${warrning}`,
52
+ message: `Parameter Validation warrnings for platform > Content > addCompanyLanguage \n ${warrning}`,
59
53
  });
60
54
  }
61
55
 
@@ -66,7 +60,7 @@ class Content {
66
60
  const response = await PlatformAPIClient.execute(
67
61
  this.config,
68
62
  "post",
69
- `/service/platform/content/v2.0/company/${this.config.companyId}/customfields/resource/${resource}/definition`,
63
+ `/service/platform/content/v1.0/company/${this.config.companyId}/languages`,
70
64
  query_params,
71
65
  body,
72
66
  { ...xHeaders, ...requestHeaders },
@@ -78,12 +72,10 @@ class Content {
78
72
  responseData = response[0];
79
73
  }
80
74
 
81
- const {
82
- error: res_error,
83
- } = ContentPlatformModel.CustomFieldDefinitionDetailResSchema().validate(
84
- responseData,
85
- { abortEarly: false, allowUnknown: true }
86
- );
75
+ const { error: res_error } = Joi.any().validate(responseData, {
76
+ abortEarly: false,
77
+ allowUnknown: true,
78
+ });
87
79
 
88
80
  if (res_error) {
89
81
  if (this.config.options.strictResponseCheck === true) {
@@ -91,7 +83,7 @@ class Content {
91
83
  } else {
92
84
  Logger({
93
85
  level: "WARN",
94
- message: `Response Validation Warnings for platform > Content > createCustomFieldDefinition \n ${res_error}`,
86
+ message: `Response Validation Warnings for platform > Content > addCompanyLanguage \n ${res_error}`,
95
87
  });
96
88
  }
97
89
  }
@@ -100,23 +92,24 @@ class Content {
100
92
  }
101
93
 
102
94
  /**
103
- * @param {ContentPlatformValidator.CreateCustomObjectBySlugParam} arg - Arg object
95
+ * @param {ContentPlatformValidator.CreateCompanyResourceTranslationParam} arg
96
+ * - Arg object
97
+ *
104
98
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
105
99
  * @param {import("../PlatformAPIClient").Options} - Options
106
- * @returns {Promise<ContentPlatformModel.CustomObjectSchema>} - Success response
107
- * @name createCustomObjectBySlug
108
- * @summary: Create custom object entries
109
- * @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/createCustomObjectBySlug/).
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://partners.fynd.com/help/docs/sdk/platform/content/createCompanyResourceTranslation/).
110
104
  */
111
- async createCustomObjectBySlug(
112
- { definitionSlug, body, requestHeaders } = { requestHeaders: {} },
105
+ async createCompanyResourceTranslation(
106
+ { body, requestHeaders } = { requestHeaders: {} },
113
107
  { responseHeaders } = { responseHeaders: false }
114
108
  ) {
115
109
  const {
116
110
  error,
117
- } = ContentPlatformValidator.createCustomObjectBySlug().validate(
111
+ } = ContentPlatformValidator.createCompanyResourceTranslation().validate(
118
112
  {
119
- definitionSlug,
120
113
  body,
121
114
  },
122
115
  { abortEarly: false, allowUnknown: true }
@@ -128,9 +121,8 @@ class Content {
128
121
  // Showing warrnings if extra unknown parameters are found
129
122
  const {
130
123
  error: warrning,
131
- } = ContentPlatformValidator.createCustomObjectBySlug().validate(
124
+ } = ContentPlatformValidator.createCompanyResourceTranslation().validate(
132
125
  {
133
- definitionSlug,
134
126
  body,
135
127
  },
136
128
  { abortEarly: false, allowUnknown: false }
@@ -138,7 +130,7 @@ class Content {
138
130
  if (warrning) {
139
131
  Logger({
140
132
  level: "WARN",
141
- message: `Parameter Validation warrnings for platform > Content > createCustomObjectBySlug \n ${warrning}`,
133
+ message: `Parameter Validation warrnings for platform > Content > createCompanyResourceTranslation \n ${warrning}`,
142
134
  });
143
135
  }
144
136
 
@@ -149,7 +141,7 @@ class Content {
149
141
  const response = await PlatformAPIClient.execute(
150
142
  this.config,
151
143
  "post",
152
- `/service/platform/content/v2.0/company/${this.config.companyId}/customobjects/definition/${definitionSlug}/entries`,
144
+ `/service/platform/content/v1.0/company/${this.config.companyId}/resource/translations`,
153
145
  query_params,
154
146
  body,
155
147
  { ...xHeaders, ...requestHeaders },
@@ -163,7 +155,7 @@ class Content {
163
155
 
164
156
  const {
165
157
  error: res_error,
166
- } = ContentPlatformModel.CustomObjectSchema().validate(responseData, {
158
+ } = ContentPlatformModel.ResourceTranslation().validate(responseData, {
167
159
  abortEarly: false,
168
160
  allowUnknown: true,
169
161
  });
@@ -174,7 +166,7 @@ class Content {
174
166
  } else {
175
167
  Logger({
176
168
  level: "WARN",
177
- message: `Response Validation Warnings for platform > Content > createCustomObjectBySlug \n ${res_error}`,
169
+ message: `Response Validation Warnings for platform > Content > createCompanyResourceTranslation \n ${res_error}`,
178
170
  });
179
171
  }
180
172
  }
@@ -183,26 +175,25 @@ class Content {
183
175
  }
184
176
 
185
177
  /**
186
- * @param {ContentPlatformValidator.CreateCustomObjectDefinitionParam} arg
187
- * - Arg object
188
- *
178
+ * @param {ContentPlatformValidator.CreateCustomFieldDefinitionParam} arg - Arg object
189
179
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
190
180
  * @param {import("../PlatformAPIClient").Options} - Options
191
- * @returns {Promise<ContentPlatformModel.CustomObjectDefinitionSlugSchema>}
181
+ * @returns {Promise<ContentPlatformModel.CustomFieldDefinitionDetailResSchema>}
192
182
  * - Success response
193
183
  *
194
- * @name createCustomObjectDefinition
195
- * @summary: Create custom object definition
196
- * @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/).
184
+ * @name 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://partners.fynd.com/help/docs/sdk/platform/content/createCustomFieldDefinition/).
197
187
  */
198
- async createCustomObjectDefinition(
199
- { body, requestHeaders } = { requestHeaders: {} },
188
+ async createCustomFieldDefinition(
189
+ { resource, body, requestHeaders } = { requestHeaders: {} },
200
190
  { responseHeaders } = { responseHeaders: false }
201
191
  ) {
202
192
  const {
203
193
  error,
204
- } = ContentPlatformValidator.createCustomObjectDefinition().validate(
194
+ } = ContentPlatformValidator.createCustomFieldDefinition().validate(
205
195
  {
196
+ resource,
206
197
  body,
207
198
  },
208
199
  { abortEarly: false, allowUnknown: true }
@@ -214,8 +205,9 @@ class Content {
214
205
  // Showing warrnings if extra unknown parameters are found
215
206
  const {
216
207
  error: warrning,
217
- } = ContentPlatformValidator.createCustomObjectDefinition().validate(
208
+ } = ContentPlatformValidator.createCustomFieldDefinition().validate(
218
209
  {
210
+ resource,
219
211
  body,
220
212
  },
221
213
  { abortEarly: false, allowUnknown: false }
@@ -223,7 +215,7 @@ class Content {
223
215
  if (warrning) {
224
216
  Logger({
225
217
  level: "WARN",
226
- message: `Parameter Validation warrnings for platform > Content > createCustomObjectDefinition \n ${warrning}`,
218
+ message: `Parameter Validation warrnings for platform > Content > createCustomFieldDefinition \n ${warrning}`,
227
219
  });
228
220
  }
229
221
 
@@ -234,7 +226,7 @@ class Content {
234
226
  const response = await PlatformAPIClient.execute(
235
227
  this.config,
236
228
  "post",
237
- `/service/platform/content/v2.0/company/${this.config.companyId}/customobjects/definition`,
229
+ `/service/platform/content/v2.0/company/${this.config.companyId}/customfields/resource/${resource}/definition`,
238
230
  query_params,
239
231
  body,
240
232
  { ...xHeaders, ...requestHeaders },
@@ -248,7 +240,7 @@ class Content {
248
240
 
249
241
  const {
250
242
  error: res_error,
251
- } = ContentPlatformModel.CustomObjectDefinitionSlugSchema().validate(
243
+ } = ContentPlatformModel.CustomFieldDefinitionDetailResSchema().validate(
252
244
  responseData,
253
245
  { abortEarly: false, allowUnknown: true }
254
246
  );
@@ -259,7 +251,7 @@ class Content {
259
251
  } else {
260
252
  Logger({
261
253
  level: "WARN",
262
- message: `Response Validation Warnings for platform > Content > createCustomObjectDefinition \n ${res_error}`,
254
+ message: `Response Validation Warnings for platform > Content > createCustomFieldDefinition \n ${res_error}`,
263
255
  });
264
256
  }
265
257
  }
@@ -268,27 +260,24 @@ class Content {
268
260
  }
269
261
 
270
262
  /**
271
- * @param {ContentPlatformValidator.DeleteCustomFieldDefinitionBySlugParam} arg
272
- * - Arg object
273
- *
263
+ * @param {ContentPlatformValidator.CreateCustomObjectBySlugParam} arg - Arg object
274
264
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
275
265
  * @param {import("../PlatformAPIClient").Options} - Options
276
- * @returns {Promise<ContentPlatformModel.CustomDataDeleteSchema>} - Success response
277
- * @name deleteCustomFieldDefinitionBySlug
278
- * @summary: Delete custom fields definition
279
- * @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/deleteCustomFieldDefinitionBySlug/).
266
+ * @returns {Promise<ContentPlatformModel.CustomObjectSchema>} - Success response
267
+ * @name createCustomObjectBySlug
268
+ * @summary: Create custom object entries
269
+ * @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/createCustomObjectBySlug/).
280
270
  */
281
- async deleteCustomFieldDefinitionBySlug(
282
- { slug, resource, namespace, requestHeaders } = { requestHeaders: {} },
271
+ async createCustomObjectBySlug(
272
+ { definitionSlug, body, requestHeaders } = { requestHeaders: {} },
283
273
  { responseHeaders } = { responseHeaders: false }
284
274
  ) {
285
275
  const {
286
276
  error,
287
- } = ContentPlatformValidator.deleteCustomFieldDefinitionBySlug().validate(
277
+ } = ContentPlatformValidator.createCustomObjectBySlug().validate(
288
278
  {
289
- slug,
290
- resource,
291
- namespace,
279
+ definitionSlug,
280
+ body,
292
281
  },
293
282
  { abortEarly: false, allowUnknown: true }
294
283
  );
@@ -299,18 +288,17 @@ class Content {
299
288
  // Showing warrnings if extra unknown parameters are found
300
289
  const {
301
290
  error: warrning,
302
- } = ContentPlatformValidator.deleteCustomFieldDefinitionBySlug().validate(
291
+ } = ContentPlatformValidator.createCustomObjectBySlug().validate(
303
292
  {
304
- slug,
305
- resource,
306
- namespace,
293
+ definitionSlug,
294
+ body,
307
295
  },
308
296
  { abortEarly: false, allowUnknown: false }
309
297
  );
310
298
  if (warrning) {
311
299
  Logger({
312
300
  level: "WARN",
313
- message: `Parameter Validation warrnings for platform > Content > deleteCustomFieldDefinitionBySlug \n ${warrning}`,
301
+ message: `Parameter Validation warrnings for platform > Content > createCustomObjectBySlug \n ${warrning}`,
314
302
  });
315
303
  }
316
304
 
@@ -320,10 +308,10 @@ class Content {
320
308
 
321
309
  const response = await PlatformAPIClient.execute(
322
310
  this.config,
323
- "delete",
324
- `/service/platform/content/v2.0/company/${this.config.companyId}/customfields/resource/${resource}/namespace/${namespace}/definition/${slug}`,
311
+ "post",
312
+ `/service/platform/content/v2.0/company/${this.config.companyId}/customobjects/definition/${definitionSlug}/entries`,
325
313
  query_params,
326
- undefined,
314
+ body,
327
315
  { ...xHeaders, ...requestHeaders },
328
316
  { responseHeaders }
329
317
  );
@@ -335,7 +323,7 @@ class Content {
335
323
 
336
324
  const {
337
325
  error: res_error,
338
- } = ContentPlatformModel.CustomDataDeleteSchema().validate(responseData, {
326
+ } = ContentPlatformModel.CustomObjectSchema().validate(responseData, {
339
327
  abortEarly: false,
340
328
  allowUnknown: true,
341
329
  });
@@ -346,7 +334,7 @@ class Content {
346
334
  } else {
347
335
  Logger({
348
336
  level: "WARN",
349
- message: `Response Validation Warnings for platform > Content > deleteCustomFieldDefinitionBySlug \n ${res_error}`,
337
+ message: `Response Validation Warnings for platform > Content > createCustomObjectBySlug \n ${res_error}`,
350
338
  });
351
339
  }
352
340
  }
@@ -355,28 +343,27 @@ class Content {
355
343
  }
356
344
 
357
345
  /**
358
- * @param {ContentPlatformValidator.DeleteCustomFieldsByResourceSlugParam} arg
346
+ * @param {ContentPlatformValidator.CreateCustomObjectDefinitionParam} arg
359
347
  * - Arg object
360
348
  *
361
349
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
362
350
  * @param {import("../PlatformAPIClient").Options} - Options
363
- * @returns {Promise<ContentPlatformModel.CustomFieldsDeleteSchema>} -
364
- * Success response
365
- * @name deleteCustomFieldsByResourceSlug
366
- * @summary: delete custom fields of given resource and resource slug
367
- * @description: Use this API to delete the custom fields for given resource in param. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/content/deleteCustomFieldsByResourceSlug/).
351
+ * @returns {Promise<ContentPlatformModel.CustomObjectDefinitionSlugSchema>}
352
+ * - Success response
353
+ *
354
+ * @name createCustomObjectDefinition
355
+ * @summary: Create custom object definition
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://partners.fynd.com/help/docs/sdk/platform/content/createCustomObjectDefinition/).
368
357
  */
369
- async deleteCustomFieldsByResourceSlug(
370
- { resource, resourceSlug, ids, requestHeaders } = { requestHeaders: {} },
358
+ async createCustomObjectDefinition(
359
+ { body, requestHeaders } = { requestHeaders: {} },
371
360
  { responseHeaders } = { responseHeaders: false }
372
361
  ) {
373
362
  const {
374
363
  error,
375
- } = ContentPlatformValidator.deleteCustomFieldsByResourceSlug().validate(
364
+ } = ContentPlatformValidator.createCustomObjectDefinition().validate(
376
365
  {
377
- resource,
378
- resourceSlug,
379
- ids,
366
+ body,
380
367
  },
381
368
  { abortEarly: false, allowUnknown: true }
382
369
  );
@@ -387,32 +374,29 @@ class Content {
387
374
  // Showing warrnings if extra unknown parameters are found
388
375
  const {
389
376
  error: warrning,
390
- } = ContentPlatformValidator.deleteCustomFieldsByResourceSlug().validate(
377
+ } = ContentPlatformValidator.createCustomObjectDefinition().validate(
391
378
  {
392
- resource,
393
- resourceSlug,
394
- ids,
379
+ body,
395
380
  },
396
381
  { abortEarly: false, allowUnknown: false }
397
382
  );
398
383
  if (warrning) {
399
384
  Logger({
400
385
  level: "WARN",
401
- message: `Parameter Validation warrnings for platform > Content > deleteCustomFieldsByResourceSlug \n ${warrning}`,
386
+ message: `Parameter Validation warrnings for platform > Content > createCustomObjectDefinition \n ${warrning}`,
402
387
  });
403
388
  }
404
389
 
405
390
  const query_params = {};
406
- query_params["ids"] = ids;
407
391
 
408
392
  const xHeaders = {};
409
393
 
410
394
  const response = await PlatformAPIClient.execute(
411
395
  this.config,
412
- "delete",
413
- `/service/platform/content/v2.0/company/${this.config.companyId}/customfields/resource/${resource}/${resourceSlug}`,
396
+ "post",
397
+ `/service/platform/content/v2.0/company/${this.config.companyId}/customobjects/definition`,
414
398
  query_params,
415
- undefined,
399
+ body,
416
400
  { ...xHeaders, ...requestHeaders },
417
401
  { responseHeaders }
418
402
  );
@@ -424,10 +408,10 @@ class Content {
424
408
 
425
409
  const {
426
410
  error: res_error,
427
- } = ContentPlatformModel.CustomFieldsDeleteSchema().validate(responseData, {
428
- abortEarly: false,
429
- allowUnknown: true,
430
- });
411
+ } = ContentPlatformModel.CustomObjectDefinitionSlugSchema().validate(
412
+ responseData,
413
+ { abortEarly: false, allowUnknown: true }
414
+ );
431
415
 
432
416
  if (res_error) {
433
417
  if (this.config.options.strictResponseCheck === true) {
@@ -435,7 +419,7 @@ class Content {
435
419
  } else {
436
420
  Logger({
437
421
  level: "WARN",
438
- message: `Response Validation Warnings for platform > Content > deleteCustomFieldsByResourceSlug \n ${res_error}`,
422
+ message: `Response Validation Warnings for platform > Content > createCustomObjectDefinition \n ${res_error}`,
439
423
  });
440
424
  }
441
425
  }
@@ -444,24 +428,21 @@ class Content {
444
428
  }
445
429
 
446
430
  /**
447
- * @param {ContentPlatformValidator.DeleteCustomObjectBySlugParam} arg - Arg object
431
+ * @param {ContentPlatformValidator.DeleteCompanyLanguageParam} arg - Arg object
448
432
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
449
433
  * @param {import("../PlatformAPIClient").Options} - Options
450
- * @returns {Promise<ContentPlatformModel.CustomDataDeleteSchema>} - Success response
451
- * @name deleteCustomObjectBySlug
452
- * @summary: Delete custom object
453
- * @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/deleteCustomObjectBySlug/).
434
+ * @returns {Promise<any>} - 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://partners.fynd.com/help/docs/sdk/platform/content/deleteCompanyLanguage/).
454
438
  */
455
- async deleteCustomObjectBySlug(
456
- { definitionSlug, slug, requestHeaders } = { requestHeaders: {} },
439
+ async deleteCompanyLanguage(
440
+ { locale, requestHeaders } = { requestHeaders: {} },
457
441
  { responseHeaders } = { responseHeaders: false }
458
442
  ) {
459
- const {
460
- error,
461
- } = ContentPlatformValidator.deleteCustomObjectBySlug().validate(
443
+ const { error } = ContentPlatformValidator.deleteCompanyLanguage().validate(
462
444
  {
463
- definitionSlug,
464
- slug,
445
+ locale,
465
446
  },
466
447
  { abortEarly: false, allowUnknown: true }
467
448
  );
@@ -472,17 +453,16 @@ class Content {
472
453
  // Showing warrnings if extra unknown parameters are found
473
454
  const {
474
455
  error: warrning,
475
- } = ContentPlatformValidator.deleteCustomObjectBySlug().validate(
456
+ } = ContentPlatformValidator.deleteCompanyLanguage().validate(
476
457
  {
477
- definitionSlug,
478
- slug,
458
+ locale,
479
459
  },
480
460
  { abortEarly: false, allowUnknown: false }
481
461
  );
482
462
  if (warrning) {
483
463
  Logger({
484
464
  level: "WARN",
485
- message: `Parameter Validation warrnings for platform > Content > deleteCustomObjectBySlug \n ${warrning}`,
465
+ message: `Parameter Validation warrnings for platform > Content > deleteCompanyLanguage \n ${warrning}`,
486
466
  });
487
467
  }
488
468
 
@@ -493,7 +473,7 @@ class Content {
493
473
  const response = await PlatformAPIClient.execute(
494
474
  this.config,
495
475
  "delete",
496
- `/service/platform/content/v2.0/company/${this.config.companyId}/customobjects/definition/${definitionSlug}/entries/${slug}`,
476
+ `/service/platform/content/v1.0/company/${this.config.companyId}/languages/${locale}`,
497
477
  query_params,
498
478
  undefined,
499
479
  { ...xHeaders, ...requestHeaders },
@@ -505,12 +485,9 @@ class Content {
505
485
  responseData = response[0];
506
486
  }
507
487
 
508
- const {
509
- error: res_error,
510
- } = ContentPlatformModel.CustomDataDeleteSchema().validate(responseData, {
511
- abortEarly: false,
512
- allowUnknown: true,
513
- });
488
+ const { error: res_error } = Joi.string()
489
+ .allow("")
490
+ .validate(responseData, { abortEarly: false, allowUnknown: true });
514
491
 
515
492
  if (res_error) {
516
493
  if (this.config.options.strictResponseCheck === true) {
@@ -518,7 +495,7 @@ class Content {
518
495
  } else {
519
496
  Logger({
520
497
  level: "WARN",
521
- message: `Response Validation Warnings for platform > Content > deleteCustomObjectBySlug \n ${res_error}`,
498
+ message: `Response Validation Warnings for platform > Content > deleteCompanyLanguage \n ${res_error}`,
522
499
  });
523
500
  }
524
501
  }
@@ -527,27 +504,25 @@ class Content {
527
504
  }
528
505
 
529
506
  /**
530
- * @param {ContentPlatformValidator.DeleteCustomObjectDefinitionBySlugParam} arg
507
+ * @param {ContentPlatformValidator.DeleteCompanyResourceTranslationParam} arg
531
508
  * - Arg object
532
509
  *
533
510
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
534
511
  * @param {import("../PlatformAPIClient").Options} - Options
535
- * @returns {Promise<ContentPlatformModel.CustomObjectDefinitionDeleteResponseSchema>}
536
- * - Success response
537
- *
538
- * @name deleteCustomObjectDefinitionBySlug
539
- * @summary: Delete custom object definition
540
- * @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/deleteCustomObjectDefinitionBySlug/).
512
+ * @returns {Promise<ContentPlatformModel.DeletedResource>} - Success response
513
+ * @name deleteCompanyResourceTranslation
514
+ * @summary: Remove company translation
515
+ * @description: Remove translations for company resources. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/content/deleteCompanyResourceTranslation/).
541
516
  */
542
- async deleteCustomObjectDefinitionBySlug(
543
- { slug, requestHeaders } = { requestHeaders: {} },
517
+ async deleteCompanyResourceTranslation(
518
+ { id, requestHeaders } = { requestHeaders: {} },
544
519
  { responseHeaders } = { responseHeaders: false }
545
520
  ) {
546
521
  const {
547
522
  error,
548
- } = ContentPlatformValidator.deleteCustomObjectDefinitionBySlug().validate(
523
+ } = ContentPlatformValidator.deleteCompanyResourceTranslation().validate(
549
524
  {
550
- slug,
525
+ id,
551
526
  },
552
527
  { abortEarly: false, allowUnknown: true }
553
528
  );
@@ -558,16 +533,16 @@ class Content {
558
533
  // Showing warrnings if extra unknown parameters are found
559
534
  const {
560
535
  error: warrning,
561
- } = ContentPlatformValidator.deleteCustomObjectDefinitionBySlug().validate(
536
+ } = ContentPlatformValidator.deleteCompanyResourceTranslation().validate(
562
537
  {
563
- slug,
538
+ id,
564
539
  },
565
540
  { abortEarly: false, allowUnknown: false }
566
541
  );
567
542
  if (warrning) {
568
543
  Logger({
569
544
  level: "WARN",
570
- message: `Parameter Validation warrnings for platform > Content > deleteCustomObjectDefinitionBySlug \n ${warrning}`,
545
+ message: `Parameter Validation warrnings for platform > Content > deleteCompanyResourceTranslation \n ${warrning}`,
571
546
  });
572
547
  }
573
548
 
@@ -578,7 +553,7 @@ class Content {
578
553
  const response = await PlatformAPIClient.execute(
579
554
  this.config,
580
555
  "delete",
581
- `/service/platform/content/v2.0/company/${this.config.companyId}/customobjects/definition/${slug}`,
556
+ `/service/platform/content/v1.0/company/${this.config.companyId}/resource/translations/${id}`,
582
557
  query_params,
583
558
  undefined,
584
559
  { ...xHeaders, ...requestHeaders },
@@ -592,10 +567,10 @@ class Content {
592
567
 
593
568
  const {
594
569
  error: res_error,
595
- } = ContentPlatformModel.CustomObjectDefinitionDeleteResponseSchema().validate(
596
- responseData,
597
- { abortEarly: false, allowUnknown: true }
598
- );
570
+ } = ContentPlatformModel.DeletedResource().validate(responseData, {
571
+ abortEarly: false,
572
+ allowUnknown: true,
573
+ });
599
574
 
600
575
  if (res_error) {
601
576
  if (this.config.options.strictResponseCheck === true) {
@@ -603,7 +578,7 @@ class Content {
603
578
  } else {
604
579
  Logger({
605
580
  level: "WARN",
606
- message: `Response Validation Warnings for platform > Content > deleteCustomObjectDefinitionBySlug \n ${res_error}`,
581
+ message: `Response Validation Warnings for platform > Content > deleteCompanyResourceTranslation \n ${res_error}`,
607
582
  });
608
583
  }
609
584
  }
@@ -612,27 +587,27 @@ class Content {
612
587
  }
613
588
 
614
589
  /**
615
- * @param {ContentPlatformValidator.ExportCustomObjectEntriesBySlugParam} arg
590
+ * @param {ContentPlatformValidator.DeleteCustomFieldDefinitionBySlugParam} arg
616
591
  * - Arg object
617
592
  *
618
593
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
619
594
  * @param {import("../PlatformAPIClient").Options} - Options
620
- * @returns {Promise<ContentPlatformModel.CustomObjectBulkEntryInitiateDownload>}
621
- * - Success response
622
- *
623
- * @name exportCustomObjectEntriesBySlug
624
- * @summary: Initiate download for bulk custom object entries
625
- * @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/exportCustomObjectEntriesBySlug/).
595
+ * @returns {Promise<ContentPlatformModel.CustomDataDeleteSchema>} - Success response
596
+ * @name deleteCustomFieldDefinitionBySlug
597
+ * @summary: Delete custom fields definition
598
+ * @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/deleteCustomFieldDefinitionBySlug/).
626
599
  */
627
- async exportCustomObjectEntriesBySlug(
628
- { slug, requestHeaders } = { requestHeaders: {} },
600
+ async deleteCustomFieldDefinitionBySlug(
601
+ { slug, resource, namespace, requestHeaders } = { requestHeaders: {} },
629
602
  { responseHeaders } = { responseHeaders: false }
630
603
  ) {
631
604
  const {
632
605
  error,
633
- } = ContentPlatformValidator.exportCustomObjectEntriesBySlug().validate(
606
+ } = ContentPlatformValidator.deleteCustomFieldDefinitionBySlug().validate(
634
607
  {
635
608
  slug,
609
+ resource,
610
+ namespace,
636
611
  },
637
612
  { abortEarly: false, allowUnknown: true }
638
613
  );
@@ -643,16 +618,18 @@ class Content {
643
618
  // Showing warrnings if extra unknown parameters are found
644
619
  const {
645
620
  error: warrning,
646
- } = ContentPlatformValidator.exportCustomObjectEntriesBySlug().validate(
621
+ } = ContentPlatformValidator.deleteCustomFieldDefinitionBySlug().validate(
647
622
  {
648
623
  slug,
624
+ resource,
625
+ namespace,
649
626
  },
650
627
  { abortEarly: false, allowUnknown: false }
651
628
  );
652
629
  if (warrning) {
653
630
  Logger({
654
631
  level: "WARN",
655
- message: `Parameter Validation warrnings for platform > Content > exportCustomObjectEntriesBySlug \n ${warrning}`,
632
+ message: `Parameter Validation warrnings for platform > Content > deleteCustomFieldDefinitionBySlug \n ${warrning}`,
656
633
  });
657
634
  }
658
635
 
@@ -662,8 +639,8 @@ class Content {
662
639
 
663
640
  const response = await PlatformAPIClient.execute(
664
641
  this.config,
665
- "get",
666
- `/service/platform/content/v2.0/company/${this.config.companyId}/customobjects/definition/${slug}/bulk/download`,
642
+ "delete",
643
+ `/service/platform/content/v2.0/company/${this.config.companyId}/customfields/resource/${resource}/namespace/${namespace}/definition/${slug}`,
667
644
  query_params,
668
645
  undefined,
669
646
  { ...xHeaders, ...requestHeaders },
@@ -677,10 +654,10 @@ class Content {
677
654
 
678
655
  const {
679
656
  error: res_error,
680
- } = ContentPlatformModel.CustomObjectBulkEntryInitiateDownload().validate(
681
- responseData,
682
- { abortEarly: false, allowUnknown: true }
683
- );
657
+ } = ContentPlatformModel.CustomDataDeleteSchema().validate(responseData, {
658
+ abortEarly: false,
659
+ allowUnknown: true,
660
+ });
684
661
 
685
662
  if (res_error) {
686
663
  if (this.config.options.strictResponseCheck === true) {
@@ -688,7 +665,740 @@ class Content {
688
665
  } else {
689
666
  Logger({
690
667
  level: "WARN",
691
- message: `Response Validation Warnings for platform > Content > exportCustomObjectEntriesBySlug \n ${res_error}`,
668
+ message: `Response Validation Warnings for platform > Content > deleteCustomFieldDefinitionBySlug \n ${res_error}`,
669
+ });
670
+ }
671
+ }
672
+
673
+ return response;
674
+ }
675
+
676
+ /**
677
+ * @param {ContentPlatformValidator.DeleteCustomFieldsByResourceSlugParam} arg
678
+ * - Arg object
679
+ *
680
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
681
+ * @param {import("../PlatformAPIClient").Options} - Options
682
+ * @returns {Promise<ContentPlatformModel.CustomFieldsDeleteSchema>} -
683
+ * Success response
684
+ * @name deleteCustomFieldsByResourceSlug
685
+ * @summary: delete custom fields of given resource and resource slug
686
+ * @description: Use this API to delete the custom fields for given resource in param. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/content/deleteCustomFieldsByResourceSlug/).
687
+ */
688
+ async deleteCustomFieldsByResourceSlug(
689
+ { resource, resourceSlug, ids, requestHeaders } = { requestHeaders: {} },
690
+ { responseHeaders } = { responseHeaders: false }
691
+ ) {
692
+ const {
693
+ error,
694
+ } = ContentPlatformValidator.deleteCustomFieldsByResourceSlug().validate(
695
+ {
696
+ resource,
697
+ resourceSlug,
698
+ ids,
699
+ },
700
+ { abortEarly: false, allowUnknown: true }
701
+ );
702
+ if (error) {
703
+ return Promise.reject(new FDKClientValidationError(error));
704
+ }
705
+
706
+ // Showing warrnings if extra unknown parameters are found
707
+ const {
708
+ error: warrning,
709
+ } = ContentPlatformValidator.deleteCustomFieldsByResourceSlug().validate(
710
+ {
711
+ resource,
712
+ resourceSlug,
713
+ ids,
714
+ },
715
+ { abortEarly: false, allowUnknown: false }
716
+ );
717
+ if (warrning) {
718
+ Logger({
719
+ level: "WARN",
720
+ message: `Parameter Validation warrnings for platform > Content > deleteCustomFieldsByResourceSlug \n ${warrning}`,
721
+ });
722
+ }
723
+
724
+ const query_params = {};
725
+ query_params["ids"] = ids;
726
+
727
+ const xHeaders = {};
728
+
729
+ const response = await PlatformAPIClient.execute(
730
+ this.config,
731
+ "delete",
732
+ `/service/platform/content/v2.0/company/${this.config.companyId}/customfields/resource/${resource}/${resourceSlug}`,
733
+ query_params,
734
+ undefined,
735
+ { ...xHeaders, ...requestHeaders },
736
+ { responseHeaders }
737
+ );
738
+
739
+ let responseData = response;
740
+ if (responseHeaders) {
741
+ responseData = response[0];
742
+ }
743
+
744
+ const {
745
+ error: res_error,
746
+ } = ContentPlatformModel.CustomFieldsDeleteSchema().validate(responseData, {
747
+ abortEarly: false,
748
+ allowUnknown: true,
749
+ });
750
+
751
+ if (res_error) {
752
+ if (this.config.options.strictResponseCheck === true) {
753
+ return Promise.reject(new FDKResponseValidationError(res_error));
754
+ } else {
755
+ Logger({
756
+ level: "WARN",
757
+ message: `Response Validation Warnings for platform > Content > deleteCustomFieldsByResourceSlug \n ${res_error}`,
758
+ });
759
+ }
760
+ }
761
+
762
+ return response;
763
+ }
764
+
765
+ /**
766
+ * @param {ContentPlatformValidator.DeleteCustomObjectBySlugParam} arg - Arg object
767
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
768
+ * @param {import("../PlatformAPIClient").Options} - Options
769
+ * @returns {Promise<ContentPlatformModel.CustomDataDeleteSchema>} - Success response
770
+ * @name deleteCustomObjectBySlug
771
+ * @summary: Delete custom object
772
+ * @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/deleteCustomObjectBySlug/).
773
+ */
774
+ async deleteCustomObjectBySlug(
775
+ { definitionSlug, slug, requestHeaders } = { requestHeaders: {} },
776
+ { responseHeaders } = { responseHeaders: false }
777
+ ) {
778
+ const {
779
+ error,
780
+ } = ContentPlatformValidator.deleteCustomObjectBySlug().validate(
781
+ {
782
+ definitionSlug,
783
+ slug,
784
+ },
785
+ { abortEarly: false, allowUnknown: true }
786
+ );
787
+ if (error) {
788
+ return Promise.reject(new FDKClientValidationError(error));
789
+ }
790
+
791
+ // Showing warrnings if extra unknown parameters are found
792
+ const {
793
+ error: warrning,
794
+ } = ContentPlatformValidator.deleteCustomObjectBySlug().validate(
795
+ {
796
+ definitionSlug,
797
+ slug,
798
+ },
799
+ { abortEarly: false, allowUnknown: false }
800
+ );
801
+ if (warrning) {
802
+ Logger({
803
+ level: "WARN",
804
+ message: `Parameter Validation warrnings for platform > Content > deleteCustomObjectBySlug \n ${warrning}`,
805
+ });
806
+ }
807
+
808
+ const query_params = {};
809
+
810
+ const xHeaders = {};
811
+
812
+ const response = await PlatformAPIClient.execute(
813
+ this.config,
814
+ "delete",
815
+ `/service/platform/content/v2.0/company/${this.config.companyId}/customobjects/definition/${definitionSlug}/entries/${slug}`,
816
+ query_params,
817
+ undefined,
818
+ { ...xHeaders, ...requestHeaders },
819
+ { responseHeaders }
820
+ );
821
+
822
+ let responseData = response;
823
+ if (responseHeaders) {
824
+ responseData = response[0];
825
+ }
826
+
827
+ const {
828
+ error: res_error,
829
+ } = ContentPlatformModel.CustomDataDeleteSchema().validate(responseData, {
830
+ abortEarly: false,
831
+ allowUnknown: true,
832
+ });
833
+
834
+ if (res_error) {
835
+ if (this.config.options.strictResponseCheck === true) {
836
+ return Promise.reject(new FDKResponseValidationError(res_error));
837
+ } else {
838
+ Logger({
839
+ level: "WARN",
840
+ message: `Response Validation Warnings for platform > Content > deleteCustomObjectBySlug \n ${res_error}`,
841
+ });
842
+ }
843
+ }
844
+
845
+ return response;
846
+ }
847
+
848
+ /**
849
+ * @param {ContentPlatformValidator.DeleteCustomObjectDefinitionBySlugParam} arg
850
+ * - Arg object
851
+ *
852
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
853
+ * @param {import("../PlatformAPIClient").Options} - Options
854
+ * @returns {Promise<ContentPlatformModel.CustomObjectDefinitionDeleteResponseSchema>}
855
+ * - Success response
856
+ *
857
+ * @name deleteCustomObjectDefinitionBySlug
858
+ * @summary: Delete custom object definition
859
+ * @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/deleteCustomObjectDefinitionBySlug/).
860
+ */
861
+ async deleteCustomObjectDefinitionBySlug(
862
+ { slug, requestHeaders } = { requestHeaders: {} },
863
+ { responseHeaders } = { responseHeaders: false }
864
+ ) {
865
+ const {
866
+ error,
867
+ } = ContentPlatformValidator.deleteCustomObjectDefinitionBySlug().validate(
868
+ {
869
+ slug,
870
+ },
871
+ { abortEarly: false, allowUnknown: true }
872
+ );
873
+ if (error) {
874
+ return Promise.reject(new FDKClientValidationError(error));
875
+ }
876
+
877
+ // Showing warrnings if extra unknown parameters are found
878
+ const {
879
+ error: warrning,
880
+ } = ContentPlatformValidator.deleteCustomObjectDefinitionBySlug().validate(
881
+ {
882
+ slug,
883
+ },
884
+ { abortEarly: false, allowUnknown: false }
885
+ );
886
+ if (warrning) {
887
+ Logger({
888
+ level: "WARN",
889
+ message: `Parameter Validation warrnings for platform > Content > deleteCustomObjectDefinitionBySlug \n ${warrning}`,
890
+ });
891
+ }
892
+
893
+ const query_params = {};
894
+
895
+ const xHeaders = {};
896
+
897
+ const response = await PlatformAPIClient.execute(
898
+ this.config,
899
+ "delete",
900
+ `/service/platform/content/v2.0/company/${this.config.companyId}/customobjects/definition/${slug}`,
901
+ query_params,
902
+ undefined,
903
+ { ...xHeaders, ...requestHeaders },
904
+ { responseHeaders }
905
+ );
906
+
907
+ let responseData = response;
908
+ if (responseHeaders) {
909
+ responseData = response[0];
910
+ }
911
+
912
+ const {
913
+ error: res_error,
914
+ } = ContentPlatformModel.CustomObjectDefinitionDeleteResponseSchema().validate(
915
+ responseData,
916
+ { abortEarly: false, allowUnknown: true }
917
+ );
918
+
919
+ if (res_error) {
920
+ if (this.config.options.strictResponseCheck === true) {
921
+ return Promise.reject(new FDKResponseValidationError(res_error));
922
+ } else {
923
+ Logger({
924
+ level: "WARN",
925
+ message: `Response Validation Warnings for platform > Content > deleteCustomObjectDefinitionBySlug \n ${res_error}`,
926
+ });
927
+ }
928
+ }
929
+
930
+ return response;
931
+ }
932
+
933
+ /**
934
+ * @param {ContentPlatformValidator.ExportCustomObjectEntriesBySlugParam} arg
935
+ * - Arg object
936
+ *
937
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
938
+ * @param {import("../PlatformAPIClient").Options} - Options
939
+ * @returns {Promise<ContentPlatformModel.CustomObjectBulkEntryInitiateDownload>}
940
+ * - Success response
941
+ *
942
+ * @name exportCustomObjectEntriesBySlug
943
+ * @summary: Initiate download for bulk custom object entries
944
+ * @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/exportCustomObjectEntriesBySlug/).
945
+ */
946
+ async exportCustomObjectEntriesBySlug(
947
+ { slug, requestHeaders } = { requestHeaders: {} },
948
+ { responseHeaders } = { responseHeaders: false }
949
+ ) {
950
+ const {
951
+ error,
952
+ } = ContentPlatformValidator.exportCustomObjectEntriesBySlug().validate(
953
+ {
954
+ slug,
955
+ },
956
+ { abortEarly: false, allowUnknown: true }
957
+ );
958
+ if (error) {
959
+ return Promise.reject(new FDKClientValidationError(error));
960
+ }
961
+
962
+ // Showing warrnings if extra unknown parameters are found
963
+ const {
964
+ error: warrning,
965
+ } = ContentPlatformValidator.exportCustomObjectEntriesBySlug().validate(
966
+ {
967
+ slug,
968
+ },
969
+ { abortEarly: false, allowUnknown: false }
970
+ );
971
+ if (warrning) {
972
+ Logger({
973
+ level: "WARN",
974
+ message: `Parameter Validation warrnings for platform > Content > exportCustomObjectEntriesBySlug \n ${warrning}`,
975
+ });
976
+ }
977
+
978
+ const query_params = {};
979
+
980
+ const xHeaders = {};
981
+
982
+ const response = await PlatformAPIClient.execute(
983
+ this.config,
984
+ "get",
985
+ `/service/platform/content/v2.0/company/${this.config.companyId}/customobjects/definition/${slug}/bulk/download`,
986
+ query_params,
987
+ undefined,
988
+ { ...xHeaders, ...requestHeaders },
989
+ { responseHeaders }
990
+ );
991
+
992
+ let responseData = response;
993
+ if (responseHeaders) {
994
+ responseData = response[0];
995
+ }
996
+
997
+ const {
998
+ error: res_error,
999
+ } = ContentPlatformModel.CustomObjectBulkEntryInitiateDownload().validate(
1000
+ responseData,
1001
+ { abortEarly: false, allowUnknown: true }
1002
+ );
1003
+
1004
+ if (res_error) {
1005
+ if (this.config.options.strictResponseCheck === true) {
1006
+ return Promise.reject(new FDKResponseValidationError(res_error));
1007
+ } else {
1008
+ Logger({
1009
+ level: "WARN",
1010
+ message: `Response Validation Warnings for platform > Content > exportCustomObjectEntriesBySlug \n ${res_error}`,
1011
+ });
1012
+ }
1013
+ }
1014
+
1015
+ return response;
1016
+ }
1017
+
1018
+ /**
1019
+ * @param {ContentPlatformValidator.GetAllResourceDefinitionsParam} arg - Arg object
1020
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1021
+ * @param {import("../PlatformAPIClient").Options} - Options
1022
+ * @returns {Promise<Object>} - Success response
1023
+ * @name getAllResourceDefinitions
1024
+ * @summary: Get all resource defination
1025
+ * @description: Retrieve translation schemas and configurations for resources. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/content/getAllResourceDefinitions/).
1026
+ */
1027
+ async getAllResourceDefinitions(
1028
+ { translatableResourceId, requestHeaders } = { requestHeaders: {} },
1029
+ { responseHeaders } = { responseHeaders: false }
1030
+ ) {
1031
+ const {
1032
+ error,
1033
+ } = ContentPlatformValidator.getAllResourceDefinitions().validate(
1034
+ {
1035
+ translatableResourceId,
1036
+ },
1037
+ { abortEarly: false, allowUnknown: true }
1038
+ );
1039
+ if (error) {
1040
+ return Promise.reject(new FDKClientValidationError(error));
1041
+ }
1042
+
1043
+ // Showing warrnings if extra unknown parameters are found
1044
+ const {
1045
+ error: warrning,
1046
+ } = ContentPlatformValidator.getAllResourceDefinitions().validate(
1047
+ {
1048
+ translatableResourceId,
1049
+ },
1050
+ { abortEarly: false, allowUnknown: false }
1051
+ );
1052
+ if (warrning) {
1053
+ Logger({
1054
+ level: "WARN",
1055
+ message: `Parameter Validation warrnings for platform > Content > getAllResourceDefinitions \n ${warrning}`,
1056
+ });
1057
+ }
1058
+
1059
+ const query_params = {};
1060
+ query_params["translatable_resource_id"] = translatableResourceId;
1061
+
1062
+ const xHeaders = {};
1063
+
1064
+ const response = await PlatformAPIClient.execute(
1065
+ this.config,
1066
+ "get",
1067
+ `/service/platform/content/v1.0/company/${this.config.companyId}/translatable/resource/definitions`,
1068
+ query_params,
1069
+ undefined,
1070
+ { ...xHeaders, ...requestHeaders },
1071
+ { responseHeaders }
1072
+ );
1073
+
1074
+ let responseData = response;
1075
+ if (responseHeaders) {
1076
+ responseData = response[0];
1077
+ }
1078
+
1079
+ const { error: res_error } = Joi.any().validate(responseData, {
1080
+ abortEarly: false,
1081
+ allowUnknown: true,
1082
+ });
1083
+
1084
+ if (res_error) {
1085
+ if (this.config.options.strictResponseCheck === true) {
1086
+ return Promise.reject(new FDKResponseValidationError(res_error));
1087
+ } else {
1088
+ Logger({
1089
+ level: "WARN",
1090
+ message: `Response Validation Warnings for platform > Content > getAllResourceDefinitions \n ${res_error}`,
1091
+ });
1092
+ }
1093
+ }
1094
+
1095
+ return response;
1096
+ }
1097
+
1098
+ /**
1099
+ * @param {ContentPlatformValidator.GetAllSectionsParam} arg - Arg object
1100
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1101
+ * @param {import("../PlatformAPIClient").Options} - Options
1102
+ * @returns {Promise<Object>} - Success response
1103
+ * @name getAllSections
1104
+ * @summary: List all translatable content sections
1105
+ * @description: Retrieve all translatable content sections for organization. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/content/getAllSections/).
1106
+ */
1107
+ async getAllSections(
1108
+ { requestHeaders } = { requestHeaders: {} },
1109
+ { responseHeaders } = { responseHeaders: false }
1110
+ ) {
1111
+ const { error } = ContentPlatformValidator.getAllSections().validate(
1112
+ {},
1113
+ { abortEarly: false, allowUnknown: true }
1114
+ );
1115
+ if (error) {
1116
+ return Promise.reject(new FDKClientValidationError(error));
1117
+ }
1118
+
1119
+ // Showing warrnings if extra unknown parameters are found
1120
+ const {
1121
+ error: warrning,
1122
+ } = ContentPlatformValidator.getAllSections().validate(
1123
+ {},
1124
+ { abortEarly: false, allowUnknown: false }
1125
+ );
1126
+ if (warrning) {
1127
+ Logger({
1128
+ level: "WARN",
1129
+ message: `Parameter Validation warrnings for platform > Content > getAllSections \n ${warrning}`,
1130
+ });
1131
+ }
1132
+
1133
+ const query_params = {};
1134
+
1135
+ const xHeaders = {};
1136
+
1137
+ const response = await PlatformAPIClient.execute(
1138
+ this.config,
1139
+ "get",
1140
+ `/service/platform/content/v1.0/company/${this.config.companyId}/translatable/sections`,
1141
+ query_params,
1142
+ undefined,
1143
+ { ...xHeaders, ...requestHeaders },
1144
+ { responseHeaders }
1145
+ );
1146
+
1147
+ let responseData = response;
1148
+ if (responseHeaders) {
1149
+ responseData = response[0];
1150
+ }
1151
+
1152
+ const { error: res_error } = Joi.any().validate(responseData, {
1153
+ abortEarly: false,
1154
+ allowUnknown: true,
1155
+ });
1156
+
1157
+ if (res_error) {
1158
+ if (this.config.options.strictResponseCheck === true) {
1159
+ return Promise.reject(new FDKResponseValidationError(res_error));
1160
+ } else {
1161
+ Logger({
1162
+ level: "WARN",
1163
+ message: `Response Validation Warnings for platform > Content > getAllSections \n ${res_error}`,
1164
+ });
1165
+ }
1166
+ }
1167
+
1168
+ return response;
1169
+ }
1170
+
1171
+ /**
1172
+ * @param {ContentPlatformValidator.GetAllTranslatableResourcesParam} arg - Arg object
1173
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1174
+ * @param {import("../PlatformAPIClient").Options} - Options
1175
+ * @returns {Promise<Object>} - Success response
1176
+ * @name getAllTranslatableResources
1177
+ * @summary: List all translatable resources
1178
+ * @description: Retrieve all translatable content resources for the company. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/content/getAllTranslatableResources/).
1179
+ */
1180
+ async getAllTranslatableResources(
1181
+ { requestHeaders } = { requestHeaders: {} },
1182
+ { responseHeaders } = { responseHeaders: false }
1183
+ ) {
1184
+ const {
1185
+ error,
1186
+ } = ContentPlatformValidator.getAllTranslatableResources().validate(
1187
+ {},
1188
+ { abortEarly: false, allowUnknown: true }
1189
+ );
1190
+ if (error) {
1191
+ return Promise.reject(new FDKClientValidationError(error));
1192
+ }
1193
+
1194
+ // Showing warrnings if extra unknown parameters are found
1195
+ const {
1196
+ error: warrning,
1197
+ } = ContentPlatformValidator.getAllTranslatableResources().validate(
1198
+ {},
1199
+ { abortEarly: false, allowUnknown: false }
1200
+ );
1201
+ if (warrning) {
1202
+ Logger({
1203
+ level: "WARN",
1204
+ message: `Parameter Validation warrnings for platform > Content > getAllTranslatableResources \n ${warrning}`,
1205
+ });
1206
+ }
1207
+
1208
+ const query_params = {};
1209
+
1210
+ const xHeaders = {};
1211
+
1212
+ const response = await PlatformAPIClient.execute(
1213
+ this.config,
1214
+ "get",
1215
+ `/service/platform/content/v1.0/company/${this.config.companyId}/translatable/resources`,
1216
+ query_params,
1217
+ undefined,
1218
+ { ...xHeaders, ...requestHeaders },
1219
+ { responseHeaders }
1220
+ );
1221
+
1222
+ let responseData = response;
1223
+ if (responseHeaders) {
1224
+ responseData = response[0];
1225
+ }
1226
+
1227
+ const { error: res_error } = Joi.any().validate(responseData, {
1228
+ abortEarly: false,
1229
+ allowUnknown: true,
1230
+ });
1231
+
1232
+ if (res_error) {
1233
+ if (this.config.options.strictResponseCheck === true) {
1234
+ return Promise.reject(new FDKResponseValidationError(res_error));
1235
+ } else {
1236
+ Logger({
1237
+ level: "WARN",
1238
+ message: `Response Validation Warnings for platform > Content > getAllTranslatableResources \n ${res_error}`,
1239
+ });
1240
+ }
1241
+ }
1242
+
1243
+ return response;
1244
+ }
1245
+
1246
+ /**
1247
+ * @param {ContentPlatformValidator.GetCompanyLanguagesParam} arg - Arg object
1248
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1249
+ * @param {import("../PlatformAPIClient").Options} - Options
1250
+ * @returns {Promise<Object>} - Success response
1251
+ * @name getCompanyLanguages
1252
+ * @summary: Get company languages
1253
+ * @description: Retrieve language configurations and settings for the specified company. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/content/getCompanyLanguages/).
1254
+ */
1255
+ async getCompanyLanguages(
1256
+ { requestHeaders } = { requestHeaders: {} },
1257
+ { responseHeaders } = { responseHeaders: false }
1258
+ ) {
1259
+ const { error } = ContentPlatformValidator.getCompanyLanguages().validate(
1260
+ {},
1261
+ { abortEarly: false, allowUnknown: true }
1262
+ );
1263
+ if (error) {
1264
+ return Promise.reject(new FDKClientValidationError(error));
1265
+ }
1266
+
1267
+ // Showing warrnings if extra unknown parameters are found
1268
+ const {
1269
+ error: warrning,
1270
+ } = ContentPlatformValidator.getCompanyLanguages().validate(
1271
+ {},
1272
+ { abortEarly: false, allowUnknown: false }
1273
+ );
1274
+ if (warrning) {
1275
+ Logger({
1276
+ level: "WARN",
1277
+ message: `Parameter Validation warrnings for platform > Content > getCompanyLanguages \n ${warrning}`,
1278
+ });
1279
+ }
1280
+
1281
+ const query_params = {};
1282
+
1283
+ const xHeaders = {};
1284
+
1285
+ const response = await PlatformAPIClient.execute(
1286
+ this.config,
1287
+ "get",
1288
+ `/service/platform/content/v1.0/company/${this.config.companyId}/languages`,
1289
+ query_params,
1290
+ undefined,
1291
+ { ...xHeaders, ...requestHeaders },
1292
+ { responseHeaders }
1293
+ );
1294
+
1295
+ let responseData = response;
1296
+ if (responseHeaders) {
1297
+ responseData = response[0];
1298
+ }
1299
+
1300
+ const { error: res_error } = Joi.any().validate(responseData, {
1301
+ abortEarly: false,
1302
+ allowUnknown: true,
1303
+ });
1304
+
1305
+ if (res_error) {
1306
+ if (this.config.options.strictResponseCheck === true) {
1307
+ return Promise.reject(new FDKResponseValidationError(res_error));
1308
+ } else {
1309
+ Logger({
1310
+ level: "WARN",
1311
+ message: `Response Validation Warnings for platform > Content > getCompanyLanguages \n ${res_error}`,
1312
+ });
1313
+ }
1314
+ }
1315
+
1316
+ return response;
1317
+ }
1318
+
1319
+ /**
1320
+ * @param {ContentPlatformValidator.GetCompanyResourceTranslationParam} arg
1321
+ * - Arg object
1322
+ *
1323
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1324
+ * @param {import("../PlatformAPIClient").Options} - Options
1325
+ * @returns {Promise<ContentPlatformModel.ResourceTranslation>} - Success response
1326
+ * @name getCompanyResourceTranslation
1327
+ * @summary: Get company translations
1328
+ * @description: Fetch translations for company-level resources. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/content/getCompanyResourceTranslation/).
1329
+ */
1330
+ async getCompanyResourceTranslation(
1331
+ { locale, type, resourceId, requestHeaders } = { requestHeaders: {} },
1332
+ { responseHeaders } = { responseHeaders: false }
1333
+ ) {
1334
+ const {
1335
+ error,
1336
+ } = ContentPlatformValidator.getCompanyResourceTranslation().validate(
1337
+ {
1338
+ locale,
1339
+ type,
1340
+ resourceId,
1341
+ },
1342
+ { abortEarly: false, allowUnknown: true }
1343
+ );
1344
+ if (error) {
1345
+ return Promise.reject(new FDKClientValidationError(error));
1346
+ }
1347
+
1348
+ // Showing warrnings if extra unknown parameters are found
1349
+ const {
1350
+ error: warrning,
1351
+ } = ContentPlatformValidator.getCompanyResourceTranslation().validate(
1352
+ {
1353
+ locale,
1354
+ type,
1355
+ resourceId,
1356
+ },
1357
+ { abortEarly: false, allowUnknown: false }
1358
+ );
1359
+ if (warrning) {
1360
+ Logger({
1361
+ level: "WARN",
1362
+ message: `Parameter Validation warrnings for platform > Content > getCompanyResourceTranslation \n ${warrning}`,
1363
+ });
1364
+ }
1365
+
1366
+ const query_params = {};
1367
+ query_params["locale"] = locale;
1368
+ query_params["type"] = type;
1369
+ query_params["resource_id"] = resourceId;
1370
+
1371
+ const xHeaders = {};
1372
+
1373
+ const response = await PlatformAPIClient.execute(
1374
+ this.config,
1375
+ "get",
1376
+ `/service/platform/content/v1.0/company/${this.config.companyId}/resource/translations`,
1377
+ query_params,
1378
+ undefined,
1379
+ { ...xHeaders, ...requestHeaders },
1380
+ { responseHeaders }
1381
+ );
1382
+
1383
+ let responseData = response;
1384
+ if (responseHeaders) {
1385
+ responseData = response[0];
1386
+ }
1387
+
1388
+ const {
1389
+ error: res_error,
1390
+ } = ContentPlatformModel.ResourceTranslation().validate(responseData, {
1391
+ abortEarly: false,
1392
+ allowUnknown: true,
1393
+ });
1394
+
1395
+ if (res_error) {
1396
+ if (this.config.options.strictResponseCheck === true) {
1397
+ return Promise.reject(new FDKResponseValidationError(res_error));
1398
+ } else {
1399
+ Logger({
1400
+ level: "WARN",
1401
+ message: `Response Validation Warnings for platform > Content > getCompanyResourceTranslation \n ${res_error}`,
692
1402
  });
693
1403
  }
694
1404
  }
@@ -702,36 +1412,576 @@ class Content {
702
1412
  *
703
1413
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
704
1414
  * @param {import("../PlatformAPIClient").Options} - Options
705
- * @returns {Promise<ContentPlatformModel.CustomFieldDefinitionsSchema>} -
706
- * Success response
707
- * @name getCustomFieldDefinitionByResource
708
- * @summary: Get custom fields definitions for a given resource type
709
- * @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/getCustomFieldDefinitionByResource/).
1415
+ * @returns {Promise<ContentPlatformModel.CustomFieldDefinitionsSchema>} -
1416
+ * Success response
1417
+ * @name getCustomFieldDefinitionByResource
1418
+ * @summary: Get custom fields definitions for a given resource type
1419
+ * @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/getCustomFieldDefinitionByResource/).
1420
+ */
1421
+ async getCustomFieldDefinitionByResource(
1422
+ {
1423
+ pageNo,
1424
+ pageSize,
1425
+ resource,
1426
+ types,
1427
+ search,
1428
+ slugs,
1429
+ namespaces,
1430
+ requestHeaders,
1431
+ } = { requestHeaders: {} },
1432
+ { responseHeaders } = { responseHeaders: false }
1433
+ ) {
1434
+ const {
1435
+ error,
1436
+ } = ContentPlatformValidator.getCustomFieldDefinitionByResource().validate(
1437
+ {
1438
+ pageNo,
1439
+ pageSize,
1440
+ resource,
1441
+ types,
1442
+ search,
1443
+ slugs,
1444
+ namespaces,
1445
+ },
1446
+ { abortEarly: false, allowUnknown: true }
1447
+ );
1448
+ if (error) {
1449
+ return Promise.reject(new FDKClientValidationError(error));
1450
+ }
1451
+
1452
+ // Showing warrnings if extra unknown parameters are found
1453
+ const {
1454
+ error: warrning,
1455
+ } = ContentPlatformValidator.getCustomFieldDefinitionByResource().validate(
1456
+ {
1457
+ pageNo,
1458
+ pageSize,
1459
+ resource,
1460
+ types,
1461
+ search,
1462
+ slugs,
1463
+ namespaces,
1464
+ },
1465
+ { abortEarly: false, allowUnknown: false }
1466
+ );
1467
+ if (warrning) {
1468
+ Logger({
1469
+ level: "WARN",
1470
+ message: `Parameter Validation warrnings for platform > Content > getCustomFieldDefinitionByResource \n ${warrning}`,
1471
+ });
1472
+ }
1473
+
1474
+ const query_params = {};
1475
+ query_params["page_no"] = pageNo;
1476
+ query_params["page_size"] = pageSize;
1477
+ query_params["types"] = types;
1478
+ query_params["search"] = search;
1479
+ query_params["slugs"] = slugs;
1480
+ query_params["namespaces"] = namespaces;
1481
+
1482
+ const xHeaders = {};
1483
+
1484
+ const response = await PlatformAPIClient.execute(
1485
+ this.config,
1486
+ "get",
1487
+ `/service/platform/content/v2.0/company/${this.config.companyId}/customfields/resource/${resource}/definition`,
1488
+ query_params,
1489
+ undefined,
1490
+ { ...xHeaders, ...requestHeaders },
1491
+ { responseHeaders }
1492
+ );
1493
+
1494
+ let responseData = response;
1495
+ if (responseHeaders) {
1496
+ responseData = response[0];
1497
+ }
1498
+
1499
+ const {
1500
+ error: res_error,
1501
+ } = ContentPlatformModel.CustomFieldDefinitionsSchema().validate(
1502
+ responseData,
1503
+ { abortEarly: false, allowUnknown: true }
1504
+ );
1505
+
1506
+ if (res_error) {
1507
+ if (this.config.options.strictResponseCheck === true) {
1508
+ return Promise.reject(new FDKResponseValidationError(res_error));
1509
+ } else {
1510
+ Logger({
1511
+ level: "WARN",
1512
+ message: `Response Validation Warnings for platform > Content > getCustomFieldDefinitionByResource \n ${res_error}`,
1513
+ });
1514
+ }
1515
+ }
1516
+
1517
+ return response;
1518
+ }
1519
+
1520
+ /**
1521
+ * @param {ContentPlatformValidator.GetCustomFieldDefinitionBySlugParam} arg
1522
+ * - Arg object
1523
+ *
1524
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1525
+ * @param {import("../PlatformAPIClient").Options} - Options
1526
+ * @returns {Promise<ContentPlatformModel.MetaFieldDefinitionDetailResSchema>}
1527
+ * - Success response
1528
+ *
1529
+ * @name getCustomFieldDefinitionBySlug
1530
+ * @summary: Get custom fields definition by resource, slug and namespace
1531
+ * @description: Custom field definitions can be retrived from this using its slug, namespace and resource - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/content/getCustomFieldDefinitionBySlug/).
1532
+ */
1533
+ async getCustomFieldDefinitionBySlug(
1534
+ { slug, resource, namespace, requestHeaders } = { requestHeaders: {} },
1535
+ { responseHeaders } = { responseHeaders: false }
1536
+ ) {
1537
+ const {
1538
+ error,
1539
+ } = ContentPlatformValidator.getCustomFieldDefinitionBySlug().validate(
1540
+ {
1541
+ slug,
1542
+ resource,
1543
+ namespace,
1544
+ },
1545
+ { abortEarly: false, allowUnknown: true }
1546
+ );
1547
+ if (error) {
1548
+ return Promise.reject(new FDKClientValidationError(error));
1549
+ }
1550
+
1551
+ // Showing warrnings if extra unknown parameters are found
1552
+ const {
1553
+ error: warrning,
1554
+ } = ContentPlatformValidator.getCustomFieldDefinitionBySlug().validate(
1555
+ {
1556
+ slug,
1557
+ resource,
1558
+ namespace,
1559
+ },
1560
+ { abortEarly: false, allowUnknown: false }
1561
+ );
1562
+ if (warrning) {
1563
+ Logger({
1564
+ level: "WARN",
1565
+ message: `Parameter Validation warrnings for platform > Content > getCustomFieldDefinitionBySlug \n ${warrning}`,
1566
+ });
1567
+ }
1568
+
1569
+ const query_params = {};
1570
+
1571
+ const xHeaders = {};
1572
+
1573
+ const response = await PlatformAPIClient.execute(
1574
+ this.config,
1575
+ "get",
1576
+ `/service/platform/content/v2.0/company/${this.config.companyId}/customfields/resource/${resource}/namespace/${namespace}/definition/${slug}`,
1577
+ query_params,
1578
+ undefined,
1579
+ { ...xHeaders, ...requestHeaders },
1580
+ { responseHeaders }
1581
+ );
1582
+
1583
+ let responseData = response;
1584
+ if (responseHeaders) {
1585
+ responseData = response[0];
1586
+ }
1587
+
1588
+ const {
1589
+ error: res_error,
1590
+ } = ContentPlatformModel.MetaFieldDefinitionDetailResSchema().validate(
1591
+ responseData,
1592
+ { abortEarly: false, allowUnknown: true }
1593
+ );
1594
+
1595
+ if (res_error) {
1596
+ if (this.config.options.strictResponseCheck === true) {
1597
+ return Promise.reject(new FDKResponseValidationError(res_error));
1598
+ } else {
1599
+ Logger({
1600
+ level: "WARN",
1601
+ message: `Response Validation Warnings for platform > Content > getCustomFieldDefinitionBySlug \n ${res_error}`,
1602
+ });
1603
+ }
1604
+ }
1605
+
1606
+ return response;
1607
+ }
1608
+
1609
+ /**
1610
+ * @param {ContentPlatformValidator.GetCustomFieldDefinitionsParam} arg - Arg object
1611
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1612
+ * @param {import("../PlatformAPIClient").Options} - Options
1613
+ * @returns {Promise<ContentPlatformModel.CustomFieldDefinitionsSchema>} -
1614
+ * Success response
1615
+ * @name getCustomFieldDefinitions
1616
+ * @summary: Get custom fields definitions
1617
+ * @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/).
1618
+ */
1619
+ async getCustomFieldDefinitions(
1620
+ {
1621
+ pageNo,
1622
+ pageSize,
1623
+ resources,
1624
+ types,
1625
+ search,
1626
+ slugs,
1627
+ namespaces,
1628
+ requestHeaders,
1629
+ } = { requestHeaders: {} },
1630
+ { responseHeaders } = { responseHeaders: false }
1631
+ ) {
1632
+ const {
1633
+ error,
1634
+ } = ContentPlatformValidator.getCustomFieldDefinitions().validate(
1635
+ {
1636
+ pageNo,
1637
+ pageSize,
1638
+ resources,
1639
+ types,
1640
+ search,
1641
+ slugs,
1642
+ namespaces,
1643
+ },
1644
+ { abortEarly: false, allowUnknown: true }
1645
+ );
1646
+ if (error) {
1647
+ return Promise.reject(new FDKClientValidationError(error));
1648
+ }
1649
+
1650
+ // Showing warrnings if extra unknown parameters are found
1651
+ const {
1652
+ error: warrning,
1653
+ } = ContentPlatformValidator.getCustomFieldDefinitions().validate(
1654
+ {
1655
+ pageNo,
1656
+ pageSize,
1657
+ resources,
1658
+ types,
1659
+ search,
1660
+ slugs,
1661
+ namespaces,
1662
+ },
1663
+ { abortEarly: false, allowUnknown: false }
1664
+ );
1665
+ if (warrning) {
1666
+ Logger({
1667
+ level: "WARN",
1668
+ message: `Parameter Validation warrnings for platform > Content > getCustomFieldDefinitions \n ${warrning}`,
1669
+ });
1670
+ }
1671
+
1672
+ const query_params = {};
1673
+ query_params["page_no"] = pageNo;
1674
+ query_params["page_size"] = pageSize;
1675
+ query_params["resources"] = resources;
1676
+ query_params["types"] = types;
1677
+ query_params["search"] = search;
1678
+ query_params["slugs"] = slugs;
1679
+ query_params["namespaces"] = namespaces;
1680
+
1681
+ const xHeaders = {};
1682
+
1683
+ const response = await PlatformAPIClient.execute(
1684
+ this.config,
1685
+ "get",
1686
+ `/service/platform/content/v2.0/company/${this.config.companyId}/customfields/definition`,
1687
+ query_params,
1688
+ undefined,
1689
+ { ...xHeaders, ...requestHeaders },
1690
+ { responseHeaders }
1691
+ );
1692
+
1693
+ let responseData = response;
1694
+ if (responseHeaders) {
1695
+ responseData = response[0];
1696
+ }
1697
+
1698
+ const {
1699
+ error: res_error,
1700
+ } = ContentPlatformModel.CustomFieldDefinitionsSchema().validate(
1701
+ responseData,
1702
+ { abortEarly: false, allowUnknown: true }
1703
+ );
1704
+
1705
+ if (res_error) {
1706
+ if (this.config.options.strictResponseCheck === true) {
1707
+ return Promise.reject(new FDKResponseValidationError(res_error));
1708
+ } else {
1709
+ Logger({
1710
+ level: "WARN",
1711
+ message: `Response Validation Warnings for platform > Content > getCustomFieldDefinitions \n ${res_error}`,
1712
+ });
1713
+ }
1714
+ }
1715
+
1716
+ return response;
1717
+ }
1718
+
1719
+ /**
1720
+ * @param {ContentPlatformValidator.GetCustomFieldTypesParam} arg - Arg object
1721
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1722
+ * @param {import("../PlatformAPIClient").Options} - Options
1723
+ * @returns {Promise<ContentPlatformModel.MetafieldTypesSchema>} - Success response
1724
+ * @name getCustomFieldTypes
1725
+ * @summary: Get custom field types
1726
+ * @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/).
1727
+ */
1728
+ async getCustomFieldTypes(
1729
+ { requestHeaders } = { requestHeaders: {} },
1730
+ { responseHeaders } = { responseHeaders: false }
1731
+ ) {
1732
+ const { error } = ContentPlatformValidator.getCustomFieldTypes().validate(
1733
+ {},
1734
+ { abortEarly: false, allowUnknown: true }
1735
+ );
1736
+ if (error) {
1737
+ return Promise.reject(new FDKClientValidationError(error));
1738
+ }
1739
+
1740
+ // Showing warrnings if extra unknown parameters are found
1741
+ const {
1742
+ error: warrning,
1743
+ } = ContentPlatformValidator.getCustomFieldTypes().validate(
1744
+ {},
1745
+ { abortEarly: false, allowUnknown: false }
1746
+ );
1747
+ if (warrning) {
1748
+ Logger({
1749
+ level: "WARN",
1750
+ message: `Parameter Validation warrnings for platform > Content > getCustomFieldTypes \n ${warrning}`,
1751
+ });
1752
+ }
1753
+
1754
+ const query_params = {};
1755
+
1756
+ const xHeaders = {};
1757
+
1758
+ const response = await PlatformAPIClient.execute(
1759
+ this.config,
1760
+ "get",
1761
+ `/service/platform/content/v1.0/company/${this.config.companyId}/metafields/types`,
1762
+ query_params,
1763
+ undefined,
1764
+ { ...xHeaders, ...requestHeaders },
1765
+ { responseHeaders }
1766
+ );
1767
+
1768
+ let responseData = response;
1769
+ if (responseHeaders) {
1770
+ responseData = response[0];
1771
+ }
1772
+
1773
+ const {
1774
+ error: res_error,
1775
+ } = ContentPlatformModel.MetafieldTypesSchema().validate(responseData, {
1776
+ abortEarly: false,
1777
+ allowUnknown: true,
1778
+ });
1779
+
1780
+ if (res_error) {
1781
+ if (this.config.options.strictResponseCheck === true) {
1782
+ return Promise.reject(new FDKResponseValidationError(res_error));
1783
+ } else {
1784
+ Logger({
1785
+ level: "WARN",
1786
+ message: `Response Validation Warnings for platform > Content > getCustomFieldTypes \n ${res_error}`,
1787
+ });
1788
+ }
1789
+ }
1790
+
1791
+ return response;
1792
+ }
1793
+
1794
+ /**
1795
+ * @param {ContentPlatformValidator.GetCustomFieldsByResourceSlugParam} arg
1796
+ * - Arg object
1797
+ *
1798
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1799
+ * @param {import("../PlatformAPIClient").Options} - Options
1800
+ * @returns {Promise<ContentPlatformModel.CustomFieldsResponseByResourceIdSchema>}
1801
+ * - Success response
1802
+ *
1803
+ * @name getCustomFieldsByResourceSlug
1804
+ * @summary: Get list of custom fields of given resource and resource slug
1805
+ * @description: Retrieves a list of custom fields attached to a particular resource by using the resource and resource slug. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/content/getCustomFieldsByResourceSlug/).
1806
+ */
1807
+ async getCustomFieldsByResourceSlug(
1808
+ { resource, resourceSlug, requestHeaders } = { requestHeaders: {} },
1809
+ { responseHeaders } = { responseHeaders: false }
1810
+ ) {
1811
+ const {
1812
+ error,
1813
+ } = ContentPlatformValidator.getCustomFieldsByResourceSlug().validate(
1814
+ {
1815
+ resource,
1816
+ resourceSlug,
1817
+ },
1818
+ { abortEarly: false, allowUnknown: true }
1819
+ );
1820
+ if (error) {
1821
+ return Promise.reject(new FDKClientValidationError(error));
1822
+ }
1823
+
1824
+ // Showing warrnings if extra unknown parameters are found
1825
+ const {
1826
+ error: warrning,
1827
+ } = ContentPlatformValidator.getCustomFieldsByResourceSlug().validate(
1828
+ {
1829
+ resource,
1830
+ resourceSlug,
1831
+ },
1832
+ { abortEarly: false, allowUnknown: false }
1833
+ );
1834
+ if (warrning) {
1835
+ Logger({
1836
+ level: "WARN",
1837
+ message: `Parameter Validation warrnings for platform > Content > getCustomFieldsByResourceSlug \n ${warrning}`,
1838
+ });
1839
+ }
1840
+
1841
+ const query_params = {};
1842
+
1843
+ const xHeaders = {};
1844
+
1845
+ const response = await PlatformAPIClient.execute(
1846
+ this.config,
1847
+ "get",
1848
+ `/service/platform/content/v2.0/company/${this.config.companyId}/customfields/resource/${resource}/${resourceSlug}`,
1849
+ query_params,
1850
+ undefined,
1851
+ { ...xHeaders, ...requestHeaders },
1852
+ { responseHeaders }
1853
+ );
1854
+
1855
+ let responseData = response;
1856
+ if (responseHeaders) {
1857
+ responseData = response[0];
1858
+ }
1859
+
1860
+ const {
1861
+ error: res_error,
1862
+ } = ContentPlatformModel.CustomFieldsResponseByResourceIdSchema().validate(
1863
+ responseData,
1864
+ { abortEarly: false, allowUnknown: true }
1865
+ );
1866
+
1867
+ if (res_error) {
1868
+ if (this.config.options.strictResponseCheck === true) {
1869
+ return Promise.reject(new FDKResponseValidationError(res_error));
1870
+ } else {
1871
+ Logger({
1872
+ level: "WARN",
1873
+ message: `Response Validation Warnings for platform > Content > getCustomFieldsByResourceSlug \n ${res_error}`,
1874
+ });
1875
+ }
1876
+ }
1877
+
1878
+ return response;
1879
+ }
1880
+
1881
+ /**
1882
+ * @param {ContentPlatformValidator.GetCustomObjectBySlugParam} arg - Arg object
1883
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1884
+ * @param {import("../PlatformAPIClient").Options} - Options
1885
+ * @returns {Promise<ContentPlatformModel.CustomObjectBySlugSchema>} -
1886
+ * Success response
1887
+ * @name getCustomObjectBySlug
1888
+ * @summary: Get custom object details
1889
+ * @description: Details of a custom object entry can be obtained using this endpoint. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/content/getCustomObjectBySlug/).
1890
+ */
1891
+ async getCustomObjectBySlug(
1892
+ { definitionSlug, slug, requestHeaders } = { requestHeaders: {} },
1893
+ { responseHeaders } = { responseHeaders: false }
1894
+ ) {
1895
+ const { error } = ContentPlatformValidator.getCustomObjectBySlug().validate(
1896
+ {
1897
+ definitionSlug,
1898
+ slug,
1899
+ },
1900
+ { abortEarly: false, allowUnknown: true }
1901
+ );
1902
+ if (error) {
1903
+ return Promise.reject(new FDKClientValidationError(error));
1904
+ }
1905
+
1906
+ // Showing warrnings if extra unknown parameters are found
1907
+ const {
1908
+ error: warrning,
1909
+ } = ContentPlatformValidator.getCustomObjectBySlug().validate(
1910
+ {
1911
+ definitionSlug,
1912
+ slug,
1913
+ },
1914
+ { abortEarly: false, allowUnknown: false }
1915
+ );
1916
+ if (warrning) {
1917
+ Logger({
1918
+ level: "WARN",
1919
+ message: `Parameter Validation warrnings for platform > Content > getCustomObjectBySlug \n ${warrning}`,
1920
+ });
1921
+ }
1922
+
1923
+ const query_params = {};
1924
+
1925
+ const xHeaders = {};
1926
+
1927
+ const response = await PlatformAPIClient.execute(
1928
+ this.config,
1929
+ "get",
1930
+ `/service/platform/content/v2.0/company/${this.config.companyId}/customobjects/definition/${definitionSlug}/entries/${slug}`,
1931
+ query_params,
1932
+ undefined,
1933
+ { ...xHeaders, ...requestHeaders },
1934
+ { responseHeaders }
1935
+ );
1936
+
1937
+ let responseData = response;
1938
+ if (responseHeaders) {
1939
+ responseData = response[0];
1940
+ }
1941
+
1942
+ const {
1943
+ error: res_error,
1944
+ } = ContentPlatformModel.CustomObjectBySlugSchema().validate(responseData, {
1945
+ abortEarly: false,
1946
+ allowUnknown: true,
1947
+ });
1948
+
1949
+ if (res_error) {
1950
+ if (this.config.options.strictResponseCheck === true) {
1951
+ return Promise.reject(new FDKResponseValidationError(res_error));
1952
+ } else {
1953
+ Logger({
1954
+ level: "WARN",
1955
+ message: `Response Validation Warnings for platform > Content > getCustomObjectBySlug \n ${res_error}`,
1956
+ });
1957
+ }
1958
+ }
1959
+
1960
+ return response;
1961
+ }
1962
+
1963
+ /**
1964
+ * @param {ContentPlatformValidator.GetCustomObjectDefinitionBySlugParam} arg
1965
+ * - Arg object
1966
+ *
1967
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1968
+ * @param {import("../PlatformAPIClient").Options} - Options
1969
+ * @returns {Promise<ContentPlatformModel.CustomObjectDefinitionSlugSchema>}
1970
+ * - Success response
1971
+ *
1972
+ * @name getCustomObjectDefinitionBySlug
1973
+ * @summary: Get custom object definition
1974
+ * @description: Custom object definitions can be fetched using their custom object definition slug. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/content/getCustomObjectDefinitionBySlug/).
710
1975
  */
711
- async getCustomFieldDefinitionByResource(
712
- {
713
- pageNo,
714
- pageSize,
715
- resource,
716
- types,
717
- search,
718
- slugs,
719
- namespaces,
720
- requestHeaders,
721
- } = { requestHeaders: {} },
1976
+ async getCustomObjectDefinitionBySlug(
1977
+ { slug, requestHeaders } = { requestHeaders: {} },
722
1978
  { responseHeaders } = { responseHeaders: false }
723
1979
  ) {
724
1980
  const {
725
1981
  error,
726
- } = ContentPlatformValidator.getCustomFieldDefinitionByResource().validate(
1982
+ } = ContentPlatformValidator.getCustomObjectDefinitionBySlug().validate(
727
1983
  {
728
- pageNo,
729
- pageSize,
730
- resource,
731
- types,
732
- search,
733
- slugs,
734
- namespaces,
1984
+ slug,
735
1985
  },
736
1986
  { abortEarly: false, allowUnknown: true }
737
1987
  );
@@ -742,39 +1992,27 @@ class Content {
742
1992
  // Showing warrnings if extra unknown parameters are found
743
1993
  const {
744
1994
  error: warrning,
745
- } = ContentPlatformValidator.getCustomFieldDefinitionByResource().validate(
1995
+ } = ContentPlatformValidator.getCustomObjectDefinitionBySlug().validate(
746
1996
  {
747
- pageNo,
748
- pageSize,
749
- resource,
750
- types,
751
- search,
752
- slugs,
753
- namespaces,
1997
+ slug,
754
1998
  },
755
1999
  { abortEarly: false, allowUnknown: false }
756
2000
  );
757
2001
  if (warrning) {
758
2002
  Logger({
759
2003
  level: "WARN",
760
- message: `Parameter Validation warrnings for platform > Content > getCustomFieldDefinitionByResource \n ${warrning}`,
2004
+ message: `Parameter Validation warrnings for platform > Content > getCustomObjectDefinitionBySlug \n ${warrning}`,
761
2005
  });
762
2006
  }
763
2007
 
764
2008
  const query_params = {};
765
- query_params["page_no"] = pageNo;
766
- query_params["page_size"] = pageSize;
767
- query_params["types"] = types;
768
- query_params["search"] = search;
769
- query_params["slugs"] = slugs;
770
- query_params["namespaces"] = namespaces;
771
2009
 
772
2010
  const xHeaders = {};
773
2011
 
774
2012
  const response = await PlatformAPIClient.execute(
775
2013
  this.config,
776
2014
  "get",
777
- `/service/platform/content/v2.0/company/${this.config.companyId}/customfields/resource/${resource}/definition`,
2015
+ `/service/platform/content/v2.0/company/${this.config.companyId}/customobjects/definition/${slug}`,
778
2016
  query_params,
779
2017
  undefined,
780
2018
  { ...xHeaders, ...requestHeaders },
@@ -788,7 +2026,7 @@ class Content {
788
2026
 
789
2027
  const {
790
2028
  error: res_error,
791
- } = ContentPlatformModel.CustomFieldDefinitionsSchema().validate(
2029
+ } = ContentPlatformModel.CustomObjectDefinitionSlugSchema().validate(
792
2030
  responseData,
793
2031
  { abortEarly: false, allowUnknown: true }
794
2032
  );
@@ -799,7 +2037,7 @@ class Content {
799
2037
  } else {
800
2038
  Logger({
801
2039
  level: "WARN",
802
- message: `Response Validation Warnings for platform > Content > getCustomFieldDefinitionByResource \n ${res_error}`,
2040
+ message: `Response Validation Warnings for platform > Content > getCustomObjectDefinitionBySlug \n ${res_error}`,
803
2041
  });
804
2042
  }
805
2043
  }
@@ -808,29 +2046,26 @@ class Content {
808
2046
  }
809
2047
 
810
2048
  /**
811
- * @param {ContentPlatformValidator.GetCustomFieldDefinitionBySlugParam} arg
812
- * - Arg object
813
- *
2049
+ * @param {ContentPlatformValidator.GetCustomObjectDefinitionsParam} arg - Arg object
814
2050
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
815
2051
  * @param {import("../PlatformAPIClient").Options} - Options
816
- * @returns {Promise<ContentPlatformModel.MetaFieldDefinitionDetailResSchema>}
817
- * - Success response
818
- *
819
- * @name getCustomFieldDefinitionBySlug
820
- * @summary: Get custom fields definition by resource, slug and namespace
821
- * @description: Custom field definitions can be retrived from this using its slug, namespace and resource - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/content/getCustomFieldDefinitionBySlug/).
2052
+ * @returns {Promise<ContentPlatformModel.CustomObjectDefinitionsSchema>} -
2053
+ * Success response
2054
+ * @name getCustomObjectDefinitions
2055
+ * @summary: Get custom object definitions
2056
+ * @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/).
822
2057
  */
823
- async getCustomFieldDefinitionBySlug(
824
- { slug, resource, namespace, requestHeaders } = { requestHeaders: {} },
2058
+ async getCustomObjectDefinitions(
2059
+ { pageNo, pageSize, search, requestHeaders } = { requestHeaders: {} },
825
2060
  { responseHeaders } = { responseHeaders: false }
826
2061
  ) {
827
2062
  const {
828
2063
  error,
829
- } = ContentPlatformValidator.getCustomFieldDefinitionBySlug().validate(
2064
+ } = ContentPlatformValidator.getCustomObjectDefinitions().validate(
830
2065
  {
831
- slug,
832
- resource,
833
- namespace,
2066
+ pageNo,
2067
+ pageSize,
2068
+ search,
834
2069
  },
835
2070
  { abortEarly: false, allowUnknown: true }
836
2071
  );
@@ -841,29 +2076,32 @@ class Content {
841
2076
  // Showing warrnings if extra unknown parameters are found
842
2077
  const {
843
2078
  error: warrning,
844
- } = ContentPlatformValidator.getCustomFieldDefinitionBySlug().validate(
2079
+ } = ContentPlatformValidator.getCustomObjectDefinitions().validate(
845
2080
  {
846
- slug,
847
- resource,
848
- namespace,
2081
+ pageNo,
2082
+ pageSize,
2083
+ search,
849
2084
  },
850
2085
  { abortEarly: false, allowUnknown: false }
851
2086
  );
852
2087
  if (warrning) {
853
2088
  Logger({
854
2089
  level: "WARN",
855
- message: `Parameter Validation warrnings for platform > Content > getCustomFieldDefinitionBySlug \n ${warrning}`,
2090
+ message: `Parameter Validation warrnings for platform > Content > getCustomObjectDefinitions \n ${warrning}`,
856
2091
  });
857
2092
  }
858
2093
 
859
2094
  const query_params = {};
2095
+ query_params["page_no"] = pageNo;
2096
+ query_params["page_size"] = pageSize;
2097
+ query_params["search"] = search;
860
2098
 
861
2099
  const xHeaders = {};
862
2100
 
863
2101
  const response = await PlatformAPIClient.execute(
864
2102
  this.config,
865
2103
  "get",
866
- `/service/platform/content/v2.0/company/${this.config.companyId}/customfields/resource/${resource}/namespace/${namespace}/definition/${slug}`,
2104
+ `/service/platform/content/v2.0/company/${this.config.companyId}/customobjects/definition`,
867
2105
  query_params,
868
2106
  undefined,
869
2107
  { ...xHeaders, ...requestHeaders },
@@ -877,7 +2115,7 @@ class Content {
877
2115
 
878
2116
  const {
879
2117
  error: res_error,
880
- } = ContentPlatformModel.MetaFieldDefinitionDetailResSchema().validate(
2118
+ } = ContentPlatformModel.CustomObjectDefinitionsSchema().validate(
881
2119
  responseData,
882
2120
  { abortEarly: false, allowUnknown: true }
883
2121
  );
@@ -888,7 +2126,7 @@ class Content {
888
2126
  } else {
889
2127
  Logger({
890
2128
  level: "WARN",
891
- message: `Response Validation Warnings for platform > Content > getCustomFieldDefinitionBySlug \n ${res_error}`,
2129
+ message: `Response Validation Warnings for platform > Content > getCustomObjectDefinitions \n ${res_error}`,
892
2130
  });
893
2131
  }
894
2132
  }
@@ -897,39 +2135,27 @@ class Content {
897
2135
  }
898
2136
 
899
2137
  /**
900
- * @param {ContentPlatformValidator.GetCustomFieldDefinitionsParam} arg - Arg object
2138
+ * @param {ContentPlatformValidator.GetCustomObjectsBySlugParam} arg - Arg object
901
2139
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
902
2140
  * @param {import("../PlatformAPIClient").Options} - Options
903
- * @returns {Promise<ContentPlatformModel.CustomFieldDefinitionsSchema>} -
904
- * Success response
905
- * @name getCustomFieldDefinitions
906
- * @summary: Get custom fields definitions
907
- * @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/).
2141
+ * @returns {Promise<ContentPlatformModel.CustomObjectsSchema>} - Success response
2142
+ * @name getCustomObjectsBySlug
2143
+ * @summary: Get list of custom objects under a certain custom object definition
2144
+ * @description: Custom object entries can fetch using this endpoint. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/content/getCustomObjectsBySlug/).
908
2145
  */
909
- async getCustomFieldDefinitions(
910
- {
911
- pageNo,
912
- pageSize,
913
- resources,
914
- types,
915
- search,
916
- slugs,
917
- namespaces,
918
- requestHeaders,
919
- } = { requestHeaders: {} },
2146
+ async getCustomObjectsBySlug(
2147
+ { pageNo, pageSize, definitionSlug, requestHeaders } = {
2148
+ requestHeaders: {},
2149
+ },
920
2150
  { responseHeaders } = { responseHeaders: false }
921
2151
  ) {
922
2152
  const {
923
2153
  error,
924
- } = ContentPlatformValidator.getCustomFieldDefinitions().validate(
2154
+ } = ContentPlatformValidator.getCustomObjectsBySlug().validate(
925
2155
  {
926
2156
  pageNo,
927
2157
  pageSize,
928
- resources,
929
- types,
930
- search,
931
- slugs,
932
- namespaces,
2158
+ definitionSlug,
933
2159
  },
934
2160
  { abortEarly: false, allowUnknown: true }
935
2161
  );
@@ -940,40 +2166,31 @@ class Content {
940
2166
  // Showing warrnings if extra unknown parameters are found
941
2167
  const {
942
2168
  error: warrning,
943
- } = ContentPlatformValidator.getCustomFieldDefinitions().validate(
2169
+ } = ContentPlatformValidator.getCustomObjectsBySlug().validate(
944
2170
  {
945
2171
  pageNo,
946
2172
  pageSize,
947
- resources,
948
- types,
949
- search,
950
- slugs,
951
- namespaces,
2173
+ definitionSlug,
952
2174
  },
953
2175
  { abortEarly: false, allowUnknown: false }
954
2176
  );
955
2177
  if (warrning) {
956
2178
  Logger({
957
2179
  level: "WARN",
958
- message: `Parameter Validation warrnings for platform > Content > getCustomFieldDefinitions \n ${warrning}`,
2180
+ message: `Parameter Validation warrnings for platform > Content > getCustomObjectsBySlug \n ${warrning}`,
959
2181
  });
960
2182
  }
961
2183
 
962
2184
  const query_params = {};
963
2185
  query_params["page_no"] = pageNo;
964
2186
  query_params["page_size"] = pageSize;
965
- query_params["resources"] = resources;
966
- query_params["types"] = types;
967
- query_params["search"] = search;
968
- query_params["slugs"] = slugs;
969
- query_params["namespaces"] = namespaces;
970
2187
 
971
2188
  const xHeaders = {};
972
2189
 
973
2190
  const response = await PlatformAPIClient.execute(
974
2191
  this.config,
975
2192
  "get",
976
- `/service/platform/content/v2.0/company/${this.config.companyId}/customfields/definition`,
2193
+ `/service/platform/content/v2.0/company/${this.config.companyId}/customobjects/definition/${definitionSlug}/entries`,
977
2194
  query_params,
978
2195
  undefined,
979
2196
  { ...xHeaders, ...requestHeaders },
@@ -987,10 +2204,10 @@ class Content {
987
2204
 
988
2205
  const {
989
2206
  error: res_error,
990
- } = ContentPlatformModel.CustomFieldDefinitionsSchema().validate(
991
- responseData,
992
- { abortEarly: false, allowUnknown: true }
993
- );
2207
+ } = ContentPlatformModel.CustomObjectsSchema().validate(responseData, {
2208
+ abortEarly: false,
2209
+ allowUnknown: true,
2210
+ });
994
2211
 
995
2212
  if (res_error) {
996
2213
  if (this.config.options.strictResponseCheck === true) {
@@ -998,7 +2215,7 @@ class Content {
998
2215
  } else {
999
2216
  Logger({
1000
2217
  level: "WARN",
1001
- message: `Response Validation Warnings for platform > Content > getCustomFieldDefinitions \n ${res_error}`,
2218
+ message: `Response Validation Warnings for platform > Content > getCustomObjectsBySlug \n ${res_error}`,
1002
2219
  });
1003
2220
  }
1004
2221
  }
@@ -1007,20 +2224,24 @@ class Content {
1007
2224
  }
1008
2225
 
1009
2226
  /**
1010
- * @param {ContentPlatformValidator.GetCustomFieldTypesParam} arg - Arg object
2227
+ * @param {ContentPlatformValidator.GetJobsParam} arg - Arg object
1011
2228
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1012
2229
  * @param {import("../PlatformAPIClient").Options} - Options
1013
- * @returns {Promise<ContentPlatformModel.MetafieldTypesSchema>} - Success response
1014
- * @name getCustomFieldTypes
1015
- * @summary: Get custom field types
1016
- * @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/).
2230
+ * @returns {Promise<ContentPlatformModel.CustomObjectBulkEntry>} - Success response
2231
+ * @name getJobs
2232
+ * @summary: Get bulk import and export job list
2233
+ * @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/).
1017
2234
  */
1018
- async getCustomFieldTypes(
1019
- { requestHeaders } = { requestHeaders: {} },
2235
+ async getJobs(
2236
+ { page, pageSize, actionType, requestHeaders } = { requestHeaders: {} },
1020
2237
  { responseHeaders } = { responseHeaders: false }
1021
2238
  ) {
1022
- const { error } = ContentPlatformValidator.getCustomFieldTypes().validate(
1023
- {},
2239
+ const { error } = ContentPlatformValidator.getJobs().validate(
2240
+ {
2241
+ page,
2242
+ pageSize,
2243
+ actionType,
2244
+ },
1024
2245
  { abortEarly: false, allowUnknown: true }
1025
2246
  );
1026
2247
  if (error) {
@@ -1028,27 +2249,32 @@ class Content {
1028
2249
  }
1029
2250
 
1030
2251
  // Showing warrnings if extra unknown parameters are found
1031
- const {
1032
- error: warrning,
1033
- } = ContentPlatformValidator.getCustomFieldTypes().validate(
1034
- {},
2252
+ const { error: warrning } = ContentPlatformValidator.getJobs().validate(
2253
+ {
2254
+ page,
2255
+ pageSize,
2256
+ actionType,
2257
+ },
1035
2258
  { abortEarly: false, allowUnknown: false }
1036
2259
  );
1037
2260
  if (warrning) {
1038
2261
  Logger({
1039
2262
  level: "WARN",
1040
- message: `Parameter Validation warrnings for platform > Content > getCustomFieldTypes \n ${warrning}`,
2263
+ message: `Parameter Validation warrnings for platform > Content > getJobs \n ${warrning}`,
1041
2264
  });
1042
2265
  }
1043
2266
 
1044
2267
  const query_params = {};
2268
+ query_params["page"] = page;
2269
+ query_params["page_size"] = pageSize;
2270
+ query_params["action_type"] = actionType;
1045
2271
 
1046
2272
  const xHeaders = {};
1047
2273
 
1048
2274
  const response = await PlatformAPIClient.execute(
1049
2275
  this.config,
1050
2276
  "get",
1051
- `/service/platform/content/v1.0/company/${this.config.companyId}/metafields/types`,
2277
+ `/service/platform/content/v1.0/company/${this.config.companyId}/metaobjects/jobs`,
1052
2278
  query_params,
1053
2279
  undefined,
1054
2280
  { ...xHeaders, ...requestHeaders },
@@ -1062,7 +2288,7 @@ class Content {
1062
2288
 
1063
2289
  const {
1064
2290
  error: res_error,
1065
- } = ContentPlatformModel.MetafieldTypesSchema().validate(responseData, {
2291
+ } = ContentPlatformModel.CustomObjectBulkEntry().validate(responseData, {
1066
2292
  abortEarly: false,
1067
2293
  allowUnknown: true,
1068
2294
  });
@@ -1073,7 +2299,7 @@ class Content {
1073
2299
  } else {
1074
2300
  Logger({
1075
2301
  level: "WARN",
1076
- message: `Response Validation Warnings for platform > Content > getCustomFieldTypes \n ${res_error}`,
2302
+ message: `Response Validation Warnings for platform > Content > getJobs \n ${res_error}`,
1077
2303
  });
1078
2304
  }
1079
2305
  }
@@ -1082,28 +2308,23 @@ class Content {
1082
2308
  }
1083
2309
 
1084
2310
  /**
1085
- * @param {ContentPlatformValidator.GetCustomFieldsByResourceSlugParam} arg
1086
- * - Arg object
1087
- *
2311
+ * @param {ContentPlatformValidator.GetResourceDefinitionByIdParam} arg - Arg object
1088
2312
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1089
2313
  * @param {import("../PlatformAPIClient").Options} - Options
1090
- * @returns {Promise<ContentPlatformModel.CustomFieldsResponseByResourceIdSchema>}
1091
- * - Success response
1092
- *
1093
- * @name getCustomFieldsByResourceSlug
1094
- * @summary: Get list of custom fields of given resource and resource slug
1095
- * @description: Retrieves a list of custom fields attached to a particular resource by using the resource and resource slug. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/content/getCustomFieldsByResourceSlug/).
2314
+ * @returns {Promise<ContentPlatformModel.ResourceDefinition>} - Success response
2315
+ * @name getResourceDefinitionById
2316
+ * @summary: Get resource definitions details
2317
+ * @description: Fetch specific resource definition and its translation schema. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/content/getResourceDefinitionById/).
1096
2318
  */
1097
- async getCustomFieldsByResourceSlug(
1098
- { resource, resourceSlug, requestHeaders } = { requestHeaders: {} },
2319
+ async getResourceDefinitionById(
2320
+ { id, requestHeaders } = { requestHeaders: {} },
1099
2321
  { responseHeaders } = { responseHeaders: false }
1100
2322
  ) {
1101
2323
  const {
1102
2324
  error,
1103
- } = ContentPlatformValidator.getCustomFieldsByResourceSlug().validate(
2325
+ } = ContentPlatformValidator.getResourceDefinitionById().validate(
1104
2326
  {
1105
- resource,
1106
- resourceSlug,
2327
+ id,
1107
2328
  },
1108
2329
  { abortEarly: false, allowUnknown: true }
1109
2330
  );
@@ -1114,17 +2335,16 @@ class Content {
1114
2335
  // Showing warrnings if extra unknown parameters are found
1115
2336
  const {
1116
2337
  error: warrning,
1117
- } = ContentPlatformValidator.getCustomFieldsByResourceSlug().validate(
2338
+ } = ContentPlatformValidator.getResourceDefinitionById().validate(
1118
2339
  {
1119
- resource,
1120
- resourceSlug,
2340
+ id,
1121
2341
  },
1122
2342
  { abortEarly: false, allowUnknown: false }
1123
2343
  );
1124
2344
  if (warrning) {
1125
2345
  Logger({
1126
2346
  level: "WARN",
1127
- message: `Parameter Validation warrnings for platform > Content > getCustomFieldsByResourceSlug \n ${warrning}`,
2347
+ message: `Parameter Validation warrnings for platform > Content > getResourceDefinitionById \n ${warrning}`,
1128
2348
  });
1129
2349
  }
1130
2350
 
@@ -1135,7 +2355,7 @@ class Content {
1135
2355
  const response = await PlatformAPIClient.execute(
1136
2356
  this.config,
1137
2357
  "get",
1138
- `/service/platform/content/v2.0/company/${this.config.companyId}/customfields/resource/${resource}/${resourceSlug}`,
2358
+ `/service/platform/content/v1.0/company/${this.config.companyId}/translatable/resource/definitions/${id}`,
1139
2359
  query_params,
1140
2360
  undefined,
1141
2361
  { ...xHeaders, ...requestHeaders },
@@ -1149,10 +2369,10 @@ class Content {
1149
2369
 
1150
2370
  const {
1151
2371
  error: res_error,
1152
- } = ContentPlatformModel.CustomFieldsResponseByResourceIdSchema().validate(
1153
- responseData,
1154
- { abortEarly: false, allowUnknown: true }
1155
- );
2372
+ } = ContentPlatformModel.ResourceDefinition().validate(responseData, {
2373
+ abortEarly: false,
2374
+ allowUnknown: true,
2375
+ });
1156
2376
 
1157
2377
  if (res_error) {
1158
2378
  if (this.config.options.strictResponseCheck === true) {
@@ -1160,7 +2380,7 @@ class Content {
1160
2380
  } else {
1161
2381
  Logger({
1162
2382
  level: "WARN",
1163
- message: `Response Validation Warnings for platform > Content > getCustomFieldsByResourceSlug \n ${res_error}`,
2383
+ message: `Response Validation Warnings for platform > Content > getResourceDefinitionById \n ${res_error}`,
1164
2384
  });
1165
2385
  }
1166
2386
  }
@@ -1169,24 +2389,20 @@ class Content {
1169
2389
  }
1170
2390
 
1171
2391
  /**
1172
- * @param {ContentPlatformValidator.GetCustomObjectBySlugParam} arg - Arg object
2392
+ * @param {ContentPlatformValidator.GetResourcesParam} arg - Arg object
1173
2393
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1174
2394
  * @param {import("../PlatformAPIClient").Options} - Options
1175
- * @returns {Promise<ContentPlatformModel.CustomObjectBySlugSchema>} -
1176
- * Success response
1177
- * @name getCustomObjectBySlug
1178
- * @summary: Get custom object details
1179
- * @description: Details of a custom object entry can be obtained using this endpoint. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/content/getCustomObjectBySlug/).
2395
+ * @returns {Promise<ContentPlatformModel.ResourcesSchema>} - Success response
2396
+ * @name getResources
2397
+ * @summary: Get resources
2398
+ * @description: Use this API to retrieve the resources, such as products, collections, customers, selling locations, etc. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/content/getResources/).
1180
2399
  */
1181
- async getCustomObjectBySlug(
1182
- { definitionSlug, slug, requestHeaders } = { requestHeaders: {} },
2400
+ async getResources(
2401
+ { requestHeaders } = { requestHeaders: {} },
1183
2402
  { responseHeaders } = { responseHeaders: false }
1184
2403
  ) {
1185
- const { error } = ContentPlatformValidator.getCustomObjectBySlug().validate(
1186
- {
1187
- definitionSlug,
1188
- slug,
1189
- },
2404
+ const { error } = ContentPlatformValidator.getResources().validate(
2405
+ {},
1190
2406
  { abortEarly: false, allowUnknown: true }
1191
2407
  );
1192
2408
  if (error) {
@@ -1196,17 +2412,14 @@ class Content {
1196
2412
  // Showing warrnings if extra unknown parameters are found
1197
2413
  const {
1198
2414
  error: warrning,
1199
- } = ContentPlatformValidator.getCustomObjectBySlug().validate(
1200
- {
1201
- definitionSlug,
1202
- slug,
1203
- },
2415
+ } = ContentPlatformValidator.getResources().validate(
2416
+ {},
1204
2417
  { abortEarly: false, allowUnknown: false }
1205
2418
  );
1206
2419
  if (warrning) {
1207
2420
  Logger({
1208
2421
  level: "WARN",
1209
- message: `Parameter Validation warrnings for platform > Content > getCustomObjectBySlug \n ${warrning}`,
2422
+ message: `Parameter Validation warrnings for platform > Content > getResources \n ${warrning}`,
1210
2423
  });
1211
2424
  }
1212
2425
 
@@ -1217,7 +2430,7 @@ class Content {
1217
2430
  const response = await PlatformAPIClient.execute(
1218
2431
  this.config,
1219
2432
  "get",
1220
- `/service/platform/content/v2.0/company/${this.config.companyId}/customobjects/definition/${definitionSlug}/entries/${slug}`,
2433
+ `/service/platform/content/v1.0/company/${this.config.companyId}/metafields/resources`,
1221
2434
  query_params,
1222
2435
  undefined,
1223
2436
  { ...xHeaders, ...requestHeaders },
@@ -1231,7 +2444,7 @@ class Content {
1231
2444
 
1232
2445
  const {
1233
2446
  error: res_error,
1234
- } = ContentPlatformModel.CustomObjectBySlugSchema().validate(responseData, {
2447
+ } = ContentPlatformModel.ResourcesSchema().validate(responseData, {
1235
2448
  abortEarly: false,
1236
2449
  allowUnknown: true,
1237
2450
  });
@@ -1242,7 +2455,7 @@ class Content {
1242
2455
  } else {
1243
2456
  Logger({
1244
2457
  level: "WARN",
1245
- message: `Response Validation Warnings for platform > Content > getCustomObjectBySlug \n ${res_error}`,
2458
+ message: `Response Validation Warnings for platform > Content > getResources \n ${res_error}`,
1246
2459
  });
1247
2460
  }
1248
2461
  }
@@ -1251,27 +2464,21 @@ class Content {
1251
2464
  }
1252
2465
 
1253
2466
  /**
1254
- * @param {ContentPlatformValidator.GetCustomObjectDefinitionBySlugParam} arg
1255
- * - Arg object
1256
- *
2467
+ * @param {ContentPlatformValidator.GetSectionByIdParam} arg - Arg object
1257
2468
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1258
2469
  * @param {import("../PlatformAPIClient").Options} - Options
1259
- * @returns {Promise<ContentPlatformModel.CustomObjectDefinitionSlugSchema>}
1260
- * - Success response
1261
- *
1262
- * @name getCustomObjectDefinitionBySlug
1263
- * @summary: Get custom object definition
1264
- * @description: Custom object definitions can be fetched using their custom object definition slug. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/content/getCustomObjectDefinitionBySlug/).
2470
+ * @returns {Promise<ContentPlatformModel.TranslatableSection>} - Success response
2471
+ * @name getSectionById
2472
+ * @summary: Retrieve details of a specific translatable section by its ID.
2473
+ * @description: Fetch details of a specific translatable section. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/content/getSectionById/).
1265
2474
  */
1266
- async getCustomObjectDefinitionBySlug(
1267
- { slug, requestHeaders } = { requestHeaders: {} },
2475
+ async getSectionById(
2476
+ { id, requestHeaders } = { requestHeaders: {} },
1268
2477
  { responseHeaders } = { responseHeaders: false }
1269
2478
  ) {
1270
- const {
1271
- error,
1272
- } = ContentPlatformValidator.getCustomObjectDefinitionBySlug().validate(
2479
+ const { error } = ContentPlatformValidator.getSectionById().validate(
1273
2480
  {
1274
- slug,
2481
+ id,
1275
2482
  },
1276
2483
  { abortEarly: false, allowUnknown: true }
1277
2484
  );
@@ -1282,16 +2489,16 @@ class Content {
1282
2489
  // Showing warrnings if extra unknown parameters are found
1283
2490
  const {
1284
2491
  error: warrning,
1285
- } = ContentPlatformValidator.getCustomObjectDefinitionBySlug().validate(
2492
+ } = ContentPlatformValidator.getSectionById().validate(
1286
2493
  {
1287
- slug,
2494
+ id,
1288
2495
  },
1289
2496
  { abortEarly: false, allowUnknown: false }
1290
2497
  );
1291
2498
  if (warrning) {
1292
2499
  Logger({
1293
2500
  level: "WARN",
1294
- message: `Parameter Validation warrnings for platform > Content > getCustomObjectDefinitionBySlug \n ${warrning}`,
2501
+ message: `Parameter Validation warrnings for platform > Content > getSectionById \n ${warrning}`,
1295
2502
  });
1296
2503
  }
1297
2504
 
@@ -1302,7 +2509,7 @@ class Content {
1302
2509
  const response = await PlatformAPIClient.execute(
1303
2510
  this.config,
1304
2511
  "get",
1305
- `/service/platform/content/v2.0/company/${this.config.companyId}/customobjects/definition/${slug}`,
2512
+ `/service/platform/content/v1.0/company/${this.config.companyId}/translatable/sections/${id}`,
1306
2513
  query_params,
1307
2514
  undefined,
1308
2515
  { ...xHeaders, ...requestHeaders },
@@ -1316,10 +2523,10 @@ class Content {
1316
2523
 
1317
2524
  const {
1318
2525
  error: res_error,
1319
- } = ContentPlatformModel.CustomObjectDefinitionSlugSchema().validate(
1320
- responseData,
1321
- { abortEarly: false, allowUnknown: true }
1322
- );
2526
+ } = ContentPlatformModel.TranslatableSection().validate(responseData, {
2527
+ abortEarly: false,
2528
+ allowUnknown: true,
2529
+ });
1323
2530
 
1324
2531
  if (res_error) {
1325
2532
  if (this.config.options.strictResponseCheck === true) {
@@ -1327,7 +2534,7 @@ class Content {
1327
2534
  } else {
1328
2535
  Logger({
1329
2536
  level: "WARN",
1330
- message: `Response Validation Warnings for platform > Content > getCustomObjectDefinitionBySlug \n ${res_error}`,
2537
+ message: `Response Validation Warnings for platform > Content > getSectionById \n ${res_error}`,
1331
2538
  });
1332
2539
  }
1333
2540
  }
@@ -1336,26 +2543,23 @@ class Content {
1336
2543
  }
1337
2544
 
1338
2545
  /**
1339
- * @param {ContentPlatformValidator.GetCustomObjectDefinitionsParam} arg - Arg object
2546
+ * @param {ContentPlatformValidator.GetTranslatableResourceByIdParam} arg - Arg object
1340
2547
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1341
2548
  * @param {import("../PlatformAPIClient").Options} - Options
1342
- * @returns {Promise<ContentPlatformModel.CustomObjectDefinitionsSchema>} -
1343
- * Success response
1344
- * @name getCustomObjectDefinitions
1345
- * @summary: Get custom object definitions
1346
- * @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/).
2549
+ * @returns {Promise<ContentPlatformModel.TranslatableResource>} - Success response
2550
+ * @name getTranslatableResourceById
2551
+ * @summary: Get translatable resource details
2552
+ * @description: Fetch details of a specific translatable resource. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/content/getTranslatableResourceById/).
1347
2553
  */
1348
- async getCustomObjectDefinitions(
1349
- { pageNo, pageSize, search, requestHeaders } = { requestHeaders: {} },
2554
+ async getTranslatableResourceById(
2555
+ { id, requestHeaders } = { requestHeaders: {} },
1350
2556
  { responseHeaders } = { responseHeaders: false }
1351
2557
  ) {
1352
2558
  const {
1353
2559
  error,
1354
- } = ContentPlatformValidator.getCustomObjectDefinitions().validate(
2560
+ } = ContentPlatformValidator.getTranslatableResourceById().validate(
1355
2561
  {
1356
- pageNo,
1357
- pageSize,
1358
- search,
2562
+ id,
1359
2563
  },
1360
2564
  { abortEarly: false, allowUnknown: true }
1361
2565
  );
@@ -1366,32 +2570,27 @@ class Content {
1366
2570
  // Showing warrnings if extra unknown parameters are found
1367
2571
  const {
1368
2572
  error: warrning,
1369
- } = ContentPlatformValidator.getCustomObjectDefinitions().validate(
2573
+ } = ContentPlatformValidator.getTranslatableResourceById().validate(
1370
2574
  {
1371
- pageNo,
1372
- pageSize,
1373
- search,
2575
+ id,
1374
2576
  },
1375
2577
  { abortEarly: false, allowUnknown: false }
1376
2578
  );
1377
2579
  if (warrning) {
1378
2580
  Logger({
1379
2581
  level: "WARN",
1380
- message: `Parameter Validation warrnings for platform > Content > getCustomObjectDefinitions \n ${warrning}`,
2582
+ message: `Parameter Validation warrnings for platform > Content > getTranslatableResourceById \n ${warrning}`,
1381
2583
  });
1382
2584
  }
1383
2585
 
1384
2586
  const query_params = {};
1385
- query_params["page_no"] = pageNo;
1386
- query_params["page_size"] = pageSize;
1387
- query_params["search"] = search;
1388
2587
 
1389
2588
  const xHeaders = {};
1390
2589
 
1391
2590
  const response = await PlatformAPIClient.execute(
1392
2591
  this.config,
1393
2592
  "get",
1394
- `/service/platform/content/v2.0/company/${this.config.companyId}/customobjects/definition`,
2593
+ `/service/platform/content/v1.0/company/${this.config.companyId}/translatable/resources/${id}`,
1395
2594
  query_params,
1396
2595
  undefined,
1397
2596
  { ...xHeaders, ...requestHeaders },
@@ -1405,10 +2604,10 @@ class Content {
1405
2604
 
1406
2605
  const {
1407
2606
  error: res_error,
1408
- } = ContentPlatformModel.CustomObjectDefinitionsSchema().validate(
1409
- responseData,
1410
- { abortEarly: false, allowUnknown: true }
1411
- );
2607
+ } = ContentPlatformModel.TranslatableResource().validate(responseData, {
2608
+ abortEarly: false,
2609
+ allowUnknown: true,
2610
+ });
1412
2611
 
1413
2612
  if (res_error) {
1414
2613
  if (this.config.options.strictResponseCheck === true) {
@@ -1416,7 +2615,7 @@ class Content {
1416
2615
  } else {
1417
2616
  Logger({
1418
2617
  level: "WARN",
1419
- message: `Response Validation Warnings for platform > Content > getCustomObjectDefinitions \n ${res_error}`,
2618
+ message: `Response Validation Warnings for platform > Content > getTranslatableResourceById \n ${res_error}`,
1420
2619
  });
1421
2620
  }
1422
2621
  }
@@ -1425,27 +2624,25 @@ class Content {
1425
2624
  }
1426
2625
 
1427
2626
  /**
1428
- * @param {ContentPlatformValidator.GetCustomObjectsBySlugParam} arg - Arg object
2627
+ * @param {ContentPlatformValidator.GetTranslatableResourcesBySectionIdParam} arg
2628
+ * - Arg object
2629
+ *
1429
2630
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1430
2631
  * @param {import("../PlatformAPIClient").Options} - Options
1431
- * @returns {Promise<ContentPlatformModel.CustomObjectsSchema>} - Success response
1432
- * @name getCustomObjectsBySlug
1433
- * @summary: Get list of custom objects under a certain custom object definition
1434
- * @description: Custom object entries can fetch using this endpoint. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/content/getCustomObjectsBySlug/).
2632
+ * @returns {Promise<Object>} - Success response
2633
+ * @name getTranslatableResourcesBySectionId
2634
+ * @summary: Get section resources
2635
+ * @description: Retrieve all resources within a specific section. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/content/getTranslatableResourcesBySectionId/).
1435
2636
  */
1436
- async getCustomObjectsBySlug(
1437
- { pageNo, pageSize, definitionSlug, requestHeaders } = {
1438
- requestHeaders: {},
1439
- },
2637
+ async getTranslatableResourcesBySectionId(
2638
+ { id, requestHeaders } = { requestHeaders: {} },
1440
2639
  { responseHeaders } = { responseHeaders: false }
1441
2640
  ) {
1442
2641
  const {
1443
2642
  error,
1444
- } = ContentPlatformValidator.getCustomObjectsBySlug().validate(
2643
+ } = ContentPlatformValidator.getTranslatableResourcesBySectionId().validate(
1445
2644
  {
1446
- pageNo,
1447
- pageSize,
1448
- definitionSlug,
2645
+ id,
1449
2646
  },
1450
2647
  { abortEarly: false, allowUnknown: true }
1451
2648
  );
@@ -1456,31 +2653,27 @@ class Content {
1456
2653
  // Showing warrnings if extra unknown parameters are found
1457
2654
  const {
1458
2655
  error: warrning,
1459
- } = ContentPlatformValidator.getCustomObjectsBySlug().validate(
2656
+ } = ContentPlatformValidator.getTranslatableResourcesBySectionId().validate(
1460
2657
  {
1461
- pageNo,
1462
- pageSize,
1463
- definitionSlug,
2658
+ id,
1464
2659
  },
1465
2660
  { abortEarly: false, allowUnknown: false }
1466
2661
  );
1467
2662
  if (warrning) {
1468
2663
  Logger({
1469
2664
  level: "WARN",
1470
- message: `Parameter Validation warrnings for platform > Content > getCustomObjectsBySlug \n ${warrning}`,
2665
+ message: `Parameter Validation warrnings for platform > Content > getTranslatableResourcesBySectionId \n ${warrning}`,
1471
2666
  });
1472
2667
  }
1473
2668
 
1474
2669
  const query_params = {};
1475
- query_params["page_no"] = pageNo;
1476
- query_params["page_size"] = pageSize;
1477
2670
 
1478
2671
  const xHeaders = {};
1479
2672
 
1480
2673
  const response = await PlatformAPIClient.execute(
1481
2674
  this.config,
1482
2675
  "get",
1483
- `/service/platform/content/v2.0/company/${this.config.companyId}/customobjects/definition/${definitionSlug}/entries`,
2676
+ `/service/platform/content/v1.0/company/${this.config.companyId}/translatable/section/${id}/resources`,
1484
2677
  query_params,
1485
2678
  undefined,
1486
2679
  { ...xHeaders, ...requestHeaders },
@@ -1492,9 +2685,7 @@ class Content {
1492
2685
  responseData = response[0];
1493
2686
  }
1494
2687
 
1495
- const {
1496
- error: res_error,
1497
- } = ContentPlatformModel.CustomObjectsSchema().validate(responseData, {
2688
+ const { error: res_error } = Joi.any().validate(responseData, {
1498
2689
  abortEarly: false,
1499
2690
  allowUnknown: true,
1500
2691
  });
@@ -1505,7 +2696,7 @@ class Content {
1505
2696
  } else {
1506
2697
  Logger({
1507
2698
  level: "WARN",
1508
- message: `Response Validation Warnings for platform > Content > getCustomObjectsBySlug \n ${res_error}`,
2699
+ message: `Response Validation Warnings for platform > Content > getTranslatableResourcesBySectionId \n ${res_error}`,
1509
2700
  });
1510
2701
  }
1511
2702
  }
@@ -1514,23 +2705,28 @@ class Content {
1514
2705
  }
1515
2706
 
1516
2707
  /**
1517
- * @param {ContentPlatformValidator.GetJobsParam} arg - Arg object
2708
+ * @param {ContentPlatformValidator.ImportCustomObjectEntriesBySlugParam} arg
2709
+ * - Arg object
2710
+ *
1518
2711
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1519
2712
  * @param {import("../PlatformAPIClient").Options} - Options
1520
- * @returns {Promise<ContentPlatformModel.CustomObjectBulkEntry>} - Success response
1521
- * @name getJobs
1522
- * @summary: Get bulk import and export job list
1523
- * @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/).
2713
+ * @returns {Promise<ContentPlatformModel.CustomObjectEntryBulkUploadDetails>}
2714
+ * - Success response
2715
+ *
2716
+ * @name importCustomObjectEntriesBySlug
2717
+ * @summary: Bulk custom object entries upload
2718
+ * @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/importCustomObjectEntriesBySlug/).
1524
2719
  */
1525
- async getJobs(
1526
- { page, pageSize, actionType, requestHeaders } = { requestHeaders: {} },
2720
+ async importCustomObjectEntriesBySlug(
2721
+ { slug, body, requestHeaders } = { requestHeaders: {} },
1527
2722
  { responseHeaders } = { responseHeaders: false }
1528
2723
  ) {
1529
- const { error } = ContentPlatformValidator.getJobs().validate(
2724
+ const {
2725
+ error,
2726
+ } = ContentPlatformValidator.importCustomObjectEntriesBySlug().validate(
1530
2727
  {
1531
- page,
1532
- pageSize,
1533
- actionType,
2728
+ slug,
2729
+ body,
1534
2730
  },
1535
2731
  { abortEarly: false, allowUnknown: true }
1536
2732
  );
@@ -1539,34 +2735,32 @@ class Content {
1539
2735
  }
1540
2736
 
1541
2737
  // Showing warrnings if extra unknown parameters are found
1542
- const { error: warrning } = ContentPlatformValidator.getJobs().validate(
2738
+ const {
2739
+ error: warrning,
2740
+ } = ContentPlatformValidator.importCustomObjectEntriesBySlug().validate(
1543
2741
  {
1544
- page,
1545
- pageSize,
1546
- actionType,
2742
+ slug,
2743
+ body,
1547
2744
  },
1548
2745
  { abortEarly: false, allowUnknown: false }
1549
2746
  );
1550
2747
  if (warrning) {
1551
2748
  Logger({
1552
2749
  level: "WARN",
1553
- message: `Parameter Validation warrnings for platform > Content > getJobs \n ${warrning}`,
2750
+ message: `Parameter Validation warrnings for platform > Content > importCustomObjectEntriesBySlug \n ${warrning}`,
1554
2751
  });
1555
2752
  }
1556
2753
 
1557
2754
  const query_params = {};
1558
- query_params["page"] = page;
1559
- query_params["page_size"] = pageSize;
1560
- query_params["action_type"] = actionType;
1561
2755
 
1562
2756
  const xHeaders = {};
1563
2757
 
1564
2758
  const response = await PlatformAPIClient.execute(
1565
2759
  this.config,
1566
- "get",
1567
- `/service/platform/content/v1.0/company/${this.config.companyId}/metaobjects/jobs`,
2760
+ "post",
2761
+ `/service/platform/content/v2.0/company/${this.config.companyId}/customobjects/definition/${slug}/bulk/upload`,
1568
2762
  query_params,
1569
- undefined,
2763
+ body,
1570
2764
  { ...xHeaders, ...requestHeaders },
1571
2765
  { responseHeaders }
1572
2766
  );
@@ -1578,10 +2772,10 @@ class Content {
1578
2772
 
1579
2773
  const {
1580
2774
  error: res_error,
1581
- } = ContentPlatformModel.CustomObjectBulkEntry().validate(responseData, {
1582
- abortEarly: false,
1583
- allowUnknown: true,
1584
- });
2775
+ } = ContentPlatformModel.CustomObjectEntryBulkUploadDetails().validate(
2776
+ responseData,
2777
+ { abortEarly: false, allowUnknown: true }
2778
+ );
1585
2779
 
1586
2780
  if (res_error) {
1587
2781
  if (this.config.options.strictResponseCheck === true) {
@@ -1589,7 +2783,7 @@ class Content {
1589
2783
  } else {
1590
2784
  Logger({
1591
2785
  level: "WARN",
1592
- message: `Response Validation Warnings for platform > Content > getJobs \n ${res_error}`,
2786
+ message: `Response Validation Warnings for platform > Content > importCustomObjectEntriesBySlug \n ${res_error}`,
1593
2787
  });
1594
2788
  }
1595
2789
  }
@@ -1598,20 +2792,26 @@ class Content {
1598
2792
  }
1599
2793
 
1600
2794
  /**
1601
- * @param {ContentPlatformValidator.GetResourcesParam} arg - Arg object
2795
+ * @param {ContentPlatformValidator.SampleCustomObjectBulkEntryBySlugParam} arg
2796
+ * - Arg object
2797
+ *
1602
2798
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1603
2799
  * @param {import("../PlatformAPIClient").Options} - Options
1604
- * @returns {Promise<ContentPlatformModel.ResourcesSchema>} - Success response
1605
- * @name getResources
1606
- * @summary: Get resources
1607
- * @description: Use this API to retrieve the resources, such as products, collections, customers, selling locations, etc. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/content/getResources/).
2800
+ * @returns {Promise<string>} - Success response
2801
+ * @name sampleCustomObjectBulkEntryBySlug
2802
+ * @summary: Download sample for custom object bulk entry
2803
+ * @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/sampleCustomObjectBulkEntryBySlug/).
1608
2804
  */
1609
- async getResources(
1610
- { requestHeaders } = { requestHeaders: {} },
2805
+ async sampleCustomObjectBulkEntryBySlug(
2806
+ { slug, requestHeaders } = { requestHeaders: {} },
1611
2807
  { responseHeaders } = { responseHeaders: false }
1612
2808
  ) {
1613
- const { error } = ContentPlatformValidator.getResources().validate(
1614
- {},
2809
+ const {
2810
+ error,
2811
+ } = ContentPlatformValidator.sampleCustomObjectBulkEntryBySlug().validate(
2812
+ {
2813
+ slug,
2814
+ },
1615
2815
  { abortEarly: false, allowUnknown: true }
1616
2816
  );
1617
2817
  if (error) {
@@ -1621,14 +2821,16 @@ class Content {
1621
2821
  // Showing warrnings if extra unknown parameters are found
1622
2822
  const {
1623
2823
  error: warrning,
1624
- } = ContentPlatformValidator.getResources().validate(
1625
- {},
2824
+ } = ContentPlatformValidator.sampleCustomObjectBulkEntryBySlug().validate(
2825
+ {
2826
+ slug,
2827
+ },
1626
2828
  { abortEarly: false, allowUnknown: false }
1627
2829
  );
1628
2830
  if (warrning) {
1629
2831
  Logger({
1630
2832
  level: "WARN",
1631
- message: `Parameter Validation warrnings for platform > Content > getResources \n ${warrning}`,
2833
+ message: `Parameter Validation warrnings for platform > Content > sampleCustomObjectBulkEntryBySlug \n ${warrning}`,
1632
2834
  });
1633
2835
  }
1634
2836
 
@@ -1639,7 +2841,7 @@ class Content {
1639
2841
  const response = await PlatformAPIClient.execute(
1640
2842
  this.config,
1641
2843
  "get",
1642
- `/service/platform/content/v1.0/company/${this.config.companyId}/metafields/resources`,
2844
+ `/service/platform/content/v2.0/company/${this.config.companyId}/customobjects/definition/${slug}/bulk/sample`,
1643
2845
  query_params,
1644
2846
  undefined,
1645
2847
  { ...xHeaders, ...requestHeaders },
@@ -1651,12 +2853,9 @@ class Content {
1651
2853
  responseData = response[0];
1652
2854
  }
1653
2855
 
1654
- const {
1655
- error: res_error,
1656
- } = ContentPlatformModel.ResourcesSchema().validate(responseData, {
1657
- abortEarly: false,
1658
- allowUnknown: true,
1659
- });
2856
+ const { error: res_error } = Joi.string()
2857
+ .allow("")
2858
+ .validate(responseData, { abortEarly: false, allowUnknown: true });
1660
2859
 
1661
2860
  if (res_error) {
1662
2861
  if (this.config.options.strictResponseCheck === true) {
@@ -1664,7 +2863,7 @@ class Content {
1664
2863
  } else {
1665
2864
  Logger({
1666
2865
  level: "WARN",
1667
- message: `Response Validation Warnings for platform > Content > getResources \n ${res_error}`,
2866
+ message: `Response Validation Warnings for platform > Content > sampleCustomObjectBulkEntryBySlug \n ${res_error}`,
1668
2867
  });
1669
2868
  }
1670
2869
  }
@@ -1673,27 +2872,24 @@ class Content {
1673
2872
  }
1674
2873
 
1675
2874
  /**
1676
- * @param {ContentPlatformValidator.ImportCustomObjectEntriesBySlugParam} arg
2875
+ * @param {ContentPlatformValidator.UpdateCompanyLanguageDefaultParam} arg
1677
2876
  * - Arg object
1678
2877
  *
1679
2878
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1680
2879
  * @param {import("../PlatformAPIClient").Options} - Options
1681
- * @returns {Promise<ContentPlatformModel.CustomObjectEntryBulkUploadDetails>}
1682
- * - Success response
1683
- *
1684
- * @name importCustomObjectEntriesBySlug
1685
- * @summary: Bulk custom object entries upload
1686
- * @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/importCustomObjectEntriesBySlug/).
2880
+ * @returns {Promise<ContentPlatformModel.CompanyLanguage>} - Success response
2881
+ * @name updateCompanyLanguageDefault
2882
+ * @summary: Set default language
2883
+ * @description: Update default language settings for the company. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/content/updateCompanyLanguageDefault/).
1687
2884
  */
1688
- async importCustomObjectEntriesBySlug(
1689
- { slug, body, requestHeaders } = { requestHeaders: {} },
2885
+ async updateCompanyLanguageDefault(
2886
+ { body, requestHeaders } = { requestHeaders: {} },
1690
2887
  { responseHeaders } = { responseHeaders: false }
1691
2888
  ) {
1692
2889
  const {
1693
2890
  error,
1694
- } = ContentPlatformValidator.importCustomObjectEntriesBySlug().validate(
2891
+ } = ContentPlatformValidator.updateCompanyLanguageDefault().validate(
1695
2892
  {
1696
- slug,
1697
2893
  body,
1698
2894
  },
1699
2895
  { abortEarly: false, allowUnknown: true }
@@ -1705,9 +2901,8 @@ class Content {
1705
2901
  // Showing warrnings if extra unknown parameters are found
1706
2902
  const {
1707
2903
  error: warrning,
1708
- } = ContentPlatformValidator.importCustomObjectEntriesBySlug().validate(
2904
+ } = ContentPlatformValidator.updateCompanyLanguageDefault().validate(
1709
2905
  {
1710
- slug,
1711
2906
  body,
1712
2907
  },
1713
2908
  { abortEarly: false, allowUnknown: false }
@@ -1715,7 +2910,7 @@ class Content {
1715
2910
  if (warrning) {
1716
2911
  Logger({
1717
2912
  level: "WARN",
1718
- message: `Parameter Validation warrnings for platform > Content > importCustomObjectEntriesBySlug \n ${warrning}`,
2913
+ message: `Parameter Validation warrnings for platform > Content > updateCompanyLanguageDefault \n ${warrning}`,
1719
2914
  });
1720
2915
  }
1721
2916
 
@@ -1725,8 +2920,8 @@ class Content {
1725
2920
 
1726
2921
  const response = await PlatformAPIClient.execute(
1727
2922
  this.config,
1728
- "post",
1729
- `/service/platform/content/v2.0/company/${this.config.companyId}/customobjects/definition/${slug}/bulk/upload`,
2923
+ "put",
2924
+ `/service/platform/content/v1.0/company/${this.config.companyId}/languages`,
1730
2925
  query_params,
1731
2926
  body,
1732
2927
  { ...xHeaders, ...requestHeaders },
@@ -1740,10 +2935,10 @@ class Content {
1740
2935
 
1741
2936
  const {
1742
2937
  error: res_error,
1743
- } = ContentPlatformModel.CustomObjectEntryBulkUploadDetails().validate(
1744
- responseData,
1745
- { abortEarly: false, allowUnknown: true }
1746
- );
2938
+ } = ContentPlatformModel.CompanyLanguage().validate(responseData, {
2939
+ abortEarly: false,
2940
+ allowUnknown: true,
2941
+ });
1747
2942
 
1748
2943
  if (res_error) {
1749
2944
  if (this.config.options.strictResponseCheck === true) {
@@ -1751,7 +2946,7 @@ class Content {
1751
2946
  } else {
1752
2947
  Logger({
1753
2948
  level: "WARN",
1754
- message: `Response Validation Warnings for platform > Content > importCustomObjectEntriesBySlug \n ${res_error}`,
2949
+ message: `Response Validation Warnings for platform > Content > updateCompanyLanguageDefault \n ${res_error}`,
1755
2950
  });
1756
2951
  }
1757
2952
  }
@@ -1760,25 +2955,26 @@ class Content {
1760
2955
  }
1761
2956
 
1762
2957
  /**
1763
- * @param {ContentPlatformValidator.SampleCustomObjectBulkEntryBySlugParam} arg
2958
+ * @param {ContentPlatformValidator.UpdateCompanyResourceTranslationParam} arg
1764
2959
  * - Arg object
1765
2960
  *
1766
2961
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1767
2962
  * @param {import("../PlatformAPIClient").Options} - Options
1768
- * @returns {Promise<string>} - Success response
1769
- * @name sampleCustomObjectBulkEntryBySlug
1770
- * @summary: Download sample for custom object bulk entry
1771
- * @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/sampleCustomObjectBulkEntryBySlug/).
2963
+ * @returns {Promise<ContentPlatformModel.ResourceTranslation>} - Success response
2964
+ * @name updateCompanyResourceTranslation
2965
+ * @summary: Update company translation
2966
+ * @description: Update existing translations for company resources. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/content/updateCompanyResourceTranslation/).
1772
2967
  */
1773
- async sampleCustomObjectBulkEntryBySlug(
1774
- { slug, requestHeaders } = { requestHeaders: {} },
2968
+ async updateCompanyResourceTranslation(
2969
+ { id, body, requestHeaders } = { requestHeaders: {} },
1775
2970
  { responseHeaders } = { responseHeaders: false }
1776
2971
  ) {
1777
2972
  const {
1778
2973
  error,
1779
- } = ContentPlatformValidator.sampleCustomObjectBulkEntryBySlug().validate(
2974
+ } = ContentPlatformValidator.updateCompanyResourceTranslation().validate(
1780
2975
  {
1781
- slug,
2976
+ id,
2977
+ body,
1782
2978
  },
1783
2979
  { abortEarly: false, allowUnknown: true }
1784
2980
  );
@@ -1789,16 +2985,17 @@ class Content {
1789
2985
  // Showing warrnings if extra unknown parameters are found
1790
2986
  const {
1791
2987
  error: warrning,
1792
- } = ContentPlatformValidator.sampleCustomObjectBulkEntryBySlug().validate(
2988
+ } = ContentPlatformValidator.updateCompanyResourceTranslation().validate(
1793
2989
  {
1794
- slug,
2990
+ id,
2991
+ body,
1795
2992
  },
1796
2993
  { abortEarly: false, allowUnknown: false }
1797
2994
  );
1798
2995
  if (warrning) {
1799
2996
  Logger({
1800
2997
  level: "WARN",
1801
- message: `Parameter Validation warrnings for platform > Content > sampleCustomObjectBulkEntryBySlug \n ${warrning}`,
2998
+ message: `Parameter Validation warrnings for platform > Content > updateCompanyResourceTranslation \n ${warrning}`,
1802
2999
  });
1803
3000
  }
1804
3001
 
@@ -1808,10 +3005,10 @@ class Content {
1808
3005
 
1809
3006
  const response = await PlatformAPIClient.execute(
1810
3007
  this.config,
1811
- "get",
1812
- `/service/platform/content/v2.0/company/${this.config.companyId}/customobjects/definition/${slug}/bulk/sample`,
3008
+ "put",
3009
+ `/service/platform/content/v1.0/company/${this.config.companyId}/resource/translations/${id}`,
1813
3010
  query_params,
1814
- undefined,
3011
+ body,
1815
3012
  { ...xHeaders, ...requestHeaders },
1816
3013
  { responseHeaders }
1817
3014
  );
@@ -1821,9 +3018,12 @@ class Content {
1821
3018
  responseData = response[0];
1822
3019
  }
1823
3020
 
1824
- const { error: res_error } = Joi.string()
1825
- .allow("")
1826
- .validate(responseData, { abortEarly: false, allowUnknown: true });
3021
+ const {
3022
+ error: res_error,
3023
+ } = ContentPlatformModel.ResourceTranslation().validate(responseData, {
3024
+ abortEarly: false,
3025
+ allowUnknown: true,
3026
+ });
1827
3027
 
1828
3028
  if (res_error) {
1829
3029
  if (this.config.options.strictResponseCheck === true) {
@@ -1831,7 +3031,7 @@ class Content {
1831
3031
  } else {
1832
3032
  Logger({
1833
3033
  level: "WARN",
1834
- message: `Response Validation Warnings for platform > Content > sampleCustomObjectBulkEntryBySlug \n ${res_error}`,
3034
+ message: `Response Validation Warnings for platform > Content > updateCompanyResourceTranslation \n ${res_error}`,
1835
3035
  });
1836
3036
  }
1837
3037
  }