@gofynd/fdk-client-javascript 1.0.4 → 1.1.1

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.
Files changed (121) hide show
  1. package/README.md +19 -0
  2. package/index.d.ts +4 -1
  3. package/index.js +19 -3
  4. package/package.json +13 -4
  5. package/partner.d.ts +4 -0
  6. package/partner.js +7 -0
  7. package/sdk/application/ApplicationAPIClient.js +2 -4
  8. package/sdk/application/Catalog/CatalogApplicationClient.d.ts +6 -1
  9. package/sdk/application/Catalog/CatalogApplicationClient.js +11 -2
  10. package/sdk/application/Catalog/CatalogApplicationModel.js +4 -2
  11. package/sdk/application/Catalog/CatalogApplicationValidator.js +2 -0
  12. package/sdk/application/Content/ContentApplicationModel.js +0 -5
  13. package/sdk/application/Lead/LeadApplicationModel.js +1 -0
  14. package/sdk/application/Order/OrderApplicationClient.d.ts +0 -15
  15. package/sdk/application/Order/OrderApplicationClient.js +0 -68
  16. package/sdk/application/Order/OrderApplicationModel.d.ts +0 -17
  17. package/sdk/application/Order/OrderApplicationModel.js +0 -111
  18. package/sdk/application/Order/OrderApplicationValidator.d.ts +0 -1
  19. package/sdk/application/Order/OrderApplicationValidator.js +0 -7
  20. package/sdk/common/AxiosHelper.js +1 -1
  21. package/sdk/common/BaseOAuthClient.d.ts +17 -0
  22. package/sdk/common/BaseOAuthClient.js +67 -0
  23. package/sdk/common/Constant.d.ts +0 -18
  24. package/sdk/common/Constant.js +0 -22
  25. package/sdk/common/RequestSigner.js +0 -5
  26. package/sdk/partner/OAuthClient.d.ts +14 -0
  27. package/sdk/partner/OAuthClient.js +112 -0
  28. package/sdk/{APIClient.d.ts → partner/PartnerAPIClient.d.ts} +2 -1
  29. package/sdk/{APIClient.js → partner/PartnerAPIClient.js} +13 -6
  30. package/sdk/{Client.d.ts → partner/PartnerClient.d.ts} +2 -2
  31. package/sdk/{Client.js → partner/PartnerClient.js} +2 -2
  32. package/sdk/partner/PartnerConfig.d.ts +30 -0
  33. package/sdk/partner/PartnerConfig.js +39 -0
  34. package/sdk/partner/index.d.ts +3 -0
  35. package/sdk/partner/index.js +5 -0
  36. package/sdk/platform/Billing/BillingPlatformClient.d.ts +24 -0
  37. package/sdk/platform/Billing/BillingPlatformClient.js +134 -0
  38. package/sdk/platform/Billing/BillingPlatformModel.d.ts +4 -0
  39. package/sdk/platform/Billing/BillingPlatformModel.js +44 -0
  40. package/sdk/platform/Billing/BillingPlatformValidator.d.ts +2 -0
  41. package/sdk/platform/Billing/BillingPlatformValidator.js +14 -0
  42. package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +29 -0
  43. package/sdk/platform/Cart/CartPlatformApplicationClient.js +181 -0
  44. package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +3 -0
  45. package/sdk/platform/Cart/CartPlatformApplicationValidator.js +17 -0
  46. package/sdk/platform/Cart/CartPlatformModel.d.ts +4 -0
  47. package/sdk/platform/Cart/CartPlatformModel.js +37 -0
  48. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +3 -1
  49. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +5 -0
  50. package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +1 -0
  51. package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +1 -1
  52. package/sdk/platform/Catalog/CatalogPlatformClient.js +1 -1
  53. package/sdk/platform/Catalog/CatalogPlatformModel.js +1 -5
  54. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +0 -183
  55. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +0 -417
  56. package/sdk/platform/Communication/CommunicationPlatformClient.d.ts +0 -10
  57. package/sdk/platform/Communication/CommunicationPlatformClient.js +0 -26
  58. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +4 -0
  59. package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +0 -22
  60. package/sdk/platform/Configuration/ConfigurationPlatformClient.js +0 -56
  61. package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +22 -1
  62. package/sdk/platform/Content/ContentPlatformApplicationClient.js +123 -2
  63. package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +2 -0
  64. package/sdk/platform/Content/ContentPlatformApplicationValidator.js +12 -0
  65. package/sdk/platform/Content/ContentPlatformModel.js +0 -5
  66. package/sdk/platform/Discount/DiscountPlatformClient.d.ts +2 -2
  67. package/sdk/platform/Discount/DiscountPlatformClient.js +1 -1
  68. package/sdk/platform/Discount/DiscountPlatformModel.d.ts +1 -0
  69. package/sdk/platform/Discount/DiscountPlatformModel.js +15 -0
  70. package/sdk/platform/Discount/DiscountPlatformValidator.js +1 -1
  71. package/sdk/platform/FileStorage/FileStoragePlatformClient.js +1 -1
  72. package/sdk/platform/Lead/LeadPlatformModel.js +1 -0
  73. package/sdk/platform/OAuthClient.js +3 -9
  74. package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +1 -47
  75. package/sdk/platform/Order/OrderPlatformApplicationClient.js +5 -201
  76. package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +1 -3
  77. package/sdk/platform/Order/OrderPlatformApplicationValidator.js +1 -26
  78. package/sdk/platform/Order/OrderPlatformClient.d.ts +51 -183
  79. package/sdk/platform/Order/OrderPlatformClient.js +243 -931
  80. package/sdk/platform/Order/OrderPlatformModel.d.ts +4 -20
  81. package/sdk/platform/Order/OrderPlatformModel.js +38 -182
  82. package/sdk/platform/Order/OrderPlatformValidator.d.ts +3 -12
  83. package/sdk/platform/Order/OrderPlatformValidator.js +19 -95
  84. package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +24 -10
  85. package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +111 -44
  86. package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +2 -1
  87. package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +13 -5
  88. package/sdk/platform/Payment/PaymentPlatformModel.d.ts +2 -0
  89. package/sdk/platform/Payment/PaymentPlatformModel.js +12 -0
  90. package/sdk/platform/PlatformApplicationClient.d.ts +16 -41
  91. package/sdk/platform/PlatformApplicationClient.js +17 -45
  92. package/sdk/platform/PlatformClient.d.ts +124 -263
  93. package/sdk/platform/PlatformClient.js +148 -315
  94. package/sdk/platform/Rewards/RewardsPlatformApplicationClient.d.ts +14 -16
  95. package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +63 -77
  96. package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.d.ts +1 -1
  97. package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.js +7 -8
  98. package/sdk/platform/Share/SharePlatformApplicationClient.d.ts +11 -0
  99. package/sdk/platform/Share/SharePlatformApplicationClient.js +61 -0
  100. package/sdk/platform/Share/SharePlatformApplicationValidator.d.ts +1 -0
  101. package/sdk/platform/Share/SharePlatformApplicationValidator.js +6 -0
  102. package/sdk/platform/Share/SharePlatformModel.d.ts +2 -0
  103. package/sdk/platform/Share/SharePlatformModel.js +11 -0
  104. package/sdk/platform/index.d.ts +0 -1
  105. package/sdk/platform/index.js +0 -2
  106. package/sdk/Config.d.ts +0 -9
  107. package/sdk/Config.js +0 -17
  108. package/sdk/constructUrl.d.ts +0 -5
  109. package/sdk/constructUrl.js +0 -13
  110. package/sdk/index.d.ts +0 -3
  111. package/sdk/index.js +0 -5
  112. package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.d.ts +0 -109
  113. package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.js +0 -558
  114. package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.d.ts +0 -11
  115. package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.js +0 -56
  116. package/sdk/platform/Analytics/AnalyticsPlatformClient.d.ts +0 -88
  117. package/sdk/platform/Analytics/AnalyticsPlatformClient.js +0 -361
  118. package/sdk/platform/Analytics/AnalyticsPlatformModel.d.ts +0 -23
  119. package/sdk/platform/Analytics/AnalyticsPlatformModel.js +0 -169
  120. package/sdk/platform/Analytics/AnalyticsPlatformValidator.d.ts +0 -7
  121. package/sdk/platform/Analytics/AnalyticsPlatformValidator.js +0 -38
@@ -11,136 +11,6 @@ class Order {
11
11
  this.config = config;
12
12
  }
13
13
 
14
- /**
15
- * @param {Object} arg - Arg object.
16
- * @param {string} arg.batchId -
17
- * @returns {Promise<BulkActionDetailsResponse>} - Success response
18
- * @summary: Returns failed, processing and successfully processed shipments.
19
- * @description: Returns failed, processing and successfully processed shipments along with their counts and failed reasons.
20
- */
21
- async bulkActionDetails({ batchId } = {}) {
22
- const { error } = OrderValidator.bulkActionDetails().validate(
23
- {
24
- batchId,
25
- },
26
- { abortEarly: false, allowUnknown: true }
27
- );
28
- if (error) {
29
- return Promise.reject(new FDKClientValidationError(error));
30
- }
31
-
32
- // Showing warrnings if extra unknown parameters are found
33
- const { error: warrning } = OrderValidator.bulkActionDetails().validate(
34
- {
35
- batchId,
36
- },
37
- { abortEarly: false, allowUnknown: false }
38
- );
39
- if (warrning) {
40
- Logger({
41
- level: "WARN",
42
- message: "Parameter Validation warrnings for bulkActionDetails",
43
- });
44
- Logger({ level: "WARN", message: warrning });
45
- }
46
-
47
- const query_params = {};
48
-
49
- const xHeaders = {};
50
-
51
- const response = await PlatformAPIClient.execute(
52
- this.config,
53
- "get",
54
- `/service/platform/orders/v2.0/company/${this.config.companyId}/bulk-action/${batchId}`,
55
- query_params,
56
- undefined,
57
- xHeaders
58
- );
59
-
60
- const {
61
- error: res_error,
62
- } = OrderModel.BulkActionDetailsResponse().validate(response, {
63
- abortEarly: false,
64
- allowUnknown: false,
65
- });
66
-
67
- if (res_error) {
68
- Logger({
69
- level: "WARN",
70
- message: "Response Validation Warnnings for bulkActionDetails",
71
- });
72
- Logger({ level: "WARN", message: res_error });
73
- }
74
-
75
- return response;
76
- }
77
-
78
- /**
79
- * @param {Object} arg - Arg object.
80
- * @param {BulkActionPayload} arg.body
81
- * @returns {Promise<BulkActionResponse>} - Success response
82
- * @summary: emits uuid to kafka topic.
83
- * @description: Use this API to start processing Xlsx file.
84
- */
85
- async bulkActionProcessXlsxFile({ body } = {}) {
86
- const { error } = OrderValidator.bulkActionProcessXlsxFile().validate(
87
- {
88
- body,
89
- },
90
- { abortEarly: false, allowUnknown: true }
91
- );
92
- if (error) {
93
- return Promise.reject(new FDKClientValidationError(error));
94
- }
95
-
96
- // Showing warrnings if extra unknown parameters are found
97
- const {
98
- error: warrning,
99
- } = OrderValidator.bulkActionProcessXlsxFile().validate(
100
- {
101
- body,
102
- },
103
- { abortEarly: false, allowUnknown: false }
104
- );
105
- if (warrning) {
106
- Logger({
107
- level: "WARN",
108
- message: "Parameter Validation warrnings for bulkActionProcessXlsxFile",
109
- });
110
- Logger({ level: "WARN", message: warrning });
111
- }
112
-
113
- const query_params = {};
114
-
115
- const xHeaders = {};
116
-
117
- const response = await PlatformAPIClient.execute(
118
- this.config,
119
- "post",
120
- `/service/platform/orders/v2.0/company/${this.config.companyId}/bulk-action/`,
121
- query_params,
122
- body,
123
- xHeaders
124
- );
125
-
126
- const {
127
- error: res_error,
128
- } = OrderModel.BulkActionResponse().validate(response, {
129
- abortEarly: false,
130
- allowUnknown: false,
131
- });
132
-
133
- if (res_error) {
134
- Logger({
135
- level: "WARN",
136
- message: "Response Validation Warnnings for bulkActionProcessXlsxFile",
137
- });
138
- Logger({ level: "WARN", message: res_error });
139
- }
140
-
141
- return response;
142
- }
143
-
144
14
  /**
145
15
  * @param {Object} arg - Arg object.
146
16
  * @param {OrderStatus} arg.body
@@ -207,11 +77,11 @@ class Order {
207
77
 
208
78
  /**
209
79
  * @param {Object} arg - Arg object.
210
- * @param {string} arg.caller -
211
- * @param {string} arg.receiver -
212
- * @param {string} arg.bagId -
213
- * @param {string} [arg.callingTo] -
214
- * @param {string} [arg.callerId] -
80
+ * @param {string} arg.caller - Call Number
81
+ * @param {string} arg.receiver - Receiver Number
82
+ * @param {string} arg.bagId - Bag Id for the query
83
+ * @param {string} [arg.callerId] - Caller Id
84
+ * @param {string} [arg.method] - Provider Method to Call
215
85
  * @returns {Promise<Click2CallResponse>} - Success response
216
86
  * @summary:
217
87
  * @description:
@@ -221,8 +91,8 @@ class Order {
221
91
  receiver,
222
92
  bagId,
223
93
 
224
- callingTo,
225
94
  callerId,
95
+ method,
226
96
  } = {}) {
227
97
  const { error } = OrderValidator.click2Call().validate(
228
98
  {
@@ -230,8 +100,8 @@ class Order {
230
100
  receiver,
231
101
  bagId,
232
102
 
233
- callingTo,
234
103
  callerId,
104
+ method,
235
105
  },
236
106
  { abortEarly: false, allowUnknown: true }
237
107
  );
@@ -246,8 +116,8 @@ class Order {
246
116
  receiver,
247
117
  bagId,
248
118
 
249
- callingTo,
250
119
  callerId,
120
+ method,
251
121
  },
252
122
  { abortEarly: false, allowUnknown: false }
253
123
  );
@@ -263,8 +133,8 @@ class Order {
263
133
  query_params["caller"] = caller;
264
134
  query_params["receiver"] = receiver;
265
135
  query_params["bag_id"] = bagId;
266
- query_params["calling_to"] = callingTo;
267
136
  query_params["caller_id"] = callerId;
137
+ query_params["method"] = method;
268
138
 
269
139
  const xHeaders = {};
270
140
 
@@ -425,17 +295,15 @@ class Order {
425
295
 
426
296
  /**
427
297
  * @param {Object} arg - Arg object.
428
- * @param {string} [arg.fromDate] -
429
- * @param {string} [arg.toDate] -
430
- * @returns {Promise<Success>} - Success response
298
+ * @param {DispatchManifest} arg.body
299
+ * @returns {Promise<SuccessResponse>} - Success response
431
300
  * @summary:
432
301
  * @description:
433
302
  */
434
- async createShipmentReport({ fromDate, toDate } = {}) {
435
- const { error } = OrderValidator.createShipmentReport().validate(
303
+ async dispatchManifest({ body } = {}) {
304
+ const { error } = OrderValidator.dispatchManifest().validate(
436
305
  {
437
- fromDate,
438
- toDate,
306
+ body,
439
307
  },
440
308
  { abortEarly: false, allowUnknown: true }
441
309
  );
@@ -444,45 +312,42 @@ class Order {
444
312
  }
445
313
 
446
314
  // Showing warrnings if extra unknown parameters are found
447
- const { error: warrning } = OrderValidator.createShipmentReport().validate(
315
+ const { error: warrning } = OrderValidator.dispatchManifest().validate(
448
316
  {
449
- fromDate,
450
- toDate,
317
+ body,
451
318
  },
452
319
  { abortEarly: false, allowUnknown: false }
453
320
  );
454
321
  if (warrning) {
455
322
  Logger({
456
323
  level: "WARN",
457
- message: "Parameter Validation warrnings for createShipmentReport",
324
+ message: "Parameter Validation warrnings for dispatchManifest",
458
325
  });
459
326
  Logger({ level: "WARN", message: warrning });
460
327
  }
461
328
 
462
329
  const query_params = {};
463
- query_params["from_date"] = fromDate;
464
- query_params["to_date"] = toDate;
465
330
 
466
331
  const xHeaders = {};
467
332
 
468
333
  const response = await PlatformAPIClient.execute(
469
334
  this.config,
470
335
  "post",
471
- `/service/platform/orders/v1.0/company/${this.config.companyId}/reports/shipment`,
336
+ `/service/platform/order-manage/v1.0/company/${this.config.companyId}/manifest/dispatch`,
472
337
  query_params,
473
- undefined,
338
+ body,
474
339
  xHeaders
475
340
  );
476
341
 
477
- const { error: res_error } = OrderModel.Success().validate(response, {
478
- abortEarly: false,
479
- allowUnknown: false,
480
- });
342
+ const { error: res_error } = OrderModel.SuccessResponse().validate(
343
+ response,
344
+ { abortEarly: false, allowUnknown: false }
345
+ );
481
346
 
482
347
  if (res_error) {
483
348
  Logger({
484
349
  level: "WARN",
485
- message: "Response Validation Warnnings for createShipmentReport",
350
+ message: "Response Validation Warnnings for dispatchManifest",
486
351
  });
487
352
  Logger({ level: "WARN", message: res_error });
488
353
  }
@@ -492,15 +357,15 @@ class Order {
492
357
 
493
358
  /**
494
359
  * @param {Object} arg - Arg object.
495
- * @param {DispatchManifest} arg.body
496
- * @returns {Promise<SuccessResponse>} - Success response
360
+ * @param {string} [arg.templateSlug] - Slug name of template to be downloaded
361
+ * @returns {Promise<FileResponse>} - Success response
497
362
  * @summary:
498
363
  * @description:
499
364
  */
500
- async dispatchManifest({ body } = {}) {
501
- const { error } = OrderValidator.dispatchManifest().validate(
365
+ async downloadBulkActionTemplate({ templateSlug } = {}) {
366
+ const { error } = OrderValidator.downloadBulkActionTemplate().validate(
502
367
  {
503
- body,
368
+ templateSlug,
504
369
  },
505
370
  { abortEarly: false, allowUnknown: true }
506
371
  );
@@ -509,42 +374,46 @@ class Order {
509
374
  }
510
375
 
511
376
  // Showing warrnings if extra unknown parameters are found
512
- const { error: warrning } = OrderValidator.dispatchManifest().validate(
377
+ const {
378
+ error: warrning,
379
+ } = OrderValidator.downloadBulkActionTemplate().validate(
513
380
  {
514
- body,
381
+ templateSlug,
515
382
  },
516
383
  { abortEarly: false, allowUnknown: false }
517
384
  );
518
385
  if (warrning) {
519
386
  Logger({
520
387
  level: "WARN",
521
- message: "Parameter Validation warrnings for dispatchManifest",
388
+ message:
389
+ "Parameter Validation warrnings for downloadBulkActionTemplate",
522
390
  });
523
391
  Logger({ level: "WARN", message: warrning });
524
392
  }
525
393
 
526
394
  const query_params = {};
395
+ query_params["template_slug"] = templateSlug;
527
396
 
528
397
  const xHeaders = {};
529
398
 
530
399
  const response = await PlatformAPIClient.execute(
531
400
  this.config,
532
- "post",
533
- `/service/platform/order-manage/v1.0/company/${this.config.companyId}/manifest/dispatch`,
401
+ "get",
402
+ `/service/platform/orders/v1.0/company/${this.config.companyId}/bulk-action/download-seller-templates`,
534
403
  query_params,
535
- body,
404
+ undefined,
536
405
  xHeaders
537
406
  );
538
407
 
539
- const { error: res_error } = OrderModel.SuccessResponse().validate(
540
- response,
541
- { abortEarly: false, allowUnknown: false }
542
- );
408
+ const { error: res_error } = OrderModel.FileResponse().validate(response, {
409
+ abortEarly: false,
410
+ allowUnknown: false,
411
+ });
543
412
 
544
413
  if (res_error) {
545
414
  Logger({
546
415
  level: "WARN",
547
- message: "Response Validation Warnnings for dispatchManifest",
416
+ message: "Response Validation Warnnings for downloadBulkActionTemplate",
548
417
  });
549
418
  Logger({ level: "WARN", message: res_error });
550
419
  }
@@ -554,7 +423,8 @@ class Order {
554
423
 
555
424
  /**
556
425
  * @param {Object} arg - Arg object.
557
- * @param {string} [arg.date] -
426
+ * @param {string} [arg.date] - Date On which the announcement is Active
427
+ * (Date should in ISO Datetime format IST Time)
558
428
  * @returns {Promise<AnnouncementsResponse>} - Success response
559
429
  * @summary:
560
430
  * @description:
@@ -799,18 +669,13 @@ class Order {
799
669
 
800
670
  /**
801
671
  * @param {Object} arg - Arg object.
802
- * @param {string} arg.batchId -
803
- * @param {string} [arg.reportType] -
804
- * @returns {Promise<FileResponse>} - Success response
672
+ * @returns {Promise<BulkActionTemplateResponse>} - Success response
805
673
  * @summary:
806
674
  * @description:
807
675
  */
808
- async getBulkActionFailedReport({ batchId, reportType } = {}) {
809
- const { error } = OrderValidator.getBulkActionFailedReport().validate(
810
- {
811
- batchId,
812
- reportType,
813
- },
676
+ async getBulkActionTemplate({} = {}) {
677
+ const { error } = OrderValidator.getBulkActionTemplate().validate(
678
+ {},
814
679
  { abortEarly: false, allowUnknown: true }
815
680
  );
816
681
  if (error) {
@@ -818,39 +683,34 @@ class Order {
818
683
  }
819
684
 
820
685
  // Showing warrnings if extra unknown parameters are found
821
- const {
822
- error: warrning,
823
- } = OrderValidator.getBulkActionFailedReport().validate(
824
- {
825
- batchId,
826
- reportType,
827
- },
686
+ const { error: warrning } = OrderValidator.getBulkActionTemplate().validate(
687
+ {},
828
688
  { abortEarly: false, allowUnknown: false }
829
689
  );
830
690
  if (warrning) {
831
691
  Logger({
832
692
  level: "WARN",
833
- message: "Parameter Validation warrnings for getBulkActionFailedReport",
693
+ message: "Parameter Validation warrnings for getBulkActionTemplate",
834
694
  });
835
695
  Logger({ level: "WARN", message: warrning });
836
696
  }
837
697
 
838
698
  const query_params = {};
839
- query_params["batch_id"] = batchId;
840
- query_params["report_type"] = reportType;
841
699
 
842
700
  const xHeaders = {};
843
701
 
844
702
  const response = await PlatformAPIClient.execute(
845
703
  this.config,
846
704
  "get",
847
- `/service/platform/orders/v1.0/company/${this.config.companyId}/bulk-action-failed-report/`,
705
+ `/service/platform/orders/v1.0/company/${this.config.companyId}/bulk-action/get-seller-templates`,
848
706
  query_params,
849
707
  undefined,
850
708
  xHeaders
851
709
  );
852
710
 
853
- const { error: res_error } = OrderModel.FileResponse().validate(response, {
711
+ const {
712
+ error: res_error,
713
+ } = OrderModel.BulkActionTemplateResponse().validate(response, {
854
714
  abortEarly: false,
855
715
  allowUnknown: false,
856
716
  });
@@ -858,7 +718,7 @@ class Order {
858
718
  if (res_error) {
859
719
  Logger({
860
720
  level: "WARN",
861
- message: "Response Validation Warnnings for getBulkActionFailedReport",
721
+ message: "Response Validation Warnnings for getBulkActionTemplate",
862
722
  });
863
723
  Logger({ level: "WARN", message: res_error });
864
724
  }
@@ -868,17 +728,50 @@ class Order {
868
728
 
869
729
  /**
870
730
  * @param {Object} arg - Arg object.
871
- * @param {string} arg.batchId -
872
- * @param {string} arg.docType -
873
- * @returns {Promise<BulkInvoicingResponse>} - Success response
731
+ * @param {string} [arg.salesChannels] - Comma seperated values of sales channel ids
732
+ * @param {string} [arg.dpIds] - Comma seperated values of delivery partner ids
733
+ * @param {string} [arg.fromDate] - Start Date in DD-MM-YYYY format
734
+ * @param {string} [arg.toDate] - End Date in DD-MM-YYYY format
735
+ * @param {string} [arg.stores] - Comma seperated values of store ids
736
+ * @param {string} [arg.tags] - Comma seperated values of tags
737
+ * @param {string} [arg.bagStatus] - Comma seperated values of bag statuses
738
+ * @param {string} [arg.paymentMethods] - Comma seperated values of payment methods
739
+ * @param {string} [arg.fileType] - File type to be downloaded
740
+ * @param {number} [arg.timeToDispatch] - Sla breached or not breached
741
+ * @param {number} [arg.pageNo] -
742
+ * @param {number} [arg.pageSize] -
743
+ * @returns {Promise<FileResponse>} - Success response
874
744
  * @summary:
875
745
  * @description:
876
746
  */
877
- async getBulkInvoice({ batchId, docType } = {}) {
878
- const { error } = OrderValidator.getBulkInvoice().validate(
747
+ async getBulkShipmentExcelFile({
748
+ salesChannels,
749
+ dpIds,
750
+ fromDate,
751
+ toDate,
752
+ stores,
753
+ tags,
754
+ bagStatus,
755
+ paymentMethods,
756
+ fileType,
757
+ timeToDispatch,
758
+ pageNo,
759
+ pageSize,
760
+ } = {}) {
761
+ const { error } = OrderValidator.getBulkShipmentExcelFile().validate(
879
762
  {
880
- batchId,
881
- docType,
763
+ salesChannels,
764
+ dpIds,
765
+ fromDate,
766
+ toDate,
767
+ stores,
768
+ tags,
769
+ bagStatus,
770
+ paymentMethods,
771
+ fileType,
772
+ timeToDispatch,
773
+ pageNo,
774
+ pageSize,
882
775
  },
883
776
  { abortEarly: false, allowUnknown: true }
884
777
  );
@@ -887,39 +780,59 @@ class Order {
887
780
  }
888
781
 
889
782
  // Showing warrnings if extra unknown parameters are found
890
- const { error: warrning } = OrderValidator.getBulkInvoice().validate(
783
+ const {
784
+ error: warrning,
785
+ } = OrderValidator.getBulkShipmentExcelFile().validate(
891
786
  {
892
- batchId,
893
- docType,
787
+ salesChannels,
788
+ dpIds,
789
+ fromDate,
790
+ toDate,
791
+ stores,
792
+ tags,
793
+ bagStatus,
794
+ paymentMethods,
795
+ fileType,
796
+ timeToDispatch,
797
+ pageNo,
798
+ pageSize,
894
799
  },
895
800
  { abortEarly: false, allowUnknown: false }
896
801
  );
897
802
  if (warrning) {
898
803
  Logger({
899
804
  level: "WARN",
900
- message: "Parameter Validation warrnings for getBulkInvoice",
805
+ message: "Parameter Validation warrnings for getBulkShipmentExcelFile",
901
806
  });
902
807
  Logger({ level: "WARN", message: warrning });
903
808
  }
904
809
 
905
810
  const query_params = {};
906
- query_params["batch_id"] = batchId;
907
- query_params["doc_type"] = docType;
811
+ query_params["sales_channels"] = salesChannels;
812
+ query_params["dp_ids"] = dpIds;
813
+ query_params["from_date"] = fromDate;
814
+ query_params["to_date"] = toDate;
815
+ query_params["stores"] = stores;
816
+ query_params["tags"] = tags;
817
+ query_params["bag_status"] = bagStatus;
818
+ query_params["payment_methods"] = paymentMethods;
819
+ query_params["file_type"] = fileType;
820
+ query_params["time_to_dispatch"] = timeToDispatch;
821
+ query_params["page_no"] = pageNo;
822
+ query_params["page_size"] = pageSize;
908
823
 
909
824
  const xHeaders = {};
910
825
 
911
826
  const response = await PlatformAPIClient.execute(
912
827
  this.config,
913
828
  "get",
914
- `/service/platform/orders/v1.0/company/${this.config.companyId}/bulk-action/invoice`,
829
+ `/service/platform/orders/v1.0/company/${this.config.companyId}/generate/file`,
915
830
  query_params,
916
831
  undefined,
917
832
  xHeaders
918
833
  );
919
834
 
920
- const {
921
- error: res_error,
922
- } = OrderModel.BulkInvoicingResponse().validate(response, {
835
+ const { error: res_error } = OrderModel.FileResponse().validate(response, {
923
836
  abortEarly: false,
924
837
  allowUnknown: false,
925
838
  });
@@ -927,7 +840,7 @@ class Order {
927
840
  if (res_error) {
928
841
  Logger({
929
842
  level: "WARN",
930
- message: "Response Validation Warnnings for getBulkInvoice",
843
+ message: "Response Validation Warnnings for getBulkShipmentExcelFile",
931
844
  });
932
845
  Logger({ level: "WARN", message: res_error });
933
846
  }
@@ -937,16 +850,13 @@ class Order {
937
850
 
938
851
  /**
939
852
  * @param {Object} arg - Arg object.
940
- * @param {string} arg.batchId -
941
- * @returns {Promise<BulkInvoiceLabelResponse>} - Success response
853
+ * @returns {Promise<CreateChannelConfigData>} - Success response
942
854
  * @summary:
943
- * @description:
855
+ * @description: getChannelConfig
944
856
  */
945
- async getBulkInvoiceLabel({ batchId } = {}) {
946
- const { error } = OrderValidator.getBulkInvoiceLabel().validate(
947
- {
948
- batchId,
949
- },
857
+ async getChannelConfig({} = {}) {
858
+ const { error } = OrderValidator.getChannelConfig().validate(
859
+ {},
950
860
  { abortEarly: false, allowUnknown: true }
951
861
  );
952
862
  if (error) {
@@ -954,29 +864,26 @@ class Order {
954
864
  }
955
865
 
956
866
  // Showing warrnings if extra unknown parameters are found
957
- const { error: warrning } = OrderValidator.getBulkInvoiceLabel().validate(
958
- {
959
- batchId,
960
- },
867
+ const { error: warrning } = OrderValidator.getChannelConfig().validate(
868
+ {},
961
869
  { abortEarly: false, allowUnknown: false }
962
870
  );
963
871
  if (warrning) {
964
872
  Logger({
965
873
  level: "WARN",
966
- message: "Parameter Validation warrnings for getBulkInvoiceLabel",
874
+ message: "Parameter Validation warrnings for getChannelConfig",
967
875
  });
968
876
  Logger({ level: "WARN", message: warrning });
969
877
  }
970
878
 
971
879
  const query_params = {};
972
- query_params["batch_id"] = batchId;
973
880
 
974
881
  const xHeaders = {};
975
882
 
976
883
  const response = await PlatformAPIClient.execute(
977
884
  this.config,
978
885
  "get",
979
- `/service/platform/orders/v1.0/company/${this.config.companyId}/invoice-label-external`,
886
+ `/service/platform/order-manage/v1.0/company/${this.config.companyId}/order-config`,
980
887
  query_params,
981
888
  undefined,
982
889
  xHeaders
@@ -984,7 +891,7 @@ class Order {
984
891
 
985
892
  const {
986
893
  error: res_error,
987
- } = OrderModel.BulkInvoiceLabelResponse().validate(response, {
894
+ } = OrderModel.CreateChannelConfigData().validate(response, {
988
895
  abortEarly: false,
989
896
  allowUnknown: false,
990
897
  });
@@ -992,7 +899,7 @@ class Order {
992
899
  if (res_error) {
993
900
  Logger({
994
901
  level: "WARN",
995
- message: "Response Validation Warnnings for getBulkInvoiceLabel",
902
+ message: "Response Validation Warnnings for getChannelConfig",
996
903
  });
997
904
  Logger({ level: "WARN", message: res_error });
998
905
  }
@@ -1002,339 +909,16 @@ class Order {
1002
909
 
1003
910
  /**
1004
911
  * @param {Object} arg - Arg object.
1005
- * @param {string} [arg.lane] -
1006
- * @param {string} [arg.searchType] -
1007
- * @param {string} [arg.searchId] -
912
+ * @param {string} [arg.superLane] -
913
+ * @param {string} [arg.groupEntity] -
1008
914
  * @param {string} [arg.fromDate] -
1009
915
  * @param {string} [arg.toDate] -
1010
916
  * @param {string} [arg.dpIds] -
1011
- * @param {string} [arg.orderingCompanyId] -
1012
917
  * @param {string} [arg.stores] -
1013
918
  * @param {string} [arg.salesChannel] -
1014
- * @param {string} [arg.requestByExt] -
1015
- * @param {number} [arg.pageNo] -
1016
- * @param {number} [arg.pageSize] -
1017
- * @param {string} [arg.customerId] -
1018
- * @param {boolean} [arg.isPrioritySort] -
1019
- * @returns {Promise<BulkListingResponse>} - Success response
1020
- * @summary:
1021
- * @description:
1022
- */
1023
- async getBulkList({
1024
- lane,
1025
- searchType,
1026
- searchId,
1027
- fromDate,
1028
- toDate,
1029
- dpIds,
1030
- orderingCompanyId,
1031
- stores,
1032
- salesChannel,
1033
- requestByExt,
1034
- pageNo,
1035
- pageSize,
1036
- customerId,
1037
- isPrioritySort,
1038
- } = {}) {
1039
- const { error } = OrderValidator.getBulkList().validate(
1040
- {
1041
- lane,
1042
- searchType,
1043
- searchId,
1044
- fromDate,
1045
- toDate,
1046
- dpIds,
1047
- orderingCompanyId,
1048
- stores,
1049
- salesChannel,
1050
- requestByExt,
1051
- pageNo,
1052
- pageSize,
1053
- customerId,
1054
- isPrioritySort,
1055
- },
1056
- { abortEarly: false, allowUnknown: true }
1057
- );
1058
- if (error) {
1059
- return Promise.reject(new FDKClientValidationError(error));
1060
- }
1061
-
1062
- // Showing warrnings if extra unknown parameters are found
1063
- const { error: warrning } = OrderValidator.getBulkList().validate(
1064
- {
1065
- lane,
1066
- searchType,
1067
- searchId,
1068
- fromDate,
1069
- toDate,
1070
- dpIds,
1071
- orderingCompanyId,
1072
- stores,
1073
- salesChannel,
1074
- requestByExt,
1075
- pageNo,
1076
- pageSize,
1077
- customerId,
1078
- isPrioritySort,
1079
- },
1080
- { abortEarly: false, allowUnknown: false }
1081
- );
1082
- if (warrning) {
1083
- Logger({
1084
- level: "WARN",
1085
- message: "Parameter Validation warrnings for getBulkList",
1086
- });
1087
- Logger({ level: "WARN", message: warrning });
1088
- }
1089
-
1090
- const query_params = {};
1091
- query_params["lane"] = lane;
1092
- query_params["search_type"] = searchType;
1093
- query_params["search_id"] = searchId;
1094
- query_params["from_date"] = fromDate;
1095
- query_params["to_date"] = toDate;
1096
- query_params["dp_ids"] = dpIds;
1097
- query_params["ordering_company_id"] = orderingCompanyId;
1098
- query_params["stores"] = stores;
1099
- query_params["sales_channel"] = salesChannel;
1100
- query_params["request_by_ext"] = requestByExt;
1101
- query_params["page_no"] = pageNo;
1102
- query_params["page_size"] = pageSize;
1103
- query_params["customer_id"] = customerId;
1104
- query_params["is_priority_sort"] = isPrioritySort;
1105
-
1106
- const xHeaders = {};
1107
-
1108
- const response = await PlatformAPIClient.execute(
1109
- this.config,
1110
- "get",
1111
- `/service/platform/orders/v1.0/company/${this.config.companyId}/bulk-action/listing`,
1112
- query_params,
1113
- undefined,
1114
- xHeaders
1115
- );
1116
-
1117
- const {
1118
- error: res_error,
1119
- } = OrderModel.BulkListingResponse().validate(response, {
1120
- abortEarly: false,
1121
- allowUnknown: false,
1122
- });
1123
-
1124
- if (res_error) {
1125
- Logger({
1126
- level: "WARN",
1127
- message: "Response Validation Warnnings for getBulkList",
1128
- });
1129
- Logger({ level: "WARN", message: res_error });
1130
- }
1131
-
1132
- return response;
1133
- }
1134
-
1135
- /**
1136
- * @param {Object} arg - Arg object.
1137
- * @param {string} [arg.lane] -
1138
- * @param {string} [arg.searchType] -
1139
- * @param {string} [arg.searchId] -
1140
- * @param {string} [arg.fromDate] -
1141
- * @param {string} [arg.toDate] -
1142
- * @param {string} [arg.dpIds] -
1143
- * @param {string} [arg.orderingCompanyId] -
1144
- * @param {string} [arg.stores] -
1145
- * @param {string} [arg.salesChannel] -
1146
- * @param {string} [arg.requestByExt] -
1147
- * @param {number} [arg.pageNo] -
1148
- * @param {number} [arg.pageSize] -
1149
- * @param {string} [arg.customerId] -
1150
- * @param {boolean} [arg.isPrioritySort] -
1151
- * @returns {Promise<FileResponse>} - Success response
1152
- * @summary:
1153
- * @description:
1154
- */
1155
- async getBulkShipmentExcelFile({
1156
- lane,
1157
- searchType,
1158
- searchId,
1159
- fromDate,
1160
- toDate,
1161
- dpIds,
1162
- orderingCompanyId,
1163
- stores,
1164
- salesChannel,
1165
- requestByExt,
1166
- pageNo,
1167
- pageSize,
1168
- customerId,
1169
- isPrioritySort,
1170
- } = {}) {
1171
- const { error } = OrderValidator.getBulkShipmentExcelFile().validate(
1172
- {
1173
- lane,
1174
- searchType,
1175
- searchId,
1176
- fromDate,
1177
- toDate,
1178
- dpIds,
1179
- orderingCompanyId,
1180
- stores,
1181
- salesChannel,
1182
- requestByExt,
1183
- pageNo,
1184
- pageSize,
1185
- customerId,
1186
- isPrioritySort,
1187
- },
1188
- { abortEarly: false, allowUnknown: true }
1189
- );
1190
- if (error) {
1191
- return Promise.reject(new FDKClientValidationError(error));
1192
- }
1193
-
1194
- // Showing warrnings if extra unknown parameters are found
1195
- const {
1196
- error: warrning,
1197
- } = OrderValidator.getBulkShipmentExcelFile().validate(
1198
- {
1199
- lane,
1200
- searchType,
1201
- searchId,
1202
- fromDate,
1203
- toDate,
1204
- dpIds,
1205
- orderingCompanyId,
1206
- stores,
1207
- salesChannel,
1208
- requestByExt,
1209
- pageNo,
1210
- pageSize,
1211
- customerId,
1212
- isPrioritySort,
1213
- },
1214
- { abortEarly: false, allowUnknown: false }
1215
- );
1216
- if (warrning) {
1217
- Logger({
1218
- level: "WARN",
1219
- message: "Parameter Validation warrnings for getBulkShipmentExcelFile",
1220
- });
1221
- Logger({ level: "WARN", message: warrning });
1222
- }
1223
-
1224
- const query_params = {};
1225
- query_params["lane"] = lane;
1226
- query_params["search_type"] = searchType;
1227
- query_params["search_id"] = searchId;
1228
- query_params["from_date"] = fromDate;
1229
- query_params["to_date"] = toDate;
1230
- query_params["dp_ids"] = dpIds;
1231
- query_params["ordering_company_id"] = orderingCompanyId;
1232
- query_params["stores"] = stores;
1233
- query_params["sales_channel"] = salesChannel;
1234
- query_params["request_by_ext"] = requestByExt;
1235
- query_params["page_no"] = pageNo;
1236
- query_params["page_size"] = pageSize;
1237
- query_params["customer_id"] = customerId;
1238
- query_params["is_priority_sort"] = isPrioritySort;
1239
-
1240
- const xHeaders = {};
1241
-
1242
- const response = await PlatformAPIClient.execute(
1243
- this.config,
1244
- "get",
1245
- `/service/platform/orders/v1.0/company/${this.config.companyId}/generate/file`,
1246
- query_params,
1247
- undefined,
1248
- xHeaders
1249
- );
1250
-
1251
- const { error: res_error } = OrderModel.FileResponse().validate(response, {
1252
- abortEarly: false,
1253
- allowUnknown: false,
1254
- });
1255
-
1256
- if (res_error) {
1257
- Logger({
1258
- level: "WARN",
1259
- message: "Response Validation Warnnings for getBulkShipmentExcelFile",
1260
- });
1261
- Logger({ level: "WARN", message: res_error });
1262
- }
1263
-
1264
- return response;
1265
- }
1266
-
1267
- /**
1268
- * @param {Object} arg - Arg object.
1269
- * @returns {Promise<CreateChannelConfigData>} - Success response
1270
- * @summary:
1271
- * @description: getChannelConfig
1272
- */
1273
- async getChannelConfig({} = {}) {
1274
- const { error } = OrderValidator.getChannelConfig().validate(
1275
- {},
1276
- { abortEarly: false, allowUnknown: true }
1277
- );
1278
- if (error) {
1279
- return Promise.reject(new FDKClientValidationError(error));
1280
- }
1281
-
1282
- // Showing warrnings if extra unknown parameters are found
1283
- const { error: warrning } = OrderValidator.getChannelConfig().validate(
1284
- {},
1285
- { abortEarly: false, allowUnknown: false }
1286
- );
1287
- if (warrning) {
1288
- Logger({
1289
- level: "WARN",
1290
- message: "Parameter Validation warrnings for getChannelConfig",
1291
- });
1292
- Logger({ level: "WARN", message: warrning });
1293
- }
1294
-
1295
- const query_params = {};
1296
-
1297
- const xHeaders = {};
1298
-
1299
- const response = await PlatformAPIClient.execute(
1300
- this.config,
1301
- "get",
1302
- `/service/platform/order-manage/v1.0/company/${this.config.companyId}/order-config`,
1303
- query_params,
1304
- undefined,
1305
- xHeaders
1306
- );
1307
-
1308
- const {
1309
- error: res_error,
1310
- } = OrderModel.CreateChannelConfigData().validate(response, {
1311
- abortEarly: false,
1312
- allowUnknown: false,
1313
- });
1314
-
1315
- if (res_error) {
1316
- Logger({
1317
- level: "WARN",
1318
- message: "Response Validation Warnnings for getChannelConfig",
1319
- });
1320
- Logger({ level: "WARN", message: res_error });
1321
- }
1322
-
1323
- return response;
1324
- }
1325
-
1326
- /**
1327
- * @param {Object} arg - Arg object.
1328
- * @param {string} [arg.superLane] -
1329
- * @param {string} [arg.groupEntity] -
1330
- * @param {string} [arg.fromDate] -
1331
- * @param {string} [arg.toDate] -
1332
- * @param {string} [arg.dpIds] -
1333
- * @param {string} [arg.stores] -
1334
- * @param {string} [arg.salesChannel] -
1335
- * @param {string} [arg.paymentMode] -
1336
- * @param {string} [arg.bagStatus] -
1337
- * @returns {Promise<LaneConfigResponse>} - Success response
919
+ * @param {string} [arg.paymentMode] -
920
+ * @param {string} [arg.bagStatus] -
921
+ * @returns {Promise<LaneConfigResponse>} - Success response
1338
922
  * @summary:
1339
923
  * @description:
1340
924
  */
@@ -1430,75 +1014,6 @@ class Order {
1430
1014
  return response;
1431
1015
  }
1432
1016
 
1433
- /**
1434
- * @param {Object} arg - Arg object.
1435
- * @param {string} [arg.fromDate] -
1436
- * @param {string} [arg.toDate] -
1437
- * @returns {Promise<MetricCountResponse>} - Success response
1438
- * @summary:
1439
- * @description:
1440
- */
1441
- async getMetricCount({ fromDate, toDate } = {}) {
1442
- const { error } = OrderValidator.getMetricCount().validate(
1443
- {
1444
- fromDate,
1445
- toDate,
1446
- },
1447
- { abortEarly: false, allowUnknown: true }
1448
- );
1449
- if (error) {
1450
- return Promise.reject(new FDKClientValidationError(error));
1451
- }
1452
-
1453
- // Showing warrnings if extra unknown parameters are found
1454
- const { error: warrning } = OrderValidator.getMetricCount().validate(
1455
- {
1456
- fromDate,
1457
- toDate,
1458
- },
1459
- { abortEarly: false, allowUnknown: false }
1460
- );
1461
- if (warrning) {
1462
- Logger({
1463
- level: "WARN",
1464
- message: "Parameter Validation warrnings for getMetricCount",
1465
- });
1466
- Logger({ level: "WARN", message: warrning });
1467
- }
1468
-
1469
- const query_params = {};
1470
- query_params["from_date"] = fromDate;
1471
- query_params["to_date"] = toDate;
1472
-
1473
- const xHeaders = {};
1474
-
1475
- const response = await PlatformAPIClient.execute(
1476
- this.config,
1477
- "get",
1478
- `/service/platform/orders/v1.0/company/${this.config.companyId}/shipment/metrics-count/`,
1479
- query_params,
1480
- undefined,
1481
- xHeaders
1482
- );
1483
-
1484
- const {
1485
- error: res_error,
1486
- } = OrderModel.MetricCountResponse().validate(response, {
1487
- abortEarly: false,
1488
- allowUnknown: false,
1489
- });
1490
-
1491
- if (res_error) {
1492
- Logger({
1493
- level: "WARN",
1494
- message: "Response Validation Warnnings for getMetricCount",
1495
- });
1496
- Logger({ level: "WARN", message: res_error });
1497
- }
1498
-
1499
- return response;
1500
- }
1501
-
1502
1017
  /**
1503
1018
  * @param {Object} arg - Arg object.
1504
1019
  * @param {string} arg.orderId -
@@ -1630,136 +1145,67 @@ class Order {
1630
1145
  }
1631
1146
 
1632
1147
  // Showing warrnings if extra unknown parameters are found
1633
- const { error: warrning } = OrderValidator.getOrders().validate(
1634
- {
1635
- lane,
1636
- searchType,
1637
- bagStatus,
1638
- timeToDispatch,
1639
- paymentMethods,
1640
- tags,
1641
- searchValue,
1642
- fromDate,
1643
- toDate,
1644
- dpIds,
1645
- stores,
1646
- salesChannel,
1647
- pageNo,
1648
- pageSize,
1649
- isPrioritySort,
1650
- customMeta,
1651
- },
1652
- { abortEarly: false, allowUnknown: false }
1653
- );
1654
- if (warrning) {
1655
- Logger({
1656
- level: "WARN",
1657
- message: "Parameter Validation warrnings for getOrders",
1658
- });
1659
- Logger({ level: "WARN", message: warrning });
1660
- }
1661
-
1662
- const query_params = {};
1663
- query_params["lane"] = lane;
1664
- query_params["search_type"] = searchType;
1665
- query_params["bag_status"] = bagStatus;
1666
- query_params["time_to_dispatch"] = timeToDispatch;
1667
- query_params["payment_methods"] = paymentMethods;
1668
- query_params["tags"] = tags;
1669
- query_params["search_value"] = searchValue;
1670
- query_params["from_date"] = fromDate;
1671
- query_params["to_date"] = toDate;
1672
- query_params["dp_ids"] = dpIds;
1673
- query_params["stores"] = stores;
1674
- query_params["sales_channel"] = salesChannel;
1675
- query_params["page_no"] = pageNo;
1676
- query_params["page_size"] = pageSize;
1677
- query_params["is_priority_sort"] = isPrioritySort;
1678
- query_params["custom_meta"] = customMeta;
1679
-
1680
- const xHeaders = {};
1681
-
1682
- const response = await PlatformAPIClient.execute(
1683
- this.config,
1684
- "get",
1685
- `/service/platform/orders/v1.0/company/${this.config.companyId}/orders-listing`,
1686
- query_params,
1687
- undefined,
1688
- xHeaders
1689
- );
1690
-
1691
- const {
1692
- error: res_error,
1693
- } = OrderModel.OrderListingResponse().validate(response, {
1694
- abortEarly: false,
1695
- allowUnknown: false,
1696
- });
1697
-
1698
- if (res_error) {
1699
- Logger({
1700
- level: "WARN",
1701
- message: "Response Validation Warnnings for getOrders",
1702
- });
1703
- Logger({ level: "WARN", message: res_error });
1704
- }
1705
-
1706
- return response;
1707
- }
1708
-
1709
- /**
1710
- * @param {Object} arg - Arg object.
1711
- * @param {number} [arg.pageNo] -
1712
- * @param {number} [arg.pageSize] -
1713
- * @returns {Promise<OmsReports>} - Success response
1714
- * @summary:
1715
- * @description:
1716
- */
1717
- async getReportsShipmentListing({ pageNo, pageSize } = {}) {
1718
- const { error } = OrderValidator.getReportsShipmentListing().validate(
1719
- {
1720
- pageNo,
1721
- pageSize,
1722
- },
1723
- { abortEarly: false, allowUnknown: true }
1724
- );
1725
- if (error) {
1726
- return Promise.reject(new FDKClientValidationError(error));
1727
- }
1728
-
1729
- // Showing warrnings if extra unknown parameters are found
1730
- const {
1731
- error: warrning,
1732
- } = OrderValidator.getReportsShipmentListing().validate(
1148
+ const { error: warrning } = OrderValidator.getOrders().validate(
1733
1149
  {
1150
+ lane,
1151
+ searchType,
1152
+ bagStatus,
1153
+ timeToDispatch,
1154
+ paymentMethods,
1155
+ tags,
1156
+ searchValue,
1157
+ fromDate,
1158
+ toDate,
1159
+ dpIds,
1160
+ stores,
1161
+ salesChannel,
1734
1162
  pageNo,
1735
1163
  pageSize,
1164
+ isPrioritySort,
1165
+ customMeta,
1736
1166
  },
1737
1167
  { abortEarly: false, allowUnknown: false }
1738
1168
  );
1739
1169
  if (warrning) {
1740
1170
  Logger({
1741
1171
  level: "WARN",
1742
- message: "Parameter Validation warrnings for getReportsShipmentListing",
1172
+ message: "Parameter Validation warrnings for getOrders",
1743
1173
  });
1744
1174
  Logger({ level: "WARN", message: warrning });
1745
1175
  }
1746
1176
 
1747
1177
  const query_params = {};
1178
+ query_params["lane"] = lane;
1179
+ query_params["search_type"] = searchType;
1180
+ query_params["bag_status"] = bagStatus;
1181
+ query_params["time_to_dispatch"] = timeToDispatch;
1182
+ query_params["payment_methods"] = paymentMethods;
1183
+ query_params["tags"] = tags;
1184
+ query_params["search_value"] = searchValue;
1185
+ query_params["from_date"] = fromDate;
1186
+ query_params["to_date"] = toDate;
1187
+ query_params["dp_ids"] = dpIds;
1188
+ query_params["stores"] = stores;
1189
+ query_params["sales_channel"] = salesChannel;
1748
1190
  query_params["page_no"] = pageNo;
1749
1191
  query_params["page_size"] = pageSize;
1192
+ query_params["is_priority_sort"] = isPrioritySort;
1193
+ query_params["custom_meta"] = customMeta;
1750
1194
 
1751
1195
  const xHeaders = {};
1752
1196
 
1753
1197
  const response = await PlatformAPIClient.execute(
1754
1198
  this.config,
1755
1199
  "get",
1756
- `/service/platform/orders/v1.0/company/${this.config.companyId}/reports/shipment-listing`,
1200
+ `/service/platform/orders/v1.0/company/${this.config.companyId}/orders-listing`,
1757
1201
  query_params,
1758
1202
  undefined,
1759
1203
  xHeaders
1760
1204
  );
1761
1205
 
1762
- const { error: res_error } = OrderModel.OmsReports().validate(response, {
1206
+ const {
1207
+ error: res_error,
1208
+ } = OrderModel.OrderListingResponse().validate(response, {
1763
1209
  abortEarly: false,
1764
1210
  allowUnknown: false,
1765
1211
  });
@@ -1767,7 +1213,7 @@ class Order {
1767
1213
  if (res_error) {
1768
1214
  Logger({
1769
1215
  level: "WARN",
1770
- message: "Response Validation Warnnings for getReportsShipmentListing",
1216
+ message: "Response Validation Warnnings for getOrders",
1771
1217
  });
1772
1218
  Logger({ level: "WARN", message: res_error });
1773
1219
  }
@@ -1918,8 +1364,8 @@ class Order {
1918
1364
 
1919
1365
  /**
1920
1366
  * @param {Object} arg - Arg object.
1921
- * @param {number} [arg.shipmentId] -
1922
- * @param {number} [arg.bagId] -
1367
+ * @param {string} [arg.shipmentId] - Shipment Id
1368
+ * @param {number} [arg.bagId] - Bag/Product Id
1923
1369
  * @returns {Promise<ShipmentHistoryResponse>} - Success response
1924
1370
  * @summary:
1925
1371
  * @description:
@@ -2240,6 +1686,65 @@ class Order {
2240
1686
  return response;
2241
1687
  }
2242
1688
 
1689
+ /**
1690
+ * @param {Object} arg - Arg object.
1691
+ * @returns {Promise<BagStateTransitionMap>} - Success response
1692
+ * @summary:
1693
+ * @description:
1694
+ */
1695
+ async getStateTransitionMap({} = {}) {
1696
+ const { error } = OrderValidator.getStateTransitionMap().validate(
1697
+ {},
1698
+ { abortEarly: false, allowUnknown: true }
1699
+ );
1700
+ if (error) {
1701
+ return Promise.reject(new FDKClientValidationError(error));
1702
+ }
1703
+
1704
+ // Showing warrnings if extra unknown parameters are found
1705
+ const { error: warrning } = OrderValidator.getStateTransitionMap().validate(
1706
+ {},
1707
+ { abortEarly: false, allowUnknown: false }
1708
+ );
1709
+ if (warrning) {
1710
+ Logger({
1711
+ level: "WARN",
1712
+ message: "Parameter Validation warrnings for getStateTransitionMap",
1713
+ });
1714
+ Logger({ level: "WARN", message: warrning });
1715
+ }
1716
+
1717
+ const query_params = {};
1718
+
1719
+ const xHeaders = {};
1720
+
1721
+ const response = await PlatformAPIClient.execute(
1722
+ this.config,
1723
+ "get",
1724
+ `/service/platform/order-manage/v1.0/company/${this.config.companyId}/bag/state/transition`,
1725
+ query_params,
1726
+ undefined,
1727
+ xHeaders
1728
+ );
1729
+
1730
+ const {
1731
+ error: res_error,
1732
+ } = OrderModel.BagStateTransitionMap().validate(response, {
1733
+ abortEarly: false,
1734
+ allowUnknown: false,
1735
+ });
1736
+
1737
+ if (res_error) {
1738
+ Logger({
1739
+ level: "WARN",
1740
+ message: "Response Validation Warnnings for getStateTransitionMap",
1741
+ });
1742
+ Logger({ level: "WARN", message: res_error });
1743
+ }
1744
+
1745
+ return response;
1746
+ }
1747
+
2243
1748
  /**
2244
1749
  * @param {Object} arg - Arg object.
2245
1750
  * @param {string} arg.view -
@@ -2435,76 +1940,6 @@ class Order {
2435
1940
  return response;
2436
1941
  }
2437
1942
 
2438
- /**
2439
- * @param {Object} arg - Arg object.
2440
- * @param {ManualAssignDPToShipment} arg.body
2441
- * @returns {Promise<ManualAssignDPToShipmentResponse>} - Success response
2442
- * @summary:
2443
- * @description:
2444
- */
2445
- async platformManualAssignDPToShipment({ body } = {}) {
2446
- const {
2447
- error,
2448
- } = OrderValidator.platformManualAssignDPToShipment().validate(
2449
- {
2450
- body,
2451
- },
2452
- { abortEarly: false, allowUnknown: true }
2453
- );
2454
- if (error) {
2455
- return Promise.reject(new FDKClientValidationError(error));
2456
- }
2457
-
2458
- // Showing warrnings if extra unknown parameters are found
2459
- const {
2460
- error: warrning,
2461
- } = OrderValidator.platformManualAssignDPToShipment().validate(
2462
- {
2463
- body,
2464
- },
2465
- { abortEarly: false, allowUnknown: false }
2466
- );
2467
- if (warrning) {
2468
- Logger({
2469
- level: "WARN",
2470
- message:
2471
- "Parameter Validation warrnings for platformManualAssignDPToShipment",
2472
- });
2473
- Logger({ level: "WARN", message: warrning });
2474
- }
2475
-
2476
- const query_params = {};
2477
-
2478
- const xHeaders = {};
2479
-
2480
- const response = await PlatformAPIClient.execute(
2481
- this.config,
2482
- "post",
2483
- `/service/platform/order-manage/v1.0/company/${this.config.companyId}/oms/manual-place-shipment`,
2484
- query_params,
2485
- body,
2486
- xHeaders
2487
- );
2488
-
2489
- const {
2490
- error: res_error,
2491
- } = OrderModel.ManualAssignDPToShipmentResponse().validate(response, {
2492
- abortEarly: false,
2493
- allowUnknown: false,
2494
- });
2495
-
2496
- if (res_error) {
2497
- Logger({
2498
- level: "WARN",
2499
- message:
2500
- "Response Validation Warnnings for platformManualAssignDPToShipment",
2501
- });
2502
- Logger({ level: "WARN", message: res_error });
2503
- }
2504
-
2505
- return response;
2506
- }
2507
-
2508
1943
  /**
2509
1944
  * @param {Object} arg - Arg object.
2510
1945
  * @param {PostShipmentHistory} arg.body
@@ -2761,65 +2196,6 @@ class Order {
2761
2196
  return response;
2762
2197
  }
2763
2198
 
2764
- /**
2765
- * @param {Object} arg - Arg object.
2766
- * @returns {Promise<OrderStatusResult>} - Success response
2767
- * @summary:
2768
- * @description:
2769
- */
2770
- async sendSmsNinjaPlatform({} = {}) {
2771
- const { error } = OrderValidator.sendSmsNinjaPlatform().validate(
2772
- {},
2773
- { abortEarly: false, allowUnknown: true }
2774
- );
2775
- if (error) {
2776
- return Promise.reject(new FDKClientValidationError(error));
2777
- }
2778
-
2779
- // Showing warrnings if extra unknown parameters are found
2780
- const { error: warrning } = OrderValidator.sendSmsNinjaPlatform().validate(
2781
- {},
2782
- { abortEarly: false, allowUnknown: false }
2783
- );
2784
- if (warrning) {
2785
- Logger({
2786
- level: "WARN",
2787
- message: "Parameter Validation warrnings for sendSmsNinjaPlatform",
2788
- });
2789
- Logger({ level: "WARN", message: warrning });
2790
- }
2791
-
2792
- const query_params = {};
2793
-
2794
- const xHeaders = {};
2795
-
2796
- const response = await PlatformAPIClient.execute(
2797
- this.config,
2798
- "get",
2799
- `/service/platform/order-manage/v1.0/company/${this.config.companyId}/bag/state/transition`,
2800
- query_params,
2801
- undefined,
2802
- xHeaders
2803
- );
2804
-
2805
- const {
2806
- error: res_error,
2807
- } = OrderModel.OrderStatusResult().validate(response, {
2808
- abortEarly: false,
2809
- allowUnknown: false,
2810
- });
2811
-
2812
- if (res_error) {
2813
- Logger({
2814
- level: "WARN",
2815
- message: "Response Validation Warnnings for sendSmsNinjaPlatform",
2816
- });
2817
- Logger({ level: "WARN", message: res_error });
2818
- }
2819
-
2820
- return response;
2821
- }
2822
-
2823
2199
  /**
2824
2200
  * @param {Object} arg - Arg object.
2825
2201
  * @param {string} arg.shipmentId -
@@ -3014,7 +2390,7 @@ class Order {
3014
2390
  * @param {UpdateShipmentLockPayload} arg.body
3015
2391
  * @returns {Promise<UpdateShipmentLockResponse>} - Success response
3016
2392
  * @summary:
3017
- * @description: update shipment lock
2393
+ * @description: update shipment/bag lock and check status
3018
2394
  */
3019
2395
  async updateShipmentLock({ body } = {}) {
3020
2396
  const { error } = OrderValidator.updateShipmentLock().validate(
@@ -3078,7 +2454,7 @@ class Order {
3078
2454
  * @param {UpdateShipmentStatusRequest} arg.body
3079
2455
  * @returns {Promise<UpdateShipmentStatusResponseBody>} - Success response
3080
2456
  * @summary:
3081
- * @description: Update shipment status
2457
+ * @description: This API is for Shipment State transition or Shipment data update or both below example is for partial state transition with data update
3082
2458
  */
3083
2459
  async updateShipmentStatus({ body } = {}) {
3084
2460
  const { error } = OrderValidator.updateShipmentStatus().validate(
@@ -3198,70 +2574,6 @@ class Order {
3198
2574
 
3199
2575
  return response;
3200
2576
  }
3201
-
3202
- /**
3203
- * @param {Object} arg - Arg object.
3204
- * @param {JioCodeUpsertPayload} arg.body
3205
- * @returns {Promise<JioCodeUpsertResponse>} - Success response
3206
- * @summary:
3207
- * @description:
3208
- */
3209
- async upsertJioCode({ body } = {}) {
3210
- const { error } = OrderValidator.upsertJioCode().validate(
3211
- {
3212
- body,
3213
- },
3214
- { abortEarly: false, allowUnknown: true }
3215
- );
3216
- if (error) {
3217
- return Promise.reject(new FDKClientValidationError(error));
3218
- }
3219
-
3220
- // Showing warrnings if extra unknown parameters are found
3221
- const { error: warrning } = OrderValidator.upsertJioCode().validate(
3222
- {
3223
- body,
3224
- },
3225
- { abortEarly: false, allowUnknown: false }
3226
- );
3227
- if (warrning) {
3228
- Logger({
3229
- level: "WARN",
3230
- message: "Parameter Validation warrnings for upsertJioCode",
3231
- });
3232
- Logger({ level: "WARN", message: warrning });
3233
- }
3234
-
3235
- const query_params = {};
3236
-
3237
- const xHeaders = {};
3238
-
3239
- const response = await PlatformAPIClient.execute(
3240
- this.config,
3241
- "post",
3242
- `/service/platform/orders/v1.0/company/${this.config.companyId}/upsert/jiocode/article`,
3243
- query_params,
3244
- body,
3245
- xHeaders
3246
- );
3247
-
3248
- const {
3249
- error: res_error,
3250
- } = OrderModel.JioCodeUpsertResponse().validate(response, {
3251
- abortEarly: false,
3252
- allowUnknown: false,
3253
- });
3254
-
3255
- if (res_error) {
3256
- Logger({
3257
- level: "WARN",
3258
- message: "Response Validation Warnnings for upsertJioCode",
3259
- });
3260
- Logger({ level: "WARN", message: res_error });
3261
- }
3262
-
3263
- return response;
3264
- }
3265
2577
  }
3266
2578
 
3267
2579
  module.exports = Order;