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