@gofynd/fdk-client-javascript 1.1.6 → 1.2.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 +12 -0
- package/index.js +0 -3
- package/package.json +1 -1
- package/sdk/application/ApplicationAPIClient.d.ts +15 -1
- package/sdk/application/ApplicationAPIClient.js +8 -1
- package/sdk/application/ApplicationClient.d.ts +37 -6
- package/sdk/application/ApplicationClient.js +31 -0
- package/sdk/application/ApplicationConfig.d.ts +52 -12
- package/sdk/application/ApplicationConfig.js +37 -2
- package/sdk/application/ApplicationModels.d.ts +46 -1
- package/sdk/application/ApplicationModels.js +18 -0
- package/sdk/application/Cart/CartApplicationClient.d.ts +172 -357
- package/sdk/application/Cart/CartApplicationClient.js +620 -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 +234 -413
- package/sdk/application/Catalog/CatalogApplicationClient.js +777 -630
- package/sdk/application/Catalog/CatalogApplicationModel.d.ts +2218 -117
- package/sdk/application/Catalog/CatalogApplicationModel.js +1499 -170
- package/sdk/application/Catalog/CatalogApplicationValidator.d.ts +798 -31
- package/sdk/application/Catalog/CatalogApplicationValidator.js +318 -3
- package/sdk/application/Common/CommonApplicationClient.d.ts +14 -21
- package/sdk/application/Common/CommonApplicationClient.js +50 -33
- package/sdk/application/Common/CommonApplicationModel.d.ts +448 -19
- package/sdk/application/Common/CommonApplicationModel.js +224 -16
- package/sdk/application/Common/CommonApplicationValidator.d.ts +42 -4
- package/sdk/application/Common/CommonApplicationValidator.js +21 -3
- package/sdk/application/Communication/CommunicationApplicationClient.d.ts +25 -18
- package/sdk/application/Communication/CommunicationApplicationClient.js +74 -47
- package/sdk/application/Communication/CommunicationApplicationModel.d.ts +190 -14
- package/sdk/application/Communication/CommunicationApplicationModel.js +124 -7
- package/sdk/application/Communication/CommunicationApplicationValidator.d.ts +27 -4
- package/sdk/application/Communication/CommunicationApplicationValidator.js +21 -5
- package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +113 -112
- package/sdk/application/Configuration/ConfigurationApplicationClient.js +381 -260
- package/sdk/application/Configuration/ConfigurationApplicationModel.d.ts +2453 -110
- package/sdk/application/Configuration/ConfigurationApplicationModel.js +1254 -108
- package/sdk/application/Configuration/ConfigurationApplicationValidator.d.ts +160 -8
- package/sdk/application/Configuration/ConfigurationApplicationValidator.js +88 -4
- package/sdk/application/Content/ContentApplicationClient.d.ts +120 -138
- package/sdk/application/Content/ContentApplicationClient.js +409 -277
- package/sdk/application/Content/ContentApplicationModel.d.ts +1627 -105
- package/sdk/application/Content/ContentApplicationModel.js +1202 -109
- package/sdk/application/Content/ContentApplicationValidator.d.ts +214 -12
- package/sdk/application/Content/ContentApplicationValidator.js +113 -3
- package/sdk/application/FileStorage/FileStorageApplicationClient.d.ts +20 -29
- package/sdk/application/FileStorage/FileStorageApplicationClient.js +68 -47
- package/sdk/application/FileStorage/FileStorageApplicationModel.d.ts +299 -20
- package/sdk/application/FileStorage/FileStorageApplicationModel.js +209 -16
- package/sdk/application/FileStorage/FileStorageApplicationValidator.d.ts +55 -5
- package/sdk/application/FileStorage/FileStorageApplicationValidator.js +33 -6
- package/sdk/application/Lead/LeadApplicationClient.d.ts +50 -53
- package/sdk/application/Lead/LeadApplicationClient.js +169 -103
- package/sdk/application/Lead/LeadApplicationModel.d.ts +1405 -54
- package/sdk/application/Lead/LeadApplicationModel.js +619 -73
- package/sdk/application/Lead/LeadApplicationValidator.d.ts +91 -9
- package/sdk/application/Lead/LeadApplicationValidator.js +51 -6
- package/sdk/application/Logistic/LogisticApplicationClient.d.ts +34 -33
- package/sdk/application/Logistic/LogisticApplicationClient.js +110 -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 +81 -133
- package/sdk/application/Order/OrderApplicationClient.js +297 -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 +341 -356
- package/sdk/application/Payment/PaymentApplicationClient.js +1077 -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 +178 -350
- package/sdk/application/PosCart/PosCartApplicationClient.js +636 -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 +49 -47
- package/sdk/application/Rewards/RewardsApplicationClient.js +160 -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 +44 -50
- package/sdk/application/Share/ShareApplicationClient.js +165 -97
- package/sdk/application/Share/ShareApplicationModel.d.ts +230 -15
- package/sdk/application/Share/ShareApplicationModel.js +154 -16
- package/sdk/application/Share/ShareApplicationValidator.d.ts +86 -8
- package/sdk/application/Share/ShareApplicationValidator.js +48 -4
- package/sdk/application/Theme/ThemeApplicationClient.d.ts +25 -27
- package/sdk/application/Theme/ThemeApplicationClient.js +83 -54
- package/sdk/application/Theme/ThemeApplicationModel.d.ts +621 -48
- package/sdk/application/Theme/ThemeApplicationModel.js +464 -40
- package/sdk/application/Theme/ThemeApplicationValidator.d.ts +49 -5
- package/sdk/application/Theme/ThemeApplicationValidator.js +26 -3
- package/sdk/application/User/UserApplicationClient.d.ts +219 -303
- package/sdk/application/User/UserApplicationClient.js +819 -522
- package/sdk/application/User/UserApplicationModel.d.ts +1390 -101
- package/sdk/application/User/UserApplicationModel.js +983 -44
- package/sdk/application/User/UserApplicationValidator.d.ts +457 -33
- package/sdk/application/User/UserApplicationValidator.js +265 -31
- package/sdk/common/AxiosHelper.js +8 -2
- package/sdk/common/Paginator.d.ts +27 -12
- package/sdk/common/Paginator.js +15 -0
- package/sdk/common/RequestSigner.js +0 -1
- package/sdk/partner/PartnerAPIClient.d.ts +15 -1
- package/sdk/partner/PartnerAPIClient.js +8 -1
- package/sdk/partner/PartnerClient.d.ts +20 -3
- package/sdk/partner/PartnerClient.js +17 -0
- package/sdk/partner/PartnerConfig.d.ts +40 -14
- package/sdk/partner/PartnerConfig.js +31 -6
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.d.ts +26 -25
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +82 -53
- package/sdk/platform/AuditTrail/AuditTrailPlatformModel.d.ts +202 -17
- package/sdk/platform/AuditTrail/AuditTrailPlatformModel.js +139 -10
- package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.d.ts +42 -5
- package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.js +26 -4
- package/sdk/platform/Billing/BillingPlatformClient.d.ts +88 -97
- package/sdk/platform/Billing/BillingPlatformClient.js +310 -191
- package/sdk/platform/Billing/BillingPlatformModel.d.ts +1211 -68
- package/sdk/platform/Billing/BillingPlatformModel.js +824 -59
- package/sdk/platform/Billing/BillingPlatformValidator.d.ts +153 -12
- package/sdk/platform/Billing/BillingPlatformValidator.js +87 -8
- package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +392 -634
- package/sdk/platform/Cart/CartPlatformApplicationClient.js +1480 -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 +3639 -175
- package/sdk/platform/Cart/CartPlatformModel.js +2368 -212
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +438 -615
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +1449 -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 +573 -824
- package/sdk/platform/Catalog/CatalogPlatformClient.js +1773 -1264
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +6871 -326
- package/sdk/platform/Catalog/CatalogPlatformModel.js +4215 -349
- package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +1331 -71
- package/sdk/platform/Catalog/CatalogPlatformValidator.js +611 -30
- package/sdk/platform/Common/CommonPlatformClient.d.ts +14 -21
- package/sdk/platform/Common/CommonPlatformClient.js +48 -33
- package/sdk/platform/Common/CommonPlatformModel.d.ts +448 -19
- package/sdk/platform/Common/CommonPlatformModel.js +224 -16
- package/sdk/platform/Common/CommonPlatformValidator.d.ts +42 -4
- package/sdk/platform/Common/CommonPlatformValidator.js +21 -3
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +457 -279
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +1423 -553
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.d.ts +581 -42
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.js +294 -22
- package/sdk/platform/Communication/CommunicationPlatformClient.d.ts +18 -5
- package/sdk/platform/Communication/CommunicationPlatformClient.js +58 -19
- package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +1630 -102
- package/sdk/platform/Communication/CommunicationPlatformModel.js +1150 -85
- package/sdk/platform/Communication/CommunicationPlatformValidator.d.ts +16 -3
- package/sdk/platform/Communication/CommunicationPlatformValidator.js +11 -3
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +102 -111
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +321 -225
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +830 -43
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +612 -78
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.d.ts +180 -13
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.js +98 -10
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +232 -212
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +737 -438
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.d.ts +293 -22
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.js +184 -17
- package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +166 -178
- package/sdk/platform/Configuration/ConfigurationPlatformClient.js +519 -310
- package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +4504 -188
- package/sdk/platform/Configuration/ConfigurationPlatformModel.js +2242 -204
- package/sdk/platform/Configuration/ConfigurationPlatformValidator.d.ts +332 -19
- package/sdk/platform/Configuration/ConfigurationPlatformValidator.js +153 -10
- package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +495 -560
- package/sdk/platform/Content/ContentPlatformApplicationClient.js +1777 -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 +1661 -108
- package/sdk/platform/Content/ContentPlatformModel.js +1217 -113
- package/sdk/platform/Discount/DiscountPlatformClient.d.ts +67 -101
- package/sdk/platform/Discount/DiscountPlatformClient.js +240 -176
- package/sdk/platform/Discount/DiscountPlatformModel.d.ts +242 -15
- package/sdk/platform/Discount/DiscountPlatformModel.js +162 -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 +32 -41
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +106 -74
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.d.ts +77 -6
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.js +41 -6
- package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +39 -54
- package/sdk/platform/FileStorage/FileStoragePlatformClient.js +124 -99
- package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +299 -20
- package/sdk/platform/FileStorage/FileStoragePlatformModel.js +207 -16
- package/sdk/platform/FileStorage/FileStoragePlatformValidator.d.ts +98 -8
- package/sdk/platform/FileStorage/FileStoragePlatformValidator.js +54 -7
- package/sdk/platform/Finance/FinancePlatformClient.d.ts +85 -91
- package/sdk/platform/Finance/FinancePlatformClient.js +272 -180
- package/sdk/platform/Finance/FinancePlatformModel.d.ts +619 -50
- package/sdk/platform/Finance/FinancePlatformModel.js +458 -30
- package/sdk/platform/Finance/FinancePlatformValidator.d.ts +123 -15
- package/sdk/platform/Finance/FinancePlatformValidator.js +95 -16
- package/sdk/platform/Inventory/InventoryPlatformClient.d.ts +99 -97
- package/sdk/platform/Inventory/InventoryPlatformClient.js +288 -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 +86 -106
- package/sdk/platform/Lead/LeadPlatformApplicationClient.js +326 -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 +75 -101
- package/sdk/platform/Lead/LeadPlatformClient.js +240 -174
- package/sdk/platform/Lead/LeadPlatformModel.d.ts +1403 -54
- package/sdk/platform/Lead/LeadPlatformModel.js +618 -73
- package/sdk/platform/Lead/LeadPlatformValidator.d.ts +173 -12
- package/sdk/platform/Lead/LeadPlatformValidator.js +85 -8
- package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +18 -14
- package/sdk/platform/Order/OrderPlatformApplicationClient.js +56 -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 +343 -556
- package/sdk/platform/Order/OrderPlatformClient.js +969 -762
- package/sdk/platform/Order/OrderPlatformModel.d.ts +4967 -247
- package/sdk/platform/Order/OrderPlatformModel.js +3249 -259
- package/sdk/platform/Order/OrderPlatformValidator.d.ts +758 -37
- package/sdk/platform/Order/OrderPlatformValidator.js +351 -22
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.d.ts +28 -36
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.js +103 -59
- package/sdk/platform/Partner/PartnerPlatformApplicationValidator.d.ts +66 -6
- package/sdk/platform/Partner/PartnerPlatformApplicationValidator.js +32 -4
- package/sdk/platform/Partner/PartnerPlatformClient.d.ts +68 -107
- package/sdk/platform/Partner/PartnerPlatformClient.js +253 -174
- package/sdk/platform/Partner/PartnerPlatformModel.d.ts +767 -45
- package/sdk/platform/Partner/PartnerPlatformModel.js +524 -41
- package/sdk/platform/Partner/PartnerPlatformValidator.d.ts +207 -13
- package/sdk/platform/Partner/PartnerPlatformValidator.js +87 -5
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +255 -260
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +860 -504
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +348 -30
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +221 -19
- package/sdk/platform/Payment/PaymentPlatformClient.d.ts +73 -73
- package/sdk/platform/Payment/PaymentPlatformClient.js +238 -154
- package/sdk/platform/Payment/PaymentPlatformModel.d.ts +2658 -93
- package/sdk/platform/Payment/PaymentPlatformModel.js +1035 -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 +29 -12579
- package/sdk/platform/PlatformClient.js +26 -15085
- package/sdk/platform/PlatformConfig.d.ts +37 -11
- package/sdk/platform/PlatformConfig.js +32 -6
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.d.ts +80 -92
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +307 -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 +371 -23
- package/sdk/platform/Rewards/RewardsPlatformModel.js +246 -16
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.d.ts +120 -89
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.js +349 -201
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.d.ts +128 -12
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.js +85 -11
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +148 -178
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +454 -329
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +1399 -96
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +1022 -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 +38 -47
- package/sdk/platform/Share/SharePlatformApplicationClient.js +137 -73
- 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 +165 -17
- package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +149 -183
- package/sdk/platform/Theme/ThemePlatformApplicationClient.js +579 -330
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.d.ts +308 -24
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.js +162 -10
- package/sdk/platform/Theme/ThemePlatformModel.d.ts +621 -48
- package/sdk/platform/Theme/ThemePlatformModel.js +464 -40
- package/sdk/platform/User/UserPlatformApplicationClient.d.ts +119 -151
- package/sdk/platform/User/UserPlatformApplicationClient.js +411 -244
- package/sdk/platform/User/UserPlatformApplicationValidator.d.ts +235 -18
- package/sdk/platform/User/UserPlatformApplicationValidator.js +126 -12
- package/sdk/platform/User/UserPlatformModel.d.ts +1390 -101
- package/sdk/platform/User/UserPlatformModel.js +983 -44
- package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +38 -47
- package/sdk/platform/Webhook/WebhookPlatformClient.js +137 -87
- package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +242 -16
- package/sdk/platform/Webhook/WebhookPlatformModel.js +167 -18
- package/sdk/platform/Webhook/WebhookPlatformValidator.d.ts +83 -7
- package/sdk/platform/Webhook/WebhookPlatformValidator.js +43 -5
- package/sdk/public/Configuration/ConfigurationPublicClient.d.ts +14 -21
- package/sdk/public/Configuration/ConfigurationPublicClient.js +46 -33
- package/sdk/public/Configuration/ConfigurationPublicModel.d.ts +473 -19
- package/sdk/public/Configuration/ConfigurationPublicModel.js +224 -16
- package/sdk/public/Configuration/ConfigurationPublicValidator.d.ts +42 -4
- package/sdk/public/Configuration/ConfigurationPublicValidator.js +21 -3
- package/sdk/public/Inventory/InventoryPublicClient.d.ts +48 -48
- package/sdk/public/Inventory/InventoryPublicClient.js +146 -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/PublicClient.d.ts +19 -3
- package/sdk/public/PublicClient.js +16 -0
- package/sdk/public/PublicConfig.d.ts +27 -6
- package/sdk/public/PublicConfig.js +17 -1
- package/sdk/public/Webhook/WebhookPublicClient.d.ts +13 -11
- package/sdk/public/Webhook/WebhookPublicClient.js +42 -27
- package/sdk/public/Webhook/WebhookPublicModel.d.ts +242 -16
- package/sdk/public/Webhook/WebhookPublicModel.js +167 -18
- package/sdk/public/Webhook/WebhookPublicValidator.d.ts +18 -3
- package/sdk/public/Webhook/WebhookPublicValidator.js +14 -4
|
@@ -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 CommunicationPlatformApplicationValidator = require("./CommunicationPlatformApplicationValidator");
|
|
5
|
+
const CommunicationPlatformModel = require("./CommunicationPlatformModel");
|
|
6
6
|
const { Logger } = require("./../../common/Logger");
|
|
7
7
|
const Joi = require("joi");
|
|
8
8
|
|
|
@@ -13,14 +13,19 @@ class Communication {
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
|
-
* @param {
|
|
17
|
-
*
|
|
18
|
-
*
|
|
16
|
+
* @param {CommunicationPlatformApplicationValidator.CreateAudienceParam} arg
|
|
17
|
+
* - Arg object
|
|
18
|
+
*
|
|
19
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
20
|
+
* @returns {Promise<CommunicationPlatformModel.Audience>} - Success response
|
|
21
|
+
* @name createAudience
|
|
19
22
|
* @summary: Create audience
|
|
20
|
-
* @description: Create audience
|
|
23
|
+
* @description: Create audience - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/communication/createAudience/).
|
|
21
24
|
*/
|
|
22
|
-
async createAudience({ body } = {}) {
|
|
23
|
-
const {
|
|
25
|
+
async createAudience({ body } = {}, { headers } = { headers: false }) {
|
|
26
|
+
const {
|
|
27
|
+
error,
|
|
28
|
+
} = CommunicationPlatformApplicationValidator.createAudience().validate(
|
|
24
29
|
{
|
|
25
30
|
body,
|
|
26
31
|
},
|
|
@@ -33,7 +38,7 @@ class Communication {
|
|
|
33
38
|
// Showing warrnings if extra unknown parameters are found
|
|
34
39
|
const {
|
|
35
40
|
error: warrning,
|
|
36
|
-
} =
|
|
41
|
+
} = CommunicationPlatformApplicationValidator.createAudience().validate(
|
|
37
42
|
{
|
|
38
43
|
body,
|
|
39
44
|
},
|
|
@@ -42,9 +47,8 @@ class Communication {
|
|
|
42
47
|
if (warrning) {
|
|
43
48
|
Logger({
|
|
44
49
|
level: "WARN",
|
|
45
|
-
message:
|
|
50
|
+
message: `Parameter Validation warrnings for platform > Communication > createAudience \n ${warrning}`,
|
|
46
51
|
});
|
|
47
|
-
Logger({ level: "WARN", message: warrning });
|
|
48
52
|
}
|
|
49
53
|
|
|
50
54
|
const query_params = {};
|
|
@@ -54,12 +58,19 @@ class Communication {
|
|
|
54
58
|
"post",
|
|
55
59
|
`/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/sources/datasources`,
|
|
56
60
|
query_params,
|
|
57
|
-
body
|
|
61
|
+
body,
|
|
62
|
+
undefined,
|
|
63
|
+
{ headers }
|
|
58
64
|
);
|
|
59
65
|
|
|
66
|
+
let responseData = response;
|
|
67
|
+
if (headers) {
|
|
68
|
+
responseData = response[0];
|
|
69
|
+
}
|
|
70
|
+
|
|
60
71
|
const {
|
|
61
72
|
error: res_error,
|
|
62
|
-
} =
|
|
73
|
+
} = CommunicationPlatformModel.Audience().validate(responseData, {
|
|
63
74
|
abortEarly: false,
|
|
64
75
|
allowUnknown: false,
|
|
65
76
|
});
|
|
@@ -67,23 +78,27 @@ class Communication {
|
|
|
67
78
|
if (res_error) {
|
|
68
79
|
Logger({
|
|
69
80
|
level: "WARN",
|
|
70
|
-
message:
|
|
81
|
+
message: `Response Validation Warnnings for platform > Communication > createAudience \n ${res_error}`,
|
|
71
82
|
});
|
|
72
|
-
Logger({ level: "WARN", message: res_error });
|
|
73
83
|
}
|
|
74
84
|
|
|
75
85
|
return response;
|
|
76
86
|
}
|
|
77
87
|
|
|
78
88
|
/**
|
|
79
|
-
* @param {
|
|
80
|
-
*
|
|
81
|
-
*
|
|
89
|
+
* @param {CommunicationPlatformApplicationValidator.CreateCampaignParam} arg
|
|
90
|
+
* - Arg object
|
|
91
|
+
*
|
|
92
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
93
|
+
* @returns {Promise<CommunicationPlatformModel.Campaign>} - Success response
|
|
94
|
+
* @name createCampaign
|
|
82
95
|
* @summary: Create campaign
|
|
83
|
-
* @description: Create campaign
|
|
96
|
+
* @description: Create campaign - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/communication/createCampaign/).
|
|
84
97
|
*/
|
|
85
|
-
async createCampaign({ body } = {}) {
|
|
86
|
-
const {
|
|
98
|
+
async createCampaign({ body } = {}, { headers } = { headers: false }) {
|
|
99
|
+
const {
|
|
100
|
+
error,
|
|
101
|
+
} = CommunicationPlatformApplicationValidator.createCampaign().validate(
|
|
87
102
|
{
|
|
88
103
|
body,
|
|
89
104
|
},
|
|
@@ -96,7 +111,7 @@ class Communication {
|
|
|
96
111
|
// Showing warrnings if extra unknown parameters are found
|
|
97
112
|
const {
|
|
98
113
|
error: warrning,
|
|
99
|
-
} =
|
|
114
|
+
} = CommunicationPlatformApplicationValidator.createCampaign().validate(
|
|
100
115
|
{
|
|
101
116
|
body,
|
|
102
117
|
},
|
|
@@ -105,9 +120,8 @@ class Communication {
|
|
|
105
120
|
if (warrning) {
|
|
106
121
|
Logger({
|
|
107
122
|
level: "WARN",
|
|
108
|
-
message:
|
|
123
|
+
message: `Parameter Validation warrnings for platform > Communication > createCampaign \n ${warrning}`,
|
|
109
124
|
});
|
|
110
|
-
Logger({ level: "WARN", message: warrning });
|
|
111
125
|
}
|
|
112
126
|
|
|
113
127
|
const query_params = {};
|
|
@@ -117,12 +131,19 @@ class Communication {
|
|
|
117
131
|
"post",
|
|
118
132
|
`/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/campaigns/campaigns`,
|
|
119
133
|
query_params,
|
|
120
|
-
body
|
|
134
|
+
body,
|
|
135
|
+
undefined,
|
|
136
|
+
{ headers }
|
|
121
137
|
);
|
|
122
138
|
|
|
139
|
+
let responseData = response;
|
|
140
|
+
if (headers) {
|
|
141
|
+
responseData = response[0];
|
|
142
|
+
}
|
|
143
|
+
|
|
123
144
|
const {
|
|
124
145
|
error: res_error,
|
|
125
|
-
} =
|
|
146
|
+
} = CommunicationPlatformModel.Campaign().validate(responseData, {
|
|
126
147
|
abortEarly: false,
|
|
127
148
|
allowUnknown: false,
|
|
128
149
|
});
|
|
@@ -130,23 +151,27 @@ class Communication {
|
|
|
130
151
|
if (res_error) {
|
|
131
152
|
Logger({
|
|
132
153
|
level: "WARN",
|
|
133
|
-
message:
|
|
154
|
+
message: `Response Validation Warnnings for platform > Communication > createCampaign \n ${res_error}`,
|
|
134
155
|
});
|
|
135
|
-
Logger({ level: "WARN", message: res_error });
|
|
136
156
|
}
|
|
137
157
|
|
|
138
158
|
return response;
|
|
139
159
|
}
|
|
140
160
|
|
|
141
161
|
/**
|
|
142
|
-
* @param {
|
|
143
|
-
*
|
|
144
|
-
*
|
|
162
|
+
* @param {CommunicationPlatformApplicationValidator.CreateEmailProviderParam} arg
|
|
163
|
+
* - Arg object
|
|
164
|
+
*
|
|
165
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
166
|
+
* @returns {Promise<CommunicationPlatformModel.EmailProvider>} - Success response
|
|
167
|
+
* @name createEmailProvider
|
|
145
168
|
* @summary: Create email provider
|
|
146
|
-
* @description: Create email provider
|
|
169
|
+
* @description: Create email provider - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/communication/createEmailProvider/).
|
|
147
170
|
*/
|
|
148
|
-
async createEmailProvider({ body } = {}) {
|
|
149
|
-
const {
|
|
171
|
+
async createEmailProvider({ body } = {}, { headers } = { headers: false }) {
|
|
172
|
+
const {
|
|
173
|
+
error,
|
|
174
|
+
} = CommunicationPlatformApplicationValidator.createEmailProvider().validate(
|
|
150
175
|
{
|
|
151
176
|
body,
|
|
152
177
|
},
|
|
@@ -159,7 +184,7 @@ class Communication {
|
|
|
159
184
|
// Showing warrnings if extra unknown parameters are found
|
|
160
185
|
const {
|
|
161
186
|
error: warrning,
|
|
162
|
-
} =
|
|
187
|
+
} = CommunicationPlatformApplicationValidator.createEmailProvider().validate(
|
|
163
188
|
{
|
|
164
189
|
body,
|
|
165
190
|
},
|
|
@@ -168,9 +193,8 @@ class Communication {
|
|
|
168
193
|
if (warrning) {
|
|
169
194
|
Logger({
|
|
170
195
|
level: "WARN",
|
|
171
|
-
message:
|
|
196
|
+
message: `Parameter Validation warrnings for platform > Communication > createEmailProvider \n ${warrning}`,
|
|
172
197
|
});
|
|
173
|
-
Logger({ level: "WARN", message: warrning });
|
|
174
198
|
}
|
|
175
199
|
|
|
176
200
|
const query_params = {};
|
|
@@ -180,12 +204,19 @@ class Communication {
|
|
|
180
204
|
"post",
|
|
181
205
|
`/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/email/providers`,
|
|
182
206
|
query_params,
|
|
183
|
-
body
|
|
207
|
+
body,
|
|
208
|
+
undefined,
|
|
209
|
+
{ headers }
|
|
184
210
|
);
|
|
185
211
|
|
|
212
|
+
let responseData = response;
|
|
213
|
+
if (headers) {
|
|
214
|
+
responseData = response[0];
|
|
215
|
+
}
|
|
216
|
+
|
|
186
217
|
const {
|
|
187
218
|
error: res_error,
|
|
188
|
-
} =
|
|
219
|
+
} = CommunicationPlatformModel.EmailProvider().validate(responseData, {
|
|
189
220
|
abortEarly: false,
|
|
190
221
|
allowUnknown: false,
|
|
191
222
|
});
|
|
@@ -193,23 +224,27 @@ class Communication {
|
|
|
193
224
|
if (res_error) {
|
|
194
225
|
Logger({
|
|
195
226
|
level: "WARN",
|
|
196
|
-
message:
|
|
227
|
+
message: `Response Validation Warnnings for platform > Communication > createEmailProvider \n ${res_error}`,
|
|
197
228
|
});
|
|
198
|
-
Logger({ level: "WARN", message: res_error });
|
|
199
229
|
}
|
|
200
230
|
|
|
201
231
|
return response;
|
|
202
232
|
}
|
|
203
233
|
|
|
204
234
|
/**
|
|
205
|
-
* @param {
|
|
206
|
-
*
|
|
207
|
-
*
|
|
235
|
+
* @param {CommunicationPlatformApplicationValidator.CreateEmailTemplateParam} arg
|
|
236
|
+
* - Arg object
|
|
237
|
+
*
|
|
238
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
239
|
+
* @returns {Promise<CommunicationPlatformModel.EmailTemplateRes>} - Success response
|
|
240
|
+
* @name createEmailTemplate
|
|
208
241
|
* @summary: Create email template
|
|
209
|
-
* @description: Create email template
|
|
242
|
+
* @description: Create email template - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/communication/createEmailTemplate/).
|
|
210
243
|
*/
|
|
211
|
-
async createEmailTemplate({ body } = {}) {
|
|
212
|
-
const {
|
|
244
|
+
async createEmailTemplate({ body } = {}, { headers } = { headers: false }) {
|
|
245
|
+
const {
|
|
246
|
+
error,
|
|
247
|
+
} = CommunicationPlatformApplicationValidator.createEmailTemplate().validate(
|
|
213
248
|
{
|
|
214
249
|
body,
|
|
215
250
|
},
|
|
@@ -222,7 +257,7 @@ class Communication {
|
|
|
222
257
|
// Showing warrnings if extra unknown parameters are found
|
|
223
258
|
const {
|
|
224
259
|
error: warrning,
|
|
225
|
-
} =
|
|
260
|
+
} = CommunicationPlatformApplicationValidator.createEmailTemplate().validate(
|
|
226
261
|
{
|
|
227
262
|
body,
|
|
228
263
|
},
|
|
@@ -231,9 +266,8 @@ class Communication {
|
|
|
231
266
|
if (warrning) {
|
|
232
267
|
Logger({
|
|
233
268
|
level: "WARN",
|
|
234
|
-
message:
|
|
269
|
+
message: `Parameter Validation warrnings for platform > Communication > createEmailTemplate \n ${warrning}`,
|
|
235
270
|
});
|
|
236
|
-
Logger({ level: "WARN", message: warrning });
|
|
237
271
|
}
|
|
238
272
|
|
|
239
273
|
const query_params = {};
|
|
@@ -243,12 +277,19 @@ class Communication {
|
|
|
243
277
|
"post",
|
|
244
278
|
`/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/email/templates`,
|
|
245
279
|
query_params,
|
|
246
|
-
body
|
|
280
|
+
body,
|
|
281
|
+
undefined,
|
|
282
|
+
{ headers }
|
|
247
283
|
);
|
|
248
284
|
|
|
285
|
+
let responseData = response;
|
|
286
|
+
if (headers) {
|
|
287
|
+
responseData = response[0];
|
|
288
|
+
}
|
|
289
|
+
|
|
249
290
|
const {
|
|
250
291
|
error: res_error,
|
|
251
|
-
} =
|
|
292
|
+
} = CommunicationPlatformModel.EmailTemplateRes().validate(responseData, {
|
|
252
293
|
abortEarly: false,
|
|
253
294
|
allowUnknown: false,
|
|
254
295
|
});
|
|
@@ -256,23 +297,27 @@ class Communication {
|
|
|
256
297
|
if (res_error) {
|
|
257
298
|
Logger({
|
|
258
299
|
level: "WARN",
|
|
259
|
-
message:
|
|
300
|
+
message: `Response Validation Warnnings for platform > Communication > createEmailTemplate \n ${res_error}`,
|
|
260
301
|
});
|
|
261
|
-
Logger({ level: "WARN", message: res_error });
|
|
262
302
|
}
|
|
263
303
|
|
|
264
304
|
return response;
|
|
265
305
|
}
|
|
266
306
|
|
|
267
307
|
/**
|
|
268
|
-
* @param {
|
|
269
|
-
*
|
|
270
|
-
*
|
|
308
|
+
* @param {CommunicationPlatformApplicationValidator.CreateSmsProviderParam} arg
|
|
309
|
+
* - Arg object
|
|
310
|
+
*
|
|
311
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
312
|
+
* @returns {Promise<CommunicationPlatformModel.SmsProvider>} - Success response
|
|
313
|
+
* @name createSmsProvider
|
|
271
314
|
* @summary: Create sms provider
|
|
272
|
-
* @description: Create sms provider
|
|
315
|
+
* @description: Create sms provider - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/communication/createSmsProvider/).
|
|
273
316
|
*/
|
|
274
|
-
async createSmsProvider({ body } = {}) {
|
|
275
|
-
const {
|
|
317
|
+
async createSmsProvider({ body } = {}, { headers } = { headers: false }) {
|
|
318
|
+
const {
|
|
319
|
+
error,
|
|
320
|
+
} = CommunicationPlatformApplicationValidator.createSmsProvider().validate(
|
|
276
321
|
{
|
|
277
322
|
body,
|
|
278
323
|
},
|
|
@@ -285,7 +330,7 @@ class Communication {
|
|
|
285
330
|
// Showing warrnings if extra unknown parameters are found
|
|
286
331
|
const {
|
|
287
332
|
error: warrning,
|
|
288
|
-
} =
|
|
333
|
+
} = CommunicationPlatformApplicationValidator.createSmsProvider().validate(
|
|
289
334
|
{
|
|
290
335
|
body,
|
|
291
336
|
},
|
|
@@ -294,9 +339,8 @@ class Communication {
|
|
|
294
339
|
if (warrning) {
|
|
295
340
|
Logger({
|
|
296
341
|
level: "WARN",
|
|
297
|
-
message:
|
|
342
|
+
message: `Parameter Validation warrnings for platform > Communication > createSmsProvider \n ${warrning}`,
|
|
298
343
|
});
|
|
299
|
-
Logger({ level: "WARN", message: warrning });
|
|
300
344
|
}
|
|
301
345
|
|
|
302
346
|
const query_params = {};
|
|
@@ -306,12 +350,19 @@ class Communication {
|
|
|
306
350
|
"post",
|
|
307
351
|
`/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/sms/providers`,
|
|
308
352
|
query_params,
|
|
309
|
-
body
|
|
353
|
+
body,
|
|
354
|
+
undefined,
|
|
355
|
+
{ headers }
|
|
310
356
|
);
|
|
311
357
|
|
|
358
|
+
let responseData = response;
|
|
359
|
+
if (headers) {
|
|
360
|
+
responseData = response[0];
|
|
361
|
+
}
|
|
362
|
+
|
|
312
363
|
const {
|
|
313
364
|
error: res_error,
|
|
314
|
-
} =
|
|
365
|
+
} = CommunicationPlatformModel.SmsProvider().validate(responseData, {
|
|
315
366
|
abortEarly: false,
|
|
316
367
|
allowUnknown: false,
|
|
317
368
|
});
|
|
@@ -319,23 +370,27 @@ class Communication {
|
|
|
319
370
|
if (res_error) {
|
|
320
371
|
Logger({
|
|
321
372
|
level: "WARN",
|
|
322
|
-
message:
|
|
373
|
+
message: `Response Validation Warnnings for platform > Communication > createSmsProvider \n ${res_error}`,
|
|
323
374
|
});
|
|
324
|
-
Logger({ level: "WARN", message: res_error });
|
|
325
375
|
}
|
|
326
376
|
|
|
327
377
|
return response;
|
|
328
378
|
}
|
|
329
379
|
|
|
330
380
|
/**
|
|
331
|
-
* @param {
|
|
332
|
-
*
|
|
333
|
-
*
|
|
381
|
+
* @param {CommunicationPlatformApplicationValidator.CreateSmsTemplateParam} arg
|
|
382
|
+
* - Arg object
|
|
383
|
+
*
|
|
384
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
385
|
+
* @returns {Promise<CommunicationPlatformModel.SmsTemplateRes>} - Success response
|
|
386
|
+
* @name createSmsTemplate
|
|
334
387
|
* @summary: Create sms template
|
|
335
|
-
* @description: Create sms template
|
|
388
|
+
* @description: Create sms template - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/communication/createSmsTemplate/).
|
|
336
389
|
*/
|
|
337
|
-
async createSmsTemplate({ body } = {}) {
|
|
338
|
-
const {
|
|
390
|
+
async createSmsTemplate({ body } = {}, { headers } = { headers: false }) {
|
|
391
|
+
const {
|
|
392
|
+
error,
|
|
393
|
+
} = CommunicationPlatformApplicationValidator.createSmsTemplate().validate(
|
|
339
394
|
{
|
|
340
395
|
body,
|
|
341
396
|
},
|
|
@@ -348,7 +403,7 @@ class Communication {
|
|
|
348
403
|
// Showing warrnings if extra unknown parameters are found
|
|
349
404
|
const {
|
|
350
405
|
error: warrning,
|
|
351
|
-
} =
|
|
406
|
+
} = CommunicationPlatformApplicationValidator.createSmsTemplate().validate(
|
|
352
407
|
{
|
|
353
408
|
body,
|
|
354
409
|
},
|
|
@@ -357,9 +412,8 @@ class Communication {
|
|
|
357
412
|
if (warrning) {
|
|
358
413
|
Logger({
|
|
359
414
|
level: "WARN",
|
|
360
|
-
message:
|
|
415
|
+
message: `Parameter Validation warrnings for platform > Communication > createSmsTemplate \n ${warrning}`,
|
|
361
416
|
});
|
|
362
|
-
Logger({ level: "WARN", message: warrning });
|
|
363
417
|
}
|
|
364
418
|
|
|
365
419
|
const query_params = {};
|
|
@@ -369,12 +423,19 @@ class Communication {
|
|
|
369
423
|
"post",
|
|
370
424
|
`/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/sms/templates`,
|
|
371
425
|
query_params,
|
|
372
|
-
body
|
|
426
|
+
body,
|
|
427
|
+
undefined,
|
|
428
|
+
{ headers }
|
|
373
429
|
);
|
|
374
430
|
|
|
431
|
+
let responseData = response;
|
|
432
|
+
if (headers) {
|
|
433
|
+
responseData = response[0];
|
|
434
|
+
}
|
|
435
|
+
|
|
375
436
|
const {
|
|
376
437
|
error: res_error,
|
|
377
|
-
} =
|
|
438
|
+
} = CommunicationPlatformModel.SmsTemplateRes().validate(responseData, {
|
|
378
439
|
abortEarly: false,
|
|
379
440
|
allowUnknown: false,
|
|
380
441
|
});
|
|
@@ -382,23 +443,29 @@ class Communication {
|
|
|
382
443
|
if (res_error) {
|
|
383
444
|
Logger({
|
|
384
445
|
level: "WARN",
|
|
385
|
-
message:
|
|
446
|
+
message: `Response Validation Warnnings for platform > Communication > createSmsTemplate \n ${res_error}`,
|
|
386
447
|
});
|
|
387
|
-
Logger({ level: "WARN", message: res_error });
|
|
388
448
|
}
|
|
389
449
|
|
|
390
450
|
return response;
|
|
391
451
|
}
|
|
392
452
|
|
|
393
453
|
/**
|
|
394
|
-
* @param {
|
|
395
|
-
*
|
|
396
|
-
*
|
|
454
|
+
* @param {CommunicationPlatformApplicationValidator.DeleteEmailTemplateByIdParam} arg
|
|
455
|
+
* - Arg object
|
|
456
|
+
*
|
|
457
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
458
|
+
* @returns {Promise<CommunicationPlatformModel.EmailTemplateDeleteSuccessRes>}
|
|
459
|
+
* - Success response
|
|
460
|
+
*
|
|
461
|
+
* @name deleteEmailTemplateById
|
|
397
462
|
* @summary: Delete email template by id
|
|
398
|
-
* @description: Delete email template by id
|
|
463
|
+
* @description: Delete email template by id - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/communication/deleteEmailTemplateById/).
|
|
399
464
|
*/
|
|
400
|
-
async deleteEmailTemplateById({ id } = {}) {
|
|
401
|
-
const {
|
|
465
|
+
async deleteEmailTemplateById({ id } = {}, { headers } = { headers: false }) {
|
|
466
|
+
const {
|
|
467
|
+
error,
|
|
468
|
+
} = CommunicationPlatformApplicationValidator.deleteEmailTemplateById().validate(
|
|
402
469
|
{
|
|
403
470
|
id,
|
|
404
471
|
},
|
|
@@ -411,7 +478,7 @@ class Communication {
|
|
|
411
478
|
// Showing warrnings if extra unknown parameters are found
|
|
412
479
|
const {
|
|
413
480
|
error: warrning,
|
|
414
|
-
} =
|
|
481
|
+
} = CommunicationPlatformApplicationValidator.deleteEmailTemplateById().validate(
|
|
415
482
|
{
|
|
416
483
|
id,
|
|
417
484
|
},
|
|
@@ -420,9 +487,8 @@ class Communication {
|
|
|
420
487
|
if (warrning) {
|
|
421
488
|
Logger({
|
|
422
489
|
level: "WARN",
|
|
423
|
-
message:
|
|
490
|
+
message: `Parameter Validation warrnings for platform > Communication > deleteEmailTemplateById \n ${warrning}`,
|
|
424
491
|
});
|
|
425
|
-
Logger({ level: "WARN", message: warrning });
|
|
426
492
|
}
|
|
427
493
|
|
|
428
494
|
const query_params = {};
|
|
@@ -432,36 +498,49 @@ class Communication {
|
|
|
432
498
|
"delete",
|
|
433
499
|
`/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/email/templates/${id}`,
|
|
434
500
|
query_params,
|
|
435
|
-
undefined
|
|
501
|
+
undefined,
|
|
502
|
+
undefined,
|
|
503
|
+
{ headers }
|
|
436
504
|
);
|
|
437
505
|
|
|
506
|
+
let responseData = response;
|
|
507
|
+
if (headers) {
|
|
508
|
+
responseData = response[0];
|
|
509
|
+
}
|
|
510
|
+
|
|
438
511
|
const {
|
|
439
512
|
error: res_error,
|
|
440
|
-
} =
|
|
441
|
-
|
|
442
|
-
allowUnknown: false
|
|
443
|
-
|
|
513
|
+
} = CommunicationPlatformModel.EmailTemplateDeleteSuccessRes().validate(
|
|
514
|
+
responseData,
|
|
515
|
+
{ abortEarly: false, allowUnknown: false }
|
|
516
|
+
);
|
|
444
517
|
|
|
445
518
|
if (res_error) {
|
|
446
519
|
Logger({
|
|
447
520
|
level: "WARN",
|
|
448
|
-
message:
|
|
521
|
+
message: `Response Validation Warnnings for platform > Communication > deleteEmailTemplateById \n ${res_error}`,
|
|
449
522
|
});
|
|
450
|
-
Logger({ level: "WARN", message: res_error });
|
|
451
523
|
}
|
|
452
524
|
|
|
453
525
|
return response;
|
|
454
526
|
}
|
|
455
527
|
|
|
456
528
|
/**
|
|
457
|
-
* @param {
|
|
458
|
-
*
|
|
459
|
-
*
|
|
529
|
+
* @param {CommunicationPlatformApplicationValidator.DeleteSmsTemplateByIdParam} arg
|
|
530
|
+
* - Arg object
|
|
531
|
+
*
|
|
532
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
533
|
+
* @returns {Promise<CommunicationPlatformModel.SmsTemplateDeleteSuccessRes>}
|
|
534
|
+
* - Success response
|
|
535
|
+
*
|
|
536
|
+
* @name deleteSmsTemplateById
|
|
460
537
|
* @summary: Delete sms template by id
|
|
461
|
-
* @description: Delete sms template by id
|
|
538
|
+
* @description: Delete sms template by id - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/communication/deleteSmsTemplateById/).
|
|
462
539
|
*/
|
|
463
|
-
async deleteSmsTemplateById({ id } = {}) {
|
|
464
|
-
const {
|
|
540
|
+
async deleteSmsTemplateById({ id } = {}, { headers } = { headers: false }) {
|
|
541
|
+
const {
|
|
542
|
+
error,
|
|
543
|
+
} = CommunicationPlatformApplicationValidator.deleteSmsTemplateById().validate(
|
|
465
544
|
{
|
|
466
545
|
id,
|
|
467
546
|
},
|
|
@@ -474,7 +553,7 @@ class Communication {
|
|
|
474
553
|
// Showing warrnings if extra unknown parameters are found
|
|
475
554
|
const {
|
|
476
555
|
error: warrning,
|
|
477
|
-
} =
|
|
556
|
+
} = CommunicationPlatformApplicationValidator.deleteSmsTemplateById().validate(
|
|
478
557
|
{
|
|
479
558
|
id,
|
|
480
559
|
},
|
|
@@ -483,9 +562,8 @@ class Communication {
|
|
|
483
562
|
if (warrning) {
|
|
484
563
|
Logger({
|
|
485
564
|
level: "WARN",
|
|
486
|
-
message:
|
|
565
|
+
message: `Parameter Validation warrnings for platform > Communication > deleteSmsTemplateById \n ${warrning}`,
|
|
487
566
|
});
|
|
488
|
-
Logger({ level: "WARN", message: warrning });
|
|
489
567
|
}
|
|
490
568
|
|
|
491
569
|
const query_params = {};
|
|
@@ -495,36 +573,47 @@ class Communication {
|
|
|
495
573
|
"delete",
|
|
496
574
|
`/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/sms/templates/${id}`,
|
|
497
575
|
query_params,
|
|
498
|
-
undefined
|
|
576
|
+
undefined,
|
|
577
|
+
undefined,
|
|
578
|
+
{ headers }
|
|
499
579
|
);
|
|
500
580
|
|
|
581
|
+
let responseData = response;
|
|
582
|
+
if (headers) {
|
|
583
|
+
responseData = response[0];
|
|
584
|
+
}
|
|
585
|
+
|
|
501
586
|
const {
|
|
502
587
|
error: res_error,
|
|
503
|
-
} =
|
|
504
|
-
|
|
505
|
-
allowUnknown: false
|
|
506
|
-
|
|
588
|
+
} = CommunicationPlatformModel.SmsTemplateDeleteSuccessRes().validate(
|
|
589
|
+
responseData,
|
|
590
|
+
{ abortEarly: false, allowUnknown: false }
|
|
591
|
+
);
|
|
507
592
|
|
|
508
593
|
if (res_error) {
|
|
509
594
|
Logger({
|
|
510
595
|
level: "WARN",
|
|
511
|
-
message:
|
|
596
|
+
message: `Response Validation Warnnings for platform > Communication > deleteSmsTemplateById \n ${res_error}`,
|
|
512
597
|
});
|
|
513
|
-
Logger({ level: "WARN", message: res_error });
|
|
514
598
|
}
|
|
515
599
|
|
|
516
600
|
return response;
|
|
517
601
|
}
|
|
518
602
|
|
|
519
603
|
/**
|
|
520
|
-
* @param {
|
|
521
|
-
*
|
|
522
|
-
*
|
|
604
|
+
* @param {CommunicationPlatformApplicationValidator.GetAudienceByIdParam} arg
|
|
605
|
+
* - Arg object
|
|
606
|
+
*
|
|
607
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
608
|
+
* @returns {Promise<CommunicationPlatformModel.Audience>} - Success response
|
|
609
|
+
* @name getAudienceById
|
|
523
610
|
* @summary: Get audience by id
|
|
524
|
-
* @description: Get audience by id
|
|
611
|
+
* @description: Get audience by id - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/communication/getAudienceById/).
|
|
525
612
|
*/
|
|
526
|
-
async getAudienceById({ id } = {}) {
|
|
527
|
-
const {
|
|
613
|
+
async getAudienceById({ id } = {}, { headers } = { headers: false }) {
|
|
614
|
+
const {
|
|
615
|
+
error,
|
|
616
|
+
} = CommunicationPlatformApplicationValidator.getAudienceById().validate(
|
|
528
617
|
{
|
|
529
618
|
id,
|
|
530
619
|
},
|
|
@@ -537,7 +626,7 @@ class Communication {
|
|
|
537
626
|
// Showing warrnings if extra unknown parameters are found
|
|
538
627
|
const {
|
|
539
628
|
error: warrning,
|
|
540
|
-
} =
|
|
629
|
+
} = CommunicationPlatformApplicationValidator.getAudienceById().validate(
|
|
541
630
|
{
|
|
542
631
|
id,
|
|
543
632
|
},
|
|
@@ -546,9 +635,8 @@ class Communication {
|
|
|
546
635
|
if (warrning) {
|
|
547
636
|
Logger({
|
|
548
637
|
level: "WARN",
|
|
549
|
-
message:
|
|
638
|
+
message: `Parameter Validation warrnings for platform > Communication > getAudienceById \n ${warrning}`,
|
|
550
639
|
});
|
|
551
|
-
Logger({ level: "WARN", message: warrning });
|
|
552
640
|
}
|
|
553
641
|
|
|
554
642
|
const query_params = {};
|
|
@@ -558,12 +646,19 @@ class Communication {
|
|
|
558
646
|
"get",
|
|
559
647
|
`/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/sources/datasources/${id}`,
|
|
560
648
|
query_params,
|
|
561
|
-
undefined
|
|
649
|
+
undefined,
|
|
650
|
+
undefined,
|
|
651
|
+
{ headers }
|
|
562
652
|
);
|
|
563
653
|
|
|
654
|
+
let responseData = response;
|
|
655
|
+
if (headers) {
|
|
656
|
+
responseData = response[0];
|
|
657
|
+
}
|
|
658
|
+
|
|
564
659
|
const {
|
|
565
660
|
error: res_error,
|
|
566
|
-
} =
|
|
661
|
+
} = CommunicationPlatformModel.Audience().validate(responseData, {
|
|
567
662
|
abortEarly: false,
|
|
568
663
|
allowUnknown: false,
|
|
569
664
|
});
|
|
@@ -571,25 +666,30 @@ class Communication {
|
|
|
571
666
|
if (res_error) {
|
|
572
667
|
Logger({
|
|
573
668
|
level: "WARN",
|
|
574
|
-
message:
|
|
669
|
+
message: `Response Validation Warnnings for platform > Communication > getAudienceById \n ${res_error}`,
|
|
575
670
|
});
|
|
576
|
-
Logger({ level: "WARN", message: res_error });
|
|
577
671
|
}
|
|
578
672
|
|
|
579
673
|
return response;
|
|
580
674
|
}
|
|
581
675
|
|
|
582
676
|
/**
|
|
583
|
-
* @param {
|
|
584
|
-
*
|
|
585
|
-
*
|
|
586
|
-
* @param {
|
|
587
|
-
* @returns {Promise<Audiences>} - Success response
|
|
677
|
+
* @param {CommunicationPlatformApplicationValidator.GetAudiencesParam} arg
|
|
678
|
+
* - Arg object
|
|
679
|
+
*
|
|
680
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
681
|
+
* @returns {Promise<CommunicationPlatformModel.Audiences>} - Success response
|
|
682
|
+
* @name getAudiences
|
|
588
683
|
* @summary: Get audiences
|
|
589
|
-
* @description: Get audiences
|
|
684
|
+
* @description: Get audiences - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/communication/getAudiences/).
|
|
590
685
|
*/
|
|
591
|
-
async getAudiences(
|
|
592
|
-
|
|
686
|
+
async getAudiences(
|
|
687
|
+
{ pageNo, pageSize, sort } = {},
|
|
688
|
+
{ headers } = { headers: false }
|
|
689
|
+
) {
|
|
690
|
+
const {
|
|
691
|
+
error,
|
|
692
|
+
} = CommunicationPlatformApplicationValidator.getAudiences().validate(
|
|
593
693
|
{
|
|
594
694
|
pageNo,
|
|
595
695
|
pageSize,
|
|
@@ -602,7 +702,9 @@ class Communication {
|
|
|
602
702
|
}
|
|
603
703
|
|
|
604
704
|
// Showing warrnings if extra unknown parameters are found
|
|
605
|
-
const {
|
|
705
|
+
const {
|
|
706
|
+
error: warrning,
|
|
707
|
+
} = CommunicationPlatformApplicationValidator.getAudiences().validate(
|
|
606
708
|
{
|
|
607
709
|
pageNo,
|
|
608
710
|
pageSize,
|
|
@@ -613,9 +715,8 @@ class Communication {
|
|
|
613
715
|
if (warrning) {
|
|
614
716
|
Logger({
|
|
615
717
|
level: "WARN",
|
|
616
|
-
message:
|
|
718
|
+
message: `Parameter Validation warrnings for platform > Communication > getAudiences \n ${warrning}`,
|
|
617
719
|
});
|
|
618
|
-
Logger({ level: "WARN", message: warrning });
|
|
619
720
|
}
|
|
620
721
|
|
|
621
722
|
const query_params = {};
|
|
@@ -628,12 +729,19 @@ class Communication {
|
|
|
628
729
|
"get",
|
|
629
730
|
`/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/sources/datasources`,
|
|
630
731
|
query_params,
|
|
631
|
-
undefined
|
|
732
|
+
undefined,
|
|
733
|
+
undefined,
|
|
734
|
+
{ headers }
|
|
632
735
|
);
|
|
633
736
|
|
|
737
|
+
let responseData = response;
|
|
738
|
+
if (headers) {
|
|
739
|
+
responseData = response[0];
|
|
740
|
+
}
|
|
741
|
+
|
|
634
742
|
const {
|
|
635
743
|
error: res_error,
|
|
636
|
-
} =
|
|
744
|
+
} = CommunicationPlatformModel.Audiences().validate(responseData, {
|
|
637
745
|
abortEarly: false,
|
|
638
746
|
allowUnknown: false,
|
|
639
747
|
});
|
|
@@ -641,9 +749,8 @@ class Communication {
|
|
|
641
749
|
if (res_error) {
|
|
642
750
|
Logger({
|
|
643
751
|
level: "WARN",
|
|
644
|
-
message:
|
|
752
|
+
message: `Response Validation Warnnings for platform > Communication > getAudiences \n ${res_error}`,
|
|
645
753
|
});
|
|
646
|
-
Logger({ level: "WARN", message: res_error });
|
|
647
754
|
}
|
|
648
755
|
|
|
649
756
|
return response;
|
|
@@ -651,13 +758,52 @@ class Communication {
|
|
|
651
758
|
|
|
652
759
|
/**
|
|
653
760
|
* @param {Object} arg - Arg object.
|
|
654
|
-
* @param {
|
|
655
|
-
* @
|
|
761
|
+
* @param {string} arg.companyId - Company id
|
|
762
|
+
* @param {string} arg.applicationId - Application id
|
|
763
|
+
* @param {number} [arg.pageSize] - Current request items count
|
|
764
|
+
* @param {Object} [arg.sort] - To sort based on created_at
|
|
765
|
+
* @returns {Paginator<CommunicationPlatformModel.Audiences>}
|
|
766
|
+
* @summary: Get audiences
|
|
767
|
+
* @description: Get audiences
|
|
768
|
+
*/
|
|
769
|
+
getAudiencesPaginator({ companyId, applicationId, pageSize, sort } = {}) {
|
|
770
|
+
const paginator = new Paginator();
|
|
771
|
+
const callback = async () => {
|
|
772
|
+
const pageId = paginator.nextId;
|
|
773
|
+
const pageNo = paginator.pageNo;
|
|
774
|
+
const pageType = "number";
|
|
775
|
+
const data = await this.getAudiences({
|
|
776
|
+
companyId: companyId,
|
|
777
|
+
applicationId: applicationId,
|
|
778
|
+
pageNo: pageNo,
|
|
779
|
+
pageSize: pageSize,
|
|
780
|
+
sort: sort,
|
|
781
|
+
});
|
|
782
|
+
paginator.setPaginator({
|
|
783
|
+
hasNext: data.page.has_next ? true : false,
|
|
784
|
+
nextId: data.page.next_id,
|
|
785
|
+
});
|
|
786
|
+
return data;
|
|
787
|
+
};
|
|
788
|
+
paginator.setCallback(callback.bind(this));
|
|
789
|
+
return paginator;
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
/**
|
|
793
|
+
* @param {CommunicationPlatformApplicationValidator.GetBigqueryHeadersParam} arg
|
|
794
|
+
* - Arg object
|
|
795
|
+
*
|
|
796
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
797
|
+
* @returns {Promise<CommunicationPlatformModel.BigqueryHeadersRes>} -
|
|
798
|
+
* Success response
|
|
799
|
+
* @name getBigqueryHeaders
|
|
656
800
|
* @summary: Get bigquery headers
|
|
657
|
-
* @description: Get bigquery headers
|
|
801
|
+
* @description: Get bigquery headers - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/communication/getBigqueryHeaders/).
|
|
658
802
|
*/
|
|
659
|
-
async getBigqueryHeaders({ body } = {}) {
|
|
660
|
-
const {
|
|
803
|
+
async getBigqueryHeaders({ body } = {}, { headers } = { headers: false }) {
|
|
804
|
+
const {
|
|
805
|
+
error,
|
|
806
|
+
} = CommunicationPlatformApplicationValidator.getBigqueryHeaders().validate(
|
|
661
807
|
{
|
|
662
808
|
body,
|
|
663
809
|
},
|
|
@@ -670,7 +816,7 @@ class Communication {
|
|
|
670
816
|
// Showing warrnings if extra unknown parameters are found
|
|
671
817
|
const {
|
|
672
818
|
error: warrning,
|
|
673
|
-
} =
|
|
819
|
+
} = CommunicationPlatformApplicationValidator.getBigqueryHeaders().validate(
|
|
674
820
|
{
|
|
675
821
|
body,
|
|
676
822
|
},
|
|
@@ -679,9 +825,8 @@ class Communication {
|
|
|
679
825
|
if (warrning) {
|
|
680
826
|
Logger({
|
|
681
827
|
level: "WARN",
|
|
682
|
-
message:
|
|
828
|
+
message: `Parameter Validation warrnings for platform > Communication > getBigqueryHeaders \n ${warrning}`,
|
|
683
829
|
});
|
|
684
|
-
Logger({ level: "WARN", message: warrning });
|
|
685
830
|
}
|
|
686
831
|
|
|
687
832
|
const query_params = {};
|
|
@@ -691,12 +836,19 @@ class Communication {
|
|
|
691
836
|
"post",
|
|
692
837
|
`/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/sources/bigquery-headers`,
|
|
693
838
|
query_params,
|
|
694
|
-
body
|
|
839
|
+
body,
|
|
840
|
+
undefined,
|
|
841
|
+
{ headers }
|
|
695
842
|
);
|
|
696
843
|
|
|
844
|
+
let responseData = response;
|
|
845
|
+
if (headers) {
|
|
846
|
+
responseData = response[0];
|
|
847
|
+
}
|
|
848
|
+
|
|
697
849
|
const {
|
|
698
850
|
error: res_error,
|
|
699
|
-
} =
|
|
851
|
+
} = CommunicationPlatformModel.BigqueryHeadersRes().validate(responseData, {
|
|
700
852
|
abortEarly: false,
|
|
701
853
|
allowUnknown: false,
|
|
702
854
|
});
|
|
@@ -704,23 +856,27 @@ class Communication {
|
|
|
704
856
|
if (res_error) {
|
|
705
857
|
Logger({
|
|
706
858
|
level: "WARN",
|
|
707
|
-
message:
|
|
859
|
+
message: `Response Validation Warnnings for platform > Communication > getBigqueryHeaders \n ${res_error}`,
|
|
708
860
|
});
|
|
709
|
-
Logger({ level: "WARN", message: res_error });
|
|
710
861
|
}
|
|
711
862
|
|
|
712
863
|
return response;
|
|
713
864
|
}
|
|
714
865
|
|
|
715
866
|
/**
|
|
716
|
-
* @param {
|
|
717
|
-
*
|
|
718
|
-
*
|
|
867
|
+
* @param {CommunicationPlatformApplicationValidator.GetCampaignByIdParam} arg
|
|
868
|
+
* - Arg object
|
|
869
|
+
*
|
|
870
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
871
|
+
* @returns {Promise<CommunicationPlatformModel.Campaign>} - Success response
|
|
872
|
+
* @name getCampaignById
|
|
719
873
|
* @summary: Get campaign by id
|
|
720
|
-
* @description: Get campaign by id
|
|
874
|
+
* @description: Get campaign by id - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/communication/getCampaignById/).
|
|
721
875
|
*/
|
|
722
|
-
async getCampaignById({ id } = {}) {
|
|
723
|
-
const {
|
|
876
|
+
async getCampaignById({ id } = {}, { headers } = { headers: false }) {
|
|
877
|
+
const {
|
|
878
|
+
error,
|
|
879
|
+
} = CommunicationPlatformApplicationValidator.getCampaignById().validate(
|
|
724
880
|
{
|
|
725
881
|
id,
|
|
726
882
|
},
|
|
@@ -733,7 +889,7 @@ class Communication {
|
|
|
733
889
|
// Showing warrnings if extra unknown parameters are found
|
|
734
890
|
const {
|
|
735
891
|
error: warrning,
|
|
736
|
-
} =
|
|
892
|
+
} = CommunicationPlatformApplicationValidator.getCampaignById().validate(
|
|
737
893
|
{
|
|
738
894
|
id,
|
|
739
895
|
},
|
|
@@ -742,9 +898,8 @@ class Communication {
|
|
|
742
898
|
if (warrning) {
|
|
743
899
|
Logger({
|
|
744
900
|
level: "WARN",
|
|
745
|
-
message:
|
|
901
|
+
message: `Parameter Validation warrnings for platform > Communication > getCampaignById \n ${warrning}`,
|
|
746
902
|
});
|
|
747
|
-
Logger({ level: "WARN", message: warrning });
|
|
748
903
|
}
|
|
749
904
|
|
|
750
905
|
const query_params = {};
|
|
@@ -754,12 +909,19 @@ class Communication {
|
|
|
754
909
|
"get",
|
|
755
910
|
`/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/campaigns/campaigns/${id}`,
|
|
756
911
|
query_params,
|
|
757
|
-
undefined
|
|
912
|
+
undefined,
|
|
913
|
+
undefined,
|
|
914
|
+
{ headers }
|
|
758
915
|
);
|
|
759
916
|
|
|
917
|
+
let responseData = response;
|
|
918
|
+
if (headers) {
|
|
919
|
+
responseData = response[0];
|
|
920
|
+
}
|
|
921
|
+
|
|
760
922
|
const {
|
|
761
923
|
error: res_error,
|
|
762
|
-
} =
|
|
924
|
+
} = CommunicationPlatformModel.Campaign().validate(responseData, {
|
|
763
925
|
abortEarly: false,
|
|
764
926
|
allowUnknown: false,
|
|
765
927
|
});
|
|
@@ -767,25 +929,30 @@ class Communication {
|
|
|
767
929
|
if (res_error) {
|
|
768
930
|
Logger({
|
|
769
931
|
level: "WARN",
|
|
770
|
-
message:
|
|
932
|
+
message: `Response Validation Warnnings for platform > Communication > getCampaignById \n ${res_error}`,
|
|
771
933
|
});
|
|
772
|
-
Logger({ level: "WARN", message: res_error });
|
|
773
934
|
}
|
|
774
935
|
|
|
775
936
|
return response;
|
|
776
937
|
}
|
|
777
938
|
|
|
778
939
|
/**
|
|
779
|
-
* @param {
|
|
780
|
-
*
|
|
781
|
-
*
|
|
782
|
-
* @param {
|
|
783
|
-
* @returns {Promise<Campaigns>} - Success response
|
|
940
|
+
* @param {CommunicationPlatformApplicationValidator.GetCampaignsParam} arg
|
|
941
|
+
* - Arg object
|
|
942
|
+
*
|
|
943
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
944
|
+
* @returns {Promise<CommunicationPlatformModel.Campaigns>} - Success response
|
|
945
|
+
* @name getCampaigns
|
|
784
946
|
* @summary: Get campaigns
|
|
785
|
-
* @description: Get campaigns
|
|
947
|
+
* @description: Get campaigns - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/communication/getCampaigns/).
|
|
786
948
|
*/
|
|
787
|
-
async getCampaigns(
|
|
788
|
-
|
|
949
|
+
async getCampaigns(
|
|
950
|
+
{ pageNo, pageSize, sort } = {},
|
|
951
|
+
{ headers } = { headers: false }
|
|
952
|
+
) {
|
|
953
|
+
const {
|
|
954
|
+
error,
|
|
955
|
+
} = CommunicationPlatformApplicationValidator.getCampaigns().validate(
|
|
789
956
|
{
|
|
790
957
|
pageNo,
|
|
791
958
|
pageSize,
|
|
@@ -798,7 +965,9 @@ class Communication {
|
|
|
798
965
|
}
|
|
799
966
|
|
|
800
967
|
// Showing warrnings if extra unknown parameters are found
|
|
801
|
-
const {
|
|
968
|
+
const {
|
|
969
|
+
error: warrning,
|
|
970
|
+
} = CommunicationPlatformApplicationValidator.getCampaigns().validate(
|
|
802
971
|
{
|
|
803
972
|
pageNo,
|
|
804
973
|
pageSize,
|
|
@@ -809,9 +978,8 @@ class Communication {
|
|
|
809
978
|
if (warrning) {
|
|
810
979
|
Logger({
|
|
811
980
|
level: "WARN",
|
|
812
|
-
message:
|
|
981
|
+
message: `Parameter Validation warrnings for platform > Communication > getCampaigns \n ${warrning}`,
|
|
813
982
|
});
|
|
814
|
-
Logger({ level: "WARN", message: warrning });
|
|
815
983
|
}
|
|
816
984
|
|
|
817
985
|
const query_params = {};
|
|
@@ -824,12 +992,19 @@ class Communication {
|
|
|
824
992
|
"get",
|
|
825
993
|
`/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/campaigns/campaigns`,
|
|
826
994
|
query_params,
|
|
827
|
-
undefined
|
|
995
|
+
undefined,
|
|
996
|
+
undefined,
|
|
997
|
+
{ headers }
|
|
828
998
|
);
|
|
829
999
|
|
|
1000
|
+
let responseData = response;
|
|
1001
|
+
if (headers) {
|
|
1002
|
+
responseData = response[0];
|
|
1003
|
+
}
|
|
1004
|
+
|
|
830
1005
|
const {
|
|
831
1006
|
error: res_error,
|
|
832
|
-
} =
|
|
1007
|
+
} = CommunicationPlatformModel.Campaigns().validate(responseData, {
|
|
833
1008
|
abortEarly: false,
|
|
834
1009
|
allowUnknown: false,
|
|
835
1010
|
});
|
|
@@ -837,9 +1012,8 @@ class Communication {
|
|
|
837
1012
|
if (res_error) {
|
|
838
1013
|
Logger({
|
|
839
1014
|
level: "WARN",
|
|
840
|
-
message:
|
|
1015
|
+
message: `Response Validation Warnnings for platform > Communication > getCampaigns \n ${res_error}`,
|
|
841
1016
|
});
|
|
842
|
-
Logger({ level: "WARN", message: res_error });
|
|
843
1017
|
}
|
|
844
1018
|
|
|
845
1019
|
return response;
|
|
@@ -847,16 +1021,54 @@ class Communication {
|
|
|
847
1021
|
|
|
848
1022
|
/**
|
|
849
1023
|
* @param {Object} arg - Arg object.
|
|
850
|
-
* @param {string}
|
|
1024
|
+
* @param {string} arg.companyId - Company id
|
|
1025
|
+
* @param {string} arg.applicationId - Application id
|
|
851
1026
|
* @param {number} [arg.pageSize] - Current request items count
|
|
852
|
-
* @param {Object} [arg.sort] - To sort based on
|
|
853
|
-
* @
|
|
854
|
-
* @
|
|
1027
|
+
* @param {Object} [arg.sort] - To sort based on created_at
|
|
1028
|
+
* @returns {Paginator<CommunicationPlatformModel.Campaigns>}
|
|
1029
|
+
* @summary: Get campaigns
|
|
1030
|
+
* @description: Get campaigns
|
|
1031
|
+
*/
|
|
1032
|
+
getCampaignsPaginator({ companyId, applicationId, pageSize, sort } = {}) {
|
|
1033
|
+
const paginator = new Paginator();
|
|
1034
|
+
const callback = async () => {
|
|
1035
|
+
const pageId = paginator.nextId;
|
|
1036
|
+
const pageNo = paginator.pageNo;
|
|
1037
|
+
const pageType = "number";
|
|
1038
|
+
const data = await this.getCampaigns({
|
|
1039
|
+
companyId: companyId,
|
|
1040
|
+
applicationId: applicationId,
|
|
1041
|
+
pageNo: pageNo,
|
|
1042
|
+
pageSize: pageSize,
|
|
1043
|
+
sort: sort,
|
|
1044
|
+
});
|
|
1045
|
+
paginator.setPaginator({
|
|
1046
|
+
hasNext: data.page.has_next ? true : false,
|
|
1047
|
+
nextId: data.page.next_id,
|
|
1048
|
+
});
|
|
1049
|
+
return data;
|
|
1050
|
+
};
|
|
1051
|
+
paginator.setCallback(callback.bind(this));
|
|
1052
|
+
return paginator;
|
|
1053
|
+
}
|
|
1054
|
+
|
|
1055
|
+
/**
|
|
1056
|
+
* @param {CommunicationPlatformApplicationValidator.GetCommunicationLogsParam} arg
|
|
1057
|
+
* - Arg object
|
|
1058
|
+
*
|
|
1059
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1060
|
+
* @returns {Promise<CommunicationPlatformModel.Logs>} - Success response
|
|
1061
|
+
* @name getCommunicationLogs
|
|
855
1062
|
* @summary: Get communication logs
|
|
856
|
-
* @description: Get communication logs
|
|
1063
|
+
* @description: Get communication logs - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/communication/getCommunicationLogs/).
|
|
857
1064
|
*/
|
|
858
|
-
async getCommunicationLogs(
|
|
859
|
-
|
|
1065
|
+
async getCommunicationLogs(
|
|
1066
|
+
{ pageId, pageSize, sort, query } = {},
|
|
1067
|
+
{ headers } = { headers: false }
|
|
1068
|
+
) {
|
|
1069
|
+
const {
|
|
1070
|
+
error,
|
|
1071
|
+
} = CommunicationPlatformApplicationValidator.getCommunicationLogs().validate(
|
|
860
1072
|
{
|
|
861
1073
|
pageId,
|
|
862
1074
|
pageSize,
|
|
@@ -872,7 +1084,7 @@ class Communication {
|
|
|
872
1084
|
// Showing warrnings if extra unknown parameters are found
|
|
873
1085
|
const {
|
|
874
1086
|
error: warrning,
|
|
875
|
-
} =
|
|
1087
|
+
} = CommunicationPlatformApplicationValidator.getCommunicationLogs().validate(
|
|
876
1088
|
{
|
|
877
1089
|
pageId,
|
|
878
1090
|
pageSize,
|
|
@@ -884,9 +1096,8 @@ class Communication {
|
|
|
884
1096
|
if (warrning) {
|
|
885
1097
|
Logger({
|
|
886
1098
|
level: "WARN",
|
|
887
|
-
message:
|
|
1099
|
+
message: `Parameter Validation warrnings for platform > Communication > getCommunicationLogs \n ${warrning}`,
|
|
888
1100
|
});
|
|
889
|
-
Logger({ level: "WARN", message: warrning });
|
|
890
1101
|
}
|
|
891
1102
|
|
|
892
1103
|
const query_params = {};
|
|
@@ -900,10 +1111,19 @@ class Communication {
|
|
|
900
1111
|
"get",
|
|
901
1112
|
`/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/log`,
|
|
902
1113
|
query_params,
|
|
903
|
-
undefined
|
|
1114
|
+
undefined,
|
|
1115
|
+
undefined,
|
|
1116
|
+
{ headers }
|
|
904
1117
|
);
|
|
905
1118
|
|
|
906
|
-
|
|
1119
|
+
let responseData = response;
|
|
1120
|
+
if (headers) {
|
|
1121
|
+
responseData = response[0];
|
|
1122
|
+
}
|
|
1123
|
+
|
|
1124
|
+
const {
|
|
1125
|
+
error: res_error,
|
|
1126
|
+
} = CommunicationPlatformModel.Logs().validate(responseData, {
|
|
907
1127
|
abortEarly: false,
|
|
908
1128
|
allowUnknown: false,
|
|
909
1129
|
});
|
|
@@ -911,9 +1131,8 @@ class Communication {
|
|
|
911
1131
|
if (res_error) {
|
|
912
1132
|
Logger({
|
|
913
1133
|
level: "WARN",
|
|
914
|
-
message:
|
|
1134
|
+
message: `Response Validation Warnnings for platform > Communication > getCommunicationLogs \n ${res_error}`,
|
|
915
1135
|
});
|
|
916
|
-
Logger({ level: "WARN", message: res_error });
|
|
917
1136
|
}
|
|
918
1137
|
|
|
919
1138
|
return response;
|
|
@@ -921,13 +1140,59 @@ class Communication {
|
|
|
921
1140
|
|
|
922
1141
|
/**
|
|
923
1142
|
* @param {Object} arg - Arg object.
|
|
924
|
-
* @param {string} arg.
|
|
925
|
-
* @
|
|
1143
|
+
* @param {string} arg.companyId - Company id
|
|
1144
|
+
* @param {string} arg.applicationId - Application id
|
|
1145
|
+
* @param {number} [arg.pageSize] - Current request items count
|
|
1146
|
+
* @param {Object} [arg.sort] - To sort based on _id
|
|
1147
|
+
* @param {Object} [arg.query] -
|
|
1148
|
+
* @returns {Paginator<CommunicationPlatformModel.Logs>}
|
|
1149
|
+
* @summary: Get communication logs
|
|
1150
|
+
* @description: Get communication logs
|
|
1151
|
+
*/
|
|
1152
|
+
getCommunicationLogsPaginator({
|
|
1153
|
+
companyId,
|
|
1154
|
+
applicationId,
|
|
1155
|
+
pageSize,
|
|
1156
|
+
sort,
|
|
1157
|
+
query,
|
|
1158
|
+
} = {}) {
|
|
1159
|
+
const paginator = new Paginator();
|
|
1160
|
+
const callback = async () => {
|
|
1161
|
+
const pageId = paginator.nextId;
|
|
1162
|
+
const pageNo = paginator.pageNo;
|
|
1163
|
+
const pageType = "cursor";
|
|
1164
|
+
const data = await this.getCommunicationLogs({
|
|
1165
|
+
companyId: companyId,
|
|
1166
|
+
applicationId: applicationId,
|
|
1167
|
+
pageId: pageId,
|
|
1168
|
+
pageSize: pageSize,
|
|
1169
|
+
sort: sort,
|
|
1170
|
+
query: query,
|
|
1171
|
+
});
|
|
1172
|
+
paginator.setPaginator({
|
|
1173
|
+
hasNext: data.page.has_next ? true : false,
|
|
1174
|
+
nextId: data.page.next_id,
|
|
1175
|
+
});
|
|
1176
|
+
return data;
|
|
1177
|
+
};
|
|
1178
|
+
paginator.setCallback(callback.bind(this));
|
|
1179
|
+
return paginator;
|
|
1180
|
+
}
|
|
1181
|
+
|
|
1182
|
+
/**
|
|
1183
|
+
* @param {CommunicationPlatformApplicationValidator.GetEmailProviderByIdParam} arg
|
|
1184
|
+
* - Arg object
|
|
1185
|
+
*
|
|
1186
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1187
|
+
* @returns {Promise<CommunicationPlatformModel.EmailProvider>} - Success response
|
|
1188
|
+
* @name getEmailProviderById
|
|
926
1189
|
* @summary: Get email provider by id
|
|
927
|
-
* @description: Get email provider by id
|
|
1190
|
+
* @description: Get email provider by id - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/communication/getEmailProviderById/).
|
|
928
1191
|
*/
|
|
929
|
-
async getEmailProviderById({ id } = {}) {
|
|
930
|
-
const {
|
|
1192
|
+
async getEmailProviderById({ id } = {}, { headers } = { headers: false }) {
|
|
1193
|
+
const {
|
|
1194
|
+
error,
|
|
1195
|
+
} = CommunicationPlatformApplicationValidator.getEmailProviderById().validate(
|
|
931
1196
|
{
|
|
932
1197
|
id,
|
|
933
1198
|
},
|
|
@@ -940,7 +1205,7 @@ class Communication {
|
|
|
940
1205
|
// Showing warrnings if extra unknown parameters are found
|
|
941
1206
|
const {
|
|
942
1207
|
error: warrning,
|
|
943
|
-
} =
|
|
1208
|
+
} = CommunicationPlatformApplicationValidator.getEmailProviderById().validate(
|
|
944
1209
|
{
|
|
945
1210
|
id,
|
|
946
1211
|
},
|
|
@@ -949,9 +1214,8 @@ class Communication {
|
|
|
949
1214
|
if (warrning) {
|
|
950
1215
|
Logger({
|
|
951
1216
|
level: "WARN",
|
|
952
|
-
message:
|
|
1217
|
+
message: `Parameter Validation warrnings for platform > Communication > getEmailProviderById \n ${warrning}`,
|
|
953
1218
|
});
|
|
954
|
-
Logger({ level: "WARN", message: warrning });
|
|
955
1219
|
}
|
|
956
1220
|
|
|
957
1221
|
const query_params = {};
|
|
@@ -961,12 +1225,19 @@ class Communication {
|
|
|
961
1225
|
"get",
|
|
962
1226
|
`/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/email/providers/${id}`,
|
|
963
1227
|
query_params,
|
|
964
|
-
undefined
|
|
1228
|
+
undefined,
|
|
1229
|
+
undefined,
|
|
1230
|
+
{ headers }
|
|
965
1231
|
);
|
|
966
1232
|
|
|
1233
|
+
let responseData = response;
|
|
1234
|
+
if (headers) {
|
|
1235
|
+
responseData = response[0];
|
|
1236
|
+
}
|
|
1237
|
+
|
|
967
1238
|
const {
|
|
968
1239
|
error: res_error,
|
|
969
|
-
} =
|
|
1240
|
+
} = CommunicationPlatformModel.EmailProvider().validate(responseData, {
|
|
970
1241
|
abortEarly: false,
|
|
971
1242
|
allowUnknown: false,
|
|
972
1243
|
});
|
|
@@ -974,25 +1245,30 @@ class Communication {
|
|
|
974
1245
|
if (res_error) {
|
|
975
1246
|
Logger({
|
|
976
1247
|
level: "WARN",
|
|
977
|
-
message:
|
|
1248
|
+
message: `Response Validation Warnnings for platform > Communication > getEmailProviderById \n ${res_error}`,
|
|
978
1249
|
});
|
|
979
|
-
Logger({ level: "WARN", message: res_error });
|
|
980
1250
|
}
|
|
981
1251
|
|
|
982
1252
|
return response;
|
|
983
1253
|
}
|
|
984
1254
|
|
|
985
1255
|
/**
|
|
986
|
-
* @param {
|
|
987
|
-
*
|
|
988
|
-
*
|
|
989
|
-
* @param {
|
|
990
|
-
* @returns {Promise<EmailProviders>} - Success response
|
|
1256
|
+
* @param {CommunicationPlatformApplicationValidator.GetEmailProvidersParam} arg
|
|
1257
|
+
* - Arg object
|
|
1258
|
+
*
|
|
1259
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1260
|
+
* @returns {Promise<CommunicationPlatformModel.EmailProviders>} - Success response
|
|
1261
|
+
* @name getEmailProviders
|
|
991
1262
|
* @summary: Get email providers
|
|
992
|
-
* @description: Get email providers
|
|
1263
|
+
* @description: Get email providers - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/communication/getEmailProviders/).
|
|
993
1264
|
*/
|
|
994
|
-
async getEmailProviders(
|
|
995
|
-
|
|
1265
|
+
async getEmailProviders(
|
|
1266
|
+
{ pageNo, pageSize, sort } = {},
|
|
1267
|
+
{ headers } = { headers: false }
|
|
1268
|
+
) {
|
|
1269
|
+
const {
|
|
1270
|
+
error,
|
|
1271
|
+
} = CommunicationPlatformApplicationValidator.getEmailProviders().validate(
|
|
996
1272
|
{
|
|
997
1273
|
pageNo,
|
|
998
1274
|
pageSize,
|
|
@@ -1007,7 +1283,7 @@ class Communication {
|
|
|
1007
1283
|
// Showing warrnings if extra unknown parameters are found
|
|
1008
1284
|
const {
|
|
1009
1285
|
error: warrning,
|
|
1010
|
-
} =
|
|
1286
|
+
} = CommunicationPlatformApplicationValidator.getEmailProviders().validate(
|
|
1011
1287
|
{
|
|
1012
1288
|
pageNo,
|
|
1013
1289
|
pageSize,
|
|
@@ -1018,9 +1294,8 @@ class Communication {
|
|
|
1018
1294
|
if (warrning) {
|
|
1019
1295
|
Logger({
|
|
1020
1296
|
level: "WARN",
|
|
1021
|
-
message:
|
|
1297
|
+
message: `Parameter Validation warrnings for platform > Communication > getEmailProviders \n ${warrning}`,
|
|
1022
1298
|
});
|
|
1023
|
-
Logger({ level: "WARN", message: warrning });
|
|
1024
1299
|
}
|
|
1025
1300
|
|
|
1026
1301
|
const query_params = {};
|
|
@@ -1033,12 +1308,19 @@ class Communication {
|
|
|
1033
1308
|
"get",
|
|
1034
1309
|
`/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/email/providers`,
|
|
1035
1310
|
query_params,
|
|
1036
|
-
undefined
|
|
1311
|
+
undefined,
|
|
1312
|
+
undefined,
|
|
1313
|
+
{ headers }
|
|
1037
1314
|
);
|
|
1038
1315
|
|
|
1316
|
+
let responseData = response;
|
|
1317
|
+
if (headers) {
|
|
1318
|
+
responseData = response[0];
|
|
1319
|
+
}
|
|
1320
|
+
|
|
1039
1321
|
const {
|
|
1040
1322
|
error: res_error,
|
|
1041
|
-
} =
|
|
1323
|
+
} = CommunicationPlatformModel.EmailProviders().validate(responseData, {
|
|
1042
1324
|
abortEarly: false,
|
|
1043
1325
|
allowUnknown: false,
|
|
1044
1326
|
});
|
|
@@ -1046,9 +1328,8 @@ class Communication {
|
|
|
1046
1328
|
if (res_error) {
|
|
1047
1329
|
Logger({
|
|
1048
1330
|
level: "WARN",
|
|
1049
|
-
message:
|
|
1331
|
+
message: `Response Validation Warnnings for platform > Communication > getEmailProviders \n ${res_error}`,
|
|
1050
1332
|
});
|
|
1051
|
-
Logger({ level: "WARN", message: res_error });
|
|
1052
1333
|
}
|
|
1053
1334
|
|
|
1054
1335
|
return response;
|
|
@@ -1056,13 +1337,56 @@ class Communication {
|
|
|
1056
1337
|
|
|
1057
1338
|
/**
|
|
1058
1339
|
* @param {Object} arg - Arg object.
|
|
1059
|
-
* @param {string} arg.
|
|
1060
|
-
* @
|
|
1340
|
+
* @param {string} arg.companyId - Company id
|
|
1341
|
+
* @param {string} arg.applicationId - Application id
|
|
1342
|
+
* @param {number} [arg.pageSize] - Current request items count
|
|
1343
|
+
* @param {Object} [arg.sort] - To sort based on created_at
|
|
1344
|
+
* @returns {Paginator<CommunicationPlatformModel.EmailProviders>}
|
|
1345
|
+
* @summary: Get email providers
|
|
1346
|
+
* @description: Get email providers
|
|
1347
|
+
*/
|
|
1348
|
+
getEmailProvidersPaginator({
|
|
1349
|
+
companyId,
|
|
1350
|
+
applicationId,
|
|
1351
|
+
pageSize,
|
|
1352
|
+
sort,
|
|
1353
|
+
} = {}) {
|
|
1354
|
+
const paginator = new Paginator();
|
|
1355
|
+
const callback = async () => {
|
|
1356
|
+
const pageId = paginator.nextId;
|
|
1357
|
+
const pageNo = paginator.pageNo;
|
|
1358
|
+
const pageType = "number";
|
|
1359
|
+
const data = await this.getEmailProviders({
|
|
1360
|
+
companyId: companyId,
|
|
1361
|
+
applicationId: applicationId,
|
|
1362
|
+
pageNo: pageNo,
|
|
1363
|
+
pageSize: pageSize,
|
|
1364
|
+
sort: sort,
|
|
1365
|
+
});
|
|
1366
|
+
paginator.setPaginator({
|
|
1367
|
+
hasNext: data.page.has_next ? true : false,
|
|
1368
|
+
nextId: data.page.next_id,
|
|
1369
|
+
});
|
|
1370
|
+
return data;
|
|
1371
|
+
};
|
|
1372
|
+
paginator.setCallback(callback.bind(this));
|
|
1373
|
+
return paginator;
|
|
1374
|
+
}
|
|
1375
|
+
|
|
1376
|
+
/**
|
|
1377
|
+
* @param {CommunicationPlatformApplicationValidator.GetEmailTemplateByIdParam} arg
|
|
1378
|
+
* - Arg object
|
|
1379
|
+
*
|
|
1380
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1381
|
+
* @returns {Promise<CommunicationPlatformModel.EmailTemplate>} - Success response
|
|
1382
|
+
* @name getEmailTemplateById
|
|
1061
1383
|
* @summary: Get email template by id
|
|
1062
|
-
* @description: Get email template by id
|
|
1384
|
+
* @description: Get email template by id - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/communication/getEmailTemplateById/).
|
|
1063
1385
|
*/
|
|
1064
|
-
async getEmailTemplateById({ id } = {}) {
|
|
1065
|
-
const {
|
|
1386
|
+
async getEmailTemplateById({ id } = {}, { headers } = { headers: false }) {
|
|
1387
|
+
const {
|
|
1388
|
+
error,
|
|
1389
|
+
} = CommunicationPlatformApplicationValidator.getEmailTemplateById().validate(
|
|
1066
1390
|
{
|
|
1067
1391
|
id,
|
|
1068
1392
|
},
|
|
@@ -1075,7 +1399,7 @@ class Communication {
|
|
|
1075
1399
|
// Showing warrnings if extra unknown parameters are found
|
|
1076
1400
|
const {
|
|
1077
1401
|
error: warrning,
|
|
1078
|
-
} =
|
|
1402
|
+
} = CommunicationPlatformApplicationValidator.getEmailTemplateById().validate(
|
|
1079
1403
|
{
|
|
1080
1404
|
id,
|
|
1081
1405
|
},
|
|
@@ -1084,9 +1408,8 @@ class Communication {
|
|
|
1084
1408
|
if (warrning) {
|
|
1085
1409
|
Logger({
|
|
1086
1410
|
level: "WARN",
|
|
1087
|
-
message:
|
|
1411
|
+
message: `Parameter Validation warrnings for platform > Communication > getEmailTemplateById \n ${warrning}`,
|
|
1088
1412
|
});
|
|
1089
|
-
Logger({ level: "WARN", message: warrning });
|
|
1090
1413
|
}
|
|
1091
1414
|
|
|
1092
1415
|
const query_params = {};
|
|
@@ -1096,12 +1419,19 @@ class Communication {
|
|
|
1096
1419
|
"get",
|
|
1097
1420
|
`/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/email/templates/${id}`,
|
|
1098
1421
|
query_params,
|
|
1099
|
-
undefined
|
|
1422
|
+
undefined,
|
|
1423
|
+
undefined,
|
|
1424
|
+
{ headers }
|
|
1100
1425
|
);
|
|
1101
1426
|
|
|
1427
|
+
let responseData = response;
|
|
1428
|
+
if (headers) {
|
|
1429
|
+
responseData = response[0];
|
|
1430
|
+
}
|
|
1431
|
+
|
|
1102
1432
|
const {
|
|
1103
1433
|
error: res_error,
|
|
1104
|
-
} =
|
|
1434
|
+
} = CommunicationPlatformModel.EmailTemplate().validate(responseData, {
|
|
1105
1435
|
abortEarly: false,
|
|
1106
1436
|
allowUnknown: false,
|
|
1107
1437
|
});
|
|
@@ -1109,25 +1439,30 @@ class Communication {
|
|
|
1109
1439
|
if (res_error) {
|
|
1110
1440
|
Logger({
|
|
1111
1441
|
level: "WARN",
|
|
1112
|
-
message:
|
|
1442
|
+
message: `Response Validation Warnnings for platform > Communication > getEmailTemplateById \n ${res_error}`,
|
|
1113
1443
|
});
|
|
1114
|
-
Logger({ level: "WARN", message: res_error });
|
|
1115
1444
|
}
|
|
1116
1445
|
|
|
1117
1446
|
return response;
|
|
1118
1447
|
}
|
|
1119
1448
|
|
|
1120
1449
|
/**
|
|
1121
|
-
* @param {
|
|
1122
|
-
*
|
|
1123
|
-
*
|
|
1124
|
-
* @param {
|
|
1125
|
-
* @returns {Promise<EmailTemplates>} - Success response
|
|
1450
|
+
* @param {CommunicationPlatformApplicationValidator.GetEmailTemplatesParam} arg
|
|
1451
|
+
* - Arg object
|
|
1452
|
+
*
|
|
1453
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1454
|
+
* @returns {Promise<CommunicationPlatformModel.EmailTemplates>} - Success response
|
|
1455
|
+
* @name getEmailTemplates
|
|
1126
1456
|
* @summary: Get email templates
|
|
1127
|
-
* @description: Get email templates
|
|
1457
|
+
* @description: Get email templates - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/communication/getEmailTemplates/).
|
|
1128
1458
|
*/
|
|
1129
|
-
async getEmailTemplates(
|
|
1130
|
-
|
|
1459
|
+
async getEmailTemplates(
|
|
1460
|
+
{ pageNo, pageSize, sort } = {},
|
|
1461
|
+
{ headers } = { headers: false }
|
|
1462
|
+
) {
|
|
1463
|
+
const {
|
|
1464
|
+
error,
|
|
1465
|
+
} = CommunicationPlatformApplicationValidator.getEmailTemplates().validate(
|
|
1131
1466
|
{
|
|
1132
1467
|
pageNo,
|
|
1133
1468
|
pageSize,
|
|
@@ -1142,7 +1477,7 @@ class Communication {
|
|
|
1142
1477
|
// Showing warrnings if extra unknown parameters are found
|
|
1143
1478
|
const {
|
|
1144
1479
|
error: warrning,
|
|
1145
|
-
} =
|
|
1480
|
+
} = CommunicationPlatformApplicationValidator.getEmailTemplates().validate(
|
|
1146
1481
|
{
|
|
1147
1482
|
pageNo,
|
|
1148
1483
|
pageSize,
|
|
@@ -1153,9 +1488,8 @@ class Communication {
|
|
|
1153
1488
|
if (warrning) {
|
|
1154
1489
|
Logger({
|
|
1155
1490
|
level: "WARN",
|
|
1156
|
-
message:
|
|
1491
|
+
message: `Parameter Validation warrnings for platform > Communication > getEmailTemplates \n ${warrning}`,
|
|
1157
1492
|
});
|
|
1158
|
-
Logger({ level: "WARN", message: warrning });
|
|
1159
1493
|
}
|
|
1160
1494
|
|
|
1161
1495
|
const query_params = {};
|
|
@@ -1168,12 +1502,19 @@ class Communication {
|
|
|
1168
1502
|
"get",
|
|
1169
1503
|
`/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/email/templates`,
|
|
1170
1504
|
query_params,
|
|
1171
|
-
undefined
|
|
1505
|
+
undefined,
|
|
1506
|
+
undefined,
|
|
1507
|
+
{ headers }
|
|
1172
1508
|
);
|
|
1173
1509
|
|
|
1510
|
+
let responseData = response;
|
|
1511
|
+
if (headers) {
|
|
1512
|
+
responseData = response[0];
|
|
1513
|
+
}
|
|
1514
|
+
|
|
1174
1515
|
const {
|
|
1175
1516
|
error: res_error,
|
|
1176
|
-
} =
|
|
1517
|
+
} = CommunicationPlatformModel.EmailTemplates().validate(responseData, {
|
|
1177
1518
|
abortEarly: false,
|
|
1178
1519
|
allowUnknown: false,
|
|
1179
1520
|
});
|
|
@@ -1181,9 +1522,8 @@ class Communication {
|
|
|
1181
1522
|
if (res_error) {
|
|
1182
1523
|
Logger({
|
|
1183
1524
|
level: "WARN",
|
|
1184
|
-
message:
|
|
1525
|
+
message: `Response Validation Warnnings for platform > Communication > getEmailTemplates \n ${res_error}`,
|
|
1185
1526
|
});
|
|
1186
|
-
Logger({ level: "WARN", message: res_error });
|
|
1187
1527
|
}
|
|
1188
1528
|
|
|
1189
1529
|
return response;
|
|
@@ -1191,15 +1531,60 @@ class Communication {
|
|
|
1191
1531
|
|
|
1192
1532
|
/**
|
|
1193
1533
|
* @param {Object} arg - Arg object.
|
|
1194
|
-
* @param {
|
|
1534
|
+
* @param {string} arg.companyId - Company id
|
|
1535
|
+
* @param {string} arg.applicationId - Application id
|
|
1195
1536
|
* @param {number} [arg.pageSize] - Current request items count
|
|
1196
|
-
* @param {
|
|
1197
|
-
* @returns {
|
|
1537
|
+
* @param {Object} [arg.sort] - To sort based on created_at
|
|
1538
|
+
* @returns {Paginator<CommunicationPlatformModel.EmailTemplates>}
|
|
1539
|
+
* @summary: Get email templates
|
|
1540
|
+
* @description: Get email templates
|
|
1541
|
+
*/
|
|
1542
|
+
getEmailTemplatesPaginator({
|
|
1543
|
+
companyId,
|
|
1544
|
+
applicationId,
|
|
1545
|
+
pageSize,
|
|
1546
|
+
sort,
|
|
1547
|
+
} = {}) {
|
|
1548
|
+
const paginator = new Paginator();
|
|
1549
|
+
const callback = async () => {
|
|
1550
|
+
const pageId = paginator.nextId;
|
|
1551
|
+
const pageNo = paginator.pageNo;
|
|
1552
|
+
const pageType = "number";
|
|
1553
|
+
const data = await this.getEmailTemplates({
|
|
1554
|
+
companyId: companyId,
|
|
1555
|
+
applicationId: applicationId,
|
|
1556
|
+
pageNo: pageNo,
|
|
1557
|
+
pageSize: pageSize,
|
|
1558
|
+
sort: sort,
|
|
1559
|
+
});
|
|
1560
|
+
paginator.setPaginator({
|
|
1561
|
+
hasNext: data.page.has_next ? true : false,
|
|
1562
|
+
nextId: data.page.next_id,
|
|
1563
|
+
});
|
|
1564
|
+
return data;
|
|
1565
|
+
};
|
|
1566
|
+
paginator.setCallback(callback.bind(this));
|
|
1567
|
+
return paginator;
|
|
1568
|
+
}
|
|
1569
|
+
|
|
1570
|
+
/**
|
|
1571
|
+
* @param {CommunicationPlatformApplicationValidator.GetEventSubscriptionsParam} arg
|
|
1572
|
+
* - Arg object
|
|
1573
|
+
*
|
|
1574
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1575
|
+
* @returns {Promise<CommunicationPlatformModel.EventSubscriptions>} -
|
|
1576
|
+
* Success response
|
|
1577
|
+
* @name getEventSubscriptions
|
|
1198
1578
|
* @summary: Get event subscriptions
|
|
1199
|
-
* @description: Get event subscriptions
|
|
1579
|
+
* @description: Get event subscriptions - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/communication/getEventSubscriptions/).
|
|
1200
1580
|
*/
|
|
1201
|
-
async getEventSubscriptions(
|
|
1202
|
-
|
|
1581
|
+
async getEventSubscriptions(
|
|
1582
|
+
{ pageNo, pageSize, populate } = {},
|
|
1583
|
+
{ headers } = { headers: false }
|
|
1584
|
+
) {
|
|
1585
|
+
const {
|
|
1586
|
+
error,
|
|
1587
|
+
} = CommunicationPlatformApplicationValidator.getEventSubscriptions().validate(
|
|
1203
1588
|
{
|
|
1204
1589
|
pageNo,
|
|
1205
1590
|
pageSize,
|
|
@@ -1214,7 +1599,7 @@ class Communication {
|
|
|
1214
1599
|
// Showing warrnings if extra unknown parameters are found
|
|
1215
1600
|
const {
|
|
1216
1601
|
error: warrning,
|
|
1217
|
-
} =
|
|
1602
|
+
} = CommunicationPlatformApplicationValidator.getEventSubscriptions().validate(
|
|
1218
1603
|
{
|
|
1219
1604
|
pageNo,
|
|
1220
1605
|
pageSize,
|
|
@@ -1225,9 +1610,8 @@ class Communication {
|
|
|
1225
1610
|
if (warrning) {
|
|
1226
1611
|
Logger({
|
|
1227
1612
|
level: "WARN",
|
|
1228
|
-
message:
|
|
1613
|
+
message: `Parameter Validation warrnings for platform > Communication > getEventSubscriptions \n ${warrning}`,
|
|
1229
1614
|
});
|
|
1230
|
-
Logger({ level: "WARN", message: warrning });
|
|
1231
1615
|
}
|
|
1232
1616
|
|
|
1233
1617
|
const query_params = {};
|
|
@@ -1240,12 +1624,19 @@ class Communication {
|
|
|
1240
1624
|
"get",
|
|
1241
1625
|
`/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/event/event-subscriptions`,
|
|
1242
1626
|
query_params,
|
|
1243
|
-
undefined
|
|
1627
|
+
undefined,
|
|
1628
|
+
undefined,
|
|
1629
|
+
{ headers }
|
|
1244
1630
|
);
|
|
1245
1631
|
|
|
1632
|
+
let responseData = response;
|
|
1633
|
+
if (headers) {
|
|
1634
|
+
responseData = response[0];
|
|
1635
|
+
}
|
|
1636
|
+
|
|
1246
1637
|
const {
|
|
1247
1638
|
error: res_error,
|
|
1248
|
-
} =
|
|
1639
|
+
} = CommunicationPlatformModel.EventSubscriptions().validate(responseData, {
|
|
1249
1640
|
abortEarly: false,
|
|
1250
1641
|
allowUnknown: false,
|
|
1251
1642
|
});
|
|
@@ -1253,9 +1644,8 @@ class Communication {
|
|
|
1253
1644
|
if (res_error) {
|
|
1254
1645
|
Logger({
|
|
1255
1646
|
level: "WARN",
|
|
1256
|
-
message:
|
|
1647
|
+
message: `Response Validation Warnnings for platform > Communication > getEventSubscriptions \n ${res_error}`,
|
|
1257
1648
|
});
|
|
1258
|
-
Logger({ level: "WARN", message: res_error });
|
|
1259
1649
|
}
|
|
1260
1650
|
|
|
1261
1651
|
return response;
|
|
@@ -1263,15 +1653,57 @@ class Communication {
|
|
|
1263
1653
|
|
|
1264
1654
|
/**
|
|
1265
1655
|
* @param {Object} arg - Arg object.
|
|
1266
|
-
* @param {
|
|
1656
|
+
* @param {string} arg.companyId - Company id
|
|
1657
|
+
* @param {string} arg.applicationId - Application id
|
|
1267
1658
|
* @param {number} [arg.pageSize] - Current request items count
|
|
1268
|
-
* @param {
|
|
1269
|
-
* @returns {
|
|
1659
|
+
* @param {string} [arg.populate] - Populate fields
|
|
1660
|
+
* @returns {Paginator<CommunicationPlatformModel.EventSubscriptions>}
|
|
1661
|
+
* @summary: Get event subscriptions
|
|
1662
|
+
* @description: Get event subscriptions
|
|
1663
|
+
*/
|
|
1664
|
+
getEventSubscriptionsPaginator({
|
|
1665
|
+
companyId,
|
|
1666
|
+
applicationId,
|
|
1667
|
+
pageSize,
|
|
1668
|
+
populate,
|
|
1669
|
+
} = {}) {
|
|
1670
|
+
const paginator = new Paginator();
|
|
1671
|
+
const callback = async () => {
|
|
1672
|
+
const pageId = paginator.nextId;
|
|
1673
|
+
const pageNo = paginator.pageNo;
|
|
1674
|
+
const pageType = "number";
|
|
1675
|
+
const data = await this.getEventSubscriptions({
|
|
1676
|
+
companyId: companyId,
|
|
1677
|
+
applicationId: applicationId,
|
|
1678
|
+
pageNo: pageNo,
|
|
1679
|
+
pageSize: pageSize,
|
|
1680
|
+
populate: populate,
|
|
1681
|
+
});
|
|
1682
|
+
paginator.setPaginator({
|
|
1683
|
+
hasNext: data.page.has_next ? true : false,
|
|
1684
|
+
nextId: data.page.next_id,
|
|
1685
|
+
});
|
|
1686
|
+
return data;
|
|
1687
|
+
};
|
|
1688
|
+
paginator.setCallback(callback.bind(this));
|
|
1689
|
+
return paginator;
|
|
1690
|
+
}
|
|
1691
|
+
|
|
1692
|
+
/**
|
|
1693
|
+
* @param {CommunicationPlatformApplicationValidator.GetJobLogsParam} arg - Arg object
|
|
1694
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1695
|
+
* @returns {Promise<CommunicationPlatformModel.JobLogs>} - Success response
|
|
1696
|
+
* @name getJobLogs
|
|
1270
1697
|
* @summary: Get job logs
|
|
1271
|
-
* @description: Get job logs
|
|
1698
|
+
* @description: Get job logs - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/communication/getJobLogs/).
|
|
1272
1699
|
*/
|
|
1273
|
-
async getJobLogs(
|
|
1274
|
-
|
|
1700
|
+
async getJobLogs(
|
|
1701
|
+
{ pageNo, pageSize, sort } = {},
|
|
1702
|
+
{ headers } = { headers: false }
|
|
1703
|
+
) {
|
|
1704
|
+
const {
|
|
1705
|
+
error,
|
|
1706
|
+
} = CommunicationPlatformApplicationValidator.getJobLogs().validate(
|
|
1275
1707
|
{
|
|
1276
1708
|
pageNo,
|
|
1277
1709
|
pageSize,
|
|
@@ -1284,7 +1716,9 @@ class Communication {
|
|
|
1284
1716
|
}
|
|
1285
1717
|
|
|
1286
1718
|
// Showing warrnings if extra unknown parameters are found
|
|
1287
|
-
const {
|
|
1719
|
+
const {
|
|
1720
|
+
error: warrning,
|
|
1721
|
+
} = CommunicationPlatformApplicationValidator.getJobLogs().validate(
|
|
1288
1722
|
{
|
|
1289
1723
|
pageNo,
|
|
1290
1724
|
pageSize,
|
|
@@ -1295,9 +1729,8 @@ class Communication {
|
|
|
1295
1729
|
if (warrning) {
|
|
1296
1730
|
Logger({
|
|
1297
1731
|
level: "WARN",
|
|
1298
|
-
message:
|
|
1732
|
+
message: `Parameter Validation warrnings for platform > Communication > getJobLogs \n ${warrning}`,
|
|
1299
1733
|
});
|
|
1300
|
-
Logger({ level: "WARN", message: warrning });
|
|
1301
1734
|
}
|
|
1302
1735
|
|
|
1303
1736
|
const query_params = {};
|
|
@@ -1310,20 +1743,28 @@ class Communication {
|
|
|
1310
1743
|
"get",
|
|
1311
1744
|
`/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/jobs/logs`,
|
|
1312
1745
|
query_params,
|
|
1313
|
-
undefined
|
|
1746
|
+
undefined,
|
|
1747
|
+
undefined,
|
|
1748
|
+
{ headers }
|
|
1314
1749
|
);
|
|
1315
1750
|
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1751
|
+
let responseData = response;
|
|
1752
|
+
if (headers) {
|
|
1753
|
+
responseData = response[0];
|
|
1754
|
+
}
|
|
1755
|
+
|
|
1756
|
+
const {
|
|
1757
|
+
error: res_error,
|
|
1758
|
+
} = CommunicationPlatformModel.JobLogs().validate(responseData, {
|
|
1759
|
+
abortEarly: false,
|
|
1760
|
+
allowUnknown: false,
|
|
1761
|
+
});
|
|
1320
1762
|
|
|
1321
1763
|
if (res_error) {
|
|
1322
1764
|
Logger({
|
|
1323
1765
|
level: "WARN",
|
|
1324
|
-
message:
|
|
1766
|
+
message: `Response Validation Warnnings for platform > Communication > getJobLogs \n ${res_error}`,
|
|
1325
1767
|
});
|
|
1326
|
-
Logger({ level: "WARN", message: res_error });
|
|
1327
1768
|
}
|
|
1328
1769
|
|
|
1329
1770
|
return response;
|
|
@@ -1331,15 +1772,52 @@ class Communication {
|
|
|
1331
1772
|
|
|
1332
1773
|
/**
|
|
1333
1774
|
* @param {Object} arg - Arg object.
|
|
1334
|
-
* @param {
|
|
1775
|
+
* @param {string} arg.companyId - Company id
|
|
1776
|
+
* @param {string} arg.applicationId - Application id
|
|
1335
1777
|
* @param {number} [arg.pageSize] - Current request items count
|
|
1336
1778
|
* @param {Object} [arg.sort] - To sort based on created_at
|
|
1337
|
-
* @returns {
|
|
1779
|
+
* @returns {Paginator<CommunicationPlatformModel.JobLogs>}
|
|
1780
|
+
* @summary: Get job logs
|
|
1781
|
+
* @description: Get job logs
|
|
1782
|
+
*/
|
|
1783
|
+
getJobLogsPaginator({ companyId, applicationId, pageSize, sort } = {}) {
|
|
1784
|
+
const paginator = new Paginator();
|
|
1785
|
+
const callback = async () => {
|
|
1786
|
+
const pageId = paginator.nextId;
|
|
1787
|
+
const pageNo = paginator.pageNo;
|
|
1788
|
+
const pageType = "number";
|
|
1789
|
+
const data = await this.getJobLogs({
|
|
1790
|
+
companyId: companyId,
|
|
1791
|
+
applicationId: applicationId,
|
|
1792
|
+
pageNo: pageNo,
|
|
1793
|
+
pageSize: pageSize,
|
|
1794
|
+
sort: sort,
|
|
1795
|
+
});
|
|
1796
|
+
paginator.setPaginator({
|
|
1797
|
+
hasNext: data.page.has_next ? true : false,
|
|
1798
|
+
nextId: data.page.next_id,
|
|
1799
|
+
});
|
|
1800
|
+
return data;
|
|
1801
|
+
};
|
|
1802
|
+
paginator.setCallback(callback.bind(this));
|
|
1803
|
+
return paginator;
|
|
1804
|
+
}
|
|
1805
|
+
|
|
1806
|
+
/**
|
|
1807
|
+
* @param {CommunicationPlatformApplicationValidator.GetJobsParam} arg - Arg object
|
|
1808
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1809
|
+
* @returns {Promise<CommunicationPlatformModel.Jobs>} - Success response
|
|
1810
|
+
* @name getJobs
|
|
1338
1811
|
* @summary: Get jobs
|
|
1339
|
-
* @description: Get jobs
|
|
1812
|
+
* @description: Get jobs - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/communication/getJobs/).
|
|
1340
1813
|
*/
|
|
1341
|
-
async getJobs(
|
|
1342
|
-
|
|
1814
|
+
async getJobs(
|
|
1815
|
+
{ pageNo, pageSize, sort } = {},
|
|
1816
|
+
{ headers } = { headers: false }
|
|
1817
|
+
) {
|
|
1818
|
+
const {
|
|
1819
|
+
error,
|
|
1820
|
+
} = CommunicationPlatformApplicationValidator.getJobs().validate(
|
|
1343
1821
|
{
|
|
1344
1822
|
pageNo,
|
|
1345
1823
|
pageSize,
|
|
@@ -1352,7 +1830,9 @@ class Communication {
|
|
|
1352
1830
|
}
|
|
1353
1831
|
|
|
1354
1832
|
// Showing warrnings if extra unknown parameters are found
|
|
1355
|
-
const {
|
|
1833
|
+
const {
|
|
1834
|
+
error: warrning,
|
|
1835
|
+
} = CommunicationPlatformApplicationValidator.getJobs().validate(
|
|
1356
1836
|
{
|
|
1357
1837
|
pageNo,
|
|
1358
1838
|
pageSize,
|
|
@@ -1363,9 +1843,8 @@ class Communication {
|
|
|
1363
1843
|
if (warrning) {
|
|
1364
1844
|
Logger({
|
|
1365
1845
|
level: "WARN",
|
|
1366
|
-
message:
|
|
1846
|
+
message: `Parameter Validation warrnings for platform > Communication > getJobs \n ${warrning}`,
|
|
1367
1847
|
});
|
|
1368
|
-
Logger({ level: "WARN", message: warrning });
|
|
1369
1848
|
}
|
|
1370
1849
|
|
|
1371
1850
|
const query_params = {};
|
|
@@ -1378,10 +1857,19 @@ class Communication {
|
|
|
1378
1857
|
"get",
|
|
1379
1858
|
`/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/jobs/jobs`,
|
|
1380
1859
|
query_params,
|
|
1381
|
-
undefined
|
|
1860
|
+
undefined,
|
|
1861
|
+
undefined,
|
|
1862
|
+
{ headers }
|
|
1382
1863
|
);
|
|
1383
1864
|
|
|
1384
|
-
|
|
1865
|
+
let responseData = response;
|
|
1866
|
+
if (headers) {
|
|
1867
|
+
responseData = response[0];
|
|
1868
|
+
}
|
|
1869
|
+
|
|
1870
|
+
const {
|
|
1871
|
+
error: res_error,
|
|
1872
|
+
} = CommunicationPlatformModel.Jobs().validate(responseData, {
|
|
1385
1873
|
abortEarly: false,
|
|
1386
1874
|
allowUnknown: false,
|
|
1387
1875
|
});
|
|
@@ -1389,9 +1877,8 @@ class Communication {
|
|
|
1389
1877
|
if (res_error) {
|
|
1390
1878
|
Logger({
|
|
1391
1879
|
level: "WARN",
|
|
1392
|
-
message:
|
|
1880
|
+
message: `Response Validation Warnnings for platform > Communication > getJobs \n ${res_error}`,
|
|
1393
1881
|
});
|
|
1394
|
-
Logger({ level: "WARN", message: res_error });
|
|
1395
1882
|
}
|
|
1396
1883
|
|
|
1397
1884
|
return response;
|
|
@@ -1399,15 +1886,54 @@ class Communication {
|
|
|
1399
1886
|
|
|
1400
1887
|
/**
|
|
1401
1888
|
* @param {Object} arg - Arg object.
|
|
1402
|
-
* @param {
|
|
1403
|
-
* @
|
|
1889
|
+
* @param {string} arg.companyId - Company id
|
|
1890
|
+
* @param {string} arg.applicationId - Application id
|
|
1891
|
+
* @param {number} [arg.pageSize] - Current request items count
|
|
1892
|
+
* @param {Object} [arg.sort] - To sort based on created_at
|
|
1893
|
+
* @returns {Paginator<CommunicationPlatformModel.Jobs>}
|
|
1894
|
+
* @summary: Get jobs
|
|
1895
|
+
* @description: Get jobs
|
|
1896
|
+
*/
|
|
1897
|
+
getJobsPaginator({ companyId, applicationId, pageSize, sort } = {}) {
|
|
1898
|
+
const paginator = new Paginator();
|
|
1899
|
+
const callback = async () => {
|
|
1900
|
+
const pageId = paginator.nextId;
|
|
1901
|
+
const pageNo = paginator.pageNo;
|
|
1902
|
+
const pageType = "number";
|
|
1903
|
+
const data = await this.getJobs({
|
|
1904
|
+
companyId: companyId,
|
|
1905
|
+
applicationId: applicationId,
|
|
1906
|
+
pageNo: pageNo,
|
|
1907
|
+
pageSize: pageSize,
|
|
1908
|
+
sort: sort,
|
|
1909
|
+
});
|
|
1910
|
+
paginator.setPaginator({
|
|
1911
|
+
hasNext: data.page.has_next ? true : false,
|
|
1912
|
+
nextId: data.page.next_id,
|
|
1913
|
+
});
|
|
1914
|
+
return data;
|
|
1915
|
+
};
|
|
1916
|
+
paginator.setCallback(callback.bind(this));
|
|
1917
|
+
return paginator;
|
|
1918
|
+
}
|
|
1919
|
+
|
|
1920
|
+
/**
|
|
1921
|
+
* @param {CommunicationPlatformApplicationValidator.GetNSampleRecordsFromCsvParam} arg
|
|
1922
|
+
* - Arg object
|
|
1923
|
+
*
|
|
1924
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1925
|
+
* @returns {Promise<CommunicationPlatformModel.GetNRecordsCsvRes>} - Success response
|
|
1926
|
+
* @name getNSampleRecordsFromCsv
|
|
1404
1927
|
* @summary: Get n sample records from csv
|
|
1405
|
-
* @description: Get n sample records from csv
|
|
1928
|
+
* @description: Get n sample records from csv - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/communication/getNSampleRecordsFromCsv/).
|
|
1406
1929
|
*/
|
|
1407
|
-
async getNSampleRecordsFromCsv(
|
|
1930
|
+
async getNSampleRecordsFromCsv(
|
|
1931
|
+
{ body } = {},
|
|
1932
|
+
{ headers } = { headers: false }
|
|
1933
|
+
) {
|
|
1408
1934
|
const {
|
|
1409
1935
|
error,
|
|
1410
|
-
} =
|
|
1936
|
+
} = CommunicationPlatformApplicationValidator.getNSampleRecordsFromCsv().validate(
|
|
1411
1937
|
{
|
|
1412
1938
|
body,
|
|
1413
1939
|
},
|
|
@@ -1420,7 +1946,7 @@ class Communication {
|
|
|
1420
1946
|
// Showing warrnings if extra unknown parameters are found
|
|
1421
1947
|
const {
|
|
1422
1948
|
error: warrning,
|
|
1423
|
-
} =
|
|
1949
|
+
} = CommunicationPlatformApplicationValidator.getNSampleRecordsFromCsv().validate(
|
|
1424
1950
|
{
|
|
1425
1951
|
body,
|
|
1426
1952
|
},
|
|
@@ -1429,9 +1955,8 @@ class Communication {
|
|
|
1429
1955
|
if (warrning) {
|
|
1430
1956
|
Logger({
|
|
1431
1957
|
level: "WARN",
|
|
1432
|
-
message:
|
|
1958
|
+
message: `Parameter Validation warrnings for platform > Communication > getNSampleRecordsFromCsv \n ${warrning}`,
|
|
1433
1959
|
});
|
|
1434
|
-
Logger({ level: "WARN", message: warrning });
|
|
1435
1960
|
}
|
|
1436
1961
|
|
|
1437
1962
|
const query_params = {};
|
|
@@ -1441,12 +1966,19 @@ class Communication {
|
|
|
1441
1966
|
"post",
|
|
1442
1967
|
`/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/sources/get-n-records`,
|
|
1443
1968
|
query_params,
|
|
1444
|
-
body
|
|
1969
|
+
body,
|
|
1970
|
+
undefined,
|
|
1971
|
+
{ headers }
|
|
1445
1972
|
);
|
|
1446
1973
|
|
|
1974
|
+
let responseData = response;
|
|
1975
|
+
if (headers) {
|
|
1976
|
+
responseData = response[0];
|
|
1977
|
+
}
|
|
1978
|
+
|
|
1447
1979
|
const {
|
|
1448
1980
|
error: res_error,
|
|
1449
|
-
} =
|
|
1981
|
+
} = CommunicationPlatformModel.GetNRecordsCsvRes().validate(responseData, {
|
|
1450
1982
|
abortEarly: false,
|
|
1451
1983
|
allowUnknown: false,
|
|
1452
1984
|
});
|
|
@@ -1454,23 +1986,27 @@ class Communication {
|
|
|
1454
1986
|
if (res_error) {
|
|
1455
1987
|
Logger({
|
|
1456
1988
|
level: "WARN",
|
|
1457
|
-
message:
|
|
1989
|
+
message: `Response Validation Warnnings for platform > Communication > getNSampleRecordsFromCsv \n ${res_error}`,
|
|
1458
1990
|
});
|
|
1459
|
-
Logger({ level: "WARN", message: res_error });
|
|
1460
1991
|
}
|
|
1461
1992
|
|
|
1462
1993
|
return response;
|
|
1463
1994
|
}
|
|
1464
1995
|
|
|
1465
1996
|
/**
|
|
1466
|
-
* @param {
|
|
1467
|
-
*
|
|
1468
|
-
*
|
|
1997
|
+
* @param {CommunicationPlatformApplicationValidator.GetSmsProviderByIdParam} arg
|
|
1998
|
+
* - Arg object
|
|
1999
|
+
*
|
|
2000
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
2001
|
+
* @returns {Promise<CommunicationPlatformModel.SmsProvider>} - Success response
|
|
2002
|
+
* @name getSmsProviderById
|
|
1469
2003
|
* @summary: Get sms provider by id
|
|
1470
|
-
* @description: Get sms provider by id
|
|
2004
|
+
* @description: Get sms provider by id - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/communication/getSmsProviderById/).
|
|
1471
2005
|
*/
|
|
1472
|
-
async getSmsProviderById({ id } = {}) {
|
|
1473
|
-
const {
|
|
2006
|
+
async getSmsProviderById({ id } = {}, { headers } = { headers: false }) {
|
|
2007
|
+
const {
|
|
2008
|
+
error,
|
|
2009
|
+
} = CommunicationPlatformApplicationValidator.getSmsProviderById().validate(
|
|
1474
2010
|
{
|
|
1475
2011
|
id,
|
|
1476
2012
|
},
|
|
@@ -1483,7 +2019,7 @@ class Communication {
|
|
|
1483
2019
|
// Showing warrnings if extra unknown parameters are found
|
|
1484
2020
|
const {
|
|
1485
2021
|
error: warrning,
|
|
1486
|
-
} =
|
|
2022
|
+
} = CommunicationPlatformApplicationValidator.getSmsProviderById().validate(
|
|
1487
2023
|
{
|
|
1488
2024
|
id,
|
|
1489
2025
|
},
|
|
@@ -1492,9 +2028,8 @@ class Communication {
|
|
|
1492
2028
|
if (warrning) {
|
|
1493
2029
|
Logger({
|
|
1494
2030
|
level: "WARN",
|
|
1495
|
-
message:
|
|
2031
|
+
message: `Parameter Validation warrnings for platform > Communication > getSmsProviderById \n ${warrning}`,
|
|
1496
2032
|
});
|
|
1497
|
-
Logger({ level: "WARN", message: warrning });
|
|
1498
2033
|
}
|
|
1499
2034
|
|
|
1500
2035
|
const query_params = {};
|
|
@@ -1504,12 +2039,19 @@ class Communication {
|
|
|
1504
2039
|
"get",
|
|
1505
2040
|
`/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/sms/providers/${id}`,
|
|
1506
2041
|
query_params,
|
|
1507
|
-
undefined
|
|
2042
|
+
undefined,
|
|
2043
|
+
undefined,
|
|
2044
|
+
{ headers }
|
|
1508
2045
|
);
|
|
1509
2046
|
|
|
2047
|
+
let responseData = response;
|
|
2048
|
+
if (headers) {
|
|
2049
|
+
responseData = response[0];
|
|
2050
|
+
}
|
|
2051
|
+
|
|
1510
2052
|
const {
|
|
1511
2053
|
error: res_error,
|
|
1512
|
-
} =
|
|
2054
|
+
} = CommunicationPlatformModel.SmsProvider().validate(responseData, {
|
|
1513
2055
|
abortEarly: false,
|
|
1514
2056
|
allowUnknown: false,
|
|
1515
2057
|
});
|
|
@@ -1517,25 +2059,30 @@ class Communication {
|
|
|
1517
2059
|
if (res_error) {
|
|
1518
2060
|
Logger({
|
|
1519
2061
|
level: "WARN",
|
|
1520
|
-
message:
|
|
2062
|
+
message: `Response Validation Warnnings for platform > Communication > getSmsProviderById \n ${res_error}`,
|
|
1521
2063
|
});
|
|
1522
|
-
Logger({ level: "WARN", message: res_error });
|
|
1523
2064
|
}
|
|
1524
2065
|
|
|
1525
2066
|
return response;
|
|
1526
2067
|
}
|
|
1527
2068
|
|
|
1528
2069
|
/**
|
|
1529
|
-
* @param {
|
|
1530
|
-
*
|
|
1531
|
-
*
|
|
1532
|
-
* @param {
|
|
1533
|
-
* @returns {Promise<SmsProviders>} - Success response
|
|
2070
|
+
* @param {CommunicationPlatformApplicationValidator.GetSmsProvidersParam} arg
|
|
2071
|
+
* - Arg object
|
|
2072
|
+
*
|
|
2073
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
2074
|
+
* @returns {Promise<CommunicationPlatformModel.SmsProviders>} - Success response
|
|
2075
|
+
* @name getSmsProviders
|
|
1534
2076
|
* @summary: Get sms providers
|
|
1535
|
-
* @description: Get sms providers
|
|
2077
|
+
* @description: Get sms providers - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/communication/getSmsProviders/).
|
|
1536
2078
|
*/
|
|
1537
|
-
async getSmsProviders(
|
|
1538
|
-
|
|
2079
|
+
async getSmsProviders(
|
|
2080
|
+
{ pageNo, pageSize, sort } = {},
|
|
2081
|
+
{ headers } = { headers: false }
|
|
2082
|
+
) {
|
|
2083
|
+
const {
|
|
2084
|
+
error,
|
|
2085
|
+
} = CommunicationPlatformApplicationValidator.getSmsProviders().validate(
|
|
1539
2086
|
{
|
|
1540
2087
|
pageNo,
|
|
1541
2088
|
pageSize,
|
|
@@ -1550,7 +2097,7 @@ class Communication {
|
|
|
1550
2097
|
// Showing warrnings if extra unknown parameters are found
|
|
1551
2098
|
const {
|
|
1552
2099
|
error: warrning,
|
|
1553
|
-
} =
|
|
2100
|
+
} = CommunicationPlatformApplicationValidator.getSmsProviders().validate(
|
|
1554
2101
|
{
|
|
1555
2102
|
pageNo,
|
|
1556
2103
|
pageSize,
|
|
@@ -1561,9 +2108,8 @@ class Communication {
|
|
|
1561
2108
|
if (warrning) {
|
|
1562
2109
|
Logger({
|
|
1563
2110
|
level: "WARN",
|
|
1564
|
-
message:
|
|
2111
|
+
message: `Parameter Validation warrnings for platform > Communication > getSmsProviders \n ${warrning}`,
|
|
1565
2112
|
});
|
|
1566
|
-
Logger({ level: "WARN", message: warrning });
|
|
1567
2113
|
}
|
|
1568
2114
|
|
|
1569
2115
|
const query_params = {};
|
|
@@ -1576,12 +2122,19 @@ class Communication {
|
|
|
1576
2122
|
"get",
|
|
1577
2123
|
`/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/sms/providers`,
|
|
1578
2124
|
query_params,
|
|
1579
|
-
undefined
|
|
2125
|
+
undefined,
|
|
2126
|
+
undefined,
|
|
2127
|
+
{ headers }
|
|
1580
2128
|
);
|
|
1581
2129
|
|
|
2130
|
+
let responseData = response;
|
|
2131
|
+
if (headers) {
|
|
2132
|
+
responseData = response[0];
|
|
2133
|
+
}
|
|
2134
|
+
|
|
1582
2135
|
const {
|
|
1583
2136
|
error: res_error,
|
|
1584
|
-
} =
|
|
2137
|
+
} = CommunicationPlatformModel.SmsProviders().validate(responseData, {
|
|
1585
2138
|
abortEarly: false,
|
|
1586
2139
|
allowUnknown: false,
|
|
1587
2140
|
});
|
|
@@ -1589,9 +2142,8 @@ class Communication {
|
|
|
1589
2142
|
if (res_error) {
|
|
1590
2143
|
Logger({
|
|
1591
2144
|
level: "WARN",
|
|
1592
|
-
message:
|
|
2145
|
+
message: `Response Validation Warnnings for platform > Communication > getSmsProviders \n ${res_error}`,
|
|
1593
2146
|
});
|
|
1594
|
-
Logger({ level: "WARN", message: res_error });
|
|
1595
2147
|
}
|
|
1596
2148
|
|
|
1597
2149
|
return response;
|
|
@@ -1599,13 +2151,51 @@ class Communication {
|
|
|
1599
2151
|
|
|
1600
2152
|
/**
|
|
1601
2153
|
* @param {Object} arg - Arg object.
|
|
1602
|
-
* @param {string} arg.
|
|
1603
|
-
* @
|
|
2154
|
+
* @param {string} arg.companyId - Company id
|
|
2155
|
+
* @param {string} arg.applicationId - Application id
|
|
2156
|
+
* @param {number} [arg.pageSize] - Current request items count
|
|
2157
|
+
* @param {Object} [arg.sort] - To sort based on created_at
|
|
2158
|
+
* @returns {Paginator<CommunicationPlatformModel.SmsProviders>}
|
|
2159
|
+
* @summary: Get sms providers
|
|
2160
|
+
* @description: Get sms providers
|
|
2161
|
+
*/
|
|
2162
|
+
getSmsProvidersPaginator({ companyId, applicationId, pageSize, sort } = {}) {
|
|
2163
|
+
const paginator = new Paginator();
|
|
2164
|
+
const callback = async () => {
|
|
2165
|
+
const pageId = paginator.nextId;
|
|
2166
|
+
const pageNo = paginator.pageNo;
|
|
2167
|
+
const pageType = "number";
|
|
2168
|
+
const data = await this.getSmsProviders({
|
|
2169
|
+
companyId: companyId,
|
|
2170
|
+
applicationId: applicationId,
|
|
2171
|
+
pageNo: pageNo,
|
|
2172
|
+
pageSize: pageSize,
|
|
2173
|
+
sort: sort,
|
|
2174
|
+
});
|
|
2175
|
+
paginator.setPaginator({
|
|
2176
|
+
hasNext: data.page.has_next ? true : false,
|
|
2177
|
+
nextId: data.page.next_id,
|
|
2178
|
+
});
|
|
2179
|
+
return data;
|
|
2180
|
+
};
|
|
2181
|
+
paginator.setCallback(callback.bind(this));
|
|
2182
|
+
return paginator;
|
|
2183
|
+
}
|
|
2184
|
+
|
|
2185
|
+
/**
|
|
2186
|
+
* @param {CommunicationPlatformApplicationValidator.GetSmsTemplateByIdParam} arg
|
|
2187
|
+
* - Arg object
|
|
2188
|
+
*
|
|
2189
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
2190
|
+
* @returns {Promise<CommunicationPlatformModel.SmsTemplate>} - Success response
|
|
2191
|
+
* @name getSmsTemplateById
|
|
1604
2192
|
* @summary: Get sms template by id
|
|
1605
|
-
* @description: Get sms template by id
|
|
2193
|
+
* @description: Get sms template by id - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/communication/getSmsTemplateById/).
|
|
1606
2194
|
*/
|
|
1607
|
-
async getSmsTemplateById({ id } = {}) {
|
|
1608
|
-
const {
|
|
2195
|
+
async getSmsTemplateById({ id } = {}, { headers } = { headers: false }) {
|
|
2196
|
+
const {
|
|
2197
|
+
error,
|
|
2198
|
+
} = CommunicationPlatformApplicationValidator.getSmsTemplateById().validate(
|
|
1609
2199
|
{
|
|
1610
2200
|
id,
|
|
1611
2201
|
},
|
|
@@ -1618,7 +2208,7 @@ class Communication {
|
|
|
1618
2208
|
// Showing warrnings if extra unknown parameters are found
|
|
1619
2209
|
const {
|
|
1620
2210
|
error: warrning,
|
|
1621
|
-
} =
|
|
2211
|
+
} = CommunicationPlatformApplicationValidator.getSmsTemplateById().validate(
|
|
1622
2212
|
{
|
|
1623
2213
|
id,
|
|
1624
2214
|
},
|
|
@@ -1627,9 +2217,8 @@ class Communication {
|
|
|
1627
2217
|
if (warrning) {
|
|
1628
2218
|
Logger({
|
|
1629
2219
|
level: "WARN",
|
|
1630
|
-
message:
|
|
2220
|
+
message: `Parameter Validation warrnings for platform > Communication > getSmsTemplateById \n ${warrning}`,
|
|
1631
2221
|
});
|
|
1632
|
-
Logger({ level: "WARN", message: warrning });
|
|
1633
2222
|
}
|
|
1634
2223
|
|
|
1635
2224
|
const query_params = {};
|
|
@@ -1639,12 +2228,19 @@ class Communication {
|
|
|
1639
2228
|
"get",
|
|
1640
2229
|
`/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/sms/templates/${id}`,
|
|
1641
2230
|
query_params,
|
|
1642
|
-
undefined
|
|
2231
|
+
undefined,
|
|
2232
|
+
undefined,
|
|
2233
|
+
{ headers }
|
|
1643
2234
|
);
|
|
1644
2235
|
|
|
2236
|
+
let responseData = response;
|
|
2237
|
+
if (headers) {
|
|
2238
|
+
responseData = response[0];
|
|
2239
|
+
}
|
|
2240
|
+
|
|
1645
2241
|
const {
|
|
1646
2242
|
error: res_error,
|
|
1647
|
-
} =
|
|
2243
|
+
} = CommunicationPlatformModel.SmsTemplate().validate(responseData, {
|
|
1648
2244
|
abortEarly: false,
|
|
1649
2245
|
allowUnknown: false,
|
|
1650
2246
|
});
|
|
@@ -1652,25 +2248,30 @@ class Communication {
|
|
|
1652
2248
|
if (res_error) {
|
|
1653
2249
|
Logger({
|
|
1654
2250
|
level: "WARN",
|
|
1655
|
-
message:
|
|
2251
|
+
message: `Response Validation Warnnings for platform > Communication > getSmsTemplateById \n ${res_error}`,
|
|
1656
2252
|
});
|
|
1657
|
-
Logger({ level: "WARN", message: res_error });
|
|
1658
2253
|
}
|
|
1659
2254
|
|
|
1660
2255
|
return response;
|
|
1661
2256
|
}
|
|
1662
2257
|
|
|
1663
2258
|
/**
|
|
1664
|
-
* @param {
|
|
1665
|
-
*
|
|
1666
|
-
*
|
|
1667
|
-
* @param {
|
|
1668
|
-
* @returns {Promise<SmsTemplates>} - Success response
|
|
2259
|
+
* @param {CommunicationPlatformApplicationValidator.GetSmsTemplatesParam} arg
|
|
2260
|
+
* - Arg object
|
|
2261
|
+
*
|
|
2262
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
2263
|
+
* @returns {Promise<CommunicationPlatformModel.SmsTemplates>} - Success response
|
|
2264
|
+
* @name getSmsTemplates
|
|
1669
2265
|
* @summary: Get sms templates
|
|
1670
|
-
* @description: Get sms templates
|
|
2266
|
+
* @description: Get sms templates - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/communication/getSmsTemplates/).
|
|
1671
2267
|
*/
|
|
1672
|
-
async getSmsTemplates(
|
|
1673
|
-
|
|
2268
|
+
async getSmsTemplates(
|
|
2269
|
+
{ pageNo, pageSize, sort } = {},
|
|
2270
|
+
{ headers } = { headers: false }
|
|
2271
|
+
) {
|
|
2272
|
+
const {
|
|
2273
|
+
error,
|
|
2274
|
+
} = CommunicationPlatformApplicationValidator.getSmsTemplates().validate(
|
|
1674
2275
|
{
|
|
1675
2276
|
pageNo,
|
|
1676
2277
|
pageSize,
|
|
@@ -1685,7 +2286,7 @@ class Communication {
|
|
|
1685
2286
|
// Showing warrnings if extra unknown parameters are found
|
|
1686
2287
|
const {
|
|
1687
2288
|
error: warrning,
|
|
1688
|
-
} =
|
|
2289
|
+
} = CommunicationPlatformApplicationValidator.getSmsTemplates().validate(
|
|
1689
2290
|
{
|
|
1690
2291
|
pageNo,
|
|
1691
2292
|
pageSize,
|
|
@@ -1696,9 +2297,8 @@ class Communication {
|
|
|
1696
2297
|
if (warrning) {
|
|
1697
2298
|
Logger({
|
|
1698
2299
|
level: "WARN",
|
|
1699
|
-
message:
|
|
2300
|
+
message: `Parameter Validation warrnings for platform > Communication > getSmsTemplates \n ${warrning}`,
|
|
1700
2301
|
});
|
|
1701
|
-
Logger({ level: "WARN", message: warrning });
|
|
1702
2302
|
}
|
|
1703
2303
|
|
|
1704
2304
|
const query_params = {};
|
|
@@ -1711,12 +2311,19 @@ class Communication {
|
|
|
1711
2311
|
"get",
|
|
1712
2312
|
`/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/sms/templates`,
|
|
1713
2313
|
query_params,
|
|
1714
|
-
undefined
|
|
2314
|
+
undefined,
|
|
2315
|
+
undefined,
|
|
2316
|
+
{ headers }
|
|
1715
2317
|
);
|
|
1716
2318
|
|
|
2319
|
+
let responseData = response;
|
|
2320
|
+
if (headers) {
|
|
2321
|
+
responseData = response[0];
|
|
2322
|
+
}
|
|
2323
|
+
|
|
1717
2324
|
const {
|
|
1718
2325
|
error: res_error,
|
|
1719
|
-
} =
|
|
2326
|
+
} = CommunicationPlatformModel.SmsTemplates().validate(responseData, {
|
|
1720
2327
|
abortEarly: false,
|
|
1721
2328
|
allowUnknown: false,
|
|
1722
2329
|
});
|
|
@@ -1724,9 +2331,8 @@ class Communication {
|
|
|
1724
2331
|
if (res_error) {
|
|
1725
2332
|
Logger({
|
|
1726
2333
|
level: "WARN",
|
|
1727
|
-
message:
|
|
2334
|
+
message: `Response Validation Warnnings for platform > Communication > getSmsTemplates \n ${res_error}`,
|
|
1728
2335
|
});
|
|
1729
|
-
Logger({ level: "WARN", message: res_error });
|
|
1730
2336
|
}
|
|
1731
2337
|
|
|
1732
2338
|
return response;
|
|
@@ -1734,13 +2340,51 @@ class Communication {
|
|
|
1734
2340
|
|
|
1735
2341
|
/**
|
|
1736
2342
|
* @param {Object} arg - Arg object.
|
|
1737
|
-
* @param {string} arg.
|
|
1738
|
-
* @
|
|
2343
|
+
* @param {string} arg.companyId - Company id
|
|
2344
|
+
* @param {string} arg.applicationId - Application id
|
|
2345
|
+
* @param {number} [arg.pageSize] - Current request items count
|
|
2346
|
+
* @param {Object} [arg.sort] - To sort based on created_at
|
|
2347
|
+
* @returns {Paginator<CommunicationPlatformModel.SmsTemplates>}
|
|
2348
|
+
* @summary: Get sms templates
|
|
2349
|
+
* @description: Get sms templates
|
|
2350
|
+
*/
|
|
2351
|
+
getSmsTemplatesPaginator({ companyId, applicationId, pageSize, sort } = {}) {
|
|
2352
|
+
const paginator = new Paginator();
|
|
2353
|
+
const callback = async () => {
|
|
2354
|
+
const pageId = paginator.nextId;
|
|
2355
|
+
const pageNo = paginator.pageNo;
|
|
2356
|
+
const pageType = "number";
|
|
2357
|
+
const data = await this.getSmsTemplates({
|
|
2358
|
+
companyId: companyId,
|
|
2359
|
+
applicationId: applicationId,
|
|
2360
|
+
pageNo: pageNo,
|
|
2361
|
+
pageSize: pageSize,
|
|
2362
|
+
sort: sort,
|
|
2363
|
+
});
|
|
2364
|
+
paginator.setPaginator({
|
|
2365
|
+
hasNext: data.page.has_next ? true : false,
|
|
2366
|
+
nextId: data.page.next_id,
|
|
2367
|
+
});
|
|
2368
|
+
return data;
|
|
2369
|
+
};
|
|
2370
|
+
paginator.setCallback(callback.bind(this));
|
|
2371
|
+
return paginator;
|
|
2372
|
+
}
|
|
2373
|
+
|
|
2374
|
+
/**
|
|
2375
|
+
* @param {CommunicationPlatformApplicationValidator.GetStatsOfCampaignByIdParam} arg
|
|
2376
|
+
* - Arg object
|
|
2377
|
+
*
|
|
2378
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
2379
|
+
* @returns {Promise<CommunicationPlatformModel.GetStats>} - Success response
|
|
2380
|
+
* @name getStatsOfCampaignById
|
|
1739
2381
|
* @summary: Get stats of campaign by id
|
|
1740
|
-
* @description: Get stats of campaign by id
|
|
2382
|
+
* @description: Get stats of campaign by id - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/communication/getStatsOfCampaignById/).
|
|
1741
2383
|
*/
|
|
1742
|
-
async getStatsOfCampaignById({ id } = {}) {
|
|
1743
|
-
const {
|
|
2384
|
+
async getStatsOfCampaignById({ id } = {}, { headers } = { headers: false }) {
|
|
2385
|
+
const {
|
|
2386
|
+
error,
|
|
2387
|
+
} = CommunicationPlatformApplicationValidator.getStatsOfCampaignById().validate(
|
|
1744
2388
|
{
|
|
1745
2389
|
id,
|
|
1746
2390
|
},
|
|
@@ -1753,7 +2397,7 @@ class Communication {
|
|
|
1753
2397
|
// Showing warrnings if extra unknown parameters are found
|
|
1754
2398
|
const {
|
|
1755
2399
|
error: warrning,
|
|
1756
|
-
} =
|
|
2400
|
+
} = CommunicationPlatformApplicationValidator.getStatsOfCampaignById().validate(
|
|
1757
2401
|
{
|
|
1758
2402
|
id,
|
|
1759
2403
|
},
|
|
@@ -1762,9 +2406,8 @@ class Communication {
|
|
|
1762
2406
|
if (warrning) {
|
|
1763
2407
|
Logger({
|
|
1764
2408
|
level: "WARN",
|
|
1765
|
-
message:
|
|
2409
|
+
message: `Parameter Validation warrnings for platform > Communication > getStatsOfCampaignById \n ${warrning}`,
|
|
1766
2410
|
});
|
|
1767
|
-
Logger({ level: "WARN", message: warrning });
|
|
1768
2411
|
}
|
|
1769
2412
|
|
|
1770
2413
|
const query_params = {};
|
|
@@ -1774,12 +2417,19 @@ class Communication {
|
|
|
1774
2417
|
"get",
|
|
1775
2418
|
`/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/campaigns/get-stats/${id}`,
|
|
1776
2419
|
query_params,
|
|
1777
|
-
undefined
|
|
2420
|
+
undefined,
|
|
2421
|
+
undefined,
|
|
2422
|
+
{ headers }
|
|
1778
2423
|
);
|
|
1779
2424
|
|
|
2425
|
+
let responseData = response;
|
|
2426
|
+
if (headers) {
|
|
2427
|
+
responseData = response[0];
|
|
2428
|
+
}
|
|
2429
|
+
|
|
1780
2430
|
const {
|
|
1781
2431
|
error: res_error,
|
|
1782
|
-
} =
|
|
2432
|
+
} = CommunicationPlatformModel.GetStats().validate(responseData, {
|
|
1783
2433
|
abortEarly: false,
|
|
1784
2434
|
allowUnknown: false,
|
|
1785
2435
|
});
|
|
@@ -1787,25 +2437,31 @@ class Communication {
|
|
|
1787
2437
|
if (res_error) {
|
|
1788
2438
|
Logger({
|
|
1789
2439
|
level: "WARN",
|
|
1790
|
-
message:
|
|
2440
|
+
message: `Response Validation Warnnings for platform > Communication > getStatsOfCampaignById \n ${res_error}`,
|
|
1791
2441
|
});
|
|
1792
|
-
Logger({ level: "WARN", message: res_error });
|
|
1793
2442
|
}
|
|
1794
2443
|
|
|
1795
2444
|
return response;
|
|
1796
2445
|
}
|
|
1797
2446
|
|
|
1798
2447
|
/**
|
|
1799
|
-
* @param {
|
|
1800
|
-
*
|
|
1801
|
-
*
|
|
1802
|
-
* @param {
|
|
1803
|
-
* @returns {Promise<SystemEmailTemplates>} -
|
|
2448
|
+
* @param {CommunicationPlatformApplicationValidator.GetSystemEmailTemplatesParam} arg
|
|
2449
|
+
* - Arg object
|
|
2450
|
+
*
|
|
2451
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
2452
|
+
* @returns {Promise<CommunicationPlatformModel.SystemEmailTemplates>} -
|
|
2453
|
+
* Success response
|
|
2454
|
+
* @name getSystemEmailTemplates
|
|
1804
2455
|
* @summary: Get system email templates
|
|
1805
|
-
* @description: Get system email templates
|
|
2456
|
+
* @description: Get system email templates - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/communication/getSystemEmailTemplates/).
|
|
1806
2457
|
*/
|
|
1807
|
-
async getSystemEmailTemplates(
|
|
1808
|
-
|
|
2458
|
+
async getSystemEmailTemplates(
|
|
2459
|
+
{ pageNo, pageSize, sort } = {},
|
|
2460
|
+
{ headers } = { headers: false }
|
|
2461
|
+
) {
|
|
2462
|
+
const {
|
|
2463
|
+
error,
|
|
2464
|
+
} = CommunicationPlatformApplicationValidator.getSystemEmailTemplates().validate(
|
|
1809
2465
|
{
|
|
1810
2466
|
pageNo,
|
|
1811
2467
|
pageSize,
|
|
@@ -1820,7 +2476,7 @@ class Communication {
|
|
|
1820
2476
|
// Showing warrnings if extra unknown parameters are found
|
|
1821
2477
|
const {
|
|
1822
2478
|
error: warrning,
|
|
1823
|
-
} =
|
|
2479
|
+
} = CommunicationPlatformApplicationValidator.getSystemEmailTemplates().validate(
|
|
1824
2480
|
{
|
|
1825
2481
|
pageNo,
|
|
1826
2482
|
pageSize,
|
|
@@ -1831,9 +2487,8 @@ class Communication {
|
|
|
1831
2487
|
if (warrning) {
|
|
1832
2488
|
Logger({
|
|
1833
2489
|
level: "WARN",
|
|
1834
|
-
message:
|
|
2490
|
+
message: `Parameter Validation warrnings for platform > Communication > getSystemEmailTemplates \n ${warrning}`,
|
|
1835
2491
|
});
|
|
1836
|
-
Logger({ level: "WARN", message: warrning });
|
|
1837
2492
|
}
|
|
1838
2493
|
|
|
1839
2494
|
const query_params = {};
|
|
@@ -1846,22 +2501,28 @@ class Communication {
|
|
|
1846
2501
|
"get",
|
|
1847
2502
|
`/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/email/system-templates`,
|
|
1848
2503
|
query_params,
|
|
1849
|
-
undefined
|
|
2504
|
+
undefined,
|
|
2505
|
+
undefined,
|
|
2506
|
+
{ headers }
|
|
1850
2507
|
);
|
|
1851
2508
|
|
|
2509
|
+
let responseData = response;
|
|
2510
|
+
if (headers) {
|
|
2511
|
+
responseData = response[0];
|
|
2512
|
+
}
|
|
2513
|
+
|
|
1852
2514
|
const {
|
|
1853
2515
|
error: res_error,
|
|
1854
|
-
} =
|
|
1855
|
-
|
|
1856
|
-
allowUnknown: false
|
|
1857
|
-
|
|
2516
|
+
} = CommunicationPlatformModel.SystemEmailTemplates().validate(
|
|
2517
|
+
responseData,
|
|
2518
|
+
{ abortEarly: false, allowUnknown: false }
|
|
2519
|
+
);
|
|
1858
2520
|
|
|
1859
2521
|
if (res_error) {
|
|
1860
2522
|
Logger({
|
|
1861
2523
|
level: "WARN",
|
|
1862
|
-
message:
|
|
2524
|
+
message: `Response Validation Warnnings for platform > Communication > getSystemEmailTemplates \n ${res_error}`,
|
|
1863
2525
|
});
|
|
1864
|
-
Logger({ level: "WARN", message: res_error });
|
|
1865
2526
|
}
|
|
1866
2527
|
|
|
1867
2528
|
return response;
|
|
@@ -1869,17 +2530,60 @@ class Communication {
|
|
|
1869
2530
|
|
|
1870
2531
|
/**
|
|
1871
2532
|
* @param {Object} arg - Arg object.
|
|
1872
|
-
* @param {
|
|
2533
|
+
* @param {string} arg.companyId - Company id
|
|
2534
|
+
* @param {string} arg.applicationId - Application id
|
|
1873
2535
|
* @param {number} [arg.pageSize] - Current request items count
|
|
1874
2536
|
* @param {Object} [arg.sort] - To sort based on created_at
|
|
1875
|
-
* @returns {
|
|
2537
|
+
* @returns {Paginator<CommunicationPlatformModel.SystemEmailTemplates>}
|
|
2538
|
+
* @summary: Get system email templates
|
|
2539
|
+
* @description: Get system email templates
|
|
2540
|
+
*/
|
|
2541
|
+
getSystemEmailTemplatesPaginator({
|
|
2542
|
+
companyId,
|
|
2543
|
+
applicationId,
|
|
2544
|
+
pageSize,
|
|
2545
|
+
sort,
|
|
2546
|
+
} = {}) {
|
|
2547
|
+
const paginator = new Paginator();
|
|
2548
|
+
const callback = async () => {
|
|
2549
|
+
const pageId = paginator.nextId;
|
|
2550
|
+
const pageNo = paginator.pageNo;
|
|
2551
|
+
const pageType = "number";
|
|
2552
|
+
const data = await this.getSystemEmailTemplates({
|
|
2553
|
+
companyId: companyId,
|
|
2554
|
+
applicationId: applicationId,
|
|
2555
|
+
pageNo: pageNo,
|
|
2556
|
+
pageSize: pageSize,
|
|
2557
|
+
sort: sort,
|
|
2558
|
+
});
|
|
2559
|
+
paginator.setPaginator({
|
|
2560
|
+
hasNext: data.page.has_next ? true : false,
|
|
2561
|
+
nextId: data.page.next_id,
|
|
2562
|
+
});
|
|
2563
|
+
return data;
|
|
2564
|
+
};
|
|
2565
|
+
paginator.setCallback(callback.bind(this));
|
|
2566
|
+
return paginator;
|
|
2567
|
+
}
|
|
2568
|
+
|
|
2569
|
+
/**
|
|
2570
|
+
* @param {CommunicationPlatformApplicationValidator.GetSystemSystemTemplatesParam} arg
|
|
2571
|
+
* - Arg object
|
|
2572
|
+
*
|
|
2573
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
2574
|
+
* @returns {Promise<CommunicationPlatformModel.SystemSmsTemplates>} -
|
|
2575
|
+
* Success response
|
|
2576
|
+
* @name getSystemSystemTemplates
|
|
1876
2577
|
* @summary: Get system sms templates
|
|
1877
|
-
* @description: Get system sms templates
|
|
2578
|
+
* @description: Get system sms templates - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/communication/getSystemSystemTemplates/).
|
|
1878
2579
|
*/
|
|
1879
|
-
async getSystemSystemTemplates(
|
|
2580
|
+
async getSystemSystemTemplates(
|
|
2581
|
+
{ pageNo, pageSize, sort } = {},
|
|
2582
|
+
{ headers } = { headers: false }
|
|
2583
|
+
) {
|
|
1880
2584
|
const {
|
|
1881
2585
|
error,
|
|
1882
|
-
} =
|
|
2586
|
+
} = CommunicationPlatformApplicationValidator.getSystemSystemTemplates().validate(
|
|
1883
2587
|
{
|
|
1884
2588
|
pageNo,
|
|
1885
2589
|
pageSize,
|
|
@@ -1894,7 +2598,7 @@ class Communication {
|
|
|
1894
2598
|
// Showing warrnings if extra unknown parameters are found
|
|
1895
2599
|
const {
|
|
1896
2600
|
error: warrning,
|
|
1897
|
-
} =
|
|
2601
|
+
} = CommunicationPlatformApplicationValidator.getSystemSystemTemplates().validate(
|
|
1898
2602
|
{
|
|
1899
2603
|
pageNo,
|
|
1900
2604
|
pageSize,
|
|
@@ -1905,9 +2609,8 @@ class Communication {
|
|
|
1905
2609
|
if (warrning) {
|
|
1906
2610
|
Logger({
|
|
1907
2611
|
level: "WARN",
|
|
1908
|
-
message:
|
|
2612
|
+
message: `Parameter Validation warrnings for platform > Communication > getSystemSystemTemplates \n ${warrning}`,
|
|
1909
2613
|
});
|
|
1910
|
-
Logger({ level: "WARN", message: warrning });
|
|
1911
2614
|
}
|
|
1912
2615
|
|
|
1913
2616
|
const query_params = {};
|
|
@@ -1920,12 +2623,19 @@ class Communication {
|
|
|
1920
2623
|
"get",
|
|
1921
2624
|
`/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/sms/system-templates`,
|
|
1922
2625
|
query_params,
|
|
1923
|
-
undefined
|
|
2626
|
+
undefined,
|
|
2627
|
+
undefined,
|
|
2628
|
+
{ headers }
|
|
1924
2629
|
);
|
|
1925
2630
|
|
|
2631
|
+
let responseData = response;
|
|
2632
|
+
if (headers) {
|
|
2633
|
+
responseData = response[0];
|
|
2634
|
+
}
|
|
2635
|
+
|
|
1926
2636
|
const {
|
|
1927
2637
|
error: res_error,
|
|
1928
|
-
} =
|
|
2638
|
+
} = CommunicationPlatformModel.SystemSmsTemplates().validate(responseData, {
|
|
1929
2639
|
abortEarly: false,
|
|
1930
2640
|
allowUnknown: false,
|
|
1931
2641
|
});
|
|
@@ -1933,9 +2643,8 @@ class Communication {
|
|
|
1933
2643
|
if (res_error) {
|
|
1934
2644
|
Logger({
|
|
1935
2645
|
level: "WARN",
|
|
1936
|
-
message:
|
|
2646
|
+
message: `Response Validation Warnnings for platform > Communication > getSystemSystemTemplates \n ${res_error}`,
|
|
1937
2647
|
});
|
|
1938
|
-
Logger({ level: "WARN", message: res_error });
|
|
1939
2648
|
}
|
|
1940
2649
|
|
|
1941
2650
|
return response;
|
|
@@ -1943,15 +2652,59 @@ class Communication {
|
|
|
1943
2652
|
|
|
1944
2653
|
/**
|
|
1945
2654
|
* @param {Object} arg - Arg object.
|
|
1946
|
-
* @param {
|
|
1947
|
-
* @
|
|
2655
|
+
* @param {string} arg.companyId - Company id
|
|
2656
|
+
* @param {string} arg.applicationId - Application id
|
|
2657
|
+
* @param {number} [arg.pageSize] - Current request items count
|
|
2658
|
+
* @param {Object} [arg.sort] - To sort based on created_at
|
|
2659
|
+
* @returns {Paginator<CommunicationPlatformModel.SystemSmsTemplates>}
|
|
2660
|
+
* @summary: Get system sms templates
|
|
2661
|
+
* @description: Get system sms templates
|
|
2662
|
+
*/
|
|
2663
|
+
getSystemSystemTemplatesPaginator({
|
|
2664
|
+
companyId,
|
|
2665
|
+
applicationId,
|
|
2666
|
+
pageSize,
|
|
2667
|
+
sort,
|
|
2668
|
+
} = {}) {
|
|
2669
|
+
const paginator = new Paginator();
|
|
2670
|
+
const callback = async () => {
|
|
2671
|
+
const pageId = paginator.nextId;
|
|
2672
|
+
const pageNo = paginator.pageNo;
|
|
2673
|
+
const pageType = "number";
|
|
2674
|
+
const data = await this.getSystemSystemTemplates({
|
|
2675
|
+
companyId: companyId,
|
|
2676
|
+
applicationId: applicationId,
|
|
2677
|
+
pageNo: pageNo,
|
|
2678
|
+
pageSize: pageSize,
|
|
2679
|
+
sort: sort,
|
|
2680
|
+
});
|
|
2681
|
+
paginator.setPaginator({
|
|
2682
|
+
hasNext: data.page.has_next ? true : false,
|
|
2683
|
+
nextId: data.page.next_id,
|
|
2684
|
+
});
|
|
2685
|
+
return data;
|
|
2686
|
+
};
|
|
2687
|
+
paginator.setCallback(callback.bind(this));
|
|
2688
|
+
return paginator;
|
|
2689
|
+
}
|
|
2690
|
+
|
|
2691
|
+
/**
|
|
2692
|
+
* @param {CommunicationPlatformApplicationValidator.SendCommunicationAsynchronouslyParam} arg
|
|
2693
|
+
* - Arg object
|
|
2694
|
+
*
|
|
2695
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
2696
|
+
* @returns {Promise<CommunicationPlatformModel.EngineResponse>} - Success response
|
|
2697
|
+
* @name sendCommunicationAsynchronously
|
|
1948
2698
|
* @summary: Send email or sms asynchronously
|
|
1949
|
-
* @description: Send email or sms asynchronously
|
|
2699
|
+
* @description: Send email or sms asynchronously - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/communication/sendCommunicationAsynchronously/).
|
|
1950
2700
|
*/
|
|
1951
|
-
async sendCommunicationAsynchronously(
|
|
2701
|
+
async sendCommunicationAsynchronously(
|
|
2702
|
+
{ body } = {},
|
|
2703
|
+
{ headers } = { headers: false }
|
|
2704
|
+
) {
|
|
1952
2705
|
const {
|
|
1953
2706
|
error,
|
|
1954
|
-
} =
|
|
2707
|
+
} = CommunicationPlatformApplicationValidator.sendCommunicationAsynchronously().validate(
|
|
1955
2708
|
{
|
|
1956
2709
|
body,
|
|
1957
2710
|
},
|
|
@@ -1964,7 +2717,7 @@ class Communication {
|
|
|
1964
2717
|
// Showing warrnings if extra unknown parameters are found
|
|
1965
2718
|
const {
|
|
1966
2719
|
error: warrning,
|
|
1967
|
-
} =
|
|
2720
|
+
} = CommunicationPlatformApplicationValidator.sendCommunicationAsynchronously().validate(
|
|
1968
2721
|
{
|
|
1969
2722
|
body,
|
|
1970
2723
|
},
|
|
@@ -1973,10 +2726,8 @@ class Communication {
|
|
|
1973
2726
|
if (warrning) {
|
|
1974
2727
|
Logger({
|
|
1975
2728
|
level: "WARN",
|
|
1976
|
-
message:
|
|
1977
|
-
"Parameter Validation warrnings for sendCommunicationAsynchronously",
|
|
2729
|
+
message: `Parameter Validation warrnings for platform > Communication > sendCommunicationAsynchronously \n ${warrning}`,
|
|
1978
2730
|
});
|
|
1979
|
-
Logger({ level: "WARN", message: warrning });
|
|
1980
2731
|
}
|
|
1981
2732
|
|
|
1982
2733
|
const query_params = {};
|
|
@@ -1986,12 +2737,19 @@ class Communication {
|
|
|
1986
2737
|
"post",
|
|
1987
2738
|
`/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/engine/send-async`,
|
|
1988
2739
|
query_params,
|
|
1989
|
-
body
|
|
2740
|
+
body,
|
|
2741
|
+
undefined,
|
|
2742
|
+
{ headers }
|
|
1990
2743
|
);
|
|
1991
2744
|
|
|
2745
|
+
let responseData = response;
|
|
2746
|
+
if (headers) {
|
|
2747
|
+
responseData = response[0];
|
|
2748
|
+
}
|
|
2749
|
+
|
|
1992
2750
|
const {
|
|
1993
2751
|
error: res_error,
|
|
1994
|
-
} =
|
|
2752
|
+
} = CommunicationPlatformModel.EngineResponse().validate(responseData, {
|
|
1995
2753
|
abortEarly: false,
|
|
1996
2754
|
allowUnknown: false,
|
|
1997
2755
|
});
|
|
@@ -1999,26 +2757,30 @@ class Communication {
|
|
|
1999
2757
|
if (res_error) {
|
|
2000
2758
|
Logger({
|
|
2001
2759
|
level: "WARN",
|
|
2002
|
-
message:
|
|
2003
|
-
"Response Validation Warnnings for sendCommunicationAsynchronously",
|
|
2760
|
+
message: `Response Validation Warnnings for platform > Communication > sendCommunicationAsynchronously \n ${res_error}`,
|
|
2004
2761
|
});
|
|
2005
|
-
Logger({ level: "WARN", message: res_error });
|
|
2006
2762
|
}
|
|
2007
2763
|
|
|
2008
2764
|
return response;
|
|
2009
2765
|
}
|
|
2010
2766
|
|
|
2011
2767
|
/**
|
|
2012
|
-
* @param {
|
|
2013
|
-
*
|
|
2014
|
-
*
|
|
2768
|
+
* @param {CommunicationPlatformApplicationValidator.SendCommunicationSynchronouslyParam} arg
|
|
2769
|
+
* - Arg object
|
|
2770
|
+
*
|
|
2771
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
2772
|
+
* @returns {Promise<CommunicationPlatformModel.EngineResponse>} - Success response
|
|
2773
|
+
* @name sendCommunicationSynchronously
|
|
2015
2774
|
* @summary: Send email or sms synchronously
|
|
2016
|
-
* @description: Send email or sms synchronously
|
|
2775
|
+
* @description: Send email or sms synchronously - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/communication/sendCommunicationSynchronously/).
|
|
2017
2776
|
*/
|
|
2018
|
-
async sendCommunicationSynchronously(
|
|
2777
|
+
async sendCommunicationSynchronously(
|
|
2778
|
+
{ body } = {},
|
|
2779
|
+
{ headers } = { headers: false }
|
|
2780
|
+
) {
|
|
2019
2781
|
const {
|
|
2020
2782
|
error,
|
|
2021
|
-
} =
|
|
2783
|
+
} = CommunicationPlatformApplicationValidator.sendCommunicationSynchronously().validate(
|
|
2022
2784
|
{
|
|
2023
2785
|
body,
|
|
2024
2786
|
},
|
|
@@ -2031,7 +2793,7 @@ class Communication {
|
|
|
2031
2793
|
// Showing warrnings if extra unknown parameters are found
|
|
2032
2794
|
const {
|
|
2033
2795
|
error: warrning,
|
|
2034
|
-
} =
|
|
2796
|
+
} = CommunicationPlatformApplicationValidator.sendCommunicationSynchronously().validate(
|
|
2035
2797
|
{
|
|
2036
2798
|
body,
|
|
2037
2799
|
},
|
|
@@ -2040,10 +2802,8 @@ class Communication {
|
|
|
2040
2802
|
if (warrning) {
|
|
2041
2803
|
Logger({
|
|
2042
2804
|
level: "WARN",
|
|
2043
|
-
message:
|
|
2044
|
-
"Parameter Validation warrnings for sendCommunicationSynchronously",
|
|
2805
|
+
message: `Parameter Validation warrnings for platform > Communication > sendCommunicationSynchronously \n ${warrning}`,
|
|
2045
2806
|
});
|
|
2046
|
-
Logger({ level: "WARN", message: warrning });
|
|
2047
2807
|
}
|
|
2048
2808
|
|
|
2049
2809
|
const query_params = {};
|
|
@@ -2053,12 +2813,19 @@ class Communication {
|
|
|
2053
2813
|
"post",
|
|
2054
2814
|
`/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/engine/send-instant`,
|
|
2055
2815
|
query_params,
|
|
2056
|
-
body
|
|
2816
|
+
body,
|
|
2817
|
+
undefined,
|
|
2818
|
+
{ headers }
|
|
2057
2819
|
);
|
|
2058
2820
|
|
|
2821
|
+
let responseData = response;
|
|
2822
|
+
if (headers) {
|
|
2823
|
+
responseData = response[0];
|
|
2824
|
+
}
|
|
2825
|
+
|
|
2059
2826
|
const {
|
|
2060
2827
|
error: res_error,
|
|
2061
|
-
} =
|
|
2828
|
+
} = CommunicationPlatformModel.EngineResponse().validate(responseData, {
|
|
2062
2829
|
abortEarly: false,
|
|
2063
2830
|
allowUnknown: false,
|
|
2064
2831
|
});
|
|
@@ -2066,24 +2833,25 @@ class Communication {
|
|
|
2066
2833
|
if (res_error) {
|
|
2067
2834
|
Logger({
|
|
2068
2835
|
level: "WARN",
|
|
2069
|
-
message:
|
|
2070
|
-
"Response Validation Warnnings for sendCommunicationSynchronously",
|
|
2836
|
+
message: `Response Validation Warnnings for platform > Communication > sendCommunicationSynchronously \n ${res_error}`,
|
|
2071
2837
|
});
|
|
2072
|
-
Logger({ level: "WARN", message: res_error });
|
|
2073
2838
|
}
|
|
2074
2839
|
|
|
2075
2840
|
return response;
|
|
2076
2841
|
}
|
|
2077
2842
|
|
|
2078
2843
|
/**
|
|
2079
|
-
* @param {
|
|
2080
|
-
* @param {
|
|
2081
|
-
* @returns {Promise<SendOtpCommsRes>} - Success response
|
|
2844
|
+
* @param {CommunicationPlatformApplicationValidator.SendOtpParam} arg - Arg object
|
|
2845
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
2846
|
+
* @returns {Promise<CommunicationPlatformModel.SendOtpCommsRes>} - Success response
|
|
2847
|
+
* @name sendOtp
|
|
2082
2848
|
* @summary: Send OTP using email and sms
|
|
2083
|
-
* @description: Send OTP Comms via email and sms
|
|
2849
|
+
* @description: Send OTP Comms via email and sms - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/communication/sendOtp/).
|
|
2084
2850
|
*/
|
|
2085
|
-
async sendOtp({ body } = {}) {
|
|
2086
|
-
const {
|
|
2851
|
+
async sendOtp({ body } = {}, { headers } = { headers: false }) {
|
|
2852
|
+
const {
|
|
2853
|
+
error,
|
|
2854
|
+
} = CommunicationPlatformApplicationValidator.sendOtp().validate(
|
|
2087
2855
|
{
|
|
2088
2856
|
body,
|
|
2089
2857
|
},
|
|
@@ -2094,7 +2862,9 @@ class Communication {
|
|
|
2094
2862
|
}
|
|
2095
2863
|
|
|
2096
2864
|
// Showing warrnings if extra unknown parameters are found
|
|
2097
|
-
const {
|
|
2865
|
+
const {
|
|
2866
|
+
error: warrning,
|
|
2867
|
+
} = CommunicationPlatformApplicationValidator.sendOtp().validate(
|
|
2098
2868
|
{
|
|
2099
2869
|
body,
|
|
2100
2870
|
},
|
|
@@ -2103,9 +2873,8 @@ class Communication {
|
|
|
2103
2873
|
if (warrning) {
|
|
2104
2874
|
Logger({
|
|
2105
2875
|
level: "WARN",
|
|
2106
|
-
message:
|
|
2876
|
+
message: `Parameter Validation warrnings for platform > Communication > sendOtp \n ${warrning}`,
|
|
2107
2877
|
});
|
|
2108
|
-
Logger({ level: "WARN", message: warrning });
|
|
2109
2878
|
}
|
|
2110
2879
|
|
|
2111
2880
|
const query_params = {};
|
|
@@ -2115,12 +2884,19 @@ class Communication {
|
|
|
2115
2884
|
"post",
|
|
2116
2885
|
`/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/otp/send-otp-comms`,
|
|
2117
2886
|
query_params,
|
|
2118
|
-
body
|
|
2887
|
+
body,
|
|
2888
|
+
undefined,
|
|
2889
|
+
{ headers }
|
|
2119
2890
|
);
|
|
2120
2891
|
|
|
2892
|
+
let responseData = response;
|
|
2893
|
+
if (headers) {
|
|
2894
|
+
responseData = response[0];
|
|
2895
|
+
}
|
|
2896
|
+
|
|
2121
2897
|
const {
|
|
2122
2898
|
error: res_error,
|
|
2123
|
-
} =
|
|
2899
|
+
} = CommunicationPlatformModel.SendOtpCommsRes().validate(responseData, {
|
|
2124
2900
|
abortEarly: false,
|
|
2125
2901
|
allowUnknown: false,
|
|
2126
2902
|
});
|
|
@@ -2128,23 +2904,28 @@ class Communication {
|
|
|
2128
2904
|
if (res_error) {
|
|
2129
2905
|
Logger({
|
|
2130
2906
|
level: "WARN",
|
|
2131
|
-
message:
|
|
2907
|
+
message: `Response Validation Warnnings for platform > Communication > sendOtp \n ${res_error}`,
|
|
2132
2908
|
});
|
|
2133
|
-
Logger({ level: "WARN", message: res_error });
|
|
2134
2909
|
}
|
|
2135
2910
|
|
|
2136
2911
|
return response;
|
|
2137
2912
|
}
|
|
2138
2913
|
|
|
2139
2914
|
/**
|
|
2140
|
-
* @param {
|
|
2141
|
-
*
|
|
2142
|
-
*
|
|
2915
|
+
* @param {CommunicationPlatformApplicationValidator.TriggerCampaignJobParam} arg
|
|
2916
|
+
* - Arg object
|
|
2917
|
+
*
|
|
2918
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
2919
|
+
* @returns {Promise<CommunicationPlatformModel.TriggerJobResponse>} -
|
|
2920
|
+
* Success response
|
|
2921
|
+
* @name triggerCampaignJob
|
|
2143
2922
|
* @summary: Trigger campaign job
|
|
2144
|
-
* @description: Trigger campaign job
|
|
2923
|
+
* @description: Trigger campaign job - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/communication/triggerCampaignJob/).
|
|
2145
2924
|
*/
|
|
2146
|
-
async triggerCampaignJob({ body } = {}) {
|
|
2147
|
-
const {
|
|
2925
|
+
async triggerCampaignJob({ body } = {}, { headers } = { headers: false }) {
|
|
2926
|
+
const {
|
|
2927
|
+
error,
|
|
2928
|
+
} = CommunicationPlatformApplicationValidator.triggerCampaignJob().validate(
|
|
2148
2929
|
{
|
|
2149
2930
|
body,
|
|
2150
2931
|
},
|
|
@@ -2157,7 +2938,7 @@ class Communication {
|
|
|
2157
2938
|
// Showing warrnings if extra unknown parameters are found
|
|
2158
2939
|
const {
|
|
2159
2940
|
error: warrning,
|
|
2160
|
-
} =
|
|
2941
|
+
} = CommunicationPlatformApplicationValidator.triggerCampaignJob().validate(
|
|
2161
2942
|
{
|
|
2162
2943
|
body,
|
|
2163
2944
|
},
|
|
@@ -2166,9 +2947,8 @@ class Communication {
|
|
|
2166
2947
|
if (warrning) {
|
|
2167
2948
|
Logger({
|
|
2168
2949
|
level: "WARN",
|
|
2169
|
-
message:
|
|
2950
|
+
message: `Parameter Validation warrnings for platform > Communication > triggerCampaignJob \n ${warrning}`,
|
|
2170
2951
|
});
|
|
2171
|
-
Logger({ level: "WARN", message: warrning });
|
|
2172
2952
|
}
|
|
2173
2953
|
|
|
2174
2954
|
const query_params = {};
|
|
@@ -2178,12 +2958,19 @@ class Communication {
|
|
|
2178
2958
|
"post",
|
|
2179
2959
|
`/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/jobs/trigger-job`,
|
|
2180
2960
|
query_params,
|
|
2181
|
-
body
|
|
2961
|
+
body,
|
|
2962
|
+
undefined,
|
|
2963
|
+
{ headers }
|
|
2182
2964
|
);
|
|
2183
2965
|
|
|
2966
|
+
let responseData = response;
|
|
2967
|
+
if (headers) {
|
|
2968
|
+
responseData = response[0];
|
|
2969
|
+
}
|
|
2970
|
+
|
|
2184
2971
|
const {
|
|
2185
2972
|
error: res_error,
|
|
2186
|
-
} =
|
|
2973
|
+
} = CommunicationPlatformModel.TriggerJobResponse().validate(responseData, {
|
|
2187
2974
|
abortEarly: false,
|
|
2188
2975
|
allowUnknown: false,
|
|
2189
2976
|
});
|
|
@@ -2191,24 +2978,30 @@ class Communication {
|
|
|
2191
2978
|
if (res_error) {
|
|
2192
2979
|
Logger({
|
|
2193
2980
|
level: "WARN",
|
|
2194
|
-
message:
|
|
2981
|
+
message: `Response Validation Warnnings for platform > Communication > triggerCampaignJob \n ${res_error}`,
|
|
2195
2982
|
});
|
|
2196
|
-
Logger({ level: "WARN", message: res_error });
|
|
2197
2983
|
}
|
|
2198
2984
|
|
|
2199
2985
|
return response;
|
|
2200
2986
|
}
|
|
2201
2987
|
|
|
2202
2988
|
/**
|
|
2203
|
-
* @param {
|
|
2204
|
-
*
|
|
2205
|
-
*
|
|
2206
|
-
* @
|
|
2989
|
+
* @param {CommunicationPlatformApplicationValidator.UpdateAudienceByIdParam} arg
|
|
2990
|
+
* - Arg object
|
|
2991
|
+
*
|
|
2992
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
2993
|
+
* @returns {Promise<CommunicationPlatformModel.Audience>} - Success response
|
|
2994
|
+
* @name updateAudienceById
|
|
2207
2995
|
* @summary: Update audience by id
|
|
2208
|
-
* @description: Update audience by id
|
|
2996
|
+
* @description: Update audience by id - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/communication/updateAudienceById/).
|
|
2209
2997
|
*/
|
|
2210
|
-
async updateAudienceById(
|
|
2211
|
-
|
|
2998
|
+
async updateAudienceById(
|
|
2999
|
+
{ id, body } = {},
|
|
3000
|
+
{ headers } = { headers: false }
|
|
3001
|
+
) {
|
|
3002
|
+
const {
|
|
3003
|
+
error,
|
|
3004
|
+
} = CommunicationPlatformApplicationValidator.updateAudienceById().validate(
|
|
2212
3005
|
{
|
|
2213
3006
|
id,
|
|
2214
3007
|
body,
|
|
@@ -2222,7 +3015,7 @@ class Communication {
|
|
|
2222
3015
|
// Showing warrnings if extra unknown parameters are found
|
|
2223
3016
|
const {
|
|
2224
3017
|
error: warrning,
|
|
2225
|
-
} =
|
|
3018
|
+
} = CommunicationPlatformApplicationValidator.updateAudienceById().validate(
|
|
2226
3019
|
{
|
|
2227
3020
|
id,
|
|
2228
3021
|
body,
|
|
@@ -2232,9 +3025,8 @@ class Communication {
|
|
|
2232
3025
|
if (warrning) {
|
|
2233
3026
|
Logger({
|
|
2234
3027
|
level: "WARN",
|
|
2235
|
-
message:
|
|
3028
|
+
message: `Parameter Validation warrnings for platform > Communication > updateAudienceById \n ${warrning}`,
|
|
2236
3029
|
});
|
|
2237
|
-
Logger({ level: "WARN", message: warrning });
|
|
2238
3030
|
}
|
|
2239
3031
|
|
|
2240
3032
|
const query_params = {};
|
|
@@ -2244,12 +3036,19 @@ class Communication {
|
|
|
2244
3036
|
"put",
|
|
2245
3037
|
`/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/sources/datasources/${id}`,
|
|
2246
3038
|
query_params,
|
|
2247
|
-
body
|
|
3039
|
+
body,
|
|
3040
|
+
undefined,
|
|
3041
|
+
{ headers }
|
|
2248
3042
|
);
|
|
2249
3043
|
|
|
3044
|
+
let responseData = response;
|
|
3045
|
+
if (headers) {
|
|
3046
|
+
responseData = response[0];
|
|
3047
|
+
}
|
|
3048
|
+
|
|
2250
3049
|
const {
|
|
2251
3050
|
error: res_error,
|
|
2252
|
-
} =
|
|
3051
|
+
} = CommunicationPlatformModel.Audience().validate(responseData, {
|
|
2253
3052
|
abortEarly: false,
|
|
2254
3053
|
allowUnknown: false,
|
|
2255
3054
|
});
|
|
@@ -2257,24 +3056,30 @@ class Communication {
|
|
|
2257
3056
|
if (res_error) {
|
|
2258
3057
|
Logger({
|
|
2259
3058
|
level: "WARN",
|
|
2260
|
-
message:
|
|
3059
|
+
message: `Response Validation Warnnings for platform > Communication > updateAudienceById \n ${res_error}`,
|
|
2261
3060
|
});
|
|
2262
|
-
Logger({ level: "WARN", message: res_error });
|
|
2263
3061
|
}
|
|
2264
3062
|
|
|
2265
3063
|
return response;
|
|
2266
3064
|
}
|
|
2267
3065
|
|
|
2268
3066
|
/**
|
|
2269
|
-
* @param {
|
|
2270
|
-
*
|
|
2271
|
-
*
|
|
2272
|
-
* @
|
|
3067
|
+
* @param {CommunicationPlatformApplicationValidator.UpdateCampaignByIdParam} arg
|
|
3068
|
+
* - Arg object
|
|
3069
|
+
*
|
|
3070
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
3071
|
+
* @returns {Promise<CommunicationPlatformModel.Campaign>} - Success response
|
|
3072
|
+
* @name updateCampaignById
|
|
2273
3073
|
* @summary: Update campaign by id
|
|
2274
|
-
* @description: Update campaign by id
|
|
3074
|
+
* @description: Update campaign by id - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/communication/updateCampaignById/).
|
|
2275
3075
|
*/
|
|
2276
|
-
async updateCampaignById(
|
|
2277
|
-
|
|
3076
|
+
async updateCampaignById(
|
|
3077
|
+
{ id, body } = {},
|
|
3078
|
+
{ headers } = { headers: false }
|
|
3079
|
+
) {
|
|
3080
|
+
const {
|
|
3081
|
+
error,
|
|
3082
|
+
} = CommunicationPlatformApplicationValidator.updateCampaignById().validate(
|
|
2278
3083
|
{
|
|
2279
3084
|
id,
|
|
2280
3085
|
body,
|
|
@@ -2288,7 +3093,7 @@ class Communication {
|
|
|
2288
3093
|
// Showing warrnings if extra unknown parameters are found
|
|
2289
3094
|
const {
|
|
2290
3095
|
error: warrning,
|
|
2291
|
-
} =
|
|
3096
|
+
} = CommunicationPlatformApplicationValidator.updateCampaignById().validate(
|
|
2292
3097
|
{
|
|
2293
3098
|
id,
|
|
2294
3099
|
body,
|
|
@@ -2298,9 +3103,8 @@ class Communication {
|
|
|
2298
3103
|
if (warrning) {
|
|
2299
3104
|
Logger({
|
|
2300
3105
|
level: "WARN",
|
|
2301
|
-
message:
|
|
3106
|
+
message: `Parameter Validation warrnings for platform > Communication > updateCampaignById \n ${warrning}`,
|
|
2302
3107
|
});
|
|
2303
|
-
Logger({ level: "WARN", message: warrning });
|
|
2304
3108
|
}
|
|
2305
3109
|
|
|
2306
3110
|
const query_params = {};
|
|
@@ -2310,12 +3114,19 @@ class Communication {
|
|
|
2310
3114
|
"put",
|
|
2311
3115
|
`/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/campaigns/campaigns/${id}`,
|
|
2312
3116
|
query_params,
|
|
2313
|
-
body
|
|
3117
|
+
body,
|
|
3118
|
+
undefined,
|
|
3119
|
+
{ headers }
|
|
2314
3120
|
);
|
|
2315
3121
|
|
|
3122
|
+
let responseData = response;
|
|
3123
|
+
if (headers) {
|
|
3124
|
+
responseData = response[0];
|
|
3125
|
+
}
|
|
3126
|
+
|
|
2316
3127
|
const {
|
|
2317
3128
|
error: res_error,
|
|
2318
|
-
} =
|
|
3129
|
+
} = CommunicationPlatformModel.Campaign().validate(responseData, {
|
|
2319
3130
|
abortEarly: false,
|
|
2320
3131
|
allowUnknown: false,
|
|
2321
3132
|
});
|
|
@@ -2323,24 +3134,30 @@ class Communication {
|
|
|
2323
3134
|
if (res_error) {
|
|
2324
3135
|
Logger({
|
|
2325
3136
|
level: "WARN",
|
|
2326
|
-
message:
|
|
3137
|
+
message: `Response Validation Warnnings for platform > Communication > updateCampaignById \n ${res_error}`,
|
|
2327
3138
|
});
|
|
2328
|
-
Logger({ level: "WARN", message: res_error });
|
|
2329
3139
|
}
|
|
2330
3140
|
|
|
2331
3141
|
return response;
|
|
2332
3142
|
}
|
|
2333
3143
|
|
|
2334
3144
|
/**
|
|
2335
|
-
* @param {
|
|
2336
|
-
*
|
|
2337
|
-
*
|
|
2338
|
-
* @
|
|
3145
|
+
* @param {CommunicationPlatformApplicationValidator.UpdateEmailProviderByIdParam} arg
|
|
3146
|
+
* - Arg object
|
|
3147
|
+
*
|
|
3148
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
3149
|
+
* @returns {Promise<CommunicationPlatformModel.EmailProvider>} - Success response
|
|
3150
|
+
* @name updateEmailProviderById
|
|
2339
3151
|
* @summary: Update email provider by id
|
|
2340
|
-
* @description: Update email provider by id
|
|
3152
|
+
* @description: Update email provider by id - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/communication/updateEmailProviderById/).
|
|
2341
3153
|
*/
|
|
2342
|
-
async updateEmailProviderById(
|
|
2343
|
-
|
|
3154
|
+
async updateEmailProviderById(
|
|
3155
|
+
{ id, body } = {},
|
|
3156
|
+
{ headers } = { headers: false }
|
|
3157
|
+
) {
|
|
3158
|
+
const {
|
|
3159
|
+
error,
|
|
3160
|
+
} = CommunicationPlatformApplicationValidator.updateEmailProviderById().validate(
|
|
2344
3161
|
{
|
|
2345
3162
|
id,
|
|
2346
3163
|
body,
|
|
@@ -2354,7 +3171,7 @@ class Communication {
|
|
|
2354
3171
|
// Showing warrnings if extra unknown parameters are found
|
|
2355
3172
|
const {
|
|
2356
3173
|
error: warrning,
|
|
2357
|
-
} =
|
|
3174
|
+
} = CommunicationPlatformApplicationValidator.updateEmailProviderById().validate(
|
|
2358
3175
|
{
|
|
2359
3176
|
id,
|
|
2360
3177
|
body,
|
|
@@ -2364,9 +3181,8 @@ class Communication {
|
|
|
2364
3181
|
if (warrning) {
|
|
2365
3182
|
Logger({
|
|
2366
3183
|
level: "WARN",
|
|
2367
|
-
message:
|
|
3184
|
+
message: `Parameter Validation warrnings for platform > Communication > updateEmailProviderById \n ${warrning}`,
|
|
2368
3185
|
});
|
|
2369
|
-
Logger({ level: "WARN", message: warrning });
|
|
2370
3186
|
}
|
|
2371
3187
|
|
|
2372
3188
|
const query_params = {};
|
|
@@ -2376,12 +3192,19 @@ class Communication {
|
|
|
2376
3192
|
"put",
|
|
2377
3193
|
`/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/email/providers/${id}`,
|
|
2378
3194
|
query_params,
|
|
2379
|
-
body
|
|
3195
|
+
body,
|
|
3196
|
+
undefined,
|
|
3197
|
+
{ headers }
|
|
2380
3198
|
);
|
|
2381
3199
|
|
|
3200
|
+
let responseData = response;
|
|
3201
|
+
if (headers) {
|
|
3202
|
+
responseData = response[0];
|
|
3203
|
+
}
|
|
3204
|
+
|
|
2382
3205
|
const {
|
|
2383
3206
|
error: res_error,
|
|
2384
|
-
} =
|
|
3207
|
+
} = CommunicationPlatformModel.EmailProvider().validate(responseData, {
|
|
2385
3208
|
abortEarly: false,
|
|
2386
3209
|
allowUnknown: false,
|
|
2387
3210
|
});
|
|
@@ -2389,24 +3212,30 @@ class Communication {
|
|
|
2389
3212
|
if (res_error) {
|
|
2390
3213
|
Logger({
|
|
2391
3214
|
level: "WARN",
|
|
2392
|
-
message:
|
|
3215
|
+
message: `Response Validation Warnnings for platform > Communication > updateEmailProviderById \n ${res_error}`,
|
|
2393
3216
|
});
|
|
2394
|
-
Logger({ level: "WARN", message: res_error });
|
|
2395
3217
|
}
|
|
2396
3218
|
|
|
2397
3219
|
return response;
|
|
2398
3220
|
}
|
|
2399
3221
|
|
|
2400
3222
|
/**
|
|
2401
|
-
* @param {
|
|
2402
|
-
*
|
|
2403
|
-
*
|
|
2404
|
-
* @
|
|
3223
|
+
* @param {CommunicationPlatformApplicationValidator.UpdateEmailTemplateByIdParam} arg
|
|
3224
|
+
* - Arg object
|
|
3225
|
+
*
|
|
3226
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
3227
|
+
* @returns {Promise<CommunicationPlatformModel.EmailTemplateRes>} - Success response
|
|
3228
|
+
* @name updateEmailTemplateById
|
|
2405
3229
|
* @summary: Update email template by id
|
|
2406
|
-
* @description: Update email template by id
|
|
3230
|
+
* @description: Update email template by id - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/communication/updateEmailTemplateById/).
|
|
2407
3231
|
*/
|
|
2408
|
-
async updateEmailTemplateById(
|
|
2409
|
-
|
|
3232
|
+
async updateEmailTemplateById(
|
|
3233
|
+
{ id, body } = {},
|
|
3234
|
+
{ headers } = { headers: false }
|
|
3235
|
+
) {
|
|
3236
|
+
const {
|
|
3237
|
+
error,
|
|
3238
|
+
} = CommunicationPlatformApplicationValidator.updateEmailTemplateById().validate(
|
|
2410
3239
|
{
|
|
2411
3240
|
id,
|
|
2412
3241
|
body,
|
|
@@ -2420,7 +3249,7 @@ class Communication {
|
|
|
2420
3249
|
// Showing warrnings if extra unknown parameters are found
|
|
2421
3250
|
const {
|
|
2422
3251
|
error: warrning,
|
|
2423
|
-
} =
|
|
3252
|
+
} = CommunicationPlatformApplicationValidator.updateEmailTemplateById().validate(
|
|
2424
3253
|
{
|
|
2425
3254
|
id,
|
|
2426
3255
|
body,
|
|
@@ -2430,9 +3259,8 @@ class Communication {
|
|
|
2430
3259
|
if (warrning) {
|
|
2431
3260
|
Logger({
|
|
2432
3261
|
level: "WARN",
|
|
2433
|
-
message:
|
|
3262
|
+
message: `Parameter Validation warrnings for platform > Communication > updateEmailTemplateById \n ${warrning}`,
|
|
2434
3263
|
});
|
|
2435
|
-
Logger({ level: "WARN", message: warrning });
|
|
2436
3264
|
}
|
|
2437
3265
|
|
|
2438
3266
|
const query_params = {};
|
|
@@ -2442,12 +3270,19 @@ class Communication {
|
|
|
2442
3270
|
"put",
|
|
2443
3271
|
`/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/email/templates/${id}`,
|
|
2444
3272
|
query_params,
|
|
2445
|
-
body
|
|
3273
|
+
body,
|
|
3274
|
+
undefined,
|
|
3275
|
+
{ headers }
|
|
2446
3276
|
);
|
|
2447
3277
|
|
|
3278
|
+
let responseData = response;
|
|
3279
|
+
if (headers) {
|
|
3280
|
+
responseData = response[0];
|
|
3281
|
+
}
|
|
3282
|
+
|
|
2448
3283
|
const {
|
|
2449
3284
|
error: res_error,
|
|
2450
|
-
} =
|
|
3285
|
+
} = CommunicationPlatformModel.EmailTemplateRes().validate(responseData, {
|
|
2451
3286
|
abortEarly: false,
|
|
2452
3287
|
allowUnknown: false,
|
|
2453
3288
|
});
|
|
@@ -2455,24 +3290,30 @@ class Communication {
|
|
|
2455
3290
|
if (res_error) {
|
|
2456
3291
|
Logger({
|
|
2457
3292
|
level: "WARN",
|
|
2458
|
-
message:
|
|
3293
|
+
message: `Response Validation Warnnings for platform > Communication > updateEmailTemplateById \n ${res_error}`,
|
|
2459
3294
|
});
|
|
2460
|
-
Logger({ level: "WARN", message: res_error });
|
|
2461
3295
|
}
|
|
2462
3296
|
|
|
2463
3297
|
return response;
|
|
2464
3298
|
}
|
|
2465
3299
|
|
|
2466
3300
|
/**
|
|
2467
|
-
* @param {
|
|
2468
|
-
*
|
|
2469
|
-
*
|
|
2470
|
-
* @
|
|
3301
|
+
* @param {CommunicationPlatformApplicationValidator.UpdateSmsProviderByIdParam} arg
|
|
3302
|
+
* - Arg object
|
|
3303
|
+
*
|
|
3304
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
3305
|
+
* @returns {Promise<CommunicationPlatformModel.SmsProvider>} - Success response
|
|
3306
|
+
* @name updateSmsProviderById
|
|
2471
3307
|
* @summary: Update sms provider by id
|
|
2472
|
-
* @description: Update sms provider by id
|
|
3308
|
+
* @description: Update sms provider by id - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/communication/updateSmsProviderById/).
|
|
2473
3309
|
*/
|
|
2474
|
-
async updateSmsProviderById(
|
|
2475
|
-
|
|
3310
|
+
async updateSmsProviderById(
|
|
3311
|
+
{ id, body } = {},
|
|
3312
|
+
{ headers } = { headers: false }
|
|
3313
|
+
) {
|
|
3314
|
+
const {
|
|
3315
|
+
error,
|
|
3316
|
+
} = CommunicationPlatformApplicationValidator.updateSmsProviderById().validate(
|
|
2476
3317
|
{
|
|
2477
3318
|
id,
|
|
2478
3319
|
body,
|
|
@@ -2486,7 +3327,7 @@ class Communication {
|
|
|
2486
3327
|
// Showing warrnings if extra unknown parameters are found
|
|
2487
3328
|
const {
|
|
2488
3329
|
error: warrning,
|
|
2489
|
-
} =
|
|
3330
|
+
} = CommunicationPlatformApplicationValidator.updateSmsProviderById().validate(
|
|
2490
3331
|
{
|
|
2491
3332
|
id,
|
|
2492
3333
|
body,
|
|
@@ -2496,9 +3337,8 @@ class Communication {
|
|
|
2496
3337
|
if (warrning) {
|
|
2497
3338
|
Logger({
|
|
2498
3339
|
level: "WARN",
|
|
2499
|
-
message:
|
|
3340
|
+
message: `Parameter Validation warrnings for platform > Communication > updateSmsProviderById \n ${warrning}`,
|
|
2500
3341
|
});
|
|
2501
|
-
Logger({ level: "WARN", message: warrning });
|
|
2502
3342
|
}
|
|
2503
3343
|
|
|
2504
3344
|
const query_params = {};
|
|
@@ -2508,12 +3348,19 @@ class Communication {
|
|
|
2508
3348
|
"put",
|
|
2509
3349
|
`/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/sms/providers/${id}`,
|
|
2510
3350
|
query_params,
|
|
2511
|
-
body
|
|
3351
|
+
body,
|
|
3352
|
+
undefined,
|
|
3353
|
+
{ headers }
|
|
2512
3354
|
);
|
|
2513
3355
|
|
|
3356
|
+
let responseData = response;
|
|
3357
|
+
if (headers) {
|
|
3358
|
+
responseData = response[0];
|
|
3359
|
+
}
|
|
3360
|
+
|
|
2514
3361
|
const {
|
|
2515
3362
|
error: res_error,
|
|
2516
|
-
} =
|
|
3363
|
+
} = CommunicationPlatformModel.SmsProvider().validate(responseData, {
|
|
2517
3364
|
abortEarly: false,
|
|
2518
3365
|
allowUnknown: false,
|
|
2519
3366
|
});
|
|
@@ -2521,24 +3368,30 @@ class Communication {
|
|
|
2521
3368
|
if (res_error) {
|
|
2522
3369
|
Logger({
|
|
2523
3370
|
level: "WARN",
|
|
2524
|
-
message:
|
|
3371
|
+
message: `Response Validation Warnnings for platform > Communication > updateSmsProviderById \n ${res_error}`,
|
|
2525
3372
|
});
|
|
2526
|
-
Logger({ level: "WARN", message: res_error });
|
|
2527
3373
|
}
|
|
2528
3374
|
|
|
2529
3375
|
return response;
|
|
2530
3376
|
}
|
|
2531
3377
|
|
|
2532
3378
|
/**
|
|
2533
|
-
* @param {
|
|
2534
|
-
*
|
|
2535
|
-
*
|
|
2536
|
-
* @
|
|
3379
|
+
* @param {CommunicationPlatformApplicationValidator.UpdateSmsTemplateByIdParam} arg
|
|
3380
|
+
* - Arg object
|
|
3381
|
+
*
|
|
3382
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
3383
|
+
* @returns {Promise<CommunicationPlatformModel.SmsTemplateRes>} - Success response
|
|
3384
|
+
* @name updateSmsTemplateById
|
|
2537
3385
|
* @summary: Update sms template by id
|
|
2538
|
-
* @description: Update sms template by id
|
|
3386
|
+
* @description: Update sms template by id - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/communication/updateSmsTemplateById/).
|
|
2539
3387
|
*/
|
|
2540
|
-
async updateSmsTemplateById(
|
|
2541
|
-
|
|
3388
|
+
async updateSmsTemplateById(
|
|
3389
|
+
{ id, body } = {},
|
|
3390
|
+
{ headers } = { headers: false }
|
|
3391
|
+
) {
|
|
3392
|
+
const {
|
|
3393
|
+
error,
|
|
3394
|
+
} = CommunicationPlatformApplicationValidator.updateSmsTemplateById().validate(
|
|
2542
3395
|
{
|
|
2543
3396
|
id,
|
|
2544
3397
|
body,
|
|
@@ -2552,7 +3405,7 @@ class Communication {
|
|
|
2552
3405
|
// Showing warrnings if extra unknown parameters are found
|
|
2553
3406
|
const {
|
|
2554
3407
|
error: warrning,
|
|
2555
|
-
} =
|
|
3408
|
+
} = CommunicationPlatformApplicationValidator.updateSmsTemplateById().validate(
|
|
2556
3409
|
{
|
|
2557
3410
|
id,
|
|
2558
3411
|
body,
|
|
@@ -2562,9 +3415,8 @@ class Communication {
|
|
|
2562
3415
|
if (warrning) {
|
|
2563
3416
|
Logger({
|
|
2564
3417
|
level: "WARN",
|
|
2565
|
-
message:
|
|
3418
|
+
message: `Parameter Validation warrnings for platform > Communication > updateSmsTemplateById \n ${warrning}`,
|
|
2566
3419
|
});
|
|
2567
|
-
Logger({ level: "WARN", message: warrning });
|
|
2568
3420
|
}
|
|
2569
3421
|
|
|
2570
3422
|
const query_params = {};
|
|
@@ -2574,12 +3426,19 @@ class Communication {
|
|
|
2574
3426
|
"put",
|
|
2575
3427
|
`/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/sms/templates/${id}`,
|
|
2576
3428
|
query_params,
|
|
2577
|
-
body
|
|
3429
|
+
body,
|
|
3430
|
+
undefined,
|
|
3431
|
+
{ headers }
|
|
2578
3432
|
);
|
|
2579
3433
|
|
|
3434
|
+
let responseData = response;
|
|
3435
|
+
if (headers) {
|
|
3436
|
+
responseData = response[0];
|
|
3437
|
+
}
|
|
3438
|
+
|
|
2580
3439
|
const {
|
|
2581
3440
|
error: res_error,
|
|
2582
|
-
} =
|
|
3441
|
+
} = CommunicationPlatformModel.SmsTemplateRes().validate(responseData, {
|
|
2583
3442
|
abortEarly: false,
|
|
2584
3443
|
allowUnknown: false,
|
|
2585
3444
|
});
|
|
@@ -2587,23 +3446,27 @@ class Communication {
|
|
|
2587
3446
|
if (res_error) {
|
|
2588
3447
|
Logger({
|
|
2589
3448
|
level: "WARN",
|
|
2590
|
-
message:
|
|
3449
|
+
message: `Response Validation Warnnings for platform > Communication > updateSmsTemplateById \n ${res_error}`,
|
|
2591
3450
|
});
|
|
2592
|
-
Logger({ level: "WARN", message: res_error });
|
|
2593
3451
|
}
|
|
2594
3452
|
|
|
2595
3453
|
return response;
|
|
2596
3454
|
}
|
|
2597
3455
|
|
|
2598
3456
|
/**
|
|
2599
|
-
* @param {
|
|
2600
|
-
* @param {
|
|
2601
|
-
* @returns {Promise<VerifyOtpCommsSuccessRes>}
|
|
3457
|
+
* @param {CommunicationPlatformApplicationValidator.VerfiyOtpParam} arg - Arg object
|
|
3458
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
3459
|
+
* @returns {Promise<CommunicationPlatformModel.VerifyOtpCommsSuccessRes>}
|
|
3460
|
+
* - Success response
|
|
3461
|
+
*
|
|
3462
|
+
* @name verfiyOtp
|
|
2602
3463
|
* @summary: Verify OTP sent via email and sms
|
|
2603
|
-
* @description: Verify OTP sent via email and sms
|
|
3464
|
+
* @description: Verify OTP sent via email and sms - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/communication/verfiyOtp/).
|
|
2604
3465
|
*/
|
|
2605
|
-
async verfiyOtp({ body } = {}) {
|
|
2606
|
-
const {
|
|
3466
|
+
async verfiyOtp({ body } = {}, { headers } = { headers: false }) {
|
|
3467
|
+
const {
|
|
3468
|
+
error,
|
|
3469
|
+
} = CommunicationPlatformApplicationValidator.verfiyOtp().validate(
|
|
2607
3470
|
{
|
|
2608
3471
|
body,
|
|
2609
3472
|
},
|
|
@@ -2614,7 +3477,9 @@ class Communication {
|
|
|
2614
3477
|
}
|
|
2615
3478
|
|
|
2616
3479
|
// Showing warrnings if extra unknown parameters are found
|
|
2617
|
-
const {
|
|
3480
|
+
const {
|
|
3481
|
+
error: warrning,
|
|
3482
|
+
} = CommunicationPlatformApplicationValidator.verfiyOtp().validate(
|
|
2618
3483
|
{
|
|
2619
3484
|
body,
|
|
2620
3485
|
},
|
|
@@ -2623,9 +3488,8 @@ class Communication {
|
|
|
2623
3488
|
if (warrning) {
|
|
2624
3489
|
Logger({
|
|
2625
3490
|
level: "WARN",
|
|
2626
|
-
message:
|
|
3491
|
+
message: `Parameter Validation warrnings for platform > Communication > verfiyOtp \n ${warrning}`,
|
|
2627
3492
|
});
|
|
2628
|
-
Logger({ level: "WARN", message: warrning });
|
|
2629
3493
|
}
|
|
2630
3494
|
|
|
2631
3495
|
const query_params = {};
|
|
@@ -2635,22 +3499,28 @@ class Communication {
|
|
|
2635
3499
|
"post",
|
|
2636
3500
|
`/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/otp/verify-otp-comms`,
|
|
2637
3501
|
query_params,
|
|
2638
|
-
body
|
|
3502
|
+
body,
|
|
3503
|
+
undefined,
|
|
3504
|
+
{ headers }
|
|
2639
3505
|
);
|
|
2640
3506
|
|
|
3507
|
+
let responseData = response;
|
|
3508
|
+
if (headers) {
|
|
3509
|
+
responseData = response[0];
|
|
3510
|
+
}
|
|
3511
|
+
|
|
2641
3512
|
const {
|
|
2642
3513
|
error: res_error,
|
|
2643
|
-
} =
|
|
2644
|
-
|
|
2645
|
-
allowUnknown: false
|
|
2646
|
-
|
|
3514
|
+
} = CommunicationPlatformModel.VerifyOtpCommsSuccessRes().validate(
|
|
3515
|
+
responseData,
|
|
3516
|
+
{ abortEarly: false, allowUnknown: false }
|
|
3517
|
+
);
|
|
2647
3518
|
|
|
2648
3519
|
if (res_error) {
|
|
2649
3520
|
Logger({
|
|
2650
3521
|
level: "WARN",
|
|
2651
|
-
message:
|
|
3522
|
+
message: `Response Validation Warnnings for platform > Communication > verfiyOtp \n ${res_error}`,
|
|
2652
3523
|
});
|
|
2653
|
-
Logger({ level: "WARN", message: res_error });
|
|
2654
3524
|
}
|
|
2655
3525
|
|
|
2656
3526
|
return response;
|