@gofynd/fdk-client-javascript 1.4.15-beta.1 → 1.4.15-beta.10
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 +2 -2
- package/application.d.ts +1 -2
- package/application.js +2 -3
- package/index.d.ts +1 -2
- package/index.js +7 -1
- package/package.json +2 -3
- package/sdk/application/ApplicationClient.js +0 -18
- package/sdk/application/Cart/CartApplicationClient.d.ts +55 -90
- package/sdk/application/Cart/CartApplicationClient.js +60 -1185
- package/sdk/application/Catalog/CatalogApplicationClient.d.ts +80 -142
- package/sdk/application/Catalog/CatalogApplicationClient.js +148 -1293
- package/sdk/application/Common/CommonApplicationClient.d.ts +4 -8
- package/sdk/application/Common/CommonApplicationClient.js +5 -89
- package/sdk/application/Communication/CommunicationApplicationClient.d.ts +6 -19
- package/sdk/application/Communication/CommunicationApplicationClient.js +6 -145
- package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +32 -73
- package/sdk/application/Configuration/ConfigurationApplicationClient.js +31 -718
- package/sdk/application/Content/ContentApplicationClient.d.ts +46 -78
- package/sdk/application/Content/ContentApplicationClient.js +77 -914
- package/sdk/application/FileStorage/FileStorageApplicationClient.d.ts +9 -12
- package/sdk/application/FileStorage/FileStorageApplicationClient.js +22 -125
- package/sdk/application/Lead/LeadApplicationClient.d.ts +10 -18
- package/sdk/application/Lead/LeadApplicationClient.js +32 -202
- package/sdk/application/Logistic/LogisticApplicationClient.d.ts +22 -39
- package/sdk/application/Logistic/LogisticApplicationClient.js +50 -478
- package/sdk/application/Order/OrderApplicationClient.d.ts +22 -42
- package/sdk/application/Order/OrderApplicationClient.js +86 -472
- package/sdk/application/Payment/PaymentApplicationClient.d.ts +92 -212
- package/sdk/application/Payment/PaymentApplicationClient.js +57 -2102
- package/sdk/application/Rewards/RewardsApplicationClient.d.ts +14 -28
- package/sdk/application/Rewards/RewardsApplicationClient.js +16 -305
- package/sdk/application/Share/ShareApplicationClient.d.ts +14 -24
- package/sdk/application/Share/ShareApplicationClient.js +34 -294
- package/sdk/application/Theme/ThemeApplicationClient.d.ts +8 -14
- package/sdk/application/Theme/ThemeApplicationClient.js +28 -162
- package/sdk/application/User/UserApplicationClient.d.ts +85 -136
- package/sdk/application/User/UserApplicationClient.js +45 -1815
- package/sdk/application/Webhook/WebhookApplicationClient.d.ts +2 -5
- package/sdk/application/Webhook/WebhookApplicationClient.js +4 -47
- package/sdk/application/index.d.ts +0 -18
- package/sdk/application/index.js +0 -33
- package/sdk/common/Utility.d.ts +1 -1
- package/sdk/common/Utility.js +10 -7
- package/sdk/common/Validator.d.ts +1 -0
- package/sdk/common/Validator.js +20 -0
- package/sdk/common/utils.d.ts +0 -1
- package/sdk/common/utils.js +0 -14
- package/sdk/partner/FileStorage/FileStoragePartnerModel.d.ts +2 -0
- package/sdk/partner/FileStorage/FileStoragePartnerModel.js +2 -0
- package/sdk/partner/OAuthClient.js +1 -0
- package/sdk/partner/Theme/ThemePartnerModel.d.ts +3 -40
- package/sdk/partner/Theme/ThemePartnerModel.js +2 -24
- package/sdk/platform/Cart/CartPlatformModel.d.ts +28 -0
- package/sdk/platform/Cart/CartPlatformModel.js +12 -0
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +0 -7
- package/sdk/platform/Catalog/CatalogPlatformModel.js +1 -4
- package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +14 -0
- package/sdk/platform/Configuration/ConfigurationPlatformModel.js +6 -0
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +3 -1
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +3 -0
- package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +3 -1
- package/sdk/platform/FileStorage/FileStoragePlatformClient.js +3 -0
- package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +16 -1
- package/sdk/platform/FileStorage/FileStoragePlatformModel.js +20 -0
- package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +0 -10
- package/sdk/platform/Order/OrderPlatformApplicationClient.js +0 -92
- package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +1 -28
- package/sdk/platform/Order/OrderPlatformApplicationValidator.js +0 -18
- package/sdk/platform/Order/OrderPlatformClient.d.ts +10 -0
- package/sdk/platform/Order/OrderPlatformClient.js +99 -0
- package/sdk/platform/Order/OrderPlatformModel.d.ts +7 -0
- package/sdk/platform/Order/OrderPlatformModel.js +3 -0
- package/sdk/platform/Order/OrderPlatformValidator.d.ts +33 -1
- package/sdk/platform/Order/OrderPlatformValidator.js +20 -0
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +1 -1
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +4 -4
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +56 -19
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +42 -18
- package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.d.ts +3 -3
- package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.js +2 -2
- package/sdk/platform/Theme/ThemePlatformModel.d.ts +3 -40
- package/sdk/platform/Theme/ThemePlatformModel.js +2 -24
- package/sdk/public/Configuration/ConfigurationPublicClient.js +5 -2
- package/sdk/public/Content/ContentPublicClient.d.ts +1 -1
- package/sdk/public/Content/ContentPublicClient.js +14 -2
- package/sdk/public/Partner/PartnerPublicClient.d.ts +1 -1
- package/sdk/public/Partner/PartnerPublicClient.js +14 -2
- package/sdk/public/Webhook/WebhookPublicClient.js +5 -2
- package/sdk/application/Cart/CartApplicationModel.d.ts +0 -3994
- package/sdk/application/Cart/CartApplicationModel.js +0 -2497
- package/sdk/application/Cart/CartApplicationValidator.d.ts +0 -769
- package/sdk/application/Cart/CartApplicationValidator.js +0 -530
- package/sdk/application/Catalog/CatalogApplicationModel.d.ts +0 -3857
- package/sdk/application/Catalog/CatalogApplicationModel.js +0 -2629
- package/sdk/application/Catalog/CatalogApplicationValidator.d.ts +0 -791
- package/sdk/application/Catalog/CatalogApplicationValidator.js +0 -551
- package/sdk/application/Common/CommonApplicationModel.d.ts +0 -449
- package/sdk/application/Common/CommonApplicationModel.js +0 -308
- package/sdk/application/Common/CommonApplicationValidator.d.ts +0 -46
- package/sdk/application/Common/CommonApplicationValidator.js +0 -38
- package/sdk/application/Communication/CommunicationApplicationModel.d.ts +0 -293
- package/sdk/application/Communication/CommunicationApplicationModel.js +0 -201
- package/sdk/application/Communication/CommunicationApplicationValidator.d.ts +0 -29
- package/sdk/application/Communication/CommunicationApplicationValidator.js +0 -38
- package/sdk/application/Configuration/ConfigurationApplicationModel.d.ts +0 -2556
- package/sdk/application/Configuration/ConfigurationApplicationModel.js +0 -1887
- package/sdk/application/Configuration/ConfigurationApplicationValidator.d.ts +0 -179
- package/sdk/application/Configuration/ConfigurationApplicationValidator.js +0 -176
- package/sdk/application/Content/ContentApplicationModel.d.ts +0 -2133
- package/sdk/application/Content/ContentApplicationModel.js +0 -1589
- package/sdk/application/Content/ContentApplicationValidator.d.ts +0 -284
- package/sdk/application/Content/ContentApplicationValidator.js +0 -264
- package/sdk/application/FileStorage/FileStorageApplicationModel.d.ts +0 -272
- package/sdk/application/FileStorage/FileStorageApplicationModel.js +0 -190
- package/sdk/application/FileStorage/FileStorageApplicationValidator.d.ts +0 -56
- package/sdk/application/FileStorage/FileStorageApplicationValidator.js +0 -53
- package/sdk/application/Lead/LeadApplicationModel.d.ts +0 -590
- package/sdk/application/Lead/LeadApplicationModel.js +0 -480
- package/sdk/application/Lead/LeadApplicationValidator.d.ts +0 -68
- package/sdk/application/Lead/LeadApplicationValidator.js +0 -71
- package/sdk/application/Logistic/LogisticApplicationModel.d.ts +0 -1675
- package/sdk/application/Logistic/LogisticApplicationModel.js +0 -1121
- package/sdk/application/Logistic/LogisticApplicationValidator.d.ts +0 -254
- package/sdk/application/Logistic/LogisticApplicationValidator.js +0 -190
- package/sdk/application/Order/OrderApplicationModel.d.ts +0 -2296
- package/sdk/application/Order/OrderApplicationModel.js +0 -1471
- package/sdk/application/Order/OrderApplicationValidator.d.ts +0 -265
- package/sdk/application/Order/OrderApplicationValidator.js +0 -197
- package/sdk/application/Payment/PaymentApplicationModel.d.ts +0 -4058
- package/sdk/application/Payment/PaymentApplicationModel.js +0 -2630
- package/sdk/application/Payment/PaymentApplicationValidator.d.ts +0 -576
- package/sdk/application/Payment/PaymentApplicationValidator.js +0 -594
- package/sdk/application/Rewards/RewardsApplicationModel.d.ts +0 -365
- package/sdk/application/Rewards/RewardsApplicationModel.js +0 -396
- package/sdk/application/Rewards/RewardsApplicationValidator.d.ts +0 -73
- package/sdk/application/Rewards/RewardsApplicationValidator.js +0 -84
- package/sdk/application/Share/ShareApplicationModel.d.ts +0 -339
- package/sdk/application/Share/ShareApplicationModel.js +0 -234
- package/sdk/application/Share/ShareApplicationValidator.d.ts +0 -90
- package/sdk/application/Share/ShareApplicationValidator.js +0 -91
- package/sdk/application/Theme/ThemeApplicationModel.d.ts +0 -1713
- package/sdk/application/Theme/ThemeApplicationModel.js +0 -1426
- package/sdk/application/Theme/ThemeApplicationValidator.d.ts +0 -66
- package/sdk/application/Theme/ThemeApplicationValidator.js +0 -58
- package/sdk/application/User/UserApplicationModel.d.ts +0 -1943
- package/sdk/application/User/UserApplicationModel.js +0 -1382
- package/sdk/application/User/UserApplicationValidator.d.ts +0 -560
- package/sdk/application/User/UserApplicationValidator.js +0 -573
- package/sdk/application/Webhook/WebhookApplicationModel.d.ts +0 -52
- package/sdk/application/Webhook/WebhookApplicationModel.js +0 -46
- package/sdk/application/Webhook/WebhookApplicationValidator.d.ts +0 -16
- package/sdk/application/Webhook/WebhookApplicationValidator.js +0 -19
- package/sdk/common/Clickstream.d.ts +0 -1
- package/sdk/common/Clickstream.js +0 -464
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
const ApplicationAPIClient = require("../ApplicationAPIClient");
|
|
2
1
|
const {
|
|
3
2
|
FDKClientValidationError,
|
|
4
3
|
FDKResponseValidationError,
|
|
5
4
|
} = require("../../common/FDKError");
|
|
5
|
+
|
|
6
|
+
const ApplicationAPIClient = require("../ApplicationAPIClient");
|
|
6
7
|
const constructUrl = require("../constructUrl");
|
|
7
8
|
const Paginator = require("../../common/Paginator");
|
|
8
|
-
const
|
|
9
|
-
const ContentApplicationModel = require("./ContentApplicationModel");
|
|
10
|
-
const { Logger } = require("./../../common/Logger");
|
|
11
|
-
const Joi = require("joi");
|
|
9
|
+
const { validateRequiredParams } = require("../../common/Validator");
|
|
12
10
|
|
|
13
11
|
class Content {
|
|
14
12
|
constructor(_conf) {
|
|
@@ -58,12 +56,9 @@ class Content {
|
|
|
58
56
|
}
|
|
59
57
|
|
|
60
58
|
/**
|
|
61
|
-
* @param {ContentApplicationValidator.GetAnnouncementsParam} arg - Arg object.
|
|
62
59
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
63
60
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
64
|
-
* @returns {Promise<
|
|
65
|
-
* - Success response
|
|
66
|
-
*
|
|
61
|
+
* @returns {Promise<AnnouncementsResponseSchema>} - Success response
|
|
67
62
|
* @name getAnnouncements
|
|
68
63
|
* @summary: List announcements
|
|
69
64
|
* @description: List all current announcements in the application. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/content/getAnnouncements/).
|
|
@@ -72,28 +67,6 @@ class Content {
|
|
|
72
67
|
{ requestHeaders } = { requestHeaders: {} },
|
|
73
68
|
{ responseHeaders } = { responseHeaders: false }
|
|
74
69
|
) {
|
|
75
|
-
const { error } = ContentApplicationValidator.getAnnouncements().validate(
|
|
76
|
-
{},
|
|
77
|
-
{ abortEarly: false, allowUnknown: true }
|
|
78
|
-
);
|
|
79
|
-
if (error) {
|
|
80
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
// Showing warrnings if extra unknown parameters are found
|
|
84
|
-
const {
|
|
85
|
-
error: warrning,
|
|
86
|
-
} = ContentApplicationValidator.getAnnouncements().validate(
|
|
87
|
-
{},
|
|
88
|
-
{ abortEarly: false, allowUnknown: false }
|
|
89
|
-
);
|
|
90
|
-
if (warrning) {
|
|
91
|
-
Logger({
|
|
92
|
-
level: "WARN",
|
|
93
|
-
message: `Parameter Validation warrnings for application > Content > getAnnouncements \n ${warrning}`,
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
|
|
97
70
|
const query_params = {};
|
|
98
71
|
|
|
99
72
|
const xHeaders = {};
|
|
@@ -116,32 +89,13 @@ class Content {
|
|
|
116
89
|
responseData = response[0];
|
|
117
90
|
}
|
|
118
91
|
|
|
119
|
-
const {
|
|
120
|
-
error: res_error,
|
|
121
|
-
} = ContentApplicationModel.AnnouncementsResponseSchema().validate(
|
|
122
|
-
responseData,
|
|
123
|
-
{ abortEarly: false, allowUnknown: true }
|
|
124
|
-
);
|
|
125
|
-
|
|
126
|
-
if (res_error) {
|
|
127
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
128
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
129
|
-
} else {
|
|
130
|
-
Logger({
|
|
131
|
-
level: "WARN",
|
|
132
|
-
message: `Response Validation Warnings for application > Content > getAnnouncements \n ${res_error}`,
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
|
|
137
92
|
return response;
|
|
138
93
|
}
|
|
139
94
|
|
|
140
95
|
/**
|
|
141
|
-
* @param {ContentApplicationValidator.GetBlogParam} arg - Arg object.
|
|
142
96
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
143
97
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
144
|
-
* @returns {Promise<
|
|
98
|
+
* @returns {Promise<BlogSchema>} - Success response
|
|
145
99
|
* @name getBlog
|
|
146
100
|
* @summary: Get a blog
|
|
147
101
|
* @description: Get information related to a specific blog such as it's contents, author, publish date, SEO related information. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/content/getBlog/).
|
|
@@ -150,24 +104,13 @@ class Content {
|
|
|
150
104
|
{ slug, rootId, requestHeaders } = { requestHeaders: {} },
|
|
151
105
|
{ responseHeaders } = { responseHeaders: false }
|
|
152
106
|
) {
|
|
153
|
-
const
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
// Showing warrnings if extra unknown parameters are found
|
|
162
|
-
const { error: warrning } = ContentApplicationValidator.getBlog().validate(
|
|
163
|
-
{ slug, rootId },
|
|
164
|
-
{ abortEarly: false, allowUnknown: false }
|
|
165
|
-
);
|
|
166
|
-
if (warrning) {
|
|
167
|
-
Logger({
|
|
168
|
-
level: "WARN",
|
|
169
|
-
message: `Parameter Validation warrnings for application > Content > getBlog \n ${warrning}`,
|
|
107
|
+
const errors = validateRequiredParams(arguments[0], ["slug"]);
|
|
108
|
+
if (errors.length > 0) {
|
|
109
|
+
const error = new FDKClientValidationError({
|
|
110
|
+
message: "Missing required field",
|
|
111
|
+
details: errors,
|
|
170
112
|
});
|
|
113
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
171
114
|
}
|
|
172
115
|
|
|
173
116
|
const query_params = {};
|
|
@@ -193,32 +136,13 @@ class Content {
|
|
|
193
136
|
responseData = response[0];
|
|
194
137
|
}
|
|
195
138
|
|
|
196
|
-
const {
|
|
197
|
-
error: res_error,
|
|
198
|
-
} = ContentApplicationModel.BlogSchema().validate(responseData, {
|
|
199
|
-
abortEarly: false,
|
|
200
|
-
allowUnknown: true,
|
|
201
|
-
});
|
|
202
|
-
|
|
203
|
-
if (res_error) {
|
|
204
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
205
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
206
|
-
} else {
|
|
207
|
-
Logger({
|
|
208
|
-
level: "WARN",
|
|
209
|
-
message: `Response Validation Warnings for application > Content > getBlog \n ${res_error}`,
|
|
210
|
-
});
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
|
|
214
139
|
return response;
|
|
215
140
|
}
|
|
216
141
|
|
|
217
142
|
/**
|
|
218
|
-
* @param {ContentApplicationValidator.GetBlogsParam} arg - Arg object.
|
|
219
143
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
220
144
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
221
|
-
* @returns {Promise<
|
|
145
|
+
* @returns {Promise<BlogGetResponse>} - Success response
|
|
222
146
|
* @name getBlogs
|
|
223
147
|
* @summary: List blogs
|
|
224
148
|
* @description: List all the blogs against an application. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/content/getBlogs/).
|
|
@@ -227,26 +151,6 @@ class Content {
|
|
|
227
151
|
{ pageNo, pageSize, tags, search, requestHeaders } = { requestHeaders: {} },
|
|
228
152
|
{ responseHeaders } = { responseHeaders: false }
|
|
229
153
|
) {
|
|
230
|
-
const { error } = ContentApplicationValidator.getBlogs().validate(
|
|
231
|
-
{ pageNo, pageSize, tags, search },
|
|
232
|
-
{ abortEarly: false, allowUnknown: true }
|
|
233
|
-
);
|
|
234
|
-
if (error) {
|
|
235
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
// Showing warrnings if extra unknown parameters are found
|
|
239
|
-
const { error: warrning } = ContentApplicationValidator.getBlogs().validate(
|
|
240
|
-
{ pageNo, pageSize, tags, search },
|
|
241
|
-
{ abortEarly: false, allowUnknown: false }
|
|
242
|
-
);
|
|
243
|
-
if (warrning) {
|
|
244
|
-
Logger({
|
|
245
|
-
level: "WARN",
|
|
246
|
-
message: `Parameter Validation warrnings for application > Content > getBlogs \n ${warrning}`,
|
|
247
|
-
});
|
|
248
|
-
}
|
|
249
|
-
|
|
250
154
|
const query_params = {};
|
|
251
155
|
query_params["page_no"] = pageNo;
|
|
252
156
|
query_params["page_size"] = pageSize;
|
|
@@ -273,34 +177,13 @@ class Content {
|
|
|
273
177
|
responseData = response[0];
|
|
274
178
|
}
|
|
275
179
|
|
|
276
|
-
const {
|
|
277
|
-
error: res_error,
|
|
278
|
-
} = ContentApplicationModel.BlogGetResponse().validate(responseData, {
|
|
279
|
-
abortEarly: false,
|
|
280
|
-
allowUnknown: true,
|
|
281
|
-
});
|
|
282
|
-
|
|
283
|
-
if (res_error) {
|
|
284
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
285
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
286
|
-
} else {
|
|
287
|
-
Logger({
|
|
288
|
-
level: "WARN",
|
|
289
|
-
message: `Response Validation Warnings for application > Content > getBlogs \n ${res_error}`,
|
|
290
|
-
});
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
|
|
294
180
|
return response;
|
|
295
181
|
}
|
|
296
182
|
|
|
297
183
|
/**
|
|
298
|
-
* @param {ContentApplicationValidator.GetCustomFieldsParam} arg - Arg object.
|
|
299
184
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
300
185
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
301
|
-
* @returns {Promise<
|
|
302
|
-
* - Success response
|
|
303
|
-
*
|
|
186
|
+
* @returns {Promise<CustomFieldsResponseByResourceIdSchema>} - Success response
|
|
304
187
|
* @name getCustomFields
|
|
305
188
|
* @summary: Get list of custom fields
|
|
306
189
|
* @description: List custom fields attached to a particular resource by using the resource. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/content/getCustomFields/).
|
|
@@ -309,26 +192,16 @@ class Content {
|
|
|
309
192
|
{ resource, resourceId, requestHeaders } = { requestHeaders: {} },
|
|
310
193
|
{ responseHeaders } = { responseHeaders: false }
|
|
311
194
|
) {
|
|
312
|
-
const
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
);
|
|
316
|
-
if (
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
// Showing warrnings if extra unknown parameters are found
|
|
321
|
-
const {
|
|
322
|
-
error: warrning,
|
|
323
|
-
} = ContentApplicationValidator.getCustomFields().validate(
|
|
324
|
-
{ resource, resourceId },
|
|
325
|
-
{ abortEarly: false, allowUnknown: false }
|
|
326
|
-
);
|
|
327
|
-
if (warrning) {
|
|
328
|
-
Logger({
|
|
329
|
-
level: "WARN",
|
|
330
|
-
message: `Parameter Validation warrnings for application > Content > getCustomFields \n ${warrning}`,
|
|
195
|
+
const errors = validateRequiredParams(arguments[0], [
|
|
196
|
+
"resource",
|
|
197
|
+
"resourceId",
|
|
198
|
+
]);
|
|
199
|
+
if (errors.length > 0) {
|
|
200
|
+
const error = new FDKClientValidationError({
|
|
201
|
+
message: "Missing required field",
|
|
202
|
+
details: errors,
|
|
331
203
|
});
|
|
204
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
332
205
|
}
|
|
333
206
|
|
|
334
207
|
const query_params = {};
|
|
@@ -353,33 +226,13 @@ class Content {
|
|
|
353
226
|
responseData = response[0];
|
|
354
227
|
}
|
|
355
228
|
|
|
356
|
-
const {
|
|
357
|
-
error: res_error,
|
|
358
|
-
} = ContentApplicationModel.CustomFieldsResponseByResourceIdSchema().validate(
|
|
359
|
-
responseData,
|
|
360
|
-
{ abortEarly: false, allowUnknown: true }
|
|
361
|
-
);
|
|
362
|
-
|
|
363
|
-
if (res_error) {
|
|
364
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
365
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
366
|
-
} else {
|
|
367
|
-
Logger({
|
|
368
|
-
level: "WARN",
|
|
369
|
-
message: `Response Validation Warnings for application > Content > getCustomFields \n ${res_error}`,
|
|
370
|
-
});
|
|
371
|
-
}
|
|
372
|
-
}
|
|
373
|
-
|
|
374
229
|
return response;
|
|
375
230
|
}
|
|
376
231
|
|
|
377
232
|
/**
|
|
378
|
-
* @param {ContentApplicationValidator.GetCustomObjectParam} arg - Arg object.
|
|
379
233
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
380
234
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
381
|
-
* @returns {Promise<
|
|
382
|
-
* Success response
|
|
235
|
+
* @returns {Promise<CustomObjectByIdSchema>} - Success response
|
|
383
236
|
* @name getCustomObject
|
|
384
237
|
* @summary: Get custom object
|
|
385
238
|
* @description: Get details of custom objects, their field details, definitions, and references can be obtained using this endpoint. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/content/getCustomObject/).
|
|
@@ -388,26 +241,13 @@ class Content {
|
|
|
388
241
|
{ metaobjectId, requestHeaders } = { requestHeaders: {} },
|
|
389
242
|
{ responseHeaders } = { responseHeaders: false }
|
|
390
243
|
) {
|
|
391
|
-
const
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
397
|
-
}
|
|
398
|
-
|
|
399
|
-
// Showing warrnings if extra unknown parameters are found
|
|
400
|
-
const {
|
|
401
|
-
error: warrning,
|
|
402
|
-
} = ContentApplicationValidator.getCustomObject().validate(
|
|
403
|
-
{ metaobjectId },
|
|
404
|
-
{ abortEarly: false, allowUnknown: false }
|
|
405
|
-
);
|
|
406
|
-
if (warrning) {
|
|
407
|
-
Logger({
|
|
408
|
-
level: "WARN",
|
|
409
|
-
message: `Parameter Validation warrnings for application > Content > getCustomObject \n ${warrning}`,
|
|
244
|
+
const errors = validateRequiredParams(arguments[0], ["metaobjectId"]);
|
|
245
|
+
if (errors.length > 0) {
|
|
246
|
+
const error = new FDKClientValidationError({
|
|
247
|
+
message: "Missing required field",
|
|
248
|
+
details: errors,
|
|
410
249
|
});
|
|
250
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
411
251
|
}
|
|
412
252
|
|
|
413
253
|
const query_params = {};
|
|
@@ -432,32 +272,13 @@ class Content {
|
|
|
432
272
|
responseData = response[0];
|
|
433
273
|
}
|
|
434
274
|
|
|
435
|
-
const {
|
|
436
|
-
error: res_error,
|
|
437
|
-
} = ContentApplicationModel.CustomObjectByIdSchema().validate(
|
|
438
|
-
responseData,
|
|
439
|
-
{ abortEarly: false, allowUnknown: true }
|
|
440
|
-
);
|
|
441
|
-
|
|
442
|
-
if (res_error) {
|
|
443
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
444
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
445
|
-
} else {
|
|
446
|
-
Logger({
|
|
447
|
-
level: "WARN",
|
|
448
|
-
message: `Response Validation Warnings for application > Content > getCustomObject \n ${res_error}`,
|
|
449
|
-
});
|
|
450
|
-
}
|
|
451
|
-
}
|
|
452
|
-
|
|
453
275
|
return response;
|
|
454
276
|
}
|
|
455
277
|
|
|
456
278
|
/**
|
|
457
|
-
* @param {ContentApplicationValidator.GetDataLoadersParam} arg - Arg object.
|
|
458
279
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
459
280
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
460
|
-
* @returns {Promise<
|
|
281
|
+
* @returns {Promise<DataLoadersSchema>} - Success response
|
|
461
282
|
* @name getDataLoaders
|
|
462
283
|
* @summary: List Dataloaders
|
|
463
284
|
* @description: List all the data loaders that are enabled for an application. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/content/getDataLoaders/).
|
|
@@ -466,28 +287,6 @@ class Content {
|
|
|
466
287
|
{ requestHeaders } = { requestHeaders: {} },
|
|
467
288
|
{ responseHeaders } = { responseHeaders: false }
|
|
468
289
|
) {
|
|
469
|
-
const { error } = ContentApplicationValidator.getDataLoaders().validate(
|
|
470
|
-
{},
|
|
471
|
-
{ abortEarly: false, allowUnknown: true }
|
|
472
|
-
);
|
|
473
|
-
if (error) {
|
|
474
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
475
|
-
}
|
|
476
|
-
|
|
477
|
-
// Showing warrnings if extra unknown parameters are found
|
|
478
|
-
const {
|
|
479
|
-
error: warrning,
|
|
480
|
-
} = ContentApplicationValidator.getDataLoaders().validate(
|
|
481
|
-
{},
|
|
482
|
-
{ abortEarly: false, allowUnknown: false }
|
|
483
|
-
);
|
|
484
|
-
if (warrning) {
|
|
485
|
-
Logger({
|
|
486
|
-
level: "WARN",
|
|
487
|
-
message: `Parameter Validation warrnings for application > Content > getDataLoaders \n ${warrning}`,
|
|
488
|
-
});
|
|
489
|
-
}
|
|
490
|
-
|
|
491
290
|
const query_params = {};
|
|
492
291
|
|
|
493
292
|
const xHeaders = {};
|
|
@@ -510,32 +309,13 @@ class Content {
|
|
|
510
309
|
responseData = response[0];
|
|
511
310
|
}
|
|
512
311
|
|
|
513
|
-
const {
|
|
514
|
-
error: res_error,
|
|
515
|
-
} = ContentApplicationModel.DataLoadersSchema().validate(responseData, {
|
|
516
|
-
abortEarly: false,
|
|
517
|
-
allowUnknown: true,
|
|
518
|
-
});
|
|
519
|
-
|
|
520
|
-
if (res_error) {
|
|
521
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
522
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
523
|
-
} else {
|
|
524
|
-
Logger({
|
|
525
|
-
level: "WARN",
|
|
526
|
-
message: `Response Validation Warnings for application > Content > getDataLoaders \n ${res_error}`,
|
|
527
|
-
});
|
|
528
|
-
}
|
|
529
|
-
}
|
|
530
|
-
|
|
531
312
|
return response;
|
|
532
313
|
}
|
|
533
314
|
|
|
534
315
|
/**
|
|
535
|
-
* @param {ContentApplicationValidator.GetFaqBySlugParam} arg - Arg object.
|
|
536
316
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
537
317
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
538
|
-
* @returns {Promise<
|
|
318
|
+
* @returns {Promise<FaqSchema>} - Success response
|
|
539
319
|
* @name getFaqBySlug
|
|
540
320
|
* @summary: Get FAQ
|
|
541
321
|
* @description: Get a specific FAQ using its slug identifier. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/content/getFaqBySlug/).
|
|
@@ -544,26 +324,13 @@ class Content {
|
|
|
544
324
|
{ slug, requestHeaders } = { requestHeaders: {} },
|
|
545
325
|
{ responseHeaders } = { responseHeaders: false }
|
|
546
326
|
) {
|
|
547
|
-
const
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
553
|
-
}
|
|
554
|
-
|
|
555
|
-
// Showing warrnings if extra unknown parameters are found
|
|
556
|
-
const {
|
|
557
|
-
error: warrning,
|
|
558
|
-
} = ContentApplicationValidator.getFaqBySlug().validate(
|
|
559
|
-
{ slug },
|
|
560
|
-
{ abortEarly: false, allowUnknown: false }
|
|
561
|
-
);
|
|
562
|
-
if (warrning) {
|
|
563
|
-
Logger({
|
|
564
|
-
level: "WARN",
|
|
565
|
-
message: `Parameter Validation warrnings for application > Content > getFaqBySlug \n ${warrning}`,
|
|
327
|
+
const errors = validateRequiredParams(arguments[0], ["slug"]);
|
|
328
|
+
if (errors.length > 0) {
|
|
329
|
+
const error = new FDKClientValidationError({
|
|
330
|
+
message: "Missing required field",
|
|
331
|
+
details: errors,
|
|
566
332
|
});
|
|
333
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
567
334
|
}
|
|
568
335
|
|
|
569
336
|
const query_params = {};
|
|
@@ -588,33 +355,13 @@ class Content {
|
|
|
588
355
|
responseData = response[0];
|
|
589
356
|
}
|
|
590
357
|
|
|
591
|
-
const {
|
|
592
|
-
error: res_error,
|
|
593
|
-
} = ContentApplicationModel.FaqSchema().validate(responseData, {
|
|
594
|
-
abortEarly: false,
|
|
595
|
-
allowUnknown: true,
|
|
596
|
-
});
|
|
597
|
-
|
|
598
|
-
if (res_error) {
|
|
599
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
600
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
601
|
-
} else {
|
|
602
|
-
Logger({
|
|
603
|
-
level: "WARN",
|
|
604
|
-
message: `Response Validation Warnings for application > Content > getFaqBySlug \n ${res_error}`,
|
|
605
|
-
});
|
|
606
|
-
}
|
|
607
|
-
}
|
|
608
|
-
|
|
609
358
|
return response;
|
|
610
359
|
}
|
|
611
360
|
|
|
612
361
|
/**
|
|
613
|
-
* @param {ContentApplicationValidator.GetFaqCategoriesParam} arg - Arg object.
|
|
614
362
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
615
363
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
616
|
-
* @returns {Promise<
|
|
617
|
-
* Success response
|
|
364
|
+
* @returns {Promise<GetFaqCategoriesSchema>} - Success response
|
|
618
365
|
* @name getFaqCategories
|
|
619
366
|
* @summary: List FAQ Categories
|
|
620
367
|
* @description: List categories for organizing FAQs. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/content/getFaqCategories/).
|
|
@@ -623,28 +370,6 @@ class Content {
|
|
|
623
370
|
{ requestHeaders } = { requestHeaders: {} },
|
|
624
371
|
{ responseHeaders } = { responseHeaders: false }
|
|
625
372
|
) {
|
|
626
|
-
const { error } = ContentApplicationValidator.getFaqCategories().validate(
|
|
627
|
-
{},
|
|
628
|
-
{ abortEarly: false, allowUnknown: true }
|
|
629
|
-
);
|
|
630
|
-
if (error) {
|
|
631
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
632
|
-
}
|
|
633
|
-
|
|
634
|
-
// Showing warrnings if extra unknown parameters are found
|
|
635
|
-
const {
|
|
636
|
-
error: warrning,
|
|
637
|
-
} = ContentApplicationValidator.getFaqCategories().validate(
|
|
638
|
-
{},
|
|
639
|
-
{ abortEarly: false, allowUnknown: false }
|
|
640
|
-
);
|
|
641
|
-
if (warrning) {
|
|
642
|
-
Logger({
|
|
643
|
-
level: "WARN",
|
|
644
|
-
message: `Parameter Validation warrnings for application > Content > getFaqCategories \n ${warrning}`,
|
|
645
|
-
});
|
|
646
|
-
}
|
|
647
|
-
|
|
648
373
|
const query_params = {};
|
|
649
374
|
|
|
650
375
|
const xHeaders = {};
|
|
@@ -667,33 +392,13 @@ class Content {
|
|
|
667
392
|
responseData = response[0];
|
|
668
393
|
}
|
|
669
394
|
|
|
670
|
-
const {
|
|
671
|
-
error: res_error,
|
|
672
|
-
} = ContentApplicationModel.GetFaqCategoriesSchema().validate(
|
|
673
|
-
responseData,
|
|
674
|
-
{ abortEarly: false, allowUnknown: true }
|
|
675
|
-
);
|
|
676
|
-
|
|
677
|
-
if (res_error) {
|
|
678
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
679
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
680
|
-
} else {
|
|
681
|
-
Logger({
|
|
682
|
-
level: "WARN",
|
|
683
|
-
message: `Response Validation Warnings for application > Content > getFaqCategories \n ${res_error}`,
|
|
684
|
-
});
|
|
685
|
-
}
|
|
686
|
-
}
|
|
687
|
-
|
|
688
395
|
return response;
|
|
689
396
|
}
|
|
690
397
|
|
|
691
398
|
/**
|
|
692
|
-
* @param {ContentApplicationValidator.GetFaqCategoryBySlugParam} arg - Arg object.
|
|
693
399
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
694
400
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
695
|
-
* @returns {Promise<
|
|
696
|
-
* Success response
|
|
401
|
+
* @returns {Promise<GetFaqCategoryBySlugSchema>} - Success response
|
|
697
402
|
* @name getFaqCategoryBySlug
|
|
698
403
|
* @summary: Get a FAQ category
|
|
699
404
|
* @description: Get a specific FAQ category using its slug. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/content/getFaqCategoryBySlug/).
|
|
@@ -702,28 +407,13 @@ class Content {
|
|
|
702
407
|
{ slug, requestHeaders } = { requestHeaders: {} },
|
|
703
408
|
{ responseHeaders } = { responseHeaders: false }
|
|
704
409
|
) {
|
|
705
|
-
const
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
);
|
|
711
|
-
if (error) {
|
|
712
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
713
|
-
}
|
|
714
|
-
|
|
715
|
-
// Showing warrnings if extra unknown parameters are found
|
|
716
|
-
const {
|
|
717
|
-
error: warrning,
|
|
718
|
-
} = ContentApplicationValidator.getFaqCategoryBySlug().validate(
|
|
719
|
-
{ slug },
|
|
720
|
-
{ abortEarly: false, allowUnknown: false }
|
|
721
|
-
);
|
|
722
|
-
if (warrning) {
|
|
723
|
-
Logger({
|
|
724
|
-
level: "WARN",
|
|
725
|
-
message: `Parameter Validation warrnings for application > Content > getFaqCategoryBySlug \n ${warrning}`,
|
|
410
|
+
const errors = validateRequiredParams(arguments[0], ["slug"]);
|
|
411
|
+
if (errors.length > 0) {
|
|
412
|
+
const error = new FDKClientValidationError({
|
|
413
|
+
message: "Missing required field",
|
|
414
|
+
details: errors,
|
|
726
415
|
});
|
|
416
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
727
417
|
}
|
|
728
418
|
|
|
729
419
|
const query_params = {};
|
|
@@ -748,32 +438,13 @@ class Content {
|
|
|
748
438
|
responseData = response[0];
|
|
749
439
|
}
|
|
750
440
|
|
|
751
|
-
const {
|
|
752
|
-
error: res_error,
|
|
753
|
-
} = ContentApplicationModel.GetFaqCategoryBySlugSchema().validate(
|
|
754
|
-
responseData,
|
|
755
|
-
{ abortEarly: false, allowUnknown: true }
|
|
756
|
-
);
|
|
757
|
-
|
|
758
|
-
if (res_error) {
|
|
759
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
760
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
761
|
-
} else {
|
|
762
|
-
Logger({
|
|
763
|
-
level: "WARN",
|
|
764
|
-
message: `Response Validation Warnings for application > Content > getFaqCategoryBySlug \n ${res_error}`,
|
|
765
|
-
});
|
|
766
|
-
}
|
|
767
|
-
}
|
|
768
|
-
|
|
769
441
|
return response;
|
|
770
442
|
}
|
|
771
443
|
|
|
772
444
|
/**
|
|
773
|
-
* @param {ContentApplicationValidator.GetFaqsParam} arg - Arg object.
|
|
774
445
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
775
446
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
776
|
-
* @returns {Promise<
|
|
447
|
+
* @returns {Promise<FaqResponseSchema>} - Success response
|
|
777
448
|
* @name getFaqs
|
|
778
449
|
* @summary: List FAQs
|
|
779
450
|
* @description: List frequently asked questions and answers. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/content/getFaqs/).
|
|
@@ -782,26 +453,6 @@ class Content {
|
|
|
782
453
|
{ requestHeaders } = { requestHeaders: {} },
|
|
783
454
|
{ responseHeaders } = { responseHeaders: false }
|
|
784
455
|
) {
|
|
785
|
-
const { error } = ContentApplicationValidator.getFaqs().validate(
|
|
786
|
-
{},
|
|
787
|
-
{ abortEarly: false, allowUnknown: true }
|
|
788
|
-
);
|
|
789
|
-
if (error) {
|
|
790
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
791
|
-
}
|
|
792
|
-
|
|
793
|
-
// Showing warrnings if extra unknown parameters are found
|
|
794
|
-
const { error: warrning } = ContentApplicationValidator.getFaqs().validate(
|
|
795
|
-
{},
|
|
796
|
-
{ abortEarly: false, allowUnknown: false }
|
|
797
|
-
);
|
|
798
|
-
if (warrning) {
|
|
799
|
-
Logger({
|
|
800
|
-
level: "WARN",
|
|
801
|
-
message: `Parameter Validation warrnings for application > Content > getFaqs \n ${warrning}`,
|
|
802
|
-
});
|
|
803
|
-
}
|
|
804
|
-
|
|
805
456
|
const query_params = {};
|
|
806
457
|
|
|
807
458
|
const xHeaders = {};
|
|
@@ -824,32 +475,13 @@ class Content {
|
|
|
824
475
|
responseData = response[0];
|
|
825
476
|
}
|
|
826
477
|
|
|
827
|
-
const {
|
|
828
|
-
error: res_error,
|
|
829
|
-
} = ContentApplicationModel.FaqResponseSchema().validate(responseData, {
|
|
830
|
-
abortEarly: false,
|
|
831
|
-
allowUnknown: true,
|
|
832
|
-
});
|
|
833
|
-
|
|
834
|
-
if (res_error) {
|
|
835
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
836
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
837
|
-
} else {
|
|
838
|
-
Logger({
|
|
839
|
-
level: "WARN",
|
|
840
|
-
message: `Response Validation Warnings for application > Content > getFaqs \n ${res_error}`,
|
|
841
|
-
});
|
|
842
|
-
}
|
|
843
|
-
}
|
|
844
|
-
|
|
845
478
|
return response;
|
|
846
479
|
}
|
|
847
480
|
|
|
848
481
|
/**
|
|
849
|
-
* @param {ContentApplicationValidator.GetFaqsByCategorySlugParam} arg - Arg object.
|
|
850
482
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
851
483
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
852
|
-
* @returns {Promise<
|
|
484
|
+
* @returns {Promise<GetFaqSchema>} - Success response
|
|
853
485
|
* @name getFaqsByCategorySlug
|
|
854
486
|
* @summary: List FAQs by category
|
|
855
487
|
* @description: Get FAQs belonging to a specific category slug. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/content/getFaqsByCategorySlug/).
|
|
@@ -858,28 +490,13 @@ class Content {
|
|
|
858
490
|
{ slug, requestHeaders } = { requestHeaders: {} },
|
|
859
491
|
{ responseHeaders } = { responseHeaders: false }
|
|
860
492
|
) {
|
|
861
|
-
const
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
);
|
|
867
|
-
if (error) {
|
|
868
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
869
|
-
}
|
|
870
|
-
|
|
871
|
-
// Showing warrnings if extra unknown parameters are found
|
|
872
|
-
const {
|
|
873
|
-
error: warrning,
|
|
874
|
-
} = ContentApplicationValidator.getFaqsByCategorySlug().validate(
|
|
875
|
-
{ slug },
|
|
876
|
-
{ abortEarly: false, allowUnknown: false }
|
|
877
|
-
);
|
|
878
|
-
if (warrning) {
|
|
879
|
-
Logger({
|
|
880
|
-
level: "WARN",
|
|
881
|
-
message: `Parameter Validation warrnings for application > Content > getFaqsByCategorySlug \n ${warrning}`,
|
|
493
|
+
const errors = validateRequiredParams(arguments[0], ["slug"]);
|
|
494
|
+
if (errors.length > 0) {
|
|
495
|
+
const error = new FDKClientValidationError({
|
|
496
|
+
message: "Missing required field",
|
|
497
|
+
details: errors,
|
|
882
498
|
});
|
|
499
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
883
500
|
}
|
|
884
501
|
|
|
885
502
|
const query_params = {};
|
|
@@ -904,32 +521,13 @@ class Content {
|
|
|
904
521
|
responseData = response[0];
|
|
905
522
|
}
|
|
906
523
|
|
|
907
|
-
const {
|
|
908
|
-
error: res_error,
|
|
909
|
-
} = ContentApplicationModel.GetFaqSchema().validate(responseData, {
|
|
910
|
-
abortEarly: false,
|
|
911
|
-
allowUnknown: true,
|
|
912
|
-
});
|
|
913
|
-
|
|
914
|
-
if (res_error) {
|
|
915
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
916
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
917
|
-
} else {
|
|
918
|
-
Logger({
|
|
919
|
-
level: "WARN",
|
|
920
|
-
message: `Response Validation Warnings for application > Content > getFaqsByCategorySlug \n ${res_error}`,
|
|
921
|
-
});
|
|
922
|
-
}
|
|
923
|
-
}
|
|
924
|
-
|
|
925
524
|
return response;
|
|
926
525
|
}
|
|
927
526
|
|
|
928
527
|
/**
|
|
929
|
-
* @param {ContentApplicationValidator.GetLandingPageParam} arg - Arg object.
|
|
930
528
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
931
529
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
932
|
-
* @returns {Promise<
|
|
530
|
+
* @returns {Promise<LandingPageSchema>} - Success response
|
|
933
531
|
* @name getLandingPage
|
|
934
532
|
* @summary: Get a landing page
|
|
935
533
|
* @description: Get content of the application's landing page. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/content/getLandingPage/).
|
|
@@ -938,28 +536,6 @@ class Content {
|
|
|
938
536
|
{ requestHeaders } = { requestHeaders: {} },
|
|
939
537
|
{ responseHeaders } = { responseHeaders: false }
|
|
940
538
|
) {
|
|
941
|
-
const { error } = ContentApplicationValidator.getLandingPage().validate(
|
|
942
|
-
{},
|
|
943
|
-
{ abortEarly: false, allowUnknown: true }
|
|
944
|
-
);
|
|
945
|
-
if (error) {
|
|
946
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
947
|
-
}
|
|
948
|
-
|
|
949
|
-
// Showing warrnings if extra unknown parameters are found
|
|
950
|
-
const {
|
|
951
|
-
error: warrning,
|
|
952
|
-
} = ContentApplicationValidator.getLandingPage().validate(
|
|
953
|
-
{},
|
|
954
|
-
{ abortEarly: false, allowUnknown: false }
|
|
955
|
-
);
|
|
956
|
-
if (warrning) {
|
|
957
|
-
Logger({
|
|
958
|
-
level: "WARN",
|
|
959
|
-
message: `Parameter Validation warrnings for application > Content > getLandingPage \n ${warrning}`,
|
|
960
|
-
});
|
|
961
|
-
}
|
|
962
|
-
|
|
963
539
|
const query_params = {};
|
|
964
540
|
|
|
965
541
|
const xHeaders = {};
|
|
@@ -982,32 +558,13 @@ class Content {
|
|
|
982
558
|
responseData = response[0];
|
|
983
559
|
}
|
|
984
560
|
|
|
985
|
-
const {
|
|
986
|
-
error: res_error,
|
|
987
|
-
} = ContentApplicationModel.LandingPageSchema().validate(responseData, {
|
|
988
|
-
abortEarly: false,
|
|
989
|
-
allowUnknown: true,
|
|
990
|
-
});
|
|
991
|
-
|
|
992
|
-
if (res_error) {
|
|
993
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
994
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
995
|
-
} else {
|
|
996
|
-
Logger({
|
|
997
|
-
level: "WARN",
|
|
998
|
-
message: `Response Validation Warnings for application > Content > getLandingPage \n ${res_error}`,
|
|
999
|
-
});
|
|
1000
|
-
}
|
|
1001
|
-
}
|
|
1002
|
-
|
|
1003
561
|
return response;
|
|
1004
562
|
}
|
|
1005
563
|
|
|
1006
564
|
/**
|
|
1007
|
-
* @param {ContentApplicationValidator.GetLegalInformationParam} arg - Arg object.
|
|
1008
565
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1009
566
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1010
|
-
* @returns {Promise<
|
|
567
|
+
* @returns {Promise<ApplicationLegal>} - Success response
|
|
1011
568
|
* @name getLegalInformation
|
|
1012
569
|
* @summary: Get legal information
|
|
1013
570
|
* @description: Get legal policies for an application which includes Terms and conditions, return policy, shipping policy and privacy policy. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/content/getLegalInformation/).
|
|
@@ -1016,30 +573,6 @@ class Content {
|
|
|
1016
573
|
{ requestHeaders } = { requestHeaders: {} },
|
|
1017
574
|
{ responseHeaders } = { responseHeaders: false }
|
|
1018
575
|
) {
|
|
1019
|
-
const {
|
|
1020
|
-
error,
|
|
1021
|
-
} = ContentApplicationValidator.getLegalInformation().validate(
|
|
1022
|
-
{},
|
|
1023
|
-
{ abortEarly: false, allowUnknown: true }
|
|
1024
|
-
);
|
|
1025
|
-
if (error) {
|
|
1026
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
1027
|
-
}
|
|
1028
|
-
|
|
1029
|
-
// Showing warrnings if extra unknown parameters are found
|
|
1030
|
-
const {
|
|
1031
|
-
error: warrning,
|
|
1032
|
-
} = ContentApplicationValidator.getLegalInformation().validate(
|
|
1033
|
-
{},
|
|
1034
|
-
{ abortEarly: false, allowUnknown: false }
|
|
1035
|
-
);
|
|
1036
|
-
if (warrning) {
|
|
1037
|
-
Logger({
|
|
1038
|
-
level: "WARN",
|
|
1039
|
-
message: `Parameter Validation warrnings for application > Content > getLegalInformation \n ${warrning}`,
|
|
1040
|
-
});
|
|
1041
|
-
}
|
|
1042
|
-
|
|
1043
576
|
const query_params = {};
|
|
1044
577
|
|
|
1045
578
|
const xHeaders = {};
|
|
@@ -1062,33 +595,13 @@ class Content {
|
|
|
1062
595
|
responseData = response[0];
|
|
1063
596
|
}
|
|
1064
597
|
|
|
1065
|
-
const {
|
|
1066
|
-
error: res_error,
|
|
1067
|
-
} = ContentApplicationModel.ApplicationLegal().validate(responseData, {
|
|
1068
|
-
abortEarly: false,
|
|
1069
|
-
allowUnknown: true,
|
|
1070
|
-
});
|
|
1071
|
-
|
|
1072
|
-
if (res_error) {
|
|
1073
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
1074
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1075
|
-
} else {
|
|
1076
|
-
Logger({
|
|
1077
|
-
level: "WARN",
|
|
1078
|
-
message: `Response Validation Warnings for application > Content > getLegalInformation \n ${res_error}`,
|
|
1079
|
-
});
|
|
1080
|
-
}
|
|
1081
|
-
}
|
|
1082
|
-
|
|
1083
598
|
return response;
|
|
1084
599
|
}
|
|
1085
600
|
|
|
1086
601
|
/**
|
|
1087
|
-
* @param {ContentApplicationValidator.GetNavigationsParam} arg - Arg object.
|
|
1088
602
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1089
603
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1090
|
-
* @returns {Promise<
|
|
1091
|
-
* Success response
|
|
604
|
+
* @returns {Promise<NavigationGetResponse>} - Success response
|
|
1092
605
|
* @name getNavigations
|
|
1093
606
|
* @summary: List navigation items
|
|
1094
607
|
* @description: Get the navigation link items which can be powered to generate menus on application's website or equivalent mobile apps. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/content/getNavigations/).
|
|
@@ -1097,28 +610,6 @@ class Content {
|
|
|
1097
610
|
{ pageNo, pageSize, requestHeaders } = { requestHeaders: {} },
|
|
1098
611
|
{ responseHeaders } = { responseHeaders: false }
|
|
1099
612
|
) {
|
|
1100
|
-
const { error } = ContentApplicationValidator.getNavigations().validate(
|
|
1101
|
-
{ pageNo, pageSize },
|
|
1102
|
-
{ abortEarly: false, allowUnknown: true }
|
|
1103
|
-
);
|
|
1104
|
-
if (error) {
|
|
1105
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
1106
|
-
}
|
|
1107
|
-
|
|
1108
|
-
// Showing warrnings if extra unknown parameters are found
|
|
1109
|
-
const {
|
|
1110
|
-
error: warrning,
|
|
1111
|
-
} = ContentApplicationValidator.getNavigations().validate(
|
|
1112
|
-
{ pageNo, pageSize },
|
|
1113
|
-
{ abortEarly: false, allowUnknown: false }
|
|
1114
|
-
);
|
|
1115
|
-
if (warrning) {
|
|
1116
|
-
Logger({
|
|
1117
|
-
level: "WARN",
|
|
1118
|
-
message: `Parameter Validation warrnings for application > Content > getNavigations \n ${warrning}`,
|
|
1119
|
-
});
|
|
1120
|
-
}
|
|
1121
|
-
|
|
1122
613
|
const query_params = {};
|
|
1123
614
|
query_params["page_no"] = pageNo;
|
|
1124
615
|
query_params["page_size"] = pageSize;
|
|
@@ -1143,32 +634,13 @@ class Content {
|
|
|
1143
634
|
responseData = response[0];
|
|
1144
635
|
}
|
|
1145
636
|
|
|
1146
|
-
const {
|
|
1147
|
-
error: res_error,
|
|
1148
|
-
} = ContentApplicationModel.NavigationGetResponse().validate(responseData, {
|
|
1149
|
-
abortEarly: false,
|
|
1150
|
-
allowUnknown: true,
|
|
1151
|
-
});
|
|
1152
|
-
|
|
1153
|
-
if (res_error) {
|
|
1154
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
1155
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1156
|
-
} else {
|
|
1157
|
-
Logger({
|
|
1158
|
-
level: "WARN",
|
|
1159
|
-
message: `Response Validation Warnings for application > Content > getNavigations \n ${res_error}`,
|
|
1160
|
-
});
|
|
1161
|
-
}
|
|
1162
|
-
}
|
|
1163
|
-
|
|
1164
637
|
return response;
|
|
1165
638
|
}
|
|
1166
639
|
|
|
1167
640
|
/**
|
|
1168
|
-
* @param {ContentApplicationValidator.GetPageParam} arg - Arg object.
|
|
1169
641
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1170
642
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1171
|
-
* @returns {Promise<
|
|
643
|
+
* @returns {Promise<PageSchema>} - Success response
|
|
1172
644
|
* @name getPage
|
|
1173
645
|
* @summary: Get a page
|
|
1174
646
|
* @description: Get detailed information for a specific page within the theme. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/content/getPage/).
|
|
@@ -1177,24 +649,13 @@ class Content {
|
|
|
1177
649
|
{ slug, rootId, requestHeaders } = { requestHeaders: {} },
|
|
1178
650
|
{ responseHeaders } = { responseHeaders: false }
|
|
1179
651
|
) {
|
|
1180
|
-
const
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
1186
|
-
}
|
|
1187
|
-
|
|
1188
|
-
// Showing warrnings if extra unknown parameters are found
|
|
1189
|
-
const { error: warrning } = ContentApplicationValidator.getPage().validate(
|
|
1190
|
-
{ slug, rootId },
|
|
1191
|
-
{ abortEarly: false, allowUnknown: false }
|
|
1192
|
-
);
|
|
1193
|
-
if (warrning) {
|
|
1194
|
-
Logger({
|
|
1195
|
-
level: "WARN",
|
|
1196
|
-
message: `Parameter Validation warrnings for application > Content > getPage \n ${warrning}`,
|
|
652
|
+
const errors = validateRequiredParams(arguments[0], ["slug"]);
|
|
653
|
+
if (errors.length > 0) {
|
|
654
|
+
const error = new FDKClientValidationError({
|
|
655
|
+
message: "Missing required field",
|
|
656
|
+
details: errors,
|
|
1197
657
|
});
|
|
658
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
1198
659
|
}
|
|
1199
660
|
|
|
1200
661
|
const query_params = {};
|
|
@@ -1220,32 +681,13 @@ class Content {
|
|
|
1220
681
|
responseData = response[0];
|
|
1221
682
|
}
|
|
1222
683
|
|
|
1223
|
-
const {
|
|
1224
|
-
error: res_error,
|
|
1225
|
-
} = ContentApplicationModel.PageSchema().validate(responseData, {
|
|
1226
|
-
abortEarly: false,
|
|
1227
|
-
allowUnknown: true,
|
|
1228
|
-
});
|
|
1229
|
-
|
|
1230
|
-
if (res_error) {
|
|
1231
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
1232
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1233
|
-
} else {
|
|
1234
|
-
Logger({
|
|
1235
|
-
level: "WARN",
|
|
1236
|
-
message: `Response Validation Warnings for application > Content > getPage \n ${res_error}`,
|
|
1237
|
-
});
|
|
1238
|
-
}
|
|
1239
|
-
}
|
|
1240
|
-
|
|
1241
684
|
return response;
|
|
1242
685
|
}
|
|
1243
686
|
|
|
1244
687
|
/**
|
|
1245
|
-
* @param {ContentApplicationValidator.GetPagesParam} arg - Arg object.
|
|
1246
688
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1247
689
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1248
|
-
* @returns {Promise<
|
|
690
|
+
* @returns {Promise<PageGetResponse>} - Success response
|
|
1249
691
|
* @name getPages
|
|
1250
692
|
* @summary: Lists pages
|
|
1251
693
|
* @description: Lists all Custom Pages. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/content/getPages/).
|
|
@@ -1254,26 +696,6 @@ class Content {
|
|
|
1254
696
|
{ pageNo, pageSize, requestHeaders } = { requestHeaders: {} },
|
|
1255
697
|
{ responseHeaders } = { responseHeaders: false }
|
|
1256
698
|
) {
|
|
1257
|
-
const { error } = ContentApplicationValidator.getPages().validate(
|
|
1258
|
-
{ pageNo, pageSize },
|
|
1259
|
-
{ abortEarly: false, allowUnknown: true }
|
|
1260
|
-
);
|
|
1261
|
-
if (error) {
|
|
1262
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
1263
|
-
}
|
|
1264
|
-
|
|
1265
|
-
// Showing warrnings if extra unknown parameters are found
|
|
1266
|
-
const { error: warrning } = ContentApplicationValidator.getPages().validate(
|
|
1267
|
-
{ pageNo, pageSize },
|
|
1268
|
-
{ abortEarly: false, allowUnknown: false }
|
|
1269
|
-
);
|
|
1270
|
-
if (warrning) {
|
|
1271
|
-
Logger({
|
|
1272
|
-
level: "WARN",
|
|
1273
|
-
message: `Parameter Validation warrnings for application > Content > getPages \n ${warrning}`,
|
|
1274
|
-
});
|
|
1275
|
-
}
|
|
1276
|
-
|
|
1277
699
|
const query_params = {};
|
|
1278
700
|
query_params["page_no"] = pageNo;
|
|
1279
701
|
query_params["page_size"] = pageSize;
|
|
@@ -1298,32 +720,13 @@ class Content {
|
|
|
1298
720
|
responseData = response[0];
|
|
1299
721
|
}
|
|
1300
722
|
|
|
1301
|
-
const {
|
|
1302
|
-
error: res_error,
|
|
1303
|
-
} = ContentApplicationModel.PageGetResponse().validate(responseData, {
|
|
1304
|
-
abortEarly: false,
|
|
1305
|
-
allowUnknown: true,
|
|
1306
|
-
});
|
|
1307
|
-
|
|
1308
|
-
if (res_error) {
|
|
1309
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
1310
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1311
|
-
} else {
|
|
1312
|
-
Logger({
|
|
1313
|
-
level: "WARN",
|
|
1314
|
-
message: `Response Validation Warnings for application > Content > getPages \n ${res_error}`,
|
|
1315
|
-
});
|
|
1316
|
-
}
|
|
1317
|
-
}
|
|
1318
|
-
|
|
1319
723
|
return response;
|
|
1320
724
|
}
|
|
1321
725
|
|
|
1322
726
|
/**
|
|
1323
|
-
* @param {ContentApplicationValidator.GetSEOConfigurationParam} arg - Arg object.
|
|
1324
727
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1325
728
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1326
|
-
* @returns {Promise<
|
|
729
|
+
* @returns {Promise<SeoComponent>} - Success response
|
|
1327
730
|
* @name getSEOConfiguration
|
|
1328
731
|
* @summary: Get SEO settings
|
|
1329
732
|
* @description: Get search engine optimization configurations of an application. Details include the title, description and an image. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/content/getSEOConfiguration/).
|
|
@@ -1332,30 +735,6 @@ class Content {
|
|
|
1332
735
|
{ requestHeaders } = { requestHeaders: {} },
|
|
1333
736
|
{ responseHeaders } = { responseHeaders: false }
|
|
1334
737
|
) {
|
|
1335
|
-
const {
|
|
1336
|
-
error,
|
|
1337
|
-
} = ContentApplicationValidator.getSEOConfiguration().validate(
|
|
1338
|
-
{},
|
|
1339
|
-
{ abortEarly: false, allowUnknown: true }
|
|
1340
|
-
);
|
|
1341
|
-
if (error) {
|
|
1342
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
1343
|
-
}
|
|
1344
|
-
|
|
1345
|
-
// Showing warrnings if extra unknown parameters are found
|
|
1346
|
-
const {
|
|
1347
|
-
error: warrning,
|
|
1348
|
-
} = ContentApplicationValidator.getSEOConfiguration().validate(
|
|
1349
|
-
{},
|
|
1350
|
-
{ abortEarly: false, allowUnknown: false }
|
|
1351
|
-
);
|
|
1352
|
-
if (warrning) {
|
|
1353
|
-
Logger({
|
|
1354
|
-
level: "WARN",
|
|
1355
|
-
message: `Parameter Validation warrnings for application > Content > getSEOConfiguration \n ${warrning}`,
|
|
1356
|
-
});
|
|
1357
|
-
}
|
|
1358
|
-
|
|
1359
738
|
const query_params = {};
|
|
1360
739
|
|
|
1361
740
|
const xHeaders = {};
|
|
@@ -1378,32 +757,13 @@ class Content {
|
|
|
1378
757
|
responseData = response[0];
|
|
1379
758
|
}
|
|
1380
759
|
|
|
1381
|
-
const {
|
|
1382
|
-
error: res_error,
|
|
1383
|
-
} = ContentApplicationModel.SeoComponent().validate(responseData, {
|
|
1384
|
-
abortEarly: false,
|
|
1385
|
-
allowUnknown: true,
|
|
1386
|
-
});
|
|
1387
|
-
|
|
1388
|
-
if (res_error) {
|
|
1389
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
1390
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1391
|
-
} else {
|
|
1392
|
-
Logger({
|
|
1393
|
-
level: "WARN",
|
|
1394
|
-
message: `Response Validation Warnings for application > Content > getSEOConfiguration \n ${res_error}`,
|
|
1395
|
-
});
|
|
1396
|
-
}
|
|
1397
|
-
}
|
|
1398
|
-
|
|
1399
760
|
return response;
|
|
1400
761
|
}
|
|
1401
762
|
|
|
1402
763
|
/**
|
|
1403
|
-
* @param {ContentApplicationValidator.GetSEOMarkupSchemasParam} arg - Arg object.
|
|
1404
764
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1405
765
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1406
|
-
* @returns {Promise<
|
|
766
|
+
* @returns {Promise<SeoSchemaComponent>} - Success response
|
|
1407
767
|
* @name getSEOMarkupSchemas
|
|
1408
768
|
* @summary: List SEO Markup schemas
|
|
1409
769
|
* @description: Get all SEO Markup schema Templates setup for an application. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/content/getSEOMarkupSchemas/).
|
|
@@ -1412,30 +772,6 @@ class Content {
|
|
|
1412
772
|
{ pageType, active, requestHeaders } = { requestHeaders: {} },
|
|
1413
773
|
{ responseHeaders } = { responseHeaders: false }
|
|
1414
774
|
) {
|
|
1415
|
-
const {
|
|
1416
|
-
error,
|
|
1417
|
-
} = ContentApplicationValidator.getSEOMarkupSchemas().validate(
|
|
1418
|
-
{ pageType, active },
|
|
1419
|
-
{ abortEarly: false, allowUnknown: true }
|
|
1420
|
-
);
|
|
1421
|
-
if (error) {
|
|
1422
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
1423
|
-
}
|
|
1424
|
-
|
|
1425
|
-
// Showing warrnings if extra unknown parameters are found
|
|
1426
|
-
const {
|
|
1427
|
-
error: warrning,
|
|
1428
|
-
} = ContentApplicationValidator.getSEOMarkupSchemas().validate(
|
|
1429
|
-
{ pageType, active },
|
|
1430
|
-
{ abortEarly: false, allowUnknown: false }
|
|
1431
|
-
);
|
|
1432
|
-
if (warrning) {
|
|
1433
|
-
Logger({
|
|
1434
|
-
level: "WARN",
|
|
1435
|
-
message: `Parameter Validation warrnings for application > Content > getSEOMarkupSchemas \n ${warrning}`,
|
|
1436
|
-
});
|
|
1437
|
-
}
|
|
1438
|
-
|
|
1439
775
|
const query_params = {};
|
|
1440
776
|
query_params["page_type"] = pageType;
|
|
1441
777
|
query_params["active"] = active;
|
|
@@ -1460,32 +796,13 @@ class Content {
|
|
|
1460
796
|
responseData = response[0];
|
|
1461
797
|
}
|
|
1462
798
|
|
|
1463
|
-
const {
|
|
1464
|
-
error: res_error,
|
|
1465
|
-
} = ContentApplicationModel.SeoSchemaComponent().validate(responseData, {
|
|
1466
|
-
abortEarly: false,
|
|
1467
|
-
allowUnknown: true,
|
|
1468
|
-
});
|
|
1469
|
-
|
|
1470
|
-
if (res_error) {
|
|
1471
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
1472
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1473
|
-
} else {
|
|
1474
|
-
Logger({
|
|
1475
|
-
level: "WARN",
|
|
1476
|
-
message: `Response Validation Warnings for application > Content > getSEOMarkupSchemas \n ${res_error}`,
|
|
1477
|
-
});
|
|
1478
|
-
}
|
|
1479
|
-
}
|
|
1480
|
-
|
|
1481
799
|
return response;
|
|
1482
800
|
}
|
|
1483
801
|
|
|
1484
802
|
/**
|
|
1485
|
-
* @param {ContentApplicationValidator.GetSlideshowParam} arg - Arg object.
|
|
1486
803
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1487
804
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1488
|
-
* @returns {Promise<
|
|
805
|
+
* @returns {Promise<SlideshowSchema>} - Success response
|
|
1489
806
|
* @name getSlideshow
|
|
1490
807
|
* @summary: Get a Slideshow
|
|
1491
808
|
* @description: Get a slideshow using its `slug`. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/content/getSlideshow/).
|
|
@@ -1494,26 +811,13 @@ class Content {
|
|
|
1494
811
|
{ slug, requestHeaders } = { requestHeaders: {} },
|
|
1495
812
|
{ responseHeaders } = { responseHeaders: false }
|
|
1496
813
|
) {
|
|
1497
|
-
const
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
1503
|
-
}
|
|
1504
|
-
|
|
1505
|
-
// Showing warrnings if extra unknown parameters are found
|
|
1506
|
-
const {
|
|
1507
|
-
error: warrning,
|
|
1508
|
-
} = ContentApplicationValidator.getSlideshow().validate(
|
|
1509
|
-
{ slug },
|
|
1510
|
-
{ abortEarly: false, allowUnknown: false }
|
|
1511
|
-
);
|
|
1512
|
-
if (warrning) {
|
|
1513
|
-
Logger({
|
|
1514
|
-
level: "WARN",
|
|
1515
|
-
message: `Parameter Validation warrnings for application > Content > getSlideshow \n ${warrning}`,
|
|
814
|
+
const errors = validateRequiredParams(arguments[0], ["slug"]);
|
|
815
|
+
if (errors.length > 0) {
|
|
816
|
+
const error = new FDKClientValidationError({
|
|
817
|
+
message: "Missing required field",
|
|
818
|
+
details: errors,
|
|
1516
819
|
});
|
|
820
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
1517
821
|
}
|
|
1518
822
|
|
|
1519
823
|
const query_params = {};
|
|
@@ -1538,32 +842,13 @@ class Content {
|
|
|
1538
842
|
responseData = response[0];
|
|
1539
843
|
}
|
|
1540
844
|
|
|
1541
|
-
const {
|
|
1542
|
-
error: res_error,
|
|
1543
|
-
} = ContentApplicationModel.SlideshowSchema().validate(responseData, {
|
|
1544
|
-
abortEarly: false,
|
|
1545
|
-
allowUnknown: true,
|
|
1546
|
-
});
|
|
1547
|
-
|
|
1548
|
-
if (res_error) {
|
|
1549
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
1550
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1551
|
-
} else {
|
|
1552
|
-
Logger({
|
|
1553
|
-
level: "WARN",
|
|
1554
|
-
message: `Response Validation Warnings for application > Content > getSlideshow \n ${res_error}`,
|
|
1555
|
-
});
|
|
1556
|
-
}
|
|
1557
|
-
}
|
|
1558
|
-
|
|
1559
845
|
return response;
|
|
1560
846
|
}
|
|
1561
847
|
|
|
1562
848
|
/**
|
|
1563
|
-
* @param {ContentApplicationValidator.GetSlideshowsParam} arg - Arg object.
|
|
1564
849
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1565
850
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1566
|
-
* @returns {Promise<
|
|
851
|
+
* @returns {Promise<SlideshowGetResponse>} - Success response
|
|
1567
852
|
* @name getSlideshows
|
|
1568
853
|
* @summary: List Slideshows
|
|
1569
854
|
* @description: List slideshows along with their details. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/content/getSlideshows/).
|
|
@@ -1572,28 +857,6 @@ class Content {
|
|
|
1572
857
|
{ pageNo, pageSize, requestHeaders } = { requestHeaders: {} },
|
|
1573
858
|
{ responseHeaders } = { responseHeaders: false }
|
|
1574
859
|
) {
|
|
1575
|
-
const { error } = ContentApplicationValidator.getSlideshows().validate(
|
|
1576
|
-
{ pageNo, pageSize },
|
|
1577
|
-
{ abortEarly: false, allowUnknown: true }
|
|
1578
|
-
);
|
|
1579
|
-
if (error) {
|
|
1580
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
1581
|
-
}
|
|
1582
|
-
|
|
1583
|
-
// Showing warrnings if extra unknown parameters are found
|
|
1584
|
-
const {
|
|
1585
|
-
error: warrning,
|
|
1586
|
-
} = ContentApplicationValidator.getSlideshows().validate(
|
|
1587
|
-
{ pageNo, pageSize },
|
|
1588
|
-
{ abortEarly: false, allowUnknown: false }
|
|
1589
|
-
);
|
|
1590
|
-
if (warrning) {
|
|
1591
|
-
Logger({
|
|
1592
|
-
level: "WARN",
|
|
1593
|
-
message: `Parameter Validation warrnings for application > Content > getSlideshows \n ${warrning}`,
|
|
1594
|
-
});
|
|
1595
|
-
}
|
|
1596
|
-
|
|
1597
860
|
const query_params = {};
|
|
1598
861
|
query_params["page_no"] = pageNo;
|
|
1599
862
|
query_params["page_size"] = pageSize;
|
|
@@ -1618,31 +881,13 @@ class Content {
|
|
|
1618
881
|
responseData = response[0];
|
|
1619
882
|
}
|
|
1620
883
|
|
|
1621
|
-
const {
|
|
1622
|
-
error: res_error,
|
|
1623
|
-
} = ContentApplicationModel.SlideshowGetResponse().validate(responseData, {
|
|
1624
|
-
abortEarly: false,
|
|
1625
|
-
allowUnknown: true,
|
|
1626
|
-
});
|
|
1627
|
-
|
|
1628
|
-
if (res_error) {
|
|
1629
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
1630
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1631
|
-
} else {
|
|
1632
|
-
Logger({
|
|
1633
|
-
level: "WARN",
|
|
1634
|
-
message: `Response Validation Warnings for application > Content > getSlideshows \n ${res_error}`,
|
|
1635
|
-
});
|
|
1636
|
-
}
|
|
1637
|
-
}
|
|
1638
|
-
|
|
1639
884
|
return response;
|
|
1640
885
|
}
|
|
1641
886
|
|
|
1642
887
|
/**
|
|
1643
888
|
* @param {Object} arg - Arg object.
|
|
1644
889
|
* @param {number} [arg.pageSize] - The number of items to retrieve in each page.
|
|
1645
|
-
* @returns {Paginator<
|
|
890
|
+
* @returns {Paginator<SlideshowGetResponse>}
|
|
1646
891
|
* @summary: List Slideshows
|
|
1647
892
|
* @description: List slideshows along with their details.
|
|
1648
893
|
*/
|
|
@@ -1667,10 +912,9 @@ class Content {
|
|
|
1667
912
|
}
|
|
1668
913
|
|
|
1669
914
|
/**
|
|
1670
|
-
* @param {ContentApplicationValidator.GetSupportInformationParam} arg - Arg object.
|
|
1671
915
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1672
916
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1673
|
-
* @returns {Promise<
|
|
917
|
+
* @returns {Promise<Support>} - Success response
|
|
1674
918
|
* @name getSupportInformation
|
|
1675
919
|
* @summary: Get customer support information
|
|
1676
920
|
* @description: Get customer support contact details. Contact Details can be either a phone number or an email-id or both. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/content/getSupportInformation/).
|
|
@@ -1679,30 +923,6 @@ class Content {
|
|
|
1679
923
|
{ requestHeaders } = { requestHeaders: {} },
|
|
1680
924
|
{ responseHeaders } = { responseHeaders: false }
|
|
1681
925
|
) {
|
|
1682
|
-
const {
|
|
1683
|
-
error,
|
|
1684
|
-
} = ContentApplicationValidator.getSupportInformation().validate(
|
|
1685
|
-
{},
|
|
1686
|
-
{ abortEarly: false, allowUnknown: true }
|
|
1687
|
-
);
|
|
1688
|
-
if (error) {
|
|
1689
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
1690
|
-
}
|
|
1691
|
-
|
|
1692
|
-
// Showing warrnings if extra unknown parameters are found
|
|
1693
|
-
const {
|
|
1694
|
-
error: warrning,
|
|
1695
|
-
} = ContentApplicationValidator.getSupportInformation().validate(
|
|
1696
|
-
{},
|
|
1697
|
-
{ abortEarly: false, allowUnknown: false }
|
|
1698
|
-
);
|
|
1699
|
-
if (warrning) {
|
|
1700
|
-
Logger({
|
|
1701
|
-
level: "WARN",
|
|
1702
|
-
message: `Parameter Validation warrnings for application > Content > getSupportInformation \n ${warrning}`,
|
|
1703
|
-
});
|
|
1704
|
-
}
|
|
1705
|
-
|
|
1706
926
|
const query_params = {};
|
|
1707
927
|
|
|
1708
928
|
const xHeaders = {};
|
|
@@ -1725,32 +945,13 @@ class Content {
|
|
|
1725
945
|
responseData = response[0];
|
|
1726
946
|
}
|
|
1727
947
|
|
|
1728
|
-
const {
|
|
1729
|
-
error: res_error,
|
|
1730
|
-
} = ContentApplicationModel.Support().validate(responseData, {
|
|
1731
|
-
abortEarly: false,
|
|
1732
|
-
allowUnknown: true,
|
|
1733
|
-
});
|
|
1734
|
-
|
|
1735
|
-
if (res_error) {
|
|
1736
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
1737
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1738
|
-
} else {
|
|
1739
|
-
Logger({
|
|
1740
|
-
level: "WARN",
|
|
1741
|
-
message: `Response Validation Warnings for application > Content > getSupportInformation \n ${res_error}`,
|
|
1742
|
-
});
|
|
1743
|
-
}
|
|
1744
|
-
}
|
|
1745
|
-
|
|
1746
948
|
return response;
|
|
1747
949
|
}
|
|
1748
950
|
|
|
1749
951
|
/**
|
|
1750
|
-
* @param {ContentApplicationValidator.GetTagsParam} arg - Arg object.
|
|
1751
952
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1752
953
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1753
|
-
* @returns {Promise<
|
|
954
|
+
* @returns {Promise<TagsSchema>} - Success response
|
|
1754
955
|
* @name getTags
|
|
1755
956
|
* @summary: Get HTML tags
|
|
1756
957
|
* @description: Lists HTML tags to power additional functionalities within an application. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/content/getTags/).
|
|
@@ -1759,26 +960,6 @@ class Content {
|
|
|
1759
960
|
{ requestHeaders } = { requestHeaders: {} },
|
|
1760
961
|
{ responseHeaders } = { responseHeaders: false }
|
|
1761
962
|
) {
|
|
1762
|
-
const { error } = ContentApplicationValidator.getTags().validate(
|
|
1763
|
-
{},
|
|
1764
|
-
{ abortEarly: false, allowUnknown: true }
|
|
1765
|
-
);
|
|
1766
|
-
if (error) {
|
|
1767
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
1768
|
-
}
|
|
1769
|
-
|
|
1770
|
-
// Showing warrnings if extra unknown parameters are found
|
|
1771
|
-
const { error: warrning } = ContentApplicationValidator.getTags().validate(
|
|
1772
|
-
{},
|
|
1773
|
-
{ abortEarly: false, allowUnknown: false }
|
|
1774
|
-
);
|
|
1775
|
-
if (warrning) {
|
|
1776
|
-
Logger({
|
|
1777
|
-
level: "WARN",
|
|
1778
|
-
message: `Parameter Validation warrnings for application > Content > getTags \n ${warrning}`,
|
|
1779
|
-
});
|
|
1780
|
-
}
|
|
1781
|
-
|
|
1782
963
|
const query_params = {};
|
|
1783
964
|
|
|
1784
965
|
const xHeaders = {};
|
|
@@ -1801,24 +982,6 @@ class Content {
|
|
|
1801
982
|
responseData = response[0];
|
|
1802
983
|
}
|
|
1803
984
|
|
|
1804
|
-
const {
|
|
1805
|
-
error: res_error,
|
|
1806
|
-
} = ContentApplicationModel.TagsSchema().validate(responseData, {
|
|
1807
|
-
abortEarly: false,
|
|
1808
|
-
allowUnknown: true,
|
|
1809
|
-
});
|
|
1810
|
-
|
|
1811
|
-
if (res_error) {
|
|
1812
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
1813
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1814
|
-
} else {
|
|
1815
|
-
Logger({
|
|
1816
|
-
level: "WARN",
|
|
1817
|
-
message: `Response Validation Warnings for application > Content > getTags \n ${res_error}`,
|
|
1818
|
-
});
|
|
1819
|
-
}
|
|
1820
|
-
}
|
|
1821
|
-
|
|
1822
985
|
return response;
|
|
1823
986
|
}
|
|
1824
987
|
}
|