@gofynd/fdk-client-javascript 3.6.0 → 3.7.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.
- package/README.md +1 -1
- package/package.json +1 -1
- package/sdk/application/Payment/PaymentApplicationClient.d.ts +0 -50
- package/sdk/application/Payment/PaymentApplicationClient.js +0 -210
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +1 -1
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +4 -1
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +5 -0
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +2 -0
- package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +1 -125
- package/sdk/platform/Catalog/CatalogPlatformClient.js +131 -1111
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +228 -1009
- package/sdk/platform/Catalog/CatalogPlatformModel.js +102 -681
- package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +5 -200
- package/sdk/platform/Catalog/CatalogPlatformValidator.js +4 -174
- package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +4 -9
- package/sdk/platform/FileStorage/FileStoragePlatformModel.js +4 -4
- package/sdk/platform/Order/OrderPlatformModel.d.ts +8 -60
- package/sdk/platform/Order/OrderPlatformModel.js +3 -33
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.d.ts +2 -2
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.js +2 -2
- package/sdk/platform/Partner/PartnerPlatformApplicationValidator.d.ts +6 -4
- package/sdk/platform/Partner/PartnerPlatformApplicationValidator.js +3 -2
- package/sdk/platform/Partner/PartnerPlatformModel.d.ts +10 -6
- package/sdk/platform/Partner/PartnerPlatformModel.js +5 -3
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +10 -0
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +4 -0
|
@@ -494,85 +494,6 @@ 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
|
-
|
|
576
497
|
/**
|
|
577
498
|
* @param {CatalogPlatformValidator.CreateInventoryExportParam} arg - Arg object
|
|
578
499
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
@@ -866,7 +787,7 @@ class Catalog {
|
|
|
866
787
|
const response = await PlatformAPIClient.execute(
|
|
867
788
|
this.config,
|
|
868
789
|
"post",
|
|
869
|
-
`/service/platform/catalog/
|
|
790
|
+
`/service/platform/catalog/v2.0/company/${this.config.companyId}/products/`,
|
|
870
791
|
query_params,
|
|
871
792
|
body,
|
|
872
793
|
{ ...xHeaders, ...requestHeaders },
|
|
@@ -1111,7 +1032,7 @@ class Catalog {
|
|
|
1111
1032
|
const response = await PlatformAPIClient.execute(
|
|
1112
1033
|
this.config,
|
|
1113
1034
|
"post",
|
|
1114
|
-
`/service/platform/catalog/
|
|
1035
|
+
`/service/platform/catalog/v2.0/company/${this.config.companyId}/products/downloads/`,
|
|
1115
1036
|
query_params,
|
|
1116
1037
|
body,
|
|
1117
1038
|
{ ...xHeaders, ...requestHeaders },
|
|
@@ -1296,246 +1217,7 @@ class Catalog {
|
|
|
1296
1217
|
} else {
|
|
1297
1218
|
Logger({
|
|
1298
1219
|
level: "WARN",
|
|
1299
|
-
message: `Response Validation Warnings for platform > Catalog > createSizeGuide \n ${res_error}`,
|
|
1300
|
-
});
|
|
1301
|
-
}
|
|
1302
|
-
}
|
|
1303
|
-
|
|
1304
|
-
return response;
|
|
1305
|
-
}
|
|
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}`,
|
|
1220
|
+
message: `Response Validation Warnings for platform > Catalog > createSizeGuide \n ${res_error}`,
|
|
1539
1221
|
});
|
|
1540
1222
|
}
|
|
1541
1223
|
}
|
|
@@ -1949,153 +1631,6 @@ class Catalog {
|
|
|
1949
1631
|
return response;
|
|
1950
1632
|
}
|
|
1951
1633
|
|
|
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
|
-
|
|
2099
1634
|
/**
|
|
2100
1635
|
* @param {CatalogPlatformValidator.DownloadInventoryTemplateViewParam} arg
|
|
2101
1636
|
* - Arg object
|
|
@@ -2312,7 +1847,7 @@ class Catalog {
|
|
|
2312
1847
|
const response = await PlatformAPIClient.execute(
|
|
2313
1848
|
this.config,
|
|
2314
1849
|
"put",
|
|
2315
|
-
`/service/platform/catalog/
|
|
1850
|
+
`/service/platform/catalog/v2.0/company/${this.config.companyId}/products/${itemId}/`,
|
|
2316
1851
|
query_params,
|
|
2317
1852
|
body,
|
|
2318
1853
|
{ ...xHeaders, ...requestHeaders },
|
|
@@ -2516,100 +2051,6 @@ class Catalog {
|
|
|
2516
2051
|
return response;
|
|
2517
2052
|
}
|
|
2518
2053
|
|
|
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}`,
|
|
2606
|
-
});
|
|
2607
|
-
}
|
|
2608
|
-
}
|
|
2609
|
-
|
|
2610
|
-
return response;
|
|
2611
|
-
}
|
|
2612
|
-
|
|
2613
2054
|
/**
|
|
2614
2055
|
* @param {CatalogPlatformValidator.GetAttributeParam} arg - Arg object
|
|
2615
2056
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
@@ -3043,115 +2484,25 @@ class Catalog {
|
|
|
3043
2484
|
error: warrning,
|
|
3044
2485
|
} = CatalogPlatformValidator.getDepartmentData().validate(
|
|
3045
2486
|
{
|
|
3046
|
-
uid,
|
|
3047
|
-
},
|
|
3048
|
-
{ abortEarly: false, allowUnknown: false }
|
|
3049
|
-
);
|
|
3050
|
-
if (warrning) {
|
|
3051
|
-
Logger({
|
|
3052
|
-
level: "WARN",
|
|
3053
|
-
message: `Parameter Validation warrnings for platform > Catalog > getDepartmentData \n ${warrning}`,
|
|
3054
|
-
});
|
|
3055
|
-
}
|
|
3056
|
-
|
|
3057
|
-
const query_params = {};
|
|
3058
|
-
|
|
3059
|
-
const xHeaders = {};
|
|
3060
|
-
|
|
3061
|
-
const response = await PlatformAPIClient.execute(
|
|
3062
|
-
this.config,
|
|
3063
|
-
"get",
|
|
3064
|
-
`/service/platform/catalog/v1.0/company/${this.config.companyId}/departments/${uid}/`,
|
|
3065
|
-
query_params,
|
|
3066
|
-
undefined,
|
|
3067
|
-
{ ...xHeaders, ...requestHeaders },
|
|
3068
|
-
{ responseHeaders }
|
|
3069
|
-
);
|
|
3070
|
-
|
|
3071
|
-
let responseData = response;
|
|
3072
|
-
if (responseHeaders) {
|
|
3073
|
-
responseData = response[0];
|
|
3074
|
-
}
|
|
3075
|
-
|
|
3076
|
-
const {
|
|
3077
|
-
error: res_error,
|
|
3078
|
-
} = CatalogPlatformModel.DepartmentsResponseSchema().validate(
|
|
3079
|
-
responseData,
|
|
3080
|
-
{ abortEarly: false, allowUnknown: true }
|
|
3081
|
-
);
|
|
3082
|
-
|
|
3083
|
-
if (res_error) {
|
|
3084
|
-
if (this.config.options.strictResponseCheck === true) {
|
|
3085
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
3086
|
-
} else {
|
|
3087
|
-
Logger({
|
|
3088
|
-
level: "WARN",
|
|
3089
|
-
message: `Response Validation Warnings for platform > Catalog > getDepartmentData \n ${res_error}`,
|
|
3090
|
-
});
|
|
3091
|
-
}
|
|
3092
|
-
}
|
|
3093
|
-
|
|
3094
|
-
return response;
|
|
3095
|
-
}
|
|
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,
|
|
2487
|
+
uid,
|
|
3133
2488
|
},
|
|
3134
2489
|
{ abortEarly: false, allowUnknown: false }
|
|
3135
2490
|
);
|
|
3136
2491
|
if (warrning) {
|
|
3137
2492
|
Logger({
|
|
3138
2493
|
level: "WARN",
|
|
3139
|
-
message: `Parameter Validation warrnings for platform > Catalog >
|
|
2494
|
+
message: `Parameter Validation warrnings for platform > Catalog > getDepartmentData \n ${warrning}`,
|
|
3140
2495
|
});
|
|
3141
2496
|
}
|
|
3142
2497
|
|
|
3143
2498
|
const query_params = {};
|
|
3144
|
-
query_params["page"] = page;
|
|
3145
|
-
query_params["limit"] = limit;
|
|
3146
|
-
query_params["type"] = type;
|
|
3147
|
-
query_params["q"] = q;
|
|
3148
2499
|
|
|
3149
2500
|
const xHeaders = {};
|
|
3150
2501
|
|
|
3151
2502
|
const response = await PlatformAPIClient.execute(
|
|
3152
2503
|
this.config,
|
|
3153
2504
|
"get",
|
|
3154
|
-
`/service/platform/catalog/v1.0/company/${this.config.companyId}/
|
|
2505
|
+
`/service/platform/catalog/v1.0/company/${this.config.companyId}/departments/${uid}/`,
|
|
3155
2506
|
query_params,
|
|
3156
2507
|
undefined,
|
|
3157
2508
|
{ ...xHeaders, ...requestHeaders },
|
|
@@ -3165,10 +2516,10 @@ class Catalog {
|
|
|
3165
2516
|
|
|
3166
2517
|
const {
|
|
3167
2518
|
error: res_error,
|
|
3168
|
-
} = CatalogPlatformModel.
|
|
3169
|
-
|
|
3170
|
-
allowUnknown: true
|
|
3171
|
-
|
|
2519
|
+
} = CatalogPlatformModel.DepartmentsResponseSchema().validate(
|
|
2520
|
+
responseData,
|
|
2521
|
+
{ abortEarly: false, allowUnknown: true }
|
|
2522
|
+
);
|
|
3172
2523
|
|
|
3173
2524
|
if (res_error) {
|
|
3174
2525
|
if (this.config.options.strictResponseCheck === true) {
|
|
@@ -3176,7 +2527,7 @@ class Catalog {
|
|
|
3176
2527
|
} else {
|
|
3177
2528
|
Logger({
|
|
3178
2529
|
level: "WARN",
|
|
3179
|
-
message: `Response Validation Warnings for platform > Catalog >
|
|
2530
|
+
message: `Response Validation Warnings for platform > Catalog > getDepartmentData \n ${res_error}`,
|
|
3180
2531
|
});
|
|
3181
2532
|
}
|
|
3182
2533
|
}
|
|
@@ -5564,264 +4915,60 @@ class Catalog {
|
|
|
5564
4915
|
`/service/platform/catalog/v1.0/company/${this.config.companyId}/sizeguide/${id}/`,
|
|
5565
4916
|
query_params,
|
|
5566
4917
|
undefined,
|
|
5567
|
-
{ ...xHeaders, ...requestHeaders },
|
|
5568
|
-
{ responseHeaders }
|
|
5569
|
-
);
|
|
5570
|
-
|
|
5571
|
-
let responseData = response;
|
|
5572
|
-
if (responseHeaders) {
|
|
5573
|
-
responseData = response[0];
|
|
5574
|
-
}
|
|
5575
|
-
|
|
5576
|
-
const {
|
|
5577
|
-
error: res_error,
|
|
5578
|
-
} = CatalogPlatformModel.SizeGuideResponseSchema().validate(responseData, {
|
|
5579
|
-
abortEarly: false,
|
|
5580
|
-
allowUnknown: true,
|
|
5581
|
-
});
|
|
5582
|
-
|
|
5583
|
-
if (res_error) {
|
|
5584
|
-
if (this.config.options.strictResponseCheck === true) {
|
|
5585
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
5586
|
-
} else {
|
|
5587
|
-
Logger({
|
|
5588
|
-
level: "WARN",
|
|
5589
|
-
message: `Response Validation Warnings for platform > Catalog > getSizeGuide \n ${res_error}`,
|
|
5590
|
-
});
|
|
5591
|
-
}
|
|
5592
|
-
}
|
|
5593
|
-
|
|
5594
|
-
return response;
|
|
5595
|
-
}
|
|
5596
|
-
|
|
5597
|
-
/**
|
|
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;
|
|
4918
|
+
{ ...xHeaders, ...requestHeaders },
|
|
4919
|
+
{ responseHeaders }
|
|
4920
|
+
);
|
|
4921
|
+
|
|
4922
|
+
let responseData = response;
|
|
4923
|
+
if (responseHeaders) {
|
|
4924
|
+
responseData = response[0];
|
|
4925
|
+
}
|
|
4926
|
+
|
|
4927
|
+
const {
|
|
4928
|
+
error: res_error,
|
|
4929
|
+
} = CatalogPlatformModel.SizeGuideResponseSchema().validate(responseData, {
|
|
4930
|
+
abortEarly: false,
|
|
4931
|
+
allowUnknown: true,
|
|
4932
|
+
});
|
|
4933
|
+
|
|
4934
|
+
if (res_error) {
|
|
4935
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
4936
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
4937
|
+
} else {
|
|
4938
|
+
Logger({
|
|
4939
|
+
level: "WARN",
|
|
4940
|
+
message: `Response Validation Warnings for platform > Catalog > getSizeGuide \n ${res_error}`,
|
|
4941
|
+
});
|
|
4942
|
+
}
|
|
4943
|
+
}
|
|
4944
|
+
|
|
4945
|
+
return response;
|
|
5808
4946
|
}
|
|
5809
4947
|
|
|
5810
4948
|
/**
|
|
5811
|
-
* @param {CatalogPlatformValidator.
|
|
4949
|
+
* @param {CatalogPlatformValidator.GetSizeGuidesParam} arg - Arg object
|
|
5812
4950
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
5813
4951
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
5814
|
-
* @returns {Promise<CatalogPlatformModel.
|
|
5815
|
-
* @name
|
|
5816
|
-
* @summary:
|
|
5817
|
-
* @description:
|
|
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/).
|
|
5818
4956
|
*/
|
|
5819
|
-
async
|
|
5820
|
-
{
|
|
4957
|
+
async getSizeGuides(
|
|
4958
|
+
{ active, q, tag, pageNo, pageSize, brandId, requestHeaders } = {
|
|
4959
|
+
requestHeaders: {},
|
|
4960
|
+
},
|
|
5821
4961
|
{ responseHeaders } = { responseHeaders: false }
|
|
5822
4962
|
) {
|
|
5823
|
-
const { error } = CatalogPlatformValidator.
|
|
5824
|
-
{
|
|
4963
|
+
const { error } = CatalogPlatformValidator.getSizeGuides().validate(
|
|
4964
|
+
{
|
|
4965
|
+
active,
|
|
4966
|
+
q,
|
|
4967
|
+
tag,
|
|
4968
|
+
pageNo,
|
|
4969
|
+
pageSize,
|
|
4970
|
+
brandId,
|
|
4971
|
+
},
|
|
5825
4972
|
{ abortEarly: false, allowUnknown: true }
|
|
5826
4973
|
);
|
|
5827
4974
|
if (error) {
|
|
@@ -5831,25 +4978,38 @@ class Catalog {
|
|
|
5831
4978
|
// Showing warrnings if extra unknown parameters are found
|
|
5832
4979
|
const {
|
|
5833
4980
|
error: warrning,
|
|
5834
|
-
} = CatalogPlatformValidator.
|
|
5835
|
-
{
|
|
4981
|
+
} = CatalogPlatformValidator.getSizeGuides().validate(
|
|
4982
|
+
{
|
|
4983
|
+
active,
|
|
4984
|
+
q,
|
|
4985
|
+
tag,
|
|
4986
|
+
pageNo,
|
|
4987
|
+
pageSize,
|
|
4988
|
+
brandId,
|
|
4989
|
+
},
|
|
5836
4990
|
{ abortEarly: false, allowUnknown: false }
|
|
5837
4991
|
);
|
|
5838
4992
|
if (warrning) {
|
|
5839
4993
|
Logger({
|
|
5840
4994
|
level: "WARN",
|
|
5841
|
-
message: `Parameter Validation warrnings for platform > Catalog >
|
|
4995
|
+
message: `Parameter Validation warrnings for platform > Catalog > getSizeGuides \n ${warrning}`,
|
|
5842
4996
|
});
|
|
5843
4997
|
}
|
|
5844
4998
|
|
|
5845
4999
|
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;
|
|
5846
5006
|
|
|
5847
5007
|
const xHeaders = {};
|
|
5848
5008
|
|
|
5849
5009
|
const response = await PlatformAPIClient.execute(
|
|
5850
5010
|
this.config,
|
|
5851
5011
|
"get",
|
|
5852
|
-
`/service/platform/catalog/v1.0/company/${this.config.companyId}/
|
|
5012
|
+
`/service/platform/catalog/v1.0/company/${this.config.companyId}/sizeguide`,
|
|
5853
5013
|
query_params,
|
|
5854
5014
|
undefined,
|
|
5855
5015
|
{ ...xHeaders, ...requestHeaders },
|
|
@@ -5863,7 +5023,7 @@ class Catalog {
|
|
|
5863
5023
|
|
|
5864
5024
|
const {
|
|
5865
5025
|
error: res_error,
|
|
5866
|
-
} = CatalogPlatformModel.
|
|
5026
|
+
} = CatalogPlatformModel.ListSizeGuide().validate(responseData, {
|
|
5867
5027
|
abortEarly: false,
|
|
5868
5028
|
allowUnknown: true,
|
|
5869
5029
|
});
|
|
@@ -5874,7 +5034,7 @@ class Catalog {
|
|
|
5874
5034
|
} else {
|
|
5875
5035
|
Logger({
|
|
5876
5036
|
level: "WARN",
|
|
5877
|
-
message: `Response Validation Warnings for platform > Catalog >
|
|
5037
|
+
message: `Response Validation Warnings for platform > Catalog > getSizeGuides \n ${res_error}`,
|
|
5878
5038
|
});
|
|
5879
5039
|
}
|
|
5880
5040
|
}
|
|
@@ -5883,26 +5043,23 @@ class Catalog {
|
|
|
5883
5043
|
}
|
|
5884
5044
|
|
|
5885
5045
|
/**
|
|
5886
|
-
* @param {CatalogPlatformValidator.
|
|
5046
|
+
* @param {CatalogPlatformValidator.GetStoreDetailParam} arg - Arg object
|
|
5887
5047
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
5888
5048
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
5889
|
-
* @returns {Promise<CatalogPlatformModel.
|
|
5890
|
-
* @name
|
|
5891
|
-
* @summary: Get
|
|
5892
|
-
* @description: Retrieve
|
|
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/).
|
|
5893
5053
|
*/
|
|
5894
|
-
async
|
|
5895
|
-
{
|
|
5896
|
-
requestHeaders: {},
|
|
5897
|
-
},
|
|
5054
|
+
async getStoreDetail(
|
|
5055
|
+
{ q, pageNo, pageSize, requestHeaders } = { requestHeaders: {} },
|
|
5898
5056
|
{ responseHeaders } = { responseHeaders: false }
|
|
5899
5057
|
) {
|
|
5900
|
-
const { error } = CatalogPlatformValidator.
|
|
5058
|
+
const { error } = CatalogPlatformValidator.getStoreDetail().validate(
|
|
5901
5059
|
{
|
|
5902
|
-
|
|
5903
|
-
|
|
5904
|
-
|
|
5905
|
-
page,
|
|
5060
|
+
q,
|
|
5061
|
+
pageNo,
|
|
5062
|
+
pageSize,
|
|
5906
5063
|
},
|
|
5907
5064
|
{ abortEarly: false, allowUnknown: true }
|
|
5908
5065
|
);
|
|
@@ -5913,33 +5070,32 @@ class Catalog {
|
|
|
5913
5070
|
// Showing warrnings if extra unknown parameters are found
|
|
5914
5071
|
const {
|
|
5915
5072
|
error: warrning,
|
|
5916
|
-
} = CatalogPlatformValidator.
|
|
5073
|
+
} = CatalogPlatformValidator.getStoreDetail().validate(
|
|
5917
5074
|
{
|
|
5918
|
-
|
|
5919
|
-
|
|
5920
|
-
|
|
5921
|
-
page,
|
|
5075
|
+
q,
|
|
5076
|
+
pageNo,
|
|
5077
|
+
pageSize,
|
|
5922
5078
|
},
|
|
5923
5079
|
{ abortEarly: false, allowUnknown: false }
|
|
5924
5080
|
);
|
|
5925
5081
|
if (warrning) {
|
|
5926
5082
|
Logger({
|
|
5927
5083
|
level: "WARN",
|
|
5928
|
-
message: `Parameter Validation warrnings for platform > Catalog >
|
|
5084
|
+
message: `Parameter Validation warrnings for platform > Catalog > getStoreDetail \n ${warrning}`,
|
|
5929
5085
|
});
|
|
5930
5086
|
}
|
|
5931
5087
|
|
|
5932
5088
|
const query_params = {};
|
|
5933
|
-
query_params["
|
|
5934
|
-
query_params["
|
|
5935
|
-
query_params["
|
|
5089
|
+
query_params["q"] = q;
|
|
5090
|
+
query_params["page_no"] = pageNo;
|
|
5091
|
+
query_params["page_size"] = pageSize;
|
|
5936
5092
|
|
|
5937
5093
|
const xHeaders = {};
|
|
5938
5094
|
|
|
5939
5095
|
const response = await PlatformAPIClient.execute(
|
|
5940
5096
|
this.config,
|
|
5941
5097
|
"get",
|
|
5942
|
-
`/service/platform/catalog/
|
|
5098
|
+
`/service/platform/catalog/v2.0/company/${this.config.companyId}/marketplaces/location-details/`,
|
|
5943
5099
|
query_params,
|
|
5944
5100
|
undefined,
|
|
5945
5101
|
{ ...xHeaders, ...requestHeaders },
|
|
@@ -5953,7 +5109,7 @@ class Catalog {
|
|
|
5953
5109
|
|
|
5954
5110
|
const {
|
|
5955
5111
|
error: res_error,
|
|
5956
|
-
} = CatalogPlatformModel.
|
|
5112
|
+
} = CatalogPlatformModel.OptinStoreDetails().validate(responseData, {
|
|
5957
5113
|
abortEarly: false,
|
|
5958
5114
|
allowUnknown: true,
|
|
5959
5115
|
});
|
|
@@ -5964,7 +5120,7 @@ class Catalog {
|
|
|
5964
5120
|
} else {
|
|
5965
5121
|
Logger({
|
|
5966
5122
|
level: "WARN",
|
|
5967
|
-
message: `Response Validation Warnings for platform > Catalog >
|
|
5123
|
+
message: `Response Validation Warnings for platform > Catalog > getStoreDetail \n ${res_error}`,
|
|
5968
5124
|
});
|
|
5969
5125
|
}
|
|
5970
5126
|
}
|
|
@@ -5972,6 +5128,36 @@ class Catalog {
|
|
|
5972
5128
|
return response;
|
|
5973
5129
|
}
|
|
5974
5130
|
|
|
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
|
+
|
|
5975
5161
|
/**
|
|
5976
5162
|
* @param {CatalogPlatformValidator.GetVariantsOfProductsParam} arg - Arg object
|
|
5977
5163
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
@@ -7579,172 +6765,6 @@ class Catalog {
|
|
|
7579
6765
|
return response;
|
|
7580
6766
|
}
|
|
7581
6767
|
|
|
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
|
-
|
|
7748
6768
|
/**
|
|
7749
6769
|
* @param {CatalogPlatformValidator.UploadBulkProductsParam} arg - Arg object
|
|
7750
6770
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
@@ -7752,7 +6772,7 @@ class Catalog {
|
|
|
7752
6772
|
* @returns {Promise<CatalogPlatformModel.BulkResponseSchema>} - Success response
|
|
7753
6773
|
* @name uploadBulkProducts
|
|
7754
6774
|
* @summary: Upload bulk products
|
|
7755
|
-
* @description: Users can create multiple products by providing the required information needed for product creation in a CSV
|
|
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/).
|
|
7756
6776
|
*/
|
|
7757
6777
|
async uploadBulkProducts(
|
|
7758
6778
|
{ department, productType, body, requestHeaders } = { requestHeaders: {} },
|
|
@@ -7797,7 +6817,7 @@ class Catalog {
|
|
|
7797
6817
|
const response = await PlatformAPIClient.execute(
|
|
7798
6818
|
this.config,
|
|
7799
6819
|
"post",
|
|
7800
|
-
`/service/platform/catalog/
|
|
6820
|
+
`/service/platform/catalog/v2.0/company/${this.config.companyId}/products/bulk`,
|
|
7801
6821
|
query_params,
|
|
7802
6822
|
body,
|
|
7803
6823
|
{ ...xHeaders, ...requestHeaders },
|