@gofynd/fdk-client-javascript 1.5.2 → 1.6.1

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 (55) hide show
  1. package/README.md +1 -1
  2. package/package.json +1 -1
  3. package/sdk/application/Cart/CartApplicationClient.js +293 -0
  4. package/sdk/application/Catalog/CatalogApplicationClient.js +408 -0
  5. package/sdk/application/Common/CommonApplicationClient.js +21 -0
  6. package/sdk/application/Communication/CommunicationApplicationClient.js +29 -0
  7. package/sdk/application/Configuration/ConfigurationApplicationClient.js +147 -0
  8. package/sdk/application/Content/ContentApplicationClient.js +226 -0
  9. package/sdk/application/FileStorage/FileStorageApplicationClient.js +43 -0
  10. package/sdk/application/Finance/FinanceApplicationClient.js +21 -0
  11. package/sdk/application/Lead/LeadApplicationClient.js +73 -0
  12. package/sdk/application/Logistic/LogisticApplicationClient.d.ts +1 -1
  13. package/sdk/application/Logistic/LogisticApplicationClient.js +192 -3
  14. package/sdk/application/Order/OrderApplicationClient.js +202 -0
  15. package/sdk/application/Payment/PaymentApplicationClient.js +454 -0
  16. package/sdk/application/Rewards/RewardsApplicationClient.js +68 -0
  17. package/sdk/application/Share/ShareApplicationClient.js +96 -0
  18. package/sdk/application/Theme/ThemeApplicationClient.js +64 -0
  19. package/sdk/application/User/UserApplicationClient.js +412 -0
  20. package/sdk/application/Webhook/WebhookApplicationClient.js +13 -0
  21. package/sdk/partner/FileStorage/FileStoragePartnerClient.d.ts +10 -0
  22. package/sdk/partner/FileStorage/FileStoragePartnerClient.js +75 -0
  23. package/sdk/partner/FileStorage/FileStoragePartnerModel.d.ts +54 -1
  24. package/sdk/partner/FileStorage/FileStoragePartnerModel.js +43 -0
  25. package/sdk/partner/FileStorage/FileStoragePartnerValidator.d.ts +1 -0
  26. package/sdk/partner/FileStorage/FileStoragePartnerValidator.js +6 -0
  27. package/sdk/partner/Webhook/WebhookPartnerModel.d.ts +16 -3
  28. package/sdk/partner/Webhook/WebhookPartnerModel.js +5 -3
  29. package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.d.ts +4 -1
  30. package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.js +1 -1
  31. package/sdk/platform/AuditTrail/AuditTrailPlatformModel.d.ts +46 -23
  32. package/sdk/platform/AuditTrail/AuditTrailPlatformModel.js +12 -23
  33. package/sdk/platform/Cart/CartPlatformModel.d.ts +90 -1
  34. package/sdk/platform/Cart/CartPlatformModel.js +51 -0
  35. package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +0 -12
  36. package/sdk/platform/Content/ContentPlatformApplicationClient.js +0 -81
  37. package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +1 -10
  38. package/sdk/platform/Content/ContentPlatformApplicationValidator.js +0 -12
  39. package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +13 -0
  40. package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +82 -0
  41. package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +10 -1
  42. package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +12 -0
  43. package/sdk/platform/Payment/PaymentPlatformModel.d.ts +108 -1
  44. package/sdk/platform/Payment/PaymentPlatformModel.js +77 -0
  45. package/sdk/platform/User/UserPlatformModel.d.ts +2 -2
  46. package/sdk/platform/User/UserPlatformModel.js +2 -2
  47. package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +58 -14
  48. package/sdk/platform/Webhook/WebhookPlatformModel.js +15 -14
  49. package/sdk/public/Catalog/CatalogPublicClient.js +15 -0
  50. package/sdk/public/Configuration/ConfigurationPublicClient.js +16 -0
  51. package/sdk/public/Content/ContentPublicClient.js +116 -0
  52. package/sdk/public/Partner/PartnerPublicClient.js +15 -0
  53. package/sdk/public/Webhook/WebhookPublicClient.js +40 -0
  54. package/sdk/public/Webhook/WebhookPublicModel.d.ts +194 -46
  55. package/sdk/public/Webhook/WebhookPublicModel.js +51 -46
@@ -1,3 +1,8 @@
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");
@@ -57,6 +62,27 @@ class Order {
57
62
  { orderId, shipmentId, requestHeaders } = { requestHeaders: {} },
58
63
  { responseHeaders } = { responseHeaders: false }
59
64
  ) {
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"],
77
+ });
78
+ }
79
+ if (invalidInput.length) {
80
+ const error = new Error();
81
+ error.message = "Missing required field";
82
+ error.details = invalidInput;
83
+ return Promise.reject(new FDKClientValidationError(error));
84
+ }
85
+
60
86
  const query_params = {};
61
87
 
62
88
  const xHeaders = {};
@@ -94,6 +120,21 @@ class Order {
94
120
  { shipmentId, requestHeaders } = { requestHeaders: {} },
95
121
  { responseHeaders } = { responseHeaders: false }
96
122
  ) {
123
+ let invalidInput = [];
124
+
125
+ if (!shipmentId) {
126
+ invalidInput.push({
127
+ message: `The 'shipmentId' field is required.`,
128
+ path: ["shipmentId"],
129
+ });
130
+ }
131
+ if (invalidInput.length) {
132
+ const error = new Error();
133
+ error.message = "Missing required field";
134
+ error.details = invalidInput;
135
+ return Promise.reject(new FDKClientValidationError(error));
136
+ }
137
+
97
138
  const query_params = {};
98
139
 
99
140
  const xHeaders = {};
@@ -131,6 +172,21 @@ class Order {
131
172
  { orderId, allowInactive, requestHeaders } = { requestHeaders: {} },
132
173
  { responseHeaders } = { responseHeaders: false }
133
174
  ) {
175
+ let invalidInput = [];
176
+
177
+ if (!orderId) {
178
+ invalidInput.push({
179
+ message: `The 'orderId' field is required.`,
180
+ path: ["orderId"],
181
+ });
182
+ }
183
+ if (invalidInput.length) {
184
+ const error = new Error();
185
+ error.message = "Missing required field";
186
+ error.details = invalidInput;
187
+ return Promise.reject(new FDKClientValidationError(error));
188
+ }
189
+
134
190
  const query_params = {};
135
191
  query_params["allow_inactive"] = allowInactive;
136
192
 
@@ -180,6 +236,14 @@ class Order {
180
236
  } = { requestHeaders: {} },
181
237
  { responseHeaders } = { responseHeaders: false }
182
238
  ) {
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
+
183
247
  const query_params = {};
184
248
  query_params["status"] = status;
185
249
  query_params["page_no"] = pageNo;
@@ -226,6 +290,21 @@ class Order {
226
290
  { orderId, requestHeaders } = { requestHeaders: {} },
227
291
  { responseHeaders } = { responseHeaders: false }
228
292
  ) {
293
+ let invalidInput = [];
294
+
295
+ if (!orderId) {
296
+ invalidInput.push({
297
+ message: `The 'orderId' field is required.`,
298
+ path: ["orderId"],
299
+ });
300
+ }
301
+ if (invalidInput.length) {
302
+ const error = new Error();
303
+ error.message = "Missing required field";
304
+ error.details = invalidInput;
305
+ return Promise.reject(new FDKClientValidationError(error));
306
+ }
307
+
229
308
  const query_params = {};
230
309
 
231
310
  const xHeaders = {};
@@ -263,6 +342,27 @@ class Order {
263
342
  { shipmentId, bagId, requestHeaders } = { requestHeaders: {} },
264
343
  { responseHeaders } = { responseHeaders: false }
265
344
  ) {
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"],
357
+ });
358
+ }
359
+ if (invalidInput.length) {
360
+ const error = new Error();
361
+ error.message = "Missing required field";
362
+ error.details = invalidInput;
363
+ return Promise.reject(new FDKClientValidationError(error));
364
+ }
365
+
266
366
  const query_params = {};
267
367
 
268
368
  const xHeaders = {};
@@ -300,6 +400,21 @@ class Order {
300
400
  { shipmentId, allowInactive, requestHeaders } = { requestHeaders: {} },
301
401
  { responseHeaders } = { responseHeaders: false }
302
402
  ) {
403
+ let invalidInput = [];
404
+
405
+ if (!shipmentId) {
406
+ invalidInput.push({
407
+ message: `The 'shipmentId' field is required.`,
408
+ path: ["shipmentId"],
409
+ });
410
+ }
411
+ if (invalidInput.length) {
412
+ const error = new Error();
413
+ error.message = "Missing required field";
414
+ error.details = invalidInput;
415
+ return Promise.reject(new FDKClientValidationError(error));
416
+ }
417
+
303
418
  const query_params = {};
304
419
  query_params["allow_inactive"] = allowInactive;
305
420
 
@@ -338,6 +453,21 @@ class Order {
338
453
  { shipmentId, requestHeaders } = { requestHeaders: {} },
339
454
  { responseHeaders } = { responseHeaders: false }
340
455
  ) {
456
+ let invalidInput = [];
457
+
458
+ if (!shipmentId) {
459
+ invalidInput.push({
460
+ message: `The 'shipmentId' field is required.`,
461
+ path: ["shipmentId"],
462
+ });
463
+ }
464
+ if (invalidInput.length) {
465
+ const error = new Error();
466
+ error.message = "Missing required field";
467
+ error.details = invalidInput;
468
+ return Promise.reject(new FDKClientValidationError(error));
469
+ }
470
+
341
471
  const query_params = {};
342
472
 
343
473
  const xHeaders = {};
@@ -375,6 +505,27 @@ class Order {
375
505
  { orderId, shipmentId, requestHeaders } = { requestHeaders: {} },
376
506
  { responseHeaders } = { responseHeaders: false }
377
507
  ) {
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"],
520
+ });
521
+ }
522
+ if (invalidInput.length) {
523
+ const error = new Error();
524
+ error.message = "Missing required field";
525
+ error.details = invalidInput;
526
+ return Promise.reject(new FDKClientValidationError(error));
527
+ }
528
+
378
529
  const query_params = {};
379
530
 
380
531
  const xHeaders = {};
@@ -412,6 +563,21 @@ class Order {
412
563
  { shipmentId, requestHeaders } = { requestHeaders: {} },
413
564
  { responseHeaders } = { responseHeaders: false }
414
565
  ) {
566
+ let invalidInput = [];
567
+
568
+ if (!shipmentId) {
569
+ invalidInput.push({
570
+ message: `The 'shipmentId' field is required.`,
571
+ path: ["shipmentId"],
572
+ });
573
+ }
574
+ if (invalidInput.length) {
575
+ const error = new Error();
576
+ error.message = "Missing required field";
577
+ error.details = invalidInput;
578
+ return Promise.reject(new FDKClientValidationError(error));
579
+ }
580
+
415
581
  const query_params = {};
416
582
 
417
583
  const xHeaders = {};
@@ -449,6 +615,21 @@ class Order {
449
615
  { shipmentId, body, requestHeaders } = { requestHeaders: {} },
450
616
  { responseHeaders } = { responseHeaders: false }
451
617
  ) {
618
+ let invalidInput = [];
619
+
620
+ if (!shipmentId) {
621
+ invalidInput.push({
622
+ message: `The 'shipmentId' field is required.`,
623
+ path: ["shipmentId"],
624
+ });
625
+ }
626
+ if (invalidInput.length) {
627
+ const error = new Error();
628
+ error.message = "Missing required field";
629
+ error.details = invalidInput;
630
+ return Promise.reject(new FDKClientValidationError(error));
631
+ }
632
+
452
633
  const query_params = {};
453
634
 
454
635
  const xHeaders = {};
@@ -486,6 +667,27 @@ class Order {
486
667
  { orderId, shipmentId, body, requestHeaders } = { requestHeaders: {} },
487
668
  { responseHeaders } = { responseHeaders: false }
488
669
  ) {
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"],
682
+ });
683
+ }
684
+ if (invalidInput.length) {
685
+ const error = new Error();
686
+ error.message = "Missing required field";
687
+ error.details = invalidInput;
688
+ return Promise.reject(new FDKClientValidationError(error));
689
+ }
690
+
489
691
  const query_params = {};
490
692
 
491
693
  const xHeaders = {};