@gofynd/fdk-client-javascript 1.4.15-beta.4 → 1.4.15-beta.5

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 (26) hide show
  1. package/README.md +1 -1
  2. package/package.json +1 -1
  3. package/sdk/application/Cart/CartApplicationClient.js +277 -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 +243 -0
  9. package/sdk/application/FileStorage/FileStorageApplicationClient.js +43 -0
  10. package/sdk/application/Lead/LeadApplicationClient.js +73 -0
  11. package/sdk/application/Logistic/LogisticApplicationClient.js +153 -0
  12. package/sdk/application/Order/OrderApplicationClient.js +187 -0
  13. package/sdk/application/Payment/PaymentApplicationClient.js +427 -0
  14. package/sdk/application/Rewards/RewardsApplicationClient.js +68 -0
  15. package/sdk/application/Share/ShareApplicationClient.js +96 -0
  16. package/sdk/application/Theme/ThemeApplicationClient.js +64 -0
  17. package/sdk/application/User/UserApplicationClient.js +412 -0
  18. package/sdk/application/Webhook/WebhookApplicationClient.js +13 -0
  19. package/sdk/partner/Theme/ThemePartnerModel.d.ts +3 -40
  20. package/sdk/partner/Theme/ThemePartnerModel.js +2 -24
  21. package/sdk/platform/Theme/ThemePlatformModel.d.ts +3 -40
  22. package/sdk/platform/Theme/ThemePlatformModel.js +2 -24
  23. package/sdk/public/Configuration/ConfigurationPublicClient.js +16 -0
  24. package/sdk/public/Content/ContentPublicClient.js +15 -0
  25. package/sdk/public/Partner/PartnerPublicClient.js +15 -0
  26. package/sdk/public/Webhook/WebhookPublicClient.js +40 -0
@@ -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");
@@ -40,6 +45,21 @@ class Lead {
40
45
  { id, body, requestHeaders } = { requestHeaders: {} },
41
46
  { responseHeaders } = { responseHeaders: false }
42
47
  ) {
48
+ let invalidInput = [];
49
+
50
+ if (!id) {
51
+ invalidInput.push({
52
+ message: `The 'id' field is required.`,
53
+ path: ["id"],
54
+ });
55
+ }
56
+ if (invalidInput.length) {
57
+ const error = new Error();
58
+ error.message = "Missing required field";
59
+ error.details = invalidInput;
60
+ return Promise.reject(new FDKClientValidationError(error));
61
+ }
62
+
43
63
  const query_params = {};
44
64
 
45
65
  const xHeaders = {};
@@ -77,6 +97,14 @@ class Lead {
77
97
  { body, requestHeaders } = { requestHeaders: {} },
78
98
  { responseHeaders } = { responseHeaders: false }
79
99
  ) {
100
+ let invalidInput = [];
101
+ if (invalidInput.length) {
102
+ const error = new Error();
103
+ error.message = "Missing required field";
104
+ error.details = invalidInput;
105
+ return Promise.reject(new FDKClientValidationError(error));
106
+ }
107
+
80
108
  const query_params = {};
81
109
 
82
110
  const xHeaders = {};
@@ -114,6 +142,21 @@ class Lead {
114
142
  { slug, requestHeaders } = { requestHeaders: {} },
115
143
  { responseHeaders } = { responseHeaders: false }
116
144
  ) {
145
+ let invalidInput = [];
146
+
147
+ if (!slug) {
148
+ invalidInput.push({
149
+ message: `The 'slug' field is required.`,
150
+ path: ["slug"],
151
+ });
152
+ }
153
+ if (invalidInput.length) {
154
+ const error = new Error();
155
+ error.message = "Missing required field";
156
+ error.details = invalidInput;
157
+ return Promise.reject(new FDKClientValidationError(error));
158
+ }
159
+
117
160
  const query_params = {};
118
161
 
119
162
  const xHeaders = {};
@@ -151,6 +194,21 @@ class Lead {
151
194
  { id, requestHeaders } = { requestHeaders: {} },
152
195
  { responseHeaders } = { responseHeaders: false }
153
196
  ) {
197
+ let invalidInput = [];
198
+
199
+ if (!id) {
200
+ invalidInput.push({
201
+ message: `The 'id' field is required.`,
202
+ path: ["id"],
203
+ });
204
+ }
205
+ if (invalidInput.length) {
206
+ const error = new Error();
207
+ error.message = "Missing required field";
208
+ error.details = invalidInput;
209
+ return Promise.reject(new FDKClientValidationError(error));
210
+ }
211
+
154
212
  const query_params = {};
155
213
 
156
214
  const xHeaders = {};
@@ -188,6 +246,21 @@ class Lead {
188
246
  { slug, body, requestHeaders } = { requestHeaders: {} },
189
247
  { responseHeaders } = { responseHeaders: false }
190
248
  ) {
249
+ let invalidInput = [];
250
+
251
+ if (!slug) {
252
+ invalidInput.push({
253
+ message: `The 'slug' field is required.`,
254
+ path: ["slug"],
255
+ });
256
+ }
257
+ if (invalidInput.length) {
258
+ const error = new Error();
259
+ error.message = "Missing required field";
260
+ error.details = invalidInput;
261
+ return Promise.reject(new FDKClientValidationError(error));
262
+ }
263
+
191
264
  const query_params = {};
192
265
 
193
266
  const xHeaders = {};
@@ -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");
@@ -51,6 +56,14 @@ class Logistic {
51
56
  { requestHeaders } = { requestHeaders: {} },
52
57
  { responseHeaders } = { responseHeaders: false }
53
58
  ) {
59
+ let invalidInput = [];
60
+ if (invalidInput.length) {
61
+ const error = new Error();
62
+ error.message = "Missing required field";
63
+ error.details = invalidInput;
64
+ return Promise.reject(new FDKClientValidationError(error));
65
+ }
66
+
54
67
  const query_params = {};
55
68
 
56
69
  const xHeaders = {};
@@ -90,6 +103,14 @@ class Logistic {
90
103
  },
91
104
  { responseHeaders } = { responseHeaders: false }
92
105
  ) {
106
+ let invalidInput = [];
107
+ if (invalidInput.length) {
108
+ const error = new Error();
109
+ error.message = "Missing required field";
110
+ error.details = invalidInput;
111
+ return Promise.reject(new FDKClientValidationError(error));
112
+ }
113
+
93
114
  const query_params = {};
94
115
  query_params["onboarding"] = onboarding;
95
116
  query_params["page_no"] = pageNo;
@@ -131,6 +152,21 @@ class Logistic {
131
152
  { countryIsoCode, requestHeaders } = { requestHeaders: {} },
132
153
  { responseHeaders } = { responseHeaders: false }
133
154
  ) {
155
+ let invalidInput = [];
156
+
157
+ if (!countryIsoCode) {
158
+ invalidInput.push({
159
+ message: `The 'countryIsoCode' field is required.`,
160
+ path: ["countryIsoCode"],
161
+ });
162
+ }
163
+ if (invalidInput.length) {
164
+ const error = new Error();
165
+ error.message = "Missing required field";
166
+ error.details = invalidInput;
167
+ return Promise.reject(new FDKClientValidationError(error));
168
+ }
169
+
134
170
  const query_params = {};
135
171
 
136
172
  const xHeaders = {};
@@ -177,6 +213,21 @@ class Logistic {
177
213
  } = { requestHeaders: {} },
178
214
  { responseHeaders } = { responseHeaders: false }
179
215
  ) {
216
+ let invalidInput = [];
217
+
218
+ if (!localityType) {
219
+ invalidInput.push({
220
+ message: `The 'localityType' field is required.`,
221
+ path: ["localityType"],
222
+ });
223
+ }
224
+ if (invalidInput.length) {
225
+ const error = new Error();
226
+ error.message = "Missing required field";
227
+ error.details = invalidInput;
228
+ return Promise.reject(new FDKClientValidationError(error));
229
+ }
230
+
180
231
  const query_params = {};
181
232
  query_params["country"] = country;
182
233
  query_params["state"] = state;
@@ -222,6 +273,27 @@ class Logistic {
222
273
  },
223
274
  { responseHeaders } = { responseHeaders: false }
224
275
  ) {
276
+ let invalidInput = [];
277
+
278
+ if (!localityType) {
279
+ invalidInput.push({
280
+ message: `The 'localityType' field is required.`,
281
+ path: ["localityType"],
282
+ });
283
+ }
284
+ if (!localityValue) {
285
+ invalidInput.push({
286
+ message: `The 'localityValue' field is required.`,
287
+ path: ["localityValue"],
288
+ });
289
+ }
290
+ if (invalidInput.length) {
291
+ const error = new Error();
292
+ error.message = "Missing required field";
293
+ error.details = invalidInput;
294
+ return Promise.reject(new FDKClientValidationError(error));
295
+ }
296
+
225
297
  const query_params = {};
226
298
  query_params["country"] = country;
227
299
  query_params["state"] = state;
@@ -273,6 +345,27 @@ class Logistic {
273
345
  } = { requestHeaders: {} },
274
346
  { responseHeaders } = { responseHeaders: false }
275
347
  ) {
348
+ let invalidInput = [];
349
+
350
+ if (!xApplicationId) {
351
+ invalidInput.push({
352
+ message: `The 'xApplicationId' field is required.`,
353
+ path: ["xApplicationId"],
354
+ });
355
+ }
356
+ if (!xApplicationData) {
357
+ invalidInput.push({
358
+ message: `The 'xApplicationData' field is required.`,
359
+ path: ["xApplicationData"],
360
+ });
361
+ }
362
+ if (invalidInput.length) {
363
+ const error = new Error();
364
+ error.message = "Missing required field";
365
+ error.details = invalidInput;
366
+ return Promise.reject(new FDKClientValidationError(error));
367
+ }
368
+
276
369
  const query_params = {};
277
370
  query_params["x-application-id"] = xApplicationId;
278
371
  query_params["x-application-data"] = xApplicationData;
@@ -319,6 +412,14 @@ class Logistic {
319
412
  { body, requestHeaders } = { requestHeaders: {} },
320
413
  { responseHeaders } = { responseHeaders: false }
321
414
  ) {
415
+ let invalidInput = [];
416
+ if (invalidInput.length) {
417
+ const error = new Error();
418
+ error.message = "Missing required field";
419
+ error.details = invalidInput;
420
+ return Promise.reject(new FDKClientValidationError(error));
421
+ }
422
+
322
423
  const query_params = {};
323
424
 
324
425
  const xHeaders = {};
@@ -356,6 +457,21 @@ class Logistic {
356
457
  { pincode, requestHeaders } = { requestHeaders: {} },
357
458
  { responseHeaders } = { responseHeaders: false }
358
459
  ) {
460
+ let invalidInput = [];
461
+
462
+ if (!pincode) {
463
+ invalidInput.push({
464
+ message: `The 'pincode' field is required.`,
465
+ path: ["pincode"],
466
+ });
467
+ }
468
+ if (invalidInput.length) {
469
+ const error = new Error();
470
+ error.message = "Missing required field";
471
+ error.details = invalidInput;
472
+ return Promise.reject(new FDKClientValidationError(error));
473
+ }
474
+
359
475
  const query_params = {};
360
476
 
361
477
  const xHeaders = {};
@@ -393,6 +509,14 @@ class Logistic {
393
509
  { body, requestHeaders } = { requestHeaders: {} },
394
510
  { responseHeaders } = { responseHeaders: false }
395
511
  ) {
512
+ let invalidInput = [];
513
+ if (invalidInput.length) {
514
+ const error = new Error();
515
+ error.message = "Missing required field";
516
+ error.details = invalidInput;
517
+ return Promise.reject(new FDKClientValidationError(error));
518
+ }
519
+
396
520
  const query_params = {};
397
521
 
398
522
  const xHeaders = {};
@@ -430,6 +554,14 @@ class Logistic {
430
554
  { body, requestHeaders } = { requestHeaders: {} },
431
555
  { responseHeaders } = { responseHeaders: false }
432
556
  ) {
557
+ let invalidInput = [];
558
+ if (invalidInput.length) {
559
+ const error = new Error();
560
+ error.message = "Missing required field";
561
+ error.details = invalidInput;
562
+ return Promise.reject(new FDKClientValidationError(error));
563
+ }
564
+
433
565
  const query_params = {};
434
566
 
435
567
  const xHeaders = {};
@@ -469,6 +601,27 @@ class Logistic {
469
601
  },
470
602
  { responseHeaders } = { responseHeaders: false }
471
603
  ) {
604
+ let invalidInput = [];
605
+
606
+ if (!countryIsoCode) {
607
+ invalidInput.push({
608
+ message: `The 'countryIsoCode' field is required.`,
609
+ path: ["countryIsoCode"],
610
+ });
611
+ }
612
+ if (!templateName) {
613
+ invalidInput.push({
614
+ message: `The 'templateName' field is required.`,
615
+ path: ["templateName"],
616
+ });
617
+ }
618
+ if (invalidInput.length) {
619
+ const error = new Error();
620
+ error.message = "Missing required field";
621
+ error.details = invalidInput;
622
+ return Promise.reject(new FDKClientValidationError(error));
623
+ }
624
+
472
625
  const query_params = {};
473
626
 
474
627
  const xHeaders = {};
@@ -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");
@@ -55,6 +60,27 @@ class Order {
55
60
  { orderId, shipmentId, requestHeaders } = { requestHeaders: {} },
56
61
  { responseHeaders } = { responseHeaders: false }
57
62
  ) {
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"],
75
+ });
76
+ }
77
+ if (invalidInput.length) {
78
+ const error = new Error();
79
+ error.message = "Missing required field";
80
+ error.details = invalidInput;
81
+ return Promise.reject(new FDKClientValidationError(error));
82
+ }
83
+
58
84
  const query_params = {};
59
85
 
60
86
  const xHeaders = {};
@@ -92,6 +118,21 @@ class Order {
92
118
  { shipmentId, requestHeaders } = { requestHeaders: {} },
93
119
  { responseHeaders } = { responseHeaders: false }
94
120
  ) {
121
+ let invalidInput = [];
122
+
123
+ if (!shipmentId) {
124
+ invalidInput.push({
125
+ message: `The 'shipmentId' field is required.`,
126
+ path: ["shipmentId"],
127
+ });
128
+ }
129
+ if (invalidInput.length) {
130
+ const error = new Error();
131
+ error.message = "Missing required field";
132
+ error.details = invalidInput;
133
+ return Promise.reject(new FDKClientValidationError(error));
134
+ }
135
+
95
136
  const query_params = {};
96
137
 
97
138
  const xHeaders = {};
@@ -129,6 +170,21 @@ class Order {
129
170
  { orderId, allowInactive, requestHeaders } = { requestHeaders: {} },
130
171
  { responseHeaders } = { responseHeaders: false }
131
172
  ) {
173
+ let invalidInput = [];
174
+
175
+ if (!orderId) {
176
+ invalidInput.push({
177
+ message: `The 'orderId' field is required.`,
178
+ path: ["orderId"],
179
+ });
180
+ }
181
+ if (invalidInput.length) {
182
+ const error = new Error();
183
+ error.message = "Missing required field";
184
+ error.details = invalidInput;
185
+ return Promise.reject(new FDKClientValidationError(error));
186
+ }
187
+
132
188
  const query_params = {};
133
189
  query_params["allow_inactive"] = allowInactive;
134
190
 
@@ -178,6 +234,14 @@ class Order {
178
234
  } = { requestHeaders: {} },
179
235
  { responseHeaders } = { responseHeaders: false }
180
236
  ) {
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
+
181
245
  const query_params = {};
182
246
  query_params["status"] = status;
183
247
  query_params["page_no"] = pageNo;
@@ -224,6 +288,27 @@ class Order {
224
288
  { shipmentId, bagId, requestHeaders } = { requestHeaders: {} },
225
289
  { responseHeaders } = { responseHeaders: false }
226
290
  ) {
291
+ let invalidInput = [];
292
+
293
+ if (!shipmentId) {
294
+ invalidInput.push({
295
+ message: `The 'shipmentId' field is required.`,
296
+ path: ["shipmentId"],
297
+ });
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
+ return Promise.reject(new FDKClientValidationError(error));
310
+ }
311
+
227
312
  const query_params = {};
228
313
 
229
314
  const xHeaders = {};
@@ -261,6 +346,21 @@ class Order {
261
346
  { shipmentId, allowInactive, requestHeaders } = { requestHeaders: {} },
262
347
  { responseHeaders } = { responseHeaders: false }
263
348
  ) {
349
+ let invalidInput = [];
350
+
351
+ if (!shipmentId) {
352
+ invalidInput.push({
353
+ message: `The 'shipmentId' field is required.`,
354
+ path: ["shipmentId"],
355
+ });
356
+ }
357
+ if (invalidInput.length) {
358
+ const error = new Error();
359
+ error.message = "Missing required field";
360
+ error.details = invalidInput;
361
+ return Promise.reject(new FDKClientValidationError(error));
362
+ }
363
+
264
364
  const query_params = {};
265
365
  query_params["allow_inactive"] = allowInactive;
266
366
 
@@ -299,6 +399,21 @@ class Order {
299
399
  { shipmentId, requestHeaders } = { requestHeaders: {} },
300
400
  { responseHeaders } = { responseHeaders: false }
301
401
  ) {
402
+ let invalidInput = [];
403
+
404
+ if (!shipmentId) {
405
+ invalidInput.push({
406
+ message: `The 'shipmentId' field is required.`,
407
+ path: ["shipmentId"],
408
+ });
409
+ }
410
+ if (invalidInput.length) {
411
+ const error = new Error();
412
+ error.message = "Missing required field";
413
+ error.details = invalidInput;
414
+ return Promise.reject(new FDKClientValidationError(error));
415
+ }
416
+
302
417
  const query_params = {};
303
418
 
304
419
  const xHeaders = {};
@@ -336,6 +451,27 @@ class Order {
336
451
  { orderId, shipmentId, requestHeaders } = { requestHeaders: {} },
337
452
  { responseHeaders } = { responseHeaders: false }
338
453
  ) {
454
+ let invalidInput = [];
455
+
456
+ if (!orderId) {
457
+ invalidInput.push({
458
+ message: `The 'orderId' field is required.`,
459
+ path: ["orderId"],
460
+ });
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
+ return Promise.reject(new FDKClientValidationError(error));
473
+ }
474
+
339
475
  const query_params = {};
340
476
 
341
477
  const xHeaders = {};
@@ -373,6 +509,21 @@ class Order {
373
509
  { shipmentId, requestHeaders } = { requestHeaders: {} },
374
510
  { responseHeaders } = { responseHeaders: false }
375
511
  ) {
512
+ let invalidInput = [];
513
+
514
+ if (!shipmentId) {
515
+ invalidInput.push({
516
+ message: `The 'shipmentId' field is required.`,
517
+ path: ["shipmentId"],
518
+ });
519
+ }
520
+ if (invalidInput.length) {
521
+ const error = new Error();
522
+ error.message = "Missing required field";
523
+ error.details = invalidInput;
524
+ return Promise.reject(new FDKClientValidationError(error));
525
+ }
526
+
376
527
  const query_params = {};
377
528
 
378
529
  const xHeaders = {};
@@ -410,6 +561,21 @@ class Order {
410
561
  { shipmentId, body, requestHeaders } = { requestHeaders: {} },
411
562
  { responseHeaders } = { responseHeaders: false }
412
563
  ) {
564
+ let invalidInput = [];
565
+
566
+ if (!shipmentId) {
567
+ invalidInput.push({
568
+ message: `The 'shipmentId' field is required.`,
569
+ path: ["shipmentId"],
570
+ });
571
+ }
572
+ if (invalidInput.length) {
573
+ const error = new Error();
574
+ error.message = "Missing required field";
575
+ error.details = invalidInput;
576
+ return Promise.reject(new FDKClientValidationError(error));
577
+ }
578
+
413
579
  const query_params = {};
414
580
 
415
581
  const xHeaders = {};
@@ -447,6 +613,27 @@ class Order {
447
613
  { orderId, shipmentId, body, requestHeaders } = { requestHeaders: {} },
448
614
  { responseHeaders } = { responseHeaders: false }
449
615
  ) {
616
+ let invalidInput = [];
617
+
618
+ if (!orderId) {
619
+ invalidInput.push({
620
+ message: `The 'orderId' field is required.`,
621
+ path: ["orderId"],
622
+ });
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
+ return Promise.reject(new FDKClientValidationError(error));
635
+ }
636
+
450
637
  const query_params = {};
451
638
 
452
639
  const xHeaders = {};