@gofynd/fdk-client-javascript 1.4.7 → 1.4.8-beta.3
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 +16 -3
- package/sdk/application/Cart/CartApplicationClient.js +118 -13
- package/sdk/application/Cart/CartApplicationModel.d.ts +121 -45
- package/sdk/application/Cart/CartApplicationModel.js +98 -26
- package/sdk/application/Cart/CartApplicationValidator.d.ts +45 -1
- package/sdk/application/Cart/CartApplicationValidator.js +26 -0
- package/sdk/application/Catalog/CatalogApplicationModel.d.ts +4 -2
- package/sdk/application/Catalog/CatalogApplicationModel.js +4 -2
- package/sdk/application/Content/ContentApplicationClient.d.ts +1 -1
- package/sdk/application/Content/ContentApplicationClient.js +5 -3
- package/sdk/application/Content/ContentApplicationModel.d.ts +7 -18
- package/sdk/application/Content/ContentApplicationModel.js +6 -20
- package/sdk/application/Content/ContentApplicationValidator.d.ts +10 -0
- package/sdk/application/Content/ContentApplicationValidator.js +4 -0
- package/sdk/application/Lead/LeadApplicationClient.d.ts +0 -27
- package/sdk/application/Lead/LeadApplicationClient.js +0 -167
- package/sdk/application/Lead/LeadApplicationModel.d.ts +1 -146
- package/sdk/application/Lead/LeadApplicationModel.js +0 -126
- package/sdk/application/Lead/LeadApplicationValidator.d.ts +1 -25
- package/sdk/application/Lead/LeadApplicationValidator.js +0 -24
- package/sdk/application/Logistic/LogisticApplicationClient.js +1 -1
- package/sdk/application/Logistic/LogisticApplicationModel.d.ts +2 -0
- package/sdk/application/Logistic/LogisticApplicationModel.js +2 -0
- package/sdk/application/Order/OrderApplicationModel.d.ts +4 -0
- package/sdk/application/Order/OrderApplicationModel.js +4 -0
- package/sdk/application/Payment/PaymentApplicationModel.d.ts +9 -2
- package/sdk/application/Payment/PaymentApplicationModel.js +5 -2
- package/sdk/application/Theme/ThemeApplicationModel.d.ts +2 -0
- package/sdk/application/Theme/ThemeApplicationModel.js +2 -0
- package/sdk/partner/Lead/LeadPartnerClient.d.ts +0 -23
- package/sdk/partner/Lead/LeadPartnerClient.js +0 -157
- package/sdk/partner/Lead/LeadPartnerModel.d.ts +12 -581
- package/sdk/partner/Lead/LeadPartnerModel.js +14 -403
- package/sdk/partner/Lead/LeadPartnerValidator.d.ts +0 -2
- package/sdk/partner/Lead/LeadPartnerValidator.js +0 -12
- package/sdk/partner/Logistics/LogisticsPartnerClient.js +1 -1
- package/sdk/partner/Logistics/LogisticsPartnerModel.d.ts +47 -1
- package/sdk/partner/Logistics/LogisticsPartnerModel.js +56 -4
- package/sdk/partner/Logistics/LogisticsPartnerValidator.js +2 -2
- package/sdk/partner/Theme/ThemePartnerClient.d.ts +22 -0
- package/sdk/partner/Theme/ThemePartnerClient.js +162 -0
- package/sdk/partner/Theme/ThemePartnerModel.d.ts +119 -1
- package/sdk/partner/Theme/ThemePartnerModel.js +142 -0
- package/sdk/partner/Theme/ThemePartnerValidator.d.ts +2 -0
- package/sdk/partner/Theme/ThemePartnerValidator.js +14 -0
- package/sdk/platform/Billing/BillingPlatformClient.d.ts +304 -43
- package/sdk/platform/Billing/BillingPlatformClient.js +2218 -118
- package/sdk/platform/Billing/BillingPlatformModel.d.ts +1330 -282
- package/sdk/platform/Billing/BillingPlatformModel.js +1808 -590
- package/sdk/platform/Billing/BillingPlatformValidator.d.ts +324 -16
- package/sdk/platform/Billing/BillingPlatformValidator.js +340 -12
- package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +28 -5
- package/sdk/platform/Cart/CartPlatformApplicationClient.js +198 -5
- package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +81 -1
- package/sdk/platform/Cart/CartPlatformApplicationValidator.js +48 -0
- package/sdk/platform/Cart/CartPlatformModel.d.ts +214 -40
- package/sdk/platform/Cart/CartPlatformModel.js +164 -24
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +1 -1
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +20 -0
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +37 -0
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +16 -0
- package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +2 -2
- package/sdk/platform/Catalog/CatalogPlatformClient.js +18 -2
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +4 -0
- package/sdk/platform/Catalog/CatalogPlatformModel.js +4 -0
- package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +28 -0
- package/sdk/platform/Catalog/CatalogPlatformValidator.js +12 -0
- package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +1 -1
- package/sdk/platform/Content/ContentPlatformApplicationClient.js +18 -1
- package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +25 -0
- package/sdk/platform/Content/ContentPlatformApplicationValidator.js +10 -0
- package/sdk/platform/Content/ContentPlatformModel.d.ts +8 -4
- package/sdk/platform/Content/ContentPlatformModel.js +8 -4
- package/sdk/platform/Finance/FinancePlatformClient.d.ts +49 -28
- package/sdk/platform/Finance/FinancePlatformClient.js +181 -28
- package/sdk/platform/Finance/FinancePlatformModel.d.ts +369 -129
- package/sdk/platform/Finance/FinancePlatformModel.js +404 -110
- package/sdk/platform/Finance/FinancePlatformValidator.d.ts +56 -43
- package/sdk/platform/Finance/FinancePlatformValidator.js +61 -42
- package/sdk/platform/Lead/LeadPlatformApplicationClient.d.ts +0 -47
- package/sdk/platform/Lead/LeadPlatformApplicationClient.js +0 -321
- package/sdk/platform/Lead/LeadPlatformApplicationValidator.d.ts +1 -46
- package/sdk/platform/Lead/LeadPlatformApplicationValidator.js +0 -48
- package/sdk/platform/Lead/LeadPlatformClient.d.ts +2 -25
- package/sdk/platform/Lead/LeadPlatformClient.js +2 -167
- package/sdk/platform/Lead/LeadPlatformModel.d.ts +82 -204
- package/sdk/platform/Lead/LeadPlatformModel.js +98 -178
- package/sdk/platform/Lead/LeadPlatformValidator.d.ts +1 -25
- package/sdk/platform/Lead/LeadPlatformValidator.js +0 -24
- package/sdk/platform/Order/OrderPlatformModel.d.ts +126 -15
- package/sdk/platform/Order/OrderPlatformModel.js +55 -14
- package/sdk/platform/Payment/PaymentPlatformModel.d.ts +12 -0
- package/sdk/platform/Payment/PaymentPlatformModel.js +5 -0
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +1 -1
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +4 -4
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +20 -1
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +26 -4
- package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.d.ts +4 -4
- package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.js +4 -4
- package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +12 -0
- package/sdk/platform/Theme/ThemePlatformApplicationClient.js +82 -0
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.d.ts +18 -1
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.js +14 -0
- package/sdk/platform/Theme/ThemePlatformModel.d.ts +67 -1
- package/sdk/platform/Theme/ThemePlatformModel.js +78 -0
- package/sdk/platform/User/UserPlatformModel.d.ts +0 -2
- package/sdk/platform/User/UserPlatformModel.js +0 -2
- package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +0 -40
- package/sdk/platform/Webhook/WebhookPlatformClient.js +0 -307
- package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +94 -146
- package/sdk/platform/Webhook/WebhookPlatformModel.js +100 -151
- package/sdk/platform/Webhook/WebhookPlatformValidator.d.ts +9 -35
- package/sdk/platform/Webhook/WebhookPlatformValidator.js +8 -46
- package/sdk/public/Billing/BillingPublicClient.d.ts +24 -2
- package/sdk/public/Billing/BillingPublicClient.js +156 -3
- package/sdk/public/Billing/BillingPublicModel.d.ts +368 -26
- package/sdk/public/Billing/BillingPublicModel.js +317 -18
- package/sdk/public/Billing/BillingPublicValidator.d.ts +19 -3
- package/sdk/public/Billing/BillingPublicValidator.js +22 -3
- package/sdk/public/Webhook/WebhookPublicModel.d.ts +22 -22
- package/sdk/public/Webhook/WebhookPublicModel.js +22 -22
|
@@ -331,85 +331,6 @@ class Webhook {
|
|
|
331
331
|
return response;
|
|
332
332
|
}
|
|
333
333
|
|
|
334
|
-
/**
|
|
335
|
-
* @param {WebhookPlatformValidator.GetEventCountsParam} arg - Arg object
|
|
336
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
337
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
338
|
-
* @returns {Promise<WebhookPlatformModel.RetryCountResponse>} - Success response
|
|
339
|
-
* @name getEventCounts
|
|
340
|
-
* @summary: Get event counts
|
|
341
|
-
* @description: Retrieve the counts of events based on their status. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/webhook/getEventCounts/).
|
|
342
|
-
*/
|
|
343
|
-
async getEventCounts(
|
|
344
|
-
{ body, requestHeaders } = { requestHeaders: {} },
|
|
345
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
346
|
-
) {
|
|
347
|
-
const { error } = WebhookPlatformValidator.getEventCounts().validate(
|
|
348
|
-
{
|
|
349
|
-
body,
|
|
350
|
-
},
|
|
351
|
-
{ abortEarly: false, allowUnknown: true }
|
|
352
|
-
);
|
|
353
|
-
if (error) {
|
|
354
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
// Showing warrnings if extra unknown parameters are found
|
|
358
|
-
const {
|
|
359
|
-
error: warrning,
|
|
360
|
-
} = WebhookPlatformValidator.getEventCounts().validate(
|
|
361
|
-
{
|
|
362
|
-
body,
|
|
363
|
-
},
|
|
364
|
-
{ abortEarly: false, allowUnknown: false }
|
|
365
|
-
);
|
|
366
|
-
if (warrning) {
|
|
367
|
-
Logger({
|
|
368
|
-
level: "WARN",
|
|
369
|
-
message: `Parameter Validation warrnings for platform > Webhook > getEventCounts \n ${warrning}`,
|
|
370
|
-
});
|
|
371
|
-
}
|
|
372
|
-
|
|
373
|
-
const query_params = {};
|
|
374
|
-
|
|
375
|
-
const xHeaders = {};
|
|
376
|
-
|
|
377
|
-
const response = await PlatformAPIClient.execute(
|
|
378
|
-
this.config,
|
|
379
|
-
"post",
|
|
380
|
-
`/service/platform/webhook/v1.0/company/${this.config.companyId}/retry/events/counts`,
|
|
381
|
-
query_params,
|
|
382
|
-
body,
|
|
383
|
-
{ ...xHeaders, ...requestHeaders },
|
|
384
|
-
{ responseHeaders }
|
|
385
|
-
);
|
|
386
|
-
|
|
387
|
-
let responseData = response;
|
|
388
|
-
if (responseHeaders) {
|
|
389
|
-
responseData = response[0];
|
|
390
|
-
}
|
|
391
|
-
|
|
392
|
-
const {
|
|
393
|
-
error: res_error,
|
|
394
|
-
} = WebhookPlatformModel.RetryCountResponse().validate(responseData, {
|
|
395
|
-
abortEarly: false,
|
|
396
|
-
allowUnknown: true,
|
|
397
|
-
});
|
|
398
|
-
|
|
399
|
-
if (res_error) {
|
|
400
|
-
if (this.config.options.strictResponseCheck === true) {
|
|
401
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
402
|
-
} else {
|
|
403
|
-
Logger({
|
|
404
|
-
level: "WARN",
|
|
405
|
-
message: `Response Validation Warnings for platform > Webhook > getEventCounts \n ${res_error}`,
|
|
406
|
-
});
|
|
407
|
-
}
|
|
408
|
-
}
|
|
409
|
-
|
|
410
|
-
return response;
|
|
411
|
-
}
|
|
412
|
-
|
|
413
334
|
/**
|
|
414
335
|
* @param {WebhookPlatformValidator.GetHistoricalReportsParam} arg - Arg object
|
|
415
336
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
@@ -489,81 +410,6 @@ class Webhook {
|
|
|
489
410
|
return response;
|
|
490
411
|
}
|
|
491
412
|
|
|
492
|
-
/**
|
|
493
|
-
* @param {WebhookPlatformValidator.GetManualRetryStatusParam} arg - Arg object
|
|
494
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
495
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
496
|
-
* @returns {Promise<WebhookPlatformModel.RetryStatusResponse>} - Success response
|
|
497
|
-
* @name getManualRetryStatus
|
|
498
|
-
* @summary: Get manual retry status
|
|
499
|
-
* @description: Check the status of a manual retry operation. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/webhook/getManualRetryStatus/).
|
|
500
|
-
*/
|
|
501
|
-
async getManualRetryStatus(
|
|
502
|
-
{ requestHeaders } = { requestHeaders: {} },
|
|
503
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
504
|
-
) {
|
|
505
|
-
const { error } = WebhookPlatformValidator.getManualRetryStatus().validate(
|
|
506
|
-
{},
|
|
507
|
-
{ abortEarly: false, allowUnknown: true }
|
|
508
|
-
);
|
|
509
|
-
if (error) {
|
|
510
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
511
|
-
}
|
|
512
|
-
|
|
513
|
-
// Showing warrnings if extra unknown parameters are found
|
|
514
|
-
const {
|
|
515
|
-
error: warrning,
|
|
516
|
-
} = WebhookPlatformValidator.getManualRetryStatus().validate(
|
|
517
|
-
{},
|
|
518
|
-
{ abortEarly: false, allowUnknown: false }
|
|
519
|
-
);
|
|
520
|
-
if (warrning) {
|
|
521
|
-
Logger({
|
|
522
|
-
level: "WARN",
|
|
523
|
-
message: `Parameter Validation warrnings for platform > Webhook > getManualRetryStatus \n ${warrning}`,
|
|
524
|
-
});
|
|
525
|
-
}
|
|
526
|
-
|
|
527
|
-
const query_params = {};
|
|
528
|
-
|
|
529
|
-
const xHeaders = {};
|
|
530
|
-
|
|
531
|
-
const response = await PlatformAPIClient.execute(
|
|
532
|
-
this.config,
|
|
533
|
-
"get",
|
|
534
|
-
`/service/platform/webhook/v1.0/company/${this.config.companyId}/retry/status`,
|
|
535
|
-
query_params,
|
|
536
|
-
undefined,
|
|
537
|
-
{ ...xHeaders, ...requestHeaders },
|
|
538
|
-
{ responseHeaders }
|
|
539
|
-
);
|
|
540
|
-
|
|
541
|
-
let responseData = response;
|
|
542
|
-
if (responseHeaders) {
|
|
543
|
-
responseData = response[0];
|
|
544
|
-
}
|
|
545
|
-
|
|
546
|
-
const {
|
|
547
|
-
error: res_error,
|
|
548
|
-
} = WebhookPlatformModel.RetryStatusResponse().validate(responseData, {
|
|
549
|
-
abortEarly: false,
|
|
550
|
-
allowUnknown: true,
|
|
551
|
-
});
|
|
552
|
-
|
|
553
|
-
if (res_error) {
|
|
554
|
-
if (this.config.options.strictResponseCheck === true) {
|
|
555
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
556
|
-
} else {
|
|
557
|
-
Logger({
|
|
558
|
-
level: "WARN",
|
|
559
|
-
message: `Response Validation Warnings for platform > Webhook > getManualRetryStatus \n ${res_error}`,
|
|
560
|
-
});
|
|
561
|
-
}
|
|
562
|
-
}
|
|
563
|
-
|
|
564
|
-
return response;
|
|
565
|
-
}
|
|
566
|
-
|
|
567
413
|
/**
|
|
568
414
|
* @param {WebhookPlatformValidator.GetReportFiltersParam} arg - Arg object
|
|
569
415
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
@@ -894,159 +740,6 @@ class Webhook {
|
|
|
894
740
|
return response;
|
|
895
741
|
}
|
|
896
742
|
|
|
897
|
-
/**
|
|
898
|
-
* @param {WebhookPlatformValidator.ManualRetryCancelParam} arg - Arg object
|
|
899
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
900
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
901
|
-
* @returns {Promise<string>} - Success response
|
|
902
|
-
* @name manualRetryCancel
|
|
903
|
-
* @summary: Manual retry cancellation
|
|
904
|
-
* @description: Cancel a manual retry operation for a failed event. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/webhook/manualRetryCancel/).
|
|
905
|
-
*/
|
|
906
|
-
async manualRetryCancel(
|
|
907
|
-
{ requestHeaders } = { requestHeaders: {} },
|
|
908
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
909
|
-
) {
|
|
910
|
-
const { error } = WebhookPlatformValidator.manualRetryCancel().validate(
|
|
911
|
-
{},
|
|
912
|
-
{ abortEarly: false, allowUnknown: true }
|
|
913
|
-
);
|
|
914
|
-
if (error) {
|
|
915
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
916
|
-
}
|
|
917
|
-
|
|
918
|
-
// Showing warrnings if extra unknown parameters are found
|
|
919
|
-
const {
|
|
920
|
-
error: warrning,
|
|
921
|
-
} = WebhookPlatformValidator.manualRetryCancel().validate(
|
|
922
|
-
{},
|
|
923
|
-
{ abortEarly: false, allowUnknown: false }
|
|
924
|
-
);
|
|
925
|
-
if (warrning) {
|
|
926
|
-
Logger({
|
|
927
|
-
level: "WARN",
|
|
928
|
-
message: `Parameter Validation warrnings for platform > Webhook > manualRetryCancel \n ${warrning}`,
|
|
929
|
-
});
|
|
930
|
-
}
|
|
931
|
-
|
|
932
|
-
const query_params = {};
|
|
933
|
-
|
|
934
|
-
const xHeaders = {};
|
|
935
|
-
|
|
936
|
-
const response = await PlatformAPIClient.execute(
|
|
937
|
-
this.config,
|
|
938
|
-
"delete",
|
|
939
|
-
`/service/platform/webhook/v1.0/company/${this.config.companyId}/retry/cancel`,
|
|
940
|
-
query_params,
|
|
941
|
-
undefined,
|
|
942
|
-
{ ...xHeaders, ...requestHeaders },
|
|
943
|
-
{ responseHeaders }
|
|
944
|
-
);
|
|
945
|
-
|
|
946
|
-
let responseData = response;
|
|
947
|
-
if (responseHeaders) {
|
|
948
|
-
responseData = response[0];
|
|
949
|
-
}
|
|
950
|
-
|
|
951
|
-
const { error: res_error } = Joi.string()
|
|
952
|
-
.allow("")
|
|
953
|
-
.validate(responseData, { abortEarly: false, allowUnknown: true });
|
|
954
|
-
|
|
955
|
-
if (res_error) {
|
|
956
|
-
if (this.config.options.strictResponseCheck === true) {
|
|
957
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
958
|
-
} else {
|
|
959
|
-
Logger({
|
|
960
|
-
level: "WARN",
|
|
961
|
-
message: `Response Validation Warnings for platform > Webhook > manualRetryCancel \n ${res_error}`,
|
|
962
|
-
});
|
|
963
|
-
}
|
|
964
|
-
}
|
|
965
|
-
|
|
966
|
-
return response;
|
|
967
|
-
}
|
|
968
|
-
|
|
969
|
-
/**
|
|
970
|
-
* @param {WebhookPlatformValidator.ManualRetryOfFailedEventParam} arg - Arg object
|
|
971
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
972
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
973
|
-
* @returns {Promise<WebhookPlatformModel.RetrySuccessResponse>} - Success response
|
|
974
|
-
* @name manualRetryOfFailedEvent
|
|
975
|
-
* @summary: Manual retry of failed event
|
|
976
|
-
* @description: Trigger a manual retry for an event that failed to deliver. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/webhook/manualRetryOfFailedEvent/).
|
|
977
|
-
*/
|
|
978
|
-
async manualRetryOfFailedEvent(
|
|
979
|
-
{ body, requestHeaders } = { requestHeaders: {} },
|
|
980
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
981
|
-
) {
|
|
982
|
-
const {
|
|
983
|
-
error,
|
|
984
|
-
} = WebhookPlatformValidator.manualRetryOfFailedEvent().validate(
|
|
985
|
-
{
|
|
986
|
-
body,
|
|
987
|
-
},
|
|
988
|
-
{ abortEarly: false, allowUnknown: true }
|
|
989
|
-
);
|
|
990
|
-
if (error) {
|
|
991
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
992
|
-
}
|
|
993
|
-
|
|
994
|
-
// Showing warrnings if extra unknown parameters are found
|
|
995
|
-
const {
|
|
996
|
-
error: warrning,
|
|
997
|
-
} = WebhookPlatformValidator.manualRetryOfFailedEvent().validate(
|
|
998
|
-
{
|
|
999
|
-
body,
|
|
1000
|
-
},
|
|
1001
|
-
{ abortEarly: false, allowUnknown: false }
|
|
1002
|
-
);
|
|
1003
|
-
if (warrning) {
|
|
1004
|
-
Logger({
|
|
1005
|
-
level: "WARN",
|
|
1006
|
-
message: `Parameter Validation warrnings for platform > Webhook > manualRetryOfFailedEvent \n ${warrning}`,
|
|
1007
|
-
});
|
|
1008
|
-
}
|
|
1009
|
-
|
|
1010
|
-
const query_params = {};
|
|
1011
|
-
|
|
1012
|
-
const xHeaders = {};
|
|
1013
|
-
|
|
1014
|
-
const response = await PlatformAPIClient.execute(
|
|
1015
|
-
this.config,
|
|
1016
|
-
"post",
|
|
1017
|
-
`/service/platform/webhook/v1.0/company/${this.config.companyId}/retry`,
|
|
1018
|
-
query_params,
|
|
1019
|
-
body,
|
|
1020
|
-
{ ...xHeaders, ...requestHeaders },
|
|
1021
|
-
{ responseHeaders }
|
|
1022
|
-
);
|
|
1023
|
-
|
|
1024
|
-
let responseData = response;
|
|
1025
|
-
if (responseHeaders) {
|
|
1026
|
-
responseData = response[0];
|
|
1027
|
-
}
|
|
1028
|
-
|
|
1029
|
-
const {
|
|
1030
|
-
error: res_error,
|
|
1031
|
-
} = WebhookPlatformModel.RetrySuccessResponse().validate(responseData, {
|
|
1032
|
-
abortEarly: false,
|
|
1033
|
-
allowUnknown: true,
|
|
1034
|
-
});
|
|
1035
|
-
|
|
1036
|
-
if (res_error) {
|
|
1037
|
-
if (this.config.options.strictResponseCheck === true) {
|
|
1038
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1039
|
-
} else {
|
|
1040
|
-
Logger({
|
|
1041
|
-
level: "WARN",
|
|
1042
|
-
message: `Response Validation Warnings for platform > Webhook > manualRetryOfFailedEvent \n ${res_error}`,
|
|
1043
|
-
});
|
|
1044
|
-
}
|
|
1045
|
-
}
|
|
1046
|
-
|
|
1047
|
-
return response;
|
|
1048
|
-
}
|
|
1049
|
-
|
|
1050
743
|
/**
|
|
1051
744
|
* @param {WebhookPlatformValidator.PingWebhookParam} arg - Arg object
|
|
1052
745
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|