@gofynd/fdk-client-javascript 1.4.15-beta.3 → 1.4.15-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/package.json +1 -1
- package/sdk/application/ApplicationClient.d.ts +0 -2
- package/sdk/application/ApplicationClient.js +0 -2
- package/sdk/application/Cart/CartApplicationClient.d.ts +48 -68
- package/sdk/application/Cart/CartApplicationClient.js +304 -114
- package/sdk/application/Catalog/CatalogApplicationClient.d.ts +58 -59
- package/sdk/application/Catalog/CatalogApplicationClient.js +437 -30
- package/sdk/application/Common/CommonApplicationClient.d.ts +2 -2
- package/sdk/application/Common/CommonApplicationClient.js +22 -1
- package/sdk/application/Communication/CommunicationApplicationClient.js +29 -0
- package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +20 -20
- package/sdk/application/Configuration/ConfigurationApplicationClient.js +157 -10
- package/sdk/application/Content/ContentApplicationClient.d.ts +30 -19
- package/sdk/application/Content/ContentApplicationClient.js +297 -28
- package/sdk/application/FileStorage/FileStorageApplicationClient.d.ts +8 -8
- package/sdk/application/FileStorage/FileStorageApplicationClient.js +50 -7
- package/sdk/application/Lead/LeadApplicationClient.d.ts +2 -2
- package/sdk/application/Lead/LeadApplicationClient.js +74 -1
- package/sdk/application/Logistic/LogisticApplicationClient.d.ts +15 -35
- package/sdk/application/Logistic/LogisticApplicationClient.js +159 -87
- package/sdk/application/Order/OrderApplicationClient.d.ts +12 -22
- package/sdk/application/Order/OrderApplicationClient.js +195 -47
- package/sdk/application/Payment/PaymentApplicationClient.d.ts +87 -87
- package/sdk/application/Payment/PaymentApplicationClient.js +473 -46
- package/sdk/application/Rewards/RewardsApplicationClient.d.ts +13 -13
- package/sdk/application/Rewards/RewardsApplicationClient.js +75 -7
- package/sdk/application/Share/ShareApplicationClient.js +96 -0
- package/sdk/application/Theme/ThemeApplicationClient.d.ts +2 -2
- package/sdk/application/Theme/ThemeApplicationClient.js +66 -4
- package/sdk/application/User/UserApplicationClient.d.ts +10 -10
- package/sdk/application/User/UserApplicationClient.js +418 -6
- package/sdk/application/Webhook/WebhookApplicationClient.d.ts +4 -4
- package/sdk/application/Webhook/WebhookApplicationClient.js +16 -3
- package/sdk/partner/FileStorage/FileStoragePartnerClient.d.ts +12 -86
- package/sdk/partner/FileStorage/FileStoragePartnerClient.js +24 -582
- package/sdk/partner/FileStorage/FileStoragePartnerModel.d.ts +19 -116
- package/sdk/partner/FileStorage/FileStoragePartnerModel.js +14 -121
- package/sdk/partner/FileStorage/FileStoragePartnerValidator.d.ts +1 -8
- package/sdk/partner/FileStorage/FileStoragePartnerValidator.js +4 -51
- package/sdk/partner/Lead/LeadPartnerClient.d.ts +2 -2
- package/sdk/partner/Lead/LeadPartnerClient.js +2 -2
- package/sdk/partner/Lead/LeadPartnerModel.d.ts +5 -5
- package/sdk/partner/Lead/LeadPartnerModel.js +15 -15
- package/sdk/partner/Logistics/LogisticsPartnerClient.d.ts +20 -126
- package/sdk/partner/Logistics/LogisticsPartnerClient.js +20 -970
- package/sdk/partner/Logistics/LogisticsPartnerModel.d.ts +167 -1200
- package/sdk/partner/Logistics/LogisticsPartnerModel.js +160 -571
- package/sdk/partner/Logistics/LogisticsPartnerValidator.d.ts +0 -10
- package/sdk/partner/Logistics/LogisticsPartnerValidator.js +7 -121
- package/sdk/partner/OAuthClient.js +1 -0
- package/sdk/partner/Theme/ThemePartnerClient.d.ts +10 -8
- package/sdk/partner/Theme/ThemePartnerClient.js +16 -14
- package/sdk/partner/Theme/ThemePartnerModel.d.ts +39 -135
- package/sdk/partner/Theme/ThemePartnerModel.js +38 -114
- package/sdk/partner/Theme/ThemePartnerValidator.js +4 -4
- package/sdk/partner/Webhook/WebhookPartnerClient.d.ts +18 -28
- package/sdk/partner/Webhook/WebhookPartnerClient.js +18 -103
- package/sdk/partner/Webhook/WebhookPartnerModel.d.ts +179 -612
- package/sdk/partner/Webhook/WebhookPartnerModel.js +150 -253
- package/sdk/partner/Webhook/WebhookPartnerValidator.d.ts +0 -1
- package/sdk/partner/Webhook/WebhookPartnerValidator.js +3 -11
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.d.ts +4 -5
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.js +8 -14
- package/sdk/platform/Analytics/AnalyticsPlatformModel.d.ts +9 -59
- package/sdk/platform/Analytics/AnalyticsPlatformModel.js +4 -40
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.d.ts +32 -2
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +243 -3
- package/sdk/platform/AuditTrail/AuditTrailPlatformModel.d.ts +130 -11
- package/sdk/platform/AuditTrail/AuditTrailPlatformModel.js +152 -12
- package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.d.ts +39 -1
- package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.js +35 -0
- package/sdk/platform/Billing/BillingPlatformClient.d.ts +12 -12
- package/sdk/platform/Billing/BillingPlatformClient.js +15 -15
- package/sdk/platform/Billing/BillingPlatformModel.d.ts +388 -443
- package/sdk/platform/Billing/BillingPlatformModel.js +263 -280
- package/sdk/platform/Billing/BillingPlatformValidator.d.ts +18 -16
- package/sdk/platform/Billing/BillingPlatformValidator.js +9 -8
- package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +103 -134
- package/sdk/platform/Cart/CartPlatformApplicationClient.js +115 -419
- package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +65 -118
- package/sdk/platform/Cart/CartPlatformApplicationValidator.js +44 -109
- package/sdk/platform/Cart/CartPlatformModel.d.ts +1298 -5037
- package/sdk/platform/Cart/CartPlatformModel.js +1217 -1976
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +183 -209
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +400 -457
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +142 -185
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +78 -96
- package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +117 -154
- package/sdk/platform/Catalog/CatalogPlatformClient.js +172 -292
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +1647 -6385
- package/sdk/platform/Catalog/CatalogPlatformModel.js +1680 -3217
- package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +31 -72
- package/sdk/platform/Catalog/CatalogPlatformValidator.js +24 -50
- package/sdk/platform/Common/CommonPlatformClient.d.ts +2 -3
- package/sdk/platform/Common/CommonPlatformClient.js +2 -3
- package/sdk/platform/Common/CommonPlatformModel.d.ts +9 -9
- package/sdk/platform/Common/CommonPlatformModel.js +6 -6
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +17 -16
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +17 -16
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.d.ts +8 -8
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.js +8 -8
- package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +33 -43
- package/sdk/platform/Communication/CommunicationPlatformModel.js +34 -38
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +42 -46
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +43 -47
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +223 -223
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +212 -210
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.d.ts +12 -12
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.js +12 -12
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +33 -46
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +54 -67
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.d.ts +18 -18
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.js +18 -18
- package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +24 -45
- package/sdk/platform/Configuration/ConfigurationPlatformClient.js +30 -134
- package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +131 -283
- package/sdk/platform/Configuration/ConfigurationPlatformModel.js +97 -219
- package/sdk/platform/Configuration/ConfigurationPlatformValidator.d.ts +9 -37
- package/sdk/platform/Configuration/ConfigurationPlatformValidator.js +8 -27
- package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +141 -124
- package/sdk/platform/Content/ContentPlatformApplicationClient.js +422 -449
- package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +141 -179
- package/sdk/platform/Content/ContentPlatformApplicationValidator.js +130 -168
- package/sdk/platform/Content/ContentPlatformClient.d.ts +106 -142
- package/sdk/platform/Content/ContentPlatformClient.js +336 -523
- package/sdk/platform/Content/ContentPlatformModel.d.ts +395 -1241
- package/sdk/platform/Content/ContentPlatformModel.js +390 -521
- package/sdk/platform/Content/ContentPlatformValidator.d.ts +117 -168
- package/sdk/platform/Content/ContentPlatformValidator.js +108 -162
- package/sdk/platform/Discount/DiscountPlatformClient.d.ts +12 -14
- package/sdk/platform/Discount/DiscountPlatformClient.js +12 -14
- package/sdk/platform/Discount/DiscountPlatformModel.d.ts +13 -13
- package/sdk/platform/Discount/DiscountPlatformModel.js +12 -12
- package/sdk/platform/Discount/DiscountPlatformValidator.d.ts +2 -2
- package/sdk/platform/Discount/DiscountPlatformValidator.js +2 -2
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +36 -94
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +60 -462
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.d.ts +15 -62
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.js +13 -75
- package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +19 -19
- package/sdk/platform/FileStorage/FileStoragePlatformClient.js +21 -21
- package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +101 -370
- package/sdk/platform/FileStorage/FileStoragePlatformModel.js +84 -313
- package/sdk/platform/FileStorage/FileStoragePlatformValidator.d.ts +6 -6
- package/sdk/platform/FileStorage/FileStoragePlatformValidator.js +6 -6
- package/sdk/platform/Finance/FinancePlatformClient.d.ts +320 -0
- package/sdk/platform/Finance/FinancePlatformClient.js +2333 -0
- package/sdk/platform/Finance/FinancePlatformModel.d.ts +2890 -0
- package/sdk/platform/Finance/FinancePlatformModel.js +2148 -0
- package/sdk/platform/Finance/FinancePlatformValidator.d.ts +284 -0
- package/sdk/platform/Finance/FinancePlatformValidator.js +354 -0
- package/sdk/platform/Lead/LeadPlatformClient.d.ts +2 -2
- package/sdk/platform/Lead/LeadPlatformClient.js +2 -2
- package/sdk/platform/Lead/LeadPlatformModel.d.ts +5 -5
- package/sdk/platform/Lead/LeadPlatformModel.js +16 -16
- package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +6 -17
- package/sdk/platform/Order/OrderPlatformApplicationClient.js +7 -85
- package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +24 -95
- package/sdk/platform/Order/OrderPlatformApplicationValidator.js +19 -39
- package/sdk/platform/Order/OrderPlatformClient.d.ts +96 -153
- package/sdk/platform/Order/OrderPlatformClient.js +198 -416
- package/sdk/platform/Order/OrderPlatformModel.d.ts +1286 -7619
- package/sdk/platform/Order/OrderPlatformModel.js +1265 -3922
- package/sdk/platform/Order/OrderPlatformValidator.d.ts +109 -270
- package/sdk/platform/Order/OrderPlatformValidator.js +77 -135
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.d.ts +4 -6
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.js +7 -9
- package/sdk/platform/Partner/PartnerPlatformModel.d.ts +9 -9
- package/sdk/platform/Partner/PartnerPlatformModel.js +8 -8
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +105 -93
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +141 -129
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +48 -48
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +48 -48
- package/sdk/platform/Payment/PaymentPlatformClient.d.ts +20 -20
- package/sdk/platform/Payment/PaymentPlatformClient.js +20 -20
- package/sdk/platform/Payment/PaymentPlatformModel.d.ts +319 -333
- package/sdk/platform/Payment/PaymentPlatformModel.js +278 -288
- package/sdk/platform/Payment/PaymentPlatformValidator.d.ts +8 -8
- package/sdk/platform/Payment/PaymentPlatformValidator.js +8 -8
- package/sdk/platform/PlatformClient.d.ts +2 -0
- package/sdk/platform/PlatformClient.js +4 -0
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.d.ts +2 -2
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +2 -2
- package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.d.ts +2 -2
- package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.js +2 -2
- package/sdk/platform/Rewards/RewardsPlatformModel.d.ts +9 -9
- package/sdk/platform/Rewards/RewardsPlatformModel.js +8 -8
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.d.ts +36 -46
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.js +41 -132
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.d.ts +17 -46
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.js +14 -34
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +46 -40
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +64 -58
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +612 -1845
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +554 -886
- package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.d.ts +46 -42
- package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.js +28 -26
- package/sdk/platform/Share/SharePlatformApplicationClient.d.ts +2 -2
- package/sdk/platform/Share/SharePlatformApplicationClient.js +2 -2
- package/sdk/platform/Share/SharePlatformModel.d.ts +5 -36
- package/sdk/platform/Share/SharePlatformModel.js +4 -27
- package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +3 -3
- package/sdk/platform/Theme/ThemePlatformApplicationClient.js +4 -8
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.d.ts +0 -5
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.js +0 -2
- package/sdk/platform/Theme/ThemePlatformModel.d.ts +13 -76
- package/sdk/platform/Theme/ThemePlatformModel.js +17 -57
- package/sdk/platform/User/UserPlatformApplicationClient.d.ts +12 -12
- package/sdk/platform/User/UserPlatformApplicationClient.js +12 -12
- package/sdk/platform/User/UserPlatformApplicationValidator.d.ts +2 -2
- package/sdk/platform/User/UserPlatformApplicationValidator.js +2 -2
- package/sdk/platform/User/UserPlatformModel.d.ts +21 -21
- package/sdk/platform/User/UserPlatformModel.js +23 -23
- package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +78 -25
- package/sdk/platform/Webhook/WebhookPlatformClient.js +470 -75
- package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +427 -720
- package/sdk/platform/Webhook/WebhookPlatformModel.js +386 -410
- package/sdk/platform/Webhook/WebhookPlatformValidator.d.ts +55 -10
- package/sdk/platform/Webhook/WebhookPlatformValidator.js +72 -12
- package/sdk/platform/index.d.ts +1 -0
- package/sdk/platform/index.js +2 -0
- package/sdk/public/Configuration/ConfigurationPublicClient.d.ts +2 -3
- package/sdk/public/Configuration/ConfigurationPublicClient.js +21 -6
- package/sdk/public/Configuration/ConfigurationPublicModel.d.ts +9 -9
- package/sdk/public/Configuration/ConfigurationPublicModel.js +6 -6
- package/sdk/public/Content/ContentPublicClient.d.ts +2 -112
- package/sdk/public/Content/ContentPublicClient.js +20 -791
- package/sdk/public/Content/ContentPublicModel.d.ts +3 -549
- package/sdk/public/Content/ContentPublicModel.js +3 -649
- package/sdk/public/Content/ContentPublicValidator.d.ts +3 -69
- package/sdk/public/Content/ContentPublicValidator.js +2 -88
- package/sdk/public/Partner/PartnerPublicClient.js +15 -0
- package/sdk/public/Webhook/WebhookPublicClient.d.ts +8 -8
- package/sdk/public/Webhook/WebhookPublicClient.js +48 -8
- package/sdk/public/Webhook/WebhookPublicModel.d.ts +21 -21
- package/sdk/public/Webhook/WebhookPublicModel.js +15 -15
- package/sdk/public/Webhook/WebhookPublicValidator.d.ts +4 -4
- package/sdk/public/Webhook/WebhookPublicValidator.js +4 -4
- package/sdk/application/Finance/FinanceApplicationClient.d.ts +0 -29
- package/sdk/application/Finance/FinanceApplicationClient.js +0 -105
|
@@ -14,11 +14,172 @@ class Webhook {
|
|
|
14
14
|
this.config = config;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
+
/**
|
|
18
|
+
* @param {WebhookPlatformValidator.CancelJobByNameParam} arg - Arg object
|
|
19
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
20
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
21
|
+
* @returns {Promise<WebhookPlatformModel.CancelResponse>} - Success response
|
|
22
|
+
* @name cancelJobByName
|
|
23
|
+
* @summary: Cancel job by name
|
|
24
|
+
* @description: It will cancel export job triggerd by user in order to fetch
|
|
25
|
+
* historical delivery summery - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/webhook/cancelJobByName/).
|
|
26
|
+
*/
|
|
27
|
+
async cancelJobByName(
|
|
28
|
+
{ filename, requestHeaders } = { requestHeaders: {} },
|
|
29
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
30
|
+
) {
|
|
31
|
+
const { error } = WebhookPlatformValidator.cancelJobByName().validate(
|
|
32
|
+
{
|
|
33
|
+
filename,
|
|
34
|
+
},
|
|
35
|
+
{ abortEarly: false, allowUnknown: true }
|
|
36
|
+
);
|
|
37
|
+
if (error) {
|
|
38
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// Showing warrnings if extra unknown parameters are found
|
|
42
|
+
const {
|
|
43
|
+
error: warrning,
|
|
44
|
+
} = WebhookPlatformValidator.cancelJobByName().validate(
|
|
45
|
+
{
|
|
46
|
+
filename,
|
|
47
|
+
},
|
|
48
|
+
{ abortEarly: false, allowUnknown: false }
|
|
49
|
+
);
|
|
50
|
+
if (warrning) {
|
|
51
|
+
Logger({
|
|
52
|
+
level: "WARN",
|
|
53
|
+
message: `Parameter Validation warrnings for platform > Webhook > cancelJobByName \n ${warrning}`,
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const query_params = {};
|
|
58
|
+
|
|
59
|
+
const xHeaders = {};
|
|
60
|
+
|
|
61
|
+
const response = await PlatformAPIClient.execute(
|
|
62
|
+
this.config,
|
|
63
|
+
"get",
|
|
64
|
+
`/service/platform/webhook/v1.0/company/${this.config.companyId}/reports/cancel/file/${filename}`,
|
|
65
|
+
query_params,
|
|
66
|
+
undefined,
|
|
67
|
+
{ ...xHeaders, ...requestHeaders },
|
|
68
|
+
{ responseHeaders }
|
|
69
|
+
);
|
|
70
|
+
|
|
71
|
+
let responseData = response;
|
|
72
|
+
if (responseHeaders) {
|
|
73
|
+
responseData = response[0];
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const {
|
|
77
|
+
error: res_error,
|
|
78
|
+
} = WebhookPlatformModel.CancelResponse().validate(responseData, {
|
|
79
|
+
abortEarly: false,
|
|
80
|
+
allowUnknown: true,
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
if (res_error) {
|
|
84
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
85
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
86
|
+
} else {
|
|
87
|
+
Logger({
|
|
88
|
+
level: "WARN",
|
|
89
|
+
message: `Response Validation Warnings for platform > Webhook > cancelJobByName \n ${res_error}`,
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
return response;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* @param {WebhookPlatformValidator.DownloadDeliveryReportParam} arg - Arg object
|
|
99
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
100
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
101
|
+
* @returns {Promise<WebhookPlatformModel.DownloadReportResponse>} - Success response
|
|
102
|
+
* @name downloadDeliveryReport
|
|
103
|
+
* @summary: Download delivery report
|
|
104
|
+
* @description: Download detailed delivery reports for events. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/webhook/downloadDeliveryReport/).
|
|
105
|
+
*/
|
|
106
|
+
async downloadDeliveryReport(
|
|
107
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
108
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
109
|
+
) {
|
|
110
|
+
const {
|
|
111
|
+
error,
|
|
112
|
+
} = WebhookPlatformValidator.downloadDeliveryReport().validate(
|
|
113
|
+
{
|
|
114
|
+
body,
|
|
115
|
+
},
|
|
116
|
+
{ abortEarly: false, allowUnknown: true }
|
|
117
|
+
);
|
|
118
|
+
if (error) {
|
|
119
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// Showing warrnings if extra unknown parameters are found
|
|
123
|
+
const {
|
|
124
|
+
error: warrning,
|
|
125
|
+
} = WebhookPlatformValidator.downloadDeliveryReport().validate(
|
|
126
|
+
{
|
|
127
|
+
body,
|
|
128
|
+
},
|
|
129
|
+
{ abortEarly: false, allowUnknown: false }
|
|
130
|
+
);
|
|
131
|
+
if (warrning) {
|
|
132
|
+
Logger({
|
|
133
|
+
level: "WARN",
|
|
134
|
+
message: `Parameter Validation warrnings for platform > Webhook > downloadDeliveryReport \n ${warrning}`,
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
const query_params = {};
|
|
139
|
+
|
|
140
|
+
const xHeaders = {};
|
|
141
|
+
|
|
142
|
+
const response = await PlatformAPIClient.execute(
|
|
143
|
+
this.config,
|
|
144
|
+
"post",
|
|
145
|
+
`/service/platform/webhook/v1.0/company/${this.config.companyId}/reports/download`,
|
|
146
|
+
query_params,
|
|
147
|
+
body,
|
|
148
|
+
{ ...xHeaders, ...requestHeaders },
|
|
149
|
+
{ responseHeaders }
|
|
150
|
+
);
|
|
151
|
+
|
|
152
|
+
let responseData = response;
|
|
153
|
+
if (responseHeaders) {
|
|
154
|
+
responseData = response[0];
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
const {
|
|
158
|
+
error: res_error,
|
|
159
|
+
} = WebhookPlatformModel.DownloadReportResponse().validate(responseData, {
|
|
160
|
+
abortEarly: false,
|
|
161
|
+
allowUnknown: true,
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
if (res_error) {
|
|
165
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
166
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
167
|
+
} else {
|
|
168
|
+
Logger({
|
|
169
|
+
level: "WARN",
|
|
170
|
+
message: `Response Validation Warnings for platform > Webhook > downloadDeliveryReport \n ${res_error}`,
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
return response;
|
|
176
|
+
}
|
|
177
|
+
|
|
17
178
|
/**
|
|
18
179
|
* @param {WebhookPlatformValidator.FetchAllEventConfigurationsParam} arg - Arg object
|
|
19
180
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
20
181
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
21
|
-
* @returns {Promise<WebhookPlatformModel.
|
|
182
|
+
* @returns {Promise<WebhookPlatformModel.EventConfigResponse>} - Success response
|
|
22
183
|
* @name fetchAllEventConfigurations
|
|
23
184
|
* @summary: List event configurations
|
|
24
185
|
* @description: Retrieve all configurations for event handling. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/webhook/fetchAllEventConfigurations/).
|
|
@@ -72,7 +233,7 @@ class Webhook {
|
|
|
72
233
|
|
|
73
234
|
const {
|
|
74
235
|
error: res_error,
|
|
75
|
-
} = WebhookPlatformModel.
|
|
236
|
+
} = WebhookPlatformModel.EventConfigResponse().validate(responseData, {
|
|
76
237
|
abortEarly: false,
|
|
77
238
|
allowUnknown: true,
|
|
78
239
|
});
|
|
@@ -91,11 +252,245 @@ class Webhook {
|
|
|
91
252
|
return response;
|
|
92
253
|
}
|
|
93
254
|
|
|
255
|
+
/**
|
|
256
|
+
* @param {WebhookPlatformValidator.GetDeliveryReportsParam} arg - Arg object
|
|
257
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
258
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
259
|
+
* @returns {Promise<WebhookPlatformModel.EventProcessReports>} - Success response
|
|
260
|
+
* @name getDeliveryReports
|
|
261
|
+
* @summary: Get delivery reports
|
|
262
|
+
* @description: Retrieve reports on the delivery status of events. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/webhook/getDeliveryReports/).
|
|
263
|
+
*/
|
|
264
|
+
async getDeliveryReports(
|
|
265
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
266
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
267
|
+
) {
|
|
268
|
+
const { error } = WebhookPlatformValidator.getDeliveryReports().validate(
|
|
269
|
+
{
|
|
270
|
+
body,
|
|
271
|
+
},
|
|
272
|
+
{ abortEarly: false, allowUnknown: true }
|
|
273
|
+
);
|
|
274
|
+
if (error) {
|
|
275
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
// Showing warrnings if extra unknown parameters are found
|
|
279
|
+
const {
|
|
280
|
+
error: warrning,
|
|
281
|
+
} = WebhookPlatformValidator.getDeliveryReports().validate(
|
|
282
|
+
{
|
|
283
|
+
body,
|
|
284
|
+
},
|
|
285
|
+
{ abortEarly: false, allowUnknown: false }
|
|
286
|
+
);
|
|
287
|
+
if (warrning) {
|
|
288
|
+
Logger({
|
|
289
|
+
level: "WARN",
|
|
290
|
+
message: `Parameter Validation warrnings for platform > Webhook > getDeliveryReports \n ${warrning}`,
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
const query_params = {};
|
|
295
|
+
|
|
296
|
+
const xHeaders = {};
|
|
297
|
+
|
|
298
|
+
const response = await PlatformAPIClient.execute(
|
|
299
|
+
this.config,
|
|
300
|
+
"post",
|
|
301
|
+
`/service/platform/webhook/v1.0/company/${this.config.companyId}/reports/event_processed`,
|
|
302
|
+
query_params,
|
|
303
|
+
body,
|
|
304
|
+
{ ...xHeaders, ...requestHeaders },
|
|
305
|
+
{ responseHeaders }
|
|
306
|
+
);
|
|
307
|
+
|
|
308
|
+
let responseData = response;
|
|
309
|
+
if (responseHeaders) {
|
|
310
|
+
responseData = response[0];
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
const {
|
|
314
|
+
error: res_error,
|
|
315
|
+
} = WebhookPlatformModel.EventProcessReports().validate(responseData, {
|
|
316
|
+
abortEarly: false,
|
|
317
|
+
allowUnknown: true,
|
|
318
|
+
});
|
|
319
|
+
|
|
320
|
+
if (res_error) {
|
|
321
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
322
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
323
|
+
} else {
|
|
324
|
+
Logger({
|
|
325
|
+
level: "WARN",
|
|
326
|
+
message: `Response Validation Warnings for platform > Webhook > getDeliveryReports \n ${res_error}`,
|
|
327
|
+
});
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
return response;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
/**
|
|
335
|
+
* @param {WebhookPlatformValidator.GetHistoricalReportsParam} arg - Arg object
|
|
336
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
337
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
338
|
+
* @returns {Promise<WebhookPlatformModel.HistoryResponse>} - Success response
|
|
339
|
+
* @name getHistoricalReports
|
|
340
|
+
* @summary: Get historical reports
|
|
341
|
+
* @description: Retrieve historical reports of webhook events. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/webhook/getHistoricalReports/).
|
|
342
|
+
*/
|
|
343
|
+
async getHistoricalReports(
|
|
344
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
345
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
346
|
+
) {
|
|
347
|
+
const { error } = WebhookPlatformValidator.getHistoricalReports().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.getHistoricalReports().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 > getHistoricalReports \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}/reports/history`,
|
|
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.HistoryResponse().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 > getHistoricalReports \n ${res_error}`,
|
|
406
|
+
});
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
return response;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
/**
|
|
414
|
+
* @param {WebhookPlatformValidator.GetReportFiltersParam} arg - Arg object
|
|
415
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
416
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
417
|
+
* @returns {Promise<WebhookPlatformModel.ReportFilterResponse[]>} - Success response
|
|
418
|
+
* @name getReportFilters
|
|
419
|
+
* @summary: Get report filters
|
|
420
|
+
* @description: Retrieve filters used for generating reports. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/webhook/getReportFilters/).
|
|
421
|
+
*/
|
|
422
|
+
async getReportFilters(
|
|
423
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
424
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
425
|
+
) {
|
|
426
|
+
const { error } = WebhookPlatformValidator.getReportFilters().validate(
|
|
427
|
+
{
|
|
428
|
+
body,
|
|
429
|
+
},
|
|
430
|
+
{ abortEarly: false, allowUnknown: true }
|
|
431
|
+
);
|
|
432
|
+
if (error) {
|
|
433
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
// Showing warrnings if extra unknown parameters are found
|
|
437
|
+
const {
|
|
438
|
+
error: warrning,
|
|
439
|
+
} = WebhookPlatformValidator.getReportFilters().validate(
|
|
440
|
+
{
|
|
441
|
+
body,
|
|
442
|
+
},
|
|
443
|
+
{ abortEarly: false, allowUnknown: false }
|
|
444
|
+
);
|
|
445
|
+
if (warrning) {
|
|
446
|
+
Logger({
|
|
447
|
+
level: "WARN",
|
|
448
|
+
message: `Parameter Validation warrnings for platform > Webhook > getReportFilters \n ${warrning}`,
|
|
449
|
+
});
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
const query_params = {};
|
|
453
|
+
|
|
454
|
+
const xHeaders = {};
|
|
455
|
+
|
|
456
|
+
const response = await PlatformAPIClient.execute(
|
|
457
|
+
this.config,
|
|
458
|
+
"post",
|
|
459
|
+
`/service/platform/webhook/v1.0/company/${this.config.companyId}/filters`,
|
|
460
|
+
query_params,
|
|
461
|
+
body,
|
|
462
|
+
{ ...xHeaders, ...requestHeaders },
|
|
463
|
+
{ responseHeaders }
|
|
464
|
+
);
|
|
465
|
+
|
|
466
|
+
let responseData = response;
|
|
467
|
+
if (responseHeaders) {
|
|
468
|
+
responseData = response[0];
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
const { error: res_error } = Joi.array()
|
|
472
|
+
.items(WebhookPlatformModel.ReportFilterResponse())
|
|
473
|
+
.validate(responseData, { abortEarly: false, allowUnknown: true });
|
|
474
|
+
|
|
475
|
+
if (res_error) {
|
|
476
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
477
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
478
|
+
} else {
|
|
479
|
+
Logger({
|
|
480
|
+
level: "WARN",
|
|
481
|
+
message: `Response Validation Warnings for platform > Webhook > getReportFilters \n ${res_error}`,
|
|
482
|
+
});
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
return response;
|
|
487
|
+
}
|
|
488
|
+
|
|
94
489
|
/**
|
|
95
490
|
* @param {WebhookPlatformValidator.GetSubscriberByIdParam} arg - Arg object
|
|
96
491
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
97
492
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
98
|
-
* @returns {Promise<WebhookPlatformModel.
|
|
493
|
+
* @returns {Promise<WebhookPlatformModel.SubscriberResponse>} - Success response
|
|
99
494
|
* @name getSubscriberById
|
|
100
495
|
* @summary: Get a subscriber
|
|
101
496
|
* @description: Retrieve a subscriber's details by their unique identifier. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/webhook/getSubscriberById/).
|
|
@@ -151,7 +546,7 @@ class Webhook {
|
|
|
151
546
|
|
|
152
547
|
const {
|
|
153
548
|
error: res_error,
|
|
154
|
-
} = WebhookPlatformModel.
|
|
549
|
+
} = WebhookPlatformModel.SubscriberResponse().validate(responseData, {
|
|
155
550
|
abortEarly: false,
|
|
156
551
|
allowUnknown: true,
|
|
157
552
|
});
|
|
@@ -346,21 +741,19 @@ class Webhook {
|
|
|
346
741
|
}
|
|
347
742
|
|
|
348
743
|
/**
|
|
349
|
-
* @param {WebhookPlatformValidator.
|
|
744
|
+
* @param {WebhookPlatformValidator.PingWebhookParam} arg - Arg object
|
|
350
745
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
351
746
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
352
|
-
* @returns {Promise<WebhookPlatformModel.
|
|
353
|
-
* @name
|
|
354
|
-
* @summary:
|
|
355
|
-
* @description:
|
|
747
|
+
* @returns {Promise<WebhookPlatformModel.PingWebhookResponse>} - Success response
|
|
748
|
+
* @name pingWebhook
|
|
749
|
+
* @summary: Ping webhook
|
|
750
|
+
* @description: Send a test ping to a webhook for verification. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/webhook/pingWebhook/).
|
|
356
751
|
*/
|
|
357
|
-
async
|
|
752
|
+
async pingWebhook(
|
|
358
753
|
{ body, requestHeaders } = { requestHeaders: {} },
|
|
359
754
|
{ responseHeaders } = { responseHeaders: false }
|
|
360
755
|
) {
|
|
361
|
-
const {
|
|
362
|
-
error,
|
|
363
|
-
} = WebhookPlatformValidator.registerSubscriberToEvent().validate(
|
|
756
|
+
const { error } = WebhookPlatformValidator.pingWebhook().validate(
|
|
364
757
|
{
|
|
365
758
|
body,
|
|
366
759
|
},
|
|
@@ -371,9 +764,7 @@ class Webhook {
|
|
|
371
764
|
}
|
|
372
765
|
|
|
373
766
|
// Showing warrnings if extra unknown parameters are found
|
|
374
|
-
const {
|
|
375
|
-
error: warrning,
|
|
376
|
-
} = WebhookPlatformValidator.registerSubscriberToEvent().validate(
|
|
767
|
+
const { error: warrning } = WebhookPlatformValidator.pingWebhook().validate(
|
|
377
768
|
{
|
|
378
769
|
body,
|
|
379
770
|
},
|
|
@@ -382,7 +773,7 @@ class Webhook {
|
|
|
382
773
|
if (warrning) {
|
|
383
774
|
Logger({
|
|
384
775
|
level: "WARN",
|
|
385
|
-
message: `Parameter Validation warrnings for platform > Webhook >
|
|
776
|
+
message: `Parameter Validation warrnings for platform > Webhook > pingWebhook \n ${warrning}`,
|
|
386
777
|
});
|
|
387
778
|
}
|
|
388
779
|
|
|
@@ -393,7 +784,7 @@ class Webhook {
|
|
|
393
784
|
const response = await PlatformAPIClient.execute(
|
|
394
785
|
this.config,
|
|
395
786
|
"post",
|
|
396
|
-
`/service/platform/webhook/v1.0/company/${this.config.companyId}/subscriber
|
|
787
|
+
`/service/platform/webhook/v1.0/company/${this.config.companyId}/subscriber/ping`,
|
|
397
788
|
query_params,
|
|
398
789
|
body,
|
|
399
790
|
{ ...xHeaders, ...requestHeaders },
|
|
@@ -407,7 +798,7 @@ class Webhook {
|
|
|
407
798
|
|
|
408
799
|
const {
|
|
409
800
|
error: res_error,
|
|
410
|
-
} = WebhookPlatformModel.
|
|
801
|
+
} = WebhookPlatformModel.PingWebhookResponse().validate(responseData, {
|
|
411
802
|
abortEarly: false,
|
|
412
803
|
allowUnknown: true,
|
|
413
804
|
});
|
|
@@ -418,7 +809,7 @@ class Webhook {
|
|
|
418
809
|
} else {
|
|
419
810
|
Logger({
|
|
420
811
|
level: "WARN",
|
|
421
|
-
message: `Response Validation Warnings for platform > Webhook >
|
|
812
|
+
message: `Response Validation Warnings for platform > Webhook > pingWebhook \n ${res_error}`,
|
|
422
813
|
});
|
|
423
814
|
}
|
|
424
815
|
}
|
|
@@ -427,22 +818,22 @@ class Webhook {
|
|
|
427
818
|
}
|
|
428
819
|
|
|
429
820
|
/**
|
|
430
|
-
* @param {WebhookPlatformValidator.
|
|
821
|
+
* @param {WebhookPlatformValidator.RegisterSubscriberToEventParam} arg - Arg object
|
|
431
822
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
432
823
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
433
|
-
* @returns {Promise<WebhookPlatformModel.
|
|
434
|
-
*
|
|
435
|
-
* @
|
|
436
|
-
* @
|
|
437
|
-
*
|
|
824
|
+
* @returns {Promise<WebhookPlatformModel.SubscriberConfigResponse>} -
|
|
825
|
+
* Success response
|
|
826
|
+
* @name registerSubscriberToEvent
|
|
827
|
+
* @summary: Register subscriber to event
|
|
828
|
+
* @description: Add a subscriber to receive events of a specific type. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/webhook/registerSubscriberToEvent/).
|
|
438
829
|
*/
|
|
439
|
-
async
|
|
830
|
+
async registerSubscriberToEvent(
|
|
440
831
|
{ body, requestHeaders } = { requestHeaders: {} },
|
|
441
832
|
{ responseHeaders } = { responseHeaders: false }
|
|
442
833
|
) {
|
|
443
834
|
const {
|
|
444
835
|
error,
|
|
445
|
-
} = WebhookPlatformValidator.
|
|
836
|
+
} = WebhookPlatformValidator.registerSubscriberToEvent().validate(
|
|
446
837
|
{
|
|
447
838
|
body,
|
|
448
839
|
},
|
|
@@ -455,7 +846,7 @@ class Webhook {
|
|
|
455
846
|
// Showing warrnings if extra unknown parameters are found
|
|
456
847
|
const {
|
|
457
848
|
error: warrning,
|
|
458
|
-
} = WebhookPlatformValidator.
|
|
849
|
+
} = WebhookPlatformValidator.registerSubscriberToEvent().validate(
|
|
459
850
|
{
|
|
460
851
|
body,
|
|
461
852
|
},
|
|
@@ -464,7 +855,7 @@ class Webhook {
|
|
|
464
855
|
if (warrning) {
|
|
465
856
|
Logger({
|
|
466
857
|
level: "WARN",
|
|
467
|
-
message: `Parameter Validation warrnings for platform > Webhook >
|
|
858
|
+
message: `Parameter Validation warrnings for platform > Webhook > registerSubscriberToEvent \n ${warrning}`,
|
|
468
859
|
});
|
|
469
860
|
}
|
|
470
861
|
|
|
@@ -475,7 +866,7 @@ class Webhook {
|
|
|
475
866
|
const response = await PlatformAPIClient.execute(
|
|
476
867
|
this.config,
|
|
477
868
|
"post",
|
|
478
|
-
`/service/platform/webhook/
|
|
869
|
+
`/service/platform/webhook/v1.0/company/${this.config.companyId}/subscriber/`,
|
|
479
870
|
query_params,
|
|
480
871
|
body,
|
|
481
872
|
{ ...xHeaders, ...requestHeaders },
|
|
@@ -489,7 +880,7 @@ class Webhook {
|
|
|
489
880
|
|
|
490
881
|
const {
|
|
491
882
|
error: res_error,
|
|
492
|
-
} = WebhookPlatformModel.
|
|
883
|
+
} = WebhookPlatformModel.SubscriberConfigResponse().validate(responseData, {
|
|
493
884
|
abortEarly: false,
|
|
494
885
|
allowUnknown: true,
|
|
495
886
|
});
|
|
@@ -500,7 +891,7 @@ class Webhook {
|
|
|
500
891
|
} else {
|
|
501
892
|
Logger({
|
|
502
893
|
level: "WARN",
|
|
503
|
-
message: `Response Validation Warnings for platform > Webhook >
|
|
894
|
+
message: `Response Validation Warnings for platform > Webhook > registerSubscriberToEvent \n ${res_error}`,
|
|
504
895
|
});
|
|
505
896
|
}
|
|
506
897
|
}
|
|
@@ -509,21 +900,23 @@ class Webhook {
|
|
|
509
900
|
}
|
|
510
901
|
|
|
511
902
|
/**
|
|
512
|
-
* @param {WebhookPlatformValidator.
|
|
903
|
+
* @param {WebhookPlatformValidator.RegisterSubscriberToEventV2Param} arg - Arg object
|
|
513
904
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
514
905
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
515
|
-
* @returns {Promise<WebhookPlatformModel.
|
|
516
|
-
*
|
|
517
|
-
* @
|
|
518
|
-
* @
|
|
906
|
+
* @returns {Promise<WebhookPlatformModel.SubscriberConfigResponse>} -
|
|
907
|
+
* Success response
|
|
908
|
+
* @name registerSubscriberToEventV2
|
|
909
|
+
* @summary: Register Subscriber.
|
|
910
|
+
* @description: Register Subscriber.
|
|
911
|
+
* - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/webhook/registerSubscriberToEventV2/).
|
|
519
912
|
*/
|
|
520
|
-
async
|
|
913
|
+
async registerSubscriberToEventV2(
|
|
521
914
|
{ body, requestHeaders } = { requestHeaders: {} },
|
|
522
915
|
{ responseHeaders } = { responseHeaders: false }
|
|
523
916
|
) {
|
|
524
917
|
const {
|
|
525
918
|
error,
|
|
526
|
-
} = WebhookPlatformValidator.
|
|
919
|
+
} = WebhookPlatformValidator.registerSubscriberToEventV2().validate(
|
|
527
920
|
{
|
|
528
921
|
body,
|
|
529
922
|
},
|
|
@@ -536,7 +929,7 @@ class Webhook {
|
|
|
536
929
|
// Showing warrnings if extra unknown parameters are found
|
|
537
930
|
const {
|
|
538
931
|
error: warrning,
|
|
539
|
-
} = WebhookPlatformValidator.
|
|
932
|
+
} = WebhookPlatformValidator.registerSubscriberToEventV2().validate(
|
|
540
933
|
{
|
|
541
934
|
body,
|
|
542
935
|
},
|
|
@@ -545,7 +938,7 @@ class Webhook {
|
|
|
545
938
|
if (warrning) {
|
|
546
939
|
Logger({
|
|
547
940
|
level: "WARN",
|
|
548
|
-
message: `Parameter Validation warrnings for platform > Webhook >
|
|
941
|
+
message: `Parameter Validation warrnings for platform > Webhook > registerSubscriberToEventV2 \n ${warrning}`,
|
|
549
942
|
});
|
|
550
943
|
}
|
|
551
944
|
|
|
@@ -555,8 +948,8 @@ class Webhook {
|
|
|
555
948
|
|
|
556
949
|
const response = await PlatformAPIClient.execute(
|
|
557
950
|
this.config,
|
|
558
|
-
"
|
|
559
|
-
`/service/platform/webhook/
|
|
951
|
+
"post",
|
|
952
|
+
`/service/platform/webhook/v2.0/company/${this.config.companyId}/subscriber/`,
|
|
560
953
|
query_params,
|
|
561
954
|
body,
|
|
562
955
|
{ ...xHeaders, ...requestHeaders },
|
|
@@ -570,7 +963,7 @@ class Webhook {
|
|
|
570
963
|
|
|
571
964
|
const {
|
|
572
965
|
error: res_error,
|
|
573
|
-
} = WebhookPlatformModel.
|
|
966
|
+
} = WebhookPlatformModel.SubscriberConfigResponse().validate(responseData, {
|
|
574
967
|
abortEarly: false,
|
|
575
968
|
allowUnknown: true,
|
|
576
969
|
});
|
|
@@ -581,7 +974,7 @@ class Webhook {
|
|
|
581
974
|
} else {
|
|
582
975
|
Logger({
|
|
583
976
|
level: "WARN",
|
|
584
|
-
message: `Response Validation Warnings for platform > Webhook >
|
|
977
|
+
message: `Response Validation Warnings for platform > Webhook > registerSubscriberToEventV2 \n ${res_error}`,
|
|
585
978
|
});
|
|
586
979
|
}
|
|
587
980
|
}
|
|
@@ -590,20 +983,22 @@ class Webhook {
|
|
|
590
983
|
}
|
|
591
984
|
|
|
592
985
|
/**
|
|
593
|
-
* @param {WebhookPlatformValidator.
|
|
986
|
+
* @param {WebhookPlatformValidator.UpdateSubscriberConfigParam} arg - Arg object
|
|
594
987
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
595
988
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
596
|
-
* @returns {Promise<WebhookPlatformModel.
|
|
597
|
-
*
|
|
598
|
-
* @
|
|
599
|
-
* @
|
|
600
|
-
*
|
|
989
|
+
* @returns {Promise<WebhookPlatformModel.SubscriberConfigResponse>} -
|
|
990
|
+
* Success response
|
|
991
|
+
* @name updateSubscriberConfig
|
|
992
|
+
* @summary: Update a subscriber config
|
|
993
|
+
* @description: Modify and update subscriber configuration settings. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/webhook/updateSubscriberConfig/).
|
|
601
994
|
*/
|
|
602
|
-
async
|
|
995
|
+
async updateSubscriberConfig(
|
|
603
996
|
{ body, requestHeaders } = { requestHeaders: {} },
|
|
604
997
|
{ responseHeaders } = { responseHeaders: false }
|
|
605
998
|
) {
|
|
606
|
-
const {
|
|
999
|
+
const {
|
|
1000
|
+
error,
|
|
1001
|
+
} = WebhookPlatformValidator.updateSubscriberConfig().validate(
|
|
607
1002
|
{
|
|
608
1003
|
body,
|
|
609
1004
|
},
|
|
@@ -616,7 +1011,7 @@ class Webhook {
|
|
|
616
1011
|
// Showing warrnings if extra unknown parameters are found
|
|
617
1012
|
const {
|
|
618
1013
|
error: warrning,
|
|
619
|
-
} = WebhookPlatformValidator.
|
|
1014
|
+
} = WebhookPlatformValidator.updateSubscriberConfig().validate(
|
|
620
1015
|
{
|
|
621
1016
|
body,
|
|
622
1017
|
},
|
|
@@ -625,7 +1020,7 @@ class Webhook {
|
|
|
625
1020
|
if (warrning) {
|
|
626
1021
|
Logger({
|
|
627
1022
|
level: "WARN",
|
|
628
|
-
message: `Parameter Validation warrnings for platform > Webhook >
|
|
1023
|
+
message: `Parameter Validation warrnings for platform > Webhook > updateSubscriberConfig \n ${warrning}`,
|
|
629
1024
|
});
|
|
630
1025
|
}
|
|
631
1026
|
|
|
@@ -636,7 +1031,7 @@ class Webhook {
|
|
|
636
1031
|
const response = await PlatformAPIClient.execute(
|
|
637
1032
|
this.config,
|
|
638
1033
|
"put",
|
|
639
|
-
`/service/platform/webhook/
|
|
1034
|
+
`/service/platform/webhook/v1.0/company/${this.config.companyId}/subscriber/`,
|
|
640
1035
|
query_params,
|
|
641
1036
|
body,
|
|
642
1037
|
{ ...xHeaders, ...requestHeaders },
|
|
@@ -650,7 +1045,7 @@ class Webhook {
|
|
|
650
1045
|
|
|
651
1046
|
const {
|
|
652
1047
|
error: res_error,
|
|
653
|
-
} = WebhookPlatformModel.
|
|
1048
|
+
} = WebhookPlatformModel.SubscriberConfigResponse().validate(responseData, {
|
|
654
1049
|
abortEarly: false,
|
|
655
1050
|
allowUnknown: true,
|
|
656
1051
|
});
|
|
@@ -661,7 +1056,7 @@ class Webhook {
|
|
|
661
1056
|
} else {
|
|
662
1057
|
Logger({
|
|
663
1058
|
level: "WARN",
|
|
664
|
-
message: `Response Validation Warnings for platform > Webhook >
|
|
1059
|
+
message: `Response Validation Warnings for platform > Webhook > updateSubscriberConfig \n ${res_error}`,
|
|
665
1060
|
});
|
|
666
1061
|
}
|
|
667
1062
|
}
|
|
@@ -670,21 +1065,21 @@ class Webhook {
|
|
|
670
1065
|
}
|
|
671
1066
|
|
|
672
1067
|
/**
|
|
673
|
-
* @param {WebhookPlatformValidator.
|
|
1068
|
+
* @param {WebhookPlatformValidator.UpdateSubscriberV2Param} arg - Arg object
|
|
674
1069
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
675
1070
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
676
|
-
* @returns {Promise<WebhookPlatformModel.
|
|
1071
|
+
* @returns {Promise<WebhookPlatformModel.SubscriberConfigResponse>} -
|
|
677
1072
|
* Success response
|
|
678
|
-
* @name
|
|
679
|
-
* @summary:
|
|
680
|
-
* @description:
|
|
681
|
-
* - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/webhook/
|
|
1073
|
+
* @name updateSubscriberV2
|
|
1074
|
+
* @summary: Update Subscriber.
|
|
1075
|
+
* @description: Update Subscriber.
|
|
1076
|
+
* - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/webhook/updateSubscriberV2/).
|
|
682
1077
|
*/
|
|
683
|
-
async
|
|
1078
|
+
async updateSubscriberV2(
|
|
684
1079
|
{ body, requestHeaders } = { requestHeaders: {} },
|
|
685
1080
|
{ responseHeaders } = { responseHeaders: false }
|
|
686
1081
|
) {
|
|
687
|
-
const { error } = WebhookPlatformValidator.
|
|
1082
|
+
const { error } = WebhookPlatformValidator.updateSubscriberV2().validate(
|
|
688
1083
|
{
|
|
689
1084
|
body,
|
|
690
1085
|
},
|
|
@@ -697,7 +1092,7 @@ class Webhook {
|
|
|
697
1092
|
// Showing warrnings if extra unknown parameters are found
|
|
698
1093
|
const {
|
|
699
1094
|
error: warrning,
|
|
700
|
-
} = WebhookPlatformValidator.
|
|
1095
|
+
} = WebhookPlatformValidator.updateSubscriberV2().validate(
|
|
701
1096
|
{
|
|
702
1097
|
body,
|
|
703
1098
|
},
|
|
@@ -706,7 +1101,7 @@ class Webhook {
|
|
|
706
1101
|
if (warrning) {
|
|
707
1102
|
Logger({
|
|
708
1103
|
level: "WARN",
|
|
709
|
-
message: `Parameter Validation warrnings for platform > Webhook >
|
|
1104
|
+
message: `Parameter Validation warrnings for platform > Webhook > updateSubscriberV2 \n ${warrning}`,
|
|
710
1105
|
});
|
|
711
1106
|
}
|
|
712
1107
|
|
|
@@ -717,7 +1112,7 @@ class Webhook {
|
|
|
717
1112
|
const response = await PlatformAPIClient.execute(
|
|
718
1113
|
this.config,
|
|
719
1114
|
"put",
|
|
720
|
-
`/service/platform/webhook/
|
|
1115
|
+
`/service/platform/webhook/v2.0/company/${this.config.companyId}/subscriber/`,
|
|
721
1116
|
query_params,
|
|
722
1117
|
body,
|
|
723
1118
|
{ ...xHeaders, ...requestHeaders },
|
|
@@ -731,10 +1126,10 @@ class Webhook {
|
|
|
731
1126
|
|
|
732
1127
|
const {
|
|
733
1128
|
error: res_error,
|
|
734
|
-
} = WebhookPlatformModel.
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
);
|
|
1129
|
+
} = WebhookPlatformModel.SubscriberConfigResponse().validate(responseData, {
|
|
1130
|
+
abortEarly: false,
|
|
1131
|
+
allowUnknown: true,
|
|
1132
|
+
});
|
|
738
1133
|
|
|
739
1134
|
if (res_error) {
|
|
740
1135
|
if (this.config.options.strictResponseCheck === true) {
|
|
@@ -742,7 +1137,7 @@ class Webhook {
|
|
|
742
1137
|
} else {
|
|
743
1138
|
Logger({
|
|
744
1139
|
level: "WARN",
|
|
745
|
-
message: `Response Validation Warnings for platform > Webhook >
|
|
1140
|
+
message: `Response Validation Warnings for platform > Webhook > updateSubscriberV2 \n ${res_error}`,
|
|
746
1141
|
});
|
|
747
1142
|
}
|
|
748
1143
|
}
|