@gofynd/fdk-client-javascript 3.3.6 → 3.4.0

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 (40) hide show
  1. package/README.md +1 -1
  2. package/package.json +1 -1
  3. package/sdk/application/Catalog/CatalogApplicationClient.d.ts +6 -3
  4. package/sdk/application/Catalog/CatalogApplicationClient.js +24 -5
  5. package/sdk/application/Logistic/LogisticApplicationClient.d.ts +10 -0
  6. package/sdk/application/Logistic/LogisticApplicationClient.js +44 -0
  7. package/sdk/partner/Logistics/LogisticsPartnerModel.d.ts +4 -4
  8. package/sdk/partner/Logistics/LogisticsPartnerModel.js +2 -2
  9. package/sdk/partner/Webhook/WebhookPartnerModel.d.ts +5 -0
  10. package/sdk/partner/Webhook/WebhookPartnerModel.js +2 -0
  11. package/sdk/platform/Cart/CartPlatformModel.d.ts +193 -1
  12. package/sdk/platform/Cart/CartPlatformModel.js +123 -0
  13. package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +4 -2
  14. package/sdk/platform/Catalog/CatalogPlatformClient.js +16 -3
  15. package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +33 -2
  16. package/sdk/platform/Catalog/CatalogPlatformModel.js +17 -2
  17. package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +5 -0
  18. package/sdk/platform/Catalog/CatalogPlatformValidator.js +2 -0
  19. package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +17 -1
  20. package/sdk/platform/Configuration/ConfigurationPlatformModel.js +15 -0
  21. package/sdk/platform/Order/OrderPlatformModel.d.ts +20 -1
  22. package/sdk/platform/Order/OrderPlatformModel.js +22 -0
  23. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.d.ts +124 -1
  24. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.js +800 -33
  25. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.d.ts +139 -1
  26. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.js +125 -0
  27. package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +2 -2
  28. package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +8 -2
  29. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +936 -62
  30. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +591 -33
  31. package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.d.ts +12 -0
  32. package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.js +5 -0
  33. package/sdk/platform/User/UserPlatformApplicationClient.d.ts +36 -0
  34. package/sdk/platform/User/UserPlatformApplicationClient.js +251 -0
  35. package/sdk/platform/User/UserPlatformApplicationValidator.d.ts +38 -1
  36. package/sdk/platform/User/UserPlatformApplicationValidator.js +42 -0
  37. package/sdk/platform/User/UserPlatformModel.d.ts +430 -10
  38. package/sdk/platform/User/UserPlatformModel.js +276 -7
  39. package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +10 -0
  40. package/sdk/platform/Webhook/WebhookPlatformModel.js +4 -0
@@ -261,6 +261,88 @@ class Serviceability {
261
261
  return response;
262
262
  }
263
263
 
264
+ /**
265
+ * @param {ServiceabilityPlatformApplicationValidator.CreateFulfillmentOptionParam} arg
266
+ * - Arg object
267
+ *
268
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
269
+ * @param {import("../PlatformAPIClient").Options} - Options
270
+ * @returns {Promise<ServiceabilityPlatformModel.FulfillmentOption>} -
271
+ * Success response
272
+ * @name createFulfillmentOption
273
+ * @summary: Create a new fulfillment option
274
+ * @description: Creates a new fulfillment option for the specified company and application. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/serviceability/createFulfillmentOption/).
275
+ */
276
+ async createFulfillmentOption(
277
+ { body, requestHeaders } = { requestHeaders: {} },
278
+ { responseHeaders } = { responseHeaders: false }
279
+ ) {
280
+ const {
281
+ error,
282
+ } = ServiceabilityPlatformApplicationValidator.createFulfillmentOption().validate(
283
+ {
284
+ body,
285
+ },
286
+ { abortEarly: false, allowUnknown: true }
287
+ );
288
+ if (error) {
289
+ return Promise.reject(new FDKClientValidationError(error));
290
+ }
291
+
292
+ // Showing warrnings if extra unknown parameters are found
293
+ const {
294
+ error: warrning,
295
+ } = ServiceabilityPlatformApplicationValidator.createFulfillmentOption().validate(
296
+ {
297
+ body,
298
+ },
299
+ { abortEarly: false, allowUnknown: false }
300
+ );
301
+ if (warrning) {
302
+ Logger({
303
+ level: "WARN",
304
+ message: `Parameter Validation warrnings for platform > Serviceability > createFulfillmentOption \n ${warrning}`,
305
+ });
306
+ }
307
+
308
+ const query_params = {};
309
+
310
+ const response = await PlatformAPIClient.execute(
311
+ this.config,
312
+ "post",
313
+ `/service/platform/logistics/v1.0/company/${this.config.companyId}/application/${this.applicationId}/fulfillment-options`,
314
+ query_params,
315
+ body,
316
+ requestHeaders,
317
+ { responseHeaders }
318
+ );
319
+
320
+ let responseData = response;
321
+ if (responseHeaders) {
322
+ responseData = response[0];
323
+ }
324
+
325
+ const {
326
+ error: res_error,
327
+ } = ServiceabilityPlatformModel.FulfillmentOption().validate(responseData, {
328
+ abortEarly: false,
329
+ allowUnknown: true,
330
+ });
331
+
332
+ if (res_error) {
333
+ if (this.config.options.strictResponseCheck === true) {
334
+ return Promise.reject(new FDKResponseValidationError(res_error));
335
+ } else {
336
+ Logger({
337
+ level: "WARN",
338
+ message: `Response Validation Warnings for platform > Serviceability > createFulfillmentOption \n ${res_error}`,
339
+ });
340
+ }
341
+ }
342
+
343
+ return response;
344
+ }
345
+
264
346
  /**
265
347
  * @param {ServiceabilityPlatformApplicationValidator.CreateGeoAreaParam} arg
266
348
  * - Arg object
@@ -589,6 +671,89 @@ class Serviceability {
589
671
  return response;
590
672
  }
591
673
 
674
+ /**
675
+ * @param {ServiceabilityPlatformApplicationValidator.DeleteFulfillmentOptionsParam} arg
676
+ * - Arg object
677
+ *
678
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
679
+ * @param {import("../PlatformAPIClient").Options} - Options
680
+ * @returns {Promise<ServiceabilityPlatformModel.OperationResponseSchema>}
681
+ * - Success response
682
+ *
683
+ * @name deleteFulfillmentOptions
684
+ * @summary: Delete fulfillment options
685
+ * @description: Deletes fulfillment options for provided slug. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/serviceability/deleteFulfillmentOptions/).
686
+ */
687
+ async deleteFulfillmentOptions(
688
+ { slug, requestHeaders } = { requestHeaders: {} },
689
+ { responseHeaders } = { responseHeaders: false }
690
+ ) {
691
+ const {
692
+ error,
693
+ } = ServiceabilityPlatformApplicationValidator.deleteFulfillmentOptions().validate(
694
+ {
695
+ slug,
696
+ },
697
+ { abortEarly: false, allowUnknown: true }
698
+ );
699
+ if (error) {
700
+ return Promise.reject(new FDKClientValidationError(error));
701
+ }
702
+
703
+ // Showing warrnings if extra unknown parameters are found
704
+ const {
705
+ error: warrning,
706
+ } = ServiceabilityPlatformApplicationValidator.deleteFulfillmentOptions().validate(
707
+ {
708
+ slug,
709
+ },
710
+ { abortEarly: false, allowUnknown: false }
711
+ );
712
+ if (warrning) {
713
+ Logger({
714
+ level: "WARN",
715
+ message: `Parameter Validation warrnings for platform > Serviceability > deleteFulfillmentOptions \n ${warrning}`,
716
+ });
717
+ }
718
+
719
+ const query_params = {};
720
+
721
+ const response = await PlatformAPIClient.execute(
722
+ this.config,
723
+ "delete",
724
+ `/service/platform/logistics/v1.0/company/${this.config.companyId}/application/${this.applicationId}/fulfillment-options/${slug}`,
725
+ query_params,
726
+ undefined,
727
+ requestHeaders,
728
+ { responseHeaders }
729
+ );
730
+
731
+ let responseData = response;
732
+ if (responseHeaders) {
733
+ responseData = response[0];
734
+ }
735
+
736
+ const {
737
+ error: res_error,
738
+ } = ServiceabilityPlatformModel.OperationResponseSchema().validate(
739
+ responseData,
740
+ { abortEarly: false, allowUnknown: true }
741
+ );
742
+
743
+ if (res_error) {
744
+ if (this.config.options.strictResponseCheck === true) {
745
+ return Promise.reject(new FDKResponseValidationError(res_error));
746
+ } else {
747
+ Logger({
748
+ level: "WARN",
749
+ message: `Response Validation Warnings for platform > Serviceability > deleteFulfillmentOptions \n ${res_error}`,
750
+ });
751
+ }
752
+ }
753
+
754
+ return response;
755
+ }
756
+
592
757
  /**
593
758
  * @param {ServiceabilityPlatformApplicationValidator.DeleteZoneParam} arg
594
759
  * - Arg object
@@ -985,6 +1150,89 @@ class Serviceability {
985
1150
  return response;
986
1151
  }
987
1152
 
1153
+ /**
1154
+ * @param {ServiceabilityPlatformApplicationValidator.GetBulkFulfillmentValidationStatusParam} arg
1155
+ * - Arg object
1156
+ *
1157
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1158
+ * @param {import("../PlatformAPIClient").Options} - Options
1159
+ * @returns {Promise<ServiceabilityPlatformModel.FulfillmentOptionBulkValidate>}
1160
+ * - Success response
1161
+ *
1162
+ * @name getBulkFulfillmentValidationStatus
1163
+ * @summary: Validate bulk fulfillment options.
1164
+ * @description: Validates a bulk list of fulfillment options for an application before processing, ensuring correctness for stores or products. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/serviceability/getBulkFulfillmentValidationStatus/).
1165
+ */
1166
+ async getBulkFulfillmentValidationStatus(
1167
+ { bulkId, requestHeaders } = { requestHeaders: {} },
1168
+ { responseHeaders } = { responseHeaders: false }
1169
+ ) {
1170
+ const {
1171
+ error,
1172
+ } = ServiceabilityPlatformApplicationValidator.getBulkFulfillmentValidationStatus().validate(
1173
+ {
1174
+ bulkId,
1175
+ },
1176
+ { abortEarly: false, allowUnknown: true }
1177
+ );
1178
+ if (error) {
1179
+ return Promise.reject(new FDKClientValidationError(error));
1180
+ }
1181
+
1182
+ // Showing warrnings if extra unknown parameters are found
1183
+ const {
1184
+ error: warrning,
1185
+ } = ServiceabilityPlatformApplicationValidator.getBulkFulfillmentValidationStatus().validate(
1186
+ {
1187
+ bulkId,
1188
+ },
1189
+ { abortEarly: false, allowUnknown: false }
1190
+ );
1191
+ if (warrning) {
1192
+ Logger({
1193
+ level: "WARN",
1194
+ message: `Parameter Validation warrnings for platform > Serviceability > getBulkFulfillmentValidationStatus \n ${warrning}`,
1195
+ });
1196
+ }
1197
+
1198
+ const query_params = {};
1199
+
1200
+ const response = await PlatformAPIClient.execute(
1201
+ this.config,
1202
+ "get",
1203
+ `/service/platform/logistics/v1.0/company/${this.config.companyId}/application/${this.applicationId}/fulfillment-options/poll/validate/${bulkId}`,
1204
+ query_params,
1205
+ undefined,
1206
+ requestHeaders,
1207
+ { responseHeaders }
1208
+ );
1209
+
1210
+ let responseData = response;
1211
+ if (responseHeaders) {
1212
+ responseData = response[0];
1213
+ }
1214
+
1215
+ const {
1216
+ error: res_error,
1217
+ } = ServiceabilityPlatformModel.FulfillmentOptionBulkValidate().validate(
1218
+ responseData,
1219
+ { abortEarly: false, allowUnknown: true }
1220
+ );
1221
+
1222
+ if (res_error) {
1223
+ if (this.config.options.strictResponseCheck === true) {
1224
+ return Promise.reject(new FDKResponseValidationError(res_error));
1225
+ } else {
1226
+ Logger({
1227
+ level: "WARN",
1228
+ message: `Response Validation Warnings for platform > Serviceability > getBulkFulfillmentValidationStatus \n ${res_error}`,
1229
+ });
1230
+ }
1231
+ }
1232
+
1233
+ return response;
1234
+ }
1235
+
988
1236
  /**
989
1237
  * @param {ServiceabilityPlatformApplicationValidator.GetBulkGeoAreaParam} arg
990
1238
  * - Arg object
@@ -1184,30 +1432,288 @@ class Serviceability {
1184
1432
  // Showing warrnings if extra unknown parameters are found
1185
1433
  const {
1186
1434
  error: warrning,
1187
- } = ServiceabilityPlatformApplicationValidator.getCourierPartnerRules().validate(
1435
+ } = ServiceabilityPlatformApplicationValidator.getCourierPartnerRules().validate(
1436
+ {
1437
+ pageNo,
1438
+ pageSize,
1439
+ status,
1440
+ },
1441
+ { abortEarly: false, allowUnknown: false }
1442
+ );
1443
+ if (warrning) {
1444
+ Logger({
1445
+ level: "WARN",
1446
+ message: `Parameter Validation warrnings for platform > Serviceability > getCourierPartnerRules \n ${warrning}`,
1447
+ });
1448
+ }
1449
+
1450
+ const query_params = {};
1451
+ query_params["page_no"] = pageNo;
1452
+ query_params["page_size"] = pageSize;
1453
+ query_params["status"] = status;
1454
+
1455
+ const response = await PlatformAPIClient.execute(
1456
+ this.config,
1457
+ "get",
1458
+ `/service/platform/logistics/v1.0/company/${this.config.companyId}/application/${this.applicationId}/courier-partner/rules`,
1459
+ query_params,
1460
+ undefined,
1461
+ requestHeaders,
1462
+ { responseHeaders }
1463
+ );
1464
+
1465
+ let responseData = response;
1466
+ if (responseHeaders) {
1467
+ responseData = response[0];
1468
+ }
1469
+
1470
+ const {
1471
+ error: res_error,
1472
+ } = ServiceabilityPlatformModel.CourierPartnerRulesListResult().validate(
1473
+ responseData,
1474
+ { abortEarly: false, allowUnknown: true }
1475
+ );
1476
+
1477
+ if (res_error) {
1478
+ if (this.config.options.strictResponseCheck === true) {
1479
+ return Promise.reject(new FDKResponseValidationError(res_error));
1480
+ } else {
1481
+ Logger({
1482
+ level: "WARN",
1483
+ message: `Response Validation Warnings for platform > Serviceability > getCourierPartnerRules \n ${res_error}`,
1484
+ });
1485
+ }
1486
+ }
1487
+
1488
+ return response;
1489
+ }
1490
+
1491
+ /**
1492
+ * @param {ServiceabilityPlatformApplicationValidator.GetCourierPartnersParam} arg
1493
+ * - Arg object
1494
+ *
1495
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1496
+ * @param {import("../PlatformAPIClient").Options} - Options
1497
+ * @returns {Promise<ServiceabilityPlatformModel.ShipmentCourierPartnerResult>}
1498
+ * - Success response
1499
+ *
1500
+ * @name getCourierPartners
1501
+ * @summary: Serviceable Courier Partners
1502
+ * @description: Get all the serviceable courier partners of a destination and the shipments. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/serviceability/getCourierPartners/).
1503
+ */
1504
+ async getCourierPartners(
1505
+ { body, requestHeaders } = { requestHeaders: {} },
1506
+ { responseHeaders } = { responseHeaders: false }
1507
+ ) {
1508
+ const {
1509
+ error,
1510
+ } = ServiceabilityPlatformApplicationValidator.getCourierPartners().validate(
1511
+ {
1512
+ body,
1513
+ },
1514
+ { abortEarly: false, allowUnknown: true }
1515
+ );
1516
+ if (error) {
1517
+ return Promise.reject(new FDKClientValidationError(error));
1518
+ }
1519
+
1520
+ // Showing warrnings if extra unknown parameters are found
1521
+ const {
1522
+ error: warrning,
1523
+ } = ServiceabilityPlatformApplicationValidator.getCourierPartners().validate(
1524
+ {
1525
+ body,
1526
+ },
1527
+ { abortEarly: false, allowUnknown: false }
1528
+ );
1529
+ if (warrning) {
1530
+ Logger({
1531
+ level: "WARN",
1532
+ message: `Parameter Validation warrnings for platform > Serviceability > getCourierPartners \n ${warrning}`,
1533
+ });
1534
+ }
1535
+
1536
+ const query_params = {};
1537
+
1538
+ const response = await PlatformAPIClient.execute(
1539
+ this.config,
1540
+ "post",
1541
+ `/service/platform/logistics/v1.0/company/${this.config.companyId}/application/${this.applicationId}/shipment/courier-partners`,
1542
+ query_params,
1543
+ body,
1544
+ requestHeaders,
1545
+ { responseHeaders }
1546
+ );
1547
+
1548
+ let responseData = response;
1549
+ if (responseHeaders) {
1550
+ responseData = response[0];
1551
+ }
1552
+
1553
+ const {
1554
+ error: res_error,
1555
+ } = ServiceabilityPlatformModel.ShipmentCourierPartnerResult().validate(
1556
+ responseData,
1557
+ { abortEarly: false, allowUnknown: true }
1558
+ );
1559
+
1560
+ if (res_error) {
1561
+ if (this.config.options.strictResponseCheck === true) {
1562
+ return Promise.reject(new FDKResponseValidationError(res_error));
1563
+ } else {
1564
+ Logger({
1565
+ level: "WARN",
1566
+ message: `Response Validation Warnings for platform > Serviceability > getCourierPartners \n ${res_error}`,
1567
+ });
1568
+ }
1569
+ }
1570
+
1571
+ return response;
1572
+ }
1573
+
1574
+ /**
1575
+ * @param {ServiceabilityPlatformApplicationValidator.GetFulfillmentOptionProductsParam} arg
1576
+ * - Arg object
1577
+ *
1578
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1579
+ * @param {import("../PlatformAPIClient").Options} - Options
1580
+ * @returns {Promise<ServiceabilityPlatformModel.FulfillmentOptionProducts>}
1581
+ * - Success response
1582
+ *
1583
+ * @name getFulfillmentOptionProducts
1584
+ * @summary: Get products for a specific fulfillment option.
1585
+ * @description: Retrieves products available for a specific fulfillment option in an application. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/serviceability/getFulfillmentOptionProducts/).
1586
+ */
1587
+ async getFulfillmentOptionProducts(
1588
+ { slug, storeId, q, requestHeaders } = { requestHeaders: {} },
1589
+ { responseHeaders } = { responseHeaders: false }
1590
+ ) {
1591
+ const {
1592
+ error,
1593
+ } = ServiceabilityPlatformApplicationValidator.getFulfillmentOptionProducts().validate(
1594
+ {
1595
+ slug,
1596
+ storeId,
1597
+ q,
1598
+ },
1599
+ { abortEarly: false, allowUnknown: true }
1600
+ );
1601
+ if (error) {
1602
+ return Promise.reject(new FDKClientValidationError(error));
1603
+ }
1604
+
1605
+ // Showing warrnings if extra unknown parameters are found
1606
+ const {
1607
+ error: warrning,
1608
+ } = ServiceabilityPlatformApplicationValidator.getFulfillmentOptionProducts().validate(
1609
+ {
1610
+ slug,
1611
+ storeId,
1612
+ q,
1613
+ },
1614
+ { abortEarly: false, allowUnknown: false }
1615
+ );
1616
+ if (warrning) {
1617
+ Logger({
1618
+ level: "WARN",
1619
+ message: `Parameter Validation warrnings for platform > Serviceability > getFulfillmentOptionProducts \n ${warrning}`,
1620
+ });
1621
+ }
1622
+
1623
+ const query_params = {};
1624
+ query_params["q"] = q;
1625
+ query_params["store_id"] = storeId;
1626
+
1627
+ const response = await PlatformAPIClient.execute(
1628
+ this.config,
1629
+ "get",
1630
+ `/service/platform/logistics/v1.0/company/${this.config.companyId}/application/${this.applicationId}/fulfillment-options/${slug}/products`,
1631
+ query_params,
1632
+ undefined,
1633
+ requestHeaders,
1634
+ { responseHeaders }
1635
+ );
1636
+
1637
+ let responseData = response;
1638
+ if (responseHeaders) {
1639
+ responseData = response[0];
1640
+ }
1641
+
1642
+ const {
1643
+ error: res_error,
1644
+ } = ServiceabilityPlatformModel.FulfillmentOptionProducts().validate(
1645
+ responseData,
1646
+ { abortEarly: false, allowUnknown: true }
1647
+ );
1648
+
1649
+ if (res_error) {
1650
+ if (this.config.options.strictResponseCheck === true) {
1651
+ return Promise.reject(new FDKResponseValidationError(res_error));
1652
+ } else {
1653
+ Logger({
1654
+ level: "WARN",
1655
+ message: `Response Validation Warnings for platform > Serviceability > getFulfillmentOptionProducts \n ${res_error}`,
1656
+ });
1657
+ }
1658
+ }
1659
+
1660
+ return response;
1661
+ }
1662
+
1663
+ /**
1664
+ * @param {ServiceabilityPlatformApplicationValidator.GetFulfillmentOptionStoresParam} arg
1665
+ * - Arg object
1666
+ *
1667
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1668
+ * @param {import("../PlatformAPIClient").Options} - Options
1669
+ * @returns {Promise<ServiceabilityPlatformModel.FulfillmentOptionStores>}
1670
+ * - Success response
1671
+ *
1672
+ * @name getFulfillmentOptionStores
1673
+ * @summary: Get stores for a specific fulfillment option.
1674
+ * @description: Retrieves stores available for a specific fulfillment option in an application. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/serviceability/getFulfillmentOptionStores/).
1675
+ */
1676
+ async getFulfillmentOptionStores(
1677
+ { slug, q, requestHeaders } = { requestHeaders: {} },
1678
+ { responseHeaders } = { responseHeaders: false }
1679
+ ) {
1680
+ const {
1681
+ error,
1682
+ } = ServiceabilityPlatformApplicationValidator.getFulfillmentOptionStores().validate(
1683
+ {
1684
+ slug,
1685
+ q,
1686
+ },
1687
+ { abortEarly: false, allowUnknown: true }
1688
+ );
1689
+ if (error) {
1690
+ return Promise.reject(new FDKClientValidationError(error));
1691
+ }
1692
+
1693
+ // Showing warrnings if extra unknown parameters are found
1694
+ const {
1695
+ error: warrning,
1696
+ } = ServiceabilityPlatformApplicationValidator.getFulfillmentOptionStores().validate(
1188
1697
  {
1189
- pageNo,
1190
- pageSize,
1191
- status,
1698
+ slug,
1699
+ q,
1192
1700
  },
1193
1701
  { abortEarly: false, allowUnknown: false }
1194
1702
  );
1195
1703
  if (warrning) {
1196
1704
  Logger({
1197
1705
  level: "WARN",
1198
- message: `Parameter Validation warrnings for platform > Serviceability > getCourierPartnerRules \n ${warrning}`,
1706
+ message: `Parameter Validation warrnings for platform > Serviceability > getFulfillmentOptionStores \n ${warrning}`,
1199
1707
  });
1200
1708
  }
1201
1709
 
1202
1710
  const query_params = {};
1203
- query_params["page_no"] = pageNo;
1204
- query_params["page_size"] = pageSize;
1205
- query_params["status"] = status;
1711
+ query_params["q"] = q;
1206
1712
 
1207
1713
  const response = await PlatformAPIClient.execute(
1208
1714
  this.config,
1209
1715
  "get",
1210
- `/service/platform/logistics/v1.0/company/${this.config.companyId}/application/${this.applicationId}/courier-partner/rules`,
1716
+ `/service/platform/logistics/v1.0/company/${this.config.companyId}/application/${this.applicationId}/fulfillment-options/${slug}/stores`,
1211
1717
  query_params,
1212
1718
  undefined,
1213
1719
  requestHeaders,
@@ -1221,7 +1727,7 @@ class Serviceability {
1221
1727
 
1222
1728
  const {
1223
1729
  error: res_error,
1224
- } = ServiceabilityPlatformModel.CourierPartnerRulesListResult().validate(
1730
+ } = ServiceabilityPlatformModel.FulfillmentOptionStores().validate(
1225
1731
  responseData,
1226
1732
  { abortEarly: false, allowUnknown: true }
1227
1733
  );
@@ -1232,7 +1738,7 @@ class Serviceability {
1232
1738
  } else {
1233
1739
  Logger({
1234
1740
  level: "WARN",
1235
- message: `Response Validation Warnings for platform > Serviceability > getCourierPartnerRules \n ${res_error}`,
1741
+ message: `Response Validation Warnings for platform > Serviceability > getFulfillmentOptionStores \n ${res_error}`,
1236
1742
  });
1237
1743
  }
1238
1744
  }
@@ -1241,27 +1747,28 @@ class Serviceability {
1241
1747
  }
1242
1748
 
1243
1749
  /**
1244
- * @param {ServiceabilityPlatformApplicationValidator.GetCourierPartnersParam} arg
1750
+ * @param {ServiceabilityPlatformApplicationValidator.GetFulfillmentOptionsParam} arg
1245
1751
  * - Arg object
1246
1752
  *
1247
1753
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1248
1754
  * @param {import("../PlatformAPIClient").Options} - Options
1249
- * @returns {Promise<ServiceabilityPlatformModel.ShipmentCourierPartnerResult>}
1250
- * - Success response
1251
- *
1252
- * @name getCourierPartners
1253
- * @summary: Serviceable Courier Partners
1254
- * @description: Get all the serviceable courier partners of a destination and the shipments. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/serviceability/getCourierPartners/).
1755
+ * @returns {Promise<ServiceabilityPlatformModel.FulfillmentOption>} -
1756
+ * Success response
1757
+ * @name getFulfillmentOptions
1758
+ * @summary: Get fulfillment options
1759
+ * @description: Fetches available fulfillment options for a given product and store. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/serviceability/getFulfillmentOptions/).
1255
1760
  */
1256
- async getCourierPartners(
1257
- { body, requestHeaders } = { requestHeaders: {} },
1761
+ async getFulfillmentOptions(
1762
+ { slug, productId, storeId, requestHeaders } = { requestHeaders: {} },
1258
1763
  { responseHeaders } = { responseHeaders: false }
1259
1764
  ) {
1260
1765
  const {
1261
1766
  error,
1262
- } = ServiceabilityPlatformApplicationValidator.getCourierPartners().validate(
1767
+ } = ServiceabilityPlatformApplicationValidator.getFulfillmentOptions().validate(
1263
1768
  {
1264
- body,
1769
+ slug,
1770
+ productId,
1771
+ storeId,
1265
1772
  },
1266
1773
  { abortEarly: false, allowUnknown: true }
1267
1774
  );
@@ -1272,27 +1779,31 @@ class Serviceability {
1272
1779
  // Showing warrnings if extra unknown parameters are found
1273
1780
  const {
1274
1781
  error: warrning,
1275
- } = ServiceabilityPlatformApplicationValidator.getCourierPartners().validate(
1782
+ } = ServiceabilityPlatformApplicationValidator.getFulfillmentOptions().validate(
1276
1783
  {
1277
- body,
1784
+ slug,
1785
+ productId,
1786
+ storeId,
1278
1787
  },
1279
1788
  { abortEarly: false, allowUnknown: false }
1280
1789
  );
1281
1790
  if (warrning) {
1282
1791
  Logger({
1283
1792
  level: "WARN",
1284
- message: `Parameter Validation warrnings for platform > Serviceability > getCourierPartners \n ${warrning}`,
1793
+ message: `Parameter Validation warrnings for platform > Serviceability > getFulfillmentOptions \n ${warrning}`,
1285
1794
  });
1286
1795
  }
1287
1796
 
1288
1797
  const query_params = {};
1798
+ query_params["product_id"] = productId;
1799
+ query_params["store_id"] = storeId;
1289
1800
 
1290
1801
  const response = await PlatformAPIClient.execute(
1291
1802
  this.config,
1292
- "post",
1293
- `/service/platform/logistics/v1.0/company/${this.config.companyId}/application/${this.applicationId}/shipment/courier-partners`,
1803
+ "get",
1804
+ `/service/platform/logistics/v1.0/company/${this.config.companyId}/application/${this.applicationId}/fulfillment-options/${slug}`,
1294
1805
  query_params,
1295
- body,
1806
+ undefined,
1296
1807
  requestHeaders,
1297
1808
  { responseHeaders }
1298
1809
  );
@@ -1304,10 +1815,10 @@ class Serviceability {
1304
1815
 
1305
1816
  const {
1306
1817
  error: res_error,
1307
- } = ServiceabilityPlatformModel.ShipmentCourierPartnerResult().validate(
1308
- responseData,
1309
- { abortEarly: false, allowUnknown: true }
1310
- );
1818
+ } = ServiceabilityPlatformModel.FulfillmentOption().validate(responseData, {
1819
+ abortEarly: false,
1820
+ allowUnknown: true,
1821
+ });
1311
1822
 
1312
1823
  if (res_error) {
1313
1824
  if (this.config.options.strictResponseCheck === true) {
@@ -1315,7 +1826,7 @@ class Serviceability {
1315
1826
  } else {
1316
1827
  Logger({
1317
1828
  level: "WARN",
1318
- message: `Response Validation Warnings for platform > Serviceability > getCourierPartners \n ${res_error}`,
1829
+ message: `Response Validation Warnings for platform > Serviceability > getFulfillmentOptions \n ${res_error}`,
1319
1830
  });
1320
1831
  }
1321
1832
  }
@@ -1874,6 +2385,7 @@ class Serviceability {
1874
2385
  stage,
1875
2386
  pageSize,
1876
2387
  pageNo,
2388
+ fulfillmentOptionSlug,
1877
2389
  isActive,
1878
2390
  q,
1879
2391
  countryIsoCode,
@@ -1892,6 +2404,7 @@ class Serviceability {
1892
2404
  stage,
1893
2405
  pageSize,
1894
2406
  pageNo,
2407
+ fulfillmentOptionSlug,
1895
2408
  isActive,
1896
2409
  q,
1897
2410
  countryIsoCode,
@@ -1914,6 +2427,7 @@ class Serviceability {
1914
2427
  stage,
1915
2428
  pageSize,
1916
2429
  pageNo,
2430
+ fulfillmentOptionSlug,
1917
2431
  isActive,
1918
2432
  q,
1919
2433
  countryIsoCode,
@@ -1935,6 +2449,7 @@ class Serviceability {
1935
2449
  query_params["stage"] = stage;
1936
2450
  query_params["page_size"] = pageSize;
1937
2451
  query_params["page_no"] = pageNo;
2452
+ query_params["fulfillment_option_slug"] = fulfillmentOptionSlug;
1938
2453
  query_params["is_active"] = isActive;
1939
2454
  query_params["q"] = q;
1940
2455
  query_params["country_iso_code"] = countryIsoCode;
@@ -2144,6 +2659,90 @@ class Serviceability {
2144
2659
  return response;
2145
2660
  }
2146
2661
 
2662
+ /**
2663
+ * @param {ServiceabilityPlatformApplicationValidator.PutFulfillmentOptionParam} arg
2664
+ * - Arg object
2665
+ *
2666
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
2667
+ * @param {import("../PlatformAPIClient").Options} - Options
2668
+ * @returns {Promise<ServiceabilityPlatformModel.FulfillmentOption>} -
2669
+ * Success response
2670
+ * @name putFulfillmentOption
2671
+ * @summary: Update an existing fulfillment option
2672
+ * @description: Updates the details of an existing fulfillment option for the specified company and application - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/serviceability/putFulfillmentOption/).
2673
+ */
2674
+ async putFulfillmentOption(
2675
+ { slug, body, requestHeaders } = { requestHeaders: {} },
2676
+ { responseHeaders } = { responseHeaders: false }
2677
+ ) {
2678
+ const {
2679
+ error,
2680
+ } = ServiceabilityPlatformApplicationValidator.putFulfillmentOption().validate(
2681
+ {
2682
+ slug,
2683
+ body,
2684
+ },
2685
+ { abortEarly: false, allowUnknown: true }
2686
+ );
2687
+ if (error) {
2688
+ return Promise.reject(new FDKClientValidationError(error));
2689
+ }
2690
+
2691
+ // Showing warrnings if extra unknown parameters are found
2692
+ const {
2693
+ error: warrning,
2694
+ } = ServiceabilityPlatformApplicationValidator.putFulfillmentOption().validate(
2695
+ {
2696
+ slug,
2697
+ body,
2698
+ },
2699
+ { abortEarly: false, allowUnknown: false }
2700
+ );
2701
+ if (warrning) {
2702
+ Logger({
2703
+ level: "WARN",
2704
+ message: `Parameter Validation warrnings for platform > Serviceability > putFulfillmentOption \n ${warrning}`,
2705
+ });
2706
+ }
2707
+
2708
+ const query_params = {};
2709
+
2710
+ const response = await PlatformAPIClient.execute(
2711
+ this.config,
2712
+ "put",
2713
+ `/service/platform/logistics/v1.0/company/${this.config.companyId}/application/${this.applicationId}/fulfillment-options/${slug}`,
2714
+ query_params,
2715
+ body,
2716
+ requestHeaders,
2717
+ { responseHeaders }
2718
+ );
2719
+
2720
+ let responseData = response;
2721
+ if (responseHeaders) {
2722
+ responseData = response[0];
2723
+ }
2724
+
2725
+ const {
2726
+ error: res_error,
2727
+ } = ServiceabilityPlatformModel.FulfillmentOption().validate(responseData, {
2728
+ abortEarly: false,
2729
+ allowUnknown: true,
2730
+ });
2731
+
2732
+ if (res_error) {
2733
+ if (this.config.options.strictResponseCheck === true) {
2734
+ return Promise.reject(new FDKResponseValidationError(res_error));
2735
+ } else {
2736
+ Logger({
2737
+ level: "WARN",
2738
+ message: `Response Validation Warnings for platform > Serviceability > putFulfillmentOption \n ${res_error}`,
2739
+ });
2740
+ }
2741
+ }
2742
+
2743
+ return response;
2744
+ }
2745
+
2147
2746
  /**
2148
2747
  * @param {ServiceabilityPlatformApplicationValidator.UpdateApplicationConfigurationParam} arg
2149
2748
  * - Arg object
@@ -3239,6 +3838,174 @@ class Serviceability {
3239
3838
 
3240
3839
  return response;
3241
3840
  }
3841
+
3842
+ /**
3843
+ * @param {ServiceabilityPlatformApplicationValidator.UploadBulkFulfillmentOptionsParam} arg
3844
+ * - Arg object
3845
+ *
3846
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
3847
+ * @param {import("../PlatformAPIClient").Options} - Options
3848
+ * @returns {Promise<ServiceabilityPlatformModel.FulfillmentOptionBulkData>}
3849
+ * - Success response
3850
+ *
3851
+ * @name uploadBulkFulfillmentOptions
3852
+ * @summary: Upload bulk fulfillment options.
3853
+ * @description: Uploads a bulk list of fulfillment options for an application, allowing multiple fulfillment configurations to be processed at once. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/serviceability/uploadBulkFulfillmentOptions/).
3854
+ */
3855
+ async uploadBulkFulfillmentOptions(
3856
+ { body, requestHeaders } = { requestHeaders: {} },
3857
+ { responseHeaders } = { responseHeaders: false }
3858
+ ) {
3859
+ const {
3860
+ error,
3861
+ } = ServiceabilityPlatformApplicationValidator.uploadBulkFulfillmentOptions().validate(
3862
+ {
3863
+ body,
3864
+ },
3865
+ { abortEarly: false, allowUnknown: true }
3866
+ );
3867
+ if (error) {
3868
+ return Promise.reject(new FDKClientValidationError(error));
3869
+ }
3870
+
3871
+ // Showing warrnings if extra unknown parameters are found
3872
+ const {
3873
+ error: warrning,
3874
+ } = ServiceabilityPlatformApplicationValidator.uploadBulkFulfillmentOptions().validate(
3875
+ {
3876
+ body,
3877
+ },
3878
+ { abortEarly: false, allowUnknown: false }
3879
+ );
3880
+ if (warrning) {
3881
+ Logger({
3882
+ level: "WARN",
3883
+ message: `Parameter Validation warrnings for platform > Serviceability > uploadBulkFulfillmentOptions \n ${warrning}`,
3884
+ });
3885
+ }
3886
+
3887
+ const query_params = {};
3888
+
3889
+ const response = await PlatformAPIClient.execute(
3890
+ this.config,
3891
+ "post",
3892
+ `/service/platform/logistics/v1.0/company/${this.config.companyId}/application/${this.applicationId}/fulfillment-options/bulk`,
3893
+ query_params,
3894
+ body,
3895
+ requestHeaders,
3896
+ { responseHeaders }
3897
+ );
3898
+
3899
+ let responseData = response;
3900
+ if (responseHeaders) {
3901
+ responseData = response[0];
3902
+ }
3903
+
3904
+ const {
3905
+ error: res_error,
3906
+ } = ServiceabilityPlatformModel.FulfillmentOptionBulkData().validate(
3907
+ responseData,
3908
+ { abortEarly: false, allowUnknown: true }
3909
+ );
3910
+
3911
+ if (res_error) {
3912
+ if (this.config.options.strictResponseCheck === true) {
3913
+ return Promise.reject(new FDKResponseValidationError(res_error));
3914
+ } else {
3915
+ Logger({
3916
+ level: "WARN",
3917
+ message: `Response Validation Warnings for platform > Serviceability > uploadBulkFulfillmentOptions \n ${res_error}`,
3918
+ });
3919
+ }
3920
+ }
3921
+
3922
+ return response;
3923
+ }
3924
+
3925
+ /**
3926
+ * @param {ServiceabilityPlatformApplicationValidator.ValidateBulkFulfillmentOptionsParam} arg
3927
+ * - Arg object
3928
+ *
3929
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
3930
+ * @param {import("../PlatformAPIClient").Options} - Options
3931
+ * @returns {Promise<ServiceabilityPlatformModel.FulfillmentOptionBulkValidateData>}
3932
+ * - Success response
3933
+ *
3934
+ * @name validateBulkFulfillmentOptions
3935
+ * @summary: Validate bulk fulfillment options.
3936
+ * @description: Validates a bulk list of fulfillment options for an application before processing, ensuring correctness for stores or products. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/serviceability/validateBulkFulfillmentOptions/).
3937
+ */
3938
+ async validateBulkFulfillmentOptions(
3939
+ { type, body, requestHeaders } = { requestHeaders: {} },
3940
+ { responseHeaders } = { responseHeaders: false }
3941
+ ) {
3942
+ const {
3943
+ error,
3944
+ } = ServiceabilityPlatformApplicationValidator.validateBulkFulfillmentOptions().validate(
3945
+ {
3946
+ type,
3947
+ body,
3948
+ },
3949
+ { abortEarly: false, allowUnknown: true }
3950
+ );
3951
+ if (error) {
3952
+ return Promise.reject(new FDKClientValidationError(error));
3953
+ }
3954
+
3955
+ // Showing warrnings if extra unknown parameters are found
3956
+ const {
3957
+ error: warrning,
3958
+ } = ServiceabilityPlatformApplicationValidator.validateBulkFulfillmentOptions().validate(
3959
+ {
3960
+ type,
3961
+ body,
3962
+ },
3963
+ { abortEarly: false, allowUnknown: false }
3964
+ );
3965
+ if (warrning) {
3966
+ Logger({
3967
+ level: "WARN",
3968
+ message: `Parameter Validation warrnings for platform > Serviceability > validateBulkFulfillmentOptions \n ${warrning}`,
3969
+ });
3970
+ }
3971
+
3972
+ const query_params = {};
3973
+
3974
+ const response = await PlatformAPIClient.execute(
3975
+ this.config,
3976
+ "post",
3977
+ `/service/platform/logistics/v1.0/company/${this.config.companyId}/application/${this.applicationId}/fulfillment-options/bulk/validate/${type}`,
3978
+ query_params,
3979
+ body,
3980
+ requestHeaders,
3981
+ { responseHeaders }
3982
+ );
3983
+
3984
+ let responseData = response;
3985
+ if (responseHeaders) {
3986
+ responseData = response[0];
3987
+ }
3988
+
3989
+ const {
3990
+ error: res_error,
3991
+ } = ServiceabilityPlatformModel.FulfillmentOptionBulkValidateData().validate(
3992
+ responseData,
3993
+ { abortEarly: false, allowUnknown: true }
3994
+ );
3995
+
3996
+ if (res_error) {
3997
+ if (this.config.options.strictResponseCheck === true) {
3998
+ return Promise.reject(new FDKResponseValidationError(res_error));
3999
+ } else {
4000
+ Logger({
4001
+ level: "WARN",
4002
+ message: `Response Validation Warnings for platform > Serviceability > validateBulkFulfillmentOptions \n ${res_error}`,
4003
+ });
4004
+ }
4005
+ }
4006
+
4007
+ return response;
4008
+ }
3242
4009
  }
3243
4010
 
3244
4011
  module.exports = Serviceability;