@gofynd/fdk-client-javascript 3.6.0 → 3.8.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/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 +10 -16
- package/sdk/platform/Catalog/CatalogPlatformClient.js +10 -91
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +277 -31
- package/sdk/platform/Catalog/CatalogPlatformModel.js +155 -25
- package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +3 -24
- package/sdk/platform/Catalog/CatalogPlatformValidator.js +2 -19
- package/sdk/platform/Order/OrderPlatformModel.d.ts +7 -11
- package/sdk/platform/Order/OrderPlatformModel.js +3 -5
- 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/README.md
CHANGED
|
@@ -234,7 +234,7 @@ console.log("Active Theme: ", response.information.name);
|
|
|
234
234
|
The above code will log the curl command in the console
|
|
235
235
|
|
|
236
236
|
```bash
|
|
237
|
-
curl --request GET "https://api.fynd.com/service/application/theme/v1.0/applied-theme" --header 'authorization: Bearer <authorization-token>' --header 'x-fp-sdk-version: 3.
|
|
237
|
+
curl --request GET "https://api.fynd.com/service/application/theme/v1.0/applied-theme" --header 'authorization: Bearer <authorization-token>' --header 'x-fp-sdk-version: 3.8.0' --header 'x-fp-date: 20230222T115108Z' --header 'x-fp-signature: v1.1:1e3ab3b02b5bc626e3c32a37ee844266ade02bbcbaafc28fc7a0e46a76a7a1a8'
|
|
238
238
|
Active Theme: Emerge
|
|
239
239
|
```
|
|
240
240
|
|
package/package.json
CHANGED
|
@@ -861,7 +861,7 @@ declare class Catalog {
|
|
|
861
861
|
* @description: List all product ids a user has wishlisted or is following for sales channel.
|
|
862
862
|
* - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/catalog/getFollowedProducts/).
|
|
863
863
|
*/
|
|
864
|
-
getFollowedProducts({ userId, pageId, requestHeaders }?: CatalogPlatformApplicationValidator.GetFollowedProductsParam, { responseHeaders }?: object): Promise<CatalogPlatformModel.FollowedProducts>;
|
|
864
|
+
getFollowedProducts({ userId, pageId, pageSize, requestHeaders }?: CatalogPlatformApplicationValidator.GetFollowedProductsParam, { responseHeaders }?: object): Promise<CatalogPlatformModel.FollowedProducts>;
|
|
865
865
|
/**
|
|
866
866
|
* @param {CatalogPlatformApplicationValidator.GetGroupConfigurationsParam} arg
|
|
867
867
|
* - Arg object
|
|
@@ -4591,7 +4591,7 @@ class Catalog {
|
|
|
4591
4591
|
* - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/catalog/getFollowedProducts/).
|
|
4592
4592
|
*/
|
|
4593
4593
|
async getFollowedProducts(
|
|
4594
|
-
{ userId, pageId, requestHeaders } = { requestHeaders: {} },
|
|
4594
|
+
{ userId, pageId, pageSize, requestHeaders } = { requestHeaders: {} },
|
|
4595
4595
|
{ responseHeaders } = { responseHeaders: false }
|
|
4596
4596
|
) {
|
|
4597
4597
|
const {
|
|
@@ -4600,6 +4600,7 @@ class Catalog {
|
|
|
4600
4600
|
{
|
|
4601
4601
|
userId,
|
|
4602
4602
|
pageId,
|
|
4603
|
+
pageSize,
|
|
4603
4604
|
},
|
|
4604
4605
|
{ abortEarly: false, allowUnknown: true }
|
|
4605
4606
|
);
|
|
@@ -4614,6 +4615,7 @@ class Catalog {
|
|
|
4614
4615
|
{
|
|
4615
4616
|
userId,
|
|
4616
4617
|
pageId,
|
|
4618
|
+
pageSize,
|
|
4617
4619
|
},
|
|
4618
4620
|
{ abortEarly: false, allowUnknown: false }
|
|
4619
4621
|
);
|
|
@@ -4626,6 +4628,7 @@ class Catalog {
|
|
|
4626
4628
|
|
|
4627
4629
|
const query_params = {};
|
|
4628
4630
|
query_params["page_id"] = pageId;
|
|
4631
|
+
query_params["page_size"] = pageSize;
|
|
4629
4632
|
|
|
4630
4633
|
const response = await PlatformAPIClient.execute(
|
|
4631
4634
|
this.config,
|
|
@@ -341,6 +341,7 @@ export = CatalogPlatformApplicationValidator;
|
|
|
341
341
|
* @property {string} userId - User ID to fetch the followed list
|
|
342
342
|
* @property {string} [pageId] - The identifier used to retrieve the next set of
|
|
343
343
|
* results. This parameter follows cursor-based pagination.
|
|
344
|
+
* @property {number} [pageSize] - Number of items per page
|
|
344
345
|
*/
|
|
345
346
|
/**
|
|
346
347
|
* @typedef GetGroupConfigurationsParam
|
|
@@ -1246,6 +1247,10 @@ type GetFollowedProductsParam = {
|
|
|
1246
1247
|
* results. This parameter follows cursor-based pagination.
|
|
1247
1248
|
*/
|
|
1248
1249
|
pageId?: string;
|
|
1250
|
+
/**
|
|
1251
|
+
* - Number of items per page
|
|
1252
|
+
*/
|
|
1253
|
+
pageSize?: number;
|
|
1249
1254
|
};
|
|
1250
1255
|
type GetGroupConfigurationsParam = {
|
|
1251
1256
|
/**
|
|
@@ -390,6 +390,7 @@ const CatalogPlatformModel = require("./CatalogPlatformModel");
|
|
|
390
390
|
* @property {string} userId - User ID to fetch the followed list
|
|
391
391
|
* @property {string} [pageId] - The identifier used to retrieve the next set of
|
|
392
392
|
* results. This parameter follows cursor-based pagination.
|
|
393
|
+
* @property {number} [pageSize] - Number of items per page
|
|
393
394
|
*/
|
|
394
395
|
|
|
395
396
|
/**
|
|
@@ -935,6 +936,7 @@ class CatalogPlatformApplicationValidator {
|
|
|
935
936
|
return Joi.object({
|
|
936
937
|
userId: Joi.string().allow("").required(),
|
|
937
938
|
pageId: Joi.string().allow(""),
|
|
939
|
+
pageSize: Joi.number(),
|
|
938
940
|
}).required();
|
|
939
941
|
}
|
|
940
942
|
|
|
@@ -176,7 +176,7 @@ declare class Catalog {
|
|
|
176
176
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
177
177
|
* @returns {Promise<CatalogPlatformModel.CreateTax>} - Success response
|
|
178
178
|
* @name createTax
|
|
179
|
-
* @summary: Create
|
|
179
|
+
* @summary: Create Tax Rule
|
|
180
180
|
* @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/).
|
|
181
181
|
*/
|
|
182
182
|
createTax({ body, requestHeaders }?: CatalogPlatformValidator.CreateTaxParam, { responseHeaders }?: object): Promise<CatalogPlatformModel.CreateTax>;
|
|
@@ -184,12 +184,16 @@ declare class Catalog {
|
|
|
184
184
|
* @param {CatalogPlatformValidator.CreateTaxComponentNameParam} arg - Arg object
|
|
185
185
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
186
186
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
187
|
-
* @returns {Promise<CatalogPlatformModel.
|
|
187
|
+
* @returns {Promise<CatalogPlatformModel.TaxComponentName>} - Success response
|
|
188
188
|
* @name createTaxComponentName
|
|
189
|
-
* @summary: Create component
|
|
190
|
-
* @description:
|
|
189
|
+
* @summary: Create tax component name
|
|
190
|
+
* @description: Tax components represent different types of taxes that may be applied to products or transactions,
|
|
191
|
+
* such as sales tax, value-added tax (VAT), goods and services tax, consumption tax,
|
|
192
|
+
* or other region-specific taxation systems. This endpoint allows companies to define and
|
|
193
|
+
* customize the names of tax components according to their local tax regulations and business requirements.
|
|
194
|
+
* - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/catalog/createTaxComponentName/).
|
|
191
195
|
*/
|
|
192
|
-
createTaxComponentName({ body, requestHeaders }?: CatalogPlatformValidator.CreateTaxComponentNameParam, { responseHeaders }?: object): Promise<CatalogPlatformModel.
|
|
196
|
+
createTaxComponentName({ body, requestHeaders }?: CatalogPlatformValidator.CreateTaxComponentNameParam, { responseHeaders }?: object): Promise<CatalogPlatformModel.TaxComponentName>;
|
|
193
197
|
/**
|
|
194
198
|
* @param {CatalogPlatformValidator.CreateTaxVersionParam} arg - Arg object
|
|
195
199
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
@@ -1149,7 +1153,7 @@ declare class Catalog {
|
|
|
1149
1153
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1150
1154
|
* @returns {Promise<CatalogPlatformModel.TaxRule>} - Success response
|
|
1151
1155
|
* @name updateTaxRule
|
|
1152
|
-
* @summary: Update
|
|
1156
|
+
* @summary: Update Tax Rule
|
|
1153
1157
|
* @description: Update an existing tax rule under a specific company. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/catalog/updateTaxRule/).
|
|
1154
1158
|
*/
|
|
1155
1159
|
updateTaxRule({ ruleId, body, requestHeaders }?: CatalogPlatformValidator.UpdateTaxRuleParam, { responseHeaders }?: object): Promise<CatalogPlatformModel.TaxRule>;
|
|
@@ -1163,16 +1167,6 @@ declare class Catalog {
|
|
|
1163
1167
|
* @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/).
|
|
1164
1168
|
*/
|
|
1165
1169
|
updateTaxVersion({ ruleId, versionId, body, requestHeaders }?: CatalogPlatformValidator.UpdateTaxVersionParam, { responseHeaders }?: object): Promise<CatalogPlatformModel.TaxVersion>;
|
|
1166
|
-
/**
|
|
1167
|
-
* @param {CatalogPlatformValidator.UploadBulkProductsParam} arg - Arg object
|
|
1168
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1169
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1170
|
-
* @returns {Promise<CatalogPlatformModel.BulkResponseSchema>} - Success response
|
|
1171
|
-
* @name uploadBulkProducts
|
|
1172
|
-
* @summary: Upload bulk products
|
|
1173
|
-
* @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/).
|
|
1174
|
-
*/
|
|
1175
|
-
uploadBulkProducts({ department, productType, body, requestHeaders }?: CatalogPlatformValidator.UploadBulkProductsParam, { responseHeaders }?: object): Promise<CatalogPlatformModel.BulkResponseSchema>;
|
|
1176
1170
|
/**
|
|
1177
1171
|
* @param {CatalogPlatformValidator.ValidateProductGlobalTemplateParam} arg
|
|
1178
1172
|
* - Arg object
|
|
@@ -1310,7 +1310,7 @@ class Catalog {
|
|
|
1310
1310
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1311
1311
|
* @returns {Promise<CatalogPlatformModel.CreateTax>} - Success response
|
|
1312
1312
|
* @name createTax
|
|
1313
|
-
* @summary: Create
|
|
1313
|
+
* @summary: Create Tax Rule
|
|
1314
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
1315
|
*/
|
|
1316
1316
|
async createTax(
|
|
@@ -1385,10 +1385,14 @@ class Catalog {
|
|
|
1385
1385
|
* @param {CatalogPlatformValidator.CreateTaxComponentNameParam} arg - Arg object
|
|
1386
1386
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1387
1387
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1388
|
-
* @returns {Promise<CatalogPlatformModel.
|
|
1388
|
+
* @returns {Promise<CatalogPlatformModel.TaxComponentName>} - Success response
|
|
1389
1389
|
* @name createTaxComponentName
|
|
1390
|
-
* @summary: Create component
|
|
1391
|
-
* @description:
|
|
1390
|
+
* @summary: Create tax component name
|
|
1391
|
+
* @description: Tax components represent different types of taxes that may be applied to products or transactions,
|
|
1392
|
+
* such as sales tax, value-added tax (VAT), goods and services tax, consumption tax,
|
|
1393
|
+
* or other region-specific taxation systems. This endpoint allows companies to define and
|
|
1394
|
+
* customize the names of tax components according to their local tax regulations and business requirements.
|
|
1395
|
+
* - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/catalog/createTaxComponentName/).
|
|
1392
1396
|
*/
|
|
1393
1397
|
async createTaxComponentName(
|
|
1394
1398
|
{ body, requestHeaders } = { requestHeaders: {} },
|
|
@@ -1443,7 +1447,7 @@ class Catalog {
|
|
|
1443
1447
|
|
|
1444
1448
|
const {
|
|
1445
1449
|
error: res_error,
|
|
1446
|
-
} = CatalogPlatformModel.
|
|
1450
|
+
} = CatalogPlatformModel.TaxComponentName().validate(responseData, {
|
|
1447
1451
|
abortEarly: false,
|
|
1448
1452
|
allowUnknown: true,
|
|
1449
1453
|
});
|
|
@@ -7585,7 +7589,7 @@ class Catalog {
|
|
|
7585
7589
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
7586
7590
|
* @returns {Promise<CatalogPlatformModel.TaxRule>} - Success response
|
|
7587
7591
|
* @name updateTaxRule
|
|
7588
|
-
* @summary: Update
|
|
7592
|
+
* @summary: Update Tax Rule
|
|
7589
7593
|
* @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
7594
|
*/
|
|
7591
7595
|
async updateTaxRule(
|
|
@@ -7745,91 +7749,6 @@ class Catalog {
|
|
|
7745
7749
|
return response;
|
|
7746
7750
|
}
|
|
7747
7751
|
|
|
7748
|
-
/**
|
|
7749
|
-
* @param {CatalogPlatformValidator.UploadBulkProductsParam} arg - Arg object
|
|
7750
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
7751
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
7752
|
-
* @returns {Promise<CatalogPlatformModel.BulkResponseSchema>} - Success response
|
|
7753
|
-
* @name uploadBulkProducts
|
|
7754
|
-
* @summary: Upload bulk products
|
|
7755
|
-
* @description: Users can create multiple products by providing the required information needed for product creation in a CSV or Excel file format. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/catalog/uploadBulkProducts/).
|
|
7756
|
-
*/
|
|
7757
|
-
async uploadBulkProducts(
|
|
7758
|
-
{ department, productType, body, requestHeaders } = { requestHeaders: {} },
|
|
7759
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
7760
|
-
) {
|
|
7761
|
-
const { error } = CatalogPlatformValidator.uploadBulkProducts().validate(
|
|
7762
|
-
{
|
|
7763
|
-
department,
|
|
7764
|
-
productType,
|
|
7765
|
-
body,
|
|
7766
|
-
},
|
|
7767
|
-
{ abortEarly: false, allowUnknown: true }
|
|
7768
|
-
);
|
|
7769
|
-
if (error) {
|
|
7770
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
7771
|
-
}
|
|
7772
|
-
|
|
7773
|
-
// Showing warrnings if extra unknown parameters are found
|
|
7774
|
-
const {
|
|
7775
|
-
error: warrning,
|
|
7776
|
-
} = CatalogPlatformValidator.uploadBulkProducts().validate(
|
|
7777
|
-
{
|
|
7778
|
-
department,
|
|
7779
|
-
productType,
|
|
7780
|
-
body,
|
|
7781
|
-
},
|
|
7782
|
-
{ abortEarly: false, allowUnknown: false }
|
|
7783
|
-
);
|
|
7784
|
-
if (warrning) {
|
|
7785
|
-
Logger({
|
|
7786
|
-
level: "WARN",
|
|
7787
|
-
message: `Parameter Validation warrnings for platform > Catalog > uploadBulkProducts \n ${warrning}`,
|
|
7788
|
-
});
|
|
7789
|
-
}
|
|
7790
|
-
|
|
7791
|
-
const query_params = {};
|
|
7792
|
-
query_params["department"] = department;
|
|
7793
|
-
query_params["product_type"] = productType;
|
|
7794
|
-
|
|
7795
|
-
const xHeaders = {};
|
|
7796
|
-
|
|
7797
|
-
const response = await PlatformAPIClient.execute(
|
|
7798
|
-
this.config,
|
|
7799
|
-
"post",
|
|
7800
|
-
`/service/platform/catalog/v3.0/company/${this.config.companyId}/products/bulk`,
|
|
7801
|
-
query_params,
|
|
7802
|
-
body,
|
|
7803
|
-
{ ...xHeaders, ...requestHeaders },
|
|
7804
|
-
{ responseHeaders }
|
|
7805
|
-
);
|
|
7806
|
-
|
|
7807
|
-
let responseData = response;
|
|
7808
|
-
if (responseHeaders) {
|
|
7809
|
-
responseData = response[0];
|
|
7810
|
-
}
|
|
7811
|
-
|
|
7812
|
-
const {
|
|
7813
|
-
error: res_error,
|
|
7814
|
-
} = CatalogPlatformModel.BulkResponseSchema().validate(responseData, {
|
|
7815
|
-
abortEarly: false,
|
|
7816
|
-
allowUnknown: true,
|
|
7817
|
-
});
|
|
7818
|
-
|
|
7819
|
-
if (res_error) {
|
|
7820
|
-
if (this.config.options.strictResponseCheck === true) {
|
|
7821
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
7822
|
-
} else {
|
|
7823
|
-
Logger({
|
|
7824
|
-
level: "WARN",
|
|
7825
|
-
message: `Response Validation Warnings for platform > Catalog > uploadBulkProducts \n ${res_error}`,
|
|
7826
|
-
});
|
|
7827
|
-
}
|
|
7828
|
-
}
|
|
7829
|
-
|
|
7830
|
-
return response;
|
|
7831
|
-
}
|
|
7832
|
-
|
|
7833
7752
|
/**
|
|
7834
7753
|
* @param {CatalogPlatformValidator.ValidateProductGlobalTemplateParam} arg
|
|
7835
7754
|
* - Arg object
|