@gofynd/fdk-client-javascript 1.1.6 → 1.3.0
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 +52 -3
- package/index.js +0 -3
- package/package.json +1 -2
- package/sdk/application/ApplicationAPIClient.d.ts +15 -1
- package/sdk/application/ApplicationAPIClient.js +12 -3
- package/sdk/application/ApplicationClient.d.ts +36 -6
- package/sdk/application/ApplicationClient.js +30 -43
- package/sdk/application/ApplicationConfig.d.ts +92 -12
- package/sdk/application/ApplicationConfig.js +48 -14
- package/sdk/application/Cart/CartApplicationClient.d.ts +200 -357
- package/sdk/application/Cart/CartApplicationClient.js +711 -483
- package/sdk/application/Cart/CartApplicationModel.d.ts +2054 -96
- package/sdk/application/Cart/CartApplicationModel.js +1224 -93
- package/sdk/application/Cart/CartApplicationValidator.d.ts +508 -30
- package/sdk/application/Cart/CartApplicationValidator.js +270 -15
- package/sdk/application/Catalog/CatalogApplicationClient.d.ts +274 -422
- package/sdk/application/Catalog/CatalogApplicationClient.js +865 -630
- package/sdk/application/Catalog/CatalogApplicationModel.d.ts +2320 -117
- package/sdk/application/Catalog/CatalogApplicationModel.js +1566 -172
- package/sdk/application/Catalog/CatalogApplicationValidator.d.ts +798 -31
- package/sdk/application/Catalog/CatalogApplicationValidator.js +318 -3
- package/sdk/application/Common/CommonApplicationClient.d.ts +16 -21
- package/sdk/application/Common/CommonApplicationClient.js +52 -33
- package/sdk/application/Common/CommonApplicationModel.d.ts +368 -19
- package/sdk/application/Common/CommonApplicationModel.js +192 -40
- package/sdk/application/Common/CommonApplicationValidator.d.ts +42 -4
- package/sdk/application/Common/CommonApplicationValidator.js +21 -3
- package/sdk/application/Communication/CommunicationApplicationClient.d.ts +31 -18
- package/sdk/application/Communication/CommunicationApplicationClient.js +86 -47
- package/sdk/application/Communication/CommunicationApplicationModel.d.ts +157 -14
- package/sdk/application/Communication/CommunicationApplicationModel.js +104 -23
- package/sdk/application/Communication/CommunicationApplicationValidator.d.ts +27 -4
- package/sdk/application/Communication/CommunicationApplicationValidator.js +21 -5
- package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +149 -118
- package/sdk/application/Configuration/ConfigurationApplicationClient.js +457 -260
- package/sdk/application/Configuration/ConfigurationApplicationModel.d.ts +2235 -110
- package/sdk/application/Configuration/ConfigurationApplicationModel.js +1113 -193
- package/sdk/application/Configuration/ConfigurationApplicationValidator.d.ts +160 -8
- package/sdk/application/Configuration/ConfigurationApplicationValidator.js +88 -4
- package/sdk/application/Content/ContentApplicationClient.d.ts +149 -139
- package/sdk/application/Content/ContentApplicationClient.js +489 -278
- package/sdk/application/Content/ContentApplicationModel.d.ts +1010 -105
- package/sdk/application/Content/ContentApplicationModel.js +737 -396
- package/sdk/application/Content/ContentApplicationValidator.d.ts +214 -12
- package/sdk/application/Content/ContentApplicationValidator.js +113 -3
- package/sdk/application/FileStorage/FileStorageApplicationClient.d.ts +23 -29
- package/sdk/application/FileStorage/FileStorageApplicationClient.js +74 -47
- package/sdk/application/FileStorage/FileStorageApplicationModel.d.ts +148 -20
- package/sdk/application/FileStorage/FileStorageApplicationModel.js +100 -87
- package/sdk/application/FileStorage/FileStorageApplicationValidator.d.ts +55 -5
- package/sdk/application/FileStorage/FileStorageApplicationValidator.js +33 -6
- package/sdk/application/Lead/LeadApplicationClient.d.ts +57 -53
- package/sdk/application/Lead/LeadApplicationClient.js +188 -103
- package/sdk/application/Lead/LeadApplicationModel.d.ts +686 -54
- package/sdk/application/Lead/LeadApplicationModel.js +330 -244
- package/sdk/application/Lead/LeadApplicationValidator.d.ts +91 -9
- package/sdk/application/Lead/LeadApplicationValidator.js +51 -6
- package/sdk/application/Logistic/LogisticApplicationClient.d.ts +40 -33
- package/sdk/application/Logistic/LogisticApplicationClient.js +131 -73
- package/sdk/application/Logistic/LogisticApplicationModel.d.ts +399 -28
- package/sdk/application/Logistic/LogisticApplicationModel.js +293 -24
- package/sdk/application/Logistic/LogisticApplicationValidator.d.ts +48 -6
- package/sdk/application/Logistic/LogisticApplicationValidator.js +34 -6
- package/sdk/application/Order/OrderApplicationClient.d.ts +93 -133
- package/sdk/application/Order/OrderApplicationClient.js +329 -217
- package/sdk/application/Order/OrderApplicationModel.d.ts +1101 -66
- package/sdk/application/Order/OrderApplicationModel.js +776 -57
- package/sdk/application/Order/OrderApplicationValidator.d.ts +249 -14
- package/sdk/application/Order/OrderApplicationValidator.js +114 -5
- package/sdk/application/Payment/PaymentApplicationClient.d.ts +400 -366
- package/sdk/application/Payment/PaymentApplicationClient.js +1176 -703
- package/sdk/application/Payment/PaymentApplicationModel.d.ts +3125 -99
- package/sdk/application/Payment/PaymentApplicationModel.js +1158 -62
- package/sdk/application/Payment/PaymentApplicationValidator.d.ts +494 -41
- package/sdk/application/Payment/PaymentApplicationValidator.js +297 -25
- package/sdk/application/PosCart/PosCartApplicationClient.d.ts +205 -350
- package/sdk/application/PosCart/PosCartApplicationClient.js +720 -491
- package/sdk/application/PosCart/PosCartApplicationModel.d.ts +1823 -89
- package/sdk/application/PosCart/PosCartApplicationModel.js +1117 -85
- package/sdk/application/PosCart/PosCartApplicationValidator.d.ts +480 -29
- package/sdk/application/PosCart/PosCartApplicationValidator.js +262 -15
- package/sdk/application/Rewards/RewardsApplicationClient.d.ts +58 -47
- package/sdk/application/Rewards/RewardsApplicationClient.js +187 -102
- package/sdk/application/Rewards/RewardsApplicationModel.d.ts +343 -22
- package/sdk/application/Rewards/RewardsApplicationModel.js +230 -15
- package/sdk/application/Rewards/RewardsApplicationValidator.d.ts +70 -7
- package/sdk/application/Rewards/RewardsApplicationValidator.js +45 -6
- package/sdk/application/Share/ShareApplicationClient.d.ts +52 -50
- package/sdk/application/Share/ShareApplicationClient.js +185 -97
- package/sdk/application/Share/ShareApplicationModel.d.ts +198 -15
- package/sdk/application/Share/ShareApplicationModel.js +131 -31
- package/sdk/application/Share/ShareApplicationValidator.d.ts +86 -8
- package/sdk/application/Share/ShareApplicationValidator.js +48 -4
- package/sdk/application/Theme/ThemeApplicationClient.d.ts +30 -27
- package/sdk/application/Theme/ThemeApplicationClient.js +102 -56
- package/sdk/application/Theme/ThemeApplicationModel.d.ts +1291 -48
- package/sdk/application/Theme/ThemeApplicationModel.js +895 -134
- package/sdk/application/Theme/ThemeApplicationValidator.d.ts +49 -5
- package/sdk/application/Theme/ThemeApplicationValidator.js +26 -3
- package/sdk/application/User/UserApplicationClient.d.ts +260 -305
- package/sdk/application/User/UserApplicationClient.js +910 -522
- package/sdk/application/User/UserApplicationModel.d.ts +992 -101
- package/sdk/application/User/UserApplicationModel.js +699 -248
- package/sdk/application/User/UserApplicationValidator.d.ts +457 -33
- package/sdk/application/User/UserApplicationValidator.js +265 -31
- package/sdk/common/AxiosHelper.js +7 -2
- package/sdk/common/FDKError.d.ts +3 -0
- package/sdk/common/FDKError.js +8 -0
- package/sdk/common/Paginator.d.ts +27 -12
- package/sdk/common/Paginator.js +15 -0
- package/sdk/common/RequestSigner.js +0 -1
- package/sdk/common/utils.d.ts +3 -0
- package/sdk/common/utils.js +29 -0
- package/sdk/partner/PartnerAPIClient.d.ts +16 -1
- package/sdk/partner/PartnerAPIClient.js +12 -2
- package/sdk/partner/PartnerClient.d.ts +22 -3
- package/sdk/partner/PartnerClient.js +20 -0
- package/sdk/partner/PartnerConfig.d.ts +40 -14
- package/sdk/partner/PartnerConfig.js +31 -6
- 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 +30 -25
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +104 -53
- package/sdk/platform/AuditTrail/AuditTrailPlatformModel.d.ts +190 -17
- package/sdk/platform/AuditTrail/AuditTrailPlatformModel.js +132 -15
- package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.d.ts +52 -5
- package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.js +30 -4
- package/sdk/platform/Billing/BillingPlatformClient.d.ts +133 -97
- package/sdk/platform/Billing/BillingPlatformClient.js +561 -191
- package/sdk/platform/Billing/BillingPlatformModel.d.ts +1071 -68
- package/sdk/platform/Billing/BillingPlatformModel.js +762 -151
- package/sdk/platform/Billing/BillingPlatformValidator.d.ts +175 -12
- package/sdk/platform/Billing/BillingPlatformValidator.js +118 -8
- package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +454 -635
- package/sdk/platform/Cart/CartPlatformApplicationClient.js +1646 -957
- package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +827 -57
- package/sdk/platform/Cart/CartPlatformApplicationValidator.js +492 -34
- package/sdk/platform/Cart/CartPlatformModel.d.ts +3839 -175
- package/sdk/platform/Cart/CartPlatformModel.js +2423 -217
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +528 -638
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +1600 -984
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +1081 -49
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +482 -23
- package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +652 -826
- package/sdk/platform/Catalog/CatalogPlatformClient.js +1979 -1264
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +6869 -326
- package/sdk/platform/Catalog/CatalogPlatformModel.js +4215 -351
- package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +1361 -71
- package/sdk/platform/Catalog/CatalogPlatformValidator.js +624 -30
- package/sdk/platform/Common/CommonPlatformClient.d.ts +16 -21
- package/sdk/platform/Common/CommonPlatformClient.js +50 -33
- package/sdk/platform/Common/CommonPlatformModel.d.ts +423 -19
- package/sdk/platform/Common/CommonPlatformModel.js +214 -40
- package/sdk/platform/Common/CommonPlatformValidator.d.ts +37 -4
- package/sdk/platform/Common/CommonPlatformValidator.js +20 -3
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +731 -303
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +3095 -785
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.d.ts +699 -41
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.js +463 -27
- package/sdk/platform/Communication/CommunicationPlatformClient.d.ts +19 -5
- package/sdk/platform/Communication/CommunicationPlatformClient.js +59 -19
- package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +1708 -102
- package/sdk/platform/Communication/CommunicationPlatformModel.js +1360 -235
- package/sdk/platform/Communication/CommunicationPlatformValidator.d.ts +16 -3
- package/sdk/platform/Communication/CommunicationPlatformValidator.js +11 -3
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +127 -111
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +435 -225
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +882 -43
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +666 -78
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.d.ts +184 -13
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.js +105 -10
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +327 -240
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +922 -438
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.d.ts +297 -22
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.js +191 -17
- package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +184 -178
- package/sdk/platform/Configuration/ConfigurationPlatformClient.js +555 -311
- package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +4337 -188
- package/sdk/platform/Configuration/ConfigurationPlatformModel.js +2178 -248
- package/sdk/platform/Configuration/ConfigurationPlatformValidator.d.ts +332 -19
- package/sdk/platform/Configuration/ConfigurationPlatformValidator.js +153 -10
- package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +605 -578
- package/sdk/platform/Content/ContentPlatformApplicationClient.js +1996 -987
- package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +872 -62
- package/sdk/platform/Content/ContentPlatformApplicationValidator.js +487 -35
- package/sdk/platform/Content/ContentPlatformModel.d.ts +1472 -108
- package/sdk/platform/Content/ContentPlatformModel.js +1085 -204
- package/sdk/platform/Discount/DiscountPlatformClient.d.ts +85 -82
- package/sdk/platform/Discount/DiscountPlatformClient.js +333 -175
- package/sdk/platform/Discount/DiscountPlatformModel.d.ts +281 -15
- package/sdk/platform/Discount/DiscountPlatformModel.js +189 -10
- package/sdk/platform/Discount/DiscountPlatformValidator.d.ts +185 -13
- package/sdk/platform/Discount/DiscountPlatformValidator.js +88 -8
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +109 -52
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +570 -105
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.d.ts +141 -6
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.js +118 -7
- package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +43 -63
- package/sdk/platform/FileStorage/FileStoragePlatformClient.js +153 -135
- package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +426 -20
- package/sdk/platform/FileStorage/FileStoragePlatformModel.js +379 -40
- package/sdk/platform/FileStorage/FileStoragePlatformValidator.d.ts +106 -8
- package/sdk/platform/FileStorage/FileStoragePlatformValidator.js +60 -8
- package/sdk/platform/Finance/FinancePlatformClient.d.ts +260 -129
- package/sdk/platform/Finance/FinancePlatformClient.js +1182 -194
- package/sdk/platform/Finance/FinancePlatformModel.d.ts +1267 -50
- package/sdk/platform/Finance/FinancePlatformModel.js +1252 -38
- package/sdk/platform/Finance/FinancePlatformValidator.d.ts +233 -15
- package/sdk/platform/Finance/FinancePlatformValidator.js +229 -16
- package/sdk/platform/Inventory/InventoryPlatformClient.d.ts +111 -97
- package/sdk/platform/Inventory/InventoryPlatformClient.js +330 -199
- package/sdk/platform/Inventory/InventoryPlatformModel.d.ts +1354 -61
- package/sdk/platform/Inventory/InventoryPlatformModel.js +916 -83
- package/sdk/platform/Inventory/InventoryPlatformValidator.d.ts +168 -12
- package/sdk/platform/Inventory/InventoryPlatformValidator.js +82 -6
- package/sdk/platform/Lead/LeadPlatformApplicationClient.d.ts +100 -106
- package/sdk/platform/Lead/LeadPlatformApplicationClient.js +372 -186
- package/sdk/platform/Lead/LeadPlatformApplicationValidator.d.ts +180 -14
- package/sdk/platform/Lead/LeadPlatformApplicationValidator.js +94 -9
- package/sdk/platform/Lead/LeadPlatformClient.d.ts +89 -104
- package/sdk/platform/Lead/LeadPlatformClient.js +305 -180
- package/sdk/platform/Lead/LeadPlatformModel.d.ts +1045 -54
- package/sdk/platform/Lead/LeadPlatformModel.js +504 -142
- package/sdk/platform/Lead/LeadPlatformValidator.d.ts +173 -12
- package/sdk/platform/Lead/LeadPlatformValidator.js +92 -15
- package/sdk/platform/OAuthClient.js +6 -2
- package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +20 -14
- package/sdk/platform/Order/OrderPlatformApplicationClient.js +58 -29
- package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +26 -4
- package/sdk/platform/Order/OrderPlatformApplicationValidator.js +16 -3
- package/sdk/platform/Order/OrderPlatformClient.d.ts +437 -556
- package/sdk/platform/Order/OrderPlatformClient.js +1500 -760
- package/sdk/platform/Order/OrderPlatformModel.d.ts +5225 -247
- package/sdk/platform/Order/OrderPlatformModel.js +3473 -260
- package/sdk/platform/Order/OrderPlatformValidator.d.ts +859 -37
- package/sdk/platform/Order/OrderPlatformValidator.js +435 -23
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.d.ts +16 -42
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.js +52 -155
- package/sdk/platform/Partner/PartnerPlatformApplicationValidator.d.ts +37 -6
- package/sdk/platform/Partner/PartnerPlatformApplicationValidator.js +19 -17
- package/sdk/platform/Partner/PartnerPlatformModel.d.ts +78 -45
- package/sdk/platform/Partner/PartnerPlatformModel.js +43 -369
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +418 -288
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +1509 -505
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +438 -30
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +312 -19
- package/sdk/platform/Payment/PaymentPlatformClient.d.ts +83 -73
- package/sdk/platform/Payment/PaymentPlatformClient.js +259 -154
- package/sdk/platform/Payment/PaymentPlatformModel.d.ts +3200 -93
- package/sdk/platform/Payment/PaymentPlatformModel.js +1334 -36
- package/sdk/platform/Payment/PaymentPlatformValidator.d.ts +111 -11
- package/sdk/platform/Payment/PaymentPlatformValidator.js +68 -7
- package/sdk/platform/PlatformAPIClient.d.ts +16 -1
- package/sdk/platform/PlatformAPIClient.js +9 -1
- package/sdk/platform/PlatformApplicationClient.d.ts +22 -1798
- package/sdk/platform/PlatformApplicationClient.js +17 -1899
- package/sdk/platform/PlatformClient.d.ts +31 -12581
- package/sdk/platform/PlatformClient.js +30 -15089
- package/sdk/platform/PlatformConfig.d.ts +37 -11
- package/sdk/platform/PlatformConfig.js +32 -6
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.d.ts +96 -92
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +344 -177
- package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.d.ts +149 -12
- package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.js +82 -8
- package/sdk/platform/Rewards/RewardsPlatformModel.d.ts +360 -23
- package/sdk/platform/Rewards/RewardsPlatformModel.js +238 -22
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.d.ts +159 -92
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.js +473 -208
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.d.ts +138 -13
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.js +100 -14
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +166 -178
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +518 -329
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +1408 -96
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +1034 -71
- package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.d.ts +280 -18
- package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.js +134 -11
- package/sdk/platform/Share/SharePlatformApplicationClient.d.ts +41 -66
- package/sdk/platform/Share/SharePlatformApplicationClient.js +149 -116
- package/sdk/platform/Share/SharePlatformApplicationValidator.d.ts +87 -7
- package/sdk/platform/Share/SharePlatformApplicationValidator.js +42 -5
- package/sdk/platform/Share/SharePlatformModel.d.ts +250 -16
- package/sdk/platform/Share/SharePlatformModel.js +167 -19
- package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +229 -193
- package/sdk/platform/Theme/ThemePlatformApplicationClient.js +976 -352
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.d.ts +345 -24
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.js +206 -14
- package/sdk/platform/Theme/ThemePlatformClient.d.ts +37 -0
- package/sdk/platform/Theme/ThemePlatformClient.js +235 -0
- package/sdk/platform/Theme/ThemePlatformModel.d.ts +1527 -48
- package/sdk/platform/Theme/ThemePlatformModel.js +1099 -118
- package/sdk/platform/Theme/ThemePlatformValidator.d.ts +32 -0
- package/sdk/platform/Theme/ThemePlatformValidator.js +38 -0
- package/sdk/platform/User/UserPlatformApplicationClient.d.ts +138 -152
- package/sdk/platform/User/UserPlatformApplicationClient.js +470 -244
- package/sdk/platform/User/UserPlatformApplicationValidator.d.ts +242 -18
- package/sdk/platform/User/UserPlatformApplicationValidator.js +129 -12
- package/sdk/platform/User/UserPlatformModel.d.ts +653 -101
- package/sdk/platform/User/UserPlatformModel.js +467 -424
- package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +153 -49
- package/sdk/platform/Webhook/WebhookPlatformClient.js +896 -88
- package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +632 -16
- package/sdk/platform/Webhook/WebhookPlatformModel.js +502 -54
- package/sdk/platform/Webhook/WebhookPlatformValidator.d.ts +170 -7
- package/sdk/platform/Webhook/WebhookPlatformValidator.js +157 -7
- package/sdk/public/Configuration/ConfigurationPublicClient.d.ts +16 -21
- package/sdk/public/Configuration/ConfigurationPublicClient.js +48 -33
- package/sdk/public/Configuration/ConfigurationPublicModel.d.ts +370 -19
- package/sdk/public/Configuration/ConfigurationPublicModel.js +191 -40
- package/sdk/public/Configuration/ConfigurationPublicValidator.d.ts +42 -4
- package/sdk/public/Configuration/ConfigurationPublicValidator.js +21 -3
- package/sdk/public/Inventory/InventoryPublicClient.d.ts +54 -48
- package/sdk/public/Inventory/InventoryPublicClient.js +161 -98
- package/sdk/public/Inventory/InventoryPublicModel.d.ts +392 -21
- package/sdk/public/Inventory/InventoryPublicModel.js +267 -27
- package/sdk/public/Inventory/InventoryPublicValidator.d.ts +90 -8
- package/sdk/public/Inventory/InventoryPublicValidator.js +44 -4
- 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 +21 -3
- package/sdk/public/PublicClient.js +20 -0
- package/sdk/public/PublicConfig.d.ts +27 -6
- package/sdk/public/PublicConfig.js +17 -1
- package/sdk/public/Webhook/WebhookPublicClient.d.ts +16 -11
- package/sdk/public/Webhook/WebhookPublicClient.js +48 -27
- package/sdk/public/Webhook/WebhookPublicModel.d.ts +52 -16
- package/sdk/public/Webhook/WebhookPublicModel.js +33 -113
- package/sdk/public/Webhook/WebhookPublicValidator.d.ts +18 -3
- package/sdk/public/Webhook/WebhookPublicValidator.js +14 -4
- package/sdk/public/index.d.ts +1 -0
- package/sdk/public/index.js +2 -0
- package/sdk/application/ApplicationModels.d.ts +0 -3
- package/sdk/application/ApplicationModels.js +0 -20
- package/sdk/platform/Partner/PartnerPlatformClient.d.ts +0 -145
- package/sdk/platform/Partner/PartnerPlatformClient.js +0 -799
- package/sdk/platform/Partner/PartnerPlatformValidator.d.ts +0 -14
- package/sdk/platform/Partner/PartnerPlatformValidator.js +0 -87
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
const PlatformAPIClient = require("../PlatformAPIClient");
|
|
2
2
|
const { FDKClientValidationError } = require("../../common/FDKError");
|
|
3
3
|
const Paginator = require("../../common/Paginator");
|
|
4
|
-
const
|
|
5
|
-
const
|
|
4
|
+
const WebhookPlatformValidator = require("./WebhookPlatformValidator");
|
|
5
|
+
const WebhookPlatformModel = require("./WebhookPlatformModel");
|
|
6
6
|
const { Logger } = require("./../../common/Logger");
|
|
7
7
|
const Joi = require("joi");
|
|
8
8
|
|
|
@@ -12,13 +12,471 @@ class Webhook {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
|
-
* @param {
|
|
16
|
-
* @
|
|
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
|
+
|
|
164
|
+
/**
|
|
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
|
|
17
170
|
* @summary:
|
|
18
|
-
* @description: Get All Webhook Events
|
|
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 `{}`
|
|
468
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
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/).
|
|
19
474
|
*/
|
|
20
|
-
async
|
|
21
|
-
|
|
475
|
+
async getManualRetryStatus(
|
|
476
|
+
{ requestHeaders } = { requestHeaders: {} },
|
|
477
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
478
|
+
) {
|
|
479
|
+
const { error } = WebhookPlatformValidator.getManualRetryStatus().validate(
|
|
22
480
|
{},
|
|
23
481
|
{ abortEarly: false, allowUnknown: true }
|
|
24
482
|
);
|
|
@@ -29,17 +487,15 @@ class Webhook {
|
|
|
29
487
|
// Showing warrnings if extra unknown parameters are found
|
|
30
488
|
const {
|
|
31
489
|
error: warrning,
|
|
32
|
-
} =
|
|
490
|
+
} = WebhookPlatformValidator.getManualRetryStatus().validate(
|
|
33
491
|
{},
|
|
34
492
|
{ abortEarly: false, allowUnknown: false }
|
|
35
493
|
);
|
|
36
494
|
if (warrning) {
|
|
37
495
|
Logger({
|
|
38
496
|
level: "WARN",
|
|
39
|
-
message:
|
|
40
|
-
"Parameter Validation warrnings for fetchAllEventConfigurations",
|
|
497
|
+
message: `Parameter Validation warrnings for platform > Webhook > getManualRetryStatus \n ${warrning}`,
|
|
41
498
|
});
|
|
42
|
-
Logger({ level: "WARN", message: warrning });
|
|
43
499
|
}
|
|
44
500
|
|
|
45
501
|
const query_params = {};
|
|
@@ -49,15 +505,96 @@ class Webhook {
|
|
|
49
505
|
const response = await PlatformAPIClient.execute(
|
|
50
506
|
this.config,
|
|
51
507
|
"get",
|
|
52
|
-
`/service/platform/webhook/v1.0/company/${this.config.companyId}/
|
|
508
|
+
`/service/platform/webhook/v1.0/company/${this.config.companyId}/retry/status`,
|
|
53
509
|
query_params,
|
|
54
510
|
undefined,
|
|
55
|
-
xHeaders
|
|
511
|
+
{ ...xHeaders, ...requestHeaders },
|
|
512
|
+
{ responseHeaders }
|
|
513
|
+
);
|
|
514
|
+
|
|
515
|
+
let responseData = response;
|
|
516
|
+
if (responseHeaders) {
|
|
517
|
+
responseData = response[0];
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
const {
|
|
521
|
+
error: res_error,
|
|
522
|
+
} = WebhookPlatformModel.RetryStatusResponse().validate(responseData, {
|
|
523
|
+
abortEarly: false,
|
|
524
|
+
allowUnknown: false,
|
|
525
|
+
});
|
|
526
|
+
|
|
527
|
+
if (res_error) {
|
|
528
|
+
Logger({
|
|
529
|
+
level: "WARN",
|
|
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 }
|
|
56
588
|
);
|
|
57
589
|
|
|
590
|
+
let responseData = response;
|
|
591
|
+
if (responseHeaders) {
|
|
592
|
+
responseData = response[0];
|
|
593
|
+
}
|
|
594
|
+
|
|
58
595
|
const {
|
|
59
596
|
error: res_error,
|
|
60
|
-
} =
|
|
597
|
+
} = WebhookPlatformModel.ReportFilterResponse().validate(responseData, {
|
|
61
598
|
abortEarly: false,
|
|
62
599
|
allowUnknown: false,
|
|
63
600
|
});
|
|
@@ -65,24 +602,27 @@ class Webhook {
|
|
|
65
602
|
if (res_error) {
|
|
66
603
|
Logger({
|
|
67
604
|
level: "WARN",
|
|
68
|
-
message:
|
|
69
|
-
"Response Validation Warnnings for fetchAllEventConfigurations",
|
|
605
|
+
message: `Response Validation Warnnings for platform > Webhook > getReportFilters \n ${res_error}`,
|
|
70
606
|
});
|
|
71
|
-
Logger({ level: "WARN", message: res_error });
|
|
72
607
|
}
|
|
73
608
|
|
|
74
609
|
return response;
|
|
75
610
|
}
|
|
76
611
|
|
|
77
612
|
/**
|
|
78
|
-
* @param {
|
|
79
|
-
* @param {
|
|
80
|
-
* @
|
|
613
|
+
* @param {WebhookPlatformValidator.GetSubscriberByIdParam} arg - Arg object
|
|
614
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
615
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
616
|
+
* @returns {Promise<WebhookPlatformModel.SubscriberResponse>} - Success response
|
|
617
|
+
* @name getSubscriberById
|
|
81
618
|
* @summary: Get Subscriber By Subscriber ID
|
|
82
|
-
* @description: Get Subscriber By Subscriber ID
|
|
619
|
+
* @description: Get Subscriber By Subscriber ID - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/webhook/getSubscriberById/).
|
|
83
620
|
*/
|
|
84
|
-
async getSubscriberById(
|
|
85
|
-
|
|
621
|
+
async getSubscriberById(
|
|
622
|
+
{ subscriberId, requestHeaders } = { requestHeaders: {} },
|
|
623
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
624
|
+
) {
|
|
625
|
+
const { error } = WebhookPlatformValidator.getSubscriberById().validate(
|
|
86
626
|
{
|
|
87
627
|
subscriberId,
|
|
88
628
|
},
|
|
@@ -93,7 +633,9 @@ class Webhook {
|
|
|
93
633
|
}
|
|
94
634
|
|
|
95
635
|
// Showing warrnings if extra unknown parameters are found
|
|
96
|
-
const {
|
|
636
|
+
const {
|
|
637
|
+
error: warrning,
|
|
638
|
+
} = WebhookPlatformValidator.getSubscriberById().validate(
|
|
97
639
|
{
|
|
98
640
|
subscriberId,
|
|
99
641
|
},
|
|
@@ -102,9 +644,8 @@ class Webhook {
|
|
|
102
644
|
if (warrning) {
|
|
103
645
|
Logger({
|
|
104
646
|
level: "WARN",
|
|
105
|
-
message:
|
|
647
|
+
message: `Parameter Validation warrnings for platform > Webhook > getSubscriberById \n ${warrning}`,
|
|
106
648
|
});
|
|
107
|
-
Logger({ level: "WARN", message: warrning });
|
|
108
649
|
}
|
|
109
650
|
|
|
110
651
|
const query_params = {};
|
|
@@ -117,12 +658,18 @@ class Webhook {
|
|
|
117
658
|
`/service/platform/webhook/v1.0/company/${this.config.companyId}/subscriber/${subscriberId}`,
|
|
118
659
|
query_params,
|
|
119
660
|
undefined,
|
|
120
|
-
xHeaders
|
|
661
|
+
{ ...xHeaders, ...requestHeaders },
|
|
662
|
+
{ responseHeaders }
|
|
121
663
|
);
|
|
122
664
|
|
|
665
|
+
let responseData = response;
|
|
666
|
+
if (responseHeaders) {
|
|
667
|
+
responseData = response[0];
|
|
668
|
+
}
|
|
669
|
+
|
|
123
670
|
const {
|
|
124
671
|
error: res_error,
|
|
125
|
-
} =
|
|
672
|
+
} = WebhookPlatformModel.SubscriberResponse().validate(responseData, {
|
|
126
673
|
abortEarly: false,
|
|
127
674
|
allowUnknown: false,
|
|
128
675
|
});
|
|
@@ -130,25 +677,29 @@ class Webhook {
|
|
|
130
677
|
if (res_error) {
|
|
131
678
|
Logger({
|
|
132
679
|
level: "WARN",
|
|
133
|
-
message:
|
|
680
|
+
message: `Response Validation Warnnings for platform > Webhook > getSubscriberById \n ${res_error}`,
|
|
134
681
|
});
|
|
135
|
-
Logger({ level: "WARN", message: res_error });
|
|
136
682
|
}
|
|
137
683
|
|
|
138
684
|
return response;
|
|
139
685
|
}
|
|
140
686
|
|
|
141
687
|
/**
|
|
142
|
-
* @param {
|
|
143
|
-
* @param {
|
|
144
|
-
* @param {
|
|
145
|
-
* @
|
|
146
|
-
* @
|
|
688
|
+
* @param {WebhookPlatformValidator.GetSubscribersByCompanyParam} arg - Arg object
|
|
689
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
690
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
691
|
+
* @returns {Promise<WebhookPlatformModel.SubscriberResponse>} - Success response
|
|
692
|
+
* @name getSubscribersByCompany
|
|
147
693
|
* @summary: Get Subscribers By Company ID
|
|
148
|
-
* @description: Get Subscribers By CompanyId
|
|
694
|
+
* @description: Get Subscribers By CompanyId - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/webhook/getSubscribersByCompany/).
|
|
149
695
|
*/
|
|
150
|
-
async getSubscribersByCompany(
|
|
151
|
-
|
|
696
|
+
async getSubscribersByCompany(
|
|
697
|
+
{ pageNo, pageSize, extensionId, requestHeaders } = { requestHeaders: {} },
|
|
698
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
699
|
+
) {
|
|
700
|
+
const {
|
|
701
|
+
error,
|
|
702
|
+
} = WebhookPlatformValidator.getSubscribersByCompany().validate(
|
|
152
703
|
{
|
|
153
704
|
pageNo,
|
|
154
705
|
pageSize,
|
|
@@ -163,7 +714,7 @@ class Webhook {
|
|
|
163
714
|
// Showing warrnings if extra unknown parameters are found
|
|
164
715
|
const {
|
|
165
716
|
error: warrning,
|
|
166
|
-
} =
|
|
717
|
+
} = WebhookPlatformValidator.getSubscribersByCompany().validate(
|
|
167
718
|
{
|
|
168
719
|
pageNo,
|
|
169
720
|
pageSize,
|
|
@@ -174,9 +725,8 @@ class Webhook {
|
|
|
174
725
|
if (warrning) {
|
|
175
726
|
Logger({
|
|
176
727
|
level: "WARN",
|
|
177
|
-
message:
|
|
728
|
+
message: `Parameter Validation warrnings for platform > Webhook > getSubscribersByCompany \n ${warrning}`,
|
|
178
729
|
});
|
|
179
|
-
Logger({ level: "WARN", message: warrning });
|
|
180
730
|
}
|
|
181
731
|
|
|
182
732
|
const query_params = {};
|
|
@@ -192,12 +742,18 @@ class Webhook {
|
|
|
192
742
|
`/service/platform/webhook/v1.0/company/${this.config.companyId}/subscriber`,
|
|
193
743
|
query_params,
|
|
194
744
|
undefined,
|
|
195
|
-
xHeaders
|
|
745
|
+
{ ...xHeaders, ...requestHeaders },
|
|
746
|
+
{ responseHeaders }
|
|
196
747
|
);
|
|
197
748
|
|
|
749
|
+
let responseData = response;
|
|
750
|
+
if (responseHeaders) {
|
|
751
|
+
responseData = response[0];
|
|
752
|
+
}
|
|
753
|
+
|
|
198
754
|
const {
|
|
199
755
|
error: res_error,
|
|
200
|
-
} =
|
|
756
|
+
} = WebhookPlatformModel.SubscriberResponse().validate(responseData, {
|
|
201
757
|
abortEarly: false,
|
|
202
758
|
allowUnknown: false,
|
|
203
759
|
});
|
|
@@ -205,25 +761,29 @@ class Webhook {
|
|
|
205
761
|
if (res_error) {
|
|
206
762
|
Logger({
|
|
207
763
|
level: "WARN",
|
|
208
|
-
message:
|
|
764
|
+
message: `Response Validation Warnnings for platform > Webhook > getSubscribersByCompany \n ${res_error}`,
|
|
209
765
|
});
|
|
210
|
-
Logger({ level: "WARN", message: res_error });
|
|
211
766
|
}
|
|
212
767
|
|
|
213
768
|
return response;
|
|
214
769
|
}
|
|
215
770
|
|
|
216
771
|
/**
|
|
217
|
-
* @param {
|
|
218
|
-
* @param {
|
|
219
|
-
* @param {
|
|
220
|
-
* @
|
|
221
|
-
* @
|
|
772
|
+
* @param {WebhookPlatformValidator.GetSubscribersByExtensionIdParam} arg - Arg object
|
|
773
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
774
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
775
|
+
* @returns {Promise<WebhookPlatformModel.SubscriberConfigList>} - Success response
|
|
776
|
+
* @name getSubscribersByExtensionId
|
|
222
777
|
* @summary: Get Subscribers By Extension ID
|
|
223
|
-
* @description: Get Subscribers By ExtensionID
|
|
778
|
+
* @description: Get Subscribers By ExtensionID - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/webhook/getSubscribersByExtensionId/).
|
|
224
779
|
*/
|
|
225
|
-
async getSubscribersByExtensionId(
|
|
226
|
-
|
|
780
|
+
async getSubscribersByExtensionId(
|
|
781
|
+
{ extensionId, pageNo, pageSize, requestHeaders } = { requestHeaders: {} },
|
|
782
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
783
|
+
) {
|
|
784
|
+
const {
|
|
785
|
+
error,
|
|
786
|
+
} = WebhookPlatformValidator.getSubscribersByExtensionId().validate(
|
|
227
787
|
{
|
|
228
788
|
extensionId,
|
|
229
789
|
pageNo,
|
|
@@ -238,7 +798,7 @@ class Webhook {
|
|
|
238
798
|
// Showing warrnings if extra unknown parameters are found
|
|
239
799
|
const {
|
|
240
800
|
error: warrning,
|
|
241
|
-
} =
|
|
801
|
+
} = WebhookPlatformValidator.getSubscribersByExtensionId().validate(
|
|
242
802
|
{
|
|
243
803
|
extensionId,
|
|
244
804
|
pageNo,
|
|
@@ -249,10 +809,8 @@ class Webhook {
|
|
|
249
809
|
if (warrning) {
|
|
250
810
|
Logger({
|
|
251
811
|
level: "WARN",
|
|
252
|
-
message:
|
|
253
|
-
"Parameter Validation warrnings for getSubscribersByExtensionId",
|
|
812
|
+
message: `Parameter Validation warrnings for platform > Webhook > getSubscribersByExtensionId \n ${warrning}`,
|
|
254
813
|
});
|
|
255
|
-
Logger({ level: "WARN", message: warrning });
|
|
256
814
|
}
|
|
257
815
|
|
|
258
816
|
const query_params = {};
|
|
@@ -267,12 +825,242 @@ class Webhook {
|
|
|
267
825
|
`/service/platform/webhook/v1.0/company/${this.config.companyId}/extension/${extensionId}/subscriber`,
|
|
268
826
|
query_params,
|
|
269
827
|
undefined,
|
|
270
|
-
xHeaders
|
|
828
|
+
{ ...xHeaders, ...requestHeaders },
|
|
829
|
+
{ responseHeaders }
|
|
830
|
+
);
|
|
831
|
+
|
|
832
|
+
let responseData = response;
|
|
833
|
+
if (responseHeaders) {
|
|
834
|
+
responseData = response[0];
|
|
835
|
+
}
|
|
836
|
+
|
|
837
|
+
const {
|
|
838
|
+
error: res_error,
|
|
839
|
+
} = WebhookPlatformModel.SubscriberConfigList().validate(responseData, {
|
|
840
|
+
abortEarly: false,
|
|
841
|
+
allowUnknown: false,
|
|
842
|
+
});
|
|
843
|
+
|
|
844
|
+
if (res_error) {
|
|
845
|
+
Logger({
|
|
846
|
+
level: "WARN",
|
|
847
|
+
message: `Response Validation Warnnings for platform > Webhook > getSubscribersByExtensionId \n ${res_error}`,
|
|
848
|
+
});
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
return response;
|
|
852
|
+
}
|
|
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 }
|
|
271
1054
|
);
|
|
272
1055
|
|
|
1056
|
+
let responseData = response;
|
|
1057
|
+
if (responseHeaders) {
|
|
1058
|
+
responseData = response[0];
|
|
1059
|
+
}
|
|
1060
|
+
|
|
273
1061
|
const {
|
|
274
1062
|
error: res_error,
|
|
275
|
-
} =
|
|
1063
|
+
} = WebhookPlatformModel.PingWebhookResponse().validate(responseData, {
|
|
276
1064
|
abortEarly: false,
|
|
277
1065
|
allowUnknown: false,
|
|
278
1066
|
});
|
|
@@ -280,24 +1068,29 @@ class Webhook {
|
|
|
280
1068
|
if (res_error) {
|
|
281
1069
|
Logger({
|
|
282
1070
|
level: "WARN",
|
|
283
|
-
message:
|
|
284
|
-
"Response Validation Warnnings for getSubscribersByExtensionId",
|
|
1071
|
+
message: `Response Validation Warnnings for platform > Webhook > pingWebhook \n ${res_error}`,
|
|
285
1072
|
});
|
|
286
|
-
Logger({ level: "WARN", message: res_error });
|
|
287
1073
|
}
|
|
288
1074
|
|
|
289
1075
|
return response;
|
|
290
1076
|
}
|
|
291
1077
|
|
|
292
1078
|
/**
|
|
293
|
-
* @param {
|
|
294
|
-
* @param {
|
|
295
|
-
* @
|
|
1079
|
+
* @param {WebhookPlatformValidator.RegisterSubscriberToEventParam} arg - Arg object
|
|
1080
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1081
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1082
|
+
* @returns {Promise<WebhookPlatformModel.SubscriberConfig>} - Success response
|
|
1083
|
+
* @name registerSubscriberToEvent
|
|
296
1084
|
* @summary: Register Subscriber
|
|
297
|
-
* @description: Register Subscriber
|
|
1085
|
+
* @description: Register Subscriber - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/webhook/registerSubscriberToEvent/).
|
|
298
1086
|
*/
|
|
299
|
-
async registerSubscriberToEvent(
|
|
300
|
-
|
|
1087
|
+
async registerSubscriberToEvent(
|
|
1088
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
1089
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
1090
|
+
) {
|
|
1091
|
+
const {
|
|
1092
|
+
error,
|
|
1093
|
+
} = WebhookPlatformValidator.registerSubscriberToEvent().validate(
|
|
301
1094
|
{
|
|
302
1095
|
body,
|
|
303
1096
|
},
|
|
@@ -310,7 +1103,7 @@ class Webhook {
|
|
|
310
1103
|
// Showing warrnings if extra unknown parameters are found
|
|
311
1104
|
const {
|
|
312
1105
|
error: warrning,
|
|
313
|
-
} =
|
|
1106
|
+
} = WebhookPlatformValidator.registerSubscriberToEvent().validate(
|
|
314
1107
|
{
|
|
315
1108
|
body,
|
|
316
1109
|
},
|
|
@@ -319,9 +1112,8 @@ class Webhook {
|
|
|
319
1112
|
if (warrning) {
|
|
320
1113
|
Logger({
|
|
321
1114
|
level: "WARN",
|
|
322
|
-
message:
|
|
1115
|
+
message: `Parameter Validation warrnings for platform > Webhook > registerSubscriberToEvent \n ${warrning}`,
|
|
323
1116
|
});
|
|
324
|
-
Logger({ level: "WARN", message: warrning });
|
|
325
1117
|
}
|
|
326
1118
|
|
|
327
1119
|
const query_params = {};
|
|
@@ -334,12 +1126,18 @@ class Webhook {
|
|
|
334
1126
|
`/service/platform/webhook/v1.0/company/${this.config.companyId}/subscriber`,
|
|
335
1127
|
query_params,
|
|
336
1128
|
body,
|
|
337
|
-
xHeaders
|
|
1129
|
+
{ ...xHeaders, ...requestHeaders },
|
|
1130
|
+
{ responseHeaders }
|
|
338
1131
|
);
|
|
339
1132
|
|
|
1133
|
+
let responseData = response;
|
|
1134
|
+
if (responseHeaders) {
|
|
1135
|
+
responseData = response[0];
|
|
1136
|
+
}
|
|
1137
|
+
|
|
340
1138
|
const {
|
|
341
1139
|
error: res_error,
|
|
342
|
-
} =
|
|
1140
|
+
} = WebhookPlatformModel.SubscriberConfig().validate(responseData, {
|
|
343
1141
|
abortEarly: false,
|
|
344
1142
|
allowUnknown: false,
|
|
345
1143
|
});
|
|
@@ -347,23 +1145,29 @@ class Webhook {
|
|
|
347
1145
|
if (res_error) {
|
|
348
1146
|
Logger({
|
|
349
1147
|
level: "WARN",
|
|
350
|
-
message:
|
|
1148
|
+
message: `Response Validation Warnnings for platform > Webhook > registerSubscriberToEvent \n ${res_error}`,
|
|
351
1149
|
});
|
|
352
|
-
Logger({ level: "WARN", message: res_error });
|
|
353
1150
|
}
|
|
354
1151
|
|
|
355
1152
|
return response;
|
|
356
1153
|
}
|
|
357
1154
|
|
|
358
1155
|
/**
|
|
359
|
-
* @param {
|
|
360
|
-
* @param {
|
|
361
|
-
* @
|
|
1156
|
+
* @param {WebhookPlatformValidator.UpdateSubscriberConfigParam} arg - Arg object
|
|
1157
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1158
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1159
|
+
* @returns {Promise<WebhookPlatformModel.SubscriberConfig>} - Success response
|
|
1160
|
+
* @name updateSubscriberConfig
|
|
362
1161
|
* @summary: Update Subscriber
|
|
363
|
-
* @description: Update Subscriber
|
|
1162
|
+
* @description: Update Subscriber - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/webhook/updateSubscriberConfig/).
|
|
364
1163
|
*/
|
|
365
|
-
async updateSubscriberConfig(
|
|
366
|
-
|
|
1164
|
+
async updateSubscriberConfig(
|
|
1165
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
1166
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
1167
|
+
) {
|
|
1168
|
+
const {
|
|
1169
|
+
error,
|
|
1170
|
+
} = WebhookPlatformValidator.updateSubscriberConfig().validate(
|
|
367
1171
|
{
|
|
368
1172
|
body,
|
|
369
1173
|
},
|
|
@@ -376,7 +1180,7 @@ class Webhook {
|
|
|
376
1180
|
// Showing warrnings if extra unknown parameters are found
|
|
377
1181
|
const {
|
|
378
1182
|
error: warrning,
|
|
379
|
-
} =
|
|
1183
|
+
} = WebhookPlatformValidator.updateSubscriberConfig().validate(
|
|
380
1184
|
{
|
|
381
1185
|
body,
|
|
382
1186
|
},
|
|
@@ -385,9 +1189,8 @@ class Webhook {
|
|
|
385
1189
|
if (warrning) {
|
|
386
1190
|
Logger({
|
|
387
1191
|
level: "WARN",
|
|
388
|
-
message:
|
|
1192
|
+
message: `Parameter Validation warrnings for platform > Webhook > updateSubscriberConfig \n ${warrning}`,
|
|
389
1193
|
});
|
|
390
|
-
Logger({ level: "WARN", message: warrning });
|
|
391
1194
|
}
|
|
392
1195
|
|
|
393
1196
|
const query_params = {};
|
|
@@ -400,12 +1203,18 @@ class Webhook {
|
|
|
400
1203
|
`/service/platform/webhook/v1.0/company/${this.config.companyId}/subscriber`,
|
|
401
1204
|
query_params,
|
|
402
1205
|
body,
|
|
403
|
-
xHeaders
|
|
1206
|
+
{ ...xHeaders, ...requestHeaders },
|
|
1207
|
+
{ responseHeaders }
|
|
404
1208
|
);
|
|
405
1209
|
|
|
1210
|
+
let responseData = response;
|
|
1211
|
+
if (responseHeaders) {
|
|
1212
|
+
responseData = response[0];
|
|
1213
|
+
}
|
|
1214
|
+
|
|
406
1215
|
const {
|
|
407
1216
|
error: res_error,
|
|
408
|
-
} =
|
|
1217
|
+
} = WebhookPlatformModel.SubscriberConfig().validate(responseData, {
|
|
409
1218
|
abortEarly: false,
|
|
410
1219
|
allowUnknown: false,
|
|
411
1220
|
});
|
|
@@ -413,9 +1222,8 @@ class Webhook {
|
|
|
413
1222
|
if (res_error) {
|
|
414
1223
|
Logger({
|
|
415
1224
|
level: "WARN",
|
|
416
|
-
message:
|
|
1225
|
+
message: `Response Validation Warnnings for platform > Webhook > updateSubscriberConfig \n ${res_error}`,
|
|
417
1226
|
});
|
|
418
|
-
Logger({ level: "WARN", message: res_error });
|
|
419
1227
|
}
|
|
420
1228
|
|
|
421
1229
|
return response;
|