@gofynd/fdk-client-javascript 1.4.15-beta.6 → 1.4.16-beta.1
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 +1 -1
- package/sdk/application/ApplicationClient.d.ts +2 -0
- package/sdk/application/ApplicationClient.js +2 -0
- package/sdk/application/Cart/CartApplicationClient.d.ts +68 -48
- package/sdk/application/Cart/CartApplicationClient.js +130 -27
- package/sdk/application/Catalog/CatalogApplicationClient.d.ts +59 -58
- package/sdk/application/Catalog/CatalogApplicationClient.js +30 -29
- package/sdk/application/Common/CommonApplicationClient.d.ts +2 -2
- package/sdk/application/Common/CommonApplicationClient.js +1 -1
- package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +20 -20
- package/sdk/application/Configuration/ConfigurationApplicationClient.js +10 -10
- package/sdk/application/Content/ContentApplicationClient.d.ts +19 -30
- package/sdk/application/Content/ContentApplicationClient.js +40 -60
- package/sdk/application/FileStorage/FileStorageApplicationClient.d.ts +8 -8
- package/sdk/application/FileStorage/FileStorageApplicationClient.js +7 -7
- package/sdk/application/Finance/FinanceApplicationClient.d.ts +29 -0
- package/sdk/application/Finance/FinanceApplicationClient.js +126 -0
- package/sdk/application/Lead/LeadApplicationClient.d.ts +2 -2
- package/sdk/application/Lead/LeadApplicationClient.js +1 -1
- package/sdk/application/Logistic/LogisticApplicationClient.d.ts +35 -15
- package/sdk/application/Logistic/LogisticApplicationClient.js +118 -8
- package/sdk/application/Order/OrderApplicationClient.d.ts +22 -12
- package/sdk/application/Order/OrderApplicationClient.js +62 -8
- package/sdk/application/Payment/PaymentApplicationClient.d.ts +87 -87
- package/sdk/application/Payment/PaymentApplicationClient.js +65 -46
- package/sdk/application/Rewards/RewardsApplicationClient.d.ts +13 -13
- package/sdk/application/Rewards/RewardsApplicationClient.js +7 -7
- package/sdk/application/Theme/ThemeApplicationClient.d.ts +2 -2
- package/sdk/application/Theme/ThemeApplicationClient.js +4 -2
- package/sdk/application/User/UserApplicationClient.d.ts +10 -10
- package/sdk/application/User/UserApplicationClient.js +6 -6
- package/sdk/application/Webhook/WebhookApplicationClient.d.ts +4 -4
- package/sdk/application/Webhook/WebhookApplicationClient.js +3 -3
- package/sdk/partner/FileStorage/FileStoragePartnerClient.d.ts +86 -12
- package/sdk/partner/FileStorage/FileStoragePartnerClient.js +582 -24
- package/sdk/partner/FileStorage/FileStoragePartnerModel.d.ts +116 -19
- package/sdk/partner/FileStorage/FileStoragePartnerModel.js +121 -14
- package/sdk/partner/FileStorage/FileStoragePartnerValidator.d.ts +8 -1
- package/sdk/partner/FileStorage/FileStoragePartnerValidator.js +51 -4
- package/sdk/partner/Lead/LeadPartnerClient.d.ts +2 -2
- package/sdk/partner/Lead/LeadPartnerClient.js +2 -2
- package/sdk/partner/Lead/LeadPartnerModel.d.ts +5 -5
- package/sdk/partner/Lead/LeadPartnerModel.js +15 -15
- package/sdk/partner/Logistics/LogisticsPartnerClient.d.ts +126 -20
- package/sdk/partner/Logistics/LogisticsPartnerClient.js +970 -20
- package/sdk/partner/Logistics/LogisticsPartnerModel.d.ts +1200 -167
- package/sdk/partner/Logistics/LogisticsPartnerModel.js +571 -160
- package/sdk/partner/Logistics/LogisticsPartnerValidator.d.ts +10 -0
- package/sdk/partner/Logistics/LogisticsPartnerValidator.js +121 -7
- package/sdk/partner/Theme/ThemePartnerClient.d.ts +8 -10
- package/sdk/partner/Theme/ThemePartnerClient.js +14 -16
- package/sdk/partner/Theme/ThemePartnerModel.d.ts +96 -37
- package/sdk/partner/Theme/ThemePartnerModel.js +90 -36
- package/sdk/partner/Theme/ThemePartnerValidator.js +4 -4
- package/sdk/partner/Webhook/WebhookPartnerClient.d.ts +28 -18
- package/sdk/partner/Webhook/WebhookPartnerClient.js +103 -18
- package/sdk/partner/Webhook/WebhookPartnerModel.d.ts +612 -179
- package/sdk/partner/Webhook/WebhookPartnerModel.js +253 -150
- package/sdk/partner/Webhook/WebhookPartnerValidator.d.ts +1 -0
- package/sdk/partner/Webhook/WebhookPartnerValidator.js +11 -3
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.d.ts +5 -4
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.js +14 -8
- package/sdk/platform/Analytics/AnalyticsPlatformModel.d.ts +59 -9
- package/sdk/platform/Analytics/AnalyticsPlatformModel.js +40 -4
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.d.ts +2 -32
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +3 -243
- package/sdk/platform/AuditTrail/AuditTrailPlatformModel.d.ts +11 -130
- package/sdk/platform/AuditTrail/AuditTrailPlatformModel.js +12 -152
- 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 +134 -103
- package/sdk/platform/Cart/CartPlatformApplicationClient.js +419 -115
- package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +121 -65
- package/sdk/platform/Cart/CartPlatformApplicationValidator.js +109 -44
- package/sdk/platform/Cart/CartPlatformModel.d.ts +5039 -1300
- package/sdk/platform/Cart/CartPlatformModel.js +1976 -1217
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +209 -183
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +452 -395
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +185 -142
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +96 -78
- package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +154 -117
- package/sdk/platform/Catalog/CatalogPlatformClient.js +292 -172
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +6941 -2203
- package/sdk/platform/Catalog/CatalogPlatformModel.js +3224 -1687
- package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +72 -31
- package/sdk/platform/Catalog/CatalogPlatformValidator.js +50 -24
- package/sdk/platform/Common/CommonPlatformClient.d.ts +3 -2
- package/sdk/platform/Common/CommonPlatformClient.js +3 -2
- package/sdk/platform/Common/CommonPlatformModel.d.ts +9 -9
- package/sdk/platform/Common/CommonPlatformModel.js +6 -6
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +16 -17
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +16 -17
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.d.ts +8 -8
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.js +8 -8
- package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +43 -33
- package/sdk/platform/Communication/CommunicationPlatformModel.js +38 -34
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +46 -42
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +47 -43
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +223 -223
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +210 -212
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.d.ts +12 -12
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.js +12 -12
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +46 -33
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +67 -54
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.d.ts +18 -18
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.js +18 -18
- package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +45 -24
- package/sdk/platform/Configuration/ConfigurationPlatformClient.js +134 -30
- package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +283 -124
- package/sdk/platform/Configuration/ConfigurationPlatformModel.js +219 -94
- package/sdk/platform/Configuration/ConfigurationPlatformValidator.d.ts +37 -9
- package/sdk/platform/Configuration/ConfigurationPlatformValidator.js +27 -8
- package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +124 -141
- package/sdk/platform/Content/ContentPlatformApplicationClient.js +449 -422
- package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +179 -141
- package/sdk/platform/Content/ContentPlatformApplicationValidator.js +168 -130
- package/sdk/platform/Content/ContentPlatformClient.d.ts +142 -106
- package/sdk/platform/Content/ContentPlatformClient.js +523 -336
- package/sdk/platform/Content/ContentPlatformModel.d.ts +1241 -395
- package/sdk/platform/Content/ContentPlatformModel.js +521 -390
- package/sdk/platform/Content/ContentPlatformValidator.d.ts +168 -117
- package/sdk/platform/Content/ContentPlatformValidator.js +162 -108
- package/sdk/platform/Discount/DiscountPlatformClient.d.ts +14 -12
- package/sdk/platform/Discount/DiscountPlatformClient.js +14 -12
- package/sdk/platform/Discount/DiscountPlatformModel.d.ts +13 -13
- package/sdk/platform/Discount/DiscountPlatformModel.js +12 -12
- package/sdk/platform/Discount/DiscountPlatformValidator.d.ts +2 -2
- package/sdk/platform/Discount/DiscountPlatformValidator.js +2 -2
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +94 -36
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +462 -60
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.d.ts +62 -15
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.js +75 -13
- package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +19 -19
- package/sdk/platform/FileStorage/FileStoragePlatformClient.js +21 -21
- package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +370 -101
- package/sdk/platform/FileStorage/FileStoragePlatformModel.js +313 -84
- package/sdk/platform/FileStorage/FileStoragePlatformValidator.d.ts +6 -6
- package/sdk/platform/FileStorage/FileStoragePlatformValidator.js +6 -6
- package/sdk/platform/Lead/LeadPlatformClient.d.ts +2 -2
- package/sdk/platform/Lead/LeadPlatformClient.js +2 -2
- package/sdk/platform/Lead/LeadPlatformModel.d.ts +5 -5
- package/sdk/platform/Lead/LeadPlatformModel.js +16 -16
- package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +17 -6
- package/sdk/platform/Order/OrderPlatformApplicationClient.js +85 -7
- package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +95 -24
- package/sdk/platform/Order/OrderPlatformApplicationValidator.js +39 -19
- package/sdk/platform/Order/OrderPlatformClient.d.ts +153 -96
- package/sdk/platform/Order/OrderPlatformClient.js +416 -198
- package/sdk/platform/Order/OrderPlatformModel.d.ts +7602 -1269
- package/sdk/platform/Order/OrderPlatformModel.js +3926 -1269
- package/sdk/platform/Order/OrderPlatformValidator.d.ts +270 -109
- package/sdk/platform/Order/OrderPlatformValidator.js +135 -77
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.d.ts +6 -4
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.js +9 -7
- package/sdk/platform/Partner/PartnerPlatformModel.d.ts +9 -9
- package/sdk/platform/Partner/PartnerPlatformModel.js +8 -8
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +93 -105
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +129 -141
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +48 -48
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +48 -48
- package/sdk/platform/Payment/PaymentPlatformClient.d.ts +20 -20
- package/sdk/platform/Payment/PaymentPlatformClient.js +20 -20
- package/sdk/platform/Payment/PaymentPlatformModel.d.ts +333 -319
- package/sdk/platform/Payment/PaymentPlatformModel.js +288 -278
- package/sdk/platform/Payment/PaymentPlatformValidator.d.ts +8 -8
- package/sdk/platform/Payment/PaymentPlatformValidator.js +8 -8
- 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 +9 -9
- package/sdk/platform/Rewards/RewardsPlatformModel.js +8 -8
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.d.ts +48 -38
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.js +134 -43
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.d.ts +46 -17
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.js +34 -14
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +38 -44
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +56 -62
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +1842 -609
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +886 -554
- package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.d.ts +42 -46
- package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.js +26 -28
- package/sdk/platform/Share/SharePlatformApplicationClient.d.ts +2 -2
- package/sdk/platform/Share/SharePlatformApplicationClient.js +2 -2
- package/sdk/platform/Share/SharePlatformModel.d.ts +36 -5
- package/sdk/platform/Share/SharePlatformModel.js +27 -4
- package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +3 -3
- package/sdk/platform/Theme/ThemePlatformApplicationClient.js +8 -4
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.d.ts +5 -0
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.js +2 -0
- package/sdk/platform/Theme/ThemePlatformModel.d.ts +37 -11
- package/sdk/platform/Theme/ThemePlatformModel.js +33 -15
- package/sdk/platform/User/UserPlatformApplicationClient.d.ts +12 -12
- package/sdk/platform/User/UserPlatformApplicationClient.js +12 -12
- package/sdk/platform/User/UserPlatformApplicationValidator.d.ts +2 -2
- package/sdk/platform/User/UserPlatformApplicationValidator.js +2 -2
- package/sdk/platform/User/UserPlatformModel.d.ts +21 -21
- package/sdk/platform/User/UserPlatformModel.js +23 -23
- package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +25 -78
- package/sdk/platform/Webhook/WebhookPlatformClient.js +75 -470
- package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +720 -427
- package/sdk/platform/Webhook/WebhookPlatformModel.js +410 -386
- 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/Configuration/ConfigurationPublicClient.d.ts +3 -2
- package/sdk/public/Configuration/ConfigurationPublicClient.js +6 -5
- package/sdk/public/Configuration/ConfigurationPublicModel.d.ts +9 -9
- package/sdk/public/Configuration/ConfigurationPublicModel.js +6 -6
- package/sdk/public/Content/ContentPublicClient.d.ts +112 -2
- package/sdk/public/Content/ContentPublicClient.js +895 -8
- package/sdk/public/Content/ContentPublicModel.d.ts +549 -3
- package/sdk/public/Content/ContentPublicModel.js +649 -3
- package/sdk/public/Content/ContentPublicValidator.d.ts +69 -3
- package/sdk/public/Content/ContentPublicValidator.js +88 -2
- package/sdk/public/Webhook/WebhookPublicClient.d.ts +8 -8
- package/sdk/public/Webhook/WebhookPublicClient.js +8 -8
- package/sdk/public/Webhook/WebhookPublicModel.d.ts +21 -21
- package/sdk/public/Webhook/WebhookPublicModel.js +15 -15
- package/sdk/public/Webhook/WebhookPublicValidator.d.ts +4 -4
- package/sdk/public/Webhook/WebhookPublicValidator.js +4 -4
- 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 -2890
- package/sdk/platform/Finance/FinancePlatformModel.js +0 -2148
- package/sdk/platform/Finance/FinancePlatformValidator.d.ts +0 -284
- package/sdk/platform/Finance/FinancePlatformValidator.js +0 -354
|
@@ -15,28 +15,25 @@ class Content {
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
|
-
* @param {ContentPlatformValidator.
|
|
19
|
-
* - Arg object
|
|
20
|
-
*
|
|
18
|
+
* @param {ContentPlatformValidator.CreateCustomFieldDefinitionParam} arg - Arg object
|
|
21
19
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
22
20
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
23
|
-
* @returns {Promise<ContentPlatformModel.
|
|
21
|
+
* @returns {Promise<ContentPlatformModel.CustomFieldDefinitionDetailResSchema>}
|
|
24
22
|
* - Success response
|
|
25
23
|
*
|
|
26
|
-
* @name
|
|
27
|
-
* @summary: Create custom field
|
|
28
|
-
* @description: You can
|
|
24
|
+
* @name createCustomFieldDefinition
|
|
25
|
+
* @summary: Create custom field definition for a given resource type
|
|
26
|
+
* @description: You can create custom fields definition to any resource so you can extend property of resource. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/content/createCustomFieldDefinition/).
|
|
29
27
|
*/
|
|
30
|
-
async
|
|
31
|
-
{ resource,
|
|
28
|
+
async createCustomFieldDefinition(
|
|
29
|
+
{ resource, body, requestHeaders } = { requestHeaders: {} },
|
|
32
30
|
{ responseHeaders } = { responseHeaders: false }
|
|
33
31
|
) {
|
|
34
32
|
const {
|
|
35
33
|
error,
|
|
36
|
-
} = ContentPlatformValidator.
|
|
34
|
+
} = ContentPlatformValidator.createCustomFieldDefinition().validate(
|
|
37
35
|
{
|
|
38
36
|
resource,
|
|
39
|
-
resourceId,
|
|
40
37
|
body,
|
|
41
38
|
},
|
|
42
39
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -48,10 +45,9 @@ class Content {
|
|
|
48
45
|
// Showing warrnings if extra unknown parameters are found
|
|
49
46
|
const {
|
|
50
47
|
error: warrning,
|
|
51
|
-
} = ContentPlatformValidator.
|
|
48
|
+
} = ContentPlatformValidator.createCustomFieldDefinition().validate(
|
|
52
49
|
{
|
|
53
50
|
resource,
|
|
54
|
-
resourceId,
|
|
55
51
|
body,
|
|
56
52
|
},
|
|
57
53
|
{ abortEarly: false, allowUnknown: false }
|
|
@@ -59,7 +55,7 @@ class Content {
|
|
|
59
55
|
if (warrning) {
|
|
60
56
|
Logger({
|
|
61
57
|
level: "WARN",
|
|
62
|
-
message: `Parameter Validation warrnings for platform > Content >
|
|
58
|
+
message: `Parameter Validation warrnings for platform > Content > createCustomFieldDefinition \n ${warrning}`,
|
|
63
59
|
});
|
|
64
60
|
}
|
|
65
61
|
|
|
@@ -69,8 +65,8 @@ class Content {
|
|
|
69
65
|
|
|
70
66
|
const response = await PlatformAPIClient.execute(
|
|
71
67
|
this.config,
|
|
72
|
-
"
|
|
73
|
-
`/service/platform/content/
|
|
68
|
+
"post",
|
|
69
|
+
`/service/platform/content/v2.0/company/${this.config.companyId}/customfields/resource/${resource}/definition`,
|
|
74
70
|
query_params,
|
|
75
71
|
body,
|
|
76
72
|
{ ...xHeaders, ...requestHeaders },
|
|
@@ -84,7 +80,7 @@ class Content {
|
|
|
84
80
|
|
|
85
81
|
const {
|
|
86
82
|
error: res_error,
|
|
87
|
-
} = ContentPlatformModel.
|
|
83
|
+
} = ContentPlatformModel.CustomFieldDefinitionDetailResSchema().validate(
|
|
88
84
|
responseData,
|
|
89
85
|
{ abortEarly: false, allowUnknown: true }
|
|
90
86
|
);
|
|
@@ -95,7 +91,7 @@ class Content {
|
|
|
95
91
|
} else {
|
|
96
92
|
Logger({
|
|
97
93
|
level: "WARN",
|
|
98
|
-
message: `Response Validation Warnings for platform > Content >
|
|
94
|
+
message: `Response Validation Warnings for platform > Content > createCustomFieldDefinition \n ${res_error}`,
|
|
99
95
|
});
|
|
100
96
|
}
|
|
101
97
|
}
|
|
@@ -104,24 +100,23 @@ class Content {
|
|
|
104
100
|
}
|
|
105
101
|
|
|
106
102
|
/**
|
|
107
|
-
* @param {ContentPlatformValidator.
|
|
103
|
+
* @param {ContentPlatformValidator.CreateCustomObjectBySlugParam} arg - Arg object
|
|
108
104
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
109
105
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
110
|
-
* @returns {Promise<ContentPlatformModel.
|
|
111
|
-
*
|
|
112
|
-
*
|
|
113
|
-
* @
|
|
114
|
-
* @summary: Create custom field definition
|
|
115
|
-
* @description: You can create custom fields definition to any resource so you can extend property of resource. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/content/createCustomFieldDefinition/).
|
|
106
|
+
* @returns {Promise<ContentPlatformModel.CustomObjectSchema>} - Success response
|
|
107
|
+
* @name createCustomObjectBySlug
|
|
108
|
+
* @summary: Create custom object entries
|
|
109
|
+
* @description: Custom object entries against the custom object definition can be added using this API. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/content/createCustomObjectBySlug/).
|
|
116
110
|
*/
|
|
117
|
-
async
|
|
118
|
-
{ body, requestHeaders } = { requestHeaders: {} },
|
|
111
|
+
async createCustomObjectBySlug(
|
|
112
|
+
{ definitionSlug, body, requestHeaders } = { requestHeaders: {} },
|
|
119
113
|
{ responseHeaders } = { responseHeaders: false }
|
|
120
114
|
) {
|
|
121
115
|
const {
|
|
122
116
|
error,
|
|
123
|
-
} = ContentPlatformValidator.
|
|
117
|
+
} = ContentPlatformValidator.createCustomObjectBySlug().validate(
|
|
124
118
|
{
|
|
119
|
+
definitionSlug,
|
|
125
120
|
body,
|
|
126
121
|
},
|
|
127
122
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -133,8 +128,9 @@ class Content {
|
|
|
133
128
|
// Showing warrnings if extra unknown parameters are found
|
|
134
129
|
const {
|
|
135
130
|
error: warrning,
|
|
136
|
-
} = ContentPlatformValidator.
|
|
131
|
+
} = ContentPlatformValidator.createCustomObjectBySlug().validate(
|
|
137
132
|
{
|
|
133
|
+
definitionSlug,
|
|
138
134
|
body,
|
|
139
135
|
},
|
|
140
136
|
{ abortEarly: false, allowUnknown: false }
|
|
@@ -142,7 +138,7 @@ class Content {
|
|
|
142
138
|
if (warrning) {
|
|
143
139
|
Logger({
|
|
144
140
|
level: "WARN",
|
|
145
|
-
message: `Parameter Validation warrnings for platform > Content >
|
|
141
|
+
message: `Parameter Validation warrnings for platform > Content > createCustomObjectBySlug \n ${warrning}`,
|
|
146
142
|
});
|
|
147
143
|
}
|
|
148
144
|
|
|
@@ -153,7 +149,7 @@ class Content {
|
|
|
153
149
|
const response = await PlatformAPIClient.execute(
|
|
154
150
|
this.config,
|
|
155
151
|
"post",
|
|
156
|
-
`/service/platform/content/
|
|
152
|
+
`/service/platform/content/v2.0/company/${this.config.companyId}/customobjects/definition/${definitionSlug}/entries`,
|
|
157
153
|
query_params,
|
|
158
154
|
body,
|
|
159
155
|
{ ...xHeaders, ...requestHeaders },
|
|
@@ -167,10 +163,10 @@ class Content {
|
|
|
167
163
|
|
|
168
164
|
const {
|
|
169
165
|
error: res_error,
|
|
170
|
-
} = ContentPlatformModel.
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
);
|
|
166
|
+
} = ContentPlatformModel.CustomObjectSchema().validate(responseData, {
|
|
167
|
+
abortEarly: false,
|
|
168
|
+
allowUnknown: true,
|
|
169
|
+
});
|
|
174
170
|
|
|
175
171
|
if (res_error) {
|
|
176
172
|
if (this.config.options.strictResponseCheck === true) {
|
|
@@ -178,7 +174,7 @@ class Content {
|
|
|
178
174
|
} else {
|
|
179
175
|
Logger({
|
|
180
176
|
level: "WARN",
|
|
181
|
-
message: `Response Validation Warnings for platform > Content >
|
|
177
|
+
message: `Response Validation Warnings for platform > Content > createCustomObjectBySlug \n ${res_error}`,
|
|
182
178
|
});
|
|
183
179
|
}
|
|
184
180
|
}
|
|
@@ -187,19 +183,25 @@ class Content {
|
|
|
187
183
|
}
|
|
188
184
|
|
|
189
185
|
/**
|
|
190
|
-
* @param {ContentPlatformValidator.
|
|
186
|
+
* @param {ContentPlatformValidator.CreateCustomObjectDefinitionParam} arg
|
|
187
|
+
* - Arg object
|
|
188
|
+
*
|
|
191
189
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
192
190
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
193
|
-
* @returns {Promise<ContentPlatformModel.
|
|
194
|
-
*
|
|
195
|
-
*
|
|
196
|
-
* @
|
|
191
|
+
* @returns {Promise<ContentPlatformModel.CustomObjectDefinitionSlugSchema>}
|
|
192
|
+
* - Success response
|
|
193
|
+
*
|
|
194
|
+
* @name createCustomObjectDefinition
|
|
195
|
+
* @summary: Create custom object definition
|
|
196
|
+
* @description: Create a custom object that will have a collection of custom fields and can be used anywhere in the custom field for any resource. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/content/createCustomObjectDefinition/).
|
|
197
197
|
*/
|
|
198
|
-
async
|
|
198
|
+
async createCustomObjectDefinition(
|
|
199
199
|
{ body, requestHeaders } = { requestHeaders: {} },
|
|
200
200
|
{ responseHeaders } = { responseHeaders: false }
|
|
201
201
|
) {
|
|
202
|
-
const {
|
|
202
|
+
const {
|
|
203
|
+
error,
|
|
204
|
+
} = ContentPlatformValidator.createCustomObjectDefinition().validate(
|
|
203
205
|
{
|
|
204
206
|
body,
|
|
205
207
|
},
|
|
@@ -212,7 +214,7 @@ class Content {
|
|
|
212
214
|
// Showing warrnings if extra unknown parameters are found
|
|
213
215
|
const {
|
|
214
216
|
error: warrning,
|
|
215
|
-
} = ContentPlatformValidator.
|
|
217
|
+
} = ContentPlatformValidator.createCustomObjectDefinition().validate(
|
|
216
218
|
{
|
|
217
219
|
body,
|
|
218
220
|
},
|
|
@@ -221,7 +223,7 @@ class Content {
|
|
|
221
223
|
if (warrning) {
|
|
222
224
|
Logger({
|
|
223
225
|
level: "WARN",
|
|
224
|
-
message: `Parameter Validation warrnings for platform > Content >
|
|
226
|
+
message: `Parameter Validation warrnings for platform > Content > createCustomObjectDefinition \n ${warrning}`,
|
|
225
227
|
});
|
|
226
228
|
}
|
|
227
229
|
|
|
@@ -232,7 +234,7 @@ class Content {
|
|
|
232
234
|
const response = await PlatformAPIClient.execute(
|
|
233
235
|
this.config,
|
|
234
236
|
"post",
|
|
235
|
-
`/service/platform/content/
|
|
237
|
+
`/service/platform/content/v2.0/company/${this.config.companyId}/customobjects/definition`,
|
|
236
238
|
query_params,
|
|
237
239
|
body,
|
|
238
240
|
{ ...xHeaders, ...requestHeaders },
|
|
@@ -246,10 +248,10 @@ class Content {
|
|
|
246
248
|
|
|
247
249
|
const {
|
|
248
250
|
error: res_error,
|
|
249
|
-
} = ContentPlatformModel.
|
|
250
|
-
|
|
251
|
-
allowUnknown: true
|
|
252
|
-
|
|
251
|
+
} = ContentPlatformModel.CustomObjectDefinitionSlugSchema().validate(
|
|
252
|
+
responseData,
|
|
253
|
+
{ abortEarly: false, allowUnknown: true }
|
|
254
|
+
);
|
|
253
255
|
|
|
254
256
|
if (res_error) {
|
|
255
257
|
if (this.config.options.strictResponseCheck === true) {
|
|
@@ -257,7 +259,7 @@ class Content {
|
|
|
257
259
|
} else {
|
|
258
260
|
Logger({
|
|
259
261
|
level: "WARN",
|
|
260
|
-
message: `Response Validation Warnings for platform > Content >
|
|
262
|
+
message: `Response Validation Warnings for platform > Content > createCustomObjectDefinition \n ${res_error}`,
|
|
261
263
|
});
|
|
262
264
|
}
|
|
263
265
|
}
|
|
@@ -266,26 +268,27 @@ class Content {
|
|
|
266
268
|
}
|
|
267
269
|
|
|
268
270
|
/**
|
|
269
|
-
* @param {ContentPlatformValidator.
|
|
271
|
+
* @param {ContentPlatformValidator.DeleteCustomFieldDefinitionBySlugParam} arg
|
|
270
272
|
* - Arg object
|
|
271
273
|
*
|
|
272
274
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
273
275
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
274
|
-
* @returns {Promise<ContentPlatformModel.
|
|
275
|
-
*
|
|
276
|
-
* @
|
|
277
|
-
* @
|
|
278
|
-
* @description: Create a custom object that will have a collection of custom fields and can be used anywhere in the custom field for any resource. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/content/createCustomObjectDefinition/).
|
|
276
|
+
* @returns {Promise<ContentPlatformModel.CustomDataDeleteSchema>} - Success response
|
|
277
|
+
* @name deleteCustomFieldDefinitionBySlug
|
|
278
|
+
* @summary: Delete custom fields definition
|
|
279
|
+
* @description: Custom field definition and its assosiated custom fields value can be deleted using this api on the basis of definition id. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/content/deleteCustomFieldDefinitionBySlug/).
|
|
279
280
|
*/
|
|
280
|
-
async
|
|
281
|
-
{
|
|
281
|
+
async deleteCustomFieldDefinitionBySlug(
|
|
282
|
+
{ slug, resource, namespace, requestHeaders } = { requestHeaders: {} },
|
|
282
283
|
{ responseHeaders } = { responseHeaders: false }
|
|
283
284
|
) {
|
|
284
285
|
const {
|
|
285
286
|
error,
|
|
286
|
-
} = ContentPlatformValidator.
|
|
287
|
+
} = ContentPlatformValidator.deleteCustomFieldDefinitionBySlug().validate(
|
|
287
288
|
{
|
|
288
|
-
|
|
289
|
+
slug,
|
|
290
|
+
resource,
|
|
291
|
+
namespace,
|
|
289
292
|
},
|
|
290
293
|
{ abortEarly: false, allowUnknown: true }
|
|
291
294
|
);
|
|
@@ -296,16 +299,18 @@ class Content {
|
|
|
296
299
|
// Showing warrnings if extra unknown parameters are found
|
|
297
300
|
const {
|
|
298
301
|
error: warrning,
|
|
299
|
-
} = ContentPlatformValidator.
|
|
302
|
+
} = ContentPlatformValidator.deleteCustomFieldDefinitionBySlug().validate(
|
|
300
303
|
{
|
|
301
|
-
|
|
304
|
+
slug,
|
|
305
|
+
resource,
|
|
306
|
+
namespace,
|
|
302
307
|
},
|
|
303
308
|
{ abortEarly: false, allowUnknown: false }
|
|
304
309
|
);
|
|
305
310
|
if (warrning) {
|
|
306
311
|
Logger({
|
|
307
312
|
level: "WARN",
|
|
308
|
-
message: `Parameter Validation warrnings for platform > Content >
|
|
313
|
+
message: `Parameter Validation warrnings for platform > Content > deleteCustomFieldDefinitionBySlug \n ${warrning}`,
|
|
309
314
|
});
|
|
310
315
|
}
|
|
311
316
|
|
|
@@ -315,10 +320,10 @@ class Content {
|
|
|
315
320
|
|
|
316
321
|
const response = await PlatformAPIClient.execute(
|
|
317
322
|
this.config,
|
|
318
|
-
"
|
|
319
|
-
`/service/platform/content/
|
|
323
|
+
"delete",
|
|
324
|
+
`/service/platform/content/v2.0/company/${this.config.companyId}/customfields/resource/${resource}/namespace/${namespace}/definition/${slug}`,
|
|
320
325
|
query_params,
|
|
321
|
-
|
|
326
|
+
undefined,
|
|
322
327
|
{ ...xHeaders, ...requestHeaders },
|
|
323
328
|
{ responseHeaders }
|
|
324
329
|
);
|
|
@@ -330,10 +335,10 @@ class Content {
|
|
|
330
335
|
|
|
331
336
|
const {
|
|
332
337
|
error: res_error,
|
|
333
|
-
} = ContentPlatformModel.
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
);
|
|
338
|
+
} = ContentPlatformModel.CustomDataDeleteSchema().validate(responseData, {
|
|
339
|
+
abortEarly: false,
|
|
340
|
+
allowUnknown: true,
|
|
341
|
+
});
|
|
337
342
|
|
|
338
343
|
if (res_error) {
|
|
339
344
|
if (this.config.options.strictResponseCheck === true) {
|
|
@@ -341,7 +346,7 @@ class Content {
|
|
|
341
346
|
} else {
|
|
342
347
|
Logger({
|
|
343
348
|
level: "WARN",
|
|
344
|
-
message: `Response Validation Warnings for platform > Content >
|
|
349
|
+
message: `Response Validation Warnings for platform > Content > deleteCustomFieldDefinitionBySlug \n ${res_error}`,
|
|
345
350
|
});
|
|
346
351
|
}
|
|
347
352
|
}
|
|
@@ -350,23 +355,28 @@ class Content {
|
|
|
350
355
|
}
|
|
351
356
|
|
|
352
357
|
/**
|
|
353
|
-
* @param {ContentPlatformValidator.
|
|
358
|
+
* @param {ContentPlatformValidator.DeleteCustomFieldsByResourceSlugParam} arg
|
|
359
|
+
* - Arg object
|
|
360
|
+
*
|
|
354
361
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
355
362
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
356
|
-
* @returns {Promise<ContentPlatformModel.
|
|
357
|
-
*
|
|
358
|
-
* @
|
|
359
|
-
* @
|
|
363
|
+
* @returns {Promise<ContentPlatformModel.CustomFieldsDeleteSchema>} -
|
|
364
|
+
* Success response
|
|
365
|
+
* @name deleteCustomFieldsByResourceSlug
|
|
366
|
+
* @summary: delete custom fields of given resource and resource slug
|
|
367
|
+
* @description: Use this API to delete the custom fields for given resource in param. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/content/deleteCustomFieldsByResourceSlug/).
|
|
360
368
|
*/
|
|
361
|
-
async
|
|
362
|
-
{
|
|
369
|
+
async deleteCustomFieldsByResourceSlug(
|
|
370
|
+
{ resource, resourceSlug, ids, requestHeaders } = { requestHeaders: {} },
|
|
363
371
|
{ responseHeaders } = { responseHeaders: false }
|
|
364
372
|
) {
|
|
365
373
|
const {
|
|
366
374
|
error,
|
|
367
|
-
} = ContentPlatformValidator.
|
|
375
|
+
} = ContentPlatformValidator.deleteCustomFieldsByResourceSlug().validate(
|
|
368
376
|
{
|
|
369
|
-
|
|
377
|
+
resource,
|
|
378
|
+
resourceSlug,
|
|
379
|
+
ids,
|
|
370
380
|
},
|
|
371
381
|
{ abortEarly: false, allowUnknown: true }
|
|
372
382
|
);
|
|
@@ -377,27 +387,30 @@ class Content {
|
|
|
377
387
|
// Showing warrnings if extra unknown parameters are found
|
|
378
388
|
const {
|
|
379
389
|
error: warrning,
|
|
380
|
-
} = ContentPlatformValidator.
|
|
390
|
+
} = ContentPlatformValidator.deleteCustomFieldsByResourceSlug().validate(
|
|
381
391
|
{
|
|
382
|
-
|
|
392
|
+
resource,
|
|
393
|
+
resourceSlug,
|
|
394
|
+
ids,
|
|
383
395
|
},
|
|
384
396
|
{ abortEarly: false, allowUnknown: false }
|
|
385
397
|
);
|
|
386
398
|
if (warrning) {
|
|
387
399
|
Logger({
|
|
388
400
|
level: "WARN",
|
|
389
|
-
message: `Parameter Validation warrnings for platform > Content >
|
|
401
|
+
message: `Parameter Validation warrnings for platform > Content > deleteCustomFieldsByResourceSlug \n ${warrning}`,
|
|
390
402
|
});
|
|
391
403
|
}
|
|
392
404
|
|
|
393
405
|
const query_params = {};
|
|
406
|
+
query_params["ids"] = ids;
|
|
394
407
|
|
|
395
408
|
const xHeaders = {};
|
|
396
409
|
|
|
397
410
|
const response = await PlatformAPIClient.execute(
|
|
398
411
|
this.config,
|
|
399
412
|
"delete",
|
|
400
|
-
`/service/platform/content/
|
|
413
|
+
`/service/platform/content/v2.0/company/${this.config.companyId}/customfields/resource/${resource}/${resourceSlug}`,
|
|
401
414
|
query_params,
|
|
402
415
|
undefined,
|
|
403
416
|
{ ...xHeaders, ...requestHeaders },
|
|
@@ -411,7 +424,7 @@ class Content {
|
|
|
411
424
|
|
|
412
425
|
const {
|
|
413
426
|
error: res_error,
|
|
414
|
-
} = ContentPlatformModel.
|
|
427
|
+
} = ContentPlatformModel.CustomFieldsDeleteSchema().validate(responseData, {
|
|
415
428
|
abortEarly: false,
|
|
416
429
|
allowUnknown: true,
|
|
417
430
|
});
|
|
@@ -422,7 +435,7 @@ class Content {
|
|
|
422
435
|
} else {
|
|
423
436
|
Logger({
|
|
424
437
|
level: "WARN",
|
|
425
|
-
message: `Response Validation Warnings for platform > Content >
|
|
438
|
+
message: `Response Validation Warnings for platform > Content > deleteCustomFieldsByResourceSlug \n ${res_error}`,
|
|
426
439
|
});
|
|
427
440
|
}
|
|
428
441
|
}
|
|
@@ -431,21 +444,24 @@ class Content {
|
|
|
431
444
|
}
|
|
432
445
|
|
|
433
446
|
/**
|
|
434
|
-
* @param {ContentPlatformValidator.
|
|
447
|
+
* @param {ContentPlatformValidator.DeleteCustomObjectBySlugParam} arg - Arg object
|
|
435
448
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
436
449
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
437
450
|
* @returns {Promise<ContentPlatformModel.CustomDataDeleteSchema>} - Success response
|
|
438
|
-
* @name
|
|
451
|
+
* @name deleteCustomObjectBySlug
|
|
439
452
|
* @summary: Delete custom object
|
|
440
|
-
* @description: Custom object entries can be deleted by providing the delete ID using this endpoint. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/content/
|
|
453
|
+
* @description: Custom object entries can be deleted by providing the delete ID using this endpoint. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/content/deleteCustomObjectBySlug/).
|
|
441
454
|
*/
|
|
442
|
-
async
|
|
443
|
-
{
|
|
455
|
+
async deleteCustomObjectBySlug(
|
|
456
|
+
{ definitionSlug, slug, requestHeaders } = { requestHeaders: {} },
|
|
444
457
|
{ responseHeaders } = { responseHeaders: false }
|
|
445
458
|
) {
|
|
446
|
-
const {
|
|
459
|
+
const {
|
|
460
|
+
error,
|
|
461
|
+
} = ContentPlatformValidator.deleteCustomObjectBySlug().validate(
|
|
447
462
|
{
|
|
448
|
-
|
|
463
|
+
definitionSlug,
|
|
464
|
+
slug,
|
|
449
465
|
},
|
|
450
466
|
{ abortEarly: false, allowUnknown: true }
|
|
451
467
|
);
|
|
@@ -456,16 +472,17 @@ class Content {
|
|
|
456
472
|
// Showing warrnings if extra unknown parameters are found
|
|
457
473
|
const {
|
|
458
474
|
error: warrning,
|
|
459
|
-
} = ContentPlatformValidator.
|
|
475
|
+
} = ContentPlatformValidator.deleteCustomObjectBySlug().validate(
|
|
460
476
|
{
|
|
461
|
-
|
|
477
|
+
definitionSlug,
|
|
478
|
+
slug,
|
|
462
479
|
},
|
|
463
480
|
{ abortEarly: false, allowUnknown: false }
|
|
464
481
|
);
|
|
465
482
|
if (warrning) {
|
|
466
483
|
Logger({
|
|
467
484
|
level: "WARN",
|
|
468
|
-
message: `Parameter Validation warrnings for platform > Content >
|
|
485
|
+
message: `Parameter Validation warrnings for platform > Content > deleteCustomObjectBySlug \n ${warrning}`,
|
|
469
486
|
});
|
|
470
487
|
}
|
|
471
488
|
|
|
@@ -476,7 +493,7 @@ class Content {
|
|
|
476
493
|
const response = await PlatformAPIClient.execute(
|
|
477
494
|
this.config,
|
|
478
495
|
"delete",
|
|
479
|
-
`/service/platform/content/
|
|
496
|
+
`/service/platform/content/v2.0/company/${this.config.companyId}/customobjects/definition/${definitionSlug}/entries/${slug}`,
|
|
480
497
|
query_params,
|
|
481
498
|
undefined,
|
|
482
499
|
{ ...xHeaders, ...requestHeaders },
|
|
@@ -501,7 +518,7 @@ class Content {
|
|
|
501
518
|
} else {
|
|
502
519
|
Logger({
|
|
503
520
|
level: "WARN",
|
|
504
|
-
message: `Response Validation Warnings for platform > Content >
|
|
521
|
+
message: `Response Validation Warnings for platform > Content > deleteCustomObjectBySlug \n ${res_error}`,
|
|
505
522
|
});
|
|
506
523
|
}
|
|
507
524
|
}
|
|
@@ -510,7 +527,7 @@ class Content {
|
|
|
510
527
|
}
|
|
511
528
|
|
|
512
529
|
/**
|
|
513
|
-
* @param {ContentPlatformValidator.
|
|
530
|
+
* @param {ContentPlatformValidator.DeleteCustomObjectDefinitionBySlugParam} arg
|
|
514
531
|
* - Arg object
|
|
515
532
|
*
|
|
516
533
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
@@ -518,19 +535,19 @@ class Content {
|
|
|
518
535
|
* @returns {Promise<ContentPlatformModel.CustomObjectDefinitionDeleteResponseSchema>}
|
|
519
536
|
* - Success response
|
|
520
537
|
*
|
|
521
|
-
* @name
|
|
522
|
-
* @summary:
|
|
523
|
-
* @description: Custom object definitions can be deleted using this endpoint by providing the definition ID. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/content/
|
|
538
|
+
* @name deleteCustomObjectDefinitionBySlug
|
|
539
|
+
* @summary: Delete custom object definition
|
|
540
|
+
* @description: Custom object definitions can be deleted using this endpoint by providing the definition ID. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/content/deleteCustomObjectDefinitionBySlug/).
|
|
524
541
|
*/
|
|
525
|
-
async
|
|
526
|
-
{
|
|
542
|
+
async deleteCustomObjectDefinitionBySlug(
|
|
543
|
+
{ slug, requestHeaders } = { requestHeaders: {} },
|
|
527
544
|
{ responseHeaders } = { responseHeaders: false }
|
|
528
545
|
) {
|
|
529
546
|
const {
|
|
530
547
|
error,
|
|
531
|
-
} = ContentPlatformValidator.
|
|
548
|
+
} = ContentPlatformValidator.deleteCustomObjectDefinitionBySlug().validate(
|
|
532
549
|
{
|
|
533
|
-
|
|
550
|
+
slug,
|
|
534
551
|
},
|
|
535
552
|
{ abortEarly: false, allowUnknown: true }
|
|
536
553
|
);
|
|
@@ -541,16 +558,16 @@ class Content {
|
|
|
541
558
|
// Showing warrnings if extra unknown parameters are found
|
|
542
559
|
const {
|
|
543
560
|
error: warrning,
|
|
544
|
-
} = ContentPlatformValidator.
|
|
561
|
+
} = ContentPlatformValidator.deleteCustomObjectDefinitionBySlug().validate(
|
|
545
562
|
{
|
|
546
|
-
|
|
563
|
+
slug,
|
|
547
564
|
},
|
|
548
565
|
{ abortEarly: false, allowUnknown: false }
|
|
549
566
|
);
|
|
550
567
|
if (warrning) {
|
|
551
568
|
Logger({
|
|
552
569
|
level: "WARN",
|
|
553
|
-
message: `Parameter Validation warrnings for platform > Content >
|
|
570
|
+
message: `Parameter Validation warrnings for platform > Content > deleteCustomObjectDefinitionBySlug \n ${warrning}`,
|
|
554
571
|
});
|
|
555
572
|
}
|
|
556
573
|
|
|
@@ -561,7 +578,7 @@ class Content {
|
|
|
561
578
|
const response = await PlatformAPIClient.execute(
|
|
562
579
|
this.config,
|
|
563
580
|
"delete",
|
|
564
|
-
`/service/platform/content/
|
|
581
|
+
`/service/platform/content/v2.0/company/${this.config.companyId}/customobjects/definition/${slug}`,
|
|
565
582
|
query_params,
|
|
566
583
|
undefined,
|
|
567
584
|
{ ...xHeaders, ...requestHeaders },
|
|
@@ -586,7 +603,7 @@ class Content {
|
|
|
586
603
|
} else {
|
|
587
604
|
Logger({
|
|
588
605
|
level: "WARN",
|
|
589
|
-
message: `Response Validation Warnings for platform > Content >
|
|
606
|
+
message: `Response Validation Warnings for platform > Content > deleteCustomObjectDefinitionBySlug \n ${res_error}`,
|
|
590
607
|
});
|
|
591
608
|
}
|
|
592
609
|
}
|
|
@@ -595,25 +612,27 @@ class Content {
|
|
|
595
612
|
}
|
|
596
613
|
|
|
597
614
|
/**
|
|
598
|
-
* @param {ContentPlatformValidator.
|
|
615
|
+
* @param {ContentPlatformValidator.ExportCustomObjectEntriesBySlugParam} arg
|
|
616
|
+
* - Arg object
|
|
617
|
+
*
|
|
599
618
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
600
619
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
601
620
|
* @returns {Promise<ContentPlatformModel.CustomObjectBulkEntryInitiateDownload>}
|
|
602
621
|
* - Success response
|
|
603
622
|
*
|
|
604
|
-
* @name
|
|
623
|
+
* @name exportCustomObjectEntriesBySlug
|
|
605
624
|
* @summary: Initiate download for bulk custom object entries
|
|
606
|
-
* @description: Custom object bulk export of bulk entries can be perform using this endpoint. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/content/
|
|
625
|
+
* @description: Custom object bulk export of bulk entries can be perform using this endpoint. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/content/exportCustomObjectEntriesBySlug/).
|
|
607
626
|
*/
|
|
608
|
-
async
|
|
609
|
-
{
|
|
627
|
+
async exportCustomObjectEntriesBySlug(
|
|
628
|
+
{ slug, requestHeaders } = { requestHeaders: {} },
|
|
610
629
|
{ responseHeaders } = { responseHeaders: false }
|
|
611
630
|
) {
|
|
612
631
|
const {
|
|
613
632
|
error,
|
|
614
|
-
} = ContentPlatformValidator.
|
|
633
|
+
} = ContentPlatformValidator.exportCustomObjectEntriesBySlug().validate(
|
|
615
634
|
{
|
|
616
|
-
|
|
635
|
+
slug,
|
|
617
636
|
},
|
|
618
637
|
{ abortEarly: false, allowUnknown: true }
|
|
619
638
|
);
|
|
@@ -624,16 +643,16 @@ class Content {
|
|
|
624
643
|
// Showing warrnings if extra unknown parameters are found
|
|
625
644
|
const {
|
|
626
645
|
error: warrning,
|
|
627
|
-
} = ContentPlatformValidator.
|
|
646
|
+
} = ContentPlatformValidator.exportCustomObjectEntriesBySlug().validate(
|
|
628
647
|
{
|
|
629
|
-
|
|
648
|
+
slug,
|
|
630
649
|
},
|
|
631
650
|
{ abortEarly: false, allowUnknown: false }
|
|
632
651
|
);
|
|
633
652
|
if (warrning) {
|
|
634
653
|
Logger({
|
|
635
654
|
level: "WARN",
|
|
636
|
-
message: `Parameter Validation warrnings for platform > Content >
|
|
655
|
+
message: `Parameter Validation warrnings for platform > Content > exportCustomObjectEntriesBySlug \n ${warrning}`,
|
|
637
656
|
});
|
|
638
657
|
}
|
|
639
658
|
|
|
@@ -644,7 +663,7 @@ class Content {
|
|
|
644
663
|
const response = await PlatformAPIClient.execute(
|
|
645
664
|
this.config,
|
|
646
665
|
"get",
|
|
647
|
-
`/service/platform/content/
|
|
666
|
+
`/service/platform/content/v2.0/company/${this.config.companyId}/customobjects/definition/${slug}/bulk/download`,
|
|
648
667
|
query_params,
|
|
649
668
|
undefined,
|
|
650
669
|
{ ...xHeaders, ...requestHeaders },
|
|
@@ -669,7 +688,7 @@ class Content {
|
|
|
669
688
|
} else {
|
|
670
689
|
Logger({
|
|
671
690
|
level: "WARN",
|
|
672
|
-
message: `Response Validation Warnings for platform > Content >
|
|
691
|
+
message: `Response Validation Warnings for platform > Content > exportCustomObjectEntriesBySlug \n ${res_error}`,
|
|
673
692
|
});
|
|
674
693
|
}
|
|
675
694
|
}
|
|
@@ -678,25 +697,41 @@ class Content {
|
|
|
678
697
|
}
|
|
679
698
|
|
|
680
699
|
/**
|
|
681
|
-
* @param {ContentPlatformValidator.
|
|
700
|
+
* @param {ContentPlatformValidator.GetCustomFieldDefinitionByResourceParam} arg
|
|
701
|
+
* - Arg object
|
|
702
|
+
*
|
|
682
703
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
683
704
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
684
|
-
* @returns {Promise<ContentPlatformModel.
|
|
685
|
-
*
|
|
686
|
-
*
|
|
687
|
-
* @
|
|
688
|
-
* @
|
|
689
|
-
* @description: Custom field definitions can be fetch using definition id. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/content/getCustomFieldDefinition/).
|
|
705
|
+
* @returns {Promise<ContentPlatformModel.CustomFieldDefinitionsSchema>} -
|
|
706
|
+
* Success response
|
|
707
|
+
* @name getCustomFieldDefinitionByResource
|
|
708
|
+
* @summary: Get custom fields definitions for a given resource type
|
|
709
|
+
* @description: Custom field definitions enable you to include data validation for custom fields, and enable sellers to add custom fields values for resources. With the help of this seller can retrive list of custom field definitions list. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/content/getCustomFieldDefinitionByResource/).
|
|
690
710
|
*/
|
|
691
|
-
async
|
|
692
|
-
{
|
|
711
|
+
async getCustomFieldDefinitionByResource(
|
|
712
|
+
{
|
|
713
|
+
pageNo,
|
|
714
|
+
pageSize,
|
|
715
|
+
resource,
|
|
716
|
+
types,
|
|
717
|
+
search,
|
|
718
|
+
slugs,
|
|
719
|
+
namespaces,
|
|
720
|
+
requestHeaders,
|
|
721
|
+
} = { requestHeaders: {} },
|
|
693
722
|
{ responseHeaders } = { responseHeaders: false }
|
|
694
723
|
) {
|
|
695
724
|
const {
|
|
696
725
|
error,
|
|
697
|
-
} = ContentPlatformValidator.
|
|
726
|
+
} = ContentPlatformValidator.getCustomFieldDefinitionByResource().validate(
|
|
698
727
|
{
|
|
699
|
-
|
|
728
|
+
pageNo,
|
|
729
|
+
pageSize,
|
|
730
|
+
resource,
|
|
731
|
+
types,
|
|
732
|
+
search,
|
|
733
|
+
slugs,
|
|
734
|
+
namespaces,
|
|
700
735
|
},
|
|
701
736
|
{ abortEarly: false, allowUnknown: true }
|
|
702
737
|
);
|
|
@@ -707,27 +742,39 @@ class Content {
|
|
|
707
742
|
// Showing warrnings if extra unknown parameters are found
|
|
708
743
|
const {
|
|
709
744
|
error: warrning,
|
|
710
|
-
} = ContentPlatformValidator.
|
|
745
|
+
} = ContentPlatformValidator.getCustomFieldDefinitionByResource().validate(
|
|
711
746
|
{
|
|
712
|
-
|
|
747
|
+
pageNo,
|
|
748
|
+
pageSize,
|
|
749
|
+
resource,
|
|
750
|
+
types,
|
|
751
|
+
search,
|
|
752
|
+
slugs,
|
|
753
|
+
namespaces,
|
|
713
754
|
},
|
|
714
755
|
{ abortEarly: false, allowUnknown: false }
|
|
715
756
|
);
|
|
716
757
|
if (warrning) {
|
|
717
758
|
Logger({
|
|
718
759
|
level: "WARN",
|
|
719
|
-
message: `Parameter Validation warrnings for platform > Content >
|
|
760
|
+
message: `Parameter Validation warrnings for platform > Content > getCustomFieldDefinitionByResource \n ${warrning}`,
|
|
720
761
|
});
|
|
721
762
|
}
|
|
722
763
|
|
|
723
764
|
const query_params = {};
|
|
765
|
+
query_params["page_no"] = pageNo;
|
|
766
|
+
query_params["page_size"] = pageSize;
|
|
767
|
+
query_params["types"] = types;
|
|
768
|
+
query_params["search"] = search;
|
|
769
|
+
query_params["slugs"] = slugs;
|
|
770
|
+
query_params["namespaces"] = namespaces;
|
|
724
771
|
|
|
725
772
|
const xHeaders = {};
|
|
726
773
|
|
|
727
774
|
const response = await PlatformAPIClient.execute(
|
|
728
775
|
this.config,
|
|
729
776
|
"get",
|
|
730
|
-
`/service/platform/content/
|
|
777
|
+
`/service/platform/content/v2.0/company/${this.config.companyId}/customfields/resource/${resource}/definition`,
|
|
731
778
|
query_params,
|
|
732
779
|
undefined,
|
|
733
780
|
{ ...xHeaders, ...requestHeaders },
|
|
@@ -741,7 +788,7 @@ class Content {
|
|
|
741
788
|
|
|
742
789
|
const {
|
|
743
790
|
error: res_error,
|
|
744
|
-
} = ContentPlatformModel.
|
|
791
|
+
} = ContentPlatformModel.CustomFieldDefinitionsSchema().validate(
|
|
745
792
|
responseData,
|
|
746
793
|
{ abortEarly: false, allowUnknown: true }
|
|
747
794
|
);
|
|
@@ -752,7 +799,7 @@ class Content {
|
|
|
752
799
|
} else {
|
|
753
800
|
Logger({
|
|
754
801
|
level: "WARN",
|
|
755
|
-
message: `Response Validation Warnings for platform > Content >
|
|
802
|
+
message: `Response Validation Warnings for platform > Content > getCustomFieldDefinitionByResource \n ${res_error}`,
|
|
756
803
|
});
|
|
757
804
|
}
|
|
758
805
|
}
|
|
@@ -761,30 +808,29 @@ class Content {
|
|
|
761
808
|
}
|
|
762
809
|
|
|
763
810
|
/**
|
|
764
|
-
* @param {ContentPlatformValidator.
|
|
811
|
+
* @param {ContentPlatformValidator.GetCustomFieldDefinitionBySlugParam} arg
|
|
812
|
+
* - Arg object
|
|
813
|
+
*
|
|
765
814
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
766
815
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
767
|
-
* @returns {Promise<ContentPlatformModel.
|
|
768
|
-
* Success response
|
|
769
|
-
*
|
|
770
|
-
* @
|
|
771
|
-
* @
|
|
816
|
+
* @returns {Promise<ContentPlatformModel.MetaFieldDefinitionDetailResSchema>}
|
|
817
|
+
* - Success response
|
|
818
|
+
*
|
|
819
|
+
* @name getCustomFieldDefinitionBySlug
|
|
820
|
+
* @summary: Get custom fields definition by resource, slug and namespace
|
|
821
|
+
* @description: Custom field definitions can be retrived from this using its slug, namespace and resource - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/content/getCustomFieldDefinitionBySlug/).
|
|
772
822
|
*/
|
|
773
|
-
async
|
|
774
|
-
{
|
|
775
|
-
requestHeaders: {},
|
|
776
|
-
},
|
|
823
|
+
async getCustomFieldDefinitionBySlug(
|
|
824
|
+
{ slug, resource, namespace, requestHeaders } = { requestHeaders: {} },
|
|
777
825
|
{ responseHeaders } = { responseHeaders: false }
|
|
778
826
|
) {
|
|
779
827
|
const {
|
|
780
828
|
error,
|
|
781
|
-
} = ContentPlatformValidator.
|
|
829
|
+
} = ContentPlatformValidator.getCustomFieldDefinitionBySlug().validate(
|
|
782
830
|
{
|
|
783
|
-
|
|
784
|
-
pageSize,
|
|
831
|
+
slug,
|
|
785
832
|
resource,
|
|
786
|
-
|
|
787
|
-
search,
|
|
833
|
+
namespace,
|
|
788
834
|
},
|
|
789
835
|
{ abortEarly: false, allowUnknown: true }
|
|
790
836
|
);
|
|
@@ -795,36 +841,29 @@ class Content {
|
|
|
795
841
|
// Showing warrnings if extra unknown parameters are found
|
|
796
842
|
const {
|
|
797
843
|
error: warrning,
|
|
798
|
-
} = ContentPlatformValidator.
|
|
844
|
+
} = ContentPlatformValidator.getCustomFieldDefinitionBySlug().validate(
|
|
799
845
|
{
|
|
800
|
-
|
|
801
|
-
pageSize,
|
|
846
|
+
slug,
|
|
802
847
|
resource,
|
|
803
|
-
|
|
804
|
-
search,
|
|
848
|
+
namespace,
|
|
805
849
|
},
|
|
806
850
|
{ abortEarly: false, allowUnknown: false }
|
|
807
851
|
);
|
|
808
852
|
if (warrning) {
|
|
809
853
|
Logger({
|
|
810
854
|
level: "WARN",
|
|
811
|
-
message: `Parameter Validation warrnings for platform > Content >
|
|
855
|
+
message: `Parameter Validation warrnings for platform > Content > getCustomFieldDefinitionBySlug \n ${warrning}`,
|
|
812
856
|
});
|
|
813
857
|
}
|
|
814
858
|
|
|
815
859
|
const query_params = {};
|
|
816
|
-
query_params["page_no"] = pageNo;
|
|
817
|
-
query_params["page_size"] = pageSize;
|
|
818
|
-
query_params["resource"] = resource;
|
|
819
|
-
query_params["type"] = type;
|
|
820
|
-
query_params["search"] = search;
|
|
821
860
|
|
|
822
861
|
const xHeaders = {};
|
|
823
862
|
|
|
824
863
|
const response = await PlatformAPIClient.execute(
|
|
825
864
|
this.config,
|
|
826
865
|
"get",
|
|
827
|
-
`/service/platform/content/
|
|
866
|
+
`/service/platform/content/v2.0/company/${this.config.companyId}/customfields/resource/${resource}/namespace/${namespace}/definition/${slug}`,
|
|
828
867
|
query_params,
|
|
829
868
|
undefined,
|
|
830
869
|
{ ...xHeaders, ...requestHeaders },
|
|
@@ -838,7 +877,7 @@ class Content {
|
|
|
838
877
|
|
|
839
878
|
const {
|
|
840
879
|
error: res_error,
|
|
841
|
-
} = ContentPlatformModel.
|
|
880
|
+
} = ContentPlatformModel.MetaFieldDefinitionDetailResSchema().validate(
|
|
842
881
|
responseData,
|
|
843
882
|
{ abortEarly: false, allowUnknown: true }
|
|
844
883
|
);
|
|
@@ -849,7 +888,7 @@ class Content {
|
|
|
849
888
|
} else {
|
|
850
889
|
Logger({
|
|
851
890
|
level: "WARN",
|
|
852
|
-
message: `Response Validation Warnings for platform > Content >
|
|
891
|
+
message: `Response Validation Warnings for platform > Content > getCustomFieldDefinitionBySlug \n ${res_error}`,
|
|
853
892
|
});
|
|
854
893
|
}
|
|
855
894
|
}
|
|
@@ -858,20 +897,40 @@ class Content {
|
|
|
858
897
|
}
|
|
859
898
|
|
|
860
899
|
/**
|
|
861
|
-
* @param {ContentPlatformValidator.
|
|
900
|
+
* @param {ContentPlatformValidator.GetCustomFieldDefinitionsParam} arg - Arg object
|
|
862
901
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
863
902
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
864
|
-
* @returns {Promise<ContentPlatformModel.
|
|
865
|
-
*
|
|
866
|
-
* @
|
|
867
|
-
* @
|
|
903
|
+
* @returns {Promise<ContentPlatformModel.CustomFieldDefinitionsSchema>} -
|
|
904
|
+
* Success response
|
|
905
|
+
* @name getCustomFieldDefinitions
|
|
906
|
+
* @summary: Get custom fields definitions
|
|
907
|
+
* @description: Custom field definitions enable you to include data validation for custom fields, and enable sellers to add custom fields values for resources. With the help of this seller can retrive list of custom field definitions list. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/content/getCustomFieldDefinitions/).
|
|
868
908
|
*/
|
|
869
|
-
async
|
|
870
|
-
{
|
|
909
|
+
async getCustomFieldDefinitions(
|
|
910
|
+
{
|
|
911
|
+
pageNo,
|
|
912
|
+
pageSize,
|
|
913
|
+
resources,
|
|
914
|
+
types,
|
|
915
|
+
search,
|
|
916
|
+
slugs,
|
|
917
|
+
namespaces,
|
|
918
|
+
requestHeaders,
|
|
919
|
+
} = { requestHeaders: {} },
|
|
871
920
|
{ responseHeaders } = { responseHeaders: false }
|
|
872
921
|
) {
|
|
873
|
-
const {
|
|
874
|
-
|
|
922
|
+
const {
|
|
923
|
+
error,
|
|
924
|
+
} = ContentPlatformValidator.getCustomFieldDefinitions().validate(
|
|
925
|
+
{
|
|
926
|
+
pageNo,
|
|
927
|
+
pageSize,
|
|
928
|
+
resources,
|
|
929
|
+
types,
|
|
930
|
+
search,
|
|
931
|
+
slugs,
|
|
932
|
+
namespaces,
|
|
933
|
+
},
|
|
875
934
|
{ abortEarly: false, allowUnknown: true }
|
|
876
935
|
);
|
|
877
936
|
if (error) {
|
|
@@ -881,25 +940,40 @@ class Content {
|
|
|
881
940
|
// Showing warrnings if extra unknown parameters are found
|
|
882
941
|
const {
|
|
883
942
|
error: warrning,
|
|
884
|
-
} = ContentPlatformValidator.
|
|
885
|
-
{
|
|
943
|
+
} = ContentPlatformValidator.getCustomFieldDefinitions().validate(
|
|
944
|
+
{
|
|
945
|
+
pageNo,
|
|
946
|
+
pageSize,
|
|
947
|
+
resources,
|
|
948
|
+
types,
|
|
949
|
+
search,
|
|
950
|
+
slugs,
|
|
951
|
+
namespaces,
|
|
952
|
+
},
|
|
886
953
|
{ abortEarly: false, allowUnknown: false }
|
|
887
954
|
);
|
|
888
955
|
if (warrning) {
|
|
889
956
|
Logger({
|
|
890
957
|
level: "WARN",
|
|
891
|
-
message: `Parameter Validation warrnings for platform > Content >
|
|
958
|
+
message: `Parameter Validation warrnings for platform > Content > getCustomFieldDefinitions \n ${warrning}`,
|
|
892
959
|
});
|
|
893
960
|
}
|
|
894
961
|
|
|
895
962
|
const query_params = {};
|
|
963
|
+
query_params["page_no"] = pageNo;
|
|
964
|
+
query_params["page_size"] = pageSize;
|
|
965
|
+
query_params["resources"] = resources;
|
|
966
|
+
query_params["types"] = types;
|
|
967
|
+
query_params["search"] = search;
|
|
968
|
+
query_params["slugs"] = slugs;
|
|
969
|
+
query_params["namespaces"] = namespaces;
|
|
896
970
|
|
|
897
971
|
const xHeaders = {};
|
|
898
972
|
|
|
899
973
|
const response = await PlatformAPIClient.execute(
|
|
900
974
|
this.config,
|
|
901
975
|
"get",
|
|
902
|
-
`/service/platform/content/
|
|
976
|
+
`/service/platform/content/v2.0/company/${this.config.companyId}/customfields/definition`,
|
|
903
977
|
query_params,
|
|
904
978
|
undefined,
|
|
905
979
|
{ ...xHeaders, ...requestHeaders },
|
|
@@ -913,10 +987,10 @@ class Content {
|
|
|
913
987
|
|
|
914
988
|
const {
|
|
915
989
|
error: res_error,
|
|
916
|
-
} = ContentPlatformModel.
|
|
917
|
-
|
|
918
|
-
allowUnknown: true
|
|
919
|
-
|
|
990
|
+
} = ContentPlatformModel.CustomFieldDefinitionsSchema().validate(
|
|
991
|
+
responseData,
|
|
992
|
+
{ abortEarly: false, allowUnknown: true }
|
|
993
|
+
);
|
|
920
994
|
|
|
921
995
|
if (res_error) {
|
|
922
996
|
if (this.config.options.strictResponseCheck === true) {
|
|
@@ -924,7 +998,7 @@ class Content {
|
|
|
924
998
|
} else {
|
|
925
999
|
Logger({
|
|
926
1000
|
level: "WARN",
|
|
927
|
-
message: `Response Validation Warnings for platform > Content >
|
|
1001
|
+
message: `Response Validation Warnings for platform > Content > getCustomFieldDefinitions \n ${res_error}`,
|
|
928
1002
|
});
|
|
929
1003
|
}
|
|
930
1004
|
}
|
|
@@ -933,23 +1007,20 @@ class Content {
|
|
|
933
1007
|
}
|
|
934
1008
|
|
|
935
1009
|
/**
|
|
936
|
-
* @param {ContentPlatformValidator.
|
|
1010
|
+
* @param {ContentPlatformValidator.GetCustomFieldTypesParam} arg - Arg object
|
|
937
1011
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
938
1012
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
939
|
-
* @returns {Promise<ContentPlatformModel.
|
|
940
|
-
*
|
|
941
|
-
* @
|
|
942
|
-
* @
|
|
943
|
-
* @description: Retrieves a list of custom fields attached to a particular resource by using the resource. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/content/getCustomFields/).
|
|
1013
|
+
* @returns {Promise<ContentPlatformModel.MetafieldTypesSchema>} - Success response
|
|
1014
|
+
* @name getCustomFieldTypes
|
|
1015
|
+
* @summary: Get custom field types
|
|
1016
|
+
* @description: Each custom field and custom field definition has a type, which defines the type of information that it can store. The custom field types have built-in validation. This api will give list of supported custom fields types - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/content/getCustomFieldTypes/).
|
|
944
1017
|
*/
|
|
945
|
-
async
|
|
946
|
-
{
|
|
1018
|
+
async getCustomFieldTypes(
|
|
1019
|
+
{ requestHeaders } = { requestHeaders: {} },
|
|
947
1020
|
{ responseHeaders } = { responseHeaders: false }
|
|
948
1021
|
) {
|
|
949
|
-
const { error } = ContentPlatformValidator.
|
|
950
|
-
{
|
|
951
|
-
resource,
|
|
952
|
-
},
|
|
1022
|
+
const { error } = ContentPlatformValidator.getCustomFieldTypes().validate(
|
|
1023
|
+
{},
|
|
953
1024
|
{ abortEarly: false, allowUnknown: true }
|
|
954
1025
|
);
|
|
955
1026
|
if (error) {
|
|
@@ -959,16 +1030,14 @@ class Content {
|
|
|
959
1030
|
// Showing warrnings if extra unknown parameters are found
|
|
960
1031
|
const {
|
|
961
1032
|
error: warrning,
|
|
962
|
-
} = ContentPlatformValidator.
|
|
963
|
-
{
|
|
964
|
-
resource,
|
|
965
|
-
},
|
|
1033
|
+
} = ContentPlatformValidator.getCustomFieldTypes().validate(
|
|
1034
|
+
{},
|
|
966
1035
|
{ abortEarly: false, allowUnknown: false }
|
|
967
1036
|
);
|
|
968
1037
|
if (warrning) {
|
|
969
1038
|
Logger({
|
|
970
1039
|
level: "WARN",
|
|
971
|
-
message: `Parameter Validation warrnings for platform > Content >
|
|
1040
|
+
message: `Parameter Validation warrnings for platform > Content > getCustomFieldTypes \n ${warrning}`,
|
|
972
1041
|
});
|
|
973
1042
|
}
|
|
974
1043
|
|
|
@@ -979,7 +1048,7 @@ class Content {
|
|
|
979
1048
|
const response = await PlatformAPIClient.execute(
|
|
980
1049
|
this.config,
|
|
981
1050
|
"get",
|
|
982
|
-
`/service/platform/content/v1.0/company/${this.config.companyId}/metafields
|
|
1051
|
+
`/service/platform/content/v1.0/company/${this.config.companyId}/metafields/types`,
|
|
983
1052
|
query_params,
|
|
984
1053
|
undefined,
|
|
985
1054
|
{ ...xHeaders, ...requestHeaders },
|
|
@@ -993,10 +1062,10 @@ class Content {
|
|
|
993
1062
|
|
|
994
1063
|
const {
|
|
995
1064
|
error: res_error,
|
|
996
|
-
} = ContentPlatformModel.
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
);
|
|
1065
|
+
} = ContentPlatformModel.MetafieldTypesSchema().validate(responseData, {
|
|
1066
|
+
abortEarly: false,
|
|
1067
|
+
allowUnknown: true,
|
|
1068
|
+
});
|
|
1000
1069
|
|
|
1001
1070
|
if (res_error) {
|
|
1002
1071
|
if (this.config.options.strictResponseCheck === true) {
|
|
@@ -1004,7 +1073,7 @@ class Content {
|
|
|
1004
1073
|
} else {
|
|
1005
1074
|
Logger({
|
|
1006
1075
|
level: "WARN",
|
|
1007
|
-
message: `Response Validation Warnings for platform > Content >
|
|
1076
|
+
message: `Response Validation Warnings for platform > Content > getCustomFieldTypes \n ${res_error}`,
|
|
1008
1077
|
});
|
|
1009
1078
|
}
|
|
1010
1079
|
}
|
|
@@ -1013,26 +1082,28 @@ class Content {
|
|
|
1013
1082
|
}
|
|
1014
1083
|
|
|
1015
1084
|
/**
|
|
1016
|
-
* @param {ContentPlatformValidator.
|
|
1085
|
+
* @param {ContentPlatformValidator.GetCustomFieldsByResourceSlugParam} arg
|
|
1086
|
+
* - Arg object
|
|
1087
|
+
*
|
|
1017
1088
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1018
1089
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1019
1090
|
* @returns {Promise<ContentPlatformModel.CustomFieldsResponseByResourceIdSchema>}
|
|
1020
1091
|
* - Success response
|
|
1021
1092
|
*
|
|
1022
|
-
* @name
|
|
1023
|
-
* @summary: Get list of custom fields of given resource and resource
|
|
1024
|
-
* @description: Retrieves a list of custom fields attached to a particular resource by using the resource and resource
|
|
1093
|
+
* @name getCustomFieldsByResourceSlug
|
|
1094
|
+
* @summary: Get list of custom fields of given resource and resource slug
|
|
1095
|
+
* @description: Retrieves a list of custom fields attached to a particular resource by using the resource and resource slug. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/content/getCustomFieldsByResourceSlug/).
|
|
1025
1096
|
*/
|
|
1026
|
-
async
|
|
1027
|
-
{ resource,
|
|
1097
|
+
async getCustomFieldsByResourceSlug(
|
|
1098
|
+
{ resource, resourceSlug, requestHeaders } = { requestHeaders: {} },
|
|
1028
1099
|
{ responseHeaders } = { responseHeaders: false }
|
|
1029
1100
|
) {
|
|
1030
1101
|
const {
|
|
1031
1102
|
error,
|
|
1032
|
-
} = ContentPlatformValidator.
|
|
1103
|
+
} = ContentPlatformValidator.getCustomFieldsByResourceSlug().validate(
|
|
1033
1104
|
{
|
|
1034
1105
|
resource,
|
|
1035
|
-
|
|
1106
|
+
resourceSlug,
|
|
1036
1107
|
},
|
|
1037
1108
|
{ abortEarly: false, allowUnknown: true }
|
|
1038
1109
|
);
|
|
@@ -1043,17 +1114,17 @@ class Content {
|
|
|
1043
1114
|
// Showing warrnings if extra unknown parameters are found
|
|
1044
1115
|
const {
|
|
1045
1116
|
error: warrning,
|
|
1046
|
-
} = ContentPlatformValidator.
|
|
1117
|
+
} = ContentPlatformValidator.getCustomFieldsByResourceSlug().validate(
|
|
1047
1118
|
{
|
|
1048
1119
|
resource,
|
|
1049
|
-
|
|
1120
|
+
resourceSlug,
|
|
1050
1121
|
},
|
|
1051
1122
|
{ abortEarly: false, allowUnknown: false }
|
|
1052
1123
|
);
|
|
1053
1124
|
if (warrning) {
|
|
1054
1125
|
Logger({
|
|
1055
1126
|
level: "WARN",
|
|
1056
|
-
message: `Parameter Validation warrnings for platform > Content >
|
|
1127
|
+
message: `Parameter Validation warrnings for platform > Content > getCustomFieldsByResourceSlug \n ${warrning}`,
|
|
1057
1128
|
});
|
|
1058
1129
|
}
|
|
1059
1130
|
|
|
@@ -1064,7 +1135,7 @@ class Content {
|
|
|
1064
1135
|
const response = await PlatformAPIClient.execute(
|
|
1065
1136
|
this.config,
|
|
1066
1137
|
"get",
|
|
1067
|
-
`/service/platform/content/
|
|
1138
|
+
`/service/platform/content/v2.0/company/${this.config.companyId}/customfields/resource/${resource}/${resourceSlug}`,
|
|
1068
1139
|
query_params,
|
|
1069
1140
|
undefined,
|
|
1070
1141
|
{ ...xHeaders, ...requestHeaders },
|
|
@@ -1089,7 +1160,7 @@ class Content {
|
|
|
1089
1160
|
} else {
|
|
1090
1161
|
Logger({
|
|
1091
1162
|
level: "WARN",
|
|
1092
|
-
message: `Response Validation Warnings for platform > Content >
|
|
1163
|
+
message: `Response Validation Warnings for platform > Content > getCustomFieldsByResourceSlug \n ${res_error}`,
|
|
1093
1164
|
});
|
|
1094
1165
|
}
|
|
1095
1166
|
}
|
|
@@ -1098,21 +1169,23 @@ class Content {
|
|
|
1098
1169
|
}
|
|
1099
1170
|
|
|
1100
1171
|
/**
|
|
1101
|
-
* @param {ContentPlatformValidator.
|
|
1172
|
+
* @param {ContentPlatformValidator.GetCustomObjectBySlugParam} arg - Arg object
|
|
1102
1173
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1103
1174
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1104
|
-
* @returns {Promise<ContentPlatformModel.
|
|
1105
|
-
*
|
|
1175
|
+
* @returns {Promise<ContentPlatformModel.CustomObjectBySlugSchema>} -
|
|
1176
|
+
* Success response
|
|
1177
|
+
* @name getCustomObjectBySlug
|
|
1106
1178
|
* @summary: Get custom object details
|
|
1107
|
-
* @description: Details of custom
|
|
1179
|
+
* @description: Details of a custom object entry can be obtained using this endpoint. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/content/getCustomObjectBySlug/).
|
|
1108
1180
|
*/
|
|
1109
|
-
async
|
|
1110
|
-
{
|
|
1181
|
+
async getCustomObjectBySlug(
|
|
1182
|
+
{ definitionSlug, slug, requestHeaders } = { requestHeaders: {} },
|
|
1111
1183
|
{ responseHeaders } = { responseHeaders: false }
|
|
1112
1184
|
) {
|
|
1113
|
-
const { error } = ContentPlatformValidator.
|
|
1185
|
+
const { error } = ContentPlatformValidator.getCustomObjectBySlug().validate(
|
|
1114
1186
|
{
|
|
1115
|
-
|
|
1187
|
+
definitionSlug,
|
|
1188
|
+
slug,
|
|
1116
1189
|
},
|
|
1117
1190
|
{ abortEarly: false, allowUnknown: true }
|
|
1118
1191
|
);
|
|
@@ -1123,16 +1196,17 @@ class Content {
|
|
|
1123
1196
|
// Showing warrnings if extra unknown parameters are found
|
|
1124
1197
|
const {
|
|
1125
1198
|
error: warrning,
|
|
1126
|
-
} = ContentPlatformValidator.
|
|
1199
|
+
} = ContentPlatformValidator.getCustomObjectBySlug().validate(
|
|
1127
1200
|
{
|
|
1128
|
-
|
|
1201
|
+
definitionSlug,
|
|
1202
|
+
slug,
|
|
1129
1203
|
},
|
|
1130
1204
|
{ abortEarly: false, allowUnknown: false }
|
|
1131
1205
|
);
|
|
1132
1206
|
if (warrning) {
|
|
1133
1207
|
Logger({
|
|
1134
1208
|
level: "WARN",
|
|
1135
|
-
message: `Parameter Validation warrnings for platform > Content >
|
|
1209
|
+
message: `Parameter Validation warrnings for platform > Content > getCustomObjectBySlug \n ${warrning}`,
|
|
1136
1210
|
});
|
|
1137
1211
|
}
|
|
1138
1212
|
|
|
@@ -1143,7 +1217,7 @@ class Content {
|
|
|
1143
1217
|
const response = await PlatformAPIClient.execute(
|
|
1144
1218
|
this.config,
|
|
1145
1219
|
"get",
|
|
1146
|
-
`/service/platform/content/
|
|
1220
|
+
`/service/platform/content/v2.0/company/${this.config.companyId}/customobjects/definition/${definitionSlug}/entries/${slug}`,
|
|
1147
1221
|
query_params,
|
|
1148
1222
|
undefined,
|
|
1149
1223
|
{ ...xHeaders, ...requestHeaders },
|
|
@@ -1157,7 +1231,7 @@ class Content {
|
|
|
1157
1231
|
|
|
1158
1232
|
const {
|
|
1159
1233
|
error: res_error,
|
|
1160
|
-
} = ContentPlatformModel.
|
|
1234
|
+
} = ContentPlatformModel.CustomObjectBySlugSchema().validate(responseData, {
|
|
1161
1235
|
abortEarly: false,
|
|
1162
1236
|
allowUnknown: true,
|
|
1163
1237
|
});
|
|
@@ -1168,7 +1242,7 @@ class Content {
|
|
|
1168
1242
|
} else {
|
|
1169
1243
|
Logger({
|
|
1170
1244
|
level: "WARN",
|
|
1171
|
-
message: `Response Validation Warnings for platform > Content >
|
|
1245
|
+
message: `Response Validation Warnings for platform > Content > getCustomObjectBySlug \n ${res_error}`,
|
|
1172
1246
|
});
|
|
1173
1247
|
}
|
|
1174
1248
|
}
|
|
@@ -1177,24 +1251,27 @@ class Content {
|
|
|
1177
1251
|
}
|
|
1178
1252
|
|
|
1179
1253
|
/**
|
|
1180
|
-
* @param {ContentPlatformValidator.
|
|
1254
|
+
* @param {ContentPlatformValidator.GetCustomObjectDefinitionBySlugParam} arg
|
|
1255
|
+
* - Arg object
|
|
1256
|
+
*
|
|
1181
1257
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1182
1258
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1183
|
-
* @returns {Promise<ContentPlatformModel.
|
|
1184
|
-
* Success response
|
|
1185
|
-
*
|
|
1259
|
+
* @returns {Promise<ContentPlatformModel.CustomObjectDefinitionSlugSchema>}
|
|
1260
|
+
* - Success response
|
|
1261
|
+
*
|
|
1262
|
+
* @name getCustomObjectDefinitionBySlug
|
|
1186
1263
|
* @summary: Get custom object definition
|
|
1187
|
-
* @description: Custom object definitions can be fetched using their definition
|
|
1264
|
+
* @description: Custom object definitions can be fetched using their custom object definition slug. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/content/getCustomObjectDefinitionBySlug/).
|
|
1188
1265
|
*/
|
|
1189
|
-
async
|
|
1190
|
-
{
|
|
1266
|
+
async getCustomObjectDefinitionBySlug(
|
|
1267
|
+
{ slug, requestHeaders } = { requestHeaders: {} },
|
|
1191
1268
|
{ responseHeaders } = { responseHeaders: false }
|
|
1192
1269
|
) {
|
|
1193
1270
|
const {
|
|
1194
1271
|
error,
|
|
1195
|
-
} = ContentPlatformValidator.
|
|
1272
|
+
} = ContentPlatformValidator.getCustomObjectDefinitionBySlug().validate(
|
|
1196
1273
|
{
|
|
1197
|
-
|
|
1274
|
+
slug,
|
|
1198
1275
|
},
|
|
1199
1276
|
{ abortEarly: false, allowUnknown: true }
|
|
1200
1277
|
);
|
|
@@ -1205,16 +1282,16 @@ class Content {
|
|
|
1205
1282
|
// Showing warrnings if extra unknown parameters are found
|
|
1206
1283
|
const {
|
|
1207
1284
|
error: warrning,
|
|
1208
|
-
} = ContentPlatformValidator.
|
|
1285
|
+
} = ContentPlatformValidator.getCustomObjectDefinitionBySlug().validate(
|
|
1209
1286
|
{
|
|
1210
|
-
|
|
1287
|
+
slug,
|
|
1211
1288
|
},
|
|
1212
1289
|
{ abortEarly: false, allowUnknown: false }
|
|
1213
1290
|
);
|
|
1214
1291
|
if (warrning) {
|
|
1215
1292
|
Logger({
|
|
1216
1293
|
level: "WARN",
|
|
1217
|
-
message: `Parameter Validation warrnings for platform > Content >
|
|
1294
|
+
message: `Parameter Validation warrnings for platform > Content > getCustomObjectDefinitionBySlug \n ${warrning}`,
|
|
1218
1295
|
});
|
|
1219
1296
|
}
|
|
1220
1297
|
|
|
@@ -1225,7 +1302,7 @@ class Content {
|
|
|
1225
1302
|
const response = await PlatformAPIClient.execute(
|
|
1226
1303
|
this.config,
|
|
1227
1304
|
"get",
|
|
1228
|
-
`/service/platform/content/
|
|
1305
|
+
`/service/platform/content/v2.0/company/${this.config.companyId}/customobjects/definition/${slug}`,
|
|
1229
1306
|
query_params,
|
|
1230
1307
|
undefined,
|
|
1231
1308
|
{ ...xHeaders, ...requestHeaders },
|
|
@@ -1239,7 +1316,7 @@ class Content {
|
|
|
1239
1316
|
|
|
1240
1317
|
const {
|
|
1241
1318
|
error: res_error,
|
|
1242
|
-
} = ContentPlatformModel.
|
|
1319
|
+
} = ContentPlatformModel.CustomObjectDefinitionSlugSchema().validate(
|
|
1243
1320
|
responseData,
|
|
1244
1321
|
{ abortEarly: false, allowUnknown: true }
|
|
1245
1322
|
);
|
|
@@ -1250,7 +1327,7 @@ class Content {
|
|
|
1250
1327
|
} else {
|
|
1251
1328
|
Logger({
|
|
1252
1329
|
level: "WARN",
|
|
1253
|
-
message: `Response Validation Warnings for platform > Content >
|
|
1330
|
+
message: `Response Validation Warnings for platform > Content > getCustomObjectDefinitionBySlug \n ${res_error}`,
|
|
1254
1331
|
});
|
|
1255
1332
|
}
|
|
1256
1333
|
}
|
|
@@ -1314,7 +1391,7 @@ class Content {
|
|
|
1314
1391
|
const response = await PlatformAPIClient.execute(
|
|
1315
1392
|
this.config,
|
|
1316
1393
|
"get",
|
|
1317
|
-
`/service/platform/content/
|
|
1394
|
+
`/service/platform/content/v2.0/company/${this.config.companyId}/customobjects/definition`,
|
|
1318
1395
|
query_params,
|
|
1319
1396
|
undefined,
|
|
1320
1397
|
{ ...xHeaders, ...requestHeaders },
|
|
@@ -1348,23 +1425,27 @@ class Content {
|
|
|
1348
1425
|
}
|
|
1349
1426
|
|
|
1350
1427
|
/**
|
|
1351
|
-
* @param {ContentPlatformValidator.
|
|
1428
|
+
* @param {ContentPlatformValidator.GetCustomObjectsBySlugParam} arg - Arg object
|
|
1352
1429
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1353
1430
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1354
1431
|
* @returns {Promise<ContentPlatformModel.CustomObjectsSchema>} - Success response
|
|
1355
|
-
* @name
|
|
1356
|
-
* @summary: Get list of custom objects
|
|
1357
|
-
* @description: Custom object entries can fetch using this endpoint. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/content/
|
|
1432
|
+
* @name getCustomObjectsBySlug
|
|
1433
|
+
* @summary: Get list of custom objects under a certain custom object definition
|
|
1434
|
+
* @description: Custom object entries can fetch using this endpoint. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/content/getCustomObjectsBySlug/).
|
|
1358
1435
|
*/
|
|
1359
|
-
async
|
|
1360
|
-
{ pageNo, pageSize,
|
|
1436
|
+
async getCustomObjectsBySlug(
|
|
1437
|
+
{ pageNo, pageSize, definitionSlug, requestHeaders } = {
|
|
1438
|
+
requestHeaders: {},
|
|
1439
|
+
},
|
|
1361
1440
|
{ responseHeaders } = { responseHeaders: false }
|
|
1362
1441
|
) {
|
|
1363
|
-
const {
|
|
1442
|
+
const {
|
|
1443
|
+
error,
|
|
1444
|
+
} = ContentPlatformValidator.getCustomObjectsBySlug().validate(
|
|
1364
1445
|
{
|
|
1365
1446
|
pageNo,
|
|
1366
1447
|
pageSize,
|
|
1367
|
-
|
|
1448
|
+
definitionSlug,
|
|
1368
1449
|
},
|
|
1369
1450
|
{ abortEarly: false, allowUnknown: true }
|
|
1370
1451
|
);
|
|
@@ -1375,23 +1456,22 @@ class Content {
|
|
|
1375
1456
|
// Showing warrnings if extra unknown parameters are found
|
|
1376
1457
|
const {
|
|
1377
1458
|
error: warrning,
|
|
1378
|
-
} = ContentPlatformValidator.
|
|
1459
|
+
} = ContentPlatformValidator.getCustomObjectsBySlug().validate(
|
|
1379
1460
|
{
|
|
1380
1461
|
pageNo,
|
|
1381
1462
|
pageSize,
|
|
1382
|
-
|
|
1463
|
+
definitionSlug,
|
|
1383
1464
|
},
|
|
1384
1465
|
{ abortEarly: false, allowUnknown: false }
|
|
1385
1466
|
);
|
|
1386
1467
|
if (warrning) {
|
|
1387
1468
|
Logger({
|
|
1388
1469
|
level: "WARN",
|
|
1389
|
-
message: `Parameter Validation warrnings for platform > Content >
|
|
1470
|
+
message: `Parameter Validation warrnings for platform > Content > getCustomObjectsBySlug \n ${warrning}`,
|
|
1390
1471
|
});
|
|
1391
1472
|
}
|
|
1392
1473
|
|
|
1393
1474
|
const query_params = {};
|
|
1394
|
-
query_params["definition_id"] = definitionId;
|
|
1395
1475
|
query_params["page_no"] = pageNo;
|
|
1396
1476
|
query_params["page_size"] = pageSize;
|
|
1397
1477
|
|
|
@@ -1400,7 +1480,7 @@ class Content {
|
|
|
1400
1480
|
const response = await PlatformAPIClient.execute(
|
|
1401
1481
|
this.config,
|
|
1402
1482
|
"get",
|
|
1403
|
-
`/service/platform/content/
|
|
1483
|
+
`/service/platform/content/v2.0/company/${this.config.companyId}/customobjects/definition/${definitionSlug}/entries`,
|
|
1404
1484
|
query_params,
|
|
1405
1485
|
undefined,
|
|
1406
1486
|
{ ...xHeaders, ...requestHeaders },
|
|
@@ -1425,7 +1505,7 @@ class Content {
|
|
|
1425
1505
|
} else {
|
|
1426
1506
|
Logger({
|
|
1427
1507
|
level: "WARN",
|
|
1428
|
-
message: `Response Validation Warnings for platform > Content >
|
|
1508
|
+
message: `Response Validation Warnings for platform > Content > getCustomObjectsBySlug \n ${res_error}`,
|
|
1429
1509
|
});
|
|
1430
1510
|
}
|
|
1431
1511
|
}
|
|
@@ -1524,7 +1604,7 @@ class Content {
|
|
|
1524
1604
|
* @returns {Promise<ContentPlatformModel.ResourcesSchema>} - Success response
|
|
1525
1605
|
* @name getResources
|
|
1526
1606
|
* @summary: Get resources
|
|
1527
|
-
* @description:
|
|
1607
|
+
* @description: Use this API to retrieve the resources, such as products, collections, customers, selling locations, etc. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/content/getResources/).
|
|
1528
1608
|
*/
|
|
1529
1609
|
async getResources(
|
|
1530
1610
|
{ requestHeaders } = { requestHeaders: {} },
|
|
@@ -1593,25 +1673,27 @@ class Content {
|
|
|
1593
1673
|
}
|
|
1594
1674
|
|
|
1595
1675
|
/**
|
|
1596
|
-
* @param {ContentPlatformValidator.
|
|
1676
|
+
* @param {ContentPlatformValidator.ImportCustomObjectEntriesBySlugParam} arg
|
|
1677
|
+
* - Arg object
|
|
1678
|
+
*
|
|
1597
1679
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1598
1680
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1599
|
-
* @returns {Promise<ContentPlatformModel.
|
|
1681
|
+
* @returns {Promise<ContentPlatformModel.CustomObjectEntryBulkUploadDetails>}
|
|
1600
1682
|
* - Success response
|
|
1601
1683
|
*
|
|
1602
|
-
* @name
|
|
1684
|
+
* @name importCustomObjectEntriesBySlug
|
|
1603
1685
|
* @summary: Bulk custom object entries upload
|
|
1604
|
-
* @description: Custom object bulk import of bulk entries can be performed using this endpoint. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/content/
|
|
1686
|
+
* @description: Custom object bulk import of bulk entries can be performed using this endpoint. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/content/importCustomObjectEntriesBySlug/).
|
|
1605
1687
|
*/
|
|
1606
|
-
async
|
|
1607
|
-
{
|
|
1688
|
+
async importCustomObjectEntriesBySlug(
|
|
1689
|
+
{ slug, body, requestHeaders } = { requestHeaders: {} },
|
|
1608
1690
|
{ responseHeaders } = { responseHeaders: false }
|
|
1609
1691
|
) {
|
|
1610
1692
|
const {
|
|
1611
1693
|
error,
|
|
1612
|
-
} = ContentPlatformValidator.
|
|
1694
|
+
} = ContentPlatformValidator.importCustomObjectEntriesBySlug().validate(
|
|
1613
1695
|
{
|
|
1614
|
-
|
|
1696
|
+
slug,
|
|
1615
1697
|
body,
|
|
1616
1698
|
},
|
|
1617
1699
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -1623,9 +1705,9 @@ class Content {
|
|
|
1623
1705
|
// Showing warrnings if extra unknown parameters are found
|
|
1624
1706
|
const {
|
|
1625
1707
|
error: warrning,
|
|
1626
|
-
} = ContentPlatformValidator.
|
|
1708
|
+
} = ContentPlatformValidator.importCustomObjectEntriesBySlug().validate(
|
|
1627
1709
|
{
|
|
1628
|
-
|
|
1710
|
+
slug,
|
|
1629
1711
|
body,
|
|
1630
1712
|
},
|
|
1631
1713
|
{ abortEarly: false, allowUnknown: false }
|
|
@@ -1633,7 +1715,7 @@ class Content {
|
|
|
1633
1715
|
if (warrning) {
|
|
1634
1716
|
Logger({
|
|
1635
1717
|
level: "WARN",
|
|
1636
|
-
message: `Parameter Validation warrnings for platform > Content >
|
|
1718
|
+
message: `Parameter Validation warrnings for platform > Content > importCustomObjectEntriesBySlug \n ${warrning}`,
|
|
1637
1719
|
});
|
|
1638
1720
|
}
|
|
1639
1721
|
|
|
@@ -1644,7 +1726,7 @@ class Content {
|
|
|
1644
1726
|
const response = await PlatformAPIClient.execute(
|
|
1645
1727
|
this.config,
|
|
1646
1728
|
"post",
|
|
1647
|
-
`/service/platform/content/
|
|
1729
|
+
`/service/platform/content/v2.0/company/${this.config.companyId}/customobjects/definition/${slug}/bulk/upload`,
|
|
1648
1730
|
query_params,
|
|
1649
1731
|
body,
|
|
1650
1732
|
{ ...xHeaders, ...requestHeaders },
|
|
@@ -1658,7 +1740,7 @@ class Content {
|
|
|
1658
1740
|
|
|
1659
1741
|
const {
|
|
1660
1742
|
error: res_error,
|
|
1661
|
-
} = ContentPlatformModel.
|
|
1743
|
+
} = ContentPlatformModel.CustomObjectEntryBulkUploadDetails().validate(
|
|
1662
1744
|
responseData,
|
|
1663
1745
|
{ abortEarly: false, allowUnknown: true }
|
|
1664
1746
|
);
|
|
@@ -1669,7 +1751,7 @@ class Content {
|
|
|
1669
1751
|
} else {
|
|
1670
1752
|
Logger({
|
|
1671
1753
|
level: "WARN",
|
|
1672
|
-
message: `Response Validation Warnings for platform > Content >
|
|
1754
|
+
message: `Response Validation Warnings for platform > Content > importCustomObjectEntriesBySlug \n ${res_error}`,
|
|
1673
1755
|
});
|
|
1674
1756
|
}
|
|
1675
1757
|
}
|
|
@@ -1678,23 +1760,25 @@ class Content {
|
|
|
1678
1760
|
}
|
|
1679
1761
|
|
|
1680
1762
|
/**
|
|
1681
|
-
* @param {ContentPlatformValidator.
|
|
1763
|
+
* @param {ContentPlatformValidator.SampleCustomObjectBulkEntryBySlugParam} arg
|
|
1764
|
+
* - Arg object
|
|
1765
|
+
*
|
|
1682
1766
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1683
1767
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1684
1768
|
* @returns {Promise<string>} - Success response
|
|
1685
|
-
* @name
|
|
1769
|
+
* @name sampleCustomObjectBulkEntryBySlug
|
|
1686
1770
|
* @summary: Download sample for custom object bulk entry
|
|
1687
|
-
* @description: Sample files for custom object bulk import can be obtained from this endpoint. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/content/
|
|
1771
|
+
* @description: Sample files for custom object bulk import can be obtained from this endpoint. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/content/sampleCustomObjectBulkEntryBySlug/).
|
|
1688
1772
|
*/
|
|
1689
|
-
async
|
|
1690
|
-
{
|
|
1773
|
+
async sampleCustomObjectBulkEntryBySlug(
|
|
1774
|
+
{ slug, requestHeaders } = { requestHeaders: {} },
|
|
1691
1775
|
{ responseHeaders } = { responseHeaders: false }
|
|
1692
1776
|
) {
|
|
1693
1777
|
const {
|
|
1694
1778
|
error,
|
|
1695
|
-
} = ContentPlatformValidator.
|
|
1779
|
+
} = ContentPlatformValidator.sampleCustomObjectBulkEntryBySlug().validate(
|
|
1696
1780
|
{
|
|
1697
|
-
|
|
1781
|
+
slug,
|
|
1698
1782
|
},
|
|
1699
1783
|
{ abortEarly: false, allowUnknown: true }
|
|
1700
1784
|
);
|
|
@@ -1705,16 +1789,16 @@ class Content {
|
|
|
1705
1789
|
// Showing warrnings if extra unknown parameters are found
|
|
1706
1790
|
const {
|
|
1707
1791
|
error: warrning,
|
|
1708
|
-
} = ContentPlatformValidator.
|
|
1792
|
+
} = ContentPlatformValidator.sampleCustomObjectBulkEntryBySlug().validate(
|
|
1709
1793
|
{
|
|
1710
|
-
|
|
1794
|
+
slug,
|
|
1711
1795
|
},
|
|
1712
1796
|
{ abortEarly: false, allowUnknown: false }
|
|
1713
1797
|
);
|
|
1714
1798
|
if (warrning) {
|
|
1715
1799
|
Logger({
|
|
1716
1800
|
level: "WARN",
|
|
1717
|
-
message: `Parameter Validation warrnings for platform > Content >
|
|
1801
|
+
message: `Parameter Validation warrnings for platform > Content > sampleCustomObjectBulkEntryBySlug \n ${warrning}`,
|
|
1718
1802
|
});
|
|
1719
1803
|
}
|
|
1720
1804
|
|
|
@@ -1725,7 +1809,7 @@ class Content {
|
|
|
1725
1809
|
const response = await PlatformAPIClient.execute(
|
|
1726
1810
|
this.config,
|
|
1727
1811
|
"get",
|
|
1728
|
-
`/service/platform/content/
|
|
1812
|
+
`/service/platform/content/v2.0/company/${this.config.companyId}/customobjects/definition/${slug}/bulk/sample`,
|
|
1729
1813
|
query_params,
|
|
1730
1814
|
undefined,
|
|
1731
1815
|
{ ...xHeaders, ...requestHeaders },
|
|
@@ -1747,7 +1831,96 @@ class Content {
|
|
|
1747
1831
|
} else {
|
|
1748
1832
|
Logger({
|
|
1749
1833
|
level: "WARN",
|
|
1750
|
-
message: `Response Validation Warnings for platform > Content >
|
|
1834
|
+
message: `Response Validation Warnings for platform > Content > sampleCustomObjectBulkEntryBySlug \n ${res_error}`,
|
|
1835
|
+
});
|
|
1836
|
+
}
|
|
1837
|
+
}
|
|
1838
|
+
|
|
1839
|
+
return response;
|
|
1840
|
+
}
|
|
1841
|
+
|
|
1842
|
+
/**
|
|
1843
|
+
* @param {ContentPlatformValidator.UpdateCustomFieldByResourceSlugParam} arg
|
|
1844
|
+
* - Arg object
|
|
1845
|
+
*
|
|
1846
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1847
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1848
|
+
* @returns {Promise<ContentPlatformModel.CustomFieldsResponseByResourceIdSchema>}
|
|
1849
|
+
* - Success response
|
|
1850
|
+
*
|
|
1851
|
+
* @name updateCustomFieldByResourceSlug
|
|
1852
|
+
* @summary: Update custom field entries for gives resource and resource slug
|
|
1853
|
+
* @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/).
|
|
1854
|
+
*/
|
|
1855
|
+
async updateCustomFieldByResourceSlug(
|
|
1856
|
+
{ resource, resourceSlug, body, requestHeaders } = { requestHeaders: {} },
|
|
1857
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
1858
|
+
) {
|
|
1859
|
+
const {
|
|
1860
|
+
error,
|
|
1861
|
+
} = ContentPlatformValidator.updateCustomFieldByResourceSlug().validate(
|
|
1862
|
+
{
|
|
1863
|
+
resource,
|
|
1864
|
+
resourceSlug,
|
|
1865
|
+
body,
|
|
1866
|
+
},
|
|
1867
|
+
{ abortEarly: false, allowUnknown: true }
|
|
1868
|
+
);
|
|
1869
|
+
if (error) {
|
|
1870
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
1871
|
+
}
|
|
1872
|
+
|
|
1873
|
+
// Showing warrnings if extra unknown parameters are found
|
|
1874
|
+
const {
|
|
1875
|
+
error: warrning,
|
|
1876
|
+
} = ContentPlatformValidator.updateCustomFieldByResourceSlug().validate(
|
|
1877
|
+
{
|
|
1878
|
+
resource,
|
|
1879
|
+
resourceSlug,
|
|
1880
|
+
body,
|
|
1881
|
+
},
|
|
1882
|
+
{ abortEarly: false, allowUnknown: false }
|
|
1883
|
+
);
|
|
1884
|
+
if (warrning) {
|
|
1885
|
+
Logger({
|
|
1886
|
+
level: "WARN",
|
|
1887
|
+
message: `Parameter Validation warrnings for platform > Content > updateCustomFieldByResourceSlug \n ${warrning}`,
|
|
1888
|
+
});
|
|
1889
|
+
}
|
|
1890
|
+
|
|
1891
|
+
const query_params = {};
|
|
1892
|
+
|
|
1893
|
+
const xHeaders = {};
|
|
1894
|
+
|
|
1895
|
+
const response = await PlatformAPIClient.execute(
|
|
1896
|
+
this.config,
|
|
1897
|
+
"put",
|
|
1898
|
+
`/service/platform/content/v2.0/company/${this.config.companyId}/customfields/resource/${resource}/${resourceSlug}`,
|
|
1899
|
+
query_params,
|
|
1900
|
+
body,
|
|
1901
|
+
{ ...xHeaders, ...requestHeaders },
|
|
1902
|
+
{ responseHeaders }
|
|
1903
|
+
);
|
|
1904
|
+
|
|
1905
|
+
let responseData = response;
|
|
1906
|
+
if (responseHeaders) {
|
|
1907
|
+
responseData = response[0];
|
|
1908
|
+
}
|
|
1909
|
+
|
|
1910
|
+
const {
|
|
1911
|
+
error: res_error,
|
|
1912
|
+
} = ContentPlatformModel.CustomFieldsResponseByResourceIdSchema().validate(
|
|
1913
|
+
responseData,
|
|
1914
|
+
{ abortEarly: false, allowUnknown: true }
|
|
1915
|
+
);
|
|
1916
|
+
|
|
1917
|
+
if (res_error) {
|
|
1918
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
1919
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1920
|
+
} else {
|
|
1921
|
+
Logger({
|
|
1922
|
+
level: "WARN",
|
|
1923
|
+
message: `Response Validation Warnings for platform > Content > updateCustomFieldByResourceSlug \n ${res_error}`,
|
|
1751
1924
|
});
|
|
1752
1925
|
}
|
|
1753
1926
|
}
|
|
@@ -1756,25 +1929,31 @@ class Content {
|
|
|
1756
1929
|
}
|
|
1757
1930
|
|
|
1758
1931
|
/**
|
|
1759
|
-
* @param {ContentPlatformValidator.
|
|
1932
|
+
* @param {ContentPlatformValidator.UpdateCustomFieldDefinitionBySlugParam} arg
|
|
1933
|
+
* - Arg object
|
|
1934
|
+
*
|
|
1760
1935
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1761
1936
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1762
1937
|
* @returns {Promise<ContentPlatformModel.CustomFieldDefinitionDetailResSchema>}
|
|
1763
1938
|
* - Success response
|
|
1764
1939
|
*
|
|
1765
|
-
* @name
|
|
1940
|
+
* @name updateCustomFieldDefinitionBySlug
|
|
1766
1941
|
* @summary: Update custom field definition
|
|
1767
|
-
* @description: Custom fields definition can be update using this api, You can update custom field definition name and description. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/content/
|
|
1942
|
+
* @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/).
|
|
1768
1943
|
*/
|
|
1769
|
-
async
|
|
1770
|
-
{
|
|
1944
|
+
async updateCustomFieldDefinitionBySlug(
|
|
1945
|
+
{ slug, resource, namespace, body, requestHeaders } = {
|
|
1946
|
+
requestHeaders: {},
|
|
1947
|
+
},
|
|
1771
1948
|
{ responseHeaders } = { responseHeaders: false }
|
|
1772
1949
|
) {
|
|
1773
1950
|
const {
|
|
1774
1951
|
error,
|
|
1775
|
-
} = ContentPlatformValidator.
|
|
1952
|
+
} = ContentPlatformValidator.updateCustomFieldDefinitionBySlug().validate(
|
|
1776
1953
|
{
|
|
1777
|
-
|
|
1954
|
+
slug,
|
|
1955
|
+
resource,
|
|
1956
|
+
namespace,
|
|
1778
1957
|
body,
|
|
1779
1958
|
},
|
|
1780
1959
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -1786,9 +1965,11 @@ class Content {
|
|
|
1786
1965
|
// Showing warrnings if extra unknown parameters are found
|
|
1787
1966
|
const {
|
|
1788
1967
|
error: warrning,
|
|
1789
|
-
} = ContentPlatformValidator.
|
|
1968
|
+
} = ContentPlatformValidator.updateCustomFieldDefinitionBySlug().validate(
|
|
1790
1969
|
{
|
|
1791
|
-
|
|
1970
|
+
slug,
|
|
1971
|
+
resource,
|
|
1972
|
+
namespace,
|
|
1792
1973
|
body,
|
|
1793
1974
|
},
|
|
1794
1975
|
{ abortEarly: false, allowUnknown: false }
|
|
@@ -1796,7 +1977,7 @@ class Content {
|
|
|
1796
1977
|
if (warrning) {
|
|
1797
1978
|
Logger({
|
|
1798
1979
|
level: "WARN",
|
|
1799
|
-
message: `Parameter Validation warrnings for platform > Content >
|
|
1980
|
+
message: `Parameter Validation warrnings for platform > Content > updateCustomFieldDefinitionBySlug \n ${warrning}`,
|
|
1800
1981
|
});
|
|
1801
1982
|
}
|
|
1802
1983
|
|
|
@@ -1807,7 +1988,7 @@ class Content {
|
|
|
1807
1988
|
const response = await PlatformAPIClient.execute(
|
|
1808
1989
|
this.config,
|
|
1809
1990
|
"put",
|
|
1810
|
-
`/service/platform/content/
|
|
1991
|
+
`/service/platform/content/v2.0/company/${this.config.companyId}/customfields/resource/${resource}/namespace/${namespace}/definition/${slug}`,
|
|
1811
1992
|
query_params,
|
|
1812
1993
|
body,
|
|
1813
1994
|
{ ...xHeaders, ...requestHeaders },
|
|
@@ -1832,7 +2013,7 @@ class Content {
|
|
|
1832
2013
|
} else {
|
|
1833
2014
|
Logger({
|
|
1834
2015
|
level: "WARN",
|
|
1835
|
-
message: `Response Validation Warnings for platform > Content >
|
|
2016
|
+
message: `Response Validation Warnings for platform > Content > updateCustomFieldDefinitionBySlug \n ${res_error}`,
|
|
1836
2017
|
});
|
|
1837
2018
|
}
|
|
1838
2019
|
}
|
|
@@ -1841,21 +2022,25 @@ class Content {
|
|
|
1841
2022
|
}
|
|
1842
2023
|
|
|
1843
2024
|
/**
|
|
1844
|
-
* @param {ContentPlatformValidator.
|
|
2025
|
+
* @param {ContentPlatformValidator.UpdateCustomObjectBySlugParam} arg - Arg object
|
|
1845
2026
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1846
2027
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1847
|
-
* @returns {Promise<ContentPlatformModel.
|
|
1848
|
-
*
|
|
2028
|
+
* @returns {Promise<ContentPlatformModel.CustomObjectBySlugSchema>} -
|
|
2029
|
+
* Success response
|
|
2030
|
+
* @name updateCustomObjectBySlug
|
|
1849
2031
|
* @summary: Update custom object details
|
|
1850
|
-
* @description: Custom object entries can be updated using this endpoint. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/content/
|
|
2032
|
+
* @description: Custom object entries can be updated using this endpoint. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/content/updateCustomObjectBySlug/).
|
|
1851
2033
|
*/
|
|
1852
|
-
async
|
|
1853
|
-
{
|
|
2034
|
+
async updateCustomObjectBySlug(
|
|
2035
|
+
{ definitionSlug, slug, body, requestHeaders } = { requestHeaders: {} },
|
|
1854
2036
|
{ responseHeaders } = { responseHeaders: false }
|
|
1855
2037
|
) {
|
|
1856
|
-
const {
|
|
2038
|
+
const {
|
|
2039
|
+
error,
|
|
2040
|
+
} = ContentPlatformValidator.updateCustomObjectBySlug().validate(
|
|
1857
2041
|
{
|
|
1858
|
-
|
|
2042
|
+
definitionSlug,
|
|
2043
|
+
slug,
|
|
1859
2044
|
body,
|
|
1860
2045
|
},
|
|
1861
2046
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -1867,9 +2052,10 @@ class Content {
|
|
|
1867
2052
|
// Showing warrnings if extra unknown parameters are found
|
|
1868
2053
|
const {
|
|
1869
2054
|
error: warrning,
|
|
1870
|
-
} = ContentPlatformValidator.
|
|
2055
|
+
} = ContentPlatformValidator.updateCustomObjectBySlug().validate(
|
|
1871
2056
|
{
|
|
1872
|
-
|
|
2057
|
+
definitionSlug,
|
|
2058
|
+
slug,
|
|
1873
2059
|
body,
|
|
1874
2060
|
},
|
|
1875
2061
|
{ abortEarly: false, allowUnknown: false }
|
|
@@ -1877,7 +2063,7 @@ class Content {
|
|
|
1877
2063
|
if (warrning) {
|
|
1878
2064
|
Logger({
|
|
1879
2065
|
level: "WARN",
|
|
1880
|
-
message: `Parameter Validation warrnings for platform > Content >
|
|
2066
|
+
message: `Parameter Validation warrnings for platform > Content > updateCustomObjectBySlug \n ${warrning}`,
|
|
1881
2067
|
});
|
|
1882
2068
|
}
|
|
1883
2069
|
|
|
@@ -1888,7 +2074,7 @@ class Content {
|
|
|
1888
2074
|
const response = await PlatformAPIClient.execute(
|
|
1889
2075
|
this.config,
|
|
1890
2076
|
"put",
|
|
1891
|
-
`/service/platform/content/
|
|
2077
|
+
`/service/platform/content/v2.0/company/${this.config.companyId}/customobjects/definition/${definitionSlug}/entries/${slug}`,
|
|
1892
2078
|
query_params,
|
|
1893
2079
|
body,
|
|
1894
2080
|
{ ...xHeaders, ...requestHeaders },
|
|
@@ -1902,7 +2088,7 @@ class Content {
|
|
|
1902
2088
|
|
|
1903
2089
|
const {
|
|
1904
2090
|
error: res_error,
|
|
1905
|
-
} = ContentPlatformModel.
|
|
2091
|
+
} = ContentPlatformModel.CustomObjectBySlugSchema().validate(responseData, {
|
|
1906
2092
|
abortEarly: false,
|
|
1907
2093
|
allowUnknown: true,
|
|
1908
2094
|
});
|
|
@@ -1913,7 +2099,7 @@ class Content {
|
|
|
1913
2099
|
} else {
|
|
1914
2100
|
Logger({
|
|
1915
2101
|
level: "WARN",
|
|
1916
|
-
message: `Response Validation Warnings for platform > Content >
|
|
2102
|
+
message: `Response Validation Warnings for platform > Content > updateCustomObjectBySlug \n ${res_error}`,
|
|
1917
2103
|
});
|
|
1918
2104
|
}
|
|
1919
2105
|
}
|
|
@@ -1922,26 +2108,27 @@ class Content {
|
|
|
1922
2108
|
}
|
|
1923
2109
|
|
|
1924
2110
|
/**
|
|
1925
|
-
* @param {ContentPlatformValidator.
|
|
2111
|
+
* @param {ContentPlatformValidator.UpdateCustomObjectDefinitionBySlugParam} arg
|
|
1926
2112
|
* - Arg object
|
|
1927
2113
|
*
|
|
1928
2114
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1929
2115
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1930
|
-
* @returns {Promise<ContentPlatformModel.
|
|
1931
|
-
* Success response
|
|
1932
|
-
*
|
|
2116
|
+
* @returns {Promise<ContentPlatformModel.CustomObjectDefinitionSlugSchema>}
|
|
2117
|
+
* - Success response
|
|
2118
|
+
*
|
|
2119
|
+
* @name updateCustomObjectDefinitionBySlug
|
|
1933
2120
|
* @summary: Update custom object definition
|
|
1934
|
-
* @description: Custom object definitions can be updated using this endpoint. You can update the name and description of the custom object and add more custom field definitions to the existing custom object. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/content/
|
|
2121
|
+
* @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/).
|
|
1935
2122
|
*/
|
|
1936
|
-
async
|
|
1937
|
-
{
|
|
2123
|
+
async updateCustomObjectDefinitionBySlug(
|
|
2124
|
+
{ slug, body, requestHeaders } = { requestHeaders: {} },
|
|
1938
2125
|
{ responseHeaders } = { responseHeaders: false }
|
|
1939
2126
|
) {
|
|
1940
2127
|
const {
|
|
1941
2128
|
error,
|
|
1942
|
-
} = ContentPlatformValidator.
|
|
2129
|
+
} = ContentPlatformValidator.updateCustomObjectDefinitionBySlug().validate(
|
|
1943
2130
|
{
|
|
1944
|
-
|
|
2131
|
+
slug,
|
|
1945
2132
|
body,
|
|
1946
2133
|
},
|
|
1947
2134
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -1953,9 +2140,9 @@ class Content {
|
|
|
1953
2140
|
// Showing warrnings if extra unknown parameters are found
|
|
1954
2141
|
const {
|
|
1955
2142
|
error: warrning,
|
|
1956
|
-
} = ContentPlatformValidator.
|
|
2143
|
+
} = ContentPlatformValidator.updateCustomObjectDefinitionBySlug().validate(
|
|
1957
2144
|
{
|
|
1958
|
-
|
|
2145
|
+
slug,
|
|
1959
2146
|
body,
|
|
1960
2147
|
},
|
|
1961
2148
|
{ abortEarly: false, allowUnknown: false }
|
|
@@ -1963,7 +2150,7 @@ class Content {
|
|
|
1963
2150
|
if (warrning) {
|
|
1964
2151
|
Logger({
|
|
1965
2152
|
level: "WARN",
|
|
1966
|
-
message: `Parameter Validation warrnings for platform > Content >
|
|
2153
|
+
message: `Parameter Validation warrnings for platform > Content > updateCustomObjectDefinitionBySlug \n ${warrning}`,
|
|
1967
2154
|
});
|
|
1968
2155
|
}
|
|
1969
2156
|
|
|
@@ -1974,7 +2161,7 @@ class Content {
|
|
|
1974
2161
|
const response = await PlatformAPIClient.execute(
|
|
1975
2162
|
this.config,
|
|
1976
2163
|
"put",
|
|
1977
|
-
`/service/platform/content/
|
|
2164
|
+
`/service/platform/content/v2.0/company/${this.config.companyId}/customobjects/definition/${slug}`,
|
|
1978
2165
|
query_params,
|
|
1979
2166
|
body,
|
|
1980
2167
|
{ ...xHeaders, ...requestHeaders },
|
|
@@ -1988,7 +2175,7 @@ class Content {
|
|
|
1988
2175
|
|
|
1989
2176
|
const {
|
|
1990
2177
|
error: res_error,
|
|
1991
|
-
} = ContentPlatformModel.
|
|
2178
|
+
} = ContentPlatformModel.CustomObjectDefinitionSlugSchema().validate(
|
|
1992
2179
|
responseData,
|
|
1993
2180
|
{ abortEarly: false, allowUnknown: true }
|
|
1994
2181
|
);
|
|
@@ -1999,7 +2186,7 @@ class Content {
|
|
|
1999
2186
|
} else {
|
|
2000
2187
|
Logger({
|
|
2001
2188
|
level: "WARN",
|
|
2002
|
-
message: `Response Validation Warnings for platform > Content >
|
|
2189
|
+
message: `Response Validation Warnings for platform > Content > updateCustomObjectDefinitionBySlug \n ${res_error}`,
|
|
2003
2190
|
});
|
|
2004
2191
|
}
|
|
2005
2192
|
}
|