@gofynd/fdk-client-javascript 1.4.15-beta.7 → 1.4.15-beta.8

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 (60) 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 -252
  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 +8 -8
  12. package/sdk/application/Content/ContentApplicationClient.js +44 -206
  13. package/sdk/application/FileStorage/FileStorageApplicationClient.d.ts +5 -3
  14. package/sdk/application/FileStorage/FileStorageApplicationClient.js +14 -30
  15. package/sdk/application/Lead/LeadApplicationClient.d.ts +4 -4
  16. package/sdk/application/Lead/LeadApplicationClient.js +21 -52
  17. package/sdk/application/Logistic/LogisticApplicationClient.d.ts +5 -5
  18. package/sdk/application/Logistic/LogisticApplicationClient.js +32 -128
  19. package/sdk/application/Order/OrderApplicationClient.d.ts +10 -10
  20. package/sdk/application/Order/OrderApplicationClient.js +63 -142
  21. package/sdk/application/Payment/PaymentApplicationClient.d.ts +1 -1
  22. package/sdk/application/Payment/PaymentApplicationClient.js +6 -418
  23. package/sdk/application/Rewards/RewardsApplicationClient.d.ts +1 -1
  24. package/sdk/application/Rewards/RewardsApplicationClient.js +6 -59
  25. package/sdk/application/Share/ShareApplicationClient.d.ts +4 -4
  26. package/sdk/application/Share/ShareApplicationClient.js +21 -75
  27. package/sdk/application/Theme/ThemeApplicationClient.d.ts +3 -3
  28. package/sdk/application/Theme/ThemeApplicationClient.js +19 -47
  29. package/sdk/application/User/UserApplicationClient.js +1 -407
  30. package/sdk/application/Webhook/WebhookApplicationClient.js +1 -8
  31. package/sdk/common/Utility.d.ts +1 -1
  32. package/sdk/common/Utility.js +10 -7
  33. package/sdk/common/Validator.d.ts +1 -0
  34. package/sdk/common/Validator.js +20 -0
  35. package/sdk/common/utils.d.ts +0 -1
  36. package/sdk/common/utils.js +0 -14
  37. package/sdk/partner/FileStorage/FileStoragePartnerModel.d.ts +2 -0
  38. package/sdk/partner/FileStorage/FileStoragePartnerModel.js +2 -0
  39. package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +7 -0
  40. package/sdk/platform/Configuration/ConfigurationPlatformModel.js +3 -0
  41. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +3 -1
  42. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +3 -0
  43. package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +3 -1
  44. package/sdk/platform/FileStorage/FileStoragePlatformClient.js +3 -0
  45. package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +16 -1
  46. package/sdk/platform/FileStorage/FileStoragePlatformModel.js +20 -0
  47. package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +0 -10
  48. package/sdk/platform/Order/OrderPlatformApplicationClient.js +0 -92
  49. package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +1 -28
  50. package/sdk/platform/Order/OrderPlatformApplicationValidator.js +0 -18
  51. package/sdk/platform/Order/OrderPlatformClient.d.ts +10 -0
  52. package/sdk/platform/Order/OrderPlatformClient.js +99 -0
  53. package/sdk/platform/Order/OrderPlatformValidator.d.ts +33 -1
  54. package/sdk/platform/Order/OrderPlatformValidator.js +20 -0
  55. package/sdk/public/Configuration/ConfigurationPublicClient.js +1 -16
  56. package/sdk/public/Content/ContentPublicClient.d.ts +1 -1
  57. package/sdk/public/Content/ContentPublicClient.js +6 -11
  58. package/sdk/public/Partner/PartnerPublicClient.d.ts +1 -1
  59. package/sdk/public/Partner/PartnerPublicClient.js +6 -11
  60. 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) {
@@ -60,24 +61,15 @@ class Order {
60
61
  { orderId, shipmentId, requestHeaders } = { requestHeaders: {} },
61
62
  { responseHeaders } = { responseHeaders: false }
62
63
  ) {
63
- let invalidInput = [];
64
-
65
- if (!orderId) {
66
- invalidInput.push({
67
- message: `The 'orderId' field is required.`,
68
- path: ["orderId"],
69
- });
70
- }
71
- if (!shipmentId) {
72
- invalidInput.push({
73
- message: `The 'shipmentId' field is required.`,
74
- path: ["shipmentId"],
64
+ const errors = validateRequiredParams(arguments[0], [
65
+ "orderId",
66
+ "shipmentId",
67
+ ]);
68
+ if (errors.length > 0) {
69
+ const error = new FDKClientValidationError({
70
+ message: "Missing required field",
71
+ details: errors,
75
72
  });
76
- }
77
- if (invalidInput.length) {
78
- const error = new Error();
79
- error.message = "Missing required field";
80
- error.details = invalidInput;
81
73
  return Promise.reject(new FDKClientValidationError(error));
82
74
  }
83
75
 
@@ -118,18 +110,12 @@ class Order {
118
110
  { shipmentId, requestHeaders } = { requestHeaders: {} },
119
111
  { responseHeaders } = { responseHeaders: false }
120
112
  ) {
121
- let invalidInput = [];
122
-
123
- if (!shipmentId) {
124
- invalidInput.push({
125
- message: `The 'shipmentId' field is required.`,
126
- path: ["shipmentId"],
113
+ const errors = validateRequiredParams(arguments[0], ["shipmentId"]);
114
+ if (errors.length > 0) {
115
+ const error = new FDKClientValidationError({
116
+ message: "Missing required field",
117
+ details: errors,
127
118
  });
128
- }
129
- if (invalidInput.length) {
130
- const error = new Error();
131
- error.message = "Missing required field";
132
- error.details = invalidInput;
133
119
  return Promise.reject(new FDKClientValidationError(error));
134
120
  }
135
121
 
@@ -170,18 +156,12 @@ class Order {
170
156
  { orderId, allowInactive, requestHeaders } = { requestHeaders: {} },
171
157
  { responseHeaders } = { responseHeaders: false }
172
158
  ) {
173
- let invalidInput = [];
174
-
175
- if (!orderId) {
176
- invalidInput.push({
177
- message: `The 'orderId' field is required.`,
178
- path: ["orderId"],
159
+ const errors = validateRequiredParams(arguments[0], ["orderId"]);
160
+ if (errors.length > 0) {
161
+ const error = new FDKClientValidationError({
162
+ message: "Missing required field",
163
+ details: errors,
179
164
  });
180
- }
181
- if (invalidInput.length) {
182
- const error = new Error();
183
- error.message = "Missing required field";
184
- error.details = invalidInput;
185
165
  return Promise.reject(new FDKClientValidationError(error));
186
166
  }
187
167
 
@@ -234,14 +214,6 @@ class Order {
234
214
  } = { requestHeaders: {} },
235
215
  { responseHeaders } = { responseHeaders: false }
236
216
  ) {
237
- let invalidInput = [];
238
- if (invalidInput.length) {
239
- const error = new Error();
240
- error.message = "Missing required field";
241
- error.details = invalidInput;
242
- return Promise.reject(new FDKClientValidationError(error));
243
- }
244
-
245
217
  const query_params = {};
246
218
  query_params["status"] = status;
247
219
  query_params["page_no"] = pageNo;
@@ -288,24 +260,15 @@ class Order {
288
260
  { shipmentId, bagId, requestHeaders } = { requestHeaders: {} },
289
261
  { responseHeaders } = { responseHeaders: false }
290
262
  ) {
291
- let invalidInput = [];
292
-
293
- if (!shipmentId) {
294
- invalidInput.push({
295
- message: `The 'shipmentId' field is required.`,
296
- path: ["shipmentId"],
263
+ const errors = validateRequiredParams(arguments[0], [
264
+ "shipmentId",
265
+ "bagId",
266
+ ]);
267
+ if (errors.length > 0) {
268
+ const error = new FDKClientValidationError({
269
+ message: "Missing required field",
270
+ details: errors,
297
271
  });
298
- }
299
- if (!bagId) {
300
- invalidInput.push({
301
- message: `The 'bagId' field is required.`,
302
- path: ["bagId"],
303
- });
304
- }
305
- if (invalidInput.length) {
306
- const error = new Error();
307
- error.message = "Missing required field";
308
- error.details = invalidInput;
309
272
  return Promise.reject(new FDKClientValidationError(error));
310
273
  }
311
274
 
@@ -346,18 +309,12 @@ class Order {
346
309
  { shipmentId, allowInactive, requestHeaders } = { requestHeaders: {} },
347
310
  { responseHeaders } = { responseHeaders: false }
348
311
  ) {
349
- let invalidInput = [];
350
-
351
- if (!shipmentId) {
352
- invalidInput.push({
353
- message: `The 'shipmentId' field is required.`,
354
- path: ["shipmentId"],
312
+ const errors = validateRequiredParams(arguments[0], ["shipmentId"]);
313
+ if (errors.length > 0) {
314
+ const error = new FDKClientValidationError({
315
+ message: "Missing required field",
316
+ details: errors,
355
317
  });
356
- }
357
- if (invalidInput.length) {
358
- const error = new Error();
359
- error.message = "Missing required field";
360
- error.details = invalidInput;
361
318
  return Promise.reject(new FDKClientValidationError(error));
362
319
  }
363
320
 
@@ -399,18 +356,12 @@ class Order {
399
356
  { shipmentId, requestHeaders } = { requestHeaders: {} },
400
357
  { responseHeaders } = { responseHeaders: false }
401
358
  ) {
402
- let invalidInput = [];
403
-
404
- if (!shipmentId) {
405
- invalidInput.push({
406
- message: `The 'shipmentId' field is required.`,
407
- path: ["shipmentId"],
359
+ const errors = validateRequiredParams(arguments[0], ["shipmentId"]);
360
+ if (errors.length > 0) {
361
+ const error = new FDKClientValidationError({
362
+ message: "Missing required field",
363
+ details: errors,
408
364
  });
409
- }
410
- if (invalidInput.length) {
411
- const error = new Error();
412
- error.message = "Missing required field";
413
- error.details = invalidInput;
414
365
  return Promise.reject(new FDKClientValidationError(error));
415
366
  }
416
367
 
@@ -451,24 +402,15 @@ class Order {
451
402
  { orderId, shipmentId, requestHeaders } = { requestHeaders: {} },
452
403
  { responseHeaders } = { responseHeaders: false }
453
404
  ) {
454
- let invalidInput = [];
455
-
456
- if (!orderId) {
457
- invalidInput.push({
458
- message: `The 'orderId' field is required.`,
459
- path: ["orderId"],
405
+ const errors = validateRequiredParams(arguments[0], [
406
+ "orderId",
407
+ "shipmentId",
408
+ ]);
409
+ if (errors.length > 0) {
410
+ const error = new FDKClientValidationError({
411
+ message: "Missing required field",
412
+ details: errors,
460
413
  });
461
- }
462
- if (!shipmentId) {
463
- invalidInput.push({
464
- message: `The 'shipmentId' field is required.`,
465
- path: ["shipmentId"],
466
- });
467
- }
468
- if (invalidInput.length) {
469
- const error = new Error();
470
- error.message = "Missing required field";
471
- error.details = invalidInput;
472
414
  return Promise.reject(new FDKClientValidationError(error));
473
415
  }
474
416
 
@@ -509,18 +451,12 @@ class Order {
509
451
  { shipmentId, requestHeaders } = { requestHeaders: {} },
510
452
  { responseHeaders } = { responseHeaders: false }
511
453
  ) {
512
- let invalidInput = [];
513
-
514
- if (!shipmentId) {
515
- invalidInput.push({
516
- message: `The 'shipmentId' field is required.`,
517
- path: ["shipmentId"],
454
+ const errors = validateRequiredParams(arguments[0], ["shipmentId"]);
455
+ if (errors.length > 0) {
456
+ const error = new FDKClientValidationError({
457
+ message: "Missing required field",
458
+ details: errors,
518
459
  });
519
- }
520
- if (invalidInput.length) {
521
- const error = new Error();
522
- error.message = "Missing required field";
523
- error.details = invalidInput;
524
460
  return Promise.reject(new FDKClientValidationError(error));
525
461
  }
526
462
 
@@ -561,18 +497,12 @@ class Order {
561
497
  { shipmentId, body, requestHeaders } = { requestHeaders: {} },
562
498
  { responseHeaders } = { responseHeaders: false }
563
499
  ) {
564
- let invalidInput = [];
565
-
566
- if (!shipmentId) {
567
- invalidInput.push({
568
- message: `The 'shipmentId' field is required.`,
569
- path: ["shipmentId"],
500
+ const errors = validateRequiredParams(arguments[0], ["shipmentId"]);
501
+ if (errors.length > 0) {
502
+ const error = new FDKClientValidationError({
503
+ message: "Missing required field",
504
+ details: errors,
570
505
  });
571
- }
572
- if (invalidInput.length) {
573
- const error = new Error();
574
- error.message = "Missing required field";
575
- error.details = invalidInput;
576
506
  return Promise.reject(new FDKClientValidationError(error));
577
507
  }
578
508
 
@@ -613,24 +543,15 @@ class Order {
613
543
  { orderId, shipmentId, body, requestHeaders } = { requestHeaders: {} },
614
544
  { responseHeaders } = { responseHeaders: false }
615
545
  ) {
616
- let invalidInput = [];
617
-
618
- if (!orderId) {
619
- invalidInput.push({
620
- message: `The 'orderId' field is required.`,
621
- path: ["orderId"],
546
+ const errors = validateRequiredParams(arguments[0], [
547
+ "orderId",
548
+ "shipmentId",
549
+ ]);
550
+ if (errors.length > 0) {
551
+ const error = new FDKClientValidationError({
552
+ message: "Missing required field",
553
+ details: errors,
622
554
  });
623
- }
624
- if (!shipmentId) {
625
- invalidInput.push({
626
- message: `The 'shipmentId' field is required.`,
627
- path: ["shipmentId"],
628
- });
629
- }
630
- if (invalidInput.length) {
631
- const error = new Error();
632
- error.message = "Missing required field";
633
- error.details = invalidInput;
634
555
  return Promise.reject(new FDKClientValidationError(error));
635
556
  }
636
557
 
@@ -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<CardDetailsResponse>;
99
+ cardDetails({ cardInfo, aggregator, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options, ...args: any[]): Promise<CardDetailsResponse>;
100
100
  /**
101
101
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
102
102
  * @param {import("../ApplicationAPIClient").Options} - Options