@gofynd/fdk-client-javascript 1.4.11 → 1.4.12

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 (30) hide show
  1. package/README.md +1 -1
  2. package/package.json +1 -1
  3. package/sdk/application/Cart/CartApplicationClient.d.ts +8 -19
  4. package/sdk/application/Cart/CartApplicationClient.js +8 -89
  5. package/sdk/application/Cart/CartApplicationModel.d.ts +1 -178
  6. package/sdk/application/Cart/CartApplicationModel.js +0 -92
  7. package/sdk/application/Cart/CartApplicationValidator.d.ts +1 -20
  8. package/sdk/application/Cart/CartApplicationValidator.js +0 -16
  9. package/sdk/application/Logistic/LogisticApplicationModel.js +3 -3
  10. package/sdk/application/Order/OrderApplicationModel.js +1 -1
  11. package/sdk/application/Payment/PaymentApplicationModel.js +2 -2
  12. package/sdk/common/Clickstream.js +34 -15
  13. package/sdk/partner/Webhook/WebhookPartnerModel.js +1 -1
  14. package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +8 -20
  15. package/sdk/platform/Cart/CartPlatformApplicationClient.js +8 -92
  16. package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +1 -15
  17. package/sdk/platform/Cart/CartPlatformApplicationValidator.js +0 -14
  18. package/sdk/platform/Cart/CartPlatformModel.d.ts +1 -87
  19. package/sdk/platform/Cart/CartPlatformModel.js +0 -88
  20. package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +10 -51
  21. package/sdk/platform/Catalog/CatalogPlatformClient.js +79 -400
  22. package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +5 -240
  23. package/sdk/platform/Catalog/CatalogPlatformModel.js +3 -169
  24. package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +15 -61
  25. package/sdk/platform/Catalog/CatalogPlatformValidator.js +13 -65
  26. package/sdk/platform/Finance/FinancePlatformModel.js +1 -1
  27. package/sdk/platform/Order/OrderPlatformModel.js +9 -9
  28. package/sdk/platform/Payment/PaymentPlatformModel.d.ts +38 -4
  29. package/sdk/platform/Payment/PaymentPlatformModel.js +17 -7
  30. package/sdk/platform/Webhook/WebhookPlatformModel.js +1 -1
@@ -1706,47 +1706,6 @@ const Joi = require("joi");
1706
1706
  * @property {string[]} values
1707
1707
  */
1708
1708
 
1709
- /**
1710
- * @typedef CartCheckoutCustomMeta
1711
- * @property {string} key
1712
- * @property {string} value
1713
- */
1714
-
1715
- /**
1716
- * @typedef PlatformCartCheckoutDetailRequest
1717
- * @property {CartCheckoutCustomMeta[]} [custom_meta]
1718
- * @property {string} [address_id]
1719
- * @property {string} [payment_identifier]
1720
- * @property {Object} [payment_params]
1721
- * @property {boolean} [payment_auto_confirm]
1722
- * @property {string} id
1723
- * @property {boolean} [pos]
1724
- * @property {string} [billing_address_id]
1725
- * @property {string} [merchant_code]
1726
- * @property {string} [aggregator]
1727
- * @property {number} [pick_at_store_uid]
1728
- * @property {string} [device_id]
1729
- * @property {Object} [delivery_address]
1730
- * @property {string} payment_mode
1731
- * @property {string} [checkout_mode]
1732
- * @property {Object} [customer_details] - Customer details
1733
- * @property {Object} [meta]
1734
- * @property {StaffCheckout} [staff]
1735
- * @property {string} [employee_code]
1736
- * @property {Object} [billing_address]
1737
- * @property {string} [callback_url]
1738
- * @property {string} user_id
1739
- * @property {Object} [extra_meta]
1740
- * @property {string} order_type
1741
- * @property {Files[]} [files] - List of file url
1742
- * @property {number} [ordering_store]
1743
- * @property {Object} [payment_extra_identifiers]
1744
- * @property {string} [iin]
1745
- * @property {string} [network]
1746
- * @property {string} [type]
1747
- * @property {string} [card_id]
1748
- */
1749
-
1750
1709
  /**
1751
1710
  * @typedef CheckCart
1752
1711
  * @property {string} [coupon_text]
@@ -4021,53 +3980,6 @@ class CartPlatformModel {
4021
3980
  });
4022
3981
  }
4023
3982
 
4024
- /** @returns {CartCheckoutCustomMeta} */
4025
- static CartCheckoutCustomMeta() {
4026
- return Joi.object({
4027
- key: Joi.string().allow("").required(),
4028
- value: Joi.string().allow("").required(),
4029
- });
4030
- }
4031
-
4032
- /** @returns {PlatformCartCheckoutDetailRequest} */
4033
- static PlatformCartCheckoutDetailRequest() {
4034
- return Joi.object({
4035
- custom_meta: Joi.array().items(
4036
- CartPlatformModel.CartCheckoutCustomMeta()
4037
- ),
4038
- address_id: Joi.string().allow(""),
4039
- payment_identifier: Joi.string().allow("").allow(null),
4040
- payment_params: Joi.any().allow(null),
4041
- payment_auto_confirm: Joi.boolean(),
4042
- id: Joi.string().allow("").required(),
4043
- pos: Joi.boolean(),
4044
- billing_address_id: Joi.string().allow(""),
4045
- merchant_code: Joi.string().allow(""),
4046
- aggregator: Joi.string().allow(""),
4047
- pick_at_store_uid: Joi.number().allow(null),
4048
- device_id: Joi.string().allow("").allow(null),
4049
- delivery_address: Joi.any(),
4050
- payment_mode: Joi.string().allow("").required(),
4051
- checkout_mode: Joi.string().allow(""),
4052
- customer_details: Joi.any().allow(null),
4053
- meta: Joi.any(),
4054
- staff: CartPlatformModel.StaffCheckout(),
4055
- employee_code: Joi.string().allow("").allow(null),
4056
- billing_address: Joi.any(),
4057
- callback_url: Joi.string().allow("").allow(null),
4058
- user_id: Joi.string().allow("").allow(null).required(),
4059
- extra_meta: Joi.any(),
4060
- order_type: Joi.string().allow("").required(),
4061
- files: Joi.array().items(CartPlatformModel.Files()),
4062
- ordering_store: Joi.number().allow(null),
4063
- payment_extra_identifiers: Joi.any(),
4064
- iin: Joi.string().allow(""),
4065
- network: Joi.string().allow(""),
4066
- type: Joi.string().allow(""),
4067
- card_id: Joi.string().allow(""),
4068
- });
4069
- }
4070
-
4071
3983
  /** @returns {CheckCart} */
4072
3984
  static CheckCart() {
4073
3985
  return Joi.object({
@@ -62,27 +62,6 @@ declare class Catalog {
62
62
  * @description: This API helps to create a bulk products upload job. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/catalog/createBulkProductUploadJob/).
63
63
  */
64
64
  createBulkProductUploadJob({ body, requestHeaders }?: CatalogPlatformValidator.CreateBulkProductUploadJobParam, { responseHeaders }?: object): Promise<CatalogPlatformModel.BulkResponse>;
65
- /**
66
- * @param {CatalogPlatformValidator.CreateCategoriesParam} arg - Arg object
67
- * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
68
- * @param {import("../PlatformAPIClient").Options} - Options
69
- * @returns {Promise<CatalogPlatformModel.CategoryCreateResponse>} - Success response
70
- * @name createCategories
71
- * @summary: Create categories
72
- * @description: Allows to create product categories for specific company. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/catalog/createCategories/).
73
- */
74
- createCategories({ body, requestHeaders }?: CatalogPlatformValidator.CreateCategoriesParam, { responseHeaders }?: object): Promise<CatalogPlatformModel.CategoryCreateResponse>;
75
- /**
76
- * @param {CatalogPlatformValidator.CreateDepartmentsParam} arg - Arg object
77
- * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
78
- * @param {import("../PlatformAPIClient").Options} - Options
79
- * @returns {Promise<CatalogPlatformModel.DepartmentCreateResponse>} -
80
- * Success response
81
- * @name createDepartments
82
- * @summary: Create departments
83
- * @description: Create departments for a specific company. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/catalog/createDepartments/).
84
- */
85
- createDepartments({ body, requestHeaders }?: CatalogPlatformValidator.CreateDepartmentsParam, { responseHeaders }?: object): Promise<CatalogPlatformModel.DepartmentCreateResponse>;
86
65
  /**
87
66
  * @param {CatalogPlatformValidator.CreateInventoryExportParam} arg - Arg object
88
67
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
@@ -285,6 +264,16 @@ declare class Catalog {
285
264
  * @description: Retrieve all HSN codes associated with company products and provide search capabilities based on HSN code, reporting HSN, etc - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/catalog/getAllProductHsnCodes/).
286
265
  */
287
266
  getAllProductHsnCodes({ pageNo, pageSize, q, type, requestHeaders }?: CatalogPlatformValidator.GetAllProductHsnCodesParam, { responseHeaders }?: object): Promise<CatalogPlatformModel.HsnCodesListingResponseSchemaV2>;
267
+ /**
268
+ * @param {CatalogPlatformValidator.GetAttributeParam} arg - Arg object
269
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
270
+ * @param {import("../PlatformAPIClient").Options} - Options
271
+ * @returns {Promise<CatalogPlatformModel.AttributeDetail>} - Success response
272
+ * @name getAttribute
273
+ * @summary: Get attribute detail by slug
274
+ * @description: Retrieve the attribute detail for catalog listings by attribute slug passed for a specific company. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/catalog/getAttribute/).
275
+ */
276
+ getAttribute({ attributeSlug, requestHeaders }?: CatalogPlatformValidator.GetAttributeParam, { responseHeaders }?: object): Promise<CatalogPlatformModel.AttributeDetail>;
288
277
  /**
289
278
  * @param {CatalogPlatformValidator.GetCategoryDataParam} arg - Arg object
290
279
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
@@ -336,16 +325,6 @@ declare class Catalog {
336
325
  * @description: Retrieve detailed information about a specific department for a specific company by uid. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/catalog/getDepartmentData/).
337
326
  */
338
327
  getDepartmentData({ uid, requestHeaders }?: CatalogPlatformValidator.GetDepartmentDataParam, { responseHeaders }?: object): Promise<CatalogPlatformModel.DepartmentsResponse>;
339
- /**
340
- * @param {CatalogPlatformValidator.GetGenderAttributeParam} arg - Arg object
341
- * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
342
- * @param {import("../PlatformAPIClient").Options} - Options
343
- * @returns {Promise<CatalogPlatformModel.GenderDetail>} - Success response
344
- * @name getGenderAttribute
345
- * @summary: Get gender attribute by slug
346
- * @description: Retrieve the gender attribute for catalog listings by attribute slug passed for a specific company. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/catalog/getGenderAttribute/).
347
- */
348
- getGenderAttribute({ attributeSlug, requestHeaders }?: CatalogPlatformValidator.GetGenderAttributeParam, { responseHeaders }?: object): Promise<CatalogPlatformModel.GenderDetail>;
349
328
  /**
350
329
  * @param {CatalogPlatformValidator.GetHsnCodeParam} arg - Arg object
351
330
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
@@ -942,26 +921,6 @@ declare class Catalog {
942
921
  * @description: Retrieve values related to template brand types for a specific company. The filter type query parameter defines what type of data to return. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/catalog/listTemplateBrandTypeValues/).
943
922
  */
944
923
  listTemplateBrandTypeValues({ filter, templateTag, itemType, requestHeaders }?: CatalogPlatformValidator.ListTemplateBrandTypeValuesParam, { responseHeaders }?: object): Promise<CatalogPlatformModel.ProductConfigurationDownloads>;
945
- /**
946
- * @param {CatalogPlatformValidator.UpdateCategoryParam} arg - Arg object
947
- * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
948
- * @param {import("../PlatformAPIClient").Options} - Options
949
- * @returns {Promise<CatalogPlatformModel.CategoryUpdateResponse>} - Success response
950
- * @name updateCategory
951
- * @summary: Update category
952
- * @description: Modify data for an existing category by its uid for a specific company. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/catalog/updateCategory/).
953
- */
954
- updateCategory({ uid, body, requestHeaders }?: CatalogPlatformValidator.UpdateCategoryParam, { responseHeaders }?: object): Promise<CatalogPlatformModel.CategoryUpdateResponse>;
955
- /**
956
- * @param {CatalogPlatformValidator.UpdateDepartmentParam} arg - Arg object
957
- * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
958
- * @param {import("../PlatformAPIClient").Options} - Options
959
- * @returns {Promise<CatalogPlatformModel.DepartmentModel>} - Success response
960
- * @name updateDepartment
961
- * @summary: Update department
962
- * @description: Modify the department data by their uid for a specifc company. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/catalog/updateDepartment/).
963
- */
964
- updateDepartment({ uid, body, requestHeaders }?: CatalogPlatformValidator.UpdateDepartmentParam, { responseHeaders }?: object): Promise<CatalogPlatformModel.DepartmentModel>;
965
924
  /**
966
925
  * @param {CatalogPlatformValidator.UpdateHsnCodeParam} arg - Arg object
967
926
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
@@ -494,165 +494,6 @@ class Catalog {
494
494
  return response;
495
495
  }
496
496
 
497
- /**
498
- * @param {CatalogPlatformValidator.CreateCategoriesParam} arg - Arg object
499
- * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
500
- * @param {import("../PlatformAPIClient").Options} - Options
501
- * @returns {Promise<CatalogPlatformModel.CategoryCreateResponse>} - Success response
502
- * @name createCategories
503
- * @summary: Create categories
504
- * @description: Allows to create product categories for specific company. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/catalog/createCategories/).
505
- */
506
- async createCategories(
507
- { body, requestHeaders } = { requestHeaders: {} },
508
- { responseHeaders } = { responseHeaders: false }
509
- ) {
510
- const { error } = CatalogPlatformValidator.createCategories().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.createCategories().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 > createCategories \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}/category/`,
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.CategoryCreateResponse().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 > createCategories \n ${res_error}`,
569
- });
570
- }
571
- }
572
-
573
- return response;
574
- }
575
-
576
- /**
577
- * @param {CatalogPlatformValidator.CreateDepartmentsParam} arg - Arg object
578
- * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
579
- * @param {import("../PlatformAPIClient").Options} - Options
580
- * @returns {Promise<CatalogPlatformModel.DepartmentCreateResponse>} -
581
- * Success response
582
- * @name createDepartments
583
- * @summary: Create departments
584
- * @description: Create departments for a specific company. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/catalog/createDepartments/).
585
- */
586
- async createDepartments(
587
- { body, requestHeaders } = { requestHeaders: {} },
588
- { responseHeaders } = { responseHeaders: false }
589
- ) {
590
- const { error } = CatalogPlatformValidator.createDepartments().validate(
591
- {
592
- body,
593
- },
594
- { abortEarly: false, allowUnknown: true }
595
- );
596
- if (error) {
597
- return Promise.reject(new FDKClientValidationError(error));
598
- }
599
-
600
- // Showing warrnings if extra unknown parameters are found
601
- const {
602
- error: warrning,
603
- } = CatalogPlatformValidator.createDepartments().validate(
604
- {
605
- body,
606
- },
607
- { abortEarly: false, allowUnknown: false }
608
- );
609
- if (warrning) {
610
- Logger({
611
- level: "WARN",
612
- message: `Parameter Validation warrnings for platform > Catalog > createDepartments \n ${warrning}`,
613
- });
614
- }
615
-
616
- const query_params = {};
617
-
618
- const xHeaders = {};
619
-
620
- const response = await PlatformAPIClient.execute(
621
- this.config,
622
- "post",
623
- `/service/platform/catalog/v1.0/company/${this.config.companyId}/departments/`,
624
- query_params,
625
- body,
626
- { ...xHeaders, ...requestHeaders },
627
- { responseHeaders }
628
- );
629
-
630
- let responseData = response;
631
- if (responseHeaders) {
632
- responseData = response[0];
633
- }
634
-
635
- const {
636
- error: res_error,
637
- } = CatalogPlatformModel.DepartmentCreateResponse().validate(responseData, {
638
- abortEarly: false,
639
- allowUnknown: true,
640
- });
641
-
642
- if (res_error) {
643
- if (this.config.options.strictResponseCheck === true) {
644
- return Promise.reject(new FDKResponseValidationError(res_error));
645
- } else {
646
- Logger({
647
- level: "WARN",
648
- message: `Response Validation Warnings for platform > Catalog > createDepartments \n ${res_error}`,
649
- });
650
- }
651
- }
652
-
653
- return response;
654
- }
655
-
656
497
  /**
657
498
  * @param {CatalogPlatformValidator.CreateInventoryExportParam} arg - Arg object
658
499
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
@@ -2202,6 +2043,85 @@ class Catalog {
2202
2043
  return response;
2203
2044
  }
2204
2045
 
2046
+ /**
2047
+ * @param {CatalogPlatformValidator.GetAttributeParam} arg - Arg object
2048
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
2049
+ * @param {import("../PlatformAPIClient").Options} - Options
2050
+ * @returns {Promise<CatalogPlatformModel.AttributeDetail>} - Success response
2051
+ * @name getAttribute
2052
+ * @summary: Get attribute detail by slug
2053
+ * @description: Retrieve the attribute detail for catalog listings by attribute slug passed for a specific company. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/catalog/getAttribute/).
2054
+ */
2055
+ async getAttribute(
2056
+ { attributeSlug, requestHeaders } = { requestHeaders: {} },
2057
+ { responseHeaders } = { responseHeaders: false }
2058
+ ) {
2059
+ const { error } = CatalogPlatformValidator.getAttribute().validate(
2060
+ {
2061
+ attributeSlug,
2062
+ },
2063
+ { abortEarly: false, allowUnknown: true }
2064
+ );
2065
+ if (error) {
2066
+ return Promise.reject(new FDKClientValidationError(error));
2067
+ }
2068
+
2069
+ // Showing warrnings if extra unknown parameters are found
2070
+ const {
2071
+ error: warrning,
2072
+ } = CatalogPlatformValidator.getAttribute().validate(
2073
+ {
2074
+ attributeSlug,
2075
+ },
2076
+ { abortEarly: false, allowUnknown: false }
2077
+ );
2078
+ if (warrning) {
2079
+ Logger({
2080
+ level: "WARN",
2081
+ message: `Parameter Validation warrnings for platform > Catalog > getAttribute \n ${warrning}`,
2082
+ });
2083
+ }
2084
+
2085
+ const query_params = {};
2086
+
2087
+ const xHeaders = {};
2088
+
2089
+ const response = await PlatformAPIClient.execute(
2090
+ this.config,
2091
+ "get",
2092
+ `/service/platform/catalog/v1.0/company/${this.config.companyId}/product-attributes/${attributeSlug}`,
2093
+ query_params,
2094
+ undefined,
2095
+ { ...xHeaders, ...requestHeaders },
2096
+ { responseHeaders }
2097
+ );
2098
+
2099
+ let responseData = response;
2100
+ if (responseHeaders) {
2101
+ responseData = response[0];
2102
+ }
2103
+
2104
+ const {
2105
+ error: res_error,
2106
+ } = CatalogPlatformModel.AttributeDetail().validate(responseData, {
2107
+ abortEarly: false,
2108
+ allowUnknown: true,
2109
+ });
2110
+
2111
+ if (res_error) {
2112
+ if (this.config.options.strictResponseCheck === true) {
2113
+ return Promise.reject(new FDKResponseValidationError(res_error));
2114
+ } else {
2115
+ Logger({
2116
+ level: "WARN",
2117
+ message: `Response Validation Warnings for platform > Catalog > getAttribute \n ${res_error}`,
2118
+ });
2119
+ }
2120
+ }
2121
+
2122
+ return response;
2123
+ }
2124
+
2205
2125
  /**
2206
2126
  * @param {CatalogPlatformValidator.GetCategoryDataParam} arg - Arg object
2207
2127
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
@@ -2605,85 +2525,6 @@ class Catalog {
2605
2525
  return response;
2606
2526
  }
2607
2527
 
2608
- /**
2609
- * @param {CatalogPlatformValidator.GetGenderAttributeParam} arg - Arg object
2610
- * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
2611
- * @param {import("../PlatformAPIClient").Options} - Options
2612
- * @returns {Promise<CatalogPlatformModel.GenderDetail>} - Success response
2613
- * @name getGenderAttribute
2614
- * @summary: Get gender attribute by slug
2615
- * @description: Retrieve the gender attribute for catalog listings by attribute slug passed for a specific company. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/catalog/getGenderAttribute/).
2616
- */
2617
- async getGenderAttribute(
2618
- { attributeSlug, requestHeaders } = { requestHeaders: {} },
2619
- { responseHeaders } = { responseHeaders: false }
2620
- ) {
2621
- const { error } = CatalogPlatformValidator.getGenderAttribute().validate(
2622
- {
2623
- attributeSlug,
2624
- },
2625
- { abortEarly: false, allowUnknown: true }
2626
- );
2627
- if (error) {
2628
- return Promise.reject(new FDKClientValidationError(error));
2629
- }
2630
-
2631
- // Showing warrnings if extra unknown parameters are found
2632
- const {
2633
- error: warrning,
2634
- } = CatalogPlatformValidator.getGenderAttribute().validate(
2635
- {
2636
- attributeSlug,
2637
- },
2638
- { abortEarly: false, allowUnknown: false }
2639
- );
2640
- if (warrning) {
2641
- Logger({
2642
- level: "WARN",
2643
- message: `Parameter Validation warrnings for platform > Catalog > getGenderAttribute \n ${warrning}`,
2644
- });
2645
- }
2646
-
2647
- const query_params = {};
2648
-
2649
- const xHeaders = {};
2650
-
2651
- const response = await PlatformAPIClient.execute(
2652
- this.config,
2653
- "get",
2654
- `/service/platform/catalog/v1.0/company/${this.config.companyId}/product-attributes/${attributeSlug}`,
2655
- query_params,
2656
- undefined,
2657
- { ...xHeaders, ...requestHeaders },
2658
- { responseHeaders }
2659
- );
2660
-
2661
- let responseData = response;
2662
- if (responseHeaders) {
2663
- responseData = response[0];
2664
- }
2665
-
2666
- const {
2667
- error: res_error,
2668
- } = CatalogPlatformModel.GenderDetail().validate(responseData, {
2669
- abortEarly: false,
2670
- allowUnknown: true,
2671
- });
2672
-
2673
- if (res_error) {
2674
- if (this.config.options.strictResponseCheck === true) {
2675
- return Promise.reject(new FDKResponseValidationError(res_error));
2676
- } else {
2677
- Logger({
2678
- level: "WARN",
2679
- message: `Response Validation Warnings for platform > Catalog > getGenderAttribute \n ${res_error}`,
2680
- });
2681
- }
2682
- }
2683
-
2684
- return response;
2685
- }
2686
-
2687
2528
  /**
2688
2529
  * @param {CatalogPlatformValidator.GetHsnCodeParam} arg - Arg object
2689
2530
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
@@ -6181,168 +6022,6 @@ class Catalog {
6181
6022
  return response;
6182
6023
  }
6183
6024
 
6184
- /**
6185
- * @param {CatalogPlatformValidator.UpdateCategoryParam} arg - Arg object
6186
- * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
6187
- * @param {import("../PlatformAPIClient").Options} - Options
6188
- * @returns {Promise<CatalogPlatformModel.CategoryUpdateResponse>} - Success response
6189
- * @name updateCategory
6190
- * @summary: Update category
6191
- * @description: Modify data for an existing category by its uid for a specific company. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/catalog/updateCategory/).
6192
- */
6193
- async updateCategory(
6194
- { uid, body, requestHeaders } = { requestHeaders: {} },
6195
- { responseHeaders } = { responseHeaders: false }
6196
- ) {
6197
- const { error } = CatalogPlatformValidator.updateCategory().validate(
6198
- {
6199
- uid,
6200
- body,
6201
- },
6202
- { abortEarly: false, allowUnknown: true }
6203
- );
6204
- if (error) {
6205
- return Promise.reject(new FDKClientValidationError(error));
6206
- }
6207
-
6208
- // Showing warrnings if extra unknown parameters are found
6209
- const {
6210
- error: warrning,
6211
- } = CatalogPlatformValidator.updateCategory().validate(
6212
- {
6213
- uid,
6214
- body,
6215
- },
6216
- { abortEarly: false, allowUnknown: false }
6217
- );
6218
- if (warrning) {
6219
- Logger({
6220
- level: "WARN",
6221
- message: `Parameter Validation warrnings for platform > Catalog > updateCategory \n ${warrning}`,
6222
- });
6223
- }
6224
-
6225
- const query_params = {};
6226
-
6227
- const xHeaders = {};
6228
-
6229
- const response = await PlatformAPIClient.execute(
6230
- this.config,
6231
- "put",
6232
- `/service/platform/catalog/v1.0/company/${this.config.companyId}/category/${uid}/`,
6233
- query_params,
6234
- body,
6235
- { ...xHeaders, ...requestHeaders },
6236
- { responseHeaders }
6237
- );
6238
-
6239
- let responseData = response;
6240
- if (responseHeaders) {
6241
- responseData = response[0];
6242
- }
6243
-
6244
- const {
6245
- error: res_error,
6246
- } = CatalogPlatformModel.CategoryUpdateResponse().validate(responseData, {
6247
- abortEarly: false,
6248
- allowUnknown: true,
6249
- });
6250
-
6251
- if (res_error) {
6252
- if (this.config.options.strictResponseCheck === true) {
6253
- return Promise.reject(new FDKResponseValidationError(res_error));
6254
- } else {
6255
- Logger({
6256
- level: "WARN",
6257
- message: `Response Validation Warnings for platform > Catalog > updateCategory \n ${res_error}`,
6258
- });
6259
- }
6260
- }
6261
-
6262
- return response;
6263
- }
6264
-
6265
- /**
6266
- * @param {CatalogPlatformValidator.UpdateDepartmentParam} arg - Arg object
6267
- * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
6268
- * @param {import("../PlatformAPIClient").Options} - Options
6269
- * @returns {Promise<CatalogPlatformModel.DepartmentModel>} - Success response
6270
- * @name updateDepartment
6271
- * @summary: Update department
6272
- * @description: Modify the department data by their uid for a specifc company. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/catalog/updateDepartment/).
6273
- */
6274
- async updateDepartment(
6275
- { uid, body, requestHeaders } = { requestHeaders: {} },
6276
- { responseHeaders } = { responseHeaders: false }
6277
- ) {
6278
- const { error } = CatalogPlatformValidator.updateDepartment().validate(
6279
- {
6280
- uid,
6281
- body,
6282
- },
6283
- { abortEarly: false, allowUnknown: true }
6284
- );
6285
- if (error) {
6286
- return Promise.reject(new FDKClientValidationError(error));
6287
- }
6288
-
6289
- // Showing warrnings if extra unknown parameters are found
6290
- const {
6291
- error: warrning,
6292
- } = CatalogPlatformValidator.updateDepartment().validate(
6293
- {
6294
- uid,
6295
- body,
6296
- },
6297
- { abortEarly: false, allowUnknown: false }
6298
- );
6299
- if (warrning) {
6300
- Logger({
6301
- level: "WARN",
6302
- message: `Parameter Validation warrnings for platform > Catalog > updateDepartment \n ${warrning}`,
6303
- });
6304
- }
6305
-
6306
- const query_params = {};
6307
-
6308
- const xHeaders = {};
6309
-
6310
- const response = await PlatformAPIClient.execute(
6311
- this.config,
6312
- "put",
6313
- `/service/platform/catalog/v1.0/company/${this.config.companyId}/departments/${uid}/`,
6314
- query_params,
6315
- body,
6316
- { ...xHeaders, ...requestHeaders },
6317
- { responseHeaders }
6318
- );
6319
-
6320
- let responseData = response;
6321
- if (responseHeaders) {
6322
- responseData = response[0];
6323
- }
6324
-
6325
- const {
6326
- error: res_error,
6327
- } = CatalogPlatformModel.DepartmentModel().validate(responseData, {
6328
- abortEarly: false,
6329
- allowUnknown: true,
6330
- });
6331
-
6332
- if (res_error) {
6333
- if (this.config.options.strictResponseCheck === true) {
6334
- return Promise.reject(new FDKResponseValidationError(res_error));
6335
- } else {
6336
- Logger({
6337
- level: "WARN",
6338
- message: `Response Validation Warnings for platform > Catalog > updateDepartment \n ${res_error}`,
6339
- });
6340
- }
6341
- }
6342
-
6343
- return response;
6344
- }
6345
-
6346
6025
  /**
6347
6026
  * @param {CatalogPlatformValidator.UpdateHsnCodeParam} arg - Arg object
6348
6027
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`