@gofynd/fdk-client-javascript 1.0.1 → 1.0.2
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/documentation/application/CART.md +251 -251
- package/documentation/application/CATALOG.md +414 -414
- package/documentation/application/CONTENT.md +15 -1
- package/documentation/application/ORDER.md +290 -290
- package/documentation/application/PAYMENT.md +255 -255
- package/documentation/application/POSCART.md +297 -297
- package/documentation/platform/CART.md +499 -499
- package/documentation/platform/CATALOG.md +3088 -2702
- package/documentation/platform/COMPANYPROFILE.md +201 -201
- package/documentation/platform/CONTENT.md +123 -1
- package/documentation/platform/ORDER.md +1233 -1158
- package/documentation/platform/PARTNER.md +7 -7
- package/documentation/platform/PAYMENT.md +83 -83
- package/package.json +1 -1
- package/sdk/application/ApplicationConfig.js +1 -1
- package/sdk/application/Cart/CartApplicationClient.js +619 -108
- package/sdk/application/Cart/CartApplicationModel.d.ts +7 -7
- package/sdk/application/Cart/CartApplicationModel.js +335 -335
- package/sdk/application/Catalog/CatalogApplicationClient.d.ts +1 -1
- package/sdk/application/Catalog/CatalogApplicationClient.js +730 -134
- package/sdk/application/Catalog/CatalogApplicationModel.d.ts +21 -21
- package/sdk/application/Catalog/CatalogApplicationModel.js +547 -547
- package/sdk/application/Common/CommonApplicationClient.js +48 -8
- package/sdk/application/Communication/CommunicationApplicationClient.js +75 -14
- package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +1 -1
- package/sdk/application/Configuration/ConfigurationApplicationClient.js +392 -66
- package/sdk/application/Content/ContentApplicationClient.js +444 -76
- package/sdk/application/Content/ContentApplicationModel.d.ts +1 -0
- package/sdk/application/Content/ContentApplicationModel.js +11 -1
- package/sdk/application/FileStorage/FileStorageApplicationClient.js +74 -12
- package/sdk/application/Lead/LeadApplicationClient.js +164 -30
- package/sdk/application/Logistic/LogisticApplicationClient.js +98 -16
- package/sdk/application/Order/OrderApplicationClient.d.ts +1 -1
- package/sdk/application/Order/OrderApplicationClient.js +287 -54
- package/sdk/application/Order/OrderApplicationModel.d.ts +19 -19
- package/sdk/application/Order/OrderApplicationModel.js +357 -357
- package/sdk/application/Payment/PaymentApplicationClient.js +961 -186
- package/sdk/application/Payment/PaymentApplicationModel.d.ts +3 -3
- package/sdk/application/Payment/PaymentApplicationModel.js +352 -352
- package/sdk/application/PosCart/PosCartApplicationClient.js +645 -114
- package/sdk/application/PosCart/PosCartApplicationModel.d.ts +15 -15
- package/sdk/application/PosCart/PosCartApplicationModel.js +389 -389
- package/sdk/application/Rewards/RewardsApplicationClient.js +168 -28
- package/sdk/application/Share/ShareApplicationClient.js +157 -32
- package/sdk/application/Theme/ThemeApplicationClient.js +94 -16
- package/sdk/application/User/UserApplicationClient.js +806 -148
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.d.ts +16 -8
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.js +191 -34
- package/sdk/platform/Analytics/AnalyticsPlatformClient.d.ts +8 -4
- package/sdk/platform/Analytics/AnalyticsPlatformClient.js +103 -16
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.d.ts +8 -4
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +103 -16
- package/sdk/platform/Billing/BillingPlatformClient.d.ts +24 -12
- package/sdk/platform/Billing/BillingPlatformClient.js +299 -54
- package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +34 -17
- package/sdk/platform/Cart/CartPlatformApplicationClient.js +409 -72
- package/sdk/platform/Cart/CartPlatformModel.d.ts +35 -35
- package/sdk/platform/Cart/CartPlatformModel.js +617 -617
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +167 -114
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +1562 -453
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +8 -8
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +39 -39
- package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +314 -196
- package/sdk/platform/Catalog/CatalogPlatformClient.js +2459 -718
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +103 -94
- package/sdk/platform/Catalog/CatalogPlatformModel.js +2063 -1797
- package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +17 -15
- package/sdk/platform/Catalog/CatalogPlatformValidator.js +95 -76
- package/sdk/platform/Common/CommonPlatformClient.d.ts +4 -2
- package/sdk/platform/Common/CommonPlatformClient.js +51 -8
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +80 -40
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +1000 -168
- package/sdk/platform/Communication/CommunicationPlatformClient.d.ts +2 -1
- package/sdk/platform/Communication/CommunicationPlatformClient.js +28 -4
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +27 -14
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +335 -54
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +10 -10
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +278 -278
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +56 -28
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +702 -118
- package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +36 -18
- package/sdk/platform/Configuration/ConfigurationPlatformClient.js +457 -82
- package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +148 -67
- package/sdk/platform/Content/ContentPlatformApplicationClient.js +1724 -284
- package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +1 -0
- package/sdk/platform/Content/ContentPlatformApplicationValidator.js +7 -0
- package/sdk/platform/Content/ContentPlatformModel.d.ts +4 -0
- package/sdk/platform/Content/ContentPlatformModel.js +43 -1
- package/sdk/platform/Discount/DiscountPlatformClient.d.ts +21 -10
- package/sdk/platform/Discount/DiscountPlatformClient.js +270 -44
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +8 -4
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +102 -16
- package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +12 -6
- package/sdk/platform/FileStorage/FileStoragePlatformClient.js +150 -24
- package/sdk/platform/Inventory/InventoryPlatformClient.d.ts +27 -14
- package/sdk/platform/Inventory/InventoryPlatformClient.js +316 -52
- package/sdk/platform/Lead/LeadPlatformApplicationClient.d.ts +26 -13
- package/sdk/platform/Lead/LeadPlatformApplicationClient.js +311 -52
- package/sdk/platform/Lead/LeadPlatformClient.d.ts +22 -11
- package/sdk/platform/Lead/LeadPlatformClient.js +266 -44
- package/sdk/platform/OAuthClient.js +8 -8
- package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +6 -3
- package/sdk/platform/Order/OrderPlatformApplicationClient.js +78 -14
- package/sdk/platform/Order/OrderPlatformClient.d.ts +95 -43
- package/sdk/platform/Order/OrderPlatformClient.js +1062 -180
- package/sdk/platform/Order/OrderPlatformModel.d.ts +64 -60
- package/sdk/platform/Order/OrderPlatformModel.js +1481 -1425
- package/sdk/platform/Order/OrderPlatformValidator.js +5 -0
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.d.ts +4 -2
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.js +52 -8
- package/sdk/platform/Partner/PartnerPlatformModel.d.ts +1 -1
- package/sdk/platform/Partner/PartnerPlatformModel.js +8 -8
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +22 -11
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +287 -56
- package/sdk/platform/Payment/PaymentPlatformClient.d.ts +21 -11
- package/sdk/platform/Payment/PaymentPlatformClient.js +263 -48
- package/sdk/platform/Payment/PaymentPlatformModel.js +122 -122
- package/sdk/platform/PlatformApplicationClient.d.ts +2959 -2787
- package/sdk/platform/PlatformApplicationClient.js +3420 -3212
- package/sdk/platform/PlatformClient.d.ts +2959 -2787
- package/sdk/platform/PlatformClient.js +3420 -3212
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.d.ts +26 -13
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +308 -54
- package/sdk/platform/Share/SharePlatformApplicationClient.d.ts +8 -4
- package/sdk/platform/Share/SharePlatformApplicationClient.js +94 -16
- package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +47 -23
- package/sdk/platform/Theme/ThemePlatformApplicationClient.js +571 -96
- package/sdk/platform/User/UserPlatformApplicationClient.d.ts +24 -12
- package/sdk/platform/User/UserPlatformApplicationClient.js +296 -48
- package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +12 -6
- package/sdk/platform/Webhook/WebhookPlatformClient.js +157 -30
- package/sdk/public/Configuration/ConfigurationPublicClient.js +51 -8
- package/sdk/public/Inventory/InventoryPublicClient.js +149 -26
- package/sdk/public/Webhook/WebhookPublicClient.js +51 -10
|
@@ -3,6 +3,8 @@ const constructUrl = require("../constructUrl");
|
|
|
3
3
|
const Paginator = require("../../common/Paginator");
|
|
4
4
|
const { FDKClientValidationError } = require("../../common/FDKError");
|
|
5
5
|
const ContentValidator = require("./ContentApplicationValidator");
|
|
6
|
+
const ContentModel = require("./ContentApplicationModel");
|
|
7
|
+
const { Logger } = require("./../../common/Logger");
|
|
6
8
|
|
|
7
9
|
class Content {
|
|
8
10
|
constructor(_conf) {
|
|
@@ -52,7 +54,7 @@ class Content {
|
|
|
52
54
|
* @summary: Get live announcements
|
|
53
55
|
* @description: Announcements are useful to highlight a message or information on top of a webpage. Use this API to retrieve live announcements. Get announcements on individual pages or for all pages.
|
|
54
56
|
*/
|
|
55
|
-
getAnnouncements({} = {}) {
|
|
57
|
+
async getAnnouncements({} = {}) {
|
|
56
58
|
const { error } = ContentValidator.getAnnouncements().validate(
|
|
57
59
|
{},
|
|
58
60
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -67,15 +69,18 @@ class Content {
|
|
|
67
69
|
{ abortEarly: false, allowUnknown: false }
|
|
68
70
|
);
|
|
69
71
|
if (warrning) {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
+
Logger({
|
|
73
|
+
level: "WARN",
|
|
74
|
+
message: "Parameter Validation warrnings for getAnnouncements",
|
|
75
|
+
});
|
|
76
|
+
Logger({ level: "WARN", message: warrning });
|
|
72
77
|
}
|
|
73
78
|
|
|
74
79
|
const query_params = {};
|
|
75
80
|
|
|
76
81
|
const xHeaders = {};
|
|
77
82
|
|
|
78
|
-
|
|
83
|
+
const response = await APIClient.execute(
|
|
79
84
|
this._conf,
|
|
80
85
|
"get",
|
|
81
86
|
constructUrl({
|
|
@@ -86,6 +91,23 @@ class Content {
|
|
|
86
91
|
undefined,
|
|
87
92
|
xHeaders
|
|
88
93
|
);
|
|
94
|
+
|
|
95
|
+
const {
|
|
96
|
+
error: res_error,
|
|
97
|
+
} = ContentModel.AnnouncementsResponseSchema().validate(response, {
|
|
98
|
+
abortEarly: false,
|
|
99
|
+
allowUnknown: false,
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
if (res_error) {
|
|
103
|
+
Logger({
|
|
104
|
+
level: "WARN",
|
|
105
|
+
message: "Response Validation Warnnings for getAnnouncements",
|
|
106
|
+
});
|
|
107
|
+
Logger({ level: "WARN", message: res_error });
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
return response;
|
|
89
111
|
}
|
|
90
112
|
|
|
91
113
|
/**
|
|
@@ -98,7 +120,7 @@ class Content {
|
|
|
98
120
|
* @summary: Get a blog
|
|
99
121
|
* @description: Use this API to get the details of a blog using its slug. Details include the title, reading time, publish status, feature image, tags, author, etc.
|
|
100
122
|
*/
|
|
101
|
-
getBlog({ slug, rootId } = {}) {
|
|
123
|
+
async getBlog({ slug, rootId } = {}) {
|
|
102
124
|
const { error } = ContentValidator.getBlog().validate(
|
|
103
125
|
{ slug, rootId },
|
|
104
126
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -113,8 +135,11 @@ class Content {
|
|
|
113
135
|
{ abortEarly: false, allowUnknown: false }
|
|
114
136
|
);
|
|
115
137
|
if (warrning) {
|
|
116
|
-
|
|
117
|
-
|
|
138
|
+
Logger({
|
|
139
|
+
level: "WARN",
|
|
140
|
+
message: "Parameter Validation warrnings for getBlog",
|
|
141
|
+
});
|
|
142
|
+
Logger({ level: "WARN", message: warrning });
|
|
118
143
|
}
|
|
119
144
|
|
|
120
145
|
const query_params = {};
|
|
@@ -122,7 +147,7 @@ class Content {
|
|
|
122
147
|
|
|
123
148
|
const xHeaders = {};
|
|
124
149
|
|
|
125
|
-
|
|
150
|
+
const response = await APIClient.execute(
|
|
126
151
|
this._conf,
|
|
127
152
|
"get",
|
|
128
153
|
constructUrl({
|
|
@@ -133,6 +158,21 @@ class Content {
|
|
|
133
158
|
undefined,
|
|
134
159
|
xHeaders
|
|
135
160
|
);
|
|
161
|
+
|
|
162
|
+
const { error: res_error } = ContentModel.BlogSchema().validate(response, {
|
|
163
|
+
abortEarly: false,
|
|
164
|
+
allowUnknown: false,
|
|
165
|
+
});
|
|
166
|
+
|
|
167
|
+
if (res_error) {
|
|
168
|
+
Logger({
|
|
169
|
+
level: "WARN",
|
|
170
|
+
message: "Response Validation Warnnings for getBlog",
|
|
171
|
+
});
|
|
172
|
+
Logger({ level: "WARN", message: res_error });
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
return response;
|
|
136
176
|
}
|
|
137
177
|
|
|
138
178
|
/**
|
|
@@ -144,7 +184,7 @@ class Content {
|
|
|
144
184
|
* @summary: Get a list of blogs
|
|
145
185
|
* @description: Use this API to get all the blogs.
|
|
146
186
|
*/
|
|
147
|
-
getBlogs({ pageNo, pageSize } = {}) {
|
|
187
|
+
async getBlogs({ pageNo, pageSize } = {}) {
|
|
148
188
|
const { error } = ContentValidator.getBlogs().validate(
|
|
149
189
|
{ pageNo, pageSize },
|
|
150
190
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -159,8 +199,11 @@ class Content {
|
|
|
159
199
|
{ abortEarly: false, allowUnknown: false }
|
|
160
200
|
);
|
|
161
201
|
if (warrning) {
|
|
162
|
-
|
|
163
|
-
|
|
202
|
+
Logger({
|
|
203
|
+
level: "WARN",
|
|
204
|
+
message: "Parameter Validation warrnings for getBlogs",
|
|
205
|
+
});
|
|
206
|
+
Logger({ level: "WARN", message: warrning });
|
|
164
207
|
}
|
|
165
208
|
|
|
166
209
|
const query_params = {};
|
|
@@ -169,7 +212,7 @@ class Content {
|
|
|
169
212
|
|
|
170
213
|
const xHeaders = {};
|
|
171
214
|
|
|
172
|
-
|
|
215
|
+
const response = await APIClient.execute(
|
|
173
216
|
this._conf,
|
|
174
217
|
"get",
|
|
175
218
|
constructUrl({
|
|
@@ -180,6 +223,23 @@ class Content {
|
|
|
180
223
|
undefined,
|
|
181
224
|
xHeaders
|
|
182
225
|
);
|
|
226
|
+
|
|
227
|
+
const {
|
|
228
|
+
error: res_error,
|
|
229
|
+
} = ContentModel.BlogGetResponse().validate(response, {
|
|
230
|
+
abortEarly: false,
|
|
231
|
+
allowUnknown: false,
|
|
232
|
+
});
|
|
233
|
+
|
|
234
|
+
if (res_error) {
|
|
235
|
+
Logger({
|
|
236
|
+
level: "WARN",
|
|
237
|
+
message: "Response Validation Warnnings for getBlogs",
|
|
238
|
+
});
|
|
239
|
+
Logger({ level: "WARN", message: res_error });
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
return response;
|
|
183
243
|
}
|
|
184
244
|
|
|
185
245
|
/**
|
|
@@ -214,7 +274,7 @@ class Content {
|
|
|
214
274
|
* @summary: Get the data loaders associated with an application
|
|
215
275
|
* @description: Use this API to get all selected data loaders of the application in the form of tags.
|
|
216
276
|
*/
|
|
217
|
-
getDataLoaders({} = {}) {
|
|
277
|
+
async getDataLoaders({} = {}) {
|
|
218
278
|
const { error } = ContentValidator.getDataLoaders().validate(
|
|
219
279
|
{},
|
|
220
280
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -229,15 +289,18 @@ class Content {
|
|
|
229
289
|
{ abortEarly: false, allowUnknown: false }
|
|
230
290
|
);
|
|
231
291
|
if (warrning) {
|
|
232
|
-
|
|
233
|
-
|
|
292
|
+
Logger({
|
|
293
|
+
level: "WARN",
|
|
294
|
+
message: "Parameter Validation warrnings for getDataLoaders",
|
|
295
|
+
});
|
|
296
|
+
Logger({ level: "WARN", message: warrning });
|
|
234
297
|
}
|
|
235
298
|
|
|
236
299
|
const query_params = {};
|
|
237
300
|
|
|
238
301
|
const xHeaders = {};
|
|
239
302
|
|
|
240
|
-
|
|
303
|
+
const response = await APIClient.execute(
|
|
241
304
|
this._conf,
|
|
242
305
|
"get",
|
|
243
306
|
constructUrl({
|
|
@@ -248,6 +311,23 @@ class Content {
|
|
|
248
311
|
undefined,
|
|
249
312
|
xHeaders
|
|
250
313
|
);
|
|
314
|
+
|
|
315
|
+
const {
|
|
316
|
+
error: res_error,
|
|
317
|
+
} = ContentModel.DataLoadersSchema().validate(response, {
|
|
318
|
+
abortEarly: false,
|
|
319
|
+
allowUnknown: false,
|
|
320
|
+
});
|
|
321
|
+
|
|
322
|
+
if (res_error) {
|
|
323
|
+
Logger({
|
|
324
|
+
level: "WARN",
|
|
325
|
+
message: "Response Validation Warnnings for getDataLoaders",
|
|
326
|
+
});
|
|
327
|
+
Logger({ level: "WARN", message: res_error });
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
return response;
|
|
251
331
|
}
|
|
252
332
|
|
|
253
333
|
/**
|
|
@@ -256,7 +336,7 @@ class Content {
|
|
|
256
336
|
* @summary: Get a list of FAQs
|
|
257
337
|
* @description: Use this API to get a list of frequently asked questions. Users will benefit from it when facing any issue with the website.
|
|
258
338
|
*/
|
|
259
|
-
getFaqs({} = {}) {
|
|
339
|
+
async getFaqs({} = {}) {
|
|
260
340
|
const { error } = ContentValidator.getFaqs().validate(
|
|
261
341
|
{},
|
|
262
342
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -271,15 +351,18 @@ class Content {
|
|
|
271
351
|
{ abortEarly: false, allowUnknown: false }
|
|
272
352
|
);
|
|
273
353
|
if (warrning) {
|
|
274
|
-
|
|
275
|
-
|
|
354
|
+
Logger({
|
|
355
|
+
level: "WARN",
|
|
356
|
+
message: "Parameter Validation warrnings for getFaqs",
|
|
357
|
+
});
|
|
358
|
+
Logger({ level: "WARN", message: warrning });
|
|
276
359
|
}
|
|
277
360
|
|
|
278
361
|
const query_params = {};
|
|
279
362
|
|
|
280
363
|
const xHeaders = {};
|
|
281
364
|
|
|
282
|
-
|
|
365
|
+
const response = await APIClient.execute(
|
|
283
366
|
this._conf,
|
|
284
367
|
"get",
|
|
285
368
|
constructUrl({
|
|
@@ -290,6 +373,23 @@ class Content {
|
|
|
290
373
|
undefined,
|
|
291
374
|
xHeaders
|
|
292
375
|
);
|
|
376
|
+
|
|
377
|
+
const {
|
|
378
|
+
error: res_error,
|
|
379
|
+
} = ContentModel.FaqResponseSchema().validate(response, {
|
|
380
|
+
abortEarly: false,
|
|
381
|
+
allowUnknown: false,
|
|
382
|
+
});
|
|
383
|
+
|
|
384
|
+
if (res_error) {
|
|
385
|
+
Logger({
|
|
386
|
+
level: "WARN",
|
|
387
|
+
message: "Response Validation Warnnings for getFaqs",
|
|
388
|
+
});
|
|
389
|
+
Logger({ level: "WARN", message: res_error });
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
return response;
|
|
293
393
|
}
|
|
294
394
|
|
|
295
395
|
/**
|
|
@@ -298,7 +398,7 @@ class Content {
|
|
|
298
398
|
* @summary: Get a list of FAQ categories
|
|
299
399
|
* @description: FAQs can be divided into categories. Use this API to get a list of FAQ categories.
|
|
300
400
|
*/
|
|
301
|
-
getFaqCategories({} = {}) {
|
|
401
|
+
async getFaqCategories({} = {}) {
|
|
302
402
|
const { error } = ContentValidator.getFaqCategories().validate(
|
|
303
403
|
{},
|
|
304
404
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -313,15 +413,18 @@ class Content {
|
|
|
313
413
|
{ abortEarly: false, allowUnknown: false }
|
|
314
414
|
);
|
|
315
415
|
if (warrning) {
|
|
316
|
-
|
|
317
|
-
|
|
416
|
+
Logger({
|
|
417
|
+
level: "WARN",
|
|
418
|
+
message: "Parameter Validation warrnings for getFaqCategories",
|
|
419
|
+
});
|
|
420
|
+
Logger({ level: "WARN", message: warrning });
|
|
318
421
|
}
|
|
319
422
|
|
|
320
423
|
const query_params = {};
|
|
321
424
|
|
|
322
425
|
const xHeaders = {};
|
|
323
426
|
|
|
324
|
-
|
|
427
|
+
const response = await APIClient.execute(
|
|
325
428
|
this._conf,
|
|
326
429
|
"get",
|
|
327
430
|
constructUrl({
|
|
@@ -332,6 +435,23 @@ class Content {
|
|
|
332
435
|
undefined,
|
|
333
436
|
xHeaders
|
|
334
437
|
);
|
|
438
|
+
|
|
439
|
+
const {
|
|
440
|
+
error: res_error,
|
|
441
|
+
} = ContentModel.GetFaqCategoriesSchema().validate(response, {
|
|
442
|
+
abortEarly: false,
|
|
443
|
+
allowUnknown: false,
|
|
444
|
+
});
|
|
445
|
+
|
|
446
|
+
if (res_error) {
|
|
447
|
+
Logger({
|
|
448
|
+
level: "WARN",
|
|
449
|
+
message: "Response Validation Warnnings for getFaqCategories",
|
|
450
|
+
});
|
|
451
|
+
Logger({ level: "WARN", message: res_error });
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
return response;
|
|
335
455
|
}
|
|
336
456
|
|
|
337
457
|
/**
|
|
@@ -343,7 +463,7 @@ class Content {
|
|
|
343
463
|
* @summary: Get an FAQ
|
|
344
464
|
* @description: Use this API to get a particular FAQ by its slug.
|
|
345
465
|
*/
|
|
346
|
-
getFaqBySlug({ slug } = {}) {
|
|
466
|
+
async getFaqBySlug({ slug } = {}) {
|
|
347
467
|
const { error } = ContentValidator.getFaqBySlug().validate(
|
|
348
468
|
{ slug },
|
|
349
469
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -358,15 +478,18 @@ class Content {
|
|
|
358
478
|
{ abortEarly: false, allowUnknown: false }
|
|
359
479
|
);
|
|
360
480
|
if (warrning) {
|
|
361
|
-
|
|
362
|
-
|
|
481
|
+
Logger({
|
|
482
|
+
level: "WARN",
|
|
483
|
+
message: "Parameter Validation warrnings for getFaqBySlug",
|
|
484
|
+
});
|
|
485
|
+
Logger({ level: "WARN", message: warrning });
|
|
363
486
|
}
|
|
364
487
|
|
|
365
488
|
const query_params = {};
|
|
366
489
|
|
|
367
490
|
const xHeaders = {};
|
|
368
491
|
|
|
369
|
-
|
|
492
|
+
const response = await APIClient.execute(
|
|
370
493
|
this._conf,
|
|
371
494
|
"get",
|
|
372
495
|
constructUrl({
|
|
@@ -377,6 +500,21 @@ class Content {
|
|
|
377
500
|
undefined,
|
|
378
501
|
xHeaders
|
|
379
502
|
);
|
|
503
|
+
|
|
504
|
+
const { error: res_error } = ContentModel.FaqSchema().validate(response, {
|
|
505
|
+
abortEarly: false,
|
|
506
|
+
allowUnknown: false,
|
|
507
|
+
});
|
|
508
|
+
|
|
509
|
+
if (res_error) {
|
|
510
|
+
Logger({
|
|
511
|
+
level: "WARN",
|
|
512
|
+
message: "Response Validation Warnnings for getFaqBySlug",
|
|
513
|
+
});
|
|
514
|
+
Logger({ level: "WARN", message: res_error });
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
return response;
|
|
380
518
|
}
|
|
381
519
|
|
|
382
520
|
/**
|
|
@@ -388,7 +526,7 @@ class Content {
|
|
|
388
526
|
* @summary: Get the FAQ category
|
|
389
527
|
* @description: FAQs can be divided into categories. Use this API to get the category to which an FAQ belongs.
|
|
390
528
|
*/
|
|
391
|
-
getFaqCategoryBySlug({ slug } = {}) {
|
|
529
|
+
async getFaqCategoryBySlug({ slug } = {}) {
|
|
392
530
|
const { error } = ContentValidator.getFaqCategoryBySlug().validate(
|
|
393
531
|
{ slug },
|
|
394
532
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -405,15 +543,18 @@ class Content {
|
|
|
405
543
|
{ abortEarly: false, allowUnknown: false }
|
|
406
544
|
);
|
|
407
545
|
if (warrning) {
|
|
408
|
-
|
|
409
|
-
|
|
546
|
+
Logger({
|
|
547
|
+
level: "WARN",
|
|
548
|
+
message: "Parameter Validation warrnings for getFaqCategoryBySlug",
|
|
549
|
+
});
|
|
550
|
+
Logger({ level: "WARN", message: warrning });
|
|
410
551
|
}
|
|
411
552
|
|
|
412
553
|
const query_params = {};
|
|
413
554
|
|
|
414
555
|
const xHeaders = {};
|
|
415
556
|
|
|
416
|
-
|
|
557
|
+
const response = await APIClient.execute(
|
|
417
558
|
this._conf,
|
|
418
559
|
"get",
|
|
419
560
|
constructUrl({
|
|
@@ -424,6 +565,23 @@ class Content {
|
|
|
424
565
|
undefined,
|
|
425
566
|
xHeaders
|
|
426
567
|
);
|
|
568
|
+
|
|
569
|
+
const {
|
|
570
|
+
error: res_error,
|
|
571
|
+
} = ContentModel.GetFaqCategoryBySlugSchema().validate(response, {
|
|
572
|
+
abortEarly: false,
|
|
573
|
+
allowUnknown: false,
|
|
574
|
+
});
|
|
575
|
+
|
|
576
|
+
if (res_error) {
|
|
577
|
+
Logger({
|
|
578
|
+
level: "WARN",
|
|
579
|
+
message: "Response Validation Warnnings for getFaqCategoryBySlug",
|
|
580
|
+
});
|
|
581
|
+
Logger({ level: "WARN", message: res_error });
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
return response;
|
|
427
585
|
}
|
|
428
586
|
|
|
429
587
|
/**
|
|
@@ -435,7 +593,7 @@ class Content {
|
|
|
435
593
|
* @summary: Get FAQs using the slug of FAQ category
|
|
436
594
|
* @description: FAQs can be divided into categories. Use this API to get all the FAQs belonging to a category by using the category slug.
|
|
437
595
|
*/
|
|
438
|
-
getFaqsByCategorySlug({ slug } = {}) {
|
|
596
|
+
async getFaqsByCategorySlug({ slug } = {}) {
|
|
439
597
|
const { error } = ContentValidator.getFaqsByCategorySlug().validate(
|
|
440
598
|
{ slug },
|
|
441
599
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -452,15 +610,18 @@ class Content {
|
|
|
452
610
|
{ abortEarly: false, allowUnknown: false }
|
|
453
611
|
);
|
|
454
612
|
if (warrning) {
|
|
455
|
-
|
|
456
|
-
|
|
613
|
+
Logger({
|
|
614
|
+
level: "WARN",
|
|
615
|
+
message: "Parameter Validation warrnings for getFaqsByCategorySlug",
|
|
616
|
+
});
|
|
617
|
+
Logger({ level: "WARN", message: warrning });
|
|
457
618
|
}
|
|
458
619
|
|
|
459
620
|
const query_params = {};
|
|
460
621
|
|
|
461
622
|
const xHeaders = {};
|
|
462
623
|
|
|
463
|
-
|
|
624
|
+
const response = await APIClient.execute(
|
|
464
625
|
this._conf,
|
|
465
626
|
"get",
|
|
466
627
|
constructUrl({
|
|
@@ -471,6 +632,21 @@ class Content {
|
|
|
471
632
|
undefined,
|
|
472
633
|
xHeaders
|
|
473
634
|
);
|
|
635
|
+
|
|
636
|
+
const { error: res_error } = ContentModel.GetFaqSchema().validate(
|
|
637
|
+
response,
|
|
638
|
+
{ abortEarly: false, allowUnknown: false }
|
|
639
|
+
);
|
|
640
|
+
|
|
641
|
+
if (res_error) {
|
|
642
|
+
Logger({
|
|
643
|
+
level: "WARN",
|
|
644
|
+
message: "Response Validation Warnnings for getFaqsByCategorySlug",
|
|
645
|
+
});
|
|
646
|
+
Logger({ level: "WARN", message: res_error });
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
return response;
|
|
474
650
|
}
|
|
475
651
|
|
|
476
652
|
/**
|
|
@@ -479,7 +655,7 @@ class Content {
|
|
|
479
655
|
* @summary: Get the landing page
|
|
480
656
|
* @description: Landing page is the first page that a prospect lands upon while visiting a website. Use this API to fetch the details of a landing page.
|
|
481
657
|
*/
|
|
482
|
-
getLandingPage({} = {}) {
|
|
658
|
+
async getLandingPage({} = {}) {
|
|
483
659
|
const { error } = ContentValidator.getLandingPage().validate(
|
|
484
660
|
{},
|
|
485
661
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -494,15 +670,18 @@ class Content {
|
|
|
494
670
|
{ abortEarly: false, allowUnknown: false }
|
|
495
671
|
);
|
|
496
672
|
if (warrning) {
|
|
497
|
-
|
|
498
|
-
|
|
673
|
+
Logger({
|
|
674
|
+
level: "WARN",
|
|
675
|
+
message: "Parameter Validation warrnings for getLandingPage",
|
|
676
|
+
});
|
|
677
|
+
Logger({ level: "WARN", message: warrning });
|
|
499
678
|
}
|
|
500
679
|
|
|
501
680
|
const query_params = {};
|
|
502
681
|
|
|
503
682
|
const xHeaders = {};
|
|
504
683
|
|
|
505
|
-
|
|
684
|
+
const response = await APIClient.execute(
|
|
506
685
|
this._conf,
|
|
507
686
|
"get",
|
|
508
687
|
constructUrl({
|
|
@@ -513,6 +692,23 @@ class Content {
|
|
|
513
692
|
undefined,
|
|
514
693
|
xHeaders
|
|
515
694
|
);
|
|
695
|
+
|
|
696
|
+
const {
|
|
697
|
+
error: res_error,
|
|
698
|
+
} = ContentModel.LandingPageSchema().validate(response, {
|
|
699
|
+
abortEarly: false,
|
|
700
|
+
allowUnknown: false,
|
|
701
|
+
});
|
|
702
|
+
|
|
703
|
+
if (res_error) {
|
|
704
|
+
Logger({
|
|
705
|
+
level: "WARN",
|
|
706
|
+
message: "Response Validation Warnnings for getLandingPage",
|
|
707
|
+
});
|
|
708
|
+
Logger({ level: "WARN", message: res_error });
|
|
709
|
+
}
|
|
710
|
+
|
|
711
|
+
return response;
|
|
516
712
|
}
|
|
517
713
|
|
|
518
714
|
/**
|
|
@@ -521,7 +717,7 @@ class Content {
|
|
|
521
717
|
* @summary: Get legal information
|
|
522
718
|
* @description: Use this API to get the legal information of an application, which includes Privacy Policy, Terms and Conditions, Shipping Policy and FAQs regarding the usage of the application.
|
|
523
719
|
*/
|
|
524
|
-
getLegalInformation({} = {}) {
|
|
720
|
+
async getLegalInformation({} = {}) {
|
|
525
721
|
const { error } = ContentValidator.getLegalInformation().validate(
|
|
526
722
|
{},
|
|
527
723
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -536,15 +732,18 @@ class Content {
|
|
|
536
732
|
{ abortEarly: false, allowUnknown: false }
|
|
537
733
|
);
|
|
538
734
|
if (warrning) {
|
|
539
|
-
|
|
540
|
-
|
|
735
|
+
Logger({
|
|
736
|
+
level: "WARN",
|
|
737
|
+
message: "Parameter Validation warrnings for getLegalInformation",
|
|
738
|
+
});
|
|
739
|
+
Logger({ level: "WARN", message: warrning });
|
|
541
740
|
}
|
|
542
741
|
|
|
543
742
|
const query_params = {};
|
|
544
743
|
|
|
545
744
|
const xHeaders = {};
|
|
546
745
|
|
|
547
|
-
|
|
746
|
+
const response = await APIClient.execute(
|
|
548
747
|
this._conf,
|
|
549
748
|
"get",
|
|
550
749
|
constructUrl({
|
|
@@ -555,6 +754,23 @@ class Content {
|
|
|
555
754
|
undefined,
|
|
556
755
|
xHeaders
|
|
557
756
|
);
|
|
757
|
+
|
|
758
|
+
const {
|
|
759
|
+
error: res_error,
|
|
760
|
+
} = ContentModel.ApplicationLegal().validate(response, {
|
|
761
|
+
abortEarly: false,
|
|
762
|
+
allowUnknown: false,
|
|
763
|
+
});
|
|
764
|
+
|
|
765
|
+
if (res_error) {
|
|
766
|
+
Logger({
|
|
767
|
+
level: "WARN",
|
|
768
|
+
message: "Response Validation Warnnings for getLegalInformation",
|
|
769
|
+
});
|
|
770
|
+
Logger({ level: "WARN", message: res_error });
|
|
771
|
+
}
|
|
772
|
+
|
|
773
|
+
return response;
|
|
558
774
|
}
|
|
559
775
|
|
|
560
776
|
/**
|
|
@@ -566,7 +782,7 @@ class Content {
|
|
|
566
782
|
* @summary: Get the navigation
|
|
567
783
|
* @description: Use this API to fetch the navigations details which includes the items of the navigation pane. It also shows the links and sub-navigations.
|
|
568
784
|
*/
|
|
569
|
-
getNavigations({ pageNo, pageSize } = {}) {
|
|
785
|
+
async getNavigations({ pageNo, pageSize } = {}) {
|
|
570
786
|
const { error } = ContentValidator.getNavigations().validate(
|
|
571
787
|
{ pageNo, pageSize },
|
|
572
788
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -581,8 +797,11 @@ class Content {
|
|
|
581
797
|
{ abortEarly: false, allowUnknown: false }
|
|
582
798
|
);
|
|
583
799
|
if (warrning) {
|
|
584
|
-
|
|
585
|
-
|
|
800
|
+
Logger({
|
|
801
|
+
level: "WARN",
|
|
802
|
+
message: "Parameter Validation warrnings for getNavigations",
|
|
803
|
+
});
|
|
804
|
+
Logger({ level: "WARN", message: warrning });
|
|
586
805
|
}
|
|
587
806
|
|
|
588
807
|
const query_params = {};
|
|
@@ -591,7 +810,7 @@ class Content {
|
|
|
591
810
|
|
|
592
811
|
const xHeaders = {};
|
|
593
812
|
|
|
594
|
-
|
|
813
|
+
const response = await APIClient.execute(
|
|
595
814
|
this._conf,
|
|
596
815
|
"get",
|
|
597
816
|
constructUrl({
|
|
@@ -602,6 +821,23 @@ class Content {
|
|
|
602
821
|
undefined,
|
|
603
822
|
xHeaders
|
|
604
823
|
);
|
|
824
|
+
|
|
825
|
+
const {
|
|
826
|
+
error: res_error,
|
|
827
|
+
} = ContentModel.NavigationGetResponse().validate(response, {
|
|
828
|
+
abortEarly: false,
|
|
829
|
+
allowUnknown: false,
|
|
830
|
+
});
|
|
831
|
+
|
|
832
|
+
if (res_error) {
|
|
833
|
+
Logger({
|
|
834
|
+
level: "WARN",
|
|
835
|
+
message: "Response Validation Warnnings for getNavigations",
|
|
836
|
+
});
|
|
837
|
+
Logger({ level: "WARN", message: res_error });
|
|
838
|
+
}
|
|
839
|
+
|
|
840
|
+
return response;
|
|
605
841
|
}
|
|
606
842
|
|
|
607
843
|
/**
|
|
@@ -636,7 +872,7 @@ class Content {
|
|
|
636
872
|
* @summary: Get the SEO of an application
|
|
637
873
|
* @description: Use this API to get the SEO details of an application, which includes a robot.txt, meta-tags and sitemap.
|
|
638
874
|
*/
|
|
639
|
-
getSEOConfiguration({} = {}) {
|
|
875
|
+
async getSEOConfiguration({} = {}) {
|
|
640
876
|
const { error } = ContentValidator.getSEOConfiguration().validate(
|
|
641
877
|
{},
|
|
642
878
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -651,15 +887,18 @@ class Content {
|
|
|
651
887
|
{ abortEarly: false, allowUnknown: false }
|
|
652
888
|
);
|
|
653
889
|
if (warrning) {
|
|
654
|
-
|
|
655
|
-
|
|
890
|
+
Logger({
|
|
891
|
+
level: "WARN",
|
|
892
|
+
message: "Parameter Validation warrnings for getSEOConfiguration",
|
|
893
|
+
});
|
|
894
|
+
Logger({ level: "WARN", message: warrning });
|
|
656
895
|
}
|
|
657
896
|
|
|
658
897
|
const query_params = {};
|
|
659
898
|
|
|
660
899
|
const xHeaders = {};
|
|
661
900
|
|
|
662
|
-
|
|
901
|
+
const response = await APIClient.execute(
|
|
663
902
|
this._conf,
|
|
664
903
|
"get",
|
|
665
904
|
constructUrl({
|
|
@@ -670,6 +909,21 @@ class Content {
|
|
|
670
909
|
undefined,
|
|
671
910
|
xHeaders
|
|
672
911
|
);
|
|
912
|
+
|
|
913
|
+
const { error: res_error } = ContentModel.SeoComponent().validate(
|
|
914
|
+
response,
|
|
915
|
+
{ abortEarly: false, allowUnknown: false }
|
|
916
|
+
);
|
|
917
|
+
|
|
918
|
+
if (res_error) {
|
|
919
|
+
Logger({
|
|
920
|
+
level: "WARN",
|
|
921
|
+
message: "Response Validation Warnnings for getSEOConfiguration",
|
|
922
|
+
});
|
|
923
|
+
Logger({ level: "WARN", message: res_error });
|
|
924
|
+
}
|
|
925
|
+
|
|
926
|
+
return response;
|
|
673
927
|
}
|
|
674
928
|
|
|
675
929
|
/**
|
|
@@ -681,7 +935,7 @@ class Content {
|
|
|
681
935
|
* @summary: Get the slideshows
|
|
682
936
|
* @description: Use this API to get a list of slideshows along with their details.
|
|
683
937
|
*/
|
|
684
|
-
getSlideshows({ pageNo, pageSize } = {}) {
|
|
938
|
+
async getSlideshows({ pageNo, pageSize } = {}) {
|
|
685
939
|
const { error } = ContentValidator.getSlideshows().validate(
|
|
686
940
|
{ pageNo, pageSize },
|
|
687
941
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -696,8 +950,11 @@ class Content {
|
|
|
696
950
|
{ abortEarly: false, allowUnknown: false }
|
|
697
951
|
);
|
|
698
952
|
if (warrning) {
|
|
699
|
-
|
|
700
|
-
|
|
953
|
+
Logger({
|
|
954
|
+
level: "WARN",
|
|
955
|
+
message: "Parameter Validation warrnings for getSlideshows",
|
|
956
|
+
});
|
|
957
|
+
Logger({ level: "WARN", message: warrning });
|
|
701
958
|
}
|
|
702
959
|
|
|
703
960
|
const query_params = {};
|
|
@@ -706,7 +963,7 @@ class Content {
|
|
|
706
963
|
|
|
707
964
|
const xHeaders = {};
|
|
708
965
|
|
|
709
|
-
|
|
966
|
+
const response = await APIClient.execute(
|
|
710
967
|
this._conf,
|
|
711
968
|
"get",
|
|
712
969
|
constructUrl({
|
|
@@ -717,6 +974,23 @@ class Content {
|
|
|
717
974
|
undefined,
|
|
718
975
|
xHeaders
|
|
719
976
|
);
|
|
977
|
+
|
|
978
|
+
const {
|
|
979
|
+
error: res_error,
|
|
980
|
+
} = ContentModel.SlideshowGetResponse().validate(response, {
|
|
981
|
+
abortEarly: false,
|
|
982
|
+
allowUnknown: false,
|
|
983
|
+
});
|
|
984
|
+
|
|
985
|
+
if (res_error) {
|
|
986
|
+
Logger({
|
|
987
|
+
level: "WARN",
|
|
988
|
+
message: "Response Validation Warnnings for getSlideshows",
|
|
989
|
+
});
|
|
990
|
+
Logger({ level: "WARN", message: res_error });
|
|
991
|
+
}
|
|
992
|
+
|
|
993
|
+
return response;
|
|
720
994
|
}
|
|
721
995
|
|
|
722
996
|
/**
|
|
@@ -754,7 +1028,7 @@ class Content {
|
|
|
754
1028
|
* @summary: Get a slideshow
|
|
755
1029
|
* @description: A slideshow is a group of images, videos or a combination of both that are shown on the website in the form of slides. Use this API to fetch a slideshow using its `slug`.
|
|
756
1030
|
*/
|
|
757
|
-
getSlideshow({ slug } = {}) {
|
|
1031
|
+
async getSlideshow({ slug } = {}) {
|
|
758
1032
|
const { error } = ContentValidator.getSlideshow().validate(
|
|
759
1033
|
{ slug },
|
|
760
1034
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -769,15 +1043,18 @@ class Content {
|
|
|
769
1043
|
{ abortEarly: false, allowUnknown: false }
|
|
770
1044
|
);
|
|
771
1045
|
if (warrning) {
|
|
772
|
-
|
|
773
|
-
|
|
1046
|
+
Logger({
|
|
1047
|
+
level: "WARN",
|
|
1048
|
+
message: "Parameter Validation warrnings for getSlideshow",
|
|
1049
|
+
});
|
|
1050
|
+
Logger({ level: "WARN", message: warrning });
|
|
774
1051
|
}
|
|
775
1052
|
|
|
776
1053
|
const query_params = {};
|
|
777
1054
|
|
|
778
1055
|
const xHeaders = {};
|
|
779
1056
|
|
|
780
|
-
|
|
1057
|
+
const response = await APIClient.execute(
|
|
781
1058
|
this._conf,
|
|
782
1059
|
"get",
|
|
783
1060
|
constructUrl({
|
|
@@ -788,6 +1065,23 @@ class Content {
|
|
|
788
1065
|
undefined,
|
|
789
1066
|
xHeaders
|
|
790
1067
|
);
|
|
1068
|
+
|
|
1069
|
+
const {
|
|
1070
|
+
error: res_error,
|
|
1071
|
+
} = ContentModel.SlideshowSchema().validate(response, {
|
|
1072
|
+
abortEarly: false,
|
|
1073
|
+
allowUnknown: false,
|
|
1074
|
+
});
|
|
1075
|
+
|
|
1076
|
+
if (res_error) {
|
|
1077
|
+
Logger({
|
|
1078
|
+
level: "WARN",
|
|
1079
|
+
message: "Response Validation Warnnings for getSlideshow",
|
|
1080
|
+
});
|
|
1081
|
+
Logger({ level: "WARN", message: res_error });
|
|
1082
|
+
}
|
|
1083
|
+
|
|
1084
|
+
return response;
|
|
791
1085
|
}
|
|
792
1086
|
|
|
793
1087
|
/**
|
|
@@ -796,7 +1090,7 @@ class Content {
|
|
|
796
1090
|
* @summary: Get the support information
|
|
797
1091
|
* @description: Use this API to get contact details for customer support including emails and phone numbers.
|
|
798
1092
|
*/
|
|
799
|
-
getSupportInformation({} = {}) {
|
|
1093
|
+
async getSupportInformation({} = {}) {
|
|
800
1094
|
const { error } = ContentValidator.getSupportInformation().validate(
|
|
801
1095
|
{},
|
|
802
1096
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -813,15 +1107,18 @@ class Content {
|
|
|
813
1107
|
{ abortEarly: false, allowUnknown: false }
|
|
814
1108
|
);
|
|
815
1109
|
if (warrning) {
|
|
816
|
-
|
|
817
|
-
|
|
1110
|
+
Logger({
|
|
1111
|
+
level: "WARN",
|
|
1112
|
+
message: "Parameter Validation warrnings for getSupportInformation",
|
|
1113
|
+
});
|
|
1114
|
+
Logger({ level: "WARN", message: warrning });
|
|
818
1115
|
}
|
|
819
1116
|
|
|
820
1117
|
const query_params = {};
|
|
821
1118
|
|
|
822
1119
|
const xHeaders = {};
|
|
823
1120
|
|
|
824
|
-
|
|
1121
|
+
const response = await APIClient.execute(
|
|
825
1122
|
this._conf,
|
|
826
1123
|
"get",
|
|
827
1124
|
constructUrl({
|
|
@@ -832,6 +1129,21 @@ class Content {
|
|
|
832
1129
|
undefined,
|
|
833
1130
|
xHeaders
|
|
834
1131
|
);
|
|
1132
|
+
|
|
1133
|
+
const { error: res_error } = ContentModel.Support().validate(response, {
|
|
1134
|
+
abortEarly: false,
|
|
1135
|
+
allowUnknown: false,
|
|
1136
|
+
});
|
|
1137
|
+
|
|
1138
|
+
if (res_error) {
|
|
1139
|
+
Logger({
|
|
1140
|
+
level: "WARN",
|
|
1141
|
+
message: "Response Validation Warnnings for getSupportInformation",
|
|
1142
|
+
});
|
|
1143
|
+
Logger({ level: "WARN", message: res_error });
|
|
1144
|
+
}
|
|
1145
|
+
|
|
1146
|
+
return response;
|
|
835
1147
|
}
|
|
836
1148
|
|
|
837
1149
|
/**
|
|
@@ -840,7 +1152,7 @@ class Content {
|
|
|
840
1152
|
* @summary: Get the tags associated with an application
|
|
841
1153
|
* @description: Use this API to get all the CSS and JS injected in the application in the form of tags.
|
|
842
1154
|
*/
|
|
843
|
-
getTags({} = {}) {
|
|
1155
|
+
async getTags({} = {}) {
|
|
844
1156
|
const { error } = ContentValidator.getTags().validate(
|
|
845
1157
|
{},
|
|
846
1158
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -855,15 +1167,18 @@ class Content {
|
|
|
855
1167
|
{ abortEarly: false, allowUnknown: false }
|
|
856
1168
|
);
|
|
857
1169
|
if (warrning) {
|
|
858
|
-
|
|
859
|
-
|
|
1170
|
+
Logger({
|
|
1171
|
+
level: "WARN",
|
|
1172
|
+
message: "Parameter Validation warrnings for getTags",
|
|
1173
|
+
});
|
|
1174
|
+
Logger({ level: "WARN", message: warrning });
|
|
860
1175
|
}
|
|
861
1176
|
|
|
862
1177
|
const query_params = {};
|
|
863
1178
|
|
|
864
1179
|
const xHeaders = {};
|
|
865
1180
|
|
|
866
|
-
|
|
1181
|
+
const response = await APIClient.execute(
|
|
867
1182
|
this._conf,
|
|
868
1183
|
"get",
|
|
869
1184
|
constructUrl({
|
|
@@ -874,6 +1189,21 @@ class Content {
|
|
|
874
1189
|
undefined,
|
|
875
1190
|
xHeaders
|
|
876
1191
|
);
|
|
1192
|
+
|
|
1193
|
+
const { error: res_error } = ContentModel.TagsSchema().validate(response, {
|
|
1194
|
+
abortEarly: false,
|
|
1195
|
+
allowUnknown: false,
|
|
1196
|
+
});
|
|
1197
|
+
|
|
1198
|
+
if (res_error) {
|
|
1199
|
+
Logger({
|
|
1200
|
+
level: "WARN",
|
|
1201
|
+
message: "Response Validation Warnnings for getTags",
|
|
1202
|
+
});
|
|
1203
|
+
Logger({ level: "WARN", message: res_error });
|
|
1204
|
+
}
|
|
1205
|
+
|
|
1206
|
+
return response;
|
|
877
1207
|
}
|
|
878
1208
|
|
|
879
1209
|
/**
|
|
@@ -886,7 +1216,7 @@ class Content {
|
|
|
886
1216
|
* @summary: Get a page
|
|
887
1217
|
* @description: Use this API to get the details of a page using its slug. Details include the title, seo, publish status, feature image, tags, meta, etc.
|
|
888
1218
|
*/
|
|
889
|
-
getPage({ slug, rootId } = {}) {
|
|
1219
|
+
async getPage({ slug, rootId } = {}) {
|
|
890
1220
|
const { error } = ContentValidator.getPage().validate(
|
|
891
1221
|
{ slug, rootId },
|
|
892
1222
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -901,8 +1231,11 @@ class Content {
|
|
|
901
1231
|
{ abortEarly: false, allowUnknown: false }
|
|
902
1232
|
);
|
|
903
1233
|
if (warrning) {
|
|
904
|
-
|
|
905
|
-
|
|
1234
|
+
Logger({
|
|
1235
|
+
level: "WARN",
|
|
1236
|
+
message: "Parameter Validation warrnings for getPage",
|
|
1237
|
+
});
|
|
1238
|
+
Logger({ level: "WARN", message: warrning });
|
|
906
1239
|
}
|
|
907
1240
|
|
|
908
1241
|
const query_params = {};
|
|
@@ -910,7 +1243,7 @@ class Content {
|
|
|
910
1243
|
|
|
911
1244
|
const xHeaders = {};
|
|
912
1245
|
|
|
913
|
-
|
|
1246
|
+
const response = await APIClient.execute(
|
|
914
1247
|
this._conf,
|
|
915
1248
|
"get",
|
|
916
1249
|
constructUrl({
|
|
@@ -921,6 +1254,21 @@ class Content {
|
|
|
921
1254
|
undefined,
|
|
922
1255
|
xHeaders
|
|
923
1256
|
);
|
|
1257
|
+
|
|
1258
|
+
const { error: res_error } = ContentModel.PageSchema().validate(response, {
|
|
1259
|
+
abortEarly: false,
|
|
1260
|
+
allowUnknown: false,
|
|
1261
|
+
});
|
|
1262
|
+
|
|
1263
|
+
if (res_error) {
|
|
1264
|
+
Logger({
|
|
1265
|
+
level: "WARN",
|
|
1266
|
+
message: "Response Validation Warnnings for getPage",
|
|
1267
|
+
});
|
|
1268
|
+
Logger({ level: "WARN", message: res_error });
|
|
1269
|
+
}
|
|
1270
|
+
|
|
1271
|
+
return response;
|
|
924
1272
|
}
|
|
925
1273
|
|
|
926
1274
|
/**
|
|
@@ -932,7 +1280,7 @@ class Content {
|
|
|
932
1280
|
* @summary: Get all pages
|
|
933
1281
|
* @description: Use this API to get a list of pages.
|
|
934
1282
|
*/
|
|
935
|
-
getPages({ pageNo, pageSize } = {}) {
|
|
1283
|
+
async getPages({ pageNo, pageSize } = {}) {
|
|
936
1284
|
const { error } = ContentValidator.getPages().validate(
|
|
937
1285
|
{ pageNo, pageSize },
|
|
938
1286
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -947,8 +1295,11 @@ class Content {
|
|
|
947
1295
|
{ abortEarly: false, allowUnknown: false }
|
|
948
1296
|
);
|
|
949
1297
|
if (warrning) {
|
|
950
|
-
|
|
951
|
-
|
|
1298
|
+
Logger({
|
|
1299
|
+
level: "WARN",
|
|
1300
|
+
message: "Parameter Validation warrnings for getPages",
|
|
1301
|
+
});
|
|
1302
|
+
Logger({ level: "WARN", message: warrning });
|
|
952
1303
|
}
|
|
953
1304
|
|
|
954
1305
|
const query_params = {};
|
|
@@ -957,7 +1308,7 @@ class Content {
|
|
|
957
1308
|
|
|
958
1309
|
const xHeaders = {};
|
|
959
1310
|
|
|
960
|
-
|
|
1311
|
+
const response = await APIClient.execute(
|
|
961
1312
|
this._conf,
|
|
962
1313
|
"get",
|
|
963
1314
|
constructUrl({
|
|
@@ -968,6 +1319,23 @@ class Content {
|
|
|
968
1319
|
undefined,
|
|
969
1320
|
xHeaders
|
|
970
1321
|
);
|
|
1322
|
+
|
|
1323
|
+
const {
|
|
1324
|
+
error: res_error,
|
|
1325
|
+
} = ContentModel.PageGetResponse().validate(response, {
|
|
1326
|
+
abortEarly: false,
|
|
1327
|
+
allowUnknown: false,
|
|
1328
|
+
});
|
|
1329
|
+
|
|
1330
|
+
if (res_error) {
|
|
1331
|
+
Logger({
|
|
1332
|
+
level: "WARN",
|
|
1333
|
+
message: "Response Validation Warnnings for getPages",
|
|
1334
|
+
});
|
|
1335
|
+
Logger({ level: "WARN", message: res_error });
|
|
1336
|
+
}
|
|
1337
|
+
|
|
1338
|
+
return response;
|
|
971
1339
|
}
|
|
972
1340
|
|
|
973
1341
|
/**
|