@gofynd/fdk-client-javascript 1.3.3-beta.2 → 1.3.3-beta.3
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 +1 -1
- package/package.json +1 -1
- package/sdk/common/AxiosHelper.js +2 -2
- package/sdk/platform/Cart/CartPlatformModel.d.ts +7 -2
- package/sdk/platform/Cart/CartPlatformModel.js +4 -2
- package/sdk/platform/Order/OrderPlatformClient.d.ts +121 -3
- package/sdk/platform/Order/OrderPlatformClient.js +211 -0
- package/sdk/platform/Order/OrderPlatformModel.d.ts +12 -0
- package/sdk/platform/Order/OrderPlatformModel.js +509 -497
- package/sdk/platform/Order/OrderPlatformValidator.d.ts +6 -0
- package/sdk/platform/Order/OrderPlatformValidator.js +6 -0
package/README.md
CHANGED
|
@@ -214,7 +214,7 @@ console.log("Active Theme: ", response.information.name);
|
|
|
214
214
|
The above code will log the curl command in the console
|
|
215
215
|
|
|
216
216
|
```bash
|
|
217
|
-
curl --request GET "https://api.fynd.com/service/application/theme/v1.0/applied-theme" --header 'authorization: Bearer <authorization-token>' --header 'x-fp-sdk-version:
|
|
217
|
+
curl --request GET "https://api.fynd.com/service/application/theme/v1.0/applied-theme" --header 'authorization: Bearer <authorization-token>' --header 'x-fp-sdk-version: 1.3.3-beta.3' --header 'x-fp-date: 20230222T115108Z' --header 'x-fp-signature: v1.1:1e3ab3b02b5bc626e3c32a37ee844266ade02bbcbaafc28fc7a0e46a76a7a1a8'
|
|
218
218
|
Active Theme: Emerge
|
|
219
219
|
```
|
|
220
220
|
|
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@ const { sign } = require("@gofynd/fp-signature");
|
|
|
6
6
|
const { FDKServerResponseError } = require("./FDKError");
|
|
7
7
|
const { log, Logger, getLoggerLevel } = require("./Logger");
|
|
8
8
|
const createCurl = require("./curlHelper");
|
|
9
|
-
const
|
|
9
|
+
const { version } = require("./../../package.json");
|
|
10
10
|
axios.defaults.withCredentials = true;
|
|
11
11
|
|
|
12
12
|
function getTransformer(config) {
|
|
@@ -39,7 +39,7 @@ function requestInterceptorFn() {
|
|
|
39
39
|
}
|
|
40
40
|
const { host, pathname, search } = new URL(url);
|
|
41
41
|
const { data, headers, method, params } = config;
|
|
42
|
-
headers["x-fp-sdk-version"] =
|
|
42
|
+
headers["x-fp-sdk-version"] = version;
|
|
43
43
|
let querySearchObj = querystring.parse(search);
|
|
44
44
|
querySearchObj = { ...querySearchObj, ...params };
|
|
45
45
|
let queryParam = "";
|
|
@@ -387,6 +387,7 @@ export = CartPlatformModel;
|
|
|
387
387
|
*/
|
|
388
388
|
/**
|
|
389
389
|
* @typedef CouponAdd
|
|
390
|
+
* @property {string} [_id] - Coupon id
|
|
390
391
|
* @property {CouponSchedule} [_schedule]
|
|
391
392
|
* @property {CouponAction} [action]
|
|
392
393
|
* @property {CouponAuthor} [author]
|
|
@@ -451,7 +452,7 @@ export = CartPlatformModel;
|
|
|
451
452
|
*/
|
|
452
453
|
/**
|
|
453
454
|
* @typedef CouponsResponse
|
|
454
|
-
* @property {CouponAdd} [items]
|
|
455
|
+
* @property {CouponAdd[]} [items]
|
|
455
456
|
* @property {Page} [page]
|
|
456
457
|
*/
|
|
457
458
|
/**
|
|
@@ -2210,6 +2211,10 @@ type CouponAction = {
|
|
|
2210
2211
|
/** @returns {CouponAdd} */
|
|
2211
2212
|
declare function CouponAdd(): CouponAdd;
|
|
2212
2213
|
type CouponAdd = {
|
|
2214
|
+
/**
|
|
2215
|
+
* - Coupon id
|
|
2216
|
+
*/
|
|
2217
|
+
_id?: string;
|
|
2213
2218
|
_schedule?: CouponSchedule;
|
|
2214
2219
|
action?: CouponAction;
|
|
2215
2220
|
author?: CouponAuthor;
|
|
@@ -2284,7 +2289,7 @@ type CouponSchedule = {
|
|
|
2284
2289
|
/** @returns {CouponsResponse} */
|
|
2285
2290
|
declare function CouponsResponse(): CouponsResponse;
|
|
2286
2291
|
type CouponsResponse = {
|
|
2287
|
-
items?: CouponAdd;
|
|
2292
|
+
items?: CouponAdd[];
|
|
2288
2293
|
page?: Page;
|
|
2289
2294
|
};
|
|
2290
2295
|
/** @returns {CouponUpdate} */
|
|
@@ -428,6 +428,7 @@ const Joi = require("joi");
|
|
|
428
428
|
|
|
429
429
|
/**
|
|
430
430
|
* @typedef CouponAdd
|
|
431
|
+
* @property {string} [_id] - Coupon id
|
|
431
432
|
* @property {CouponSchedule} [_schedule]
|
|
432
433
|
* @property {CouponAction} [action]
|
|
433
434
|
* @property {CouponAuthor} [author]
|
|
@@ -499,7 +500,7 @@ const Joi = require("joi");
|
|
|
499
500
|
|
|
500
501
|
/**
|
|
501
502
|
* @typedef CouponsResponse
|
|
502
|
-
* @property {CouponAdd} [items]
|
|
503
|
+
* @property {CouponAdd[]} [items]
|
|
503
504
|
* @property {Page} [page]
|
|
504
505
|
*/
|
|
505
506
|
|
|
@@ -2324,6 +2325,7 @@ class CartPlatformModel {
|
|
|
2324
2325
|
/** @returns {CouponAdd} */
|
|
2325
2326
|
static CouponAdd() {
|
|
2326
2327
|
return Joi.object({
|
|
2328
|
+
_id: Joi.string().allow(""),
|
|
2327
2329
|
_schedule: CartPlatformModel.CouponSchedule(),
|
|
2328
2330
|
action: CartPlatformModel.CouponAction(),
|
|
2329
2331
|
author: CartPlatformModel.CouponAuthor(),
|
|
@@ -2409,7 +2411,7 @@ class CartPlatformModel {
|
|
|
2409
2411
|
/** @returns {CouponsResponse} */
|
|
2410
2412
|
static CouponsResponse() {
|
|
2411
2413
|
return Joi.object({
|
|
2412
|
-
items: CartPlatformModel.CouponAdd(),
|
|
2414
|
+
items: Joi.array().items(CartPlatformModel.CouponAdd()),
|
|
2413
2415
|
page: CartPlatformModel.Page(),
|
|
2414
2416
|
});
|
|
2415
2417
|
}
|
|
@@ -211,7 +211,7 @@ declare class Order {
|
|
|
211
211
|
* @summary:
|
|
212
212
|
* @description: Get lane config for the order - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/getLaneConfig/).
|
|
213
213
|
*/
|
|
214
|
-
getLaneConfig({ superLane, groupEntity, fromDate, toDate, dpIds, stores, salesChannels, paymentMode, bagStatus, searchType, searchValue, tags, timeToDispatch, paymentMethods, myOrders, showCrossCompanyData, requestHeaders, }?: OrderPlatformValidator.GetLaneConfigParam, { responseHeaders }?: object): Promise<OrderPlatformModel.LaneConfigResponse>;
|
|
214
|
+
getLaneConfig({ superLane, groupEntity, fromDate, toDate, dpIds, stores, salesChannels, paymentMode, bagStatus, searchType, searchValue, tags, timeToDispatch, paymentMethods, myOrders, showCrossCompanyData, orderType, requestHeaders, }?: OrderPlatformValidator.GetLaneConfigParam, { responseHeaders }?: object): Promise<OrderPlatformModel.LaneConfigResponse>;
|
|
215
215
|
/**
|
|
216
216
|
* @param {OrderPlatformValidator.GetOrderByIdParam} arg - Arg object
|
|
217
217
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
@@ -231,7 +231,60 @@ declare class Order {
|
|
|
231
231
|
* @summary:
|
|
232
232
|
* @description: Get Orders Listing - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/getOrders/).
|
|
233
233
|
*/
|
|
234
|
-
getOrders({ lane, searchType, bagStatus, timeToDispatch, paymentMethods, tags, searchValue, fromDate, toDate, dpIds, stores, salesChannels, pageNo, pageSize, isPrioritySort, customMeta, myOrders, showCrossCompanyData, customerId, requestHeaders, }?: OrderPlatformValidator.GetOrdersParam, { responseHeaders }?: object): Promise<OrderPlatformModel.OrderListingResponse>;
|
|
234
|
+
getOrders({ lane, searchType, bagStatus, timeToDispatch, paymentMethods, tags, searchValue, fromDate, toDate, dpIds, stores, salesChannels, pageNo, pageSize, isPrioritySort, customMeta, myOrders, showCrossCompanyData, customerId, orderType, requestHeaders, }?: OrderPlatformValidator.GetOrdersParam, { responseHeaders }?: object): Promise<OrderPlatformModel.OrderListingResponse>;
|
|
235
|
+
/**
|
|
236
|
+
* @param {Object} arg - Arg object.
|
|
237
|
+
* @param {string} [arg.lane] - Lane refers to a section where orders are
|
|
238
|
+
* assigned, indicating its grouping
|
|
239
|
+
* @param {string} [arg.searchType] - Search_type refers to the field that
|
|
240
|
+
* will be used as the target for the search operation
|
|
241
|
+
* @param {string} [arg.bagStatus] - Bag_status refers to status of the
|
|
242
|
+
* entity. Filters orders based on the status.
|
|
243
|
+
* @param {string} [arg.timeToDispatch] - Time_to_dispatch refers to
|
|
244
|
+
* estimated SLA time.
|
|
245
|
+
* @param {string} [arg.paymentMethods] -
|
|
246
|
+
* @param {string} [arg.tags] - Tags refers to additional descriptive labels
|
|
247
|
+
* associated with the order
|
|
248
|
+
* @param {string} [arg.searchValue] - Search_value is matched against the
|
|
249
|
+
* field specified by the search_type
|
|
250
|
+
* @param {string} [arg.fromDate] -
|
|
251
|
+
* @param {string} [arg.toDate] -
|
|
252
|
+
* @param {string} [arg.dpIds] - Delivery Partner IDs to which shipments are assigned.
|
|
253
|
+
* @param {string} [arg.stores] -
|
|
254
|
+
* @param {string} [arg.salesChannels] -
|
|
255
|
+
* @param {number} [arg.pageSize] -
|
|
256
|
+
* @param {boolean} [arg.isPrioritySort] -
|
|
257
|
+
* @param {string} [arg.customMeta] -
|
|
258
|
+
* @param {boolean} [arg.myOrders] -
|
|
259
|
+
* @param {boolean} [arg.showCrossCompanyData] - Flag to view cross &
|
|
260
|
+
* non-cross company order
|
|
261
|
+
* @param {string} [arg.customerId] -
|
|
262
|
+
* @param {string} [arg.orderType] -
|
|
263
|
+
* @returns {Paginator<OrderPlatformModel.OrderListingResponse>}
|
|
264
|
+
* @summary:
|
|
265
|
+
* @description: Get Orders Listing
|
|
266
|
+
*/
|
|
267
|
+
getOrdersPaginator({ lane, searchType, bagStatus, timeToDispatch, paymentMethods, tags, searchValue, fromDate, toDate, dpIds, stores, salesChannels, pageSize, isPrioritySort, customMeta, myOrders, showCrossCompanyData, customerId, orderType, }?: {
|
|
268
|
+
lane?: string;
|
|
269
|
+
searchType?: string;
|
|
270
|
+
bagStatus?: string;
|
|
271
|
+
timeToDispatch?: string;
|
|
272
|
+
paymentMethods?: string;
|
|
273
|
+
tags?: string;
|
|
274
|
+
searchValue?: string;
|
|
275
|
+
fromDate?: string;
|
|
276
|
+
toDate?: string;
|
|
277
|
+
dpIds?: string;
|
|
278
|
+
stores?: string;
|
|
279
|
+
salesChannels?: string;
|
|
280
|
+
pageSize?: number;
|
|
281
|
+
isPrioritySort?: boolean;
|
|
282
|
+
customMeta?: string;
|
|
283
|
+
myOrders?: boolean;
|
|
284
|
+
showCrossCompanyData?: boolean;
|
|
285
|
+
customerId?: string;
|
|
286
|
+
orderType?: string;
|
|
287
|
+
}): Paginator<OrderPlatformModel.OrderListingResponse>;
|
|
235
288
|
/**
|
|
236
289
|
* @param {OrderPlatformValidator.GetRoleBasedActionsParam} arg - Arg object
|
|
237
290
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
@@ -284,7 +337,71 @@ declare class Order {
|
|
|
284
337
|
* @summary:
|
|
285
338
|
* @description: Get Shipments Listing for the company id - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/getShipments/).
|
|
286
339
|
*/
|
|
287
|
-
getShipments({ lane, bagStatus, statusOverrideLane, timeToDispatch, searchType, searchValue, fromDate, toDate, dpIds, stores, salesChannels, pageNo, pageSize, fetchActiveShipment, excludeLockedShipments, paymentMethods, channelShipmentId, channelOrderId, customMeta, orderingChannel, companyAffiliateTag, myOrders, platformUserId, sortType, showCrossCompanyData, tags, customerId, requestHeaders, }?: OrderPlatformValidator.GetShipmentsParam, { responseHeaders }?: object): Promise<OrderPlatformModel.ShipmentInternalPlatformViewResponse>;
|
|
340
|
+
getShipments({ lane, bagStatus, statusOverrideLane, timeToDispatch, searchType, searchValue, fromDate, toDate, dpIds, stores, salesChannels, pageNo, pageSize, fetchActiveShipment, excludeLockedShipments, paymentMethods, channelShipmentId, channelOrderId, customMeta, orderingChannel, companyAffiliateTag, myOrders, platformUserId, sortType, showCrossCompanyData, tags, customerId, orderType, requestHeaders, }?: OrderPlatformValidator.GetShipmentsParam, { responseHeaders }?: object): Promise<OrderPlatformModel.ShipmentInternalPlatformViewResponse>;
|
|
341
|
+
/**
|
|
342
|
+
* @param {Object} arg - Arg object.
|
|
343
|
+
* @param {string} [arg.lane] - Name of lane for which data is to be fetched
|
|
344
|
+
* @param {string} [arg.bagStatus] - Comma separated values of bag statuses
|
|
345
|
+
* @param {boolean} [arg.statusOverrideLane] - Use this flag to fetch by
|
|
346
|
+
* bag_status and override lane
|
|
347
|
+
* @param {number} [arg.timeToDispatch] -
|
|
348
|
+
* @param {string} [arg.searchType] - Search type key
|
|
349
|
+
* @param {string} [arg.searchValue] - Search type value
|
|
350
|
+
* @param {string} [arg.fromDate] - Start Date in DD-MM-YYYY format
|
|
351
|
+
* @param {string} [arg.toDate] - End Date in DD-MM-YYYY format
|
|
352
|
+
* @param {string} [arg.dpIds] - Comma separated values of delivery partner ids
|
|
353
|
+
* @param {string} [arg.stores] - Comma separated values of store ids
|
|
354
|
+
* @param {string} [arg.salesChannels] - Comma separated values of sales channel ids
|
|
355
|
+
* @param {number} [arg.pageSize] - Page size of data received per page
|
|
356
|
+
* @param {boolean} [arg.fetchActiveShipment] - Flag to fetch active shipments
|
|
357
|
+
* @param {boolean} [arg.excludeLockedShipments] - Flag to fetch locked shipments
|
|
358
|
+
* @param {string} [arg.paymentMethods] - Comma separated values of payment methods
|
|
359
|
+
* @param {string} [arg.channelShipmentId] - App Shipment Id
|
|
360
|
+
* @param {string} [arg.channelOrderId] - App Order Id
|
|
361
|
+
* @param {string} [arg.customMeta] -
|
|
362
|
+
* @param {string} [arg.orderingChannel] -
|
|
363
|
+
* @param {string} [arg.companyAffiliateTag] -
|
|
364
|
+
* @param {boolean} [arg.myOrders] -
|
|
365
|
+
* @param {string} [arg.platformUserId] -
|
|
366
|
+
* @param {string} [arg.sortType] - Sort the result data on basis of input
|
|
367
|
+
* @param {boolean} [arg.showCrossCompanyData] - Flag to view cross &
|
|
368
|
+
* non-cross company order
|
|
369
|
+
* @param {string} [arg.tags] - Comma separated values of tags
|
|
370
|
+
* @param {string} [arg.customerId] -
|
|
371
|
+
* @param {string} [arg.orderType] -
|
|
372
|
+
* @returns {Paginator<OrderPlatformModel.ShipmentInternalPlatformViewResponse>}
|
|
373
|
+
* @summary:
|
|
374
|
+
* @description: Get Shipments Listing for the company id
|
|
375
|
+
*/
|
|
376
|
+
getShipmentsPaginator({ lane, bagStatus, statusOverrideLane, timeToDispatch, searchType, searchValue, fromDate, toDate, dpIds, stores, salesChannels, pageSize, fetchActiveShipment, excludeLockedShipments, paymentMethods, channelShipmentId, channelOrderId, customMeta, orderingChannel, companyAffiliateTag, myOrders, platformUserId, sortType, showCrossCompanyData, tags, customerId, orderType, }?: {
|
|
377
|
+
lane?: string;
|
|
378
|
+
bagStatus?: string;
|
|
379
|
+
statusOverrideLane?: boolean;
|
|
380
|
+
timeToDispatch?: number;
|
|
381
|
+
searchType?: string;
|
|
382
|
+
searchValue?: string;
|
|
383
|
+
fromDate?: string;
|
|
384
|
+
toDate?: string;
|
|
385
|
+
dpIds?: string;
|
|
386
|
+
stores?: string;
|
|
387
|
+
salesChannels?: string;
|
|
388
|
+
pageSize?: number;
|
|
389
|
+
fetchActiveShipment?: boolean;
|
|
390
|
+
excludeLockedShipments?: boolean;
|
|
391
|
+
paymentMethods?: string;
|
|
392
|
+
channelShipmentId?: string;
|
|
393
|
+
channelOrderId?: string;
|
|
394
|
+
customMeta?: string;
|
|
395
|
+
orderingChannel?: string;
|
|
396
|
+
companyAffiliateTag?: string;
|
|
397
|
+
myOrders?: boolean;
|
|
398
|
+
platformUserId?: string;
|
|
399
|
+
sortType?: string;
|
|
400
|
+
showCrossCompanyData?: boolean;
|
|
401
|
+
tags?: string;
|
|
402
|
+
customerId?: string;
|
|
403
|
+
orderType?: string;
|
|
404
|
+
}): Paginator<OrderPlatformModel.ShipmentInternalPlatformViewResponse>;
|
|
288
405
|
/**
|
|
289
406
|
* @param {OrderPlatformValidator.GetStateTransitionMapParam} arg - Arg object
|
|
290
407
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
@@ -466,3 +583,4 @@ declare class Order {
|
|
|
466
583
|
}
|
|
467
584
|
import OrderPlatformValidator = require("./OrderPlatformValidator");
|
|
468
585
|
import OrderPlatformModel = require("./OrderPlatformModel");
|
|
586
|
+
import Paginator = require("../../common/Paginator");
|
|
@@ -1587,6 +1587,7 @@ class Order {
|
|
|
1587
1587
|
paymentMethods,
|
|
1588
1588
|
myOrders,
|
|
1589
1589
|
showCrossCompanyData,
|
|
1590
|
+
orderType,
|
|
1590
1591
|
requestHeaders,
|
|
1591
1592
|
} = { requestHeaders: {} },
|
|
1592
1593
|
{ responseHeaders } = { responseHeaders: false }
|
|
@@ -1609,6 +1610,7 @@ class Order {
|
|
|
1609
1610
|
paymentMethods,
|
|
1610
1611
|
myOrders,
|
|
1611
1612
|
showCrossCompanyData,
|
|
1613
|
+
orderType,
|
|
1612
1614
|
},
|
|
1613
1615
|
{ abortEarly: false, allowUnknown: true }
|
|
1614
1616
|
);
|
|
@@ -1635,6 +1637,7 @@ class Order {
|
|
|
1635
1637
|
paymentMethods,
|
|
1636
1638
|
myOrders,
|
|
1637
1639
|
showCrossCompanyData,
|
|
1640
|
+
orderType,
|
|
1638
1641
|
},
|
|
1639
1642
|
{ abortEarly: false, allowUnknown: false }
|
|
1640
1643
|
);
|
|
@@ -1662,6 +1665,7 @@ class Order {
|
|
|
1662
1665
|
query_params["payment_methods"] = paymentMethods;
|
|
1663
1666
|
query_params["my_orders"] = myOrders;
|
|
1664
1667
|
query_params["show_cross_company_data"] = showCrossCompanyData;
|
|
1668
|
+
query_params["order_type"] = orderType;
|
|
1665
1669
|
|
|
1666
1670
|
const xHeaders = {};
|
|
1667
1671
|
|
|
@@ -1801,6 +1805,7 @@ class Order {
|
|
|
1801
1805
|
myOrders,
|
|
1802
1806
|
showCrossCompanyData,
|
|
1803
1807
|
customerId,
|
|
1808
|
+
orderType,
|
|
1804
1809
|
requestHeaders,
|
|
1805
1810
|
} = { requestHeaders: {} },
|
|
1806
1811
|
{ responseHeaders } = { responseHeaders: false }
|
|
@@ -1826,6 +1831,7 @@ class Order {
|
|
|
1826
1831
|
myOrders,
|
|
1827
1832
|
showCrossCompanyData,
|
|
1828
1833
|
customerId,
|
|
1834
|
+
orderType,
|
|
1829
1835
|
},
|
|
1830
1836
|
{ abortEarly: false, allowUnknown: true }
|
|
1831
1837
|
);
|
|
@@ -1855,6 +1861,7 @@ class Order {
|
|
|
1855
1861
|
myOrders,
|
|
1856
1862
|
showCrossCompanyData,
|
|
1857
1863
|
customerId,
|
|
1864
|
+
orderType,
|
|
1858
1865
|
},
|
|
1859
1866
|
{ abortEarly: false, allowUnknown: false }
|
|
1860
1867
|
);
|
|
@@ -1885,6 +1892,7 @@ class Order {
|
|
|
1885
1892
|
query_params["my_orders"] = myOrders;
|
|
1886
1893
|
query_params["show_cross_company_data"] = showCrossCompanyData;
|
|
1887
1894
|
query_params["customer_id"] = customerId;
|
|
1895
|
+
query_params["order_type"] = orderType;
|
|
1888
1896
|
|
|
1889
1897
|
const xHeaders = {};
|
|
1890
1898
|
|
|
@@ -1920,6 +1928,96 @@ class Order {
|
|
|
1920
1928
|
return response;
|
|
1921
1929
|
}
|
|
1922
1930
|
|
|
1931
|
+
/**
|
|
1932
|
+
* @param {Object} arg - Arg object.
|
|
1933
|
+
* @param {string} [arg.lane] - Lane refers to a section where orders are
|
|
1934
|
+
* assigned, indicating its grouping
|
|
1935
|
+
* @param {string} [arg.searchType] - Search_type refers to the field that
|
|
1936
|
+
* will be used as the target for the search operation
|
|
1937
|
+
* @param {string} [arg.bagStatus] - Bag_status refers to status of the
|
|
1938
|
+
* entity. Filters orders based on the status.
|
|
1939
|
+
* @param {string} [arg.timeToDispatch] - Time_to_dispatch refers to
|
|
1940
|
+
* estimated SLA time.
|
|
1941
|
+
* @param {string} [arg.paymentMethods] -
|
|
1942
|
+
* @param {string} [arg.tags] - Tags refers to additional descriptive labels
|
|
1943
|
+
* associated with the order
|
|
1944
|
+
* @param {string} [arg.searchValue] - Search_value is matched against the
|
|
1945
|
+
* field specified by the search_type
|
|
1946
|
+
* @param {string} [arg.fromDate] -
|
|
1947
|
+
* @param {string} [arg.toDate] -
|
|
1948
|
+
* @param {string} [arg.dpIds] - Delivery Partner IDs to which shipments are assigned.
|
|
1949
|
+
* @param {string} [arg.stores] -
|
|
1950
|
+
* @param {string} [arg.salesChannels] -
|
|
1951
|
+
* @param {number} [arg.pageSize] -
|
|
1952
|
+
* @param {boolean} [arg.isPrioritySort] -
|
|
1953
|
+
* @param {string} [arg.customMeta] -
|
|
1954
|
+
* @param {boolean} [arg.myOrders] -
|
|
1955
|
+
* @param {boolean} [arg.showCrossCompanyData] - Flag to view cross &
|
|
1956
|
+
* non-cross company order
|
|
1957
|
+
* @param {string} [arg.customerId] -
|
|
1958
|
+
* @param {string} [arg.orderType] -
|
|
1959
|
+
* @returns {Paginator<OrderPlatformModel.OrderListingResponse>}
|
|
1960
|
+
* @summary:
|
|
1961
|
+
* @description: Get Orders Listing
|
|
1962
|
+
*/
|
|
1963
|
+
getOrdersPaginator({
|
|
1964
|
+
lane,
|
|
1965
|
+
searchType,
|
|
1966
|
+
bagStatus,
|
|
1967
|
+
timeToDispatch,
|
|
1968
|
+
paymentMethods,
|
|
1969
|
+
tags,
|
|
1970
|
+
searchValue,
|
|
1971
|
+
fromDate,
|
|
1972
|
+
toDate,
|
|
1973
|
+
dpIds,
|
|
1974
|
+
stores,
|
|
1975
|
+
salesChannels,
|
|
1976
|
+
pageSize,
|
|
1977
|
+
isPrioritySort,
|
|
1978
|
+
customMeta,
|
|
1979
|
+
myOrders,
|
|
1980
|
+
showCrossCompanyData,
|
|
1981
|
+
customerId,
|
|
1982
|
+
orderType,
|
|
1983
|
+
} = {}) {
|
|
1984
|
+
const paginator = new Paginator();
|
|
1985
|
+
const callback = async () => {
|
|
1986
|
+
const pageId = paginator.nextId;
|
|
1987
|
+
const pageNo = paginator.pageNo;
|
|
1988
|
+
const pageType = "number";
|
|
1989
|
+
const data = await this.getOrders({
|
|
1990
|
+
lane: lane,
|
|
1991
|
+
searchType: searchType,
|
|
1992
|
+
bagStatus: bagStatus,
|
|
1993
|
+
timeToDispatch: timeToDispatch,
|
|
1994
|
+
paymentMethods: paymentMethods,
|
|
1995
|
+
tags: tags,
|
|
1996
|
+
searchValue: searchValue,
|
|
1997
|
+
fromDate: fromDate,
|
|
1998
|
+
toDate: toDate,
|
|
1999
|
+
dpIds: dpIds,
|
|
2000
|
+
stores: stores,
|
|
2001
|
+
salesChannels: salesChannels,
|
|
2002
|
+
pageNo: pageNo,
|
|
2003
|
+
pageSize: pageSize,
|
|
2004
|
+
isPrioritySort: isPrioritySort,
|
|
2005
|
+
customMeta: customMeta,
|
|
2006
|
+
myOrders: myOrders,
|
|
2007
|
+
showCrossCompanyData: showCrossCompanyData,
|
|
2008
|
+
customerId: customerId,
|
|
2009
|
+
orderType: orderType,
|
|
2010
|
+
});
|
|
2011
|
+
paginator.setPaginator({
|
|
2012
|
+
hasNext: data.page.has_next ? true : false,
|
|
2013
|
+
nextId: data.page.next_id,
|
|
2014
|
+
});
|
|
2015
|
+
return data;
|
|
2016
|
+
};
|
|
2017
|
+
paginator.setCallback(callback.bind(this));
|
|
2018
|
+
return paginator;
|
|
2019
|
+
}
|
|
2020
|
+
|
|
1923
2021
|
/**
|
|
1924
2022
|
* @param {OrderPlatformValidator.GetRoleBasedActionsParam} arg - Arg object
|
|
1925
2023
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
@@ -2269,6 +2367,7 @@ class Order {
|
|
|
2269
2367
|
showCrossCompanyData,
|
|
2270
2368
|
tags,
|
|
2271
2369
|
customerId,
|
|
2370
|
+
orderType,
|
|
2272
2371
|
requestHeaders,
|
|
2273
2372
|
} = { requestHeaders: {} },
|
|
2274
2373
|
{ responseHeaders } = { responseHeaders: false }
|
|
@@ -2302,6 +2401,7 @@ class Order {
|
|
|
2302
2401
|
showCrossCompanyData,
|
|
2303
2402
|
tags,
|
|
2304
2403
|
customerId,
|
|
2404
|
+
orderType,
|
|
2305
2405
|
},
|
|
2306
2406
|
{ abortEarly: false, allowUnknown: true }
|
|
2307
2407
|
);
|
|
@@ -2339,6 +2439,7 @@ class Order {
|
|
|
2339
2439
|
showCrossCompanyData,
|
|
2340
2440
|
tags,
|
|
2341
2441
|
customerId,
|
|
2442
|
+
orderType,
|
|
2342
2443
|
},
|
|
2343
2444
|
{ abortEarly: false, allowUnknown: false }
|
|
2344
2445
|
);
|
|
@@ -2377,6 +2478,7 @@ class Order {
|
|
|
2377
2478
|
query_params["show_cross_company_data"] = showCrossCompanyData;
|
|
2378
2479
|
query_params["tags"] = tags;
|
|
2379
2480
|
query_params["customer_id"] = customerId;
|
|
2481
|
+
query_params["order_type"] = orderType;
|
|
2380
2482
|
|
|
2381
2483
|
const xHeaders = {};
|
|
2382
2484
|
|
|
@@ -2412,6 +2514,115 @@ class Order {
|
|
|
2412
2514
|
return response;
|
|
2413
2515
|
}
|
|
2414
2516
|
|
|
2517
|
+
/**
|
|
2518
|
+
* @param {Object} arg - Arg object.
|
|
2519
|
+
* @param {string} [arg.lane] - Name of lane for which data is to be fetched
|
|
2520
|
+
* @param {string} [arg.bagStatus] - Comma separated values of bag statuses
|
|
2521
|
+
* @param {boolean} [arg.statusOverrideLane] - Use this flag to fetch by
|
|
2522
|
+
* bag_status and override lane
|
|
2523
|
+
* @param {number} [arg.timeToDispatch] -
|
|
2524
|
+
* @param {string} [arg.searchType] - Search type key
|
|
2525
|
+
* @param {string} [arg.searchValue] - Search type value
|
|
2526
|
+
* @param {string} [arg.fromDate] - Start Date in DD-MM-YYYY format
|
|
2527
|
+
* @param {string} [arg.toDate] - End Date in DD-MM-YYYY format
|
|
2528
|
+
* @param {string} [arg.dpIds] - Comma separated values of delivery partner ids
|
|
2529
|
+
* @param {string} [arg.stores] - Comma separated values of store ids
|
|
2530
|
+
* @param {string} [arg.salesChannels] - Comma separated values of sales channel ids
|
|
2531
|
+
* @param {number} [arg.pageSize] - Page size of data received per page
|
|
2532
|
+
* @param {boolean} [arg.fetchActiveShipment] - Flag to fetch active shipments
|
|
2533
|
+
* @param {boolean} [arg.excludeLockedShipments] - Flag to fetch locked shipments
|
|
2534
|
+
* @param {string} [arg.paymentMethods] - Comma separated values of payment methods
|
|
2535
|
+
* @param {string} [arg.channelShipmentId] - App Shipment Id
|
|
2536
|
+
* @param {string} [arg.channelOrderId] - App Order Id
|
|
2537
|
+
* @param {string} [arg.customMeta] -
|
|
2538
|
+
* @param {string} [arg.orderingChannel] -
|
|
2539
|
+
* @param {string} [arg.companyAffiliateTag] -
|
|
2540
|
+
* @param {boolean} [arg.myOrders] -
|
|
2541
|
+
* @param {string} [arg.platformUserId] -
|
|
2542
|
+
* @param {string} [arg.sortType] - Sort the result data on basis of input
|
|
2543
|
+
* @param {boolean} [arg.showCrossCompanyData] - Flag to view cross &
|
|
2544
|
+
* non-cross company order
|
|
2545
|
+
* @param {string} [arg.tags] - Comma separated values of tags
|
|
2546
|
+
* @param {string} [arg.customerId] -
|
|
2547
|
+
* @param {string} [arg.orderType] -
|
|
2548
|
+
* @returns {Paginator<OrderPlatformModel.ShipmentInternalPlatformViewResponse>}
|
|
2549
|
+
* @summary:
|
|
2550
|
+
* @description: Get Shipments Listing for the company id
|
|
2551
|
+
*/
|
|
2552
|
+
getShipmentsPaginator({
|
|
2553
|
+
lane,
|
|
2554
|
+
bagStatus,
|
|
2555
|
+
statusOverrideLane,
|
|
2556
|
+
timeToDispatch,
|
|
2557
|
+
searchType,
|
|
2558
|
+
searchValue,
|
|
2559
|
+
fromDate,
|
|
2560
|
+
toDate,
|
|
2561
|
+
dpIds,
|
|
2562
|
+
stores,
|
|
2563
|
+
salesChannels,
|
|
2564
|
+
pageSize,
|
|
2565
|
+
fetchActiveShipment,
|
|
2566
|
+
excludeLockedShipments,
|
|
2567
|
+
paymentMethods,
|
|
2568
|
+
channelShipmentId,
|
|
2569
|
+
channelOrderId,
|
|
2570
|
+
customMeta,
|
|
2571
|
+
orderingChannel,
|
|
2572
|
+
companyAffiliateTag,
|
|
2573
|
+
myOrders,
|
|
2574
|
+
platformUserId,
|
|
2575
|
+
sortType,
|
|
2576
|
+
showCrossCompanyData,
|
|
2577
|
+
tags,
|
|
2578
|
+
customerId,
|
|
2579
|
+
orderType,
|
|
2580
|
+
} = {}) {
|
|
2581
|
+
const paginator = new Paginator();
|
|
2582
|
+
const callback = async () => {
|
|
2583
|
+
const pageId = paginator.nextId;
|
|
2584
|
+
const pageNo = paginator.pageNo;
|
|
2585
|
+
const pageType = "number";
|
|
2586
|
+
const data = await this.getShipments({
|
|
2587
|
+
lane: lane,
|
|
2588
|
+
bagStatus: bagStatus,
|
|
2589
|
+
statusOverrideLane: statusOverrideLane,
|
|
2590
|
+
timeToDispatch: timeToDispatch,
|
|
2591
|
+
searchType: searchType,
|
|
2592
|
+
searchValue: searchValue,
|
|
2593
|
+
fromDate: fromDate,
|
|
2594
|
+
toDate: toDate,
|
|
2595
|
+
dpIds: dpIds,
|
|
2596
|
+
stores: stores,
|
|
2597
|
+
salesChannels: salesChannels,
|
|
2598
|
+
pageNo: pageNo,
|
|
2599
|
+
pageSize: pageSize,
|
|
2600
|
+
fetchActiveShipment: fetchActiveShipment,
|
|
2601
|
+
excludeLockedShipments: excludeLockedShipments,
|
|
2602
|
+
paymentMethods: paymentMethods,
|
|
2603
|
+
channelShipmentId: channelShipmentId,
|
|
2604
|
+
channelOrderId: channelOrderId,
|
|
2605
|
+
customMeta: customMeta,
|
|
2606
|
+
orderingChannel: orderingChannel,
|
|
2607
|
+
companyAffiliateTag: companyAffiliateTag,
|
|
2608
|
+
myOrders: myOrders,
|
|
2609
|
+
platformUserId: platformUserId,
|
|
2610
|
+
sortType: sortType,
|
|
2611
|
+
showCrossCompanyData: showCrossCompanyData,
|
|
2612
|
+
tags: tags,
|
|
2613
|
+
customerId: customerId,
|
|
2614
|
+
orderType: orderType,
|
|
2615
|
+
});
|
|
2616
|
+
paginator.setPaginator({
|
|
2617
|
+
hasNext: data.page.has_next ? true : false,
|
|
2618
|
+
nextId: data.page.next_id,
|
|
2619
|
+
});
|
|
2620
|
+
return data;
|
|
2621
|
+
};
|
|
2622
|
+
paginator.setCallback(callback.bind(this));
|
|
2623
|
+
return paginator;
|
|
2624
|
+
}
|
|
2625
|
+
|
|
2415
2626
|
/**
|
|
2416
2627
|
* @param {OrderPlatformValidator.GetStateTransitionMapParam} arg - Arg object
|
|
2417
2628
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
@@ -1167,6 +1167,7 @@ export = OrderPlatformModel;
|
|
|
1167
1167
|
* @property {string} [group_id]
|
|
1168
1168
|
* @property {BagGST} [gst_details]
|
|
1169
1169
|
* @property {string} [identifier]
|
|
1170
|
+
* @property {boolean} [is_parent]
|
|
1170
1171
|
* @property {PlatformItem} [item]
|
|
1171
1172
|
* @property {number} [line_number]
|
|
1172
1173
|
* @property {BagMeta} [meta]
|
|
@@ -1276,6 +1277,7 @@ export = OrderPlatformModel;
|
|
|
1276
1277
|
* @typedef OrderMeta
|
|
1277
1278
|
* @property {BillingStaffDetails} [billing_staff_details]
|
|
1278
1279
|
* @property {number} [cart_id]
|
|
1280
|
+
* @property {string} [cart_object_id]
|
|
1279
1281
|
* @property {string} [comment]
|
|
1280
1282
|
* @property {string} [company_logo]
|
|
1281
1283
|
* @property {string} [currency_symbol]
|
|
@@ -1503,9 +1505,11 @@ export = OrderPlatformModel;
|
|
|
1503
1505
|
* @property {InvoiceInfo} [invoice]
|
|
1504
1506
|
* @property {string} [invoice_id]
|
|
1505
1507
|
* @property {boolean} [is_dp_assign_enabled]
|
|
1508
|
+
* @property {boolean} [is_self_ship]
|
|
1506
1509
|
* @property {string} [journey_type]
|
|
1507
1510
|
* @property {boolean} [lock_status]
|
|
1508
1511
|
* @property {ShipmentMeta} [meta]
|
|
1512
|
+
* @property {string} [mode_of_payment]
|
|
1509
1513
|
* @property {string} [operational_status]
|
|
1510
1514
|
* @property {OrderDetailsData} [order]
|
|
1511
1515
|
* @property {OrderingStoreDetails} [ordering_store]
|
|
@@ -1830,6 +1834,7 @@ export = OrderPlatformModel;
|
|
|
1830
1834
|
* @property {string} [invoice_id]
|
|
1831
1835
|
* @property {boolean} [lock_status]
|
|
1832
1836
|
* @property {ShipmentItemMeta} [meta]
|
|
1837
|
+
* @property {string} [mode_of_payment]
|
|
1833
1838
|
* @property {string} [order_date]
|
|
1834
1839
|
* @property {string} order_id
|
|
1835
1840
|
* @property {string} [ordering_channnel]
|
|
@@ -1934,6 +1939,7 @@ export = OrderPlatformModel;
|
|
|
1934
1939
|
* @property {string} [packaging_name]
|
|
1935
1940
|
* @property {string} [parent_dp_id]
|
|
1936
1941
|
* @property {string} [po_number]
|
|
1942
|
+
* @property {string} [refund_to]
|
|
1937
1943
|
* @property {string} [return_affiliate_order_id]
|
|
1938
1944
|
* @property {string} [return_affiliate_shipment_id]
|
|
1939
1945
|
* @property {string} [return_awb_number]
|
|
@@ -3816,6 +3822,7 @@ type OrderBags = {
|
|
|
3816
3822
|
group_id?: string;
|
|
3817
3823
|
gst_details?: BagGST;
|
|
3818
3824
|
identifier?: string;
|
|
3825
|
+
is_parent?: boolean;
|
|
3819
3826
|
item?: PlatformItem;
|
|
3820
3827
|
line_number?: number;
|
|
3821
3828
|
meta?: BagMeta;
|
|
@@ -3936,6 +3943,7 @@ declare function OrderMeta(): OrderMeta;
|
|
|
3936
3943
|
type OrderMeta = {
|
|
3937
3944
|
billing_staff_details?: BillingStaffDetails;
|
|
3938
3945
|
cart_id?: number;
|
|
3946
|
+
cart_object_id?: string;
|
|
3939
3947
|
comment?: string;
|
|
3940
3948
|
company_logo?: string;
|
|
3941
3949
|
currency_symbol?: string;
|
|
@@ -4205,9 +4213,11 @@ type PlatformShipment = {
|
|
|
4205
4213
|
invoice?: InvoiceInfo;
|
|
4206
4214
|
invoice_id?: string;
|
|
4207
4215
|
is_dp_assign_enabled?: boolean;
|
|
4216
|
+
is_self_ship?: boolean;
|
|
4208
4217
|
journey_type?: string;
|
|
4209
4218
|
lock_status?: boolean;
|
|
4210
4219
|
meta?: ShipmentMeta;
|
|
4220
|
+
mode_of_payment?: string;
|
|
4211
4221
|
operational_status?: string;
|
|
4212
4222
|
order?: OrderDetailsData;
|
|
4213
4223
|
ordering_store?: OrderingStoreDetails;
|
|
@@ -4604,6 +4614,7 @@ type ShipmentItem = {
|
|
|
4604
4614
|
invoice_id?: string;
|
|
4605
4615
|
lock_status?: boolean;
|
|
4606
4616
|
meta?: ShipmentItemMeta;
|
|
4617
|
+
mode_of_payment?: string;
|
|
4607
4618
|
order_date?: string;
|
|
4608
4619
|
order_id: string;
|
|
4609
4620
|
ordering_channnel?: string;
|
|
@@ -4713,6 +4724,7 @@ type ShipmentMeta = {
|
|
|
4713
4724
|
packaging_name?: string;
|
|
4714
4725
|
parent_dp_id?: string;
|
|
4715
4726
|
po_number?: string;
|
|
4727
|
+
refund_to?: string;
|
|
4716
4728
|
return_affiliate_order_id?: string;
|
|
4717
4729
|
return_affiliate_shipment_id?: string;
|
|
4718
4730
|
return_awb_number?: string;
|