@gofynd/fdk-client-javascript 1.4.16-beta.1 → 1.4.16-beta.3

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 (73) hide show
  1. package/README.md +1 -1
  2. package/package.json +1 -1
  3. package/sdk/application/Cart/CartApplicationClient.d.ts +6 -6
  4. package/sdk/application/Cart/CartApplicationClient.js +30 -269
  5. package/sdk/application/Catalog/CatalogApplicationClient.d.ts +16 -16
  6. package/sdk/application/Catalog/CatalogApplicationClient.js +90 -339
  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 +2 -2
  10. package/sdk/application/Configuration/ConfigurationApplicationClient.js +11 -134
  11. package/sdk/application/Content/ContentApplicationClient.d.ts +40 -8
  12. package/sdk/application/Content/ContentApplicationClient.js +174 -211
  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 +6 -6
  19. package/sdk/application/Logistic/LogisticApplicationClient.js +40 -153
  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 +1 -1
  23. package/sdk/application/Payment/PaymentApplicationClient.js +6 -437
  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/platform/Cart/CartPlatformModel.d.ts +35 -0
  37. package/sdk/platform/Cart/CartPlatformModel.js +16 -0
  38. package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +4 -0
  39. package/sdk/platform/Catalog/CatalogPlatformModel.js +4 -0
  40. package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +80 -0
  41. package/sdk/platform/Content/ContentPlatformApplicationClient.js +571 -0
  42. package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +75 -1
  43. package/sdk/platform/Content/ContentPlatformApplicationValidator.js +88 -0
  44. package/sdk/platform/Content/ContentPlatformModel.d.ts +131 -5
  45. package/sdk/platform/Content/ContentPlatformModel.js +110 -4
  46. package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +0 -10
  47. package/sdk/platform/Order/OrderPlatformApplicationClient.js +0 -92
  48. package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +1 -28
  49. package/sdk/platform/Order/OrderPlatformApplicationValidator.js +0 -18
  50. package/sdk/platform/Order/OrderPlatformClient.d.ts +10 -0
  51. package/sdk/platform/Order/OrderPlatformClient.js +99 -0
  52. package/sdk/platform/Order/OrderPlatformValidator.d.ts +33 -1
  53. package/sdk/platform/Order/OrderPlatformValidator.js +20 -0
  54. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.d.ts +0 -10
  55. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.js +0 -118
  56. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.d.ts +1 -53
  57. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.js +0 -29
  58. package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +10 -0
  59. package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +119 -0
  60. package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.d.ts +58 -1
  61. package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.js +30 -0
  62. package/sdk/platform/Share/SharePlatformApplicationClient.d.ts +3 -3
  63. package/sdk/platform/Share/SharePlatformApplicationClient.js +7 -7
  64. package/sdk/platform/Share/SharePlatformApplicationValidator.d.ts +3 -6
  65. package/sdk/platform/Share/SharePlatformApplicationValidator.js +2 -2
  66. package/sdk/platform/Share/SharePlatformModel.d.ts +10 -2
  67. package/sdk/platform/Share/SharePlatformModel.js +4 -2
  68. package/sdk/public/Configuration/ConfigurationPublicClient.js +1 -16
  69. package/sdk/public/Content/ContentPublicClient.d.ts +3 -3
  70. package/sdk/public/Content/ContentPublicClient.js +16 -104
  71. package/sdk/public/Partner/PartnerPublicClient.d.ts +1 -1
  72. package/sdk/public/Partner/PartnerPublicClient.js +6 -11
  73. package/sdk/public/Webhook/WebhookPublicClient.js +1 -40
@@ -6,6 +6,7 @@ const {
6
6
  const ApplicationAPIClient = require("../ApplicationAPIClient");
7
7
  const constructUrl = require("../constructUrl");
8
8
  const Paginator = require("../../common/Paginator");
9
+ const { validateRequiredParams } = require("../../common/Validator");
9
10
 
10
11
  class Content {
11
12
  constructor(_conf) {
@@ -19,6 +20,8 @@ class Content {
19
20
  getCustomObjectBySlug:
20
21
  "/service/application/content/v2.0/customobjects/definition/{definition_slug}/entries/{slug}",
21
22
  getDataLoaders: "/service/application/content/v1.0/data-loader",
23
+ getDefaultSitemapConfig:
24
+ "/service/application/content/v1.0/seo/sitemap/default",
22
25
  getFaqBySlug: "/service/application/content/v1.0/faq/{slug}",
23
26
  getFaqCategories: "/service/application/content/v1.0/faq/categories",
24
27
  getFaqCategoryBySlug:
@@ -33,6 +36,8 @@ class Content {
33
36
  getPages: "/service/application/content/v2.0/pages",
34
37
  getSEOConfiguration: "/service/application/content/v1.0/seo",
35
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",
36
41
  getSlideshow: "/service/application/content/v1.0/slideshow/{slug}",
37
42
  getSlideshows: "/service/application/content/v1.0/slideshow",
38
43
  getSupportInformation: "/service/application/content/v1.0/support",
@@ -66,14 +71,6 @@ class Content {
66
71
  { requestHeaders } = { requestHeaders: {} },
67
72
  { responseHeaders } = { responseHeaders: false }
68
73
  ) {
69
- let invalidInput = [];
70
- if (invalidInput.length) {
71
- const error = new Error();
72
- error.message = "Missing required field";
73
- error.details = invalidInput;
74
- return Promise.reject(new FDKClientValidationError(error));
75
- }
76
-
77
74
  const query_params = {};
78
75
 
79
76
  const xHeaders = {};
@@ -111,18 +108,12 @@ class Content {
111
108
  { slug, rootId, preview, requestHeaders } = { requestHeaders: {} },
112
109
  { responseHeaders } = { responseHeaders: false }
113
110
  ) {
114
- let invalidInput = [];
115
-
116
- if (!slug) {
117
- invalidInput.push({
118
- message: `The 'slug' field is required.`,
119
- path: ["slug"],
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,
120
116
  });
121
- }
122
- if (invalidInput.length) {
123
- const error = new Error();
124
- error.message = "Missing required field";
125
- error.details = invalidInput;
126
117
  return Promise.reject(new FDKClientValidationError(error));
127
118
  }
128
119
 
@@ -165,14 +156,6 @@ class Content {
165
156
  { pageNo, pageSize, tags, search, requestHeaders } = { requestHeaders: {} },
166
157
  { responseHeaders } = { responseHeaders: false }
167
158
  ) {
168
- let invalidInput = [];
169
- if (invalidInput.length) {
170
- const error = new Error();
171
- error.message = "Missing required field";
172
- error.details = invalidInput;
173
- return Promise.reject(new FDKClientValidationError(error));
174
- }
175
-
176
159
  const query_params = {};
177
160
  query_params["page_no"] = pageNo;
178
161
  query_params["page_size"] = pageSize;
@@ -214,24 +197,15 @@ class Content {
214
197
  { resource, resourceSlug, requestHeaders } = { requestHeaders: {} },
215
198
  { responseHeaders } = { responseHeaders: false }
216
199
  ) {
217
- let invalidInput = [];
218
-
219
- if (!resource) {
220
- invalidInput.push({
221
- message: `The 'resource' field is required.`,
222
- path: ["resource"],
223
- });
224
- }
225
- if (!resourceSlug) {
226
- invalidInput.push({
227
- message: `The 'resourceSlug' field is required.`,
228
- path: ["resourceSlug"],
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,
229
208
  });
230
- }
231
- if (invalidInput.length) {
232
- const error = new Error();
233
- error.message = "Missing required field";
234
- error.details = invalidInput;
235
209
  return Promise.reject(new FDKClientValidationError(error));
236
210
  }
237
211
 
@@ -272,24 +246,15 @@ class Content {
272
246
  { definitionSlug, slug, requestHeaders } = { requestHeaders: {} },
273
247
  { responseHeaders } = { responseHeaders: false }
274
248
  ) {
275
- let invalidInput = [];
276
-
277
- if (!definitionSlug) {
278
- invalidInput.push({
279
- message: `The 'definitionSlug' field is required.`,
280
- path: ["definitionSlug"],
281
- });
282
- }
283
- if (!slug) {
284
- invalidInput.push({
285
- message: `The 'slug' field is required.`,
286
- path: ["slug"],
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,
287
257
  });
288
- }
289
- if (invalidInput.length) {
290
- const error = new Error();
291
- error.message = "Missing required field";
292
- error.details = invalidInput;
293
258
  return Promise.reject(new FDKClientValidationError(error));
294
259
  }
295
260
 
@@ -330,14 +295,43 @@ class Content {
330
295
  { requestHeaders } = { requestHeaders: {} },
331
296
  { responseHeaders } = { responseHeaders: false }
332
297
  ) {
333
- let invalidInput = [];
334
- if (invalidInput.length) {
335
- const error = new Error();
336
- error.message = "Missing required field";
337
- error.details = invalidInput;
338
- return Promise.reject(new FDKClientValidationError(error));
298
+ const query_params = {};
299
+
300
+ const xHeaders = {};
301
+
302
+ const response = await ApplicationAPIClient.execute(
303
+ this._conf,
304
+ "get",
305
+ constructUrl({
306
+ url: this._urls["getDataLoaders"],
307
+ params: {},
308
+ }),
309
+ query_params,
310
+ undefined,
311
+ { ...xHeaders, ...requestHeaders },
312
+ { responseHeaders }
313
+ );
314
+
315
+ let responseData = response;
316
+ if (responseHeaders) {
317
+ responseData = response[0];
339
318
  }
340
319
 
320
+ return response;
321
+ }
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
+ ) {
341
335
  const query_params = {};
342
336
 
343
337
  const xHeaders = {};
@@ -346,7 +340,7 @@ class Content {
346
340
  this._conf,
347
341
  "get",
348
342
  constructUrl({
349
- url: this._urls["getDataLoaders"],
343
+ url: this._urls["getDefaultSitemapConfig"],
350
344
  params: {},
351
345
  }),
352
346
  query_params,
@@ -375,18 +369,12 @@ class Content {
375
369
  { slug, requestHeaders } = { requestHeaders: {} },
376
370
  { responseHeaders } = { responseHeaders: false }
377
371
  ) {
378
- let invalidInput = [];
379
-
380
- if (!slug) {
381
- invalidInput.push({
382
- message: `The 'slug' field is required.`,
383
- path: ["slug"],
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,
384
377
  });
385
- }
386
- if (invalidInput.length) {
387
- const error = new Error();
388
- error.message = "Missing required field";
389
- error.details = invalidInput;
390
378
  return Promise.reject(new FDKClientValidationError(error));
391
379
  }
392
380
 
@@ -427,14 +415,6 @@ class Content {
427
415
  { requestHeaders } = { requestHeaders: {} },
428
416
  { responseHeaders } = { responseHeaders: false }
429
417
  ) {
430
- let invalidInput = [];
431
- if (invalidInput.length) {
432
- const error = new Error();
433
- error.message = "Missing required field";
434
- error.details = invalidInput;
435
- return Promise.reject(new FDKClientValidationError(error));
436
- }
437
-
438
418
  const query_params = {};
439
419
 
440
420
  const xHeaders = {};
@@ -472,18 +452,12 @@ class Content {
472
452
  { slug, requestHeaders } = { requestHeaders: {} },
473
453
  { responseHeaders } = { responseHeaders: false }
474
454
  ) {
475
- let invalidInput = [];
476
-
477
- if (!slug) {
478
- invalidInput.push({
479
- message: `The 'slug' field is required.`,
480
- path: ["slug"],
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,
481
460
  });
482
- }
483
- if (invalidInput.length) {
484
- const error = new Error();
485
- error.message = "Missing required field";
486
- error.details = invalidInput;
487
461
  return Promise.reject(new FDKClientValidationError(error));
488
462
  }
489
463
 
@@ -524,14 +498,6 @@ class Content {
524
498
  { requestHeaders } = { requestHeaders: {} },
525
499
  { responseHeaders } = { responseHeaders: false }
526
500
  ) {
527
- let invalidInput = [];
528
- if (invalidInput.length) {
529
- const error = new Error();
530
- error.message = "Missing required field";
531
- error.details = invalidInput;
532
- return Promise.reject(new FDKClientValidationError(error));
533
- }
534
-
535
501
  const query_params = {};
536
502
 
537
503
  const xHeaders = {};
@@ -569,18 +535,12 @@ class Content {
569
535
  { slug, requestHeaders } = { requestHeaders: {} },
570
536
  { responseHeaders } = { responseHeaders: false }
571
537
  ) {
572
- let invalidInput = [];
573
-
574
- if (!slug) {
575
- invalidInput.push({
576
- message: `The 'slug' field is required.`,
577
- path: ["slug"],
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,
578
543
  });
579
- }
580
- if (invalidInput.length) {
581
- const error = new Error();
582
- error.message = "Missing required field";
583
- error.details = invalidInput;
584
544
  return Promise.reject(new FDKClientValidationError(error));
585
545
  }
586
546
 
@@ -621,14 +581,6 @@ class Content {
621
581
  { requestHeaders } = { requestHeaders: {} },
622
582
  { responseHeaders } = { responseHeaders: false }
623
583
  ) {
624
- let invalidInput = [];
625
- if (invalidInput.length) {
626
- const error = new Error();
627
- error.message = "Missing required field";
628
- error.details = invalidInput;
629
- return Promise.reject(new FDKClientValidationError(error));
630
- }
631
-
632
584
  const query_params = {};
633
585
 
634
586
  const xHeaders = {};
@@ -666,14 +618,6 @@ class Content {
666
618
  { requestHeaders } = { requestHeaders: {} },
667
619
  { responseHeaders } = { responseHeaders: false }
668
620
  ) {
669
- let invalidInput = [];
670
- if (invalidInput.length) {
671
- const error = new Error();
672
- error.message = "Missing required field";
673
- error.details = invalidInput;
674
- return Promise.reject(new FDKClientValidationError(error));
675
- }
676
-
677
621
  const query_params = {};
678
622
 
679
623
  const xHeaders = {};
@@ -711,14 +655,6 @@ class Content {
711
655
  { pageNo, pageSize, requestHeaders } = { requestHeaders: {} },
712
656
  { responseHeaders } = { responseHeaders: false }
713
657
  ) {
714
- let invalidInput = [];
715
- if (invalidInput.length) {
716
- const error = new Error();
717
- error.message = "Missing required field";
718
- error.details = invalidInput;
719
- return Promise.reject(new FDKClientValidationError(error));
720
- }
721
-
722
658
  const query_params = {};
723
659
  query_params["page_no"] = pageNo;
724
660
  query_params["page_size"] = pageSize;
@@ -758,18 +694,12 @@ class Content {
758
694
  { slug, rootId, requestHeaders } = { requestHeaders: {} },
759
695
  { responseHeaders } = { responseHeaders: false }
760
696
  ) {
761
- let invalidInput = [];
762
-
763
- if (!slug) {
764
- invalidInput.push({
765
- message: `The 'slug' field is required.`,
766
- path: ["slug"],
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,
767
702
  });
768
- }
769
- if (invalidInput.length) {
770
- const error = new Error();
771
- error.message = "Missing required field";
772
- error.details = invalidInput;
773
703
  return Promise.reject(new FDKClientValidationError(error));
774
704
  }
775
705
 
@@ -811,14 +741,6 @@ class Content {
811
741
  { pageNo, pageSize, requestHeaders } = { requestHeaders: {} },
812
742
  { responseHeaders } = { responseHeaders: false }
813
743
  ) {
814
- let invalidInput = [];
815
- if (invalidInput.length) {
816
- const error = new Error();
817
- error.message = "Missing required field";
818
- error.details = invalidInput;
819
- return Promise.reject(new FDKClientValidationError(error));
820
- }
821
-
822
744
  const query_params = {};
823
745
  query_params["page_no"] = pageNo;
824
746
  query_params["page_size"] = pageSize;
@@ -858,14 +780,6 @@ class Content {
858
780
  { requestHeaders } = { requestHeaders: {} },
859
781
  { responseHeaders } = { responseHeaders: false }
860
782
  ) {
861
- let invalidInput = [];
862
- if (invalidInput.length) {
863
- const error = new Error();
864
- error.message = "Missing required field";
865
- error.details = invalidInput;
866
- return Promise.reject(new FDKClientValidationError(error));
867
- }
868
-
869
783
  const query_params = {};
870
784
 
871
785
  const xHeaders = {};
@@ -903,14 +817,6 @@ class Content {
903
817
  { pageType, active, requestHeaders } = { requestHeaders: {} },
904
818
  { responseHeaders } = { responseHeaders: false }
905
819
  ) {
906
- let invalidInput = [];
907
- if (invalidInput.length) {
908
- const error = new Error();
909
- error.message = "Missing required field";
910
- error.details = invalidInput;
911
- return Promise.reject(new FDKClientValidationError(error));
912
- }
913
-
914
820
  const query_params = {};
915
821
  query_params["page_type"] = pageType;
916
822
  query_params["active"] = active;
@@ -938,6 +844,93 @@ class Content {
938
844
  return response;
939
845
  }
940
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
+
941
934
  /**
942
935
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
943
936
  * @param {import("../ApplicationAPIClient").Options} - Options
@@ -950,18 +943,12 @@ class Content {
950
943
  { slug, requestHeaders } = { requestHeaders: {} },
951
944
  { responseHeaders } = { responseHeaders: false }
952
945
  ) {
953
- let invalidInput = [];
954
-
955
- if (!slug) {
956
- invalidInput.push({
957
- message: `The 'slug' field is required.`,
958
- path: ["slug"],
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,
959
951
  });
960
- }
961
- if (invalidInput.length) {
962
- const error = new Error();
963
- error.message = "Missing required field";
964
- error.details = invalidInput;
965
952
  return Promise.reject(new FDKClientValidationError(error));
966
953
  }
967
954
 
@@ -1002,14 +989,6 @@ class Content {
1002
989
  { pageNo, pageSize, requestHeaders } = { requestHeaders: {} },
1003
990
  { responseHeaders } = { responseHeaders: false }
1004
991
  ) {
1005
- let invalidInput = [];
1006
- if (invalidInput.length) {
1007
- const error = new Error();
1008
- error.message = "Missing required field";
1009
- error.details = invalidInput;
1010
- return Promise.reject(new FDKClientValidationError(error));
1011
- }
1012
-
1013
992
  const query_params = {};
1014
993
  query_params["page_no"] = pageNo;
1015
994
  query_params["page_size"] = pageSize;
@@ -1049,14 +1028,6 @@ class Content {
1049
1028
  { requestHeaders } = { requestHeaders: {} },
1050
1029
  { responseHeaders } = { responseHeaders: false }
1051
1030
  ) {
1052
- let invalidInput = [];
1053
- if (invalidInput.length) {
1054
- const error = new Error();
1055
- error.message = "Missing required field";
1056
- error.details = invalidInput;
1057
- return Promise.reject(new FDKClientValidationError(error));
1058
- }
1059
-
1060
1031
  const query_params = {};
1061
1032
 
1062
1033
  const xHeaders = {};
@@ -1094,14 +1065,6 @@ class Content {
1094
1065
  { requestHeaders } = { requestHeaders: {} },
1095
1066
  { responseHeaders } = { responseHeaders: false }
1096
1067
  ) {
1097
- let invalidInput = [];
1098
- if (invalidInput.length) {
1099
- const error = new Error();
1100
- error.message = "Missing required field";
1101
- error.details = invalidInput;
1102
- return Promise.reject(new FDKClientValidationError(error));
1103
- }
1104
-
1105
1068
  const query_params = {};
1106
1069
 
1107
1070
  const xHeaders = {};
@@ -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
@@ -6,6 +6,7 @@ const {
6
6
  const ApplicationAPIClient = require("../ApplicationAPIClient");
7
7
  const constructUrl = require("../constructUrl");
8
8
  const Paginator = require("../../common/Paginator");
9
+ const { validateRequiredParams } = require("../../common/Validator");
9
10
 
10
11
  const { fdkAxios } = require("../../common/AxiosHelper.js");
11
12
 
@@ -47,18 +48,12 @@ class FileStorage {
47
48
  { namespace, body, requestHeaders } = { requestHeaders: {} },
48
49
  { responseHeaders } = { responseHeaders: false }
49
50
  ) {
50
- let invalidInput = [];
51
-
52
- if (!namespace) {
53
- invalidInput.push({
54
- message: `The 'namespace' field is required.`,
55
- path: ["namespace"],
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
56
  });
57
- }
58
- if (invalidInput.length) {
59
- const error = new Error();
60
- error.message = "Missing required field";
61
- error.details = invalidInput;
62
57
  return Promise.reject(new FDKClientValidationError(error));
63
58
  }
64
59
 
@@ -99,14 +94,6 @@ class FileStorage {
99
94
  { body, requestHeaders } = { requestHeaders: {} },
100
95
  { responseHeaders } = { responseHeaders: false }
101
96
  ) {
102
- let invalidInput = [];
103
- if (invalidInput.length) {
104
- const error = new Error();
105
- error.message = "Missing required field";
106
- error.details = invalidInput;
107
- return Promise.reject(new FDKClientValidationError(error));
108
- }
109
-
110
97
  const query_params = {};
111
98
 
112
99
  const xHeaders = {};
@@ -144,18 +131,12 @@ class FileStorage {
144
131
  { namespace, body, requestHeaders } = { requestHeaders: {} },
145
132
  { responseHeaders } = { responseHeaders: false }
146
133
  ) {
147
- let invalidInput = [];
148
-
149
- if (!namespace) {
150
- invalidInput.push({
151
- message: `The 'namespace' field is required.`,
152
- path: ["namespace"],
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,
153
139
  });
154
- }
155
- if (invalidInput.length) {
156
- const error = new Error();
157
- error.message = "Missing required field";
158
- error.details = invalidInput;
159
140
  return Promise.reject(new FDKClientValidationError(error));
160
141
  }
161
142