@gofynd/fdk-client-javascript 1.0.0 → 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 +393 -393
- package/documentation/application/CONTENT.md +15 -1
- package/documentation/application/ORDER.md +268 -268
- package/documentation/application/PAYMENT.md +249 -249
- package/documentation/application/POSCART.md +297 -297
- package/documentation/platform/CART.md +499 -499
- package/documentation/platform/CATALOG.md +3497 -3097
- package/documentation/platform/COMPANYPROFILE.md +207 -207
- package/documentation/platform/CONTENT.md +123 -1
- package/documentation/platform/ORDER.md +1518 -1324
- package/documentation/platform/PARTNER.md +7 -7
- package/documentation/platform/PAYMENT.md +96 -96
- package/index.js +7 -1
- package/package.json +1 -1
- package/sdk/application/ApplicationConfig.js +1 -1
- package/sdk/application/Cart/CartApplicationClient.js +865 -52
- package/sdk/application/Cart/CartApplicationModel.d.ts +7 -7
- package/sdk/application/Cart/CartApplicationModel.js +335 -335
- package/sdk/application/Cart/CartApplicationValidator.js +1 -0
- package/sdk/application/Catalog/CatalogApplicationClient.d.ts +1 -1
- package/sdk/application/Catalog/CatalogApplicationClient.js +1034 -60
- package/sdk/application/Catalog/CatalogApplicationModel.d.ts +19 -19
- package/sdk/application/Catalog/CatalogApplicationModel.js +532 -532
- package/sdk/application/Catalog/CatalogApplicationValidator.js +1 -0
- package/sdk/application/Common/CommonApplicationClient.js +66 -4
- package/sdk/application/Common/CommonApplicationValidator.js +1 -0
- package/sdk/application/Communication/CommunicationApplicationClient.js +108 -6
- package/sdk/application/Communication/CommunicationApplicationValidator.js +1 -0
- package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +1 -1
- package/sdk/application/Configuration/ConfigurationApplicationClient.js +558 -32
- package/sdk/application/Configuration/ConfigurationApplicationValidator.js +1 -0
- package/sdk/application/Content/ContentApplicationClient.js +621 -38
- package/sdk/application/Content/ContentApplicationModel.d.ts +1 -0
- package/sdk/application/Content/ContentApplicationModel.js +11 -1
- package/sdk/application/Content/ContentApplicationValidator.js +1 -0
- package/sdk/application/FileStorage/FileStorageApplicationClient.js +101 -6
- package/sdk/application/FileStorage/FileStorageApplicationValidator.js +1 -0
- package/sdk/application/Lead/LeadApplicationClient.js +229 -14
- package/sdk/application/Lead/LeadApplicationValidator.js +1 -0
- package/sdk/application/Logistic/LogisticApplicationClient.js +134 -8
- package/sdk/application/Logistic/LogisticApplicationValidator.js +1 -0
- package/sdk/application/Order/OrderApplicationClient.d.ts +1 -1
- package/sdk/application/Order/OrderApplicationClient.js +403 -24
- package/sdk/application/Order/OrderApplicationModel.d.ts +20 -20
- package/sdk/application/Order/OrderApplicationModel.js +334 -334
- package/sdk/application/Order/OrderApplicationValidator.js +1 -0
- package/sdk/application/Payment/PaymentApplicationClient.js +1381 -78
- package/sdk/application/Payment/PaymentApplicationModel.d.ts +2 -2
- package/sdk/application/Payment/PaymentApplicationModel.js +350 -350
- package/sdk/application/Payment/PaymentApplicationValidator.js +1 -0
- package/sdk/application/PosCart/PosCartApplicationClient.js +914 -54
- package/sdk/application/PosCart/PosCartApplicationModel.d.ts +15 -15
- package/sdk/application/PosCart/PosCartApplicationModel.js +389 -389
- package/sdk/application/PosCart/PosCartApplicationValidator.js +1 -0
- package/sdk/application/Rewards/RewardsApplicationClient.js +235 -14
- package/sdk/application/Rewards/RewardsApplicationValidator.js +1 -0
- package/sdk/application/Share/ShareApplicationClient.js +226 -14
- package/sdk/application/Share/ShareApplicationValidator.js +1 -0
- package/sdk/application/Theme/ThemeApplicationClient.js +130 -8
- package/sdk/application/Theme/ThemeApplicationValidator.js +1 -0
- package/sdk/application/User/UserApplicationClient.js +1133 -70
- package/sdk/application/User/UserApplicationValidator.js +1 -0
- package/sdk/common/AxiosHelper.js +1 -1
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.d.ts +16 -8
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.js +287 -16
- package/sdk/platform/Analytics/AnalyticsPlatformClient.d.ts +8 -4
- package/sdk/platform/Analytics/AnalyticsPlatformClient.js +153 -8
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.d.ts +8 -4
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +141 -8
- package/sdk/platform/Billing/BillingPlatformClient.d.ts +24 -12
- package/sdk/platform/Billing/BillingPlatformClient.js +429 -24
- package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +34 -17
- package/sdk/platform/Cart/CartPlatformApplicationClient.js +617 -34
- package/sdk/platform/Cart/CartPlatformModel.d.ts +35 -35
- package/sdk/platform/Cart/CartPlatformModel.js +617 -617
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +191 -138
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +2202 -302
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +11 -11
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +45 -45
- package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +344 -226
- package/sdk/platform/Catalog/CatalogPlatformClient.js +3282 -488
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +110 -100
- package/sdk/platform/Catalog/CatalogPlatformModel.js +2073 -1795
- package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +23 -21
- package/sdk/platform/Catalog/CatalogPlatformValidator.js +103 -84
- package/sdk/platform/Common/CommonPlatformClient.d.ts +4 -2
- package/sdk/platform/Common/CommonPlatformClient.js +73 -4
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +80 -40
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +1499 -80
- package/sdk/platform/Communication/CommunicationPlatformClient.d.ts +2 -1
- package/sdk/platform/Communication/CommunicationPlatformClient.js +41 -2
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +27 -14
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +486 -26
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +9 -9
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +274 -274
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +56 -28
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +1022 -56
- package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +36 -18
- package/sdk/platform/Configuration/ConfigurationPlatformClient.js +693 -36
- package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +148 -67
- package/sdk/platform/Content/ContentPlatformApplicationClient.js +2446 -140
- 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 +400 -22
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +8 -4
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +148 -8
- package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +12 -6
- package/sdk/platform/FileStorage/FileStoragePlatformClient.js +214 -12
- package/sdk/platform/Inventory/InventoryPlatformClient.d.ts +27 -14
- package/sdk/platform/Inventory/InventoryPlatformClient.js +449 -24
- package/sdk/platform/Lead/LeadPlatformApplicationClient.d.ts +26 -13
- package/sdk/platform/Lead/LeadPlatformApplicationClient.js +447 -26
- package/sdk/platform/Lead/LeadPlatformClient.d.ts +22 -11
- package/sdk/platform/Lead/LeadPlatformClient.js +384 -22
- package/sdk/platform/OAuthClient.js +8 -8
- package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +6 -3
- package/sdk/platform/Order/OrderPlatformApplicationClient.js +125 -6
- package/sdk/platform/Order/OrderPlatformClient.d.ts +108 -47
- package/sdk/platform/Order/OrderPlatformClient.js +1641 -100
- package/sdk/platform/Order/OrderPlatformModel.d.ts +69 -58
- package/sdk/platform/Order/OrderPlatformModel.js +1485 -1493
- package/sdk/platform/Order/OrderPlatformValidator.d.ts +2 -1
- package/sdk/platform/Order/OrderPlatformValidator.js +15 -4
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.d.ts +4 -2
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.js +74 -4
- 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 +418 -22
- package/sdk/platform/Payment/PaymentPlatformClient.d.ts +21 -11
- package/sdk/platform/Payment/PaymentPlatformClient.js +374 -20
- package/sdk/platform/Payment/PaymentPlatformModel.js +139 -139
- package/sdk/platform/PlatformApplicationClient.d.ts +2973 -2827
- package/sdk/platform/PlatformApplicationClient.js +3461 -3263
- package/sdk/platform/PlatformClient.d.ts +2973 -2827
- package/sdk/platform/PlatformClient.js +3461 -3263
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.d.ts +26 -13
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +449 -26
- package/sdk/platform/Share/SharePlatformApplicationClient.d.ts +8 -4
- package/sdk/platform/Share/SharePlatformApplicationClient.js +139 -8
- package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +47 -23
- package/sdk/platform/Theme/ThemePlatformApplicationClient.js +816 -48
- package/sdk/platform/User/UserPlatformApplicationClient.d.ts +24 -12
- package/sdk/platform/User/UserPlatformApplicationClient.js +417 -24
- package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +12 -6
- package/sdk/platform/Webhook/WebhookPlatformClient.js +229 -12
- package/sdk/public/Configuration/ConfigurationPublicClient.js +72 -4
- package/sdk/public/Configuration/ConfigurationPublicValidator.js +3 -1
- package/sdk/public/Inventory/InventoryPublicClient.js +210 -12
- package/sdk/public/Inventory/InventoryPublicValidator.js +3 -1
- package/sdk/public/Webhook/WebhookPublicClient.js +74 -4
- package/sdk/public/Webhook/WebhookPublicValidator.js +3 -1
|
@@ -2,6 +2,9 @@ const Paginator = require("../../common/Paginator");
|
|
|
2
2
|
const { FDKClientValidationError } = require("../../common/FDKError");
|
|
3
3
|
const PlatformAPIClient = require("../PlatformAPIClient");
|
|
4
4
|
const ConfigurationValidator = require("./ConfigurationPlatformValidator");
|
|
5
|
+
const ConfigurationModel = require("./ConfigurationPlatformModel");
|
|
6
|
+
const { Logger } = require("./../../common/Logger");
|
|
7
|
+
|
|
5
8
|
class Configuration {
|
|
6
9
|
constructor(config) {
|
|
7
10
|
this.config = config;
|
|
@@ -10,10 +13,11 @@ class Configuration {
|
|
|
10
13
|
/**
|
|
11
14
|
* @param {Object} arg - Arg object.
|
|
12
15
|
* @param {CreateApplicationRequest} arg.body
|
|
16
|
+
* @returns {Promise<CreateAppResponse>} - Success response
|
|
13
17
|
* @summary: Create application
|
|
14
18
|
* @description: Create new application
|
|
15
19
|
*/
|
|
16
|
-
createApplication({ body } = {}) {
|
|
20
|
+
async createApplication({ body } = {}) {
|
|
17
21
|
const { error } = ConfigurationValidator.createApplication().validate(
|
|
18
22
|
{
|
|
19
23
|
body,
|
|
@@ -24,11 +28,28 @@ class Configuration {
|
|
|
24
28
|
return Promise.reject(new FDKClientValidationError(error));
|
|
25
29
|
}
|
|
26
30
|
|
|
31
|
+
// Showing warrnings if extra unknown parameters are found
|
|
32
|
+
const {
|
|
33
|
+
error: warrning,
|
|
34
|
+
} = ConfigurationValidator.createApplication().validate(
|
|
35
|
+
{
|
|
36
|
+
body,
|
|
37
|
+
},
|
|
38
|
+
{ abortEarly: false, allowUnknown: false }
|
|
39
|
+
);
|
|
40
|
+
if (warrning) {
|
|
41
|
+
Logger({
|
|
42
|
+
level: "WARN",
|
|
43
|
+
message: "Parameter Validation warrnings for createApplication",
|
|
44
|
+
});
|
|
45
|
+
Logger({ level: "WARN", message: warrning });
|
|
46
|
+
}
|
|
47
|
+
|
|
27
48
|
const query_params = {};
|
|
28
49
|
|
|
29
50
|
const xHeaders = {};
|
|
30
51
|
|
|
31
|
-
|
|
52
|
+
const response = await PlatformAPIClient.execute(
|
|
32
53
|
this.config,
|
|
33
54
|
"post",
|
|
34
55
|
`/service/platform/configuration/v1.0/company/${this.config.companyId}/application`,
|
|
@@ -36,6 +57,23 @@ class Configuration {
|
|
|
36
57
|
body,
|
|
37
58
|
xHeaders
|
|
38
59
|
);
|
|
60
|
+
|
|
61
|
+
const {
|
|
62
|
+
error: res_error,
|
|
63
|
+
} = ConfigurationModel.CreateAppResponse().validate(response, {
|
|
64
|
+
abortEarly: false,
|
|
65
|
+
allowUnknown: false,
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
if (res_error) {
|
|
69
|
+
Logger({
|
|
70
|
+
level: "WARN",
|
|
71
|
+
message: "Response Validation Warnnings for createApplication",
|
|
72
|
+
});
|
|
73
|
+
Logger({ level: "WARN", message: res_error });
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
return response;
|
|
39
77
|
}
|
|
40
78
|
|
|
41
79
|
/**
|
|
@@ -43,10 +81,11 @@ class Configuration {
|
|
|
43
81
|
* @param {number} [arg.pageNo] -
|
|
44
82
|
* @param {number} [arg.pageSize] -
|
|
45
83
|
* @param {string} [arg.q] - Url encoded object used as mongodb query
|
|
84
|
+
* @returns {Promise<ApplicationsResponse>} - Success response
|
|
46
85
|
* @summary: Get list of application under company
|
|
47
86
|
* @description: Get list of application under company
|
|
48
87
|
*/
|
|
49
|
-
getApplications({ pageNo, pageSize, q } = {}) {
|
|
88
|
+
async getApplications({ pageNo, pageSize, q } = {}) {
|
|
50
89
|
const { error } = ConfigurationValidator.getApplications().validate(
|
|
51
90
|
{
|
|
52
91
|
pageNo,
|
|
@@ -59,6 +98,25 @@ class Configuration {
|
|
|
59
98
|
return Promise.reject(new FDKClientValidationError(error));
|
|
60
99
|
}
|
|
61
100
|
|
|
101
|
+
// Showing warrnings if extra unknown parameters are found
|
|
102
|
+
const {
|
|
103
|
+
error: warrning,
|
|
104
|
+
} = ConfigurationValidator.getApplications().validate(
|
|
105
|
+
{
|
|
106
|
+
pageNo,
|
|
107
|
+
pageSize,
|
|
108
|
+
q,
|
|
109
|
+
},
|
|
110
|
+
{ abortEarly: false, allowUnknown: false }
|
|
111
|
+
);
|
|
112
|
+
if (warrning) {
|
|
113
|
+
Logger({
|
|
114
|
+
level: "WARN",
|
|
115
|
+
message: "Parameter Validation warrnings for getApplications",
|
|
116
|
+
});
|
|
117
|
+
Logger({ level: "WARN", message: warrning });
|
|
118
|
+
}
|
|
119
|
+
|
|
62
120
|
const query_params = {};
|
|
63
121
|
query_params["page_no"] = pageNo;
|
|
64
122
|
query_params["page_size"] = pageSize;
|
|
@@ -66,7 +124,7 @@ class Configuration {
|
|
|
66
124
|
|
|
67
125
|
const xHeaders = {};
|
|
68
126
|
|
|
69
|
-
|
|
127
|
+
const response = await PlatformAPIClient.execute(
|
|
70
128
|
this.config,
|
|
71
129
|
"get",
|
|
72
130
|
`/service/platform/configuration/v1.0/company/${this.config.companyId}/application`,
|
|
@@ -74,6 +132,23 @@ class Configuration {
|
|
|
74
132
|
undefined,
|
|
75
133
|
xHeaders
|
|
76
134
|
);
|
|
135
|
+
|
|
136
|
+
const {
|
|
137
|
+
error: res_error,
|
|
138
|
+
} = ConfigurationModel.ApplicationsResponse().validate(response, {
|
|
139
|
+
abortEarly: false,
|
|
140
|
+
allowUnknown: false,
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
if (res_error) {
|
|
144
|
+
Logger({
|
|
145
|
+
level: "WARN",
|
|
146
|
+
message: "Response Validation Warnnings for getApplications",
|
|
147
|
+
});
|
|
148
|
+
Logger({ level: "WARN", message: res_error });
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
return response;
|
|
77
152
|
}
|
|
78
153
|
|
|
79
154
|
/**
|
|
@@ -106,10 +181,11 @@ class Configuration {
|
|
|
106
181
|
|
|
107
182
|
/**
|
|
108
183
|
* @param {Object} arg - Arg object.
|
|
184
|
+
* @returns {Promise<CurrenciesResponse>} - Success response
|
|
109
185
|
* @summary: Get all currencies
|
|
110
186
|
* @description: Get all currencies
|
|
111
187
|
*/
|
|
112
|
-
getCurrencies({} = {}) {
|
|
188
|
+
async getCurrencies({} = {}) {
|
|
113
189
|
const { error } = ConfigurationValidator.getCurrencies().validate(
|
|
114
190
|
{},
|
|
115
191
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -118,11 +194,24 @@ class Configuration {
|
|
|
118
194
|
return Promise.reject(new FDKClientValidationError(error));
|
|
119
195
|
}
|
|
120
196
|
|
|
197
|
+
// Showing warrnings if extra unknown parameters are found
|
|
198
|
+
const { error: warrning } = ConfigurationValidator.getCurrencies().validate(
|
|
199
|
+
{},
|
|
200
|
+
{ abortEarly: false, allowUnknown: false }
|
|
201
|
+
);
|
|
202
|
+
if (warrning) {
|
|
203
|
+
Logger({
|
|
204
|
+
level: "WARN",
|
|
205
|
+
message: "Parameter Validation warrnings for getCurrencies",
|
|
206
|
+
});
|
|
207
|
+
Logger({ level: "WARN", message: warrning });
|
|
208
|
+
}
|
|
209
|
+
|
|
121
210
|
const query_params = {};
|
|
122
211
|
|
|
123
212
|
const xHeaders = {};
|
|
124
213
|
|
|
125
|
-
|
|
214
|
+
const response = await PlatformAPIClient.execute(
|
|
126
215
|
this.config,
|
|
127
216
|
"get",
|
|
128
217
|
`/service/platform/configuration/v1.0/company/${this.config.companyId}/currencies`,
|
|
@@ -130,15 +219,33 @@ class Configuration {
|
|
|
130
219
|
undefined,
|
|
131
220
|
xHeaders
|
|
132
221
|
);
|
|
222
|
+
|
|
223
|
+
const {
|
|
224
|
+
error: res_error,
|
|
225
|
+
} = ConfigurationModel.CurrenciesResponse().validate(response, {
|
|
226
|
+
abortEarly: false,
|
|
227
|
+
allowUnknown: false,
|
|
228
|
+
});
|
|
229
|
+
|
|
230
|
+
if (res_error) {
|
|
231
|
+
Logger({
|
|
232
|
+
level: "WARN",
|
|
233
|
+
message: "Response Validation Warnnings for getCurrencies",
|
|
234
|
+
});
|
|
235
|
+
Logger({ level: "WARN", message: res_error });
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
return response;
|
|
133
239
|
}
|
|
134
240
|
|
|
135
241
|
/**
|
|
136
242
|
* @param {Object} arg - Arg object.
|
|
137
243
|
* @param {DomainSuggestionsRequest} arg.body
|
|
244
|
+
* @returns {Promise<DomainSuggestionsResponse>} - Success response
|
|
138
245
|
* @summary: Check domain availibility before linking to application
|
|
139
246
|
* @description: Check domain availibility before linking to application. Also sends domain suggestions with similar to queried domain. \ Custom domain search is currently powered by GoDaddy provider.
|
|
140
247
|
*/
|
|
141
|
-
getDomainAvailibility({ body } = {}) {
|
|
248
|
+
async getDomainAvailibility({ body } = {}) {
|
|
142
249
|
const { error } = ConfigurationValidator.getDomainAvailibility().validate(
|
|
143
250
|
{
|
|
144
251
|
body,
|
|
@@ -149,11 +256,28 @@ class Configuration {
|
|
|
149
256
|
return Promise.reject(new FDKClientValidationError(error));
|
|
150
257
|
}
|
|
151
258
|
|
|
259
|
+
// Showing warrnings if extra unknown parameters are found
|
|
260
|
+
const {
|
|
261
|
+
error: warrning,
|
|
262
|
+
} = ConfigurationValidator.getDomainAvailibility().validate(
|
|
263
|
+
{
|
|
264
|
+
body,
|
|
265
|
+
},
|
|
266
|
+
{ abortEarly: false, allowUnknown: false }
|
|
267
|
+
);
|
|
268
|
+
if (warrning) {
|
|
269
|
+
Logger({
|
|
270
|
+
level: "WARN",
|
|
271
|
+
message: "Parameter Validation warrnings for getDomainAvailibility",
|
|
272
|
+
});
|
|
273
|
+
Logger({ level: "WARN", message: warrning });
|
|
274
|
+
}
|
|
275
|
+
|
|
152
276
|
const query_params = {};
|
|
153
277
|
|
|
154
278
|
const xHeaders = {};
|
|
155
279
|
|
|
156
|
-
|
|
280
|
+
const response = await PlatformAPIClient.execute(
|
|
157
281
|
this.config,
|
|
158
282
|
"post",
|
|
159
283
|
`/service/platform/configuration/v1.0/company/${this.config.companyId}/domain/suggestions`,
|
|
@@ -161,15 +285,33 @@ class Configuration {
|
|
|
161
285
|
body,
|
|
162
286
|
xHeaders
|
|
163
287
|
);
|
|
288
|
+
|
|
289
|
+
const {
|
|
290
|
+
error: res_error,
|
|
291
|
+
} = ConfigurationModel.DomainSuggestionsResponse().validate(response, {
|
|
292
|
+
abortEarly: false,
|
|
293
|
+
allowUnknown: false,
|
|
294
|
+
});
|
|
295
|
+
|
|
296
|
+
if (res_error) {
|
|
297
|
+
Logger({
|
|
298
|
+
level: "WARN",
|
|
299
|
+
message: "Response Validation Warnnings for getDomainAvailibility",
|
|
300
|
+
});
|
|
301
|
+
Logger({ level: "WARN", message: res_error });
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
return response;
|
|
164
305
|
}
|
|
165
306
|
|
|
166
307
|
/**
|
|
167
308
|
* @param {Object} arg - Arg object.
|
|
168
309
|
* @param {number} arg.id - Integration id
|
|
310
|
+
* @returns {Promise<Integration>} - Success response
|
|
169
311
|
* @summary: Get integration data
|
|
170
312
|
* @description: Get integration data
|
|
171
313
|
*/
|
|
172
|
-
getIntegrationById({ id } = {}) {
|
|
314
|
+
async getIntegrationById({ id } = {}) {
|
|
173
315
|
const { error } = ConfigurationValidator.getIntegrationById().validate(
|
|
174
316
|
{
|
|
175
317
|
id,
|
|
@@ -180,11 +322,28 @@ class Configuration {
|
|
|
180
322
|
return Promise.reject(new FDKClientValidationError(error));
|
|
181
323
|
}
|
|
182
324
|
|
|
325
|
+
// Showing warrnings if extra unknown parameters are found
|
|
326
|
+
const {
|
|
327
|
+
error: warrning,
|
|
328
|
+
} = ConfigurationValidator.getIntegrationById().validate(
|
|
329
|
+
{
|
|
330
|
+
id,
|
|
331
|
+
},
|
|
332
|
+
{ abortEarly: false, allowUnknown: false }
|
|
333
|
+
);
|
|
334
|
+
if (warrning) {
|
|
335
|
+
Logger({
|
|
336
|
+
level: "WARN",
|
|
337
|
+
message: "Parameter Validation warrnings for getIntegrationById",
|
|
338
|
+
});
|
|
339
|
+
Logger({ level: "WARN", message: warrning });
|
|
340
|
+
}
|
|
341
|
+
|
|
183
342
|
const query_params = {};
|
|
184
343
|
|
|
185
344
|
const xHeaders = {};
|
|
186
345
|
|
|
187
|
-
|
|
346
|
+
const response = await PlatformAPIClient.execute(
|
|
188
347
|
this.config,
|
|
189
348
|
"get",
|
|
190
349
|
`/service/platform/configuration/v1.0/company/${this.config.companyId}/integration/${id}`,
|
|
@@ -192,16 +351,34 @@ class Configuration {
|
|
|
192
351
|
undefined,
|
|
193
352
|
xHeaders
|
|
194
353
|
);
|
|
354
|
+
|
|
355
|
+
const {
|
|
356
|
+
error: res_error,
|
|
357
|
+
} = ConfigurationModel.Integration().validate(response, {
|
|
358
|
+
abortEarly: false,
|
|
359
|
+
allowUnknown: false,
|
|
360
|
+
});
|
|
361
|
+
|
|
362
|
+
if (res_error) {
|
|
363
|
+
Logger({
|
|
364
|
+
level: "WARN",
|
|
365
|
+
message: "Response Validation Warnnings for getIntegrationById",
|
|
366
|
+
});
|
|
367
|
+
Logger({ level: "WARN", message: res_error });
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
return response;
|
|
195
371
|
}
|
|
196
372
|
|
|
197
373
|
/**
|
|
198
374
|
* @param {Object} arg - Arg object.
|
|
199
375
|
* @param {number} [arg.pageNo] - Current page no
|
|
200
376
|
* @param {number} [arg.pageSize] - Current request items count
|
|
377
|
+
* @returns {Promise<GetIntegrationsOptInsResponse>} - Success response
|
|
201
378
|
* @summary: Get all available integration opt-ins
|
|
202
379
|
* @description: Get all available integration opt-ins
|
|
203
380
|
*/
|
|
204
|
-
getAvailableOptIns({ pageNo, pageSize } = {}) {
|
|
381
|
+
async getAvailableOptIns({ pageNo, pageSize } = {}) {
|
|
205
382
|
const { error } = ConfigurationValidator.getAvailableOptIns().validate(
|
|
206
383
|
{
|
|
207
384
|
pageNo,
|
|
@@ -213,13 +390,31 @@ class Configuration {
|
|
|
213
390
|
return Promise.reject(new FDKClientValidationError(error));
|
|
214
391
|
}
|
|
215
392
|
|
|
393
|
+
// Showing warrnings if extra unknown parameters are found
|
|
394
|
+
const {
|
|
395
|
+
error: warrning,
|
|
396
|
+
} = ConfigurationValidator.getAvailableOptIns().validate(
|
|
397
|
+
{
|
|
398
|
+
pageNo,
|
|
399
|
+
pageSize,
|
|
400
|
+
},
|
|
401
|
+
{ abortEarly: false, allowUnknown: false }
|
|
402
|
+
);
|
|
403
|
+
if (warrning) {
|
|
404
|
+
Logger({
|
|
405
|
+
level: "WARN",
|
|
406
|
+
message: "Parameter Validation warrnings for getAvailableOptIns",
|
|
407
|
+
});
|
|
408
|
+
Logger({ level: "WARN", message: warrning });
|
|
409
|
+
}
|
|
410
|
+
|
|
216
411
|
const query_params = {};
|
|
217
412
|
query_params["page_no"] = pageNo;
|
|
218
413
|
query_params["page_size"] = pageSize;
|
|
219
414
|
|
|
220
415
|
const xHeaders = {};
|
|
221
416
|
|
|
222
|
-
|
|
417
|
+
const response = await PlatformAPIClient.execute(
|
|
223
418
|
this.config,
|
|
224
419
|
"get",
|
|
225
420
|
`/service/platform/configuration/v1.0/company/${this.config.companyId}/integration-opt-in/available`,
|
|
@@ -227,6 +422,23 @@ class Configuration {
|
|
|
227
422
|
undefined,
|
|
228
423
|
xHeaders
|
|
229
424
|
);
|
|
425
|
+
|
|
426
|
+
const {
|
|
427
|
+
error: res_error,
|
|
428
|
+
} = ConfigurationModel.GetIntegrationsOptInsResponse().validate(response, {
|
|
429
|
+
abortEarly: false,
|
|
430
|
+
allowUnknown: false,
|
|
431
|
+
});
|
|
432
|
+
|
|
433
|
+
if (res_error) {
|
|
434
|
+
Logger({
|
|
435
|
+
level: "WARN",
|
|
436
|
+
message: "Response Validation Warnnings for getAvailableOptIns",
|
|
437
|
+
});
|
|
438
|
+
Logger({ level: "WARN", message: res_error });
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
return response;
|
|
230
442
|
}
|
|
231
443
|
|
|
232
444
|
/**
|
|
@@ -261,10 +473,11 @@ class Configuration {
|
|
|
261
473
|
* @param {number} arg.uid - Integration level uid
|
|
262
474
|
* @param {number} [arg.pageNo] - Current page no
|
|
263
475
|
* @param {number} [arg.pageSize] - Current request items count
|
|
476
|
+
* @returns {Promise<GetIntegrationsOptInsResponse>} - Success response
|
|
264
477
|
* @summary: Get company/store level integration opt-ins
|
|
265
478
|
* @description: Get company/store level integration opt-ins
|
|
266
479
|
*/
|
|
267
|
-
getSelectedOptIns({ level, uid, pageNo, pageSize } = {}) {
|
|
480
|
+
async getSelectedOptIns({ level, uid, pageNo, pageSize } = {}) {
|
|
268
481
|
const { error } = ConfigurationValidator.getSelectedOptIns().validate(
|
|
269
482
|
{
|
|
270
483
|
level,
|
|
@@ -278,13 +491,33 @@ class Configuration {
|
|
|
278
491
|
return Promise.reject(new FDKClientValidationError(error));
|
|
279
492
|
}
|
|
280
493
|
|
|
494
|
+
// Showing warrnings if extra unknown parameters are found
|
|
495
|
+
const {
|
|
496
|
+
error: warrning,
|
|
497
|
+
} = ConfigurationValidator.getSelectedOptIns().validate(
|
|
498
|
+
{
|
|
499
|
+
level,
|
|
500
|
+
uid,
|
|
501
|
+
pageNo,
|
|
502
|
+
pageSize,
|
|
503
|
+
},
|
|
504
|
+
{ abortEarly: false, allowUnknown: false }
|
|
505
|
+
);
|
|
506
|
+
if (warrning) {
|
|
507
|
+
Logger({
|
|
508
|
+
level: "WARN",
|
|
509
|
+
message: "Parameter Validation warrnings for getSelectedOptIns",
|
|
510
|
+
});
|
|
511
|
+
Logger({ level: "WARN", message: warrning });
|
|
512
|
+
}
|
|
513
|
+
|
|
281
514
|
const query_params = {};
|
|
282
515
|
query_params["page_no"] = pageNo;
|
|
283
516
|
query_params["page_size"] = pageSize;
|
|
284
517
|
|
|
285
518
|
const xHeaders = {};
|
|
286
519
|
|
|
287
|
-
|
|
520
|
+
const response = await PlatformAPIClient.execute(
|
|
288
521
|
this.config,
|
|
289
522
|
"get",
|
|
290
523
|
`/service/platform/configuration/v1.0/company/${this.config.companyId}/integration-opt-in/selected/${level}/${uid}`,
|
|
@@ -292,6 +525,23 @@ class Configuration {
|
|
|
292
525
|
undefined,
|
|
293
526
|
xHeaders
|
|
294
527
|
);
|
|
528
|
+
|
|
529
|
+
const {
|
|
530
|
+
error: res_error,
|
|
531
|
+
} = ConfigurationModel.GetIntegrationsOptInsResponse().validate(response, {
|
|
532
|
+
abortEarly: false,
|
|
533
|
+
allowUnknown: false,
|
|
534
|
+
});
|
|
535
|
+
|
|
536
|
+
if (res_error) {
|
|
537
|
+
Logger({
|
|
538
|
+
level: "WARN",
|
|
539
|
+
message: "Response Validation Warnnings for getSelectedOptIns",
|
|
540
|
+
});
|
|
541
|
+
Logger({ level: "WARN", message: res_error });
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
return response;
|
|
295
545
|
}
|
|
296
546
|
|
|
297
547
|
/**
|
|
@@ -330,10 +580,11 @@ class Configuration {
|
|
|
330
580
|
* @param {string} arg.level - Integration level
|
|
331
581
|
* @param {boolean} [arg.opted] - Filter on opted stores
|
|
332
582
|
* @param {boolean} [arg.checkPermission] - Filter on if permissions are present
|
|
583
|
+
* @returns {Promise<IntegrationConfigResponse>} - Success response
|
|
333
584
|
* @summary: Get integration level config
|
|
334
585
|
* @description: Get integration/integration-opt-in level config
|
|
335
586
|
*/
|
|
336
|
-
getIntegrationLevelConfig({ id, level, opted, checkPermission } = {}) {
|
|
587
|
+
async getIntegrationLevelConfig({ id, level, opted, checkPermission } = {}) {
|
|
337
588
|
const {
|
|
338
589
|
error,
|
|
339
590
|
} = ConfigurationValidator.getIntegrationLevelConfig().validate(
|
|
@@ -349,13 +600,33 @@ class Configuration {
|
|
|
349
600
|
return Promise.reject(new FDKClientValidationError(error));
|
|
350
601
|
}
|
|
351
602
|
|
|
603
|
+
// Showing warrnings if extra unknown parameters are found
|
|
604
|
+
const {
|
|
605
|
+
error: warrning,
|
|
606
|
+
} = ConfigurationValidator.getIntegrationLevelConfig().validate(
|
|
607
|
+
{
|
|
608
|
+
id,
|
|
609
|
+
level,
|
|
610
|
+
opted,
|
|
611
|
+
checkPermission,
|
|
612
|
+
},
|
|
613
|
+
{ abortEarly: false, allowUnknown: false }
|
|
614
|
+
);
|
|
615
|
+
if (warrning) {
|
|
616
|
+
Logger({
|
|
617
|
+
level: "WARN",
|
|
618
|
+
message: "Parameter Validation warrnings for getIntegrationLevelConfig",
|
|
619
|
+
});
|
|
620
|
+
Logger({ level: "WARN", message: warrning });
|
|
621
|
+
}
|
|
622
|
+
|
|
352
623
|
const query_params = {};
|
|
353
624
|
query_params["opted"] = opted;
|
|
354
625
|
query_params["check_permission"] = checkPermission;
|
|
355
626
|
|
|
356
627
|
const xHeaders = {};
|
|
357
628
|
|
|
358
|
-
|
|
629
|
+
const response = await PlatformAPIClient.execute(
|
|
359
630
|
this.config,
|
|
360
631
|
"get",
|
|
361
632
|
`/service/platform/configuration/v1.0/company/${this.config.companyId}/integration-opt-in/configuration/${id}/${level}`,
|
|
@@ -363,6 +634,23 @@ class Configuration {
|
|
|
363
634
|
undefined,
|
|
364
635
|
xHeaders
|
|
365
636
|
);
|
|
637
|
+
|
|
638
|
+
const {
|
|
639
|
+
error: res_error,
|
|
640
|
+
} = ConfigurationModel.IntegrationConfigResponse().validate(response, {
|
|
641
|
+
abortEarly: false,
|
|
642
|
+
allowUnknown: false,
|
|
643
|
+
});
|
|
644
|
+
|
|
645
|
+
if (res_error) {
|
|
646
|
+
Logger({
|
|
647
|
+
level: "WARN",
|
|
648
|
+
message: "Response Validation Warnnings for getIntegrationLevelConfig",
|
|
649
|
+
});
|
|
650
|
+
Logger({ level: "WARN", message: res_error });
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
return response;
|
|
366
654
|
}
|
|
367
655
|
|
|
368
656
|
/**
|
|
@@ -370,10 +658,11 @@ class Configuration {
|
|
|
370
658
|
* @param {string} arg.id - Integration id
|
|
371
659
|
* @param {string} arg.level - Integration level
|
|
372
660
|
* @param {UpdateIntegrationLevelRequest} arg.body
|
|
661
|
+
* @returns {Promise<IntegrationLevel>} - Success response
|
|
373
662
|
* @summary: Update a store level opt-in for integration
|
|
374
663
|
* @description: Update a store level opt-in for integration
|
|
375
664
|
*/
|
|
376
|
-
updateLevelIntegration({ id, level, body } = {}) {
|
|
665
|
+
async updateLevelIntegration({ id, level, body } = {}) {
|
|
377
666
|
const { error } = ConfigurationValidator.updateLevelIntegration().validate(
|
|
378
667
|
{
|
|
379
668
|
id,
|
|
@@ -386,11 +675,30 @@ class Configuration {
|
|
|
386
675
|
return Promise.reject(new FDKClientValidationError(error));
|
|
387
676
|
}
|
|
388
677
|
|
|
678
|
+
// Showing warrnings if extra unknown parameters are found
|
|
679
|
+
const {
|
|
680
|
+
error: warrning,
|
|
681
|
+
} = ConfigurationValidator.updateLevelIntegration().validate(
|
|
682
|
+
{
|
|
683
|
+
id,
|
|
684
|
+
level,
|
|
685
|
+
body,
|
|
686
|
+
},
|
|
687
|
+
{ abortEarly: false, allowUnknown: false }
|
|
688
|
+
);
|
|
689
|
+
if (warrning) {
|
|
690
|
+
Logger({
|
|
691
|
+
level: "WARN",
|
|
692
|
+
message: "Parameter Validation warrnings for updateLevelIntegration",
|
|
693
|
+
});
|
|
694
|
+
Logger({ level: "WARN", message: warrning });
|
|
695
|
+
}
|
|
696
|
+
|
|
389
697
|
const query_params = {};
|
|
390
698
|
|
|
391
699
|
const xHeaders = {};
|
|
392
700
|
|
|
393
|
-
|
|
701
|
+
const response = await PlatformAPIClient.execute(
|
|
394
702
|
this.config,
|
|
395
703
|
"put",
|
|
396
704
|
`/service/platform/configuration/v1.0/company/${this.config.companyId}/integration-opt-in/configuration/${id}/${level}`,
|
|
@@ -398,6 +706,23 @@ class Configuration {
|
|
|
398
706
|
body,
|
|
399
707
|
xHeaders
|
|
400
708
|
);
|
|
709
|
+
|
|
710
|
+
const {
|
|
711
|
+
error: res_error,
|
|
712
|
+
} = ConfigurationModel.IntegrationLevel().validate(response, {
|
|
713
|
+
abortEarly: false,
|
|
714
|
+
allowUnknown: false,
|
|
715
|
+
});
|
|
716
|
+
|
|
717
|
+
if (res_error) {
|
|
718
|
+
Logger({
|
|
719
|
+
level: "WARN",
|
|
720
|
+
message: "Response Validation Warnnings for updateLevelIntegration",
|
|
721
|
+
});
|
|
722
|
+
Logger({ level: "WARN", message: res_error });
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
return response;
|
|
401
726
|
}
|
|
402
727
|
|
|
403
728
|
/**
|
|
@@ -405,10 +730,11 @@ class Configuration {
|
|
|
405
730
|
* @param {string} arg.id - Integration id
|
|
406
731
|
* @param {string} arg.level - Integration level
|
|
407
732
|
* @param {number} arg.uid - Integration level uid
|
|
733
|
+
* @returns {Promise<IntegrationLevel>} - Success response
|
|
408
734
|
* @summary: Get level data for integration
|
|
409
735
|
* @description: Get level data for integration
|
|
410
736
|
*/
|
|
411
|
-
getIntegrationByLevelId({ id, level, uid } = {}) {
|
|
737
|
+
async getIntegrationByLevelId({ id, level, uid } = {}) {
|
|
412
738
|
const { error } = ConfigurationValidator.getIntegrationByLevelId().validate(
|
|
413
739
|
{
|
|
414
740
|
id,
|
|
@@ -421,11 +747,30 @@ class Configuration {
|
|
|
421
747
|
return Promise.reject(new FDKClientValidationError(error));
|
|
422
748
|
}
|
|
423
749
|
|
|
750
|
+
// Showing warrnings if extra unknown parameters are found
|
|
751
|
+
const {
|
|
752
|
+
error: warrning,
|
|
753
|
+
} = ConfigurationValidator.getIntegrationByLevelId().validate(
|
|
754
|
+
{
|
|
755
|
+
id,
|
|
756
|
+
level,
|
|
757
|
+
uid,
|
|
758
|
+
},
|
|
759
|
+
{ abortEarly: false, allowUnknown: false }
|
|
760
|
+
);
|
|
761
|
+
if (warrning) {
|
|
762
|
+
Logger({
|
|
763
|
+
level: "WARN",
|
|
764
|
+
message: "Parameter Validation warrnings for getIntegrationByLevelId",
|
|
765
|
+
});
|
|
766
|
+
Logger({ level: "WARN", message: warrning });
|
|
767
|
+
}
|
|
768
|
+
|
|
424
769
|
const query_params = {};
|
|
425
770
|
|
|
426
771
|
const xHeaders = {};
|
|
427
772
|
|
|
428
|
-
|
|
773
|
+
const response = await PlatformAPIClient.execute(
|
|
429
774
|
this.config,
|
|
430
775
|
"get",
|
|
431
776
|
`/service/platform/configuration/v1.0/company/${this.config.companyId}/integration-opt-in/configuration/${id}/${level}/${uid}`,
|
|
@@ -433,6 +778,23 @@ class Configuration {
|
|
|
433
778
|
undefined,
|
|
434
779
|
xHeaders
|
|
435
780
|
);
|
|
781
|
+
|
|
782
|
+
const {
|
|
783
|
+
error: res_error,
|
|
784
|
+
} = ConfigurationModel.IntegrationLevel().validate(response, {
|
|
785
|
+
abortEarly: false,
|
|
786
|
+
allowUnknown: false,
|
|
787
|
+
});
|
|
788
|
+
|
|
789
|
+
if (res_error) {
|
|
790
|
+
Logger({
|
|
791
|
+
level: "WARN",
|
|
792
|
+
message: "Response Validation Warnnings for getIntegrationByLevelId",
|
|
793
|
+
});
|
|
794
|
+
Logger({ level: "WARN", message: res_error });
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
return response;
|
|
436
798
|
}
|
|
437
799
|
|
|
438
800
|
/**
|
|
@@ -441,10 +803,11 @@ class Configuration {
|
|
|
441
803
|
* @param {string} arg.level - Integration level
|
|
442
804
|
* @param {number} arg.uid - Integration level uid
|
|
443
805
|
* @param {IntegrationLevel} arg.body
|
|
806
|
+
* @returns {Promise<IntegrationLevel>} - Success response
|
|
444
807
|
* @summary: Update a store level opt-in for integration
|
|
445
808
|
* @description: Update a store level opt-in for integration
|
|
446
809
|
*/
|
|
447
|
-
updateLevelUidIntegration({ id, level, uid, body } = {}) {
|
|
810
|
+
async updateLevelUidIntegration({ id, level, uid, body } = {}) {
|
|
448
811
|
const {
|
|
449
812
|
error,
|
|
450
813
|
} = ConfigurationValidator.updateLevelUidIntegration().validate(
|
|
@@ -460,11 +823,31 @@ class Configuration {
|
|
|
460
823
|
return Promise.reject(new FDKClientValidationError(error));
|
|
461
824
|
}
|
|
462
825
|
|
|
826
|
+
// Showing warrnings if extra unknown parameters are found
|
|
827
|
+
const {
|
|
828
|
+
error: warrning,
|
|
829
|
+
} = ConfigurationValidator.updateLevelUidIntegration().validate(
|
|
830
|
+
{
|
|
831
|
+
id,
|
|
832
|
+
level,
|
|
833
|
+
uid,
|
|
834
|
+
body,
|
|
835
|
+
},
|
|
836
|
+
{ abortEarly: false, allowUnknown: false }
|
|
837
|
+
);
|
|
838
|
+
if (warrning) {
|
|
839
|
+
Logger({
|
|
840
|
+
level: "WARN",
|
|
841
|
+
message: "Parameter Validation warrnings for updateLevelUidIntegration",
|
|
842
|
+
});
|
|
843
|
+
Logger({ level: "WARN", message: warrning });
|
|
844
|
+
}
|
|
845
|
+
|
|
463
846
|
const query_params = {};
|
|
464
847
|
|
|
465
848
|
const xHeaders = {};
|
|
466
849
|
|
|
467
|
-
|
|
850
|
+
const response = await PlatformAPIClient.execute(
|
|
468
851
|
this.config,
|
|
469
852
|
"put",
|
|
470
853
|
`/service/platform/configuration/v1.0/company/${this.config.companyId}/integration-opt-in/configuration/${id}/${level}/${uid}`,
|
|
@@ -472,6 +855,23 @@ class Configuration {
|
|
|
472
855
|
body,
|
|
473
856
|
xHeaders
|
|
474
857
|
);
|
|
858
|
+
|
|
859
|
+
const {
|
|
860
|
+
error: res_error,
|
|
861
|
+
} = ConfigurationModel.IntegrationLevel().validate(response, {
|
|
862
|
+
abortEarly: false,
|
|
863
|
+
allowUnknown: false,
|
|
864
|
+
});
|
|
865
|
+
|
|
866
|
+
if (res_error) {
|
|
867
|
+
Logger({
|
|
868
|
+
level: "WARN",
|
|
869
|
+
message: "Response Validation Warnnings for updateLevelUidIntegration",
|
|
870
|
+
});
|
|
871
|
+
Logger({ level: "WARN", message: res_error });
|
|
872
|
+
}
|
|
873
|
+
|
|
874
|
+
return response;
|
|
475
875
|
}
|
|
476
876
|
|
|
477
877
|
/**
|
|
@@ -479,10 +879,11 @@ class Configuration {
|
|
|
479
879
|
* @param {string} arg.id - Integration id
|
|
480
880
|
* @param {string} arg.level - Integration level
|
|
481
881
|
* @param {number} arg.uid - Integration level uid
|
|
882
|
+
* @returns {Promise<OptedStoreIntegration>} - Success response
|
|
482
883
|
* @summary: Check store has active integration
|
|
483
884
|
* @description: API checks if a store is already opted in any other integrations
|
|
484
885
|
*/
|
|
485
|
-
getLevelActiveIntegrations({ id, level, uid } = {}) {
|
|
886
|
+
async getLevelActiveIntegrations({ id, level, uid } = {}) {
|
|
486
887
|
const {
|
|
487
888
|
error,
|
|
488
889
|
} = ConfigurationValidator.getLevelActiveIntegrations().validate(
|
|
@@ -497,11 +898,31 @@ class Configuration {
|
|
|
497
898
|
return Promise.reject(new FDKClientValidationError(error));
|
|
498
899
|
}
|
|
499
900
|
|
|
901
|
+
// Showing warrnings if extra unknown parameters are found
|
|
902
|
+
const {
|
|
903
|
+
error: warrning,
|
|
904
|
+
} = ConfigurationValidator.getLevelActiveIntegrations().validate(
|
|
905
|
+
{
|
|
906
|
+
id,
|
|
907
|
+
level,
|
|
908
|
+
uid,
|
|
909
|
+
},
|
|
910
|
+
{ abortEarly: false, allowUnknown: false }
|
|
911
|
+
);
|
|
912
|
+
if (warrning) {
|
|
913
|
+
Logger({
|
|
914
|
+
level: "WARN",
|
|
915
|
+
message:
|
|
916
|
+
"Parameter Validation warrnings for getLevelActiveIntegrations",
|
|
917
|
+
});
|
|
918
|
+
Logger({ level: "WARN", message: warrning });
|
|
919
|
+
}
|
|
920
|
+
|
|
500
921
|
const query_params = {};
|
|
501
922
|
|
|
502
923
|
const xHeaders = {};
|
|
503
924
|
|
|
504
|
-
|
|
925
|
+
const response = await PlatformAPIClient.execute(
|
|
505
926
|
this.config,
|
|
506
927
|
"get",
|
|
507
928
|
`/service/platform/configuration/v1.0/company/${this.config.companyId}/integration-opt-in/check/configuration/${id}/${level}/${uid}`,
|
|
@@ -509,15 +930,33 @@ class Configuration {
|
|
|
509
930
|
undefined,
|
|
510
931
|
xHeaders
|
|
511
932
|
);
|
|
933
|
+
|
|
934
|
+
const {
|
|
935
|
+
error: res_error,
|
|
936
|
+
} = ConfigurationModel.OptedStoreIntegration().validate(response, {
|
|
937
|
+
abortEarly: false,
|
|
938
|
+
allowUnknown: false,
|
|
939
|
+
});
|
|
940
|
+
|
|
941
|
+
if (res_error) {
|
|
942
|
+
Logger({
|
|
943
|
+
level: "WARN",
|
|
944
|
+
message: "Response Validation Warnnings for getLevelActiveIntegrations",
|
|
945
|
+
});
|
|
946
|
+
Logger({ level: "WARN", message: res_error });
|
|
947
|
+
}
|
|
948
|
+
|
|
949
|
+
return response;
|
|
512
950
|
}
|
|
513
951
|
|
|
514
952
|
/**
|
|
515
953
|
* @param {Object} arg - Arg object.
|
|
516
954
|
* @param {string} [arg.q] - Search text for brand name
|
|
955
|
+
* @returns {Promise<BrandsByCompanyResponse>} - Success response
|
|
517
956
|
* @summary: Get brands by company
|
|
518
957
|
* @description: Get brands by company
|
|
519
958
|
*/
|
|
520
|
-
getBrandsByCompany({ q } = {}) {
|
|
959
|
+
async getBrandsByCompany({ q } = {}) {
|
|
521
960
|
const { error } = ConfigurationValidator.getBrandsByCompany().validate(
|
|
522
961
|
{
|
|
523
962
|
q,
|
|
@@ -528,12 +967,29 @@ class Configuration {
|
|
|
528
967
|
return Promise.reject(new FDKClientValidationError(error));
|
|
529
968
|
}
|
|
530
969
|
|
|
970
|
+
// Showing warrnings if extra unknown parameters are found
|
|
971
|
+
const {
|
|
972
|
+
error: warrning,
|
|
973
|
+
} = ConfigurationValidator.getBrandsByCompany().validate(
|
|
974
|
+
{
|
|
975
|
+
q,
|
|
976
|
+
},
|
|
977
|
+
{ abortEarly: false, allowUnknown: false }
|
|
978
|
+
);
|
|
979
|
+
if (warrning) {
|
|
980
|
+
Logger({
|
|
981
|
+
level: "WARN",
|
|
982
|
+
message: "Parameter Validation warrnings for getBrandsByCompany",
|
|
983
|
+
});
|
|
984
|
+
Logger({ level: "WARN", message: warrning });
|
|
985
|
+
}
|
|
986
|
+
|
|
531
987
|
const query_params = {};
|
|
532
988
|
query_params["q"] = q;
|
|
533
989
|
|
|
534
990
|
const xHeaders = {};
|
|
535
991
|
|
|
536
|
-
|
|
992
|
+
const response = await PlatformAPIClient.execute(
|
|
537
993
|
this.config,
|
|
538
994
|
"get",
|
|
539
995
|
`/service/platform/configuration/v1.0/company/${this.config.companyId}/inventory/brands-by-companies`,
|
|
@@ -541,6 +997,23 @@ class Configuration {
|
|
|
541
997
|
undefined,
|
|
542
998
|
xHeaders
|
|
543
999
|
);
|
|
1000
|
+
|
|
1001
|
+
const {
|
|
1002
|
+
error: res_error,
|
|
1003
|
+
} = ConfigurationModel.BrandsByCompanyResponse().validate(response, {
|
|
1004
|
+
abortEarly: false,
|
|
1005
|
+
allowUnknown: false,
|
|
1006
|
+
});
|
|
1007
|
+
|
|
1008
|
+
if (res_error) {
|
|
1009
|
+
Logger({
|
|
1010
|
+
level: "WARN",
|
|
1011
|
+
message: "Response Validation Warnnings for getBrandsByCompany",
|
|
1012
|
+
});
|
|
1013
|
+
Logger({ level: "WARN", message: res_error });
|
|
1014
|
+
}
|
|
1015
|
+
|
|
1016
|
+
return response;
|
|
544
1017
|
}
|
|
545
1018
|
|
|
546
1019
|
/**
|
|
@@ -548,10 +1021,11 @@ class Configuration {
|
|
|
548
1021
|
* @param {number} [arg.pageNo] - Current page no
|
|
549
1022
|
* @param {number} [arg.pageSize] - Current request items count
|
|
550
1023
|
* @param {CompanyByBrandsRequest} arg.body
|
|
1024
|
+
* @returns {Promise<CompanyByBrandsResponse>} - Success response
|
|
551
1025
|
* @summary: Get company by brand uids
|
|
552
1026
|
* @description: Get company by brand uids
|
|
553
1027
|
*/
|
|
554
|
-
getCompanyByBrands({ body, pageNo, pageSize } = {}) {
|
|
1028
|
+
async getCompanyByBrands({ body, pageNo, pageSize } = {}) {
|
|
555
1029
|
const { error } = ConfigurationValidator.getCompanyByBrands().validate(
|
|
556
1030
|
{
|
|
557
1031
|
body,
|
|
@@ -564,13 +1038,32 @@ class Configuration {
|
|
|
564
1038
|
return Promise.reject(new FDKClientValidationError(error));
|
|
565
1039
|
}
|
|
566
1040
|
|
|
1041
|
+
// Showing warrnings if extra unknown parameters are found
|
|
1042
|
+
const {
|
|
1043
|
+
error: warrning,
|
|
1044
|
+
} = ConfigurationValidator.getCompanyByBrands().validate(
|
|
1045
|
+
{
|
|
1046
|
+
body,
|
|
1047
|
+
pageNo,
|
|
1048
|
+
pageSize,
|
|
1049
|
+
},
|
|
1050
|
+
{ abortEarly: false, allowUnknown: false }
|
|
1051
|
+
);
|
|
1052
|
+
if (warrning) {
|
|
1053
|
+
Logger({
|
|
1054
|
+
level: "WARN",
|
|
1055
|
+
message: "Parameter Validation warrnings for getCompanyByBrands",
|
|
1056
|
+
});
|
|
1057
|
+
Logger({ level: "WARN", message: warrning });
|
|
1058
|
+
}
|
|
1059
|
+
|
|
567
1060
|
const query_params = {};
|
|
568
1061
|
query_params["page_no"] = pageNo;
|
|
569
1062
|
query_params["page_size"] = pageSize;
|
|
570
1063
|
|
|
571
1064
|
const xHeaders = {};
|
|
572
1065
|
|
|
573
|
-
|
|
1066
|
+
const response = await PlatformAPIClient.execute(
|
|
574
1067
|
this.config,
|
|
575
1068
|
"post",
|
|
576
1069
|
`/service/platform/configuration/v1.0/company/${this.config.companyId}/inventory/companies-by-brands`,
|
|
@@ -578,6 +1071,23 @@ class Configuration {
|
|
|
578
1071
|
body,
|
|
579
1072
|
xHeaders
|
|
580
1073
|
);
|
|
1074
|
+
|
|
1075
|
+
const {
|
|
1076
|
+
error: res_error,
|
|
1077
|
+
} = ConfigurationModel.CompanyByBrandsResponse().validate(response, {
|
|
1078
|
+
abortEarly: false,
|
|
1079
|
+
allowUnknown: false,
|
|
1080
|
+
});
|
|
1081
|
+
|
|
1082
|
+
if (res_error) {
|
|
1083
|
+
Logger({
|
|
1084
|
+
level: "WARN",
|
|
1085
|
+
message: "Response Validation Warnnings for getCompanyByBrands",
|
|
1086
|
+
});
|
|
1087
|
+
Logger({ level: "WARN", message: res_error });
|
|
1088
|
+
}
|
|
1089
|
+
|
|
1090
|
+
return response;
|
|
581
1091
|
}
|
|
582
1092
|
|
|
583
1093
|
/**
|
|
@@ -613,10 +1123,11 @@ class Configuration {
|
|
|
613
1123
|
* @param {number} [arg.pageNo] - Current page no
|
|
614
1124
|
* @param {number} [arg.pageSize] - Current request items count
|
|
615
1125
|
* @param {StoreByBrandsRequest} arg.body
|
|
1126
|
+
* @returns {Promise<StoreByBrandsResponse>} - Success response
|
|
616
1127
|
* @summary: Get stores by brand uids
|
|
617
1128
|
* @description: Get stores by brand uids
|
|
618
1129
|
*/
|
|
619
|
-
getStoreByBrands({ body, pageNo, pageSize } = {}) {
|
|
1130
|
+
async getStoreByBrands({ body, pageNo, pageSize } = {}) {
|
|
620
1131
|
const { error } = ConfigurationValidator.getStoreByBrands().validate(
|
|
621
1132
|
{
|
|
622
1133
|
body,
|
|
@@ -629,13 +1140,32 @@ class Configuration {
|
|
|
629
1140
|
return Promise.reject(new FDKClientValidationError(error));
|
|
630
1141
|
}
|
|
631
1142
|
|
|
1143
|
+
// Showing warrnings if extra unknown parameters are found
|
|
1144
|
+
const {
|
|
1145
|
+
error: warrning,
|
|
1146
|
+
} = ConfigurationValidator.getStoreByBrands().validate(
|
|
1147
|
+
{
|
|
1148
|
+
body,
|
|
1149
|
+
pageNo,
|
|
1150
|
+
pageSize,
|
|
1151
|
+
},
|
|
1152
|
+
{ abortEarly: false, allowUnknown: false }
|
|
1153
|
+
);
|
|
1154
|
+
if (warrning) {
|
|
1155
|
+
Logger({
|
|
1156
|
+
level: "WARN",
|
|
1157
|
+
message: "Parameter Validation warrnings for getStoreByBrands",
|
|
1158
|
+
});
|
|
1159
|
+
Logger({ level: "WARN", message: warrning });
|
|
1160
|
+
}
|
|
1161
|
+
|
|
632
1162
|
const query_params = {};
|
|
633
1163
|
query_params["page_no"] = pageNo;
|
|
634
1164
|
query_params["page_size"] = pageSize;
|
|
635
1165
|
|
|
636
1166
|
const xHeaders = {};
|
|
637
1167
|
|
|
638
|
-
|
|
1168
|
+
const response = await PlatformAPIClient.execute(
|
|
639
1169
|
this.config,
|
|
640
1170
|
"post",
|
|
641
1171
|
`/service/platform/configuration/v1.0/company/${this.config.companyId}/inventory/stores-by-brands`,
|
|
@@ -643,6 +1173,23 @@ class Configuration {
|
|
|
643
1173
|
body,
|
|
644
1174
|
xHeaders
|
|
645
1175
|
);
|
|
1176
|
+
|
|
1177
|
+
const {
|
|
1178
|
+
error: res_error,
|
|
1179
|
+
} = ConfigurationModel.StoreByBrandsResponse().validate(response, {
|
|
1180
|
+
abortEarly: false,
|
|
1181
|
+
allowUnknown: false,
|
|
1182
|
+
});
|
|
1183
|
+
|
|
1184
|
+
if (res_error) {
|
|
1185
|
+
Logger({
|
|
1186
|
+
level: "WARN",
|
|
1187
|
+
message: "Response Validation Warnnings for getStoreByBrands",
|
|
1188
|
+
});
|
|
1189
|
+
Logger({ level: "WARN", message: res_error });
|
|
1190
|
+
}
|
|
1191
|
+
|
|
1192
|
+
return response;
|
|
646
1193
|
}
|
|
647
1194
|
|
|
648
1195
|
/**
|
|
@@ -677,10 +1224,11 @@ class Configuration {
|
|
|
677
1224
|
* @param {Object} arg - Arg object.
|
|
678
1225
|
* @param {number} [arg.pageNo] - Current page no
|
|
679
1226
|
* @param {number} [arg.pageSize] - Current request items count
|
|
1227
|
+
* @returns {Promise<OtherSellerApplications>} - Success response
|
|
680
1228
|
* @summary: Get other seller applications
|
|
681
1229
|
* @description: Get other seller applications who has opted current company as inventory
|
|
682
1230
|
*/
|
|
683
|
-
getOtherSellerApplications({ pageNo, pageSize } = {}) {
|
|
1231
|
+
async getOtherSellerApplications({ pageNo, pageSize } = {}) {
|
|
684
1232
|
const {
|
|
685
1233
|
error,
|
|
686
1234
|
} = ConfigurationValidator.getOtherSellerApplications().validate(
|
|
@@ -694,13 +1242,32 @@ class Configuration {
|
|
|
694
1242
|
return Promise.reject(new FDKClientValidationError(error));
|
|
695
1243
|
}
|
|
696
1244
|
|
|
1245
|
+
// Showing warrnings if extra unknown parameters are found
|
|
1246
|
+
const {
|
|
1247
|
+
error: warrning,
|
|
1248
|
+
} = ConfigurationValidator.getOtherSellerApplications().validate(
|
|
1249
|
+
{
|
|
1250
|
+
pageNo,
|
|
1251
|
+
pageSize,
|
|
1252
|
+
},
|
|
1253
|
+
{ abortEarly: false, allowUnknown: false }
|
|
1254
|
+
);
|
|
1255
|
+
if (warrning) {
|
|
1256
|
+
Logger({
|
|
1257
|
+
level: "WARN",
|
|
1258
|
+
message:
|
|
1259
|
+
"Parameter Validation warrnings for getOtherSellerApplications",
|
|
1260
|
+
});
|
|
1261
|
+
Logger({ level: "WARN", message: warrning });
|
|
1262
|
+
}
|
|
1263
|
+
|
|
697
1264
|
const query_params = {};
|
|
698
1265
|
query_params["page_no"] = pageNo;
|
|
699
1266
|
query_params["page_size"] = pageSize;
|
|
700
1267
|
|
|
701
1268
|
const xHeaders = {};
|
|
702
1269
|
|
|
703
|
-
|
|
1270
|
+
const response = await PlatformAPIClient.execute(
|
|
704
1271
|
this.config,
|
|
705
1272
|
"get",
|
|
706
1273
|
`/service/platform/configuration/v1.0/company/${this.config.companyId}/other-seller-applications/`,
|
|
@@ -708,6 +1275,23 @@ class Configuration {
|
|
|
708
1275
|
undefined,
|
|
709
1276
|
xHeaders
|
|
710
1277
|
);
|
|
1278
|
+
|
|
1279
|
+
const {
|
|
1280
|
+
error: res_error,
|
|
1281
|
+
} = ConfigurationModel.OtherSellerApplications().validate(response, {
|
|
1282
|
+
abortEarly: false,
|
|
1283
|
+
allowUnknown: false,
|
|
1284
|
+
});
|
|
1285
|
+
|
|
1286
|
+
if (res_error) {
|
|
1287
|
+
Logger({
|
|
1288
|
+
level: "WARN",
|
|
1289
|
+
message: "Response Validation Warnnings for getOtherSellerApplications",
|
|
1290
|
+
});
|
|
1291
|
+
Logger({ level: "WARN", message: res_error });
|
|
1292
|
+
}
|
|
1293
|
+
|
|
1294
|
+
return response;
|
|
711
1295
|
}
|
|
712
1296
|
|
|
713
1297
|
/**
|
|
@@ -739,10 +1323,11 @@ class Configuration {
|
|
|
739
1323
|
/**
|
|
740
1324
|
* @param {Object} arg - Arg object.
|
|
741
1325
|
* @param {string} arg.id - Application Id
|
|
1326
|
+
* @returns {Promise<OptedApplicationResponse>} - Success response
|
|
742
1327
|
* @summary: Get other seller applications
|
|
743
1328
|
* @description: Get other seller application
|
|
744
1329
|
*/
|
|
745
|
-
getOtherSellerApplicationById({ id } = {}) {
|
|
1330
|
+
async getOtherSellerApplicationById({ id } = {}) {
|
|
746
1331
|
const {
|
|
747
1332
|
error,
|
|
748
1333
|
} = ConfigurationValidator.getOtherSellerApplicationById().validate(
|
|
@@ -755,11 +1340,29 @@ class Configuration {
|
|
|
755
1340
|
return Promise.reject(new FDKClientValidationError(error));
|
|
756
1341
|
}
|
|
757
1342
|
|
|
1343
|
+
// Showing warrnings if extra unknown parameters are found
|
|
1344
|
+
const {
|
|
1345
|
+
error: warrning,
|
|
1346
|
+
} = ConfigurationValidator.getOtherSellerApplicationById().validate(
|
|
1347
|
+
{
|
|
1348
|
+
id,
|
|
1349
|
+
},
|
|
1350
|
+
{ abortEarly: false, allowUnknown: false }
|
|
1351
|
+
);
|
|
1352
|
+
if (warrning) {
|
|
1353
|
+
Logger({
|
|
1354
|
+
level: "WARN",
|
|
1355
|
+
message:
|
|
1356
|
+
"Parameter Validation warrnings for getOtherSellerApplicationById",
|
|
1357
|
+
});
|
|
1358
|
+
Logger({ level: "WARN", message: warrning });
|
|
1359
|
+
}
|
|
1360
|
+
|
|
758
1361
|
const query_params = {};
|
|
759
1362
|
|
|
760
1363
|
const xHeaders = {};
|
|
761
1364
|
|
|
762
|
-
|
|
1365
|
+
const response = await PlatformAPIClient.execute(
|
|
763
1366
|
this.config,
|
|
764
1367
|
"get",
|
|
765
1368
|
`/service/platform/configuration/v1.0/company/${this.config.companyId}/other-seller-applications/${id}`,
|
|
@@ -767,16 +1370,35 @@ class Configuration {
|
|
|
767
1370
|
undefined,
|
|
768
1371
|
xHeaders
|
|
769
1372
|
);
|
|
1373
|
+
|
|
1374
|
+
const {
|
|
1375
|
+
error: res_error,
|
|
1376
|
+
} = ConfigurationModel.OptedApplicationResponse().validate(response, {
|
|
1377
|
+
abortEarly: false,
|
|
1378
|
+
allowUnknown: false,
|
|
1379
|
+
});
|
|
1380
|
+
|
|
1381
|
+
if (res_error) {
|
|
1382
|
+
Logger({
|
|
1383
|
+
level: "WARN",
|
|
1384
|
+
message:
|
|
1385
|
+
"Response Validation Warnnings for getOtherSellerApplicationById",
|
|
1386
|
+
});
|
|
1387
|
+
Logger({ level: "WARN", message: res_error });
|
|
1388
|
+
}
|
|
1389
|
+
|
|
1390
|
+
return response;
|
|
770
1391
|
}
|
|
771
1392
|
|
|
772
1393
|
/**
|
|
773
1394
|
* @param {Object} arg - Arg object.
|
|
774
1395
|
* @param {string} arg.id - Application Id
|
|
775
1396
|
* @param {OptOutInventory} arg.body
|
|
1397
|
+
* @returns {Promise<SuccessMessageResponse>} - Success response
|
|
776
1398
|
* @summary: Opt out company or store from other seller application
|
|
777
1399
|
* @description: Opt out company or store from other seller application
|
|
778
1400
|
*/
|
|
779
|
-
optOutFromApplication({ id, body } = {}) {
|
|
1401
|
+
async optOutFromApplication({ id, body } = {}) {
|
|
780
1402
|
const { error } = ConfigurationValidator.optOutFromApplication().validate(
|
|
781
1403
|
{
|
|
782
1404
|
id,
|
|
@@ -788,11 +1410,29 @@ class Configuration {
|
|
|
788
1410
|
return Promise.reject(new FDKClientValidationError(error));
|
|
789
1411
|
}
|
|
790
1412
|
|
|
1413
|
+
// Showing warrnings if extra unknown parameters are found
|
|
1414
|
+
const {
|
|
1415
|
+
error: warrning,
|
|
1416
|
+
} = ConfigurationValidator.optOutFromApplication().validate(
|
|
1417
|
+
{
|
|
1418
|
+
id,
|
|
1419
|
+
body,
|
|
1420
|
+
},
|
|
1421
|
+
{ abortEarly: false, allowUnknown: false }
|
|
1422
|
+
);
|
|
1423
|
+
if (warrning) {
|
|
1424
|
+
Logger({
|
|
1425
|
+
level: "WARN",
|
|
1426
|
+
message: "Parameter Validation warrnings for optOutFromApplication",
|
|
1427
|
+
});
|
|
1428
|
+
Logger({ level: "WARN", message: warrning });
|
|
1429
|
+
}
|
|
1430
|
+
|
|
791
1431
|
const query_params = {};
|
|
792
1432
|
|
|
793
1433
|
const xHeaders = {};
|
|
794
1434
|
|
|
795
|
-
|
|
1435
|
+
const response = await PlatformAPIClient.execute(
|
|
796
1436
|
this.config,
|
|
797
1437
|
"put",
|
|
798
1438
|
`/service/platform/configuration/v1.0/company/${this.config.companyId}/other-seller-applications/${id}/opt_out`,
|
|
@@ -800,6 +1440,23 @@ class Configuration {
|
|
|
800
1440
|
body,
|
|
801
1441
|
xHeaders
|
|
802
1442
|
);
|
|
1443
|
+
|
|
1444
|
+
const {
|
|
1445
|
+
error: res_error,
|
|
1446
|
+
} = ConfigurationModel.SuccessMessageResponse().validate(response, {
|
|
1447
|
+
abortEarly: false,
|
|
1448
|
+
allowUnknown: false,
|
|
1449
|
+
});
|
|
1450
|
+
|
|
1451
|
+
if (res_error) {
|
|
1452
|
+
Logger({
|
|
1453
|
+
level: "WARN",
|
|
1454
|
+
message: "Response Validation Warnnings for optOutFromApplication",
|
|
1455
|
+
});
|
|
1456
|
+
Logger({ level: "WARN", message: res_error });
|
|
1457
|
+
}
|
|
1458
|
+
|
|
1459
|
+
return response;
|
|
803
1460
|
}
|
|
804
1461
|
}
|
|
805
1462
|
|