@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
|
@@ -910,6 +910,105 @@ class Order {
|
|
|
910
910
|
return response;
|
|
911
911
|
}
|
|
912
912
|
|
|
913
|
+
/**
|
|
914
|
+
* @param {OrderPlatformValidator.FailedOrderLogsParam} arg - Arg object
|
|
915
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
916
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
917
|
+
* @returns {Promise<OrderPlatformModel.FailedOrderLogs>} - Success response
|
|
918
|
+
* @name failedOrderLogs
|
|
919
|
+
* @summary: List failed order logs
|
|
920
|
+
* @description: Get failed order logs listing for filters based on order Id, user contact number, user email Id and sales channel Id. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/failedOrderLogs/).
|
|
921
|
+
*/
|
|
922
|
+
async failedOrderLogs(
|
|
923
|
+
{
|
|
924
|
+
applicationId,
|
|
925
|
+
pageNo,
|
|
926
|
+
pageSize,
|
|
927
|
+
searchType,
|
|
928
|
+
searchValue,
|
|
929
|
+
requestHeaders,
|
|
930
|
+
} = { requestHeaders: {} },
|
|
931
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
932
|
+
) {
|
|
933
|
+
const { error } = OrderPlatformValidator.failedOrderLogs().validate(
|
|
934
|
+
{
|
|
935
|
+
applicationId,
|
|
936
|
+
pageNo,
|
|
937
|
+
pageSize,
|
|
938
|
+
searchType,
|
|
939
|
+
searchValue,
|
|
940
|
+
},
|
|
941
|
+
{ abortEarly: false, allowUnknown: true }
|
|
942
|
+
);
|
|
943
|
+
if (error) {
|
|
944
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
945
|
+
}
|
|
946
|
+
|
|
947
|
+
// Showing warrnings if extra unknown parameters are found
|
|
948
|
+
const {
|
|
949
|
+
error: warrning,
|
|
950
|
+
} = OrderPlatformValidator.failedOrderLogs().validate(
|
|
951
|
+
{
|
|
952
|
+
applicationId,
|
|
953
|
+
pageNo,
|
|
954
|
+
pageSize,
|
|
955
|
+
searchType,
|
|
956
|
+
searchValue,
|
|
957
|
+
},
|
|
958
|
+
{ abortEarly: false, allowUnknown: false }
|
|
959
|
+
);
|
|
960
|
+
if (warrning) {
|
|
961
|
+
Logger({
|
|
962
|
+
level: "WARN",
|
|
963
|
+
message: `Parameter Validation warrnings for platform > Order > failedOrderLogs \n ${warrning}`,
|
|
964
|
+
});
|
|
965
|
+
}
|
|
966
|
+
|
|
967
|
+
const query_params = {};
|
|
968
|
+
query_params["application_id"] = applicationId;
|
|
969
|
+
query_params["page_no"] = pageNo;
|
|
970
|
+
query_params["page_size"] = pageSize;
|
|
971
|
+
query_params["search_type"] = searchType;
|
|
972
|
+
query_params["search_value"] = searchValue;
|
|
973
|
+
|
|
974
|
+
const xHeaders = {};
|
|
975
|
+
|
|
976
|
+
const response = await PlatformAPIClient.execute(
|
|
977
|
+
this.config,
|
|
978
|
+
"get",
|
|
979
|
+
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/orders/failed`,
|
|
980
|
+
query_params,
|
|
981
|
+
undefined,
|
|
982
|
+
{ ...xHeaders, ...requestHeaders },
|
|
983
|
+
{ responseHeaders }
|
|
984
|
+
);
|
|
985
|
+
|
|
986
|
+
let responseData = response;
|
|
987
|
+
if (responseHeaders) {
|
|
988
|
+
responseData = response[0];
|
|
989
|
+
}
|
|
990
|
+
|
|
991
|
+
const {
|
|
992
|
+
error: res_error,
|
|
993
|
+
} = OrderPlatformModel.FailedOrderLogs().validate(responseData, {
|
|
994
|
+
abortEarly: false,
|
|
995
|
+
allowUnknown: true,
|
|
996
|
+
});
|
|
997
|
+
|
|
998
|
+
if (res_error) {
|
|
999
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
1000
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1001
|
+
} else {
|
|
1002
|
+
Logger({
|
|
1003
|
+
level: "WARN",
|
|
1004
|
+
message: `Response Validation Warnings for platform > Order > failedOrderLogs \n ${res_error}`,
|
|
1005
|
+
});
|
|
1006
|
+
}
|
|
1007
|
+
}
|
|
1008
|
+
|
|
1009
|
+
return response;
|
|
1010
|
+
}
|
|
1011
|
+
|
|
913
1012
|
/**
|
|
914
1013
|
* @param {OrderPlatformValidator.FetchRefundModeConfigParam} arg - Arg object
|
|
915
1014
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
@@ -51,6 +51,14 @@ export = OrderPlatformValidator;
|
|
|
51
51
|
* @typedef FailedOrderLogDetailsParam
|
|
52
52
|
* @property {string} logId - Log Error ID
|
|
53
53
|
*/
|
|
54
|
+
/**
|
|
55
|
+
* @typedef FailedOrderLogsParam
|
|
56
|
+
* @property {string} [applicationId] - Application ID
|
|
57
|
+
* @property {number} [pageNo] - Page Number
|
|
58
|
+
* @property {number} [pageSize] - Page Size
|
|
59
|
+
* @property {string} [searchType] - Search type for filter
|
|
60
|
+
* @property {string} [searchValue] - Search value for filter
|
|
61
|
+
*/
|
|
54
62
|
/**
|
|
55
63
|
* @typedef FetchRefundModeConfigParam
|
|
56
64
|
* @property {OrderPlatformModel.RefundModeConfigRequestPayload} body
|
|
@@ -410,6 +418,8 @@ declare class OrderPlatformValidator {
|
|
|
410
418
|
static eInvoiceRetry(): EInvoiceRetryParam;
|
|
411
419
|
/** @returns {FailedOrderLogDetailsParam} */
|
|
412
420
|
static failedOrderLogDetails(): FailedOrderLogDetailsParam;
|
|
421
|
+
/** @returns {FailedOrderLogsParam} */
|
|
422
|
+
static failedOrderLogs(): FailedOrderLogsParam;
|
|
413
423
|
/** @returns {FetchRefundModeConfigParam} */
|
|
414
424
|
static fetchRefundModeConfig(): FetchRefundModeConfigParam;
|
|
415
425
|
/** @returns {GenerateInvoiceIDParam} */
|
|
@@ -498,7 +508,7 @@ declare class OrderPlatformValidator {
|
|
|
498
508
|
static verifyMobileOTP(): VerifyMobileOTPParam;
|
|
499
509
|
}
|
|
500
510
|
declare namespace OrderPlatformValidator {
|
|
501
|
-
export { AddStateManagerConfigParam, AttachOrderUserParam, BulkListingParam, BulkStateTransistionParam, CheckOrderStatusParam, CreateOrderParam, DispatchManifestsParam, DownloadBulkActionTemplateParam, DownloadLanesReportParam, EInvoiceRetryParam, FailedOrderLogDetailsParam, FetchRefundModeConfigParam, GenerateInvoiceIDParam, GeneratePOSReceiptByOrderIdParam, GenerateProcessManifestParam, GetAllowedStateTransitionParam, GetAllowedTemplatesForBulkParam, GetAnnouncementsParam, GetBagByIdParam, GetBagsParam, GetBulkActionTemplateParam, GetBulkShipmentExcelFileParam, GetFileByStatusParam, GetLaneConfigParam, GetManifestDetailsParam, GetManifestShipmentsParam, GetManifestfiltersParam, GetManifestsParam, GetOrderByIdParam, GetOrdersParam, GetRoleBasedActionsParam, GetShipmentByIdParam, GetShipmentHistoryParam, GetShipmentReasonsParam, GetShipmentsParam, GetStateManagerConfigParam, GetStateTransitionMapParam, GetTemplateParam, GetfiltersParam, InvalidateShipmentCacheParam, JobDetailsParam, OrderUpdateParam, PostShipmentHistoryParam, ReassignLocationParam, SendSmsNinjaParam, SendUserMobileOTPParam, TrackShipmentParam, UpdateAddressParam, UpdatePackagingDimensionsParam, UpdateShipmentLockParam, UpdateShipmentStatusParam, UpdateShipmentTrackingParam, UploadConsentsParam, VerifyMobileOTPParam };
|
|
511
|
+
export { AddStateManagerConfigParam, AttachOrderUserParam, BulkListingParam, BulkStateTransistionParam, CheckOrderStatusParam, CreateOrderParam, DispatchManifestsParam, DownloadBulkActionTemplateParam, DownloadLanesReportParam, EInvoiceRetryParam, FailedOrderLogDetailsParam, FailedOrderLogsParam, FetchRefundModeConfigParam, GenerateInvoiceIDParam, GeneratePOSReceiptByOrderIdParam, GenerateProcessManifestParam, GetAllowedStateTransitionParam, GetAllowedTemplatesForBulkParam, GetAnnouncementsParam, GetBagByIdParam, GetBagsParam, GetBulkActionTemplateParam, GetBulkShipmentExcelFileParam, GetFileByStatusParam, GetLaneConfigParam, GetManifestDetailsParam, GetManifestShipmentsParam, GetManifestfiltersParam, GetManifestsParam, GetOrderByIdParam, GetOrdersParam, GetRoleBasedActionsParam, GetShipmentByIdParam, GetShipmentHistoryParam, GetShipmentReasonsParam, GetShipmentsParam, GetStateManagerConfigParam, GetStateTransitionMapParam, GetTemplateParam, GetfiltersParam, InvalidateShipmentCacheParam, JobDetailsParam, OrderUpdateParam, PostShipmentHistoryParam, ReassignLocationParam, SendSmsNinjaParam, SendUserMobileOTPParam, TrackShipmentParam, UpdateAddressParam, UpdatePackagingDimensionsParam, UpdateShipmentLockParam, UpdateShipmentStatusParam, UpdateShipmentTrackingParam, UploadConsentsParam, VerifyMobileOTPParam };
|
|
502
512
|
}
|
|
503
513
|
type AddStateManagerConfigParam = {
|
|
504
514
|
body: OrderPlatformModel.TransitionConfigPayload;
|
|
@@ -568,6 +578,28 @@ type FailedOrderLogDetailsParam = {
|
|
|
568
578
|
*/
|
|
569
579
|
logId: string;
|
|
570
580
|
};
|
|
581
|
+
type FailedOrderLogsParam = {
|
|
582
|
+
/**
|
|
583
|
+
* - Application ID
|
|
584
|
+
*/
|
|
585
|
+
applicationId?: string;
|
|
586
|
+
/**
|
|
587
|
+
* - Page Number
|
|
588
|
+
*/
|
|
589
|
+
pageNo?: number;
|
|
590
|
+
/**
|
|
591
|
+
* - Page Size
|
|
592
|
+
*/
|
|
593
|
+
pageSize?: number;
|
|
594
|
+
/**
|
|
595
|
+
* - Search type for filter
|
|
596
|
+
*/
|
|
597
|
+
searchType?: string;
|
|
598
|
+
/**
|
|
599
|
+
* - Search value for filter
|
|
600
|
+
*/
|
|
601
|
+
searchValue?: string;
|
|
602
|
+
};
|
|
571
603
|
type FetchRefundModeConfigParam = {
|
|
572
604
|
body: OrderPlatformModel.RefundModeConfigRequestPayload;
|
|
573
605
|
};
|
|
@@ -65,6 +65,15 @@ const OrderPlatformModel = require("./OrderPlatformModel");
|
|
|
65
65
|
* @property {string} logId - Log Error ID
|
|
66
66
|
*/
|
|
67
67
|
|
|
68
|
+
/**
|
|
69
|
+
* @typedef FailedOrderLogsParam
|
|
70
|
+
* @property {string} [applicationId] - Application ID
|
|
71
|
+
* @property {number} [pageNo] - Page Number
|
|
72
|
+
* @property {number} [pageSize] - Page Size
|
|
73
|
+
* @property {string} [searchType] - Search type for filter
|
|
74
|
+
* @property {string} [searchValue] - Search value for filter
|
|
75
|
+
*/
|
|
76
|
+
|
|
68
77
|
/**
|
|
69
78
|
* @typedef FetchRefundModeConfigParam
|
|
70
79
|
* @property {OrderPlatformModel.RefundModeConfigRequestPayload} body
|
|
@@ -528,6 +537,17 @@ class OrderPlatformValidator {
|
|
|
528
537
|
}).required();
|
|
529
538
|
}
|
|
530
539
|
|
|
540
|
+
/** @returns {FailedOrderLogsParam} */
|
|
541
|
+
static failedOrderLogs() {
|
|
542
|
+
return Joi.object({
|
|
543
|
+
applicationId: Joi.string().allow(""),
|
|
544
|
+
pageNo: Joi.number(),
|
|
545
|
+
pageSize: Joi.number(),
|
|
546
|
+
searchType: Joi.string().allow(""),
|
|
547
|
+
searchValue: Joi.string().allow(""),
|
|
548
|
+
}).required();
|
|
549
|
+
}
|
|
550
|
+
|
|
531
551
|
/** @returns {FetchRefundModeConfigParam} */
|
|
532
552
|
static fetchRefundModeConfig() {
|
|
533
553
|
return Joi.object({
|
|
@@ -6,6 +6,7 @@ const {
|
|
|
6
6
|
const PublicAPIClient = require("../PublicAPIClient");
|
|
7
7
|
const constructUrl = require("../constructUrl");
|
|
8
8
|
const Paginator = require("../../common/Paginator");
|
|
9
|
+
const { validateRequiredParams } = require("../../common/Validator");
|
|
9
10
|
|
|
10
11
|
const ConfigurationPublicValidator = require("./ConfigurationPublicValidator");
|
|
11
12
|
const ConfigurationPublicModel = require("./ConfigurationPublicModel");
|
|
@@ -49,14 +50,6 @@ class Configuration {
|
|
|
49
50
|
{ locationType, id, requestHeaders } = { requestHeaders: {} },
|
|
50
51
|
{ responseHeaders } = { responseHeaders: false }
|
|
51
52
|
) {
|
|
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
|
-
|
|
60
53
|
const { error } = ConfigurationPublicValidator.getLocations().validate(
|
|
61
54
|
{ locationType, id },
|
|
62
55
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -137,14 +130,6 @@ class Configuration {
|
|
|
137
130
|
{ authorization, query, requestHeaders } = { requestHeaders: {} },
|
|
138
131
|
{ responseHeaders } = { responseHeaders: false }
|
|
139
132
|
) {
|
|
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
|
-
|
|
148
133
|
const { error } = ConfigurationPublicValidator.searchApplication().validate(
|
|
149
134
|
{ authorization, query },
|
|
150
135
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -16,7 +16,7 @@ declare class Content {
|
|
|
16
16
|
* @summary: Get credentials to power chat support systems
|
|
17
17
|
* @description: Get credentials for support system - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/public/content/getCredentialsByEntity/).
|
|
18
18
|
*/
|
|
19
|
-
getCredentialsByEntity({ entity, requestHeaders }?: ContentPublicValidator.GetCredentialsByEntityParam, { responseHeaders }?: object): Promise<ContentPublicModel.CredentialsSchema>;
|
|
19
|
+
getCredentialsByEntity({ entity, requestHeaders }?: ContentPublicValidator.GetCredentialsByEntityParam, { responseHeaders }?: object, ...args: any[]): Promise<ContentPublicModel.CredentialsSchema>;
|
|
20
20
|
}
|
|
21
21
|
import ContentPublicValidator = require("./ContentPublicValidator");
|
|
22
22
|
import ContentPublicModel = require("./ContentPublicModel");
|
|
@@ -6,6 +6,7 @@ const {
|
|
|
6
6
|
const PublicAPIClient = require("../PublicAPIClient");
|
|
7
7
|
const constructUrl = require("../constructUrl");
|
|
8
8
|
const Paginator = require("../../common/Paginator");
|
|
9
|
+
const { validateRequiredParams } = require("../../common/Validator");
|
|
9
10
|
|
|
10
11
|
const ContentPublicValidator = require("./ContentPublicValidator");
|
|
11
12
|
const ContentPublicModel = require("./ContentPublicModel");
|
|
@@ -47,18 +48,12 @@ class Content {
|
|
|
47
48
|
{ entity, requestHeaders } = { requestHeaders: {} },
|
|
48
49
|
{ responseHeaders } = { responseHeaders: false }
|
|
49
50
|
) {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
path: ["entity"],
|
|
51
|
+
const errors = validateRequiredParams(arguments[0], ["entity"]);
|
|
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
|
|
|
@@ -16,7 +16,7 @@ declare class Partner {
|
|
|
16
16
|
* @summary: Get panel extension details
|
|
17
17
|
* @description: Retrieve detailed information about panel extensions in the public server setup. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/public/partner/getPanelExtensionDetails/).
|
|
18
18
|
*/
|
|
19
|
-
getPanelExtensionDetails({ slug, requestHeaders }?: PartnerPublicValidator.GetPanelExtensionDetailsParam, { responseHeaders }?: object): Promise<PartnerPublicModel.ExtensionUsingSlug>;
|
|
19
|
+
getPanelExtensionDetails({ slug, requestHeaders }?: PartnerPublicValidator.GetPanelExtensionDetailsParam, { responseHeaders }?: object, ...args: any[]): Promise<PartnerPublicModel.ExtensionUsingSlug>;
|
|
20
20
|
}
|
|
21
21
|
import PartnerPublicValidator = require("./PartnerPublicValidator");
|
|
22
22
|
import PartnerPublicModel = require("./PartnerPublicModel");
|
|
@@ -6,6 +6,7 @@ const {
|
|
|
6
6
|
const PublicAPIClient = require("../PublicAPIClient");
|
|
7
7
|
const constructUrl = require("../constructUrl");
|
|
8
8
|
const Paginator = require("../../common/Paginator");
|
|
9
|
+
const { validateRequiredParams } = require("../../common/Validator");
|
|
9
10
|
|
|
10
11
|
const PartnerPublicValidator = require("./PartnerPublicValidator");
|
|
11
12
|
const PartnerPublicModel = require("./PartnerPublicModel");
|
|
@@ -48,18 +49,12 @@ class Partner {
|
|
|
48
49
|
{ slug, requestHeaders } = { requestHeaders: {} },
|
|
49
50
|
{ responseHeaders } = { responseHeaders: false }
|
|
50
51
|
) {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
path: ["slug"],
|
|
52
|
+
const errors = validateRequiredParams(arguments[0], ["slug"]);
|
|
53
|
+
if (errors.length > 0) {
|
|
54
|
+
const error = new FDKClientValidationError({
|
|
55
|
+
message: "Missing required field",
|
|
56
|
+
details: errors,
|
|
57
57
|
});
|
|
58
|
-
}
|
|
59
|
-
if (invalidInput.length) {
|
|
60
|
-
const error = new Error();
|
|
61
|
-
error.message = "Missing required field";
|
|
62
|
-
error.details = invalidInput;
|
|
63
58
|
return Promise.reject(new FDKClientValidationError(error));
|
|
64
59
|
}
|
|
65
60
|
|
|
@@ -6,6 +6,7 @@ const {
|
|
|
6
6
|
const PublicAPIClient = require("../PublicAPIClient");
|
|
7
7
|
const constructUrl = require("../constructUrl");
|
|
8
8
|
const Paginator = require("../../common/Paginator");
|
|
9
|
+
const { validateRequiredParams } = require("../../common/Validator");
|
|
9
10
|
|
|
10
11
|
const WebhookPublicValidator = require("./WebhookPublicValidator");
|
|
11
12
|
const WebhookPublicModel = require("./WebhookPublicModel");
|
|
@@ -55,14 +56,6 @@ class Webhook {
|
|
|
55
56
|
{ requestHeaders } = { requestHeaders: {} },
|
|
56
57
|
{ responseHeaders } = { responseHeaders: false }
|
|
57
58
|
) {
|
|
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
|
-
|
|
66
59
|
const { error } = WebhookPublicValidator.fetchAllWebhookEvents().validate(
|
|
67
60
|
{},
|
|
68
61
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -141,14 +134,6 @@ class Webhook {
|
|
|
141
134
|
{ requestHeaders } = { requestHeaders: {} },
|
|
142
135
|
{ responseHeaders } = { responseHeaders: false }
|
|
143
136
|
) {
|
|
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
|
-
|
|
152
137
|
const { error } = WebhookPublicValidator.notifyDepricatedEvent().validate(
|
|
153
138
|
{},
|
|
154
139
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -227,14 +212,6 @@ class Webhook {
|
|
|
227
212
|
{ body, requestHeaders } = { requestHeaders: {} },
|
|
228
213
|
{ responseHeaders } = { responseHeaders: false }
|
|
229
214
|
) {
|
|
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
|
-
|
|
238
215
|
const {
|
|
239
216
|
error,
|
|
240
217
|
} = WebhookPublicValidator.queryWebhookEventDetails().validate(
|
|
@@ -315,14 +292,6 @@ class Webhook {
|
|
|
315
292
|
{ body, requestHeaders } = { requestHeaders: {} },
|
|
316
293
|
{ responseHeaders } = { responseHeaders: false }
|
|
317
294
|
) {
|
|
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
|
-
|
|
326
295
|
const {
|
|
327
296
|
error,
|
|
328
297
|
} = WebhookPublicValidator.testHandlerTransformation().validate(
|
|
@@ -403,14 +372,6 @@ class Webhook {
|
|
|
403
372
|
{ body, requestHeaders } = { requestHeaders: {} },
|
|
404
373
|
{ responseHeaders } = { responseHeaders: false }
|
|
405
374
|
) {
|
|
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
|
-
|
|
414
375
|
const { error } = WebhookPublicValidator.validateSchema().validate(
|
|
415
376
|
{ body },
|
|
416
377
|
{ abortEarly: false, allowUnknown: true }
|