@gofynd/fdk-client-javascript 1.4.16-beta.1 → 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 (73) 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 +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 Order {
11
12
  constructor(_conf) {
@@ -62,24 +63,15 @@ class Order {
62
63
  { orderId, shipmentId, requestHeaders } = { requestHeaders: {} },
63
64
  { responseHeaders } = { responseHeaders: false }
64
65
  ) {
65
- let invalidInput = [];
66
-
67
- if (!orderId) {
68
- invalidInput.push({
69
- message: `The 'orderId' field is required.`,
70
- path: ["orderId"],
71
- });
72
- }
73
- if (!shipmentId) {
74
- invalidInput.push({
75
- message: `The 'shipmentId' field is required.`,
76
- path: ["shipmentId"],
66
+ const errors = validateRequiredParams(arguments[0], [
67
+ "orderId",
68
+ "shipmentId",
69
+ ]);
70
+ if (errors.length > 0) {
71
+ const error = new FDKClientValidationError({
72
+ message: "Missing required field",
73
+ details: errors,
77
74
  });
78
- }
79
- if (invalidInput.length) {
80
- const error = new Error();
81
- error.message = "Missing required field";
82
- error.details = invalidInput;
83
75
  return Promise.reject(new FDKClientValidationError(error));
84
76
  }
85
77
 
@@ -120,18 +112,12 @@ class Order {
120
112
  { shipmentId, requestHeaders } = { requestHeaders: {} },
121
113
  { responseHeaders } = { responseHeaders: false }
122
114
  ) {
123
- let invalidInput = [];
124
-
125
- if (!shipmentId) {
126
- invalidInput.push({
127
- message: `The 'shipmentId' field is required.`,
128
- path: ["shipmentId"],
115
+ const errors = validateRequiredParams(arguments[0], ["shipmentId"]);
116
+ if (errors.length > 0) {
117
+ const error = new FDKClientValidationError({
118
+ message: "Missing required field",
119
+ details: errors,
129
120
  });
130
- }
131
- if (invalidInput.length) {
132
- const error = new Error();
133
- error.message = "Missing required field";
134
- error.details = invalidInput;
135
121
  return Promise.reject(new FDKClientValidationError(error));
136
122
  }
137
123
 
@@ -172,18 +158,12 @@ class Order {
172
158
  { orderId, allowInactive, requestHeaders } = { requestHeaders: {} },
173
159
  { responseHeaders } = { responseHeaders: false }
174
160
  ) {
175
- let invalidInput = [];
176
-
177
- if (!orderId) {
178
- invalidInput.push({
179
- message: `The 'orderId' field is required.`,
180
- path: ["orderId"],
161
+ const errors = validateRequiredParams(arguments[0], ["orderId"]);
162
+ if (errors.length > 0) {
163
+ const error = new FDKClientValidationError({
164
+ message: "Missing required field",
165
+ details: errors,
181
166
  });
182
- }
183
- if (invalidInput.length) {
184
- const error = new Error();
185
- error.message = "Missing required field";
186
- error.details = invalidInput;
187
167
  return Promise.reject(new FDKClientValidationError(error));
188
168
  }
189
169
 
@@ -236,14 +216,6 @@ class Order {
236
216
  } = { requestHeaders: {} },
237
217
  { responseHeaders } = { responseHeaders: false }
238
218
  ) {
239
- let invalidInput = [];
240
- if (invalidInput.length) {
241
- const error = new Error();
242
- error.message = "Missing required field";
243
- error.details = invalidInput;
244
- return Promise.reject(new FDKClientValidationError(error));
245
- }
246
-
247
219
  const query_params = {};
248
220
  query_params["status"] = status;
249
221
  query_params["page_no"] = pageNo;
@@ -290,18 +262,12 @@ class Order {
290
262
  { orderId, requestHeaders } = { requestHeaders: {} },
291
263
  { responseHeaders } = { responseHeaders: false }
292
264
  ) {
293
- let invalidInput = [];
294
-
295
- if (!orderId) {
296
- invalidInput.push({
297
- message: `The 'orderId' field is required.`,
298
- path: ["orderId"],
265
+ const errors = validateRequiredParams(arguments[0], ["orderId"]);
266
+ if (errors.length > 0) {
267
+ const error = new FDKClientValidationError({
268
+ message: "Missing required field",
269
+ details: errors,
299
270
  });
300
- }
301
- if (invalidInput.length) {
302
- const error = new Error();
303
- error.message = "Missing required field";
304
- error.details = invalidInput;
305
271
  return Promise.reject(new FDKClientValidationError(error));
306
272
  }
307
273
 
@@ -342,24 +308,15 @@ class Order {
342
308
  { shipmentId, bagId, requestHeaders } = { requestHeaders: {} },
343
309
  { responseHeaders } = { responseHeaders: false }
344
310
  ) {
345
- let invalidInput = [];
346
-
347
- if (!shipmentId) {
348
- invalidInput.push({
349
- message: `The 'shipmentId' field is required.`,
350
- path: ["shipmentId"],
351
- });
352
- }
353
- if (!bagId) {
354
- invalidInput.push({
355
- message: `The 'bagId' field is required.`,
356
- path: ["bagId"],
311
+ const errors = validateRequiredParams(arguments[0], [
312
+ "shipmentId",
313
+ "bagId",
314
+ ]);
315
+ if (errors.length > 0) {
316
+ const error = new FDKClientValidationError({
317
+ message: "Missing required field",
318
+ details: errors,
357
319
  });
358
- }
359
- if (invalidInput.length) {
360
- const error = new Error();
361
- error.message = "Missing required field";
362
- error.details = invalidInput;
363
320
  return Promise.reject(new FDKClientValidationError(error));
364
321
  }
365
322
 
@@ -400,18 +357,12 @@ class Order {
400
357
  { shipmentId, allowInactive, requestHeaders } = { requestHeaders: {} },
401
358
  { responseHeaders } = { responseHeaders: false }
402
359
  ) {
403
- let invalidInput = [];
404
-
405
- if (!shipmentId) {
406
- invalidInput.push({
407
- message: `The 'shipmentId' field is required.`,
408
- path: ["shipmentId"],
360
+ const errors = validateRequiredParams(arguments[0], ["shipmentId"]);
361
+ if (errors.length > 0) {
362
+ const error = new FDKClientValidationError({
363
+ message: "Missing required field",
364
+ details: errors,
409
365
  });
410
- }
411
- if (invalidInput.length) {
412
- const error = new Error();
413
- error.message = "Missing required field";
414
- error.details = invalidInput;
415
366
  return Promise.reject(new FDKClientValidationError(error));
416
367
  }
417
368
 
@@ -453,18 +404,12 @@ class Order {
453
404
  { shipmentId, requestHeaders } = { requestHeaders: {} },
454
405
  { responseHeaders } = { responseHeaders: false }
455
406
  ) {
456
- let invalidInput = [];
457
-
458
- if (!shipmentId) {
459
- invalidInput.push({
460
- message: `The 'shipmentId' field is required.`,
461
- path: ["shipmentId"],
407
+ const errors = validateRequiredParams(arguments[0], ["shipmentId"]);
408
+ if (errors.length > 0) {
409
+ const error = new FDKClientValidationError({
410
+ message: "Missing required field",
411
+ details: errors,
462
412
  });
463
- }
464
- if (invalidInput.length) {
465
- const error = new Error();
466
- error.message = "Missing required field";
467
- error.details = invalidInput;
468
413
  return Promise.reject(new FDKClientValidationError(error));
469
414
  }
470
415
 
@@ -505,24 +450,15 @@ class Order {
505
450
  { orderId, shipmentId, requestHeaders } = { requestHeaders: {} },
506
451
  { responseHeaders } = { responseHeaders: false }
507
452
  ) {
508
- let invalidInput = [];
509
-
510
- if (!orderId) {
511
- invalidInput.push({
512
- message: `The 'orderId' field is required.`,
513
- path: ["orderId"],
514
- });
515
- }
516
- if (!shipmentId) {
517
- invalidInput.push({
518
- message: `The 'shipmentId' field is required.`,
519
- path: ["shipmentId"],
453
+ const errors = validateRequiredParams(arguments[0], [
454
+ "orderId",
455
+ "shipmentId",
456
+ ]);
457
+ if (errors.length > 0) {
458
+ const error = new FDKClientValidationError({
459
+ message: "Missing required field",
460
+ details: errors,
520
461
  });
521
- }
522
- if (invalidInput.length) {
523
- const error = new Error();
524
- error.message = "Missing required field";
525
- error.details = invalidInput;
526
462
  return Promise.reject(new FDKClientValidationError(error));
527
463
  }
528
464
 
@@ -563,18 +499,12 @@ class Order {
563
499
  { shipmentId, requestHeaders } = { requestHeaders: {} },
564
500
  { responseHeaders } = { responseHeaders: false }
565
501
  ) {
566
- let invalidInput = [];
567
-
568
- if (!shipmentId) {
569
- invalidInput.push({
570
- message: `The 'shipmentId' field is required.`,
571
- path: ["shipmentId"],
502
+ const errors = validateRequiredParams(arguments[0], ["shipmentId"]);
503
+ if (errors.length > 0) {
504
+ const error = new FDKClientValidationError({
505
+ message: "Missing required field",
506
+ details: errors,
572
507
  });
573
- }
574
- if (invalidInput.length) {
575
- const error = new Error();
576
- error.message = "Missing required field";
577
- error.details = invalidInput;
578
508
  return Promise.reject(new FDKClientValidationError(error));
579
509
  }
580
510
 
@@ -615,18 +545,12 @@ class Order {
615
545
  { shipmentId, body, requestHeaders } = { requestHeaders: {} },
616
546
  { responseHeaders } = { responseHeaders: false }
617
547
  ) {
618
- let invalidInput = [];
619
-
620
- if (!shipmentId) {
621
- invalidInput.push({
622
- message: `The 'shipmentId' field is required.`,
623
- path: ["shipmentId"],
548
+ const errors = validateRequiredParams(arguments[0], ["shipmentId"]);
549
+ if (errors.length > 0) {
550
+ const error = new FDKClientValidationError({
551
+ message: "Missing required field",
552
+ details: errors,
624
553
  });
625
- }
626
- if (invalidInput.length) {
627
- const error = new Error();
628
- error.message = "Missing required field";
629
- error.details = invalidInput;
630
554
  return Promise.reject(new FDKClientValidationError(error));
631
555
  }
632
556
 
@@ -667,24 +591,15 @@ class Order {
667
591
  { orderId, shipmentId, body, requestHeaders } = { requestHeaders: {} },
668
592
  { responseHeaders } = { responseHeaders: false }
669
593
  ) {
670
- let invalidInput = [];
671
-
672
- if (!orderId) {
673
- invalidInput.push({
674
- message: `The 'orderId' field is required.`,
675
- path: ["orderId"],
676
- });
677
- }
678
- if (!shipmentId) {
679
- invalidInput.push({
680
- message: `The 'shipmentId' field is required.`,
681
- path: ["shipmentId"],
594
+ const errors = validateRequiredParams(arguments[0], [
595
+ "orderId",
596
+ "shipmentId",
597
+ ]);
598
+ if (errors.length > 0) {
599
+ const error = new FDKClientValidationError({
600
+ message: "Missing required field",
601
+ details: errors,
682
602
  });
683
- }
684
- if (invalidInput.length) {
685
- const error = new Error();
686
- error.message = "Missing required field";
687
- error.details = invalidInput;
688
603
  return Promise.reject(new FDKClientValidationError(error));
689
604
  }
690
605
 
@@ -96,7 +96,7 @@ declare class Payment {
96
96
  * @summary: Get card details
97
97
  * @description: Get details of a specified payment card, including information such as the card type, brand, country, and expiration date. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/payment/cardDetails/).
98
98
  */
99
- cardDetails({ cardInfo, aggregator, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<CardDetailsFetchedDetails>;
99
+ cardDetails({ cardInfo, aggregator, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options, ...args: any[]): Promise<CardDetailsFetchedDetails>;
100
100
  /**
101
101
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
102
102
  * @param {import("../ApplicationAPIClient").Options} - Options