@gofynd/fdk-client-javascript 3.5.0 → 3.6.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 (31) hide show
  1. package/README.md +1 -1
  2. package/package.json +1 -1
  3. package/sdk/application/ApplicationAPIClient.d.ts +1 -1
  4. package/sdk/application/ApplicationClient.d.ts +1 -1
  5. package/sdk/application/Payment/PaymentApplicationClient.d.ts +50 -0
  6. package/sdk/application/Payment/PaymentApplicationClient.js +210 -0
  7. package/sdk/partner/OAuthClient.d.ts +3 -3
  8. package/sdk/partner/PartnerAPIClient.d.ts +1 -1
  9. package/sdk/partner/PartnerClient.d.ts +2 -2
  10. package/sdk/platform/Cart/CartPlatformModel.d.ts +11 -0
  11. package/sdk/platform/Cart/CartPlatformModel.js +5 -0
  12. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +1 -1
  13. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +1 -4
  14. package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +0 -5
  15. package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +0 -2
  16. package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +125 -1
  17. package/sdk/platform/Catalog/CatalogPlatformClient.js +1075 -95
  18. package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +1017 -46
  19. package/sdk/platform/Catalog/CatalogPlatformModel.js +681 -5
  20. package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +200 -5
  21. package/sdk/platform/Catalog/CatalogPlatformValidator.js +174 -4
  22. package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +9 -4
  23. package/sdk/platform/FileStorage/FileStoragePlatformModel.js +4 -4
  24. package/sdk/platform/OAuthClient.d.ts +3 -3
  25. package/sdk/platform/Order/OrderPlatformModel.d.ts +49 -1
  26. package/sdk/platform/Order/OrderPlatformModel.js +28 -0
  27. package/sdk/platform/PlatformAPIClient.d.ts +1 -1
  28. package/sdk/platform/PlatformClient.d.ts +2 -2
  29. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +0 -10
  30. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +0 -4
  31. package/sdk/public/PublicAPIClient.d.ts +1 -1
@@ -494,6 +494,85 @@ class Catalog {
494
494
  return response;
495
495
  }
496
496
 
497
+ /**
498
+ * @param {CatalogPlatformValidator.CreateHsCodeParam} arg - Arg object
499
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
500
+ * @param {import("../PlatformAPIClient").Options} - Options
501
+ * @returns {Promise<CatalogPlatformModel.HSCodeItem>} - Success response
502
+ * @name createHsCode
503
+ * @summary: Create HS/SAC code
504
+ * @description: Create HS/SAC code. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/catalog/createHsCode/).
505
+ */
506
+ async createHsCode(
507
+ { body, requestHeaders } = { requestHeaders: {} },
508
+ { responseHeaders } = { responseHeaders: false }
509
+ ) {
510
+ const { error } = CatalogPlatformValidator.createHsCode().validate(
511
+ {
512
+ body,
513
+ },
514
+ { abortEarly: false, allowUnknown: true }
515
+ );
516
+ if (error) {
517
+ return Promise.reject(new FDKClientValidationError(error));
518
+ }
519
+
520
+ // Showing warrnings if extra unknown parameters are found
521
+ const {
522
+ error: warrning,
523
+ } = CatalogPlatformValidator.createHsCode().validate(
524
+ {
525
+ body,
526
+ },
527
+ { abortEarly: false, allowUnknown: false }
528
+ );
529
+ if (warrning) {
530
+ Logger({
531
+ level: "WARN",
532
+ message: `Parameter Validation warrnings for platform > Catalog > createHsCode \n ${warrning}`,
533
+ });
534
+ }
535
+
536
+ const query_params = {};
537
+
538
+ const xHeaders = {};
539
+
540
+ const response = await PlatformAPIClient.execute(
541
+ this.config,
542
+ "post",
543
+ `/service/platform/catalog/v1.0/company/${this.config.companyId}/taxes/hscodes`,
544
+ query_params,
545
+ body,
546
+ { ...xHeaders, ...requestHeaders },
547
+ { responseHeaders }
548
+ );
549
+
550
+ let responseData = response;
551
+ if (responseHeaders) {
552
+ responseData = response[0];
553
+ }
554
+
555
+ const {
556
+ error: res_error,
557
+ } = CatalogPlatformModel.HSCodeItem().validate(responseData, {
558
+ abortEarly: false,
559
+ allowUnknown: true,
560
+ });
561
+
562
+ if (res_error) {
563
+ if (this.config.options.strictResponseCheck === true) {
564
+ return Promise.reject(new FDKResponseValidationError(res_error));
565
+ } else {
566
+ Logger({
567
+ level: "WARN",
568
+ message: `Response Validation Warnings for platform > Catalog > createHsCode \n ${res_error}`,
569
+ });
570
+ }
571
+ }
572
+
573
+ return response;
574
+ }
575
+
497
576
  /**
498
577
  * @param {CatalogPlatformValidator.CreateInventoryExportParam} arg - Arg object
499
578
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
@@ -787,7 +866,7 @@ class Catalog {
787
866
  const response = await PlatformAPIClient.execute(
788
867
  this.config,
789
868
  "post",
790
- `/service/platform/catalog/v2.0/company/${this.config.companyId}/products/`,
869
+ `/service/platform/catalog/v3.0/company/${this.config.companyId}/products/`,
791
870
  query_params,
792
871
  body,
793
872
  { ...xHeaders, ...requestHeaders },
@@ -1032,7 +1111,7 @@ class Catalog {
1032
1111
  const response = await PlatformAPIClient.execute(
1033
1112
  this.config,
1034
1113
  "post",
1035
- `/service/platform/catalog/v2.0/company/${this.config.companyId}/products/downloads/`,
1114
+ `/service/platform/catalog/v3.0/company/${this.config.companyId}/products/downloads/`,
1036
1115
  query_params,
1037
1116
  body,
1038
1117
  { ...xHeaders, ...requestHeaders },
@@ -1225,6 +1304,245 @@ class Catalog {
1225
1304
  return response;
1226
1305
  }
1227
1306
 
1307
+ /**
1308
+ * @param {CatalogPlatformValidator.CreateTaxParam} arg - Arg object
1309
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1310
+ * @param {import("../PlatformAPIClient").Options} - Options
1311
+ * @returns {Promise<CatalogPlatformModel.CreateTax>} - Success response
1312
+ * @name createTax
1313
+ * @summary: Create a new Tax Rule and immediately generate its corresponding live version.
1314
+ * @description: Create a tax rule and its version for under a specific company. This also creates a live version of the rule - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/catalog/createTax/).
1315
+ */
1316
+ async createTax(
1317
+ { body, requestHeaders } = { requestHeaders: {} },
1318
+ { responseHeaders } = { responseHeaders: false }
1319
+ ) {
1320
+ const { error } = CatalogPlatformValidator.createTax().validate(
1321
+ {
1322
+ body,
1323
+ },
1324
+ { abortEarly: false, allowUnknown: true }
1325
+ );
1326
+ if (error) {
1327
+ return Promise.reject(new FDKClientValidationError(error));
1328
+ }
1329
+
1330
+ // Showing warrnings if extra unknown parameters are found
1331
+ const { error: warrning } = CatalogPlatformValidator.createTax().validate(
1332
+ {
1333
+ body,
1334
+ },
1335
+ { abortEarly: false, allowUnknown: false }
1336
+ );
1337
+ if (warrning) {
1338
+ Logger({
1339
+ level: "WARN",
1340
+ message: `Parameter Validation warrnings for platform > Catalog > createTax \n ${warrning}`,
1341
+ });
1342
+ }
1343
+
1344
+ const query_params = {};
1345
+
1346
+ const xHeaders = {};
1347
+
1348
+ const response = await PlatformAPIClient.execute(
1349
+ this.config,
1350
+ "post",
1351
+ `/service/platform/catalog/v1.0/company/${this.config.companyId}/taxes/rules/versions`,
1352
+ query_params,
1353
+ body,
1354
+ { ...xHeaders, ...requestHeaders },
1355
+ { responseHeaders }
1356
+ );
1357
+
1358
+ let responseData = response;
1359
+ if (responseHeaders) {
1360
+ responseData = response[0];
1361
+ }
1362
+
1363
+ const {
1364
+ error: res_error,
1365
+ } = CatalogPlatformModel.CreateTax().validate(responseData, {
1366
+ abortEarly: false,
1367
+ allowUnknown: true,
1368
+ });
1369
+
1370
+ if (res_error) {
1371
+ if (this.config.options.strictResponseCheck === true) {
1372
+ return Promise.reject(new FDKResponseValidationError(res_error));
1373
+ } else {
1374
+ Logger({
1375
+ level: "WARN",
1376
+ message: `Response Validation Warnings for platform > Catalog > createTax \n ${res_error}`,
1377
+ });
1378
+ }
1379
+ }
1380
+
1381
+ return response;
1382
+ }
1383
+
1384
+ /**
1385
+ * @param {CatalogPlatformValidator.CreateTaxComponentNameParam} arg - Arg object
1386
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1387
+ * @param {import("../PlatformAPIClient").Options} - Options
1388
+ * @returns {Promise<CatalogPlatformModel.TaxComponentRes>} - Success response
1389
+ * @name createTaxComponentName
1390
+ * @summary: Create component names
1391
+ * @description: Create component names for a product. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/catalog/createTaxComponentName/).
1392
+ */
1393
+ async createTaxComponentName(
1394
+ { body, requestHeaders } = { requestHeaders: {} },
1395
+ { responseHeaders } = { responseHeaders: false }
1396
+ ) {
1397
+ const {
1398
+ error,
1399
+ } = CatalogPlatformValidator.createTaxComponentName().validate(
1400
+ {
1401
+ body,
1402
+ },
1403
+ { abortEarly: false, allowUnknown: true }
1404
+ );
1405
+ if (error) {
1406
+ return Promise.reject(new FDKClientValidationError(error));
1407
+ }
1408
+
1409
+ // Showing warrnings if extra unknown parameters are found
1410
+ const {
1411
+ error: warrning,
1412
+ } = CatalogPlatformValidator.createTaxComponentName().validate(
1413
+ {
1414
+ body,
1415
+ },
1416
+ { abortEarly: false, allowUnknown: false }
1417
+ );
1418
+ if (warrning) {
1419
+ Logger({
1420
+ level: "WARN",
1421
+ message: `Parameter Validation warrnings for platform > Catalog > createTaxComponentName \n ${warrning}`,
1422
+ });
1423
+ }
1424
+
1425
+ const query_params = {};
1426
+
1427
+ const xHeaders = {};
1428
+
1429
+ const response = await PlatformAPIClient.execute(
1430
+ this.config,
1431
+ "post",
1432
+ `/service/platform/catalog/v1.0/company/${this.config.companyId}/taxes/component-names`,
1433
+ query_params,
1434
+ body,
1435
+ { ...xHeaders, ...requestHeaders },
1436
+ { responseHeaders }
1437
+ );
1438
+
1439
+ let responseData = response;
1440
+ if (responseHeaders) {
1441
+ responseData = response[0];
1442
+ }
1443
+
1444
+ const {
1445
+ error: res_error,
1446
+ } = CatalogPlatformModel.TaxComponentRes().validate(responseData, {
1447
+ abortEarly: false,
1448
+ allowUnknown: true,
1449
+ });
1450
+
1451
+ if (res_error) {
1452
+ if (this.config.options.strictResponseCheck === true) {
1453
+ return Promise.reject(new FDKResponseValidationError(res_error));
1454
+ } else {
1455
+ Logger({
1456
+ level: "WARN",
1457
+ message: `Response Validation Warnings for platform > Catalog > createTaxComponentName \n ${res_error}`,
1458
+ });
1459
+ }
1460
+ }
1461
+
1462
+ return response;
1463
+ }
1464
+
1465
+ /**
1466
+ * @param {CatalogPlatformValidator.CreateTaxVersionParam} arg - Arg object
1467
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1468
+ * @param {import("../PlatformAPIClient").Options} - Options
1469
+ * @returns {Promise<CatalogPlatformModel.TaxVersion>} - Success response
1470
+ * @name createTaxVersion
1471
+ * @summary: Create a tax version
1472
+ * @description: Creates a tax rule using the provided rule_id. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/catalog/createTaxVersion/).
1473
+ */
1474
+ async createTaxVersion(
1475
+ { ruleId, body, requestHeaders } = { requestHeaders: {} },
1476
+ { responseHeaders } = { responseHeaders: false }
1477
+ ) {
1478
+ const { error } = CatalogPlatformValidator.createTaxVersion().validate(
1479
+ {
1480
+ ruleId,
1481
+ body,
1482
+ },
1483
+ { abortEarly: false, allowUnknown: true }
1484
+ );
1485
+ if (error) {
1486
+ return Promise.reject(new FDKClientValidationError(error));
1487
+ }
1488
+
1489
+ // Showing warrnings if extra unknown parameters are found
1490
+ const {
1491
+ error: warrning,
1492
+ } = CatalogPlatformValidator.createTaxVersion().validate(
1493
+ {
1494
+ ruleId,
1495
+ body,
1496
+ },
1497
+ { abortEarly: false, allowUnknown: false }
1498
+ );
1499
+ if (warrning) {
1500
+ Logger({
1501
+ level: "WARN",
1502
+ message: `Parameter Validation warrnings for platform > Catalog > createTaxVersion \n ${warrning}`,
1503
+ });
1504
+ }
1505
+
1506
+ const query_params = {};
1507
+
1508
+ const xHeaders = {};
1509
+
1510
+ const response = await PlatformAPIClient.execute(
1511
+ this.config,
1512
+ "post",
1513
+ `/service/platform/catalog/v1.0/company/${this.config.companyId}/taxes/rules/${ruleId}/versions`,
1514
+ query_params,
1515
+ body,
1516
+ { ...xHeaders, ...requestHeaders },
1517
+ { responseHeaders }
1518
+ );
1519
+
1520
+ let responseData = response;
1521
+ if (responseHeaders) {
1522
+ responseData = response[0];
1523
+ }
1524
+
1525
+ const {
1526
+ error: res_error,
1527
+ } = CatalogPlatformModel.TaxVersion().validate(responseData, {
1528
+ abortEarly: false,
1529
+ allowUnknown: true,
1530
+ });
1531
+
1532
+ if (res_error) {
1533
+ if (this.config.options.strictResponseCheck === true) {
1534
+ return Promise.reject(new FDKResponseValidationError(res_error));
1535
+ } else {
1536
+ Logger({
1537
+ level: "WARN",
1538
+ message: `Response Validation Warnings for platform > Catalog > createTaxVersion \n ${res_error}`,
1539
+ });
1540
+ }
1541
+ }
1542
+
1543
+ return response;
1544
+ }
1545
+
1228
1546
  /**
1229
1547
  * @param {CatalogPlatformValidator.DeleteBulkInventoryJobParam} arg - Arg object
1230
1548
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
@@ -1631,6 +1949,153 @@ class Catalog {
1631
1949
  return response;
1632
1950
  }
1633
1951
 
1952
+ /**
1953
+ * @param {CatalogPlatformValidator.DeleteTaxRuleParam} arg - Arg object
1954
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1955
+ * @param {import("../PlatformAPIClient").Options} - Options
1956
+ * @returns {Promise<Object>} - Success response
1957
+ * @name deleteTaxRule
1958
+ * @summary: Delete a tax rule
1959
+ * @description: Deletes a tax rule along with all its versions using the provided rule_id. You can not delete a rule if 1. it is the default tax rule 2. it is applied to any product. You will need to set any other tax rule as default or will need to attach a different tax rule to the products, then only you can delete the rule.
1960
+ * - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/catalog/deleteTaxRule/).
1961
+ */
1962
+ async deleteTaxRule(
1963
+ { ruleId, requestHeaders } = { requestHeaders: {} },
1964
+ { responseHeaders } = { responseHeaders: false }
1965
+ ) {
1966
+ const { error } = CatalogPlatformValidator.deleteTaxRule().validate(
1967
+ { ruleId },
1968
+ { abortEarly: false, allowUnknown: true }
1969
+ );
1970
+ if (error) {
1971
+ return Promise.reject(new FDKClientValidationError(error));
1972
+ }
1973
+
1974
+ // Showing warrnings if extra unknown parameters are found
1975
+ const {
1976
+ error: warrning,
1977
+ } = CatalogPlatformValidator.deleteTaxRule().validate(
1978
+ { ruleId },
1979
+ { abortEarly: false, allowUnknown: false }
1980
+ );
1981
+ if (warrning) {
1982
+ Logger({
1983
+ level: "WARN",
1984
+ message: `Parameter Validation warrnings for platform > Catalog > deleteTaxRule \n ${warrning}`,
1985
+ });
1986
+ }
1987
+
1988
+ const query_params = {};
1989
+
1990
+ const xHeaders = {};
1991
+
1992
+ const response = await PlatformAPIClient.execute(
1993
+ this.config,
1994
+ "delete",
1995
+ `/service/platform/catalog/v1.0/company/${this.config.companyId}/taxes/rules/${ruleId}`,
1996
+ query_params,
1997
+ undefined,
1998
+ { ...xHeaders, ...requestHeaders },
1999
+ { responseHeaders }
2000
+ );
2001
+
2002
+ let responseData = response;
2003
+ if (responseHeaders) {
2004
+ responseData = response[0];
2005
+ }
2006
+
2007
+ const { error: res_error } = Joi.any().validate(responseData, {
2008
+ abortEarly: false,
2009
+ allowUnknown: true,
2010
+ });
2011
+
2012
+ if (res_error) {
2013
+ if (this.config.options.strictResponseCheck === true) {
2014
+ return Promise.reject(new FDKResponseValidationError(res_error));
2015
+ } else {
2016
+ Logger({
2017
+ level: "WARN",
2018
+ message: `Response Validation Warnings for platform > Catalog > deleteTaxRule \n ${res_error}`,
2019
+ });
2020
+ }
2021
+ }
2022
+
2023
+ return response;
2024
+ }
2025
+
2026
+ /**
2027
+ * @param {CatalogPlatformValidator.DeleteTaxVersionParam} arg - Arg object
2028
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
2029
+ * @param {import("../PlatformAPIClient").Options} - Options
2030
+ * @returns {Promise<Object>} - Success response
2031
+ * @name deleteTaxVersion
2032
+ * @summary: Delete a tax version
2033
+ * @description: Deletes a tax rule using the provided rule_id. On future/scheduled version can be deleted. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/catalog/deleteTaxVersion/).
2034
+ */
2035
+ async deleteTaxVersion(
2036
+ { ruleId, versionId, requestHeaders } = { requestHeaders: {} },
2037
+ { responseHeaders } = { responseHeaders: false }
2038
+ ) {
2039
+ const { error } = CatalogPlatformValidator.deleteTaxVersion().validate(
2040
+ { ruleId, versionId },
2041
+ { abortEarly: false, allowUnknown: true }
2042
+ );
2043
+ if (error) {
2044
+ return Promise.reject(new FDKClientValidationError(error));
2045
+ }
2046
+
2047
+ // Showing warrnings if extra unknown parameters are found
2048
+ const {
2049
+ error: warrning,
2050
+ } = CatalogPlatformValidator.deleteTaxVersion().validate(
2051
+ { ruleId, versionId },
2052
+ { abortEarly: false, allowUnknown: false }
2053
+ );
2054
+ if (warrning) {
2055
+ Logger({
2056
+ level: "WARN",
2057
+ message: `Parameter Validation warrnings for platform > Catalog > deleteTaxVersion \n ${warrning}`,
2058
+ });
2059
+ }
2060
+
2061
+ const query_params = {};
2062
+
2063
+ const xHeaders = {};
2064
+
2065
+ const response = await PlatformAPIClient.execute(
2066
+ this.config,
2067
+ "delete",
2068
+ `/service/platform/catalog/v1.0/company/${this.config.companyId}/taxes/rules/${ruleId}/versions/${versionId}`,
2069
+ query_params,
2070
+ undefined,
2071
+ { ...xHeaders, ...requestHeaders },
2072
+ { responseHeaders }
2073
+ );
2074
+
2075
+ let responseData = response;
2076
+ if (responseHeaders) {
2077
+ responseData = response[0];
2078
+ }
2079
+
2080
+ const { error: res_error } = Joi.any().validate(responseData, {
2081
+ abortEarly: false,
2082
+ allowUnknown: true,
2083
+ });
2084
+
2085
+ if (res_error) {
2086
+ if (this.config.options.strictResponseCheck === true) {
2087
+ return Promise.reject(new FDKResponseValidationError(res_error));
2088
+ } else {
2089
+ Logger({
2090
+ level: "WARN",
2091
+ message: `Response Validation Warnings for platform > Catalog > deleteTaxVersion \n ${res_error}`,
2092
+ });
2093
+ }
2094
+ }
2095
+
2096
+ return response;
2097
+ }
2098
+
1634
2099
  /**
1635
2100
  * @param {CatalogPlatformValidator.DownloadInventoryTemplateViewParam} arg
1636
2101
  * - Arg object
@@ -1847,7 +2312,7 @@ class Catalog {
1847
2312
  const response = await PlatformAPIClient.execute(
1848
2313
  this.config,
1849
2314
  "put",
1850
- `/service/platform/catalog/v2.0/company/${this.config.companyId}/products/${itemId}/`,
2315
+ `/service/platform/catalog/v3.0/company/${this.config.companyId}/products/${itemId}/`,
1851
2316
  query_params,
1852
2317
  body,
1853
2318
  { ...xHeaders, ...requestHeaders },
@@ -2043,7 +2508,101 @@ class Catalog {
2043
2508
  } else {
2044
2509
  Logger({
2045
2510
  level: "WARN",
2046
- message: `Response Validation Warnings for platform > Catalog > getAllProductHsnCodes \n ${res_error}`,
2511
+ message: `Response Validation Warnings for platform > Catalog > getAllProductHsnCodes \n ${res_error}`,
2512
+ });
2513
+ }
2514
+ }
2515
+
2516
+ return response;
2517
+ }
2518
+
2519
+ /**
2520
+ * @param {CatalogPlatformValidator.GetAllTaxRulesParam} arg - Arg object
2521
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
2522
+ * @param {import("../PlatformAPIClient").Options} - Options
2523
+ * @returns {Promise<CatalogPlatformModel.TaxRules>} - Success response
2524
+ * @name getAllTaxRules
2525
+ * @summary: Get all tax rules of a company
2526
+ * @description: Returns array of all tax rules of a company - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/catalog/getAllTaxRules/).
2527
+ */
2528
+ async getAllTaxRules(
2529
+ { q, statuses, page, limit, versionStatus, requestHeaders } = {
2530
+ requestHeaders: {},
2531
+ },
2532
+ { responseHeaders } = { responseHeaders: false }
2533
+ ) {
2534
+ const { error } = CatalogPlatformValidator.getAllTaxRules().validate(
2535
+ {
2536
+ q,
2537
+ statuses,
2538
+ page,
2539
+ limit,
2540
+ versionStatus,
2541
+ },
2542
+ { abortEarly: false, allowUnknown: true }
2543
+ );
2544
+ if (error) {
2545
+ return Promise.reject(new FDKClientValidationError(error));
2546
+ }
2547
+
2548
+ // Showing warrnings if extra unknown parameters are found
2549
+ const {
2550
+ error: warrning,
2551
+ } = CatalogPlatformValidator.getAllTaxRules().validate(
2552
+ {
2553
+ q,
2554
+ statuses,
2555
+ page,
2556
+ limit,
2557
+ versionStatus,
2558
+ },
2559
+ { abortEarly: false, allowUnknown: false }
2560
+ );
2561
+ if (warrning) {
2562
+ Logger({
2563
+ level: "WARN",
2564
+ message: `Parameter Validation warrnings for platform > Catalog > getAllTaxRules \n ${warrning}`,
2565
+ });
2566
+ }
2567
+
2568
+ const query_params = {};
2569
+ query_params["q"] = q;
2570
+ query_params["statuses"] = statuses;
2571
+ query_params["page"] = page;
2572
+ query_params["limit"] = limit;
2573
+ query_params["version_status"] = versionStatus;
2574
+
2575
+ const xHeaders = {};
2576
+
2577
+ const response = await PlatformAPIClient.execute(
2578
+ this.config,
2579
+ "get",
2580
+ `/service/platform/catalog/v1.0/company/${this.config.companyId}/taxes/rules`,
2581
+ query_params,
2582
+ undefined,
2583
+ { ...xHeaders, ...requestHeaders },
2584
+ { responseHeaders }
2585
+ );
2586
+
2587
+ let responseData = response;
2588
+ if (responseHeaders) {
2589
+ responseData = response[0];
2590
+ }
2591
+
2592
+ const {
2593
+ error: res_error,
2594
+ } = CatalogPlatformModel.TaxRules().validate(responseData, {
2595
+ abortEarly: false,
2596
+ allowUnknown: true,
2597
+ });
2598
+
2599
+ if (res_error) {
2600
+ if (this.config.options.strictResponseCheck === true) {
2601
+ return Promise.reject(new FDKResponseValidationError(res_error));
2602
+ } else {
2603
+ Logger({
2604
+ level: "WARN",
2605
+ message: `Response Validation Warnings for platform > Catalog > getAllTaxRules \n ${res_error}`,
2047
2606
  });
2048
2607
  }
2049
2608
  }
@@ -2535,6 +3094,96 @@ class Catalog {
2535
3094
  return response;
2536
3095
  }
2537
3096
 
3097
+ /**
3098
+ * @param {CatalogPlatformValidator.GetHsCodesParam} arg - Arg object
3099
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
3100
+ * @param {import("../PlatformAPIClient").Options} - Options
3101
+ * @returns {Promise<CatalogPlatformModel.HSCodes>} - Success response
3102
+ * @name getHsCodes
3103
+ * @summary: Get HS/SAC codes
3104
+ * @description: Retrieve a list of HS (Harmonized System) or SAC (Service Accounting Code) codes for a company.
3105
+ * HS codes are used for classifying goods in international trade, while SAC codes are used for classifying services for taxation purposes.
3106
+ * Supports optional filtering and pagination.
3107
+ * - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/catalog/getHsCodes/).
3108
+ */
3109
+ async getHsCodes(
3110
+ { page, limit, type, q, requestHeaders } = { requestHeaders: {} },
3111
+ { responseHeaders } = { responseHeaders: false }
3112
+ ) {
3113
+ const { error } = CatalogPlatformValidator.getHsCodes().validate(
3114
+ {
3115
+ page,
3116
+ limit,
3117
+ type,
3118
+ q,
3119
+ },
3120
+ { abortEarly: false, allowUnknown: true }
3121
+ );
3122
+ if (error) {
3123
+ return Promise.reject(new FDKClientValidationError(error));
3124
+ }
3125
+
3126
+ // Showing warrnings if extra unknown parameters are found
3127
+ const { error: warrning } = CatalogPlatformValidator.getHsCodes().validate(
3128
+ {
3129
+ page,
3130
+ limit,
3131
+ type,
3132
+ q,
3133
+ },
3134
+ { abortEarly: false, allowUnknown: false }
3135
+ );
3136
+ if (warrning) {
3137
+ Logger({
3138
+ level: "WARN",
3139
+ message: `Parameter Validation warrnings for platform > Catalog > getHsCodes \n ${warrning}`,
3140
+ });
3141
+ }
3142
+
3143
+ const query_params = {};
3144
+ query_params["page"] = page;
3145
+ query_params["limit"] = limit;
3146
+ query_params["type"] = type;
3147
+ query_params["q"] = q;
3148
+
3149
+ const xHeaders = {};
3150
+
3151
+ const response = await PlatformAPIClient.execute(
3152
+ this.config,
3153
+ "get",
3154
+ `/service/platform/catalog/v1.0/company/${this.config.companyId}/taxes/hscodes`,
3155
+ query_params,
3156
+ undefined,
3157
+ { ...xHeaders, ...requestHeaders },
3158
+ { responseHeaders }
3159
+ );
3160
+
3161
+ let responseData = response;
3162
+ if (responseHeaders) {
3163
+ responseData = response[0];
3164
+ }
3165
+
3166
+ const {
3167
+ error: res_error,
3168
+ } = CatalogPlatformModel.HSCodes().validate(responseData, {
3169
+ abortEarly: false,
3170
+ allowUnknown: true,
3171
+ });
3172
+
3173
+ if (res_error) {
3174
+ if (this.config.options.strictResponseCheck === true) {
3175
+ return Promise.reject(new FDKResponseValidationError(res_error));
3176
+ } else {
3177
+ Logger({
3178
+ level: "WARN",
3179
+ message: `Response Validation Warnings for platform > Catalog > getHsCodes \n ${res_error}`,
3180
+ });
3181
+ }
3182
+ }
3183
+
3184
+ return response;
3185
+ }
3186
+
2538
3187
  /**
2539
3188
  * @param {CatalogPlatformValidator.GetHsnCodeParam} arg - Arg object
2540
3189
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
@@ -4946,29 +5595,233 @@ class Catalog {
4946
5595
  }
4947
5596
 
4948
5597
  /**
4949
- * @param {CatalogPlatformValidator.GetSizeGuidesParam} arg - Arg object
5598
+ * @param {CatalogPlatformValidator.GetSizeGuidesParam} arg - Arg object
5599
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
5600
+ * @param {import("../PlatformAPIClient").Options} - Options
5601
+ * @returns {Promise<CatalogPlatformModel.ListSizeGuide>} - Success response
5602
+ * @name getSizeGuides
5603
+ * @summary: List size guides
5604
+ * @description: Allows to view all the size guides associated to the seller. Each size guide contains meta deta like header values like for shoulder, head, etc. and measurement unit like cm and values contains sizes for the same. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/catalog/getSizeGuides/).
5605
+ */
5606
+ async getSizeGuides(
5607
+ { active, q, tag, pageNo, pageSize, brandId, requestHeaders } = {
5608
+ requestHeaders: {},
5609
+ },
5610
+ { responseHeaders } = { responseHeaders: false }
5611
+ ) {
5612
+ const { error } = CatalogPlatformValidator.getSizeGuides().validate(
5613
+ {
5614
+ active,
5615
+ q,
5616
+ tag,
5617
+ pageNo,
5618
+ pageSize,
5619
+ brandId,
5620
+ },
5621
+ { abortEarly: false, allowUnknown: true }
5622
+ );
5623
+ if (error) {
5624
+ return Promise.reject(new FDKClientValidationError(error));
5625
+ }
5626
+
5627
+ // Showing warrnings if extra unknown parameters are found
5628
+ const {
5629
+ error: warrning,
5630
+ } = CatalogPlatformValidator.getSizeGuides().validate(
5631
+ {
5632
+ active,
5633
+ q,
5634
+ tag,
5635
+ pageNo,
5636
+ pageSize,
5637
+ brandId,
5638
+ },
5639
+ { abortEarly: false, allowUnknown: false }
5640
+ );
5641
+ if (warrning) {
5642
+ Logger({
5643
+ level: "WARN",
5644
+ message: `Parameter Validation warrnings for platform > Catalog > getSizeGuides \n ${warrning}`,
5645
+ });
5646
+ }
5647
+
5648
+ const query_params = {};
5649
+ query_params["active"] = active;
5650
+ query_params["q"] = q;
5651
+ query_params["tag"] = tag;
5652
+ query_params["page_no"] = pageNo;
5653
+ query_params["page_size"] = pageSize;
5654
+ query_params["brand_id"] = brandId;
5655
+
5656
+ const xHeaders = {};
5657
+
5658
+ const response = await PlatformAPIClient.execute(
5659
+ this.config,
5660
+ "get",
5661
+ `/service/platform/catalog/v1.0/company/${this.config.companyId}/sizeguide`,
5662
+ query_params,
5663
+ undefined,
5664
+ { ...xHeaders, ...requestHeaders },
5665
+ { responseHeaders }
5666
+ );
5667
+
5668
+ let responseData = response;
5669
+ if (responseHeaders) {
5670
+ responseData = response[0];
5671
+ }
5672
+
5673
+ const {
5674
+ error: res_error,
5675
+ } = CatalogPlatformModel.ListSizeGuide().validate(responseData, {
5676
+ abortEarly: false,
5677
+ allowUnknown: true,
5678
+ });
5679
+
5680
+ if (res_error) {
5681
+ if (this.config.options.strictResponseCheck === true) {
5682
+ return Promise.reject(new FDKResponseValidationError(res_error));
5683
+ } else {
5684
+ Logger({
5685
+ level: "WARN",
5686
+ message: `Response Validation Warnings for platform > Catalog > getSizeGuides \n ${res_error}`,
5687
+ });
5688
+ }
5689
+ }
5690
+
5691
+ return response;
5692
+ }
5693
+
5694
+ /**
5695
+ * @param {CatalogPlatformValidator.GetStoreDetailParam} arg - Arg object
5696
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
5697
+ * @param {import("../PlatformAPIClient").Options} - Options
5698
+ * @returns {Promise<CatalogPlatformModel.OptinStoreDetails>} - Success response
5699
+ * @name getStoreDetail
5700
+ * @summary: Get selling location
5701
+ * @description: Retrieve the details of the selling location (store) associated with a specific company passed. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/catalog/getStoreDetail/).
5702
+ */
5703
+ async getStoreDetail(
5704
+ { q, pageNo, pageSize, requestHeaders } = { requestHeaders: {} },
5705
+ { responseHeaders } = { responseHeaders: false }
5706
+ ) {
5707
+ const { error } = CatalogPlatformValidator.getStoreDetail().validate(
5708
+ {
5709
+ q,
5710
+ pageNo,
5711
+ pageSize,
5712
+ },
5713
+ { abortEarly: false, allowUnknown: true }
5714
+ );
5715
+ if (error) {
5716
+ return Promise.reject(new FDKClientValidationError(error));
5717
+ }
5718
+
5719
+ // Showing warrnings if extra unknown parameters are found
5720
+ const {
5721
+ error: warrning,
5722
+ } = CatalogPlatformValidator.getStoreDetail().validate(
5723
+ {
5724
+ q,
5725
+ pageNo,
5726
+ pageSize,
5727
+ },
5728
+ { abortEarly: false, allowUnknown: false }
5729
+ );
5730
+ if (warrning) {
5731
+ Logger({
5732
+ level: "WARN",
5733
+ message: `Parameter Validation warrnings for platform > Catalog > getStoreDetail \n ${warrning}`,
5734
+ });
5735
+ }
5736
+
5737
+ const query_params = {};
5738
+ query_params["q"] = q;
5739
+ query_params["page_no"] = pageNo;
5740
+ query_params["page_size"] = pageSize;
5741
+
5742
+ const xHeaders = {};
5743
+
5744
+ const response = await PlatformAPIClient.execute(
5745
+ this.config,
5746
+ "get",
5747
+ `/service/platform/catalog/v2.0/company/${this.config.companyId}/marketplaces/location-details/`,
5748
+ query_params,
5749
+ undefined,
5750
+ { ...xHeaders, ...requestHeaders },
5751
+ { responseHeaders }
5752
+ );
5753
+
5754
+ let responseData = response;
5755
+ if (responseHeaders) {
5756
+ responseData = response[0];
5757
+ }
5758
+
5759
+ const {
5760
+ error: res_error,
5761
+ } = CatalogPlatformModel.OptinStoreDetails().validate(responseData, {
5762
+ abortEarly: false,
5763
+ allowUnknown: true,
5764
+ });
5765
+
5766
+ if (res_error) {
5767
+ if (this.config.options.strictResponseCheck === true) {
5768
+ return Promise.reject(new FDKResponseValidationError(res_error));
5769
+ } else {
5770
+ Logger({
5771
+ level: "WARN",
5772
+ message: `Response Validation Warnings for platform > Catalog > getStoreDetail \n ${res_error}`,
5773
+ });
5774
+ }
5775
+ }
5776
+
5777
+ return response;
5778
+ }
5779
+
5780
+ /**
5781
+ * @param {Object} arg - Arg object.
5782
+ * @param {string} [arg.q] - The search related the store for the company id.
5783
+ * @param {number} [arg.pageSize] - Number of records that can be seen on
5784
+ * the page for the company id.
5785
+ * @returns {Paginator<CatalogPlatformModel.OptinStoreDetails>}
5786
+ * @summary: Get selling location
5787
+ * @description: Retrieve the details of the selling location (store) associated with a specific company passed.
5788
+ */
5789
+ getStoreDetailPaginator({ q, pageSize } = {}) {
5790
+ const paginator = new Paginator();
5791
+ const callback = async () => {
5792
+ const pageId = paginator.nextId;
5793
+ const pageNo = paginator.pageNo;
5794
+ const pageType = "number";
5795
+ const data = await this.getStoreDetail({
5796
+ q: q,
5797
+ pageNo: pageNo,
5798
+ pageSize: pageSize,
5799
+ });
5800
+ paginator.setPaginator({
5801
+ hasNext: data.page.has_next ? true : false,
5802
+ nextId: data.page.next_id,
5803
+ });
5804
+ return data;
5805
+ };
5806
+ paginator.setCallback(callback.bind(this));
5807
+ return paginator;
5808
+ }
5809
+
5810
+ /**
5811
+ * @param {CatalogPlatformValidator.GetTaxComponentNamesParam} arg - Arg object
4950
5812
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
4951
5813
  * @param {import("../PlatformAPIClient").Options} - Options
4952
- * @returns {Promise<CatalogPlatformModel.ListSizeGuide>} - Success response
4953
- * @name getSizeGuides
4954
- * @summary: List size guides
4955
- * @description: Allows to view all the size guides associated to the seller. Each size guide contains meta deta like header values like for shoulder, head, etc. and measurement unit like cm and values contains sizes for the same. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/catalog/getSizeGuides/).
5814
+ * @returns {Promise<CatalogPlatformModel.GetTaxComponents>} - Success response
5815
+ * @name getTaxComponentNames
5816
+ * @summary: Get component names
5817
+ * @description: Get component names for a company. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/catalog/getTaxComponentNames/).
4956
5818
  */
4957
- async getSizeGuides(
4958
- { active, q, tag, pageNo, pageSize, brandId, requestHeaders } = {
4959
- requestHeaders: {},
4960
- },
5819
+ async getTaxComponentNames(
5820
+ { requestHeaders } = { requestHeaders: {} },
4961
5821
  { responseHeaders } = { responseHeaders: false }
4962
5822
  ) {
4963
- const { error } = CatalogPlatformValidator.getSizeGuides().validate(
4964
- {
4965
- active,
4966
- q,
4967
- tag,
4968
- pageNo,
4969
- pageSize,
4970
- brandId,
4971
- },
5823
+ const { error } = CatalogPlatformValidator.getTaxComponentNames().validate(
5824
+ {},
4972
5825
  { abortEarly: false, allowUnknown: true }
4973
5826
  );
4974
5827
  if (error) {
@@ -4978,38 +5831,25 @@ class Catalog {
4978
5831
  // Showing warrnings if extra unknown parameters are found
4979
5832
  const {
4980
5833
  error: warrning,
4981
- } = CatalogPlatformValidator.getSizeGuides().validate(
4982
- {
4983
- active,
4984
- q,
4985
- tag,
4986
- pageNo,
4987
- pageSize,
4988
- brandId,
4989
- },
5834
+ } = CatalogPlatformValidator.getTaxComponentNames().validate(
5835
+ {},
4990
5836
  { abortEarly: false, allowUnknown: false }
4991
5837
  );
4992
5838
  if (warrning) {
4993
5839
  Logger({
4994
5840
  level: "WARN",
4995
- message: `Parameter Validation warrnings for platform > Catalog > getSizeGuides \n ${warrning}`,
5841
+ message: `Parameter Validation warrnings for platform > Catalog > getTaxComponentNames \n ${warrning}`,
4996
5842
  });
4997
5843
  }
4998
5844
 
4999
5845
  const query_params = {};
5000
- query_params["active"] = active;
5001
- query_params["q"] = q;
5002
- query_params["tag"] = tag;
5003
- query_params["page_no"] = pageNo;
5004
- query_params["page_size"] = pageSize;
5005
- query_params["brand_id"] = brandId;
5006
5846
 
5007
5847
  const xHeaders = {};
5008
5848
 
5009
5849
  const response = await PlatformAPIClient.execute(
5010
5850
  this.config,
5011
5851
  "get",
5012
- `/service/platform/catalog/v1.0/company/${this.config.companyId}/sizeguide`,
5852
+ `/service/platform/catalog/v1.0/company/${this.config.companyId}/taxes/component-names`,
5013
5853
  query_params,
5014
5854
  undefined,
5015
5855
  { ...xHeaders, ...requestHeaders },
@@ -5023,7 +5863,7 @@ class Catalog {
5023
5863
 
5024
5864
  const {
5025
5865
  error: res_error,
5026
- } = CatalogPlatformModel.ListSizeGuide().validate(responseData, {
5866
+ } = CatalogPlatformModel.GetTaxComponents().validate(responseData, {
5027
5867
  abortEarly: false,
5028
5868
  allowUnknown: true,
5029
5869
  });
@@ -5034,7 +5874,7 @@ class Catalog {
5034
5874
  } else {
5035
5875
  Logger({
5036
5876
  level: "WARN",
5037
- message: `Response Validation Warnings for platform > Catalog > getSizeGuides \n ${res_error}`,
5877
+ message: `Response Validation Warnings for platform > Catalog > getTaxComponentNames \n ${res_error}`,
5038
5878
  });
5039
5879
  }
5040
5880
  }
@@ -5043,23 +5883,26 @@ class Catalog {
5043
5883
  }
5044
5884
 
5045
5885
  /**
5046
- * @param {CatalogPlatformValidator.GetStoreDetailParam} arg - Arg object
5886
+ * @param {CatalogPlatformValidator.GetTaxVersionDetailsParam} arg - Arg object
5047
5887
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
5048
5888
  * @param {import("../PlatformAPIClient").Options} - Options
5049
- * @returns {Promise<CatalogPlatformModel.OptinStoreDetails>} - Success response
5050
- * @name getStoreDetail
5051
- * @summary: Get selling location
5052
- * @description: Retrieve the details of the selling location (store) associated with a specific company passed. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/catalog/getStoreDetail/).
5889
+ * @returns {Promise<CatalogPlatformModel.TaxRuleVersion>} - Success response
5890
+ * @name getTaxVersionDetails
5891
+ * @summary: Get tax versions for a tax rule
5892
+ * @description: Retrieve versions of a tax rule with support for filtering by query parameters (e.g., live, past, all). - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/catalog/getTaxVersionDetails/).
5053
5893
  */
5054
- async getStoreDetail(
5055
- { q, pageNo, pageSize, requestHeaders } = { requestHeaders: {} },
5894
+ async getTaxVersionDetails(
5895
+ { ruleId, versionStatus, limit, page, requestHeaders } = {
5896
+ requestHeaders: {},
5897
+ },
5056
5898
  { responseHeaders } = { responseHeaders: false }
5057
5899
  ) {
5058
- const { error } = CatalogPlatformValidator.getStoreDetail().validate(
5900
+ const { error } = CatalogPlatformValidator.getTaxVersionDetails().validate(
5059
5901
  {
5060
- q,
5061
- pageNo,
5062
- pageSize,
5902
+ ruleId,
5903
+ versionStatus,
5904
+ limit,
5905
+ page,
5063
5906
  },
5064
5907
  { abortEarly: false, allowUnknown: true }
5065
5908
  );
@@ -5070,32 +5913,33 @@ class Catalog {
5070
5913
  // Showing warrnings if extra unknown parameters are found
5071
5914
  const {
5072
5915
  error: warrning,
5073
- } = CatalogPlatformValidator.getStoreDetail().validate(
5916
+ } = CatalogPlatformValidator.getTaxVersionDetails().validate(
5074
5917
  {
5075
- q,
5076
- pageNo,
5077
- pageSize,
5918
+ ruleId,
5919
+ versionStatus,
5920
+ limit,
5921
+ page,
5078
5922
  },
5079
5923
  { abortEarly: false, allowUnknown: false }
5080
5924
  );
5081
5925
  if (warrning) {
5082
5926
  Logger({
5083
5927
  level: "WARN",
5084
- message: `Parameter Validation warrnings for platform > Catalog > getStoreDetail \n ${warrning}`,
5928
+ message: `Parameter Validation warrnings for platform > Catalog > getTaxVersionDetails \n ${warrning}`,
5085
5929
  });
5086
5930
  }
5087
5931
 
5088
5932
  const query_params = {};
5089
- query_params["q"] = q;
5090
- query_params["page_no"] = pageNo;
5091
- query_params["page_size"] = pageSize;
5933
+ query_params["version_status"] = versionStatus;
5934
+ query_params["limit"] = limit;
5935
+ query_params["page"] = page;
5092
5936
 
5093
5937
  const xHeaders = {};
5094
5938
 
5095
5939
  const response = await PlatformAPIClient.execute(
5096
5940
  this.config,
5097
5941
  "get",
5098
- `/service/platform/catalog/v2.0/company/${this.config.companyId}/marketplaces/location-details/`,
5942
+ `/service/platform/catalog/v1.0/company/${this.config.companyId}/taxes/rules/${ruleId}/versions`,
5099
5943
  query_params,
5100
5944
  undefined,
5101
5945
  { ...xHeaders, ...requestHeaders },
@@ -5109,7 +5953,7 @@ class Catalog {
5109
5953
 
5110
5954
  const {
5111
5955
  error: res_error,
5112
- } = CatalogPlatformModel.OptinStoreDetails().validate(responseData, {
5956
+ } = CatalogPlatformModel.TaxRuleVersion().validate(responseData, {
5113
5957
  abortEarly: false,
5114
5958
  allowUnknown: true,
5115
5959
  });
@@ -5120,7 +5964,7 @@ class Catalog {
5120
5964
  } else {
5121
5965
  Logger({
5122
5966
  level: "WARN",
5123
- message: `Response Validation Warnings for platform > Catalog > getStoreDetail \n ${res_error}`,
5967
+ message: `Response Validation Warnings for platform > Catalog > getTaxVersionDetails \n ${res_error}`,
5124
5968
  });
5125
5969
  }
5126
5970
  }
@@ -5128,36 +5972,6 @@ class Catalog {
5128
5972
  return response;
5129
5973
  }
5130
5974
 
5131
- /**
5132
- * @param {Object} arg - Arg object.
5133
- * @param {string} [arg.q] - The search related the store for the company id.
5134
- * @param {number} [arg.pageSize] - Number of records that can be seen on
5135
- * the page for the company id.
5136
- * @returns {Paginator<CatalogPlatformModel.OptinStoreDetails>}
5137
- * @summary: Get selling location
5138
- * @description: Retrieve the details of the selling location (store) associated with a specific company passed.
5139
- */
5140
- getStoreDetailPaginator({ q, pageSize } = {}) {
5141
- const paginator = new Paginator();
5142
- const callback = async () => {
5143
- const pageId = paginator.nextId;
5144
- const pageNo = paginator.pageNo;
5145
- const pageType = "number";
5146
- const data = await this.getStoreDetail({
5147
- q: q,
5148
- pageNo: pageNo,
5149
- pageSize: pageSize,
5150
- });
5151
- paginator.setPaginator({
5152
- hasNext: data.page.has_next ? true : false,
5153
- nextId: data.page.next_id,
5154
- });
5155
- return data;
5156
- };
5157
- paginator.setCallback(callback.bind(this));
5158
- return paginator;
5159
- }
5160
-
5161
5975
  /**
5162
5976
  * @param {CatalogPlatformValidator.GetVariantsOfProductsParam} arg - Arg object
5163
5977
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
@@ -6765,6 +7579,172 @@ class Catalog {
6765
7579
  return response;
6766
7580
  }
6767
7581
 
7582
+ /**
7583
+ * @param {CatalogPlatformValidator.UpdateTaxRuleParam} arg - Arg object
7584
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
7585
+ * @param {import("../PlatformAPIClient").Options} - Options
7586
+ * @returns {Promise<CatalogPlatformModel.TaxRule>} - Success response
7587
+ * @name updateTaxRule
7588
+ * @summary: Update a Tax Rule for a Product
7589
+ * @description: Update an existing tax rule under a specific company. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/catalog/updateTaxRule/).
7590
+ */
7591
+ async updateTaxRule(
7592
+ { ruleId, body, requestHeaders } = { requestHeaders: {} },
7593
+ { responseHeaders } = { responseHeaders: false }
7594
+ ) {
7595
+ const { error } = CatalogPlatformValidator.updateTaxRule().validate(
7596
+ {
7597
+ ruleId,
7598
+ body,
7599
+ },
7600
+ { abortEarly: false, allowUnknown: true }
7601
+ );
7602
+ if (error) {
7603
+ return Promise.reject(new FDKClientValidationError(error));
7604
+ }
7605
+
7606
+ // Showing warrnings if extra unknown parameters are found
7607
+ const {
7608
+ error: warrning,
7609
+ } = CatalogPlatformValidator.updateTaxRule().validate(
7610
+ {
7611
+ ruleId,
7612
+ body,
7613
+ },
7614
+ { abortEarly: false, allowUnknown: false }
7615
+ );
7616
+ if (warrning) {
7617
+ Logger({
7618
+ level: "WARN",
7619
+ message: `Parameter Validation warrnings for platform > Catalog > updateTaxRule \n ${warrning}`,
7620
+ });
7621
+ }
7622
+
7623
+ const query_params = {};
7624
+
7625
+ const xHeaders = {};
7626
+
7627
+ const response = await PlatformAPIClient.execute(
7628
+ this.config,
7629
+ "put",
7630
+ `/service/platform/catalog/v1.0/company/${this.config.companyId}/taxes/rules/${ruleId}`,
7631
+ query_params,
7632
+ body,
7633
+ { ...xHeaders, ...requestHeaders },
7634
+ { responseHeaders }
7635
+ );
7636
+
7637
+ let responseData = response;
7638
+ if (responseHeaders) {
7639
+ responseData = response[0];
7640
+ }
7641
+
7642
+ const {
7643
+ error: res_error,
7644
+ } = CatalogPlatformModel.TaxRule().validate(responseData, {
7645
+ abortEarly: false,
7646
+ allowUnknown: true,
7647
+ });
7648
+
7649
+ if (res_error) {
7650
+ if (this.config.options.strictResponseCheck === true) {
7651
+ return Promise.reject(new FDKResponseValidationError(res_error));
7652
+ } else {
7653
+ Logger({
7654
+ level: "WARN",
7655
+ message: `Response Validation Warnings for platform > Catalog > updateTaxRule \n ${res_error}`,
7656
+ });
7657
+ }
7658
+ }
7659
+
7660
+ return response;
7661
+ }
7662
+
7663
+ /**
7664
+ * @param {CatalogPlatformValidator.UpdateTaxVersionParam} arg - Arg object
7665
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
7666
+ * @param {import("../PlatformAPIClient").Options} - Options
7667
+ * @returns {Promise<CatalogPlatformModel.TaxVersion>} - Success response
7668
+ * @name updateTaxVersion
7669
+ * @summary: Update a tax version
7670
+ * @description: Updates a tax rule using the provided rule_id. You can update any part of a scheduled version but only tax name of live version can be updated. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/catalog/updateTaxVersion/).
7671
+ */
7672
+ async updateTaxVersion(
7673
+ { ruleId, versionId, body, requestHeaders } = { requestHeaders: {} },
7674
+ { responseHeaders } = { responseHeaders: false }
7675
+ ) {
7676
+ const { error } = CatalogPlatformValidator.updateTaxVersion().validate(
7677
+ {
7678
+ ruleId,
7679
+ versionId,
7680
+
7681
+ body,
7682
+ },
7683
+ { abortEarly: false, allowUnknown: true }
7684
+ );
7685
+ if (error) {
7686
+ return Promise.reject(new FDKClientValidationError(error));
7687
+ }
7688
+
7689
+ // Showing warrnings if extra unknown parameters are found
7690
+ const {
7691
+ error: warrning,
7692
+ } = CatalogPlatformValidator.updateTaxVersion().validate(
7693
+ {
7694
+ ruleId,
7695
+ versionId,
7696
+
7697
+ body,
7698
+ },
7699
+ { abortEarly: false, allowUnknown: false }
7700
+ );
7701
+ if (warrning) {
7702
+ Logger({
7703
+ level: "WARN",
7704
+ message: `Parameter Validation warrnings for platform > Catalog > updateTaxVersion \n ${warrning}`,
7705
+ });
7706
+ }
7707
+
7708
+ const query_params = {};
7709
+
7710
+ const xHeaders = {};
7711
+
7712
+ const response = await PlatformAPIClient.execute(
7713
+ this.config,
7714
+ "put",
7715
+ `/service/platform/catalog/v1.0/company/${this.config.companyId}/taxes/rules/${ruleId}/versions/${versionId}`,
7716
+ query_params,
7717
+ body,
7718
+ { ...xHeaders, ...requestHeaders },
7719
+ { responseHeaders }
7720
+ );
7721
+
7722
+ let responseData = response;
7723
+ if (responseHeaders) {
7724
+ responseData = response[0];
7725
+ }
7726
+
7727
+ const {
7728
+ error: res_error,
7729
+ } = CatalogPlatformModel.TaxVersion().validate(responseData, {
7730
+ abortEarly: false,
7731
+ allowUnknown: true,
7732
+ });
7733
+
7734
+ if (res_error) {
7735
+ if (this.config.options.strictResponseCheck === true) {
7736
+ return Promise.reject(new FDKResponseValidationError(res_error));
7737
+ } else {
7738
+ Logger({
7739
+ level: "WARN",
7740
+ message: `Response Validation Warnings for platform > Catalog > updateTaxVersion \n ${res_error}`,
7741
+ });
7742
+ }
7743
+ }
7744
+
7745
+ return response;
7746
+ }
7747
+
6768
7748
  /**
6769
7749
  * @param {CatalogPlatformValidator.UploadBulkProductsParam} arg - Arg object
6770
7750
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
@@ -6772,7 +7752,7 @@ class Catalog {
6772
7752
  * @returns {Promise<CatalogPlatformModel.BulkResponseSchema>} - Success response
6773
7753
  * @name uploadBulkProducts
6774
7754
  * @summary: Upload bulk products
6775
- * @description: Users can create multiple products by providing the required information needed for product creation in a CSV or Excel file format. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/catalog/uploadBulkProducts/).
7755
+ * @description: Users can create multiple products by providing the required information needed for product creation in a CSV or Excel file format. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/catalog/uploadBulkProducts/).
6776
7756
  */
6777
7757
  async uploadBulkProducts(
6778
7758
  { department, productType, body, requestHeaders } = { requestHeaders: {} },
@@ -6817,7 +7797,7 @@ class Catalog {
6817
7797
  const response = await PlatformAPIClient.execute(
6818
7798
  this.config,
6819
7799
  "post",
6820
- `/service/platform/catalog/v2.0/company/${this.config.companyId}/products/bulk`,
7800
+ `/service/platform/catalog/v3.0/company/${this.config.companyId}/products/bulk`,
6821
7801
  query_params,
6822
7802
  body,
6823
7803
  { ...xHeaders, ...requestHeaders },