@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
|
@@ -2,6 +2,8 @@ const Paginator = require("../../common/Paginator");
|
|
|
2
2
|
const PlatformAPIClient = require("../PlatformAPIClient");
|
|
3
3
|
const { FDKClientValidationError } = require("../../common/FDKError");
|
|
4
4
|
const ConfigurationValidator = require("./ConfigurationPlatformApplicationValidator");
|
|
5
|
+
const ConfigurationModel = require("./ConfigurationPlatformModel");
|
|
6
|
+
const { Logger } = require("./../../common/Logger");
|
|
5
7
|
|
|
6
8
|
class Configuration {
|
|
7
9
|
constructor(config, applicationId) {
|
|
@@ -12,10 +14,11 @@ class Configuration {
|
|
|
12
14
|
/**
|
|
13
15
|
* @param {Object} arg - Arg object.
|
|
14
16
|
* @param {string} arg.platformType - Current platform name
|
|
17
|
+
* @returns {Promise<MobileAppConfiguration>} - Success response
|
|
15
18
|
* @summary: Get latest build config
|
|
16
19
|
* @description: Get latest build config
|
|
17
20
|
*/
|
|
18
|
-
getBuildConfig({ platformType } = {}) {
|
|
21
|
+
async getBuildConfig({ platformType } = {}) {
|
|
19
22
|
const { error } = ConfigurationValidator.getBuildConfig().validate(
|
|
20
23
|
{
|
|
21
24
|
platformType,
|
|
@@ -36,29 +39,50 @@ class Configuration {
|
|
|
36
39
|
{ abortEarly: false, allowUnknown: false }
|
|
37
40
|
);
|
|
38
41
|
if (warrning) {
|
|
39
|
-
|
|
40
|
-
|
|
42
|
+
Logger({
|
|
43
|
+
level: "WARN",
|
|
44
|
+
message: "Parameter Validation warrnings for getBuildConfig",
|
|
45
|
+
});
|
|
46
|
+
Logger({ level: "WARN", message: warrning });
|
|
41
47
|
}
|
|
42
48
|
|
|
43
49
|
const query_params = {};
|
|
44
50
|
|
|
45
|
-
|
|
51
|
+
const response = await PlatformAPIClient.execute(
|
|
46
52
|
this.config,
|
|
47
53
|
"get",
|
|
48
54
|
`/service/platform/configuration/v1.0/company/${this.config.companyId}/application/${this.applicationId}/build/${platformType}/configuration`,
|
|
49
55
|
query_params,
|
|
50
56
|
undefined
|
|
51
57
|
);
|
|
58
|
+
|
|
59
|
+
const {
|
|
60
|
+
error: res_error,
|
|
61
|
+
} = ConfigurationModel.MobileAppConfiguration().validate(response, {
|
|
62
|
+
abortEarly: false,
|
|
63
|
+
allowUnknown: false,
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
if (res_error) {
|
|
67
|
+
Logger({
|
|
68
|
+
level: "WARN",
|
|
69
|
+
message: "Response Validation Warnnings for getBuildConfig",
|
|
70
|
+
});
|
|
71
|
+
Logger({ level: "WARN", message: res_error });
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
return response;
|
|
52
75
|
}
|
|
53
76
|
|
|
54
77
|
/**
|
|
55
78
|
* @param {Object} arg - Arg object.
|
|
56
79
|
* @param {string} arg.platformType - Current platform name
|
|
57
80
|
* @param {MobileAppConfigRequest} arg.body
|
|
81
|
+
* @returns {Promise<MobileAppConfiguration>} - Success response
|
|
58
82
|
* @summary: Update build config for next build
|
|
59
83
|
* @description: Update build config for next build
|
|
60
84
|
*/
|
|
61
|
-
updateBuildConfig({ platformType, body } = {}) {
|
|
85
|
+
async updateBuildConfig({ platformType, body } = {}) {
|
|
62
86
|
const { error } = ConfigurationValidator.updateBuildConfig().validate(
|
|
63
87
|
{
|
|
64
88
|
platformType,
|
|
@@ -81,28 +105,49 @@ class Configuration {
|
|
|
81
105
|
{ abortEarly: false, allowUnknown: false }
|
|
82
106
|
);
|
|
83
107
|
if (warrning) {
|
|
84
|
-
|
|
85
|
-
|
|
108
|
+
Logger({
|
|
109
|
+
level: "WARN",
|
|
110
|
+
message: "Parameter Validation warrnings for updateBuildConfig",
|
|
111
|
+
});
|
|
112
|
+
Logger({ level: "WARN", message: warrning });
|
|
86
113
|
}
|
|
87
114
|
|
|
88
115
|
const query_params = {};
|
|
89
116
|
|
|
90
|
-
|
|
117
|
+
const response = await PlatformAPIClient.execute(
|
|
91
118
|
this.config,
|
|
92
119
|
"put",
|
|
93
120
|
`/service/platform/configuration/v1.0/company/${this.config.companyId}/application/${this.applicationId}/build/${platformType}/configuration`,
|
|
94
121
|
query_params,
|
|
95
122
|
body
|
|
96
123
|
);
|
|
124
|
+
|
|
125
|
+
const {
|
|
126
|
+
error: res_error,
|
|
127
|
+
} = ConfigurationModel.MobileAppConfiguration().validate(response, {
|
|
128
|
+
abortEarly: false,
|
|
129
|
+
allowUnknown: false,
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
if (res_error) {
|
|
133
|
+
Logger({
|
|
134
|
+
level: "WARN",
|
|
135
|
+
message: "Response Validation Warnnings for updateBuildConfig",
|
|
136
|
+
});
|
|
137
|
+
Logger({ level: "WARN", message: res_error });
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
return response;
|
|
97
141
|
}
|
|
98
142
|
|
|
99
143
|
/**
|
|
100
144
|
* @param {Object} arg - Arg object.
|
|
101
145
|
* @param {string} arg.platformType - Current platform name
|
|
146
|
+
* @returns {Promise<BuildVersionHistory>} - Success response
|
|
102
147
|
* @summary: Get previous build versions
|
|
103
148
|
* @description: Get previous build versions
|
|
104
149
|
*/
|
|
105
|
-
getPreviousVersions({ platformType } = {}) {
|
|
150
|
+
async getPreviousVersions({ platformType } = {}) {
|
|
106
151
|
const { error } = ConfigurationValidator.getPreviousVersions().validate(
|
|
107
152
|
{
|
|
108
153
|
platformType,
|
|
@@ -123,27 +168,48 @@ class Configuration {
|
|
|
123
168
|
{ abortEarly: false, allowUnknown: false }
|
|
124
169
|
);
|
|
125
170
|
if (warrning) {
|
|
126
|
-
|
|
127
|
-
|
|
171
|
+
Logger({
|
|
172
|
+
level: "WARN",
|
|
173
|
+
message: "Parameter Validation warrnings for getPreviousVersions",
|
|
174
|
+
});
|
|
175
|
+
Logger({ level: "WARN", message: warrning });
|
|
128
176
|
}
|
|
129
177
|
|
|
130
178
|
const query_params = {};
|
|
131
179
|
|
|
132
|
-
|
|
180
|
+
const response = await PlatformAPIClient.execute(
|
|
133
181
|
this.config,
|
|
134
182
|
"get",
|
|
135
183
|
`/service/platform/configuration/v1.0/company/${this.config.companyId}/application/${this.applicationId}/build/${platformType}/versions`,
|
|
136
184
|
query_params,
|
|
137
185
|
undefined
|
|
138
186
|
);
|
|
187
|
+
|
|
188
|
+
const {
|
|
189
|
+
error: res_error,
|
|
190
|
+
} = ConfigurationModel.BuildVersionHistory().validate(response, {
|
|
191
|
+
abortEarly: false,
|
|
192
|
+
allowUnknown: false,
|
|
193
|
+
});
|
|
194
|
+
|
|
195
|
+
if (res_error) {
|
|
196
|
+
Logger({
|
|
197
|
+
level: "WARN",
|
|
198
|
+
message: "Response Validation Warnnings for getPreviousVersions",
|
|
199
|
+
});
|
|
200
|
+
Logger({ level: "WARN", message: res_error });
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
return response;
|
|
139
204
|
}
|
|
140
205
|
|
|
141
206
|
/**
|
|
142
207
|
* @param {Object} arg - Arg object.
|
|
208
|
+
* @returns {Promise<AppFeatureResponse>} - Success response
|
|
143
209
|
* @summary: Get features of application
|
|
144
210
|
* @description: Get features of application
|
|
145
211
|
*/
|
|
146
|
-
getAppFeatures({} = {}) {
|
|
212
|
+
async getAppFeatures({} = {}) {
|
|
147
213
|
const { error } = ConfigurationValidator.getAppFeatures().validate(
|
|
148
214
|
{},
|
|
149
215
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -160,28 +226,49 @@ class Configuration {
|
|
|
160
226
|
{ abortEarly: false, allowUnknown: false }
|
|
161
227
|
);
|
|
162
228
|
if (warrning) {
|
|
163
|
-
|
|
164
|
-
|
|
229
|
+
Logger({
|
|
230
|
+
level: "WARN",
|
|
231
|
+
message: "Parameter Validation warrnings for getAppFeatures",
|
|
232
|
+
});
|
|
233
|
+
Logger({ level: "WARN", message: warrning });
|
|
165
234
|
}
|
|
166
235
|
|
|
167
236
|
const query_params = {};
|
|
168
237
|
|
|
169
|
-
|
|
238
|
+
const response = await PlatformAPIClient.execute(
|
|
170
239
|
this.config,
|
|
171
240
|
"get",
|
|
172
241
|
`/service/platform/configuration/v1.0/company/${this.config.companyId}/application/${this.applicationId}/feature`,
|
|
173
242
|
query_params,
|
|
174
243
|
undefined
|
|
175
244
|
);
|
|
245
|
+
|
|
246
|
+
const {
|
|
247
|
+
error: res_error,
|
|
248
|
+
} = ConfigurationModel.AppFeatureResponse().validate(response, {
|
|
249
|
+
abortEarly: false,
|
|
250
|
+
allowUnknown: false,
|
|
251
|
+
});
|
|
252
|
+
|
|
253
|
+
if (res_error) {
|
|
254
|
+
Logger({
|
|
255
|
+
level: "WARN",
|
|
256
|
+
message: "Response Validation Warnnings for getAppFeatures",
|
|
257
|
+
});
|
|
258
|
+
Logger({ level: "WARN", message: res_error });
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
return response;
|
|
176
262
|
}
|
|
177
263
|
|
|
178
264
|
/**
|
|
179
265
|
* @param {Object} arg - Arg object.
|
|
180
266
|
* @param {AppFeatureRequest} arg.body
|
|
267
|
+
* @returns {Promise<AppFeature>} - Success response
|
|
181
268
|
* @summary: Update features of application
|
|
182
269
|
* @description: Update features of application
|
|
183
270
|
*/
|
|
184
|
-
updateAppFeatures({ body } = {}) {
|
|
271
|
+
async updateAppFeatures({ body } = {}) {
|
|
185
272
|
const { error } = ConfigurationValidator.updateAppFeatures().validate(
|
|
186
273
|
{
|
|
187
274
|
body,
|
|
@@ -202,27 +289,48 @@ class Configuration {
|
|
|
202
289
|
{ abortEarly: false, allowUnknown: false }
|
|
203
290
|
);
|
|
204
291
|
if (warrning) {
|
|
205
|
-
|
|
206
|
-
|
|
292
|
+
Logger({
|
|
293
|
+
level: "WARN",
|
|
294
|
+
message: "Parameter Validation warrnings for updateAppFeatures",
|
|
295
|
+
});
|
|
296
|
+
Logger({ level: "WARN", message: warrning });
|
|
207
297
|
}
|
|
208
298
|
|
|
209
299
|
const query_params = {};
|
|
210
300
|
|
|
211
|
-
|
|
301
|
+
const response = await PlatformAPIClient.execute(
|
|
212
302
|
this.config,
|
|
213
303
|
"post",
|
|
214
304
|
`/service/platform/configuration/v1.0/company/${this.config.companyId}/application/${this.applicationId}/feature`,
|
|
215
305
|
query_params,
|
|
216
306
|
body
|
|
217
307
|
);
|
|
308
|
+
|
|
309
|
+
const {
|
|
310
|
+
error: res_error,
|
|
311
|
+
} = ConfigurationModel.AppFeature().validate(response, {
|
|
312
|
+
abortEarly: false,
|
|
313
|
+
allowUnknown: false,
|
|
314
|
+
});
|
|
315
|
+
|
|
316
|
+
if (res_error) {
|
|
317
|
+
Logger({
|
|
318
|
+
level: "WARN",
|
|
319
|
+
message: "Response Validation Warnnings for updateAppFeatures",
|
|
320
|
+
});
|
|
321
|
+
Logger({ level: "WARN", message: res_error });
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
return response;
|
|
218
325
|
}
|
|
219
326
|
|
|
220
327
|
/**
|
|
221
328
|
* @param {Object} arg - Arg object.
|
|
329
|
+
* @returns {Promise<ApplicationDetail>} - Success response
|
|
222
330
|
* @summary: Get basic application details
|
|
223
331
|
* @description: Get basic application details like name
|
|
224
332
|
*/
|
|
225
|
-
getAppBasicDetails({} = {}) {
|
|
333
|
+
async getAppBasicDetails({} = {}) {
|
|
226
334
|
const { error } = ConfigurationValidator.getAppBasicDetails().validate(
|
|
227
335
|
{},
|
|
228
336
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -239,28 +347,49 @@ class Configuration {
|
|
|
239
347
|
{ abortEarly: false, allowUnknown: false }
|
|
240
348
|
);
|
|
241
349
|
if (warrning) {
|
|
242
|
-
|
|
243
|
-
|
|
350
|
+
Logger({
|
|
351
|
+
level: "WARN",
|
|
352
|
+
message: "Parameter Validation warrnings for getAppBasicDetails",
|
|
353
|
+
});
|
|
354
|
+
Logger({ level: "WARN", message: warrning });
|
|
244
355
|
}
|
|
245
356
|
|
|
246
357
|
const query_params = {};
|
|
247
358
|
|
|
248
|
-
|
|
359
|
+
const response = await PlatformAPIClient.execute(
|
|
249
360
|
this.config,
|
|
250
361
|
"get",
|
|
251
362
|
`/service/platform/configuration/v1.0/company/${this.config.companyId}/application/${this.applicationId}/detail`,
|
|
252
363
|
query_params,
|
|
253
364
|
undefined
|
|
254
365
|
);
|
|
366
|
+
|
|
367
|
+
const {
|
|
368
|
+
error: res_error,
|
|
369
|
+
} = ConfigurationModel.ApplicationDetail().validate(response, {
|
|
370
|
+
abortEarly: false,
|
|
371
|
+
allowUnknown: false,
|
|
372
|
+
});
|
|
373
|
+
|
|
374
|
+
if (res_error) {
|
|
375
|
+
Logger({
|
|
376
|
+
level: "WARN",
|
|
377
|
+
message: "Response Validation Warnnings for getAppBasicDetails",
|
|
378
|
+
});
|
|
379
|
+
Logger({ level: "WARN", message: res_error });
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
return response;
|
|
255
383
|
}
|
|
256
384
|
|
|
257
385
|
/**
|
|
258
386
|
* @param {Object} arg - Arg object.
|
|
259
387
|
* @param {ApplicationDetail} arg.body
|
|
388
|
+
* @returns {Promise<ApplicationDetail>} - Success response
|
|
260
389
|
* @summary: Add or update application's basic details
|
|
261
390
|
* @description: Add or update application's basic details
|
|
262
391
|
*/
|
|
263
|
-
updateAppBasicDetails({ body } = {}) {
|
|
392
|
+
async updateAppBasicDetails({ body } = {}) {
|
|
264
393
|
const { error } = ConfigurationValidator.updateAppBasicDetails().validate(
|
|
265
394
|
{
|
|
266
395
|
body,
|
|
@@ -281,27 +410,48 @@ class Configuration {
|
|
|
281
410
|
{ abortEarly: false, allowUnknown: false }
|
|
282
411
|
);
|
|
283
412
|
if (warrning) {
|
|
284
|
-
|
|
285
|
-
|
|
413
|
+
Logger({
|
|
414
|
+
level: "WARN",
|
|
415
|
+
message: "Parameter Validation warrnings for updateAppBasicDetails",
|
|
416
|
+
});
|
|
417
|
+
Logger({ level: "WARN", message: warrning });
|
|
286
418
|
}
|
|
287
419
|
|
|
288
420
|
const query_params = {};
|
|
289
421
|
|
|
290
|
-
|
|
422
|
+
const response = await PlatformAPIClient.execute(
|
|
291
423
|
this.config,
|
|
292
424
|
"put",
|
|
293
425
|
`/service/platform/configuration/v1.0/company/${this.config.companyId}/application/${this.applicationId}/detail`,
|
|
294
426
|
query_params,
|
|
295
427
|
body
|
|
296
428
|
);
|
|
429
|
+
|
|
430
|
+
const {
|
|
431
|
+
error: res_error,
|
|
432
|
+
} = ConfigurationModel.ApplicationDetail().validate(response, {
|
|
433
|
+
abortEarly: false,
|
|
434
|
+
allowUnknown: false,
|
|
435
|
+
});
|
|
436
|
+
|
|
437
|
+
if (res_error) {
|
|
438
|
+
Logger({
|
|
439
|
+
level: "WARN",
|
|
440
|
+
message: "Response Validation Warnnings for updateAppBasicDetails",
|
|
441
|
+
});
|
|
442
|
+
Logger({ level: "WARN", message: res_error });
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
return response;
|
|
297
446
|
}
|
|
298
447
|
|
|
299
448
|
/**
|
|
300
449
|
* @param {Object} arg - Arg object.
|
|
450
|
+
* @returns {Promise<ApplicationInformation>} - Success response
|
|
301
451
|
* @summary: Get application information
|
|
302
452
|
* @description: Get Application Current Information. This includes information about social links, address and contact information of company/seller/brand of the application.
|
|
303
453
|
*/
|
|
304
|
-
getAppContactInfo({} = {}) {
|
|
454
|
+
async getAppContactInfo({} = {}) {
|
|
305
455
|
const { error } = ConfigurationValidator.getAppContactInfo().validate(
|
|
306
456
|
{},
|
|
307
457
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -318,28 +468,49 @@ class Configuration {
|
|
|
318
468
|
{ abortEarly: false, allowUnknown: false }
|
|
319
469
|
);
|
|
320
470
|
if (warrning) {
|
|
321
|
-
|
|
322
|
-
|
|
471
|
+
Logger({
|
|
472
|
+
level: "WARN",
|
|
473
|
+
message: "Parameter Validation warrnings for getAppContactInfo",
|
|
474
|
+
});
|
|
475
|
+
Logger({ level: "WARN", message: warrning });
|
|
323
476
|
}
|
|
324
477
|
|
|
325
478
|
const query_params = {};
|
|
326
479
|
|
|
327
|
-
|
|
480
|
+
const response = await PlatformAPIClient.execute(
|
|
328
481
|
this.config,
|
|
329
482
|
"get",
|
|
330
483
|
`/service/platform/configuration/v1.0/company/${this.config.companyId}/application/${this.applicationId}/information`,
|
|
331
484
|
query_params,
|
|
332
485
|
undefined
|
|
333
486
|
);
|
|
487
|
+
|
|
488
|
+
const {
|
|
489
|
+
error: res_error,
|
|
490
|
+
} = ConfigurationModel.ApplicationInformation().validate(response, {
|
|
491
|
+
abortEarly: false,
|
|
492
|
+
allowUnknown: false,
|
|
493
|
+
});
|
|
494
|
+
|
|
495
|
+
if (res_error) {
|
|
496
|
+
Logger({
|
|
497
|
+
level: "WARN",
|
|
498
|
+
message: "Response Validation Warnnings for getAppContactInfo",
|
|
499
|
+
});
|
|
500
|
+
Logger({ level: "WARN", message: res_error });
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
return response;
|
|
334
504
|
}
|
|
335
505
|
|
|
336
506
|
/**
|
|
337
507
|
* @param {Object} arg - Arg object.
|
|
338
508
|
* @param {ApplicationInformation} arg.body
|
|
509
|
+
* @returns {Promise<ApplicationInformation>} - Success response
|
|
339
510
|
* @summary: Get application information
|
|
340
511
|
* @description: Save Application Current Information. This includes information about social links, address and contact information of an application.
|
|
341
512
|
*/
|
|
342
|
-
updateAppContactInfo({ body } = {}) {
|
|
513
|
+
async updateAppContactInfo({ body } = {}) {
|
|
343
514
|
const { error } = ConfigurationValidator.updateAppContactInfo().validate(
|
|
344
515
|
{
|
|
345
516
|
body,
|
|
@@ -360,27 +531,48 @@ class Configuration {
|
|
|
360
531
|
{ abortEarly: false, allowUnknown: false }
|
|
361
532
|
);
|
|
362
533
|
if (warrning) {
|
|
363
|
-
|
|
364
|
-
|
|
534
|
+
Logger({
|
|
535
|
+
level: "WARN",
|
|
536
|
+
message: "Parameter Validation warrnings for updateAppContactInfo",
|
|
537
|
+
});
|
|
538
|
+
Logger({ level: "WARN", message: warrning });
|
|
365
539
|
}
|
|
366
540
|
|
|
367
541
|
const query_params = {};
|
|
368
542
|
|
|
369
|
-
|
|
543
|
+
const response = await PlatformAPIClient.execute(
|
|
370
544
|
this.config,
|
|
371
545
|
"put",
|
|
372
546
|
`/service/platform/configuration/v1.0/company/${this.config.companyId}/application/${this.applicationId}/information`,
|
|
373
547
|
query_params,
|
|
374
548
|
body
|
|
375
549
|
);
|
|
550
|
+
|
|
551
|
+
const {
|
|
552
|
+
error: res_error,
|
|
553
|
+
} = ConfigurationModel.ApplicationInformation().validate(response, {
|
|
554
|
+
abortEarly: false,
|
|
555
|
+
allowUnknown: false,
|
|
556
|
+
});
|
|
557
|
+
|
|
558
|
+
if (res_error) {
|
|
559
|
+
Logger({
|
|
560
|
+
level: "WARN",
|
|
561
|
+
message: "Response Validation Warnnings for updateAppContactInfo",
|
|
562
|
+
});
|
|
563
|
+
Logger({ level: "WARN", message: res_error });
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
return response;
|
|
376
567
|
}
|
|
377
568
|
|
|
378
569
|
/**
|
|
379
570
|
* @param {Object} arg - Arg object.
|
|
571
|
+
* @returns {Promise<TokenResponse>} - Success response
|
|
380
572
|
* @summary: Get social tokens
|
|
381
573
|
* @description: Get social tokens.
|
|
382
574
|
*/
|
|
383
|
-
getAppApiTokens({} = {}) {
|
|
575
|
+
async getAppApiTokens({} = {}) {
|
|
384
576
|
const { error } = ConfigurationValidator.getAppApiTokens().validate(
|
|
385
577
|
{},
|
|
386
578
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -397,28 +589,49 @@ class Configuration {
|
|
|
397
589
|
{ abortEarly: false, allowUnknown: false }
|
|
398
590
|
);
|
|
399
591
|
if (warrning) {
|
|
400
|
-
|
|
401
|
-
|
|
592
|
+
Logger({
|
|
593
|
+
level: "WARN",
|
|
594
|
+
message: "Parameter Validation warrnings for getAppApiTokens",
|
|
595
|
+
});
|
|
596
|
+
Logger({ level: "WARN", message: warrning });
|
|
402
597
|
}
|
|
403
598
|
|
|
404
599
|
const query_params = {};
|
|
405
600
|
|
|
406
|
-
|
|
601
|
+
const response = await PlatformAPIClient.execute(
|
|
407
602
|
this.config,
|
|
408
603
|
"get",
|
|
409
604
|
`/service/platform/configuration/v1.0/company/${this.config.companyId}/application/${this.applicationId}/token`,
|
|
410
605
|
query_params,
|
|
411
606
|
undefined
|
|
412
607
|
);
|
|
608
|
+
|
|
609
|
+
const {
|
|
610
|
+
error: res_error,
|
|
611
|
+
} = ConfigurationModel.TokenResponse().validate(response, {
|
|
612
|
+
abortEarly: false,
|
|
613
|
+
allowUnknown: false,
|
|
614
|
+
});
|
|
615
|
+
|
|
616
|
+
if (res_error) {
|
|
617
|
+
Logger({
|
|
618
|
+
level: "WARN",
|
|
619
|
+
message: "Response Validation Warnnings for getAppApiTokens",
|
|
620
|
+
});
|
|
621
|
+
Logger({ level: "WARN", message: res_error });
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
return response;
|
|
413
625
|
}
|
|
414
626
|
|
|
415
627
|
/**
|
|
416
628
|
* @param {Object} arg - Arg object.
|
|
417
629
|
* @param {TokenResponse} arg.body
|
|
630
|
+
* @returns {Promise<TokenResponse>} - Success response
|
|
418
631
|
* @summary: Add social tokens
|
|
419
632
|
* @description: Add social tokens.
|
|
420
633
|
*/
|
|
421
|
-
updateAppApiTokens({ body } = {}) {
|
|
634
|
+
async updateAppApiTokens({ body } = {}) {
|
|
422
635
|
const { error } = ConfigurationValidator.updateAppApiTokens().validate(
|
|
423
636
|
{
|
|
424
637
|
body,
|
|
@@ -439,19 +652,39 @@ class Configuration {
|
|
|
439
652
|
{ abortEarly: false, allowUnknown: false }
|
|
440
653
|
);
|
|
441
654
|
if (warrning) {
|
|
442
|
-
|
|
443
|
-
|
|
655
|
+
Logger({
|
|
656
|
+
level: "WARN",
|
|
657
|
+
message: "Parameter Validation warrnings for updateAppApiTokens",
|
|
658
|
+
});
|
|
659
|
+
Logger({ level: "WARN", message: warrning });
|
|
444
660
|
}
|
|
445
661
|
|
|
446
662
|
const query_params = {};
|
|
447
663
|
|
|
448
|
-
|
|
664
|
+
const response = await PlatformAPIClient.execute(
|
|
449
665
|
this.config,
|
|
450
666
|
"post",
|
|
451
667
|
`/service/platform/configuration/v1.0/company/${this.config.companyId}/application/${this.applicationId}/token`,
|
|
452
668
|
query_params,
|
|
453
669
|
body
|
|
454
670
|
);
|
|
671
|
+
|
|
672
|
+
const {
|
|
673
|
+
error: res_error,
|
|
674
|
+
} = ConfigurationModel.TokenResponse().validate(response, {
|
|
675
|
+
abortEarly: false,
|
|
676
|
+
allowUnknown: false,
|
|
677
|
+
});
|
|
678
|
+
|
|
679
|
+
if (res_error) {
|
|
680
|
+
Logger({
|
|
681
|
+
level: "WARN",
|
|
682
|
+
message: "Response Validation Warnnings for updateAppApiTokens",
|
|
683
|
+
});
|
|
684
|
+
Logger({ level: "WARN", message: res_error });
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
return response;
|
|
455
688
|
}
|
|
456
689
|
|
|
457
690
|
/**
|
|
@@ -459,10 +692,11 @@ class Configuration {
|
|
|
459
692
|
* @param {number} [arg.uid] - Uid of companies to be fetched
|
|
460
693
|
* @param {number} [arg.pageNo] - Current page no
|
|
461
694
|
* @param {number} [arg.pageSize] - Current request items count
|
|
695
|
+
* @returns {Promise<CompaniesResponse>} - Success response
|
|
462
696
|
* @summary: Application inventory enabled companies
|
|
463
697
|
* @description: Application inventory enabled companies.
|
|
464
698
|
*/
|
|
465
|
-
getAppCompanies({ uid, pageNo, pageSize } = {}) {
|
|
699
|
+
async getAppCompanies({ uid, pageNo, pageSize } = {}) {
|
|
466
700
|
const { error } = ConfigurationValidator.getAppCompanies().validate(
|
|
467
701
|
{
|
|
468
702
|
uid,
|
|
@@ -487,8 +721,11 @@ class Configuration {
|
|
|
487
721
|
{ abortEarly: false, allowUnknown: false }
|
|
488
722
|
);
|
|
489
723
|
if (warrning) {
|
|
490
|
-
|
|
491
|
-
|
|
724
|
+
Logger({
|
|
725
|
+
level: "WARN",
|
|
726
|
+
message: "Parameter Validation warrnings for getAppCompanies",
|
|
727
|
+
});
|
|
728
|
+
Logger({ level: "WARN", message: warrning });
|
|
492
729
|
}
|
|
493
730
|
|
|
494
731
|
const query_params = {};
|
|
@@ -496,13 +733,30 @@ class Configuration {
|
|
|
496
733
|
query_params["page_no"] = pageNo;
|
|
497
734
|
query_params["page_size"] = pageSize;
|
|
498
735
|
|
|
499
|
-
|
|
736
|
+
const response = await PlatformAPIClient.execute(
|
|
500
737
|
this.config,
|
|
501
738
|
"get",
|
|
502
739
|
`/service/platform/configuration/v1.0/company/${this.config.companyId}/application/${this.applicationId}/companies`,
|
|
503
740
|
query_params,
|
|
504
741
|
undefined
|
|
505
742
|
);
|
|
743
|
+
|
|
744
|
+
const {
|
|
745
|
+
error: res_error,
|
|
746
|
+
} = ConfigurationModel.CompaniesResponse().validate(response, {
|
|
747
|
+
abortEarly: false,
|
|
748
|
+
allowUnknown: false,
|
|
749
|
+
});
|
|
750
|
+
|
|
751
|
+
if (res_error) {
|
|
752
|
+
Logger({
|
|
753
|
+
level: "WARN",
|
|
754
|
+
message: "Response Validation Warnnings for getAppCompanies",
|
|
755
|
+
});
|
|
756
|
+
Logger({ level: "WARN", message: res_error });
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
return response;
|
|
506
760
|
}
|
|
507
761
|
|
|
508
762
|
/**
|
|
@@ -541,10 +795,11 @@ class Configuration {
|
|
|
541
795
|
* @param {Object} arg - Arg object.
|
|
542
796
|
* @param {number} [arg.pageNo] - Current page no
|
|
543
797
|
* @param {number} [arg.pageSize] - Current request items count
|
|
798
|
+
* @returns {Promise<StoresResponse>} - Success response
|
|
544
799
|
* @summary: Application inventory enabled stores
|
|
545
800
|
* @description: Application inventory enabled stores.
|
|
546
801
|
*/
|
|
547
|
-
getAppStores({ pageNo, pageSize } = {}) {
|
|
802
|
+
async getAppStores({ pageNo, pageSize } = {}) {
|
|
548
803
|
const { error } = ConfigurationValidator.getAppStores().validate(
|
|
549
804
|
{
|
|
550
805
|
pageNo,
|
|
@@ -565,21 +820,41 @@ class Configuration {
|
|
|
565
820
|
{ abortEarly: false, allowUnknown: false }
|
|
566
821
|
);
|
|
567
822
|
if (warrning) {
|
|
568
|
-
|
|
569
|
-
|
|
823
|
+
Logger({
|
|
824
|
+
level: "WARN",
|
|
825
|
+
message: "Parameter Validation warrnings for getAppStores",
|
|
826
|
+
});
|
|
827
|
+
Logger({ level: "WARN", message: warrning });
|
|
570
828
|
}
|
|
571
829
|
|
|
572
830
|
const query_params = {};
|
|
573
831
|
query_params["page_no"] = pageNo;
|
|
574
832
|
query_params["page_size"] = pageSize;
|
|
575
833
|
|
|
576
|
-
|
|
834
|
+
const response = await PlatformAPIClient.execute(
|
|
577
835
|
this.config,
|
|
578
836
|
"get",
|
|
579
837
|
`/service/platform/configuration/v1.0/company/${this.config.companyId}/application/${this.applicationId}/stores`,
|
|
580
838
|
query_params,
|
|
581
839
|
undefined
|
|
582
840
|
);
|
|
841
|
+
|
|
842
|
+
const {
|
|
843
|
+
error: res_error,
|
|
844
|
+
} = ConfigurationModel.StoresResponse().validate(response, {
|
|
845
|
+
abortEarly: false,
|
|
846
|
+
allowUnknown: false,
|
|
847
|
+
});
|
|
848
|
+
|
|
849
|
+
if (res_error) {
|
|
850
|
+
Logger({
|
|
851
|
+
level: "WARN",
|
|
852
|
+
message: "Response Validation Warnnings for getAppStores",
|
|
853
|
+
});
|
|
854
|
+
Logger({ level: "WARN", message: res_error });
|
|
855
|
+
}
|
|
856
|
+
|
|
857
|
+
return response;
|
|
583
858
|
}
|
|
584
859
|
|
|
585
860
|
/**
|
|
@@ -614,10 +889,11 @@ class Configuration {
|
|
|
614
889
|
|
|
615
890
|
/**
|
|
616
891
|
* @param {Object} arg - Arg object.
|
|
892
|
+
* @returns {Promise<ApplicationInventory>} - Success response
|
|
617
893
|
* @summary: Get application configuration
|
|
618
894
|
* @description: Get application configuration for various features and data
|
|
619
895
|
*/
|
|
620
|
-
getInventoryConfig({} = {}) {
|
|
896
|
+
async getInventoryConfig({} = {}) {
|
|
621
897
|
const { error } = ConfigurationValidator.getInventoryConfig().validate(
|
|
622
898
|
{},
|
|
623
899
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -634,28 +910,49 @@ class Configuration {
|
|
|
634
910
|
{ abortEarly: false, allowUnknown: false }
|
|
635
911
|
);
|
|
636
912
|
if (warrning) {
|
|
637
|
-
|
|
638
|
-
|
|
913
|
+
Logger({
|
|
914
|
+
level: "WARN",
|
|
915
|
+
message: "Parameter Validation warrnings for getInventoryConfig",
|
|
916
|
+
});
|
|
917
|
+
Logger({ level: "WARN", message: warrning });
|
|
639
918
|
}
|
|
640
919
|
|
|
641
920
|
const query_params = {};
|
|
642
921
|
|
|
643
|
-
|
|
922
|
+
const response = await PlatformAPIClient.execute(
|
|
644
923
|
this.config,
|
|
645
924
|
"get",
|
|
646
925
|
`/service/platform/configuration/v1.0/company/${this.config.companyId}/application/${this.applicationId}/configuration`,
|
|
647
926
|
query_params,
|
|
648
927
|
undefined
|
|
649
928
|
);
|
|
929
|
+
|
|
930
|
+
const {
|
|
931
|
+
error: res_error,
|
|
932
|
+
} = ConfigurationModel.ApplicationInventory().validate(response, {
|
|
933
|
+
abortEarly: false,
|
|
934
|
+
allowUnknown: false,
|
|
935
|
+
});
|
|
936
|
+
|
|
937
|
+
if (res_error) {
|
|
938
|
+
Logger({
|
|
939
|
+
level: "WARN",
|
|
940
|
+
message: "Response Validation Warnnings for getInventoryConfig",
|
|
941
|
+
});
|
|
942
|
+
Logger({ level: "WARN", message: res_error });
|
|
943
|
+
}
|
|
944
|
+
|
|
945
|
+
return response;
|
|
650
946
|
}
|
|
651
947
|
|
|
652
948
|
/**
|
|
653
949
|
* @param {Object} arg - Arg object.
|
|
654
950
|
* @param {ApplicationInventory} arg.body
|
|
951
|
+
* @returns {Promise<ApplicationInventory>} - Success response
|
|
655
952
|
* @summary: Update application configuration
|
|
656
953
|
* @description: Update application configuration for various features and data
|
|
657
954
|
*/
|
|
658
|
-
updateInventoryConfig({ body } = {}) {
|
|
955
|
+
async updateInventoryConfig({ body } = {}) {
|
|
659
956
|
const { error } = ConfigurationValidator.updateInventoryConfig().validate(
|
|
660
957
|
{
|
|
661
958
|
body,
|
|
@@ -676,28 +973,49 @@ class Configuration {
|
|
|
676
973
|
{ abortEarly: false, allowUnknown: false }
|
|
677
974
|
);
|
|
678
975
|
if (warrning) {
|
|
679
|
-
|
|
680
|
-
|
|
976
|
+
Logger({
|
|
977
|
+
level: "WARN",
|
|
978
|
+
message: "Parameter Validation warrnings for updateInventoryConfig",
|
|
979
|
+
});
|
|
980
|
+
Logger({ level: "WARN", message: warrning });
|
|
681
981
|
}
|
|
682
982
|
|
|
683
983
|
const query_params = {};
|
|
684
984
|
|
|
685
|
-
|
|
985
|
+
const response = await PlatformAPIClient.execute(
|
|
686
986
|
this.config,
|
|
687
987
|
"put",
|
|
688
988
|
`/service/platform/configuration/v1.0/company/${this.config.companyId}/application/${this.applicationId}/configuration`,
|
|
689
989
|
query_params,
|
|
690
990
|
body
|
|
691
991
|
);
|
|
992
|
+
|
|
993
|
+
const {
|
|
994
|
+
error: res_error,
|
|
995
|
+
} = ConfigurationModel.ApplicationInventory().validate(response, {
|
|
996
|
+
abortEarly: false,
|
|
997
|
+
allowUnknown: false,
|
|
998
|
+
});
|
|
999
|
+
|
|
1000
|
+
if (res_error) {
|
|
1001
|
+
Logger({
|
|
1002
|
+
level: "WARN",
|
|
1003
|
+
message: "Response Validation Warnnings for updateInventoryConfig",
|
|
1004
|
+
});
|
|
1005
|
+
Logger({ level: "WARN", message: res_error });
|
|
1006
|
+
}
|
|
1007
|
+
|
|
1008
|
+
return response;
|
|
692
1009
|
}
|
|
693
1010
|
|
|
694
1011
|
/**
|
|
695
1012
|
* @param {Object} arg - Arg object.
|
|
696
1013
|
* @param {AppInventoryPartialUpdate} arg.body
|
|
1014
|
+
* @returns {Promise<ApplicationInventory>} - Success response
|
|
697
1015
|
* @summary: Partially update application configuration
|
|
698
1016
|
* @description: Partially update application configuration for various features and data
|
|
699
1017
|
*/
|
|
700
|
-
partiallyUpdateInventoryConfig({ body } = {}) {
|
|
1018
|
+
async partiallyUpdateInventoryConfig({ body } = {}) {
|
|
701
1019
|
const {
|
|
702
1020
|
error,
|
|
703
1021
|
} = ConfigurationValidator.partiallyUpdateInventoryConfig().validate(
|
|
@@ -720,29 +1038,50 @@ class Configuration {
|
|
|
720
1038
|
{ abortEarly: false, allowUnknown: false }
|
|
721
1039
|
);
|
|
722
1040
|
if (warrning) {
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
1041
|
+
Logger({
|
|
1042
|
+
level: "WARN",
|
|
1043
|
+
message:
|
|
1044
|
+
"Parameter Validation warrnings for partiallyUpdateInventoryConfig",
|
|
1045
|
+
});
|
|
1046
|
+
Logger({ level: "WARN", message: warrning });
|
|
727
1047
|
}
|
|
728
1048
|
|
|
729
1049
|
const query_params = {};
|
|
730
1050
|
|
|
731
|
-
|
|
1051
|
+
const response = await PlatformAPIClient.execute(
|
|
732
1052
|
this.config,
|
|
733
1053
|
"patch",
|
|
734
1054
|
`/service/platform/configuration/v1.0/company/${this.config.companyId}/application/${this.applicationId}/configuration`,
|
|
735
1055
|
query_params,
|
|
736
1056
|
body
|
|
737
1057
|
);
|
|
1058
|
+
|
|
1059
|
+
const {
|
|
1060
|
+
error: res_error,
|
|
1061
|
+
} = ConfigurationModel.ApplicationInventory().validate(response, {
|
|
1062
|
+
abortEarly: false,
|
|
1063
|
+
allowUnknown: false,
|
|
1064
|
+
});
|
|
1065
|
+
|
|
1066
|
+
if (res_error) {
|
|
1067
|
+
Logger({
|
|
1068
|
+
level: "WARN",
|
|
1069
|
+
message:
|
|
1070
|
+
"Response Validation Warnnings for partiallyUpdateInventoryConfig",
|
|
1071
|
+
});
|
|
1072
|
+
Logger({ level: "WARN", message: res_error });
|
|
1073
|
+
}
|
|
1074
|
+
|
|
1075
|
+
return response;
|
|
738
1076
|
}
|
|
739
1077
|
|
|
740
1078
|
/**
|
|
741
1079
|
* @param {Object} arg - Arg object.
|
|
1080
|
+
* @returns {Promise<AppSupportedCurrency>} - Success response
|
|
742
1081
|
* @summary: Get application enabled currency list
|
|
743
1082
|
* @description: Get application enabled currency list
|
|
744
1083
|
*/
|
|
745
|
-
getAppCurrencyConfig({} = {}) {
|
|
1084
|
+
async getAppCurrencyConfig({} = {}) {
|
|
746
1085
|
const { error } = ConfigurationValidator.getAppCurrencyConfig().validate(
|
|
747
1086
|
{},
|
|
748
1087
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -759,28 +1098,49 @@ class Configuration {
|
|
|
759
1098
|
{ abortEarly: false, allowUnknown: false }
|
|
760
1099
|
);
|
|
761
1100
|
if (warrning) {
|
|
762
|
-
|
|
763
|
-
|
|
1101
|
+
Logger({
|
|
1102
|
+
level: "WARN",
|
|
1103
|
+
message: "Parameter Validation warrnings for getAppCurrencyConfig",
|
|
1104
|
+
});
|
|
1105
|
+
Logger({ level: "WARN", message: warrning });
|
|
764
1106
|
}
|
|
765
1107
|
|
|
766
1108
|
const query_params = {};
|
|
767
1109
|
|
|
768
|
-
|
|
1110
|
+
const response = await PlatformAPIClient.execute(
|
|
769
1111
|
this.config,
|
|
770
1112
|
"get",
|
|
771
1113
|
`/service/platform/configuration/v1.0/company/${this.config.companyId}/application/${this.applicationId}/currency`,
|
|
772
1114
|
query_params,
|
|
773
1115
|
undefined
|
|
774
1116
|
);
|
|
1117
|
+
|
|
1118
|
+
const {
|
|
1119
|
+
error: res_error,
|
|
1120
|
+
} = ConfigurationModel.AppSupportedCurrency().validate(response, {
|
|
1121
|
+
abortEarly: false,
|
|
1122
|
+
allowUnknown: false,
|
|
1123
|
+
});
|
|
1124
|
+
|
|
1125
|
+
if (res_error) {
|
|
1126
|
+
Logger({
|
|
1127
|
+
level: "WARN",
|
|
1128
|
+
message: "Response Validation Warnnings for getAppCurrencyConfig",
|
|
1129
|
+
});
|
|
1130
|
+
Logger({ level: "WARN", message: res_error });
|
|
1131
|
+
}
|
|
1132
|
+
|
|
1133
|
+
return response;
|
|
775
1134
|
}
|
|
776
1135
|
|
|
777
1136
|
/**
|
|
778
1137
|
* @param {Object} arg - Arg object.
|
|
779
1138
|
* @param {AppSupportedCurrency} arg.body
|
|
1139
|
+
* @returns {Promise<AppSupportedCurrency>} - Success response
|
|
780
1140
|
* @summary: Add initial application supported currency
|
|
781
1141
|
* @description: Add initial application supported currency for various features and data. Default INR will be enabled.
|
|
782
1142
|
*/
|
|
783
|
-
updateAppCurrencyConfig({ body } = {}) {
|
|
1143
|
+
async updateAppCurrencyConfig({ body } = {}) {
|
|
784
1144
|
const { error } = ConfigurationValidator.updateAppCurrencyConfig().validate(
|
|
785
1145
|
{
|
|
786
1146
|
body,
|
|
@@ -801,27 +1161,48 @@ class Configuration {
|
|
|
801
1161
|
{ abortEarly: false, allowUnknown: false }
|
|
802
1162
|
);
|
|
803
1163
|
if (warrning) {
|
|
804
|
-
|
|
805
|
-
|
|
1164
|
+
Logger({
|
|
1165
|
+
level: "WARN",
|
|
1166
|
+
message: "Parameter Validation warrnings for updateAppCurrencyConfig",
|
|
1167
|
+
});
|
|
1168
|
+
Logger({ level: "WARN", message: warrning });
|
|
806
1169
|
}
|
|
807
1170
|
|
|
808
1171
|
const query_params = {};
|
|
809
1172
|
|
|
810
|
-
|
|
1173
|
+
const response = await PlatformAPIClient.execute(
|
|
811
1174
|
this.config,
|
|
812
1175
|
"post",
|
|
813
1176
|
`/service/platform/configuration/v1.0/company/${this.config.companyId}/application/${this.applicationId}/currency`,
|
|
814
1177
|
query_params,
|
|
815
1178
|
body
|
|
816
1179
|
);
|
|
1180
|
+
|
|
1181
|
+
const {
|
|
1182
|
+
error: res_error,
|
|
1183
|
+
} = ConfigurationModel.AppSupportedCurrency().validate(response, {
|
|
1184
|
+
abortEarly: false,
|
|
1185
|
+
allowUnknown: false,
|
|
1186
|
+
});
|
|
1187
|
+
|
|
1188
|
+
if (res_error) {
|
|
1189
|
+
Logger({
|
|
1190
|
+
level: "WARN",
|
|
1191
|
+
message: "Response Validation Warnnings for updateAppCurrencyConfig",
|
|
1192
|
+
});
|
|
1193
|
+
Logger({ level: "WARN", message: res_error });
|
|
1194
|
+
}
|
|
1195
|
+
|
|
1196
|
+
return response;
|
|
817
1197
|
}
|
|
818
1198
|
|
|
819
1199
|
/**
|
|
820
1200
|
* @param {Object} arg - Arg object.
|
|
1201
|
+
* @returns {Promise<AppCurrencyResponse>} - Success response
|
|
821
1202
|
* @summary: Get currencies enabled in the application
|
|
822
1203
|
* @description: Use this API to get a list of currencies allowed in the current application. Moreover, get the name, code, symbol, and the decimal digits of the currencies.
|
|
823
1204
|
*/
|
|
824
|
-
getAppSupportedCurrency({} = {}) {
|
|
1205
|
+
async getAppSupportedCurrency({} = {}) {
|
|
825
1206
|
const { error } = ConfigurationValidator.getAppSupportedCurrency().validate(
|
|
826
1207
|
{},
|
|
827
1208
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -838,19 +1219,39 @@ class Configuration {
|
|
|
838
1219
|
{ abortEarly: false, allowUnknown: false }
|
|
839
1220
|
);
|
|
840
1221
|
if (warrning) {
|
|
841
|
-
|
|
842
|
-
|
|
1222
|
+
Logger({
|
|
1223
|
+
level: "WARN",
|
|
1224
|
+
message: "Parameter Validation warrnings for getAppSupportedCurrency",
|
|
1225
|
+
});
|
|
1226
|
+
Logger({ level: "WARN", message: warrning });
|
|
843
1227
|
}
|
|
844
1228
|
|
|
845
1229
|
const query_params = {};
|
|
846
1230
|
|
|
847
|
-
|
|
1231
|
+
const response = await PlatformAPIClient.execute(
|
|
848
1232
|
this.config,
|
|
849
1233
|
"get",
|
|
850
1234
|
`/service/platform/configuration/v1.0/company/${this.config.companyId}/application/${this.applicationId}/currency/supported`,
|
|
851
1235
|
query_params,
|
|
852
1236
|
undefined
|
|
853
1237
|
);
|
|
1238
|
+
|
|
1239
|
+
const {
|
|
1240
|
+
error: res_error,
|
|
1241
|
+
} = ConfigurationModel.AppCurrencyResponse().validate(response, {
|
|
1242
|
+
abortEarly: false,
|
|
1243
|
+
allowUnknown: false,
|
|
1244
|
+
});
|
|
1245
|
+
|
|
1246
|
+
if (res_error) {
|
|
1247
|
+
Logger({
|
|
1248
|
+
level: "WARN",
|
|
1249
|
+
message: "Response Validation Warnnings for getAppSupportedCurrency",
|
|
1250
|
+
});
|
|
1251
|
+
Logger({ level: "WARN", message: res_error });
|
|
1252
|
+
}
|
|
1253
|
+
|
|
1254
|
+
return response;
|
|
854
1255
|
}
|
|
855
1256
|
|
|
856
1257
|
/**
|
|
@@ -858,10 +1259,11 @@ class Configuration {
|
|
|
858
1259
|
* @param {number} [arg.pageNo] - Current page no
|
|
859
1260
|
* @param {number} [arg.pageSize] - Current request items count
|
|
860
1261
|
* @param {FilterOrderingStoreRequest} arg.body
|
|
1262
|
+
* @returns {Promise<OrderingStores>} - Success response
|
|
861
1263
|
* @summary: Get ordering store by filter
|
|
862
1264
|
* @description: Get ordering store by filter
|
|
863
1265
|
*/
|
|
864
|
-
getOrderingStoresByFilter({ body, pageNo, pageSize } = {}) {
|
|
1266
|
+
async getOrderingStoresByFilter({ body, pageNo, pageSize } = {}) {
|
|
865
1267
|
const {
|
|
866
1268
|
error,
|
|
867
1269
|
} = ConfigurationValidator.getOrderingStoresByFilter().validate(
|
|
@@ -888,23 +1290,41 @@ class Configuration {
|
|
|
888
1290
|
{ abortEarly: false, allowUnknown: false }
|
|
889
1291
|
);
|
|
890
1292
|
if (warrning) {
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
1293
|
+
Logger({
|
|
1294
|
+
level: "WARN",
|
|
1295
|
+
message: "Parameter Validation warrnings for getOrderingStoresByFilter",
|
|
1296
|
+
});
|
|
1297
|
+
Logger({ level: "WARN", message: warrning });
|
|
895
1298
|
}
|
|
896
1299
|
|
|
897
1300
|
const query_params = {};
|
|
898
1301
|
query_params["page_no"] = pageNo;
|
|
899
1302
|
query_params["page_size"] = pageSize;
|
|
900
1303
|
|
|
901
|
-
|
|
1304
|
+
const response = await PlatformAPIClient.execute(
|
|
902
1305
|
this.config,
|
|
903
1306
|
"post",
|
|
904
1307
|
`/service/platform/configuration/v1.0/company/${this.config.companyId}/application/${this.applicationId}/ordering-store/stores/filter`,
|
|
905
1308
|
query_params,
|
|
906
1309
|
body
|
|
907
1310
|
);
|
|
1311
|
+
|
|
1312
|
+
const {
|
|
1313
|
+
error: res_error,
|
|
1314
|
+
} = ConfigurationModel.OrderingStores().validate(response, {
|
|
1315
|
+
abortEarly: false,
|
|
1316
|
+
allowUnknown: false,
|
|
1317
|
+
});
|
|
1318
|
+
|
|
1319
|
+
if (res_error) {
|
|
1320
|
+
Logger({
|
|
1321
|
+
level: "WARN",
|
|
1322
|
+
message: "Response Validation Warnnings for getOrderingStoresByFilter",
|
|
1323
|
+
});
|
|
1324
|
+
Logger({ level: "WARN", message: res_error });
|
|
1325
|
+
}
|
|
1326
|
+
|
|
1327
|
+
return response;
|
|
908
1328
|
}
|
|
909
1329
|
|
|
910
1330
|
/**
|
|
@@ -947,10 +1367,11 @@ class Configuration {
|
|
|
947
1367
|
/**
|
|
948
1368
|
* @param {Object} arg - Arg object.
|
|
949
1369
|
* @param {OrderingStoreConfig} arg.body
|
|
1370
|
+
* @returns {Promise<DeploymentMeta>} - Success response
|
|
950
1371
|
* @summary: Add/Update ordering store config
|
|
951
1372
|
* @description: Add/Update ordering store config.
|
|
952
1373
|
*/
|
|
953
|
-
updateOrderingStoreConfig({ body } = {}) {
|
|
1374
|
+
async updateOrderingStoreConfig({ body } = {}) {
|
|
954
1375
|
const {
|
|
955
1376
|
error,
|
|
956
1377
|
} = ConfigurationValidator.updateOrderingStoreConfig().validate(
|
|
@@ -973,21 +1394,39 @@ class Configuration {
|
|
|
973
1394
|
{ abortEarly: false, allowUnknown: false }
|
|
974
1395
|
);
|
|
975
1396
|
if (warrning) {
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
1397
|
+
Logger({
|
|
1398
|
+
level: "WARN",
|
|
1399
|
+
message: "Parameter Validation warrnings for updateOrderingStoreConfig",
|
|
1400
|
+
});
|
|
1401
|
+
Logger({ level: "WARN", message: warrning });
|
|
980
1402
|
}
|
|
981
1403
|
|
|
982
1404
|
const query_params = {};
|
|
983
1405
|
|
|
984
|
-
|
|
1406
|
+
const response = await PlatformAPIClient.execute(
|
|
985
1407
|
this.config,
|
|
986
1408
|
"post",
|
|
987
1409
|
`/service/platform/configuration/v1.0/company/${this.config.companyId}/application/${this.applicationId}/ordering-store`,
|
|
988
1410
|
query_params,
|
|
989
1411
|
body
|
|
990
1412
|
);
|
|
1413
|
+
|
|
1414
|
+
const {
|
|
1415
|
+
error: res_error,
|
|
1416
|
+
} = ConfigurationModel.DeploymentMeta().validate(response, {
|
|
1417
|
+
abortEarly: false,
|
|
1418
|
+
allowUnknown: false,
|
|
1419
|
+
});
|
|
1420
|
+
|
|
1421
|
+
if (res_error) {
|
|
1422
|
+
Logger({
|
|
1423
|
+
level: "WARN",
|
|
1424
|
+
message: "Response Validation Warnnings for updateOrderingStoreConfig",
|
|
1425
|
+
});
|
|
1426
|
+
Logger({ level: "WARN", message: res_error });
|
|
1427
|
+
}
|
|
1428
|
+
|
|
1429
|
+
return response;
|
|
991
1430
|
}
|
|
992
1431
|
|
|
993
1432
|
/**
|
|
@@ -997,10 +1436,11 @@ class Configuration {
|
|
|
997
1436
|
* @param {number} [arg.pageSize] - The number of items to retrieve in each
|
|
998
1437
|
* page. Default value is 10.
|
|
999
1438
|
* @param {string} [arg.q] - Store code or name of the ordering store.
|
|
1439
|
+
* @returns {Promise<OrderingStoresResponse>} - Success response
|
|
1000
1440
|
* @summary: Get deployment stores
|
|
1001
1441
|
* @description: Use this API to retrieve the details of all stores access given to the staff member (the selling locations where the application will be utilized for placing orders).
|
|
1002
1442
|
*/
|
|
1003
|
-
getStaffOrderingStores({ pageNo, pageSize, q } = {}) {
|
|
1443
|
+
async getStaffOrderingStores({ pageNo, pageSize, q } = {}) {
|
|
1004
1444
|
const { error } = ConfigurationValidator.getStaffOrderingStores().validate(
|
|
1005
1445
|
{
|
|
1006
1446
|
pageNo,
|
|
@@ -1025,8 +1465,11 @@ class Configuration {
|
|
|
1025
1465
|
{ abortEarly: false, allowUnknown: false }
|
|
1026
1466
|
);
|
|
1027
1467
|
if (warrning) {
|
|
1028
|
-
|
|
1029
|
-
|
|
1468
|
+
Logger({
|
|
1469
|
+
level: "WARN",
|
|
1470
|
+
message: "Parameter Validation warrnings for getStaffOrderingStores",
|
|
1471
|
+
});
|
|
1472
|
+
Logger({ level: "WARN", message: warrning });
|
|
1030
1473
|
}
|
|
1031
1474
|
|
|
1032
1475
|
const query_params = {};
|
|
@@ -1034,13 +1477,30 @@ class Configuration {
|
|
|
1034
1477
|
query_params["page_size"] = pageSize;
|
|
1035
1478
|
query_params["q"] = q;
|
|
1036
1479
|
|
|
1037
|
-
|
|
1480
|
+
const response = await PlatformAPIClient.execute(
|
|
1038
1481
|
this.config,
|
|
1039
1482
|
"get",
|
|
1040
1483
|
`/service/platform/configuration/v1.0/company/${this.config.companyId}/application/${this.applicationId}/ordering-store/staff-stores`,
|
|
1041
1484
|
query_params,
|
|
1042
1485
|
undefined
|
|
1043
1486
|
);
|
|
1487
|
+
|
|
1488
|
+
const {
|
|
1489
|
+
error: res_error,
|
|
1490
|
+
} = ConfigurationModel.OrderingStoresResponse().validate(response, {
|
|
1491
|
+
abortEarly: false,
|
|
1492
|
+
allowUnknown: false,
|
|
1493
|
+
});
|
|
1494
|
+
|
|
1495
|
+
if (res_error) {
|
|
1496
|
+
Logger({
|
|
1497
|
+
level: "WARN",
|
|
1498
|
+
message: "Response Validation Warnnings for getStaffOrderingStores",
|
|
1499
|
+
});
|
|
1500
|
+
Logger({ level: "WARN", message: res_error });
|
|
1501
|
+
}
|
|
1502
|
+
|
|
1503
|
+
return response;
|
|
1044
1504
|
}
|
|
1045
1505
|
|
|
1046
1506
|
/**
|
|
@@ -1083,10 +1543,11 @@ class Configuration {
|
|
|
1083
1543
|
|
|
1084
1544
|
/**
|
|
1085
1545
|
* @param {Object} arg - Arg object.
|
|
1546
|
+
* @returns {Promise<DomainsResponse>} - Success response
|
|
1086
1547
|
* @summary: Get attached domain list
|
|
1087
1548
|
* @description: Get attached domain list.
|
|
1088
1549
|
*/
|
|
1089
|
-
getDomains({} = {}) {
|
|
1550
|
+
async getDomains({} = {}) {
|
|
1090
1551
|
const { error } = ConfigurationValidator.getDomains().validate(
|
|
1091
1552
|
{},
|
|
1092
1553
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -1101,28 +1562,49 @@ class Configuration {
|
|
|
1101
1562
|
{ abortEarly: false, allowUnknown: false }
|
|
1102
1563
|
);
|
|
1103
1564
|
if (warrning) {
|
|
1104
|
-
|
|
1105
|
-
|
|
1565
|
+
Logger({
|
|
1566
|
+
level: "WARN",
|
|
1567
|
+
message: "Parameter Validation warrnings for getDomains",
|
|
1568
|
+
});
|
|
1569
|
+
Logger({ level: "WARN", message: warrning });
|
|
1106
1570
|
}
|
|
1107
1571
|
|
|
1108
1572
|
const query_params = {};
|
|
1109
1573
|
|
|
1110
|
-
|
|
1574
|
+
const response = await PlatformAPIClient.execute(
|
|
1111
1575
|
this.config,
|
|
1112
1576
|
"get",
|
|
1113
1577
|
`/service/platform/configuration/v1.0/company/${this.config.companyId}/application/${this.applicationId}/domain`,
|
|
1114
1578
|
query_params,
|
|
1115
1579
|
undefined
|
|
1116
1580
|
);
|
|
1581
|
+
|
|
1582
|
+
const {
|
|
1583
|
+
error: res_error,
|
|
1584
|
+
} = ConfigurationModel.DomainsResponse().validate(response, {
|
|
1585
|
+
abortEarly: false,
|
|
1586
|
+
allowUnknown: false,
|
|
1587
|
+
});
|
|
1588
|
+
|
|
1589
|
+
if (res_error) {
|
|
1590
|
+
Logger({
|
|
1591
|
+
level: "WARN",
|
|
1592
|
+
message: "Response Validation Warnnings for getDomains",
|
|
1593
|
+
});
|
|
1594
|
+
Logger({ level: "WARN", message: res_error });
|
|
1595
|
+
}
|
|
1596
|
+
|
|
1597
|
+
return response;
|
|
1117
1598
|
}
|
|
1118
1599
|
|
|
1119
1600
|
/**
|
|
1120
1601
|
* @param {Object} arg - Arg object.
|
|
1121
1602
|
* @param {DomainAddRequest} arg.body
|
|
1603
|
+
* @returns {Promise<Domain>} - Success response
|
|
1122
1604
|
* @summary: Add new domain to application
|
|
1123
1605
|
* @description: Add new domain to application.
|
|
1124
1606
|
*/
|
|
1125
|
-
addDomain({ body } = {}) {
|
|
1607
|
+
async addDomain({ body } = {}) {
|
|
1126
1608
|
const { error } = ConfigurationValidator.addDomain().validate(
|
|
1127
1609
|
{
|
|
1128
1610
|
body,
|
|
@@ -1141,28 +1623,47 @@ class Configuration {
|
|
|
1141
1623
|
{ abortEarly: false, allowUnknown: false }
|
|
1142
1624
|
);
|
|
1143
1625
|
if (warrning) {
|
|
1144
|
-
|
|
1145
|
-
|
|
1626
|
+
Logger({
|
|
1627
|
+
level: "WARN",
|
|
1628
|
+
message: "Parameter Validation warrnings for addDomain",
|
|
1629
|
+
});
|
|
1630
|
+
Logger({ level: "WARN", message: warrning });
|
|
1146
1631
|
}
|
|
1147
1632
|
|
|
1148
1633
|
const query_params = {};
|
|
1149
1634
|
|
|
1150
|
-
|
|
1635
|
+
const response = await PlatformAPIClient.execute(
|
|
1151
1636
|
this.config,
|
|
1152
1637
|
"post",
|
|
1153
1638
|
`/service/platform/configuration/v1.0/company/${this.config.companyId}/application/${this.applicationId}/domain`,
|
|
1154
1639
|
query_params,
|
|
1155
1640
|
body
|
|
1156
1641
|
);
|
|
1642
|
+
|
|
1643
|
+
const { error: res_error } = ConfigurationModel.Domain().validate(
|
|
1644
|
+
response,
|
|
1645
|
+
{ abortEarly: false, allowUnknown: false }
|
|
1646
|
+
);
|
|
1647
|
+
|
|
1648
|
+
if (res_error) {
|
|
1649
|
+
Logger({
|
|
1650
|
+
level: "WARN",
|
|
1651
|
+
message: "Response Validation Warnnings for addDomain",
|
|
1652
|
+
});
|
|
1653
|
+
Logger({ level: "WARN", message: res_error });
|
|
1654
|
+
}
|
|
1655
|
+
|
|
1656
|
+
return response;
|
|
1157
1657
|
}
|
|
1158
1658
|
|
|
1159
1659
|
/**
|
|
1160
1660
|
* @param {Object} arg - Arg object.
|
|
1161
1661
|
* @param {string} arg.id - Domain _id
|
|
1662
|
+
* @returns {Promise<SuccessMessageResponse>} - Success response
|
|
1162
1663
|
* @summary: Remove attached domain
|
|
1163
1664
|
* @description: Remove attached domain.
|
|
1164
1665
|
*/
|
|
1165
|
-
removeDomainById({ id } = {}) {
|
|
1666
|
+
async removeDomainById({ id } = {}) {
|
|
1166
1667
|
const { error } = ConfigurationValidator.removeDomainById().validate(
|
|
1167
1668
|
{
|
|
1168
1669
|
id,
|
|
@@ -1183,28 +1684,49 @@ class Configuration {
|
|
|
1183
1684
|
{ abortEarly: false, allowUnknown: false }
|
|
1184
1685
|
);
|
|
1185
1686
|
if (warrning) {
|
|
1186
|
-
|
|
1187
|
-
|
|
1687
|
+
Logger({
|
|
1688
|
+
level: "WARN",
|
|
1689
|
+
message: "Parameter Validation warrnings for removeDomainById",
|
|
1690
|
+
});
|
|
1691
|
+
Logger({ level: "WARN", message: warrning });
|
|
1188
1692
|
}
|
|
1189
1693
|
|
|
1190
1694
|
const query_params = {};
|
|
1191
1695
|
|
|
1192
|
-
|
|
1696
|
+
const response = await PlatformAPIClient.execute(
|
|
1193
1697
|
this.config,
|
|
1194
1698
|
"delete",
|
|
1195
1699
|
`/service/platform/configuration/v1.0/company/${this.config.companyId}/application/${this.applicationId}/domain/${id}`,
|
|
1196
1700
|
query_params,
|
|
1197
1701
|
undefined
|
|
1198
1702
|
);
|
|
1703
|
+
|
|
1704
|
+
const {
|
|
1705
|
+
error: res_error,
|
|
1706
|
+
} = ConfigurationModel.SuccessMessageResponse().validate(response, {
|
|
1707
|
+
abortEarly: false,
|
|
1708
|
+
allowUnknown: false,
|
|
1709
|
+
});
|
|
1710
|
+
|
|
1711
|
+
if (res_error) {
|
|
1712
|
+
Logger({
|
|
1713
|
+
level: "WARN",
|
|
1714
|
+
message: "Response Validation Warnnings for removeDomainById",
|
|
1715
|
+
});
|
|
1716
|
+
Logger({ level: "WARN", message: res_error });
|
|
1717
|
+
}
|
|
1718
|
+
|
|
1719
|
+
return response;
|
|
1199
1720
|
}
|
|
1200
1721
|
|
|
1201
1722
|
/**
|
|
1202
1723
|
* @param {Object} arg - Arg object.
|
|
1203
1724
|
* @param {UpdateDomainTypeRequest} arg.body
|
|
1725
|
+
* @returns {Promise<DomainsResponse>} - Success response
|
|
1204
1726
|
* @summary: Change domain type
|
|
1205
1727
|
* @description: Change a domain to Primary or Shortlink domain
|
|
1206
1728
|
*/
|
|
1207
|
-
changeDomainType({ body } = {}) {
|
|
1729
|
+
async changeDomainType({ body } = {}) {
|
|
1208
1730
|
const { error } = ConfigurationValidator.changeDomainType().validate(
|
|
1209
1731
|
{
|
|
1210
1732
|
body,
|
|
@@ -1225,28 +1747,49 @@ class Configuration {
|
|
|
1225
1747
|
{ abortEarly: false, allowUnknown: false }
|
|
1226
1748
|
);
|
|
1227
1749
|
if (warrning) {
|
|
1228
|
-
|
|
1229
|
-
|
|
1750
|
+
Logger({
|
|
1751
|
+
level: "WARN",
|
|
1752
|
+
message: "Parameter Validation warrnings for changeDomainType",
|
|
1753
|
+
});
|
|
1754
|
+
Logger({ level: "WARN", message: warrning });
|
|
1230
1755
|
}
|
|
1231
1756
|
|
|
1232
1757
|
const query_params = {};
|
|
1233
1758
|
|
|
1234
|
-
|
|
1759
|
+
const response = await PlatformAPIClient.execute(
|
|
1235
1760
|
this.config,
|
|
1236
1761
|
"post",
|
|
1237
1762
|
`/service/platform/configuration/v1.0/company/${this.config.companyId}/application/${this.applicationId}/domain/set-domain`,
|
|
1238
1763
|
query_params,
|
|
1239
1764
|
body
|
|
1240
1765
|
);
|
|
1766
|
+
|
|
1767
|
+
const {
|
|
1768
|
+
error: res_error,
|
|
1769
|
+
} = ConfigurationModel.DomainsResponse().validate(response, {
|
|
1770
|
+
abortEarly: false,
|
|
1771
|
+
allowUnknown: false,
|
|
1772
|
+
});
|
|
1773
|
+
|
|
1774
|
+
if (res_error) {
|
|
1775
|
+
Logger({
|
|
1776
|
+
level: "WARN",
|
|
1777
|
+
message: "Response Validation Warnnings for changeDomainType",
|
|
1778
|
+
});
|
|
1779
|
+
Logger({ level: "WARN", message: res_error });
|
|
1780
|
+
}
|
|
1781
|
+
|
|
1782
|
+
return response;
|
|
1241
1783
|
}
|
|
1242
1784
|
|
|
1243
1785
|
/**
|
|
1244
1786
|
* @param {Object} arg - Arg object.
|
|
1245
1787
|
* @param {DomainStatusRequest} arg.body
|
|
1788
|
+
* @returns {Promise<DomainStatusResponse>} - Success response
|
|
1246
1789
|
* @summary: Get domain connected status.
|
|
1247
1790
|
* @description: Get domain connected status. Check if domain is live and mapped to appropriate IP to fynd servers.
|
|
1248
1791
|
*/
|
|
1249
|
-
getDomainStatus({ body } = {}) {
|
|
1792
|
+
async getDomainStatus({ body } = {}) {
|
|
1250
1793
|
const { error } = ConfigurationValidator.getDomainStatus().validate(
|
|
1251
1794
|
{
|
|
1252
1795
|
body,
|
|
@@ -1267,27 +1810,48 @@ class Configuration {
|
|
|
1267
1810
|
{ abortEarly: false, allowUnknown: false }
|
|
1268
1811
|
);
|
|
1269
1812
|
if (warrning) {
|
|
1270
|
-
|
|
1271
|
-
|
|
1813
|
+
Logger({
|
|
1814
|
+
level: "WARN",
|
|
1815
|
+
message: "Parameter Validation warrnings for getDomainStatus",
|
|
1816
|
+
});
|
|
1817
|
+
Logger({ level: "WARN", message: warrning });
|
|
1272
1818
|
}
|
|
1273
1819
|
|
|
1274
1820
|
const query_params = {};
|
|
1275
1821
|
|
|
1276
|
-
|
|
1822
|
+
const response = await PlatformAPIClient.execute(
|
|
1277
1823
|
this.config,
|
|
1278
1824
|
"post",
|
|
1279
1825
|
`/service/platform/configuration/v1.0/company/${this.config.companyId}/application/${this.applicationId}/domain/domain-status`,
|
|
1280
1826
|
query_params,
|
|
1281
1827
|
body
|
|
1282
1828
|
);
|
|
1829
|
+
|
|
1830
|
+
const {
|
|
1831
|
+
error: res_error,
|
|
1832
|
+
} = ConfigurationModel.DomainStatusResponse().validate(response, {
|
|
1833
|
+
abortEarly: false,
|
|
1834
|
+
allowUnknown: false,
|
|
1835
|
+
});
|
|
1836
|
+
|
|
1837
|
+
if (res_error) {
|
|
1838
|
+
Logger({
|
|
1839
|
+
level: "WARN",
|
|
1840
|
+
message: "Response Validation Warnnings for getDomainStatus",
|
|
1841
|
+
});
|
|
1842
|
+
Logger({ level: "WARN", message: res_error });
|
|
1843
|
+
}
|
|
1844
|
+
|
|
1845
|
+
return response;
|
|
1283
1846
|
}
|
|
1284
1847
|
|
|
1285
1848
|
/**
|
|
1286
1849
|
* @param {Object} arg - Arg object.
|
|
1850
|
+
* @returns {Promise<Application>} - Success response
|
|
1287
1851
|
* @summary: Get application data from id
|
|
1288
1852
|
* @description: Get application data from id
|
|
1289
1853
|
*/
|
|
1290
|
-
getApplicationById({} = {}) {
|
|
1854
|
+
async getApplicationById({} = {}) {
|
|
1291
1855
|
const { error } = ConfigurationValidator.getApplicationById().validate(
|
|
1292
1856
|
{},
|
|
1293
1857
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -1304,19 +1868,39 @@ class Configuration {
|
|
|
1304
1868
|
{ abortEarly: false, allowUnknown: false }
|
|
1305
1869
|
);
|
|
1306
1870
|
if (warrning) {
|
|
1307
|
-
|
|
1308
|
-
|
|
1871
|
+
Logger({
|
|
1872
|
+
level: "WARN",
|
|
1873
|
+
message: "Parameter Validation warrnings for getApplicationById",
|
|
1874
|
+
});
|
|
1875
|
+
Logger({ level: "WARN", message: warrning });
|
|
1309
1876
|
}
|
|
1310
1877
|
|
|
1311
1878
|
const query_params = {};
|
|
1312
1879
|
|
|
1313
|
-
|
|
1880
|
+
const response = await PlatformAPIClient.execute(
|
|
1314
1881
|
this.config,
|
|
1315
1882
|
"get",
|
|
1316
1883
|
`/service/platform/configuration/v1.0/company/${this.config.companyId}/application/${this.applicationId}`,
|
|
1317
1884
|
query_params,
|
|
1318
1885
|
undefined
|
|
1319
1886
|
);
|
|
1887
|
+
|
|
1888
|
+
const {
|
|
1889
|
+
error: res_error,
|
|
1890
|
+
} = ConfigurationModel.Application().validate(response, {
|
|
1891
|
+
abortEarly: false,
|
|
1892
|
+
allowUnknown: false,
|
|
1893
|
+
});
|
|
1894
|
+
|
|
1895
|
+
if (res_error) {
|
|
1896
|
+
Logger({
|
|
1897
|
+
level: "WARN",
|
|
1898
|
+
message: "Response Validation Warnnings for getApplicationById",
|
|
1899
|
+
});
|
|
1900
|
+
Logger({ level: "WARN", message: res_error });
|
|
1901
|
+
}
|
|
1902
|
+
|
|
1903
|
+
return response;
|
|
1320
1904
|
}
|
|
1321
1905
|
}
|
|
1322
1906
|
module.exports = Configuration;
|