@gofynd/fdk-client-javascript 1.4.15-beta.2 → 1.4.15-beta.4
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 +2 -3
- package/sdk/application/ApplicationClient.js +0 -18
- package/sdk/application/Cart/CartApplicationClient.d.ts +55 -90
- package/sdk/application/Cart/CartApplicationClient.js +27 -1203
- package/sdk/application/Catalog/CatalogApplicationClient.d.ts +80 -142
- package/sdk/application/Catalog/CatalogApplicationClient.js +40 -1344
- package/sdk/application/Common/CommonApplicationClient.d.ts +4 -8
- package/sdk/application/Common/CommonApplicationClient.js +2 -92
- package/sdk/application/Communication/CommunicationApplicationClient.d.ts +6 -19
- package/sdk/application/Communication/CommunicationApplicationClient.js +3 -148
- package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +32 -73
- package/sdk/application/Configuration/ConfigurationApplicationClient.js +16 -727
- package/sdk/application/Content/ContentApplicationClient.d.ts +46 -78
- package/sdk/application/Content/ContentApplicationClient.js +23 -941
- package/sdk/application/FileStorage/FileStorageApplicationClient.d.ts +6 -11
- package/sdk/application/FileStorage/FileStorageApplicationClient.js +4 -134
- package/sdk/application/Lead/LeadApplicationClient.d.ts +10 -18
- package/sdk/application/Lead/LeadApplicationClient.js +5 -217
- package/sdk/application/Logistic/LogisticApplicationClient.d.ts +22 -39
- package/sdk/application/Logistic/LogisticApplicationClient.js +11 -496
- package/sdk/application/Order/OrderApplicationClient.d.ts +22 -42
- package/sdk/application/Order/OrderApplicationClient.js +11 -505
- package/sdk/application/Payment/PaymentApplicationClient.d.ts +92 -212
- package/sdk/application/Payment/PaymentApplicationClient.js +46 -2106
- package/sdk/application/Rewards/RewardsApplicationClient.d.ts +14 -28
- package/sdk/application/Rewards/RewardsApplicationClient.js +7 -311
- package/sdk/application/Share/ShareApplicationClient.d.ts +14 -24
- package/sdk/application/Share/ShareApplicationClient.js +7 -309
- package/sdk/application/Theme/ThemeApplicationClient.d.ts +8 -14
- package/sdk/application/Theme/ThemeApplicationClient.js +4 -174
- package/sdk/application/User/UserApplicationClient.d.ts +85 -136
- package/sdk/application/User/UserApplicationClient.js +42 -1818
- package/sdk/application/Webhook/WebhookApplicationClient.d.ts +2 -5
- package/sdk/application/Webhook/WebhookApplicationClient.js +1 -50
- package/sdk/application/index.d.ts +0 -18
- package/sdk/application/index.js +0 -33
- package/sdk/partner/OAuthClient.js +1 -0
- package/sdk/platform/Cart/CartPlatformModel.d.ts +7 -0
- package/sdk/platform/Cart/CartPlatformModel.js +3 -0
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +0 -7
- package/sdk/platform/Catalog/CatalogPlatformModel.js +0 -3
- package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +7 -0
- package/sdk/platform/Configuration/ConfigurationPlatformModel.js +3 -0
- package/sdk/public/Configuration/ConfigurationPublicClient.js +4 -2
- package/sdk/public/Content/ContentPublicClient.js +4 -2
- package/sdk/public/Partner/PartnerPublicClient.js +4 -2
- package/sdk/public/Webhook/WebhookPublicClient.js +4 -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,6 @@
|
|
|
1
1
|
const ApplicationAPIClient = require("../ApplicationAPIClient");
|
|
2
|
-
const {
|
|
3
|
-
FDKClientValidationError,
|
|
4
|
-
FDKResponseValidationError,
|
|
5
|
-
} = require("../../common/FDKError");
|
|
6
2
|
const constructUrl = require("../constructUrl");
|
|
7
3
|
const Paginator = require("../../common/Paginator");
|
|
8
|
-
const OrderApplicationValidator = require("./OrderApplicationValidator");
|
|
9
|
-
const OrderApplicationModel = require("./OrderApplicationModel");
|
|
10
|
-
const { Logger } = require("./../../common/Logger");
|
|
11
|
-
const Joi = require("joi");
|
|
12
4
|
|
|
13
5
|
class Order {
|
|
14
6
|
constructor(_conf) {
|
|
@@ -52,13 +44,9 @@ class Order {
|
|
|
52
44
|
}
|
|
53
45
|
|
|
54
46
|
/**
|
|
55
|
-
* @param {OrderApplicationValidator.GetCustomerDetailsByShipmentIdParam} arg
|
|
56
|
-
* - Arg object.
|
|
57
|
-
*
|
|
58
47
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
59
48
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
60
|
-
* @returns {Promise<
|
|
61
|
-
* Success response
|
|
49
|
+
* @returns {Promise<CustomerDetailsResponse>} - Success response
|
|
62
50
|
* @name getCustomerDetailsByShipmentId
|
|
63
51
|
* @summary: Get shipment's customer
|
|
64
52
|
* @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,30 +55,6 @@ class Order {
|
|
|
67
55
|
{ orderId, shipmentId, requestHeaders } = { requestHeaders: {} },
|
|
68
56
|
{ responseHeaders } = { responseHeaders: false }
|
|
69
57
|
) {
|
|
70
|
-
const {
|
|
71
|
-
error,
|
|
72
|
-
} = OrderApplicationValidator.getCustomerDetailsByShipmentId().validate(
|
|
73
|
-
{ orderId, shipmentId },
|
|
74
|
-
{ abortEarly: false, allowUnknown: true }
|
|
75
|
-
);
|
|
76
|
-
if (error) {
|
|
77
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
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}`,
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
|
-
|
|
94
58
|
const query_params = {};
|
|
95
59
|
|
|
96
60
|
const xHeaders = {};
|
|
@@ -113,33 +77,13 @@ class Order {
|
|
|
113
77
|
responseData = response[0];
|
|
114
78
|
}
|
|
115
79
|
|
|
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
80
|
return response;
|
|
135
81
|
}
|
|
136
82
|
|
|
137
83
|
/**
|
|
138
|
-
* @param {OrderApplicationValidator.GetInvoiceByShipmentIdParam} arg - Arg object.
|
|
139
84
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
140
85
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
141
|
-
* @returns {Promise<
|
|
142
|
-
* Success response
|
|
86
|
+
* @returns {Promise<ResponseGetInvoiceShipment>} - Success response
|
|
143
87
|
* @name getInvoiceByShipmentId
|
|
144
88
|
* @summary: Retrieves invoice for shipment
|
|
145
89
|
* @description: Get invoice corresponding to a specific shipment ID. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/order/getInvoiceByShipmentId/).
|
|
@@ -148,30 +92,6 @@ class Order {
|
|
|
148
92
|
{ shipmentId, requestHeaders } = { requestHeaders: {} },
|
|
149
93
|
{ responseHeaders } = { responseHeaders: false }
|
|
150
94
|
) {
|
|
151
|
-
const {
|
|
152
|
-
error,
|
|
153
|
-
} = OrderApplicationValidator.getInvoiceByShipmentId().validate(
|
|
154
|
-
{ shipmentId },
|
|
155
|
-
{ abortEarly: false, allowUnknown: true }
|
|
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}`,
|
|
172
|
-
});
|
|
173
|
-
}
|
|
174
|
-
|
|
175
95
|
const query_params = {};
|
|
176
96
|
|
|
177
97
|
const xHeaders = {};
|
|
@@ -194,32 +114,13 @@ class Order {
|
|
|
194
114
|
responseData = response[0];
|
|
195
115
|
}
|
|
196
116
|
|
|
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
117
|
return response;
|
|
216
118
|
}
|
|
217
119
|
|
|
218
120
|
/**
|
|
219
|
-
* @param {OrderApplicationValidator.GetOrderByIdParam} arg - Arg object.
|
|
220
121
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
221
122
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
222
|
-
* @returns {Promise<
|
|
123
|
+
* @returns {Promise<OrderById>} - Success response
|
|
223
124
|
* @name getOrderById
|
|
224
125
|
* @summary: Get an order
|
|
225
126
|
* @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,28 +129,6 @@ class Order {
|
|
|
228
129
|
{ orderId, allowInactive, requestHeaders } = { requestHeaders: {} },
|
|
229
130
|
{ responseHeaders } = { responseHeaders: false }
|
|
230
131
|
) {
|
|
231
|
-
const { error } = OrderApplicationValidator.getOrderById().validate(
|
|
232
|
-
{ orderId, allowInactive },
|
|
233
|
-
{ abortEarly: false, allowUnknown: true }
|
|
234
|
-
);
|
|
235
|
-
if (error) {
|
|
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}`,
|
|
250
|
-
});
|
|
251
|
-
}
|
|
252
|
-
|
|
253
132
|
const query_params = {};
|
|
254
133
|
query_params["allow_inactive"] = allowInactive;
|
|
255
134
|
|
|
@@ -273,32 +152,13 @@ class Order {
|
|
|
273
152
|
responseData = response[0];
|
|
274
153
|
}
|
|
275
154
|
|
|
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
155
|
return response;
|
|
295
156
|
}
|
|
296
157
|
|
|
297
158
|
/**
|
|
298
|
-
* @param {OrderApplicationValidator.GetOrdersParam} arg - Arg object.
|
|
299
159
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
300
160
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
301
|
-
* @returns {Promise<
|
|
161
|
+
* @returns {Promise<OrderList>} - Success response
|
|
302
162
|
* @name getOrders
|
|
303
163
|
* @summary: List customer orders
|
|
304
164
|
* @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 +178,6 @@ class Order {
|
|
|
318
178
|
} = { requestHeaders: {} },
|
|
319
179
|
{ responseHeaders } = { responseHeaders: false }
|
|
320
180
|
) {
|
|
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
181
|
const query_params = {};
|
|
362
182
|
query_params["status"] = status;
|
|
363
183
|
query_params["page_no"] = pageNo;
|
|
@@ -389,32 +209,13 @@ class Order {
|
|
|
389
209
|
responseData = response[0];
|
|
390
210
|
}
|
|
391
211
|
|
|
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
212
|
return response;
|
|
411
213
|
}
|
|
412
214
|
|
|
413
215
|
/**
|
|
414
|
-
* @param {OrderApplicationValidator.GetShipmentBagReasonsParam} arg - Arg object.
|
|
415
216
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
416
217
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
417
|
-
* @returns {Promise<
|
|
218
|
+
* @returns {Promise<ShipmentBagReasons>} - Success response
|
|
418
219
|
* @name getShipmentBagReasons
|
|
419
220
|
* @summary: List bag cancellation reasons
|
|
420
221
|
* @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,30 +224,6 @@ class Order {
|
|
|
423
224
|
{ shipmentId, bagId, requestHeaders } = { requestHeaders: {} },
|
|
424
225
|
{ responseHeaders } = { responseHeaders: false }
|
|
425
226
|
) {
|
|
426
|
-
const {
|
|
427
|
-
error,
|
|
428
|
-
} = OrderApplicationValidator.getShipmentBagReasons().validate(
|
|
429
|
-
{ shipmentId, bagId },
|
|
430
|
-
{ abortEarly: false, allowUnknown: true }
|
|
431
|
-
);
|
|
432
|
-
if (error) {
|
|
433
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
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}`,
|
|
447
|
-
});
|
|
448
|
-
}
|
|
449
|
-
|
|
450
227
|
const query_params = {};
|
|
451
228
|
|
|
452
229
|
const xHeaders = {};
|
|
@@ -469,32 +246,13 @@ class Order {
|
|
|
469
246
|
responseData = response[0];
|
|
470
247
|
}
|
|
471
248
|
|
|
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
249
|
return response;
|
|
491
250
|
}
|
|
492
251
|
|
|
493
252
|
/**
|
|
494
|
-
* @param {OrderApplicationValidator.GetShipmentByIdParam} arg - Arg object.
|
|
495
253
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
496
254
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
497
|
-
* @returns {Promise<
|
|
255
|
+
* @returns {Promise<ShipmentById>} - Success response
|
|
498
256
|
* @name getShipmentById
|
|
499
257
|
* @summary: Get a Shipment
|
|
500
258
|
* @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,28 +261,6 @@ class Order {
|
|
|
503
261
|
{ shipmentId, allowInactive, requestHeaders } = { requestHeaders: {} },
|
|
504
262
|
{ responseHeaders } = { responseHeaders: false }
|
|
505
263
|
) {
|
|
506
|
-
const { error } = OrderApplicationValidator.getShipmentById().validate(
|
|
507
|
-
{ shipmentId, allowInactive },
|
|
508
|
-
{ abortEarly: false, allowUnknown: true }
|
|
509
|
-
);
|
|
510
|
-
if (error) {
|
|
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}`,
|
|
525
|
-
});
|
|
526
|
-
}
|
|
527
|
-
|
|
528
264
|
const query_params = {};
|
|
529
265
|
query_params["allow_inactive"] = allowInactive;
|
|
530
266
|
|
|
@@ -548,32 +284,13 @@ class Order {
|
|
|
548
284
|
responseData = response[0];
|
|
549
285
|
}
|
|
550
286
|
|
|
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
287
|
return response;
|
|
570
288
|
}
|
|
571
289
|
|
|
572
290
|
/**
|
|
573
|
-
* @param {OrderApplicationValidator.GetShipmentReasonsParam} arg - Arg object.
|
|
574
291
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
575
292
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
576
|
-
* @returns {Promise<
|
|
293
|
+
* @returns {Promise<ShipmentReasons>} - Success response
|
|
577
294
|
* @name getShipmentReasons
|
|
578
295
|
* @summary: List shipment cancellation reasons
|
|
579
296
|
* @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,28 +299,6 @@ class Order {
|
|
|
582
299
|
{ shipmentId, requestHeaders } = { requestHeaders: {} },
|
|
583
300
|
{ responseHeaders } = { responseHeaders: false }
|
|
584
301
|
) {
|
|
585
|
-
const { error } = OrderApplicationValidator.getShipmentReasons().validate(
|
|
586
|
-
{ shipmentId },
|
|
587
|
-
{ abortEarly: false, allowUnknown: true }
|
|
588
|
-
);
|
|
589
|
-
if (error) {
|
|
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}`,
|
|
604
|
-
});
|
|
605
|
-
}
|
|
606
|
-
|
|
607
302
|
const query_params = {};
|
|
608
303
|
|
|
609
304
|
const xHeaders = {};
|
|
@@ -626,33 +321,13 @@ class Order {
|
|
|
626
321
|
responseData = response[0];
|
|
627
322
|
}
|
|
628
323
|
|
|
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
324
|
return response;
|
|
648
325
|
}
|
|
649
326
|
|
|
650
327
|
/**
|
|
651
|
-
* @param {OrderApplicationValidator.SendOtpToShipmentCustomerParam} arg - Arg object.
|
|
652
328
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
653
329
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
654
|
-
* @returns {Promise<
|
|
655
|
-
* Success response
|
|
330
|
+
* @returns {Promise<SendOtpToCustomerResponse>} - Success response
|
|
656
331
|
* @name sendOtpToShipmentCustomer
|
|
657
332
|
* @summary: Send OTP to customer
|
|
658
333
|
* @description: Send OTP to the customer for shipment verification. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/order/sendOtpToShipmentCustomer/).
|
|
@@ -661,30 +336,6 @@ class Order {
|
|
|
661
336
|
{ orderId, shipmentId, requestHeaders } = { requestHeaders: {} },
|
|
662
337
|
{ responseHeaders } = { responseHeaders: false }
|
|
663
338
|
) {
|
|
664
|
-
const {
|
|
665
|
-
error,
|
|
666
|
-
} = OrderApplicationValidator.sendOtpToShipmentCustomer().validate(
|
|
667
|
-
{ orderId, shipmentId },
|
|
668
|
-
{ abortEarly: false, allowUnknown: true }
|
|
669
|
-
);
|
|
670
|
-
if (error) {
|
|
671
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
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}`,
|
|
685
|
-
});
|
|
686
|
-
}
|
|
687
|
-
|
|
688
339
|
const query_params = {};
|
|
689
340
|
|
|
690
341
|
const xHeaders = {};
|
|
@@ -707,32 +358,13 @@ class Order {
|
|
|
707
358
|
responseData = response[0];
|
|
708
359
|
}
|
|
709
360
|
|
|
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
361
|
return response;
|
|
729
362
|
}
|
|
730
363
|
|
|
731
364
|
/**
|
|
732
|
-
* @param {OrderApplicationValidator.TrackShipmentParam} arg - Arg object.
|
|
733
365
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
734
366
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
735
|
-
* @returns {Promise<
|
|
367
|
+
* @returns {Promise<ShipmentTrack>} - Success response
|
|
736
368
|
* @name trackShipment
|
|
737
369
|
* @summary: Track shipment status
|
|
738
370
|
* @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,28 +373,6 @@ class Order {
|
|
|
741
373
|
{ shipmentId, requestHeaders } = { requestHeaders: {} },
|
|
742
374
|
{ responseHeaders } = { responseHeaders: false }
|
|
743
375
|
) {
|
|
744
|
-
const { error } = OrderApplicationValidator.trackShipment().validate(
|
|
745
|
-
{ shipmentId },
|
|
746
|
-
{ abortEarly: false, allowUnknown: true }
|
|
747
|
-
);
|
|
748
|
-
if (error) {
|
|
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}`,
|
|
763
|
-
});
|
|
764
|
-
}
|
|
765
|
-
|
|
766
376
|
const query_params = {};
|
|
767
377
|
|
|
768
378
|
const xHeaders = {};
|
|
@@ -785,34 +395,13 @@ class Order {
|
|
|
785
395
|
responseData = response[0];
|
|
786
396
|
}
|
|
787
397
|
|
|
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
398
|
return response;
|
|
807
399
|
}
|
|
808
400
|
|
|
809
401
|
/**
|
|
810
|
-
* @param {OrderApplicationValidator.UpdateShipmentStatusParam} arg - Arg object.
|
|
811
402
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
812
403
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
813
|
-
* @returns {Promise<
|
|
814
|
-
* - Success response
|
|
815
|
-
*
|
|
404
|
+
* @returns {Promise<ShipmentApplicationStatusResponse>} - Success response
|
|
816
405
|
* @name updateShipmentStatus
|
|
817
406
|
* @summary: Updates shipment status
|
|
818
407
|
* @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,28 +410,6 @@ class Order {
|
|
|
821
410
|
{ shipmentId, body, requestHeaders } = { requestHeaders: {} },
|
|
822
411
|
{ responseHeaders } = { responseHeaders: false }
|
|
823
412
|
) {
|
|
824
|
-
const { error } = OrderApplicationValidator.updateShipmentStatus().validate(
|
|
825
|
-
{ shipmentId, body },
|
|
826
|
-
{ abortEarly: false, allowUnknown: true }
|
|
827
|
-
);
|
|
828
|
-
if (error) {
|
|
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}`,
|
|
843
|
-
});
|
|
844
|
-
}
|
|
845
|
-
|
|
846
413
|
const query_params = {};
|
|
847
414
|
|
|
848
415
|
const xHeaders = {};
|
|
@@ -865,32 +432,13 @@ class Order {
|
|
|
865
432
|
responseData = response[0];
|
|
866
433
|
}
|
|
867
434
|
|
|
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
435
|
return response;
|
|
887
436
|
}
|
|
888
437
|
|
|
889
438
|
/**
|
|
890
|
-
* @param {OrderApplicationValidator.VerifyOtpShipmentCustomerParam} arg - Arg object.
|
|
891
439
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
892
440
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
893
|
-
* @returns {Promise<
|
|
441
|
+
* @returns {Promise<VerifyOtpResponse>} - Success response
|
|
894
442
|
* @name verifyOtpShipmentCustomer
|
|
895
443
|
* @summary: Verifies OTP
|
|
896
444
|
* @description: Verify OTP sent by customer. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/order/verifyOtpShipmentCustomer/).
|
|
@@ -899,30 +447,6 @@ class Order {
|
|
|
899
447
|
{ orderId, shipmentId, body, requestHeaders } = { requestHeaders: {} },
|
|
900
448
|
{ responseHeaders } = { responseHeaders: false }
|
|
901
449
|
) {
|
|
902
|
-
const {
|
|
903
|
-
error,
|
|
904
|
-
} = OrderApplicationValidator.verifyOtpShipmentCustomer().validate(
|
|
905
|
-
{ orderId, shipmentId, body },
|
|
906
|
-
{ abortEarly: false, allowUnknown: true }
|
|
907
|
-
);
|
|
908
|
-
if (error) {
|
|
909
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
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}`,
|
|
923
|
-
});
|
|
924
|
-
}
|
|
925
|
-
|
|
926
450
|
const query_params = {};
|
|
927
451
|
|
|
928
452
|
const xHeaders = {};
|
|
@@ -945,24 +469,6 @@ class Order {
|
|
|
945
469
|
responseData = response[0];
|
|
946
470
|
}
|
|
947
471
|
|
|
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
472
|
return response;
|
|
967
473
|
}
|
|
968
474
|
}
|