@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
|
@@ -16,7 +16,18 @@ class Content {
|
|
|
16
16
|
constructor(_conf) {
|
|
17
17
|
this._conf = _conf;
|
|
18
18
|
this._relativeUrls = {
|
|
19
|
-
|
|
19
|
+
getAllTags: "/service/public/content/tags",
|
|
20
|
+
getAnalyticsTags: "/service/public/content/analytics-tags",
|
|
21
|
+
getBasicDetails: "/service/public/content/basic-details",
|
|
22
|
+
getCredentialsByEntity:
|
|
23
|
+
"/service/public/content/credentials/{entity_type}",
|
|
24
|
+
getCustomPage: "/service/public/content/custom-pages/{slug}",
|
|
25
|
+
getFooterContent: "/service/public/content/footer",
|
|
26
|
+
getHomePageContent: "/service/public/content/home-page",
|
|
27
|
+
getMenuContent: "/service/public/content/menu",
|
|
28
|
+
getMenuContentByType: "/service/public/content/menu/{type}",
|
|
29
|
+
getNavbar: "/service/public/content/navbar",
|
|
30
|
+
getPricingBanner: "/service/public/content/pricing-banner",
|
|
20
31
|
};
|
|
21
32
|
this._urls = Object.entries(this._relativeUrls).reduce(
|
|
22
33
|
(urls, [method, relativeUrl]) => {
|
|
@@ -34,6 +45,262 @@ class Content {
|
|
|
34
45
|
};
|
|
35
46
|
}
|
|
36
47
|
|
|
48
|
+
/**
|
|
49
|
+
* @param {ContentPublicValidator.GetAllTagsParam} arg - Arg object.
|
|
50
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
51
|
+
* @param {import("../PublicAPIClient").Options} - Options
|
|
52
|
+
* @returns {Promise<ContentPublicModel.TagsSchema>} - Success response
|
|
53
|
+
* @name getAllTags
|
|
54
|
+
* @summary: Retrieve tags with injected css/javascript info.
|
|
55
|
+
* @description: Retrieve custom tag with injected css/javascript info. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/public/content/getAllTags/).
|
|
56
|
+
*/
|
|
57
|
+
async getAllTags(
|
|
58
|
+
{ requestHeaders } = { requestHeaders: {} },
|
|
59
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
60
|
+
) {
|
|
61
|
+
let invalidInput = [];
|
|
62
|
+
if (invalidInput.length) {
|
|
63
|
+
const error = new Error();
|
|
64
|
+
error.message = "Missing required field";
|
|
65
|
+
error.details = invalidInput;
|
|
66
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const { error } = ContentPublicValidator.getAllTags().validate(
|
|
70
|
+
{},
|
|
71
|
+
{ abortEarly: false, allowUnknown: true }
|
|
72
|
+
);
|
|
73
|
+
if (error) {
|
|
74
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// Showing warrnings if extra unknown parameters are found
|
|
78
|
+
const { error: warrning } = ContentPublicValidator.getAllTags().validate(
|
|
79
|
+
{},
|
|
80
|
+
{ abortEarly: false, allowUnknown: false }
|
|
81
|
+
);
|
|
82
|
+
if (warrning) {
|
|
83
|
+
Logger({
|
|
84
|
+
level: "WARN",
|
|
85
|
+
message: `Parameter Validation warrnings for public > Content > getAllTags \n ${warrning}`,
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
const query_params = {};
|
|
90
|
+
|
|
91
|
+
const xHeaders = {};
|
|
92
|
+
|
|
93
|
+
const response = await PublicAPIClient.execute(
|
|
94
|
+
this._conf,
|
|
95
|
+
"get",
|
|
96
|
+
constructUrl({
|
|
97
|
+
url: this._urls["getAllTags"],
|
|
98
|
+
params: {},
|
|
99
|
+
}),
|
|
100
|
+
query_params,
|
|
101
|
+
undefined,
|
|
102
|
+
{ ...xHeaders, ...requestHeaders },
|
|
103
|
+
{ responseHeaders }
|
|
104
|
+
);
|
|
105
|
+
|
|
106
|
+
let responseData = response;
|
|
107
|
+
if (responseHeaders) {
|
|
108
|
+
responseData = response[0];
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
const {
|
|
112
|
+
error: res_error,
|
|
113
|
+
} = ContentPublicModel.TagsSchema().validate(responseData, {
|
|
114
|
+
abortEarly: false,
|
|
115
|
+
allowUnknown: true,
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
if (res_error) {
|
|
119
|
+
if (this._conf.options.strictResponseCheck === true) {
|
|
120
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
121
|
+
} else {
|
|
122
|
+
Logger({
|
|
123
|
+
level: "WARN",
|
|
124
|
+
message: `Response Validation Warnings for public > Content > getAllTags \n ${res_error}`,
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
return response;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* @param {ContentPublicValidator.GetAnalyticsTagsParam} arg - Arg object.
|
|
134
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
135
|
+
* @param {import("../PublicAPIClient").Options} - Options
|
|
136
|
+
* @returns {Promise<ContentPublicModel.AnalyticsTagsSchema>} - Success response
|
|
137
|
+
* @name getAnalyticsTags
|
|
138
|
+
* @summary: Get Analytics Tags
|
|
139
|
+
* @description: Retrieve analytics tags. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/public/content/getAnalyticsTags/).
|
|
140
|
+
*/
|
|
141
|
+
async getAnalyticsTags(
|
|
142
|
+
{ requestHeaders } = { requestHeaders: {} },
|
|
143
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
144
|
+
) {
|
|
145
|
+
let invalidInput = [];
|
|
146
|
+
if (invalidInput.length) {
|
|
147
|
+
const error = new Error();
|
|
148
|
+
error.message = "Missing required field";
|
|
149
|
+
error.details = invalidInput;
|
|
150
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
const { error } = ContentPublicValidator.getAnalyticsTags().validate(
|
|
154
|
+
{},
|
|
155
|
+
{ abortEarly: false, allowUnknown: true }
|
|
156
|
+
);
|
|
157
|
+
if (error) {
|
|
158
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
// Showing warrnings if extra unknown parameters are found
|
|
162
|
+
const {
|
|
163
|
+
error: warrning,
|
|
164
|
+
} = ContentPublicValidator.getAnalyticsTags().validate(
|
|
165
|
+
{},
|
|
166
|
+
{ abortEarly: false, allowUnknown: false }
|
|
167
|
+
);
|
|
168
|
+
if (warrning) {
|
|
169
|
+
Logger({
|
|
170
|
+
level: "WARN",
|
|
171
|
+
message: `Parameter Validation warrnings for public > Content > getAnalyticsTags \n ${warrning}`,
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
const query_params = {};
|
|
176
|
+
|
|
177
|
+
const xHeaders = {};
|
|
178
|
+
|
|
179
|
+
const response = await PublicAPIClient.execute(
|
|
180
|
+
this._conf,
|
|
181
|
+
"get",
|
|
182
|
+
constructUrl({
|
|
183
|
+
url: this._urls["getAnalyticsTags"],
|
|
184
|
+
params: {},
|
|
185
|
+
}),
|
|
186
|
+
query_params,
|
|
187
|
+
undefined,
|
|
188
|
+
{ ...xHeaders, ...requestHeaders },
|
|
189
|
+
{ responseHeaders }
|
|
190
|
+
);
|
|
191
|
+
|
|
192
|
+
let responseData = response;
|
|
193
|
+
if (responseHeaders) {
|
|
194
|
+
responseData = response[0];
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
const {
|
|
198
|
+
error: res_error,
|
|
199
|
+
} = ContentPublicModel.AnalyticsTagsSchema().validate(responseData, {
|
|
200
|
+
abortEarly: false,
|
|
201
|
+
allowUnknown: true,
|
|
202
|
+
});
|
|
203
|
+
|
|
204
|
+
if (res_error) {
|
|
205
|
+
if (this._conf.options.strictResponseCheck === true) {
|
|
206
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
207
|
+
} else {
|
|
208
|
+
Logger({
|
|
209
|
+
level: "WARN",
|
|
210
|
+
message: `Response Validation Warnings for public > Content > getAnalyticsTags \n ${res_error}`,
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
return response;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* @param {ContentPublicValidator.GetBasicDetailsParam} arg - Arg object.
|
|
220
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
221
|
+
* @param {import("../PublicAPIClient").Options} - Options
|
|
222
|
+
* @returns {Promise<ContentPublicModel.BasicDetailsPayloadSchema>} - Success response
|
|
223
|
+
* @name getBasicDetails
|
|
224
|
+
* @summary: get basic platform information
|
|
225
|
+
* @description: get basic platform information on Admin panel like Common Settings, Appereance of Authentication Page, Text on Seller Login or Register Page, Business Account Restrictions, Seller Support Details and Footer Details - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/public/content/getBasicDetails/).
|
|
226
|
+
*/
|
|
227
|
+
async getBasicDetails(
|
|
228
|
+
{ requestHeaders } = { requestHeaders: {} },
|
|
229
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
230
|
+
) {
|
|
231
|
+
let invalidInput = [];
|
|
232
|
+
if (invalidInput.length) {
|
|
233
|
+
const error = new Error();
|
|
234
|
+
error.message = "Missing required field";
|
|
235
|
+
error.details = invalidInput;
|
|
236
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
const { error } = ContentPublicValidator.getBasicDetails().validate(
|
|
240
|
+
{},
|
|
241
|
+
{ abortEarly: false, allowUnknown: true }
|
|
242
|
+
);
|
|
243
|
+
if (error) {
|
|
244
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
// Showing warrnings if extra unknown parameters are found
|
|
248
|
+
const {
|
|
249
|
+
error: warrning,
|
|
250
|
+
} = ContentPublicValidator.getBasicDetails().validate(
|
|
251
|
+
{},
|
|
252
|
+
{ abortEarly: false, allowUnknown: false }
|
|
253
|
+
);
|
|
254
|
+
if (warrning) {
|
|
255
|
+
Logger({
|
|
256
|
+
level: "WARN",
|
|
257
|
+
message: `Parameter Validation warrnings for public > Content > getBasicDetails \n ${warrning}`,
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
const query_params = {};
|
|
262
|
+
|
|
263
|
+
const xHeaders = {};
|
|
264
|
+
|
|
265
|
+
const response = await PublicAPIClient.execute(
|
|
266
|
+
this._conf,
|
|
267
|
+
"get",
|
|
268
|
+
constructUrl({
|
|
269
|
+
url: this._urls["getBasicDetails"],
|
|
270
|
+
params: {},
|
|
271
|
+
}),
|
|
272
|
+
query_params,
|
|
273
|
+
undefined,
|
|
274
|
+
{ ...xHeaders, ...requestHeaders },
|
|
275
|
+
{ responseHeaders }
|
|
276
|
+
);
|
|
277
|
+
|
|
278
|
+
let responseData = response;
|
|
279
|
+
if (responseHeaders) {
|
|
280
|
+
responseData = response[0];
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
const {
|
|
284
|
+
error: res_error,
|
|
285
|
+
} = ContentPublicModel.BasicDetailsPayloadSchema().validate(responseData, {
|
|
286
|
+
abortEarly: false,
|
|
287
|
+
allowUnknown: true,
|
|
288
|
+
});
|
|
289
|
+
|
|
290
|
+
if (res_error) {
|
|
291
|
+
if (this._conf.options.strictResponseCheck === true) {
|
|
292
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
293
|
+
} else {
|
|
294
|
+
Logger({
|
|
295
|
+
level: "WARN",
|
|
296
|
+
message: `Response Validation Warnings for public > Content > getBasicDetails \n ${res_error}`,
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
return response;
|
|
302
|
+
}
|
|
303
|
+
|
|
37
304
|
/**
|
|
38
305
|
* @param {ContentPublicValidator.GetCredentialsByEntityParam} arg - Arg object.
|
|
39
306
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
@@ -44,15 +311,15 @@ class Content {
|
|
|
44
311
|
* @description: Get credentials for support system - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/public/content/getCredentialsByEntity/).
|
|
45
312
|
*/
|
|
46
313
|
async getCredentialsByEntity(
|
|
47
|
-
{
|
|
314
|
+
{ entityType, requestHeaders } = { requestHeaders: {} },
|
|
48
315
|
{ responseHeaders } = { responseHeaders: false }
|
|
49
316
|
) {
|
|
50
317
|
let invalidInput = [];
|
|
51
318
|
|
|
52
|
-
if (!
|
|
319
|
+
if (!entityType) {
|
|
53
320
|
invalidInput.push({
|
|
54
|
-
message: `The '
|
|
55
|
-
path: ["
|
|
321
|
+
message: `The 'entityType' field is required.`,
|
|
322
|
+
path: ["entityType"],
|
|
56
323
|
});
|
|
57
324
|
}
|
|
58
325
|
if (invalidInput.length) {
|
|
@@ -63,7 +330,7 @@ class Content {
|
|
|
63
330
|
}
|
|
64
331
|
|
|
65
332
|
const { error } = ContentPublicValidator.getCredentialsByEntity().validate(
|
|
66
|
-
{
|
|
333
|
+
{ entityType },
|
|
67
334
|
{ abortEarly: false, allowUnknown: true }
|
|
68
335
|
);
|
|
69
336
|
if (error) {
|
|
@@ -74,7 +341,7 @@ class Content {
|
|
|
74
341
|
const {
|
|
75
342
|
error: warrning,
|
|
76
343
|
} = ContentPublicValidator.getCredentialsByEntity().validate(
|
|
77
|
-
{
|
|
344
|
+
{ entityType },
|
|
78
345
|
{ abortEarly: false, allowUnknown: false }
|
|
79
346
|
);
|
|
80
347
|
if (warrning) {
|
|
@@ -93,7 +360,7 @@ class Content {
|
|
|
93
360
|
"get",
|
|
94
361
|
constructUrl({
|
|
95
362
|
url: this._urls["getCredentialsByEntity"],
|
|
96
|
-
params: {
|
|
363
|
+
params: { entityType },
|
|
97
364
|
}),
|
|
98
365
|
query_params,
|
|
99
366
|
undefined,
|
|
@@ -126,6 +393,626 @@ class Content {
|
|
|
126
393
|
|
|
127
394
|
return response;
|
|
128
395
|
}
|
|
396
|
+
|
|
397
|
+
/**
|
|
398
|
+
* @param {ContentPublicValidator.GetCustomPageParam} arg - Arg object.
|
|
399
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
400
|
+
* @param {import("../PublicAPIClient").Options} - Options
|
|
401
|
+
* @returns {Promise<ContentPublicModel.CustomPageBySlugSchema>} - Success response
|
|
402
|
+
* @name getCustomPage
|
|
403
|
+
* @summary: Retrieve info for custom page.
|
|
404
|
+
* @description: Retrieve info of custom pagee to develop and manage custom webpages. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/public/content/getCustomPage/).
|
|
405
|
+
*/
|
|
406
|
+
async getCustomPage(
|
|
407
|
+
{ slug, requestHeaders } = { requestHeaders: {} },
|
|
408
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
409
|
+
) {
|
|
410
|
+
let invalidInput = [];
|
|
411
|
+
|
|
412
|
+
if (!slug) {
|
|
413
|
+
invalidInput.push({
|
|
414
|
+
message: `The 'slug' field is required.`,
|
|
415
|
+
path: ["slug"],
|
|
416
|
+
});
|
|
417
|
+
}
|
|
418
|
+
if (invalidInput.length) {
|
|
419
|
+
const error = new Error();
|
|
420
|
+
error.message = "Missing required field";
|
|
421
|
+
error.details = invalidInput;
|
|
422
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
const { error } = ContentPublicValidator.getCustomPage().validate(
|
|
426
|
+
{ slug },
|
|
427
|
+
{ abortEarly: false, allowUnknown: true }
|
|
428
|
+
);
|
|
429
|
+
if (error) {
|
|
430
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
// Showing warrnings if extra unknown parameters are found
|
|
434
|
+
const { error: warrning } = ContentPublicValidator.getCustomPage().validate(
|
|
435
|
+
{ slug },
|
|
436
|
+
{ abortEarly: false, allowUnknown: false }
|
|
437
|
+
);
|
|
438
|
+
if (warrning) {
|
|
439
|
+
Logger({
|
|
440
|
+
level: "WARN",
|
|
441
|
+
message: `Parameter Validation warrnings for public > Content > getCustomPage \n ${warrning}`,
|
|
442
|
+
});
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
const query_params = {};
|
|
446
|
+
|
|
447
|
+
const xHeaders = {};
|
|
448
|
+
|
|
449
|
+
const response = await PublicAPIClient.execute(
|
|
450
|
+
this._conf,
|
|
451
|
+
"get",
|
|
452
|
+
constructUrl({
|
|
453
|
+
url: this._urls["getCustomPage"],
|
|
454
|
+
params: { slug },
|
|
455
|
+
}),
|
|
456
|
+
query_params,
|
|
457
|
+
undefined,
|
|
458
|
+
{ ...xHeaders, ...requestHeaders },
|
|
459
|
+
{ responseHeaders }
|
|
460
|
+
);
|
|
461
|
+
|
|
462
|
+
let responseData = response;
|
|
463
|
+
if (responseHeaders) {
|
|
464
|
+
responseData = response[0];
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
const {
|
|
468
|
+
error: res_error,
|
|
469
|
+
} = ContentPublicModel.CustomPageBySlugSchema().validate(responseData, {
|
|
470
|
+
abortEarly: false,
|
|
471
|
+
allowUnknown: true,
|
|
472
|
+
});
|
|
473
|
+
|
|
474
|
+
if (res_error) {
|
|
475
|
+
if (this._conf.options.strictResponseCheck === true) {
|
|
476
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
477
|
+
} else {
|
|
478
|
+
Logger({
|
|
479
|
+
level: "WARN",
|
|
480
|
+
message: `Response Validation Warnings for public > Content > getCustomPage \n ${res_error}`,
|
|
481
|
+
});
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
return response;
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
/**
|
|
489
|
+
* @param {ContentPublicValidator.GetFooterContentParam} arg - Arg object.
|
|
490
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
491
|
+
* @param {import("../PublicAPIClient").Options} - Options
|
|
492
|
+
* @returns {Promise<ContentPublicModel.FooterSchema>} - Success response
|
|
493
|
+
* @name getFooterContent
|
|
494
|
+
* @summary: Get Footer Content
|
|
495
|
+
* @description: Retrieve footer content. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/public/content/getFooterContent/).
|
|
496
|
+
*/
|
|
497
|
+
async getFooterContent(
|
|
498
|
+
{ requestHeaders } = { requestHeaders: {} },
|
|
499
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
500
|
+
) {
|
|
501
|
+
let invalidInput = [];
|
|
502
|
+
if (invalidInput.length) {
|
|
503
|
+
const error = new Error();
|
|
504
|
+
error.message = "Missing required field";
|
|
505
|
+
error.details = invalidInput;
|
|
506
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
const { error } = ContentPublicValidator.getFooterContent().validate(
|
|
510
|
+
{},
|
|
511
|
+
{ abortEarly: false, allowUnknown: true }
|
|
512
|
+
);
|
|
513
|
+
if (error) {
|
|
514
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
// Showing warrnings if extra unknown parameters are found
|
|
518
|
+
const {
|
|
519
|
+
error: warrning,
|
|
520
|
+
} = ContentPublicValidator.getFooterContent().validate(
|
|
521
|
+
{},
|
|
522
|
+
{ abortEarly: false, allowUnknown: false }
|
|
523
|
+
);
|
|
524
|
+
if (warrning) {
|
|
525
|
+
Logger({
|
|
526
|
+
level: "WARN",
|
|
527
|
+
message: `Parameter Validation warrnings for public > Content > getFooterContent \n ${warrning}`,
|
|
528
|
+
});
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
const query_params = {};
|
|
532
|
+
|
|
533
|
+
const xHeaders = {};
|
|
534
|
+
|
|
535
|
+
const response = await PublicAPIClient.execute(
|
|
536
|
+
this._conf,
|
|
537
|
+
"get",
|
|
538
|
+
constructUrl({
|
|
539
|
+
url: this._urls["getFooterContent"],
|
|
540
|
+
params: {},
|
|
541
|
+
}),
|
|
542
|
+
query_params,
|
|
543
|
+
undefined,
|
|
544
|
+
{ ...xHeaders, ...requestHeaders },
|
|
545
|
+
{ responseHeaders }
|
|
546
|
+
);
|
|
547
|
+
|
|
548
|
+
let responseData = response;
|
|
549
|
+
if (responseHeaders) {
|
|
550
|
+
responseData = response[0];
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
const {
|
|
554
|
+
error: res_error,
|
|
555
|
+
} = ContentPublicModel.FooterSchema().validate(responseData, {
|
|
556
|
+
abortEarly: false,
|
|
557
|
+
allowUnknown: true,
|
|
558
|
+
});
|
|
559
|
+
|
|
560
|
+
if (res_error) {
|
|
561
|
+
if (this._conf.options.strictResponseCheck === true) {
|
|
562
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
563
|
+
} else {
|
|
564
|
+
Logger({
|
|
565
|
+
level: "WARN",
|
|
566
|
+
message: `Response Validation Warnings for public > Content > getFooterContent \n ${res_error}`,
|
|
567
|
+
});
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
return response;
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
/**
|
|
575
|
+
* @param {ContentPublicValidator.GetHomePageContentParam} arg - Arg object.
|
|
576
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
577
|
+
* @param {import("../PublicAPIClient").Options} - Options
|
|
578
|
+
* @returns {Promise<ContentPublicModel.HomePageContentSchema>} - Success response
|
|
579
|
+
* @name getHomePageContent
|
|
580
|
+
* @summary: Get Home Page Content
|
|
581
|
+
* @description: Retrieve home page content for a specific page type. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/public/content/getHomePageContent/).
|
|
582
|
+
*/
|
|
583
|
+
async getHomePageContent(
|
|
584
|
+
{ pageType, requestHeaders } = { requestHeaders: {} },
|
|
585
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
586
|
+
) {
|
|
587
|
+
let invalidInput = [];
|
|
588
|
+
|
|
589
|
+
if (!pageType) {
|
|
590
|
+
invalidInput.push({
|
|
591
|
+
message: `The 'pageType' field is required.`,
|
|
592
|
+
path: ["pageType"],
|
|
593
|
+
});
|
|
594
|
+
}
|
|
595
|
+
if (invalidInput.length) {
|
|
596
|
+
const error = new Error();
|
|
597
|
+
error.message = "Missing required field";
|
|
598
|
+
error.details = invalidInput;
|
|
599
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
const { error } = ContentPublicValidator.getHomePageContent().validate(
|
|
603
|
+
{ pageType },
|
|
604
|
+
{ abortEarly: false, allowUnknown: true }
|
|
605
|
+
);
|
|
606
|
+
if (error) {
|
|
607
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
// Showing warrnings if extra unknown parameters are found
|
|
611
|
+
const {
|
|
612
|
+
error: warrning,
|
|
613
|
+
} = ContentPublicValidator.getHomePageContent().validate(
|
|
614
|
+
{ pageType },
|
|
615
|
+
{ abortEarly: false, allowUnknown: false }
|
|
616
|
+
);
|
|
617
|
+
if (warrning) {
|
|
618
|
+
Logger({
|
|
619
|
+
level: "WARN",
|
|
620
|
+
message: `Parameter Validation warrnings for public > Content > getHomePageContent \n ${warrning}`,
|
|
621
|
+
});
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
const query_params = {};
|
|
625
|
+
query_params["page_type"] = pageType;
|
|
626
|
+
|
|
627
|
+
const xHeaders = {};
|
|
628
|
+
|
|
629
|
+
const response = await PublicAPIClient.execute(
|
|
630
|
+
this._conf,
|
|
631
|
+
"get",
|
|
632
|
+
constructUrl({
|
|
633
|
+
url: this._urls["getHomePageContent"],
|
|
634
|
+
params: {},
|
|
635
|
+
}),
|
|
636
|
+
query_params,
|
|
637
|
+
undefined,
|
|
638
|
+
{ ...xHeaders, ...requestHeaders },
|
|
639
|
+
{ responseHeaders }
|
|
640
|
+
);
|
|
641
|
+
|
|
642
|
+
let responseData = response;
|
|
643
|
+
if (responseHeaders) {
|
|
644
|
+
responseData = response[0];
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
const {
|
|
648
|
+
error: res_error,
|
|
649
|
+
} = ContentPublicModel.HomePageContentSchema().validate(responseData, {
|
|
650
|
+
abortEarly: false,
|
|
651
|
+
allowUnknown: true,
|
|
652
|
+
});
|
|
653
|
+
|
|
654
|
+
if (res_error) {
|
|
655
|
+
if (this._conf.options.strictResponseCheck === true) {
|
|
656
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
657
|
+
} else {
|
|
658
|
+
Logger({
|
|
659
|
+
level: "WARN",
|
|
660
|
+
message: `Response Validation Warnings for public > Content > getHomePageContent \n ${res_error}`,
|
|
661
|
+
});
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
return response;
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
/**
|
|
669
|
+
* @param {ContentPublicValidator.GetMenuContentParam} arg - Arg object.
|
|
670
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
671
|
+
* @param {import("../PublicAPIClient").Options} - Options
|
|
672
|
+
* @returns {Promise<ContentPublicModel.MenusSchema>} - Success response
|
|
673
|
+
* @name getMenuContent
|
|
674
|
+
* @summary: Get desktop menu content
|
|
675
|
+
* @description: Retrieves the desktop menu content. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/public/content/getMenuContent/).
|
|
676
|
+
*/
|
|
677
|
+
async getMenuContent(
|
|
678
|
+
{ requestHeaders } = { requestHeaders: {} },
|
|
679
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
680
|
+
) {
|
|
681
|
+
let invalidInput = [];
|
|
682
|
+
if (invalidInput.length) {
|
|
683
|
+
const error = new Error();
|
|
684
|
+
error.message = "Missing required field";
|
|
685
|
+
error.details = invalidInput;
|
|
686
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
const { error } = ContentPublicValidator.getMenuContent().validate(
|
|
690
|
+
{},
|
|
691
|
+
{ abortEarly: false, allowUnknown: true }
|
|
692
|
+
);
|
|
693
|
+
if (error) {
|
|
694
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
// Showing warrnings if extra unknown parameters are found
|
|
698
|
+
const {
|
|
699
|
+
error: warrning,
|
|
700
|
+
} = ContentPublicValidator.getMenuContent().validate(
|
|
701
|
+
{},
|
|
702
|
+
{ abortEarly: false, allowUnknown: false }
|
|
703
|
+
);
|
|
704
|
+
if (warrning) {
|
|
705
|
+
Logger({
|
|
706
|
+
level: "WARN",
|
|
707
|
+
message: `Parameter Validation warrnings for public > Content > getMenuContent \n ${warrning}`,
|
|
708
|
+
});
|
|
709
|
+
}
|
|
710
|
+
|
|
711
|
+
const query_params = {};
|
|
712
|
+
|
|
713
|
+
const xHeaders = {};
|
|
714
|
+
|
|
715
|
+
const response = await PublicAPIClient.execute(
|
|
716
|
+
this._conf,
|
|
717
|
+
"get",
|
|
718
|
+
constructUrl({
|
|
719
|
+
url: this._urls["getMenuContent"],
|
|
720
|
+
params: {},
|
|
721
|
+
}),
|
|
722
|
+
query_params,
|
|
723
|
+
undefined,
|
|
724
|
+
{ ...xHeaders, ...requestHeaders },
|
|
725
|
+
{ responseHeaders }
|
|
726
|
+
);
|
|
727
|
+
|
|
728
|
+
let responseData = response;
|
|
729
|
+
if (responseHeaders) {
|
|
730
|
+
responseData = response[0];
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
const {
|
|
734
|
+
error: res_error,
|
|
735
|
+
} = ContentPublicModel.MenusSchema().validate(responseData, {
|
|
736
|
+
abortEarly: false,
|
|
737
|
+
allowUnknown: true,
|
|
738
|
+
});
|
|
739
|
+
|
|
740
|
+
if (res_error) {
|
|
741
|
+
if (this._conf.options.strictResponseCheck === true) {
|
|
742
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
743
|
+
} else {
|
|
744
|
+
Logger({
|
|
745
|
+
level: "WARN",
|
|
746
|
+
message: `Response Validation Warnings for public > Content > getMenuContent \n ${res_error}`,
|
|
747
|
+
});
|
|
748
|
+
}
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
return response;
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
/**
|
|
755
|
+
* @param {ContentPublicValidator.GetMenuContentByTypeParam} arg - Arg object.
|
|
756
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
757
|
+
* @param {import("../PublicAPIClient").Options} - Options
|
|
758
|
+
* @returns {Promise<ContentPublicModel.MenuTypeSchema>} - Success response
|
|
759
|
+
* @name getMenuContentByType
|
|
760
|
+
* @summary: Get desktop menu content
|
|
761
|
+
* @description: Retrieves the desktop menu content. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/public/content/getMenuContentByType/).
|
|
762
|
+
*/
|
|
763
|
+
async getMenuContentByType(
|
|
764
|
+
{ type, requestHeaders } = { requestHeaders: {} },
|
|
765
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
766
|
+
) {
|
|
767
|
+
let invalidInput = [];
|
|
768
|
+
|
|
769
|
+
if (!type) {
|
|
770
|
+
invalidInput.push({
|
|
771
|
+
message: `The 'type' field is required.`,
|
|
772
|
+
path: ["type"],
|
|
773
|
+
});
|
|
774
|
+
}
|
|
775
|
+
if (invalidInput.length) {
|
|
776
|
+
const error = new Error();
|
|
777
|
+
error.message = "Missing required field";
|
|
778
|
+
error.details = invalidInput;
|
|
779
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
780
|
+
}
|
|
781
|
+
|
|
782
|
+
const { error } = ContentPublicValidator.getMenuContentByType().validate(
|
|
783
|
+
{ type },
|
|
784
|
+
{ abortEarly: false, allowUnknown: true }
|
|
785
|
+
);
|
|
786
|
+
if (error) {
|
|
787
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
788
|
+
}
|
|
789
|
+
|
|
790
|
+
// Showing warrnings if extra unknown parameters are found
|
|
791
|
+
const {
|
|
792
|
+
error: warrning,
|
|
793
|
+
} = ContentPublicValidator.getMenuContentByType().validate(
|
|
794
|
+
{ type },
|
|
795
|
+
{ abortEarly: false, allowUnknown: false }
|
|
796
|
+
);
|
|
797
|
+
if (warrning) {
|
|
798
|
+
Logger({
|
|
799
|
+
level: "WARN",
|
|
800
|
+
message: `Parameter Validation warrnings for public > Content > getMenuContentByType \n ${warrning}`,
|
|
801
|
+
});
|
|
802
|
+
}
|
|
803
|
+
|
|
804
|
+
const query_params = {};
|
|
805
|
+
|
|
806
|
+
const xHeaders = {};
|
|
807
|
+
|
|
808
|
+
const response = await PublicAPIClient.execute(
|
|
809
|
+
this._conf,
|
|
810
|
+
"get",
|
|
811
|
+
constructUrl({
|
|
812
|
+
url: this._urls["getMenuContentByType"],
|
|
813
|
+
params: { type },
|
|
814
|
+
}),
|
|
815
|
+
query_params,
|
|
816
|
+
undefined,
|
|
817
|
+
{ ...xHeaders, ...requestHeaders },
|
|
818
|
+
{ responseHeaders }
|
|
819
|
+
);
|
|
820
|
+
|
|
821
|
+
let responseData = response;
|
|
822
|
+
if (responseHeaders) {
|
|
823
|
+
responseData = response[0];
|
|
824
|
+
}
|
|
825
|
+
|
|
826
|
+
const {
|
|
827
|
+
error: res_error,
|
|
828
|
+
} = ContentPublicModel.MenuTypeSchema().validate(responseData, {
|
|
829
|
+
abortEarly: false,
|
|
830
|
+
allowUnknown: true,
|
|
831
|
+
});
|
|
832
|
+
|
|
833
|
+
if (res_error) {
|
|
834
|
+
if (this._conf.options.strictResponseCheck === true) {
|
|
835
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
836
|
+
} else {
|
|
837
|
+
Logger({
|
|
838
|
+
level: "WARN",
|
|
839
|
+
message: `Response Validation Warnings for public > Content > getMenuContentByType \n ${res_error}`,
|
|
840
|
+
});
|
|
841
|
+
}
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
return response;
|
|
845
|
+
}
|
|
846
|
+
|
|
847
|
+
/**
|
|
848
|
+
* @param {ContentPublicValidator.GetNavbarParam} arg - Arg object.
|
|
849
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
850
|
+
* @param {import("../PublicAPIClient").Options} - Options
|
|
851
|
+
* @returns {Promise<ContentPublicModel.NavbarSchema>} - Success response
|
|
852
|
+
* @name getNavbar
|
|
853
|
+
* @summary: Get Navbar
|
|
854
|
+
* @description: Retrieve navbar information. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/public/content/getNavbar/).
|
|
855
|
+
*/
|
|
856
|
+
async getNavbar(
|
|
857
|
+
{ requestHeaders } = { requestHeaders: {} },
|
|
858
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
859
|
+
) {
|
|
860
|
+
let invalidInput = [];
|
|
861
|
+
if (invalidInput.length) {
|
|
862
|
+
const error = new Error();
|
|
863
|
+
error.message = "Missing required field";
|
|
864
|
+
error.details = invalidInput;
|
|
865
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
866
|
+
}
|
|
867
|
+
|
|
868
|
+
const { error } = ContentPublicValidator.getNavbar().validate(
|
|
869
|
+
{},
|
|
870
|
+
{ abortEarly: false, allowUnknown: true }
|
|
871
|
+
);
|
|
872
|
+
if (error) {
|
|
873
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
874
|
+
}
|
|
875
|
+
|
|
876
|
+
// Showing warrnings if extra unknown parameters are found
|
|
877
|
+
const { error: warrning } = ContentPublicValidator.getNavbar().validate(
|
|
878
|
+
{},
|
|
879
|
+
{ abortEarly: false, allowUnknown: false }
|
|
880
|
+
);
|
|
881
|
+
if (warrning) {
|
|
882
|
+
Logger({
|
|
883
|
+
level: "WARN",
|
|
884
|
+
message: `Parameter Validation warrnings for public > Content > getNavbar \n ${warrning}`,
|
|
885
|
+
});
|
|
886
|
+
}
|
|
887
|
+
|
|
888
|
+
const query_params = {};
|
|
889
|
+
|
|
890
|
+
const xHeaders = {};
|
|
891
|
+
|
|
892
|
+
const response = await PublicAPIClient.execute(
|
|
893
|
+
this._conf,
|
|
894
|
+
"get",
|
|
895
|
+
constructUrl({
|
|
896
|
+
url: this._urls["getNavbar"],
|
|
897
|
+
params: {},
|
|
898
|
+
}),
|
|
899
|
+
query_params,
|
|
900
|
+
undefined,
|
|
901
|
+
{ ...xHeaders, ...requestHeaders },
|
|
902
|
+
{ responseHeaders }
|
|
903
|
+
);
|
|
904
|
+
|
|
905
|
+
let responseData = response;
|
|
906
|
+
if (responseHeaders) {
|
|
907
|
+
responseData = response[0];
|
|
908
|
+
}
|
|
909
|
+
|
|
910
|
+
const {
|
|
911
|
+
error: res_error,
|
|
912
|
+
} = ContentPublicModel.NavbarSchema().validate(responseData, {
|
|
913
|
+
abortEarly: false,
|
|
914
|
+
allowUnknown: true,
|
|
915
|
+
});
|
|
916
|
+
|
|
917
|
+
if (res_error) {
|
|
918
|
+
if (this._conf.options.strictResponseCheck === true) {
|
|
919
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
920
|
+
} else {
|
|
921
|
+
Logger({
|
|
922
|
+
level: "WARN",
|
|
923
|
+
message: `Response Validation Warnings for public > Content > getNavbar \n ${res_error}`,
|
|
924
|
+
});
|
|
925
|
+
}
|
|
926
|
+
}
|
|
927
|
+
|
|
928
|
+
return response;
|
|
929
|
+
}
|
|
930
|
+
|
|
931
|
+
/**
|
|
932
|
+
* @param {ContentPublicValidator.GetPricingBannerParam} arg - Arg object.
|
|
933
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
934
|
+
* @param {import("../PublicAPIClient").Options} - Options
|
|
935
|
+
* @returns {Promise<ContentPublicModel.PricingBannerSchema>} - Success response
|
|
936
|
+
* @name getPricingBanner
|
|
937
|
+
* @summary: Get Pricing Banner
|
|
938
|
+
* @description: Retrieve pricing banner information. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/public/content/getPricingBanner/).
|
|
939
|
+
*/
|
|
940
|
+
async getPricingBanner(
|
|
941
|
+
{ requestHeaders } = { requestHeaders: {} },
|
|
942
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
943
|
+
) {
|
|
944
|
+
let invalidInput = [];
|
|
945
|
+
if (invalidInput.length) {
|
|
946
|
+
const error = new Error();
|
|
947
|
+
error.message = "Missing required field";
|
|
948
|
+
error.details = invalidInput;
|
|
949
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
950
|
+
}
|
|
951
|
+
|
|
952
|
+
const { error } = ContentPublicValidator.getPricingBanner().validate(
|
|
953
|
+
{},
|
|
954
|
+
{ abortEarly: false, allowUnknown: true }
|
|
955
|
+
);
|
|
956
|
+
if (error) {
|
|
957
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
958
|
+
}
|
|
959
|
+
|
|
960
|
+
// Showing warrnings if extra unknown parameters are found
|
|
961
|
+
const {
|
|
962
|
+
error: warrning,
|
|
963
|
+
} = ContentPublicValidator.getPricingBanner().validate(
|
|
964
|
+
{},
|
|
965
|
+
{ abortEarly: false, allowUnknown: false }
|
|
966
|
+
);
|
|
967
|
+
if (warrning) {
|
|
968
|
+
Logger({
|
|
969
|
+
level: "WARN",
|
|
970
|
+
message: `Parameter Validation warrnings for public > Content > getPricingBanner \n ${warrning}`,
|
|
971
|
+
});
|
|
972
|
+
}
|
|
973
|
+
|
|
974
|
+
const query_params = {};
|
|
975
|
+
|
|
976
|
+
const xHeaders = {};
|
|
977
|
+
|
|
978
|
+
const response = await PublicAPIClient.execute(
|
|
979
|
+
this._conf,
|
|
980
|
+
"get",
|
|
981
|
+
constructUrl({
|
|
982
|
+
url: this._urls["getPricingBanner"],
|
|
983
|
+
params: {},
|
|
984
|
+
}),
|
|
985
|
+
query_params,
|
|
986
|
+
undefined,
|
|
987
|
+
{ ...xHeaders, ...requestHeaders },
|
|
988
|
+
{ responseHeaders }
|
|
989
|
+
);
|
|
990
|
+
|
|
991
|
+
let responseData = response;
|
|
992
|
+
if (responseHeaders) {
|
|
993
|
+
responseData = response[0];
|
|
994
|
+
}
|
|
995
|
+
|
|
996
|
+
const {
|
|
997
|
+
error: res_error,
|
|
998
|
+
} = ContentPublicModel.PricingBannerSchema().validate(responseData, {
|
|
999
|
+
abortEarly: false,
|
|
1000
|
+
allowUnknown: true,
|
|
1001
|
+
});
|
|
1002
|
+
|
|
1003
|
+
if (res_error) {
|
|
1004
|
+
if (this._conf.options.strictResponseCheck === true) {
|
|
1005
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1006
|
+
} else {
|
|
1007
|
+
Logger({
|
|
1008
|
+
level: "WARN",
|
|
1009
|
+
message: `Response Validation Warnings for public > Content > getPricingBanner \n ${res_error}`,
|
|
1010
|
+
});
|
|
1011
|
+
}
|
|
1012
|
+
}
|
|
1013
|
+
|
|
1014
|
+
return response;
|
|
1015
|
+
}
|
|
129
1016
|
}
|
|
130
1017
|
|
|
131
1018
|
module.exports = Content;
|