@gofynd/fdk-client-javascript 1.6.3 → 2.0.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 (146) hide show
  1. package/README.md +1 -1
  2. package/package.json +1 -1
  3. package/sdk/application/Cart/CartApplicationClient.d.ts +5 -5
  4. package/sdk/application/Cart/CartApplicationClient.js +26 -268
  5. package/sdk/application/Catalog/CatalogApplicationClient.d.ts +20 -20
  6. package/sdk/application/Catalog/CatalogApplicationClient.js +98 -347
  7. package/sdk/application/Common/CommonApplicationClient.js +1 -16
  8. package/sdk/application/Communication/CommunicationApplicationClient.js +1 -24
  9. package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +24 -2
  10. package/sdk/application/Configuration/ConfigurationApplicationClient.js +58 -137
  11. package/sdk/application/Content/ContentApplicationClient.d.ts +47 -7
  12. package/sdk/application/Content/ContentApplicationClient.js +222 -191
  13. package/sdk/application/FileStorage/FileStorageApplicationClient.d.ts +2 -2
  14. package/sdk/application/FileStorage/FileStorageApplicationClient.js +11 -30
  15. package/sdk/application/Finance/FinanceApplicationClient.js +1 -16
  16. package/sdk/application/Lead/LeadApplicationClient.d.ts +4 -4
  17. package/sdk/application/Lead/LeadApplicationClient.js +21 -52
  18. package/sdk/application/Logistic/LogisticApplicationClient.d.ts +16 -56
  19. package/sdk/application/Logistic/LogisticApplicationClient.js +57 -332
  20. package/sdk/application/Order/OrderApplicationClient.d.ts +11 -11
  21. package/sdk/application/Order/OrderApplicationClient.js +68 -153
  22. package/sdk/application/Payment/PaymentApplicationClient.d.ts +2 -12
  23. package/sdk/application/Payment/PaymentApplicationClient.js +7 -487
  24. package/sdk/application/Rewards/RewardsApplicationClient.d.ts +1 -1
  25. package/sdk/application/Rewards/RewardsApplicationClient.js +6 -59
  26. package/sdk/application/Share/ShareApplicationClient.d.ts +4 -4
  27. package/sdk/application/Share/ShareApplicationClient.js +21 -75
  28. package/sdk/application/Theme/ThemeApplicationClient.d.ts +3 -3
  29. package/sdk/application/Theme/ThemeApplicationClient.js +19 -47
  30. package/sdk/application/User/UserApplicationClient.js +1 -407
  31. package/sdk/application/Webhook/WebhookApplicationClient.js +1 -8
  32. package/sdk/common/Utility.d.ts +1 -1
  33. package/sdk/common/Utility.js +4 -4
  34. package/sdk/common/Validator.d.ts +1 -0
  35. package/sdk/common/Validator.js +20 -0
  36. package/sdk/partner/FileStorage/FileStoragePartnerClient.d.ts +1 -55
  37. package/sdk/partner/FileStorage/FileStoragePartnerClient.js +1 -408
  38. package/sdk/partner/FileStorage/FileStoragePartnerValidator.d.ts +0 -5
  39. package/sdk/partner/FileStorage/FileStoragePartnerValidator.js +0 -37
  40. package/sdk/partner/Lead/LeadPartnerModel.d.ts +5 -0
  41. package/sdk/partner/Lead/LeadPartnerModel.js +2 -0
  42. package/sdk/partner/Logistics/LogisticsPartnerClient.d.ts +29 -25
  43. package/sdk/partner/Logistics/LogisticsPartnerClient.js +65 -42
  44. package/sdk/partner/Logistics/LogisticsPartnerModel.d.ts +1008 -794
  45. package/sdk/partner/Logistics/LogisticsPartnerModel.js +573 -460
  46. package/sdk/partner/Logistics/LogisticsPartnerValidator.js +10 -5
  47. package/sdk/partner/Webhook/WebhookPartnerModel.d.ts +64 -1
  48. package/sdk/partner/Webhook/WebhookPartnerModel.js +36 -0
  49. package/sdk/platform/Analytics/AnalyticsPlatformModel.d.ts +5 -0
  50. package/sdk/platform/Analytics/AnalyticsPlatformModel.js +2 -0
  51. package/sdk/platform/Cart/CartPlatformModel.d.ts +67 -9
  52. package/sdk/platform/Cart/CartPlatformModel.js +38 -5
  53. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +1 -1
  54. package/sdk/platform/Catalog/CatalogPlatformClient.js +4 -4
  55. package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +47 -13
  56. package/sdk/platform/Catalog/CatalogPlatformModel.js +29 -7
  57. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +2 -2
  58. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +7 -4
  59. package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +71 -7
  60. package/sdk/platform/Communication/CommunicationPlatformModel.js +70 -6
  61. package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +0 -27
  62. package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +8 -60
  63. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +31 -20
  64. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +18 -18
  65. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +1 -1
  66. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +3 -3
  67. package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +13 -0
  68. package/sdk/platform/Configuration/ConfigurationPlatformClient.js +30 -1
  69. package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +68 -11
  70. package/sdk/platform/Configuration/ConfigurationPlatformModel.js +49 -7
  71. package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +169 -0
  72. package/sdk/platform/Content/ContentPlatformApplicationClient.js +1279 -132
  73. package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +156 -1
  74. package/sdk/platform/Content/ContentPlatformApplicationValidator.js +180 -0
  75. package/sdk/platform/Content/ContentPlatformClient.d.ts +162 -0
  76. package/sdk/platform/Content/ContentPlatformClient.js +1697 -497
  77. package/sdk/platform/Content/ContentPlatformModel.d.ts +1053 -35
  78. package/sdk/platform/Content/ContentPlatformModel.js +717 -34
  79. package/sdk/platform/Content/ContentPlatformValidator.d.ts +127 -1
  80. package/sdk/platform/Content/ContentPlatformValidator.js +171 -0
  81. package/sdk/platform/Discount/DiscountPlatformClient.d.ts +34 -0
  82. package/sdk/platform/Discount/DiscountPlatformClient.js +59 -0
  83. package/sdk/platform/Discount/DiscountPlatformModel.d.ts +365 -93
  84. package/sdk/platform/Discount/DiscountPlatformModel.js +98 -93
  85. package/sdk/platform/Discount/DiscountPlatformValidator.d.ts +54 -34
  86. package/sdk/platform/Discount/DiscountPlatformValidator.js +27 -17
  87. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +0 -156
  88. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +0 -1072
  89. package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.d.ts +1 -137
  90. package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.js +0 -173
  91. package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +1 -1105
  92. package/sdk/platform/FileStorage/FileStoragePlatformModel.js +0 -1125
  93. package/sdk/platform/Lead/LeadPlatformModel.d.ts +5 -0
  94. package/sdk/platform/Lead/LeadPlatformModel.js +2 -0
  95. package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +0 -10
  96. package/sdk/platform/Order/OrderPlatformApplicationClient.js +0 -92
  97. package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +1 -28
  98. package/sdk/platform/Order/OrderPlatformApplicationValidator.js +0 -18
  99. package/sdk/platform/Order/OrderPlatformClient.d.ts +212 -0
  100. package/sdk/platform/Order/OrderPlatformClient.js +397 -0
  101. package/sdk/platform/Order/OrderPlatformModel.d.ts +66 -10
  102. package/sdk/platform/Order/OrderPlatformModel.js +39 -7
  103. package/sdk/platform/Order/OrderPlatformValidator.d.ts +33 -1
  104. package/sdk/platform/Order/OrderPlatformValidator.js +20 -0
  105. package/sdk/platform/Partner/PartnerPlatformModel.d.ts +58 -10
  106. package/sdk/platform/Partner/PartnerPlatformModel.js +19 -10
  107. package/sdk/platform/Payment/PaymentPlatformModel.d.ts +12 -2
  108. package/sdk/platform/Payment/PaymentPlatformModel.js +8 -2
  109. package/sdk/platform/Rewards/RewardsPlatformModel.d.ts +5 -0
  110. package/sdk/platform/Rewards/RewardsPlatformModel.js +2 -0
  111. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.d.ts +240 -24
  112. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.js +1753 -277
  113. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.d.ts +320 -22
  114. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.js +269 -19
  115. package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +53 -104
  116. package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +201 -629
  117. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +5720 -2891
  118. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +3414 -2181
  119. package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.d.ts +138 -216
  120. package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.js +81 -148
  121. package/sdk/platform/Share/SharePlatformModel.d.ts +5 -0
  122. package/sdk/platform/Share/SharePlatformModel.js +2 -0
  123. package/sdk/platform/User/UserPlatformApplicationClient.d.ts +73 -0
  124. package/sdk/platform/User/UserPlatformApplicationClient.js +543 -0
  125. package/sdk/platform/User/UserPlatformApplicationValidator.d.ts +129 -1
  126. package/sdk/platform/User/UserPlatformApplicationValidator.js +97 -0
  127. package/sdk/platform/User/UserPlatformModel.d.ts +269 -6
  128. package/sdk/platform/User/UserPlatformModel.js +187 -5
  129. package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +64 -1
  130. package/sdk/platform/Webhook/WebhookPlatformModel.js +36 -0
  131. package/sdk/public/Catalog/CatalogPublicClient.d.ts +1 -1
  132. package/sdk/public/Catalog/CatalogPublicClient.js +6 -11
  133. package/sdk/public/Configuration/ConfigurationPublicClient.js +1 -16
  134. package/sdk/public/Content/ContentPublicClient.d.ts +36 -3
  135. package/sdk/public/Content/ContentPublicClient.js +261 -104
  136. package/sdk/public/Content/ContentPublicModel.d.ts +155 -1
  137. package/sdk/public/Content/ContentPublicModel.js +102 -0
  138. package/sdk/public/Content/ContentPublicValidator.d.ts +18 -1
  139. package/sdk/public/Content/ContentPublicValidator.js +26 -0
  140. package/sdk/public/Partner/PartnerPublicClient.d.ts +1 -1
  141. package/sdk/public/Partner/PartnerPublicClient.js +6 -11
  142. package/sdk/public/Partner/PartnerPublicModel.d.ts +248 -72
  143. package/sdk/public/Partner/PartnerPublicModel.js +81 -71
  144. package/sdk/public/Partner/PartnerPublicValidator.d.ts +2 -2
  145. package/sdk/public/Partner/PartnerPublicValidator.js +1 -1
  146. package/sdk/public/Webhook/WebhookPublicClient.js +1 -40
@@ -314,6 +314,60 @@ const Joi = require("joi");
314
314
  * @property {Object} [meta]
315
315
  */
316
316
 
317
+ /**
318
+ * @typedef Language
319
+ * @property {string} [_id] - Unique identifier for the language entry in the
320
+ * system database.
321
+ * @property {string} locale - Standard language code following ISO 639-1 format
322
+ * for language identification.
323
+ * @property {string} direction - Text direction specification for proper
324
+ * content rendering in the language.
325
+ * @property {string} name - Full name of the language in English for easy
326
+ * reference and display at the merchant panel.
327
+ * @property {string} [display_name] - Translated name of the language in
328
+ * English for easy reference and display at the website.
329
+ */
330
+
331
+ /**
332
+ * @typedef Error
333
+ * @property {string} [error] - Detailed error message explaining the nature of
334
+ * the failure or invalid request.
335
+ */
336
+
337
+ /**
338
+ * @typedef TranslatableResource
339
+ * @property {string} [_id] - Unique identifier for the translatable resource in
340
+ * the system.
341
+ * @property {string} type - Categorization of the resource indicating its
342
+ * context and ownership level
343
+ * @property {string} name - Primary identifier or title of the resource in its
344
+ * default language.
345
+ * @property {string} description - Detailed explanation of the resource's
346
+ * purpose and content scope.
347
+ * @property {Meta} meta
348
+ */
349
+
350
+ /**
351
+ * @typedef Meta
352
+ * @property {string} [created_by] - MongoDB ObjectId of the user who initially
353
+ * created the resource.
354
+ * @property {string} [updated_by] - MongoDB ObjectId of the user who last
355
+ * modified the resource.
356
+ * @property {string} [created_at] - Timestamp indicating when the resource was
357
+ * first created.
358
+ * @property {string} [updated_at] - Timestamp indicating when the resource was
359
+ * last modified.
360
+ */
361
+
362
+ /**
363
+ * @typedef ResourceTranslation
364
+ * @property {string} [_id] - Unique identifier for the translation entry in the system.
365
+ * @property {string} [locale] - Language code indicating the target language of
366
+ * the translation.
367
+ * @property {Object} [value] - Contains the translated content with flexible
368
+ * schema based on resource type.
369
+ */
370
+
317
371
  class ContentPublicModel {
318
372
  /** @returns {BasicDetailsPayloadSchema} */
319
373
  static BasicDetailsPayloadSchema() {
@@ -702,5 +756,53 @@ class ContentPublicModel {
702
756
  meta: Joi.object().pattern(/\S/, Joi.any()),
703
757
  });
704
758
  }
759
+
760
+ /** @returns {Language} */
761
+ static Language() {
762
+ return Joi.object({
763
+ _id: Joi.string().allow(""),
764
+ locale: Joi.string().allow("").required(),
765
+ direction: Joi.string().allow("").required(),
766
+ name: Joi.string().allow("").required(),
767
+ display_name: Joi.string().allow(""),
768
+ });
769
+ }
770
+
771
+ /** @returns {Error} */
772
+ static Error() {
773
+ return Joi.object({
774
+ error: Joi.string().allow(""),
775
+ });
776
+ }
777
+
778
+ /** @returns {TranslatableResource} */
779
+ static TranslatableResource() {
780
+ return Joi.object({
781
+ _id: Joi.string().allow(""),
782
+ type: Joi.string().allow("").required(),
783
+ name: Joi.string().allow("").required(),
784
+ description: Joi.string().allow("").required(),
785
+ meta: ContentPublicModel.Meta().required(),
786
+ });
787
+ }
788
+
789
+ /** @returns {Meta} */
790
+ static Meta() {
791
+ return Joi.object({
792
+ created_by: Joi.string().allow(""),
793
+ updated_by: Joi.string().allow(""),
794
+ created_at: Joi.string().allow(""),
795
+ updated_at: Joi.string().allow(""),
796
+ });
797
+ }
798
+
799
+ /** @returns {ResourceTranslation} */
800
+ static ResourceTranslation() {
801
+ return Joi.object({
802
+ _id: Joi.string().allow(""),
803
+ locale: Joi.string().allow(""),
804
+ value: Joi.object().pattern(/\S/, Joi.any()),
805
+ });
806
+ }
705
807
  }
706
808
  module.exports = ContentPublicModel;
@@ -1,5 +1,7 @@
1
1
  export = ContentPublicValidator;
2
+ /** @typedef GetAllLanguagesParam */
2
3
  /** @typedef GetAllTagsParam */
4
+ /** @typedef GetAllTranslatableResourcesParam */
3
5
  /** @typedef GetAnalyticsTagsParam */
4
6
  /** @typedef GetBasicDetailsParam */
5
7
  /**
@@ -16,6 +18,10 @@ export = ContentPublicValidator;
16
18
  * @typedef GetHomePageContentParam
17
19
  * @property {string} pageType - The type of the page (e.g., pricing).
18
20
  */
21
+ /**
22
+ * @typedef GetLanguageByLocaleParam
23
+ * @property {string} locale
24
+ */
19
25
  /** @typedef GetMenuContentParam */
20
26
  /**
21
27
  * @typedef GetMenuContentByTypeParam
@@ -24,8 +30,12 @@ export = ContentPublicValidator;
24
30
  /** @typedef GetNavbarParam */
25
31
  /** @typedef GetPricingBannerParam */
26
32
  declare class ContentPublicValidator {
33
+ /** @returns {GetAllLanguagesParam} */
34
+ static getAllLanguages(): any;
27
35
  /** @returns {GetAllTagsParam} */
28
36
  static getAllTags(): any;
37
+ /** @returns {GetAllTranslatableResourcesParam} */
38
+ static getAllTranslatableResources(): any;
29
39
  /** @returns {GetAnalyticsTagsParam} */
30
40
  static getAnalyticsTags(): any;
31
41
  /** @returns {GetBasicDetailsParam} */
@@ -38,6 +48,8 @@ declare class ContentPublicValidator {
38
48
  static getFooterContent(): any;
39
49
  /** @returns {GetHomePageContentParam} */
40
50
  static getHomePageContent(): GetHomePageContentParam;
51
+ /** @returns {GetLanguageByLocaleParam} */
52
+ static getLanguageByLocale(): GetLanguageByLocaleParam;
41
53
  /** @returns {GetMenuContentParam} */
42
54
  static getMenuContent(): any;
43
55
  /** @returns {GetMenuContentByTypeParam} */
@@ -48,7 +60,7 @@ declare class ContentPublicValidator {
48
60
  static getPricingBanner(): any;
49
61
  }
50
62
  declare namespace ContentPublicValidator {
51
- export { GetAllTagsParam, GetAnalyticsTagsParam, GetBasicDetailsParam, GetCredentialsByEntityParam, GetCustomPageParam, GetFooterContentParam, GetHomePageContentParam, GetMenuContentParam, GetMenuContentByTypeParam, GetNavbarParam, GetPricingBannerParam };
63
+ export { GetAllLanguagesParam, GetAllTagsParam, GetAllTranslatableResourcesParam, GetAnalyticsTagsParam, GetBasicDetailsParam, GetCredentialsByEntityParam, GetCustomPageParam, GetFooterContentParam, GetHomePageContentParam, GetLanguageByLocaleParam, GetMenuContentParam, GetMenuContentByTypeParam, GetNavbarParam, GetPricingBannerParam };
52
64
  }
53
65
  type GetCredentialsByEntityParam = {
54
66
  /**
@@ -69,13 +81,18 @@ type GetHomePageContentParam = {
69
81
  */
70
82
  pageType: string;
71
83
  };
84
+ type GetLanguageByLocaleParam = {
85
+ locale: string;
86
+ };
72
87
  type GetMenuContentByTypeParam = {
73
88
  /**
74
89
  * - Type param is type of device
75
90
  */
76
91
  type: string;
77
92
  };
93
+ type GetAllLanguagesParam = any;
78
94
  type GetAllTagsParam = any;
95
+ type GetAllTranslatableResourcesParam = any;
79
96
  type GetAnalyticsTagsParam = any;
80
97
  type GetBasicDetailsParam = any;
81
98
  type GetFooterContentParam = any;
@@ -2,8 +2,12 @@ const Joi = require("joi");
2
2
 
3
3
  const ContentPublicModel = require("./ContentPublicModel");
4
4
 
5
+ /** @typedef GetAllLanguagesParam */
6
+
5
7
  /** @typedef GetAllTagsParam */
6
8
 
9
+ /** @typedef GetAllTranslatableResourcesParam */
10
+
7
11
  /** @typedef GetAnalyticsTagsParam */
8
12
 
9
13
  /** @typedef GetBasicDetailsParam */
@@ -26,6 +30,11 @@ const ContentPublicModel = require("./ContentPublicModel");
26
30
  * @property {string} pageType - The type of the page (e.g., pricing).
27
31
  */
28
32
 
33
+ /**
34
+ * @typedef GetLanguageByLocaleParam
35
+ * @property {string} locale
36
+ */
37
+
29
38
  /** @typedef GetMenuContentParam */
30
39
 
31
40
  /**
@@ -38,11 +47,21 @@ const ContentPublicModel = require("./ContentPublicModel");
38
47
  /** @typedef GetPricingBannerParam */
39
48
 
40
49
  class ContentPublicValidator {
50
+ /** @returns {GetAllLanguagesParam} */
51
+ static getAllLanguages() {
52
+ return Joi.object({});
53
+ }
54
+
41
55
  /** @returns {GetAllTagsParam} */
42
56
  static getAllTags() {
43
57
  return Joi.object({});
44
58
  }
45
59
 
60
+ /** @returns {GetAllTranslatableResourcesParam} */
61
+ static getAllTranslatableResources() {
62
+ return Joi.object({});
63
+ }
64
+
46
65
  /** @returns {GetAnalyticsTagsParam} */
47
66
  static getAnalyticsTags() {
48
67
  return Joi.object({});
@@ -79,6 +98,13 @@ class ContentPublicValidator {
79
98
  }).required();
80
99
  }
81
100
 
101
+ /** @returns {GetLanguageByLocaleParam} */
102
+ static getLanguageByLocale() {
103
+ return Joi.object({
104
+ locale: Joi.string().allow("").required(),
105
+ }).required();
106
+ }
107
+
82
108
  /** @returns {GetMenuContentParam} */
83
109
  static getMenuContent() {
84
110
  return Joi.object({});
@@ -16,7 +16,7 @@ declare class Partner {
16
16
  * @summary: Get panel extension details
17
17
  * @description: Retrieve detailed information about panel extensions in the public server setup. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/public/partner/getPanelExtensionDetails/).
18
18
  */
19
- getPanelExtensionDetails({ slug, requestHeaders }?: PartnerPublicValidator.GetPanelExtensionDetailsParam, { responseHeaders }?: object): Promise<PartnerPublicModel.ExtensionUsingSlug>;
19
+ getPanelExtensionDetails({ slug, requestHeaders }?: PartnerPublicValidator.GetPanelExtensionDetailsParam, { responseHeaders }?: object, ...args: any[]): Promise<PartnerPublicModel.ExtensionUsingSlug>;
20
20
  }
21
21
  import PartnerPublicValidator = require("./PartnerPublicValidator");
22
22
  import PartnerPublicModel = require("./PartnerPublicModel");
@@ -6,6 +6,7 @@ const {
6
6
  const PublicAPIClient = require("../PublicAPIClient");
7
7
  const constructUrl = require("../constructUrl");
8
8
  const Paginator = require("../../common/Paginator");
9
+ const { validateRequiredParams } = require("../../common/Validator");
9
10
 
10
11
  const PartnerPublicValidator = require("./PartnerPublicValidator");
11
12
  const PartnerPublicModel = require("./PartnerPublicModel");
@@ -48,18 +49,12 @@ class Partner {
48
49
  { slug, requestHeaders } = { requestHeaders: {} },
49
50
  { responseHeaders } = { responseHeaders: false }
50
51
  ) {
51
- let invalidInput = [];
52
-
53
- if (!slug) {
54
- invalidInput.push({
55
- message: `The 'slug' field is required.`,
56
- path: ["slug"],
52
+ const errors = validateRequiredParams(arguments[0], ["slug"]);
53
+ if (errors.length > 0) {
54
+ const error = new FDKClientValidationError({
55
+ message: "Missing required field",
56
+ details: errors,
57
57
  });
58
- }
59
- if (invalidInput.length) {
60
- const error = new Error();
61
- error.message = "Missing required field";
62
- error.details = invalidInput;
63
58
  return Promise.reject(new FDKClientValidationError(error));
64
59
  }
65
60