@gofynd/fdk-client-javascript 1.4.15 → 1.4.16-beta.2

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 (95) hide show
  1. package/README.md +1 -1
  2. package/package.json +1 -1
  3. package/sdk/application/Cart/CartApplicationClient.d.ts +16 -16
  4. package/sdk/application/Cart/CartApplicationClient.js +101 -48
  5. package/sdk/application/Catalog/CatalogApplicationClient.d.ts +16 -16
  6. package/sdk/application/Catalog/CatalogApplicationClient.js +159 -0
  7. package/sdk/application/Common/CommonApplicationClient.js +6 -0
  8. package/sdk/application/Communication/CommunicationApplicationClient.js +6 -0
  9. package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +2 -2
  10. package/sdk/application/Configuration/ConfigurationApplicationClient.js +24 -0
  11. package/sdk/application/Content/ContentApplicationClient.d.ts +59 -7
  12. package/sdk/application/Content/ContentApplicationClient.js +290 -0
  13. package/sdk/application/FileStorage/FileStorageApplicationClient.d.ts +2 -2
  14. package/sdk/application/FileStorage/FileStorageApplicationClient.js +24 -0
  15. package/sdk/application/Finance/FinanceApplicationClient.js +6 -0
  16. package/sdk/application/Lead/LeadApplicationClient.d.ts +4 -4
  17. package/sdk/application/Lead/LeadApplicationClient.js +42 -0
  18. package/sdk/application/Logistic/LogisticApplicationClient.d.ts +6 -6
  19. package/sdk/application/Logistic/LogisticApplicationClient.js +69 -2
  20. package/sdk/application/Order/OrderApplicationClient.d.ts +11 -11
  21. package/sdk/application/Order/OrderApplicationClient.js +117 -0
  22. package/sdk/application/Payment/PaymentApplicationClient.d.ts +1 -11
  23. package/sdk/application/Payment/PaymentApplicationClient.js +15 -39
  24. package/sdk/application/Rewards/RewardsApplicationClient.d.ts +1 -1
  25. package/sdk/application/Rewards/RewardsApplicationClient.js +15 -0
  26. package/sdk/application/Share/ShareApplicationClient.d.ts +4 -4
  27. package/sdk/application/Share/ShareApplicationClient.js +42 -0
  28. package/sdk/application/Theme/ThemeApplicationClient.d.ts +3 -3
  29. package/sdk/application/Theme/ThemeApplicationClient.js +36 -0
  30. package/sdk/application/User/UserApplicationClient.js +6 -0
  31. package/sdk/application/Webhook/WebhookApplicationClient.js +6 -0
  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/Logistics/LogisticsPartnerClient.d.ts +12 -33
  37. package/sdk/partner/Logistics/LogisticsPartnerClient.js +38 -209
  38. package/sdk/partner/Logistics/LogisticsPartnerModel.d.ts +19 -399
  39. package/sdk/partner/Logistics/LogisticsPartnerModel.js +11 -212
  40. package/sdk/partner/Logistics/LogisticsPartnerValidator.d.ts +1 -3
  41. package/sdk/partner/Logistics/LogisticsPartnerValidator.js +7 -22
  42. package/sdk/partner/OAuthClient.js +1 -0
  43. package/sdk/partner/Theme/ThemePartnerModel.d.ts +3 -40
  44. package/sdk/partner/Theme/ThemePartnerModel.js +2 -24
  45. package/sdk/platform/Analytics/AnalyticsPlatformModel.js +1 -1
  46. package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +1 -1
  47. package/sdk/platform/Cart/CartPlatformApplicationClient.js +12 -3
  48. package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +11 -1
  49. package/sdk/platform/Cart/CartPlatformApplicationValidator.js +4 -1
  50. package/sdk/platform/Cart/CartPlatformModel.d.ts +49 -28
  51. package/sdk/platform/Cart/CartPlatformModel.js +23 -13
  52. package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +0 -24
  53. package/sdk/platform/Catalog/CatalogPlatformClient.js +0 -176
  54. package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +33 -80
  55. package/sdk/platform/Catalog/CatalogPlatformModel.js +36 -72
  56. package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +1 -45
  57. package/sdk/platform/Catalog/CatalogPlatformValidator.js +0 -35
  58. package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +7 -0
  59. package/sdk/platform/Configuration/ConfigurationPlatformModel.js +3 -0
  60. package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +132 -0
  61. package/sdk/platform/Content/ContentPlatformApplicationClient.js +1104 -122
  62. package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +159 -1
  63. package/sdk/platform/Content/ContentPlatformApplicationValidator.js +161 -0
  64. package/sdk/platform/Content/ContentPlatformModel.d.ts +220 -5
  65. package/sdk/platform/Content/ContentPlatformModel.js +214 -4
  66. package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +0 -10
  67. package/sdk/platform/Order/OrderPlatformApplicationClient.js +0 -92
  68. package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +1 -28
  69. package/sdk/platform/Order/OrderPlatformApplicationValidator.js +0 -18
  70. package/sdk/platform/Order/OrderPlatformClient.d.ts +12 -2
  71. package/sdk/platform/Order/OrderPlatformClient.js +99 -8
  72. package/sdk/platform/Order/OrderPlatformModel.d.ts +3 -75
  73. package/sdk/platform/Order/OrderPlatformModel.js +2 -43
  74. package/sdk/platform/Order/OrderPlatformValidator.d.ts +33 -23
  75. package/sdk/platform/Order/OrderPlatformValidator.js +20 -10
  76. package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +1 -95
  77. package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +78 -701
  78. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +23 -598
  79. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +20 -382
  80. package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.d.ts +3 -136
  81. package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.js +2 -110
  82. package/sdk/platform/Share/SharePlatformApplicationClient.d.ts +3 -3
  83. package/sdk/platform/Share/SharePlatformApplicationClient.js +7 -7
  84. package/sdk/platform/Share/SharePlatformApplicationValidator.d.ts +3 -6
  85. package/sdk/platform/Share/SharePlatformApplicationValidator.js +2 -2
  86. package/sdk/platform/Share/SharePlatformModel.d.ts +10 -2
  87. package/sdk/platform/Share/SharePlatformModel.js +4 -2
  88. package/sdk/platform/Theme/ThemePlatformModel.d.ts +3 -40
  89. package/sdk/platform/Theme/ThemePlatformModel.js +2 -24
  90. package/sdk/public/Configuration/ConfigurationPublicClient.js +1 -0
  91. package/sdk/public/Content/ContentPublicClient.d.ts +3 -3
  92. package/sdk/public/Content/ContentPublicClient.js +28 -0
  93. package/sdk/public/Partner/PartnerPublicClient.d.ts +1 -1
  94. package/sdk/public/Partner/PartnerPublicClient.js +10 -0
  95. package/sdk/public/Webhook/WebhookPublicClient.js +1 -0
@@ -1,6 +1,12 @@
1
+ const {
2
+ FDKClientValidationError,
3
+ FDKResponseValidationError,
4
+ } = require("../../common/FDKError");
5
+
1
6
  const ApplicationAPIClient = require("../ApplicationAPIClient");
2
7
  const constructUrl = require("../constructUrl");
3
8
  const Paginator = require("../../common/Paginator");
9
+ const { validateRequiredParams } = require("../../common/Validator");
4
10
 
5
11
  class Content {
6
12
  constructor(_conf) {
@@ -14,6 +20,8 @@ class Content {
14
20
  getCustomObjectBySlug:
15
21
  "/service/application/content/v2.0/customobjects/definition/{definition_slug}/entries/{slug}",
16
22
  getDataLoaders: "/service/application/content/v1.0/data-loader",
23
+ getDefaultSitemapConfig:
24
+ "/service/application/content/v1.0/seo/sitemap/default",
17
25
  getFaqBySlug: "/service/application/content/v1.0/faq/{slug}",
18
26
  getFaqCategories: "/service/application/content/v1.0/faq/categories",
19
27
  getFaqCategoryBySlug:
@@ -28,6 +36,10 @@ class Content {
28
36
  getPages: "/service/application/content/v2.0/pages",
29
37
  getSEOConfiguration: "/service/application/content/v1.0/seo",
30
38
  getSEOMarkupSchemas: "/service/application/content/v1.0/seo/schema",
39
+ getSitemap: "/service/application/content/v1.0/seo/sitemaps/{name}",
40
+ getSitemaps: "/service/application/content/v1.0/seo/sitemaps",
41
+ getSlideshow: "/service/application/content/v1.0/slideshow/{slug}",
42
+ getSlideshows: "/service/application/content/v1.0/slideshow",
31
43
  getSupportInformation: "/service/application/content/v1.0/support",
32
44
  getTags: "/service/application/content/v1.0/tags",
33
45
  };
@@ -96,6 +108,15 @@ class Content {
96
108
  { slug, rootId, preview, requestHeaders } = { requestHeaders: {} },
97
109
  { responseHeaders } = { responseHeaders: false }
98
110
  ) {
111
+ const errors = validateRequiredParams(arguments[0], ["slug"]);
112
+ if (errors.length > 0) {
113
+ const error = new FDKClientValidationError({
114
+ message: "Missing required field",
115
+ details: errors,
116
+ });
117
+ return Promise.reject(new FDKClientValidationError(error));
118
+ }
119
+
99
120
  const query_params = {};
100
121
  query_params["root_id"] = rootId;
101
122
  query_params["preview"] = preview;
@@ -176,6 +197,18 @@ class Content {
176
197
  { resource, resourceSlug, requestHeaders } = { requestHeaders: {} },
177
198
  { responseHeaders } = { responseHeaders: false }
178
199
  ) {
200
+ const errors = validateRequiredParams(arguments[0], [
201
+ "resource",
202
+ "resourceSlug",
203
+ ]);
204
+ if (errors.length > 0) {
205
+ const error = new FDKClientValidationError({
206
+ message: "Missing required field",
207
+ details: errors,
208
+ });
209
+ return Promise.reject(new FDKClientValidationError(error));
210
+ }
211
+
179
212
  const query_params = {};
180
213
 
181
214
  const xHeaders = {};
@@ -213,6 +246,18 @@ class Content {
213
246
  { definitionSlug, slug, requestHeaders } = { requestHeaders: {} },
214
247
  { responseHeaders } = { responseHeaders: false }
215
248
  ) {
249
+ const errors = validateRequiredParams(arguments[0], [
250
+ "definitionSlug",
251
+ "slug",
252
+ ]);
253
+ if (errors.length > 0) {
254
+ const error = new FDKClientValidationError({
255
+ message: "Missing required field",
256
+ details: errors,
257
+ });
258
+ return Promise.reject(new FDKClientValidationError(error));
259
+ }
260
+
216
261
  const query_params = {};
217
262
 
218
263
  const xHeaders = {};
@@ -275,6 +320,43 @@ class Content {
275
320
  return response;
276
321
  }
277
322
 
323
+ /**
324
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
325
+ * @param {import("../ApplicationAPIClient").Options} - Options
326
+ * @returns {Promise<DefaultSitemapConfig>} - Success response
327
+ * @name getDefaultSitemapConfig
328
+ * @summary: Get default sitemap configuration
329
+ * @description: Retrieves the current default sitemap configuration settings - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/content/getDefaultSitemapConfig/).
330
+ */
331
+ async getDefaultSitemapConfig(
332
+ { requestHeaders } = { requestHeaders: {} },
333
+ { responseHeaders } = { responseHeaders: false }
334
+ ) {
335
+ const query_params = {};
336
+
337
+ const xHeaders = {};
338
+
339
+ const response = await ApplicationAPIClient.execute(
340
+ this._conf,
341
+ "get",
342
+ constructUrl({
343
+ url: this._urls["getDefaultSitemapConfig"],
344
+ params: {},
345
+ }),
346
+ query_params,
347
+ undefined,
348
+ { ...xHeaders, ...requestHeaders },
349
+ { responseHeaders }
350
+ );
351
+
352
+ let responseData = response;
353
+ if (responseHeaders) {
354
+ responseData = response[0];
355
+ }
356
+
357
+ return response;
358
+ }
359
+
278
360
  /**
279
361
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
280
362
  * @param {import("../ApplicationAPIClient").Options} - Options
@@ -287,6 +369,15 @@ class Content {
287
369
  { slug, requestHeaders } = { requestHeaders: {} },
288
370
  { responseHeaders } = { responseHeaders: false }
289
371
  ) {
372
+ const errors = validateRequiredParams(arguments[0], ["slug"]);
373
+ if (errors.length > 0) {
374
+ const error = new FDKClientValidationError({
375
+ message: "Missing required field",
376
+ details: errors,
377
+ });
378
+ return Promise.reject(new FDKClientValidationError(error));
379
+ }
380
+
290
381
  const query_params = {};
291
382
 
292
383
  const xHeaders = {};
@@ -361,6 +452,15 @@ class Content {
361
452
  { slug, requestHeaders } = { requestHeaders: {} },
362
453
  { responseHeaders } = { responseHeaders: false }
363
454
  ) {
455
+ const errors = validateRequiredParams(arguments[0], ["slug"]);
456
+ if (errors.length > 0) {
457
+ const error = new FDKClientValidationError({
458
+ message: "Missing required field",
459
+ details: errors,
460
+ });
461
+ return Promise.reject(new FDKClientValidationError(error));
462
+ }
463
+
364
464
  const query_params = {};
365
465
 
366
466
  const xHeaders = {};
@@ -435,6 +535,15 @@ class Content {
435
535
  { slug, requestHeaders } = { requestHeaders: {} },
436
536
  { responseHeaders } = { responseHeaders: false }
437
537
  ) {
538
+ const errors = validateRequiredParams(arguments[0], ["slug"]);
539
+ if (errors.length > 0) {
540
+ const error = new FDKClientValidationError({
541
+ message: "Missing required field",
542
+ details: errors,
543
+ });
544
+ return Promise.reject(new FDKClientValidationError(error));
545
+ }
546
+
438
547
  const query_params = {};
439
548
 
440
549
  const xHeaders = {};
@@ -585,6 +694,15 @@ class Content {
585
694
  { slug, rootId, requestHeaders } = { requestHeaders: {} },
586
695
  { responseHeaders } = { responseHeaders: false }
587
696
  ) {
697
+ const errors = validateRequiredParams(arguments[0], ["slug"]);
698
+ if (errors.length > 0) {
699
+ const error = new FDKClientValidationError({
700
+ message: "Missing required field",
701
+ details: errors,
702
+ });
703
+ return Promise.reject(new FDKClientValidationError(error));
704
+ }
705
+
588
706
  const query_params = {};
589
707
  query_params["root_id"] = rootId;
590
708
 
@@ -726,6 +844,178 @@ class Content {
726
844
  return response;
727
845
  }
728
846
 
847
+ /**
848
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
849
+ * @param {import("../ApplicationAPIClient").Options} - Options
850
+ * @returns {Promise<SitemapConfig>} - Success response
851
+ * @name getSitemap
852
+ * @summary: Get a specific sitemap configuration
853
+ * @description: Retrieve a specific sitemap configuration by its name. Returns the complete configuration including the sitemap XML data, activation status, and timestamps.
854
+ * - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/content/getSitemap/).
855
+ */
856
+ async getSitemap(
857
+ { name, requestHeaders } = { requestHeaders: {} },
858
+ { responseHeaders } = { responseHeaders: false }
859
+ ) {
860
+ const errors = validateRequiredParams(arguments[0], ["name"]);
861
+ if (errors.length > 0) {
862
+ const error = new FDKClientValidationError({
863
+ message: "Missing required field",
864
+ details: errors,
865
+ });
866
+ return Promise.reject(new FDKClientValidationError(error));
867
+ }
868
+
869
+ const query_params = {};
870
+
871
+ const xHeaders = {};
872
+
873
+ const response = await ApplicationAPIClient.execute(
874
+ this._conf,
875
+ "get",
876
+ constructUrl({
877
+ url: this._urls["getSitemap"],
878
+ params: { name },
879
+ }),
880
+ query_params,
881
+ undefined,
882
+ { ...xHeaders, ...requestHeaders },
883
+ { responseHeaders }
884
+ );
885
+
886
+ let responseData = response;
887
+ if (responseHeaders) {
888
+ responseData = response[0];
889
+ }
890
+
891
+ return response;
892
+ }
893
+
894
+ /**
895
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
896
+ * @param {import("../ApplicationAPIClient").Options} - Options
897
+ * @returns {Promise<SitemapConfigurationList>} - Success response
898
+ * @name getSitemaps
899
+ * @summary: List sitemap configurations
900
+ * @description: Retrieve a list of sitemap configurations for a specific application. Each configuration contains the sitemap XML data.
901
+ * - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/content/getSitemaps/).
902
+ */
903
+ async getSitemaps(
904
+ { pageNo, pageSize, requestHeaders } = { requestHeaders: {} },
905
+ { responseHeaders } = { responseHeaders: false }
906
+ ) {
907
+ const query_params = {};
908
+ query_params["page_no"] = pageNo;
909
+ query_params["page_size"] = pageSize;
910
+
911
+ const xHeaders = {};
912
+
913
+ const response = await ApplicationAPIClient.execute(
914
+ this._conf,
915
+ "get",
916
+ constructUrl({
917
+ url: this._urls["getSitemaps"],
918
+ params: {},
919
+ }),
920
+ query_params,
921
+ undefined,
922
+ { ...xHeaders, ...requestHeaders },
923
+ { responseHeaders }
924
+ );
925
+
926
+ let responseData = response;
927
+ if (responseHeaders) {
928
+ responseData = response[0];
929
+ }
930
+
931
+ return response;
932
+ }
933
+
934
+ /**
935
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
936
+ * @param {import("../ApplicationAPIClient").Options} - Options
937
+ * @returns {Promise<SlideshowSchema>} - Success response
938
+ * @name getSlideshow
939
+ * @summary: Get a Slideshow
940
+ * @description: Get a slideshow using its `slug`. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/content/getSlideshow/).
941
+ */
942
+ async getSlideshow(
943
+ { slug, requestHeaders } = { requestHeaders: {} },
944
+ { responseHeaders } = { responseHeaders: false }
945
+ ) {
946
+ const errors = validateRequiredParams(arguments[0], ["slug"]);
947
+ if (errors.length > 0) {
948
+ const error = new FDKClientValidationError({
949
+ message: "Missing required field",
950
+ details: errors,
951
+ });
952
+ return Promise.reject(new FDKClientValidationError(error));
953
+ }
954
+
955
+ const query_params = {};
956
+
957
+ const xHeaders = {};
958
+
959
+ const response = await ApplicationAPIClient.execute(
960
+ this._conf,
961
+ "get",
962
+ constructUrl({
963
+ url: this._urls["getSlideshow"],
964
+ params: { slug },
965
+ }),
966
+ query_params,
967
+ undefined,
968
+ { ...xHeaders, ...requestHeaders },
969
+ { responseHeaders }
970
+ );
971
+
972
+ let responseData = response;
973
+ if (responseHeaders) {
974
+ responseData = response[0];
975
+ }
976
+
977
+ return response;
978
+ }
979
+
980
+ /**
981
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
982
+ * @param {import("../ApplicationAPIClient").Options} - Options
983
+ * @returns {Promise<SlideshowGetDetails>} - Success response
984
+ * @name getSlideshows
985
+ * @summary: List Slideshows
986
+ * @description: List slideshows along with their details. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/content/getSlideshows/).
987
+ */
988
+ async getSlideshows(
989
+ { pageNo, pageSize, requestHeaders } = { requestHeaders: {} },
990
+ { responseHeaders } = { responseHeaders: false }
991
+ ) {
992
+ const query_params = {};
993
+ query_params["page_no"] = pageNo;
994
+ query_params["page_size"] = pageSize;
995
+
996
+ const xHeaders = {};
997
+
998
+ const response = await ApplicationAPIClient.execute(
999
+ this._conf,
1000
+ "get",
1001
+ constructUrl({
1002
+ url: this._urls["getSlideshows"],
1003
+ params: {},
1004
+ }),
1005
+ query_params,
1006
+ undefined,
1007
+ { ...xHeaders, ...requestHeaders },
1008
+ { responseHeaders }
1009
+ );
1010
+
1011
+ let responseData = response;
1012
+ if (responseHeaders) {
1013
+ responseData = response[0];
1014
+ }
1015
+
1016
+ return response;
1017
+ }
1018
+
729
1019
  /**
730
1020
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
731
1021
  * @param {import("../ApplicationAPIClient").Options} - Options
@@ -17,7 +17,7 @@ declare class FileStorage {
17
17
  * @summary: Finalizes upload process.
18
18
  * @description: Complete the file upload and store the file details such as name, size, content type, and namespace to maintain integrity within the system's database. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/filestorage/completeUpload/).
19
19
  */
20
- completeUpload({ namespace, body, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<FileUploadComplete>;
20
+ completeUpload({ namespace, body, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options, ...args: any[]): Promise<FileUploadComplete>;
21
21
  /**
22
22
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
23
23
  * @param {import("../ApplicationAPIClient").Options} - Options
@@ -35,7 +35,7 @@ declare class FileStorage {
35
35
  * @summary: Initiates file upload
36
36
  * @description: Starts the process of uploading a file to storage location, and returns a signed url in response. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/filestorage/startUpload/).
37
37
  */
38
- startUpload({ namespace, body, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<FileUpload>;
38
+ startUpload({ namespace, body, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options, ...args: any[]): Promise<FileUpload>;
39
39
  /**
40
40
  * @param data
41
41
  * @param {string} file_name
@@ -1,6 +1,12 @@
1
+ const {
2
+ FDKClientValidationError,
3
+ FDKResponseValidationError,
4
+ } = require("../../common/FDKError");
5
+
1
6
  const ApplicationAPIClient = require("../ApplicationAPIClient");
2
7
  const constructUrl = require("../constructUrl");
3
8
  const Paginator = require("../../common/Paginator");
9
+ const { validateRequiredParams } = require("../../common/Validator");
4
10
 
5
11
  const { fdkAxios } = require("../../common/AxiosHelper.js");
6
12
 
@@ -42,6 +48,15 @@ class FileStorage {
42
48
  { namespace, body, requestHeaders } = { requestHeaders: {} },
43
49
  { responseHeaders } = { responseHeaders: false }
44
50
  ) {
51
+ const errors = validateRequiredParams(arguments[0], ["namespace"]);
52
+ if (errors.length > 0) {
53
+ const error = new FDKClientValidationError({
54
+ message: "Missing required field",
55
+ details: errors,
56
+ });
57
+ return Promise.reject(new FDKClientValidationError(error));
58
+ }
59
+
45
60
  const query_params = {};
46
61
 
47
62
  const xHeaders = {};
@@ -116,6 +131,15 @@ class FileStorage {
116
131
  { namespace, body, requestHeaders } = { requestHeaders: {} },
117
132
  { responseHeaders } = { responseHeaders: false }
118
133
  ) {
134
+ const errors = validateRequiredParams(arguments[0], ["namespace"]);
135
+ if (errors.length > 0) {
136
+ const error = new FDKClientValidationError({
137
+ message: "Missing required field",
138
+ details: errors,
139
+ });
140
+ return Promise.reject(new FDKClientValidationError(error));
141
+ }
142
+
119
143
  const query_params = {};
120
144
 
121
145
  const xHeaders = {};
@@ -1,6 +1,12 @@
1
+ const {
2
+ FDKClientValidationError,
3
+ FDKResponseValidationError,
4
+ } = require("../../common/FDKError");
5
+
1
6
  const ApplicationAPIClient = require("../ApplicationAPIClient");
2
7
  const constructUrl = require("../constructUrl");
3
8
  const Paginator = require("../../common/Paginator");
9
+ const { validateRequiredParams } = require("../../common/Validator");
4
10
 
5
11
  class Finance {
6
12
  constructor(_conf) {
@@ -19,7 +19,7 @@ declare class Lead {
19
19
  * @summary: Log ticket history
20
20
  * @description: Create a history entry for a specific support ticket. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/lead/createHistory/).
21
21
  */
22
- createHistory({ id, body, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<TicketHistory>;
22
+ createHistory({ id, body, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options, ...args: any[]): Promise<TicketHistory>;
23
23
  /**
24
24
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
25
25
  * @param {import("../ApplicationAPIClient").Options} - Options
@@ -37,7 +37,7 @@ declare class Lead {
37
37
  * @summary: Get custom form
38
38
  * @description: Get a customizable form template for data collection. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/lead/getCustomForm/).
39
39
  */
40
- getCustomForm({ slug, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<CustomForm>;
40
+ getCustomForm({ slug, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options, ...args: any[]): Promise<CustomForm>;
41
41
  /**
42
42
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
43
43
  * @param {import("../ApplicationAPIClient").Options} - Options
@@ -46,7 +46,7 @@ declare class Lead {
46
46
  * @summary: Get a support ticket
47
47
  * @description: Get details of a specific customer support ticket. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/lead/getTicket/).
48
48
  */
49
- getTicket({ id, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<Ticket>;
49
+ getTicket({ id, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options, ...args: any[]): Promise<Ticket>;
50
50
  /**
51
51
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
52
52
  * @param {import("../ApplicationAPIClient").Options} - Options
@@ -55,5 +55,5 @@ declare class Lead {
55
55
  * @summary: Submits form data
56
56
  * @description: Create user-entered data from a custom form for processing. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/lead/submitCustomForm/).
57
57
  */
58
- submitCustomForm({ slug, body, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<SubmitCustomFormDetails>;
58
+ submitCustomForm({ slug, body, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options, ...args: any[]): Promise<SubmitCustomFormDetails>;
59
59
  }
@@ -1,6 +1,12 @@
1
+ const {
2
+ FDKClientValidationError,
3
+ FDKResponseValidationError,
4
+ } = require("../../common/FDKError");
5
+
1
6
  const ApplicationAPIClient = require("../ApplicationAPIClient");
2
7
  const constructUrl = require("../constructUrl");
3
8
  const Paginator = require("../../common/Paginator");
9
+ const { validateRequiredParams } = require("../../common/Validator");
4
10
 
5
11
  class Lead {
6
12
  constructor(_conf) {
@@ -40,6 +46,15 @@ class Lead {
40
46
  { id, body, requestHeaders } = { requestHeaders: {} },
41
47
  { responseHeaders } = { responseHeaders: false }
42
48
  ) {
49
+ const errors = validateRequiredParams(arguments[0], ["id"]);
50
+ if (errors.length > 0) {
51
+ const error = new FDKClientValidationError({
52
+ message: "Missing required field",
53
+ details: errors,
54
+ });
55
+ return Promise.reject(new FDKClientValidationError(error));
56
+ }
57
+
43
58
  const query_params = {};
44
59
 
45
60
  const xHeaders = {};
@@ -114,6 +129,15 @@ class Lead {
114
129
  { slug, requestHeaders } = { requestHeaders: {} },
115
130
  { responseHeaders } = { responseHeaders: false }
116
131
  ) {
132
+ const errors = validateRequiredParams(arguments[0], ["slug"]);
133
+ if (errors.length > 0) {
134
+ const error = new FDKClientValidationError({
135
+ message: "Missing required field",
136
+ details: errors,
137
+ });
138
+ return Promise.reject(new FDKClientValidationError(error));
139
+ }
140
+
117
141
  const query_params = {};
118
142
 
119
143
  const xHeaders = {};
@@ -151,6 +175,15 @@ class Lead {
151
175
  { id, requestHeaders } = { requestHeaders: {} },
152
176
  { responseHeaders } = { responseHeaders: false }
153
177
  ) {
178
+ const errors = validateRequiredParams(arguments[0], ["id"]);
179
+ if (errors.length > 0) {
180
+ const error = new FDKClientValidationError({
181
+ message: "Missing required field",
182
+ details: errors,
183
+ });
184
+ return Promise.reject(new FDKClientValidationError(error));
185
+ }
186
+
154
187
  const query_params = {};
155
188
 
156
189
  const xHeaders = {};
@@ -188,6 +221,15 @@ class Lead {
188
221
  { slug, body, requestHeaders } = { requestHeaders: {} },
189
222
  { responseHeaders } = { responseHeaders: false }
190
223
  ) {
224
+ const errors = validateRequiredParams(arguments[0], ["slug"]);
225
+ if (errors.length > 0) {
226
+ const error = new FDKClientValidationError({
227
+ message: "Missing required field",
228
+ details: errors,
229
+ });
230
+ return Promise.reject(new FDKClientValidationError(error));
231
+ }
232
+
191
233
  const query_params = {};
192
234
 
193
235
  const xHeaders = {};
@@ -45,7 +45,7 @@ declare class Logistic {
45
45
  * @summary: Get country details
46
46
  * @description: Get details about a particular country and its address format customized for different business scenarios. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/logistic/getCountry/).
47
47
  */
48
- getCountry({ countryIsoCode, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<GetCountry>;
48
+ getCountry({ countryIsoCode, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options, ...args: any[]): Promise<GetCountry>;
49
49
  /**
50
50
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
51
51
  * @param {import("../ApplicationAPIClient").Options} - Options
@@ -54,7 +54,7 @@ declare class Logistic {
54
54
  * @summary: Serviceable Courier Partners.
55
55
  * @description: Get all the serviceable courier partners of a destination and the shipments. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/logistic/getCourierPartners/).
56
56
  */
57
- getCourierPartners({ companyId, applicationId, body, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<ShipmentCourierPartnerResult>;
57
+ getCourierPartners({ companyId, applicationId, body, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options, ...args: any[]): Promise<ShipmentCourierPartnerResult>;
58
58
  /**
59
59
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
60
60
  * @param {import("../ApplicationAPIClient").Options} - Options
@@ -72,7 +72,7 @@ declare class Logistic {
72
72
  * @summary: Get localities
73
73
  * @description: Get geographical data for a specific type of locality based on the provided filters. For instance, obtain a list of cities for a given country and state. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/logistic/getLocalities/).
74
74
  */
75
- getLocalities({ localityType, country, state, city, pageNo, pageSize, q, sector, requestHeaders, }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<GetLocalities>;
75
+ getLocalities({ localityType, country, state, city, pageNo, pageSize, q, requestHeaders, }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options, ...args: any[]): Promise<GetLocalities>;
76
76
  /**
77
77
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
78
78
  * @param {import("../ApplicationAPIClient").Options} - Options
@@ -81,7 +81,7 @@ declare class Logistic {
81
81
  * @summary: Get locality detail
82
82
  * @description: Get detailed geographical data for a specific locality, such as a pincode. For example, for a pincode value of 400603, the service returns its parent locations, including city, state, and country details. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/logistic/getLocality/).
83
83
  */
84
- getLocality({ localityType, localityValue, country, state, city, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<GetLocality>;
84
+ getLocality({ localityType, localityValue, country, state, city, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options, ...args: any[]): Promise<GetLocality>;
85
85
  /**
86
86
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
87
87
  * @param {import("../ApplicationAPIClient").Options} - Options
@@ -108,7 +108,7 @@ declare class Logistic {
108
108
  * @summary: Get pincode details
109
109
  * @description: Get details of a specific pincode, such as obtaining its city and state information. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/logistic/getPincodeCity/).
110
110
  */
111
- getPincodeCity({ pincode, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<PincodeDetails>;
111
+ getPincodeCity({ pincode, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options, ...args: any[]): Promise<PincodeDetails>;
112
112
  /**
113
113
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
114
114
  * @param {import("../ApplicationAPIClient").Options} - Options
@@ -135,5 +135,5 @@ declare class Logistic {
135
135
  * @summary: Validate address
136
136
  * @description: Validate addresses using specific templates customized for each country and tailored to various business scenarios. This validation ensures that the data conforms to the information currently stored in the system. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/logistic/validateAddress/).
137
137
  */
138
- validateAddress({ countryIsoCode, templateName, body, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<ValidateAddressDetails>;
138
+ validateAddress({ countryIsoCode, templateName, body, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options, ...args: any[]): Promise<ValidateAddressDetails>;
139
139
  }