@gofynd/fdk-client-javascript 1.3.11-beta.6 → 1.3.11-beta.8

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 (229) hide show
  1. package/README.md +1 -1
  2. package/package.json +1 -1
  3. package/sdk/application/Cart/CartApplicationClient.d.ts +1 -1
  4. package/sdk/application/Cart/CartApplicationClient.js +5 -3
  5. package/sdk/application/Cart/CartApplicationModel.d.ts +107 -1
  6. package/sdk/application/Cart/CartApplicationModel.js +74 -0
  7. package/sdk/application/Cart/CartApplicationValidator.d.ts +4 -0
  8. package/sdk/application/Cart/CartApplicationValidator.js +4 -0
  9. package/sdk/application/Catalog/CatalogApplicationClient.d.ts +3 -6
  10. package/sdk/application/Catalog/CatalogApplicationClient.js +7 -20
  11. package/sdk/application/Catalog/CatalogApplicationModel.d.ts +2 -2
  12. package/sdk/application/Catalog/CatalogApplicationModel.js +2 -2
  13. package/sdk/application/Catalog/CatalogApplicationValidator.d.ts +0 -14
  14. package/sdk/application/Catalog/CatalogApplicationValidator.js +0 -6
  15. package/sdk/application/Configuration/ConfigurationApplicationModel.d.ts +183 -49
  16. package/sdk/application/Configuration/ConfigurationApplicationModel.js +173 -31
  17. package/sdk/application/Content/ContentApplicationClient.d.ts +36 -0
  18. package/sdk/application/Content/ContentApplicationClient.js +246 -0
  19. package/sdk/application/Content/ContentApplicationModel.d.ts +208 -1
  20. package/sdk/application/Content/ContentApplicationModel.js +252 -0
  21. package/sdk/application/Content/ContentApplicationValidator.d.ts +40 -1
  22. package/sdk/application/Content/ContentApplicationValidator.js +41 -0
  23. package/sdk/application/Logistic/LogisticApplicationClient.d.ts +67 -0
  24. package/sdk/application/Logistic/LogisticApplicationClient.js +547 -0
  25. package/sdk/application/Logistic/LogisticApplicationModel.d.ts +456 -1
  26. package/sdk/application/Logistic/LogisticApplicationModel.js +488 -0
  27. package/sdk/application/Logistic/LogisticApplicationValidator.d.ts +211 -1
  28. package/sdk/application/Logistic/LogisticApplicationValidator.js +131 -0
  29. package/sdk/application/Order/OrderApplicationClient.d.ts +3 -3
  30. package/sdk/application/Order/OrderApplicationClient.js +32 -8
  31. package/sdk/application/Order/OrderApplicationModel.d.ts +6 -0
  32. package/sdk/application/Order/OrderApplicationModel.js +6 -0
  33. package/sdk/application/Order/OrderApplicationValidator.d.ts +20 -0
  34. package/sdk/application/Order/OrderApplicationValidator.js +8 -0
  35. package/sdk/application/Payment/PaymentApplicationClient.d.ts +46 -2
  36. package/sdk/application/Payment/PaymentApplicationClient.js +341 -10
  37. package/sdk/application/Payment/PaymentApplicationModel.d.ts +493 -186
  38. package/sdk/application/Payment/PaymentApplicationModel.js +341 -70
  39. package/sdk/application/Payment/PaymentApplicationValidator.d.ts +59 -14
  40. package/sdk/application/Payment/PaymentApplicationValidator.js +64 -10
  41. package/sdk/application/PosCart/PosCartApplicationModel.d.ts +34 -1
  42. package/sdk/application/PosCart/PosCartApplicationModel.js +24 -0
  43. package/sdk/application/Theme/ThemeApplicationClient.d.ts +1 -1
  44. package/sdk/application/Theme/ThemeApplicationClient.js +7 -3
  45. package/sdk/application/Theme/ThemeApplicationModel.d.ts +222 -36
  46. package/sdk/application/Theme/ThemeApplicationModel.js +322 -26
  47. package/sdk/application/Theme/ThemeApplicationValidator.d.ts +10 -0
  48. package/sdk/application/Theme/ThemeApplicationValidator.js +4 -0
  49. package/sdk/application/User/UserApplicationClient.d.ts +33 -0
  50. package/sdk/application/User/UserApplicationClient.js +239 -0
  51. package/sdk/application/User/UserApplicationModel.d.ts +28 -13
  52. package/sdk/application/User/UserApplicationModel.js +36 -12
  53. package/sdk/application/User/UserApplicationValidator.d.ts +34 -1
  54. package/sdk/application/User/UserApplicationValidator.js +36 -0
  55. package/sdk/partner/Lead/LeadPartnerClient.d.ts +125 -0
  56. package/sdk/partner/Lead/LeadPartnerClient.js +785 -0
  57. package/sdk/partner/Lead/LeadPartnerModel.d.ts +1127 -0
  58. package/sdk/partner/Lead/LeadPartnerModel.js +896 -0
  59. package/sdk/partner/Lead/LeadPartnerValidator.d.ts +12 -0
  60. package/sdk/partner/Lead/LeadPartnerValidator.js +67 -0
  61. package/sdk/partner/Logistics/LogisticsPartnerClient.d.ts +155 -0
  62. package/sdk/partner/Logistics/LogisticsPartnerClient.js +1195 -0
  63. package/sdk/partner/Logistics/LogisticsPartnerModel.d.ts +372 -0
  64. package/sdk/partner/Logistics/LogisticsPartnerModel.js +442 -0
  65. package/sdk/partner/Logistics/LogisticsPartnerValidator.d.ts +16 -0
  66. package/sdk/partner/Logistics/LogisticsPartnerValidator.js +123 -0
  67. package/sdk/partner/PartnerClient.d.ts +6 -0
  68. package/sdk/partner/PartnerClient.js +9 -0
  69. package/sdk/partner/Theme/ThemePartnerClient.d.ts +10 -0
  70. package/sdk/partner/Theme/ThemePartnerClient.js +80 -0
  71. package/sdk/partner/Theme/ThemePartnerModel.d.ts +100 -43
  72. package/sdk/partner/Theme/ThemePartnerModel.js +74 -30
  73. package/sdk/partner/Theme/ThemePartnerValidator.d.ts +1 -0
  74. package/sdk/partner/Theme/ThemePartnerValidator.js +9 -0
  75. package/sdk/partner/Webhook/WebhookPartnerClient.d.ts +99 -0
  76. package/sdk/partner/Webhook/WebhookPartnerClient.js +753 -0
  77. package/sdk/partner/Webhook/WebhookPartnerModel.d.ts +566 -0
  78. package/sdk/partner/Webhook/WebhookPartnerModel.js +583 -0
  79. package/sdk/partner/Webhook/WebhookPartnerValidator.d.ts +12 -0
  80. package/sdk/partner/Webhook/WebhookPartnerValidator.js +74 -0
  81. package/sdk/partner/index.d.ts +3 -0
  82. package/sdk/partner/index.js +6 -0
  83. package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +2 -2
  84. package/sdk/platform/Billing/BillingPlatformClient.d.ts +11 -1
  85. package/sdk/platform/Billing/BillingPlatformClient.js +110 -3
  86. package/sdk/platform/Billing/BillingPlatformModel.d.ts +67 -1
  87. package/sdk/platform/Billing/BillingPlatformModel.js +78 -0
  88. package/sdk/platform/Billing/BillingPlatformValidator.d.ts +43 -4
  89. package/sdk/platform/Billing/BillingPlatformValidator.js +29 -2
  90. package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +1 -1
  91. package/sdk/platform/Cart/CartPlatformApplicationClient.js +7 -1
  92. package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +4 -0
  93. package/sdk/platform/Cart/CartPlatformApplicationValidator.js +4 -0
  94. package/sdk/platform/Cart/CartPlatformModel.d.ts +100 -5
  95. package/sdk/platform/Cart/CartPlatformModel.js +71 -4
  96. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +15 -11
  97. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +52 -21
  98. package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +27 -0
  99. package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +11 -0
  100. package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +26 -4
  101. package/sdk/platform/Catalog/CatalogPlatformClient.js +173 -7
  102. package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +304 -1
  103. package/sdk/platform/Catalog/CatalogPlatformModel.js +335 -0
  104. package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +31 -3
  105. package/sdk/platform/Catalog/CatalogPlatformValidator.js +27 -2
  106. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +138 -36
  107. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +739 -57
  108. package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.d.ts +128 -3
  109. package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.js +111 -1
  110. package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +150 -1
  111. package/sdk/platform/Communication/CommunicationPlatformModel.js +172 -0
  112. package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +8 -2
  113. package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +32 -4
  114. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +38 -9
  115. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +42 -8
  116. package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.d.ts +14 -0
  117. package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.js +6 -0
  118. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +8 -8
  119. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +4 -4
  120. package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +371 -132
  121. package/sdk/platform/Configuration/ConfigurationPlatformModel.js +288 -77
  122. package/sdk/platform/Configuration/ConfigurationPlatformValidator.d.ts +2 -2
  123. package/sdk/platform/Configuration/ConfigurationPlatformValidator.js +2 -2
  124. package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +391 -0
  125. package/sdk/platform/Content/ContentPlatformApplicationClient.js +3630 -1059
  126. package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +342 -1
  127. package/sdk/platform/Content/ContentPlatformApplicationValidator.js +401 -0
  128. package/sdk/platform/Content/ContentPlatformClient.d.ts +277 -0
  129. package/sdk/platform/Content/ContentPlatformClient.js +2000 -0
  130. package/sdk/platform/Content/ContentPlatformModel.d.ts +1094 -1
  131. package/sdk/platform/Content/ContentPlatformModel.js +1356 -46
  132. package/sdk/platform/Content/ContentPlatformValidator.d.ts +238 -0
  133. package/sdk/platform/Content/ContentPlatformValidator.js +310 -0
  134. package/sdk/platform/Discount/DiscountPlatformClient.d.ts +2 -2
  135. package/sdk/platform/Discount/DiscountPlatformClient.js +2 -2
  136. package/sdk/platform/Discount/DiscountPlatformModel.d.ts +96 -13
  137. package/sdk/platform/Discount/DiscountPlatformModel.js +104 -12
  138. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +16 -6
  139. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +117 -8
  140. package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.d.ts +55 -4
  141. package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.js +39 -2
  142. package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +16 -5
  143. package/sdk/platform/FileStorage/FileStoragePlatformModel.js +18 -4
  144. package/sdk/platform/Finance/FinancePlatformClient.d.ts +33 -0
  145. package/sdk/platform/Finance/FinancePlatformClient.js +240 -0
  146. package/sdk/platform/Finance/FinancePlatformModel.d.ts +151 -5
  147. package/sdk/platform/Finance/FinancePlatformModel.js +190 -4
  148. package/sdk/platform/Finance/FinancePlatformValidator.d.ts +38 -1
  149. package/sdk/platform/Finance/FinancePlatformValidator.js +38 -0
  150. package/sdk/platform/Lead/LeadPlatformApplicationClient.d.ts +38 -28
  151. package/sdk/platform/Lead/LeadPlatformApplicationClient.js +137 -56
  152. package/sdk/platform/Lead/LeadPlatformApplicationValidator.d.ts +41 -29
  153. package/sdk/platform/Lead/LeadPlatformApplicationValidator.js +33 -21
  154. package/sdk/platform/Lead/LeadPlatformModel.d.ts +12 -3
  155. package/sdk/platform/Lead/LeadPlatformModel.js +16 -2
  156. package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +23 -1
  157. package/sdk/platform/Order/OrderPlatformApplicationClient.js +178 -1
  158. package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +39 -1
  159. package/sdk/platform/Order/OrderPlatformApplicationValidator.js +32 -0
  160. package/sdk/platform/Order/OrderPlatformClient.d.ts +202 -31
  161. package/sdk/platform/Order/OrderPlatformClient.js +2010 -586
  162. package/sdk/platform/Order/OrderPlatformModel.d.ts +1030 -468
  163. package/sdk/platform/Order/OrderPlatformModel.js +1176 -523
  164. package/sdk/platform/Order/OrderPlatformValidator.d.ts +318 -35
  165. package/sdk/platform/Order/OrderPlatformValidator.js +292 -29
  166. package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +119 -13
  167. package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +749 -39
  168. package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +143 -7
  169. package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +133 -6
  170. package/sdk/platform/Payment/PaymentPlatformClient.d.ts +1 -1
  171. package/sdk/platform/Payment/PaymentPlatformClient.js +1 -1
  172. package/sdk/platform/Payment/PaymentPlatformModel.d.ts +996 -134
  173. package/sdk/platform/Payment/PaymentPlatformModel.js +721 -58
  174. package/sdk/platform/PlatformApplicationClient.d.ts +2 -2
  175. package/sdk/platform/PlatformApplicationClient.js +4 -4
  176. package/sdk/platform/PlatformClient.d.ts +4 -2
  177. package/sdk/platform/PlatformClient.js +8 -4
  178. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.d.ts +142 -66
  179. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.js +645 -147
  180. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.d.ts +131 -63
  181. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.js +126 -47
  182. package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +217 -105
  183. package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +1136 -347
  184. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +912 -313
  185. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +1071 -355
  186. package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.d.ts +382 -133
  187. package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.js +266 -102
  188. package/sdk/platform/Theme/ThemePlatformClient.d.ts +11 -1
  189. package/sdk/platform/Theme/ThemePlatformClient.js +87 -3
  190. package/sdk/platform/Theme/ThemePlatformModel.d.ts +333 -47
  191. package/sdk/platform/Theme/ThemePlatformModel.js +395 -35
  192. package/sdk/platform/Theme/ThemePlatformValidator.d.ts +28 -4
  193. package/sdk/platform/Theme/ThemePlatformValidator.js +21 -2
  194. package/sdk/platform/User/UserPlatformApplicationClient.d.ts +116 -1
  195. package/sdk/platform/User/UserPlatformApplicationClient.js +931 -85
  196. package/sdk/platform/User/UserPlatformApplicationValidator.d.ts +224 -7
  197. package/sdk/platform/User/UserPlatformApplicationValidator.js +173 -5
  198. package/sdk/platform/User/UserPlatformModel.d.ts +344 -7
  199. package/sdk/platform/User/UserPlatformModel.js +256 -5
  200. package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +47 -39
  201. package/sdk/platform/Webhook/WebhookPlatformClient.js +63 -61
  202. package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +264 -156
  203. package/sdk/platform/Webhook/WebhookPlatformModel.js +276 -153
  204. package/sdk/platform/Webhook/WebhookPlatformValidator.d.ts +7 -10
  205. package/sdk/platform/Webhook/WebhookPlatformValidator.js +6 -6
  206. package/sdk/platform/index.d.ts +1 -1
  207. package/sdk/platform/index.js +2 -2
  208. package/sdk/public/Billing/BillingPublicClient.d.ts +23 -0
  209. package/sdk/public/Billing/BillingPublicClient.js +116 -0
  210. package/sdk/public/Billing/BillingPublicModel.d.ts +92 -0
  211. package/sdk/public/Billing/BillingPublicModel.js +96 -0
  212. package/sdk/public/Billing/BillingPublicValidator.d.ts +18 -0
  213. package/sdk/public/Billing/BillingPublicValidator.js +19 -0
  214. package/sdk/public/Content/ContentPublicClient.d.ts +22 -0
  215. package/sdk/public/Content/ContentPublicClient.js +114 -0
  216. package/sdk/public/Content/ContentPublicModel.d.ts +53 -0
  217. package/sdk/public/Content/ContentPublicModel.js +60 -0
  218. package/sdk/public/Content/ContentPublicValidator.d.ts +18 -0
  219. package/sdk/public/Content/ContentPublicValidator.js +19 -0
  220. package/sdk/public/PublicClient.d.ts +4 -0
  221. package/sdk/public/PublicClient.js +8 -0
  222. package/sdk/public/Webhook/WebhookPublicClient.d.ts +33 -0
  223. package/sdk/public/Webhook/WebhookPublicClient.js +242 -0
  224. package/sdk/public/Webhook/WebhookPublicModel.d.ts +147 -1
  225. package/sdk/public/Webhook/WebhookPublicModel.js +177 -1
  226. package/sdk/public/Webhook/WebhookPublicValidator.d.ts +23 -1
  227. package/sdk/public/Webhook/WebhookPublicValidator.js +31 -0
  228. package/sdk/public/index.d.ts +2 -0
  229. package/sdk/public/index.js +4 -0
@@ -93,6 +93,192 @@ class Order {
93
93
  return response;
94
94
  }
95
95
 
96
+ /**
97
+ * @param {OrderPlatformValidator.BulkListingParam} arg - Arg object
98
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
99
+ * @param {import("../PlatformAPIClient").Options} - Options
100
+ * @returns {Promise<OrderPlatformModel.BulkListingResponse>} - Success response
101
+ * @name bulkListing
102
+ * @summary:
103
+ * @description: Fetches of previous or running bulk jobs.
104
+ * - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/bulkListing/).
105
+ */
106
+ async bulkListing(
107
+ {
108
+ pageSize,
109
+ pageNo,
110
+ startDate,
111
+ endDate,
112
+ status,
113
+ bulkActionType,
114
+ searchKey,
115
+ requestHeaders,
116
+ } = { requestHeaders: {} },
117
+ { responseHeaders } = { responseHeaders: false }
118
+ ) {
119
+ const { error } = OrderPlatformValidator.bulkListing().validate(
120
+ {
121
+ pageSize,
122
+ pageNo,
123
+ startDate,
124
+ endDate,
125
+ status,
126
+ bulkActionType,
127
+ searchKey,
128
+ },
129
+ { abortEarly: false, allowUnknown: true }
130
+ );
131
+ if (error) {
132
+ return Promise.reject(new FDKClientValidationError(error));
133
+ }
134
+
135
+ // Showing warrnings if extra unknown parameters are found
136
+ const { error: warrning } = OrderPlatformValidator.bulkListing().validate(
137
+ {
138
+ pageSize,
139
+ pageNo,
140
+ startDate,
141
+ endDate,
142
+ status,
143
+ bulkActionType,
144
+ searchKey,
145
+ },
146
+ { abortEarly: false, allowUnknown: false }
147
+ );
148
+ if (warrning) {
149
+ Logger({
150
+ level: "WARN",
151
+ message: `Parameter Validation warrnings for platform > Order > bulkListing \n ${warrning}`,
152
+ });
153
+ }
154
+
155
+ const query_params = {};
156
+ query_params["page_size"] = pageSize;
157
+ query_params["page_no"] = pageNo;
158
+ query_params["start_date"] = startDate;
159
+ query_params["end_date"] = endDate;
160
+ query_params["status"] = status;
161
+ query_params["bulk_action_type"] = bulkActionType;
162
+ query_params["search_key"] = searchKey;
163
+
164
+ const xHeaders = {};
165
+
166
+ const response = await PlatformAPIClient.execute(
167
+ this.config,
168
+ "get",
169
+ `/service/platform/order-manage/v1.0/company/${this.config.companyId}/jobs`,
170
+ query_params,
171
+ undefined,
172
+ { ...xHeaders, ...requestHeaders },
173
+ { responseHeaders }
174
+ );
175
+
176
+ let responseData = response;
177
+ if (responseHeaders) {
178
+ responseData = response[0];
179
+ }
180
+
181
+ const {
182
+ error: res_error,
183
+ } = OrderPlatformModel.BulkListingResponse().validate(responseData, {
184
+ abortEarly: false,
185
+ allowUnknown: true,
186
+ });
187
+
188
+ if (res_error) {
189
+ if (this.config.options.strictResponseCheck === true) {
190
+ return Promise.reject(new FDKResponseValidationError(res_error));
191
+ } else {
192
+ Logger({
193
+ level: "WARN",
194
+ message: `Response Validation Warnings for platform > Order > bulkListing \n ${res_error}`,
195
+ });
196
+ }
197
+ }
198
+
199
+ return response;
200
+ }
201
+
202
+ /**
203
+ * @param {OrderPlatformValidator.BulkStateTransistionParam} arg - Arg object
204
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
205
+ * @param {import("../PlatformAPIClient").Options} - Options
206
+ * @returns {Promise<OrderPlatformModel.BulkStateTransistionResponse>} -
207
+ * Success response
208
+ * @name bulkStateTransistion
209
+ * @summary:
210
+ * @description: Performs State Transisiton in Bulk for the given shipments in the excel/csv file url. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/bulkStateTransistion/).
211
+ */
212
+ async bulkStateTransistion(
213
+ { body, requestHeaders } = { requestHeaders: {} },
214
+ { responseHeaders } = { responseHeaders: false }
215
+ ) {
216
+ const { error } = OrderPlatformValidator.bulkStateTransistion().validate(
217
+ {
218
+ body,
219
+ },
220
+ { abortEarly: false, allowUnknown: true }
221
+ );
222
+ if (error) {
223
+ return Promise.reject(new FDKClientValidationError(error));
224
+ }
225
+
226
+ // Showing warrnings if extra unknown parameters are found
227
+ const {
228
+ error: warrning,
229
+ } = OrderPlatformValidator.bulkStateTransistion().validate(
230
+ {
231
+ body,
232
+ },
233
+ { abortEarly: false, allowUnknown: false }
234
+ );
235
+ if (warrning) {
236
+ Logger({
237
+ level: "WARN",
238
+ message: `Parameter Validation warrnings for platform > Order > bulkStateTransistion \n ${warrning}`,
239
+ });
240
+ }
241
+
242
+ const query_params = {};
243
+
244
+ const xHeaders = {};
245
+
246
+ const response = await PlatformAPIClient.execute(
247
+ this.config,
248
+ "post",
249
+ `/service/platform/order-manage/v1.0/company/${this.config.companyId}/jobs/state-transition`,
250
+ query_params,
251
+ body,
252
+ { ...xHeaders, ...requestHeaders },
253
+ { responseHeaders }
254
+ );
255
+
256
+ let responseData = response;
257
+ if (responseHeaders) {
258
+ responseData = response[0];
259
+ }
260
+
261
+ const {
262
+ error: res_error,
263
+ } = OrderPlatformModel.BulkStateTransistionResponse().validate(
264
+ responseData,
265
+ { abortEarly: false, allowUnknown: true }
266
+ );
267
+
268
+ if (res_error) {
269
+ if (this.config.options.strictResponseCheck === true) {
270
+ return Promise.reject(new FDKResponseValidationError(res_error));
271
+ } else {
272
+ Logger({
273
+ level: "WARN",
274
+ message: `Response Validation Warnings for platform > Order > bulkStateTransistion \n ${res_error}`,
275
+ });
276
+ }
277
+ }
278
+
279
+ return response;
280
+ }
281
+
96
282
  /**
97
283
  * @param {OrderPlatformValidator.CheckOrderStatusParam} arg - Arg object
98
284
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
@@ -424,20 +610,21 @@ class Order {
424
610
  }
425
611
 
426
612
  /**
427
- * @param {OrderPlatformValidator.DispatchManifestParam} arg - Arg object
613
+ * @param {OrderPlatformValidator.DispatchManifestsParam} arg - Arg object
428
614
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
429
615
  * @param {import("../PlatformAPIClient").Options} - Options
430
616
  * @returns {Promise<OrderPlatformModel.SuccessResponse>} - Success response
431
- * @name dispatchManifest
617
+ * @name dispatchManifests
432
618
  * @summary:
433
- * @description: Dispatch Manifest - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/dispatchManifest/).
619
+ * @description: Dispatch Manifest - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/dispatchManifests/).
434
620
  */
435
- async dispatchManifest(
436
- { body, requestHeaders } = { requestHeaders: {} },
621
+ async dispatchManifests(
622
+ { manifestId, body, requestHeaders } = { requestHeaders: {} },
437
623
  { responseHeaders } = { responseHeaders: false }
438
624
  ) {
439
- const { error } = OrderPlatformValidator.dispatchManifest().validate(
625
+ const { error } = OrderPlatformValidator.dispatchManifests().validate(
440
626
  {
627
+ manifestId,
441
628
  body,
442
629
  },
443
630
  { abortEarly: false, allowUnknown: true }
@@ -449,8 +636,9 @@ class Order {
449
636
  // Showing warrnings if extra unknown parameters are found
450
637
  const {
451
638
  error: warrning,
452
- } = OrderPlatformValidator.dispatchManifest().validate(
639
+ } = OrderPlatformValidator.dispatchManifests().validate(
453
640
  {
641
+ manifestId,
454
642
  body,
455
643
  },
456
644
  { abortEarly: false, allowUnknown: false }
@@ -458,7 +646,7 @@ class Order {
458
646
  if (warrning) {
459
647
  Logger({
460
648
  level: "WARN",
461
- message: `Parameter Validation warrnings for platform > Order > dispatchManifest \n ${warrning}`,
649
+ message: `Parameter Validation warrnings for platform > Order > dispatchManifests \n ${warrning}`,
462
650
  });
463
651
  }
464
652
 
@@ -469,7 +657,7 @@ class Order {
469
657
  const response = await PlatformAPIClient.execute(
470
658
  this.config,
471
659
  "post",
472
- `/service/platform/order-manage/v1.0/company/${this.config.companyId}/manifest/dispatch`,
660
+ `/service/platform/order-manage/v1.0/company/${this.config.companyId}/manifest/${manifestId}/dispatch`,
473
661
  query_params,
474
662
  body,
475
663
  { ...xHeaders, ...requestHeaders },
@@ -494,7 +682,7 @@ class Order {
494
682
  } else {
495
683
  Logger({
496
684
  level: "WARN",
497
- message: `Response Validation Warnings for platform > Order > dispatchManifest \n ${res_error}`,
685
+ message: `Response Validation Warnings for platform > Order > dispatchManifests \n ${res_error}`,
498
686
  });
499
687
  }
500
688
  }
@@ -742,25 +930,21 @@ class Order {
742
930
  }
743
931
 
744
932
  /**
745
- * @param {OrderPlatformValidator.FetchCreditBalanceDetailParam} arg - Arg object
933
+ * @param {OrderPlatformValidator.FailedOrderLogDetailsParam} arg - Arg object
746
934
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
747
935
  * @param {import("../PlatformAPIClient").Options} - Options
748
- * @returns {Promise<OrderPlatformModel.FetchCreditBalanceResponsePayload>}
749
- * - Success response
750
- *
751
- * @name fetchCreditBalanceDetail
752
- * @summary:
753
- * @description: Fetch Credit Balance Detail - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/fetchCreditBalanceDetail/).
936
+ * @returns {Promise<OrderPlatformModel.FailedOrderLogDetails>} - Success response
937
+ * @name failedOrderLogDetails
938
+ * @summary: Get failed order logs according to the filter provided
939
+ * @description: This endpoint allows users to get the exact error trace from the log id provided - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/failedOrderLogDetails/).
754
940
  */
755
- async fetchCreditBalanceDetail(
756
- { body, requestHeaders } = { requestHeaders: {} },
941
+ async failedOrderLogDetails(
942
+ { logId, requestHeaders } = { requestHeaders: {} },
757
943
  { responseHeaders } = { responseHeaders: false }
758
944
  ) {
759
- const {
760
- error,
761
- } = OrderPlatformValidator.fetchCreditBalanceDetail().validate(
945
+ const { error } = OrderPlatformValidator.failedOrderLogDetails().validate(
762
946
  {
763
- body,
947
+ logId,
764
948
  },
765
949
  { abortEarly: false, allowUnknown: true }
766
950
  );
@@ -771,16 +955,16 @@ class Order {
771
955
  // Showing warrnings if extra unknown parameters are found
772
956
  const {
773
957
  error: warrning,
774
- } = OrderPlatformValidator.fetchCreditBalanceDetail().validate(
958
+ } = OrderPlatformValidator.failedOrderLogDetails().validate(
775
959
  {
776
- body,
960
+ logId,
777
961
  },
778
962
  { abortEarly: false, allowUnknown: false }
779
963
  );
780
964
  if (warrning) {
781
965
  Logger({
782
966
  level: "WARN",
783
- message: `Parameter Validation warrnings for platform > Order > fetchCreditBalanceDetail \n ${warrning}`,
967
+ message: `Parameter Validation warrnings for platform > Order > failedOrderLogDetails \n ${warrning}`,
784
968
  });
785
969
  }
786
970
 
@@ -790,10 +974,10 @@ class Order {
790
974
 
791
975
  const response = await PlatformAPIClient.execute(
792
976
  this.config,
793
- "post",
794
- `/service/platform/order-manage/v1.0/company/${this.config.companyId}/customer-credit-balance`,
977
+ "get",
978
+ `/service/platform/order-manage/v1.0/company/${this.config.companyId}/orders/failed/logs/${logId}`,
795
979
  query_params,
796
- body,
980
+ undefined,
797
981
  { ...xHeaders, ...requestHeaders },
798
982
  { responseHeaders }
799
983
  );
@@ -805,10 +989,10 @@ class Order {
805
989
 
806
990
  const {
807
991
  error: res_error,
808
- } = OrderPlatformModel.FetchCreditBalanceResponsePayload().validate(
809
- responseData,
810
- { abortEarly: false, allowUnknown: true }
811
- );
992
+ } = OrderPlatformModel.FailedOrderLogDetails().validate(responseData, {
993
+ abortEarly: false,
994
+ allowUnknown: true,
995
+ });
812
996
 
813
997
  if (res_error) {
814
998
  if (this.config.options.strictResponseCheck === true) {
@@ -816,7 +1000,7 @@ class Order {
816
1000
  } else {
817
1001
  Logger({
818
1002
  level: "WARN",
819
- message: `Response Validation Warnings for platform > Order > fetchCreditBalanceDetail \n ${res_error}`,
1003
+ message: `Response Validation Warnings for platform > Order > failedOrderLogDetails \n ${res_error}`,
820
1004
  });
821
1005
  }
822
1006
  }
@@ -825,20 +1009,23 @@ class Order {
825
1009
  }
826
1010
 
827
1011
  /**
828
- * @param {OrderPlatformValidator.FetchRefundModeConfigParam} arg - Arg object
1012
+ * @param {OrderPlatformValidator.FetchCreditBalanceDetailParam} arg - Arg object
829
1013
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
830
1014
  * @param {import("../PlatformAPIClient").Options} - Options
831
- * @returns {Promise<OrderPlatformModel.RefundModeConfigResponsePayload>} -
832
- * Success response
833
- * @name fetchRefundModeConfig
1015
+ * @returns {Promise<OrderPlatformModel.FetchCreditBalanceResponsePayload>}
1016
+ * - Success response
1017
+ *
1018
+ * @name fetchCreditBalanceDetail
834
1019
  * @summary:
835
- * @description: Fetch Refund Mode Config - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/fetchRefundModeConfig/).
1020
+ * @description: Fetch Credit Balance Detail - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/fetchCreditBalanceDetail/).
836
1021
  */
837
- async fetchRefundModeConfig(
1022
+ async fetchCreditBalanceDetail(
838
1023
  { body, requestHeaders } = { requestHeaders: {} },
839
1024
  { responseHeaders } = { responseHeaders: false }
840
1025
  ) {
841
- const { error } = OrderPlatformValidator.fetchRefundModeConfig().validate(
1026
+ const {
1027
+ error,
1028
+ } = OrderPlatformValidator.fetchCreditBalanceDetail().validate(
842
1029
  {
843
1030
  body,
844
1031
  },
@@ -851,7 +1038,7 @@ class Order {
851
1038
  // Showing warrnings if extra unknown parameters are found
852
1039
  const {
853
1040
  error: warrning,
854
- } = OrderPlatformValidator.fetchRefundModeConfig().validate(
1041
+ } = OrderPlatformValidator.fetchCreditBalanceDetail().validate(
855
1042
  {
856
1043
  body,
857
1044
  },
@@ -860,7 +1047,7 @@ class Order {
860
1047
  if (warrning) {
861
1048
  Logger({
862
1049
  level: "WARN",
863
- message: `Parameter Validation warrnings for platform > Order > fetchRefundModeConfig \n ${warrning}`,
1050
+ message: `Parameter Validation warrnings for platform > Order > fetchCreditBalanceDetail \n ${warrning}`,
864
1051
  });
865
1052
  }
866
1053
 
@@ -871,7 +1058,7 @@ class Order {
871
1058
  const response = await PlatformAPIClient.execute(
872
1059
  this.config,
873
1060
  "post",
874
- `/service/platform/order-manage/v1.0/company/${this.config.companyId}/refund-mode-config`,
1061
+ `/service/platform/order-manage/v1.0/company/${this.config.companyId}/customer-credit-balance`,
875
1062
  query_params,
876
1063
  body,
877
1064
  { ...xHeaders, ...requestHeaders },
@@ -885,7 +1072,7 @@ class Order {
885
1072
 
886
1073
  const {
887
1074
  error: res_error,
888
- } = OrderPlatformModel.RefundModeConfigResponsePayload().validate(
1075
+ } = OrderPlatformModel.FetchCreditBalanceResponsePayload().validate(
889
1076
  responseData,
890
1077
  { abortEarly: false, allowUnknown: true }
891
1078
  );
@@ -896,7 +1083,7 @@ class Order {
896
1083
  } else {
897
1084
  Logger({
898
1085
  level: "WARN",
899
- message: `Response Validation Warnings for platform > Order > fetchRefundModeConfig \n ${res_error}`,
1086
+ message: `Response Validation Warnings for platform > Order > fetchCreditBalanceDetail \n ${res_error}`,
900
1087
  });
901
1088
  }
902
1089
  }
@@ -905,21 +1092,21 @@ class Order {
905
1092
  }
906
1093
 
907
1094
  /**
908
- * @param {OrderPlatformValidator.GenerateInvoiceIDParam} arg - Arg object
1095
+ * @param {OrderPlatformValidator.FetchRefundModeConfigParam} arg - Arg object
909
1096
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
910
1097
  * @param {import("../PlatformAPIClient").Options} - Options
911
- * @returns {Promise<OrderPlatformModel.GenerateInvoiceIDResponse>} - Success response
912
- * @name generateInvoiceID
1098
+ * @returns {Promise<OrderPlatformModel.RefundModeConfigResponsePayload>} -
1099
+ * Success response
1100
+ * @name fetchRefundModeConfig
913
1101
  * @summary:
914
- * @description: This API is used to manually generate Invoice ID against shipments. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/generateInvoiceID/).
1102
+ * @description: Fetch Refund Mode Config - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/fetchRefundModeConfig/).
915
1103
  */
916
- async generateInvoiceID(
917
- { invoiceType, body, requestHeaders } = { requestHeaders: {} },
1104
+ async fetchRefundModeConfig(
1105
+ { body, requestHeaders } = { requestHeaders: {} },
918
1106
  { responseHeaders } = { responseHeaders: false }
919
1107
  ) {
920
- const { error } = OrderPlatformValidator.generateInvoiceID().validate(
1108
+ const { error } = OrderPlatformValidator.fetchRefundModeConfig().validate(
921
1109
  {
922
- invoiceType,
923
1110
  body,
924
1111
  },
925
1112
  { abortEarly: false, allowUnknown: true }
@@ -931,9 +1118,8 @@ class Order {
931
1118
  // Showing warrnings if extra unknown parameters are found
932
1119
  const {
933
1120
  error: warrning,
934
- } = OrderPlatformValidator.generateInvoiceID().validate(
1121
+ } = OrderPlatformValidator.fetchRefundModeConfig().validate(
935
1122
  {
936
- invoiceType,
937
1123
  body,
938
1124
  },
939
1125
  { abortEarly: false, allowUnknown: false }
@@ -941,7 +1127,7 @@ class Order {
941
1127
  if (warrning) {
942
1128
  Logger({
943
1129
  level: "WARN",
944
- message: `Parameter Validation warrnings for platform > Order > generateInvoiceID \n ${warrning}`,
1130
+ message: `Parameter Validation warrnings for platform > Order > fetchRefundModeConfig \n ${warrning}`,
945
1131
  });
946
1132
  }
947
1133
 
@@ -952,7 +1138,7 @@ class Order {
952
1138
  const response = await PlatformAPIClient.execute(
953
1139
  this.config,
954
1140
  "post",
955
- `/service/platform/order-manage/v1.0/company/${this.config.companyId}/${invoiceType}/id/generate`,
1141
+ `/service/platform/order-manage/v1.0/company/${this.config.companyId}/refund-mode-config`,
956
1142
  query_params,
957
1143
  body,
958
1144
  { ...xHeaders, ...requestHeaders },
@@ -966,10 +1152,10 @@ class Order {
966
1152
 
967
1153
  const {
968
1154
  error: res_error,
969
- } = OrderPlatformModel.GenerateInvoiceIDResponse().validate(responseData, {
970
- abortEarly: false,
971
- allowUnknown: true,
972
- });
1155
+ } = OrderPlatformModel.RefundModeConfigResponsePayload().validate(
1156
+ responseData,
1157
+ { abortEarly: false, allowUnknown: true }
1158
+ );
973
1159
 
974
1160
  if (res_error) {
975
1161
  if (this.config.options.strictResponseCheck === true) {
@@ -977,7 +1163,7 @@ class Order {
977
1163
  } else {
978
1164
  Logger({
979
1165
  level: "WARN",
980
- message: `Response Validation Warnings for platform > Order > generateInvoiceID \n ${res_error}`,
1166
+ message: `Response Validation Warnings for platform > Order > fetchRefundModeConfig \n ${res_error}`,
981
1167
  });
982
1168
  }
983
1169
  }
@@ -1163,22 +1349,22 @@ class Order {
1163
1349
  }
1164
1350
 
1165
1351
  /**
1166
- * @param {OrderPlatformValidator.GetAnnouncementsParam} arg - Arg object
1352
+ * @param {OrderPlatformValidator.GetAllowedTemplatesForBulkParam} arg - Arg object
1167
1353
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1168
1354
  * @param {import("../PlatformAPIClient").Options} - Options
1169
- * @returns {Promise<OrderPlatformModel.AnnouncementsResponse>} - Success response
1170
- * @name getAnnouncements
1355
+ * @returns {Promise<OrderPlatformModel.AllowedTemplatesResponse>} - Success response
1356
+ * @name getAllowedTemplatesForBulk
1171
1357
  * @summary:
1172
- * @description: Get Announcements - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/getAnnouncements/).
1358
+ * @description: Gets All the allowed Templates to perform Bulk Operations. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/getAllowedTemplatesForBulk/).
1173
1359
  */
1174
- async getAnnouncements(
1175
- { date, requestHeaders } = { requestHeaders: {} },
1360
+ async getAllowedTemplatesForBulk(
1361
+ { requestHeaders } = { requestHeaders: {} },
1176
1362
  { responseHeaders } = { responseHeaders: false }
1177
1363
  ) {
1178
- const { error } = OrderPlatformValidator.getAnnouncements().validate(
1179
- {
1180
- date,
1181
- },
1364
+ const {
1365
+ error,
1366
+ } = OrderPlatformValidator.getAllowedTemplatesForBulk().validate(
1367
+ {},
1182
1368
  { abortEarly: false, allowUnknown: true }
1183
1369
  );
1184
1370
  if (error) {
@@ -1188,28 +1374,25 @@ class Order {
1188
1374
  // Showing warrnings if extra unknown parameters are found
1189
1375
  const {
1190
1376
  error: warrning,
1191
- } = OrderPlatformValidator.getAnnouncements().validate(
1192
- {
1193
- date,
1194
- },
1377
+ } = OrderPlatformValidator.getAllowedTemplatesForBulk().validate(
1378
+ {},
1195
1379
  { abortEarly: false, allowUnknown: false }
1196
1380
  );
1197
1381
  if (warrning) {
1198
1382
  Logger({
1199
1383
  level: "WARN",
1200
- message: `Parameter Validation warrnings for platform > Order > getAnnouncements \n ${warrning}`,
1384
+ message: `Parameter Validation warrnings for platform > Order > getAllowedTemplatesForBulk \n ${warrning}`,
1201
1385
  });
1202
1386
  }
1203
1387
 
1204
1388
  const query_params = {};
1205
- query_params["date"] = date;
1206
1389
 
1207
1390
  const xHeaders = {};
1208
1391
 
1209
1392
  const response = await PlatformAPIClient.execute(
1210
1393
  this.config,
1211
1394
  "get",
1212
- `/service/platform/order-manage/v1.0/company/${this.config.companyId}/announcements`,
1395
+ `/service/platform/order/v1.0/company/${this.config.companyId}/jobs/templates`,
1213
1396
  query_params,
1214
1397
  undefined,
1215
1398
  { ...xHeaders, ...requestHeaders },
@@ -1223,7 +1406,7 @@ class Order {
1223
1406
 
1224
1407
  const {
1225
1408
  error: res_error,
1226
- } = OrderPlatformModel.AnnouncementsResponse().validate(responseData, {
1409
+ } = OrderPlatformModel.AllowedTemplatesResponse().validate(responseData, {
1227
1410
  abortEarly: false,
1228
1411
  allowUnknown: true,
1229
1412
  });
@@ -1234,7 +1417,7 @@ class Order {
1234
1417
  } else {
1235
1418
  Logger({
1236
1419
  level: "WARN",
1237
- message: `Response Validation Warnings for platform > Order > getAnnouncements \n ${res_error}`,
1420
+ message: `Response Validation Warnings for platform > Order > getAllowedTemplatesForBulk \n ${res_error}`,
1238
1421
  });
1239
1422
  }
1240
1423
  }
@@ -1243,16 +1426,96 @@ class Order {
1243
1426
  }
1244
1427
 
1245
1428
  /**
1246
- * @param {OrderPlatformValidator.GetBagByIdParam} arg - Arg object
1429
+ * @param {OrderPlatformValidator.GetAnnouncementsParam} arg - Arg object
1247
1430
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1248
1431
  * @param {import("../PlatformAPIClient").Options} - Options
1249
- * @returns {Promise<OrderPlatformModel.BagDetailsPlatformResponse>} -
1250
- * Success response
1251
- * @name getBagById
1432
+ * @returns {Promise<OrderPlatformModel.AnnouncementsResponse>} - Success response
1433
+ * @name getAnnouncements
1252
1434
  * @summary:
1253
- * @description: Get Order Bag Details. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/getBagById/).
1435
+ * @description: Get Announcements - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/getAnnouncements/).
1254
1436
  */
1255
- async getBagById(
1437
+ async getAnnouncements(
1438
+ { date, requestHeaders } = { requestHeaders: {} },
1439
+ { responseHeaders } = { responseHeaders: false }
1440
+ ) {
1441
+ const { error } = OrderPlatformValidator.getAnnouncements().validate(
1442
+ {
1443
+ date,
1444
+ },
1445
+ { abortEarly: false, allowUnknown: true }
1446
+ );
1447
+ if (error) {
1448
+ return Promise.reject(new FDKClientValidationError(error));
1449
+ }
1450
+
1451
+ // Showing warrnings if extra unknown parameters are found
1452
+ const {
1453
+ error: warrning,
1454
+ } = OrderPlatformValidator.getAnnouncements().validate(
1455
+ {
1456
+ date,
1457
+ },
1458
+ { abortEarly: false, allowUnknown: false }
1459
+ );
1460
+ if (warrning) {
1461
+ Logger({
1462
+ level: "WARN",
1463
+ message: `Parameter Validation warrnings for platform > Order > getAnnouncements \n ${warrning}`,
1464
+ });
1465
+ }
1466
+
1467
+ const query_params = {};
1468
+ query_params["date"] = date;
1469
+
1470
+ const xHeaders = {};
1471
+
1472
+ const response = await PlatformAPIClient.execute(
1473
+ this.config,
1474
+ "get",
1475
+ `/service/platform/order-manage/v1.0/company/${this.config.companyId}/announcements`,
1476
+ query_params,
1477
+ undefined,
1478
+ { ...xHeaders, ...requestHeaders },
1479
+ { responseHeaders }
1480
+ );
1481
+
1482
+ let responseData = response;
1483
+ if (responseHeaders) {
1484
+ responseData = response[0];
1485
+ }
1486
+
1487
+ const {
1488
+ error: res_error,
1489
+ } = OrderPlatformModel.AnnouncementsResponse().validate(responseData, {
1490
+ abortEarly: false,
1491
+ allowUnknown: true,
1492
+ });
1493
+
1494
+ if (res_error) {
1495
+ if (this.config.options.strictResponseCheck === true) {
1496
+ return Promise.reject(new FDKResponseValidationError(res_error));
1497
+ } else {
1498
+ Logger({
1499
+ level: "WARN",
1500
+ message: `Response Validation Warnings for platform > Order > getAnnouncements \n ${res_error}`,
1501
+ });
1502
+ }
1503
+ }
1504
+
1505
+ return response;
1506
+ }
1507
+
1508
+ /**
1509
+ * @param {OrderPlatformValidator.GetBagByIdParam} arg - Arg object
1510
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1511
+ * @param {import("../PlatformAPIClient").Options} - Options
1512
+ * @returns {Promise<OrderPlatformModel.BagDetailsPlatformResponse>} -
1513
+ * Success response
1514
+ * @name getBagById
1515
+ * @summary:
1516
+ * @description: Get Order Bag Details. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/getBagById/).
1517
+ */
1518
+ async getBagById(
1256
1519
  { bagId, channelBagId, channelId, requestHeaders } = { requestHeaders: {} },
1257
1520
  { responseHeaders } = { responseHeaders: false }
1258
1521
  ) {
@@ -1529,8 +1792,8 @@ class Order {
1529
1792
  {
1530
1793
  salesChannels,
1531
1794
  dpIds,
1532
- fromDate,
1533
- toDate,
1795
+ startDate,
1796
+ endDate,
1534
1797
  stores,
1535
1798
  tags,
1536
1799
  bagStatus,
@@ -1549,8 +1812,8 @@ class Order {
1549
1812
  {
1550
1813
  salesChannels,
1551
1814
  dpIds,
1552
- fromDate,
1553
- toDate,
1815
+ startDate,
1816
+ endDate,
1554
1817
  stores,
1555
1818
  tags,
1556
1819
  bagStatus,
@@ -1573,8 +1836,8 @@ class Order {
1573
1836
  {
1574
1837
  salesChannels,
1575
1838
  dpIds,
1576
- fromDate,
1577
- toDate,
1839
+ startDate,
1840
+ endDate,
1578
1841
  stores,
1579
1842
  tags,
1580
1843
  bagStatus,
@@ -1596,8 +1859,8 @@ class Order {
1596
1859
  const query_params = {};
1597
1860
  query_params["sales_channels"] = salesChannels;
1598
1861
  query_params["dp_ids"] = dpIds;
1599
- query_params["from_date"] = fromDate;
1600
- query_params["to_date"] = toDate;
1862
+ query_params["start_date"] = startDate;
1863
+ query_params["end_date"] = endDate;
1601
1864
  query_params["stores"] = stores;
1602
1865
  query_params["tags"] = tags;
1603
1866
  query_params["bag_status"] = bagStatus;
@@ -1720,6 +1983,96 @@ class Order {
1720
1983
  return response;
1721
1984
  }
1722
1985
 
1986
+ /**
1987
+ * @param {OrderPlatformValidator.GetFileByStatusParam} arg - Arg object
1988
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1989
+ * @param {import("../PlatformAPIClient").Options} - Options
1990
+ * @returns {Promise<OrderPlatformModel.JobFailedResponse>} - Success response
1991
+ * @name getFileByStatus
1992
+ * @summary:
1993
+ * @description: Get the file URL consisting Records of the provided status. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/getFileByStatus/).
1994
+ */
1995
+ async getFileByStatus(
1996
+ { batchId, status, fileType, reportType, requestHeaders } = {
1997
+ requestHeaders: {},
1998
+ },
1999
+ { responseHeaders } = { responseHeaders: false }
2000
+ ) {
2001
+ const { error } = OrderPlatformValidator.getFileByStatus().validate(
2002
+ {
2003
+ batchId,
2004
+ status,
2005
+ fileType,
2006
+ reportType,
2007
+ },
2008
+ { abortEarly: false, allowUnknown: true }
2009
+ );
2010
+ if (error) {
2011
+ return Promise.reject(new FDKClientValidationError(error));
2012
+ }
2013
+
2014
+ // Showing warrnings if extra unknown parameters are found
2015
+ const {
2016
+ error: warrning,
2017
+ } = OrderPlatformValidator.getFileByStatus().validate(
2018
+ {
2019
+ batchId,
2020
+ status,
2021
+ fileType,
2022
+ reportType,
2023
+ },
2024
+ { abortEarly: false, allowUnknown: false }
2025
+ );
2026
+ if (warrning) {
2027
+ Logger({
2028
+ level: "WARN",
2029
+ message: `Parameter Validation warrnings for platform > Order > getFileByStatus \n ${warrning}`,
2030
+ });
2031
+ }
2032
+
2033
+ const query_params = {};
2034
+ query_params["status"] = status;
2035
+ query_params["file_type"] = fileType;
2036
+ query_params["report_type"] = reportType;
2037
+
2038
+ const xHeaders = {};
2039
+
2040
+ const response = await PlatformAPIClient.execute(
2041
+ this.config,
2042
+ "get",
2043
+ `/service/platform/order-manage/v1.0/company/${this.config.companyId}/jobs/${batchId}/file`,
2044
+ query_params,
2045
+ undefined,
2046
+ { ...xHeaders, ...requestHeaders },
2047
+ { responseHeaders }
2048
+ );
2049
+
2050
+ let responseData = response;
2051
+ if (responseHeaders) {
2052
+ responseData = response[0];
2053
+ }
2054
+
2055
+ const {
2056
+ error: res_error,
2057
+ } = OrderPlatformModel.JobFailedResponse().validate(responseData, {
2058
+ abortEarly: false,
2059
+ allowUnknown: true,
2060
+ });
2061
+
2062
+ if (res_error) {
2063
+ if (this.config.options.strictResponseCheck === true) {
2064
+ return Promise.reject(new FDKResponseValidationError(res_error));
2065
+ } else {
2066
+ Logger({
2067
+ level: "WARN",
2068
+ message: `Response Validation Warnings for platform > Order > getFileByStatus \n ${res_error}`,
2069
+ });
2070
+ }
2071
+ }
2072
+
2073
+ return response;
2074
+ }
2075
+
1723
2076
  /**
1724
2077
  * @param {OrderPlatformValidator.GetLaneConfigParam} arg - Arg object
1725
2078
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
@@ -1735,6 +2088,8 @@ class Order {
1735
2088
  groupEntity,
1736
2089
  fromDate,
1737
2090
  toDate,
2091
+ startDate,
2092
+ endDate,
1738
2093
  dpIds,
1739
2094
  stores,
1740
2095
  salesChannels,
@@ -1758,6 +2113,8 @@ class Order {
1758
2113
  groupEntity,
1759
2114
  fromDate,
1760
2115
  toDate,
2116
+ startDate,
2117
+ endDate,
1761
2118
  dpIds,
1762
2119
  stores,
1763
2120
  salesChannels,
@@ -1785,6 +2142,8 @@ class Order {
1785
2142
  groupEntity,
1786
2143
  fromDate,
1787
2144
  toDate,
2145
+ startDate,
2146
+ endDate,
1788
2147
  dpIds,
1789
2148
  stores,
1790
2149
  salesChannels,
@@ -1813,6 +2172,8 @@ class Order {
1813
2172
  query_params["group_entity"] = groupEntity;
1814
2173
  query_params["from_date"] = fromDate;
1815
2174
  query_params["to_date"] = toDate;
2175
+ query_params["start_date"] = startDate;
2176
+ query_params["end_date"] = endDate;
1816
2177
  query_params["dp_ids"] = dpIds;
1817
2178
  query_params["stores"] = stores;
1818
2179
  query_params["sales_channels"] = salesChannels;
@@ -1866,22 +2227,21 @@ class Order {
1866
2227
  }
1867
2228
 
1868
2229
  /**
1869
- * @param {OrderPlatformValidator.GetOrderByIdParam} arg - Arg object
2230
+ * @param {OrderPlatformValidator.GetManifestDetailsParam} arg - Arg object
1870
2231
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1871
2232
  * @param {import("../PlatformAPIClient").Options} - Options
1872
- * @returns {Promise<OrderPlatformModel.OrderDetailsResponse>} - Success response
1873
- * @name getOrderById
2233
+ * @returns {Promise<OrderPlatformModel.ManifestDetails>} - Success response
2234
+ * @name getManifestDetails
1874
2235
  * @summary:
1875
- * @description: Get Order Details by ID - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/getOrderById/).
2236
+ * @description: get Manifest Details. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/getManifestDetails/).
1876
2237
  */
1877
- async getOrderById(
1878
- { orderId, myOrders, requestHeaders } = { requestHeaders: {} },
2238
+ async getManifestDetails(
2239
+ { manifestId, requestHeaders } = { requestHeaders: {} },
1879
2240
  { responseHeaders } = { responseHeaders: false }
1880
2241
  ) {
1881
- const { error } = OrderPlatformValidator.getOrderById().validate(
2242
+ const { error } = OrderPlatformValidator.getManifestDetails().validate(
1882
2243
  {
1883
- orderId,
1884
- myOrders,
2244
+ manifestId,
1885
2245
  },
1886
2246
  { abortEarly: false, allowUnknown: true }
1887
2247
  );
@@ -1890,30 +2250,29 @@ class Order {
1890
2250
  }
1891
2251
 
1892
2252
  // Showing warrnings if extra unknown parameters are found
1893
- const { error: warrning } = OrderPlatformValidator.getOrderById().validate(
2253
+ const {
2254
+ error: warrning,
2255
+ } = OrderPlatformValidator.getManifestDetails().validate(
1894
2256
  {
1895
- orderId,
1896
- myOrders,
2257
+ manifestId,
1897
2258
  },
1898
2259
  { abortEarly: false, allowUnknown: false }
1899
2260
  );
1900
2261
  if (warrning) {
1901
2262
  Logger({
1902
2263
  level: "WARN",
1903
- message: `Parameter Validation warrnings for platform > Order > getOrderById \n ${warrning}`,
2264
+ message: `Parameter Validation warrnings for platform > Order > getManifestDetails \n ${warrning}`,
1904
2265
  });
1905
2266
  }
1906
2267
 
1907
2268
  const query_params = {};
1908
- query_params["order_id"] = orderId;
1909
- query_params["my_orders"] = myOrders;
1910
2269
 
1911
2270
  const xHeaders = {};
1912
2271
 
1913
2272
  const response = await PlatformAPIClient.execute(
1914
2273
  this.config,
1915
2274
  "get",
1916
- `/service/platform/order/v1.0/company/${this.config.companyId}/order-details`,
2275
+ `/service/platform/order-manage/v1.0/company/${this.config.companyId}/manifests/${manifestId}`,
1917
2276
  query_params,
1918
2277
  undefined,
1919
2278
  { ...xHeaders, ...requestHeaders },
@@ -1927,7 +2286,7 @@ class Order {
1927
2286
 
1928
2287
  const {
1929
2288
  error: res_error,
1930
- } = OrderPlatformModel.OrderDetailsResponse().validate(responseData, {
2289
+ } = OrderPlatformModel.ManifestDetails().validate(responseData, {
1931
2290
  abortEarly: false,
1932
2291
  allowUnknown: true,
1933
2292
  });
@@ -1938,7 +2297,7 @@ class Order {
1938
2297
  } else {
1939
2298
  Logger({
1940
2299
  level: "WARN",
1941
- message: `Response Validation Warnings for platform > Order > getOrderById \n ${res_error}`,
2300
+ message: `Response Validation Warnings for platform > Order > getManifestDetails \n ${res_error}`,
1942
2301
  });
1943
2302
  }
1944
2303
  }
@@ -1947,62 +2306,42 @@ class Order {
1947
2306
  }
1948
2307
 
1949
2308
  /**
1950
- * @param {OrderPlatformValidator.GetOrdersParam} arg - Arg object
2309
+ * @param {OrderPlatformValidator.GetManifestShipmentsParam} arg - Arg object
1951
2310
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1952
2311
  * @param {import("../PlatformAPIClient").Options} - Options
1953
- * @returns {Promise<OrderPlatformModel.OrderListingResponse>} - Success response
1954
- * @name getOrders
2312
+ * @returns {Promise<OrderPlatformModel.ManifestShipmentListing>} - Success response
2313
+ * @name getManifestShipments
1955
2314
  * @summary:
1956
- * @description: Get Orders Listing - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/getOrders/).
2315
+ * @description: get Manifest Shipments. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/getManifestShipments/).
1957
2316
  */
1958
- async getOrders(
2317
+ async getManifestShipments(
1959
2318
  {
1960
- lane,
1961
- searchType,
1962
- bagStatus,
1963
- timeToDispatch,
1964
- paymentMethods,
1965
- tags,
1966
- searchValue,
1967
- fromDate,
1968
- toDate,
1969
2319
  dpIds,
1970
2320
  stores,
2321
+ toDate,
2322
+ fromDate,
2323
+ dpName,
1971
2324
  salesChannels,
2325
+ searchType,
2326
+ searchValue,
1972
2327
  pageNo,
1973
2328
  pageSize,
1974
- isPrioritySort,
1975
- customMeta,
1976
- myOrders,
1977
- showCrossCompanyData,
1978
- customerId,
1979
- orderType,
1980
2329
  requestHeaders,
1981
2330
  } = { requestHeaders: {} },
1982
2331
  { responseHeaders } = { responseHeaders: false }
1983
2332
  ) {
1984
- const { error } = OrderPlatformValidator.getOrders().validate(
2333
+ const { error } = OrderPlatformValidator.getManifestShipments().validate(
1985
2334
  {
1986
- lane,
1987
- searchType,
1988
- bagStatus,
1989
- timeToDispatch,
1990
- paymentMethods,
1991
- tags,
1992
- searchValue,
1993
- fromDate,
1994
- toDate,
1995
2335
  dpIds,
1996
2336
  stores,
2337
+ toDate,
2338
+ fromDate,
2339
+ dpName,
1997
2340
  salesChannels,
2341
+ searchType,
2342
+ searchValue,
1998
2343
  pageNo,
1999
2344
  pageSize,
2000
- isPrioritySort,
2001
- customMeta,
2002
- myOrders,
2003
- showCrossCompanyData,
2004
- customerId,
2005
- orderType,
2006
2345
  },
2007
2346
  { abortEarly: false, allowUnknown: true }
2008
2347
  );
@@ -2011,57 +2350,1107 @@ class Order {
2011
2350
  }
2012
2351
 
2013
2352
  // Showing warrnings if extra unknown parameters are found
2014
- const { error: warrning } = OrderPlatformValidator.getOrders().validate(
2353
+ const {
2354
+ error: warrning,
2355
+ } = OrderPlatformValidator.getManifestShipments().validate(
2015
2356
  {
2016
- lane,
2017
- searchType,
2018
- bagStatus,
2019
- timeToDispatch,
2020
- paymentMethods,
2021
- tags,
2022
- searchValue,
2023
- fromDate,
2024
- toDate,
2025
2357
  dpIds,
2026
2358
  stores,
2359
+ toDate,
2360
+ fromDate,
2361
+ dpName,
2027
2362
  salesChannels,
2363
+ searchType,
2364
+ searchValue,
2028
2365
  pageNo,
2029
2366
  pageSize,
2030
- isPrioritySort,
2031
- customMeta,
2032
- myOrders,
2033
- showCrossCompanyData,
2034
- customerId,
2035
- orderType,
2036
2367
  },
2037
2368
  { abortEarly: false, allowUnknown: false }
2038
2369
  );
2039
2370
  if (warrning) {
2040
2371
  Logger({
2041
2372
  level: "WARN",
2042
- message: `Parameter Validation warrnings for platform > Order > getOrders \n ${warrning}`,
2373
+ message: `Parameter Validation warrnings for platform > Order > getManifestShipments \n ${warrning}`,
2043
2374
  });
2044
2375
  }
2045
2376
 
2046
2377
  const query_params = {};
2047
- query_params["lane"] = lane;
2378
+ query_params["dp_ids"] = dpIds;
2379
+ query_params["stores"] = stores;
2380
+ query_params["to_date"] = toDate;
2381
+ query_params["from_date"] = fromDate;
2382
+ query_params["dp_name"] = dpName;
2383
+ query_params["sales_channels"] = salesChannels;
2048
2384
  query_params["search_type"] = searchType;
2049
- query_params["bag_status"] = bagStatus;
2385
+ query_params["search_value"] = searchValue;
2386
+ query_params["page_no"] = pageNo;
2387
+ query_params["page_size"] = pageSize;
2388
+
2389
+ const xHeaders = {};
2390
+
2391
+ const response = await PlatformAPIClient.execute(
2392
+ this.config,
2393
+ "get",
2394
+ `/service/platform/order-manage/v1.0/company/${this.config.companyId}/manifests/shipments`,
2395
+ query_params,
2396
+ undefined,
2397
+ { ...xHeaders, ...requestHeaders },
2398
+ { responseHeaders }
2399
+ );
2400
+
2401
+ let responseData = response;
2402
+ if (responseHeaders) {
2403
+ responseData = response[0];
2404
+ }
2405
+
2406
+ const {
2407
+ error: res_error,
2408
+ } = OrderPlatformModel.ManifestShipmentListing().validate(responseData, {
2409
+ abortEarly: false,
2410
+ allowUnknown: true,
2411
+ });
2412
+
2413
+ if (res_error) {
2414
+ if (this.config.options.strictResponseCheck === true) {
2415
+ return Promise.reject(new FDKResponseValidationError(res_error));
2416
+ } else {
2417
+ Logger({
2418
+ level: "WARN",
2419
+ message: `Response Validation Warnings for platform > Order > getManifestShipments \n ${res_error}`,
2420
+ });
2421
+ }
2422
+ }
2423
+
2424
+ return response;
2425
+ }
2426
+
2427
+ /**
2428
+ * @param {OrderPlatformValidator.GetManifestfiltersParam} arg - Arg object
2429
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
2430
+ * @param {import("../PlatformAPIClient").Options} - Options
2431
+ * @returns {Promise<OrderPlatformModel.ManifestFiltersResponse>} - Success response
2432
+ * @name getManifestfilters
2433
+ * @summary:
2434
+ * @description: get Manifest Filters. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/getManifestfilters/).
2435
+ */
2436
+ async getManifestfilters(
2437
+ { view, requestHeaders } = { requestHeaders: {} },
2438
+ { responseHeaders } = { responseHeaders: false }
2439
+ ) {
2440
+ const { error } = OrderPlatformValidator.getManifestfilters().validate(
2441
+ {
2442
+ view,
2443
+ },
2444
+ { abortEarly: false, allowUnknown: true }
2445
+ );
2446
+ if (error) {
2447
+ return Promise.reject(new FDKClientValidationError(error));
2448
+ }
2449
+
2450
+ // Showing warrnings if extra unknown parameters are found
2451
+ const {
2452
+ error: warrning,
2453
+ } = OrderPlatformValidator.getManifestfilters().validate(
2454
+ {
2455
+ view,
2456
+ },
2457
+ { abortEarly: false, allowUnknown: false }
2458
+ );
2459
+ if (warrning) {
2460
+ Logger({
2461
+ level: "WARN",
2462
+ message: `Parameter Validation warrnings for platform > Order > getManifestfilters \n ${warrning}`,
2463
+ });
2464
+ }
2465
+
2466
+ const query_params = {};
2467
+ query_params["view"] = view;
2468
+
2469
+ const xHeaders = {};
2470
+
2471
+ const response = await PlatformAPIClient.execute(
2472
+ this.config,
2473
+ "get",
2474
+ `/service/platform/order-manage/v1.0/company/${this.config.companyId}/filter/listing`,
2475
+ query_params,
2476
+ undefined,
2477
+ { ...xHeaders, ...requestHeaders },
2478
+ { responseHeaders }
2479
+ );
2480
+
2481
+ let responseData = response;
2482
+ if (responseHeaders) {
2483
+ responseData = response[0];
2484
+ }
2485
+
2486
+ const {
2487
+ error: res_error,
2488
+ } = OrderPlatformModel.ManifestFiltersResponse().validate(responseData, {
2489
+ abortEarly: false,
2490
+ allowUnknown: true,
2491
+ });
2492
+
2493
+ if (res_error) {
2494
+ if (this.config.options.strictResponseCheck === true) {
2495
+ return Promise.reject(new FDKResponseValidationError(res_error));
2496
+ } else {
2497
+ Logger({
2498
+ level: "WARN",
2499
+ message: `Response Validation Warnings for platform > Order > getManifestfilters \n ${res_error}`,
2500
+ });
2501
+ }
2502
+ }
2503
+
2504
+ return response;
2505
+ }
2506
+
2507
+ /**
2508
+ * @param {OrderPlatformValidator.GetManifestsParam} arg - Arg object
2509
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
2510
+ * @param {import("../PlatformAPIClient").Options} - Options
2511
+ * @returns {Promise<OrderPlatformModel.ManifestList>} - Success response
2512
+ * @name getManifests
2513
+ * @summary:
2514
+ * @description: Fetch Manifests - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/getManifests/).
2515
+ */
2516
+ async getManifests(
2517
+ {
2518
+ status,
2519
+ startDate,
2520
+ endDate,
2521
+ searchType,
2522
+ storeId,
2523
+ searchValue,
2524
+ dpIds,
2525
+ pageNo,
2526
+ pageSize,
2527
+ requestHeaders,
2528
+ } = { requestHeaders: {} },
2529
+ { responseHeaders } = { responseHeaders: false }
2530
+ ) {
2531
+ const { error } = OrderPlatformValidator.getManifests().validate(
2532
+ {
2533
+ status,
2534
+ startDate,
2535
+ endDate,
2536
+ searchType,
2537
+ storeId,
2538
+ searchValue,
2539
+ dpIds,
2540
+ pageNo,
2541
+ pageSize,
2542
+ },
2543
+ { abortEarly: false, allowUnknown: true }
2544
+ );
2545
+ if (error) {
2546
+ return Promise.reject(new FDKClientValidationError(error));
2547
+ }
2548
+
2549
+ // Showing warrnings if extra unknown parameters are found
2550
+ const { error: warrning } = OrderPlatformValidator.getManifests().validate(
2551
+ {
2552
+ status,
2553
+ startDate,
2554
+ endDate,
2555
+ searchType,
2556
+ storeId,
2557
+ searchValue,
2558
+ dpIds,
2559
+ pageNo,
2560
+ pageSize,
2561
+ },
2562
+ { abortEarly: false, allowUnknown: false }
2563
+ );
2564
+ if (warrning) {
2565
+ Logger({
2566
+ level: "WARN",
2567
+ message: `Parameter Validation warrnings for platform > Order > getManifests \n ${warrning}`,
2568
+ });
2569
+ }
2570
+
2571
+ const query_params = {};
2572
+ query_params["status"] = status;
2573
+ query_params["start_date"] = startDate;
2574
+ query_params["end_date"] = endDate;
2575
+ query_params["search_type"] = searchType;
2576
+ query_params["store_id"] = storeId;
2577
+ query_params["search_value"] = searchValue;
2578
+ query_params["dp_ids"] = dpIds;
2579
+ query_params["page_no"] = pageNo;
2580
+ query_params["page_size"] = pageSize;
2581
+
2582
+ const xHeaders = {};
2583
+
2584
+ const response = await PlatformAPIClient.execute(
2585
+ this.config,
2586
+ "get",
2587
+ `/service/platform/order-manage/v1.0/company/${this.config.companyId}/manifests`,
2588
+ query_params,
2589
+ undefined,
2590
+ { ...xHeaders, ...requestHeaders },
2591
+ { responseHeaders }
2592
+ );
2593
+
2594
+ let responseData = response;
2595
+ if (responseHeaders) {
2596
+ responseData = response[0];
2597
+ }
2598
+
2599
+ const {
2600
+ error: res_error,
2601
+ } = OrderPlatformModel.ManifestList().validate(responseData, {
2602
+ abortEarly: false,
2603
+ allowUnknown: true,
2604
+ });
2605
+
2606
+ if (res_error) {
2607
+ if (this.config.options.strictResponseCheck === true) {
2608
+ return Promise.reject(new FDKResponseValidationError(res_error));
2609
+ } else {
2610
+ Logger({
2611
+ level: "WARN",
2612
+ message: `Response Validation Warnings for platform > Order > getManifests \n ${res_error}`,
2613
+ });
2614
+ }
2615
+ }
2616
+
2617
+ return response;
2618
+ }
2619
+
2620
+ /**
2621
+ * @param {OrderPlatformValidator.GetOrderByIdParam} arg - Arg object
2622
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
2623
+ * @param {import("../PlatformAPIClient").Options} - Options
2624
+ * @returns {Promise<OrderPlatformModel.OrderDetailsResponse>} - Success response
2625
+ * @name getOrderById
2626
+ * @summary:
2627
+ * @description: Get Order Details by ID - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/getOrderById/).
2628
+ */
2629
+ async getOrderById(
2630
+ { orderId, myOrders, allowInactive, requestHeaders } = {
2631
+ requestHeaders: {},
2632
+ },
2633
+ { responseHeaders } = { responseHeaders: false }
2634
+ ) {
2635
+ const { error } = OrderPlatformValidator.getOrderById().validate(
2636
+ {
2637
+ orderId,
2638
+ myOrders,
2639
+ allowInactive,
2640
+ },
2641
+ { abortEarly: false, allowUnknown: true }
2642
+ );
2643
+ if (error) {
2644
+ return Promise.reject(new FDKClientValidationError(error));
2645
+ }
2646
+
2647
+ // Showing warrnings if extra unknown parameters are found
2648
+ const { error: warrning } = OrderPlatformValidator.getOrderById().validate(
2649
+ {
2650
+ orderId,
2651
+ myOrders,
2652
+ allowInactive,
2653
+ },
2654
+ { abortEarly: false, allowUnknown: false }
2655
+ );
2656
+ if (warrning) {
2657
+ Logger({
2658
+ level: "WARN",
2659
+ message: `Parameter Validation warrnings for platform > Order > getOrderById \n ${warrning}`,
2660
+ });
2661
+ }
2662
+
2663
+ const query_params = {};
2664
+ query_params["order_id"] = orderId;
2665
+ query_params["my_orders"] = myOrders;
2666
+ query_params["allow_inactive"] = allowInactive;
2667
+
2668
+ const xHeaders = {};
2669
+
2670
+ const response = await PlatformAPIClient.execute(
2671
+ this.config,
2672
+ "get",
2673
+ `/service/platform/order/v1.0/company/${this.config.companyId}/order-details`,
2674
+ query_params,
2675
+ undefined,
2676
+ { ...xHeaders, ...requestHeaders },
2677
+ { responseHeaders }
2678
+ );
2679
+
2680
+ let responseData = response;
2681
+ if (responseHeaders) {
2682
+ responseData = response[0];
2683
+ }
2684
+
2685
+ const {
2686
+ error: res_error,
2687
+ } = OrderPlatformModel.OrderDetailsResponse().validate(responseData, {
2688
+ abortEarly: false,
2689
+ allowUnknown: true,
2690
+ });
2691
+
2692
+ if (res_error) {
2693
+ if (this.config.options.strictResponseCheck === true) {
2694
+ return Promise.reject(new FDKResponseValidationError(res_error));
2695
+ } else {
2696
+ Logger({
2697
+ level: "WARN",
2698
+ message: `Response Validation Warnings for platform > Order > getOrderById \n ${res_error}`,
2699
+ });
2700
+ }
2701
+ }
2702
+
2703
+ return response;
2704
+ }
2705
+
2706
+ /**
2707
+ * @param {OrderPlatformValidator.GetOrdersParam} arg - Arg object
2708
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
2709
+ * @param {import("../PlatformAPIClient").Options} - Options
2710
+ * @returns {Promise<OrderPlatformModel.OrderListingResponse>} - Success response
2711
+ * @name getOrders
2712
+ * @summary:
2713
+ * @description: Get Orders Listing - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/getOrders/).
2714
+ */
2715
+ async getOrders(
2716
+ {
2717
+ lane,
2718
+ searchType,
2719
+ bagStatus,
2720
+ timeToDispatch,
2721
+ paymentMethods,
2722
+ tags,
2723
+ searchValue,
2724
+ fromDate,
2725
+ toDate,
2726
+ startDate,
2727
+ endDate,
2728
+ dpIds,
2729
+ stores,
2730
+ salesChannels,
2731
+ pageNo,
2732
+ pageSize,
2733
+ isPrioritySort,
2734
+ customMeta,
2735
+ myOrders,
2736
+ showCrossCompanyData,
2737
+ customerId,
2738
+ orderType,
2739
+ requestHeaders,
2740
+ } = { requestHeaders: {} },
2741
+ { responseHeaders } = { responseHeaders: false }
2742
+ ) {
2743
+ const { error } = OrderPlatformValidator.getOrders().validate(
2744
+ {
2745
+ lane,
2746
+ searchType,
2747
+ bagStatus,
2748
+ timeToDispatch,
2749
+ paymentMethods,
2750
+ tags,
2751
+ searchValue,
2752
+ fromDate,
2753
+ toDate,
2754
+ startDate,
2755
+ endDate,
2756
+ dpIds,
2757
+ stores,
2758
+ salesChannels,
2759
+ pageNo,
2760
+ pageSize,
2761
+ isPrioritySort,
2762
+ customMeta,
2763
+ myOrders,
2764
+ showCrossCompanyData,
2765
+ customerId,
2766
+ orderType,
2767
+ },
2768
+ { abortEarly: false, allowUnknown: true }
2769
+ );
2770
+ if (error) {
2771
+ return Promise.reject(new FDKClientValidationError(error));
2772
+ }
2773
+
2774
+ // Showing warrnings if extra unknown parameters are found
2775
+ const { error: warrning } = OrderPlatformValidator.getOrders().validate(
2776
+ {
2777
+ lane,
2778
+ searchType,
2779
+ bagStatus,
2780
+ timeToDispatch,
2781
+ paymentMethods,
2782
+ tags,
2783
+ searchValue,
2784
+ fromDate,
2785
+ toDate,
2786
+ startDate,
2787
+ endDate,
2788
+ dpIds,
2789
+ stores,
2790
+ salesChannels,
2791
+ pageNo,
2792
+ pageSize,
2793
+ isPrioritySort,
2794
+ customMeta,
2795
+ myOrders,
2796
+ showCrossCompanyData,
2797
+ customerId,
2798
+ orderType,
2799
+ },
2800
+ { abortEarly: false, allowUnknown: false }
2801
+ );
2802
+ if (warrning) {
2803
+ Logger({
2804
+ level: "WARN",
2805
+ message: `Parameter Validation warrnings for platform > Order > getOrders \n ${warrning}`,
2806
+ });
2807
+ }
2808
+
2809
+ const query_params = {};
2810
+ query_params["lane"] = lane;
2811
+ query_params["search_type"] = searchType;
2812
+ query_params["bag_status"] = bagStatus;
2813
+ query_params["time_to_dispatch"] = timeToDispatch;
2814
+ query_params["payment_methods"] = paymentMethods;
2815
+ query_params["tags"] = tags;
2816
+ query_params["search_value"] = searchValue;
2817
+ query_params["from_date"] = fromDate;
2818
+ query_params["to_date"] = toDate;
2819
+ query_params["start_date"] = startDate;
2820
+ query_params["end_date"] = endDate;
2821
+ query_params["dp_ids"] = dpIds;
2822
+ query_params["stores"] = stores;
2823
+ query_params["sales_channels"] = salesChannels;
2824
+ query_params["page_no"] = pageNo;
2825
+ query_params["page_size"] = pageSize;
2826
+ query_params["is_priority_sort"] = isPrioritySort;
2827
+ query_params["custom_meta"] = customMeta;
2828
+ query_params["my_orders"] = myOrders;
2829
+ query_params["show_cross_company_data"] = showCrossCompanyData;
2830
+ query_params["customer_id"] = customerId;
2831
+ query_params["order_type"] = orderType;
2832
+
2833
+ const xHeaders = {};
2834
+
2835
+ const response = await PlatformAPIClient.execute(
2836
+ this.config,
2837
+ "get",
2838
+ `/service/platform/order/v1.0/company/${this.config.companyId}/orders-listing`,
2839
+ query_params,
2840
+ undefined,
2841
+ { ...xHeaders, ...requestHeaders },
2842
+ { responseHeaders }
2843
+ );
2844
+
2845
+ let responseData = response;
2846
+ if (responseHeaders) {
2847
+ responseData = response[0];
2848
+ }
2849
+
2850
+ const {
2851
+ error: res_error,
2852
+ } = OrderPlatformModel.OrderListingResponse().validate(responseData, {
2853
+ abortEarly: false,
2854
+ allowUnknown: true,
2855
+ });
2856
+
2857
+ if (res_error) {
2858
+ if (this.config.options.strictResponseCheck === true) {
2859
+ return Promise.reject(new FDKResponseValidationError(res_error));
2860
+ } else {
2861
+ Logger({
2862
+ level: "WARN",
2863
+ message: `Response Validation Warnings for platform > Order > getOrders \n ${res_error}`,
2864
+ });
2865
+ }
2866
+ }
2867
+
2868
+ return response;
2869
+ }
2870
+
2871
+ /**
2872
+ * @param {Object} arg - Arg object.
2873
+ * @param {string} [arg.lane] - Lane refers to a section where orders are
2874
+ * assigned, indicating its grouping
2875
+ * @param {string} [arg.searchType] - Search_type refers to the field that
2876
+ * will be used as the target for the search operation
2877
+ * @param {string} [arg.bagStatus] - Bag_status refers to status of the
2878
+ * entity. Filters orders based on the status.
2879
+ * @param {number} [arg.timeToDispatch] - Time_to_dispatch refers to
2880
+ * estimated SLA time.
2881
+ * @param {string} [arg.paymentMethods] -
2882
+ * @param {string} [arg.tags] - Tags refers to additional descriptive labels
2883
+ * associated with the order
2884
+ * @param {string} [arg.searchValue] - Search_value is matched against the
2885
+ * field specified by the search_type
2886
+ * @param {string} [arg.fromDate] -
2887
+ * @param {string} [arg.toDate] -
2888
+ * @param {string} [arg.startDate] -
2889
+ * @param {string} [arg.endDate] -
2890
+ * @param {string} [arg.dpIds] - Delivery Partner IDs to which shipments are assigned.
2891
+ * @param {string} [arg.stores] -
2892
+ * @param {string} [arg.salesChannels] -
2893
+ * @param {number} [arg.pageSize] -
2894
+ * @param {boolean} [arg.isPrioritySort] -
2895
+ * @param {string} [arg.customMeta] -
2896
+ * @param {boolean} [arg.myOrders] -
2897
+ * @param {boolean} [arg.showCrossCompanyData] - Flag to view cross &
2898
+ * non-cross company order
2899
+ * @param {string} [arg.customerId] -
2900
+ * @param {string} [arg.orderType] -
2901
+ * @returns {Paginator<OrderPlatformModel.OrderListingResponse>}
2902
+ * @summary:
2903
+ * @description: Get Orders Listing
2904
+ */
2905
+ getOrdersPaginator({
2906
+ lane,
2907
+ searchType,
2908
+ bagStatus,
2909
+ timeToDispatch,
2910
+ paymentMethods,
2911
+ tags,
2912
+ searchValue,
2913
+ fromDate,
2914
+ toDate,
2915
+ startDate,
2916
+ endDate,
2917
+ dpIds,
2918
+ stores,
2919
+ salesChannels,
2920
+ pageSize,
2921
+ isPrioritySort,
2922
+ customMeta,
2923
+ myOrders,
2924
+ showCrossCompanyData,
2925
+ customerId,
2926
+ orderType,
2927
+ } = {}) {
2928
+ const paginator = new Paginator();
2929
+ const callback = async () => {
2930
+ const pageId = paginator.nextId;
2931
+ const pageNo = paginator.pageNo;
2932
+ const pageType = "number";
2933
+ const data = await this.getOrders({
2934
+ lane: lane,
2935
+ searchType: searchType,
2936
+ bagStatus: bagStatus,
2937
+ timeToDispatch: timeToDispatch,
2938
+ paymentMethods: paymentMethods,
2939
+ tags: tags,
2940
+ searchValue: searchValue,
2941
+ fromDate: fromDate,
2942
+ toDate: toDate,
2943
+ startDate: startDate,
2944
+ endDate: endDate,
2945
+ dpIds: dpIds,
2946
+ stores: stores,
2947
+ salesChannels: salesChannels,
2948
+ pageNo: pageNo,
2949
+ pageSize: pageSize,
2950
+ isPrioritySort: isPrioritySort,
2951
+ customMeta: customMeta,
2952
+ myOrders: myOrders,
2953
+ showCrossCompanyData: showCrossCompanyData,
2954
+ customerId: customerId,
2955
+ orderType: orderType,
2956
+ });
2957
+ paginator.setPaginator({
2958
+ hasNext: data.page.has_next ? true : false,
2959
+ nextId: data.page.next_id,
2960
+ });
2961
+ return data;
2962
+ };
2963
+ paginator.setCallback(callback.bind(this));
2964
+ return paginator;
2965
+ }
2966
+
2967
+ /**
2968
+ * @param {OrderPlatformValidator.GetRoleBasedActionsParam} arg - Arg object
2969
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
2970
+ * @param {import("../PlatformAPIClient").Options} - Options
2971
+ * @returns {Promise<OrderPlatformModel.GetActionsResponse>} - Success response
2972
+ * @name getRoleBasedActions
2973
+ * @summary:
2974
+ * @description: Get Role Based Actions - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/getRoleBasedActions/).
2975
+ */
2976
+ async getRoleBasedActions(
2977
+ { requestHeaders } = { requestHeaders: {} },
2978
+ { responseHeaders } = { responseHeaders: false }
2979
+ ) {
2980
+ const { error } = OrderPlatformValidator.getRoleBasedActions().validate(
2981
+ {},
2982
+ { abortEarly: false, allowUnknown: true }
2983
+ );
2984
+ if (error) {
2985
+ return Promise.reject(new FDKClientValidationError(error));
2986
+ }
2987
+
2988
+ // Showing warrnings if extra unknown parameters are found
2989
+ const {
2990
+ error: warrning,
2991
+ } = OrderPlatformValidator.getRoleBasedActions().validate(
2992
+ {},
2993
+ { abortEarly: false, allowUnknown: false }
2994
+ );
2995
+ if (warrning) {
2996
+ Logger({
2997
+ level: "WARN",
2998
+ message: `Parameter Validation warrnings for platform > Order > getRoleBasedActions \n ${warrning}`,
2999
+ });
3000
+ }
3001
+
3002
+ const query_params = {};
3003
+
3004
+ const xHeaders = {};
3005
+
3006
+ const response = await PlatformAPIClient.execute(
3007
+ this.config,
3008
+ "get",
3009
+ `/service/platform/order-manage/v1.0/company/${this.config.companyId}/roles`,
3010
+ query_params,
3011
+ undefined,
3012
+ { ...xHeaders, ...requestHeaders },
3013
+ { responseHeaders }
3014
+ );
3015
+
3016
+ let responseData = response;
3017
+ if (responseHeaders) {
3018
+ responseData = response[0];
3019
+ }
3020
+
3021
+ const {
3022
+ error: res_error,
3023
+ } = OrderPlatformModel.GetActionsResponse().validate(responseData, {
3024
+ abortEarly: false,
3025
+ allowUnknown: true,
3026
+ });
3027
+
3028
+ if (res_error) {
3029
+ if (this.config.options.strictResponseCheck === true) {
3030
+ return Promise.reject(new FDKResponseValidationError(res_error));
3031
+ } else {
3032
+ Logger({
3033
+ level: "WARN",
3034
+ message: `Response Validation Warnings for platform > Order > getRoleBasedActions \n ${res_error}`,
3035
+ });
3036
+ }
3037
+ }
3038
+
3039
+ return response;
3040
+ }
3041
+
3042
+ /**
3043
+ * @param {OrderPlatformValidator.GetShipmentByIdParam} arg - Arg object
3044
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
3045
+ * @param {import("../PlatformAPIClient").Options} - Options
3046
+ * @returns {Promise<OrderPlatformModel.ShipmentInfoResponse>} - Success response
3047
+ * @name getShipmentById
3048
+ * @summary:
3049
+ * @description: Get shipment details for the given shipment. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/getShipmentById/).
3050
+ */
3051
+ async getShipmentById(
3052
+ { channelShipmentId, shipmentId, requestHeaders } = { requestHeaders: {} },
3053
+ { responseHeaders } = { responseHeaders: false }
3054
+ ) {
3055
+ const { error } = OrderPlatformValidator.getShipmentById().validate(
3056
+ {
3057
+ channelShipmentId,
3058
+ shipmentId,
3059
+ },
3060
+ { abortEarly: false, allowUnknown: true }
3061
+ );
3062
+ if (error) {
3063
+ return Promise.reject(new FDKClientValidationError(error));
3064
+ }
3065
+
3066
+ // Showing warrnings if extra unknown parameters are found
3067
+ const {
3068
+ error: warrning,
3069
+ } = OrderPlatformValidator.getShipmentById().validate(
3070
+ {
3071
+ channelShipmentId,
3072
+ shipmentId,
3073
+ },
3074
+ { abortEarly: false, allowUnknown: false }
3075
+ );
3076
+ if (warrning) {
3077
+ Logger({
3078
+ level: "WARN",
3079
+ message: `Parameter Validation warrnings for platform > Order > getShipmentById \n ${warrning}`,
3080
+ });
3081
+ }
3082
+
3083
+ const query_params = {};
3084
+ query_params["channel_shipment_id"] = channelShipmentId;
3085
+ query_params["shipment_id"] = shipmentId;
3086
+
3087
+ const xHeaders = {};
3088
+
3089
+ const response = await PlatformAPIClient.execute(
3090
+ this.config,
3091
+ "get",
3092
+ `/service/platform/order/v1.0/company/${this.config.companyId}/shipment-details`,
3093
+ query_params,
3094
+ undefined,
3095
+ { ...xHeaders, ...requestHeaders },
3096
+ { responseHeaders }
3097
+ );
3098
+
3099
+ let responseData = response;
3100
+ if (responseHeaders) {
3101
+ responseData = response[0];
3102
+ }
3103
+
3104
+ const {
3105
+ error: res_error,
3106
+ } = OrderPlatformModel.ShipmentInfoResponse().validate(responseData, {
3107
+ abortEarly: false,
3108
+ allowUnknown: true,
3109
+ });
3110
+
3111
+ if (res_error) {
3112
+ if (this.config.options.strictResponseCheck === true) {
3113
+ return Promise.reject(new FDKResponseValidationError(res_error));
3114
+ } else {
3115
+ Logger({
3116
+ level: "WARN",
3117
+ message: `Response Validation Warnings for platform > Order > getShipmentById \n ${res_error}`,
3118
+ });
3119
+ }
3120
+ }
3121
+
3122
+ return response;
3123
+ }
3124
+
3125
+ /**
3126
+ * @param {OrderPlatformValidator.GetShipmentHistoryParam} arg - Arg object
3127
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
3128
+ * @param {import("../PlatformAPIClient").Options} - Options
3129
+ * @returns {Promise<OrderPlatformModel.ShipmentHistoryResponse>} - Success response
3130
+ * @name getShipmentHistory
3131
+ * @summary:
3132
+ * @description: Get Shipment History - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/getShipmentHistory/).
3133
+ */
3134
+ async getShipmentHistory(
3135
+ { shipmentId, bagId, requestHeaders } = { requestHeaders: {} },
3136
+ { responseHeaders } = { responseHeaders: false }
3137
+ ) {
3138
+ const { error } = OrderPlatformValidator.getShipmentHistory().validate(
3139
+ {
3140
+ shipmentId,
3141
+ bagId,
3142
+ },
3143
+ { abortEarly: false, allowUnknown: true }
3144
+ );
3145
+ if (error) {
3146
+ return Promise.reject(new FDKClientValidationError(error));
3147
+ }
3148
+
3149
+ // Showing warrnings if extra unknown parameters are found
3150
+ const {
3151
+ error: warrning,
3152
+ } = OrderPlatformValidator.getShipmentHistory().validate(
3153
+ {
3154
+ shipmentId,
3155
+ bagId,
3156
+ },
3157
+ { abortEarly: false, allowUnknown: false }
3158
+ );
3159
+ if (warrning) {
3160
+ Logger({
3161
+ level: "WARN",
3162
+ message: `Parameter Validation warrnings for platform > Order > getShipmentHistory \n ${warrning}`,
3163
+ });
3164
+ }
3165
+
3166
+ const query_params = {};
3167
+ query_params["shipment_id"] = shipmentId;
3168
+ query_params["bag_id"] = bagId;
3169
+
3170
+ const xHeaders = {};
3171
+
3172
+ const response = await PlatformAPIClient.execute(
3173
+ this.config,
3174
+ "get",
3175
+ `/service/platform/order-manage/v1.0/company/${this.config.companyId}/shipment/history`,
3176
+ query_params,
3177
+ undefined,
3178
+ { ...xHeaders, ...requestHeaders },
3179
+ { responseHeaders }
3180
+ );
3181
+
3182
+ let responseData = response;
3183
+ if (responseHeaders) {
3184
+ responseData = response[0];
3185
+ }
3186
+
3187
+ const {
3188
+ error: res_error,
3189
+ } = OrderPlatformModel.ShipmentHistoryResponse().validate(responseData, {
3190
+ abortEarly: false,
3191
+ allowUnknown: true,
3192
+ });
3193
+
3194
+ if (res_error) {
3195
+ if (this.config.options.strictResponseCheck === true) {
3196
+ return Promise.reject(new FDKResponseValidationError(res_error));
3197
+ } else {
3198
+ Logger({
3199
+ level: "WARN",
3200
+ message: `Response Validation Warnings for platform > Order > getShipmentHistory \n ${res_error}`,
3201
+ });
3202
+ }
3203
+ }
3204
+
3205
+ return response;
3206
+ }
3207
+
3208
+ /**
3209
+ * @param {OrderPlatformValidator.GetShipmentReasonsParam} arg - Arg object
3210
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
3211
+ * @param {import("../PlatformAPIClient").Options} - Options
3212
+ * @returns {Promise<OrderPlatformModel.PlatformShipmentReasonsResponse>} -
3213
+ * Success response
3214
+ * @name getShipmentReasons
3215
+ * @summary: Get reasons behind full or partial cancellation of a shipment
3216
+ * @description: Use this API to retrieve the issues that led to the cancellation of bags within a shipment. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/getShipmentReasons/).
3217
+ */
3218
+ async getShipmentReasons(
3219
+ { shipmentId, bagId, state, requestHeaders } = { requestHeaders: {} },
3220
+ { responseHeaders } = { responseHeaders: false }
3221
+ ) {
3222
+ const { error } = OrderPlatformValidator.getShipmentReasons().validate(
3223
+ {
3224
+ shipmentId,
3225
+ bagId,
3226
+ state,
3227
+ },
3228
+ { abortEarly: false, allowUnknown: true }
3229
+ );
3230
+ if (error) {
3231
+ return Promise.reject(new FDKClientValidationError(error));
3232
+ }
3233
+
3234
+ // Showing warrnings if extra unknown parameters are found
3235
+ const {
3236
+ error: warrning,
3237
+ } = OrderPlatformValidator.getShipmentReasons().validate(
3238
+ {
3239
+ shipmentId,
3240
+ bagId,
3241
+ state,
3242
+ },
3243
+ { abortEarly: false, allowUnknown: false }
3244
+ );
3245
+ if (warrning) {
3246
+ Logger({
3247
+ level: "WARN",
3248
+ message: `Parameter Validation warrnings for platform > Order > getShipmentReasons \n ${warrning}`,
3249
+ });
3250
+ }
3251
+
3252
+ const query_params = {};
3253
+
3254
+ const xHeaders = {};
3255
+
3256
+ const response = await PlatformAPIClient.execute(
3257
+ this.config,
3258
+ "get",
3259
+ `/service/platform/order/v1.0/company/${this.config.companyId}/shipments/${shipmentId}/bags/${bagId}/state/${state}/reasons`,
3260
+ query_params,
3261
+ undefined,
3262
+ { ...xHeaders, ...requestHeaders },
3263
+ { responseHeaders }
3264
+ );
3265
+
3266
+ let responseData = response;
3267
+ if (responseHeaders) {
3268
+ responseData = response[0];
3269
+ }
3270
+
3271
+ const {
3272
+ error: res_error,
3273
+ } = OrderPlatformModel.PlatformShipmentReasonsResponse().validate(
3274
+ responseData,
3275
+ { abortEarly: false, allowUnknown: true }
3276
+ );
3277
+
3278
+ if (res_error) {
3279
+ if (this.config.options.strictResponseCheck === true) {
3280
+ return Promise.reject(new FDKResponseValidationError(res_error));
3281
+ } else {
3282
+ Logger({
3283
+ level: "WARN",
3284
+ message: `Response Validation Warnings for platform > Order > getShipmentReasons \n ${res_error}`,
3285
+ });
3286
+ }
3287
+ }
3288
+
3289
+ return response;
3290
+ }
3291
+
3292
+ /**
3293
+ * @param {OrderPlatformValidator.GetShipmentsParam} arg - Arg object
3294
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
3295
+ * @param {import("../PlatformAPIClient").Options} - Options
3296
+ * @returns {Promise<OrderPlatformModel.ShipmentInternalPlatformViewResponse>}
3297
+ * - Success response
3298
+ *
3299
+ * @name getShipments
3300
+ * @summary:
3301
+ * @description: Get Shipments Listing for the company id - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/getShipments/).
3302
+ */
3303
+ async getShipments(
3304
+ {
3305
+ lane,
3306
+ bagStatus,
3307
+ statusOverrideLane,
3308
+ timeToDispatch,
3309
+ searchType,
3310
+ searchValue,
3311
+ fromDate,
3312
+ toDate,
3313
+ startDate,
3314
+ endDate,
3315
+ dpIds,
3316
+ stores,
3317
+ salesChannels,
3318
+ pageNo,
3319
+ pageSize,
3320
+ fetchActiveShipment,
3321
+ allowInactive,
3322
+ excludeLockedShipments,
3323
+ paymentMethods,
3324
+ channelShipmentId,
3325
+ channelOrderId,
3326
+ customMeta,
3327
+ orderingChannel,
3328
+ companyAffiliateTag,
3329
+ myOrders,
3330
+ platformUserId,
3331
+ sortType,
3332
+ showCrossCompanyData,
3333
+ tags,
3334
+ customerId,
3335
+ orderType,
3336
+ requestHeaders,
3337
+ } = { requestHeaders: {} },
3338
+ { responseHeaders } = { responseHeaders: false }
3339
+ ) {
3340
+ const { error } = OrderPlatformValidator.getShipments().validate(
3341
+ {
3342
+ lane,
3343
+ bagStatus,
3344
+ statusOverrideLane,
3345
+ timeToDispatch,
3346
+ searchType,
3347
+ searchValue,
3348
+ fromDate,
3349
+ toDate,
3350
+ startDate,
3351
+ endDate,
3352
+ dpIds,
3353
+ stores,
3354
+ salesChannels,
3355
+ pageNo,
3356
+ pageSize,
3357
+ fetchActiveShipment,
3358
+ allowInactive,
3359
+ excludeLockedShipments,
3360
+ paymentMethods,
3361
+ channelShipmentId,
3362
+ channelOrderId,
3363
+ customMeta,
3364
+ orderingChannel,
3365
+ companyAffiliateTag,
3366
+ myOrders,
3367
+ platformUserId,
3368
+ sortType,
3369
+ showCrossCompanyData,
3370
+ tags,
3371
+ customerId,
3372
+ orderType,
3373
+ },
3374
+ { abortEarly: false, allowUnknown: true }
3375
+ );
3376
+ if (error) {
3377
+ return Promise.reject(new FDKClientValidationError(error));
3378
+ }
3379
+
3380
+ // Showing warrnings if extra unknown parameters are found
3381
+ const { error: warrning } = OrderPlatformValidator.getShipments().validate(
3382
+ {
3383
+ lane,
3384
+ bagStatus,
3385
+ statusOverrideLane,
3386
+ timeToDispatch,
3387
+ searchType,
3388
+ searchValue,
3389
+ fromDate,
3390
+ toDate,
3391
+ startDate,
3392
+ endDate,
3393
+ dpIds,
3394
+ stores,
3395
+ salesChannels,
3396
+ pageNo,
3397
+ pageSize,
3398
+ fetchActiveShipment,
3399
+ allowInactive,
3400
+ excludeLockedShipments,
3401
+ paymentMethods,
3402
+ channelShipmentId,
3403
+ channelOrderId,
3404
+ customMeta,
3405
+ orderingChannel,
3406
+ companyAffiliateTag,
3407
+ myOrders,
3408
+ platformUserId,
3409
+ sortType,
3410
+ showCrossCompanyData,
3411
+ tags,
3412
+ customerId,
3413
+ orderType,
3414
+ },
3415
+ { abortEarly: false, allowUnknown: false }
3416
+ );
3417
+ if (warrning) {
3418
+ Logger({
3419
+ level: "WARN",
3420
+ message: `Parameter Validation warrnings for platform > Order > getShipments \n ${warrning}`,
3421
+ });
3422
+ }
3423
+
3424
+ const query_params = {};
3425
+ query_params["lane"] = lane;
3426
+ query_params["bag_status"] = bagStatus;
3427
+ query_params["status_override_lane"] = statusOverrideLane;
2050
3428
  query_params["time_to_dispatch"] = timeToDispatch;
2051
- query_params["payment_methods"] = paymentMethods;
2052
- query_params["tags"] = tags;
3429
+ query_params["search_type"] = searchType;
2053
3430
  query_params["search_value"] = searchValue;
2054
3431
  query_params["from_date"] = fromDate;
2055
3432
  query_params["to_date"] = toDate;
3433
+ query_params["start_date"] = startDate;
3434
+ query_params["end_date"] = endDate;
2056
3435
  query_params["dp_ids"] = dpIds;
2057
3436
  query_params["stores"] = stores;
2058
3437
  query_params["sales_channels"] = salesChannels;
2059
3438
  query_params["page_no"] = pageNo;
2060
3439
  query_params["page_size"] = pageSize;
2061
- query_params["is_priority_sort"] = isPrioritySort;
3440
+ query_params["fetch_active_shipment"] = fetchActiveShipment;
3441
+ query_params["allow_inactive"] = allowInactive;
3442
+ query_params["exclude_locked_shipments"] = excludeLockedShipments;
3443
+ query_params["payment_methods"] = paymentMethods;
3444
+ query_params["channel_shipment_id"] = channelShipmentId;
3445
+ query_params["channel_order_id"] = channelOrderId;
2062
3446
  query_params["custom_meta"] = customMeta;
3447
+ query_params["ordering_channel"] = orderingChannel;
3448
+ query_params["company_affiliate_tag"] = companyAffiliateTag;
2063
3449
  query_params["my_orders"] = myOrders;
3450
+ query_params["platform_user_id"] = platformUserId;
3451
+ query_params["sort_type"] = sortType;
2064
3452
  query_params["show_cross_company_data"] = showCrossCompanyData;
3453
+ query_params["tags"] = tags;
2065
3454
  query_params["customer_id"] = customerId;
2066
3455
  query_params["order_type"] = orderType;
2067
3456
 
@@ -2070,7 +3459,7 @@ class Order {
2070
3459
  const response = await PlatformAPIClient.execute(
2071
3460
  this.config,
2072
3461
  "get",
2073
- `/service/platform/order/v1.0/company/${this.config.companyId}/orders-listing`,
3462
+ `/service/platform/order/v1.0/company/${this.config.companyId}/shipments-listing`,
2074
3463
  query_params,
2075
3464
  undefined,
2076
3465
  { ...xHeaders, ...requestHeaders },
@@ -2084,10 +3473,10 @@ class Order {
2084
3473
 
2085
3474
  const {
2086
3475
  error: res_error,
2087
- } = OrderPlatformModel.OrderListingResponse().validate(responseData, {
2088
- abortEarly: false,
2089
- allowUnknown: true,
2090
- });
3476
+ } = OrderPlatformModel.ShipmentInternalPlatformViewResponse().validate(
3477
+ responseData,
3478
+ { abortEarly: false, allowUnknown: true }
3479
+ );
2091
3480
 
2092
3481
  if (res_error) {
2093
3482
  if (this.config.options.strictResponseCheck === true) {
@@ -2095,7 +3484,7 @@ class Order {
2095
3484
  } else {
2096
3485
  Logger({
2097
3486
  level: "WARN",
2098
- message: `Response Validation Warnings for platform > Order > getOrders \n ${res_error}`,
3487
+ message: `Response Validation Warnings for platform > Order > getShipments \n ${res_error}`,
2099
3488
  });
2100
3489
  }
2101
3490
  }
@@ -2105,54 +3494,71 @@ class Order {
2105
3494
 
2106
3495
  /**
2107
3496
  * @param {Object} arg - Arg object.
2108
- * @param {string} [arg.lane] - Lane refers to a section where orders are
2109
- * assigned, indicating its grouping
2110
- * @param {string} [arg.searchType] - Search_type refers to the field that
2111
- * will be used as the target for the search operation
2112
- * @param {string} [arg.bagStatus] - Bag_status refers to status of the
2113
- * entity. Filters orders based on the status.
2114
- * @param {number} [arg.timeToDispatch] - Time_to_dispatch refers to
2115
- * estimated SLA time.
2116
- * @param {string} [arg.paymentMethods] -
2117
- * @param {string} [arg.tags] - Tags refers to additional descriptive labels
2118
- * associated with the order
2119
- * @param {string} [arg.searchValue] - Search_value is matched against the
2120
- * field specified by the search_type
2121
- * @param {string} [arg.fromDate] -
2122
- * @param {string} [arg.toDate] -
2123
- * @param {string} [arg.dpIds] - Delivery Partner IDs to which shipments are assigned.
2124
- * @param {string} [arg.stores] -
2125
- * @param {string} [arg.salesChannels] -
2126
- * @param {number} [arg.pageSize] -
2127
- * @param {boolean} [arg.isPrioritySort] -
3497
+ * @param {string} [arg.lane] - Name of lane for which data is to be fetched
3498
+ * @param {string} [arg.bagStatus] - Comma separated values of bag statuses
3499
+ * @param {boolean} [arg.statusOverrideLane] - Use this flag to fetch by
3500
+ * bag_status and override lane
3501
+ * @param {number} [arg.timeToDispatch] -
3502
+ * @param {string} [arg.searchType] - Search type key
3503
+ * @param {string} [arg.searchValue] - Search type value
3504
+ * @param {string} [arg.fromDate] - Start Date in DD-MM-YYYY format
3505
+ * @param {string} [arg.toDate] - End Date in DD-MM-YYYY format
3506
+ * @param {string} [arg.startDate] - UTC Start Date in ISO format
3507
+ * @param {string} [arg.endDate] - UTC End Date in ISO format
3508
+ * @param {string} [arg.dpIds] - Comma separated values of delivery partner ids
3509
+ * @param {string} [arg.stores] - Comma separated values of store ids
3510
+ * @param {string} [arg.salesChannels] - Comma separated values of sales channel ids
3511
+ * @param {number} [arg.pageSize] - Page size of data received per page
3512
+ * @param {boolean} [arg.fetchActiveShipment] - Flag to fetch active shipments
3513
+ * @param {boolean} [arg.allowInactive] - Flag to allow inactive shipments
3514
+ * @param {boolean} [arg.excludeLockedShipments] - Flag to fetch locked shipments
3515
+ * @param {string} [arg.paymentMethods] - Comma separated values of payment methods
3516
+ * @param {string} [arg.channelShipmentId] - App Shipment Id
3517
+ * @param {string} [arg.channelOrderId] - App Order Id
2128
3518
  * @param {string} [arg.customMeta] -
3519
+ * @param {string} [arg.orderingChannel] -
3520
+ * @param {string} [arg.companyAffiliateTag] -
2129
3521
  * @param {boolean} [arg.myOrders] -
3522
+ * @param {string} [arg.platformUserId] -
3523
+ * @param {string} [arg.sortType] - Sort the result data on basis of input
2130
3524
  * @param {boolean} [arg.showCrossCompanyData] - Flag to view cross &
2131
3525
  * non-cross company order
3526
+ * @param {string} [arg.tags] - Comma separated values of tags
2132
3527
  * @param {string} [arg.customerId] -
2133
3528
  * @param {string} [arg.orderType] -
2134
- * @returns {Paginator<OrderPlatformModel.OrderListingResponse>}
3529
+ * @returns {Paginator<OrderPlatformModel.ShipmentInternalPlatformViewResponse>}
2135
3530
  * @summary:
2136
- * @description: Get Orders Listing
3531
+ * @description: Get Shipments Listing for the company id
2137
3532
  */
2138
- getOrdersPaginator({
3533
+ getShipmentsPaginator({
2139
3534
  lane,
2140
- searchType,
2141
3535
  bagStatus,
3536
+ statusOverrideLane,
2142
3537
  timeToDispatch,
2143
- paymentMethods,
2144
- tags,
3538
+ searchType,
2145
3539
  searchValue,
2146
3540
  fromDate,
2147
3541
  toDate,
3542
+ startDate,
3543
+ endDate,
2148
3544
  dpIds,
2149
3545
  stores,
2150
3546
  salesChannels,
2151
3547
  pageSize,
2152
- isPrioritySort,
3548
+ fetchActiveShipment,
3549
+ allowInactive,
3550
+ excludeLockedShipments,
3551
+ paymentMethods,
3552
+ channelShipmentId,
3553
+ channelOrderId,
2153
3554
  customMeta,
3555
+ orderingChannel,
3556
+ companyAffiliateTag,
2154
3557
  myOrders,
3558
+ platformUserId,
3559
+ sortType,
2155
3560
  showCrossCompanyData,
3561
+ tags,
2156
3562
  customerId,
2157
3563
  orderType,
2158
3564
  } = {}) {
@@ -2161,25 +3567,36 @@ class Order {
2161
3567
  const pageId = paginator.nextId;
2162
3568
  const pageNo = paginator.pageNo;
2163
3569
  const pageType = "number";
2164
- const data = await this.getOrders({
3570
+ const data = await this.getShipments({
2165
3571
  lane: lane,
2166
- searchType: searchType,
2167
3572
  bagStatus: bagStatus,
3573
+ statusOverrideLane: statusOverrideLane,
2168
3574
  timeToDispatch: timeToDispatch,
2169
- paymentMethods: paymentMethods,
2170
- tags: tags,
3575
+ searchType: searchType,
2171
3576
  searchValue: searchValue,
2172
3577
  fromDate: fromDate,
2173
3578
  toDate: toDate,
3579
+ startDate: startDate,
3580
+ endDate: endDate,
2174
3581
  dpIds: dpIds,
2175
3582
  stores: stores,
2176
3583
  salesChannels: salesChannels,
2177
3584
  pageNo: pageNo,
2178
3585
  pageSize: pageSize,
2179
- isPrioritySort: isPrioritySort,
3586
+ fetchActiveShipment: fetchActiveShipment,
3587
+ allowInactive: allowInactive,
3588
+ excludeLockedShipments: excludeLockedShipments,
3589
+ paymentMethods: paymentMethods,
3590
+ channelShipmentId: channelShipmentId,
3591
+ channelOrderId: channelOrderId,
2180
3592
  customMeta: customMeta,
3593
+ orderingChannel: orderingChannel,
3594
+ companyAffiliateTag: companyAffiliateTag,
2181
3595
  myOrders: myOrders,
3596
+ platformUserId: platformUserId,
3597
+ sortType: sortType,
2182
3598
  showCrossCompanyData: showCrossCompanyData,
3599
+ tags: tags,
2183
3600
  customerId: customerId,
2184
3601
  orderType: orderType,
2185
3602
  });
@@ -2194,20 +3611,183 @@ class Order {
2194
3611
  }
2195
3612
 
2196
3613
  /**
2197
- * @param {OrderPlatformValidator.GetRoleBasedActionsParam} arg - Arg object
3614
+ * @param {OrderPlatformValidator.GetStateManagerTaskByIdParam} arg - Arg object
3615
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
3616
+ * @param {import("../PlatformAPIClient").Options} - Options
3617
+ * @returns {Promise<Object>} - Success response
3618
+ * @name getStateManagerTaskById
3619
+ * @summary: Fetch a specific State Transition task
3620
+ * @description: - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/getStateManagerTaskById/).
3621
+ */
3622
+ async getStateManagerTaskById(
3623
+ { taskId, requestHeaders } = { requestHeaders: {} },
3624
+ { responseHeaders } = { responseHeaders: false }
3625
+ ) {
3626
+ const { error } = OrderPlatformValidator.getStateManagerTaskById().validate(
3627
+ {
3628
+ taskId,
3629
+ },
3630
+ { abortEarly: false, allowUnknown: true }
3631
+ );
3632
+ if (error) {
3633
+ return Promise.reject(new FDKClientValidationError(error));
3634
+ }
3635
+
3636
+ // Showing warrnings if extra unknown parameters are found
3637
+ const {
3638
+ error: warrning,
3639
+ } = OrderPlatformValidator.getStateManagerTaskById().validate(
3640
+ {
3641
+ taskId,
3642
+ },
3643
+ { abortEarly: false, allowUnknown: false }
3644
+ );
3645
+ if (warrning) {
3646
+ Logger({
3647
+ level: "WARN",
3648
+ message: `Parameter Validation warrnings for platform > Order > getStateManagerTaskById \n ${warrning}`,
3649
+ });
3650
+ }
3651
+
3652
+ const query_params = {};
3653
+
3654
+ const xHeaders = {};
3655
+
3656
+ const response = await PlatformAPIClient.execute(
3657
+ this.config,
3658
+ "get",
3659
+ `/service/platform/order-manage/v1.0/company/${this.config.companyId}/state/transition/tasks/${taskId}`,
3660
+ query_params,
3661
+ undefined,
3662
+ { ...xHeaders, ...requestHeaders },
3663
+ { responseHeaders }
3664
+ );
3665
+
3666
+ let responseData = response;
3667
+ if (responseHeaders) {
3668
+ responseData = response[0];
3669
+ }
3670
+
3671
+ const { error: res_error } = Joi.any().validate(responseData, {
3672
+ abortEarly: false,
3673
+ allowUnknown: true,
3674
+ });
3675
+
3676
+ if (res_error) {
3677
+ if (this.config.options.strictResponseCheck === true) {
3678
+ return Promise.reject(new FDKResponseValidationError(res_error));
3679
+ } else {
3680
+ Logger({
3681
+ level: "WARN",
3682
+ message: `Response Validation Warnings for platform > Order > getStateManagerTaskById \n ${res_error}`,
3683
+ });
3684
+ }
3685
+ }
3686
+
3687
+ return response;
3688
+ }
3689
+
3690
+ /**
3691
+ * @param {OrderPlatformValidator.GetStateManagerTasksParam} arg - Arg object
3692
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
3693
+ * @param {import("../PlatformAPIClient").Options} - Options
3694
+ * @returns {Promise<Object>} - Success response
3695
+ * @name getStateManagerTasks
3696
+ * @summary: Fetch all State Transition tasks
3697
+ * @description: - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/getStateManagerTasks/).
3698
+ */
3699
+ async getStateManagerTasks(
3700
+ { pageNo, pageSize, requestHeaders } = { requestHeaders: {} },
3701
+ { responseHeaders } = { responseHeaders: false }
3702
+ ) {
3703
+ const { error } = OrderPlatformValidator.getStateManagerTasks().validate(
3704
+ {
3705
+ pageNo,
3706
+ pageSize,
3707
+ },
3708
+ { abortEarly: false, allowUnknown: true }
3709
+ );
3710
+ if (error) {
3711
+ return Promise.reject(new FDKClientValidationError(error));
3712
+ }
3713
+
3714
+ // Showing warrnings if extra unknown parameters are found
3715
+ const {
3716
+ error: warrning,
3717
+ } = OrderPlatformValidator.getStateManagerTasks().validate(
3718
+ {
3719
+ pageNo,
3720
+ pageSize,
3721
+ },
3722
+ { abortEarly: false, allowUnknown: false }
3723
+ );
3724
+ if (warrning) {
3725
+ Logger({
3726
+ level: "WARN",
3727
+ message: `Parameter Validation warrnings for platform > Order > getStateManagerTasks \n ${warrning}`,
3728
+ });
3729
+ }
3730
+
3731
+ const query_params = {};
3732
+ query_params["page_no"] = pageNo;
3733
+ query_params["page_size"] = pageSize;
3734
+
3735
+ const xHeaders = {};
3736
+
3737
+ const response = await PlatformAPIClient.execute(
3738
+ this.config,
3739
+ "get",
3740
+ `/service/platform/order-manage/v1.0/company/${this.config.companyId}/state/transition/tasks`,
3741
+ query_params,
3742
+ undefined,
3743
+ { ...xHeaders, ...requestHeaders },
3744
+ { responseHeaders }
3745
+ );
3746
+
3747
+ let responseData = response;
3748
+ if (responseHeaders) {
3749
+ responseData = response[0];
3750
+ }
3751
+
3752
+ const { error: res_error } = Joi.any().validate(responseData, {
3753
+ abortEarly: false,
3754
+ allowUnknown: true,
3755
+ });
3756
+
3757
+ if (res_error) {
3758
+ if (this.config.options.strictResponseCheck === true) {
3759
+ return Promise.reject(new FDKResponseValidationError(res_error));
3760
+ } else {
3761
+ Logger({
3762
+ level: "WARN",
3763
+ message: `Response Validation Warnings for platform > Order > getStateManagerTasks \n ${res_error}`,
3764
+ });
3765
+ }
3766
+ }
3767
+
3768
+ return response;
3769
+ }
3770
+
3771
+ /**
3772
+ * @param {OrderPlatformValidator.GetStateTransitionFiltersParam} arg - Arg object
2198
3773
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
2199
3774
  * @param {import("../PlatformAPIClient").Options} - Options
2200
- * @returns {Promise<OrderPlatformModel.GetActionsResponse>} - Success response
2201
- * @name getRoleBasedActions
2202
- * @summary:
2203
- * @description: Get Role Based Actions - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/getRoleBasedActions/).
3775
+ * @returns {Promise<Object>} - Success response
3776
+ * @name getStateTransitionFilters
3777
+ * @summary: Fetch all State Transition filters
3778
+ * @description: - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/getStateTransitionFilters/).
2204
3779
  */
2205
- async getRoleBasedActions(
2206
- { requestHeaders } = { requestHeaders: {} },
3780
+ async getStateTransitionFilters(
3781
+ { pageNo, pageSize, requestHeaders } = { requestHeaders: {} },
2207
3782
  { responseHeaders } = { responseHeaders: false }
2208
3783
  ) {
2209
- const { error } = OrderPlatformValidator.getRoleBasedActions().validate(
2210
- {},
3784
+ const {
3785
+ error,
3786
+ } = OrderPlatformValidator.getStateTransitionFilters().validate(
3787
+ {
3788
+ pageNo,
3789
+ pageSize,
3790
+ },
2211
3791
  { abortEarly: false, allowUnknown: true }
2212
3792
  );
2213
3793
  if (error) {
@@ -2217,25 +3797,30 @@ class Order {
2217
3797
  // Showing warrnings if extra unknown parameters are found
2218
3798
  const {
2219
3799
  error: warrning,
2220
- } = OrderPlatformValidator.getRoleBasedActions().validate(
2221
- {},
3800
+ } = OrderPlatformValidator.getStateTransitionFilters().validate(
3801
+ {
3802
+ pageNo,
3803
+ pageSize,
3804
+ },
2222
3805
  { abortEarly: false, allowUnknown: false }
2223
3806
  );
2224
3807
  if (warrning) {
2225
3808
  Logger({
2226
3809
  level: "WARN",
2227
- message: `Parameter Validation warrnings for platform > Order > getRoleBasedActions \n ${warrning}`,
3810
+ message: `Parameter Validation warrnings for platform > Order > getStateTransitionFilters \n ${warrning}`,
2228
3811
  });
2229
3812
  }
2230
3813
 
2231
3814
  const query_params = {};
3815
+ query_params["page_no"] = pageNo;
3816
+ query_params["page_size"] = pageSize;
2232
3817
 
2233
3818
  const xHeaders = {};
2234
3819
 
2235
3820
  const response = await PlatformAPIClient.execute(
2236
3821
  this.config,
2237
3822
  "get",
2238
- `/service/platform/order-manage/v1.0/company/${this.config.companyId}/roles`,
3823
+ `/service/platform/order-manage/v1.0/company/${this.config.companyId}/state/transition/filters`,
2239
3824
  query_params,
2240
3825
  undefined,
2241
3826
  { ...xHeaders, ...requestHeaders },
@@ -2247,9 +3832,7 @@ class Order {
2247
3832
  responseData = response[0];
2248
3833
  }
2249
3834
 
2250
- const {
2251
- error: res_error,
2252
- } = OrderPlatformModel.GetActionsResponse().validate(responseData, {
3835
+ const { error: res_error } = Joi.any().validate(responseData, {
2253
3836
  abortEarly: false,
2254
3837
  allowUnknown: true,
2255
3838
  });
@@ -2260,7 +3843,7 @@ class Order {
2260
3843
  } else {
2261
3844
  Logger({
2262
3845
  level: "WARN",
2263
- message: `Response Validation Warnings for platform > Order > getRoleBasedActions \n ${res_error}`,
3846
+ message: `Response Validation Warnings for platform > Order > getStateTransitionFilters \n ${res_error}`,
2264
3847
  });
2265
3848
  }
2266
3849
  }
@@ -2269,22 +3852,23 @@ class Order {
2269
3852
  }
2270
3853
 
2271
3854
  /**
2272
- * @param {OrderPlatformValidator.GetShipmentByIdParam} arg - Arg object
3855
+ * @param {OrderPlatformValidator.GetStateTransitionFiltersByIdParam} arg - Arg object
2273
3856
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
2274
3857
  * @param {import("../PlatformAPIClient").Options} - Options
2275
- * @returns {Promise<OrderPlatformModel.ShipmentInfoResponse>} - Success response
2276
- * @name getShipmentById
2277
- * @summary:
2278
- * @description: Get shipment details for the given shipment. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/getShipmentById/).
3858
+ * @returns {Promise<Object>} - Success response
3859
+ * @name getStateTransitionFiltersById
3860
+ * @summary: Fetch a specific State Transition filter
3861
+ * @description: - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/getStateTransitionFiltersById/).
2279
3862
  */
2280
- async getShipmentById(
2281
- { channelShipmentId, shipmentId, requestHeaders } = { requestHeaders: {} },
3863
+ async getStateTransitionFiltersById(
3864
+ { filterId, requestHeaders } = { requestHeaders: {} },
2282
3865
  { responseHeaders } = { responseHeaders: false }
2283
3866
  ) {
2284
- const { error } = OrderPlatformValidator.getShipmentById().validate(
3867
+ const {
3868
+ error,
3869
+ } = OrderPlatformValidator.getStateTransitionFiltersById().validate(
2285
3870
  {
2286
- channelShipmentId,
2287
- shipmentId,
3871
+ filterId,
2288
3872
  },
2289
3873
  { abortEarly: false, allowUnknown: true }
2290
3874
  );
@@ -2295,30 +3879,27 @@ class Order {
2295
3879
  // Showing warrnings if extra unknown parameters are found
2296
3880
  const {
2297
3881
  error: warrning,
2298
- } = OrderPlatformValidator.getShipmentById().validate(
3882
+ } = OrderPlatformValidator.getStateTransitionFiltersById().validate(
2299
3883
  {
2300
- channelShipmentId,
2301
- shipmentId,
3884
+ filterId,
2302
3885
  },
2303
3886
  { abortEarly: false, allowUnknown: false }
2304
3887
  );
2305
3888
  if (warrning) {
2306
3889
  Logger({
2307
3890
  level: "WARN",
2308
- message: `Parameter Validation warrnings for platform > Order > getShipmentById \n ${warrning}`,
3891
+ message: `Parameter Validation warrnings for platform > Order > getStateTransitionFiltersById \n ${warrning}`,
2309
3892
  });
2310
3893
  }
2311
3894
 
2312
3895
  const query_params = {};
2313
- query_params["channel_shipment_id"] = channelShipmentId;
2314
- query_params["shipment_id"] = shipmentId;
2315
3896
 
2316
3897
  const xHeaders = {};
2317
3898
 
2318
3899
  const response = await PlatformAPIClient.execute(
2319
3900
  this.config,
2320
3901
  "get",
2321
- `/service/platform/order/v1.0/company/${this.config.companyId}/shipment-details`,
3902
+ `/service/platform/order-manage/v1.0/company/${this.config.companyId}/state/transition/filters/${filterId}`,
2322
3903
  query_params,
2323
3904
  undefined,
2324
3905
  { ...xHeaders, ...requestHeaders },
@@ -2330,9 +3911,7 @@ class Order {
2330
3911
  responseData = response[0];
2331
3912
  }
2332
3913
 
2333
- const {
2334
- error: res_error,
2335
- } = OrderPlatformModel.ShipmentInfoResponse().validate(responseData, {
3914
+ const { error: res_error } = Joi.any().validate(responseData, {
2336
3915
  abortEarly: false,
2337
3916
  allowUnknown: true,
2338
3917
  });
@@ -2343,7 +3922,7 @@ class Order {
2343
3922
  } else {
2344
3923
  Logger({
2345
3924
  level: "WARN",
2346
- message: `Response Validation Warnings for platform > Order > getShipmentById \n ${res_error}`,
3925
+ message: `Response Validation Warnings for platform > Order > getStateTransitionFiltersById \n ${res_error}`,
2347
3926
  });
2348
3927
  }
2349
3928
  }
@@ -2352,22 +3931,22 @@ class Order {
2352
3931
  }
2353
3932
 
2354
3933
  /**
2355
- * @param {OrderPlatformValidator.GetShipmentHistoryParam} arg - Arg object
3934
+ * @param {OrderPlatformValidator.GetStateTransitionFlagsParam} arg - Arg object
2356
3935
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
2357
3936
  * @param {import("../PlatformAPIClient").Options} - Options
2358
- * @returns {Promise<OrderPlatformModel.ShipmentHistoryResponse>} - Success response
2359
- * @name getShipmentHistory
3937
+ * @returns {Promise<Object>} - Success response
3938
+ * @name getStateTransitionFlags
2360
3939
  * @summary:
2361
- * @description: Get Shipment History - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/getShipmentHistory/).
3940
+ * @description: Fetch all state transition flags for a company. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/getStateTransitionFlags/).
2362
3941
  */
2363
- async getShipmentHistory(
2364
- { shipmentId, bagId, requestHeaders } = { requestHeaders: {} },
3942
+ async getStateTransitionFlags(
3943
+ { pageNo, pageSize, requestHeaders } = { requestHeaders: {} },
2365
3944
  { responseHeaders } = { responseHeaders: false }
2366
3945
  ) {
2367
- const { error } = OrderPlatformValidator.getShipmentHistory().validate(
3946
+ const { error } = OrderPlatformValidator.getStateTransitionFlags().validate(
2368
3947
  {
2369
- shipmentId,
2370
- bagId,
3948
+ pageNo,
3949
+ pageSize,
2371
3950
  },
2372
3951
  { abortEarly: false, allowUnknown: true }
2373
3952
  );
@@ -2378,30 +3957,30 @@ class Order {
2378
3957
  // Showing warrnings if extra unknown parameters are found
2379
3958
  const {
2380
3959
  error: warrning,
2381
- } = OrderPlatformValidator.getShipmentHistory().validate(
3960
+ } = OrderPlatformValidator.getStateTransitionFlags().validate(
2382
3961
  {
2383
- shipmentId,
2384
- bagId,
3962
+ pageNo,
3963
+ pageSize,
2385
3964
  },
2386
3965
  { abortEarly: false, allowUnknown: false }
2387
3966
  );
2388
3967
  if (warrning) {
2389
3968
  Logger({
2390
3969
  level: "WARN",
2391
- message: `Parameter Validation warrnings for platform > Order > getShipmentHistory \n ${warrning}`,
3970
+ message: `Parameter Validation warrnings for platform > Order > getStateTransitionFlags \n ${warrning}`,
2392
3971
  });
2393
3972
  }
2394
3973
 
2395
3974
  const query_params = {};
2396
- query_params["shipment_id"] = shipmentId;
2397
- query_params["bag_id"] = bagId;
3975
+ query_params["page_no"] = pageNo;
3976
+ query_params["page_size"] = pageSize;
2398
3977
 
2399
3978
  const xHeaders = {};
2400
3979
 
2401
3980
  const response = await PlatformAPIClient.execute(
2402
3981
  this.config,
2403
3982
  "get",
2404
- `/service/platform/order-manage/v1.0/company/${this.config.companyId}/shipment/history`,
3983
+ `/service/platform/order-manage/v1.0/company/${this.config.companyId}/state/transition/flags`,
2405
3984
  query_params,
2406
3985
  undefined,
2407
3986
  { ...xHeaders, ...requestHeaders },
@@ -2413,9 +3992,7 @@ class Order {
2413
3992
  responseData = response[0];
2414
3993
  }
2415
3994
 
2416
- const {
2417
- error: res_error,
2418
- } = OrderPlatformModel.ShipmentHistoryResponse().validate(responseData, {
3995
+ const { error: res_error } = Joi.any().validate(responseData, {
2419
3996
  abortEarly: false,
2420
3997
  allowUnknown: true,
2421
3998
  });
@@ -2426,7 +4003,7 @@ class Order {
2426
4003
  } else {
2427
4004
  Logger({
2428
4005
  level: "WARN",
2429
- message: `Response Validation Warnings for platform > Order > getShipmentHistory \n ${res_error}`,
4006
+ message: `Response Validation Warnings for platform > Order > getStateTransitionFlags \n ${res_error}`,
2430
4007
  });
2431
4008
  }
2432
4009
  }
@@ -2435,24 +4012,23 @@ class Order {
2435
4012
  }
2436
4013
 
2437
4014
  /**
2438
- * @param {OrderPlatformValidator.GetShipmentReasonsParam} arg - Arg object
4015
+ * @param {OrderPlatformValidator.GetStateTransitionFlagsByIdParam} arg - Arg object
2439
4016
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
2440
4017
  * @param {import("../PlatformAPIClient").Options} - Options
2441
- * @returns {Promise<OrderPlatformModel.PlatformShipmentReasonsResponse>} -
2442
- * Success response
2443
- * @name getShipmentReasons
2444
- * @summary: Get reasons behind full or partial cancellation of a shipment
2445
- * @description: Use this API to retrieve the issues that led to the cancellation of bags within a shipment. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/getShipmentReasons/).
4018
+ * @returns {Promise<Object>} - Success response
4019
+ * @name getStateTransitionFlagsById
4020
+ * @summary:
4021
+ * @description: Fetch a specific state transition flag for a company. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/getStateTransitionFlagsById/).
2446
4022
  */
2447
- async getShipmentReasons(
2448
- { shipmentId, bagId, state, requestHeaders } = { requestHeaders: {} },
4023
+ async getStateTransitionFlagsById(
4024
+ { flagId, requestHeaders } = { requestHeaders: {} },
2449
4025
  { responseHeaders } = { responseHeaders: false }
2450
4026
  ) {
2451
- const { error } = OrderPlatformValidator.getShipmentReasons().validate(
4027
+ const {
4028
+ error,
4029
+ } = OrderPlatformValidator.getStateTransitionFlagsById().validate(
2452
4030
  {
2453
- shipmentId,
2454
- bagId,
2455
- state,
4031
+ flagId,
2456
4032
  },
2457
4033
  { abortEarly: false, allowUnknown: true }
2458
4034
  );
@@ -2463,18 +4039,16 @@ class Order {
2463
4039
  // Showing warrnings if extra unknown parameters are found
2464
4040
  const {
2465
4041
  error: warrning,
2466
- } = OrderPlatformValidator.getShipmentReasons().validate(
4042
+ } = OrderPlatformValidator.getStateTransitionFlagsById().validate(
2467
4043
  {
2468
- shipmentId,
2469
- bagId,
2470
- state,
4044
+ flagId,
2471
4045
  },
2472
4046
  { abortEarly: false, allowUnknown: false }
2473
4047
  );
2474
4048
  if (warrning) {
2475
4049
  Logger({
2476
4050
  level: "WARN",
2477
- message: `Parameter Validation warrnings for platform > Order > getShipmentReasons \n ${warrning}`,
4051
+ message: `Parameter Validation warrnings for platform > Order > getStateTransitionFlagsById \n ${warrning}`,
2478
4052
  });
2479
4053
  }
2480
4054
 
@@ -2485,7 +4059,7 @@ class Order {
2485
4059
  const response = await PlatformAPIClient.execute(
2486
4060
  this.config,
2487
4061
  "get",
2488
- `/service/platform/order/v1.0/company/${this.config.companyId}/shipments/${shipmentId}/bags/${bagId}/state/${state}/reasons`,
4062
+ `/service/platform/order-manage/v1.0/company/${this.config.companyId}/state/transition/flags/${flagId}`,
2489
4063
  query_params,
2490
4064
  undefined,
2491
4065
  { ...xHeaders, ...requestHeaders },
@@ -2497,12 +4071,10 @@ class Order {
2497
4071
  responseData = response[0];
2498
4072
  }
2499
4073
 
2500
- const {
2501
- error: res_error,
2502
- } = OrderPlatformModel.PlatformShipmentReasonsResponse().validate(
2503
- responseData,
2504
- { abortEarly: false, allowUnknown: true }
2505
- );
4074
+ const { error: res_error } = Joi.any().validate(responseData, {
4075
+ abortEarly: false,
4076
+ allowUnknown: true,
4077
+ });
2506
4078
 
2507
4079
  if (res_error) {
2508
4080
  if (this.config.options.strictResponseCheck === true) {
@@ -2510,7 +4082,7 @@ class Order {
2510
4082
  } else {
2511
4083
  Logger({
2512
4084
  level: "WARN",
2513
- message: `Response Validation Warnings for platform > Order > getShipmentReasons \n ${res_error}`,
4085
+ message: `Response Validation Warnings for platform > Order > getStateTransitionFlagsById \n ${res_error}`,
2514
4086
  });
2515
4087
  }
2516
4088
  }
@@ -2519,168 +4091,48 @@ class Order {
2519
4091
  }
2520
4092
 
2521
4093
  /**
2522
- * @param {OrderPlatformValidator.GetShipmentsParam} arg - Arg object
4094
+ * @param {OrderPlatformValidator.GetStateTransitionMapParam} arg - Arg object
2523
4095
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
2524
4096
  * @param {import("../PlatformAPIClient").Options} - Options
2525
- * @returns {Promise<OrderPlatformModel.ShipmentInternalPlatformViewResponse>}
2526
- * - Success response
2527
- *
2528
- * @name getShipments
4097
+ * @returns {Promise<OrderPlatformModel.BagStateTransitionMap>} - Success response
4098
+ * @name getStateTransitionMap
2529
4099
  * @summary:
2530
- * @description: Get Shipments Listing for the company id - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/getShipments/).
4100
+ * @description: Get State Transition Map - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/getStateTransitionMap/).
2531
4101
  */
2532
- async getShipments(
2533
- {
2534
- lane,
2535
- bagStatus,
2536
- statusOverrideLane,
2537
- timeToDispatch,
2538
- searchType,
2539
- searchValue,
2540
- fromDate,
2541
- toDate,
2542
- dpIds,
2543
- stores,
2544
- salesChannels,
2545
- pageNo,
2546
- pageSize,
2547
- fetchActiveShipment,
2548
- allowInactive,
2549
- excludeLockedShipments,
2550
- paymentMethods,
2551
- channelShipmentId,
2552
- channelOrderId,
2553
- customMeta,
2554
- orderingChannel,
2555
- companyAffiliateTag,
2556
- myOrders,
2557
- platformUserId,
2558
- sortType,
2559
- showCrossCompanyData,
2560
- tags,
2561
- customerId,
2562
- orderType,
2563
- requestHeaders,
2564
- } = { requestHeaders: {} },
4102
+ async getStateTransitionMap(
4103
+ { requestHeaders } = { requestHeaders: {} },
2565
4104
  { responseHeaders } = { responseHeaders: false }
2566
4105
  ) {
2567
- const { error } = OrderPlatformValidator.getShipments().validate(
2568
- {
2569
- lane,
2570
- bagStatus,
2571
- statusOverrideLane,
2572
- timeToDispatch,
2573
- searchType,
2574
- searchValue,
2575
- fromDate,
2576
- toDate,
2577
- dpIds,
2578
- stores,
2579
- salesChannels,
2580
- pageNo,
2581
- pageSize,
2582
- fetchActiveShipment,
2583
- allowInactive,
2584
- excludeLockedShipments,
2585
- paymentMethods,
2586
- channelShipmentId,
2587
- channelOrderId,
2588
- customMeta,
2589
- orderingChannel,
2590
- companyAffiliateTag,
2591
- myOrders,
2592
- platformUserId,
2593
- sortType,
2594
- showCrossCompanyData,
2595
- tags,
2596
- customerId,
2597
- orderType,
2598
- },
4106
+ const { error } = OrderPlatformValidator.getStateTransitionMap().validate(
4107
+ {},
2599
4108
  { abortEarly: false, allowUnknown: true }
2600
4109
  );
2601
4110
  if (error) {
2602
4111
  return Promise.reject(new FDKClientValidationError(error));
2603
4112
  }
2604
4113
 
2605
- // Showing warrnings if extra unknown parameters are found
2606
- const { error: warrning } = OrderPlatformValidator.getShipments().validate(
2607
- {
2608
- lane,
2609
- bagStatus,
2610
- statusOverrideLane,
2611
- timeToDispatch,
2612
- searchType,
2613
- searchValue,
2614
- fromDate,
2615
- toDate,
2616
- dpIds,
2617
- stores,
2618
- salesChannels,
2619
- pageNo,
2620
- pageSize,
2621
- fetchActiveShipment,
2622
- allowInactive,
2623
- excludeLockedShipments,
2624
- paymentMethods,
2625
- channelShipmentId,
2626
- channelOrderId,
2627
- customMeta,
2628
- orderingChannel,
2629
- companyAffiliateTag,
2630
- myOrders,
2631
- platformUserId,
2632
- sortType,
2633
- showCrossCompanyData,
2634
- tags,
2635
- customerId,
2636
- orderType,
2637
- },
4114
+ // Showing warrnings if extra unknown parameters are found
4115
+ const {
4116
+ error: warrning,
4117
+ } = OrderPlatformValidator.getStateTransitionMap().validate(
4118
+ {},
2638
4119
  { abortEarly: false, allowUnknown: false }
2639
4120
  );
2640
4121
  if (warrning) {
2641
4122
  Logger({
2642
4123
  level: "WARN",
2643
- message: `Parameter Validation warrnings for platform > Order > getShipments \n ${warrning}`,
4124
+ message: `Parameter Validation warrnings for platform > Order > getStateTransitionMap \n ${warrning}`,
2644
4125
  });
2645
4126
  }
2646
4127
 
2647
4128
  const query_params = {};
2648
- query_params["lane"] = lane;
2649
- query_params["bag_status"] = bagStatus;
2650
- query_params["status_override_lane"] = statusOverrideLane;
2651
- query_params["time_to_dispatch"] = timeToDispatch;
2652
- query_params["search_type"] = searchType;
2653
- query_params["search_value"] = searchValue;
2654
- query_params["from_date"] = fromDate;
2655
- query_params["to_date"] = toDate;
2656
- query_params["dp_ids"] = dpIds;
2657
- query_params["stores"] = stores;
2658
- query_params["sales_channels"] = salesChannels;
2659
- query_params["page_no"] = pageNo;
2660
- query_params["page_size"] = pageSize;
2661
- query_params["fetch_active_shipment"] = fetchActiveShipment;
2662
- query_params["allow_inactive"] = allowInactive;
2663
- query_params["exclude_locked_shipments"] = excludeLockedShipments;
2664
- query_params["payment_methods"] = paymentMethods;
2665
- query_params["channel_shipment_id"] = channelShipmentId;
2666
- query_params["channel_order_id"] = channelOrderId;
2667
- query_params["custom_meta"] = customMeta;
2668
- query_params["ordering_channel"] = orderingChannel;
2669
- query_params["company_affiliate_tag"] = companyAffiliateTag;
2670
- query_params["my_orders"] = myOrders;
2671
- query_params["platform_user_id"] = platformUserId;
2672
- query_params["sort_type"] = sortType;
2673
- query_params["show_cross_company_data"] = showCrossCompanyData;
2674
- query_params["tags"] = tags;
2675
- query_params["customer_id"] = customerId;
2676
- query_params["order_type"] = orderType;
2677
4129
 
2678
4130
  const xHeaders = {};
2679
4131
 
2680
4132
  const response = await PlatformAPIClient.execute(
2681
4133
  this.config,
2682
4134
  "get",
2683
- `/service/platform/order/v1.0/company/${this.config.companyId}/shipments-listing`,
4135
+ `/service/platform/order-manage/v1.0/company/${this.config.companyId}/bag/state/transition`,
2684
4136
  query_params,
2685
4137
  undefined,
2686
4138
  { ...xHeaders, ...requestHeaders },
@@ -2694,10 +4146,10 @@ class Order {
2694
4146
 
2695
4147
  const {
2696
4148
  error: res_error,
2697
- } = OrderPlatformModel.ShipmentInternalPlatformViewResponse().validate(
2698
- responseData,
2699
- { abortEarly: false, allowUnknown: true }
2700
- );
4149
+ } = OrderPlatformModel.BagStateTransitionMap().validate(responseData, {
4150
+ abortEarly: false,
4151
+ allowUnknown: true,
4152
+ });
2701
4153
 
2702
4154
  if (res_error) {
2703
4155
  if (this.config.options.strictResponseCheck === true) {
@@ -2705,7 +4157,7 @@ class Order {
2705
4157
  } else {
2706
4158
  Logger({
2707
4159
  level: "WARN",
2708
- message: `Response Validation Warnings for platform > Order > getShipments \n ${res_error}`,
4160
+ message: `Response Validation Warnings for platform > Order > getStateTransitionMap \n ${res_error}`,
2709
4161
  });
2710
4162
  }
2711
4163
  }
@@ -2714,132 +4166,22 @@ class Order {
2714
4166
  }
2715
4167
 
2716
4168
  /**
2717
- * @param {Object} arg - Arg object.
2718
- * @param {string} [arg.lane] - Name of lane for which data is to be fetched
2719
- * @param {string} [arg.bagStatus] - Comma separated values of bag statuses
2720
- * @param {boolean} [arg.statusOverrideLane] - Use this flag to fetch by
2721
- * bag_status and override lane
2722
- * @param {number} [arg.timeToDispatch] -
2723
- * @param {string} [arg.searchType] - Search type key
2724
- * @param {string} [arg.searchValue] - Search type value
2725
- * @param {string} [arg.fromDate] - Start Date in DD-MM-YYYY format
2726
- * @param {string} [arg.toDate] - End Date in DD-MM-YYYY format
2727
- * @param {string} [arg.dpIds] - Comma separated values of delivery partner ids
2728
- * @param {string} [arg.stores] - Comma separated values of store ids
2729
- * @param {string} [arg.salesChannels] - Comma separated values of sales channel ids
2730
- * @param {number} [arg.pageSize] - Page size of data received per page
2731
- * @param {boolean} [arg.fetchActiveShipment] - Flag to fetch active shipments
2732
- * @param {boolean} [arg.allowInactive] - Flag to allow inactive shipments
2733
- * @param {boolean} [arg.excludeLockedShipments] - Flag to fetch locked shipments
2734
- * @param {string} [arg.paymentMethods] - Comma separated values of payment methods
2735
- * @param {string} [arg.channelShipmentId] - App Shipment Id
2736
- * @param {string} [arg.channelOrderId] - App Order Id
2737
- * @param {string} [arg.customMeta] -
2738
- * @param {string} [arg.orderingChannel] -
2739
- * @param {string} [arg.companyAffiliateTag] -
2740
- * @param {boolean} [arg.myOrders] -
2741
- * @param {string} [arg.platformUserId] -
2742
- * @param {string} [arg.sortType] - Sort the result data on basis of input
2743
- * @param {boolean} [arg.showCrossCompanyData] - Flag to view cross &
2744
- * non-cross company order
2745
- * @param {string} [arg.tags] - Comma separated values of tags
2746
- * @param {string} [arg.customerId] -
2747
- * @param {string} [arg.orderType] -
2748
- * @returns {Paginator<OrderPlatformModel.ShipmentInternalPlatformViewResponse>}
2749
- * @summary:
2750
- * @description: Get Shipments Listing for the company id
2751
- */
2752
- getShipmentsPaginator({
2753
- lane,
2754
- bagStatus,
2755
- statusOverrideLane,
2756
- timeToDispatch,
2757
- searchType,
2758
- searchValue,
2759
- fromDate,
2760
- toDate,
2761
- dpIds,
2762
- stores,
2763
- salesChannels,
2764
- pageSize,
2765
- fetchActiveShipment,
2766
- allowInactive,
2767
- excludeLockedShipments,
2768
- paymentMethods,
2769
- channelShipmentId,
2770
- channelOrderId,
2771
- customMeta,
2772
- orderingChannel,
2773
- companyAffiliateTag,
2774
- myOrders,
2775
- platformUserId,
2776
- sortType,
2777
- showCrossCompanyData,
2778
- tags,
2779
- customerId,
2780
- orderType,
2781
- } = {}) {
2782
- const paginator = new Paginator();
2783
- const callback = async () => {
2784
- const pageId = paginator.nextId;
2785
- const pageNo = paginator.pageNo;
2786
- const pageType = "number";
2787
- const data = await this.getShipments({
2788
- lane: lane,
2789
- bagStatus: bagStatus,
2790
- statusOverrideLane: statusOverrideLane,
2791
- timeToDispatch: timeToDispatch,
2792
- searchType: searchType,
2793
- searchValue: searchValue,
2794
- fromDate: fromDate,
2795
- toDate: toDate,
2796
- dpIds: dpIds,
2797
- stores: stores,
2798
- salesChannels: salesChannels,
2799
- pageNo: pageNo,
2800
- pageSize: pageSize,
2801
- fetchActiveShipment: fetchActiveShipment,
2802
- allowInactive: allowInactive,
2803
- excludeLockedShipments: excludeLockedShipments,
2804
- paymentMethods: paymentMethods,
2805
- channelShipmentId: channelShipmentId,
2806
- channelOrderId: channelOrderId,
2807
- customMeta: customMeta,
2808
- orderingChannel: orderingChannel,
2809
- companyAffiliateTag: companyAffiliateTag,
2810
- myOrders: myOrders,
2811
- platformUserId: platformUserId,
2812
- sortType: sortType,
2813
- showCrossCompanyData: showCrossCompanyData,
2814
- tags: tags,
2815
- customerId: customerId,
2816
- orderType: orderType,
2817
- });
2818
- paginator.setPaginator({
2819
- hasNext: data.page.has_next ? true : false,
2820
- nextId: data.page.next_id,
2821
- });
2822
- return data;
2823
- };
2824
- paginator.setCallback(callback.bind(this));
2825
- return paginator;
2826
- }
2827
-
2828
- /**
2829
- * @param {OrderPlatformValidator.GetStateTransitionMapParam} arg - Arg object
4169
+ * @param {OrderPlatformValidator.GetTemplateParam} arg - Arg object
2830
4170
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
2831
4171
  * @param {import("../PlatformAPIClient").Options} - Options
2832
- * @returns {Promise<OrderPlatformModel.BagStateTransitionMap>} - Success response
2833
- * @name getStateTransitionMap
4172
+ * @returns {Promise<OrderPlatformModel.TemplateDownloadResponse>} - Success response
4173
+ * @name getTemplate
2834
4174
  * @summary:
2835
- * @description: Get State Transition Map - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/getStateTransitionMap/).
4175
+ * @description: Get the Excel file URL for the Template. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/getTemplate/).
2836
4176
  */
2837
- async getStateTransitionMap(
2838
- { requestHeaders } = { requestHeaders: {} },
4177
+ async getTemplate(
4178
+ { templateName, requestHeaders } = { requestHeaders: {} },
2839
4179
  { responseHeaders } = { responseHeaders: false }
2840
4180
  ) {
2841
- const { error } = OrderPlatformValidator.getStateTransitionMap().validate(
2842
- {},
4181
+ const { error } = OrderPlatformValidator.getTemplate().validate(
4182
+ {
4183
+ templateName,
4184
+ },
2843
4185
  { abortEarly: false, allowUnknown: true }
2844
4186
  );
2845
4187
  if (error) {
@@ -2847,16 +4189,16 @@ class Order {
2847
4189
  }
2848
4190
 
2849
4191
  // Showing warrnings if extra unknown parameters are found
2850
- const {
2851
- error: warrning,
2852
- } = OrderPlatformValidator.getStateTransitionMap().validate(
2853
- {},
4192
+ const { error: warrning } = OrderPlatformValidator.getTemplate().validate(
4193
+ {
4194
+ templateName,
4195
+ },
2854
4196
  { abortEarly: false, allowUnknown: false }
2855
4197
  );
2856
4198
  if (warrning) {
2857
4199
  Logger({
2858
4200
  level: "WARN",
2859
- message: `Parameter Validation warrnings for platform > Order > getStateTransitionMap \n ${warrning}`,
4201
+ message: `Parameter Validation warrnings for platform > Order > getTemplate \n ${warrning}`,
2860
4202
  });
2861
4203
  }
2862
4204
 
@@ -2867,7 +4209,7 @@ class Order {
2867
4209
  const response = await PlatformAPIClient.execute(
2868
4210
  this.config,
2869
4211
  "get",
2870
- `/service/platform/order-manage/v1.0/company/${this.config.companyId}/bag/state/transition`,
4212
+ `/service/platform/order/v1.0/company/${this.config.companyId}/jobs/templates/${templateName}`,
2871
4213
  query_params,
2872
4214
  undefined,
2873
4215
  { ...xHeaders, ...requestHeaders },
@@ -2881,7 +4223,7 @@ class Order {
2881
4223
 
2882
4224
  const {
2883
4225
  error: res_error,
2884
- } = OrderPlatformModel.BagStateTransitionMap().validate(responseData, {
4226
+ } = OrderPlatformModel.TemplateDownloadResponse().validate(responseData, {
2885
4227
  abortEarly: false,
2886
4228
  allowUnknown: true,
2887
4229
  });
@@ -2892,7 +4234,7 @@ class Order {
2892
4234
  } else {
2893
4235
  Logger({
2894
4236
  level: "WARN",
2895
- message: `Response Validation Warnings for platform > Order > getStateTransitionMap \n ${res_error}`,
4237
+ message: `Response Validation Warnings for platform > Order > getTemplate \n ${res_error}`,
2896
4238
  });
2897
4239
  }
2898
4240
  }
@@ -3061,6 +4403,83 @@ class Order {
3061
4403
  return response;
3062
4404
  }
3063
4405
 
4406
+ /**
4407
+ * @param {OrderPlatformValidator.JobDetailsParam} arg - Arg object
4408
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
4409
+ * @param {import("../PlatformAPIClient").Options} - Options
4410
+ * @returns {Promise<OrderPlatformModel.JobDetailsResponse>} - Success response
4411
+ * @name jobDetails
4412
+ * @summary:
4413
+ * @description: Fetches details for the job of the provided batch_id - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/jobDetails/).
4414
+ */
4415
+ async jobDetails(
4416
+ { batchId, requestHeaders } = { requestHeaders: {} },
4417
+ { responseHeaders } = { responseHeaders: false }
4418
+ ) {
4419
+ const { error } = OrderPlatformValidator.jobDetails().validate(
4420
+ {
4421
+ batchId,
4422
+ },
4423
+ { abortEarly: false, allowUnknown: true }
4424
+ );
4425
+ if (error) {
4426
+ return Promise.reject(new FDKClientValidationError(error));
4427
+ }
4428
+
4429
+ // Showing warrnings if extra unknown parameters are found
4430
+ const { error: warrning } = OrderPlatformValidator.jobDetails().validate(
4431
+ {
4432
+ batchId,
4433
+ },
4434
+ { abortEarly: false, allowUnknown: false }
4435
+ );
4436
+ if (warrning) {
4437
+ Logger({
4438
+ level: "WARN",
4439
+ message: `Parameter Validation warrnings for platform > Order > jobDetails \n ${warrning}`,
4440
+ });
4441
+ }
4442
+
4443
+ const query_params = {};
4444
+
4445
+ const xHeaders = {};
4446
+
4447
+ const response = await PlatformAPIClient.execute(
4448
+ this.config,
4449
+ "get",
4450
+ `/service/platform/order-manage/v1.0/company/${this.config.companyId}/jobs/${batchId}`,
4451
+ query_params,
4452
+ undefined,
4453
+ { ...xHeaders, ...requestHeaders },
4454
+ { responseHeaders }
4455
+ );
4456
+
4457
+ let responseData = response;
4458
+ if (responseHeaders) {
4459
+ responseData = response[0];
4460
+ }
4461
+
4462
+ const {
4463
+ error: res_error,
4464
+ } = OrderPlatformModel.JobDetailsResponse().validate(responseData, {
4465
+ abortEarly: false,
4466
+ allowUnknown: true,
4467
+ });
4468
+
4469
+ if (res_error) {
4470
+ if (this.config.options.strictResponseCheck === true) {
4471
+ return Promise.reject(new FDKResponseValidationError(res_error));
4472
+ } else {
4473
+ Logger({
4474
+ level: "WARN",
4475
+ message: `Response Validation Warnings for platform > Order > jobDetails \n ${res_error}`,
4476
+ });
4477
+ }
4478
+ }
4479
+
4480
+ return response;
4481
+ }
4482
+
3064
4483
  /**
3065
4484
  * @param {OrderPlatformValidator.OrderUpdateParam} arg - Arg object
3066
4485
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
@@ -3218,19 +4637,20 @@ class Order {
3218
4637
  }
3219
4638
 
3220
4639
  /**
3221
- * @param {OrderPlatformValidator.ProcessManifestParam} arg - Arg object
4640
+ * @param {OrderPlatformValidator.ProcessManifestsParam} arg - Arg object
3222
4641
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
3223
4642
  * @param {import("../PlatformAPIClient").Options} - Options
3224
- * @returns {Promise<OrderPlatformModel.CreateOrderResponse>} - Success response
3225
- * @name processManifest
4643
+ * @returns {Promise<OrderPlatformModel.ProcessManifestItemResponse>} -
4644
+ * Success response
4645
+ * @name processManifests
3226
4646
  * @summary:
3227
- * @description: Process Manifest - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/processManifest/).
4647
+ * @description: Process Manifest. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/processManifests/).
3228
4648
  */
3229
- async processManifest(
4649
+ async processManifests(
3230
4650
  { body, requestHeaders } = { requestHeaders: {} },
3231
4651
  { responseHeaders } = { responseHeaders: false }
3232
4652
  ) {
3233
- const { error } = OrderPlatformValidator.processManifest().validate(
4653
+ const { error } = OrderPlatformValidator.processManifests().validate(
3234
4654
  {
3235
4655
  body,
3236
4656
  },
@@ -3243,7 +4663,7 @@ class Order {
3243
4663
  // Showing warrnings if extra unknown parameters are found
3244
4664
  const {
3245
4665
  error: warrning,
3246
- } = OrderPlatformValidator.processManifest().validate(
4666
+ } = OrderPlatformValidator.processManifests().validate(
3247
4667
  {
3248
4668
  body,
3249
4669
  },
@@ -3252,7 +4672,7 @@ class Order {
3252
4672
  if (warrning) {
3253
4673
  Logger({
3254
4674
  level: "WARN",
3255
- message: `Parameter Validation warrnings for platform > Order > processManifest \n ${warrning}`,
4675
+ message: `Parameter Validation warrnings for platform > Order > processManifests \n ${warrning}`,
3256
4676
  });
3257
4677
  }
3258
4678
 
@@ -3263,7 +4683,7 @@ class Order {
3263
4683
  const response = await PlatformAPIClient.execute(
3264
4684
  this.config,
3265
4685
  "post",
3266
- `/service/platform/order-manage/v1.0/company/${this.config.companyId}/process-manifest`,
4686
+ `/service/platform/order-manage/v1.0/company/${this.config.companyId}/manifests`,
3267
4687
  query_params,
3268
4688
  body,
3269
4689
  { ...xHeaders, ...requestHeaders },
@@ -3277,10 +4697,10 @@ class Order {
3277
4697
 
3278
4698
  const {
3279
4699
  error: res_error,
3280
- } = OrderPlatformModel.CreateOrderResponse().validate(responseData, {
3281
- abortEarly: false,
3282
- allowUnknown: true,
3283
- });
4700
+ } = OrderPlatformModel.ProcessManifestItemResponse().validate(
4701
+ responseData,
4702
+ { abortEarly: false, allowUnknown: true }
4703
+ );
3284
4704
 
3285
4705
  if (res_error) {
3286
4706
  if (this.config.options.strictResponseCheck === true) {
@@ -3288,7 +4708,7 @@ class Order {
3288
4708
  } else {
3289
4709
  Logger({
3290
4710
  level: "WARN",
3291
- message: `Response Validation Warnings for platform > Order > processManifest \n ${res_error}`,
4711
+ message: `Response Validation Warnings for platform > Order > processManifests \n ${res_error}`,
3292
4712
  });
3293
4713
  }
3294
4714
  }
@@ -3538,7 +4958,7 @@ class Order {
3538
4958
  * @returns {Promise<OrderPlatformModel.CourierPartnerTrackingResponse>} -
3539
4959
  * Success response
3540
4960
  * @name trackShipment
3541
- * @summary: Get courier partner tracking details
4961
+ * @summary:
3542
4962
  * @description: This endpoint allows users to get courier partner tracking details for a given shipment id or awb no. The service will fetch courier partner statuses that are pushed to oms. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/trackShipment/).
3543
4963
  */
3544
4964
  async trackShipment(
@@ -4073,20 +5493,21 @@ class Order {
4073
5493
  }
4074
5494
 
4075
5495
  /**
4076
- * @param {OrderPlatformValidator.UploadConsentParam} arg - Arg object
5496
+ * @param {OrderPlatformValidator.UploadConsentsParam} arg - Arg object
4077
5497
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
4078
5498
  * @param {import("../PlatformAPIClient").Options} - Options
4079
5499
  * @returns {Promise<OrderPlatformModel.SuccessResponse>} - Success response
4080
- * @name uploadConsent
5500
+ * @name uploadConsents
4081
5501
  * @summary:
4082
- * @description: Upload Consent - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/uploadConsent/).
5502
+ * @description: Upload Consent - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/uploadConsents/).
4083
5503
  */
4084
- async uploadConsent(
4085
- { body, requestHeaders } = { requestHeaders: {} },
5504
+ async uploadConsents(
5505
+ { manifestId, body, requestHeaders } = { requestHeaders: {} },
4086
5506
  { responseHeaders } = { responseHeaders: false }
4087
5507
  ) {
4088
- const { error } = OrderPlatformValidator.uploadConsent().validate(
5508
+ const { error } = OrderPlatformValidator.uploadConsents().validate(
4089
5509
  {
5510
+ manifestId,
4090
5511
  body,
4091
5512
  },
4092
5513
  { abortEarly: false, allowUnknown: true }
@@ -4096,8 +5517,11 @@ class Order {
4096
5517
  }
4097
5518
 
4098
5519
  // Showing warrnings if extra unknown parameters are found
4099
- const { error: warrning } = OrderPlatformValidator.uploadConsent().validate(
5520
+ const {
5521
+ error: warrning,
5522
+ } = OrderPlatformValidator.uploadConsents().validate(
4100
5523
  {
5524
+ manifestId,
4101
5525
  body,
4102
5526
  },
4103
5527
  { abortEarly: false, allowUnknown: false }
@@ -4105,7 +5529,7 @@ class Order {
4105
5529
  if (warrning) {
4106
5530
  Logger({
4107
5531
  level: "WARN",
4108
- message: `Parameter Validation warrnings for platform > Order > uploadConsent \n ${warrning}`,
5532
+ message: `Parameter Validation warrnings for platform > Order > uploadConsents \n ${warrning}`,
4109
5533
  });
4110
5534
  }
4111
5535
 
@@ -4116,7 +5540,7 @@ class Order {
4116
5540
  const response = await PlatformAPIClient.execute(
4117
5541
  this.config,
4118
5542
  "post",
4119
- `/service/platform/order-manage/v1.0/company/${this.config.companyId}/manifest/uploadConsent`,
5543
+ `/service/platform/order-manage/v1.0/company/${this.config.companyId}/manifest/${manifestId}/upload-consent`,
4120
5544
  query_params,
4121
5545
  body,
4122
5546
  { ...xHeaders, ...requestHeaders },
@@ -4141,7 +5565,7 @@ class Order {
4141
5565
  } else {
4142
5566
  Logger({
4143
5567
  level: "WARN",
4144
- message: `Response Validation Warnings for platform > Order > uploadConsent \n ${res_error}`,
5568
+ message: `Response Validation Warnings for platform > Order > uploadConsents \n ${res_error}`,
4145
5569
  });
4146
5570
  }
4147
5571
  }