@gofynd/fdk-client-javascript 1.2.0 → 1.3.1-beta.1
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 +44 -7
- package/package.json +1 -2
- package/sdk/application/ApplicationAPIClient.d.ts +3 -3
- package/sdk/application/ApplicationAPIClient.js +6 -4
- package/sdk/application/ApplicationClient.d.ts +2 -3
- package/sdk/application/ApplicationClient.js +1 -45
- package/sdk/application/ApplicationConfig.d.ts +46 -6
- package/sdk/application/ApplicationConfig.js +15 -16
- package/sdk/application/Cart/CartApplicationClient.d.ts +61 -33
- package/sdk/application/Cart/CartApplicationClient.js +225 -134
- package/sdk/application/Cart/CartApplicationModel.d.ts +6 -4
- package/sdk/application/Cart/CartApplicationModel.js +6 -4
- package/sdk/application/Catalog/CatalogApplicationClient.d.ts +61 -30
- package/sdk/application/Catalog/CatalogApplicationClient.js +234 -146
- package/sdk/application/Catalog/CatalogApplicationModel.d.ts +115 -13
- package/sdk/application/Catalog/CatalogApplicationModel.js +77 -12
- package/sdk/application/Common/CommonApplicationClient.d.ts +5 -3
- package/sdk/application/Common/CommonApplicationClient.js +13 -11
- package/sdk/application/Common/CommonApplicationModel.d.ts +3 -83
- package/sdk/application/Common/CommonApplicationModel.js +2 -58
- package/sdk/application/Communication/CommunicationApplicationClient.d.ts +9 -3
- package/sdk/application/Communication/CommunicationApplicationClient.js +25 -13
- package/sdk/application/Communication/CommunicationApplicationModel.d.ts +1 -34
- package/sdk/application/Communication/CommunicationApplicationModel.js +0 -36
- package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +46 -16
- package/sdk/application/Configuration/ConfigurationApplicationClient.js +144 -68
- package/sdk/application/Configuration/ConfigurationApplicationModel.d.ts +1 -219
- package/sdk/application/Configuration/ConfigurationApplicationModel.js +0 -226
- package/sdk/application/Content/ContentApplicationClient.d.ts +49 -21
- package/sdk/application/Content/ContentApplicationClient.js +159 -80
- package/sdk/application/Content/ContentApplicationModel.d.ts +5 -622
- package/sdk/application/Content/ContentApplicationModel.js +11 -763
- package/sdk/application/FileStorage/FileStorageApplicationClient.d.ts +6 -3
- package/sdk/application/FileStorage/FileStorageApplicationClient.js +20 -14
- package/sdk/application/FileStorage/FileStorageApplicationModel.d.ts +1 -152
- package/sdk/application/FileStorage/FileStorageApplicationModel.js +0 -180
- package/sdk/application/Lead/LeadApplicationClient.d.ts +14 -7
- package/sdk/application/Lead/LeadApplicationClient.js +50 -31
- package/sdk/application/Lead/LeadApplicationModel.d.ts +22 -741
- package/sdk/application/Lead/LeadApplicationModel.js +21 -481
- package/sdk/application/Logistic/LogisticApplicationClient.d.ts +11 -5
- package/sdk/application/Logistic/LogisticApplicationClient.js +41 -20
- package/sdk/application/Order/OrderApplicationClient.d.ts +24 -12
- package/sdk/application/Order/OrderApplicationClient.js +88 -56
- package/sdk/application/Payment/PaymentApplicationClient.d.ts +91 -42
- package/sdk/application/Payment/PaymentApplicationClient.js +293 -194
- package/sdk/application/Payment/PaymentApplicationModel.d.ts +36 -36
- package/sdk/application/Payment/PaymentApplicationModel.js +36 -36
- package/sdk/application/PosCart/PosCartApplicationClient.d.ts +59 -32
- package/sdk/application/PosCart/PosCartApplicationClient.js +214 -130
- package/sdk/application/PosCart/PosCartApplicationModel.d.ts +2 -2
- package/sdk/application/PosCart/PosCartApplicationModel.js +2 -2
- package/sdk/application/Rewards/RewardsApplicationClient.d.ts +16 -7
- package/sdk/application/Rewards/RewardsApplicationClient.js +56 -29
- package/sdk/application/Share/ShareApplicationClient.d.ts +15 -7
- package/sdk/application/Share/ShareApplicationClient.js +51 -31
- package/sdk/application/Share/ShareApplicationModel.d.ts +1 -33
- package/sdk/application/Share/ShareApplicationModel.js +0 -38
- package/sdk/application/Theme/ThemeApplicationClient.d.ts +9 -4
- package/sdk/application/Theme/ThemeApplicationClient.js +35 -18
- package/sdk/application/Theme/ThemeApplicationModel.d.ts +982 -312
- package/sdk/application/Theme/ThemeApplicationModel.js +621 -284
- package/sdk/application/User/UserApplicationClient.d.ts +74 -35
- package/sdk/application/User/UserApplicationClient.js +252 -161
- package/sdk/application/User/UserApplicationModel.d.ts +3 -401
- package/sdk/application/User/UserApplicationModel.js +2 -490
- package/sdk/common/AxiosHelper.js +1 -2
- package/sdk/common/FDKError.d.ts +3 -0
- package/sdk/common/FDKError.js +8 -0
- package/sdk/common/utils.d.ts +3 -0
- package/sdk/common/utils.js +29 -0
- package/sdk/partner/PartnerAPIClient.d.ts +5 -4
- package/sdk/partner/PartnerAPIClient.js +7 -4
- package/sdk/partner/PartnerClient.d.ts +2 -0
- package/sdk/partner/PartnerClient.js +3 -0
- package/sdk/partner/Theme/ThemePartnerClient.d.ts +299 -0
- package/sdk/partner/Theme/ThemePartnerClient.js +768 -0
- package/sdk/partner/Theme/ThemePartnerModel.d.ts +1706 -0
- package/sdk/partner/Theme/ThemePartnerModel.js +1409 -0
- package/sdk/partner/Theme/ThemePartnerValidator.d.ts +22 -0
- package/sdk/partner/Theme/ThemePartnerValidator.js +157 -0
- package/sdk/partner/index.d.ts +3 -1
- package/sdk/partner/index.js +3 -1
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.d.ts +8 -4
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +38 -16
- package/sdk/platform/AuditTrail/AuditTrailPlatformModel.d.ts +1 -13
- package/sdk/platform/AuditTrail/AuditTrailPlatformModel.js +0 -12
- package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.d.ts +10 -0
- package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.js +4 -0
- package/sdk/platform/Billing/BillingPlatformClient.d.ts +59 -14
- package/sdk/platform/Billing/BillingPlatformClient.js +315 -64
- package/sdk/platform/Billing/BillingPlatformModel.d.ts +56 -196
- package/sdk/platform/Billing/BillingPlatformModel.js +63 -217
- package/sdk/platform/Billing/BillingPlatformValidator.d.ts +23 -1
- package/sdk/platform/Billing/BillingPlatformValidator.js +31 -0
- package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +124 -63
- package/sdk/platform/Cart/CartPlatformApplicationClient.js +431 -265
- package/sdk/platform/Cart/CartPlatformModel.d.ts +253 -53
- package/sdk/platform/Cart/CartPlatformModel.js +104 -54
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +120 -53
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +398 -247
- package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +155 -78
- package/sdk/platform/Catalog/CatalogPlatformClient.js +561 -355
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +10 -12
- package/sdk/platform/Catalog/CatalogPlatformModel.js +10 -12
- package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +30 -0
- package/sdk/platform/Catalog/CatalogPlatformValidator.js +13 -0
- package/sdk/platform/Common/CommonPlatformClient.d.ts +5 -3
- package/sdk/platform/Common/CommonPlatformClient.js +13 -11
- package/sdk/platform/Common/CommonPlatformModel.d.ts +39 -64
- package/sdk/platform/Common/CommonPlatformModel.js +23 -57
- package/sdk/platform/Common/CommonPlatformValidator.d.ts +5 -10
- package/sdk/platform/Common/CommonPlatformValidator.js +3 -4
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +370 -120
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +2328 -888
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.d.ts +143 -24
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.js +179 -15
- package/sdk/platform/Communication/CommunicationPlatformClient.d.ts +2 -1
- package/sdk/platform/Communication/CommunicationPlatformClient.js +6 -5
- package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +386 -308
- package/sdk/platform/Communication/CommunicationPlatformModel.js +415 -355
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +38 -13
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +171 -57
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +53 -1
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +54 -0
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.d.ts +5 -1
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.js +7 -0
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +96 -29
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +311 -126
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.d.ts +5 -1
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.js +7 -0
- package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +36 -18
- package/sdk/platform/Configuration/ConfigurationPlatformClient.js +121 -86
- package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +13 -180
- package/sdk/platform/Configuration/ConfigurationPlatformModel.js +5 -113
- package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +162 -70
- package/sdk/platform/Content/ContentPlatformApplicationClient.js +528 -309
- package/sdk/platform/Content/ContentPlatformModel.d.ts +9 -198
- package/sdk/platform/Content/ContentPlatformModel.js +8 -231
- package/sdk/platform/Discount/DiscountPlatformClient.d.ts +48 -11
- package/sdk/platform/Discount/DiscountPlatformClient.js +142 -48
- package/sdk/platform/Discount/DiscountPlatformModel.d.ts +40 -1
- package/sdk/platform/Discount/DiscountPlatformModel.js +27 -0
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +84 -18
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +486 -53
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.d.ts +71 -7
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.js +81 -5
- package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +13 -18
- package/sdk/platform/FileStorage/FileStoragePlatformClient.js +58 -65
- package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +198 -71
- package/sdk/platform/FileStorage/FileStoragePlatformModel.js +212 -64
- package/sdk/platform/FileStorage/FileStoragePlatformValidator.d.ts +18 -10
- package/sdk/platform/FileStorage/FileStoragePlatformValidator.js +11 -6
- package/sdk/platform/Finance/FinancePlatformClient.d.ts +177 -40
- package/sdk/platform/Finance/FinancePlatformClient.js +1028 -132
- package/sdk/platform/Finance/FinancePlatformModel.d.ts +670 -22
- package/sdk/platform/Finance/FinancePlatformModel.js +809 -23
- package/sdk/platform/Finance/FinancePlatformValidator.d.ts +111 -1
- package/sdk/platform/Finance/FinancePlatformValidator.js +134 -0
- package/sdk/platform/Inventory/InventoryPlatformClient.d.ts +24 -12
- package/sdk/platform/Inventory/InventoryPlatformClient.js +94 -52
- package/sdk/platform/Lead/LeadPlatformApplicationClient.d.ts +27 -13
- package/sdk/platform/Lead/LeadPlatformApplicationClient.js +101 -55
- package/sdk/platform/Lead/LeadPlatformClient.d.ts +50 -39
- package/sdk/platform/Lead/LeadPlatformClient.js +171 -112
- package/sdk/platform/Lead/LeadPlatformModel.d.ts +32 -390
- package/sdk/platform/Lead/LeadPlatformModel.js +31 -214
- package/sdk/platform/Lead/LeadPlatformValidator.d.ts +33 -33
- package/sdk/platform/Lead/LeadPlatformValidator.js +23 -23
- package/sdk/platform/OAuthClient.js +6 -2
- package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +4 -2
- package/sdk/platform/Order/OrderPlatformApplicationClient.js +12 -10
- package/sdk/platform/Order/OrderPlatformClient.d.ts +165 -71
- package/sdk/platform/Order/OrderPlatformClient.js +738 -205
- package/sdk/platform/Order/OrderPlatformModel.d.ts +261 -3
- package/sdk/platform/Order/OrderPlatformModel.js +225 -2
- package/sdk/platform/Order/OrderPlatformValidator.d.ts +104 -3
- package/sdk/platform/Order/OrderPlatformValidator.js +85 -2
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.d.ts +4 -22
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.js +12 -159
- package/sdk/platform/Partner/PartnerPlatformApplicationValidator.d.ts +1 -30
- package/sdk/platform/Partner/PartnerPlatformApplicationValidator.js +0 -26
- package/sdk/platform/Partner/PartnerPlatformModel.d.ts +1 -690
- package/sdk/platform/Partner/PartnerPlatformModel.js +0 -809
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +167 -32
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +793 -145
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +91 -1
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +91 -0
- package/sdk/platform/Payment/PaymentPlatformClient.d.ts +20 -10
- package/sdk/platform/Payment/PaymentPlatformClient.js +68 -47
- package/sdk/platform/Payment/PaymentPlatformModel.d.ts +549 -7
- package/sdk/platform/Payment/PaymentPlatformModel.js +305 -6
- package/sdk/platform/PlatformAPIClient.d.ts +3 -3
- package/sdk/platform/PlatformAPIClient.js +2 -2
- package/sdk/platform/PlatformClient.d.ts +2 -2
- package/sdk/platform/PlatformClient.js +4 -4
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.d.ts +28 -12
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +90 -53
- package/sdk/platform/Rewards/RewardsPlatformModel.d.ts +1 -12
- package/sdk/platform/Rewards/RewardsPlatformModel.js +0 -14
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.d.ts +62 -26
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.js +210 -93
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.d.ts +20 -11
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.js +23 -11
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +36 -18
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +142 -78
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +12 -3
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +14 -2
- package/sdk/platform/Share/SharePlatformApplicationClient.d.ts +10 -26
- package/sdk/platform/Share/SharePlatformApplicationClient.js +36 -67
- package/sdk/platform/Share/SharePlatformModel.d.ts +4 -4
- package/sdk/platform/Share/SharePlatformModel.js +4 -4
- package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +127 -57
- package/sdk/platform/Theme/ThemePlatformApplicationClient.js +564 -189
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.d.ts +63 -26
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.js +62 -22
- package/sdk/platform/Theme/ThemePlatformClient.d.ts +37 -0
- package/sdk/platform/Theme/ThemePlatformClient.js +235 -0
- package/sdk/platform/Theme/ThemePlatformModel.d.ts +1167 -261
- package/sdk/platform/Theme/ThemePlatformModel.js +801 -244
- package/sdk/platform/Theme/ThemePlatformValidator.d.ts +32 -0
- package/sdk/platform/Theme/ThemePlatformValidator.js +38 -0
- package/sdk/platform/User/UserPlatformApplicationClient.d.ts +35 -17
- package/sdk/platform/User/UserPlatformApplicationClient.js +132 -73
- package/sdk/platform/User/UserPlatformApplicationValidator.d.ts +7 -0
- package/sdk/platform/User/UserPlatformApplicationValidator.js +3 -0
- package/sdk/platform/User/UserPlatformModel.d.ts +1 -738
- package/sdk/platform/User/UserPlatformModel.js +3 -899
- package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +120 -7
- package/sdk/platform/Webhook/WebhookPlatformClient.js +799 -41
- package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +476 -86
- package/sdk/platform/Webhook/WebhookPlatformModel.js +388 -89
- package/sdk/platform/Webhook/WebhookPlatformValidator.d.ts +90 -7
- package/sdk/platform/Webhook/WebhookPlatformValidator.js +113 -3
- package/sdk/public/Configuration/ConfigurationPublicClient.d.ts +5 -3
- package/sdk/public/Configuration/ConfigurationPublicClient.js +13 -11
- package/sdk/public/Configuration/ConfigurationPublicModel.d.ts +3 -106
- package/sdk/public/Configuration/ConfigurationPublicModel.js +2 -59
- package/sdk/public/Inventory/InventoryPublicClient.d.ts +12 -6
- package/sdk/public/Inventory/InventoryPublicClient.js +42 -27
- package/sdk/public/Partner/PartnerPublicClient.d.ts +22 -0
- package/sdk/public/Partner/PartnerPublicClient.js +110 -0
- package/sdk/public/Partner/PartnerPublicModel.d.ts +240 -0
- package/sdk/public/Partner/PartnerPublicModel.js +280 -0
- package/sdk/public/Partner/PartnerPublicValidator.d.ts +18 -0
- package/sdk/public/Partner/PartnerPublicValidator.js +19 -0
- package/sdk/public/PublicAPIClient.d.ts +14 -1
- package/sdk/public/PublicAPIClient.js +7 -1
- package/sdk/public/PublicClient.d.ts +2 -0
- package/sdk/public/PublicClient.js +4 -0
- package/sdk/public/Webhook/WebhookPublicClient.d.ts +5 -2
- package/sdk/public/Webhook/WebhookPublicClient.js +15 -9
- package/sdk/public/Webhook/WebhookPublicModel.d.ts +1 -191
- package/sdk/public/Webhook/WebhookPublicModel.js +0 -229
- package/sdk/public/index.d.ts +1 -0
- package/sdk/public/index.js +2 -0
- package/sdk/application/ApplicationModels.d.ts +0 -48
- package/sdk/application/ApplicationModels.js +0 -38
- package/sdk/platform/Partner/PartnerPlatformClient.d.ts +0 -106
- package/sdk/platform/Partner/PartnerPlatformClient.js +0 -878
- package/sdk/platform/Partner/PartnerPlatformValidator.d.ts +0 -208
- package/sdk/platform/Partner/PartnerPlatformValidator.js +0 -169
|
@@ -11,18 +11,472 @@ class Webhook {
|
|
|
11
11
|
this.config = config;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
+
/**
|
|
15
|
+
* @param {WebhookPlatformValidator.CancelJobByNameParam} arg - Arg object
|
|
16
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
17
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
18
|
+
* @returns {Promise<WebhookPlatformModel.CancelResponse>} - Success response
|
|
19
|
+
* @name cancelJobByName
|
|
20
|
+
* @summary: Cancel a report export
|
|
21
|
+
* @description: Cancel the export of a specific report for a company. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/webhook/cancelJobByName/).
|
|
22
|
+
*/
|
|
23
|
+
async cancelJobByName(
|
|
24
|
+
{ filename, requestHeaders } = { requestHeaders: {} },
|
|
25
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
26
|
+
) {
|
|
27
|
+
const { error } = WebhookPlatformValidator.cancelJobByName().validate(
|
|
28
|
+
{
|
|
29
|
+
filename,
|
|
30
|
+
},
|
|
31
|
+
{ abortEarly: false, allowUnknown: true }
|
|
32
|
+
);
|
|
33
|
+
if (error) {
|
|
34
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// Showing warrnings if extra unknown parameters are found
|
|
38
|
+
const {
|
|
39
|
+
error: warrning,
|
|
40
|
+
} = WebhookPlatformValidator.cancelJobByName().validate(
|
|
41
|
+
{
|
|
42
|
+
filename,
|
|
43
|
+
},
|
|
44
|
+
{ abortEarly: false, allowUnknown: false }
|
|
45
|
+
);
|
|
46
|
+
if (warrning) {
|
|
47
|
+
Logger({
|
|
48
|
+
level: "WARN",
|
|
49
|
+
message: `Parameter Validation warrnings for platform > Webhook > cancelJobByName \n ${warrning}`,
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const query_params = {};
|
|
54
|
+
|
|
55
|
+
const xHeaders = {};
|
|
56
|
+
|
|
57
|
+
const response = await PlatformAPIClient.execute(
|
|
58
|
+
this.config,
|
|
59
|
+
"get",
|
|
60
|
+
`/service/platform/webhook/v1.0/company/${this.config.companyId}/reports/cancel/file/${filename}`,
|
|
61
|
+
query_params,
|
|
62
|
+
undefined,
|
|
63
|
+
{ ...xHeaders, ...requestHeaders },
|
|
64
|
+
{ responseHeaders }
|
|
65
|
+
);
|
|
66
|
+
|
|
67
|
+
let responseData = response;
|
|
68
|
+
if (responseHeaders) {
|
|
69
|
+
responseData = response[0];
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const {
|
|
73
|
+
error: res_error,
|
|
74
|
+
} = WebhookPlatformModel.CancelResponse().validate(responseData, {
|
|
75
|
+
abortEarly: false,
|
|
76
|
+
allowUnknown: false,
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
if (res_error) {
|
|
80
|
+
Logger({
|
|
81
|
+
level: "WARN",
|
|
82
|
+
message: `Response Validation Warnnings for platform > Webhook > cancelJobByName \n ${res_error}`,
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
return response;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* @param {WebhookPlatformValidator.DownloadDeliveryReportParam} arg - Arg object
|
|
91
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
92
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
93
|
+
* @returns {Promise<Object>} - Success response
|
|
94
|
+
* @name downloadDeliveryReport
|
|
95
|
+
* @summary: Download processed events report for a company
|
|
96
|
+
* @description: Download reports for a specific company based on the provided filters. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/webhook/downloadDeliveryReport/).
|
|
97
|
+
*/
|
|
98
|
+
async downloadDeliveryReport(
|
|
99
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
100
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
101
|
+
) {
|
|
102
|
+
const {
|
|
103
|
+
error,
|
|
104
|
+
} = WebhookPlatformValidator.downloadDeliveryReport().validate(
|
|
105
|
+
{
|
|
106
|
+
body,
|
|
107
|
+
},
|
|
108
|
+
{ abortEarly: false, allowUnknown: true }
|
|
109
|
+
);
|
|
110
|
+
if (error) {
|
|
111
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
// Showing warrnings if extra unknown parameters are found
|
|
115
|
+
const {
|
|
116
|
+
error: warrning,
|
|
117
|
+
} = WebhookPlatformValidator.downloadDeliveryReport().validate(
|
|
118
|
+
{
|
|
119
|
+
body,
|
|
120
|
+
},
|
|
121
|
+
{ abortEarly: false, allowUnknown: false }
|
|
122
|
+
);
|
|
123
|
+
if (warrning) {
|
|
124
|
+
Logger({
|
|
125
|
+
level: "WARN",
|
|
126
|
+
message: `Parameter Validation warrnings for platform > Webhook > downloadDeliveryReport \n ${warrning}`,
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
const query_params = {};
|
|
131
|
+
|
|
132
|
+
const xHeaders = {};
|
|
133
|
+
|
|
134
|
+
const response = await PlatformAPIClient.execute(
|
|
135
|
+
this.config,
|
|
136
|
+
"post",
|
|
137
|
+
`/service/platform/webhook/v1.0/company/${this.config.companyId}/reports/download`,
|
|
138
|
+
query_params,
|
|
139
|
+
body,
|
|
140
|
+
{ ...xHeaders, ...requestHeaders },
|
|
141
|
+
{ responseHeaders }
|
|
142
|
+
);
|
|
143
|
+
|
|
144
|
+
let responseData = response;
|
|
145
|
+
if (responseHeaders) {
|
|
146
|
+
responseData = response[0];
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
const { error: res_error } = Joi.any().validate(responseData, {
|
|
150
|
+
abortEarly: false,
|
|
151
|
+
allowUnknown: false,
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
if (res_error) {
|
|
155
|
+
Logger({
|
|
156
|
+
level: "WARN",
|
|
157
|
+
message: `Response Validation Warnnings for platform > Webhook > downloadDeliveryReport \n ${res_error}`,
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
return response;
|
|
162
|
+
}
|
|
163
|
+
|
|
14
164
|
/**
|
|
15
165
|
* @param {WebhookPlatformValidator.FetchAllEventConfigurationsParam} arg - Arg object
|
|
166
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
167
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
168
|
+
* @returns {Promise<WebhookPlatformModel.EventConfigResponse>} - Success response
|
|
169
|
+
* @name fetchAllEventConfigurations
|
|
170
|
+
* @summary:
|
|
171
|
+
* @description: Get All Webhook Events - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/webhook/fetchAllEventConfigurations/).
|
|
172
|
+
*/
|
|
173
|
+
async fetchAllEventConfigurations(
|
|
174
|
+
{ requestHeaders } = { requestHeaders: {} },
|
|
175
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
176
|
+
) {
|
|
177
|
+
const {
|
|
178
|
+
error,
|
|
179
|
+
} = WebhookPlatformValidator.fetchAllEventConfigurations().validate(
|
|
180
|
+
{},
|
|
181
|
+
{ abortEarly: false, allowUnknown: true }
|
|
182
|
+
);
|
|
183
|
+
if (error) {
|
|
184
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
// Showing warrnings if extra unknown parameters are found
|
|
188
|
+
const {
|
|
189
|
+
error: warrning,
|
|
190
|
+
} = WebhookPlatformValidator.fetchAllEventConfigurations().validate(
|
|
191
|
+
{},
|
|
192
|
+
{ abortEarly: false, allowUnknown: false }
|
|
193
|
+
);
|
|
194
|
+
if (warrning) {
|
|
195
|
+
Logger({
|
|
196
|
+
level: "WARN",
|
|
197
|
+
message: `Parameter Validation warrnings for platform > Webhook > fetchAllEventConfigurations \n ${warrning}`,
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
const query_params = {};
|
|
202
|
+
|
|
203
|
+
const xHeaders = {};
|
|
204
|
+
|
|
205
|
+
const response = await PlatformAPIClient.execute(
|
|
206
|
+
this.config,
|
|
207
|
+
"get",
|
|
208
|
+
`/service/platform/webhook/v1.0/company/${this.config.companyId}/events`,
|
|
209
|
+
query_params,
|
|
210
|
+
undefined,
|
|
211
|
+
{ ...xHeaders, ...requestHeaders },
|
|
212
|
+
{ responseHeaders }
|
|
213
|
+
);
|
|
214
|
+
|
|
215
|
+
let responseData = response;
|
|
216
|
+
if (responseHeaders) {
|
|
217
|
+
responseData = response[0];
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
const {
|
|
221
|
+
error: res_error,
|
|
222
|
+
} = WebhookPlatformModel.EventConfigResponse().validate(responseData, {
|
|
223
|
+
abortEarly: false,
|
|
224
|
+
allowUnknown: false,
|
|
225
|
+
});
|
|
226
|
+
|
|
227
|
+
if (res_error) {
|
|
228
|
+
Logger({
|
|
229
|
+
level: "WARN",
|
|
230
|
+
message: `Response Validation Warnnings for platform > Webhook > fetchAllEventConfigurations \n ${res_error}`,
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
return response;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* @param {WebhookPlatformValidator.GetDeliveryReportsParam} arg - Arg object
|
|
239
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
240
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
241
|
+
* @returns {Promise<WebhookPlatformModel.EventProcessReports>} - Success response
|
|
242
|
+
* @name getDeliveryReports
|
|
243
|
+
* @summary: Get processed events report for a company
|
|
244
|
+
* @description: Retrieve a list of processed events for a specific company based on the provided filters. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/webhook/getDeliveryReports/).
|
|
245
|
+
*/
|
|
246
|
+
async getDeliveryReports(
|
|
247
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
248
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
249
|
+
) {
|
|
250
|
+
const { error } = WebhookPlatformValidator.getDeliveryReports().validate(
|
|
251
|
+
{
|
|
252
|
+
body,
|
|
253
|
+
},
|
|
254
|
+
{ abortEarly: false, allowUnknown: true }
|
|
255
|
+
);
|
|
256
|
+
if (error) {
|
|
257
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
// Showing warrnings if extra unknown parameters are found
|
|
261
|
+
const {
|
|
262
|
+
error: warrning,
|
|
263
|
+
} = WebhookPlatformValidator.getDeliveryReports().validate(
|
|
264
|
+
{
|
|
265
|
+
body,
|
|
266
|
+
},
|
|
267
|
+
{ abortEarly: false, allowUnknown: false }
|
|
268
|
+
);
|
|
269
|
+
if (warrning) {
|
|
270
|
+
Logger({
|
|
271
|
+
level: "WARN",
|
|
272
|
+
message: `Parameter Validation warrnings for platform > Webhook > getDeliveryReports \n ${warrning}`,
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
const query_params = {};
|
|
277
|
+
|
|
278
|
+
const xHeaders = {};
|
|
279
|
+
|
|
280
|
+
const response = await PlatformAPIClient.execute(
|
|
281
|
+
this.config,
|
|
282
|
+
"post",
|
|
283
|
+
`/service/platform/webhook/v1.0/company/${this.config.companyId}/reports/event_processed`,
|
|
284
|
+
query_params,
|
|
285
|
+
body,
|
|
286
|
+
{ ...xHeaders, ...requestHeaders },
|
|
287
|
+
{ responseHeaders }
|
|
288
|
+
);
|
|
289
|
+
|
|
290
|
+
let responseData = response;
|
|
291
|
+
if (responseHeaders) {
|
|
292
|
+
responseData = response[0];
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
const {
|
|
296
|
+
error: res_error,
|
|
297
|
+
} = WebhookPlatformModel.EventProcessReports().validate(responseData, {
|
|
298
|
+
abortEarly: false,
|
|
299
|
+
allowUnknown: false,
|
|
300
|
+
});
|
|
301
|
+
|
|
302
|
+
if (res_error) {
|
|
303
|
+
Logger({
|
|
304
|
+
level: "WARN",
|
|
305
|
+
message: `Response Validation Warnnings for platform > Webhook > getDeliveryReports \n ${res_error}`,
|
|
306
|
+
});
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
return response;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
/**
|
|
313
|
+
* @param {WebhookPlatformValidator.GetEventCountsParam} arg - Arg object
|
|
314
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
315
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
316
|
+
* @returns {Promise<WebhookPlatformModel.FailedEventsCountSuccessResponse>}
|
|
317
|
+
* - Success response
|
|
318
|
+
*
|
|
319
|
+
* @name getEventCounts
|
|
320
|
+
* @summary: Get the count of failed events for a company within a specified date range.
|
|
321
|
+
* @description: Retrieves the count of failed events for a specific company within the specified date range. The user can filter the count based on specific event types if provided.
|
|
322
|
+
* - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/webhook/getEventCounts/).
|
|
323
|
+
*/
|
|
324
|
+
async getEventCounts(
|
|
325
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
326
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
327
|
+
) {
|
|
328
|
+
const { error } = WebhookPlatformValidator.getEventCounts().validate(
|
|
329
|
+
{
|
|
330
|
+
body,
|
|
331
|
+
},
|
|
332
|
+
{ abortEarly: false, allowUnknown: true }
|
|
333
|
+
);
|
|
334
|
+
if (error) {
|
|
335
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
// Showing warrnings if extra unknown parameters are found
|
|
339
|
+
const {
|
|
340
|
+
error: warrning,
|
|
341
|
+
} = WebhookPlatformValidator.getEventCounts().validate(
|
|
342
|
+
{
|
|
343
|
+
body,
|
|
344
|
+
},
|
|
345
|
+
{ abortEarly: false, allowUnknown: false }
|
|
346
|
+
);
|
|
347
|
+
if (warrning) {
|
|
348
|
+
Logger({
|
|
349
|
+
level: "WARN",
|
|
350
|
+
message: `Parameter Validation warrnings for platform > Webhook > getEventCounts \n ${warrning}`,
|
|
351
|
+
});
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
const query_params = {};
|
|
355
|
+
|
|
356
|
+
const xHeaders = {};
|
|
357
|
+
|
|
358
|
+
const response = await PlatformAPIClient.execute(
|
|
359
|
+
this.config,
|
|
360
|
+
"post",
|
|
361
|
+
`/service/platform/webhook/v1.0/company/${this.config.companyId}/retry/events/counts`,
|
|
362
|
+
query_params,
|
|
363
|
+
body,
|
|
364
|
+
{ ...xHeaders, ...requestHeaders },
|
|
365
|
+
{ responseHeaders }
|
|
366
|
+
);
|
|
367
|
+
|
|
368
|
+
let responseData = response;
|
|
369
|
+
if (responseHeaders) {
|
|
370
|
+
responseData = response[0];
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
const {
|
|
374
|
+
error: res_error,
|
|
375
|
+
} = WebhookPlatformModel.FailedEventsCountSuccessResponse().validate(
|
|
376
|
+
responseData,
|
|
377
|
+
{ abortEarly: false, allowUnknown: false }
|
|
378
|
+
);
|
|
379
|
+
|
|
380
|
+
if (res_error) {
|
|
381
|
+
Logger({
|
|
382
|
+
level: "WARN",
|
|
383
|
+
message: `Response Validation Warnnings for platform > Webhook > getEventCounts \n ${res_error}`,
|
|
384
|
+
});
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
return response;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
/**
|
|
391
|
+
* @param {WebhookPlatformValidator.GetHistoricalReportsParam} arg - Arg object
|
|
392
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
393
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
394
|
+
* @returns {Promise<WebhookPlatformModel.HistoryResponse>} - Success response
|
|
395
|
+
* @name getHistoricalReports
|
|
396
|
+
* @summary: Get report download history
|
|
397
|
+
* @description: Retrieve history reports for a specific company based on the provided filters. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/webhook/getHistoricalReports/).
|
|
398
|
+
*/
|
|
399
|
+
async getHistoricalReports(
|
|
400
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
401
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
402
|
+
) {
|
|
403
|
+
const { error } = WebhookPlatformValidator.getHistoricalReports().validate(
|
|
404
|
+
{
|
|
405
|
+
body,
|
|
406
|
+
},
|
|
407
|
+
{ abortEarly: false, allowUnknown: true }
|
|
408
|
+
);
|
|
409
|
+
if (error) {
|
|
410
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
// Showing warrnings if extra unknown parameters are found
|
|
414
|
+
const {
|
|
415
|
+
error: warrning,
|
|
416
|
+
} = WebhookPlatformValidator.getHistoricalReports().validate(
|
|
417
|
+
{
|
|
418
|
+
body,
|
|
419
|
+
},
|
|
420
|
+
{ abortEarly: false, allowUnknown: false }
|
|
421
|
+
);
|
|
422
|
+
if (warrning) {
|
|
423
|
+
Logger({
|
|
424
|
+
level: "WARN",
|
|
425
|
+
message: `Parameter Validation warrnings for platform > Webhook > getHistoricalReports \n ${warrning}`,
|
|
426
|
+
});
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
const query_params = {};
|
|
430
|
+
|
|
431
|
+
const xHeaders = {};
|
|
432
|
+
|
|
433
|
+
const response = await PlatformAPIClient.execute(
|
|
434
|
+
this.config,
|
|
435
|
+
"post",
|
|
436
|
+
`/service/platform/webhook/v1.0/company/${this.config.companyId}/reports/history`,
|
|
437
|
+
query_params,
|
|
438
|
+
body,
|
|
439
|
+
{ ...xHeaders, ...requestHeaders },
|
|
440
|
+
{ responseHeaders }
|
|
441
|
+
);
|
|
442
|
+
|
|
443
|
+
let responseData = response;
|
|
444
|
+
if (responseHeaders) {
|
|
445
|
+
responseData = response[0];
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
const {
|
|
449
|
+
error: res_error,
|
|
450
|
+
} = WebhookPlatformModel.HistoryResponse().validate(responseData, {
|
|
451
|
+
abortEarly: false,
|
|
452
|
+
allowUnknown: false,
|
|
453
|
+
});
|
|
454
|
+
|
|
455
|
+
if (res_error) {
|
|
456
|
+
Logger({
|
|
457
|
+
level: "WARN",
|
|
458
|
+
message: `Response Validation Warnnings for platform > Webhook > getHistoricalReports \n ${res_error}`,
|
|
459
|
+
});
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
return response;
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
/**
|
|
466
|
+
* @param {WebhookPlatformValidator.GetManualRetryStatusParam} arg - Arg object
|
|
467
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
16
468
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
17
|
-
* @returns {Promise<WebhookPlatformModel.
|
|
18
|
-
* @name
|
|
19
|
-
* @summary:
|
|
20
|
-
* @description:
|
|
469
|
+
* @returns {Promise<WebhookPlatformModel.RetryStatusResponse>} - Success response
|
|
470
|
+
* @name getManualRetryStatus
|
|
471
|
+
* @summary: Get the retry status for a company's failed events.
|
|
472
|
+
* @description: Retrieves the status of retry for a specific company's failed events. This endpoint returns the total number of events, the count of successfully retried events, the count of failed retry attempts, and the overall status of the retry process.
|
|
473
|
+
* - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/webhook/getManualRetryStatus/).
|
|
21
474
|
*/
|
|
22
|
-
async
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
475
|
+
async getManualRetryStatus(
|
|
476
|
+
{ requestHeaders } = { requestHeaders: {} },
|
|
477
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
478
|
+
) {
|
|
479
|
+
const { error } = WebhookPlatformValidator.getManualRetryStatus().validate(
|
|
26
480
|
{},
|
|
27
481
|
{ abortEarly: false, allowUnknown: true }
|
|
28
482
|
);
|
|
@@ -33,14 +487,14 @@ class Webhook {
|
|
|
33
487
|
// Showing warrnings if extra unknown parameters are found
|
|
34
488
|
const {
|
|
35
489
|
error: warrning,
|
|
36
|
-
} = WebhookPlatformValidator.
|
|
490
|
+
} = WebhookPlatformValidator.getManualRetryStatus().validate(
|
|
37
491
|
{},
|
|
38
492
|
{ abortEarly: false, allowUnknown: false }
|
|
39
493
|
);
|
|
40
494
|
if (warrning) {
|
|
41
495
|
Logger({
|
|
42
496
|
level: "WARN",
|
|
43
|
-
message: `Parameter Validation warrnings for platform > Webhook >
|
|
497
|
+
message: `Parameter Validation warrnings for platform > Webhook > getManualRetryStatus \n ${warrning}`,
|
|
44
498
|
});
|
|
45
499
|
}
|
|
46
500
|
|
|
@@ -51,21 +505,21 @@ class Webhook {
|
|
|
51
505
|
const response = await PlatformAPIClient.execute(
|
|
52
506
|
this.config,
|
|
53
507
|
"get",
|
|
54
|
-
`/service/platform/webhook/v1.0/company/${this.config.companyId}/
|
|
508
|
+
`/service/platform/webhook/v1.0/company/${this.config.companyId}/retry/status`,
|
|
55
509
|
query_params,
|
|
56
510
|
undefined,
|
|
57
|
-
xHeaders,
|
|
58
|
-
{
|
|
511
|
+
{ ...xHeaders, ...requestHeaders },
|
|
512
|
+
{ responseHeaders }
|
|
59
513
|
);
|
|
60
514
|
|
|
61
515
|
let responseData = response;
|
|
62
|
-
if (
|
|
516
|
+
if (responseHeaders) {
|
|
63
517
|
responseData = response[0];
|
|
64
518
|
}
|
|
65
519
|
|
|
66
520
|
const {
|
|
67
521
|
error: res_error,
|
|
68
|
-
} = WebhookPlatformModel.
|
|
522
|
+
} = WebhookPlatformModel.RetryStatusResponse().validate(responseData, {
|
|
69
523
|
abortEarly: false,
|
|
70
524
|
allowUnknown: false,
|
|
71
525
|
});
|
|
@@ -73,7 +527,82 @@ class Webhook {
|
|
|
73
527
|
if (res_error) {
|
|
74
528
|
Logger({
|
|
75
529
|
level: "WARN",
|
|
76
|
-
message: `Response Validation Warnnings for platform > Webhook >
|
|
530
|
+
message: `Response Validation Warnnings for platform > Webhook > getManualRetryStatus \n ${res_error}`,
|
|
531
|
+
});
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
return response;
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
/**
|
|
538
|
+
* @param {WebhookPlatformValidator.GetReportFiltersParam} arg - Arg object
|
|
539
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
540
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
541
|
+
* @returns {Promise<WebhookPlatformModel.ReportFilterResponse>} - Success response
|
|
542
|
+
* @name getReportFilters
|
|
543
|
+
* @summary: Get filters for a company
|
|
544
|
+
* @description: Retrieve filters for a specific company based on the provided subscriber IDs. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/webhook/getReportFilters/).
|
|
545
|
+
*/
|
|
546
|
+
async getReportFilters(
|
|
547
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
548
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
549
|
+
) {
|
|
550
|
+
const { error } = WebhookPlatformValidator.getReportFilters().validate(
|
|
551
|
+
{
|
|
552
|
+
body,
|
|
553
|
+
},
|
|
554
|
+
{ abortEarly: false, allowUnknown: true }
|
|
555
|
+
);
|
|
556
|
+
if (error) {
|
|
557
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
// Showing warrnings if extra unknown parameters are found
|
|
561
|
+
const {
|
|
562
|
+
error: warrning,
|
|
563
|
+
} = WebhookPlatformValidator.getReportFilters().validate(
|
|
564
|
+
{
|
|
565
|
+
body,
|
|
566
|
+
},
|
|
567
|
+
{ abortEarly: false, allowUnknown: false }
|
|
568
|
+
);
|
|
569
|
+
if (warrning) {
|
|
570
|
+
Logger({
|
|
571
|
+
level: "WARN",
|
|
572
|
+
message: `Parameter Validation warrnings for platform > Webhook > getReportFilters \n ${warrning}`,
|
|
573
|
+
});
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
const query_params = {};
|
|
577
|
+
|
|
578
|
+
const xHeaders = {};
|
|
579
|
+
|
|
580
|
+
const response = await PlatformAPIClient.execute(
|
|
581
|
+
this.config,
|
|
582
|
+
"post",
|
|
583
|
+
`/service/platform/webhook/v1.0/company/${this.config.companyId}/filters`,
|
|
584
|
+
query_params,
|
|
585
|
+
body,
|
|
586
|
+
{ ...xHeaders, ...requestHeaders },
|
|
587
|
+
{ responseHeaders }
|
|
588
|
+
);
|
|
589
|
+
|
|
590
|
+
let responseData = response;
|
|
591
|
+
if (responseHeaders) {
|
|
592
|
+
responseData = response[0];
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
const {
|
|
596
|
+
error: res_error,
|
|
597
|
+
} = WebhookPlatformModel.ReportFilterResponse().validate(responseData, {
|
|
598
|
+
abortEarly: false,
|
|
599
|
+
allowUnknown: false,
|
|
600
|
+
});
|
|
601
|
+
|
|
602
|
+
if (res_error) {
|
|
603
|
+
Logger({
|
|
604
|
+
level: "WARN",
|
|
605
|
+
message: `Response Validation Warnnings for platform > Webhook > getReportFilters \n ${res_error}`,
|
|
77
606
|
});
|
|
78
607
|
}
|
|
79
608
|
|
|
@@ -82,6 +611,7 @@ class Webhook {
|
|
|
82
611
|
|
|
83
612
|
/**
|
|
84
613
|
* @param {WebhookPlatformValidator.GetSubscriberByIdParam} arg - Arg object
|
|
614
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
85
615
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
86
616
|
* @returns {Promise<WebhookPlatformModel.SubscriberResponse>} - Success response
|
|
87
617
|
* @name getSubscriberById
|
|
@@ -89,8 +619,8 @@ class Webhook {
|
|
|
89
619
|
* @description: Get Subscriber By Subscriber ID - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/webhook/getSubscriberById/).
|
|
90
620
|
*/
|
|
91
621
|
async getSubscriberById(
|
|
92
|
-
{ subscriberId } = {},
|
|
93
|
-
{
|
|
622
|
+
{ subscriberId, requestHeaders } = { requestHeaders: {} },
|
|
623
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
94
624
|
) {
|
|
95
625
|
const { error } = WebhookPlatformValidator.getSubscriberById().validate(
|
|
96
626
|
{
|
|
@@ -128,12 +658,12 @@ class Webhook {
|
|
|
128
658
|
`/service/platform/webhook/v1.0/company/${this.config.companyId}/subscriber/${subscriberId}`,
|
|
129
659
|
query_params,
|
|
130
660
|
undefined,
|
|
131
|
-
xHeaders,
|
|
132
|
-
{
|
|
661
|
+
{ ...xHeaders, ...requestHeaders },
|
|
662
|
+
{ responseHeaders }
|
|
133
663
|
);
|
|
134
664
|
|
|
135
665
|
let responseData = response;
|
|
136
|
-
if (
|
|
666
|
+
if (responseHeaders) {
|
|
137
667
|
responseData = response[0];
|
|
138
668
|
}
|
|
139
669
|
|
|
@@ -156,6 +686,7 @@ class Webhook {
|
|
|
156
686
|
|
|
157
687
|
/**
|
|
158
688
|
* @param {WebhookPlatformValidator.GetSubscribersByCompanyParam} arg - Arg object
|
|
689
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
159
690
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
160
691
|
* @returns {Promise<WebhookPlatformModel.SubscriberResponse>} - Success response
|
|
161
692
|
* @name getSubscribersByCompany
|
|
@@ -163,8 +694,8 @@ class Webhook {
|
|
|
163
694
|
* @description: Get Subscribers By CompanyId - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/webhook/getSubscribersByCompany/).
|
|
164
695
|
*/
|
|
165
696
|
async getSubscribersByCompany(
|
|
166
|
-
{ pageNo, pageSize, extensionId } = {},
|
|
167
|
-
{
|
|
697
|
+
{ pageNo, pageSize, extensionId, requestHeaders } = { requestHeaders: {} },
|
|
698
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
168
699
|
) {
|
|
169
700
|
const {
|
|
170
701
|
error,
|
|
@@ -211,12 +742,12 @@ class Webhook {
|
|
|
211
742
|
`/service/platform/webhook/v1.0/company/${this.config.companyId}/subscriber`,
|
|
212
743
|
query_params,
|
|
213
744
|
undefined,
|
|
214
|
-
xHeaders,
|
|
215
|
-
{
|
|
745
|
+
{ ...xHeaders, ...requestHeaders },
|
|
746
|
+
{ responseHeaders }
|
|
216
747
|
);
|
|
217
748
|
|
|
218
749
|
let responseData = response;
|
|
219
|
-
if (
|
|
750
|
+
if (responseHeaders) {
|
|
220
751
|
responseData = response[0];
|
|
221
752
|
}
|
|
222
753
|
|
|
@@ -239,6 +770,7 @@ class Webhook {
|
|
|
239
770
|
|
|
240
771
|
/**
|
|
241
772
|
* @param {WebhookPlatformValidator.GetSubscribersByExtensionIdParam} arg - Arg object
|
|
773
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
242
774
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
243
775
|
* @returns {Promise<WebhookPlatformModel.SubscriberConfigList>} - Success response
|
|
244
776
|
* @name getSubscribersByExtensionId
|
|
@@ -246,8 +778,8 @@ class Webhook {
|
|
|
246
778
|
* @description: Get Subscribers By ExtensionID - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/webhook/getSubscribersByExtensionId/).
|
|
247
779
|
*/
|
|
248
780
|
async getSubscribersByExtensionId(
|
|
249
|
-
{ extensionId, pageNo, pageSize } = {},
|
|
250
|
-
{
|
|
781
|
+
{ extensionId, pageNo, pageSize, requestHeaders } = { requestHeaders: {} },
|
|
782
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
251
783
|
) {
|
|
252
784
|
const {
|
|
253
785
|
error,
|
|
@@ -293,12 +825,12 @@ class Webhook {
|
|
|
293
825
|
`/service/platform/webhook/v1.0/company/${this.config.companyId}/extension/${extensionId}/subscriber`,
|
|
294
826
|
query_params,
|
|
295
827
|
undefined,
|
|
296
|
-
xHeaders,
|
|
297
|
-
{
|
|
828
|
+
{ ...xHeaders, ...requestHeaders },
|
|
829
|
+
{ responseHeaders }
|
|
298
830
|
);
|
|
299
831
|
|
|
300
832
|
let responseData = response;
|
|
301
|
-
if (
|
|
833
|
+
if (responseHeaders) {
|
|
302
834
|
responseData = response[0];
|
|
303
835
|
}
|
|
304
836
|
|
|
@@ -319,8 +851,233 @@ class Webhook {
|
|
|
319
851
|
return response;
|
|
320
852
|
}
|
|
321
853
|
|
|
854
|
+
/**
|
|
855
|
+
* @param {WebhookPlatformValidator.ManualRetryCancelParam} arg - Arg object
|
|
856
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
857
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
858
|
+
* @returns {Promise<WebhookPlatformModel.EventSuccessResponse>} - Success response
|
|
859
|
+
* @name manualRetryCancel
|
|
860
|
+
* @summary: Cancel the active manual retry for a company's failed events.
|
|
861
|
+
* @description: Cancels the active manual retry for a specific company's failed events. If a manual retry is currently in progress, it will be cancelled.
|
|
862
|
+
* - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/webhook/manualRetryCancel/).
|
|
863
|
+
*/
|
|
864
|
+
async manualRetryCancel(
|
|
865
|
+
{ requestHeaders } = { requestHeaders: {} },
|
|
866
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
867
|
+
) {
|
|
868
|
+
const { error } = WebhookPlatformValidator.manualRetryCancel().validate(
|
|
869
|
+
{},
|
|
870
|
+
{ abortEarly: false, allowUnknown: true }
|
|
871
|
+
);
|
|
872
|
+
if (error) {
|
|
873
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
874
|
+
}
|
|
875
|
+
|
|
876
|
+
// Showing warrnings if extra unknown parameters are found
|
|
877
|
+
const {
|
|
878
|
+
error: warrning,
|
|
879
|
+
} = WebhookPlatformValidator.manualRetryCancel().validate(
|
|
880
|
+
{},
|
|
881
|
+
{ abortEarly: false, allowUnknown: false }
|
|
882
|
+
);
|
|
883
|
+
if (warrning) {
|
|
884
|
+
Logger({
|
|
885
|
+
level: "WARN",
|
|
886
|
+
message: `Parameter Validation warrnings for platform > Webhook > manualRetryCancel \n ${warrning}`,
|
|
887
|
+
});
|
|
888
|
+
}
|
|
889
|
+
|
|
890
|
+
const query_params = {};
|
|
891
|
+
|
|
892
|
+
const xHeaders = {};
|
|
893
|
+
|
|
894
|
+
const response = await PlatformAPIClient.execute(
|
|
895
|
+
this.config,
|
|
896
|
+
"delete",
|
|
897
|
+
`/service/platform/webhook/v1.0/company/${this.config.companyId}/retry/cancel`,
|
|
898
|
+
query_params,
|
|
899
|
+
undefined,
|
|
900
|
+
{ ...xHeaders, ...requestHeaders },
|
|
901
|
+
{ responseHeaders }
|
|
902
|
+
);
|
|
903
|
+
|
|
904
|
+
let responseData = response;
|
|
905
|
+
if (responseHeaders) {
|
|
906
|
+
responseData = response[0];
|
|
907
|
+
}
|
|
908
|
+
|
|
909
|
+
const {
|
|
910
|
+
error: res_error,
|
|
911
|
+
} = WebhookPlatformModel.EventSuccessResponse().validate(responseData, {
|
|
912
|
+
abortEarly: false,
|
|
913
|
+
allowUnknown: false,
|
|
914
|
+
});
|
|
915
|
+
|
|
916
|
+
if (res_error) {
|
|
917
|
+
Logger({
|
|
918
|
+
level: "WARN",
|
|
919
|
+
message: `Response Validation Warnnings for platform > Webhook > manualRetryCancel \n ${res_error}`,
|
|
920
|
+
});
|
|
921
|
+
}
|
|
922
|
+
|
|
923
|
+
return response;
|
|
924
|
+
}
|
|
925
|
+
|
|
926
|
+
/**
|
|
927
|
+
* @param {WebhookPlatformValidator.ManualRetryOfFailedEventParam} arg - Arg object
|
|
928
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
929
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
930
|
+
* @returns {Promise<WebhookPlatformModel.EventProcessedSuccessResponse>} -
|
|
931
|
+
* Success response
|
|
932
|
+
* @name manualRetryOfFailedEvent
|
|
933
|
+
* @summary: Initiate a manual retry for event processing.
|
|
934
|
+
* @description: Initiates a manual retry for event processing for a specific company. This endpoint allows the user to specify the date range (start_date and end_date) within which the events should be retried.
|
|
935
|
+
* - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/webhook/manualRetryOfFailedEvent/).
|
|
936
|
+
*/
|
|
937
|
+
async manualRetryOfFailedEvent(
|
|
938
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
939
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
940
|
+
) {
|
|
941
|
+
const {
|
|
942
|
+
error,
|
|
943
|
+
} = WebhookPlatformValidator.manualRetryOfFailedEvent().validate(
|
|
944
|
+
{
|
|
945
|
+
body,
|
|
946
|
+
},
|
|
947
|
+
{ abortEarly: false, allowUnknown: true }
|
|
948
|
+
);
|
|
949
|
+
if (error) {
|
|
950
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
951
|
+
}
|
|
952
|
+
|
|
953
|
+
// Showing warrnings if extra unknown parameters are found
|
|
954
|
+
const {
|
|
955
|
+
error: warrning,
|
|
956
|
+
} = WebhookPlatformValidator.manualRetryOfFailedEvent().validate(
|
|
957
|
+
{
|
|
958
|
+
body,
|
|
959
|
+
},
|
|
960
|
+
{ abortEarly: false, allowUnknown: false }
|
|
961
|
+
);
|
|
962
|
+
if (warrning) {
|
|
963
|
+
Logger({
|
|
964
|
+
level: "WARN",
|
|
965
|
+
message: `Parameter Validation warrnings for platform > Webhook > manualRetryOfFailedEvent \n ${warrning}`,
|
|
966
|
+
});
|
|
967
|
+
}
|
|
968
|
+
|
|
969
|
+
const query_params = {};
|
|
970
|
+
|
|
971
|
+
const xHeaders = {};
|
|
972
|
+
|
|
973
|
+
const response = await PlatformAPIClient.execute(
|
|
974
|
+
this.config,
|
|
975
|
+
"post",
|
|
976
|
+
`/service/platform/webhook/v1.0/company/${this.config.companyId}/retry`,
|
|
977
|
+
query_params,
|
|
978
|
+
body,
|
|
979
|
+
{ ...xHeaders, ...requestHeaders },
|
|
980
|
+
{ responseHeaders }
|
|
981
|
+
);
|
|
982
|
+
|
|
983
|
+
let responseData = response;
|
|
984
|
+
if (responseHeaders) {
|
|
985
|
+
responseData = response[0];
|
|
986
|
+
}
|
|
987
|
+
|
|
988
|
+
const {
|
|
989
|
+
error: res_error,
|
|
990
|
+
} = WebhookPlatformModel.EventProcessedSuccessResponse().validate(
|
|
991
|
+
responseData,
|
|
992
|
+
{ abortEarly: false, allowUnknown: false }
|
|
993
|
+
);
|
|
994
|
+
|
|
995
|
+
if (res_error) {
|
|
996
|
+
Logger({
|
|
997
|
+
level: "WARN",
|
|
998
|
+
message: `Response Validation Warnnings for platform > Webhook > manualRetryOfFailedEvent \n ${res_error}`,
|
|
999
|
+
});
|
|
1000
|
+
}
|
|
1001
|
+
|
|
1002
|
+
return response;
|
|
1003
|
+
}
|
|
1004
|
+
|
|
1005
|
+
/**
|
|
1006
|
+
* @param {WebhookPlatformValidator.PingWebhookParam} arg - Arg object
|
|
1007
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1008
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1009
|
+
* @returns {Promise<WebhookPlatformModel.PingWebhookResponse>} - Success response
|
|
1010
|
+
* @name pingWebhook
|
|
1011
|
+
* @summary: Ping and validate webhook url
|
|
1012
|
+
* @description: Ping and validate webhook url - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/webhook/pingWebhook/).
|
|
1013
|
+
*/
|
|
1014
|
+
async pingWebhook(
|
|
1015
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
1016
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
1017
|
+
) {
|
|
1018
|
+
const { error } = WebhookPlatformValidator.pingWebhook().validate(
|
|
1019
|
+
{
|
|
1020
|
+
body,
|
|
1021
|
+
},
|
|
1022
|
+
{ abortEarly: false, allowUnknown: true }
|
|
1023
|
+
);
|
|
1024
|
+
if (error) {
|
|
1025
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
1026
|
+
}
|
|
1027
|
+
|
|
1028
|
+
// Showing warrnings if extra unknown parameters are found
|
|
1029
|
+
const { error: warrning } = WebhookPlatformValidator.pingWebhook().validate(
|
|
1030
|
+
{
|
|
1031
|
+
body,
|
|
1032
|
+
},
|
|
1033
|
+
{ abortEarly: false, allowUnknown: false }
|
|
1034
|
+
);
|
|
1035
|
+
if (warrning) {
|
|
1036
|
+
Logger({
|
|
1037
|
+
level: "WARN",
|
|
1038
|
+
message: `Parameter Validation warrnings for platform > Webhook > pingWebhook \n ${warrning}`,
|
|
1039
|
+
});
|
|
1040
|
+
}
|
|
1041
|
+
|
|
1042
|
+
const query_params = {};
|
|
1043
|
+
|
|
1044
|
+
const xHeaders = {};
|
|
1045
|
+
|
|
1046
|
+
const response = await PlatformAPIClient.execute(
|
|
1047
|
+
this.config,
|
|
1048
|
+
"post",
|
|
1049
|
+
`/service/platform/webhook/v1.0/company/${this.config.companyId}/subscriber/ping`,
|
|
1050
|
+
query_params,
|
|
1051
|
+
body,
|
|
1052
|
+
{ ...xHeaders, ...requestHeaders },
|
|
1053
|
+
{ responseHeaders }
|
|
1054
|
+
);
|
|
1055
|
+
|
|
1056
|
+
let responseData = response;
|
|
1057
|
+
if (responseHeaders) {
|
|
1058
|
+
responseData = response[0];
|
|
1059
|
+
}
|
|
1060
|
+
|
|
1061
|
+
const {
|
|
1062
|
+
error: res_error,
|
|
1063
|
+
} = WebhookPlatformModel.PingWebhookResponse().validate(responseData, {
|
|
1064
|
+
abortEarly: false,
|
|
1065
|
+
allowUnknown: false,
|
|
1066
|
+
});
|
|
1067
|
+
|
|
1068
|
+
if (res_error) {
|
|
1069
|
+
Logger({
|
|
1070
|
+
level: "WARN",
|
|
1071
|
+
message: `Response Validation Warnnings for platform > Webhook > pingWebhook \n ${res_error}`,
|
|
1072
|
+
});
|
|
1073
|
+
}
|
|
1074
|
+
|
|
1075
|
+
return response;
|
|
1076
|
+
}
|
|
1077
|
+
|
|
322
1078
|
/**
|
|
323
1079
|
* @param {WebhookPlatformValidator.RegisterSubscriberToEventParam} arg - Arg object
|
|
1080
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
324
1081
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
325
1082
|
* @returns {Promise<WebhookPlatformModel.SubscriberConfig>} - Success response
|
|
326
1083
|
* @name registerSubscriberToEvent
|
|
@@ -328,8 +1085,8 @@ class Webhook {
|
|
|
328
1085
|
* @description: Register Subscriber - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/webhook/registerSubscriberToEvent/).
|
|
329
1086
|
*/
|
|
330
1087
|
async registerSubscriberToEvent(
|
|
331
|
-
{ body } = {},
|
|
332
|
-
{
|
|
1088
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
1089
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
333
1090
|
) {
|
|
334
1091
|
const {
|
|
335
1092
|
error,
|
|
@@ -369,12 +1126,12 @@ class Webhook {
|
|
|
369
1126
|
`/service/platform/webhook/v1.0/company/${this.config.companyId}/subscriber`,
|
|
370
1127
|
query_params,
|
|
371
1128
|
body,
|
|
372
|
-
xHeaders,
|
|
373
|
-
{
|
|
1129
|
+
{ ...xHeaders, ...requestHeaders },
|
|
1130
|
+
{ responseHeaders }
|
|
374
1131
|
);
|
|
375
1132
|
|
|
376
1133
|
let responseData = response;
|
|
377
|
-
if (
|
|
1134
|
+
if (responseHeaders) {
|
|
378
1135
|
responseData = response[0];
|
|
379
1136
|
}
|
|
380
1137
|
|
|
@@ -397,6 +1154,7 @@ class Webhook {
|
|
|
397
1154
|
|
|
398
1155
|
/**
|
|
399
1156
|
* @param {WebhookPlatformValidator.UpdateSubscriberConfigParam} arg - Arg object
|
|
1157
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
400
1158
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
401
1159
|
* @returns {Promise<WebhookPlatformModel.SubscriberConfig>} - Success response
|
|
402
1160
|
* @name updateSubscriberConfig
|
|
@@ -404,8 +1162,8 @@ class Webhook {
|
|
|
404
1162
|
* @description: Update Subscriber - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/webhook/updateSubscriberConfig/).
|
|
405
1163
|
*/
|
|
406
1164
|
async updateSubscriberConfig(
|
|
407
|
-
{ body } = {},
|
|
408
|
-
{
|
|
1165
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
1166
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
409
1167
|
) {
|
|
410
1168
|
const {
|
|
411
1169
|
error,
|
|
@@ -445,12 +1203,12 @@ class Webhook {
|
|
|
445
1203
|
`/service/platform/webhook/v1.0/company/${this.config.companyId}/subscriber`,
|
|
446
1204
|
query_params,
|
|
447
1205
|
body,
|
|
448
|
-
xHeaders,
|
|
449
|
-
{
|
|
1206
|
+
{ ...xHeaders, ...requestHeaders },
|
|
1207
|
+
{ responseHeaders }
|
|
450
1208
|
);
|
|
451
1209
|
|
|
452
1210
|
let responseData = response;
|
|
453
|
-
if (
|
|
1211
|
+
if (responseHeaders) {
|
|
454
1212
|
responseData = response[0];
|
|
455
1213
|
}
|
|
456
1214
|
|