@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 OrderValidator = require("./OrderPlatformValidator");
|
|
5
|
+
const OrderModel = require("./OrderPlatformModel");
|
|
6
|
+
const { Logger } = require("./../../common/Logger");
|
|
7
|
+
|
|
5
8
|
class Order {
|
|
6
9
|
constructor(config) {
|
|
7
10
|
this.config = config;
|
|
@@ -10,6 +13,8 @@ class Order {
|
|
|
10
13
|
/**
|
|
11
14
|
* @param {Object} arg - Arg object.
|
|
12
15
|
* @param {string} [arg.lane] -
|
|
16
|
+
* @param {string} [arg.bagStatus] -
|
|
17
|
+
* @param {boolean} [arg.statusOverrideLane] -
|
|
13
18
|
* @param {string} [arg.searchType] -
|
|
14
19
|
* @param {string} [arg.searchValue] -
|
|
15
20
|
* @param {string} [arg.searchId] -
|
|
@@ -23,16 +28,22 @@ class Order {
|
|
|
23
28
|
* @param {number} [arg.pageNo] -
|
|
24
29
|
* @param {number} [arg.pageSize] -
|
|
25
30
|
* @param {boolean} [arg.isPrioritySort] -
|
|
31
|
+
* @param {boolean} [arg.fetchActiveShipment] -
|
|
26
32
|
* @param {boolean} [arg.excludeLockedShipments] -
|
|
27
33
|
* @param {string} [arg.paymentMethods] -
|
|
28
34
|
* @param {string} [arg.channelShipmentId] -
|
|
29
35
|
* @param {string} [arg.channelOrderId] -
|
|
30
36
|
* @param {string} [arg.customMeta] -
|
|
37
|
+
* @param {string} [arg.orderingChannel] -
|
|
38
|
+
* @param {string} [arg.companyAffiliateTag] -
|
|
39
|
+
* @returns {Promise<ShipmentInternalPlatformViewResponse>} - Success response
|
|
31
40
|
* @summary:
|
|
32
41
|
* @description:
|
|
33
42
|
*/
|
|
34
|
-
getShipments({
|
|
43
|
+
async getShipments({
|
|
35
44
|
lane,
|
|
45
|
+
bagStatus,
|
|
46
|
+
statusOverrideLane,
|
|
36
47
|
searchType,
|
|
37
48
|
searchValue,
|
|
38
49
|
searchId,
|
|
@@ -46,15 +57,20 @@ class Order {
|
|
|
46
57
|
pageNo,
|
|
47
58
|
pageSize,
|
|
48
59
|
isPrioritySort,
|
|
60
|
+
fetchActiveShipment,
|
|
49
61
|
excludeLockedShipments,
|
|
50
62
|
paymentMethods,
|
|
51
63
|
channelShipmentId,
|
|
52
64
|
channelOrderId,
|
|
53
65
|
customMeta,
|
|
66
|
+
orderingChannel,
|
|
67
|
+
companyAffiliateTag,
|
|
54
68
|
} = {}) {
|
|
55
69
|
const { error } = OrderValidator.getShipments().validate(
|
|
56
70
|
{
|
|
57
71
|
lane,
|
|
72
|
+
bagStatus,
|
|
73
|
+
statusOverrideLane,
|
|
58
74
|
searchType,
|
|
59
75
|
searchValue,
|
|
60
76
|
searchId,
|
|
@@ -68,11 +84,14 @@ class Order {
|
|
|
68
84
|
pageNo,
|
|
69
85
|
pageSize,
|
|
70
86
|
isPrioritySort,
|
|
87
|
+
fetchActiveShipment,
|
|
71
88
|
excludeLockedShipments,
|
|
72
89
|
paymentMethods,
|
|
73
90
|
channelShipmentId,
|
|
74
91
|
channelOrderId,
|
|
75
92
|
customMeta,
|
|
93
|
+
orderingChannel,
|
|
94
|
+
companyAffiliateTag,
|
|
76
95
|
},
|
|
77
96
|
{ abortEarly: false, allowUnknown: true }
|
|
78
97
|
);
|
|
@@ -80,8 +99,48 @@ class Order {
|
|
|
80
99
|
return Promise.reject(new FDKClientValidationError(error));
|
|
81
100
|
}
|
|
82
101
|
|
|
102
|
+
// Showing warrnings if extra unknown parameters are found
|
|
103
|
+
const { error: warrning } = OrderValidator.getShipments().validate(
|
|
104
|
+
{
|
|
105
|
+
lane,
|
|
106
|
+
bagStatus,
|
|
107
|
+
statusOverrideLane,
|
|
108
|
+
searchType,
|
|
109
|
+
searchValue,
|
|
110
|
+
searchId,
|
|
111
|
+
fromDate,
|
|
112
|
+
toDate,
|
|
113
|
+
dpIds,
|
|
114
|
+
orderingCompanyId,
|
|
115
|
+
stores,
|
|
116
|
+
salesChannel,
|
|
117
|
+
requestByExt,
|
|
118
|
+
pageNo,
|
|
119
|
+
pageSize,
|
|
120
|
+
isPrioritySort,
|
|
121
|
+
fetchActiveShipment,
|
|
122
|
+
excludeLockedShipments,
|
|
123
|
+
paymentMethods,
|
|
124
|
+
channelShipmentId,
|
|
125
|
+
channelOrderId,
|
|
126
|
+
customMeta,
|
|
127
|
+
orderingChannel,
|
|
128
|
+
companyAffiliateTag,
|
|
129
|
+
},
|
|
130
|
+
{ abortEarly: false, allowUnknown: false }
|
|
131
|
+
);
|
|
132
|
+
if (warrning) {
|
|
133
|
+
Logger({
|
|
134
|
+
level: "WARN",
|
|
135
|
+
message: "Parameter Validation warrnings for getShipments",
|
|
136
|
+
});
|
|
137
|
+
Logger({ level: "WARN", message: warrning });
|
|
138
|
+
}
|
|
139
|
+
|
|
83
140
|
const query_params = {};
|
|
84
141
|
query_params["lane"] = lane;
|
|
142
|
+
query_params["bag_status"] = bagStatus;
|
|
143
|
+
query_params["status_override_lane"] = statusOverrideLane;
|
|
85
144
|
query_params["search_type"] = searchType;
|
|
86
145
|
query_params["search_value"] = searchValue;
|
|
87
146
|
query_params["search_id"] = searchId;
|
|
@@ -95,15 +154,18 @@ class Order {
|
|
|
95
154
|
query_params["page_no"] = pageNo;
|
|
96
155
|
query_params["page_size"] = pageSize;
|
|
97
156
|
query_params["is_priority_sort"] = isPrioritySort;
|
|
157
|
+
query_params["fetch_active_shipment"] = fetchActiveShipment;
|
|
98
158
|
query_params["exclude_locked_shipments"] = excludeLockedShipments;
|
|
99
159
|
query_params["payment_methods"] = paymentMethods;
|
|
100
160
|
query_params["channel_shipment_id"] = channelShipmentId;
|
|
101
161
|
query_params["channel_order_id"] = channelOrderId;
|
|
102
162
|
query_params["custom_meta"] = customMeta;
|
|
163
|
+
query_params["ordering_channel"] = orderingChannel;
|
|
164
|
+
query_params["company_affiliate_tag"] = companyAffiliateTag;
|
|
103
165
|
|
|
104
166
|
const xHeaders = {};
|
|
105
167
|
|
|
106
|
-
|
|
168
|
+
const response = await PlatformAPIClient.execute(
|
|
107
169
|
this.config,
|
|
108
170
|
"get",
|
|
109
171
|
`/service/platform/orders/v1.0/company/${this.config.companyId}/shipments-listing`,
|
|
@@ -111,6 +173,23 @@ class Order {
|
|
|
111
173
|
undefined,
|
|
112
174
|
xHeaders
|
|
113
175
|
);
|
|
176
|
+
|
|
177
|
+
const {
|
|
178
|
+
error: res_error,
|
|
179
|
+
} = OrderModel.ShipmentInternalPlatformViewResponse().validate(response, {
|
|
180
|
+
abortEarly: false,
|
|
181
|
+
allowUnknown: false,
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
if (res_error) {
|
|
185
|
+
Logger({
|
|
186
|
+
level: "WARN",
|
|
187
|
+
message: "Response Validation Warnnings for getShipments",
|
|
188
|
+
});
|
|
189
|
+
Logger({ level: "WARN", message: res_error });
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
return response;
|
|
114
193
|
}
|
|
115
194
|
|
|
116
195
|
/**
|
|
@@ -119,10 +198,11 @@ class Order {
|
|
|
119
198
|
* @param {string} [arg.shipmentId] -
|
|
120
199
|
* @param {string} [arg.orderingCompanyId] -
|
|
121
200
|
* @param {string} [arg.requestByExt] -
|
|
201
|
+
* @returns {Promise<ShipmentInfoResponse>} - Success response
|
|
122
202
|
* @summary:
|
|
123
203
|
* @description:
|
|
124
204
|
*/
|
|
125
|
-
getShipmentById({
|
|
205
|
+
async getShipmentById({
|
|
126
206
|
channelShipmentId,
|
|
127
207
|
shipmentId,
|
|
128
208
|
orderingCompanyId,
|
|
@@ -141,6 +221,24 @@ class Order {
|
|
|
141
221
|
return Promise.reject(new FDKClientValidationError(error));
|
|
142
222
|
}
|
|
143
223
|
|
|
224
|
+
// Showing warrnings if extra unknown parameters are found
|
|
225
|
+
const { error: warrning } = OrderValidator.getShipmentById().validate(
|
|
226
|
+
{
|
|
227
|
+
channelShipmentId,
|
|
228
|
+
shipmentId,
|
|
229
|
+
orderingCompanyId,
|
|
230
|
+
requestByExt,
|
|
231
|
+
},
|
|
232
|
+
{ abortEarly: false, allowUnknown: false }
|
|
233
|
+
);
|
|
234
|
+
if (warrning) {
|
|
235
|
+
Logger({
|
|
236
|
+
level: "WARN",
|
|
237
|
+
message: "Parameter Validation warrnings for getShipmentById",
|
|
238
|
+
});
|
|
239
|
+
Logger({ level: "WARN", message: warrning });
|
|
240
|
+
}
|
|
241
|
+
|
|
144
242
|
const query_params = {};
|
|
145
243
|
query_params["channel_shipment_id"] = channelShipmentId;
|
|
146
244
|
query_params["shipment_id"] = shipmentId;
|
|
@@ -149,7 +247,7 @@ class Order {
|
|
|
149
247
|
|
|
150
248
|
const xHeaders = {};
|
|
151
249
|
|
|
152
|
-
|
|
250
|
+
const response = await PlatformAPIClient.execute(
|
|
153
251
|
this.config,
|
|
154
252
|
"get",
|
|
155
253
|
`/service/platform/orders/v1.0/company/${this.config.companyId}/shipment-details`,
|
|
@@ -157,15 +255,33 @@ class Order {
|
|
|
157
255
|
undefined,
|
|
158
256
|
xHeaders
|
|
159
257
|
);
|
|
258
|
+
|
|
259
|
+
const {
|
|
260
|
+
error: res_error,
|
|
261
|
+
} = OrderModel.ShipmentInfoResponse().validate(response, {
|
|
262
|
+
abortEarly: false,
|
|
263
|
+
allowUnknown: false,
|
|
264
|
+
});
|
|
265
|
+
|
|
266
|
+
if (res_error) {
|
|
267
|
+
Logger({
|
|
268
|
+
level: "WARN",
|
|
269
|
+
message: "Response Validation Warnnings for getShipmentById",
|
|
270
|
+
});
|
|
271
|
+
Logger({ level: "WARN", message: res_error });
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
return response;
|
|
160
275
|
}
|
|
161
276
|
|
|
162
277
|
/**
|
|
163
278
|
* @param {Object} arg - Arg object.
|
|
164
279
|
* @param {string} arg.orderId -
|
|
280
|
+
* @returns {Promise<ShipmentDetailsResponse>} - Success response
|
|
165
281
|
* @summary:
|
|
166
282
|
* @description:
|
|
167
283
|
*/
|
|
168
|
-
getOrderById({ orderId } = {}) {
|
|
284
|
+
async getOrderById({ orderId } = {}) {
|
|
169
285
|
const { error } = OrderValidator.getOrderById().validate(
|
|
170
286
|
{
|
|
171
287
|
orderId,
|
|
@@ -176,12 +292,27 @@ class Order {
|
|
|
176
292
|
return Promise.reject(new FDKClientValidationError(error));
|
|
177
293
|
}
|
|
178
294
|
|
|
295
|
+
// Showing warrnings if extra unknown parameters are found
|
|
296
|
+
const { error: warrning } = OrderValidator.getOrderById().validate(
|
|
297
|
+
{
|
|
298
|
+
orderId,
|
|
299
|
+
},
|
|
300
|
+
{ abortEarly: false, allowUnknown: false }
|
|
301
|
+
);
|
|
302
|
+
if (warrning) {
|
|
303
|
+
Logger({
|
|
304
|
+
level: "WARN",
|
|
305
|
+
message: "Parameter Validation warrnings for getOrderById",
|
|
306
|
+
});
|
|
307
|
+
Logger({ level: "WARN", message: warrning });
|
|
308
|
+
}
|
|
309
|
+
|
|
179
310
|
const query_params = {};
|
|
180
311
|
query_params["order_id"] = orderId;
|
|
181
312
|
|
|
182
313
|
const xHeaders = {};
|
|
183
314
|
|
|
184
|
-
|
|
315
|
+
const response = await PlatformAPIClient.execute(
|
|
185
316
|
this.config,
|
|
186
317
|
"get",
|
|
187
318
|
`/service/platform/orders/v1.0/company/${this.config.companyId}/order-details`,
|
|
@@ -189,6 +320,23 @@ class Order {
|
|
|
189
320
|
undefined,
|
|
190
321
|
xHeaders
|
|
191
322
|
);
|
|
323
|
+
|
|
324
|
+
const {
|
|
325
|
+
error: res_error,
|
|
326
|
+
} = OrderModel.ShipmentDetailsResponse().validate(response, {
|
|
327
|
+
abortEarly: false,
|
|
328
|
+
allowUnknown: false,
|
|
329
|
+
});
|
|
330
|
+
|
|
331
|
+
if (res_error) {
|
|
332
|
+
Logger({
|
|
333
|
+
level: "WARN",
|
|
334
|
+
message: "Response Validation Warnnings for getOrderById",
|
|
335
|
+
});
|
|
336
|
+
Logger({ level: "WARN", message: res_error });
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
return response;
|
|
192
340
|
}
|
|
193
341
|
|
|
194
342
|
/**
|
|
@@ -202,10 +350,11 @@ class Order {
|
|
|
202
350
|
* @param {string} [arg.salesChannel] -
|
|
203
351
|
* @param {string} [arg.paymentMode] -
|
|
204
352
|
* @param {string} [arg.bagStatus] -
|
|
353
|
+
* @returns {Promise<LaneConfigResponse>} - Success response
|
|
205
354
|
* @summary:
|
|
206
355
|
* @description:
|
|
207
356
|
*/
|
|
208
|
-
getLaneConfig({
|
|
357
|
+
async getLaneConfig({
|
|
209
358
|
superLane,
|
|
210
359
|
groupEntity,
|
|
211
360
|
fromDate,
|
|
@@ -234,6 +383,29 @@ class Order {
|
|
|
234
383
|
return Promise.reject(new FDKClientValidationError(error));
|
|
235
384
|
}
|
|
236
385
|
|
|
386
|
+
// Showing warrnings if extra unknown parameters are found
|
|
387
|
+
const { error: warrning } = OrderValidator.getLaneConfig().validate(
|
|
388
|
+
{
|
|
389
|
+
superLane,
|
|
390
|
+
groupEntity,
|
|
391
|
+
fromDate,
|
|
392
|
+
toDate,
|
|
393
|
+
dpIds,
|
|
394
|
+
stores,
|
|
395
|
+
salesChannel,
|
|
396
|
+
paymentMode,
|
|
397
|
+
bagStatus,
|
|
398
|
+
},
|
|
399
|
+
{ abortEarly: false, allowUnknown: false }
|
|
400
|
+
);
|
|
401
|
+
if (warrning) {
|
|
402
|
+
Logger({
|
|
403
|
+
level: "WARN",
|
|
404
|
+
message: "Parameter Validation warrnings for getLaneConfig",
|
|
405
|
+
});
|
|
406
|
+
Logger({ level: "WARN", message: warrning });
|
|
407
|
+
}
|
|
408
|
+
|
|
237
409
|
const query_params = {};
|
|
238
410
|
query_params["super_lane"] = superLane;
|
|
239
411
|
query_params["group_entity"] = groupEntity;
|
|
@@ -247,7 +419,7 @@ class Order {
|
|
|
247
419
|
|
|
248
420
|
const xHeaders = {};
|
|
249
421
|
|
|
250
|
-
|
|
422
|
+
const response = await PlatformAPIClient.execute(
|
|
251
423
|
this.config,
|
|
252
424
|
"get",
|
|
253
425
|
`/service/platform/orders/v1.0/company/${this.config.companyId}/lane-config/`,
|
|
@@ -255,6 +427,23 @@ class Order {
|
|
|
255
427
|
undefined,
|
|
256
428
|
xHeaders
|
|
257
429
|
);
|
|
430
|
+
|
|
431
|
+
const {
|
|
432
|
+
error: res_error,
|
|
433
|
+
} = OrderModel.LaneConfigResponse().validate(response, {
|
|
434
|
+
abortEarly: false,
|
|
435
|
+
allowUnknown: false,
|
|
436
|
+
});
|
|
437
|
+
|
|
438
|
+
if (res_error) {
|
|
439
|
+
Logger({
|
|
440
|
+
level: "WARN",
|
|
441
|
+
message: "Response Validation Warnnings for getLaneConfig",
|
|
442
|
+
});
|
|
443
|
+
Logger({ level: "WARN", message: res_error });
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
return response;
|
|
258
447
|
}
|
|
259
448
|
|
|
260
449
|
/**
|
|
@@ -275,10 +464,11 @@ class Order {
|
|
|
275
464
|
* @param {number} [arg.pageSize] -
|
|
276
465
|
* @param {boolean} [arg.isPrioritySort] -
|
|
277
466
|
* @param {string} [arg.customMeta] -
|
|
467
|
+
* @returns {Promise<OrderListingResponse>} - Success response
|
|
278
468
|
* @summary:
|
|
279
469
|
* @description:
|
|
280
470
|
*/
|
|
281
|
-
getOrders({
|
|
471
|
+
async getOrders({
|
|
282
472
|
lane,
|
|
283
473
|
searchType,
|
|
284
474
|
bagStatus,
|
|
@@ -321,6 +511,36 @@ class Order {
|
|
|
321
511
|
return Promise.reject(new FDKClientValidationError(error));
|
|
322
512
|
}
|
|
323
513
|
|
|
514
|
+
// Showing warrnings if extra unknown parameters are found
|
|
515
|
+
const { error: warrning } = OrderValidator.getOrders().validate(
|
|
516
|
+
{
|
|
517
|
+
lane,
|
|
518
|
+
searchType,
|
|
519
|
+
bagStatus,
|
|
520
|
+
timeToDispatch,
|
|
521
|
+
paymentMethods,
|
|
522
|
+
tags,
|
|
523
|
+
searchValue,
|
|
524
|
+
fromDate,
|
|
525
|
+
toDate,
|
|
526
|
+
dpIds,
|
|
527
|
+
stores,
|
|
528
|
+
salesChannel,
|
|
529
|
+
pageNo,
|
|
530
|
+
pageSize,
|
|
531
|
+
isPrioritySort,
|
|
532
|
+
customMeta,
|
|
533
|
+
},
|
|
534
|
+
{ abortEarly: false, allowUnknown: false }
|
|
535
|
+
);
|
|
536
|
+
if (warrning) {
|
|
537
|
+
Logger({
|
|
538
|
+
level: "WARN",
|
|
539
|
+
message: "Parameter Validation warrnings for getOrders",
|
|
540
|
+
});
|
|
541
|
+
Logger({ level: "WARN", message: warrning });
|
|
542
|
+
}
|
|
543
|
+
|
|
324
544
|
const query_params = {};
|
|
325
545
|
query_params["lane"] = lane;
|
|
326
546
|
query_params["search_type"] = searchType;
|
|
@@ -341,7 +561,7 @@ class Order {
|
|
|
341
561
|
|
|
342
562
|
const xHeaders = {};
|
|
343
563
|
|
|
344
|
-
|
|
564
|
+
const response = await PlatformAPIClient.execute(
|
|
345
565
|
this.config,
|
|
346
566
|
"get",
|
|
347
567
|
`/service/platform/orders/v1.0/company/${this.config.companyId}/orders-listing`,
|
|
@@ -349,16 +569,34 @@ class Order {
|
|
|
349
569
|
undefined,
|
|
350
570
|
xHeaders
|
|
351
571
|
);
|
|
572
|
+
|
|
573
|
+
const {
|
|
574
|
+
error: res_error,
|
|
575
|
+
} = OrderModel.OrderListingResponse().validate(response, {
|
|
576
|
+
abortEarly: false,
|
|
577
|
+
allowUnknown: false,
|
|
578
|
+
});
|
|
579
|
+
|
|
580
|
+
if (res_error) {
|
|
581
|
+
Logger({
|
|
582
|
+
level: "WARN",
|
|
583
|
+
message: "Response Validation Warnnings for getOrders",
|
|
584
|
+
});
|
|
585
|
+
Logger({ level: "WARN", message: res_error });
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
return response;
|
|
352
589
|
}
|
|
353
590
|
|
|
354
591
|
/**
|
|
355
592
|
* @param {Object} arg - Arg object.
|
|
356
593
|
* @param {string} [arg.fromDate] -
|
|
357
594
|
* @param {string} [arg.toDate] -
|
|
595
|
+
* @returns {Promise<MetricCountResponse>} - Success response
|
|
358
596
|
* @summary:
|
|
359
597
|
* @description:
|
|
360
598
|
*/
|
|
361
|
-
getMetricCount({ fromDate, toDate } = {}) {
|
|
599
|
+
async getMetricCount({ fromDate, toDate } = {}) {
|
|
362
600
|
const { error } = OrderValidator.getMetricCount().validate(
|
|
363
601
|
{
|
|
364
602
|
fromDate,
|
|
@@ -370,13 +608,29 @@ class Order {
|
|
|
370
608
|
return Promise.reject(new FDKClientValidationError(error));
|
|
371
609
|
}
|
|
372
610
|
|
|
611
|
+
// Showing warrnings if extra unknown parameters are found
|
|
612
|
+
const { error: warrning } = OrderValidator.getMetricCount().validate(
|
|
613
|
+
{
|
|
614
|
+
fromDate,
|
|
615
|
+
toDate,
|
|
616
|
+
},
|
|
617
|
+
{ abortEarly: false, allowUnknown: false }
|
|
618
|
+
);
|
|
619
|
+
if (warrning) {
|
|
620
|
+
Logger({
|
|
621
|
+
level: "WARN",
|
|
622
|
+
message: "Parameter Validation warrnings for getMetricCount",
|
|
623
|
+
});
|
|
624
|
+
Logger({ level: "WARN", message: warrning });
|
|
625
|
+
}
|
|
626
|
+
|
|
373
627
|
const query_params = {};
|
|
374
628
|
query_params["from_date"] = fromDate;
|
|
375
629
|
query_params["to_date"] = toDate;
|
|
376
630
|
|
|
377
631
|
const xHeaders = {};
|
|
378
632
|
|
|
379
|
-
|
|
633
|
+
const response = await PlatformAPIClient.execute(
|
|
380
634
|
this.config,
|
|
381
635
|
"get",
|
|
382
636
|
`/service/platform/orders/v1.0/company/${this.config.companyId}/shipment/metrics-count/`,
|
|
@@ -384,16 +638,34 @@ class Order {
|
|
|
384
638
|
undefined,
|
|
385
639
|
xHeaders
|
|
386
640
|
);
|
|
641
|
+
|
|
642
|
+
const {
|
|
643
|
+
error: res_error,
|
|
644
|
+
} = OrderModel.MetricCountResponse().validate(response, {
|
|
645
|
+
abortEarly: false,
|
|
646
|
+
allowUnknown: false,
|
|
647
|
+
});
|
|
648
|
+
|
|
649
|
+
if (res_error) {
|
|
650
|
+
Logger({
|
|
651
|
+
level: "WARN",
|
|
652
|
+
message: "Response Validation Warnnings for getMetricCount",
|
|
653
|
+
});
|
|
654
|
+
Logger({ level: "WARN", message: res_error });
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
return response;
|
|
387
658
|
}
|
|
388
659
|
|
|
389
660
|
/**
|
|
390
661
|
* @param {Object} arg - Arg object.
|
|
391
662
|
* @param {string} arg.view -
|
|
392
663
|
* @param {string} [arg.groupEntity] -
|
|
664
|
+
* @returns {Promise<FiltersResponse>} - Success response
|
|
393
665
|
* @summary:
|
|
394
666
|
* @description:
|
|
395
667
|
*/
|
|
396
|
-
getfilters({ view, groupEntity } = {}) {
|
|
668
|
+
async getfilters({ view, groupEntity } = {}) {
|
|
397
669
|
const { error } = OrderValidator.getfilters().validate(
|
|
398
670
|
{
|
|
399
671
|
view,
|
|
@@ -405,13 +677,29 @@ class Order {
|
|
|
405
677
|
return Promise.reject(new FDKClientValidationError(error));
|
|
406
678
|
}
|
|
407
679
|
|
|
680
|
+
// Showing warrnings if extra unknown parameters are found
|
|
681
|
+
const { error: warrning } = OrderValidator.getfilters().validate(
|
|
682
|
+
{
|
|
683
|
+
view,
|
|
684
|
+
groupEntity,
|
|
685
|
+
},
|
|
686
|
+
{ abortEarly: false, allowUnknown: false }
|
|
687
|
+
);
|
|
688
|
+
if (warrning) {
|
|
689
|
+
Logger({
|
|
690
|
+
level: "WARN",
|
|
691
|
+
message: "Parameter Validation warrnings for getfilters",
|
|
692
|
+
});
|
|
693
|
+
Logger({ level: "WARN", message: warrning });
|
|
694
|
+
}
|
|
695
|
+
|
|
408
696
|
const query_params = {};
|
|
409
697
|
query_params["view"] = view;
|
|
410
698
|
query_params["group_entity"] = groupEntity;
|
|
411
699
|
|
|
412
700
|
const xHeaders = {};
|
|
413
701
|
|
|
414
|
-
|
|
702
|
+
const response = await PlatformAPIClient.execute(
|
|
415
703
|
this.config,
|
|
416
704
|
"get",
|
|
417
705
|
`/service/platform/orders/v1.0/company/${this.config.companyId}/filter-listing`,
|
|
@@ -419,16 +707,32 @@ class Order {
|
|
|
419
707
|
undefined,
|
|
420
708
|
xHeaders
|
|
421
709
|
);
|
|
710
|
+
|
|
711
|
+
const { error: res_error } = OrderModel.FiltersResponse().validate(
|
|
712
|
+
response,
|
|
713
|
+
{ abortEarly: false, allowUnknown: false }
|
|
714
|
+
);
|
|
715
|
+
|
|
716
|
+
if (res_error) {
|
|
717
|
+
Logger({
|
|
718
|
+
level: "WARN",
|
|
719
|
+
message: "Response Validation Warnnings for getfilters",
|
|
720
|
+
});
|
|
721
|
+
Logger({ level: "WARN", message: res_error });
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
return response;
|
|
422
725
|
}
|
|
423
726
|
|
|
424
727
|
/**
|
|
425
728
|
* @param {Object} arg - Arg object.
|
|
426
729
|
* @param {string} [arg.fromDate] -
|
|
427
730
|
* @param {string} [arg.toDate] -
|
|
731
|
+
* @returns {Promise<Success>} - Success response
|
|
428
732
|
* @summary:
|
|
429
733
|
* @description:
|
|
430
734
|
*/
|
|
431
|
-
createShipmentReport({ fromDate, toDate } = {}) {
|
|
735
|
+
async createShipmentReport({ fromDate, toDate } = {}) {
|
|
432
736
|
const { error } = OrderValidator.createShipmentReport().validate(
|
|
433
737
|
{
|
|
434
738
|
fromDate,
|
|
@@ -440,13 +744,29 @@ class Order {
|
|
|
440
744
|
return Promise.reject(new FDKClientValidationError(error));
|
|
441
745
|
}
|
|
442
746
|
|
|
747
|
+
// Showing warrnings if extra unknown parameters are found
|
|
748
|
+
const { error: warrning } = OrderValidator.createShipmentReport().validate(
|
|
749
|
+
{
|
|
750
|
+
fromDate,
|
|
751
|
+
toDate,
|
|
752
|
+
},
|
|
753
|
+
{ abortEarly: false, allowUnknown: false }
|
|
754
|
+
);
|
|
755
|
+
if (warrning) {
|
|
756
|
+
Logger({
|
|
757
|
+
level: "WARN",
|
|
758
|
+
message: "Parameter Validation warrnings for createShipmentReport",
|
|
759
|
+
});
|
|
760
|
+
Logger({ level: "WARN", message: warrning });
|
|
761
|
+
}
|
|
762
|
+
|
|
443
763
|
const query_params = {};
|
|
444
764
|
query_params["from_date"] = fromDate;
|
|
445
765
|
query_params["to_date"] = toDate;
|
|
446
766
|
|
|
447
767
|
const xHeaders = {};
|
|
448
768
|
|
|
449
|
-
|
|
769
|
+
const response = await PlatformAPIClient.execute(
|
|
450
770
|
this.config,
|
|
451
771
|
"post",
|
|
452
772
|
`/service/platform/orders/v1.0/company/${this.config.companyId}/reports/shipment`,
|
|
@@ -454,16 +774,32 @@ class Order {
|
|
|
454
774
|
undefined,
|
|
455
775
|
xHeaders
|
|
456
776
|
);
|
|
777
|
+
|
|
778
|
+
const { error: res_error } = OrderModel.Success().validate(response, {
|
|
779
|
+
abortEarly: false,
|
|
780
|
+
allowUnknown: false,
|
|
781
|
+
});
|
|
782
|
+
|
|
783
|
+
if (res_error) {
|
|
784
|
+
Logger({
|
|
785
|
+
level: "WARN",
|
|
786
|
+
message: "Response Validation Warnnings for createShipmentReport",
|
|
787
|
+
});
|
|
788
|
+
Logger({ level: "WARN", message: res_error });
|
|
789
|
+
}
|
|
790
|
+
|
|
791
|
+
return response;
|
|
457
792
|
}
|
|
458
793
|
|
|
459
794
|
/**
|
|
460
795
|
* @param {Object} arg - Arg object.
|
|
461
796
|
* @param {number} [arg.pageNo] -
|
|
462
797
|
* @param {number} [arg.pageSize] -
|
|
798
|
+
* @returns {Promise<OmsReports>} - Success response
|
|
463
799
|
* @summary:
|
|
464
800
|
* @description:
|
|
465
801
|
*/
|
|
466
|
-
getReportsShipmentListing({ pageNo, pageSize } = {}) {
|
|
802
|
+
async getReportsShipmentListing({ pageNo, pageSize } = {}) {
|
|
467
803
|
const { error } = OrderValidator.getReportsShipmentListing().validate(
|
|
468
804
|
{
|
|
469
805
|
pageNo,
|
|
@@ -475,13 +811,31 @@ class Order {
|
|
|
475
811
|
return Promise.reject(new FDKClientValidationError(error));
|
|
476
812
|
}
|
|
477
813
|
|
|
814
|
+
// Showing warrnings if extra unknown parameters are found
|
|
815
|
+
const {
|
|
816
|
+
error: warrning,
|
|
817
|
+
} = OrderValidator.getReportsShipmentListing().validate(
|
|
818
|
+
{
|
|
819
|
+
pageNo,
|
|
820
|
+
pageSize,
|
|
821
|
+
},
|
|
822
|
+
{ abortEarly: false, allowUnknown: false }
|
|
823
|
+
);
|
|
824
|
+
if (warrning) {
|
|
825
|
+
Logger({
|
|
826
|
+
level: "WARN",
|
|
827
|
+
message: "Parameter Validation warrnings for getReportsShipmentListing",
|
|
828
|
+
});
|
|
829
|
+
Logger({ level: "WARN", message: warrning });
|
|
830
|
+
}
|
|
831
|
+
|
|
478
832
|
const query_params = {};
|
|
479
833
|
query_params["page_no"] = pageNo;
|
|
480
834
|
query_params["page_size"] = pageSize;
|
|
481
835
|
|
|
482
836
|
const xHeaders = {};
|
|
483
837
|
|
|
484
|
-
|
|
838
|
+
const response = await PlatformAPIClient.execute(
|
|
485
839
|
this.config,
|
|
486
840
|
"get",
|
|
487
841
|
`/service/platform/orders/v1.0/company/${this.config.companyId}/reports/shipment-listing`,
|
|
@@ -489,15 +843,31 @@ class Order {
|
|
|
489
843
|
undefined,
|
|
490
844
|
xHeaders
|
|
491
845
|
);
|
|
846
|
+
|
|
847
|
+
const { error: res_error } = OrderModel.OmsReports().validate(response, {
|
|
848
|
+
abortEarly: false,
|
|
849
|
+
allowUnknown: false,
|
|
850
|
+
});
|
|
851
|
+
|
|
852
|
+
if (res_error) {
|
|
853
|
+
Logger({
|
|
854
|
+
level: "WARN",
|
|
855
|
+
message: "Response Validation Warnnings for getReportsShipmentListing",
|
|
856
|
+
});
|
|
857
|
+
Logger({ level: "WARN", message: res_error });
|
|
858
|
+
}
|
|
859
|
+
|
|
860
|
+
return response;
|
|
492
861
|
}
|
|
493
862
|
|
|
494
863
|
/**
|
|
495
864
|
* @param {Object} arg - Arg object.
|
|
496
865
|
* @param {JioCodeUpsertPayload} arg.body
|
|
866
|
+
* @returns {Promise<JioCodeUpsertResponse>} - Success response
|
|
497
867
|
* @summary:
|
|
498
868
|
* @description:
|
|
499
869
|
*/
|
|
500
|
-
upsertJioCode({ body } = {}) {
|
|
870
|
+
async upsertJioCode({ body } = {}) {
|
|
501
871
|
const { error } = OrderValidator.upsertJioCode().validate(
|
|
502
872
|
{
|
|
503
873
|
body,
|
|
@@ -508,11 +878,26 @@ class Order {
|
|
|
508
878
|
return Promise.reject(new FDKClientValidationError(error));
|
|
509
879
|
}
|
|
510
880
|
|
|
881
|
+
// Showing warrnings if extra unknown parameters are found
|
|
882
|
+
const { error: warrning } = OrderValidator.upsertJioCode().validate(
|
|
883
|
+
{
|
|
884
|
+
body,
|
|
885
|
+
},
|
|
886
|
+
{ abortEarly: false, allowUnknown: false }
|
|
887
|
+
);
|
|
888
|
+
if (warrning) {
|
|
889
|
+
Logger({
|
|
890
|
+
level: "WARN",
|
|
891
|
+
message: "Parameter Validation warrnings for upsertJioCode",
|
|
892
|
+
});
|
|
893
|
+
Logger({ level: "WARN", message: warrning });
|
|
894
|
+
}
|
|
895
|
+
|
|
511
896
|
const query_params = {};
|
|
512
897
|
|
|
513
898
|
const xHeaders = {};
|
|
514
899
|
|
|
515
|
-
|
|
900
|
+
const response = await PlatformAPIClient.execute(
|
|
516
901
|
this.config,
|
|
517
902
|
"post",
|
|
518
903
|
`/service/platform/orders/v1.0/company/${this.config.companyId}/upsert/jiocode/article`,
|
|
@@ -520,16 +905,34 @@ class Order {
|
|
|
520
905
|
body,
|
|
521
906
|
xHeaders
|
|
522
907
|
);
|
|
908
|
+
|
|
909
|
+
const {
|
|
910
|
+
error: res_error,
|
|
911
|
+
} = OrderModel.JioCodeUpsertResponse().validate(response, {
|
|
912
|
+
abortEarly: false,
|
|
913
|
+
allowUnknown: false,
|
|
914
|
+
});
|
|
915
|
+
|
|
916
|
+
if (res_error) {
|
|
917
|
+
Logger({
|
|
918
|
+
level: "WARN",
|
|
919
|
+
message: "Response Validation Warnnings for upsertJioCode",
|
|
920
|
+
});
|
|
921
|
+
Logger({ level: "WARN", message: res_error });
|
|
922
|
+
}
|
|
923
|
+
|
|
924
|
+
return response;
|
|
523
925
|
}
|
|
524
926
|
|
|
525
927
|
/**
|
|
526
928
|
* @param {Object} arg - Arg object.
|
|
527
929
|
* @param {string} arg.batchId -
|
|
528
930
|
* @param {string} arg.docType -
|
|
931
|
+
* @returns {Promise<BulkInvoicingResponse>} - Success response
|
|
529
932
|
* @summary:
|
|
530
933
|
* @description:
|
|
531
934
|
*/
|
|
532
|
-
getBulkInvoice({ batchId, docType } = {}) {
|
|
935
|
+
async getBulkInvoice({ batchId, docType } = {}) {
|
|
533
936
|
const { error } = OrderValidator.getBulkInvoice().validate(
|
|
534
937
|
{
|
|
535
938
|
batchId,
|
|
@@ -541,13 +944,29 @@ class Order {
|
|
|
541
944
|
return Promise.reject(new FDKClientValidationError(error));
|
|
542
945
|
}
|
|
543
946
|
|
|
947
|
+
// Showing warrnings if extra unknown parameters are found
|
|
948
|
+
const { error: warrning } = OrderValidator.getBulkInvoice().validate(
|
|
949
|
+
{
|
|
950
|
+
batchId,
|
|
951
|
+
docType,
|
|
952
|
+
},
|
|
953
|
+
{ abortEarly: false, allowUnknown: false }
|
|
954
|
+
);
|
|
955
|
+
if (warrning) {
|
|
956
|
+
Logger({
|
|
957
|
+
level: "WARN",
|
|
958
|
+
message: "Parameter Validation warrnings for getBulkInvoice",
|
|
959
|
+
});
|
|
960
|
+
Logger({ level: "WARN", message: warrning });
|
|
961
|
+
}
|
|
962
|
+
|
|
544
963
|
const query_params = {};
|
|
545
964
|
query_params["batch_id"] = batchId;
|
|
546
965
|
query_params["doc_type"] = docType;
|
|
547
966
|
|
|
548
967
|
const xHeaders = {};
|
|
549
968
|
|
|
550
|
-
|
|
969
|
+
const response = await PlatformAPIClient.execute(
|
|
551
970
|
this.config,
|
|
552
971
|
"get",
|
|
553
972
|
`/service/platform/orders/v1.0/company/${this.config.companyId}/bulk-action/invoice`,
|
|
@@ -555,15 +974,33 @@ class Order {
|
|
|
555
974
|
undefined,
|
|
556
975
|
xHeaders
|
|
557
976
|
);
|
|
977
|
+
|
|
978
|
+
const {
|
|
979
|
+
error: res_error,
|
|
980
|
+
} = OrderModel.BulkInvoicingResponse().validate(response, {
|
|
981
|
+
abortEarly: false,
|
|
982
|
+
allowUnknown: false,
|
|
983
|
+
});
|
|
984
|
+
|
|
985
|
+
if (res_error) {
|
|
986
|
+
Logger({
|
|
987
|
+
level: "WARN",
|
|
988
|
+
message: "Response Validation Warnnings for getBulkInvoice",
|
|
989
|
+
});
|
|
990
|
+
Logger({ level: "WARN", message: res_error });
|
|
991
|
+
}
|
|
992
|
+
|
|
993
|
+
return response;
|
|
558
994
|
}
|
|
559
995
|
|
|
560
996
|
/**
|
|
561
997
|
* @param {Object} arg - Arg object.
|
|
562
998
|
* @param {string} arg.batchId -
|
|
999
|
+
* @returns {Promise<BulkInvoiceLabelResponse>} - Success response
|
|
563
1000
|
* @summary:
|
|
564
1001
|
* @description:
|
|
565
1002
|
*/
|
|
566
|
-
getBulkInvoiceLabel({ batchId } = {}) {
|
|
1003
|
+
async getBulkInvoiceLabel({ batchId } = {}) {
|
|
567
1004
|
const { error } = OrderValidator.getBulkInvoiceLabel().validate(
|
|
568
1005
|
{
|
|
569
1006
|
batchId,
|
|
@@ -574,12 +1011,27 @@ class Order {
|
|
|
574
1011
|
return Promise.reject(new FDKClientValidationError(error));
|
|
575
1012
|
}
|
|
576
1013
|
|
|
1014
|
+
// Showing warrnings if extra unknown parameters are found
|
|
1015
|
+
const { error: warrning } = OrderValidator.getBulkInvoiceLabel().validate(
|
|
1016
|
+
{
|
|
1017
|
+
batchId,
|
|
1018
|
+
},
|
|
1019
|
+
{ abortEarly: false, allowUnknown: false }
|
|
1020
|
+
);
|
|
1021
|
+
if (warrning) {
|
|
1022
|
+
Logger({
|
|
1023
|
+
level: "WARN",
|
|
1024
|
+
message: "Parameter Validation warrnings for getBulkInvoiceLabel",
|
|
1025
|
+
});
|
|
1026
|
+
Logger({ level: "WARN", message: warrning });
|
|
1027
|
+
}
|
|
1028
|
+
|
|
577
1029
|
const query_params = {};
|
|
578
1030
|
query_params["batch_id"] = batchId;
|
|
579
1031
|
|
|
580
1032
|
const xHeaders = {};
|
|
581
1033
|
|
|
582
|
-
|
|
1034
|
+
const response = await PlatformAPIClient.execute(
|
|
583
1035
|
this.config,
|
|
584
1036
|
"get",
|
|
585
1037
|
`/service/platform/orders/v1.0/company/${this.config.companyId}/invoice-label-external`,
|
|
@@ -587,6 +1039,23 @@ class Order {
|
|
|
587
1039
|
undefined,
|
|
588
1040
|
xHeaders
|
|
589
1041
|
);
|
|
1042
|
+
|
|
1043
|
+
const {
|
|
1044
|
+
error: res_error,
|
|
1045
|
+
} = OrderModel.BulkInvoiceLabelResponse().validate(response, {
|
|
1046
|
+
abortEarly: false,
|
|
1047
|
+
allowUnknown: false,
|
|
1048
|
+
});
|
|
1049
|
+
|
|
1050
|
+
if (res_error) {
|
|
1051
|
+
Logger({
|
|
1052
|
+
level: "WARN",
|
|
1053
|
+
message: "Response Validation Warnnings for getBulkInvoiceLabel",
|
|
1054
|
+
});
|
|
1055
|
+
Logger({ level: "WARN", message: res_error });
|
|
1056
|
+
}
|
|
1057
|
+
|
|
1058
|
+
return response;
|
|
590
1059
|
}
|
|
591
1060
|
|
|
592
1061
|
/**
|
|
@@ -605,10 +1074,11 @@ class Order {
|
|
|
605
1074
|
* @param {number} [arg.pageSize] -
|
|
606
1075
|
* @param {string} [arg.customerId] -
|
|
607
1076
|
* @param {boolean} [arg.isPrioritySort] -
|
|
1077
|
+
* @returns {Promise<FileResponse>} - Success response
|
|
608
1078
|
* @summary:
|
|
609
1079
|
* @description:
|
|
610
1080
|
*/
|
|
611
|
-
getBulkShipmentExcelFile({
|
|
1081
|
+
async getBulkShipmentExcelFile({
|
|
612
1082
|
lane,
|
|
613
1083
|
searchType,
|
|
614
1084
|
searchId,
|
|
@@ -647,6 +1117,36 @@ class Order {
|
|
|
647
1117
|
return Promise.reject(new FDKClientValidationError(error));
|
|
648
1118
|
}
|
|
649
1119
|
|
|
1120
|
+
// Showing warrnings if extra unknown parameters are found
|
|
1121
|
+
const {
|
|
1122
|
+
error: warrning,
|
|
1123
|
+
} = OrderValidator.getBulkShipmentExcelFile().validate(
|
|
1124
|
+
{
|
|
1125
|
+
lane,
|
|
1126
|
+
searchType,
|
|
1127
|
+
searchId,
|
|
1128
|
+
fromDate,
|
|
1129
|
+
toDate,
|
|
1130
|
+
dpIds,
|
|
1131
|
+
orderingCompanyId,
|
|
1132
|
+
stores,
|
|
1133
|
+
salesChannel,
|
|
1134
|
+
requestByExt,
|
|
1135
|
+
pageNo,
|
|
1136
|
+
pageSize,
|
|
1137
|
+
customerId,
|
|
1138
|
+
isPrioritySort,
|
|
1139
|
+
},
|
|
1140
|
+
{ abortEarly: false, allowUnknown: false }
|
|
1141
|
+
);
|
|
1142
|
+
if (warrning) {
|
|
1143
|
+
Logger({
|
|
1144
|
+
level: "WARN",
|
|
1145
|
+
message: "Parameter Validation warrnings for getBulkShipmentExcelFile",
|
|
1146
|
+
});
|
|
1147
|
+
Logger({ level: "WARN", message: warrning });
|
|
1148
|
+
}
|
|
1149
|
+
|
|
650
1150
|
const query_params = {};
|
|
651
1151
|
query_params["lane"] = lane;
|
|
652
1152
|
query_params["search_type"] = searchType;
|
|
@@ -665,7 +1165,7 @@ class Order {
|
|
|
665
1165
|
|
|
666
1166
|
const xHeaders = {};
|
|
667
1167
|
|
|
668
|
-
|
|
1168
|
+
const response = await PlatformAPIClient.execute(
|
|
669
1169
|
this.config,
|
|
670
1170
|
"get",
|
|
671
1171
|
`/service/platform/orders/v1.0/company/${this.config.companyId}/generate/file`,
|
|
@@ -673,6 +1173,21 @@ class Order {
|
|
|
673
1173
|
undefined,
|
|
674
1174
|
xHeaders
|
|
675
1175
|
);
|
|
1176
|
+
|
|
1177
|
+
const { error: res_error } = OrderModel.FileResponse().validate(response, {
|
|
1178
|
+
abortEarly: false,
|
|
1179
|
+
allowUnknown: false,
|
|
1180
|
+
});
|
|
1181
|
+
|
|
1182
|
+
if (res_error) {
|
|
1183
|
+
Logger({
|
|
1184
|
+
level: "WARN",
|
|
1185
|
+
message: "Response Validation Warnnings for getBulkShipmentExcelFile",
|
|
1186
|
+
});
|
|
1187
|
+
Logger({ level: "WARN", message: res_error });
|
|
1188
|
+
}
|
|
1189
|
+
|
|
1190
|
+
return response;
|
|
676
1191
|
}
|
|
677
1192
|
|
|
678
1193
|
/**
|
|
@@ -691,10 +1206,11 @@ class Order {
|
|
|
691
1206
|
* @param {number} [arg.pageSize] -
|
|
692
1207
|
* @param {string} [arg.customerId] -
|
|
693
1208
|
* @param {boolean} [arg.isPrioritySort] -
|
|
1209
|
+
* @returns {Promise<BulkListingResponse>} - Success response
|
|
694
1210
|
* @summary:
|
|
695
1211
|
* @description:
|
|
696
1212
|
*/
|
|
697
|
-
getBulkList({
|
|
1213
|
+
async getBulkList({
|
|
698
1214
|
lane,
|
|
699
1215
|
searchType,
|
|
700
1216
|
searchId,
|
|
@@ -733,6 +1249,34 @@ class Order {
|
|
|
733
1249
|
return Promise.reject(new FDKClientValidationError(error));
|
|
734
1250
|
}
|
|
735
1251
|
|
|
1252
|
+
// Showing warrnings if extra unknown parameters are found
|
|
1253
|
+
const { error: warrning } = OrderValidator.getBulkList().validate(
|
|
1254
|
+
{
|
|
1255
|
+
lane,
|
|
1256
|
+
searchType,
|
|
1257
|
+
searchId,
|
|
1258
|
+
fromDate,
|
|
1259
|
+
toDate,
|
|
1260
|
+
dpIds,
|
|
1261
|
+
orderingCompanyId,
|
|
1262
|
+
stores,
|
|
1263
|
+
salesChannel,
|
|
1264
|
+
requestByExt,
|
|
1265
|
+
pageNo,
|
|
1266
|
+
pageSize,
|
|
1267
|
+
customerId,
|
|
1268
|
+
isPrioritySort,
|
|
1269
|
+
},
|
|
1270
|
+
{ abortEarly: false, allowUnknown: false }
|
|
1271
|
+
);
|
|
1272
|
+
if (warrning) {
|
|
1273
|
+
Logger({
|
|
1274
|
+
level: "WARN",
|
|
1275
|
+
message: "Parameter Validation warrnings for getBulkList",
|
|
1276
|
+
});
|
|
1277
|
+
Logger({ level: "WARN", message: warrning });
|
|
1278
|
+
}
|
|
1279
|
+
|
|
736
1280
|
const query_params = {};
|
|
737
1281
|
query_params["lane"] = lane;
|
|
738
1282
|
query_params["search_type"] = searchType;
|
|
@@ -751,7 +1295,7 @@ class Order {
|
|
|
751
1295
|
|
|
752
1296
|
const xHeaders = {};
|
|
753
1297
|
|
|
754
|
-
|
|
1298
|
+
const response = await PlatformAPIClient.execute(
|
|
755
1299
|
this.config,
|
|
756
1300
|
"get",
|
|
757
1301
|
`/service/platform/orders/v1.0/company/${this.config.companyId}/bulk-action/listing`,
|
|
@@ -759,16 +1303,34 @@ class Order {
|
|
|
759
1303
|
undefined,
|
|
760
1304
|
xHeaders
|
|
761
1305
|
);
|
|
1306
|
+
|
|
1307
|
+
const {
|
|
1308
|
+
error: res_error,
|
|
1309
|
+
} = OrderModel.BulkListingResponse().validate(response, {
|
|
1310
|
+
abortEarly: false,
|
|
1311
|
+
allowUnknown: false,
|
|
1312
|
+
});
|
|
1313
|
+
|
|
1314
|
+
if (res_error) {
|
|
1315
|
+
Logger({
|
|
1316
|
+
level: "WARN",
|
|
1317
|
+
message: "Response Validation Warnnings for getBulkList",
|
|
1318
|
+
});
|
|
1319
|
+
Logger({ level: "WARN", message: res_error });
|
|
1320
|
+
}
|
|
1321
|
+
|
|
1322
|
+
return response;
|
|
762
1323
|
}
|
|
763
1324
|
|
|
764
1325
|
/**
|
|
765
1326
|
* @param {Object} arg - Arg object.
|
|
766
1327
|
* @param {string} arg.batchId -
|
|
767
1328
|
* @param {string} [arg.reportType] -
|
|
1329
|
+
* @returns {Promise<FileResponse>} - Success response
|
|
768
1330
|
* @summary:
|
|
769
1331
|
* @description:
|
|
770
1332
|
*/
|
|
771
|
-
getBulkActionFailedReport({ batchId, reportType } = {}) {
|
|
1333
|
+
async getBulkActionFailedReport({ batchId, reportType } = {}) {
|
|
772
1334
|
const { error } = OrderValidator.getBulkActionFailedReport().validate(
|
|
773
1335
|
{
|
|
774
1336
|
batchId,
|
|
@@ -780,13 +1342,31 @@ class Order {
|
|
|
780
1342
|
return Promise.reject(new FDKClientValidationError(error));
|
|
781
1343
|
}
|
|
782
1344
|
|
|
1345
|
+
// Showing warrnings if extra unknown parameters are found
|
|
1346
|
+
const {
|
|
1347
|
+
error: warrning,
|
|
1348
|
+
} = OrderValidator.getBulkActionFailedReport().validate(
|
|
1349
|
+
{
|
|
1350
|
+
batchId,
|
|
1351
|
+
reportType,
|
|
1352
|
+
},
|
|
1353
|
+
{ abortEarly: false, allowUnknown: false }
|
|
1354
|
+
);
|
|
1355
|
+
if (warrning) {
|
|
1356
|
+
Logger({
|
|
1357
|
+
level: "WARN",
|
|
1358
|
+
message: "Parameter Validation warrnings for getBulkActionFailedReport",
|
|
1359
|
+
});
|
|
1360
|
+
Logger({ level: "WARN", message: warrning });
|
|
1361
|
+
}
|
|
1362
|
+
|
|
783
1363
|
const query_params = {};
|
|
784
1364
|
query_params["batch_id"] = batchId;
|
|
785
1365
|
query_params["report_type"] = reportType;
|
|
786
1366
|
|
|
787
1367
|
const xHeaders = {};
|
|
788
1368
|
|
|
789
|
-
|
|
1369
|
+
const response = await PlatformAPIClient.execute(
|
|
790
1370
|
this.config,
|
|
791
1371
|
"get",
|
|
792
1372
|
`/service/platform/orders/v1.0/company/${this.config.companyId}/bulk-action-failed-report/`,
|
|
@@ -794,6 +1374,21 @@ class Order {
|
|
|
794
1374
|
undefined,
|
|
795
1375
|
xHeaders
|
|
796
1376
|
);
|
|
1377
|
+
|
|
1378
|
+
const { error: res_error } = OrderModel.FileResponse().validate(response, {
|
|
1379
|
+
abortEarly: false,
|
|
1380
|
+
allowUnknown: false,
|
|
1381
|
+
});
|
|
1382
|
+
|
|
1383
|
+
if (res_error) {
|
|
1384
|
+
Logger({
|
|
1385
|
+
level: "WARN",
|
|
1386
|
+
message: "Response Validation Warnnings for getBulkActionFailedReport",
|
|
1387
|
+
});
|
|
1388
|
+
Logger({ level: "WARN", message: res_error });
|
|
1389
|
+
}
|
|
1390
|
+
|
|
1391
|
+
return response;
|
|
797
1392
|
}
|
|
798
1393
|
|
|
799
1394
|
/**
|
|
@@ -804,10 +1399,11 @@ class Order {
|
|
|
804
1399
|
* @param {string} arg.bagId - ID of the bag. An order may contain multiple
|
|
805
1400
|
* items and may get divided into one or more shipment, each having its own ID.
|
|
806
1401
|
* @param {string} arg.state - State for which reasons are required.
|
|
1402
|
+
* @returns {Promise<PlatformShipmentReasonsResponse>} - Success response
|
|
807
1403
|
* @summary: Get reasons behind full or partial cancellation of a shipment
|
|
808
1404
|
* @description: Use this API to retrieve the issues that led to the cancellation of bags within a shipment.
|
|
809
1405
|
*/
|
|
810
|
-
getShipmentReasons({ shipmentId, bagId, state } = {}) {
|
|
1406
|
+
async getShipmentReasons({ shipmentId, bagId, state } = {}) {
|
|
811
1407
|
const { error } = OrderValidator.getShipmentReasons().validate(
|
|
812
1408
|
{
|
|
813
1409
|
shipmentId,
|
|
@@ -820,11 +1416,28 @@ class Order {
|
|
|
820
1416
|
return Promise.reject(new FDKClientValidationError(error));
|
|
821
1417
|
}
|
|
822
1418
|
|
|
1419
|
+
// Showing warrnings if extra unknown parameters are found
|
|
1420
|
+
const { error: warrning } = OrderValidator.getShipmentReasons().validate(
|
|
1421
|
+
{
|
|
1422
|
+
shipmentId,
|
|
1423
|
+
bagId,
|
|
1424
|
+
state,
|
|
1425
|
+
},
|
|
1426
|
+
{ abortEarly: false, allowUnknown: false }
|
|
1427
|
+
);
|
|
1428
|
+
if (warrning) {
|
|
1429
|
+
Logger({
|
|
1430
|
+
level: "WARN",
|
|
1431
|
+
message: "Parameter Validation warrnings for getShipmentReasons",
|
|
1432
|
+
});
|
|
1433
|
+
Logger({ level: "WARN", message: warrning });
|
|
1434
|
+
}
|
|
1435
|
+
|
|
823
1436
|
const query_params = {};
|
|
824
1437
|
|
|
825
1438
|
const xHeaders = {};
|
|
826
1439
|
|
|
827
|
-
|
|
1440
|
+
const response = await PlatformAPIClient.execute(
|
|
828
1441
|
this.config,
|
|
829
1442
|
"get",
|
|
830
1443
|
`/service/platform/orders/v1.0/company/${this.config.companyId}/shipments/${shipmentId}/bags/${bagId}/state/${state}/reasons`,
|
|
@@ -832,15 +1445,33 @@ class Order {
|
|
|
832
1445
|
undefined,
|
|
833
1446
|
xHeaders
|
|
834
1447
|
);
|
|
1448
|
+
|
|
1449
|
+
const {
|
|
1450
|
+
error: res_error,
|
|
1451
|
+
} = OrderModel.PlatformShipmentReasonsResponse().validate(response, {
|
|
1452
|
+
abortEarly: false,
|
|
1453
|
+
allowUnknown: false,
|
|
1454
|
+
});
|
|
1455
|
+
|
|
1456
|
+
if (res_error) {
|
|
1457
|
+
Logger({
|
|
1458
|
+
level: "WARN",
|
|
1459
|
+
message: "Response Validation Warnnings for getShipmentReasons",
|
|
1460
|
+
});
|
|
1461
|
+
Logger({ level: "WARN", message: res_error });
|
|
1462
|
+
}
|
|
1463
|
+
|
|
1464
|
+
return response;
|
|
835
1465
|
}
|
|
836
1466
|
|
|
837
1467
|
/**
|
|
838
1468
|
* @param {Object} arg - Arg object.
|
|
839
1469
|
* @param {BulkActionPayload} arg.body
|
|
1470
|
+
* @returns {Promise<BulkActionResponse>} - Success response
|
|
840
1471
|
* @summary: emits uuid to kafka topic.
|
|
841
1472
|
* @description: Use this API to start processing Xlsx file.
|
|
842
1473
|
*/
|
|
843
|
-
bulkActionProcessXlsxFile({ body } = {}) {
|
|
1474
|
+
async bulkActionProcessXlsxFile({ body } = {}) {
|
|
844
1475
|
const { error } = OrderValidator.bulkActionProcessXlsxFile().validate(
|
|
845
1476
|
{
|
|
846
1477
|
body,
|
|
@@ -851,11 +1482,28 @@ class Order {
|
|
|
851
1482
|
return Promise.reject(new FDKClientValidationError(error));
|
|
852
1483
|
}
|
|
853
1484
|
|
|
1485
|
+
// Showing warrnings if extra unknown parameters are found
|
|
1486
|
+
const {
|
|
1487
|
+
error: warrning,
|
|
1488
|
+
} = OrderValidator.bulkActionProcessXlsxFile().validate(
|
|
1489
|
+
{
|
|
1490
|
+
body,
|
|
1491
|
+
},
|
|
1492
|
+
{ abortEarly: false, allowUnknown: false }
|
|
1493
|
+
);
|
|
1494
|
+
if (warrning) {
|
|
1495
|
+
Logger({
|
|
1496
|
+
level: "WARN",
|
|
1497
|
+
message: "Parameter Validation warrnings for bulkActionProcessXlsxFile",
|
|
1498
|
+
});
|
|
1499
|
+
Logger({ level: "WARN", message: warrning });
|
|
1500
|
+
}
|
|
1501
|
+
|
|
854
1502
|
const query_params = {};
|
|
855
1503
|
|
|
856
1504
|
const xHeaders = {};
|
|
857
1505
|
|
|
858
|
-
|
|
1506
|
+
const response = await PlatformAPIClient.execute(
|
|
859
1507
|
this.config,
|
|
860
1508
|
"post",
|
|
861
1509
|
`/service/platform/orders/v2.0/company/${this.config.companyId}/bulk-action/`,
|
|
@@ -863,15 +1511,33 @@ class Order {
|
|
|
863
1511
|
body,
|
|
864
1512
|
xHeaders
|
|
865
1513
|
);
|
|
1514
|
+
|
|
1515
|
+
const {
|
|
1516
|
+
error: res_error,
|
|
1517
|
+
} = OrderModel.BulkActionResponse().validate(response, {
|
|
1518
|
+
abortEarly: false,
|
|
1519
|
+
allowUnknown: false,
|
|
1520
|
+
});
|
|
1521
|
+
|
|
1522
|
+
if (res_error) {
|
|
1523
|
+
Logger({
|
|
1524
|
+
level: "WARN",
|
|
1525
|
+
message: "Response Validation Warnnings for bulkActionProcessXlsxFile",
|
|
1526
|
+
});
|
|
1527
|
+
Logger({ level: "WARN", message: res_error });
|
|
1528
|
+
}
|
|
1529
|
+
|
|
1530
|
+
return response;
|
|
866
1531
|
}
|
|
867
1532
|
|
|
868
1533
|
/**
|
|
869
1534
|
* @param {Object} arg - Arg object.
|
|
870
1535
|
* @param {string} arg.batchId -
|
|
1536
|
+
* @returns {Promise<BulkActionDetailsResponse>} - Success response
|
|
871
1537
|
* @summary: Returns failed, processing and successfully processed shipments.
|
|
872
1538
|
* @description: Returns failed, processing and successfully processed shipments along with their counts and failed reasons.
|
|
873
1539
|
*/
|
|
874
|
-
bulkActionDetails({ batchId } = {}) {
|
|
1540
|
+
async bulkActionDetails({ batchId } = {}) {
|
|
875
1541
|
const { error } = OrderValidator.bulkActionDetails().validate(
|
|
876
1542
|
{
|
|
877
1543
|
batchId,
|
|
@@ -882,11 +1548,26 @@ class Order {
|
|
|
882
1548
|
return Promise.reject(new FDKClientValidationError(error));
|
|
883
1549
|
}
|
|
884
1550
|
|
|
1551
|
+
// Showing warrnings if extra unknown parameters are found
|
|
1552
|
+
const { error: warrning } = OrderValidator.bulkActionDetails().validate(
|
|
1553
|
+
{
|
|
1554
|
+
batchId,
|
|
1555
|
+
},
|
|
1556
|
+
{ abortEarly: false, allowUnknown: false }
|
|
1557
|
+
);
|
|
1558
|
+
if (warrning) {
|
|
1559
|
+
Logger({
|
|
1560
|
+
level: "WARN",
|
|
1561
|
+
message: "Parameter Validation warrnings for bulkActionDetails",
|
|
1562
|
+
});
|
|
1563
|
+
Logger({ level: "WARN", message: warrning });
|
|
1564
|
+
}
|
|
1565
|
+
|
|
885
1566
|
const query_params = {};
|
|
886
1567
|
|
|
887
1568
|
const xHeaders = {};
|
|
888
1569
|
|
|
889
|
-
|
|
1570
|
+
const response = await PlatformAPIClient.execute(
|
|
890
1571
|
this.config,
|
|
891
1572
|
"get",
|
|
892
1573
|
`/service/platform/orders/v2.0/company/${this.config.companyId}/bulk-action/${batchId}`,
|
|
@@ -894,6 +1575,23 @@ class Order {
|
|
|
894
1575
|
undefined,
|
|
895
1576
|
xHeaders
|
|
896
1577
|
);
|
|
1578
|
+
|
|
1579
|
+
const {
|
|
1580
|
+
error: res_error,
|
|
1581
|
+
} = OrderModel.BulkActionDetailsResponse().validate(response, {
|
|
1582
|
+
abortEarly: false,
|
|
1583
|
+
allowUnknown: false,
|
|
1584
|
+
});
|
|
1585
|
+
|
|
1586
|
+
if (res_error) {
|
|
1587
|
+
Logger({
|
|
1588
|
+
level: "WARN",
|
|
1589
|
+
message: "Response Validation Warnnings for bulkActionDetails",
|
|
1590
|
+
});
|
|
1591
|
+
Logger({ level: "WARN", message: res_error });
|
|
1592
|
+
}
|
|
1593
|
+
|
|
1594
|
+
return response;
|
|
897
1595
|
}
|
|
898
1596
|
|
|
899
1597
|
/**
|
|
@@ -901,10 +1599,11 @@ class Order {
|
|
|
901
1599
|
* @param {string} [arg.bagId] -
|
|
902
1600
|
* @param {string} [arg.channelBagId] -
|
|
903
1601
|
* @param {string} [arg.channelId] -
|
|
1602
|
+
* @returns {Promise<BagDetailsPlatformResponse>} - Success response
|
|
904
1603
|
* @summary:
|
|
905
1604
|
* @description:
|
|
906
1605
|
*/
|
|
907
|
-
getBagById({ bagId, channelBagId, channelId } = {}) {
|
|
1606
|
+
async getBagById({ bagId, channelBagId, channelId } = {}) {
|
|
908
1607
|
const { error } = OrderValidator.getBagById().validate(
|
|
909
1608
|
{
|
|
910
1609
|
bagId,
|
|
@@ -917,14 +1616,31 @@ class Order {
|
|
|
917
1616
|
return Promise.reject(new FDKClientValidationError(error));
|
|
918
1617
|
}
|
|
919
1618
|
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
1619
|
+
// Showing warrnings if extra unknown parameters are found
|
|
1620
|
+
const { error: warrning } = OrderValidator.getBagById().validate(
|
|
1621
|
+
{
|
|
1622
|
+
bagId,
|
|
1623
|
+
channelBagId,
|
|
1624
|
+
channelId,
|
|
1625
|
+
},
|
|
1626
|
+
{ abortEarly: false, allowUnknown: false }
|
|
1627
|
+
);
|
|
1628
|
+
if (warrning) {
|
|
1629
|
+
Logger({
|
|
1630
|
+
level: "WARN",
|
|
1631
|
+
message: "Parameter Validation warrnings for getBagById",
|
|
1632
|
+
});
|
|
1633
|
+
Logger({ level: "WARN", message: warrning });
|
|
1634
|
+
}
|
|
1635
|
+
|
|
1636
|
+
const query_params = {};
|
|
1637
|
+
query_params["bag_id"] = bagId;
|
|
1638
|
+
query_params["channel_bag_id"] = channelBagId;
|
|
1639
|
+
query_params["channel_id"] = channelId;
|
|
1640
|
+
|
|
925
1641
|
const xHeaders = {};
|
|
926
1642
|
|
|
927
|
-
|
|
1643
|
+
const response = await PlatformAPIClient.execute(
|
|
928
1644
|
this.config,
|
|
929
1645
|
"get",
|
|
930
1646
|
`/service/platform/orders/v1.0/company/${this.config.companyId}/bag-details/`,
|
|
@@ -932,6 +1648,23 @@ class Order {
|
|
|
932
1648
|
undefined,
|
|
933
1649
|
xHeaders
|
|
934
1650
|
);
|
|
1651
|
+
|
|
1652
|
+
const {
|
|
1653
|
+
error: res_error,
|
|
1654
|
+
} = OrderModel.BagDetailsPlatformResponse().validate(response, {
|
|
1655
|
+
abortEarly: false,
|
|
1656
|
+
allowUnknown: false,
|
|
1657
|
+
});
|
|
1658
|
+
|
|
1659
|
+
if (res_error) {
|
|
1660
|
+
Logger({
|
|
1661
|
+
level: "WARN",
|
|
1662
|
+
message: "Response Validation Warnnings for getBagById",
|
|
1663
|
+
});
|
|
1664
|
+
Logger({ level: "WARN", message: res_error });
|
|
1665
|
+
}
|
|
1666
|
+
|
|
1667
|
+
return response;
|
|
935
1668
|
}
|
|
936
1669
|
|
|
937
1670
|
/**
|
|
@@ -945,10 +1678,11 @@ class Order {
|
|
|
945
1678
|
* @param {string} [arg.channelId] -
|
|
946
1679
|
* @param {number} [arg.pageNo] -
|
|
947
1680
|
* @param {number} [arg.pageSize] -
|
|
1681
|
+
* @returns {Promise<GetBagsPlatformResponse>} - Success response
|
|
948
1682
|
* @summary:
|
|
949
1683
|
* @description:
|
|
950
1684
|
*/
|
|
951
|
-
getBags({
|
|
1685
|
+
async getBags({
|
|
952
1686
|
bagIds,
|
|
953
1687
|
shipmentIds,
|
|
954
1688
|
orderIds,
|
|
@@ -977,6 +1711,29 @@ class Order {
|
|
|
977
1711
|
return Promise.reject(new FDKClientValidationError(error));
|
|
978
1712
|
}
|
|
979
1713
|
|
|
1714
|
+
// Showing warrnings if extra unknown parameters are found
|
|
1715
|
+
const { error: warrning } = OrderValidator.getBags().validate(
|
|
1716
|
+
{
|
|
1717
|
+
bagIds,
|
|
1718
|
+
shipmentIds,
|
|
1719
|
+
orderIds,
|
|
1720
|
+
channelBagIds,
|
|
1721
|
+
channelShipmentIds,
|
|
1722
|
+
channelOrderIds,
|
|
1723
|
+
channelId,
|
|
1724
|
+
pageNo,
|
|
1725
|
+
pageSize,
|
|
1726
|
+
},
|
|
1727
|
+
{ abortEarly: false, allowUnknown: false }
|
|
1728
|
+
);
|
|
1729
|
+
if (warrning) {
|
|
1730
|
+
Logger({
|
|
1731
|
+
level: "WARN",
|
|
1732
|
+
message: "Parameter Validation warrnings for getBags",
|
|
1733
|
+
});
|
|
1734
|
+
Logger({ level: "WARN", message: warrning });
|
|
1735
|
+
}
|
|
1736
|
+
|
|
980
1737
|
const query_params = {};
|
|
981
1738
|
query_params["bag_ids"] = bagIds;
|
|
982
1739
|
query_params["shipment_ids"] = shipmentIds;
|
|
@@ -990,7 +1747,7 @@ class Order {
|
|
|
990
1747
|
|
|
991
1748
|
const xHeaders = {};
|
|
992
1749
|
|
|
993
|
-
|
|
1750
|
+
const response = await PlatformAPIClient.execute(
|
|
994
1751
|
this.config,
|
|
995
1752
|
"get",
|
|
996
1753
|
`/service/platform/orders/v1.0/company/${this.config.companyId}/bags`,
|
|
@@ -998,15 +1755,33 @@ class Order {
|
|
|
998
1755
|
undefined,
|
|
999
1756
|
xHeaders
|
|
1000
1757
|
);
|
|
1758
|
+
|
|
1759
|
+
const {
|
|
1760
|
+
error: res_error,
|
|
1761
|
+
} = OrderModel.GetBagsPlatformResponse().validate(response, {
|
|
1762
|
+
abortEarly: false,
|
|
1763
|
+
allowUnknown: false,
|
|
1764
|
+
});
|
|
1765
|
+
|
|
1766
|
+
if (res_error) {
|
|
1767
|
+
Logger({
|
|
1768
|
+
level: "WARN",
|
|
1769
|
+
message: "Response Validation Warnnings for getBags",
|
|
1770
|
+
});
|
|
1771
|
+
Logger({ level: "WARN", message: res_error });
|
|
1772
|
+
}
|
|
1773
|
+
|
|
1774
|
+
return response;
|
|
1001
1775
|
}
|
|
1002
1776
|
|
|
1003
1777
|
/**
|
|
1004
1778
|
* @param {Object} arg - Arg object.
|
|
1005
1779
|
* @param {InvalidateShipmentCachePayload} arg.body
|
|
1780
|
+
* @returns {Promise<InvalidateShipmentCacheResponse>} - Success response
|
|
1006
1781
|
* @summary:
|
|
1007
1782
|
* @description: Invalidate shipment Cache
|
|
1008
1783
|
*/
|
|
1009
|
-
invalidateShipmentCache({ body } = {}) {
|
|
1784
|
+
async invalidateShipmentCache({ body } = {}) {
|
|
1010
1785
|
const { error } = OrderValidator.invalidateShipmentCache().validate(
|
|
1011
1786
|
{
|
|
1012
1787
|
body,
|
|
@@ -1017,11 +1792,28 @@ class Order {
|
|
|
1017
1792
|
return Promise.reject(new FDKClientValidationError(error));
|
|
1018
1793
|
}
|
|
1019
1794
|
|
|
1795
|
+
// Showing warrnings if extra unknown parameters are found
|
|
1796
|
+
const {
|
|
1797
|
+
error: warrning,
|
|
1798
|
+
} = OrderValidator.invalidateShipmentCache().validate(
|
|
1799
|
+
{
|
|
1800
|
+
body,
|
|
1801
|
+
},
|
|
1802
|
+
{ abortEarly: false, allowUnknown: false }
|
|
1803
|
+
);
|
|
1804
|
+
if (warrning) {
|
|
1805
|
+
Logger({
|
|
1806
|
+
level: "WARN",
|
|
1807
|
+
message: "Parameter Validation warrnings for invalidateShipmentCache",
|
|
1808
|
+
});
|
|
1809
|
+
Logger({ level: "WARN", message: warrning });
|
|
1810
|
+
}
|
|
1811
|
+
|
|
1020
1812
|
const query_params = {};
|
|
1021
1813
|
|
|
1022
1814
|
const xHeaders = {};
|
|
1023
1815
|
|
|
1024
|
-
|
|
1816
|
+
const response = await PlatformAPIClient.execute(
|
|
1025
1817
|
this.config,
|
|
1026
1818
|
"put",
|
|
1027
1819
|
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/update-cache`,
|
|
@@ -1029,15 +1821,33 @@ class Order {
|
|
|
1029
1821
|
body,
|
|
1030
1822
|
xHeaders
|
|
1031
1823
|
);
|
|
1824
|
+
|
|
1825
|
+
const {
|
|
1826
|
+
error: res_error,
|
|
1827
|
+
} = OrderModel.InvalidateShipmentCacheResponse().validate(response, {
|
|
1828
|
+
abortEarly: false,
|
|
1829
|
+
allowUnknown: false,
|
|
1830
|
+
});
|
|
1831
|
+
|
|
1832
|
+
if (res_error) {
|
|
1833
|
+
Logger({
|
|
1834
|
+
level: "WARN",
|
|
1835
|
+
message: "Response Validation Warnnings for invalidateShipmentCache",
|
|
1836
|
+
});
|
|
1837
|
+
Logger({ level: "WARN", message: res_error });
|
|
1838
|
+
}
|
|
1839
|
+
|
|
1840
|
+
return response;
|
|
1032
1841
|
}
|
|
1033
1842
|
|
|
1034
1843
|
/**
|
|
1035
1844
|
* @param {Object} arg - Arg object.
|
|
1036
1845
|
* @param {StoreReassign} arg.body
|
|
1846
|
+
* @returns {Promise<StoreReassignResponse>} - Success response
|
|
1037
1847
|
* @summary:
|
|
1038
1848
|
* @description: Reassign Location
|
|
1039
1849
|
*/
|
|
1040
|
-
reassignLocation({ body } = {}) {
|
|
1850
|
+
async reassignLocation({ body } = {}) {
|
|
1041
1851
|
const { error } = OrderValidator.reassignLocation().validate(
|
|
1042
1852
|
{
|
|
1043
1853
|
body,
|
|
@@ -1048,11 +1858,26 @@ class Order {
|
|
|
1048
1858
|
return Promise.reject(new FDKClientValidationError(error));
|
|
1049
1859
|
}
|
|
1050
1860
|
|
|
1861
|
+
// Showing warrnings if extra unknown parameters are found
|
|
1862
|
+
const { error: warrning } = OrderValidator.reassignLocation().validate(
|
|
1863
|
+
{
|
|
1864
|
+
body,
|
|
1865
|
+
},
|
|
1866
|
+
{ abortEarly: false, allowUnknown: false }
|
|
1867
|
+
);
|
|
1868
|
+
if (warrning) {
|
|
1869
|
+
Logger({
|
|
1870
|
+
level: "WARN",
|
|
1871
|
+
message: "Parameter Validation warrnings for reassignLocation",
|
|
1872
|
+
});
|
|
1873
|
+
Logger({ level: "WARN", message: warrning });
|
|
1874
|
+
}
|
|
1875
|
+
|
|
1051
1876
|
const query_params = {};
|
|
1052
1877
|
|
|
1053
1878
|
const xHeaders = {};
|
|
1054
1879
|
|
|
1055
|
-
|
|
1880
|
+
const response = await PlatformAPIClient.execute(
|
|
1056
1881
|
this.config,
|
|
1057
1882
|
"post",
|
|
1058
1883
|
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/store/reassign-internal`,
|
|
@@ -1060,15 +1885,33 @@ class Order {
|
|
|
1060
1885
|
body,
|
|
1061
1886
|
xHeaders
|
|
1062
1887
|
);
|
|
1888
|
+
|
|
1889
|
+
const {
|
|
1890
|
+
error: res_error,
|
|
1891
|
+
} = OrderModel.StoreReassignResponse().validate(response, {
|
|
1892
|
+
abortEarly: false,
|
|
1893
|
+
allowUnknown: false,
|
|
1894
|
+
});
|
|
1895
|
+
|
|
1896
|
+
if (res_error) {
|
|
1897
|
+
Logger({
|
|
1898
|
+
level: "WARN",
|
|
1899
|
+
message: "Response Validation Warnnings for reassignLocation",
|
|
1900
|
+
});
|
|
1901
|
+
Logger({ level: "WARN", message: res_error });
|
|
1902
|
+
}
|
|
1903
|
+
|
|
1904
|
+
return response;
|
|
1063
1905
|
}
|
|
1064
1906
|
|
|
1065
1907
|
/**
|
|
1066
1908
|
* @param {Object} arg - Arg object.
|
|
1067
1909
|
* @param {UpdateShipmentLockPayload} arg.body
|
|
1910
|
+
* @returns {Promise<UpdateShipmentLockResponse>} - Success response
|
|
1068
1911
|
* @summary:
|
|
1069
1912
|
* @description: update shipment lock
|
|
1070
1913
|
*/
|
|
1071
|
-
updateShipmentLock({ body } = {}) {
|
|
1914
|
+
async updateShipmentLock({ body } = {}) {
|
|
1072
1915
|
const { error } = OrderValidator.updateShipmentLock().validate(
|
|
1073
1916
|
{
|
|
1074
1917
|
body,
|
|
@@ -1079,11 +1922,26 @@ class Order {
|
|
|
1079
1922
|
return Promise.reject(new FDKClientValidationError(error));
|
|
1080
1923
|
}
|
|
1081
1924
|
|
|
1925
|
+
// Showing warrnings if extra unknown parameters are found
|
|
1926
|
+
const { error: warrning } = OrderValidator.updateShipmentLock().validate(
|
|
1927
|
+
{
|
|
1928
|
+
body,
|
|
1929
|
+
},
|
|
1930
|
+
{ abortEarly: false, allowUnknown: false }
|
|
1931
|
+
);
|
|
1932
|
+
if (warrning) {
|
|
1933
|
+
Logger({
|
|
1934
|
+
level: "WARN",
|
|
1935
|
+
message: "Parameter Validation warrnings for updateShipmentLock",
|
|
1936
|
+
});
|
|
1937
|
+
Logger({ level: "WARN", message: warrning });
|
|
1938
|
+
}
|
|
1939
|
+
|
|
1082
1940
|
const query_params = {};
|
|
1083
1941
|
|
|
1084
1942
|
const xHeaders = {};
|
|
1085
1943
|
|
|
1086
|
-
|
|
1944
|
+
const response = await PlatformAPIClient.execute(
|
|
1087
1945
|
this.config,
|
|
1088
1946
|
"post",
|
|
1089
1947
|
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/entity/lock-manager`,
|
|
@@ -1091,15 +1949,33 @@ class Order {
|
|
|
1091
1949
|
body,
|
|
1092
1950
|
xHeaders
|
|
1093
1951
|
);
|
|
1952
|
+
|
|
1953
|
+
const {
|
|
1954
|
+
error: res_error,
|
|
1955
|
+
} = OrderModel.UpdateShipmentLockResponse().validate(response, {
|
|
1956
|
+
abortEarly: false,
|
|
1957
|
+
allowUnknown: false,
|
|
1958
|
+
});
|
|
1959
|
+
|
|
1960
|
+
if (res_error) {
|
|
1961
|
+
Logger({
|
|
1962
|
+
level: "WARN",
|
|
1963
|
+
message: "Response Validation Warnnings for updateShipmentLock",
|
|
1964
|
+
});
|
|
1965
|
+
Logger({ level: "WARN", message: res_error });
|
|
1966
|
+
}
|
|
1967
|
+
|
|
1968
|
+
return response;
|
|
1094
1969
|
}
|
|
1095
1970
|
|
|
1096
1971
|
/**
|
|
1097
1972
|
* @param {Object} arg - Arg object.
|
|
1098
1973
|
* @param {string} [arg.date] -
|
|
1974
|
+
* @returns {Promise<AnnouncementsResponse>} - Success response
|
|
1099
1975
|
* @summary:
|
|
1100
1976
|
* @description:
|
|
1101
1977
|
*/
|
|
1102
|
-
getAnnouncements({ date } = {}) {
|
|
1978
|
+
async getAnnouncements({ date } = {}) {
|
|
1103
1979
|
const { error } = OrderValidator.getAnnouncements().validate(
|
|
1104
1980
|
{
|
|
1105
1981
|
date,
|
|
@@ -1110,12 +1986,27 @@ class Order {
|
|
|
1110
1986
|
return Promise.reject(new FDKClientValidationError(error));
|
|
1111
1987
|
}
|
|
1112
1988
|
|
|
1989
|
+
// Showing warrnings if extra unknown parameters are found
|
|
1990
|
+
const { error: warrning } = OrderValidator.getAnnouncements().validate(
|
|
1991
|
+
{
|
|
1992
|
+
date,
|
|
1993
|
+
},
|
|
1994
|
+
{ abortEarly: false, allowUnknown: false }
|
|
1995
|
+
);
|
|
1996
|
+
if (warrning) {
|
|
1997
|
+
Logger({
|
|
1998
|
+
level: "WARN",
|
|
1999
|
+
message: "Parameter Validation warrnings for getAnnouncements",
|
|
2000
|
+
});
|
|
2001
|
+
Logger({ level: "WARN", message: warrning });
|
|
2002
|
+
}
|
|
2003
|
+
|
|
1113
2004
|
const query_params = {};
|
|
1114
2005
|
query_params["date"] = date;
|
|
1115
2006
|
|
|
1116
2007
|
const xHeaders = {};
|
|
1117
2008
|
|
|
1118
|
-
|
|
2009
|
+
const response = await PlatformAPIClient.execute(
|
|
1119
2010
|
this.config,
|
|
1120
2011
|
"get",
|
|
1121
2012
|
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/announcements`,
|
|
@@ -1123,6 +2014,23 @@ class Order {
|
|
|
1123
2014
|
undefined,
|
|
1124
2015
|
xHeaders
|
|
1125
2016
|
);
|
|
2017
|
+
|
|
2018
|
+
const {
|
|
2019
|
+
error: res_error,
|
|
2020
|
+
} = OrderModel.AnnouncementsResponse().validate(response, {
|
|
2021
|
+
abortEarly: false,
|
|
2022
|
+
allowUnknown: false,
|
|
2023
|
+
});
|
|
2024
|
+
|
|
2025
|
+
if (res_error) {
|
|
2026
|
+
Logger({
|
|
2027
|
+
level: "WARN",
|
|
2028
|
+
message: "Response Validation Warnnings for getAnnouncements",
|
|
2029
|
+
});
|
|
2030
|
+
Logger({ level: "WARN", message: res_error });
|
|
2031
|
+
}
|
|
2032
|
+
|
|
2033
|
+
return response;
|
|
1126
2034
|
}
|
|
1127
2035
|
|
|
1128
2036
|
/**
|
|
@@ -1139,10 +2047,11 @@ class Order {
|
|
|
1139
2047
|
* @param {string} [arg.city] -
|
|
1140
2048
|
* @param {string} [arg.state] -
|
|
1141
2049
|
* @param {string} [arg.country] -
|
|
2050
|
+
* @returns {Promise<BaseResponse>} - Success response
|
|
1142
2051
|
* @summary:
|
|
1143
2052
|
* @description:
|
|
1144
2053
|
*/
|
|
1145
|
-
updateAddress({
|
|
2054
|
+
async updateAddress({
|
|
1146
2055
|
shipmentId,
|
|
1147
2056
|
addressCategory,
|
|
1148
2057
|
name,
|
|
@@ -1177,6 +2086,32 @@ class Order {
|
|
|
1177
2086
|
return Promise.reject(new FDKClientValidationError(error));
|
|
1178
2087
|
}
|
|
1179
2088
|
|
|
2089
|
+
// Showing warrnings if extra unknown parameters are found
|
|
2090
|
+
const { error: warrning } = OrderValidator.updateAddress().validate(
|
|
2091
|
+
{
|
|
2092
|
+
shipmentId,
|
|
2093
|
+
addressCategory,
|
|
2094
|
+
name,
|
|
2095
|
+
address,
|
|
2096
|
+
addressType,
|
|
2097
|
+
pincode,
|
|
2098
|
+
phone,
|
|
2099
|
+
email,
|
|
2100
|
+
landmark,
|
|
2101
|
+
city,
|
|
2102
|
+
state,
|
|
2103
|
+
country,
|
|
2104
|
+
},
|
|
2105
|
+
{ abortEarly: false, allowUnknown: false }
|
|
2106
|
+
);
|
|
2107
|
+
if (warrning) {
|
|
2108
|
+
Logger({
|
|
2109
|
+
level: "WARN",
|
|
2110
|
+
message: "Parameter Validation warrnings for updateAddress",
|
|
2111
|
+
});
|
|
2112
|
+
Logger({ level: "WARN", message: warrning });
|
|
2113
|
+
}
|
|
2114
|
+
|
|
1180
2115
|
const query_params = {};
|
|
1181
2116
|
query_params["shipment_id"] = shipmentId;
|
|
1182
2117
|
query_params["name"] = name;
|
|
@@ -1193,7 +2128,7 @@ class Order {
|
|
|
1193
2128
|
|
|
1194
2129
|
const xHeaders = {};
|
|
1195
2130
|
|
|
1196
|
-
|
|
2131
|
+
const response = await PlatformAPIClient.execute(
|
|
1197
2132
|
this.config,
|
|
1198
2133
|
"post",
|
|
1199
2134
|
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/delight/update-address`,
|
|
@@ -1201,6 +2136,21 @@ class Order {
|
|
|
1201
2136
|
undefined,
|
|
1202
2137
|
xHeaders
|
|
1203
2138
|
);
|
|
2139
|
+
|
|
2140
|
+
const { error: res_error } = OrderModel.BaseResponse().validate(response, {
|
|
2141
|
+
abortEarly: false,
|
|
2142
|
+
allowUnknown: false,
|
|
2143
|
+
});
|
|
2144
|
+
|
|
2145
|
+
if (res_error) {
|
|
2146
|
+
Logger({
|
|
2147
|
+
level: "WARN",
|
|
2148
|
+
message: "Response Validation Warnnings for updateAddress",
|
|
2149
|
+
});
|
|
2150
|
+
Logger({ level: "WARN", message: res_error });
|
|
2151
|
+
}
|
|
2152
|
+
|
|
2153
|
+
return response;
|
|
1204
2154
|
}
|
|
1205
2155
|
|
|
1206
2156
|
/**
|
|
@@ -1210,10 +2160,11 @@ class Order {
|
|
|
1210
2160
|
* @param {string} arg.bagId -
|
|
1211
2161
|
* @param {string} [arg.callingTo] -
|
|
1212
2162
|
* @param {string} [arg.callerId] -
|
|
2163
|
+
* @returns {Promise<Click2CallResponse>} - Success response
|
|
1213
2164
|
* @summary:
|
|
1214
2165
|
* @description:
|
|
1215
2166
|
*/
|
|
1216
|
-
click2Call({ caller, receiver, bagId, callingTo, callerId } = {}) {
|
|
2167
|
+
async click2Call({ caller, receiver, bagId, callingTo, callerId } = {}) {
|
|
1217
2168
|
const { error } = OrderValidator.click2Call().validate(
|
|
1218
2169
|
{
|
|
1219
2170
|
caller,
|
|
@@ -1228,6 +2179,25 @@ class Order {
|
|
|
1228
2179
|
return Promise.reject(new FDKClientValidationError(error));
|
|
1229
2180
|
}
|
|
1230
2181
|
|
|
2182
|
+
// Showing warrnings if extra unknown parameters are found
|
|
2183
|
+
const { error: warrning } = OrderValidator.click2Call().validate(
|
|
2184
|
+
{
|
|
2185
|
+
caller,
|
|
2186
|
+
receiver,
|
|
2187
|
+
bagId,
|
|
2188
|
+
callingTo,
|
|
2189
|
+
callerId,
|
|
2190
|
+
},
|
|
2191
|
+
{ abortEarly: false, allowUnknown: false }
|
|
2192
|
+
);
|
|
2193
|
+
if (warrning) {
|
|
2194
|
+
Logger({
|
|
2195
|
+
level: "WARN",
|
|
2196
|
+
message: "Parameter Validation warrnings for click2Call",
|
|
2197
|
+
});
|
|
2198
|
+
Logger({ level: "WARN", message: warrning });
|
|
2199
|
+
}
|
|
2200
|
+
|
|
1231
2201
|
const query_params = {};
|
|
1232
2202
|
query_params["caller"] = caller;
|
|
1233
2203
|
query_params["receiver"] = receiver;
|
|
@@ -1237,7 +2207,7 @@ class Order {
|
|
|
1237
2207
|
|
|
1238
2208
|
const xHeaders = {};
|
|
1239
2209
|
|
|
1240
|
-
|
|
2210
|
+
const response = await PlatformAPIClient.execute(
|
|
1241
2211
|
this.config,
|
|
1242
2212
|
"get",
|
|
1243
2213
|
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/ninja/click2call`,
|
|
@@ -1245,15 +2215,33 @@ class Order {
|
|
|
1245
2215
|
undefined,
|
|
1246
2216
|
xHeaders
|
|
1247
2217
|
);
|
|
2218
|
+
|
|
2219
|
+
const {
|
|
2220
|
+
error: res_error,
|
|
2221
|
+
} = OrderModel.Click2CallResponse().validate(response, {
|
|
2222
|
+
abortEarly: false,
|
|
2223
|
+
allowUnknown: false,
|
|
2224
|
+
});
|
|
2225
|
+
|
|
2226
|
+
if (res_error) {
|
|
2227
|
+
Logger({
|
|
2228
|
+
level: "WARN",
|
|
2229
|
+
message: "Response Validation Warnnings for click2Call",
|
|
2230
|
+
});
|
|
2231
|
+
Logger({ level: "WARN", message: res_error });
|
|
2232
|
+
}
|
|
2233
|
+
|
|
2234
|
+
return response;
|
|
1248
2235
|
}
|
|
1249
2236
|
|
|
1250
2237
|
/**
|
|
1251
2238
|
* @param {Object} arg - Arg object.
|
|
1252
2239
|
* @param {UpdateShipmentStatusRequest} arg.body
|
|
2240
|
+
* @returns {Promise<UpdateShipmentStatusResponseBody>} - Success response
|
|
1253
2241
|
* @summary:
|
|
1254
2242
|
* @description: Update shipment status
|
|
1255
2243
|
*/
|
|
1256
|
-
updateShipmentStatus({ body } = {}) {
|
|
2244
|
+
async updateShipmentStatus({ body } = {}) {
|
|
1257
2245
|
const { error } = OrderValidator.updateShipmentStatus().validate(
|
|
1258
2246
|
{
|
|
1259
2247
|
body,
|
|
@@ -1264,11 +2252,26 @@ class Order {
|
|
|
1264
2252
|
return Promise.reject(new FDKClientValidationError(error));
|
|
1265
2253
|
}
|
|
1266
2254
|
|
|
2255
|
+
// Showing warrnings if extra unknown parameters are found
|
|
2256
|
+
const { error: warrning } = OrderValidator.updateShipmentStatus().validate(
|
|
2257
|
+
{
|
|
2258
|
+
body,
|
|
2259
|
+
},
|
|
2260
|
+
{ abortEarly: false, allowUnknown: false }
|
|
2261
|
+
);
|
|
2262
|
+
if (warrning) {
|
|
2263
|
+
Logger({
|
|
2264
|
+
level: "WARN",
|
|
2265
|
+
message: "Parameter Validation warrnings for updateShipmentStatus",
|
|
2266
|
+
});
|
|
2267
|
+
Logger({ level: "WARN", message: warrning });
|
|
2268
|
+
}
|
|
2269
|
+
|
|
1267
2270
|
const query_params = {};
|
|
1268
2271
|
|
|
1269
2272
|
const xHeaders = {};
|
|
1270
2273
|
|
|
1271
|
-
|
|
2274
|
+
const response = await PlatformAPIClient.execute(
|
|
1272
2275
|
this.config,
|
|
1273
2276
|
"put",
|
|
1274
2277
|
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/shipment/status-internal`,
|
|
@@ -1276,15 +2279,33 @@ class Order {
|
|
|
1276
2279
|
body,
|
|
1277
2280
|
xHeaders
|
|
1278
2281
|
);
|
|
2282
|
+
|
|
2283
|
+
const {
|
|
2284
|
+
error: res_error,
|
|
2285
|
+
} = OrderModel.UpdateShipmentStatusResponseBody().validate(response, {
|
|
2286
|
+
abortEarly: false,
|
|
2287
|
+
allowUnknown: false,
|
|
2288
|
+
});
|
|
2289
|
+
|
|
2290
|
+
if (res_error) {
|
|
2291
|
+
Logger({
|
|
2292
|
+
level: "WARN",
|
|
2293
|
+
message: "Response Validation Warnnings for updateShipmentStatus",
|
|
2294
|
+
});
|
|
2295
|
+
Logger({ level: "WARN", message: res_error });
|
|
2296
|
+
}
|
|
2297
|
+
|
|
2298
|
+
return response;
|
|
1279
2299
|
}
|
|
1280
2300
|
|
|
1281
2301
|
/**
|
|
1282
2302
|
* @param {Object} arg - Arg object.
|
|
1283
2303
|
* @param {CreateOrderPayload} arg.body
|
|
2304
|
+
* @returns {Promise<CreateOrderResponse>} - Success response
|
|
1284
2305
|
* @summary:
|
|
1285
2306
|
* @description:
|
|
1286
2307
|
*/
|
|
1287
|
-
processManifest({ body } = {}) {
|
|
2308
|
+
async processManifest({ body } = {}) {
|
|
1288
2309
|
const { error } = OrderValidator.processManifest().validate(
|
|
1289
2310
|
{
|
|
1290
2311
|
body,
|
|
@@ -1295,11 +2316,26 @@ class Order {
|
|
|
1295
2316
|
return Promise.reject(new FDKClientValidationError(error));
|
|
1296
2317
|
}
|
|
1297
2318
|
|
|
2319
|
+
// Showing warrnings if extra unknown parameters are found
|
|
2320
|
+
const { error: warrning } = OrderValidator.processManifest().validate(
|
|
2321
|
+
{
|
|
2322
|
+
body,
|
|
2323
|
+
},
|
|
2324
|
+
{ abortEarly: false, allowUnknown: false }
|
|
2325
|
+
);
|
|
2326
|
+
if (warrning) {
|
|
2327
|
+
Logger({
|
|
2328
|
+
level: "WARN",
|
|
2329
|
+
message: "Parameter Validation warrnings for processManifest",
|
|
2330
|
+
});
|
|
2331
|
+
Logger({ level: "WARN", message: warrning });
|
|
2332
|
+
}
|
|
2333
|
+
|
|
1298
2334
|
const query_params = {};
|
|
1299
2335
|
|
|
1300
2336
|
const xHeaders = {};
|
|
1301
2337
|
|
|
1302
|
-
|
|
2338
|
+
const response = await PlatformAPIClient.execute(
|
|
1303
2339
|
this.config,
|
|
1304
2340
|
"post",
|
|
1305
2341
|
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/process-manifest`,
|
|
@@ -1307,15 +2343,33 @@ class Order {
|
|
|
1307
2343
|
body,
|
|
1308
2344
|
xHeaders
|
|
1309
2345
|
);
|
|
2346
|
+
|
|
2347
|
+
const {
|
|
2348
|
+
error: res_error,
|
|
2349
|
+
} = OrderModel.CreateOrderResponse().validate(response, {
|
|
2350
|
+
abortEarly: false,
|
|
2351
|
+
allowUnknown: false,
|
|
2352
|
+
});
|
|
2353
|
+
|
|
2354
|
+
if (res_error) {
|
|
2355
|
+
Logger({
|
|
2356
|
+
level: "WARN",
|
|
2357
|
+
message: "Response Validation Warnnings for processManifest",
|
|
2358
|
+
});
|
|
2359
|
+
Logger({ level: "WARN", message: res_error });
|
|
2360
|
+
}
|
|
2361
|
+
|
|
2362
|
+
return response;
|
|
1310
2363
|
}
|
|
1311
2364
|
|
|
1312
2365
|
/**
|
|
1313
2366
|
* @param {Object} arg - Arg object.
|
|
1314
2367
|
* @param {DispatchManifest} arg.body
|
|
2368
|
+
* @returns {Promise<SuccessResponse>} - Success response
|
|
1315
2369
|
* @summary:
|
|
1316
2370
|
* @description:
|
|
1317
2371
|
*/
|
|
1318
|
-
dispatchManifest({ body } = {}) {
|
|
2372
|
+
async dispatchManifest({ body } = {}) {
|
|
1319
2373
|
const { error } = OrderValidator.dispatchManifest().validate(
|
|
1320
2374
|
{
|
|
1321
2375
|
body,
|
|
@@ -1326,11 +2380,26 @@ class Order {
|
|
|
1326
2380
|
return Promise.reject(new FDKClientValidationError(error));
|
|
1327
2381
|
}
|
|
1328
2382
|
|
|
2383
|
+
// Showing warrnings if extra unknown parameters are found
|
|
2384
|
+
const { error: warrning } = OrderValidator.dispatchManifest().validate(
|
|
2385
|
+
{
|
|
2386
|
+
body,
|
|
2387
|
+
},
|
|
2388
|
+
{ abortEarly: false, allowUnknown: false }
|
|
2389
|
+
);
|
|
2390
|
+
if (warrning) {
|
|
2391
|
+
Logger({
|
|
2392
|
+
level: "WARN",
|
|
2393
|
+
message: "Parameter Validation warrnings for dispatchManifest",
|
|
2394
|
+
});
|
|
2395
|
+
Logger({ level: "WARN", message: warrning });
|
|
2396
|
+
}
|
|
2397
|
+
|
|
1329
2398
|
const query_params = {};
|
|
1330
2399
|
|
|
1331
2400
|
const xHeaders = {};
|
|
1332
2401
|
|
|
1333
|
-
|
|
2402
|
+
const response = await PlatformAPIClient.execute(
|
|
1334
2403
|
this.config,
|
|
1335
2404
|
"post",
|
|
1336
2405
|
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/manifest/dispatch`,
|
|
@@ -1338,14 +2407,30 @@ class Order {
|
|
|
1338
2407
|
body,
|
|
1339
2408
|
xHeaders
|
|
1340
2409
|
);
|
|
2410
|
+
|
|
2411
|
+
const { error: res_error } = OrderModel.SuccessResponse().validate(
|
|
2412
|
+
response,
|
|
2413
|
+
{ abortEarly: false, allowUnknown: false }
|
|
2414
|
+
);
|
|
2415
|
+
|
|
2416
|
+
if (res_error) {
|
|
2417
|
+
Logger({
|
|
2418
|
+
level: "WARN",
|
|
2419
|
+
message: "Response Validation Warnnings for dispatchManifest",
|
|
2420
|
+
});
|
|
2421
|
+
Logger({ level: "WARN", message: res_error });
|
|
2422
|
+
}
|
|
2423
|
+
|
|
2424
|
+
return response;
|
|
1341
2425
|
}
|
|
1342
2426
|
|
|
1343
2427
|
/**
|
|
1344
2428
|
* @param {Object} arg - Arg object.
|
|
2429
|
+
* @returns {Promise<GetActionsResponse>} - Success response
|
|
1345
2430
|
* @summary:
|
|
1346
2431
|
* @description:
|
|
1347
2432
|
*/
|
|
1348
|
-
getRoleBasedActions({} = {}) {
|
|
2433
|
+
async getRoleBasedActions({} = {}) {
|
|
1349
2434
|
const { error } = OrderValidator.getRoleBasedActions().validate(
|
|
1350
2435
|
{},
|
|
1351
2436
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -1354,11 +2439,24 @@ class Order {
|
|
|
1354
2439
|
return Promise.reject(new FDKClientValidationError(error));
|
|
1355
2440
|
}
|
|
1356
2441
|
|
|
2442
|
+
// Showing warrnings if extra unknown parameters are found
|
|
2443
|
+
const { error: warrning } = OrderValidator.getRoleBasedActions().validate(
|
|
2444
|
+
{},
|
|
2445
|
+
{ abortEarly: false, allowUnknown: false }
|
|
2446
|
+
);
|
|
2447
|
+
if (warrning) {
|
|
2448
|
+
Logger({
|
|
2449
|
+
level: "WARN",
|
|
2450
|
+
message: "Parameter Validation warrnings for getRoleBasedActions",
|
|
2451
|
+
});
|
|
2452
|
+
Logger({ level: "WARN", message: warrning });
|
|
2453
|
+
}
|
|
2454
|
+
|
|
1357
2455
|
const query_params = {};
|
|
1358
2456
|
|
|
1359
2457
|
const xHeaders = {};
|
|
1360
2458
|
|
|
1361
|
-
|
|
2459
|
+
const response = await PlatformAPIClient.execute(
|
|
1362
2460
|
this.config,
|
|
1363
2461
|
"get",
|
|
1364
2462
|
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/roles`,
|
|
@@ -1366,16 +2464,34 @@ class Order {
|
|
|
1366
2464
|
undefined,
|
|
1367
2465
|
xHeaders
|
|
1368
2466
|
);
|
|
2467
|
+
|
|
2468
|
+
const {
|
|
2469
|
+
error: res_error,
|
|
2470
|
+
} = OrderModel.GetActionsResponse().validate(response, {
|
|
2471
|
+
abortEarly: false,
|
|
2472
|
+
allowUnknown: false,
|
|
2473
|
+
});
|
|
2474
|
+
|
|
2475
|
+
if (res_error) {
|
|
2476
|
+
Logger({
|
|
2477
|
+
level: "WARN",
|
|
2478
|
+
message: "Response Validation Warnnings for getRoleBasedActions",
|
|
2479
|
+
});
|
|
2480
|
+
Logger({ level: "WARN", message: res_error });
|
|
2481
|
+
}
|
|
2482
|
+
|
|
2483
|
+
return response;
|
|
1369
2484
|
}
|
|
1370
2485
|
|
|
1371
2486
|
/**
|
|
1372
2487
|
* @param {Object} arg - Arg object.
|
|
1373
2488
|
* @param {number} [arg.shipmentId] -
|
|
1374
2489
|
* @param {number} [arg.bagId] -
|
|
2490
|
+
* @returns {Promise<ShipmentHistoryResponse>} - Success response
|
|
1375
2491
|
* @summary:
|
|
1376
2492
|
* @description:
|
|
1377
2493
|
*/
|
|
1378
|
-
getShipmentHistory({ shipmentId, bagId } = {}) {
|
|
2494
|
+
async getShipmentHistory({ shipmentId, bagId } = {}) {
|
|
1379
2495
|
const { error } = OrderValidator.getShipmentHistory().validate(
|
|
1380
2496
|
{
|
|
1381
2497
|
shipmentId,
|
|
@@ -1387,13 +2503,29 @@ class Order {
|
|
|
1387
2503
|
return Promise.reject(new FDKClientValidationError(error));
|
|
1388
2504
|
}
|
|
1389
2505
|
|
|
2506
|
+
// Showing warrnings if extra unknown parameters are found
|
|
2507
|
+
const { error: warrning } = OrderValidator.getShipmentHistory().validate(
|
|
2508
|
+
{
|
|
2509
|
+
shipmentId,
|
|
2510
|
+
bagId,
|
|
2511
|
+
},
|
|
2512
|
+
{ abortEarly: false, allowUnknown: false }
|
|
2513
|
+
);
|
|
2514
|
+
if (warrning) {
|
|
2515
|
+
Logger({
|
|
2516
|
+
level: "WARN",
|
|
2517
|
+
message: "Parameter Validation warrnings for getShipmentHistory",
|
|
2518
|
+
});
|
|
2519
|
+
Logger({ level: "WARN", message: warrning });
|
|
2520
|
+
}
|
|
2521
|
+
|
|
1390
2522
|
const query_params = {};
|
|
1391
2523
|
query_params["shipment_id"] = shipmentId;
|
|
1392
2524
|
query_params["bag_id"] = bagId;
|
|
1393
2525
|
|
|
1394
2526
|
const xHeaders = {};
|
|
1395
2527
|
|
|
1396
|
-
|
|
2528
|
+
const response = await PlatformAPIClient.execute(
|
|
1397
2529
|
this.config,
|
|
1398
2530
|
"get",
|
|
1399
2531
|
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/shipment/history`,
|
|
@@ -1401,15 +2533,97 @@ class Order {
|
|
|
1401
2533
|
undefined,
|
|
1402
2534
|
xHeaders
|
|
1403
2535
|
);
|
|
2536
|
+
|
|
2537
|
+
const {
|
|
2538
|
+
error: res_error,
|
|
2539
|
+
} = OrderModel.ShipmentHistoryResponse().validate(response, {
|
|
2540
|
+
abortEarly: false,
|
|
2541
|
+
allowUnknown: false,
|
|
2542
|
+
});
|
|
2543
|
+
|
|
2544
|
+
if (res_error) {
|
|
2545
|
+
Logger({
|
|
2546
|
+
level: "WARN",
|
|
2547
|
+
message: "Response Validation Warnnings for getShipmentHistory",
|
|
2548
|
+
});
|
|
2549
|
+
Logger({ level: "WARN", message: res_error });
|
|
2550
|
+
}
|
|
2551
|
+
|
|
2552
|
+
return response;
|
|
2553
|
+
}
|
|
2554
|
+
|
|
2555
|
+
/**
|
|
2556
|
+
* @param {Object} arg - Arg object.
|
|
2557
|
+
* @param {PostShipmentHistory} arg.body
|
|
2558
|
+
* @returns {Promise<ShipmentHistoryResponse>} - Success response
|
|
2559
|
+
* @summary:
|
|
2560
|
+
* @description:
|
|
2561
|
+
*/
|
|
2562
|
+
async postShipmentHistory({ body } = {}) {
|
|
2563
|
+
const { error } = OrderValidator.postShipmentHistory().validate(
|
|
2564
|
+
{
|
|
2565
|
+
body,
|
|
2566
|
+
},
|
|
2567
|
+
{ abortEarly: false, allowUnknown: true }
|
|
2568
|
+
);
|
|
2569
|
+
if (error) {
|
|
2570
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
2571
|
+
}
|
|
2572
|
+
|
|
2573
|
+
// Showing warrnings if extra unknown parameters are found
|
|
2574
|
+
const { error: warrning } = OrderValidator.postShipmentHistory().validate(
|
|
2575
|
+
{
|
|
2576
|
+
body,
|
|
2577
|
+
},
|
|
2578
|
+
{ abortEarly: false, allowUnknown: false }
|
|
2579
|
+
);
|
|
2580
|
+
if (warrning) {
|
|
2581
|
+
Logger({
|
|
2582
|
+
level: "WARN",
|
|
2583
|
+
message: "Parameter Validation warrnings for postShipmentHistory",
|
|
2584
|
+
});
|
|
2585
|
+
Logger({ level: "WARN", message: warrning });
|
|
2586
|
+
}
|
|
2587
|
+
|
|
2588
|
+
const query_params = {};
|
|
2589
|
+
|
|
2590
|
+
const xHeaders = {};
|
|
2591
|
+
|
|
2592
|
+
const response = await PlatformAPIClient.execute(
|
|
2593
|
+
this.config,
|
|
2594
|
+
"post",
|
|
2595
|
+
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/shipment/history`,
|
|
2596
|
+
query_params,
|
|
2597
|
+
body,
|
|
2598
|
+
xHeaders
|
|
2599
|
+
);
|
|
2600
|
+
|
|
2601
|
+
const {
|
|
2602
|
+
error: res_error,
|
|
2603
|
+
} = OrderModel.ShipmentHistoryResponse().validate(response, {
|
|
2604
|
+
abortEarly: false,
|
|
2605
|
+
allowUnknown: false,
|
|
2606
|
+
});
|
|
2607
|
+
|
|
2608
|
+
if (res_error) {
|
|
2609
|
+
Logger({
|
|
2610
|
+
level: "WARN",
|
|
2611
|
+
message: "Response Validation Warnnings for postShipmentHistory",
|
|
2612
|
+
});
|
|
2613
|
+
Logger({ level: "WARN", message: res_error });
|
|
2614
|
+
}
|
|
2615
|
+
|
|
2616
|
+
return response;
|
|
1404
2617
|
}
|
|
1405
2618
|
|
|
1406
2619
|
/**
|
|
1407
2620
|
* @param {Object} arg - Arg object.
|
|
1408
2621
|
* @param {SendSmsPayload} arg.body
|
|
2622
|
+
* @returns {Promise<OrderStatusResult>} - Success response
|
|
1409
2623
|
* @summary:
|
|
1410
2624
|
* @description:
|
|
1411
2625
|
*/
|
|
1412
|
-
sendSmsNinja({ body } = {}) {
|
|
2626
|
+
async sendSmsNinja({ body } = {}) {
|
|
1413
2627
|
const { error } = OrderValidator.sendSmsNinja().validate(
|
|
1414
2628
|
{
|
|
1415
2629
|
body,
|
|
@@ -1420,11 +2634,26 @@ class Order {
|
|
|
1420
2634
|
return Promise.reject(new FDKClientValidationError(error));
|
|
1421
2635
|
}
|
|
1422
2636
|
|
|
2637
|
+
// Showing warrnings if extra unknown parameters are found
|
|
2638
|
+
const { error: warrning } = OrderValidator.sendSmsNinja().validate(
|
|
2639
|
+
{
|
|
2640
|
+
body,
|
|
2641
|
+
},
|
|
2642
|
+
{ abortEarly: false, allowUnknown: false }
|
|
2643
|
+
);
|
|
2644
|
+
if (warrning) {
|
|
2645
|
+
Logger({
|
|
2646
|
+
level: "WARN",
|
|
2647
|
+
message: "Parameter Validation warrnings for sendSmsNinja",
|
|
2648
|
+
});
|
|
2649
|
+
Logger({ level: "WARN", message: warrning });
|
|
2650
|
+
}
|
|
2651
|
+
|
|
1423
2652
|
const query_params = {};
|
|
1424
2653
|
|
|
1425
2654
|
const xHeaders = {};
|
|
1426
2655
|
|
|
1427
|
-
|
|
2656
|
+
const response = await PlatformAPIClient.execute(
|
|
1428
2657
|
this.config,
|
|
1429
2658
|
"post",
|
|
1430
2659
|
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/ninja/send-sms`,
|
|
@@ -1432,15 +2661,33 @@ class Order {
|
|
|
1432
2661
|
body,
|
|
1433
2662
|
xHeaders
|
|
1434
2663
|
);
|
|
2664
|
+
|
|
2665
|
+
const {
|
|
2666
|
+
error: res_error,
|
|
2667
|
+
} = OrderModel.OrderStatusResult().validate(response, {
|
|
2668
|
+
abortEarly: false,
|
|
2669
|
+
allowUnknown: false,
|
|
2670
|
+
});
|
|
2671
|
+
|
|
2672
|
+
if (res_error) {
|
|
2673
|
+
Logger({
|
|
2674
|
+
level: "WARN",
|
|
2675
|
+
message: "Response Validation Warnnings for sendSmsNinja",
|
|
2676
|
+
});
|
|
2677
|
+
Logger({ level: "WARN", message: res_error });
|
|
2678
|
+
}
|
|
2679
|
+
|
|
2680
|
+
return response;
|
|
1435
2681
|
}
|
|
1436
2682
|
|
|
1437
2683
|
/**
|
|
1438
2684
|
* @param {Object} arg - Arg object.
|
|
1439
2685
|
* @param {ManualAssignDPToShipment} arg.body
|
|
2686
|
+
* @returns {Promise<ManualAssignDPToShipmentResponse>} - Success response
|
|
1440
2687
|
* @summary:
|
|
1441
2688
|
* @description:
|
|
1442
2689
|
*/
|
|
1443
|
-
platformManualAssignDPToShipment({ body } = {}) {
|
|
2690
|
+
async platformManualAssignDPToShipment({ body } = {}) {
|
|
1444
2691
|
const {
|
|
1445
2692
|
error,
|
|
1446
2693
|
} = OrderValidator.platformManualAssignDPToShipment().validate(
|
|
@@ -1453,11 +2700,29 @@ class Order {
|
|
|
1453
2700
|
return Promise.reject(new FDKClientValidationError(error));
|
|
1454
2701
|
}
|
|
1455
2702
|
|
|
2703
|
+
// Showing warrnings if extra unknown parameters are found
|
|
2704
|
+
const {
|
|
2705
|
+
error: warrning,
|
|
2706
|
+
} = OrderValidator.platformManualAssignDPToShipment().validate(
|
|
2707
|
+
{
|
|
2708
|
+
body,
|
|
2709
|
+
},
|
|
2710
|
+
{ abortEarly: false, allowUnknown: false }
|
|
2711
|
+
);
|
|
2712
|
+
if (warrning) {
|
|
2713
|
+
Logger({
|
|
2714
|
+
level: "WARN",
|
|
2715
|
+
message:
|
|
2716
|
+
"Parameter Validation warrnings for platformManualAssignDPToShipment",
|
|
2717
|
+
});
|
|
2718
|
+
Logger({ level: "WARN", message: warrning });
|
|
2719
|
+
}
|
|
2720
|
+
|
|
1456
2721
|
const query_params = {};
|
|
1457
2722
|
|
|
1458
2723
|
const xHeaders = {};
|
|
1459
2724
|
|
|
1460
|
-
|
|
2725
|
+
const response = await PlatformAPIClient.execute(
|
|
1461
2726
|
this.config,
|
|
1462
2727
|
"post",
|
|
1463
2728
|
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/oms/manual-place-shipment`,
|
|
@@ -1465,15 +2730,34 @@ class Order {
|
|
|
1465
2730
|
body,
|
|
1466
2731
|
xHeaders
|
|
1467
2732
|
);
|
|
2733
|
+
|
|
2734
|
+
const {
|
|
2735
|
+
error: res_error,
|
|
2736
|
+
} = OrderModel.ManualAssignDPToShipmentResponse().validate(response, {
|
|
2737
|
+
abortEarly: false,
|
|
2738
|
+
allowUnknown: false,
|
|
2739
|
+
});
|
|
2740
|
+
|
|
2741
|
+
if (res_error) {
|
|
2742
|
+
Logger({
|
|
2743
|
+
level: "WARN",
|
|
2744
|
+
message:
|
|
2745
|
+
"Response Validation Warnnings for platformManualAssignDPToShipment",
|
|
2746
|
+
});
|
|
2747
|
+
Logger({ level: "WARN", message: res_error });
|
|
2748
|
+
}
|
|
2749
|
+
|
|
2750
|
+
return response;
|
|
1468
2751
|
}
|
|
1469
2752
|
|
|
1470
2753
|
/**
|
|
1471
2754
|
* @param {Object} arg - Arg object.
|
|
1472
2755
|
* @param {CreateOrderPayload} arg.body
|
|
2756
|
+
* @returns {Promise<CreateOrderResponse>} - Success response
|
|
1473
2757
|
* @summary:
|
|
1474
2758
|
* @description:
|
|
1475
2759
|
*/
|
|
1476
|
-
updatePackagingDimensions({ body } = {}) {
|
|
2760
|
+
async updatePackagingDimensions({ body } = {}) {
|
|
1477
2761
|
const { error } = OrderValidator.updatePackagingDimensions().validate(
|
|
1478
2762
|
{
|
|
1479
2763
|
body,
|
|
@@ -1484,11 +2768,28 @@ class Order {
|
|
|
1484
2768
|
return Promise.reject(new FDKClientValidationError(error));
|
|
1485
2769
|
}
|
|
1486
2770
|
|
|
2771
|
+
// Showing warrnings if extra unknown parameters are found
|
|
2772
|
+
const {
|
|
2773
|
+
error: warrning,
|
|
2774
|
+
} = OrderValidator.updatePackagingDimensions().validate(
|
|
2775
|
+
{
|
|
2776
|
+
body,
|
|
2777
|
+
},
|
|
2778
|
+
{ abortEarly: false, allowUnknown: false }
|
|
2779
|
+
);
|
|
2780
|
+
if (warrning) {
|
|
2781
|
+
Logger({
|
|
2782
|
+
level: "WARN",
|
|
2783
|
+
message: "Parameter Validation warrnings for updatePackagingDimensions",
|
|
2784
|
+
});
|
|
2785
|
+
Logger({ level: "WARN", message: warrning });
|
|
2786
|
+
}
|
|
2787
|
+
|
|
1487
2788
|
const query_params = {};
|
|
1488
2789
|
|
|
1489
2790
|
const xHeaders = {};
|
|
1490
2791
|
|
|
1491
|
-
|
|
2792
|
+
const response = await PlatformAPIClient.execute(
|
|
1492
2793
|
this.config,
|
|
1493
2794
|
"post",
|
|
1494
2795
|
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/update-packaging-dimension`,
|
|
@@ -1496,15 +2797,33 @@ class Order {
|
|
|
1496
2797
|
body,
|
|
1497
2798
|
xHeaders
|
|
1498
2799
|
);
|
|
2800
|
+
|
|
2801
|
+
const {
|
|
2802
|
+
error: res_error,
|
|
2803
|
+
} = OrderModel.CreateOrderResponse().validate(response, {
|
|
2804
|
+
abortEarly: false,
|
|
2805
|
+
allowUnknown: false,
|
|
2806
|
+
});
|
|
2807
|
+
|
|
2808
|
+
if (res_error) {
|
|
2809
|
+
Logger({
|
|
2810
|
+
level: "WARN",
|
|
2811
|
+
message: "Response Validation Warnnings for updatePackagingDimensions",
|
|
2812
|
+
});
|
|
2813
|
+
Logger({ level: "WARN", message: res_error });
|
|
2814
|
+
}
|
|
2815
|
+
|
|
2816
|
+
return response;
|
|
1499
2817
|
}
|
|
1500
2818
|
|
|
1501
2819
|
/**
|
|
1502
2820
|
* @param {Object} arg - Arg object.
|
|
1503
2821
|
* @param {CreateOrderAPI} arg.body
|
|
2822
|
+
* @returns {Promise<CreateOrderResponse>} - Success response
|
|
1504
2823
|
* @summary:
|
|
1505
2824
|
* @description:
|
|
1506
2825
|
*/
|
|
1507
|
-
createOrder({ body } = {}) {
|
|
2826
|
+
async createOrder({ body } = {}) {
|
|
1508
2827
|
const { error } = OrderValidator.createOrder().validate(
|
|
1509
2828
|
{
|
|
1510
2829
|
body,
|
|
@@ -1515,11 +2834,26 @@ class Order {
|
|
|
1515
2834
|
return Promise.reject(new FDKClientValidationError(error));
|
|
1516
2835
|
}
|
|
1517
2836
|
|
|
2837
|
+
// Showing warrnings if extra unknown parameters are found
|
|
2838
|
+
const { error: warrning } = OrderValidator.createOrder().validate(
|
|
2839
|
+
{
|
|
2840
|
+
body,
|
|
2841
|
+
},
|
|
2842
|
+
{ abortEarly: false, allowUnknown: false }
|
|
2843
|
+
);
|
|
2844
|
+
if (warrning) {
|
|
2845
|
+
Logger({
|
|
2846
|
+
level: "WARN",
|
|
2847
|
+
message: "Parameter Validation warrnings for createOrder",
|
|
2848
|
+
});
|
|
2849
|
+
Logger({ level: "WARN", message: warrning });
|
|
2850
|
+
}
|
|
2851
|
+
|
|
1518
2852
|
const query_params = {};
|
|
1519
2853
|
|
|
1520
2854
|
const xHeaders = {};
|
|
1521
2855
|
|
|
1522
|
-
|
|
2856
|
+
const response = await PlatformAPIClient.execute(
|
|
1523
2857
|
this.config,
|
|
1524
2858
|
"post",
|
|
1525
2859
|
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/create-order`,
|
|
@@ -1527,74 +2861,156 @@ class Order {
|
|
|
1527
2861
|
body,
|
|
1528
2862
|
xHeaders
|
|
1529
2863
|
);
|
|
2864
|
+
|
|
2865
|
+
const {
|
|
2866
|
+
error: res_error,
|
|
2867
|
+
} = OrderModel.CreateOrderResponse().validate(response, {
|
|
2868
|
+
abortEarly: false,
|
|
2869
|
+
allowUnknown: false,
|
|
2870
|
+
});
|
|
2871
|
+
|
|
2872
|
+
if (res_error) {
|
|
2873
|
+
Logger({
|
|
2874
|
+
level: "WARN",
|
|
2875
|
+
message: "Response Validation Warnnings for createOrder",
|
|
2876
|
+
});
|
|
2877
|
+
Logger({ level: "WARN", message: res_error });
|
|
2878
|
+
}
|
|
2879
|
+
|
|
2880
|
+
return response;
|
|
1530
2881
|
}
|
|
1531
2882
|
|
|
1532
2883
|
/**
|
|
1533
2884
|
* @param {Object} arg - Arg object.
|
|
1534
|
-
* @
|
|
2885
|
+
* @returns {Promise<CreateChannelConfigData>} - Success response
|
|
1535
2886
|
* @summary:
|
|
1536
|
-
* @description:
|
|
2887
|
+
* @description: getChannelConfig
|
|
1537
2888
|
*/
|
|
1538
|
-
|
|
1539
|
-
const { error } = OrderValidator.
|
|
1540
|
-
{
|
|
1541
|
-
body,
|
|
1542
|
-
},
|
|
2889
|
+
async getChannelConfig({} = {}) {
|
|
2890
|
+
const { error } = OrderValidator.getChannelConfig().validate(
|
|
2891
|
+
{},
|
|
1543
2892
|
{ abortEarly: false, allowUnknown: true }
|
|
1544
2893
|
);
|
|
1545
2894
|
if (error) {
|
|
1546
2895
|
return Promise.reject(new FDKClientValidationError(error));
|
|
1547
2896
|
}
|
|
1548
2897
|
|
|
2898
|
+
// Showing warrnings if extra unknown parameters are found
|
|
2899
|
+
const { error: warrning } = OrderValidator.getChannelConfig().validate(
|
|
2900
|
+
{},
|
|
2901
|
+
{ abortEarly: false, allowUnknown: false }
|
|
2902
|
+
);
|
|
2903
|
+
if (warrning) {
|
|
2904
|
+
Logger({
|
|
2905
|
+
level: "WARN",
|
|
2906
|
+
message: "Parameter Validation warrnings for getChannelConfig",
|
|
2907
|
+
});
|
|
2908
|
+
Logger({ level: "WARN", message: warrning });
|
|
2909
|
+
}
|
|
2910
|
+
|
|
1549
2911
|
const query_params = {};
|
|
1550
2912
|
|
|
1551
2913
|
const xHeaders = {};
|
|
1552
2914
|
|
|
1553
|
-
|
|
2915
|
+
const response = await PlatformAPIClient.execute(
|
|
1554
2916
|
this.config,
|
|
1555
|
-
"
|
|
2917
|
+
"get",
|
|
1556
2918
|
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/order-config`,
|
|
1557
2919
|
query_params,
|
|
1558
|
-
|
|
2920
|
+
undefined,
|
|
1559
2921
|
xHeaders
|
|
1560
2922
|
);
|
|
2923
|
+
|
|
2924
|
+
const {
|
|
2925
|
+
error: res_error,
|
|
2926
|
+
} = OrderModel.CreateChannelConfigData().validate(response, {
|
|
2927
|
+
abortEarly: false,
|
|
2928
|
+
allowUnknown: false,
|
|
2929
|
+
});
|
|
2930
|
+
|
|
2931
|
+
if (res_error) {
|
|
2932
|
+
Logger({
|
|
2933
|
+
level: "WARN",
|
|
2934
|
+
message: "Response Validation Warnnings for getChannelConfig",
|
|
2935
|
+
});
|
|
2936
|
+
Logger({ level: "WARN", message: res_error });
|
|
2937
|
+
}
|
|
2938
|
+
|
|
2939
|
+
return response;
|
|
1561
2940
|
}
|
|
1562
2941
|
|
|
1563
2942
|
/**
|
|
1564
2943
|
* @param {Object} arg - Arg object.
|
|
2944
|
+
* @param {CreateChannelConfigData} arg.body
|
|
2945
|
+
* @returns {Promise<CreateChannelConfigResponse>} - Success response
|
|
1565
2946
|
* @summary:
|
|
1566
|
-
* @description:
|
|
2947
|
+
* @description: createChannelConfig
|
|
1567
2948
|
*/
|
|
1568
|
-
|
|
1569
|
-
const { error } = OrderValidator.
|
|
1570
|
-
{
|
|
2949
|
+
async createChannelConfig({ body } = {}) {
|
|
2950
|
+
const { error } = OrderValidator.createChannelConfig().validate(
|
|
2951
|
+
{
|
|
2952
|
+
body,
|
|
2953
|
+
},
|
|
1571
2954
|
{ abortEarly: false, allowUnknown: true }
|
|
1572
2955
|
);
|
|
1573
2956
|
if (error) {
|
|
1574
2957
|
return Promise.reject(new FDKClientValidationError(error));
|
|
1575
2958
|
}
|
|
1576
2959
|
|
|
2960
|
+
// Showing warrnings if extra unknown parameters are found
|
|
2961
|
+
const { error: warrning } = OrderValidator.createChannelConfig().validate(
|
|
2962
|
+
{
|
|
2963
|
+
body,
|
|
2964
|
+
},
|
|
2965
|
+
{ abortEarly: false, allowUnknown: false }
|
|
2966
|
+
);
|
|
2967
|
+
if (warrning) {
|
|
2968
|
+
Logger({
|
|
2969
|
+
level: "WARN",
|
|
2970
|
+
message: "Parameter Validation warrnings for createChannelConfig",
|
|
2971
|
+
});
|
|
2972
|
+
Logger({ level: "WARN", message: warrning });
|
|
2973
|
+
}
|
|
2974
|
+
|
|
1577
2975
|
const query_params = {};
|
|
1578
2976
|
|
|
1579
2977
|
const xHeaders = {};
|
|
1580
2978
|
|
|
1581
|
-
|
|
2979
|
+
const response = await PlatformAPIClient.execute(
|
|
1582
2980
|
this.config,
|
|
1583
|
-
"
|
|
2981
|
+
"post",
|
|
1584
2982
|
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/order-config`,
|
|
1585
2983
|
query_params,
|
|
1586
|
-
|
|
2984
|
+
body,
|
|
1587
2985
|
xHeaders
|
|
1588
2986
|
);
|
|
2987
|
+
|
|
2988
|
+
const {
|
|
2989
|
+
error: res_error,
|
|
2990
|
+
} = OrderModel.CreateChannelConfigResponse().validate(response, {
|
|
2991
|
+
abortEarly: false,
|
|
2992
|
+
allowUnknown: false,
|
|
2993
|
+
});
|
|
2994
|
+
|
|
2995
|
+
if (res_error) {
|
|
2996
|
+
Logger({
|
|
2997
|
+
level: "WARN",
|
|
2998
|
+
message: "Response Validation Warnnings for createChannelConfig",
|
|
2999
|
+
});
|
|
3000
|
+
Logger({ level: "WARN", message: res_error });
|
|
3001
|
+
}
|
|
3002
|
+
|
|
3003
|
+
return response;
|
|
1589
3004
|
}
|
|
1590
3005
|
|
|
1591
3006
|
/**
|
|
1592
3007
|
* @param {Object} arg - Arg object.
|
|
1593
3008
|
* @param {UploadConsent} arg.body
|
|
3009
|
+
* @returns {Promise<SuccessResponse>} - Success response
|
|
1594
3010
|
* @summary:
|
|
1595
3011
|
* @description:
|
|
1596
3012
|
*/
|
|
1597
|
-
uploadConsent({ body } = {}) {
|
|
3013
|
+
async uploadConsent({ body } = {}) {
|
|
1598
3014
|
const { error } = OrderValidator.uploadConsent().validate(
|
|
1599
3015
|
{
|
|
1600
3016
|
body,
|
|
@@ -1605,11 +3021,26 @@ class Order {
|
|
|
1605
3021
|
return Promise.reject(new FDKClientValidationError(error));
|
|
1606
3022
|
}
|
|
1607
3023
|
|
|
3024
|
+
// Showing warrnings if extra unknown parameters are found
|
|
3025
|
+
const { error: warrning } = OrderValidator.uploadConsent().validate(
|
|
3026
|
+
{
|
|
3027
|
+
body,
|
|
3028
|
+
},
|
|
3029
|
+
{ abortEarly: false, allowUnknown: false }
|
|
3030
|
+
);
|
|
3031
|
+
if (warrning) {
|
|
3032
|
+
Logger({
|
|
3033
|
+
level: "WARN",
|
|
3034
|
+
message: "Parameter Validation warrnings for uploadConsent",
|
|
3035
|
+
});
|
|
3036
|
+
Logger({ level: "WARN", message: warrning });
|
|
3037
|
+
}
|
|
3038
|
+
|
|
1608
3039
|
const query_params = {};
|
|
1609
3040
|
|
|
1610
3041
|
const xHeaders = {};
|
|
1611
3042
|
|
|
1612
|
-
|
|
3043
|
+
const response = await PlatformAPIClient.execute(
|
|
1613
3044
|
this.config,
|
|
1614
3045
|
"post",
|
|
1615
3046
|
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/manifest/uploadConsent`,
|
|
@@ -1617,15 +3048,31 @@ class Order {
|
|
|
1617
3048
|
body,
|
|
1618
3049
|
xHeaders
|
|
1619
3050
|
);
|
|
3051
|
+
|
|
3052
|
+
const { error: res_error } = OrderModel.SuccessResponse().validate(
|
|
3053
|
+
response,
|
|
3054
|
+
{ abortEarly: false, allowUnknown: false }
|
|
3055
|
+
);
|
|
3056
|
+
|
|
3057
|
+
if (res_error) {
|
|
3058
|
+
Logger({
|
|
3059
|
+
level: "WARN",
|
|
3060
|
+
message: "Response Validation Warnnings for uploadConsent",
|
|
3061
|
+
});
|
|
3062
|
+
Logger({ level: "WARN", message: res_error });
|
|
3063
|
+
}
|
|
3064
|
+
|
|
3065
|
+
return response;
|
|
1620
3066
|
}
|
|
1621
3067
|
|
|
1622
3068
|
/**
|
|
1623
3069
|
* @param {Object} arg - Arg object.
|
|
1624
3070
|
* @param {PlatformOrderUpdate} arg.body
|
|
3071
|
+
* @returns {Promise<ResponseDetail>} - Success response
|
|
1625
3072
|
* @summary:
|
|
1626
3073
|
* @description:
|
|
1627
3074
|
*/
|
|
1628
|
-
orderUpdate({ body } = {}) {
|
|
3075
|
+
async orderUpdate({ body } = {}) {
|
|
1629
3076
|
const { error } = OrderValidator.orderUpdate().validate(
|
|
1630
3077
|
{
|
|
1631
3078
|
body,
|
|
@@ -1636,11 +3083,26 @@ class Order {
|
|
|
1636
3083
|
return Promise.reject(new FDKClientValidationError(error));
|
|
1637
3084
|
}
|
|
1638
3085
|
|
|
3086
|
+
// Showing warrnings if extra unknown parameters are found
|
|
3087
|
+
const { error: warrning } = OrderValidator.orderUpdate().validate(
|
|
3088
|
+
{
|
|
3089
|
+
body,
|
|
3090
|
+
},
|
|
3091
|
+
{ abortEarly: false, allowUnknown: false }
|
|
3092
|
+
);
|
|
3093
|
+
if (warrning) {
|
|
3094
|
+
Logger({
|
|
3095
|
+
level: "WARN",
|
|
3096
|
+
message: "Parameter Validation warrnings for orderUpdate",
|
|
3097
|
+
});
|
|
3098
|
+
Logger({ level: "WARN", message: warrning });
|
|
3099
|
+
}
|
|
3100
|
+
|
|
1639
3101
|
const query_params = {};
|
|
1640
3102
|
|
|
1641
3103
|
const xHeaders = {};
|
|
1642
3104
|
|
|
1643
|
-
|
|
3105
|
+
const response = await PlatformAPIClient.execute(
|
|
1644
3106
|
this.config,
|
|
1645
3107
|
"put",
|
|
1646
3108
|
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/order/validation`,
|
|
@@ -1648,15 +3110,31 @@ class Order {
|
|
|
1648
3110
|
body,
|
|
1649
3111
|
xHeaders
|
|
1650
3112
|
);
|
|
3113
|
+
|
|
3114
|
+
const { error: res_error } = OrderModel.ResponseDetail().validate(
|
|
3115
|
+
response,
|
|
3116
|
+
{ abortEarly: false, allowUnknown: false }
|
|
3117
|
+
);
|
|
3118
|
+
|
|
3119
|
+
if (res_error) {
|
|
3120
|
+
Logger({
|
|
3121
|
+
level: "WARN",
|
|
3122
|
+
message: "Response Validation Warnnings for orderUpdate",
|
|
3123
|
+
});
|
|
3124
|
+
Logger({ level: "WARN", message: res_error });
|
|
3125
|
+
}
|
|
3126
|
+
|
|
3127
|
+
return response;
|
|
1651
3128
|
}
|
|
1652
3129
|
|
|
1653
3130
|
/**
|
|
1654
3131
|
* @param {Object} arg - Arg object.
|
|
1655
3132
|
* @param {OrderStatus} arg.body
|
|
3133
|
+
* @returns {Promise<OrderStatusResult>} - Success response
|
|
1656
3134
|
* @summary:
|
|
1657
3135
|
* @description:
|
|
1658
3136
|
*/
|
|
1659
|
-
checkOrderStatus({ body } = {}) {
|
|
3137
|
+
async checkOrderStatus({ body } = {}) {
|
|
1660
3138
|
const { error } = OrderValidator.checkOrderStatus().validate(
|
|
1661
3139
|
{
|
|
1662
3140
|
body,
|
|
@@ -1667,11 +3145,26 @@ class Order {
|
|
|
1667
3145
|
return Promise.reject(new FDKClientValidationError(error));
|
|
1668
3146
|
}
|
|
1669
3147
|
|
|
3148
|
+
// Showing warrnings if extra unknown parameters are found
|
|
3149
|
+
const { error: warrning } = OrderValidator.checkOrderStatus().validate(
|
|
3150
|
+
{
|
|
3151
|
+
body,
|
|
3152
|
+
},
|
|
3153
|
+
{ abortEarly: false, allowUnknown: false }
|
|
3154
|
+
);
|
|
3155
|
+
if (warrning) {
|
|
3156
|
+
Logger({
|
|
3157
|
+
level: "WARN",
|
|
3158
|
+
message: "Parameter Validation warrnings for checkOrderStatus",
|
|
3159
|
+
});
|
|
3160
|
+
Logger({ level: "WARN", message: warrning });
|
|
3161
|
+
}
|
|
3162
|
+
|
|
1670
3163
|
const query_params = {};
|
|
1671
3164
|
|
|
1672
3165
|
const xHeaders = {};
|
|
1673
3166
|
|
|
1674
|
-
|
|
3167
|
+
const response = await PlatformAPIClient.execute(
|
|
1675
3168
|
this.config,
|
|
1676
3169
|
"post",
|
|
1677
3170
|
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/debug/order_status`,
|
|
@@ -1679,14 +3172,32 @@ class Order {
|
|
|
1679
3172
|
body,
|
|
1680
3173
|
xHeaders
|
|
1681
3174
|
);
|
|
3175
|
+
|
|
3176
|
+
const {
|
|
3177
|
+
error: res_error,
|
|
3178
|
+
} = OrderModel.OrderStatusResult().validate(response, {
|
|
3179
|
+
abortEarly: false,
|
|
3180
|
+
allowUnknown: false,
|
|
3181
|
+
});
|
|
3182
|
+
|
|
3183
|
+
if (res_error) {
|
|
3184
|
+
Logger({
|
|
3185
|
+
level: "WARN",
|
|
3186
|
+
message: "Response Validation Warnnings for checkOrderStatus",
|
|
3187
|
+
});
|
|
3188
|
+
Logger({ level: "WARN", message: res_error });
|
|
3189
|
+
}
|
|
3190
|
+
|
|
3191
|
+
return response;
|
|
1682
3192
|
}
|
|
1683
3193
|
|
|
1684
3194
|
/**
|
|
1685
3195
|
* @param {Object} arg - Arg object.
|
|
3196
|
+
* @returns {Promise<OrderStatusResult>} - Success response
|
|
1686
3197
|
* @summary:
|
|
1687
3198
|
* @description:
|
|
1688
3199
|
*/
|
|
1689
|
-
sendSmsNinjaPlatform({} = {}) {
|
|
3200
|
+
async sendSmsNinjaPlatform({} = {}) {
|
|
1690
3201
|
const { error } = OrderValidator.sendSmsNinjaPlatform().validate(
|
|
1691
3202
|
{},
|
|
1692
3203
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -1695,11 +3206,24 @@ class Order {
|
|
|
1695
3206
|
return Promise.reject(new FDKClientValidationError(error));
|
|
1696
3207
|
}
|
|
1697
3208
|
|
|
3209
|
+
// Showing warrnings if extra unknown parameters are found
|
|
3210
|
+
const { error: warrning } = OrderValidator.sendSmsNinjaPlatform().validate(
|
|
3211
|
+
{},
|
|
3212
|
+
{ abortEarly: false, allowUnknown: false }
|
|
3213
|
+
);
|
|
3214
|
+
if (warrning) {
|
|
3215
|
+
Logger({
|
|
3216
|
+
level: "WARN",
|
|
3217
|
+
message: "Parameter Validation warrnings for sendSmsNinjaPlatform",
|
|
3218
|
+
});
|
|
3219
|
+
Logger({ level: "WARN", message: warrning });
|
|
3220
|
+
}
|
|
3221
|
+
|
|
1698
3222
|
const query_params = {};
|
|
1699
3223
|
|
|
1700
3224
|
const xHeaders = {};
|
|
1701
3225
|
|
|
1702
|
-
|
|
3226
|
+
const response = await PlatformAPIClient.execute(
|
|
1703
3227
|
this.config,
|
|
1704
3228
|
"get",
|
|
1705
3229
|
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/bag/state/transition`,
|
|
@@ -1707,6 +3231,23 @@ class Order {
|
|
|
1707
3231
|
undefined,
|
|
1708
3232
|
xHeaders
|
|
1709
3233
|
);
|
|
3234
|
+
|
|
3235
|
+
const {
|
|
3236
|
+
error: res_error,
|
|
3237
|
+
} = OrderModel.OrderStatusResult().validate(response, {
|
|
3238
|
+
abortEarly: false,
|
|
3239
|
+
allowUnknown: false,
|
|
3240
|
+
});
|
|
3241
|
+
|
|
3242
|
+
if (res_error) {
|
|
3243
|
+
Logger({
|
|
3244
|
+
level: "WARN",
|
|
3245
|
+
message: "Response Validation Warnnings for sendSmsNinjaPlatform",
|
|
3246
|
+
});
|
|
3247
|
+
Logger({ level: "WARN", message: res_error });
|
|
3248
|
+
}
|
|
3249
|
+
|
|
3250
|
+
return response;
|
|
1710
3251
|
}
|
|
1711
3252
|
}
|
|
1712
3253
|
|