@gofynd/fdk-client-javascript 1.4.15-beta.1 → 1.4.15-beta.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/application.d.ts +1 -2
- package/application.js +2 -3
- package/index.d.ts +1 -2
- package/index.js +7 -1
- package/package.json +3 -4
- package/sdk/application/ApplicationClient.js +0 -18
- package/sdk/application/Cart/CartApplicationClient.d.ts +55 -90
- package/sdk/application/Cart/CartApplicationClient.js +60 -1185
- package/sdk/application/Catalog/CatalogApplicationClient.d.ts +90 -142
- package/sdk/application/Catalog/CatalogApplicationClient.js +187 -1293
- package/sdk/application/Common/CommonApplicationClient.d.ts +4 -8
- package/sdk/application/Common/CommonApplicationClient.js +5 -89
- package/sdk/application/Communication/CommunicationApplicationClient.d.ts +6 -19
- package/sdk/application/Communication/CommunicationApplicationClient.js +6 -145
- package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +32 -73
- package/sdk/application/Configuration/ConfigurationApplicationClient.js +31 -718
- package/sdk/application/Content/ContentApplicationClient.d.ts +46 -78
- package/sdk/application/Content/ContentApplicationClient.js +77 -914
- package/sdk/application/FileStorage/FileStorageApplicationClient.d.ts +6 -11
- package/sdk/application/FileStorage/FileStorageApplicationClient.js +19 -125
- package/sdk/application/Lead/LeadApplicationClient.d.ts +10 -18
- package/sdk/application/Lead/LeadApplicationClient.js +32 -202
- package/sdk/application/Logistic/LogisticApplicationClient.d.ts +22 -39
- package/sdk/application/Logistic/LogisticApplicationClient.js +50 -478
- package/sdk/application/Order/OrderApplicationClient.d.ts +22 -42
- package/sdk/application/Order/OrderApplicationClient.js +86 -472
- package/sdk/application/Payment/PaymentApplicationClient.d.ts +92 -212
- package/sdk/application/Payment/PaymentApplicationClient.js +57 -2102
- package/sdk/application/Rewards/RewardsApplicationClient.d.ts +14 -28
- package/sdk/application/Rewards/RewardsApplicationClient.js +16 -305
- package/sdk/application/Share/ShareApplicationClient.d.ts +14 -24
- package/sdk/application/Share/ShareApplicationClient.js +34 -294
- package/sdk/application/Theme/ThemeApplicationClient.d.ts +8 -14
- package/sdk/application/Theme/ThemeApplicationClient.js +28 -162
- package/sdk/application/User/UserApplicationClient.d.ts +85 -136
- package/sdk/application/User/UserApplicationClient.js +45 -1815
- package/sdk/application/Webhook/WebhookApplicationClient.d.ts +2 -5
- package/sdk/application/Webhook/WebhookApplicationClient.js +4 -47
- package/sdk/application/index.d.ts +0 -18
- package/sdk/application/index.js +0 -33
- package/sdk/common/Utility.d.ts +1 -1
- package/sdk/common/Utility.js +10 -7
- package/sdk/common/Validator.d.ts +1 -0
- package/sdk/common/Validator.js +20 -0
- package/sdk/common/utils.d.ts +0 -1
- package/sdk/common/utils.js +0 -14
- package/sdk/partner/OAuthClient.js +1 -0
- package/sdk/partner/Theme/ThemePartnerModel.d.ts +3 -40
- package/sdk/partner/Theme/ThemePartnerModel.js +2 -24
- package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +39 -1
- package/sdk/platform/Cart/CartPlatformApplicationClient.js +247 -1
- package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +33 -1
- package/sdk/platform/Cart/CartPlatformApplicationValidator.js +37 -0
- package/sdk/platform/Cart/CartPlatformModel.d.ts +193 -1
- package/sdk/platform/Cart/CartPlatformModel.js +132 -0
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +0 -7
- package/sdk/platform/Catalog/CatalogPlatformModel.js +1 -4
- package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +14 -0
- package/sdk/platform/Configuration/ConfigurationPlatformModel.js +6 -0
- package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +0 -10
- package/sdk/platform/Order/OrderPlatformApplicationClient.js +0 -92
- package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +1 -28
- package/sdk/platform/Order/OrderPlatformApplicationValidator.js +0 -18
- package/sdk/platform/Order/OrderPlatformClient.d.ts +10 -0
- package/sdk/platform/Order/OrderPlatformClient.js +99 -0
- package/sdk/platform/Order/OrderPlatformModel.d.ts +7 -0
- package/sdk/platform/Order/OrderPlatformModel.js +3 -0
- package/sdk/platform/Order/OrderPlatformValidator.d.ts +33 -1
- package/sdk/platform/Order/OrderPlatformValidator.js +20 -0
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +1 -1
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +4 -4
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +56 -19
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +42 -18
- package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.d.ts +3 -3
- package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.js +2 -2
- package/sdk/platform/Theme/ThemePlatformModel.d.ts +3 -40
- package/sdk/platform/Theme/ThemePlatformModel.js +2 -24
- package/sdk/public/Configuration/ConfigurationPublicClient.js +5 -2
- package/sdk/public/Content/ContentPublicClient.d.ts +1 -1
- package/sdk/public/Content/ContentPublicClient.js +14 -2
- package/sdk/public/Partner/PartnerPublicClient.d.ts +1 -1
- package/sdk/public/Partner/PartnerPublicClient.js +14 -2
- package/sdk/public/Webhook/WebhookPublicClient.js +5 -2
- package/sdk/application/Cart/CartApplicationModel.d.ts +0 -3994
- package/sdk/application/Cart/CartApplicationModel.js +0 -2497
- package/sdk/application/Cart/CartApplicationValidator.d.ts +0 -769
- package/sdk/application/Cart/CartApplicationValidator.js +0 -530
- package/sdk/application/Catalog/CatalogApplicationModel.d.ts +0 -3857
- package/sdk/application/Catalog/CatalogApplicationModel.js +0 -2629
- package/sdk/application/Catalog/CatalogApplicationValidator.d.ts +0 -791
- package/sdk/application/Catalog/CatalogApplicationValidator.js +0 -551
- package/sdk/application/Common/CommonApplicationModel.d.ts +0 -449
- package/sdk/application/Common/CommonApplicationModel.js +0 -308
- package/sdk/application/Common/CommonApplicationValidator.d.ts +0 -46
- package/sdk/application/Common/CommonApplicationValidator.js +0 -38
- package/sdk/application/Communication/CommunicationApplicationModel.d.ts +0 -293
- package/sdk/application/Communication/CommunicationApplicationModel.js +0 -201
- package/sdk/application/Communication/CommunicationApplicationValidator.d.ts +0 -29
- package/sdk/application/Communication/CommunicationApplicationValidator.js +0 -38
- package/sdk/application/Configuration/ConfigurationApplicationModel.d.ts +0 -2556
- package/sdk/application/Configuration/ConfigurationApplicationModel.js +0 -1887
- package/sdk/application/Configuration/ConfigurationApplicationValidator.d.ts +0 -179
- package/sdk/application/Configuration/ConfigurationApplicationValidator.js +0 -176
- package/sdk/application/Content/ContentApplicationModel.d.ts +0 -2133
- package/sdk/application/Content/ContentApplicationModel.js +0 -1589
- package/sdk/application/Content/ContentApplicationValidator.d.ts +0 -284
- package/sdk/application/Content/ContentApplicationValidator.js +0 -264
- package/sdk/application/FileStorage/FileStorageApplicationModel.d.ts +0 -272
- package/sdk/application/FileStorage/FileStorageApplicationModel.js +0 -190
- package/sdk/application/FileStorage/FileStorageApplicationValidator.d.ts +0 -56
- package/sdk/application/FileStorage/FileStorageApplicationValidator.js +0 -53
- package/sdk/application/Lead/LeadApplicationModel.d.ts +0 -590
- package/sdk/application/Lead/LeadApplicationModel.js +0 -480
- package/sdk/application/Lead/LeadApplicationValidator.d.ts +0 -68
- package/sdk/application/Lead/LeadApplicationValidator.js +0 -71
- package/sdk/application/Logistic/LogisticApplicationModel.d.ts +0 -1675
- package/sdk/application/Logistic/LogisticApplicationModel.js +0 -1121
- package/sdk/application/Logistic/LogisticApplicationValidator.d.ts +0 -254
- package/sdk/application/Logistic/LogisticApplicationValidator.js +0 -190
- package/sdk/application/Order/OrderApplicationModel.d.ts +0 -2296
- package/sdk/application/Order/OrderApplicationModel.js +0 -1471
- package/sdk/application/Order/OrderApplicationValidator.d.ts +0 -265
- package/sdk/application/Order/OrderApplicationValidator.js +0 -197
- package/sdk/application/Payment/PaymentApplicationModel.d.ts +0 -4058
- package/sdk/application/Payment/PaymentApplicationModel.js +0 -2630
- package/sdk/application/Payment/PaymentApplicationValidator.d.ts +0 -576
- package/sdk/application/Payment/PaymentApplicationValidator.js +0 -594
- package/sdk/application/Rewards/RewardsApplicationModel.d.ts +0 -365
- package/sdk/application/Rewards/RewardsApplicationModel.js +0 -396
- package/sdk/application/Rewards/RewardsApplicationValidator.d.ts +0 -73
- package/sdk/application/Rewards/RewardsApplicationValidator.js +0 -84
- package/sdk/application/Share/ShareApplicationModel.d.ts +0 -339
- package/sdk/application/Share/ShareApplicationModel.js +0 -234
- package/sdk/application/Share/ShareApplicationValidator.d.ts +0 -90
- package/sdk/application/Share/ShareApplicationValidator.js +0 -91
- package/sdk/application/Theme/ThemeApplicationModel.d.ts +0 -1713
- package/sdk/application/Theme/ThemeApplicationModel.js +0 -1426
- package/sdk/application/Theme/ThemeApplicationValidator.d.ts +0 -66
- package/sdk/application/Theme/ThemeApplicationValidator.js +0 -58
- package/sdk/application/User/UserApplicationModel.d.ts +0 -1943
- package/sdk/application/User/UserApplicationModel.js +0 -1382
- package/sdk/application/User/UserApplicationValidator.d.ts +0 -560
- package/sdk/application/User/UserApplicationValidator.js +0 -573
- package/sdk/application/Webhook/WebhookApplicationModel.d.ts +0 -52
- package/sdk/application/Webhook/WebhookApplicationModel.js +0 -46
- package/sdk/application/Webhook/WebhookApplicationValidator.d.ts +0 -16
- package/sdk/application/Webhook/WebhookApplicationValidator.js +0 -19
- package/sdk/common/Clickstream.d.ts +0 -1
- package/sdk/common/Clickstream.js +0 -464
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
const ApplicationAPIClient = require("../ApplicationAPIClient");
|
|
2
1
|
const {
|
|
3
2
|
FDKClientValidationError,
|
|
4
3
|
FDKResponseValidationError,
|
|
5
4
|
} = require("../../common/FDKError");
|
|
5
|
+
|
|
6
|
+
const ApplicationAPIClient = require("../ApplicationAPIClient");
|
|
6
7
|
const constructUrl = require("../constructUrl");
|
|
7
8
|
const Paginator = require("../../common/Paginator");
|
|
8
|
-
const
|
|
9
|
-
const OrderApplicationModel = require("./OrderApplicationModel");
|
|
10
|
-
const { Logger } = require("./../../common/Logger");
|
|
11
|
-
const Joi = require("joi");
|
|
9
|
+
const { validateRequiredParams } = require("../../common/Validator");
|
|
12
10
|
|
|
13
11
|
class Order {
|
|
14
12
|
constructor(_conf) {
|
|
@@ -52,13 +50,9 @@ class Order {
|
|
|
52
50
|
}
|
|
53
51
|
|
|
54
52
|
/**
|
|
55
|
-
* @param {OrderApplicationValidator.GetCustomerDetailsByShipmentIdParam} arg
|
|
56
|
-
* - Arg object.
|
|
57
|
-
*
|
|
58
53
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
59
54
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
60
|
-
* @returns {Promise<
|
|
61
|
-
* Success response
|
|
55
|
+
* @returns {Promise<CustomerDetailsResponse>} - Success response
|
|
62
56
|
* @name getCustomerDetailsByShipmentId
|
|
63
57
|
* @summary: Get shipment's customer
|
|
64
58
|
* @description: Get customer details such as mobile number using Shipment ID. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/order/getCustomerDetailsByShipmentId/).
|
|
@@ -67,28 +61,16 @@ class Order {
|
|
|
67
61
|
{ orderId, shipmentId, requestHeaders } = { requestHeaders: {} },
|
|
68
62
|
{ responseHeaders } = { responseHeaders: false }
|
|
69
63
|
) {
|
|
70
|
-
const
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
// Showing warrnings if extra unknown parameters are found
|
|
81
|
-
const {
|
|
82
|
-
error: warrning,
|
|
83
|
-
} = OrderApplicationValidator.getCustomerDetailsByShipmentId().validate(
|
|
84
|
-
{ orderId, shipmentId },
|
|
85
|
-
{ abortEarly: false, allowUnknown: false }
|
|
86
|
-
);
|
|
87
|
-
if (warrning) {
|
|
88
|
-
Logger({
|
|
89
|
-
level: "WARN",
|
|
90
|
-
message: `Parameter Validation warrnings for application > Order > getCustomerDetailsByShipmentId \n ${warrning}`,
|
|
64
|
+
const errors = validateRequiredParams(arguments[0], [
|
|
65
|
+
"orderId",
|
|
66
|
+
"shipmentId",
|
|
67
|
+
]);
|
|
68
|
+
if (errors.length > 0) {
|
|
69
|
+
const error = new FDKClientValidationError({
|
|
70
|
+
message: "Missing required field",
|
|
71
|
+
details: errors,
|
|
91
72
|
});
|
|
73
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
92
74
|
}
|
|
93
75
|
|
|
94
76
|
const query_params = {};
|
|
@@ -113,33 +95,13 @@ class Order {
|
|
|
113
95
|
responseData = response[0];
|
|
114
96
|
}
|
|
115
97
|
|
|
116
|
-
const {
|
|
117
|
-
error: res_error,
|
|
118
|
-
} = OrderApplicationModel.CustomerDetailsResponse().validate(responseData, {
|
|
119
|
-
abortEarly: false,
|
|
120
|
-
allowUnknown: true,
|
|
121
|
-
});
|
|
122
|
-
|
|
123
|
-
if (res_error) {
|
|
124
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
125
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
126
|
-
} else {
|
|
127
|
-
Logger({
|
|
128
|
-
level: "WARN",
|
|
129
|
-
message: `Response Validation Warnings for application > Order > getCustomerDetailsByShipmentId \n ${res_error}`,
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
|
|
134
98
|
return response;
|
|
135
99
|
}
|
|
136
100
|
|
|
137
101
|
/**
|
|
138
|
-
* @param {OrderApplicationValidator.GetInvoiceByShipmentIdParam} arg - Arg object.
|
|
139
102
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
140
103
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
141
|
-
* @returns {Promise<
|
|
142
|
-
* Success response
|
|
104
|
+
* @returns {Promise<ResponseGetInvoiceShipment>} - Success response
|
|
143
105
|
* @name getInvoiceByShipmentId
|
|
144
106
|
* @summary: Retrieves invoice for shipment
|
|
145
107
|
* @description: Get invoice corresponding to a specific shipment ID. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/order/getInvoiceByShipmentId/).
|
|
@@ -148,28 +110,13 @@ class Order {
|
|
|
148
110
|
{ shipmentId, requestHeaders } = { requestHeaders: {} },
|
|
149
111
|
{ responseHeaders } = { responseHeaders: false }
|
|
150
112
|
) {
|
|
151
|
-
const
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
);
|
|
157
|
-
if (error) {
|
|
158
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
// Showing warrnings if extra unknown parameters are found
|
|
162
|
-
const {
|
|
163
|
-
error: warrning,
|
|
164
|
-
} = OrderApplicationValidator.getInvoiceByShipmentId().validate(
|
|
165
|
-
{ shipmentId },
|
|
166
|
-
{ abortEarly: false, allowUnknown: false }
|
|
167
|
-
);
|
|
168
|
-
if (warrning) {
|
|
169
|
-
Logger({
|
|
170
|
-
level: "WARN",
|
|
171
|
-
message: `Parameter Validation warrnings for application > Order > getInvoiceByShipmentId \n ${warrning}`,
|
|
113
|
+
const errors = validateRequiredParams(arguments[0], ["shipmentId"]);
|
|
114
|
+
if (errors.length > 0) {
|
|
115
|
+
const error = new FDKClientValidationError({
|
|
116
|
+
message: "Missing required field",
|
|
117
|
+
details: errors,
|
|
172
118
|
});
|
|
119
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
173
120
|
}
|
|
174
121
|
|
|
175
122
|
const query_params = {};
|
|
@@ -194,32 +141,13 @@ class Order {
|
|
|
194
141
|
responseData = response[0];
|
|
195
142
|
}
|
|
196
143
|
|
|
197
|
-
const {
|
|
198
|
-
error: res_error,
|
|
199
|
-
} = OrderApplicationModel.ResponseGetInvoiceShipment().validate(
|
|
200
|
-
responseData,
|
|
201
|
-
{ abortEarly: false, allowUnknown: true }
|
|
202
|
-
);
|
|
203
|
-
|
|
204
|
-
if (res_error) {
|
|
205
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
206
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
207
|
-
} else {
|
|
208
|
-
Logger({
|
|
209
|
-
level: "WARN",
|
|
210
|
-
message: `Response Validation Warnings for application > Order > getInvoiceByShipmentId \n ${res_error}`,
|
|
211
|
-
});
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
|
|
215
144
|
return response;
|
|
216
145
|
}
|
|
217
146
|
|
|
218
147
|
/**
|
|
219
|
-
* @param {OrderApplicationValidator.GetOrderByIdParam} arg - Arg object.
|
|
220
148
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
221
149
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
222
|
-
* @returns {Promise<
|
|
150
|
+
* @returns {Promise<OrderById>} - Success response
|
|
223
151
|
* @name getOrderById
|
|
224
152
|
* @summary: Get an order
|
|
225
153
|
* @description: Get order details such as tracking details, shipment, store information using Fynd Order ID. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/order/getOrderById/).
|
|
@@ -228,26 +156,13 @@ class Order {
|
|
|
228
156
|
{ orderId, allowInactive, requestHeaders } = { requestHeaders: {} },
|
|
229
157
|
{ responseHeaders } = { responseHeaders: false }
|
|
230
158
|
) {
|
|
231
|
-
const
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
// Showing warrnings if extra unknown parameters are found
|
|
240
|
-
const {
|
|
241
|
-
error: warrning,
|
|
242
|
-
} = OrderApplicationValidator.getOrderById().validate(
|
|
243
|
-
{ orderId, allowInactive },
|
|
244
|
-
{ abortEarly: false, allowUnknown: false }
|
|
245
|
-
);
|
|
246
|
-
if (warrning) {
|
|
247
|
-
Logger({
|
|
248
|
-
level: "WARN",
|
|
249
|
-
message: `Parameter Validation warrnings for application > Order > getOrderById \n ${warrning}`,
|
|
159
|
+
const errors = validateRequiredParams(arguments[0], ["orderId"]);
|
|
160
|
+
if (errors.length > 0) {
|
|
161
|
+
const error = new FDKClientValidationError({
|
|
162
|
+
message: "Missing required field",
|
|
163
|
+
details: errors,
|
|
250
164
|
});
|
|
165
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
251
166
|
}
|
|
252
167
|
|
|
253
168
|
const query_params = {};
|
|
@@ -273,32 +188,13 @@ class Order {
|
|
|
273
188
|
responseData = response[0];
|
|
274
189
|
}
|
|
275
190
|
|
|
276
|
-
const {
|
|
277
|
-
error: res_error,
|
|
278
|
-
} = OrderApplicationModel.OrderById().validate(responseData, {
|
|
279
|
-
abortEarly: false,
|
|
280
|
-
allowUnknown: true,
|
|
281
|
-
});
|
|
282
|
-
|
|
283
|
-
if (res_error) {
|
|
284
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
285
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
286
|
-
} else {
|
|
287
|
-
Logger({
|
|
288
|
-
level: "WARN",
|
|
289
|
-
message: `Response Validation Warnings for application > Order > getOrderById \n ${res_error}`,
|
|
290
|
-
});
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
|
|
294
191
|
return response;
|
|
295
192
|
}
|
|
296
193
|
|
|
297
194
|
/**
|
|
298
|
-
* @param {OrderApplicationValidator.GetOrdersParam} arg - Arg object.
|
|
299
195
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
300
196
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
301
|
-
* @returns {Promise<
|
|
197
|
+
* @returns {Promise<OrderList>} - Success response
|
|
302
198
|
* @name getOrders
|
|
303
199
|
* @summary: List customer orders
|
|
304
200
|
* @description: Get all orders associated with a customer account. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/order/getOrders/).
|
|
@@ -318,46 +214,6 @@ class Order {
|
|
|
318
214
|
} = { requestHeaders: {} },
|
|
319
215
|
{ responseHeaders } = { responseHeaders: false }
|
|
320
216
|
) {
|
|
321
|
-
const { error } = OrderApplicationValidator.getOrders().validate(
|
|
322
|
-
{
|
|
323
|
-
status,
|
|
324
|
-
pageNo,
|
|
325
|
-
pageSize,
|
|
326
|
-
fromDate,
|
|
327
|
-
toDate,
|
|
328
|
-
startDate,
|
|
329
|
-
endDate,
|
|
330
|
-
customMeta,
|
|
331
|
-
allowInactive,
|
|
332
|
-
},
|
|
333
|
-
{ abortEarly: false, allowUnknown: true }
|
|
334
|
-
);
|
|
335
|
-
if (error) {
|
|
336
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
// Showing warrnings if extra unknown parameters are found
|
|
340
|
-
const { error: warrning } = OrderApplicationValidator.getOrders().validate(
|
|
341
|
-
{
|
|
342
|
-
status,
|
|
343
|
-
pageNo,
|
|
344
|
-
pageSize,
|
|
345
|
-
fromDate,
|
|
346
|
-
toDate,
|
|
347
|
-
startDate,
|
|
348
|
-
endDate,
|
|
349
|
-
customMeta,
|
|
350
|
-
allowInactive,
|
|
351
|
-
},
|
|
352
|
-
{ abortEarly: false, allowUnknown: false }
|
|
353
|
-
);
|
|
354
|
-
if (warrning) {
|
|
355
|
-
Logger({
|
|
356
|
-
level: "WARN",
|
|
357
|
-
message: `Parameter Validation warrnings for application > Order > getOrders \n ${warrning}`,
|
|
358
|
-
});
|
|
359
|
-
}
|
|
360
|
-
|
|
361
217
|
const query_params = {};
|
|
362
218
|
query_params["status"] = status;
|
|
363
219
|
query_params["page_no"] = pageNo;
|
|
@@ -389,32 +245,13 @@ class Order {
|
|
|
389
245
|
responseData = response[0];
|
|
390
246
|
}
|
|
391
247
|
|
|
392
|
-
const {
|
|
393
|
-
error: res_error,
|
|
394
|
-
} = OrderApplicationModel.OrderList().validate(responseData, {
|
|
395
|
-
abortEarly: false,
|
|
396
|
-
allowUnknown: true,
|
|
397
|
-
});
|
|
398
|
-
|
|
399
|
-
if (res_error) {
|
|
400
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
401
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
402
|
-
} else {
|
|
403
|
-
Logger({
|
|
404
|
-
level: "WARN",
|
|
405
|
-
message: `Response Validation Warnings for application > Order > getOrders \n ${res_error}`,
|
|
406
|
-
});
|
|
407
|
-
}
|
|
408
|
-
}
|
|
409
|
-
|
|
410
248
|
return response;
|
|
411
249
|
}
|
|
412
250
|
|
|
413
251
|
/**
|
|
414
|
-
* @param {OrderApplicationValidator.GetShipmentBagReasonsParam} arg - Arg object.
|
|
415
252
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
416
253
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
417
|
-
* @returns {Promise<
|
|
254
|
+
* @returns {Promise<ShipmentBagReasons>} - Success response
|
|
418
255
|
* @name getShipmentBagReasons
|
|
419
256
|
* @summary: List bag cancellation reasons
|
|
420
257
|
* @description: Get reasons to perform full or partial cancellation of a bag. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/order/getShipmentBagReasons/).
|
|
@@ -423,28 +260,16 @@ class Order {
|
|
|
423
260
|
{ shipmentId, bagId, requestHeaders } = { requestHeaders: {} },
|
|
424
261
|
{ responseHeaders } = { responseHeaders: false }
|
|
425
262
|
) {
|
|
426
|
-
const
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
}
|
|
435
|
-
|
|
436
|
-
// Showing warrnings if extra unknown parameters are found
|
|
437
|
-
const {
|
|
438
|
-
error: warrning,
|
|
439
|
-
} = OrderApplicationValidator.getShipmentBagReasons().validate(
|
|
440
|
-
{ shipmentId, bagId },
|
|
441
|
-
{ abortEarly: false, allowUnknown: false }
|
|
442
|
-
);
|
|
443
|
-
if (warrning) {
|
|
444
|
-
Logger({
|
|
445
|
-
level: "WARN",
|
|
446
|
-
message: `Parameter Validation warrnings for application > Order > getShipmentBagReasons \n ${warrning}`,
|
|
263
|
+
const errors = validateRequiredParams(arguments[0], [
|
|
264
|
+
"shipmentId",
|
|
265
|
+
"bagId",
|
|
266
|
+
]);
|
|
267
|
+
if (errors.length > 0) {
|
|
268
|
+
const error = new FDKClientValidationError({
|
|
269
|
+
message: "Missing required field",
|
|
270
|
+
details: errors,
|
|
447
271
|
});
|
|
272
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
448
273
|
}
|
|
449
274
|
|
|
450
275
|
const query_params = {};
|
|
@@ -469,32 +294,13 @@ class Order {
|
|
|
469
294
|
responseData = response[0];
|
|
470
295
|
}
|
|
471
296
|
|
|
472
|
-
const {
|
|
473
|
-
error: res_error,
|
|
474
|
-
} = OrderApplicationModel.ShipmentBagReasons().validate(responseData, {
|
|
475
|
-
abortEarly: false,
|
|
476
|
-
allowUnknown: true,
|
|
477
|
-
});
|
|
478
|
-
|
|
479
|
-
if (res_error) {
|
|
480
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
481
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
482
|
-
} else {
|
|
483
|
-
Logger({
|
|
484
|
-
level: "WARN",
|
|
485
|
-
message: `Response Validation Warnings for application > Order > getShipmentBagReasons \n ${res_error}`,
|
|
486
|
-
});
|
|
487
|
-
}
|
|
488
|
-
}
|
|
489
|
-
|
|
490
297
|
return response;
|
|
491
298
|
}
|
|
492
299
|
|
|
493
300
|
/**
|
|
494
|
-
* @param {OrderApplicationValidator.GetShipmentByIdParam} arg - Arg object.
|
|
495
301
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
496
302
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
497
|
-
* @returns {Promise<
|
|
303
|
+
* @returns {Promise<ShipmentById>} - Success response
|
|
498
304
|
* @name getShipmentById
|
|
499
305
|
* @summary: Get a Shipment
|
|
500
306
|
* @description: Get shipment details such as price breakup, tracking details, store information, etc. using Shipment ID. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/order/getShipmentById/).
|
|
@@ -503,26 +309,13 @@ class Order {
|
|
|
503
309
|
{ shipmentId, allowInactive, requestHeaders } = { requestHeaders: {} },
|
|
504
310
|
{ responseHeaders } = { responseHeaders: false }
|
|
505
311
|
) {
|
|
506
|
-
const
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
512
|
-
}
|
|
513
|
-
|
|
514
|
-
// Showing warrnings if extra unknown parameters are found
|
|
515
|
-
const {
|
|
516
|
-
error: warrning,
|
|
517
|
-
} = OrderApplicationValidator.getShipmentById().validate(
|
|
518
|
-
{ shipmentId, allowInactive },
|
|
519
|
-
{ abortEarly: false, allowUnknown: false }
|
|
520
|
-
);
|
|
521
|
-
if (warrning) {
|
|
522
|
-
Logger({
|
|
523
|
-
level: "WARN",
|
|
524
|
-
message: `Parameter Validation warrnings for application > Order > getShipmentById \n ${warrning}`,
|
|
312
|
+
const errors = validateRequiredParams(arguments[0], ["shipmentId"]);
|
|
313
|
+
if (errors.length > 0) {
|
|
314
|
+
const error = new FDKClientValidationError({
|
|
315
|
+
message: "Missing required field",
|
|
316
|
+
details: errors,
|
|
525
317
|
});
|
|
318
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
526
319
|
}
|
|
527
320
|
|
|
528
321
|
const query_params = {};
|
|
@@ -548,32 +341,13 @@ class Order {
|
|
|
548
341
|
responseData = response[0];
|
|
549
342
|
}
|
|
550
343
|
|
|
551
|
-
const {
|
|
552
|
-
error: res_error,
|
|
553
|
-
} = OrderApplicationModel.ShipmentById().validate(responseData, {
|
|
554
|
-
abortEarly: false,
|
|
555
|
-
allowUnknown: true,
|
|
556
|
-
});
|
|
557
|
-
|
|
558
|
-
if (res_error) {
|
|
559
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
560
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
561
|
-
} else {
|
|
562
|
-
Logger({
|
|
563
|
-
level: "WARN",
|
|
564
|
-
message: `Response Validation Warnings for application > Order > getShipmentById \n ${res_error}`,
|
|
565
|
-
});
|
|
566
|
-
}
|
|
567
|
-
}
|
|
568
|
-
|
|
569
344
|
return response;
|
|
570
345
|
}
|
|
571
346
|
|
|
572
347
|
/**
|
|
573
|
-
* @param {OrderApplicationValidator.GetShipmentReasonsParam} arg - Arg object.
|
|
574
348
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
575
349
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
576
|
-
* @returns {Promise<
|
|
350
|
+
* @returns {Promise<ShipmentReasons>} - Success response
|
|
577
351
|
* @name getShipmentReasons
|
|
578
352
|
* @summary: List shipment cancellation reasons
|
|
579
353
|
* @description: Get reasons to perform full or partial cancellation of a shipment. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/order/getShipmentReasons/).
|
|
@@ -582,26 +356,13 @@ class Order {
|
|
|
582
356
|
{ shipmentId, requestHeaders } = { requestHeaders: {} },
|
|
583
357
|
{ responseHeaders } = { responseHeaders: false }
|
|
584
358
|
) {
|
|
585
|
-
const
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
591
|
-
}
|
|
592
|
-
|
|
593
|
-
// Showing warrnings if extra unknown parameters are found
|
|
594
|
-
const {
|
|
595
|
-
error: warrning,
|
|
596
|
-
} = OrderApplicationValidator.getShipmentReasons().validate(
|
|
597
|
-
{ shipmentId },
|
|
598
|
-
{ abortEarly: false, allowUnknown: false }
|
|
599
|
-
);
|
|
600
|
-
if (warrning) {
|
|
601
|
-
Logger({
|
|
602
|
-
level: "WARN",
|
|
603
|
-
message: `Parameter Validation warrnings for application > Order > getShipmentReasons \n ${warrning}`,
|
|
359
|
+
const errors = validateRequiredParams(arguments[0], ["shipmentId"]);
|
|
360
|
+
if (errors.length > 0) {
|
|
361
|
+
const error = new FDKClientValidationError({
|
|
362
|
+
message: "Missing required field",
|
|
363
|
+
details: errors,
|
|
604
364
|
});
|
|
365
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
605
366
|
}
|
|
606
367
|
|
|
607
368
|
const query_params = {};
|
|
@@ -626,33 +387,13 @@ class Order {
|
|
|
626
387
|
responseData = response[0];
|
|
627
388
|
}
|
|
628
389
|
|
|
629
|
-
const {
|
|
630
|
-
error: res_error,
|
|
631
|
-
} = OrderApplicationModel.ShipmentReasons().validate(responseData, {
|
|
632
|
-
abortEarly: false,
|
|
633
|
-
allowUnknown: true,
|
|
634
|
-
});
|
|
635
|
-
|
|
636
|
-
if (res_error) {
|
|
637
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
638
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
639
|
-
} else {
|
|
640
|
-
Logger({
|
|
641
|
-
level: "WARN",
|
|
642
|
-
message: `Response Validation Warnings for application > Order > getShipmentReasons \n ${res_error}`,
|
|
643
|
-
});
|
|
644
|
-
}
|
|
645
|
-
}
|
|
646
|
-
|
|
647
390
|
return response;
|
|
648
391
|
}
|
|
649
392
|
|
|
650
393
|
/**
|
|
651
|
-
* @param {OrderApplicationValidator.SendOtpToShipmentCustomerParam} arg - Arg object.
|
|
652
394
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
653
395
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
654
|
-
* @returns {Promise<
|
|
655
|
-
* Success response
|
|
396
|
+
* @returns {Promise<SendOtpToCustomerResponse>} - Success response
|
|
656
397
|
* @name sendOtpToShipmentCustomer
|
|
657
398
|
* @summary: Send OTP to customer
|
|
658
399
|
* @description: Send OTP to the customer for shipment verification. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/order/sendOtpToShipmentCustomer/).
|
|
@@ -661,28 +402,16 @@ class Order {
|
|
|
661
402
|
{ orderId, shipmentId, requestHeaders } = { requestHeaders: {} },
|
|
662
403
|
{ responseHeaders } = { responseHeaders: false }
|
|
663
404
|
) {
|
|
664
|
-
const
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
}
|
|
673
|
-
|
|
674
|
-
// Showing warrnings if extra unknown parameters are found
|
|
675
|
-
const {
|
|
676
|
-
error: warrning,
|
|
677
|
-
} = OrderApplicationValidator.sendOtpToShipmentCustomer().validate(
|
|
678
|
-
{ orderId, shipmentId },
|
|
679
|
-
{ abortEarly: false, allowUnknown: false }
|
|
680
|
-
);
|
|
681
|
-
if (warrning) {
|
|
682
|
-
Logger({
|
|
683
|
-
level: "WARN",
|
|
684
|
-
message: `Parameter Validation warrnings for application > Order > sendOtpToShipmentCustomer \n ${warrning}`,
|
|
405
|
+
const errors = validateRequiredParams(arguments[0], [
|
|
406
|
+
"orderId",
|
|
407
|
+
"shipmentId",
|
|
408
|
+
]);
|
|
409
|
+
if (errors.length > 0) {
|
|
410
|
+
const error = new FDKClientValidationError({
|
|
411
|
+
message: "Missing required field",
|
|
412
|
+
details: errors,
|
|
685
413
|
});
|
|
414
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
686
415
|
}
|
|
687
416
|
|
|
688
417
|
const query_params = {};
|
|
@@ -707,32 +436,13 @@ class Order {
|
|
|
707
436
|
responseData = response[0];
|
|
708
437
|
}
|
|
709
438
|
|
|
710
|
-
const {
|
|
711
|
-
error: res_error,
|
|
712
|
-
} = OrderApplicationModel.SendOtpToCustomerResponse().validate(
|
|
713
|
-
responseData,
|
|
714
|
-
{ abortEarly: false, allowUnknown: true }
|
|
715
|
-
);
|
|
716
|
-
|
|
717
|
-
if (res_error) {
|
|
718
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
719
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
720
|
-
} else {
|
|
721
|
-
Logger({
|
|
722
|
-
level: "WARN",
|
|
723
|
-
message: `Response Validation Warnings for application > Order > sendOtpToShipmentCustomer \n ${res_error}`,
|
|
724
|
-
});
|
|
725
|
-
}
|
|
726
|
-
}
|
|
727
|
-
|
|
728
439
|
return response;
|
|
729
440
|
}
|
|
730
441
|
|
|
731
442
|
/**
|
|
732
|
-
* @param {OrderApplicationValidator.TrackShipmentParam} arg - Arg object.
|
|
733
443
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
734
444
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
735
|
-
* @returns {Promise<
|
|
445
|
+
* @returns {Promise<ShipmentTrack>} - Success response
|
|
736
446
|
* @name trackShipment
|
|
737
447
|
* @summary: Track shipment status
|
|
738
448
|
* @description: Track Shipment by shipment id, for application based on application Id. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/order/trackShipment/).
|
|
@@ -741,26 +451,13 @@ class Order {
|
|
|
741
451
|
{ shipmentId, requestHeaders } = { requestHeaders: {} },
|
|
742
452
|
{ responseHeaders } = { responseHeaders: false }
|
|
743
453
|
) {
|
|
744
|
-
const
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
750
|
-
}
|
|
751
|
-
|
|
752
|
-
// Showing warrnings if extra unknown parameters are found
|
|
753
|
-
const {
|
|
754
|
-
error: warrning,
|
|
755
|
-
} = OrderApplicationValidator.trackShipment().validate(
|
|
756
|
-
{ shipmentId },
|
|
757
|
-
{ abortEarly: false, allowUnknown: false }
|
|
758
|
-
);
|
|
759
|
-
if (warrning) {
|
|
760
|
-
Logger({
|
|
761
|
-
level: "WARN",
|
|
762
|
-
message: `Parameter Validation warrnings for application > Order > trackShipment \n ${warrning}`,
|
|
454
|
+
const errors = validateRequiredParams(arguments[0], ["shipmentId"]);
|
|
455
|
+
if (errors.length > 0) {
|
|
456
|
+
const error = new FDKClientValidationError({
|
|
457
|
+
message: "Missing required field",
|
|
458
|
+
details: errors,
|
|
763
459
|
});
|
|
460
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
764
461
|
}
|
|
765
462
|
|
|
766
463
|
const query_params = {};
|
|
@@ -785,34 +482,13 @@ class Order {
|
|
|
785
482
|
responseData = response[0];
|
|
786
483
|
}
|
|
787
484
|
|
|
788
|
-
const {
|
|
789
|
-
error: res_error,
|
|
790
|
-
} = OrderApplicationModel.ShipmentTrack().validate(responseData, {
|
|
791
|
-
abortEarly: false,
|
|
792
|
-
allowUnknown: true,
|
|
793
|
-
});
|
|
794
|
-
|
|
795
|
-
if (res_error) {
|
|
796
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
797
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
798
|
-
} else {
|
|
799
|
-
Logger({
|
|
800
|
-
level: "WARN",
|
|
801
|
-
message: `Response Validation Warnings for application > Order > trackShipment \n ${res_error}`,
|
|
802
|
-
});
|
|
803
|
-
}
|
|
804
|
-
}
|
|
805
|
-
|
|
806
485
|
return response;
|
|
807
486
|
}
|
|
808
487
|
|
|
809
488
|
/**
|
|
810
|
-
* @param {OrderApplicationValidator.UpdateShipmentStatusParam} arg - Arg object.
|
|
811
489
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
812
490
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
813
|
-
* @returns {Promise<
|
|
814
|
-
* - Success response
|
|
815
|
-
*
|
|
491
|
+
* @returns {Promise<ShipmentApplicationStatusResponse>} - Success response
|
|
816
492
|
* @name updateShipmentStatus
|
|
817
493
|
* @summary: Updates shipment status
|
|
818
494
|
* @description: Update current status of a specific shipment using its shipment ID. Supports both partial and full transition as per the configured settings. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/order/updateShipmentStatus/).
|
|
@@ -821,26 +497,13 @@ class Order {
|
|
|
821
497
|
{ shipmentId, body, requestHeaders } = { requestHeaders: {} },
|
|
822
498
|
{ responseHeaders } = { responseHeaders: false }
|
|
823
499
|
) {
|
|
824
|
-
const
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
830
|
-
}
|
|
831
|
-
|
|
832
|
-
// Showing warrnings if extra unknown parameters are found
|
|
833
|
-
const {
|
|
834
|
-
error: warrning,
|
|
835
|
-
} = OrderApplicationValidator.updateShipmentStatus().validate(
|
|
836
|
-
{ shipmentId, body },
|
|
837
|
-
{ abortEarly: false, allowUnknown: false }
|
|
838
|
-
);
|
|
839
|
-
if (warrning) {
|
|
840
|
-
Logger({
|
|
841
|
-
level: "WARN",
|
|
842
|
-
message: `Parameter Validation warrnings for application > Order > updateShipmentStatus \n ${warrning}`,
|
|
500
|
+
const errors = validateRequiredParams(arguments[0], ["shipmentId"]);
|
|
501
|
+
if (errors.length > 0) {
|
|
502
|
+
const error = new FDKClientValidationError({
|
|
503
|
+
message: "Missing required field",
|
|
504
|
+
details: errors,
|
|
843
505
|
});
|
|
506
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
844
507
|
}
|
|
845
508
|
|
|
846
509
|
const query_params = {};
|
|
@@ -865,32 +528,13 @@ class Order {
|
|
|
865
528
|
responseData = response[0];
|
|
866
529
|
}
|
|
867
530
|
|
|
868
|
-
const {
|
|
869
|
-
error: res_error,
|
|
870
|
-
} = OrderApplicationModel.ShipmentApplicationStatusResponse().validate(
|
|
871
|
-
responseData,
|
|
872
|
-
{ abortEarly: false, allowUnknown: true }
|
|
873
|
-
);
|
|
874
|
-
|
|
875
|
-
if (res_error) {
|
|
876
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
877
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
878
|
-
} else {
|
|
879
|
-
Logger({
|
|
880
|
-
level: "WARN",
|
|
881
|
-
message: `Response Validation Warnings for application > Order > updateShipmentStatus \n ${res_error}`,
|
|
882
|
-
});
|
|
883
|
-
}
|
|
884
|
-
}
|
|
885
|
-
|
|
886
531
|
return response;
|
|
887
532
|
}
|
|
888
533
|
|
|
889
534
|
/**
|
|
890
|
-
* @param {OrderApplicationValidator.VerifyOtpShipmentCustomerParam} arg - Arg object.
|
|
891
535
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
892
536
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
893
|
-
* @returns {Promise<
|
|
537
|
+
* @returns {Promise<VerifyOtpResponse>} - Success response
|
|
894
538
|
* @name verifyOtpShipmentCustomer
|
|
895
539
|
* @summary: Verifies OTP
|
|
896
540
|
* @description: Verify OTP sent by customer. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/order/verifyOtpShipmentCustomer/).
|
|
@@ -899,28 +543,16 @@ class Order {
|
|
|
899
543
|
{ orderId, shipmentId, body, requestHeaders } = { requestHeaders: {} },
|
|
900
544
|
{ responseHeaders } = { responseHeaders: false }
|
|
901
545
|
) {
|
|
902
|
-
const
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
}
|
|
911
|
-
|
|
912
|
-
// Showing warrnings if extra unknown parameters are found
|
|
913
|
-
const {
|
|
914
|
-
error: warrning,
|
|
915
|
-
} = OrderApplicationValidator.verifyOtpShipmentCustomer().validate(
|
|
916
|
-
{ orderId, shipmentId, body },
|
|
917
|
-
{ abortEarly: false, allowUnknown: false }
|
|
918
|
-
);
|
|
919
|
-
if (warrning) {
|
|
920
|
-
Logger({
|
|
921
|
-
level: "WARN",
|
|
922
|
-
message: `Parameter Validation warrnings for application > Order > verifyOtpShipmentCustomer \n ${warrning}`,
|
|
546
|
+
const errors = validateRequiredParams(arguments[0], [
|
|
547
|
+
"orderId",
|
|
548
|
+
"shipmentId",
|
|
549
|
+
]);
|
|
550
|
+
if (errors.length > 0) {
|
|
551
|
+
const error = new FDKClientValidationError({
|
|
552
|
+
message: "Missing required field",
|
|
553
|
+
details: errors,
|
|
923
554
|
});
|
|
555
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
924
556
|
}
|
|
925
557
|
|
|
926
558
|
const query_params = {};
|
|
@@ -945,24 +577,6 @@ class Order {
|
|
|
945
577
|
responseData = response[0];
|
|
946
578
|
}
|
|
947
579
|
|
|
948
|
-
const {
|
|
949
|
-
error: res_error,
|
|
950
|
-
} = OrderApplicationModel.VerifyOtpResponse().validate(responseData, {
|
|
951
|
-
abortEarly: false,
|
|
952
|
-
allowUnknown: true,
|
|
953
|
-
});
|
|
954
|
-
|
|
955
|
-
if (res_error) {
|
|
956
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
957
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
958
|
-
} else {
|
|
959
|
-
Logger({
|
|
960
|
-
level: "WARN",
|
|
961
|
-
message: `Response Validation Warnings for application > Order > verifyOtpShipmentCustomer \n ${res_error}`,
|
|
962
|
-
});
|
|
963
|
-
}
|
|
964
|
-
}
|
|
965
|
-
|
|
966
580
|
return response;
|
|
967
581
|
}
|
|
968
582
|
}
|