@gofynd/fdk-client-javascript 3.17.0 → 3.17.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/package.json +1 -1
- package/sdk/application/Cart/CartApplicationClient.d.ts +40 -0
- package/sdk/application/Cart/CartApplicationClient.js +176 -0
- package/sdk/application/Catalog/CatalogApplicationClient.d.ts +18 -4
- package/sdk/application/Catalog/CatalogApplicationClient.js +47 -4
- package/sdk/application/Content/ContentApplicationClient.d.ts +11 -1
- package/sdk/application/Content/ContentApplicationClient.js +40 -2
- package/sdk/application/Payment/PaymentApplicationClient.d.ts +1 -1
- package/sdk/application/Payment/PaymentApplicationClient.js +2 -0
- package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +72 -10
- package/sdk/platform/Cart/CartPlatformApplicationClient.js +634 -33
- package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +225 -1
- package/sdk/platform/Cart/CartPlatformApplicationValidator.js +147 -0
- package/sdk/platform/Cart/CartPlatformModel.d.ts +951 -1
- package/sdk/platform/Cart/CartPlatformModel.js +597 -1
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +123 -3
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +829 -39
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +205 -7
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +154 -3
- package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +5 -5
- package/sdk/platform/Catalog/CatalogPlatformClient.js +8 -5
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +1020 -29
- package/sdk/platform/Catalog/CatalogPlatformModel.js +836 -24
- package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +7 -0
- package/sdk/platform/Catalog/CatalogPlatformValidator.js +3 -0
- package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +92 -1
- package/sdk/platform/Configuration/ConfigurationPlatformModel.js +54 -0
- package/sdk/platform/Discount/DiscountPlatformModel.d.ts +21 -0
- package/sdk/platform/Discount/DiscountPlatformModel.js +9 -0
- package/sdk/platform/Order/OrderPlatformClient.d.ts +1 -1
- package/sdk/platform/Order/OrderPlatformClient.js +1 -1
- package/sdk/platform/Order/OrderPlatformModel.d.ts +20 -2
- package/sdk/platform/Order/OrderPlatformModel.js +9 -1
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +14 -3
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +88 -6
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +28 -3
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +22 -2
- package/sdk/platform/Payment/PaymentPlatformModel.d.ts +356 -1
- package/sdk/platform/Payment/PaymentPlatformModel.js +229 -0
- package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +29 -0
- package/sdk/platform/Webhook/WebhookPlatformModel.js +13 -0
- package/sdk/public/Webhook/WebhookPublicModel.d.ts +29 -0
- package/sdk/public/Webhook/WebhookPublicModel.js +13 -0
|
@@ -870,6 +870,88 @@ class Catalog {
|
|
|
870
870
|
return response;
|
|
871
871
|
}
|
|
872
872
|
|
|
873
|
+
/**
|
|
874
|
+
* @param {CatalogPlatformApplicationValidator.CreatePriceFactoryParam} arg
|
|
875
|
+
* - Arg object
|
|
876
|
+
*
|
|
877
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
878
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
879
|
+
* @returns {Promise<CatalogPlatformModel.SuccessResponseSchema>} - Success response
|
|
880
|
+
* @name createPriceFactory
|
|
881
|
+
* @summary: Create a Price Factory for an Application
|
|
882
|
+
* @description: Creates a new price factory configuration for the specified application under a given company. A price factory allows defining region-based or international pricing strategies using fixed or percentage-based adjustments per currency.
|
|
883
|
+
* - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/catalog/createPriceFactory/).
|
|
884
|
+
*/
|
|
885
|
+
async createPriceFactory(
|
|
886
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
887
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
888
|
+
) {
|
|
889
|
+
const {
|
|
890
|
+
error,
|
|
891
|
+
} = CatalogPlatformApplicationValidator.createPriceFactory().validate(
|
|
892
|
+
{
|
|
893
|
+
body,
|
|
894
|
+
},
|
|
895
|
+
{ abortEarly: false, allowUnknown: true }
|
|
896
|
+
);
|
|
897
|
+
if (error) {
|
|
898
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
899
|
+
}
|
|
900
|
+
|
|
901
|
+
// Showing warrnings if extra unknown parameters are found
|
|
902
|
+
const {
|
|
903
|
+
error: warrning,
|
|
904
|
+
} = CatalogPlatformApplicationValidator.createPriceFactory().validate(
|
|
905
|
+
{
|
|
906
|
+
body,
|
|
907
|
+
},
|
|
908
|
+
{ abortEarly: false, allowUnknown: false }
|
|
909
|
+
);
|
|
910
|
+
if (warrning) {
|
|
911
|
+
Logger({
|
|
912
|
+
level: "WARN",
|
|
913
|
+
message: `Parameter Validation warrnings for platform > Catalog > createPriceFactory \n ${warrning}`,
|
|
914
|
+
});
|
|
915
|
+
}
|
|
916
|
+
|
|
917
|
+
const query_params = {};
|
|
918
|
+
|
|
919
|
+
const response = await PlatformAPIClient.execute(
|
|
920
|
+
this.config,
|
|
921
|
+
"post",
|
|
922
|
+
`/service/platform/catalog/v1.0/company/${this.config.companyId}/application/${this.applicationId}/price`,
|
|
923
|
+
query_params,
|
|
924
|
+
body,
|
|
925
|
+
requestHeaders,
|
|
926
|
+
{ responseHeaders }
|
|
927
|
+
);
|
|
928
|
+
|
|
929
|
+
let responseData = response;
|
|
930
|
+
if (responseHeaders) {
|
|
931
|
+
responseData = response[0];
|
|
932
|
+
}
|
|
933
|
+
|
|
934
|
+
const {
|
|
935
|
+
error: res_error,
|
|
936
|
+
} = CatalogPlatformModel.SuccessResponseSchema().validate(responseData, {
|
|
937
|
+
abortEarly: false,
|
|
938
|
+
allowUnknown: true,
|
|
939
|
+
});
|
|
940
|
+
|
|
941
|
+
if (res_error) {
|
|
942
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
943
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
944
|
+
} else {
|
|
945
|
+
Logger({
|
|
946
|
+
level: "WARN",
|
|
947
|
+
message: `Response Validation Warnings for platform > Catalog > createPriceFactory \n ${res_error}`,
|
|
948
|
+
});
|
|
949
|
+
}
|
|
950
|
+
}
|
|
951
|
+
|
|
952
|
+
return response;
|
|
953
|
+
}
|
|
954
|
+
|
|
873
955
|
/**
|
|
874
956
|
* @param {CatalogPlatformApplicationValidator.CreateSearchConfigurationParam} arg
|
|
875
957
|
* - Arg object
|
|
@@ -1364,6 +1446,88 @@ class Catalog {
|
|
|
1364
1446
|
return response;
|
|
1365
1447
|
}
|
|
1366
1448
|
|
|
1449
|
+
/**
|
|
1450
|
+
* @param {CatalogPlatformApplicationValidator.DeletePriceFactoryParam} arg
|
|
1451
|
+
* - Arg object
|
|
1452
|
+
*
|
|
1453
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1454
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1455
|
+
* @returns {Promise<CatalogPlatformModel.SuccessResponseSchema>} - Success response
|
|
1456
|
+
* @name deletePriceFactory
|
|
1457
|
+
* @summary: Delete a Price Factory Configuration
|
|
1458
|
+
* @description: Deletes a specific price factory configuration associated with a given company and application. This action is typically irreversible and will remove the pricing logic tied to the specified price factory ID.
|
|
1459
|
+
* - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/catalog/deletePriceFactory/).
|
|
1460
|
+
*/
|
|
1461
|
+
async deletePriceFactory(
|
|
1462
|
+
{ priceFactoryId, requestHeaders } = { requestHeaders: {} },
|
|
1463
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
1464
|
+
) {
|
|
1465
|
+
const {
|
|
1466
|
+
error,
|
|
1467
|
+
} = CatalogPlatformApplicationValidator.deletePriceFactory().validate(
|
|
1468
|
+
{
|
|
1469
|
+
priceFactoryId,
|
|
1470
|
+
},
|
|
1471
|
+
{ abortEarly: false, allowUnknown: true }
|
|
1472
|
+
);
|
|
1473
|
+
if (error) {
|
|
1474
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
1475
|
+
}
|
|
1476
|
+
|
|
1477
|
+
// Showing warrnings if extra unknown parameters are found
|
|
1478
|
+
const {
|
|
1479
|
+
error: warrning,
|
|
1480
|
+
} = CatalogPlatformApplicationValidator.deletePriceFactory().validate(
|
|
1481
|
+
{
|
|
1482
|
+
priceFactoryId,
|
|
1483
|
+
},
|
|
1484
|
+
{ abortEarly: false, allowUnknown: false }
|
|
1485
|
+
);
|
|
1486
|
+
if (warrning) {
|
|
1487
|
+
Logger({
|
|
1488
|
+
level: "WARN",
|
|
1489
|
+
message: `Parameter Validation warrnings for platform > Catalog > deletePriceFactory \n ${warrning}`,
|
|
1490
|
+
});
|
|
1491
|
+
}
|
|
1492
|
+
|
|
1493
|
+
const query_params = {};
|
|
1494
|
+
|
|
1495
|
+
const response = await PlatformAPIClient.execute(
|
|
1496
|
+
this.config,
|
|
1497
|
+
"delete",
|
|
1498
|
+
`/service/platform/catalog/v1.0/company/${this.config.companyId}/application/${this.applicationId}/price/${priceFactoryId}`,
|
|
1499
|
+
query_params,
|
|
1500
|
+
undefined,
|
|
1501
|
+
requestHeaders,
|
|
1502
|
+
{ responseHeaders }
|
|
1503
|
+
);
|
|
1504
|
+
|
|
1505
|
+
let responseData = response;
|
|
1506
|
+
if (responseHeaders) {
|
|
1507
|
+
responseData = response[0];
|
|
1508
|
+
}
|
|
1509
|
+
|
|
1510
|
+
const {
|
|
1511
|
+
error: res_error,
|
|
1512
|
+
} = CatalogPlatformModel.SuccessResponseSchema().validate(responseData, {
|
|
1513
|
+
abortEarly: false,
|
|
1514
|
+
allowUnknown: true,
|
|
1515
|
+
});
|
|
1516
|
+
|
|
1517
|
+
if (res_error) {
|
|
1518
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
1519
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1520
|
+
} else {
|
|
1521
|
+
Logger({
|
|
1522
|
+
level: "WARN",
|
|
1523
|
+
message: `Response Validation Warnings for platform > Catalog > deletePriceFactory \n ${res_error}`,
|
|
1524
|
+
});
|
|
1525
|
+
}
|
|
1526
|
+
}
|
|
1527
|
+
|
|
1528
|
+
return response;
|
|
1529
|
+
}
|
|
1530
|
+
|
|
1367
1531
|
/**
|
|
1368
1532
|
* @param {CatalogPlatformApplicationValidator.DeleteSearchConfigurationParam} arg
|
|
1369
1533
|
* - Arg object
|
|
@@ -2320,6 +2484,88 @@ class Catalog {
|
|
|
2320
2484
|
return response;
|
|
2321
2485
|
}
|
|
2322
2486
|
|
|
2487
|
+
/**
|
|
2488
|
+
* @param {CatalogPlatformApplicationValidator.GetAppProductPricesParam} arg
|
|
2489
|
+
* - Arg object
|
|
2490
|
+
*
|
|
2491
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
2492
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
2493
|
+
* @returns {Promise<CatalogPlatformModel.AppProductPricesSchema>} - Success response
|
|
2494
|
+
* @name getAppProductPrices
|
|
2495
|
+
* @summary: Get prices for specific raw product items
|
|
2496
|
+
* @description: Fetch pricing details for multiple raw products by their item IDs, scoped to a particular company and sales channel. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/catalog/getAppProductPrices/).
|
|
2497
|
+
*/
|
|
2498
|
+
async getAppProductPrices(
|
|
2499
|
+
{ itemIds, requestHeaders } = { requestHeaders: {} },
|
|
2500
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
2501
|
+
) {
|
|
2502
|
+
const {
|
|
2503
|
+
error,
|
|
2504
|
+
} = CatalogPlatformApplicationValidator.getAppProductPrices().validate(
|
|
2505
|
+
{
|
|
2506
|
+
itemIds,
|
|
2507
|
+
},
|
|
2508
|
+
{ abortEarly: false, allowUnknown: true }
|
|
2509
|
+
);
|
|
2510
|
+
if (error) {
|
|
2511
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
2512
|
+
}
|
|
2513
|
+
|
|
2514
|
+
// Showing warrnings if extra unknown parameters are found
|
|
2515
|
+
const {
|
|
2516
|
+
error: warrning,
|
|
2517
|
+
} = CatalogPlatformApplicationValidator.getAppProductPrices().validate(
|
|
2518
|
+
{
|
|
2519
|
+
itemIds,
|
|
2520
|
+
},
|
|
2521
|
+
{ abortEarly: false, allowUnknown: false }
|
|
2522
|
+
);
|
|
2523
|
+
if (warrning) {
|
|
2524
|
+
Logger({
|
|
2525
|
+
level: "WARN",
|
|
2526
|
+
message: `Parameter Validation warrnings for platform > Catalog > getAppProductPrices \n ${warrning}`,
|
|
2527
|
+
});
|
|
2528
|
+
}
|
|
2529
|
+
|
|
2530
|
+
const query_params = {};
|
|
2531
|
+
query_params["item_ids"] = itemIds;
|
|
2532
|
+
|
|
2533
|
+
const response = await PlatformAPIClient.execute(
|
|
2534
|
+
this.config,
|
|
2535
|
+
"get",
|
|
2536
|
+
`/service/platform/catalog/v1.0/company/${this.config.companyId}/application/${this.applicationId}/raw-products/price`,
|
|
2537
|
+
query_params,
|
|
2538
|
+
undefined,
|
|
2539
|
+
requestHeaders,
|
|
2540
|
+
{ responseHeaders }
|
|
2541
|
+
);
|
|
2542
|
+
|
|
2543
|
+
let responseData = response;
|
|
2544
|
+
if (responseHeaders) {
|
|
2545
|
+
responseData = response[0];
|
|
2546
|
+
}
|
|
2547
|
+
|
|
2548
|
+
const {
|
|
2549
|
+
error: res_error,
|
|
2550
|
+
} = CatalogPlatformModel.AppProductPricesSchema().validate(responseData, {
|
|
2551
|
+
abortEarly: false,
|
|
2552
|
+
allowUnknown: true,
|
|
2553
|
+
});
|
|
2554
|
+
|
|
2555
|
+
if (res_error) {
|
|
2556
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
2557
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
2558
|
+
} else {
|
|
2559
|
+
Logger({
|
|
2560
|
+
level: "WARN",
|
|
2561
|
+
message: `Response Validation Warnings for platform > Catalog > getAppProductPrices \n ${res_error}`,
|
|
2562
|
+
});
|
|
2563
|
+
}
|
|
2564
|
+
}
|
|
2565
|
+
|
|
2566
|
+
return response;
|
|
2567
|
+
}
|
|
2568
|
+
|
|
2323
2569
|
/**
|
|
2324
2570
|
* @param {CatalogPlatformApplicationValidator.GetAppProductsParam} arg - Arg object
|
|
2325
2571
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
@@ -3454,9 +3700,9 @@ class Catalog {
|
|
|
3454
3700
|
* @param {boolean} [arg.isDependent] - This query parameter is used to get
|
|
3455
3701
|
* the dependent products in the listing.
|
|
3456
3702
|
* @param {string} [arg.sortOn] - The order to sort the list of products on.
|
|
3457
|
-
*
|
|
3458
|
-
*
|
|
3459
|
-
*
|
|
3703
|
+
* Supported values include latest, popular, price_asc, price_dsc,
|
|
3704
|
+
* discount_asc, discount_dsc. Custom sort keys configured via listing
|
|
3705
|
+
* configuration (e.g., best_selling) are also supported for cohort-based sorting.
|
|
3460
3706
|
* @param {number} [arg.pageSize] - Number of items to retrieve in each
|
|
3461
3707
|
* page. Default is 12.
|
|
3462
3708
|
* @param {string[]} [arg.itemIds] - Item Ids of product
|
|
@@ -4851,25 +5097,28 @@ class Catalog {
|
|
|
4851
5097
|
}
|
|
4852
5098
|
|
|
4853
5099
|
/**
|
|
4854
|
-
* @param {CatalogPlatformApplicationValidator.
|
|
5100
|
+
* @param {CatalogPlatformApplicationValidator.GetPriceFactoriesParam} arg
|
|
4855
5101
|
* - Arg object
|
|
4856
5102
|
*
|
|
4857
5103
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
4858
5104
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
4859
|
-
* @returns {Promise<CatalogPlatformModel.
|
|
4860
|
-
*
|
|
4861
|
-
*
|
|
4862
|
-
* @
|
|
5105
|
+
* @returns {Promise<CatalogPlatformModel.PriceFactoryListResponseSchema>}
|
|
5106
|
+
* - Success response
|
|
5107
|
+
*
|
|
5108
|
+
* @name getPriceFactories
|
|
5109
|
+
* @summary: Retrieve Price Factories for an Application
|
|
5110
|
+
* @description: Fetches a paginated list of price factories configured for the specified application within a company. Supports optional filters such as brand IDs, category IDs, seller identifier, item code, slug, and name to narrow down the results.
|
|
5111
|
+
* - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/catalog/getPriceFactories/).
|
|
4863
5112
|
*/
|
|
4864
|
-
async
|
|
4865
|
-
{
|
|
5113
|
+
async getPriceFactories(
|
|
5114
|
+
{ q, requestHeaders } = { requestHeaders: {} },
|
|
4866
5115
|
{ responseHeaders } = { responseHeaders: false }
|
|
4867
5116
|
) {
|
|
4868
5117
|
const {
|
|
4869
5118
|
error,
|
|
4870
|
-
} = CatalogPlatformApplicationValidator.
|
|
5119
|
+
} = CatalogPlatformApplicationValidator.getPriceFactories().validate(
|
|
4871
5120
|
{
|
|
4872
|
-
|
|
5121
|
+
q,
|
|
4873
5122
|
},
|
|
4874
5123
|
{ abortEarly: false, allowUnknown: true }
|
|
4875
5124
|
);
|
|
@@ -4880,25 +5129,26 @@ class Catalog {
|
|
|
4880
5129
|
// Showing warrnings if extra unknown parameters are found
|
|
4881
5130
|
const {
|
|
4882
5131
|
error: warrning,
|
|
4883
|
-
} = CatalogPlatformApplicationValidator.
|
|
5132
|
+
} = CatalogPlatformApplicationValidator.getPriceFactories().validate(
|
|
4884
5133
|
{
|
|
4885
|
-
|
|
5134
|
+
q,
|
|
4886
5135
|
},
|
|
4887
5136
|
{ abortEarly: false, allowUnknown: false }
|
|
4888
5137
|
);
|
|
4889
5138
|
if (warrning) {
|
|
4890
5139
|
Logger({
|
|
4891
5140
|
level: "WARN",
|
|
4892
|
-
message: `Parameter Validation warrnings for platform > Catalog >
|
|
5141
|
+
message: `Parameter Validation warrnings for platform > Catalog > getPriceFactories \n ${warrning}`,
|
|
4893
5142
|
});
|
|
4894
5143
|
}
|
|
4895
5144
|
|
|
4896
5145
|
const query_params = {};
|
|
5146
|
+
query_params["q"] = q;
|
|
4897
5147
|
|
|
4898
5148
|
const response = await PlatformAPIClient.execute(
|
|
4899
5149
|
this.config,
|
|
4900
5150
|
"get",
|
|
4901
|
-
`/service/platform/catalog/v1.0/company/${this.config.companyId}/application/${this.applicationId}/
|
|
5151
|
+
`/service/platform/catalog/v1.0/company/${this.config.companyId}/application/${this.applicationId}/price/list`,
|
|
4902
5152
|
query_params,
|
|
4903
5153
|
undefined,
|
|
4904
5154
|
requestHeaders,
|
|
@@ -4912,10 +5162,10 @@ class Catalog {
|
|
|
4912
5162
|
|
|
4913
5163
|
const {
|
|
4914
5164
|
error: res_error,
|
|
4915
|
-
} = CatalogPlatformModel.
|
|
4916
|
-
|
|
4917
|
-
allowUnknown: true
|
|
4918
|
-
|
|
5165
|
+
} = CatalogPlatformModel.PriceFactoryListResponseSchema().validate(
|
|
5166
|
+
responseData,
|
|
5167
|
+
{ abortEarly: false, allowUnknown: true }
|
|
5168
|
+
);
|
|
4919
5169
|
|
|
4920
5170
|
if (res_error) {
|
|
4921
5171
|
if (this.config.options.strictResponseCheck === true) {
|
|
@@ -4923,7 +5173,7 @@ class Catalog {
|
|
|
4923
5173
|
} else {
|
|
4924
5174
|
Logger({
|
|
4925
5175
|
level: "WARN",
|
|
4926
|
-
message: `Response Validation Warnings for platform > Catalog >
|
|
5176
|
+
message: `Response Validation Warnings for platform > Catalog > getPriceFactories \n ${res_error}`,
|
|
4927
5177
|
});
|
|
4928
5178
|
}
|
|
4929
5179
|
}
|
|
@@ -4932,23 +5182,26 @@ class Catalog {
|
|
|
4932
5182
|
}
|
|
4933
5183
|
|
|
4934
5184
|
/**
|
|
4935
|
-
* @param {CatalogPlatformApplicationValidator.
|
|
5185
|
+
* @param {CatalogPlatformApplicationValidator.GetPriceFactoryParam} arg - Arg object
|
|
4936
5186
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
4937
5187
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
4938
|
-
* @returns {Promise<CatalogPlatformModel.
|
|
5188
|
+
* @returns {Promise<CatalogPlatformModel.PriceFactoryConfigSchema>} -
|
|
4939
5189
|
* Success response
|
|
4940
|
-
* @name
|
|
4941
|
-
* @summary:
|
|
4942
|
-
* @description:
|
|
5190
|
+
* @name getPriceFactory
|
|
5191
|
+
* @summary: Retrieve a Specific Price Factory Configuration
|
|
5192
|
+
* @description: Retrieves detailed information about a specific price factory configuration for the given application and company, using the unique price factory ID. This includes currency strategies, adjustment values, zone mapping, and audit metadata.
|
|
5193
|
+
* - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/catalog/getPriceFactory/).
|
|
4943
5194
|
*/
|
|
4944
|
-
async
|
|
4945
|
-
{ requestHeaders } = { requestHeaders: {} },
|
|
5195
|
+
async getPriceFactory(
|
|
5196
|
+
{ priceFactoryId, requestHeaders } = { requestHeaders: {} },
|
|
4946
5197
|
{ responseHeaders } = { responseHeaders: false }
|
|
4947
5198
|
) {
|
|
4948
5199
|
const {
|
|
4949
5200
|
error,
|
|
4950
|
-
} = CatalogPlatformApplicationValidator.
|
|
4951
|
-
{
|
|
5201
|
+
} = CatalogPlatformApplicationValidator.getPriceFactory().validate(
|
|
5202
|
+
{
|
|
5203
|
+
priceFactoryId,
|
|
5204
|
+
},
|
|
4952
5205
|
{ abortEarly: false, allowUnknown: true }
|
|
4953
5206
|
);
|
|
4954
5207
|
if (error) {
|
|
@@ -4958,14 +5211,16 @@ class Catalog {
|
|
|
4958
5211
|
// Showing warrnings if extra unknown parameters are found
|
|
4959
5212
|
const {
|
|
4960
5213
|
error: warrning,
|
|
4961
|
-
} = CatalogPlatformApplicationValidator.
|
|
4962
|
-
{
|
|
5214
|
+
} = CatalogPlatformApplicationValidator.getPriceFactory().validate(
|
|
5215
|
+
{
|
|
5216
|
+
priceFactoryId,
|
|
5217
|
+
},
|
|
4963
5218
|
{ abortEarly: false, allowUnknown: false }
|
|
4964
5219
|
);
|
|
4965
5220
|
if (warrning) {
|
|
4966
5221
|
Logger({
|
|
4967
5222
|
level: "WARN",
|
|
4968
|
-
message: `Parameter Validation warrnings for platform > Catalog >
|
|
5223
|
+
message: `Parameter Validation warrnings for platform > Catalog > getPriceFactory \n ${warrning}`,
|
|
4969
5224
|
});
|
|
4970
5225
|
}
|
|
4971
5226
|
|
|
@@ -4974,7 +5229,7 @@ class Catalog {
|
|
|
4974
5229
|
const response = await PlatformAPIClient.execute(
|
|
4975
5230
|
this.config,
|
|
4976
5231
|
"get",
|
|
4977
|
-
`/service/platform/catalog/v1.0/company/${this.config.companyId}/application/${this.applicationId}/
|
|
5232
|
+
`/service/platform/catalog/v1.0/company/${this.config.companyId}/application/${this.applicationId}/price/${priceFactoryId}`,
|
|
4978
5233
|
query_params,
|
|
4979
5234
|
undefined,
|
|
4980
5235
|
requestHeaders,
|
|
@@ -4988,11 +5243,376 @@ class Catalog {
|
|
|
4988
5243
|
|
|
4989
5244
|
const {
|
|
4990
5245
|
error: res_error,
|
|
4991
|
-
} = CatalogPlatformModel.
|
|
4992
|
-
|
|
4993
|
-
|
|
4994
|
-
);
|
|
4995
|
-
|
|
5246
|
+
} = CatalogPlatformModel.PriceFactoryConfigSchema().validate(responseData, {
|
|
5247
|
+
abortEarly: false,
|
|
5248
|
+
allowUnknown: true,
|
|
5249
|
+
});
|
|
5250
|
+
|
|
5251
|
+
if (res_error) {
|
|
5252
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
5253
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
5254
|
+
} else {
|
|
5255
|
+
Logger({
|
|
5256
|
+
level: "WARN",
|
|
5257
|
+
message: `Response Validation Warnings for platform > Catalog > getPriceFactory \n ${res_error}`,
|
|
5258
|
+
});
|
|
5259
|
+
}
|
|
5260
|
+
}
|
|
5261
|
+
|
|
5262
|
+
return response;
|
|
5263
|
+
}
|
|
5264
|
+
|
|
5265
|
+
/**
|
|
5266
|
+
* @param {CatalogPlatformApplicationValidator.GetPriceFactoryProductParam} arg
|
|
5267
|
+
* - Arg object
|
|
5268
|
+
*
|
|
5269
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
5270
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
5271
|
+
* @returns {Promise<CatalogPlatformModel.PriceFactoryProductResponseSchema>}
|
|
5272
|
+
* - Success response
|
|
5273
|
+
*
|
|
5274
|
+
* @name getPriceFactoryProduct
|
|
5275
|
+
* @summary: Update marketplace optin
|
|
5276
|
+
* @description: get price related information of item for given price factory - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/catalog/getPriceFactoryProduct/).
|
|
5277
|
+
*/
|
|
5278
|
+
async getPriceFactoryProduct(
|
|
5279
|
+
{ priceFactoryId, itemId, requestHeaders } = { requestHeaders: {} },
|
|
5280
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
5281
|
+
) {
|
|
5282
|
+
const {
|
|
5283
|
+
error,
|
|
5284
|
+
} = CatalogPlatformApplicationValidator.getPriceFactoryProduct().validate(
|
|
5285
|
+
{
|
|
5286
|
+
priceFactoryId,
|
|
5287
|
+
itemId,
|
|
5288
|
+
},
|
|
5289
|
+
{ abortEarly: false, allowUnknown: true }
|
|
5290
|
+
);
|
|
5291
|
+
if (error) {
|
|
5292
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
5293
|
+
}
|
|
5294
|
+
|
|
5295
|
+
// Showing warrnings if extra unknown parameters are found
|
|
5296
|
+
const {
|
|
5297
|
+
error: warrning,
|
|
5298
|
+
} = CatalogPlatformApplicationValidator.getPriceFactoryProduct().validate(
|
|
5299
|
+
{
|
|
5300
|
+
priceFactoryId,
|
|
5301
|
+
itemId,
|
|
5302
|
+
},
|
|
5303
|
+
{ abortEarly: false, allowUnknown: false }
|
|
5304
|
+
);
|
|
5305
|
+
if (warrning) {
|
|
5306
|
+
Logger({
|
|
5307
|
+
level: "WARN",
|
|
5308
|
+
message: `Parameter Validation warrnings for platform > Catalog > getPriceFactoryProduct \n ${warrning}`,
|
|
5309
|
+
});
|
|
5310
|
+
}
|
|
5311
|
+
|
|
5312
|
+
const query_params = {};
|
|
5313
|
+
|
|
5314
|
+
const response = await PlatformAPIClient.execute(
|
|
5315
|
+
this.config,
|
|
5316
|
+
"get",
|
|
5317
|
+
`/service/platform/catalog/v1.0/company/${this.config.companyId}/application/${this.applicationId}/price/${priceFactoryId}/products/${itemId}`,
|
|
5318
|
+
query_params,
|
|
5319
|
+
undefined,
|
|
5320
|
+
requestHeaders,
|
|
5321
|
+
{ responseHeaders }
|
|
5322
|
+
);
|
|
5323
|
+
|
|
5324
|
+
let responseData = response;
|
|
5325
|
+
if (responseHeaders) {
|
|
5326
|
+
responseData = response[0];
|
|
5327
|
+
}
|
|
5328
|
+
|
|
5329
|
+
const {
|
|
5330
|
+
error: res_error,
|
|
5331
|
+
} = CatalogPlatformModel.PriceFactoryProductResponseSchema().validate(
|
|
5332
|
+
responseData,
|
|
5333
|
+
{ abortEarly: false, allowUnknown: true }
|
|
5334
|
+
);
|
|
5335
|
+
|
|
5336
|
+
if (res_error) {
|
|
5337
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
5338
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
5339
|
+
} else {
|
|
5340
|
+
Logger({
|
|
5341
|
+
level: "WARN",
|
|
5342
|
+
message: `Response Validation Warnings for platform > Catalog > getPriceFactoryProduct \n ${res_error}`,
|
|
5343
|
+
});
|
|
5344
|
+
}
|
|
5345
|
+
}
|
|
5346
|
+
|
|
5347
|
+
return response;
|
|
5348
|
+
}
|
|
5349
|
+
|
|
5350
|
+
/**
|
|
5351
|
+
* @param {CatalogPlatformApplicationValidator.GetPriceFactoryProductsParam} arg
|
|
5352
|
+
* - Arg object
|
|
5353
|
+
*
|
|
5354
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
5355
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
5356
|
+
* @returns {Promise<CatalogPlatformModel.PriceFactoryProductListResponseSchema>}
|
|
5357
|
+
* - Success response
|
|
5358
|
+
*
|
|
5359
|
+
* @name getPriceFactoryProducts
|
|
5360
|
+
* @summary: Get Products associated with a Price Factory
|
|
5361
|
+
* @description: Retrieves a paginated list of products linked to a specific price factory configuration for the given application and company. This endpoint returns item-level details such as pricing by currency, delivery zones, seller identifiers, media, and size-level configurations. Useful for viewing how pricing strategies are applied across different items.
|
|
5362
|
+
* - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/catalog/getPriceFactoryProducts/).
|
|
5363
|
+
*/
|
|
5364
|
+
async getPriceFactoryProducts(
|
|
5365
|
+
{
|
|
5366
|
+
priceFactoryId,
|
|
5367
|
+
brandIds,
|
|
5368
|
+
categoryIds,
|
|
5369
|
+
sellerIdentifier,
|
|
5370
|
+
itemCode,
|
|
5371
|
+
slug,
|
|
5372
|
+
name,
|
|
5373
|
+
active,
|
|
5374
|
+
pageNo,
|
|
5375
|
+
pageSize,
|
|
5376
|
+
requestHeaders,
|
|
5377
|
+
} = { requestHeaders: {} },
|
|
5378
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
5379
|
+
) {
|
|
5380
|
+
const {
|
|
5381
|
+
error,
|
|
5382
|
+
} = CatalogPlatformApplicationValidator.getPriceFactoryProducts().validate(
|
|
5383
|
+
{
|
|
5384
|
+
priceFactoryId,
|
|
5385
|
+
brandIds,
|
|
5386
|
+
categoryIds,
|
|
5387
|
+
sellerIdentifier,
|
|
5388
|
+
itemCode,
|
|
5389
|
+
slug,
|
|
5390
|
+
name,
|
|
5391
|
+
active,
|
|
5392
|
+
pageNo,
|
|
5393
|
+
pageSize,
|
|
5394
|
+
},
|
|
5395
|
+
{ abortEarly: false, allowUnknown: true }
|
|
5396
|
+
);
|
|
5397
|
+
if (error) {
|
|
5398
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
5399
|
+
}
|
|
5400
|
+
|
|
5401
|
+
// Showing warrnings if extra unknown parameters are found
|
|
5402
|
+
const {
|
|
5403
|
+
error: warrning,
|
|
5404
|
+
} = CatalogPlatformApplicationValidator.getPriceFactoryProducts().validate(
|
|
5405
|
+
{
|
|
5406
|
+
priceFactoryId,
|
|
5407
|
+
brandIds,
|
|
5408
|
+
categoryIds,
|
|
5409
|
+
sellerIdentifier,
|
|
5410
|
+
itemCode,
|
|
5411
|
+
slug,
|
|
5412
|
+
name,
|
|
5413
|
+
active,
|
|
5414
|
+
pageNo,
|
|
5415
|
+
pageSize,
|
|
5416
|
+
},
|
|
5417
|
+
{ abortEarly: false, allowUnknown: false }
|
|
5418
|
+
);
|
|
5419
|
+
if (warrning) {
|
|
5420
|
+
Logger({
|
|
5421
|
+
level: "WARN",
|
|
5422
|
+
message: `Parameter Validation warrnings for platform > Catalog > getPriceFactoryProducts \n ${warrning}`,
|
|
5423
|
+
});
|
|
5424
|
+
}
|
|
5425
|
+
|
|
5426
|
+
const query_params = {};
|
|
5427
|
+
query_params["brand_ids"] = brandIds;
|
|
5428
|
+
query_params["category_ids"] = categoryIds;
|
|
5429
|
+
query_params["seller_identifier"] = sellerIdentifier;
|
|
5430
|
+
query_params["item_code"] = itemCode;
|
|
5431
|
+
query_params["slug"] = slug;
|
|
5432
|
+
query_params["name"] = name;
|
|
5433
|
+
query_params["active"] = active;
|
|
5434
|
+
query_params["page_no"] = pageNo;
|
|
5435
|
+
query_params["page_size"] = pageSize;
|
|
5436
|
+
|
|
5437
|
+
const response = await PlatformAPIClient.execute(
|
|
5438
|
+
this.config,
|
|
5439
|
+
"get",
|
|
5440
|
+
`/service/platform/catalog/v1.0/company/${this.config.companyId}/application/${this.applicationId}/price/${priceFactoryId}/products`,
|
|
5441
|
+
query_params,
|
|
5442
|
+
undefined,
|
|
5443
|
+
requestHeaders,
|
|
5444
|
+
{ responseHeaders }
|
|
5445
|
+
);
|
|
5446
|
+
|
|
5447
|
+
let responseData = response;
|
|
5448
|
+
if (responseHeaders) {
|
|
5449
|
+
responseData = response[0];
|
|
5450
|
+
}
|
|
5451
|
+
|
|
5452
|
+
const {
|
|
5453
|
+
error: res_error,
|
|
5454
|
+
} = CatalogPlatformModel.PriceFactoryProductListResponseSchema().validate(
|
|
5455
|
+
responseData,
|
|
5456
|
+
{ abortEarly: false, allowUnknown: true }
|
|
5457
|
+
);
|
|
5458
|
+
|
|
5459
|
+
if (res_error) {
|
|
5460
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
5461
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
5462
|
+
} else {
|
|
5463
|
+
Logger({
|
|
5464
|
+
level: "WARN",
|
|
5465
|
+
message: `Response Validation Warnings for platform > Catalog > getPriceFactoryProducts \n ${res_error}`,
|
|
5466
|
+
});
|
|
5467
|
+
}
|
|
5468
|
+
}
|
|
5469
|
+
|
|
5470
|
+
return response;
|
|
5471
|
+
}
|
|
5472
|
+
|
|
5473
|
+
/**
|
|
5474
|
+
* @param {CatalogPlatformApplicationValidator.GetProductDetailBySlugParam} arg
|
|
5475
|
+
* - Arg object
|
|
5476
|
+
*
|
|
5477
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
5478
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
5479
|
+
* @returns {Promise<CatalogPlatformModel.ProductDetail>} - Success response
|
|
5480
|
+
* @name getProductDetailBySlug
|
|
5481
|
+
* @summary: Get product details
|
|
5482
|
+
* @description: Retrieve detailed product information using a product slug. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/catalog/getProductDetailBySlug/).
|
|
5483
|
+
*/
|
|
5484
|
+
async getProductDetailBySlug(
|
|
5485
|
+
{ slug, requestHeaders } = { requestHeaders: {} },
|
|
5486
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
5487
|
+
) {
|
|
5488
|
+
const {
|
|
5489
|
+
error,
|
|
5490
|
+
} = CatalogPlatformApplicationValidator.getProductDetailBySlug().validate(
|
|
5491
|
+
{
|
|
5492
|
+
slug,
|
|
5493
|
+
},
|
|
5494
|
+
{ abortEarly: false, allowUnknown: true }
|
|
5495
|
+
);
|
|
5496
|
+
if (error) {
|
|
5497
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
5498
|
+
}
|
|
5499
|
+
|
|
5500
|
+
// Showing warrnings if extra unknown parameters are found
|
|
5501
|
+
const {
|
|
5502
|
+
error: warrning,
|
|
5503
|
+
} = CatalogPlatformApplicationValidator.getProductDetailBySlug().validate(
|
|
5504
|
+
{
|
|
5505
|
+
slug,
|
|
5506
|
+
},
|
|
5507
|
+
{ abortEarly: false, allowUnknown: false }
|
|
5508
|
+
);
|
|
5509
|
+
if (warrning) {
|
|
5510
|
+
Logger({
|
|
5511
|
+
level: "WARN",
|
|
5512
|
+
message: `Parameter Validation warrnings for platform > Catalog > getProductDetailBySlug \n ${warrning}`,
|
|
5513
|
+
});
|
|
5514
|
+
}
|
|
5515
|
+
|
|
5516
|
+
const query_params = {};
|
|
5517
|
+
|
|
5518
|
+
const response = await PlatformAPIClient.execute(
|
|
5519
|
+
this.config,
|
|
5520
|
+
"get",
|
|
5521
|
+
`/service/platform/catalog/v1.0/company/${this.config.companyId}/application/${this.applicationId}/products/${slug}`,
|
|
5522
|
+
query_params,
|
|
5523
|
+
undefined,
|
|
5524
|
+
requestHeaders,
|
|
5525
|
+
{ responseHeaders }
|
|
5526
|
+
);
|
|
5527
|
+
|
|
5528
|
+
let responseData = response;
|
|
5529
|
+
if (responseHeaders) {
|
|
5530
|
+
responseData = response[0];
|
|
5531
|
+
}
|
|
5532
|
+
|
|
5533
|
+
const {
|
|
5534
|
+
error: res_error,
|
|
5535
|
+
} = CatalogPlatformModel.ProductDetail().validate(responseData, {
|
|
5536
|
+
abortEarly: false,
|
|
5537
|
+
allowUnknown: true,
|
|
5538
|
+
});
|
|
5539
|
+
|
|
5540
|
+
if (res_error) {
|
|
5541
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
5542
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
5543
|
+
} else {
|
|
5544
|
+
Logger({
|
|
5545
|
+
level: "WARN",
|
|
5546
|
+
message: `Response Validation Warnings for platform > Catalog > getProductDetailBySlug \n ${res_error}`,
|
|
5547
|
+
});
|
|
5548
|
+
}
|
|
5549
|
+
}
|
|
5550
|
+
|
|
5551
|
+
return response;
|
|
5552
|
+
}
|
|
5553
|
+
|
|
5554
|
+
/**
|
|
5555
|
+
* @param {CatalogPlatformApplicationValidator.GetQueryFiltersParam} arg - Arg object
|
|
5556
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
5557
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
5558
|
+
* @returns {Promise<CatalogPlatformModel.GetQueryFiltersResponseSchema>} -
|
|
5559
|
+
* Success response
|
|
5560
|
+
* @name getQueryFilters
|
|
5561
|
+
* @summary: Get collection query filters
|
|
5562
|
+
* @description: Retrieve query filters to configure a collection for a company and a sales channel. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/catalog/getQueryFilters/).
|
|
5563
|
+
*/
|
|
5564
|
+
async getQueryFilters(
|
|
5565
|
+
{ requestHeaders } = { requestHeaders: {} },
|
|
5566
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
5567
|
+
) {
|
|
5568
|
+
const {
|
|
5569
|
+
error,
|
|
5570
|
+
} = CatalogPlatformApplicationValidator.getQueryFilters().validate(
|
|
5571
|
+
{},
|
|
5572
|
+
{ abortEarly: false, allowUnknown: true }
|
|
5573
|
+
);
|
|
5574
|
+
if (error) {
|
|
5575
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
5576
|
+
}
|
|
5577
|
+
|
|
5578
|
+
// Showing warrnings if extra unknown parameters are found
|
|
5579
|
+
const {
|
|
5580
|
+
error: warrning,
|
|
5581
|
+
} = CatalogPlatformApplicationValidator.getQueryFilters().validate(
|
|
5582
|
+
{},
|
|
5583
|
+
{ abortEarly: false, allowUnknown: false }
|
|
5584
|
+
);
|
|
5585
|
+
if (warrning) {
|
|
5586
|
+
Logger({
|
|
5587
|
+
level: "WARN",
|
|
5588
|
+
message: `Parameter Validation warrnings for platform > Catalog > getQueryFilters \n ${warrning}`,
|
|
5589
|
+
});
|
|
5590
|
+
}
|
|
5591
|
+
|
|
5592
|
+
const query_params = {};
|
|
5593
|
+
|
|
5594
|
+
const response = await PlatformAPIClient.execute(
|
|
5595
|
+
this.config,
|
|
5596
|
+
"get",
|
|
5597
|
+
`/service/platform/catalog/v1.0/company/${this.config.companyId}/application/${this.applicationId}/collections/query-options/`,
|
|
5598
|
+
query_params,
|
|
5599
|
+
undefined,
|
|
5600
|
+
requestHeaders,
|
|
5601
|
+
{ responseHeaders }
|
|
5602
|
+
);
|
|
5603
|
+
|
|
5604
|
+
let responseData = response;
|
|
5605
|
+
if (responseHeaders) {
|
|
5606
|
+
responseData = response[0];
|
|
5607
|
+
}
|
|
5608
|
+
|
|
5609
|
+
const {
|
|
5610
|
+
error: res_error,
|
|
5611
|
+
} = CatalogPlatformModel.GetQueryFiltersResponseSchema().validate(
|
|
5612
|
+
responseData,
|
|
5613
|
+
{ abortEarly: false, allowUnknown: true }
|
|
5614
|
+
);
|
|
5615
|
+
|
|
4996
5616
|
if (res_error) {
|
|
4997
5617
|
if (this.config.options.strictResponseCheck === true) {
|
|
4998
5618
|
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
@@ -6326,6 +6946,176 @@ class Catalog {
|
|
|
6326
6946
|
return response;
|
|
6327
6947
|
}
|
|
6328
6948
|
|
|
6949
|
+
/**
|
|
6950
|
+
* @param {CatalogPlatformApplicationValidator.UpdatePriceFactoryParam} arg
|
|
6951
|
+
* - Arg object
|
|
6952
|
+
*
|
|
6953
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
6954
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
6955
|
+
* @returns {Promise<CatalogPlatformModel.SuccessResponseSchema>} - Success response
|
|
6956
|
+
* @name updatePriceFactory
|
|
6957
|
+
* @summary: Update an Existing Price Factory Configuration
|
|
6958
|
+
* @description: Allows partial update of an existing price factory configuration for a specific application and company using the provided price factory ID. Fields such as name, currencies, pricing strategies, or zone mapping can be modified.
|
|
6959
|
+
* - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/catalog/updatePriceFactory/).
|
|
6960
|
+
*/
|
|
6961
|
+
async updatePriceFactory(
|
|
6962
|
+
{ priceFactoryId, body, requestHeaders } = { requestHeaders: {} },
|
|
6963
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
6964
|
+
) {
|
|
6965
|
+
const {
|
|
6966
|
+
error,
|
|
6967
|
+
} = CatalogPlatformApplicationValidator.updatePriceFactory().validate(
|
|
6968
|
+
{
|
|
6969
|
+
priceFactoryId,
|
|
6970
|
+
body,
|
|
6971
|
+
},
|
|
6972
|
+
{ abortEarly: false, allowUnknown: true }
|
|
6973
|
+
);
|
|
6974
|
+
if (error) {
|
|
6975
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
6976
|
+
}
|
|
6977
|
+
|
|
6978
|
+
// Showing warrnings if extra unknown parameters are found
|
|
6979
|
+
const {
|
|
6980
|
+
error: warrning,
|
|
6981
|
+
} = CatalogPlatformApplicationValidator.updatePriceFactory().validate(
|
|
6982
|
+
{
|
|
6983
|
+
priceFactoryId,
|
|
6984
|
+
body,
|
|
6985
|
+
},
|
|
6986
|
+
{ abortEarly: false, allowUnknown: false }
|
|
6987
|
+
);
|
|
6988
|
+
if (warrning) {
|
|
6989
|
+
Logger({
|
|
6990
|
+
level: "WARN",
|
|
6991
|
+
message: `Parameter Validation warrnings for platform > Catalog > updatePriceFactory \n ${warrning}`,
|
|
6992
|
+
});
|
|
6993
|
+
}
|
|
6994
|
+
|
|
6995
|
+
const query_params = {};
|
|
6996
|
+
|
|
6997
|
+
const response = await PlatformAPIClient.execute(
|
|
6998
|
+
this.config,
|
|
6999
|
+
"patch",
|
|
7000
|
+
`/service/platform/catalog/v1.0/company/${this.config.companyId}/application/${this.applicationId}/price/${priceFactoryId}`,
|
|
7001
|
+
query_params,
|
|
7002
|
+
body,
|
|
7003
|
+
requestHeaders,
|
|
7004
|
+
{ responseHeaders }
|
|
7005
|
+
);
|
|
7006
|
+
|
|
7007
|
+
let responseData = response;
|
|
7008
|
+
if (responseHeaders) {
|
|
7009
|
+
responseData = response[0];
|
|
7010
|
+
}
|
|
7011
|
+
|
|
7012
|
+
const {
|
|
7013
|
+
error: res_error,
|
|
7014
|
+
} = CatalogPlatformModel.SuccessResponseSchema().validate(responseData, {
|
|
7015
|
+
abortEarly: false,
|
|
7016
|
+
allowUnknown: true,
|
|
7017
|
+
});
|
|
7018
|
+
|
|
7019
|
+
if (res_error) {
|
|
7020
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
7021
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
7022
|
+
} else {
|
|
7023
|
+
Logger({
|
|
7024
|
+
level: "WARN",
|
|
7025
|
+
message: `Response Validation Warnings for platform > Catalog > updatePriceFactory \n ${res_error}`,
|
|
7026
|
+
});
|
|
7027
|
+
}
|
|
7028
|
+
}
|
|
7029
|
+
|
|
7030
|
+
return response;
|
|
7031
|
+
}
|
|
7032
|
+
|
|
7033
|
+
/**
|
|
7034
|
+
* @param {CatalogPlatformApplicationValidator.UpdatePriceFactoryProductParam} arg
|
|
7035
|
+
* - Arg object
|
|
7036
|
+
*
|
|
7037
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
7038
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
7039
|
+
* @returns {Promise<CatalogPlatformModel.SuccessResponseSchema>} - Success response
|
|
7040
|
+
* @name updatePriceFactoryProduct
|
|
7041
|
+
* @summary: Partially update price factory product configuration
|
|
7042
|
+
* @description: Updates specific fields in the price factory product configuration. Use this to partially update pricing or status for a given product and size without overwriting the entire configuration.
|
|
7043
|
+
* - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/catalog/updatePriceFactoryProduct/).
|
|
7044
|
+
*/
|
|
7045
|
+
async updatePriceFactoryProduct(
|
|
7046
|
+
{ priceFactoryId, itemId, body, requestHeaders } = { requestHeaders: {} },
|
|
7047
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
7048
|
+
) {
|
|
7049
|
+
const {
|
|
7050
|
+
error,
|
|
7051
|
+
} = CatalogPlatformApplicationValidator.updatePriceFactoryProduct().validate(
|
|
7052
|
+
{
|
|
7053
|
+
priceFactoryId,
|
|
7054
|
+
itemId,
|
|
7055
|
+
body,
|
|
7056
|
+
},
|
|
7057
|
+
{ abortEarly: false, allowUnknown: true }
|
|
7058
|
+
);
|
|
7059
|
+
if (error) {
|
|
7060
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
7061
|
+
}
|
|
7062
|
+
|
|
7063
|
+
// Showing warrnings if extra unknown parameters are found
|
|
7064
|
+
const {
|
|
7065
|
+
error: warrning,
|
|
7066
|
+
} = CatalogPlatformApplicationValidator.updatePriceFactoryProduct().validate(
|
|
7067
|
+
{
|
|
7068
|
+
priceFactoryId,
|
|
7069
|
+
itemId,
|
|
7070
|
+
body,
|
|
7071
|
+
},
|
|
7072
|
+
{ abortEarly: false, allowUnknown: false }
|
|
7073
|
+
);
|
|
7074
|
+
if (warrning) {
|
|
7075
|
+
Logger({
|
|
7076
|
+
level: "WARN",
|
|
7077
|
+
message: `Parameter Validation warrnings for platform > Catalog > updatePriceFactoryProduct \n ${warrning}`,
|
|
7078
|
+
});
|
|
7079
|
+
}
|
|
7080
|
+
|
|
7081
|
+
const query_params = {};
|
|
7082
|
+
|
|
7083
|
+
const response = await PlatformAPIClient.execute(
|
|
7084
|
+
this.config,
|
|
7085
|
+
"patch",
|
|
7086
|
+
`/service/platform/catalog/v1.0/company/${this.config.companyId}/application/${this.applicationId}/price/${priceFactoryId}/products/${itemId}`,
|
|
7087
|
+
query_params,
|
|
7088
|
+
body,
|
|
7089
|
+
requestHeaders,
|
|
7090
|
+
{ responseHeaders }
|
|
7091
|
+
);
|
|
7092
|
+
|
|
7093
|
+
let responseData = response;
|
|
7094
|
+
if (responseHeaders) {
|
|
7095
|
+
responseData = response[0];
|
|
7096
|
+
}
|
|
7097
|
+
|
|
7098
|
+
const {
|
|
7099
|
+
error: res_error,
|
|
7100
|
+
} = CatalogPlatformModel.SuccessResponseSchema().validate(responseData, {
|
|
7101
|
+
abortEarly: false,
|
|
7102
|
+
allowUnknown: true,
|
|
7103
|
+
});
|
|
7104
|
+
|
|
7105
|
+
if (res_error) {
|
|
7106
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
7107
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
7108
|
+
} else {
|
|
7109
|
+
Logger({
|
|
7110
|
+
level: "WARN",
|
|
7111
|
+
message: `Response Validation Warnings for platform > Catalog > updatePriceFactoryProduct \n ${res_error}`,
|
|
7112
|
+
});
|
|
7113
|
+
}
|
|
7114
|
+
}
|
|
7115
|
+
|
|
7116
|
+
return response;
|
|
7117
|
+
}
|
|
7118
|
+
|
|
6329
7119
|
/**
|
|
6330
7120
|
* @param {CatalogPlatformApplicationValidator.UpdateSearchConfigurationParam} arg
|
|
6331
7121
|
* - Arg object
|