@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.
- package/README.md +1 -1
- package/package.json +1 -1
- package/sdk/application/Cart/CartApplicationClient.js +277 -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 +243 -0
- package/sdk/application/FileStorage/FileStorageApplicationClient.js +43 -0
- package/sdk/application/Lead/LeadApplicationClient.js +73 -0
- package/sdk/application/Logistic/LogisticApplicationClient.js +153 -0
- package/sdk/application/Order/OrderApplicationClient.js +187 -0
- package/sdk/application/Payment/PaymentApplicationClient.js +427 -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/Theme/ThemePartnerModel.d.ts +3 -40
- package/sdk/partner/Theme/ThemePartnerModel.js +2 -24
- package/sdk/platform/Theme/ThemePlatformModel.d.ts +3 -40
- package/sdk/platform/Theme/ThemePlatformModel.js +2 -24
- package/sdk/public/Configuration/ConfigurationPublicClient.js +16 -0
- package/sdk/public/Content/ContentPublicClient.js +15 -0
- package/sdk/public/Partner/PartnerPublicClient.js +15 -0
- 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");
|
|
@@ -37,6 +42,14 @@ class Webhook {
|
|
|
37
42
|
{ body, requestHeaders } = { requestHeaders: {} },
|
|
38
43
|
{ responseHeaders } = { responseHeaders: false }
|
|
39
44
|
) {
|
|
45
|
+
let invalidInput = [];
|
|
46
|
+
if (invalidInput.length) {
|
|
47
|
+
const error = new Error();
|
|
48
|
+
error.message = "Missing required field";
|
|
49
|
+
error.details = invalidInput;
|
|
50
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
51
|
+
}
|
|
52
|
+
|
|
40
53
|
const query_params = {};
|
|
41
54
|
|
|
42
55
|
const xHeaders = {};
|
|
@@ -482,16 +482,7 @@ export = ThemePartnerModel;
|
|
|
482
482
|
*/
|
|
483
483
|
/**
|
|
484
484
|
* @typedef GlobalSchema
|
|
485
|
-
* @property {
|
|
486
|
-
*/
|
|
487
|
-
/**
|
|
488
|
-
* @typedef Prop
|
|
489
|
-
* @property {string} [type] - The type of the property
|
|
490
|
-
* @property {string} [category] - The category of the property
|
|
491
|
-
* @property {string} [value] - The value of the property
|
|
492
|
-
* @property {string} [id] - The ID of the property
|
|
493
|
-
* @property {string} [label] - The label of the property
|
|
494
|
-
* @property {string} [info] - Additional information about the property
|
|
485
|
+
* @property {Object[]} [props]
|
|
495
486
|
*/
|
|
496
487
|
/**
|
|
497
488
|
* @typedef Preset
|
|
@@ -656,7 +647,7 @@ export = ThemePartnerModel;
|
|
|
656
647
|
declare class ThemePartnerModel {
|
|
657
648
|
}
|
|
658
649
|
declare namespace ThemePartnerModel {
|
|
659
|
-
export { AvailablePageSchema, DraftExtensionSectionRequest, DraftExtensionSectionResponse, SectionsResponse, ExtensionSection, PropExtension, AssetsExtension, PublishExtensionSectionRequest, ExtensionPreviewRequest, ExtensionPreviewResponse, PublishExtensionSectionResponse, AvailablePageSectionMetaAttributes, AvailablePageSeo, SEOMetaItem, SEOMetaItems, SEOSitemap, SEObreadcrumb, Action, AvailablePageSchemaSections, AvailablePageScreenPredicate, AvailablePageUserPredicate, AvailablePageRoutePredicate, AvailablePagePlatformPredicate, AvailablePageSchedulePredicate, AvailablePagePredicate, MarketplaceThemeSchema, MarketplaceTheme, PaymentInfo, ContactInfo, CatalogSize, MarketplaceThemeImages, CarouselItem, ExploreInfo, Feature, FeatureItem, Highlight, Variation, Documentation, Comments, ThemeRejectionReasons, AllAvailablePageSchema, PaginationSchema, BlitzkriegApiErrorSchema, BlitzkriegInternalServerErrorSchema, ThemesSchema, Font, FontVariants, FontVariant, Config, ThemeConfiguration, OverlayPopup, DividerStrokeHighlight, UserAlerts, OrderTracking, ThemeConfigListPage, ThemeConfigListPageSettingsProps, CustomConfig, CustomProps, ThemeMeta, ThemePayment, Release, Images, Assets, UMDJs, CommonJS, CSS, SectionItem, GlobalSchema,
|
|
650
|
+
export { AvailablePageSchema, DraftExtensionSectionRequest, DraftExtensionSectionResponse, SectionsResponse, ExtensionSection, PropExtension, AssetsExtension, PublishExtensionSectionRequest, ExtensionPreviewRequest, ExtensionPreviewResponse, PublishExtensionSectionResponse, AvailablePageSectionMetaAttributes, AvailablePageSeo, SEOMetaItem, SEOMetaItems, SEOSitemap, SEObreadcrumb, Action, AvailablePageSchemaSections, AvailablePageScreenPredicate, AvailablePageUserPredicate, AvailablePageRoutePredicate, AvailablePagePlatformPredicate, AvailablePageSchedulePredicate, AvailablePagePredicate, MarketplaceThemeSchema, MarketplaceTheme, PaymentInfo, ContactInfo, CatalogSize, MarketplaceThemeImages, CarouselItem, ExploreInfo, Feature, FeatureItem, Highlight, Variation, Documentation, Comments, ThemeRejectionReasons, AllAvailablePageSchema, PaginationSchema, BlitzkriegApiErrorSchema, BlitzkriegInternalServerErrorSchema, ThemesSchema, Font, FontVariants, FontVariant, Config, ThemeConfiguration, OverlayPopup, DividerStrokeHighlight, UserAlerts, OrderTracking, ThemeConfigListPage, ThemeConfigListPageSettingsProps, CustomConfig, CustomProps, ThemeMeta, ThemePayment, Release, Images, Assets, UMDJs, CommonJS, CSS, SectionItem, GlobalSchema, Preset, Page, SectionProps, SectionPreset, ImagePickerProp, UrlProp, BlockProps, TextProp, CheckboxProp, RangeProp, Section, Block, Predicate, Screen, ThemeUserSchema, Route, UpdateThemeRequestBody, CreateNewTheme, ActionPage, PageType };
|
|
660
651
|
}
|
|
661
652
|
/** @returns {AvailablePageSchema} */
|
|
662
653
|
declare function AvailablePageSchema(): AvailablePageSchema;
|
|
@@ -1581,35 +1572,7 @@ type SectionItem = {
|
|
|
1581
1572
|
/** @returns {GlobalSchema} */
|
|
1582
1573
|
declare function GlobalSchema(): GlobalSchema;
|
|
1583
1574
|
type GlobalSchema = {
|
|
1584
|
-
props?:
|
|
1585
|
-
};
|
|
1586
|
-
/** @returns {Prop} */
|
|
1587
|
-
declare function Prop(): Prop;
|
|
1588
|
-
type Prop = {
|
|
1589
|
-
/**
|
|
1590
|
-
* - The type of the property
|
|
1591
|
-
*/
|
|
1592
|
-
type?: string;
|
|
1593
|
-
/**
|
|
1594
|
-
* - The category of the property
|
|
1595
|
-
*/
|
|
1596
|
-
category?: string;
|
|
1597
|
-
/**
|
|
1598
|
-
* - The value of the property
|
|
1599
|
-
*/
|
|
1600
|
-
value?: string;
|
|
1601
|
-
/**
|
|
1602
|
-
* - The ID of the property
|
|
1603
|
-
*/
|
|
1604
|
-
id?: string;
|
|
1605
|
-
/**
|
|
1606
|
-
* - The label of the property
|
|
1607
|
-
*/
|
|
1608
|
-
label?: string;
|
|
1609
|
-
/**
|
|
1610
|
-
* - Additional information about the property
|
|
1611
|
-
*/
|
|
1612
|
-
info?: string;
|
|
1575
|
+
props?: any[];
|
|
1613
1576
|
};
|
|
1614
1577
|
/** @returns {Preset} */
|
|
1615
1578
|
declare function Preset(): Preset;
|
|
@@ -550,17 +550,7 @@ const Joi = require("joi");
|
|
|
550
550
|
|
|
551
551
|
/**
|
|
552
552
|
* @typedef GlobalSchema
|
|
553
|
-
* @property {
|
|
554
|
-
*/
|
|
555
|
-
|
|
556
|
-
/**
|
|
557
|
-
* @typedef Prop
|
|
558
|
-
* @property {string} [type] - The type of the property
|
|
559
|
-
* @property {string} [category] - The category of the property
|
|
560
|
-
* @property {string} [value] - The value of the property
|
|
561
|
-
* @property {string} [id] - The ID of the property
|
|
562
|
-
* @property {string} [label] - The label of the property
|
|
563
|
-
* @property {string} [info] - Additional information about the property
|
|
553
|
+
* @property {Object[]} [props]
|
|
564
554
|
*/
|
|
565
555
|
|
|
566
556
|
/**
|
|
@@ -1428,19 +1418,7 @@ class ThemePartnerModel {
|
|
|
1428
1418
|
/** @returns {GlobalSchema} */
|
|
1429
1419
|
static GlobalSchema() {
|
|
1430
1420
|
return Joi.object({
|
|
1431
|
-
props: Joi.array().items(
|
|
1432
|
-
});
|
|
1433
|
-
}
|
|
1434
|
-
|
|
1435
|
-
/** @returns {Prop} */
|
|
1436
|
-
static Prop() {
|
|
1437
|
-
return Joi.object({
|
|
1438
|
-
type: Joi.string().allow(""),
|
|
1439
|
-
category: Joi.string().allow(""),
|
|
1440
|
-
value: Joi.string().allow(""),
|
|
1441
|
-
id: Joi.string().allow(""),
|
|
1442
|
-
label: Joi.string().allow(""),
|
|
1443
|
-
info: Joi.string().allow(""),
|
|
1421
|
+
props: Joi.array().items(Joi.any()),
|
|
1444
1422
|
});
|
|
1445
1423
|
}
|
|
1446
1424
|
|
|
@@ -379,16 +379,7 @@ export = ThemePlatformModel;
|
|
|
379
379
|
*/
|
|
380
380
|
/**
|
|
381
381
|
* @typedef GlobalSchema
|
|
382
|
-
* @property {
|
|
383
|
-
*/
|
|
384
|
-
/**
|
|
385
|
-
* @typedef Prop
|
|
386
|
-
* @property {string} [type] - The type of the property
|
|
387
|
-
* @property {string} [category] - The category of the property
|
|
388
|
-
* @property {string} [value] - The value of the property
|
|
389
|
-
* @property {string} [id] - The ID of the property
|
|
390
|
-
* @property {string} [label] - The label of the property
|
|
391
|
-
* @property {string} [info] - Additional information about the property
|
|
382
|
+
* @property {Object[]} [props]
|
|
392
383
|
*/
|
|
393
384
|
/**
|
|
394
385
|
* @typedef Assets
|
|
@@ -590,7 +581,7 @@ export = ThemePlatformModel;
|
|
|
590
581
|
declare class ThemePlatformModel {
|
|
591
582
|
}
|
|
592
583
|
declare namespace ThemePlatformModel {
|
|
593
|
-
export { GetExtensionSectionRes, ExtensionSection, PropExtension, AssetsExtension, ThemeReq, CompanyThemeSchema, MarketplaceThemeId, CompanyThemeMeta, ThemePayment, ThemeImages, AvailablePageSchema, AvailablePageSectionMetaAttributes, SEOMetaItem, SEOMetaItems, SEOSitemap, SEObreadcrumb, Action, AvailablePageSeo, AvailablePageSchemaSections, AvailablePagePredicate, AvailablePageScreenPredicate, AvailablePageUserPredicate, AvailablePageRoutePredicate, AvailablePagePlatformPredicate, AvailablePageSchedulePredicate, AllAvailablePageSchema, AddThemeRequestSchema, FontsSchema, BlitzkriegApiErrorSchema, BlitzkriegInternalServerErrorSchema, FontsSchemaItems, FontsSchemaItemsFiles, ThemesSchema, ThemeUpgradableResponse, UpdateThemeNameRequestBody, UpdateThemeRequestBody, Font, FontVariants, FontVariant, Config, ThemeConfiguration, OverlayPopup, DividerStrokeHighlight, UserAlerts, OrderTracking, ThemeConfigListPage, ThemeConfigListPageSettingsProps, CustomConfig, ThemeMeta, Release, Images, CustomProps, GlobalSchema,
|
|
584
|
+
export { GetExtensionSectionRes, ExtensionSection, PropExtension, AssetsExtension, ThemeReq, CompanyThemeSchema, MarketplaceThemeId, CompanyThemeMeta, ThemePayment, ThemeImages, AvailablePageSchema, AvailablePageSectionMetaAttributes, SEOMetaItem, SEOMetaItems, SEOSitemap, SEObreadcrumb, Action, AvailablePageSeo, AvailablePageSchemaSections, AvailablePagePredicate, AvailablePageScreenPredicate, AvailablePageUserPredicate, AvailablePageRoutePredicate, AvailablePagePlatformPredicate, AvailablePageSchedulePredicate, AllAvailablePageSchema, AddThemeRequestSchema, FontsSchema, BlitzkriegApiErrorSchema, BlitzkriegInternalServerErrorSchema, FontsSchemaItems, FontsSchemaItemsFiles, ThemesSchema, ThemeUpgradableResponse, UpdateThemeNameRequestBody, UpdateThemeRequestBody, Font, FontVariants, FontVariant, Config, ThemeConfiguration, OverlayPopup, DividerStrokeHighlight, UserAlerts, OrderTracking, ThemeConfigListPage, ThemeConfigListPageSettingsProps, CustomConfig, ThemeMeta, Release, Images, CustomProps, GlobalSchema, Assets, UMDJs, CommonJS, CSS, SectionItem, Preset, Page, Section, Block, Predicate, Screen, ThemeUserSchema, Route, SectionProps, SectionPreset, BlockProps, TextProp, CheckboxProp, RangeProp, ImagePickerProp, UrlProp, ThemeVersions, DummyResponse, AppliedThemes, CompanyPrivateTheme, ActionPage, PageType };
|
|
594
585
|
}
|
|
595
586
|
/** @returns {GetExtensionSectionRes} */
|
|
596
587
|
declare function GetExtensionSectionRes(): GetExtensionSectionRes;
|
|
@@ -1286,35 +1277,7 @@ type CustomProps = {
|
|
|
1286
1277
|
/** @returns {GlobalSchema} */
|
|
1287
1278
|
declare function GlobalSchema(): GlobalSchema;
|
|
1288
1279
|
type GlobalSchema = {
|
|
1289
|
-
props?:
|
|
1290
|
-
};
|
|
1291
|
-
/** @returns {Prop} */
|
|
1292
|
-
declare function Prop(): Prop;
|
|
1293
|
-
type Prop = {
|
|
1294
|
-
/**
|
|
1295
|
-
* - The type of the property
|
|
1296
|
-
*/
|
|
1297
|
-
type?: string;
|
|
1298
|
-
/**
|
|
1299
|
-
* - The category of the property
|
|
1300
|
-
*/
|
|
1301
|
-
category?: string;
|
|
1302
|
-
/**
|
|
1303
|
-
* - The value of the property
|
|
1304
|
-
*/
|
|
1305
|
-
value?: string;
|
|
1306
|
-
/**
|
|
1307
|
-
* - The ID of the property
|
|
1308
|
-
*/
|
|
1309
|
-
id?: string;
|
|
1310
|
-
/**
|
|
1311
|
-
* - The label of the property
|
|
1312
|
-
*/
|
|
1313
|
-
label?: string;
|
|
1314
|
-
/**
|
|
1315
|
-
* - Additional information about the property
|
|
1316
|
-
*/
|
|
1317
|
-
info?: string;
|
|
1280
|
+
props?: any[];
|
|
1318
1281
|
};
|
|
1319
1282
|
/** @returns {Assets} */
|
|
1320
1283
|
declare function Assets(): Assets;
|
|
@@ -432,17 +432,7 @@ const Joi = require("joi");
|
|
|
432
432
|
|
|
433
433
|
/**
|
|
434
434
|
* @typedef GlobalSchema
|
|
435
|
-
* @property {
|
|
436
|
-
*/
|
|
437
|
-
|
|
438
|
-
/**
|
|
439
|
-
* @typedef Prop
|
|
440
|
-
* @property {string} [type] - The type of the property
|
|
441
|
-
* @property {string} [category] - The category of the property
|
|
442
|
-
* @property {string} [value] - The value of the property
|
|
443
|
-
* @property {string} [id] - The ID of the property
|
|
444
|
-
* @property {string} [label] - The label of the property
|
|
445
|
-
* @property {string} [info] - Additional information about the property
|
|
435
|
+
* @property {Object[]} [props]
|
|
446
436
|
*/
|
|
447
437
|
|
|
448
438
|
/**
|
|
@@ -1206,19 +1196,7 @@ class ThemePlatformModel {
|
|
|
1206
1196
|
/** @returns {GlobalSchema} */
|
|
1207
1197
|
static GlobalSchema() {
|
|
1208
1198
|
return Joi.object({
|
|
1209
|
-
props: Joi.array().items(
|
|
1210
|
-
});
|
|
1211
|
-
}
|
|
1212
|
-
|
|
1213
|
-
/** @returns {Prop} */
|
|
1214
|
-
static Prop() {
|
|
1215
|
-
return Joi.object({
|
|
1216
|
-
type: Joi.string().allow(""),
|
|
1217
|
-
category: Joi.string().allow(""),
|
|
1218
|
-
value: Joi.string().allow(""),
|
|
1219
|
-
id: Joi.string().allow(""),
|
|
1220
|
-
label: Joi.string().allow(""),
|
|
1221
|
-
info: Joi.string().allow(""),
|
|
1199
|
+
props: Joi.array().items(Joi.any()),
|
|
1222
1200
|
});
|
|
1223
1201
|
}
|
|
1224
1202
|
|
|
@@ -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 }
|
|
@@ -129,6 +137,14 @@ class Configuration {
|
|
|
129
137
|
{ authorization, query, requestHeaders } = { requestHeaders: {} },
|
|
130
138
|
{ responseHeaders } = { responseHeaders: false }
|
|
131
139
|
) {
|
|
140
|
+
let invalidInput = [];
|
|
141
|
+
if (invalidInput.length) {
|
|
142
|
+
const error = new Error();
|
|
143
|
+
error.message = "Missing required field";
|
|
144
|
+
error.details = invalidInput;
|
|
145
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
146
|
+
}
|
|
147
|
+
|
|
132
148
|
const { error } = ConfigurationPublicValidator.searchApplication().validate(
|
|
133
149
|
{ authorization, query },
|
|
134
150
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -47,6 +47,21 @@ class Content {
|
|
|
47
47
|
{ entity, requestHeaders } = { requestHeaders: {} },
|
|
48
48
|
{ responseHeaders } = { responseHeaders: false }
|
|
49
49
|
) {
|
|
50
|
+
let invalidInput = [];
|
|
51
|
+
|
|
52
|
+
if (!entity) {
|
|
53
|
+
invalidInput.push({
|
|
54
|
+
message: `The 'entity' field is required.`,
|
|
55
|
+
path: ["entity"],
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
if (invalidInput.length) {
|
|
59
|
+
const error = new Error();
|
|
60
|
+
error.message = "Missing required field";
|
|
61
|
+
error.details = invalidInput;
|
|
62
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
63
|
+
}
|
|
64
|
+
|
|
50
65
|
const { error } = ContentPublicValidator.getCredentialsByEntity().validate(
|
|
51
66
|
{ entity },
|
|
52
67
|
{ 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 }
|