@gofynd/fdk-client-javascript 1.4.15-beta.6 → 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/platform/Serviceability/ServiceabilityPlatformApplicationClient.d.ts +0 -10
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.js +0 -118
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.d.ts +1 -53
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.js +0 -29
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +10 -0
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +119 -0
- package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.d.ts +58 -1
- package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.js +30 -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 Catalog {
|
|
11
12
|
constructor(_conf) {
|
|
@@ -90,24 +91,15 @@ class Catalog {
|
|
|
90
91
|
{ collectionType, collectionId, requestHeaders } = { requestHeaders: {} },
|
|
91
92
|
{ responseHeaders } = { responseHeaders: false }
|
|
92
93
|
) {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
if (!collectionId) {
|
|
102
|
-
invalidInput.push({
|
|
103
|
-
message: `The 'collectionId' field is required.`,
|
|
104
|
-
path: ["collectionId"],
|
|
94
|
+
const errors = validateRequiredParams(arguments[0], [
|
|
95
|
+
"collectionType",
|
|
96
|
+
"collectionId",
|
|
97
|
+
]);
|
|
98
|
+
if (errors.length > 0) {
|
|
99
|
+
const error = new FDKClientValidationError({
|
|
100
|
+
message: "Missing required field",
|
|
101
|
+
details: errors,
|
|
105
102
|
});
|
|
106
|
-
}
|
|
107
|
-
if (invalidInput.length) {
|
|
108
|
-
const error = new Error();
|
|
109
|
-
error.message = "Missing required field";
|
|
110
|
-
error.details = invalidInput;
|
|
111
103
|
return Promise.reject(new FDKClientValidationError(error));
|
|
112
104
|
}
|
|
113
105
|
|
|
@@ -148,18 +140,12 @@ class Catalog {
|
|
|
148
140
|
{ slug, requestHeaders } = { requestHeaders: {} },
|
|
149
141
|
{ responseHeaders } = { responseHeaders: false }
|
|
150
142
|
) {
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
path: ["slug"],
|
|
143
|
+
const errors = validateRequiredParams(arguments[0], ["slug"]);
|
|
144
|
+
if (errors.length > 0) {
|
|
145
|
+
const error = new FDKClientValidationError({
|
|
146
|
+
message: "Missing required field",
|
|
147
|
+
details: errors,
|
|
157
148
|
});
|
|
158
|
-
}
|
|
159
|
-
if (invalidInput.length) {
|
|
160
|
-
const error = new Error();
|
|
161
|
-
error.message = "Missing required field";
|
|
162
|
-
error.details = invalidInput;
|
|
163
149
|
return Promise.reject(new FDKClientValidationError(error));
|
|
164
150
|
}
|
|
165
151
|
|
|
@@ -200,14 +186,6 @@ class Catalog {
|
|
|
200
186
|
{ department, pageNo, pageSize, requestHeaders } = { requestHeaders: {} },
|
|
201
187
|
{ responseHeaders } = { responseHeaders: false }
|
|
202
188
|
) {
|
|
203
|
-
let invalidInput = [];
|
|
204
|
-
if (invalidInput.length) {
|
|
205
|
-
const error = new Error();
|
|
206
|
-
error.message = "Missing required field";
|
|
207
|
-
error.details = invalidInput;
|
|
208
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
209
|
-
}
|
|
210
|
-
|
|
211
189
|
const query_params = {};
|
|
212
190
|
query_params["department"] = department;
|
|
213
191
|
query_params["page_no"] = pageNo;
|
|
@@ -280,14 +258,6 @@ class Catalog {
|
|
|
280
258
|
{ department, requestHeaders } = { requestHeaders: {} },
|
|
281
259
|
{ responseHeaders } = { responseHeaders: false }
|
|
282
260
|
) {
|
|
283
|
-
let invalidInput = [];
|
|
284
|
-
if (invalidInput.length) {
|
|
285
|
-
const error = new Error();
|
|
286
|
-
error.message = "Missing required field";
|
|
287
|
-
error.details = invalidInput;
|
|
288
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
289
|
-
}
|
|
290
|
-
|
|
291
261
|
const query_params = {};
|
|
292
262
|
query_params["department"] = department;
|
|
293
263
|
|
|
@@ -326,18 +296,12 @@ class Catalog {
|
|
|
326
296
|
{ slug, requestHeaders } = { requestHeaders: {} },
|
|
327
297
|
{ responseHeaders } = { responseHeaders: false }
|
|
328
298
|
) {
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
path: ["slug"],
|
|
299
|
+
const errors = validateRequiredParams(arguments[0], ["slug"]);
|
|
300
|
+
if (errors.length > 0) {
|
|
301
|
+
const error = new FDKClientValidationError({
|
|
302
|
+
message: "Missing required field",
|
|
303
|
+
details: errors,
|
|
335
304
|
});
|
|
336
|
-
}
|
|
337
|
-
if (invalidInput.length) {
|
|
338
|
-
const error = new Error();
|
|
339
|
-
error.message = "Missing required field";
|
|
340
|
-
error.details = invalidInput;
|
|
341
305
|
return Promise.reject(new FDKClientValidationError(error));
|
|
342
306
|
}
|
|
343
307
|
|
|
@@ -378,18 +342,12 @@ class Catalog {
|
|
|
378
342
|
{ slug, requestHeaders } = { requestHeaders: {} },
|
|
379
343
|
{ responseHeaders } = { responseHeaders: false }
|
|
380
344
|
) {
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
path: ["slug"],
|
|
345
|
+
const errors = validateRequiredParams(arguments[0], ["slug"]);
|
|
346
|
+
if (errors.length > 0) {
|
|
347
|
+
const error = new FDKClientValidationError({
|
|
348
|
+
message: "Missing required field",
|
|
349
|
+
details: errors,
|
|
387
350
|
});
|
|
388
|
-
}
|
|
389
|
-
if (invalidInput.length) {
|
|
390
|
-
const error = new Error();
|
|
391
|
-
error.message = "Missing required field";
|
|
392
|
-
error.details = invalidInput;
|
|
393
351
|
return Promise.reject(new FDKClientValidationError(error));
|
|
394
352
|
}
|
|
395
353
|
|
|
@@ -441,18 +399,12 @@ class Catalog {
|
|
|
441
399
|
} = { requestHeaders: {} },
|
|
442
400
|
{ responseHeaders } = { responseHeaders: false }
|
|
443
401
|
) {
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
path: ["slug"],
|
|
402
|
+
const errors = validateRequiredParams(arguments[0], ["slug"]);
|
|
403
|
+
if (errors.length > 0) {
|
|
404
|
+
const error = new FDKClientValidationError({
|
|
405
|
+
message: "Missing required field",
|
|
406
|
+
details: errors,
|
|
450
407
|
});
|
|
451
|
-
}
|
|
452
|
-
if (invalidInput.length) {
|
|
453
|
-
const error = new Error();
|
|
454
|
-
error.message = "Missing required field";
|
|
455
|
-
error.details = invalidInput;
|
|
456
408
|
return Promise.reject(new FDKClientValidationError(error));
|
|
457
409
|
}
|
|
458
410
|
|
|
@@ -556,14 +508,6 @@ class Catalog {
|
|
|
556
508
|
{ pageNo, pageSize, tag, q, requestHeaders } = { requestHeaders: {} },
|
|
557
509
|
{ responseHeaders } = { responseHeaders: false }
|
|
558
510
|
) {
|
|
559
|
-
let invalidInput = [];
|
|
560
|
-
if (invalidInput.length) {
|
|
561
|
-
const error = new Error();
|
|
562
|
-
error.message = "Missing required field";
|
|
563
|
-
error.details = invalidInput;
|
|
564
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
565
|
-
}
|
|
566
|
-
|
|
567
511
|
const query_params = {};
|
|
568
512
|
query_params["page_no"] = pageNo;
|
|
569
513
|
query_params["page_size"] = pageSize;
|
|
@@ -636,18 +580,12 @@ class Catalog {
|
|
|
636
580
|
{ slug, requestHeaders } = { requestHeaders: {} },
|
|
637
581
|
{ responseHeaders } = { responseHeaders: false }
|
|
638
582
|
) {
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
path: ["slug"],
|
|
583
|
+
const errors = validateRequiredParams(arguments[0], ["slug"]);
|
|
584
|
+
if (errors.length > 0) {
|
|
585
|
+
const error = new FDKClientValidationError({
|
|
586
|
+
message: "Missing required field",
|
|
587
|
+
details: errors,
|
|
645
588
|
});
|
|
646
|
-
}
|
|
647
|
-
if (invalidInput.length) {
|
|
648
|
-
const error = new Error();
|
|
649
|
-
error.message = "Missing required field";
|
|
650
|
-
error.details = invalidInput;
|
|
651
589
|
return Promise.reject(new FDKClientValidationError(error));
|
|
652
590
|
}
|
|
653
591
|
|
|
@@ -688,14 +626,6 @@ class Catalog {
|
|
|
688
626
|
{ requestHeaders } = { requestHeaders: {} },
|
|
689
627
|
{ responseHeaders } = { responseHeaders: false }
|
|
690
628
|
) {
|
|
691
|
-
let invalidInput = [];
|
|
692
|
-
if (invalidInput.length) {
|
|
693
|
-
const error = new Error();
|
|
694
|
-
error.message = "Missing required field";
|
|
695
|
-
error.details = invalidInput;
|
|
696
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
697
|
-
}
|
|
698
|
-
|
|
699
629
|
const query_params = {};
|
|
700
630
|
|
|
701
631
|
const xHeaders = {};
|
|
@@ -733,14 +663,6 @@ class Catalog {
|
|
|
733
663
|
{ collectionType, requestHeaders } = { requestHeaders: {} },
|
|
734
664
|
{ responseHeaders } = { responseHeaders: false }
|
|
735
665
|
) {
|
|
736
|
-
let invalidInput = [];
|
|
737
|
-
if (invalidInput.length) {
|
|
738
|
-
const error = new Error();
|
|
739
|
-
error.message = "Missing required field";
|
|
740
|
-
error.details = invalidInput;
|
|
741
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
742
|
-
}
|
|
743
|
-
|
|
744
666
|
const query_params = {};
|
|
745
667
|
query_params["collection_type"] = collectionType;
|
|
746
668
|
|
|
@@ -781,18 +703,12 @@ class Catalog {
|
|
|
781
703
|
},
|
|
782
704
|
{ responseHeaders } = { responseHeaders: false }
|
|
783
705
|
) {
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
path: ["collectionType"],
|
|
706
|
+
const errors = validateRequiredParams(arguments[0], ["collectionType"]);
|
|
707
|
+
if (errors.length > 0) {
|
|
708
|
+
const error = new FDKClientValidationError({
|
|
709
|
+
message: "Missing required field",
|
|
710
|
+
details: errors,
|
|
790
711
|
});
|
|
791
|
-
}
|
|
792
|
-
if (invalidInput.length) {
|
|
793
|
-
const error = new Error();
|
|
794
|
-
error.message = "Missing required field";
|
|
795
|
-
error.details = invalidInput;
|
|
796
712
|
return Promise.reject(new FDKClientValidationError(error));
|
|
797
713
|
}
|
|
798
714
|
|
|
@@ -865,24 +781,15 @@ class Catalog {
|
|
|
865
781
|
{ collectionType, collectionId, requestHeaders } = { requestHeaders: {} },
|
|
866
782
|
{ responseHeaders } = { responseHeaders: false }
|
|
867
783
|
) {
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
if (!collectionId) {
|
|
877
|
-
invalidInput.push({
|
|
878
|
-
message: `The 'collectionId' field is required.`,
|
|
879
|
-
path: ["collectionId"],
|
|
784
|
+
const errors = validateRequiredParams(arguments[0], [
|
|
785
|
+
"collectionType",
|
|
786
|
+
"collectionId",
|
|
787
|
+
]);
|
|
788
|
+
if (errors.length > 0) {
|
|
789
|
+
const error = new FDKClientValidationError({
|
|
790
|
+
message: "Missing required field",
|
|
791
|
+
details: errors,
|
|
880
792
|
});
|
|
881
|
-
}
|
|
882
|
-
if (invalidInput.length) {
|
|
883
|
-
const error = new Error();
|
|
884
|
-
error.message = "Missing required field";
|
|
885
|
-
error.details = invalidInput;
|
|
886
793
|
return Promise.reject(new FDKClientValidationError(error));
|
|
887
794
|
}
|
|
888
795
|
|
|
@@ -923,14 +830,6 @@ class Catalog {
|
|
|
923
830
|
{ sortOn, pageId, pageSize, requestHeaders } = { requestHeaders: {} },
|
|
924
831
|
{ responseHeaders } = { responseHeaders: false }
|
|
925
832
|
) {
|
|
926
|
-
let invalidInput = [];
|
|
927
|
-
if (invalidInput.length) {
|
|
928
|
-
const error = new Error();
|
|
929
|
-
error.message = "Missing required field";
|
|
930
|
-
error.details = invalidInput;
|
|
931
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
932
|
-
}
|
|
933
|
-
|
|
934
833
|
const query_params = {};
|
|
935
834
|
query_params["sort_on"] = sortOn;
|
|
936
835
|
query_params["page_id"] = pageId;
|
|
@@ -1011,14 +910,6 @@ class Catalog {
|
|
|
1011
910
|
} = { requestHeaders: {} },
|
|
1012
911
|
{ responseHeaders } = { responseHeaders: false }
|
|
1013
912
|
) {
|
|
1014
|
-
let invalidInput = [];
|
|
1015
|
-
if (invalidInput.length) {
|
|
1016
|
-
const error = new Error();
|
|
1017
|
-
error.message = "Missing required field";
|
|
1018
|
-
error.details = invalidInput;
|
|
1019
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
1020
|
-
}
|
|
1021
|
-
|
|
1022
913
|
const query_params = {};
|
|
1023
914
|
query_params["page_no"] = pageNo;
|
|
1024
915
|
query_params["page_size"] = pageSize;
|
|
@@ -1110,18 +1001,12 @@ class Catalog {
|
|
|
1110
1001
|
{ locationId, requestHeaders } = { requestHeaders: {} },
|
|
1111
1002
|
{ responseHeaders } = { responseHeaders: false }
|
|
1112
1003
|
) {
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
path: ["locationId"],
|
|
1004
|
+
const errors = validateRequiredParams(arguments[0], ["locationId"]);
|
|
1005
|
+
if (errors.length > 0) {
|
|
1006
|
+
const error = new FDKClientValidationError({
|
|
1007
|
+
message: "Missing required field",
|
|
1008
|
+
details: errors,
|
|
1119
1009
|
});
|
|
1120
|
-
}
|
|
1121
|
-
if (invalidInput.length) {
|
|
1122
|
-
const error = new Error();
|
|
1123
|
-
error.message = "Missing required field";
|
|
1124
|
-
error.details = invalidInput;
|
|
1125
1010
|
return Promise.reject(new FDKClientValidationError(error));
|
|
1126
1011
|
}
|
|
1127
1012
|
|
|
@@ -1162,14 +1047,6 @@ class Catalog {
|
|
|
1162
1047
|
{ slug, id, requestHeaders } = { requestHeaders: {} },
|
|
1163
1048
|
{ responseHeaders } = { responseHeaders: false }
|
|
1164
1049
|
) {
|
|
1165
|
-
let invalidInput = [];
|
|
1166
|
-
if (invalidInput.length) {
|
|
1167
|
-
const error = new Error();
|
|
1168
|
-
error.message = "Missing required field";
|
|
1169
|
-
error.details = invalidInput;
|
|
1170
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
1171
|
-
}
|
|
1172
|
-
|
|
1173
1050
|
const query_params = {};
|
|
1174
1051
|
query_params["slug"] = slug;
|
|
1175
1052
|
query_params["id"] = id;
|
|
@@ -1209,21 +1086,6 @@ class Catalog {
|
|
|
1209
1086
|
{ slug, requestHeaders } = { requestHeaders: {} },
|
|
1210
1087
|
{ responseHeaders } = { responseHeaders: false }
|
|
1211
1088
|
) {
|
|
1212
|
-
let invalidInput = [];
|
|
1213
|
-
|
|
1214
|
-
if (!slug) {
|
|
1215
|
-
invalidInput.push({
|
|
1216
|
-
message: `The 'slug' field is required.`,
|
|
1217
|
-
path: ["slug"],
|
|
1218
|
-
});
|
|
1219
|
-
}
|
|
1220
|
-
if (invalidInput.length) {
|
|
1221
|
-
const error = new Error();
|
|
1222
|
-
error.message = "Missing required field";
|
|
1223
|
-
error.details = invalidInput;
|
|
1224
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
1225
|
-
}
|
|
1226
|
-
|
|
1227
1089
|
const query_params = {};
|
|
1228
1090
|
query_params["slug"] = slug;
|
|
1229
1091
|
|
|
@@ -1262,18 +1124,12 @@ class Catalog {
|
|
|
1262
1124
|
{ slug, requestHeaders } = { requestHeaders: {} },
|
|
1263
1125
|
{ responseHeaders } = { responseHeaders: false }
|
|
1264
1126
|
) {
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
path: ["slug"],
|
|
1127
|
+
const errors = validateRequiredParams(arguments[0], ["slug"]);
|
|
1128
|
+
if (errors.length > 0) {
|
|
1129
|
+
const error = new FDKClientValidationError({
|
|
1130
|
+
message: "Missing required field",
|
|
1131
|
+
details: errors,
|
|
1271
1132
|
});
|
|
1272
|
-
}
|
|
1273
|
-
if (invalidInput.length) {
|
|
1274
|
-
const error = new Error();
|
|
1275
|
-
error.message = "Missing required field";
|
|
1276
|
-
error.details = invalidInput;
|
|
1277
1133
|
return Promise.reject(new FDKClientValidationError(error));
|
|
1278
1134
|
}
|
|
1279
1135
|
|
|
@@ -1314,24 +1170,12 @@ class Catalog {
|
|
|
1314
1170
|
{ slug, size, storeId, moq, requestHeaders } = { requestHeaders: {} },
|
|
1315
1171
|
{ responseHeaders } = { responseHeaders: false }
|
|
1316
1172
|
) {
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
path: ["slug"],
|
|
1323
|
-
});
|
|
1324
|
-
}
|
|
1325
|
-
if (!size) {
|
|
1326
|
-
invalidInput.push({
|
|
1327
|
-
message: `The 'size' field is required.`,
|
|
1328
|
-
path: ["size"],
|
|
1173
|
+
const errors = validateRequiredParams(arguments[0], ["slug", "size"]);
|
|
1174
|
+
if (errors.length > 0) {
|
|
1175
|
+
const error = new FDKClientValidationError({
|
|
1176
|
+
message: "Missing required field",
|
|
1177
|
+
details: errors,
|
|
1329
1178
|
});
|
|
1330
|
-
}
|
|
1331
|
-
if (invalidInput.length) {
|
|
1332
|
-
const error = new Error();
|
|
1333
|
-
error.message = "Missing required field";
|
|
1334
|
-
error.details = invalidInput;
|
|
1335
1179
|
return Promise.reject(new FDKClientValidationError(error));
|
|
1336
1180
|
}
|
|
1337
1181
|
|
|
@@ -1376,24 +1220,12 @@ class Catalog {
|
|
|
1376
1220
|
},
|
|
1377
1221
|
{ responseHeaders } = { responseHeaders: false }
|
|
1378
1222
|
) {
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
path: ["slug"],
|
|
1223
|
+
const errors = validateRequiredParams(arguments[0], ["slug", "size"]);
|
|
1224
|
+
if (errors.length > 0) {
|
|
1225
|
+
const error = new FDKClientValidationError({
|
|
1226
|
+
message: "Missing required field",
|
|
1227
|
+
details: errors,
|
|
1385
1228
|
});
|
|
1386
|
-
}
|
|
1387
|
-
if (!size) {
|
|
1388
|
-
invalidInput.push({
|
|
1389
|
-
message: `The 'size' field is required.`,
|
|
1390
|
-
path: ["size"],
|
|
1391
|
-
});
|
|
1392
|
-
}
|
|
1393
|
-
if (invalidInput.length) {
|
|
1394
|
-
const error = new Error();
|
|
1395
|
-
error.message = "Missing required field";
|
|
1396
|
-
error.details = invalidInput;
|
|
1397
1229
|
return Promise.reject(new FDKClientValidationError(error));
|
|
1398
1230
|
}
|
|
1399
1231
|
|
|
@@ -1475,18 +1307,12 @@ class Catalog {
|
|
|
1475
1307
|
{ slug, storeId, requestHeaders } = { requestHeaders: {} },
|
|
1476
1308
|
{ responseHeaders } = { responseHeaders: false }
|
|
1477
1309
|
) {
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
path: ["slug"],
|
|
1310
|
+
const errors = validateRequiredParams(arguments[0], ["slug"]);
|
|
1311
|
+
if (errors.length > 0) {
|
|
1312
|
+
const error = new FDKClientValidationError({
|
|
1313
|
+
message: "Missing required field",
|
|
1314
|
+
details: errors,
|
|
1484
1315
|
});
|
|
1485
|
-
}
|
|
1486
|
-
if (invalidInput.length) {
|
|
1487
|
-
const error = new Error();
|
|
1488
|
-
error.message = "Missing required field";
|
|
1489
|
-
error.details = invalidInput;
|
|
1490
1316
|
return Promise.reject(new FDKClientValidationError(error));
|
|
1491
1317
|
}
|
|
1492
1318
|
|
|
@@ -1528,14 +1354,6 @@ class Catalog {
|
|
|
1528
1354
|
{ itemId, alu, skuCode, ean, upc, requestHeaders } = { requestHeaders: {} },
|
|
1529
1355
|
{ responseHeaders } = { responseHeaders: false }
|
|
1530
1356
|
) {
|
|
1531
|
-
let invalidInput = [];
|
|
1532
|
-
if (invalidInput.length) {
|
|
1533
|
-
const error = new Error();
|
|
1534
|
-
error.message = "Missing required field";
|
|
1535
|
-
error.details = invalidInput;
|
|
1536
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
1537
|
-
}
|
|
1538
|
-
|
|
1539
1357
|
const query_params = {};
|
|
1540
1358
|
query_params["item_id"] = itemId;
|
|
1541
1359
|
query_params["alu"] = alu;
|
|
@@ -1578,21 +1396,6 @@ class Catalog {
|
|
|
1578
1396
|
{ timestamp, pageSize, pageId, requestHeaders } = { requestHeaders: {} },
|
|
1579
1397
|
{ responseHeaders } = { responseHeaders: false }
|
|
1580
1398
|
) {
|
|
1581
|
-
let invalidInput = [];
|
|
1582
|
-
|
|
1583
|
-
if (!timestamp) {
|
|
1584
|
-
invalidInput.push({
|
|
1585
|
-
message: `The 'timestamp' field is required.`,
|
|
1586
|
-
path: ["timestamp"],
|
|
1587
|
-
});
|
|
1588
|
-
}
|
|
1589
|
-
if (invalidInput.length) {
|
|
1590
|
-
const error = new Error();
|
|
1591
|
-
error.message = "Missing required field";
|
|
1592
|
-
error.details = invalidInput;
|
|
1593
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
1594
|
-
}
|
|
1595
|
-
|
|
1596
1399
|
const query_params = {};
|
|
1597
1400
|
query_params["timestamp"] = timestamp;
|
|
1598
1401
|
query_params["page_size"] = pageSize;
|
|
@@ -1662,18 +1465,12 @@ class Catalog {
|
|
|
1662
1465
|
{ slug, requestHeaders } = { requestHeaders: {} },
|
|
1663
1466
|
{ responseHeaders } = { responseHeaders: false }
|
|
1664
1467
|
) {
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
path: ["slug"],
|
|
1468
|
+
const errors = validateRequiredParams(arguments[0], ["slug"]);
|
|
1469
|
+
if (errors.length > 0) {
|
|
1470
|
+
const error = new FDKClientValidationError({
|
|
1471
|
+
message: "Missing required field",
|
|
1472
|
+
details: errors,
|
|
1671
1473
|
});
|
|
1672
|
-
}
|
|
1673
|
-
if (invalidInput.length) {
|
|
1674
|
-
const error = new Error();
|
|
1675
|
-
error.message = "Missing required field";
|
|
1676
|
-
error.details = invalidInput;
|
|
1677
1474
|
return Promise.reject(new FDKClientValidationError(error));
|
|
1678
1475
|
}
|
|
1679
1476
|
|
|
@@ -1724,14 +1521,6 @@ class Catalog {
|
|
|
1724
1521
|
} = { requestHeaders: {} },
|
|
1725
1522
|
{ responseHeaders } = { responseHeaders: false }
|
|
1726
1523
|
) {
|
|
1727
|
-
let invalidInput = [];
|
|
1728
|
-
if (invalidInput.length) {
|
|
1729
|
-
const error = new Error();
|
|
1730
|
-
error.message = "Missing required field";
|
|
1731
|
-
error.details = invalidInput;
|
|
1732
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
1733
|
-
}
|
|
1734
|
-
|
|
1735
1524
|
const query_params = {};
|
|
1736
1525
|
query_params["q"] = q;
|
|
1737
1526
|
query_params["f"] = f;
|
|
@@ -1821,21 +1610,6 @@ class Catalog {
|
|
|
1821
1610
|
{ q, requestHeaders } = { requestHeaders: {} },
|
|
1822
1611
|
{ responseHeaders } = { responseHeaders: false }
|
|
1823
1612
|
) {
|
|
1824
|
-
let invalidInput = [];
|
|
1825
|
-
|
|
1826
|
-
if (!q) {
|
|
1827
|
-
invalidInput.push({
|
|
1828
|
-
message: `The 'q' field is required.`,
|
|
1829
|
-
path: ["q"],
|
|
1830
|
-
});
|
|
1831
|
-
}
|
|
1832
|
-
if (invalidInput.length) {
|
|
1833
|
-
const error = new Error();
|
|
1834
|
-
error.message = "Missing required field";
|
|
1835
|
-
error.details = invalidInput;
|
|
1836
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
1837
|
-
}
|
|
1838
|
-
|
|
1839
1613
|
const query_params = {};
|
|
1840
1614
|
query_params["q"] = q;
|
|
1841
1615
|
|
|
@@ -1874,18 +1648,12 @@ class Catalog {
|
|
|
1874
1648
|
{ slug, requestHeaders } = { requestHeaders: {} },
|
|
1875
1649
|
{ responseHeaders } = { responseHeaders: false }
|
|
1876
1650
|
) {
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
path: ["slug"],
|
|
1651
|
+
const errors = validateRequiredParams(arguments[0], ["slug"]);
|
|
1652
|
+
if (errors.length > 0) {
|
|
1653
|
+
const error = new FDKClientValidationError({
|
|
1654
|
+
message: "Missing required field",
|
|
1655
|
+
details: errors,
|
|
1883
1656
|
});
|
|
1884
|
-
}
|
|
1885
|
-
if (invalidInput.length) {
|
|
1886
|
-
const error = new Error();
|
|
1887
|
-
error.message = "Missing required field";
|
|
1888
|
-
error.details = invalidInput;
|
|
1889
1657
|
return Promise.reject(new FDKClientValidationError(error));
|
|
1890
1658
|
}
|
|
1891
1659
|
|
|
@@ -1936,14 +1704,6 @@ class Catalog {
|
|
|
1936
1704
|
} = { requestHeaders: {} },
|
|
1937
1705
|
{ responseHeaders } = { responseHeaders: false }
|
|
1938
1706
|
) {
|
|
1939
|
-
let invalidInput = [];
|
|
1940
|
-
if (invalidInput.length) {
|
|
1941
|
-
const error = new Error();
|
|
1942
|
-
error.message = "Missing required field";
|
|
1943
|
-
error.details = invalidInput;
|
|
1944
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
1945
|
-
}
|
|
1946
|
-
|
|
1947
1707
|
const query_params = {};
|
|
1948
1708
|
query_params["page_no"] = pageNo;
|
|
1949
1709
|
query_params["page_size"] = pageSize;
|
|
@@ -2039,24 +1799,15 @@ class Catalog {
|
|
|
2039
1799
|
{ collectionType, collectionId, requestHeaders } = { requestHeaders: {} },
|
|
2040
1800
|
{ responseHeaders } = { responseHeaders: false }
|
|
2041
1801
|
) {
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
1802
|
+
const errors = validateRequiredParams(arguments[0], [
|
|
1803
|
+
"collectionType",
|
|
1804
|
+
"collectionId",
|
|
1805
|
+
]);
|
|
1806
|
+
if (errors.length > 0) {
|
|
1807
|
+
const error = new FDKClientValidationError({
|
|
1808
|
+
message: "Missing required field",
|
|
1809
|
+
details: errors,
|
|
2048
1810
|
});
|
|
2049
|
-
}
|
|
2050
|
-
if (!collectionId) {
|
|
2051
|
-
invalidInput.push({
|
|
2052
|
-
message: `The 'collectionId' field is required.`,
|
|
2053
|
-
path: ["collectionId"],
|
|
2054
|
-
});
|
|
2055
|
-
}
|
|
2056
|
-
if (invalidInput.length) {
|
|
2057
|
-
const error = new Error();
|
|
2058
|
-
error.message = "Missing required field";
|
|
2059
|
-
error.details = invalidInput;
|
|
2060
1811
|
return Promise.reject(new FDKClientValidationError(error));
|
|
2061
1812
|
}
|
|
2062
1813
|
|
|
@@ -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 Common {
|
|
11
12
|
constructor(_conf) {
|
|
@@ -43,14 +44,6 @@ class Common {
|
|
|
43
44
|
{ locationType, id, requestHeaders } = { requestHeaders: {} },
|
|
44
45
|
{ responseHeaders } = { responseHeaders: false }
|
|
45
46
|
) {
|
|
46
|
-
let invalidInput = [];
|
|
47
|
-
if (invalidInput.length) {
|
|
48
|
-
const error = new Error();
|
|
49
|
-
error.message = "Missing required field";
|
|
50
|
-
error.details = invalidInput;
|
|
51
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
52
|
-
}
|
|
53
|
-
|
|
54
47
|
const query_params = {};
|
|
55
48
|
query_params["location_type"] = locationType;
|
|
56
49
|
query_params["id"] = id;
|
|
@@ -90,14 +83,6 @@ class Common {
|
|
|
90
83
|
{ authorization, query, requestHeaders } = { requestHeaders: {} },
|
|
91
84
|
{ responseHeaders } = { responseHeaders: false }
|
|
92
85
|
) {
|
|
93
|
-
let invalidInput = [];
|
|
94
|
-
if (invalidInput.length) {
|
|
95
|
-
const error = new Error();
|
|
96
|
-
error.message = "Missing required field";
|
|
97
|
-
error.details = invalidInput;
|
|
98
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
99
|
-
}
|
|
100
|
-
|
|
101
86
|
const query_params = {};
|
|
102
87
|
query_params["query"] = query;
|
|
103
88
|
|