@gofynd/fdk-client-javascript 3.11.0 → 3.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (24) hide show
  1. package/README.md +1 -1
  2. package/package.json +1 -1
  3. package/sdk/application/Catalog/CatalogApplicationClient.d.ts +16 -6
  4. package/sdk/application/Catalog/CatalogApplicationClient.js +71 -12
  5. package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +80 -80
  6. package/sdk/platform/Cart/CartPlatformApplicationValidator.js +48 -48
  7. package/sdk/platform/Cart/CartPlatformModel.d.ts +6 -18
  8. package/sdk/platform/Cart/CartPlatformModel.js +2 -36
  9. package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +14 -48
  10. package/sdk/platform/Catalog/CatalogPlatformClient.js +85 -338
  11. package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +207 -763
  12. package/sdk/platform/Catalog/CatalogPlatformModel.js +107 -392
  13. package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +15 -71
  14. package/sdk/platform/Catalog/CatalogPlatformValidator.js +14 -60
  15. package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +36 -0
  16. package/sdk/platform/Order/OrderPlatformApplicationClient.js +252 -0
  17. package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +34 -1
  18. package/sdk/platform/Order/OrderPlatformApplicationValidator.js +42 -0
  19. package/sdk/platform/Order/OrderPlatformClient.d.ts +69 -7
  20. package/sdk/platform/Order/OrderPlatformClient.js +453 -7
  21. package/sdk/platform/Order/OrderPlatformModel.d.ts +1851 -431
  22. package/sdk/platform/Order/OrderPlatformModel.js +1171 -448
  23. package/sdk/platform/Order/OrderPlatformValidator.d.ts +150 -16
  24. package/sdk/platform/Order/OrderPlatformValidator.js +105 -9
@@ -980,87 +980,6 @@ class Catalog {
980
980
  return response;
981
981
  }
982
982
 
983
- /**
984
- * @param {CatalogPlatformValidator.CreateProductBundleParam} arg - Arg object
985
- * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
986
- * @param {import("../PlatformAPIClient").Options} - Options
987
- * @returns {Promise<CatalogPlatformModel.GetProductBundleCreateResponseSchema>}
988
- * - Success response
989
- *
990
- * @name createProductBundle
991
- * @summary: Create product bundle
992
- * @description: Create product bundle in the catalog associated to a specific company - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/catalog/createProductBundle/).
993
- */
994
- async createProductBundle(
995
- { body, requestHeaders } = { requestHeaders: {} },
996
- { responseHeaders } = { responseHeaders: false }
997
- ) {
998
- const { error } = CatalogPlatformValidator.createProductBundle().validate(
999
- {
1000
- body,
1001
- },
1002
- { abortEarly: false, allowUnknown: true }
1003
- );
1004
- if (error) {
1005
- return Promise.reject(new FDKClientValidationError(error));
1006
- }
1007
-
1008
- // Showing warrnings if extra unknown parameters are found
1009
- const {
1010
- error: warrning,
1011
- } = CatalogPlatformValidator.createProductBundle().validate(
1012
- {
1013
- body,
1014
- },
1015
- { abortEarly: false, allowUnknown: false }
1016
- );
1017
- if (warrning) {
1018
- Logger({
1019
- level: "WARN",
1020
- message: `Parameter Validation warrnings for platform > Catalog > createProductBundle \n ${warrning}`,
1021
- });
1022
- }
1023
-
1024
- const query_params = {};
1025
-
1026
- const xHeaders = {};
1027
-
1028
- const response = await PlatformAPIClient.execute(
1029
- this.config,
1030
- "post",
1031
- `/service/platform/catalog/v1.0/company/${this.config.companyId}/product-bundle/`,
1032
- query_params,
1033
- body,
1034
- { ...xHeaders, ...requestHeaders },
1035
- { responseHeaders }
1036
- );
1037
-
1038
- let responseData = response;
1039
- if (responseHeaders) {
1040
- responseData = response[0];
1041
- }
1042
-
1043
- const {
1044
- error: res_error,
1045
- } = CatalogPlatformModel.GetProductBundleCreateResponseSchema().validate(
1046
- responseData,
1047
- { abortEarly: false, allowUnknown: true }
1048
- );
1049
-
1050
- if (res_error) {
1051
- if (this.config.options.strictResponseCheck === true) {
1052
- return Promise.reject(new FDKResponseValidationError(res_error));
1053
- } else {
1054
- Logger({
1055
- level: "WARN",
1056
- message: `Response Validation Warnings for platform > Catalog > createProductBundle \n ${res_error}`,
1057
- });
1058
- }
1059
- }
1060
-
1061
- return response;
1062
- }
1063
-
1064
983
  /**
1065
984
  * @param {CatalogPlatformValidator.CreateProductExportJobParam} arg - Arg object
1066
985
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
@@ -4640,180 +4559,6 @@ class Catalog {
4640
4559
  return paginator;
4641
4560
  }
4642
4561
 
4643
- /**
4644
- * @param {CatalogPlatformValidator.GetProductBundleParam} arg - Arg object
4645
- * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
4646
- * @param {import("../PlatformAPIClient").Options} - Options
4647
- * @returns {Promise<CatalogPlatformModel.GetProductBundleListingResponseSchema>}
4648
- * - Success response
4649
- *
4650
- * @name getProductBundle
4651
- * @summary: List product bundles
4652
- * @description: Retrieve a list of product bundles available in the catalog associated to a specific company. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/catalog/getProductBundle/).
4653
- */
4654
- async getProductBundle(
4655
- { q, slug, pageNo, pageSize, requestHeaders } = { requestHeaders: {} },
4656
- { responseHeaders } = { responseHeaders: false }
4657
- ) {
4658
- const { error } = CatalogPlatformValidator.getProductBundle().validate(
4659
- {
4660
- q,
4661
- slug,
4662
- pageNo,
4663
- pageSize,
4664
- },
4665
- { abortEarly: false, allowUnknown: true }
4666
- );
4667
- if (error) {
4668
- return Promise.reject(new FDKClientValidationError(error));
4669
- }
4670
-
4671
- // Showing warrnings if extra unknown parameters are found
4672
- const {
4673
- error: warrning,
4674
- } = CatalogPlatformValidator.getProductBundle().validate(
4675
- {
4676
- q,
4677
- slug,
4678
- pageNo,
4679
- pageSize,
4680
- },
4681
- { abortEarly: false, allowUnknown: false }
4682
- );
4683
- if (warrning) {
4684
- Logger({
4685
- level: "WARN",
4686
- message: `Parameter Validation warrnings for platform > Catalog > getProductBundle \n ${warrning}`,
4687
- });
4688
- }
4689
-
4690
- const query_params = {};
4691
- query_params["q"] = q;
4692
- query_params["slug"] = slug;
4693
- query_params["page_no"] = pageNo;
4694
- query_params["page_size"] = pageSize;
4695
-
4696
- const xHeaders = {};
4697
-
4698
- const response = await PlatformAPIClient.execute(
4699
- this.config,
4700
- "get",
4701
- `/service/platform/catalog/v1.0/company/${this.config.companyId}/product-bundle/`,
4702
- query_params,
4703
- undefined,
4704
- { ...xHeaders, ...requestHeaders },
4705
- { responseHeaders }
4706
- );
4707
-
4708
- let responseData = response;
4709
- if (responseHeaders) {
4710
- responseData = response[0];
4711
- }
4712
-
4713
- const {
4714
- error: res_error,
4715
- } = CatalogPlatformModel.GetProductBundleListingResponseSchema().validate(
4716
- responseData,
4717
- { abortEarly: false, allowUnknown: true }
4718
- );
4719
-
4720
- if (res_error) {
4721
- if (this.config.options.strictResponseCheck === true) {
4722
- return Promise.reject(new FDKResponseValidationError(res_error));
4723
- } else {
4724
- Logger({
4725
- level: "WARN",
4726
- message: `Response Validation Warnings for platform > Catalog > getProductBundle \n ${res_error}`,
4727
- });
4728
- }
4729
- }
4730
-
4731
- return response;
4732
- }
4733
-
4734
- /**
4735
- * @param {CatalogPlatformValidator.GetProductBundleDetailParam} arg - Arg object
4736
- * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
4737
- * @param {import("../PlatformAPIClient").Options} - Options
4738
- * @returns {Promise<CatalogPlatformModel.GetProductBundleResponseSchema>}
4739
- * - Success response
4740
- *
4741
- * @name getProductBundleDetail
4742
- * @summary: Get product bundle
4743
- * @description: Retrieve detailed information about a specific product bundle associated to a specific company. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/catalog/getProductBundleDetail/).
4744
- */
4745
- async getProductBundleDetail(
4746
- { id, requestHeaders } = { requestHeaders: {} },
4747
- { responseHeaders } = { responseHeaders: false }
4748
- ) {
4749
- const {
4750
- error,
4751
- } = CatalogPlatformValidator.getProductBundleDetail().validate(
4752
- {
4753
- id,
4754
- },
4755
- { abortEarly: false, allowUnknown: true }
4756
- );
4757
- if (error) {
4758
- return Promise.reject(new FDKClientValidationError(error));
4759
- }
4760
-
4761
- // Showing warrnings if extra unknown parameters are found
4762
- const {
4763
- error: warrning,
4764
- } = CatalogPlatformValidator.getProductBundleDetail().validate(
4765
- {
4766
- id,
4767
- },
4768
- { abortEarly: false, allowUnknown: false }
4769
- );
4770
- if (warrning) {
4771
- Logger({
4772
- level: "WARN",
4773
- message: `Parameter Validation warrnings for platform > Catalog > getProductBundleDetail \n ${warrning}`,
4774
- });
4775
- }
4776
-
4777
- const query_params = {};
4778
-
4779
- const xHeaders = {};
4780
-
4781
- const response = await PlatformAPIClient.execute(
4782
- this.config,
4783
- "get",
4784
- `/service/platform/catalog/v1.0/company/${this.config.companyId}/product-bundle/${id}/`,
4785
- query_params,
4786
- undefined,
4787
- { ...xHeaders, ...requestHeaders },
4788
- { responseHeaders }
4789
- );
4790
-
4791
- let responseData = response;
4792
- if (responseHeaders) {
4793
- responseData = response[0];
4794
- }
4795
-
4796
- const {
4797
- error: res_error,
4798
- } = CatalogPlatformModel.GetProductBundleResponseSchema().validate(
4799
- responseData,
4800
- { abortEarly: false, allowUnknown: true }
4801
- );
4802
-
4803
- if (res_error) {
4804
- if (this.config.options.strictResponseCheck === true) {
4805
- return Promise.reject(new FDKResponseValidationError(res_error));
4806
- } else {
4807
- Logger({
4808
- level: "WARN",
4809
- message: `Response Validation Warnings for platform > Catalog > getProductBundleDetail \n ${res_error}`,
4810
- });
4811
- }
4812
- }
4813
-
4814
- return response;
4815
- }
4816
-
4817
4562
  /**
4818
4563
  * @param {CatalogPlatformValidator.GetProductExportJobsParam} arg - Arg object
4819
4564
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
@@ -6911,6 +6656,91 @@ class Catalog {
6911
6656
  return response;
6912
6657
  }
6913
6658
 
6659
+ /**
6660
+ * @param {CatalogPlatformValidator.PartialUpdateProductParam} arg - Arg object
6661
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
6662
+ * @param {import("../PlatformAPIClient").Options} - Options
6663
+ * @returns {Promise<CatalogPlatformModel.SuccessResponseSchema>} - Success response
6664
+ * @name partialUpdateProduct
6665
+ * @summary: Patch a product
6666
+ * @description: Partially update an existing product in the catalog using PATCH method. This operation allows you to modify specific fields of a product without affecting other attributes. Only the fields provided in the request body will be updated, while all other existing product data remains unchanged.
6667
+ * For objects (e.g. attributes), merge keys shallowly: any key in the patch overrides the existing value.
6668
+ * For arrays of primitives (e.g. tags): replaced wholesale when present.
6669
+ * For arrays of objects (e.g. sizes): match on a unique identifier (seller_identifier) and apply the merge-patch per element; unmentioned elements remain unchanged.
6670
+ * - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/catalog/partialUpdateProduct/).
6671
+ */
6672
+ async partialUpdateProduct(
6673
+ { itemId, body, requestHeaders } = { requestHeaders: {} },
6674
+ { responseHeaders } = { responseHeaders: false }
6675
+ ) {
6676
+ const { error } = CatalogPlatformValidator.partialUpdateProduct().validate(
6677
+ {
6678
+ itemId,
6679
+ body,
6680
+ },
6681
+ { abortEarly: false, allowUnknown: true }
6682
+ );
6683
+ if (error) {
6684
+ return Promise.reject(new FDKClientValidationError(error));
6685
+ }
6686
+
6687
+ // Showing warrnings if extra unknown parameters are found
6688
+ const {
6689
+ error: warrning,
6690
+ } = CatalogPlatformValidator.partialUpdateProduct().validate(
6691
+ {
6692
+ itemId,
6693
+ body,
6694
+ },
6695
+ { abortEarly: false, allowUnknown: false }
6696
+ );
6697
+ if (warrning) {
6698
+ Logger({
6699
+ level: "WARN",
6700
+ message: `Parameter Validation warrnings for platform > Catalog > partialUpdateProduct \n ${warrning}`,
6701
+ });
6702
+ }
6703
+
6704
+ const query_params = {};
6705
+
6706
+ const xHeaders = {};
6707
+
6708
+ const response = await PlatformAPIClient.execute(
6709
+ this.config,
6710
+ "patch",
6711
+ `/service/platform/catalog/v3.0/company/${this.config.companyId}/products/${itemId}/`,
6712
+ query_params,
6713
+ body,
6714
+ { ...xHeaders, ...requestHeaders },
6715
+ { responseHeaders }
6716
+ );
6717
+
6718
+ let responseData = response;
6719
+ if (responseHeaders) {
6720
+ responseData = response[0];
6721
+ }
6722
+
6723
+ const {
6724
+ error: res_error,
6725
+ } = CatalogPlatformModel.SuccessResponseSchema().validate(responseData, {
6726
+ abortEarly: false,
6727
+ allowUnknown: true,
6728
+ });
6729
+
6730
+ if (res_error) {
6731
+ if (this.config.options.strictResponseCheck === true) {
6732
+ return Promise.reject(new FDKResponseValidationError(res_error));
6733
+ } else {
6734
+ Logger({
6735
+ level: "WARN",
6736
+ message: `Response Validation Warnings for platform > Catalog > partialUpdateProduct \n ${res_error}`,
6737
+ });
6738
+ }
6739
+ }
6740
+
6741
+ return response;
6742
+ }
6743
+
6914
6744
  /**
6915
6745
  * @param {CatalogPlatformValidator.UpdateHsnCodeParam} arg - Arg object
6916
6746
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
@@ -7333,89 +7163,6 @@ class Catalog {
7333
7163
  return response;
7334
7164
  }
7335
7165
 
7336
- /**
7337
- * @param {CatalogPlatformValidator.UpdateProductBundleParam} arg - Arg object
7338
- * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
7339
- * @param {import("../PlatformAPIClient").Options} - Options
7340
- * @returns {Promise<CatalogPlatformModel.GetProductBundleCreateResponseSchema>}
7341
- * - Success response
7342
- *
7343
- * @name updateProductBundle
7344
- * @summary: Update product bundle
7345
- * @description: Modify the details of an existing product bundle in the catalog associated to a specific company. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/catalog/updateProductBundle/).
7346
- */
7347
- async updateProductBundle(
7348
- { id, body, requestHeaders } = { requestHeaders: {} },
7349
- { responseHeaders } = { responseHeaders: false }
7350
- ) {
7351
- const { error } = CatalogPlatformValidator.updateProductBundle().validate(
7352
- {
7353
- id,
7354
- body,
7355
- },
7356
- { abortEarly: false, allowUnknown: true }
7357
- );
7358
- if (error) {
7359
- return Promise.reject(new FDKClientValidationError(error));
7360
- }
7361
-
7362
- // Showing warrnings if extra unknown parameters are found
7363
- const {
7364
- error: warrning,
7365
- } = CatalogPlatformValidator.updateProductBundle().validate(
7366
- {
7367
- id,
7368
- body,
7369
- },
7370
- { abortEarly: false, allowUnknown: false }
7371
- );
7372
- if (warrning) {
7373
- Logger({
7374
- level: "WARN",
7375
- message: `Parameter Validation warrnings for platform > Catalog > updateProductBundle \n ${warrning}`,
7376
- });
7377
- }
7378
-
7379
- const query_params = {};
7380
-
7381
- const xHeaders = {};
7382
-
7383
- const response = await PlatformAPIClient.execute(
7384
- this.config,
7385
- "put",
7386
- `/service/platform/catalog/v1.0/company/${this.config.companyId}/product-bundle/${id}/`,
7387
- query_params,
7388
- body,
7389
- { ...xHeaders, ...requestHeaders },
7390
- { responseHeaders }
7391
- );
7392
-
7393
- let responseData = response;
7394
- if (responseHeaders) {
7395
- responseData = response[0];
7396
- }
7397
-
7398
- const {
7399
- error: res_error,
7400
- } = CatalogPlatformModel.GetProductBundleCreateResponseSchema().validate(
7401
- responseData,
7402
- { abortEarly: false, allowUnknown: true }
7403
- );
7404
-
7405
- if (res_error) {
7406
- if (this.config.options.strictResponseCheck === true) {
7407
- return Promise.reject(new FDKResponseValidationError(res_error));
7408
- } else {
7409
- Logger({
7410
- level: "WARN",
7411
- message: `Response Validation Warnings for platform > Catalog > updateProductBundle \n ${res_error}`,
7412
- });
7413
- }
7414
- }
7415
-
7416
- return response;
7417
- }
7418
-
7419
7166
  /**
7420
7167
  * @param {CatalogPlatformValidator.UpdateRealtimeInventoryParam} arg - Arg object
7421
7168
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`