@gofynd/fdk-client-javascript 1.5.2 → 1.6.0
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.js +293 -0
- package/sdk/application/Catalog/CatalogApplicationClient.js +408 -0
- package/sdk/application/Common/CommonApplicationClient.js +21 -0
- package/sdk/application/Communication/CommunicationApplicationClient.js +29 -0
- package/sdk/application/Configuration/ConfigurationApplicationClient.js +147 -0
- package/sdk/application/Content/ContentApplicationClient.js +226 -0
- package/sdk/application/FileStorage/FileStorageApplicationClient.js +43 -0
- package/sdk/application/Finance/FinanceApplicationClient.js +21 -0
- package/sdk/application/Lead/LeadApplicationClient.js +73 -0
- package/sdk/application/Logistic/LogisticApplicationClient.d.ts +1 -1
- package/sdk/application/Logistic/LogisticApplicationClient.js +192 -3
- package/sdk/application/Order/OrderApplicationClient.js +202 -0
- package/sdk/application/Payment/PaymentApplicationClient.js +454 -0
- package/sdk/application/Rewards/RewardsApplicationClient.js +68 -0
- package/sdk/application/Share/ShareApplicationClient.js +96 -0
- package/sdk/application/Theme/ThemeApplicationClient.js +64 -0
- package/sdk/application/User/UserApplicationClient.js +412 -0
- package/sdk/application/Webhook/WebhookApplicationClient.js +13 -0
- package/sdk/partner/FileStorage/FileStoragePartnerClient.d.ts +10 -0
- package/sdk/partner/FileStorage/FileStoragePartnerClient.js +75 -0
- package/sdk/partner/FileStorage/FileStoragePartnerModel.d.ts +54 -1
- package/sdk/partner/FileStorage/FileStoragePartnerModel.js +43 -0
- package/sdk/partner/FileStorage/FileStoragePartnerValidator.d.ts +1 -0
- package/sdk/partner/FileStorage/FileStoragePartnerValidator.js +6 -0
- package/sdk/partner/Webhook/WebhookPartnerModel.d.ts +16 -3
- package/sdk/partner/Webhook/WebhookPartnerModel.js +5 -3
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.d.ts +4 -1
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.js +1 -1
- package/sdk/platform/AuditTrail/AuditTrailPlatformModel.d.ts +46 -23
- package/sdk/platform/AuditTrail/AuditTrailPlatformModel.js +12 -23
- package/sdk/platform/Cart/CartPlatformModel.d.ts +59 -1
- package/sdk/platform/Cart/CartPlatformModel.js +31 -0
- package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +0 -12
- package/sdk/platform/Content/ContentPlatformApplicationClient.js +0 -81
- package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +1 -10
- package/sdk/platform/Content/ContentPlatformApplicationValidator.js +0 -12
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +13 -0
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +82 -0
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +10 -1
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +12 -0
- package/sdk/platform/Payment/PaymentPlatformModel.d.ts +108 -1
- package/sdk/platform/Payment/PaymentPlatformModel.js +77 -0
- package/sdk/platform/User/UserPlatformModel.d.ts +2 -2
- package/sdk/platform/User/UserPlatformModel.js +2 -2
- package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +58 -14
- package/sdk/platform/Webhook/WebhookPlatformModel.js +15 -14
- package/sdk/public/Catalog/CatalogPublicClient.js +15 -0
- package/sdk/public/Configuration/ConfigurationPublicClient.js +16 -0
- package/sdk/public/Content/ContentPublicClient.js +116 -0
- package/sdk/public/Partner/PartnerPublicClient.js +15 -0
- package/sdk/public/Webhook/WebhookPublicClient.js +40 -0
- package/sdk/public/Webhook/WebhookPublicModel.d.ts +194 -46
- package/sdk/public/Webhook/WebhookPublicModel.js +51 -46
|
@@ -239,7 +239,7 @@ const Joi = require("joi");
|
|
|
239
239
|
* @property {string} [first_name]
|
|
240
240
|
* @property {string} [last_name]
|
|
241
241
|
* @property {string} [gender]
|
|
242
|
-
* @property {string} username
|
|
242
|
+
* @property {string} [username]
|
|
243
243
|
* @property {Object} [meta]
|
|
244
244
|
* @property {string} [external_id]
|
|
245
245
|
* @property {string} [rr_id]
|
|
@@ -827,7 +827,7 @@ class UserPlatformModel {
|
|
|
827
827
|
first_name: Joi.string().allow(""),
|
|
828
828
|
last_name: Joi.string().allow(""),
|
|
829
829
|
gender: Joi.string().allow(""),
|
|
830
|
-
username: Joi.string().allow("")
|
|
830
|
+
username: Joi.string().allow(""),
|
|
831
831
|
meta: Joi.object().pattern(/\S/, Joi.any()),
|
|
832
832
|
external_id: Joi.string().allow(""),
|
|
833
833
|
rr_id: Joi.string().allow(""),
|
|
@@ -55,7 +55,7 @@ export = WebhookPlatformModel;
|
|
|
55
55
|
*/
|
|
56
56
|
/**
|
|
57
57
|
* @typedef EventConfigResult
|
|
58
|
-
* @property {EventConfig[]} [event_configs]
|
|
58
|
+
* @property {EventConfig[]} [event_configs] - List of event configurations.
|
|
59
59
|
*/
|
|
60
60
|
/**
|
|
61
61
|
* @typedef Association
|
|
@@ -96,7 +96,7 @@ export = WebhookPlatformModel;
|
|
|
96
96
|
* @property {string} [created_on] - The date and time when the subscriber was created.
|
|
97
97
|
* @property {string} [type] - The type of subscriber, which can either be passed as null.
|
|
98
98
|
* @property {AuthMeta} [auth_meta]
|
|
99
|
-
* @property {EventConfig[]} [event_configs]
|
|
99
|
+
* @property {EventConfig[]} [event_configs] - List of event configurations.
|
|
100
100
|
*/
|
|
101
101
|
/**
|
|
102
102
|
* @typedef Events
|
|
@@ -183,7 +183,7 @@ export = WebhookPlatformModel;
|
|
|
183
183
|
*/
|
|
184
184
|
/**
|
|
185
185
|
* @typedef SubscriberConfigList
|
|
186
|
-
* @property {SubscriberDetails[]} [items]
|
|
186
|
+
* @property {SubscriberDetails[]} [items] - List of subscriber details.
|
|
187
187
|
* @property {Page} [page]
|
|
188
188
|
*/
|
|
189
189
|
/**
|
|
@@ -199,7 +199,7 @@ export = WebhookPlatformModel;
|
|
|
199
199
|
* @property {string} type - The type of the configuration.
|
|
200
200
|
* @property {Object} [custom_headers] - Custom headers for the configuration.
|
|
201
201
|
* @property {AuthMeta} [auth_meta]
|
|
202
|
-
* @property {RestEventData[]} events
|
|
202
|
+
* @property {RestEventData[]} events - List of event data for configuration.
|
|
203
203
|
*/
|
|
204
204
|
/**
|
|
205
205
|
* @typedef QueueEventData
|
|
@@ -211,13 +211,13 @@ export = WebhookPlatformModel;
|
|
|
211
211
|
*/
|
|
212
212
|
/**
|
|
213
213
|
* @typedef KafkaConfig
|
|
214
|
-
* @property {string} [type]
|
|
215
|
-
* @property {QueueEventData[]} events
|
|
214
|
+
* @property {string} [type] - Type of Kafka configuration (optional).
|
|
215
|
+
* @property {QueueEventData[]} events - List of event data for configuration.
|
|
216
216
|
*/
|
|
217
217
|
/**
|
|
218
218
|
* @typedef PubSubConfig
|
|
219
|
-
* @property {string} [type]
|
|
220
|
-
* @property {QueueEventData[]} events
|
|
219
|
+
* @property {string} [type] - Type of Pub/Sub configuration (optional).
|
|
220
|
+
* @property {QueueEventData[]} events - List of event data for configuration.
|
|
221
221
|
*/
|
|
222
222
|
/**
|
|
223
223
|
* @typedef TemporalEventData
|
|
@@ -230,8 +230,8 @@ export = WebhookPlatformModel;
|
|
|
230
230
|
*/
|
|
231
231
|
/**
|
|
232
232
|
* @typedef TemporalConfig
|
|
233
|
-
* @property {string} [type]
|
|
234
|
-
* @property {TemporalEventData[]} events
|
|
233
|
+
* @property {string} [type] - Type of Temporal configuration (optional).
|
|
234
|
+
* @property {TemporalEventData[]} events - List of event data for configuration.
|
|
235
235
|
*/
|
|
236
236
|
/**
|
|
237
237
|
* @typedef SqsEventData
|
|
@@ -243,8 +243,8 @@ export = WebhookPlatformModel;
|
|
|
243
243
|
*/
|
|
244
244
|
/**
|
|
245
245
|
* @typedef SqsConfig
|
|
246
|
-
* @property {string} [type]
|
|
247
|
-
* @property {SqsEventData[]} events
|
|
246
|
+
* @property {string} [type] - Type of SQS configuration (optional).
|
|
247
|
+
* @property {SqsEventData[]} events - List of event data for configuration.
|
|
248
248
|
*/
|
|
249
249
|
/**
|
|
250
250
|
* @typedef EventBridgeData
|
|
@@ -257,8 +257,9 @@ export = WebhookPlatformModel;
|
|
|
257
257
|
*/
|
|
258
258
|
/**
|
|
259
259
|
* @typedef EventBridgeConfig
|
|
260
|
-
* @property {string} [type]
|
|
261
|
-
* @property {EventBridgeData[]} events
|
|
260
|
+
* @property {string} [type] - Type of event configuration (optional).
|
|
261
|
+
* @property {EventBridgeData[]} events - List of event data for EventBridge
|
|
262
|
+
* configuration.
|
|
262
263
|
*/
|
|
263
264
|
/**
|
|
264
265
|
* @typedef EventMapBody
|
|
@@ -445,6 +446,9 @@ type EventConfig = {
|
|
|
445
446
|
/** @returns {EventConfigResult} */
|
|
446
447
|
declare function EventConfigResult(): EventConfigResult;
|
|
447
448
|
type EventConfigResult = {
|
|
449
|
+
/**
|
|
450
|
+
* - List of event configurations.
|
|
451
|
+
*/
|
|
448
452
|
event_configs?: EventConfig[];
|
|
449
453
|
};
|
|
450
454
|
/** @returns {Association} */
|
|
@@ -547,6 +551,9 @@ type SubscriberDetails = {
|
|
|
547
551
|
*/
|
|
548
552
|
type?: string;
|
|
549
553
|
auth_meta?: AuthMeta;
|
|
554
|
+
/**
|
|
555
|
+
* - List of event configurations.
|
|
556
|
+
*/
|
|
550
557
|
event_configs?: EventConfig[];
|
|
551
558
|
};
|
|
552
559
|
/** @returns {Events} */
|
|
@@ -776,6 +783,9 @@ type SubscriberConfigResult = {
|
|
|
776
783
|
/** @returns {SubscriberConfigList} */
|
|
777
784
|
declare function SubscriberConfigList(): SubscriberConfigList;
|
|
778
785
|
type SubscriberConfigList = {
|
|
786
|
+
/**
|
|
787
|
+
* - List of subscriber details.
|
|
788
|
+
*/
|
|
779
789
|
items?: SubscriberDetails[];
|
|
780
790
|
page?: Page;
|
|
781
791
|
};
|
|
@@ -815,6 +825,9 @@ type RestConfig = {
|
|
|
815
825
|
*/
|
|
816
826
|
custom_headers?: any;
|
|
817
827
|
auth_meta?: AuthMeta;
|
|
828
|
+
/**
|
|
829
|
+
* - List of event data for configuration.
|
|
830
|
+
*/
|
|
818
831
|
events: RestEventData[];
|
|
819
832
|
};
|
|
820
833
|
/** @returns {QueueEventData} */
|
|
@@ -844,13 +857,25 @@ type QueueEventData = {
|
|
|
844
857
|
/** @returns {KafkaConfig} */
|
|
845
858
|
declare function KafkaConfig(): KafkaConfig;
|
|
846
859
|
type KafkaConfig = {
|
|
860
|
+
/**
|
|
861
|
+
* - Type of Kafka configuration (optional).
|
|
862
|
+
*/
|
|
847
863
|
type?: string;
|
|
864
|
+
/**
|
|
865
|
+
* - List of event data for configuration.
|
|
866
|
+
*/
|
|
848
867
|
events: QueueEventData[];
|
|
849
868
|
};
|
|
850
869
|
/** @returns {PubSubConfig} */
|
|
851
870
|
declare function PubSubConfig(): PubSubConfig;
|
|
852
871
|
type PubSubConfig = {
|
|
872
|
+
/**
|
|
873
|
+
* - Type of Pub/Sub configuration (optional).
|
|
874
|
+
*/
|
|
853
875
|
type?: string;
|
|
876
|
+
/**
|
|
877
|
+
* - List of event data for configuration.
|
|
878
|
+
*/
|
|
854
879
|
events: QueueEventData[];
|
|
855
880
|
};
|
|
856
881
|
/** @returns {TemporalEventData} */
|
|
@@ -884,7 +909,13 @@ type TemporalEventData = {
|
|
|
884
909
|
/** @returns {TemporalConfig} */
|
|
885
910
|
declare function TemporalConfig(): TemporalConfig;
|
|
886
911
|
type TemporalConfig = {
|
|
912
|
+
/**
|
|
913
|
+
* - Type of Temporal configuration (optional).
|
|
914
|
+
*/
|
|
887
915
|
type?: string;
|
|
916
|
+
/**
|
|
917
|
+
* - List of event data for configuration.
|
|
918
|
+
*/
|
|
888
919
|
events: TemporalEventData[];
|
|
889
920
|
};
|
|
890
921
|
/** @returns {SqsEventData} */
|
|
@@ -914,7 +945,13 @@ type SqsEventData = {
|
|
|
914
945
|
/** @returns {SqsConfig} */
|
|
915
946
|
declare function SqsConfig(): SqsConfig;
|
|
916
947
|
type SqsConfig = {
|
|
948
|
+
/**
|
|
949
|
+
* - Type of SQS configuration (optional).
|
|
950
|
+
*/
|
|
917
951
|
type?: string;
|
|
952
|
+
/**
|
|
953
|
+
* - List of event data for configuration.
|
|
954
|
+
*/
|
|
918
955
|
events: SqsEventData[];
|
|
919
956
|
};
|
|
920
957
|
/** @returns {EventBridgeData} */
|
|
@@ -945,7 +982,14 @@ type EventBridgeData = {
|
|
|
945
982
|
/** @returns {EventBridgeConfig} */
|
|
946
983
|
declare function EventBridgeConfig(): EventBridgeConfig;
|
|
947
984
|
type EventBridgeConfig = {
|
|
985
|
+
/**
|
|
986
|
+
* - Type of event configuration (optional).
|
|
987
|
+
*/
|
|
948
988
|
type?: string;
|
|
989
|
+
/**
|
|
990
|
+
* - List of event data for EventBridge
|
|
991
|
+
* configuration.
|
|
992
|
+
*/
|
|
949
993
|
events: EventBridgeData[];
|
|
950
994
|
};
|
|
951
995
|
/** @returns {EventMapBody} */
|
|
@@ -60,7 +60,7 @@ const Joi = require("joi");
|
|
|
60
60
|
|
|
61
61
|
/**
|
|
62
62
|
* @typedef EventConfigResult
|
|
63
|
-
* @property {EventConfig[]} [event_configs]
|
|
63
|
+
* @property {EventConfig[]} [event_configs] - List of event configurations.
|
|
64
64
|
*/
|
|
65
65
|
|
|
66
66
|
/**
|
|
@@ -105,7 +105,7 @@ const Joi = require("joi");
|
|
|
105
105
|
* @property {string} [created_on] - The date and time when the subscriber was created.
|
|
106
106
|
* @property {string} [type] - The type of subscriber, which can either be passed as null.
|
|
107
107
|
* @property {AuthMeta} [auth_meta]
|
|
108
|
-
* @property {EventConfig[]} [event_configs]
|
|
108
|
+
* @property {EventConfig[]} [event_configs] - List of event configurations.
|
|
109
109
|
*/
|
|
110
110
|
|
|
111
111
|
/**
|
|
@@ -199,7 +199,7 @@ const Joi = require("joi");
|
|
|
199
199
|
|
|
200
200
|
/**
|
|
201
201
|
* @typedef SubscriberConfigList
|
|
202
|
-
* @property {SubscriberDetails[]} [items]
|
|
202
|
+
* @property {SubscriberDetails[]} [items] - List of subscriber details.
|
|
203
203
|
* @property {Page} [page]
|
|
204
204
|
*/
|
|
205
205
|
|
|
@@ -217,7 +217,7 @@ const Joi = require("joi");
|
|
|
217
217
|
* @property {string} type - The type of the configuration.
|
|
218
218
|
* @property {Object} [custom_headers] - Custom headers for the configuration.
|
|
219
219
|
* @property {AuthMeta} [auth_meta]
|
|
220
|
-
* @property {RestEventData[]} events
|
|
220
|
+
* @property {RestEventData[]} events - List of event data for configuration.
|
|
221
221
|
*/
|
|
222
222
|
|
|
223
223
|
/**
|
|
@@ -231,14 +231,14 @@ const Joi = require("joi");
|
|
|
231
231
|
|
|
232
232
|
/**
|
|
233
233
|
* @typedef KafkaConfig
|
|
234
|
-
* @property {string} [type]
|
|
235
|
-
* @property {QueueEventData[]} events
|
|
234
|
+
* @property {string} [type] - Type of Kafka configuration (optional).
|
|
235
|
+
* @property {QueueEventData[]} events - List of event data for configuration.
|
|
236
236
|
*/
|
|
237
237
|
|
|
238
238
|
/**
|
|
239
239
|
* @typedef PubSubConfig
|
|
240
|
-
* @property {string} [type]
|
|
241
|
-
* @property {QueueEventData[]} events
|
|
240
|
+
* @property {string} [type] - Type of Pub/Sub configuration (optional).
|
|
241
|
+
* @property {QueueEventData[]} events - List of event data for configuration.
|
|
242
242
|
*/
|
|
243
243
|
|
|
244
244
|
/**
|
|
@@ -253,8 +253,8 @@ const Joi = require("joi");
|
|
|
253
253
|
|
|
254
254
|
/**
|
|
255
255
|
* @typedef TemporalConfig
|
|
256
|
-
* @property {string} [type]
|
|
257
|
-
* @property {TemporalEventData[]} events
|
|
256
|
+
* @property {string} [type] - Type of Temporal configuration (optional).
|
|
257
|
+
* @property {TemporalEventData[]} events - List of event data for configuration.
|
|
258
258
|
*/
|
|
259
259
|
|
|
260
260
|
/**
|
|
@@ -268,8 +268,8 @@ const Joi = require("joi");
|
|
|
268
268
|
|
|
269
269
|
/**
|
|
270
270
|
* @typedef SqsConfig
|
|
271
|
-
* @property {string} [type]
|
|
272
|
-
* @property {SqsEventData[]} events
|
|
271
|
+
* @property {string} [type] - Type of SQS configuration (optional).
|
|
272
|
+
* @property {SqsEventData[]} events - List of event data for configuration.
|
|
273
273
|
*/
|
|
274
274
|
|
|
275
275
|
/**
|
|
@@ -284,8 +284,9 @@ const Joi = require("joi");
|
|
|
284
284
|
|
|
285
285
|
/**
|
|
286
286
|
* @typedef EventBridgeConfig
|
|
287
|
-
* @property {string} [type]
|
|
288
|
-
* @property {EventBridgeData[]} events
|
|
287
|
+
* @property {string} [type] - Type of event configuration (optional).
|
|
288
|
+
* @property {EventBridgeData[]} events - List of event data for EventBridge
|
|
289
|
+
* configuration.
|
|
289
290
|
*/
|
|
290
291
|
|
|
291
292
|
/**
|
|
@@ -49,6 +49,21 @@ class Catalog {
|
|
|
49
49
|
},
|
|
50
50
|
{ responseHeaders } = { responseHeaders: false }
|
|
51
51
|
) {
|
|
52
|
+
let invalidInput = [];
|
|
53
|
+
|
|
54
|
+
if (!level) {
|
|
55
|
+
invalidInput.push({
|
|
56
|
+
message: `The 'level' field is required.`,
|
|
57
|
+
path: ["level"],
|
|
58
|
+
});
|
|
59
|
+
}
|
|
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
|
+
|
|
52
67
|
const { error } = CatalogPublicValidator.getTaxonomyByLevel().validate(
|
|
53
68
|
{ level, l0Slug, l1Slug, l2Slug, l3Slug, limit },
|
|
54
69
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -49,6 +49,14 @@ class Configuration {
|
|
|
49
49
|
{ locationType, id, requestHeaders } = { requestHeaders: {} },
|
|
50
50
|
{ responseHeaders } = { responseHeaders: false }
|
|
51
51
|
) {
|
|
52
|
+
let invalidInput = [];
|
|
53
|
+
if (invalidInput.length) {
|
|
54
|
+
const error = new Error();
|
|
55
|
+
error.message = "Missing required field";
|
|
56
|
+
error.details = invalidInput;
|
|
57
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
58
|
+
}
|
|
59
|
+
|
|
52
60
|
const { error } = ConfigurationPublicValidator.getLocations().validate(
|
|
53
61
|
{ locationType, id },
|
|
54
62
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -130,6 +138,14 @@ class Configuration {
|
|
|
130
138
|
{ authorization, query, requestHeaders } = { requestHeaders: {} },
|
|
131
139
|
{ responseHeaders } = { responseHeaders: false }
|
|
132
140
|
) {
|
|
141
|
+
let invalidInput = [];
|
|
142
|
+
if (invalidInput.length) {
|
|
143
|
+
const error = new Error();
|
|
144
|
+
error.message = "Missing required field";
|
|
145
|
+
error.details = invalidInput;
|
|
146
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
147
|
+
}
|
|
148
|
+
|
|
133
149
|
const { error } = ConfigurationPublicValidator.searchApplication().validate(
|
|
134
150
|
{ authorization, query },
|
|
135
151
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -58,6 +58,14 @@ class Content {
|
|
|
58
58
|
{ requestHeaders } = { requestHeaders: {} },
|
|
59
59
|
{ responseHeaders } = { responseHeaders: false }
|
|
60
60
|
) {
|
|
61
|
+
let invalidInput = [];
|
|
62
|
+
if (invalidInput.length) {
|
|
63
|
+
const error = new Error();
|
|
64
|
+
error.message = "Missing required field";
|
|
65
|
+
error.details = invalidInput;
|
|
66
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
67
|
+
}
|
|
68
|
+
|
|
61
69
|
const { error } = ContentPublicValidator.getAllTags().validate(
|
|
62
70
|
{},
|
|
63
71
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -134,6 +142,14 @@ class Content {
|
|
|
134
142
|
{ requestHeaders } = { requestHeaders: {} },
|
|
135
143
|
{ responseHeaders } = { responseHeaders: false }
|
|
136
144
|
) {
|
|
145
|
+
let invalidInput = [];
|
|
146
|
+
if (invalidInput.length) {
|
|
147
|
+
const error = new Error();
|
|
148
|
+
error.message = "Missing required field";
|
|
149
|
+
error.details = invalidInput;
|
|
150
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
151
|
+
}
|
|
152
|
+
|
|
137
153
|
const { error } = ContentPublicValidator.getAnalyticsTags().validate(
|
|
138
154
|
{},
|
|
139
155
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -212,6 +228,14 @@ class Content {
|
|
|
212
228
|
{ requestHeaders } = { requestHeaders: {} },
|
|
213
229
|
{ responseHeaders } = { responseHeaders: false }
|
|
214
230
|
) {
|
|
231
|
+
let invalidInput = [];
|
|
232
|
+
if (invalidInput.length) {
|
|
233
|
+
const error = new Error();
|
|
234
|
+
error.message = "Missing required field";
|
|
235
|
+
error.details = invalidInput;
|
|
236
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
237
|
+
}
|
|
238
|
+
|
|
215
239
|
const { error } = ContentPublicValidator.getBasicDetails().validate(
|
|
216
240
|
{},
|
|
217
241
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -290,6 +314,21 @@ class Content {
|
|
|
290
314
|
{ entityType, requestHeaders } = { requestHeaders: {} },
|
|
291
315
|
{ responseHeaders } = { responseHeaders: false }
|
|
292
316
|
) {
|
|
317
|
+
let invalidInput = [];
|
|
318
|
+
|
|
319
|
+
if (!entityType) {
|
|
320
|
+
invalidInput.push({
|
|
321
|
+
message: `The 'entityType' field is required.`,
|
|
322
|
+
path: ["entityType"],
|
|
323
|
+
});
|
|
324
|
+
}
|
|
325
|
+
if (invalidInput.length) {
|
|
326
|
+
const error = new Error();
|
|
327
|
+
error.message = "Missing required field";
|
|
328
|
+
error.details = invalidInput;
|
|
329
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
330
|
+
}
|
|
331
|
+
|
|
293
332
|
const { error } = ContentPublicValidator.getCredentialsByEntity().validate(
|
|
294
333
|
{ entityType },
|
|
295
334
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -368,6 +407,21 @@ class Content {
|
|
|
368
407
|
{ slug, requestHeaders } = { requestHeaders: {} },
|
|
369
408
|
{ responseHeaders } = { responseHeaders: false }
|
|
370
409
|
) {
|
|
410
|
+
let invalidInput = [];
|
|
411
|
+
|
|
412
|
+
if (!slug) {
|
|
413
|
+
invalidInput.push({
|
|
414
|
+
message: `The 'slug' field is required.`,
|
|
415
|
+
path: ["slug"],
|
|
416
|
+
});
|
|
417
|
+
}
|
|
418
|
+
if (invalidInput.length) {
|
|
419
|
+
const error = new Error();
|
|
420
|
+
error.message = "Missing required field";
|
|
421
|
+
error.details = invalidInput;
|
|
422
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
423
|
+
}
|
|
424
|
+
|
|
371
425
|
const { error } = ContentPublicValidator.getCustomPage().validate(
|
|
372
426
|
{ slug },
|
|
373
427
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -444,6 +498,14 @@ class Content {
|
|
|
444
498
|
{ requestHeaders } = { requestHeaders: {} },
|
|
445
499
|
{ responseHeaders } = { responseHeaders: false }
|
|
446
500
|
) {
|
|
501
|
+
let invalidInput = [];
|
|
502
|
+
if (invalidInput.length) {
|
|
503
|
+
const error = new Error();
|
|
504
|
+
error.message = "Missing required field";
|
|
505
|
+
error.details = invalidInput;
|
|
506
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
507
|
+
}
|
|
508
|
+
|
|
447
509
|
const { error } = ContentPublicValidator.getFooterContent().validate(
|
|
448
510
|
{},
|
|
449
511
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -522,6 +584,21 @@ class Content {
|
|
|
522
584
|
{ pageType, requestHeaders } = { requestHeaders: {} },
|
|
523
585
|
{ responseHeaders } = { responseHeaders: false }
|
|
524
586
|
) {
|
|
587
|
+
let invalidInput = [];
|
|
588
|
+
|
|
589
|
+
if (!pageType) {
|
|
590
|
+
invalidInput.push({
|
|
591
|
+
message: `The 'pageType' field is required.`,
|
|
592
|
+
path: ["pageType"],
|
|
593
|
+
});
|
|
594
|
+
}
|
|
595
|
+
if (invalidInput.length) {
|
|
596
|
+
const error = new Error();
|
|
597
|
+
error.message = "Missing required field";
|
|
598
|
+
error.details = invalidInput;
|
|
599
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
600
|
+
}
|
|
601
|
+
|
|
525
602
|
const { error } = ContentPublicValidator.getHomePageContent().validate(
|
|
526
603
|
{ pageType },
|
|
527
604
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -601,6 +678,14 @@ class Content {
|
|
|
601
678
|
{ requestHeaders } = { requestHeaders: {} },
|
|
602
679
|
{ responseHeaders } = { responseHeaders: false }
|
|
603
680
|
) {
|
|
681
|
+
let invalidInput = [];
|
|
682
|
+
if (invalidInput.length) {
|
|
683
|
+
const error = new Error();
|
|
684
|
+
error.message = "Missing required field";
|
|
685
|
+
error.details = invalidInput;
|
|
686
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
687
|
+
}
|
|
688
|
+
|
|
604
689
|
const { error } = ContentPublicValidator.getMenuContent().validate(
|
|
605
690
|
{},
|
|
606
691
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -679,6 +764,21 @@ class Content {
|
|
|
679
764
|
{ type, requestHeaders } = { requestHeaders: {} },
|
|
680
765
|
{ responseHeaders } = { responseHeaders: false }
|
|
681
766
|
) {
|
|
767
|
+
let invalidInput = [];
|
|
768
|
+
|
|
769
|
+
if (!type) {
|
|
770
|
+
invalidInput.push({
|
|
771
|
+
message: `The 'type' field is required.`,
|
|
772
|
+
path: ["type"],
|
|
773
|
+
});
|
|
774
|
+
}
|
|
775
|
+
if (invalidInput.length) {
|
|
776
|
+
const error = new Error();
|
|
777
|
+
error.message = "Missing required field";
|
|
778
|
+
error.details = invalidInput;
|
|
779
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
780
|
+
}
|
|
781
|
+
|
|
682
782
|
const { error } = ContentPublicValidator.getMenuContentByType().validate(
|
|
683
783
|
{ type },
|
|
684
784
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -757,6 +857,14 @@ class Content {
|
|
|
757
857
|
{ requestHeaders } = { requestHeaders: {} },
|
|
758
858
|
{ responseHeaders } = { responseHeaders: false }
|
|
759
859
|
) {
|
|
860
|
+
let invalidInput = [];
|
|
861
|
+
if (invalidInput.length) {
|
|
862
|
+
const error = new Error();
|
|
863
|
+
error.message = "Missing required field";
|
|
864
|
+
error.details = invalidInput;
|
|
865
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
866
|
+
}
|
|
867
|
+
|
|
760
868
|
const { error } = ContentPublicValidator.getNavbar().validate(
|
|
761
869
|
{},
|
|
762
870
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -833,6 +941,14 @@ class Content {
|
|
|
833
941
|
{ requestHeaders } = { requestHeaders: {} },
|
|
834
942
|
{ responseHeaders } = { responseHeaders: false }
|
|
835
943
|
) {
|
|
944
|
+
let invalidInput = [];
|
|
945
|
+
if (invalidInput.length) {
|
|
946
|
+
const error = new Error();
|
|
947
|
+
error.message = "Missing required field";
|
|
948
|
+
error.details = invalidInput;
|
|
949
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
950
|
+
}
|
|
951
|
+
|
|
836
952
|
const { error } = ContentPublicValidator.getPricingBanner().validate(
|
|
837
953
|
{},
|
|
838
954
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -48,6 +48,21 @@ class Partner {
|
|
|
48
48
|
{ slug, requestHeaders } = { requestHeaders: {} },
|
|
49
49
|
{ responseHeaders } = { responseHeaders: false }
|
|
50
50
|
) {
|
|
51
|
+
let invalidInput = [];
|
|
52
|
+
|
|
53
|
+
if (!slug) {
|
|
54
|
+
invalidInput.push({
|
|
55
|
+
message: `The 'slug' field is required.`,
|
|
56
|
+
path: ["slug"],
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
if (invalidInput.length) {
|
|
60
|
+
const error = new Error();
|
|
61
|
+
error.message = "Missing required field";
|
|
62
|
+
error.details = invalidInput;
|
|
63
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
64
|
+
}
|
|
65
|
+
|
|
51
66
|
const {
|
|
52
67
|
error,
|
|
53
68
|
} = PartnerPublicValidator.getPanelExtensionDetails().validate(
|
|
@@ -55,6 +55,14 @@ class Webhook {
|
|
|
55
55
|
{ requestHeaders } = { requestHeaders: {} },
|
|
56
56
|
{ responseHeaders } = { responseHeaders: false }
|
|
57
57
|
) {
|
|
58
|
+
let invalidInput = [];
|
|
59
|
+
if (invalidInput.length) {
|
|
60
|
+
const error = new Error();
|
|
61
|
+
error.message = "Missing required field";
|
|
62
|
+
error.details = invalidInput;
|
|
63
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
64
|
+
}
|
|
65
|
+
|
|
58
66
|
const { error } = WebhookPublicValidator.fetchAllWebhookEvents().validate(
|
|
59
67
|
{},
|
|
60
68
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -133,6 +141,14 @@ class Webhook {
|
|
|
133
141
|
{ requestHeaders } = { requestHeaders: {} },
|
|
134
142
|
{ responseHeaders } = { responseHeaders: false }
|
|
135
143
|
) {
|
|
144
|
+
let invalidInput = [];
|
|
145
|
+
if (invalidInput.length) {
|
|
146
|
+
const error = new Error();
|
|
147
|
+
error.message = "Missing required field";
|
|
148
|
+
error.details = invalidInput;
|
|
149
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
150
|
+
}
|
|
151
|
+
|
|
136
152
|
const { error } = WebhookPublicValidator.notifyDepricatedEvent().validate(
|
|
137
153
|
{},
|
|
138
154
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -211,6 +227,14 @@ class Webhook {
|
|
|
211
227
|
{ body, requestHeaders } = { requestHeaders: {} },
|
|
212
228
|
{ responseHeaders } = { responseHeaders: false }
|
|
213
229
|
) {
|
|
230
|
+
let invalidInput = [];
|
|
231
|
+
if (invalidInput.length) {
|
|
232
|
+
const error = new Error();
|
|
233
|
+
error.message = "Missing required field";
|
|
234
|
+
error.details = invalidInput;
|
|
235
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
236
|
+
}
|
|
237
|
+
|
|
214
238
|
const {
|
|
215
239
|
error,
|
|
216
240
|
} = WebhookPublicValidator.queryWebhookEventDetails().validate(
|
|
@@ -291,6 +315,14 @@ class Webhook {
|
|
|
291
315
|
{ body, requestHeaders } = { requestHeaders: {} },
|
|
292
316
|
{ responseHeaders } = { responseHeaders: false }
|
|
293
317
|
) {
|
|
318
|
+
let invalidInput = [];
|
|
319
|
+
if (invalidInput.length) {
|
|
320
|
+
const error = new Error();
|
|
321
|
+
error.message = "Missing required field";
|
|
322
|
+
error.details = invalidInput;
|
|
323
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
324
|
+
}
|
|
325
|
+
|
|
294
326
|
const {
|
|
295
327
|
error,
|
|
296
328
|
} = WebhookPublicValidator.testHandlerTransformation().validate(
|
|
@@ -371,6 +403,14 @@ class Webhook {
|
|
|
371
403
|
{ body, requestHeaders } = { requestHeaders: {} },
|
|
372
404
|
{ responseHeaders } = { responseHeaders: false }
|
|
373
405
|
) {
|
|
406
|
+
let invalidInput = [];
|
|
407
|
+
if (invalidInput.length) {
|
|
408
|
+
const error = new Error();
|
|
409
|
+
error.message = "Missing required field";
|
|
410
|
+
error.details = invalidInput;
|
|
411
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
412
|
+
}
|
|
413
|
+
|
|
374
414
|
const { error } = WebhookPublicValidator.validateSchema().validate(
|
|
375
415
|
{ body },
|
|
376
416
|
{ abortEarly: false, allowUnknown: true }
|