@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.
- package/README.md +1 -1
- package/package.json +1 -1
- package/sdk/application/Cart/CartApplicationClient.d.ts +5 -5
- package/sdk/application/Cart/CartApplicationClient.js +26 -252
- package/sdk/application/Catalog/CatalogApplicationClient.d.ts +16 -16
- package/sdk/application/Catalog/CatalogApplicationClient.js +90 -339
- package/sdk/application/Common/CommonApplicationClient.js +1 -16
- package/sdk/application/Communication/CommunicationApplicationClient.js +1 -24
- package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +2 -2
- package/sdk/application/Configuration/ConfigurationApplicationClient.js +11 -134
- package/sdk/application/Content/ContentApplicationClient.d.ts +8 -8
- package/sdk/application/Content/ContentApplicationClient.js +44 -206
- package/sdk/application/FileStorage/FileStorageApplicationClient.d.ts +5 -3
- package/sdk/application/FileStorage/FileStorageApplicationClient.js +14 -30
- package/sdk/application/Lead/LeadApplicationClient.d.ts +4 -4
- package/sdk/application/Lead/LeadApplicationClient.js +21 -52
- package/sdk/application/Logistic/LogisticApplicationClient.d.ts +5 -5
- package/sdk/application/Logistic/LogisticApplicationClient.js +32 -128
- package/sdk/application/Order/OrderApplicationClient.d.ts +10 -10
- package/sdk/application/Order/OrderApplicationClient.js +63 -142
- package/sdk/application/Payment/PaymentApplicationClient.d.ts +1 -1
- package/sdk/application/Payment/PaymentApplicationClient.js +6 -418
- package/sdk/application/Rewards/RewardsApplicationClient.d.ts +1 -1
- package/sdk/application/Rewards/RewardsApplicationClient.js +6 -59
- package/sdk/application/Share/ShareApplicationClient.d.ts +4 -4
- package/sdk/application/Share/ShareApplicationClient.js +21 -75
- package/sdk/application/Theme/ThemeApplicationClient.d.ts +3 -3
- package/sdk/application/Theme/ThemeApplicationClient.js +19 -47
- package/sdk/application/User/UserApplicationClient.js +1 -407
- package/sdk/application/Webhook/WebhookApplicationClient.js +1 -8
- package/sdk/common/Utility.d.ts +1 -1
- package/sdk/common/Utility.js +10 -7
- package/sdk/common/Validator.d.ts +1 -0
- package/sdk/common/Validator.js +20 -0
- package/sdk/common/utils.d.ts +0 -1
- package/sdk/common/utils.js +0 -14
- package/sdk/partner/FileStorage/FileStoragePartnerModel.d.ts +2 -0
- package/sdk/partner/FileStorage/FileStoragePartnerModel.js +2 -0
- package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +7 -0
- package/sdk/platform/Configuration/ConfigurationPlatformModel.js +3 -0
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +3 -1
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +3 -0
- package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +3 -1
- package/sdk/platform/FileStorage/FileStoragePlatformClient.js +3 -0
- package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +16 -1
- package/sdk/platform/FileStorage/FileStoragePlatformModel.js +20 -0
- package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +0 -10
- package/sdk/platform/Order/OrderPlatformApplicationClient.js +0 -92
- package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +1 -28
- package/sdk/platform/Order/OrderPlatformApplicationValidator.js +0 -18
- package/sdk/platform/Order/OrderPlatformClient.d.ts +10 -0
- package/sdk/platform/Order/OrderPlatformClient.js +99 -0
- package/sdk/platform/Order/OrderPlatformValidator.d.ts +33 -1
- package/sdk/platform/Order/OrderPlatformValidator.js +20 -0
- package/sdk/public/Configuration/ConfigurationPublicClient.js +1 -16
- package/sdk/public/Content/ContentPublicClient.d.ts +1 -1
- package/sdk/public/Content/ContentPublicClient.js +6 -11
- package/sdk/public/Partner/PartnerPublicClient.d.ts +1 -1
- package/sdk/public/Partner/PartnerPublicClient.js +6 -11
- 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) {
|
|
@@ -66,14 +67,6 @@ class Content {
|
|
|
66
67
|
{ requestHeaders } = { requestHeaders: {} },
|
|
67
68
|
{ responseHeaders } = { responseHeaders: false }
|
|
68
69
|
) {
|
|
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
70
|
const query_params = {};
|
|
78
71
|
|
|
79
72
|
const xHeaders = {};
|
|
@@ -111,18 +104,12 @@ class Content {
|
|
|
111
104
|
{ slug, rootId, requestHeaders } = { requestHeaders: {} },
|
|
112
105
|
{ responseHeaders } = { responseHeaders: false }
|
|
113
106
|
) {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
path: ["slug"],
|
|
107
|
+
const errors = validateRequiredParams(arguments[0], ["slug"]);
|
|
108
|
+
if (errors.length > 0) {
|
|
109
|
+
const error = new FDKClientValidationError({
|
|
110
|
+
message: "Missing required field",
|
|
111
|
+
details: errors,
|
|
120
112
|
});
|
|
121
|
-
}
|
|
122
|
-
if (invalidInput.length) {
|
|
123
|
-
const error = new Error();
|
|
124
|
-
error.message = "Missing required field";
|
|
125
|
-
error.details = invalidInput;
|
|
126
113
|
return Promise.reject(new FDKClientValidationError(error));
|
|
127
114
|
}
|
|
128
115
|
|
|
@@ -164,14 +151,6 @@ class Content {
|
|
|
164
151
|
{ pageNo, pageSize, tags, search, requestHeaders } = { requestHeaders: {} },
|
|
165
152
|
{ responseHeaders } = { responseHeaders: false }
|
|
166
153
|
) {
|
|
167
|
-
let invalidInput = [];
|
|
168
|
-
if (invalidInput.length) {
|
|
169
|
-
const error = new Error();
|
|
170
|
-
error.message = "Missing required field";
|
|
171
|
-
error.details = invalidInput;
|
|
172
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
173
|
-
}
|
|
174
|
-
|
|
175
154
|
const query_params = {};
|
|
176
155
|
query_params["page_no"] = pageNo;
|
|
177
156
|
query_params["page_size"] = pageSize;
|
|
@@ -213,24 +192,15 @@ class Content {
|
|
|
213
192
|
{ resource, resourceId, requestHeaders } = { requestHeaders: {} },
|
|
214
193
|
{ responseHeaders } = { responseHeaders: false }
|
|
215
194
|
) {
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
if (!resourceId) {
|
|
225
|
-
invalidInput.push({
|
|
226
|
-
message: `The 'resourceId' field is required.`,
|
|
227
|
-
path: ["resourceId"],
|
|
195
|
+
const errors = validateRequiredParams(arguments[0], [
|
|
196
|
+
"resource",
|
|
197
|
+
"resourceId",
|
|
198
|
+
]);
|
|
199
|
+
if (errors.length > 0) {
|
|
200
|
+
const error = new FDKClientValidationError({
|
|
201
|
+
message: "Missing required field",
|
|
202
|
+
details: errors,
|
|
228
203
|
});
|
|
229
|
-
}
|
|
230
|
-
if (invalidInput.length) {
|
|
231
|
-
const error = new Error();
|
|
232
|
-
error.message = "Missing required field";
|
|
233
|
-
error.details = invalidInput;
|
|
234
204
|
return Promise.reject(new FDKClientValidationError(error));
|
|
235
205
|
}
|
|
236
206
|
|
|
@@ -271,18 +241,12 @@ class Content {
|
|
|
271
241
|
{ metaobjectId, requestHeaders } = { requestHeaders: {} },
|
|
272
242
|
{ responseHeaders } = { responseHeaders: false }
|
|
273
243
|
) {
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
path: ["metaobjectId"],
|
|
244
|
+
const errors = validateRequiredParams(arguments[0], ["metaobjectId"]);
|
|
245
|
+
if (errors.length > 0) {
|
|
246
|
+
const error = new FDKClientValidationError({
|
|
247
|
+
message: "Missing required field",
|
|
248
|
+
details: errors,
|
|
280
249
|
});
|
|
281
|
-
}
|
|
282
|
-
if (invalidInput.length) {
|
|
283
|
-
const error = new Error();
|
|
284
|
-
error.message = "Missing required field";
|
|
285
|
-
error.details = invalidInput;
|
|
286
250
|
return Promise.reject(new FDKClientValidationError(error));
|
|
287
251
|
}
|
|
288
252
|
|
|
@@ -323,14 +287,6 @@ class Content {
|
|
|
323
287
|
{ requestHeaders } = { requestHeaders: {} },
|
|
324
288
|
{ responseHeaders } = { responseHeaders: false }
|
|
325
289
|
) {
|
|
326
|
-
let invalidInput = [];
|
|
327
|
-
if (invalidInput.length) {
|
|
328
|
-
const error = new Error();
|
|
329
|
-
error.message = "Missing required field";
|
|
330
|
-
error.details = invalidInput;
|
|
331
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
332
|
-
}
|
|
333
|
-
|
|
334
290
|
const query_params = {};
|
|
335
291
|
|
|
336
292
|
const xHeaders = {};
|
|
@@ -368,18 +324,12 @@ class Content {
|
|
|
368
324
|
{ slug, requestHeaders } = { requestHeaders: {} },
|
|
369
325
|
{ responseHeaders } = { responseHeaders: false }
|
|
370
326
|
) {
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
path: ["slug"],
|
|
327
|
+
const errors = validateRequiredParams(arguments[0], ["slug"]);
|
|
328
|
+
if (errors.length > 0) {
|
|
329
|
+
const error = new FDKClientValidationError({
|
|
330
|
+
message: "Missing required field",
|
|
331
|
+
details: errors,
|
|
377
332
|
});
|
|
378
|
-
}
|
|
379
|
-
if (invalidInput.length) {
|
|
380
|
-
const error = new Error();
|
|
381
|
-
error.message = "Missing required field";
|
|
382
|
-
error.details = invalidInput;
|
|
383
333
|
return Promise.reject(new FDKClientValidationError(error));
|
|
384
334
|
}
|
|
385
335
|
|
|
@@ -420,14 +370,6 @@ class Content {
|
|
|
420
370
|
{ requestHeaders } = { requestHeaders: {} },
|
|
421
371
|
{ responseHeaders } = { responseHeaders: false }
|
|
422
372
|
) {
|
|
423
|
-
let invalidInput = [];
|
|
424
|
-
if (invalidInput.length) {
|
|
425
|
-
const error = new Error();
|
|
426
|
-
error.message = "Missing required field";
|
|
427
|
-
error.details = invalidInput;
|
|
428
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
429
|
-
}
|
|
430
|
-
|
|
431
373
|
const query_params = {};
|
|
432
374
|
|
|
433
375
|
const xHeaders = {};
|
|
@@ -465,18 +407,12 @@ class Content {
|
|
|
465
407
|
{ slug, requestHeaders } = { requestHeaders: {} },
|
|
466
408
|
{ responseHeaders } = { responseHeaders: false }
|
|
467
409
|
) {
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
path: ["slug"],
|
|
410
|
+
const errors = validateRequiredParams(arguments[0], ["slug"]);
|
|
411
|
+
if (errors.length > 0) {
|
|
412
|
+
const error = new FDKClientValidationError({
|
|
413
|
+
message: "Missing required field",
|
|
414
|
+
details: errors,
|
|
474
415
|
});
|
|
475
|
-
}
|
|
476
|
-
if (invalidInput.length) {
|
|
477
|
-
const error = new Error();
|
|
478
|
-
error.message = "Missing required field";
|
|
479
|
-
error.details = invalidInput;
|
|
480
416
|
return Promise.reject(new FDKClientValidationError(error));
|
|
481
417
|
}
|
|
482
418
|
|
|
@@ -517,14 +453,6 @@ class Content {
|
|
|
517
453
|
{ requestHeaders } = { requestHeaders: {} },
|
|
518
454
|
{ responseHeaders } = { responseHeaders: false }
|
|
519
455
|
) {
|
|
520
|
-
let invalidInput = [];
|
|
521
|
-
if (invalidInput.length) {
|
|
522
|
-
const error = new Error();
|
|
523
|
-
error.message = "Missing required field";
|
|
524
|
-
error.details = invalidInput;
|
|
525
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
526
|
-
}
|
|
527
|
-
|
|
528
456
|
const query_params = {};
|
|
529
457
|
|
|
530
458
|
const xHeaders = {};
|
|
@@ -562,18 +490,12 @@ class Content {
|
|
|
562
490
|
{ slug, requestHeaders } = { requestHeaders: {} },
|
|
563
491
|
{ responseHeaders } = { responseHeaders: false }
|
|
564
492
|
) {
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
path: ["slug"],
|
|
493
|
+
const errors = validateRequiredParams(arguments[0], ["slug"]);
|
|
494
|
+
if (errors.length > 0) {
|
|
495
|
+
const error = new FDKClientValidationError({
|
|
496
|
+
message: "Missing required field",
|
|
497
|
+
details: errors,
|
|
571
498
|
});
|
|
572
|
-
}
|
|
573
|
-
if (invalidInput.length) {
|
|
574
|
-
const error = new Error();
|
|
575
|
-
error.message = "Missing required field";
|
|
576
|
-
error.details = invalidInput;
|
|
577
499
|
return Promise.reject(new FDKClientValidationError(error));
|
|
578
500
|
}
|
|
579
501
|
|
|
@@ -614,14 +536,6 @@ class Content {
|
|
|
614
536
|
{ requestHeaders } = { requestHeaders: {} },
|
|
615
537
|
{ responseHeaders } = { responseHeaders: false }
|
|
616
538
|
) {
|
|
617
|
-
let invalidInput = [];
|
|
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
|
-
|
|
625
539
|
const query_params = {};
|
|
626
540
|
|
|
627
541
|
const xHeaders = {};
|
|
@@ -659,14 +573,6 @@ class Content {
|
|
|
659
573
|
{ requestHeaders } = { requestHeaders: {} },
|
|
660
574
|
{ responseHeaders } = { responseHeaders: false }
|
|
661
575
|
) {
|
|
662
|
-
let invalidInput = [];
|
|
663
|
-
if (invalidInput.length) {
|
|
664
|
-
const error = new Error();
|
|
665
|
-
error.message = "Missing required field";
|
|
666
|
-
error.details = invalidInput;
|
|
667
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
668
|
-
}
|
|
669
|
-
|
|
670
576
|
const query_params = {};
|
|
671
577
|
|
|
672
578
|
const xHeaders = {};
|
|
@@ -704,14 +610,6 @@ class Content {
|
|
|
704
610
|
{ pageNo, pageSize, requestHeaders } = { requestHeaders: {} },
|
|
705
611
|
{ responseHeaders } = { responseHeaders: false }
|
|
706
612
|
) {
|
|
707
|
-
let invalidInput = [];
|
|
708
|
-
if (invalidInput.length) {
|
|
709
|
-
const error = new Error();
|
|
710
|
-
error.message = "Missing required field";
|
|
711
|
-
error.details = invalidInput;
|
|
712
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
713
|
-
}
|
|
714
|
-
|
|
715
613
|
const query_params = {};
|
|
716
614
|
query_params["page_no"] = pageNo;
|
|
717
615
|
query_params["page_size"] = pageSize;
|
|
@@ -751,18 +649,12 @@ class Content {
|
|
|
751
649
|
{ slug, rootId, requestHeaders } = { requestHeaders: {} },
|
|
752
650
|
{ responseHeaders } = { responseHeaders: false }
|
|
753
651
|
) {
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
path: ["slug"],
|
|
652
|
+
const errors = validateRequiredParams(arguments[0], ["slug"]);
|
|
653
|
+
if (errors.length > 0) {
|
|
654
|
+
const error = new FDKClientValidationError({
|
|
655
|
+
message: "Missing required field",
|
|
656
|
+
details: errors,
|
|
760
657
|
});
|
|
761
|
-
}
|
|
762
|
-
if (invalidInput.length) {
|
|
763
|
-
const error = new Error();
|
|
764
|
-
error.message = "Missing required field";
|
|
765
|
-
error.details = invalidInput;
|
|
766
658
|
return Promise.reject(new FDKClientValidationError(error));
|
|
767
659
|
}
|
|
768
660
|
|
|
@@ -804,14 +696,6 @@ class Content {
|
|
|
804
696
|
{ pageNo, pageSize, requestHeaders } = { requestHeaders: {} },
|
|
805
697
|
{ responseHeaders } = { responseHeaders: false }
|
|
806
698
|
) {
|
|
807
|
-
let invalidInput = [];
|
|
808
|
-
if (invalidInput.length) {
|
|
809
|
-
const error = new Error();
|
|
810
|
-
error.message = "Missing required field";
|
|
811
|
-
error.details = invalidInput;
|
|
812
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
813
|
-
}
|
|
814
|
-
|
|
815
699
|
const query_params = {};
|
|
816
700
|
query_params["page_no"] = pageNo;
|
|
817
701
|
query_params["page_size"] = pageSize;
|
|
@@ -851,14 +735,6 @@ class Content {
|
|
|
851
735
|
{ requestHeaders } = { requestHeaders: {} },
|
|
852
736
|
{ responseHeaders } = { responseHeaders: false }
|
|
853
737
|
) {
|
|
854
|
-
let invalidInput = [];
|
|
855
|
-
if (invalidInput.length) {
|
|
856
|
-
const error = new Error();
|
|
857
|
-
error.message = "Missing required field";
|
|
858
|
-
error.details = invalidInput;
|
|
859
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
860
|
-
}
|
|
861
|
-
|
|
862
738
|
const query_params = {};
|
|
863
739
|
|
|
864
740
|
const xHeaders = {};
|
|
@@ -896,14 +772,6 @@ class Content {
|
|
|
896
772
|
{ pageType, active, requestHeaders } = { requestHeaders: {} },
|
|
897
773
|
{ responseHeaders } = { responseHeaders: false }
|
|
898
774
|
) {
|
|
899
|
-
let invalidInput = [];
|
|
900
|
-
if (invalidInput.length) {
|
|
901
|
-
const error = new Error();
|
|
902
|
-
error.message = "Missing required field";
|
|
903
|
-
error.details = invalidInput;
|
|
904
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
905
|
-
}
|
|
906
|
-
|
|
907
775
|
const query_params = {};
|
|
908
776
|
query_params["page_type"] = pageType;
|
|
909
777
|
query_params["active"] = active;
|
|
@@ -943,18 +811,12 @@ class Content {
|
|
|
943
811
|
{ slug, requestHeaders } = { requestHeaders: {} },
|
|
944
812
|
{ responseHeaders } = { responseHeaders: false }
|
|
945
813
|
) {
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
path: ["slug"],
|
|
814
|
+
const errors = validateRequiredParams(arguments[0], ["slug"]);
|
|
815
|
+
if (errors.length > 0) {
|
|
816
|
+
const error = new FDKClientValidationError({
|
|
817
|
+
message: "Missing required field",
|
|
818
|
+
details: errors,
|
|
952
819
|
});
|
|
953
|
-
}
|
|
954
|
-
if (invalidInput.length) {
|
|
955
|
-
const error = new Error();
|
|
956
|
-
error.message = "Missing required field";
|
|
957
|
-
error.details = invalidInput;
|
|
958
820
|
return Promise.reject(new FDKClientValidationError(error));
|
|
959
821
|
}
|
|
960
822
|
|
|
@@ -995,14 +857,6 @@ class Content {
|
|
|
995
857
|
{ pageNo, pageSize, requestHeaders } = { requestHeaders: {} },
|
|
996
858
|
{ responseHeaders } = { responseHeaders: false }
|
|
997
859
|
) {
|
|
998
|
-
let invalidInput = [];
|
|
999
|
-
if (invalidInput.length) {
|
|
1000
|
-
const error = new Error();
|
|
1001
|
-
error.message = "Missing required field";
|
|
1002
|
-
error.details = invalidInput;
|
|
1003
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
1004
|
-
}
|
|
1005
|
-
|
|
1006
860
|
const query_params = {};
|
|
1007
861
|
query_params["page_no"] = pageNo;
|
|
1008
862
|
query_params["page_size"] = pageSize;
|
|
@@ -1069,14 +923,6 @@ class Content {
|
|
|
1069
923
|
{ requestHeaders } = { requestHeaders: {} },
|
|
1070
924
|
{ responseHeaders } = { responseHeaders: false }
|
|
1071
925
|
) {
|
|
1072
|
-
let invalidInput = [];
|
|
1073
|
-
if (invalidInput.length) {
|
|
1074
|
-
const error = new Error();
|
|
1075
|
-
error.message = "Missing required field";
|
|
1076
|
-
error.details = invalidInput;
|
|
1077
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
1078
|
-
}
|
|
1079
|
-
|
|
1080
926
|
const query_params = {};
|
|
1081
927
|
|
|
1082
928
|
const xHeaders = {};
|
|
@@ -1114,14 +960,6 @@ class Content {
|
|
|
1114
960
|
{ requestHeaders } = { requestHeaders: {} },
|
|
1115
961
|
{ responseHeaders } = { responseHeaders: false }
|
|
1116
962
|
) {
|
|
1117
|
-
let invalidInput = [];
|
|
1118
|
-
if (invalidInput.length) {
|
|
1119
|
-
const error = new Error();
|
|
1120
|
-
error.message = "Missing required field";
|
|
1121
|
-
error.details = invalidInput;
|
|
1122
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
1123
|
-
}
|
|
1124
|
-
|
|
1125
963
|
const query_params = {};
|
|
1126
964
|
|
|
1127
965
|
const xHeaders = {};
|
|
@@ -17,7 +17,7 @@ declare class FileStorage {
|
|
|
17
17
|
* @summary: Complete file upload
|
|
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<CompleteResponse>;
|
|
20
|
+
completeUpload({ namespace, body, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options, ...args: any[]): Promise<CompleteResponse>;
|
|
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<StartResponse>;
|
|
38
|
+
startUpload({ namespace, body, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options, ...args: any[]): Promise<StartResponse>;
|
|
39
39
|
/**
|
|
40
40
|
* @param data
|
|
41
41
|
* @param {string} file_name
|
|
@@ -43,13 +43,15 @@ declare class FileStorage {
|
|
|
43
43
|
* @param {string} namespace
|
|
44
44
|
* @param {number} size
|
|
45
45
|
* @param {number} tags
|
|
46
|
+
* @param {string} enc_key
|
|
46
47
|
*/
|
|
47
|
-
upload({ data, file_name, content_type, namespace, size, tags, }?: {
|
|
48
|
+
upload({ data, file_name, content_type, namespace, size, tags, enc_key, }?: {
|
|
48
49
|
data: any;
|
|
49
50
|
file_name: any;
|
|
50
51
|
content_type: any;
|
|
51
52
|
namespace: any;
|
|
52
53
|
size: any;
|
|
53
54
|
tags: any;
|
|
55
|
+
enc_key: any;
|
|
54
56
|
}): Promise<any>;
|
|
55
57
|
}
|
|
@@ -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
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
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
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
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
|
|
|
@@ -192,6 +173,7 @@ class FileStorage {
|
|
|
192
173
|
* @param {string} namespace
|
|
193
174
|
* @param {number} size
|
|
194
175
|
* @param {number} tags
|
|
176
|
+
* @param {string} enc_key
|
|
195
177
|
*/
|
|
196
178
|
FileStorage.prototype.upload = function ({
|
|
197
179
|
data,
|
|
@@ -200,6 +182,7 @@ FileStorage.prototype.upload = function ({
|
|
|
200
182
|
namespace,
|
|
201
183
|
size,
|
|
202
184
|
tags,
|
|
185
|
+
enc_key,
|
|
203
186
|
} = {}) {
|
|
204
187
|
return new Promise(async (resolve, reject) => {
|
|
205
188
|
try {
|
|
@@ -210,6 +193,7 @@ FileStorage.prototype.upload = function ({
|
|
|
210
193
|
content_type,
|
|
211
194
|
size: size,
|
|
212
195
|
tags: tags,
|
|
196
|
+
enc_key: enc_key,
|
|
213
197
|
},
|
|
214
198
|
});
|
|
215
199
|
if (dataObj.upload && dataObj.upload.url) {
|
|
@@ -19,7 +19,7 @@ declare class Lead {
|
|
|
19
19
|
* @summary: Log ticket history
|
|
20
20
|
* @description: Create a history entry for a specific support ticket. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/lead/createHistory/).
|
|
21
21
|
*/
|
|
22
|
-
createHistory({ id, body, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<TicketHistory>;
|
|
22
|
+
createHistory({ id, body, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options, ...args: any[]): Promise<TicketHistory>;
|
|
23
23
|
/**
|
|
24
24
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
25
25
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
@@ -37,7 +37,7 @@ declare class Lead {
|
|
|
37
37
|
* @summary: Get custom form
|
|
38
38
|
* @description: Get a customizable form template for data collection. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/lead/getCustomForm/).
|
|
39
39
|
*/
|
|
40
|
-
getCustomForm({ slug, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<CustomForm>;
|
|
40
|
+
getCustomForm({ slug, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options, ...args: any[]): Promise<CustomForm>;
|
|
41
41
|
/**
|
|
42
42
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
43
43
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
@@ -46,7 +46,7 @@ declare class Lead {
|
|
|
46
46
|
* @summary: Get a support ticket
|
|
47
47
|
* @description: Get details of a specific customer support ticket. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/lead/getTicket/).
|
|
48
48
|
*/
|
|
49
|
-
getTicket({ id, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<Ticket>;
|
|
49
|
+
getTicket({ id, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options, ...args: any[]): Promise<Ticket>;
|
|
50
50
|
/**
|
|
51
51
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
52
52
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
@@ -55,5 +55,5 @@ declare class Lead {
|
|
|
55
55
|
* @summary: Submits form data
|
|
56
56
|
* @description: Create user-entered data from a custom form for processing. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/lead/submitCustomForm/).
|
|
57
57
|
*/
|
|
58
|
-
submitCustomForm({ slug, body, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<SubmitCustomFormResponse>;
|
|
58
|
+
submitCustomForm({ slug, body, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options, ...args: any[]): Promise<SubmitCustomFormResponse>;
|
|
59
59
|
}
|