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