@gofynd/fdk-client-javascript 1.4.1 → 1.4.2-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/package.json +3 -2
- package/sdk/application/ApplicationClient.js +20 -0
- package/sdk/application/Cart/CartApplicationClient.d.ts +1 -1
- package/sdk/application/Cart/CartApplicationClient.js +3 -5
- package/sdk/application/Cart/CartApplicationModel.d.ts +1634 -1742
- package/sdk/application/Cart/CartApplicationModel.js +1388 -1464
- package/sdk/application/Cart/CartApplicationValidator.d.ts +0 -4
- package/sdk/application/Cart/CartApplicationValidator.js +0 -4
- package/sdk/application/Catalog/CatalogApplicationClient.d.ts +6 -3
- package/sdk/application/Catalog/CatalogApplicationClient.js +20 -7
- package/sdk/application/Catalog/CatalogApplicationModel.d.ts +1917 -1917
- package/sdk/application/Catalog/CatalogApplicationModel.js +1613 -1613
- package/sdk/application/Catalog/CatalogApplicationValidator.d.ts +14 -0
- package/sdk/application/Catalog/CatalogApplicationValidator.js +6 -0
- package/sdk/application/Common/CommonApplicationModel.d.ts +235 -235
- package/sdk/application/Common/CommonApplicationModel.js +172 -172
- package/sdk/application/Communication/CommunicationApplicationModel.d.ts +72 -72
- package/sdk/application/Communication/CommunicationApplicationModel.js +64 -64
- package/sdk/application/Configuration/ConfigurationApplicationModel.d.ts +1492 -1626
- package/sdk/application/Configuration/ConfigurationApplicationModel.js +1038 -1180
- package/sdk/application/Content/ContentApplicationClient.d.ts +0 -36
- package/sdk/application/Content/ContentApplicationClient.js +0 -246
- package/sdk/application/Content/ContentApplicationModel.d.ts +546 -753
- package/sdk/application/Content/ContentApplicationModel.js +565 -817
- package/sdk/application/Content/ContentApplicationValidator.d.ts +1 -40
- package/sdk/application/Content/ContentApplicationValidator.js +0 -41
- package/sdk/application/FileStorage/FileStorageApplicationModel.d.ts +79 -79
- package/sdk/application/FileStorage/FileStorageApplicationModel.js +84 -84
- package/sdk/application/Lead/LeadApplicationModel.d.ts +417 -417
- package/sdk/application/Lead/LeadApplicationModel.js +301 -301
- package/sdk/application/Logistic/LogisticApplicationClient.d.ts +0 -67
- package/sdk/application/Logistic/LogisticApplicationClient.js +0 -547
- package/sdk/application/Logistic/LogisticApplicationModel.d.ts +257 -712
- package/sdk/application/Logistic/LogisticApplicationModel.js +267 -755
- package/sdk/application/Logistic/LogisticApplicationValidator.d.ts +1 -211
- package/sdk/application/Logistic/LogisticApplicationValidator.js +0 -131
- package/sdk/application/Order/OrderApplicationClient.d.ts +3 -3
- package/sdk/application/Order/OrderApplicationClient.js +8 -32
- package/sdk/application/Order/OrderApplicationModel.d.ts +845 -853
- package/sdk/application/Order/OrderApplicationModel.js +816 -824
- package/sdk/application/Order/OrderApplicationValidator.d.ts +0 -20
- package/sdk/application/Order/OrderApplicationValidator.js +0 -8
- package/sdk/application/Payment/PaymentApplicationClient.d.ts +2 -46
- package/sdk/application/Payment/PaymentApplicationClient.js +10 -341
- package/sdk/application/Payment/PaymentApplicationModel.d.ts +1892 -2199
- package/sdk/application/Payment/PaymentApplicationModel.js +1235 -1506
- package/sdk/application/Payment/PaymentApplicationValidator.d.ts +14 -59
- package/sdk/application/Payment/PaymentApplicationValidator.js +10 -64
- package/sdk/application/PosCart/PosCartApplicationModel.d.ts +1396 -1429
- package/sdk/application/PosCart/PosCartApplicationModel.js +1233 -1257
- package/sdk/application/Rewards/RewardsApplicationModel.d.ts +214 -214
- package/sdk/application/Rewards/RewardsApplicationModel.js +211 -211
- package/sdk/application/Share/ShareApplicationModel.d.ts +114 -114
- package/sdk/application/Share/ShareApplicationModel.js +121 -121
- package/sdk/application/Theme/ThemeApplicationClient.d.ts +1 -1
- package/sdk/application/Theme/ThemeApplicationClient.js +3 -7
- package/sdk/application/Theme/ThemeApplicationModel.d.ts +783 -969
- package/sdk/application/Theme/ThemeApplicationModel.js +571 -867
- package/sdk/application/Theme/ThemeApplicationValidator.d.ts +0 -10
- package/sdk/application/Theme/ThemeApplicationValidator.js +0 -4
- package/sdk/application/User/UserApplicationClient.d.ts +0 -33
- package/sdk/application/User/UserApplicationClient.js +0 -239
- package/sdk/application/User/UserApplicationModel.d.ts +753 -768
- package/sdk/application/User/UserApplicationModel.js +731 -755
- package/sdk/application/User/UserApplicationValidator.d.ts +1 -34
- package/sdk/application/User/UserApplicationValidator.js +0 -36
- package/sdk/common/Clickstream.d.ts +1 -0
- package/sdk/common/Clickstream.js +254 -0
- package/sdk/common/Utility.js +1 -4
- package/sdk/partner/FileStorage/FileStoragePartnerModel.d.ts +72 -60
- package/sdk/partner/FileStorage/FileStoragePartnerModel.js +70 -58
- package/sdk/partner/PartnerClient.d.ts +0 -6
- package/sdk/partner/PartnerClient.js +0 -9
- package/sdk/partner/Theme/ThemePartnerClient.d.ts +0 -10
- package/sdk/partner/Theme/ThemePartnerClient.js +0 -80
- package/sdk/partner/Theme/ThemePartnerModel.d.ts +1178 -1153
- package/sdk/partner/Theme/ThemePartnerModel.js +830 -974
- package/sdk/partner/Theme/ThemePartnerValidator.d.ts +0 -1
- package/sdk/partner/Theme/ThemePartnerValidator.js +0 -9
- package/sdk/partner/index.d.ts +0 -3
- package/sdk/partner/index.js +0 -6
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +2 -2
- package/sdk/platform/AuditTrail/AuditTrailPlatformModel.d.ts +123 -123
- package/sdk/platform/AuditTrail/AuditTrailPlatformModel.js +109 -109
- package/sdk/platform/Billing/BillingPlatformClient.d.ts +1 -11
- package/sdk/platform/Billing/BillingPlatformClient.js +3 -110
- package/sdk/platform/Billing/BillingPlatformModel.d.ts +734 -800
- package/sdk/platform/Billing/BillingPlatformModel.js +732 -810
- package/sdk/platform/Billing/BillingPlatformValidator.d.ts +4 -43
- package/sdk/platform/Billing/BillingPlatformValidator.js +2 -29
- package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +11 -1
- package/sdk/platform/Cart/CartPlatformApplicationClient.js +81 -7
- package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +13 -5
- package/sdk/platform/Cart/CartPlatformApplicationValidator.js +12 -4
- package/sdk/platform/Cart/CartPlatformModel.d.ts +3223 -3328
- package/sdk/platform/Cart/CartPlatformModel.js +2875 -2946
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +11 -15
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +21 -52
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +0 -27
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +0 -11
- package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +15 -27
- package/sdk/platform/Catalog/CatalogPlatformClient.js +93 -189
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +617 -920
- package/sdk/platform/Catalog/CatalogPlatformModel.js +584 -919
- package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +27 -41
- package/sdk/platform/Catalog/CatalogPlatformValidator.js +19 -31
- package/sdk/platform/Common/CommonPlatformModel.d.ts +255 -255
- package/sdk/platform/Common/CommonPlatformModel.js +187 -187
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +37 -139
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +52 -737
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.d.ts +3 -133
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.js +1 -113
- package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +1079 -1228
- package/sdk/platform/Communication/CommunicationPlatformModel.js +1090 -1262
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +2 -8
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +4 -32
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +629 -658
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +641 -675
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.d.ts +0 -14
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.js +0 -6
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +8 -8
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +4 -4
- package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +2992 -3231
- package/sdk/platform/Configuration/ConfigurationPlatformModel.js +2092 -2303
- package/sdk/platform/Configuration/ConfigurationPlatformValidator.d.ts +2 -2
- package/sdk/platform/Configuration/ConfigurationPlatformValidator.js +2 -2
- package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +0 -391
- package/sdk/platform/Content/ContentPlatformApplicationClient.js +1074 -3656
- package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +1 -351
- package/sdk/platform/Content/ContentPlatformApplicationValidator.js +0 -410
- package/sdk/platform/Content/ContentPlatformModel.d.ts +972 -2071
- package/sdk/platform/Content/ContentPlatformModel.js +1039 -2355
- package/sdk/platform/Discount/DiscountPlatformClient.d.ts +2 -2
- package/sdk/platform/Discount/DiscountPlatformClient.js +2 -2
- package/sdk/platform/Discount/DiscountPlatformModel.d.ts +174 -259
- package/sdk/platform/Discount/DiscountPlatformModel.js +163 -257
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +6 -16
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +8 -117
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.d.ts +4 -55
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.js +2 -39
- package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +821 -892
- package/sdk/platform/FileStorage/FileStoragePlatformModel.js +833 -901
- package/sdk/platform/Finance/FinancePlatformClient.d.ts +0 -33
- package/sdk/platform/Finance/FinancePlatformClient.js +0 -240
- package/sdk/platform/Finance/FinancePlatformModel.d.ts +910 -1056
- package/sdk/platform/Finance/FinancePlatformModel.js +884 -1070
- package/sdk/platform/Finance/FinancePlatformValidator.d.ts +1 -38
- package/sdk/platform/Finance/FinancePlatformValidator.js +0 -38
- package/sdk/platform/Inventory/InventoryPlatformModel.d.ts +942 -942
- package/sdk/platform/Inventory/InventoryPlatformModel.js +1003 -1003
- package/sdk/platform/Lead/LeadPlatformApplicationClient.d.ts +28 -38
- package/sdk/platform/Lead/LeadPlatformApplicationClient.js +56 -137
- package/sdk/platform/Lead/LeadPlatformApplicationValidator.d.ts +29 -41
- package/sdk/platform/Lead/LeadPlatformApplicationValidator.js +21 -33
- package/sdk/platform/Lead/LeadPlatformModel.d.ts +601 -610
- package/sdk/platform/Lead/LeadPlatformModel.js +457 -471
- package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +1 -11
- package/sdk/platform/Order/OrderPlatformApplicationClient.js +1 -93
- package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +1 -28
- package/sdk/platform/Order/OrderPlatformApplicationValidator.js +0 -18
- package/sdk/platform/Order/OrderPlatformClient.d.ts +22 -143
- package/sdk/platform/Order/OrderPlatformClient.js +160 -1190
- package/sdk/platform/Order/OrderPlatformModel.d.ts +4451 -5275
- package/sdk/platform/Order/OrderPlatformModel.js +4039 -4994
- package/sdk/platform/Order/OrderPlatformValidator.d.ts +21 -257
- package/sdk/platform/Order/OrderPlatformValidator.js +15 -216
- package/sdk/platform/Partner/PartnerPlatformModel.d.ts +22 -22
- package/sdk/platform/Partner/PartnerPlatformModel.js +22 -22
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +13 -119
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +40 -750
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +7 -143
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +6 -133
- package/sdk/platform/Payment/PaymentPlatformClient.d.ts +1 -1
- package/sdk/platform/Payment/PaymentPlatformClient.js +1 -1
- package/sdk/platform/Payment/PaymentPlatformModel.d.ts +2067 -2929
- package/sdk/platform/Payment/PaymentPlatformModel.js +1427 -2090
- package/sdk/platform/PlatformApplicationClient.d.ts +2 -2
- package/sdk/platform/PlatformApplicationClient.js +4 -4
- package/sdk/platform/PlatformClient.d.ts +2 -4
- package/sdk/platform/PlatformClient.js +4 -8
- package/sdk/platform/Rewards/RewardsPlatformModel.d.ts +204 -204
- package/sdk/platform/Rewards/RewardsPlatformModel.js +199 -199
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.d.ts +66 -142
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.js +147 -645
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.d.ts +63 -131
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.js +47 -126
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +105 -217
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +349 -1138
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +990 -1589
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +986 -1702
- package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.d.ts +133 -382
- package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.js +102 -266
- package/sdk/platform/Share/SharePlatformModel.d.ts +147 -147
- package/sdk/platform/Share/SharePlatformModel.js +139 -139
- package/sdk/platform/Theme/ThemePlatformClient.d.ts +1 -11
- package/sdk/platform/Theme/ThemePlatformClient.js +3 -87
- package/sdk/platform/Theme/ThemePlatformModel.d.ts +765 -1133
- package/sdk/platform/Theme/ThemePlatformModel.js +561 -1009
- package/sdk/platform/Theme/ThemePlatformValidator.d.ts +4 -28
- package/sdk/platform/Theme/ThemePlatformValidator.js +2 -21
- package/sdk/platform/User/UserPlatformApplicationClient.d.ts +1 -116
- package/sdk/platform/User/UserPlatformApplicationClient.js +86 -932
- package/sdk/platform/User/UserPlatformApplicationValidator.d.ts +7 -224
- package/sdk/platform/User/UserPlatformApplicationValidator.js +5 -173
- package/sdk/platform/User/UserPlatformModel.d.ts +428 -765
- package/sdk/platform/User/UserPlatformModel.js +428 -679
- package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +37 -45
- package/sdk/platform/Webhook/WebhookPlatformClient.js +57 -61
- package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +403 -448
- package/sdk/platform/Webhook/WebhookPlatformModel.js +309 -369
- package/sdk/platform/Webhook/WebhookPlatformValidator.d.ts +10 -7
- package/sdk/platform/Webhook/WebhookPlatformValidator.js +6 -6
- package/sdk/platform/index.d.ts +1 -1
- package/sdk/platform/index.js +2 -2
- package/sdk/public/Configuration/ConfigurationPublicModel.d.ts +237 -237
- package/sdk/public/Configuration/ConfigurationPublicModel.js +174 -174
- package/sdk/public/Inventory/InventoryPublicModel.d.ts +237 -237
- package/sdk/public/Inventory/InventoryPublicModel.js +257 -257
- package/sdk/public/Partner/PartnerPublicModel.d.ts +104 -104
- package/sdk/public/Partner/PartnerPublicModel.js +113 -113
- package/sdk/public/PublicClient.d.ts +0 -4
- package/sdk/public/PublicClient.js +0 -8
- package/sdk/public/Webhook/WebhookPublicClient.d.ts +0 -33
- package/sdk/public/Webhook/WebhookPublicClient.js +0 -242
- package/sdk/public/Webhook/WebhookPublicModel.d.ts +15 -161
- package/sdk/public/Webhook/WebhookPublicModel.js +13 -189
- package/sdk/public/Webhook/WebhookPublicValidator.d.ts +1 -23
- package/sdk/public/Webhook/WebhookPublicValidator.js +0 -31
- package/sdk/public/index.d.ts +0 -2
- package/sdk/public/index.js +0 -4
- package/sdk/partner/Lead/LeadPartnerClient.d.ts +0 -125
- package/sdk/partner/Lead/LeadPartnerClient.js +0 -785
- package/sdk/partner/Lead/LeadPartnerModel.d.ts +0 -1127
- package/sdk/partner/Lead/LeadPartnerModel.js +0 -896
- package/sdk/partner/Lead/LeadPartnerValidator.d.ts +0 -12
- package/sdk/partner/Lead/LeadPartnerValidator.js +0 -67
- package/sdk/partner/Logistics/LogisticsPartnerClient.d.ts +0 -155
- package/sdk/partner/Logistics/LogisticsPartnerClient.js +0 -1195
- package/sdk/partner/Logistics/LogisticsPartnerModel.d.ts +0 -372
- package/sdk/partner/Logistics/LogisticsPartnerModel.js +0 -442
- package/sdk/partner/Logistics/LogisticsPartnerValidator.d.ts +0 -16
- package/sdk/partner/Logistics/LogisticsPartnerValidator.js +0 -123
- package/sdk/partner/Webhook/WebhookPartnerClient.d.ts +0 -99
- package/sdk/partner/Webhook/WebhookPartnerClient.js +0 -753
- package/sdk/partner/Webhook/WebhookPartnerModel.d.ts +0 -566
- package/sdk/partner/Webhook/WebhookPartnerModel.js +0 -583
- package/sdk/partner/Webhook/WebhookPartnerValidator.d.ts +0 -12
- package/sdk/partner/Webhook/WebhookPartnerValidator.js +0 -74
- package/sdk/platform/Content/ContentPlatformClient.d.ts +0 -277
- package/sdk/platform/Content/ContentPlatformClient.js +0 -2011
- package/sdk/platform/Content/ContentPlatformValidator.d.ts +0 -247
- package/sdk/platform/Content/ContentPlatformValidator.js +0 -319
- package/sdk/public/Billing/BillingPublicClient.d.ts +0 -23
- package/sdk/public/Billing/BillingPublicClient.js +0 -116
- package/sdk/public/Billing/BillingPublicModel.d.ts +0 -92
- package/sdk/public/Billing/BillingPublicModel.js +0 -96
- package/sdk/public/Billing/BillingPublicValidator.d.ts +0 -18
- package/sdk/public/Billing/BillingPublicValidator.js +0 -19
- package/sdk/public/Content/ContentPublicClient.d.ts +0 -22
- package/sdk/public/Content/ContentPublicClient.js +0 -114
- package/sdk/public/Content/ContentPublicModel.d.ts +0 -53
- package/sdk/public/Content/ContentPublicModel.js +0 -60
- package/sdk/public/Content/ContentPublicValidator.d.ts +0 -18
- package/sdk/public/Content/ContentPublicValidator.js +0 -19
|
@@ -564,250 +564,6 @@ class Communication {
|
|
|
564
564
|
return response;
|
|
565
565
|
}
|
|
566
566
|
|
|
567
|
-
/**
|
|
568
|
-
* @param {CommunicationPlatformApplicationValidator.CreateEventSubscriptionsParam} arg
|
|
569
|
-
* - Arg object
|
|
570
|
-
*
|
|
571
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
572
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
573
|
-
* @returns {Promise<CommunicationPlatformModel.EventSubscriptionsBulkUpdateResponse>}
|
|
574
|
-
* - Success response
|
|
575
|
-
*
|
|
576
|
-
* @name createEventSubscriptions
|
|
577
|
-
* @summary: Create event subscriptions
|
|
578
|
-
* @description: Create event subscriptions - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/communication/createEventSubscriptions/).
|
|
579
|
-
*/
|
|
580
|
-
async createEventSubscriptions(
|
|
581
|
-
{ body, requestHeaders } = { requestHeaders: {} },
|
|
582
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
583
|
-
) {
|
|
584
|
-
const {
|
|
585
|
-
error,
|
|
586
|
-
} = CommunicationPlatformApplicationValidator.createEventSubscriptions().validate(
|
|
587
|
-
{
|
|
588
|
-
body,
|
|
589
|
-
},
|
|
590
|
-
{ abortEarly: false, allowUnknown: true }
|
|
591
|
-
);
|
|
592
|
-
if (error) {
|
|
593
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
594
|
-
}
|
|
595
|
-
|
|
596
|
-
// Showing warrnings if extra unknown parameters are found
|
|
597
|
-
const {
|
|
598
|
-
error: warrning,
|
|
599
|
-
} = CommunicationPlatformApplicationValidator.createEventSubscriptions().validate(
|
|
600
|
-
{
|
|
601
|
-
body,
|
|
602
|
-
},
|
|
603
|
-
{ abortEarly: false, allowUnknown: false }
|
|
604
|
-
);
|
|
605
|
-
if (warrning) {
|
|
606
|
-
Logger({
|
|
607
|
-
level: "WARN",
|
|
608
|
-
message: `Parameter Validation warrnings for platform > Communication > createEventSubscriptions \n ${warrning}`,
|
|
609
|
-
});
|
|
610
|
-
}
|
|
611
|
-
|
|
612
|
-
const query_params = {};
|
|
613
|
-
|
|
614
|
-
const response = await PlatformAPIClient.execute(
|
|
615
|
-
this.config,
|
|
616
|
-
"post",
|
|
617
|
-
`/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/event/event-subscriptions`,
|
|
618
|
-
query_params,
|
|
619
|
-
body,
|
|
620
|
-
requestHeaders,
|
|
621
|
-
{ responseHeaders }
|
|
622
|
-
);
|
|
623
|
-
|
|
624
|
-
let responseData = response;
|
|
625
|
-
if (responseHeaders) {
|
|
626
|
-
responseData = response[0];
|
|
627
|
-
}
|
|
628
|
-
|
|
629
|
-
const {
|
|
630
|
-
error: res_error,
|
|
631
|
-
} = CommunicationPlatformModel.EventSubscriptionsBulkUpdateResponse().validate(
|
|
632
|
-
responseData,
|
|
633
|
-
{ abortEarly: false, allowUnknown: true }
|
|
634
|
-
);
|
|
635
|
-
|
|
636
|
-
if (res_error) {
|
|
637
|
-
if (this.config.options.strictResponseCheck === true) {
|
|
638
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
639
|
-
} else {
|
|
640
|
-
Logger({
|
|
641
|
-
level: "WARN",
|
|
642
|
-
message: `Response Validation Warnings for platform > Communication > createEventSubscriptions \n ${res_error}`,
|
|
643
|
-
});
|
|
644
|
-
}
|
|
645
|
-
}
|
|
646
|
-
|
|
647
|
-
return response;
|
|
648
|
-
}
|
|
649
|
-
|
|
650
|
-
/**
|
|
651
|
-
* @param {CommunicationPlatformApplicationValidator.CreateEventSubscriptionsByBulkParam} arg
|
|
652
|
-
* - Arg object
|
|
653
|
-
*
|
|
654
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
655
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
656
|
-
* @returns {Promise<
|
|
657
|
-
* CommunicationPlatformModel.EventSubscriptionsBulkUpdateResponse[]
|
|
658
|
-
* >}
|
|
659
|
-
* - Success response
|
|
660
|
-
*
|
|
661
|
-
* @name createEventSubscriptionsByBulk
|
|
662
|
-
* @summary: Create event subscriptions by bulk
|
|
663
|
-
* @description: Create event subscriptions by bulk - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/communication/createEventSubscriptionsByBulk/).
|
|
664
|
-
*/
|
|
665
|
-
async createEventSubscriptionsByBulk(
|
|
666
|
-
{ body, requestHeaders } = { requestHeaders: {} },
|
|
667
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
668
|
-
) {
|
|
669
|
-
const {
|
|
670
|
-
error,
|
|
671
|
-
} = CommunicationPlatformApplicationValidator.createEventSubscriptionsByBulk().validate(
|
|
672
|
-
{
|
|
673
|
-
body,
|
|
674
|
-
},
|
|
675
|
-
{ abortEarly: false, allowUnknown: true }
|
|
676
|
-
);
|
|
677
|
-
if (error) {
|
|
678
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
679
|
-
}
|
|
680
|
-
|
|
681
|
-
// Showing warrnings if extra unknown parameters are found
|
|
682
|
-
const {
|
|
683
|
-
error: warrning,
|
|
684
|
-
} = CommunicationPlatformApplicationValidator.createEventSubscriptionsByBulk().validate(
|
|
685
|
-
{
|
|
686
|
-
body,
|
|
687
|
-
},
|
|
688
|
-
{ abortEarly: false, allowUnknown: false }
|
|
689
|
-
);
|
|
690
|
-
if (warrning) {
|
|
691
|
-
Logger({
|
|
692
|
-
level: "WARN",
|
|
693
|
-
message: `Parameter Validation warrnings for platform > Communication > createEventSubscriptionsByBulk \n ${warrning}`,
|
|
694
|
-
});
|
|
695
|
-
}
|
|
696
|
-
|
|
697
|
-
const query_params = {};
|
|
698
|
-
|
|
699
|
-
const response = await PlatformAPIClient.execute(
|
|
700
|
-
this.config,
|
|
701
|
-
"post",
|
|
702
|
-
`/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/event/event-subscriptions/bulkUpdate`,
|
|
703
|
-
query_params,
|
|
704
|
-
body,
|
|
705
|
-
requestHeaders,
|
|
706
|
-
{ responseHeaders }
|
|
707
|
-
);
|
|
708
|
-
|
|
709
|
-
let responseData = response;
|
|
710
|
-
if (responseHeaders) {
|
|
711
|
-
responseData = response[0];
|
|
712
|
-
}
|
|
713
|
-
|
|
714
|
-
const { error: res_error } = Joi.array()
|
|
715
|
-
.items(CommunicationPlatformModel.EventSubscriptionsBulkUpdateResponse())
|
|
716
|
-
.validate(responseData, { abortEarly: false, allowUnknown: true });
|
|
717
|
-
|
|
718
|
-
if (res_error) {
|
|
719
|
-
if (this.config.options.strictResponseCheck === true) {
|
|
720
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
721
|
-
} else {
|
|
722
|
-
Logger({
|
|
723
|
-
level: "WARN",
|
|
724
|
-
message: `Response Validation Warnings for platform > Communication > createEventSubscriptionsByBulk \n ${res_error}`,
|
|
725
|
-
});
|
|
726
|
-
}
|
|
727
|
-
}
|
|
728
|
-
|
|
729
|
-
return response;
|
|
730
|
-
}
|
|
731
|
-
|
|
732
|
-
/**
|
|
733
|
-
* @param {CommunicationPlatformApplicationValidator.CreateJobsParam} arg - Arg object
|
|
734
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
735
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
736
|
-
* @returns {Promise<CommunicationPlatformModel.CreateJobsRes>} - Success response
|
|
737
|
-
* @name createJobs
|
|
738
|
-
* @summary: Create jobs
|
|
739
|
-
* @description: Create jobs - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/communication/createJobs/).
|
|
740
|
-
*/
|
|
741
|
-
async createJobs(
|
|
742
|
-
{ body, requestHeaders } = { requestHeaders: {} },
|
|
743
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
744
|
-
) {
|
|
745
|
-
const {
|
|
746
|
-
error,
|
|
747
|
-
} = CommunicationPlatformApplicationValidator.createJobs().validate(
|
|
748
|
-
{
|
|
749
|
-
body,
|
|
750
|
-
},
|
|
751
|
-
{ abortEarly: false, allowUnknown: true }
|
|
752
|
-
);
|
|
753
|
-
if (error) {
|
|
754
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
755
|
-
}
|
|
756
|
-
|
|
757
|
-
// Showing warrnings if extra unknown parameters are found
|
|
758
|
-
const {
|
|
759
|
-
error: warrning,
|
|
760
|
-
} = CommunicationPlatformApplicationValidator.createJobs().validate(
|
|
761
|
-
{
|
|
762
|
-
body,
|
|
763
|
-
},
|
|
764
|
-
{ abortEarly: false, allowUnknown: false }
|
|
765
|
-
);
|
|
766
|
-
if (warrning) {
|
|
767
|
-
Logger({
|
|
768
|
-
level: "WARN",
|
|
769
|
-
message: `Parameter Validation warrnings for platform > Communication > createJobs \n ${warrning}`,
|
|
770
|
-
});
|
|
771
|
-
}
|
|
772
|
-
|
|
773
|
-
const query_params = {};
|
|
774
|
-
|
|
775
|
-
const response = await PlatformAPIClient.execute(
|
|
776
|
-
this.config,
|
|
777
|
-
"post",
|
|
778
|
-
`/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/jobs/jobs`,
|
|
779
|
-
query_params,
|
|
780
|
-
body,
|
|
781
|
-
requestHeaders,
|
|
782
|
-
{ responseHeaders }
|
|
783
|
-
);
|
|
784
|
-
|
|
785
|
-
let responseData = response;
|
|
786
|
-
if (responseHeaders) {
|
|
787
|
-
responseData = response[0];
|
|
788
|
-
}
|
|
789
|
-
|
|
790
|
-
const {
|
|
791
|
-
error: res_error,
|
|
792
|
-
} = CommunicationPlatformModel.CreateJobsRes().validate(responseData, {
|
|
793
|
-
abortEarly: false,
|
|
794
|
-
allowUnknown: true,
|
|
795
|
-
});
|
|
796
|
-
|
|
797
|
-
if (res_error) {
|
|
798
|
-
if (this.config.options.strictResponseCheck === true) {
|
|
799
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
800
|
-
} else {
|
|
801
|
-
Logger({
|
|
802
|
-
level: "WARN",
|
|
803
|
-
message: `Response Validation Warnings for platform > Communication > createJobs \n ${res_error}`,
|
|
804
|
-
});
|
|
805
|
-
}
|
|
806
|
-
}
|
|
807
|
-
|
|
808
|
-
return response;
|
|
809
|
-
}
|
|
810
|
-
|
|
811
567
|
/**
|
|
812
568
|
* @param {CommunicationPlatformApplicationValidator.CreateSmsProviderParam} arg
|
|
813
569
|
* - Arg object
|
|
@@ -974,13 +730,13 @@ class Communication {
|
|
|
974
730
|
*
|
|
975
731
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
976
732
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
977
|
-
* @returns {Promise<CommunicationPlatformModel.
|
|
733
|
+
* @returns {Promise<CommunicationPlatformModel.GenericDelete>} - Success response
|
|
978
734
|
* @name deleteAudienceById
|
|
979
735
|
* @summary: Delete audience by id
|
|
980
736
|
* @description: Audience is used to import CSV files containing emails, phone numbers, and other variables in order to populate email/SMS templates for bulk delivery via a Campaign. Use this API to delete audience by id. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/communication/deleteAudienceById/).
|
|
981
737
|
*/
|
|
982
738
|
async deleteAudienceById(
|
|
983
|
-
{ id,
|
|
739
|
+
{ id, requestHeaders } = { requestHeaders: {} },
|
|
984
740
|
{ responseHeaders } = { responseHeaders: false }
|
|
985
741
|
) {
|
|
986
742
|
const {
|
|
@@ -988,7 +744,6 @@ class Communication {
|
|
|
988
744
|
} = CommunicationPlatformApplicationValidator.deleteAudienceById().validate(
|
|
989
745
|
{
|
|
990
746
|
id,
|
|
991
|
-
body,
|
|
992
747
|
},
|
|
993
748
|
{ abortEarly: false, allowUnknown: true }
|
|
994
749
|
);
|
|
@@ -1002,7 +757,6 @@ class Communication {
|
|
|
1002
757
|
} = CommunicationPlatformApplicationValidator.deleteAudienceById().validate(
|
|
1003
758
|
{
|
|
1004
759
|
id,
|
|
1005
|
-
body,
|
|
1006
760
|
},
|
|
1007
761
|
{ abortEarly: false, allowUnknown: false }
|
|
1008
762
|
);
|
|
@@ -1020,7 +774,7 @@ class Communication {
|
|
|
1020
774
|
"delete",
|
|
1021
775
|
`/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/sources/datasources/${id}`,
|
|
1022
776
|
query_params,
|
|
1023
|
-
|
|
777
|
+
undefined,
|
|
1024
778
|
requestHeaders,
|
|
1025
779
|
{ responseHeaders }
|
|
1026
780
|
);
|
|
@@ -1032,7 +786,7 @@ class Communication {
|
|
|
1032
786
|
|
|
1033
787
|
const {
|
|
1034
788
|
error: res_error,
|
|
1035
|
-
} = CommunicationPlatformModel.
|
|
789
|
+
} = CommunicationPlatformModel.GenericDelete().validate(responseData, {
|
|
1036
790
|
abortEarly: false,
|
|
1037
791
|
allowUnknown: true,
|
|
1038
792
|
});
|
|
@@ -1213,87 +967,6 @@ class Communication {
|
|
|
1213
967
|
return response;
|
|
1214
968
|
}
|
|
1215
969
|
|
|
1216
|
-
/**
|
|
1217
|
-
* @param {CommunicationPlatformApplicationValidator.DeleteEventSubscriptionsByIdParam} arg
|
|
1218
|
-
* - Arg object
|
|
1219
|
-
*
|
|
1220
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1221
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1222
|
-
* @returns {Promise<CommunicationPlatformModel.GenericDelete>} - Success response
|
|
1223
|
-
* @name deleteEventSubscriptionsById
|
|
1224
|
-
* @summary: Create event subscriptions
|
|
1225
|
-
* @description: Create event subscriptions - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/communication/deleteEventSubscriptionsById/).
|
|
1226
|
-
*/
|
|
1227
|
-
async deleteEventSubscriptionsById(
|
|
1228
|
-
{ id, requestHeaders } = { requestHeaders: {} },
|
|
1229
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
1230
|
-
) {
|
|
1231
|
-
const {
|
|
1232
|
-
error,
|
|
1233
|
-
} = CommunicationPlatformApplicationValidator.deleteEventSubscriptionsById().validate(
|
|
1234
|
-
{
|
|
1235
|
-
id,
|
|
1236
|
-
},
|
|
1237
|
-
{ abortEarly: false, allowUnknown: true }
|
|
1238
|
-
);
|
|
1239
|
-
if (error) {
|
|
1240
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
1241
|
-
}
|
|
1242
|
-
|
|
1243
|
-
// Showing warrnings if extra unknown parameters are found
|
|
1244
|
-
const {
|
|
1245
|
-
error: warrning,
|
|
1246
|
-
} = CommunicationPlatformApplicationValidator.deleteEventSubscriptionsById().validate(
|
|
1247
|
-
{
|
|
1248
|
-
id,
|
|
1249
|
-
},
|
|
1250
|
-
{ abortEarly: false, allowUnknown: false }
|
|
1251
|
-
);
|
|
1252
|
-
if (warrning) {
|
|
1253
|
-
Logger({
|
|
1254
|
-
level: "WARN",
|
|
1255
|
-
message: `Parameter Validation warrnings for platform > Communication > deleteEventSubscriptionsById \n ${warrning}`,
|
|
1256
|
-
});
|
|
1257
|
-
}
|
|
1258
|
-
|
|
1259
|
-
const query_params = {};
|
|
1260
|
-
|
|
1261
|
-
const response = await PlatformAPIClient.execute(
|
|
1262
|
-
this.config,
|
|
1263
|
-
"delete",
|
|
1264
|
-
`/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/event/event-subscriptions/${id}`,
|
|
1265
|
-
query_params,
|
|
1266
|
-
undefined,
|
|
1267
|
-
requestHeaders,
|
|
1268
|
-
{ responseHeaders }
|
|
1269
|
-
);
|
|
1270
|
-
|
|
1271
|
-
let responseData = response;
|
|
1272
|
-
if (responseHeaders) {
|
|
1273
|
-
responseData = response[0];
|
|
1274
|
-
}
|
|
1275
|
-
|
|
1276
|
-
const {
|
|
1277
|
-
error: res_error,
|
|
1278
|
-
} = CommunicationPlatformModel.GenericDelete().validate(responseData, {
|
|
1279
|
-
abortEarly: false,
|
|
1280
|
-
allowUnknown: true,
|
|
1281
|
-
});
|
|
1282
|
-
|
|
1283
|
-
if (res_error) {
|
|
1284
|
-
if (this.config.options.strictResponseCheck === true) {
|
|
1285
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1286
|
-
} else {
|
|
1287
|
-
Logger({
|
|
1288
|
-
level: "WARN",
|
|
1289
|
-
message: `Response Validation Warnings for platform > Communication > deleteEventSubscriptionsById \n ${res_error}`,
|
|
1290
|
-
});
|
|
1291
|
-
}
|
|
1292
|
-
}
|
|
1293
|
-
|
|
1294
|
-
return response;
|
|
1295
|
-
}
|
|
1296
|
-
|
|
1297
970
|
/**
|
|
1298
971
|
* @param {CommunicationPlatformApplicationValidator.DeleteSmsProviderByIdParam} arg
|
|
1299
972
|
* - Arg object
|
|
@@ -1456,91 +1129,6 @@ class Communication {
|
|
|
1456
1129
|
return response;
|
|
1457
1130
|
}
|
|
1458
1131
|
|
|
1459
|
-
/**
|
|
1460
|
-
* @param {CommunicationPlatformApplicationValidator.EditEventSubscriptionsParam} arg
|
|
1461
|
-
* - Arg object
|
|
1462
|
-
*
|
|
1463
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1464
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1465
|
-
* @returns {Promise<CommunicationPlatformModel.EventSubscriptionsBulkUpdateResponse>}
|
|
1466
|
-
* - Success response
|
|
1467
|
-
*
|
|
1468
|
-
* @name editEventSubscriptions
|
|
1469
|
-
* @summary: Create event subscriptions
|
|
1470
|
-
* @description: Create event subscriptions - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/communication/editEventSubscriptions/).
|
|
1471
|
-
*/
|
|
1472
|
-
async editEventSubscriptions(
|
|
1473
|
-
{ id, body, requestHeaders } = { requestHeaders: {} },
|
|
1474
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
1475
|
-
) {
|
|
1476
|
-
const {
|
|
1477
|
-
error,
|
|
1478
|
-
} = CommunicationPlatformApplicationValidator.editEventSubscriptions().validate(
|
|
1479
|
-
{
|
|
1480
|
-
id,
|
|
1481
|
-
body,
|
|
1482
|
-
},
|
|
1483
|
-
{ abortEarly: false, allowUnknown: true }
|
|
1484
|
-
);
|
|
1485
|
-
if (error) {
|
|
1486
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
1487
|
-
}
|
|
1488
|
-
|
|
1489
|
-
// Showing warrnings if extra unknown parameters are found
|
|
1490
|
-
const {
|
|
1491
|
-
error: warrning,
|
|
1492
|
-
} = CommunicationPlatformApplicationValidator.editEventSubscriptions().validate(
|
|
1493
|
-
{
|
|
1494
|
-
id,
|
|
1495
|
-
body,
|
|
1496
|
-
},
|
|
1497
|
-
{ abortEarly: false, allowUnknown: false }
|
|
1498
|
-
);
|
|
1499
|
-
if (warrning) {
|
|
1500
|
-
Logger({
|
|
1501
|
-
level: "WARN",
|
|
1502
|
-
message: `Parameter Validation warrnings for platform > Communication > editEventSubscriptions \n ${warrning}`,
|
|
1503
|
-
});
|
|
1504
|
-
}
|
|
1505
|
-
|
|
1506
|
-
const query_params = {};
|
|
1507
|
-
|
|
1508
|
-
const response = await PlatformAPIClient.execute(
|
|
1509
|
-
this.config,
|
|
1510
|
-
"put",
|
|
1511
|
-
`/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/event/event-subscriptions/${id}`,
|
|
1512
|
-
query_params,
|
|
1513
|
-
body,
|
|
1514
|
-
requestHeaders,
|
|
1515
|
-
{ responseHeaders }
|
|
1516
|
-
);
|
|
1517
|
-
|
|
1518
|
-
let responseData = response;
|
|
1519
|
-
if (responseHeaders) {
|
|
1520
|
-
responseData = response[0];
|
|
1521
|
-
}
|
|
1522
|
-
|
|
1523
|
-
const {
|
|
1524
|
-
error: res_error,
|
|
1525
|
-
} = CommunicationPlatformModel.EventSubscriptionsBulkUpdateResponse().validate(
|
|
1526
|
-
responseData,
|
|
1527
|
-
{ abortEarly: false, allowUnknown: true }
|
|
1528
|
-
);
|
|
1529
|
-
|
|
1530
|
-
if (res_error) {
|
|
1531
|
-
if (this.config.options.strictResponseCheck === true) {
|
|
1532
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1533
|
-
} else {
|
|
1534
|
-
Logger({
|
|
1535
|
-
level: "WARN",
|
|
1536
|
-
message: `Response Validation Warnings for platform > Communication > editEventSubscriptions \n ${res_error}`,
|
|
1537
|
-
});
|
|
1538
|
-
}
|
|
1539
|
-
}
|
|
1540
|
-
|
|
1541
|
-
return response;
|
|
1542
|
-
}
|
|
1543
|
-
|
|
1544
1132
|
/**
|
|
1545
1133
|
* @param {CommunicationPlatformApplicationValidator.GetAppProvidersParam} arg
|
|
1546
1134
|
* - Arg object
|
|
@@ -1711,7 +1299,7 @@ class Communication {
|
|
|
1711
1299
|
* @description: Audience is used to import CSV files containing emails, phone numbers, and other variables in order to populate email/SMS templates for bulk delivery via a Campaign. Use this API to get audiences. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/communication/getAudiences/).
|
|
1712
1300
|
*/
|
|
1713
1301
|
async getAudiences(
|
|
1714
|
-
{ pageNo, pageSize, sort,
|
|
1302
|
+
{ pageNo, pageSize, sort, requestHeaders } = { requestHeaders: {} },
|
|
1715
1303
|
{ responseHeaders } = { responseHeaders: false }
|
|
1716
1304
|
) {
|
|
1717
1305
|
const {
|
|
@@ -1721,7 +1309,6 @@ class Communication {
|
|
|
1721
1309
|
pageNo,
|
|
1722
1310
|
pageSize,
|
|
1723
1311
|
sort,
|
|
1724
|
-
query,
|
|
1725
1312
|
},
|
|
1726
1313
|
{ abortEarly: false, allowUnknown: true }
|
|
1727
1314
|
);
|
|
@@ -1737,7 +1324,6 @@ class Communication {
|
|
|
1737
1324
|
pageNo,
|
|
1738
1325
|
pageSize,
|
|
1739
1326
|
sort,
|
|
1740
|
-
query,
|
|
1741
1327
|
},
|
|
1742
1328
|
{ abortEarly: false, allowUnknown: false }
|
|
1743
1329
|
);
|
|
@@ -1752,7 +1338,6 @@ class Communication {
|
|
|
1752
1338
|
query_params["page_no"] = pageNo;
|
|
1753
1339
|
query_params["page_size"] = pageSize;
|
|
1754
1340
|
query_params["sort"] = sort;
|
|
1755
|
-
query_params["query"] = query;
|
|
1756
1341
|
|
|
1757
1342
|
const response = await PlatformAPIClient.execute(
|
|
1758
1343
|
this.config,
|
|
@@ -1796,18 +1381,11 @@ class Communication {
|
|
|
1796
1381
|
* @param {string} arg.applicationId - Application id
|
|
1797
1382
|
* @param {number} [arg.pageSize] - Current request items count
|
|
1798
1383
|
* @param {Object} [arg.sort] - To sort based on created_at
|
|
1799
|
-
* @param {Object} [arg.query] - To search based on plain text
|
|
1800
1384
|
* @returns {Paginator<CommunicationPlatformModel.Audiences>}
|
|
1801
1385
|
* @summary: Get audiences
|
|
1802
1386
|
* @description: Audience is used to import CSV files containing emails, phone numbers, and other variables in order to populate email/SMS templates for bulk delivery via a Campaign. Use this API to get audiences.
|
|
1803
1387
|
*/
|
|
1804
|
-
getAudiencesPaginator({
|
|
1805
|
-
companyId,
|
|
1806
|
-
applicationId,
|
|
1807
|
-
pageSize,
|
|
1808
|
-
sort,
|
|
1809
|
-
query,
|
|
1810
|
-
} = {}) {
|
|
1388
|
+
getAudiencesPaginator({ companyId, applicationId, pageSize, sort } = {}) {
|
|
1811
1389
|
const paginator = new Paginator();
|
|
1812
1390
|
const callback = async () => {
|
|
1813
1391
|
const pageId = paginator.nextId;
|
|
@@ -1819,7 +1397,6 @@ class Communication {
|
|
|
1819
1397
|
pageNo: pageNo,
|
|
1820
1398
|
pageSize: pageSize,
|
|
1821
1399
|
sort: sort,
|
|
1822
|
-
query: query,
|
|
1823
1400
|
});
|
|
1824
1401
|
paginator.setPaginator({
|
|
1825
1402
|
hasNext: data.page.has_next ? true : false,
|
|
@@ -2082,14 +1659,13 @@ class Communication {
|
|
|
2082
1659
|
* @description: Get campaigns - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/communication/getCampaigns/).
|
|
2083
1660
|
*/
|
|
2084
1661
|
async getCampaigns(
|
|
2085
|
-
{
|
|
1662
|
+
{ pageNo, pageSize, sort, requestHeaders } = { requestHeaders: {} },
|
|
2086
1663
|
{ responseHeaders } = { responseHeaders: false }
|
|
2087
1664
|
) {
|
|
2088
1665
|
const {
|
|
2089
1666
|
error,
|
|
2090
1667
|
} = CommunicationPlatformApplicationValidator.getCampaigns().validate(
|
|
2091
1668
|
{
|
|
2092
|
-
query,
|
|
2093
1669
|
pageNo,
|
|
2094
1670
|
pageSize,
|
|
2095
1671
|
sort,
|
|
@@ -2105,7 +1681,6 @@ class Communication {
|
|
|
2105
1681
|
error: warrning,
|
|
2106
1682
|
} = CommunicationPlatformApplicationValidator.getCampaigns().validate(
|
|
2107
1683
|
{
|
|
2108
|
-
query,
|
|
2109
1684
|
pageNo,
|
|
2110
1685
|
pageSize,
|
|
2111
1686
|
sort,
|
|
@@ -2120,7 +1695,6 @@ class Communication {
|
|
|
2120
1695
|
}
|
|
2121
1696
|
|
|
2122
1697
|
const query_params = {};
|
|
2123
|
-
query_params["query"] = query;
|
|
2124
1698
|
query_params["page_no"] = pageNo;
|
|
2125
1699
|
query_params["page_size"] = pageSize;
|
|
2126
1700
|
query_params["sort"] = sort;
|
|
@@ -2161,6 +1735,39 @@ class Communication {
|
|
|
2161
1735
|
return response;
|
|
2162
1736
|
}
|
|
2163
1737
|
|
|
1738
|
+
/**
|
|
1739
|
+
* @param {Object} arg - Arg object.
|
|
1740
|
+
* @param {string} arg.companyId - Company id
|
|
1741
|
+
* @param {string} arg.applicationId - Application id
|
|
1742
|
+
* @param {number} [arg.pageSize] - Current request items count
|
|
1743
|
+
* @param {Object} [arg.sort] - To sort based on created_at
|
|
1744
|
+
* @returns {Paginator<CommunicationPlatformModel.Campaigns>}
|
|
1745
|
+
* @summary: Get campaigns
|
|
1746
|
+
* @description: Get campaigns
|
|
1747
|
+
*/
|
|
1748
|
+
getCampaignsPaginator({ companyId, applicationId, pageSize, sort } = {}) {
|
|
1749
|
+
const paginator = new Paginator();
|
|
1750
|
+
const callback = async () => {
|
|
1751
|
+
const pageId = paginator.nextId;
|
|
1752
|
+
const pageNo = paginator.pageNo;
|
|
1753
|
+
const pageType = "number";
|
|
1754
|
+
const data = await this.getCampaigns({
|
|
1755
|
+
companyId: companyId,
|
|
1756
|
+
applicationId: applicationId,
|
|
1757
|
+
pageNo: pageNo,
|
|
1758
|
+
pageSize: pageSize,
|
|
1759
|
+
sort: sort,
|
|
1760
|
+
});
|
|
1761
|
+
paginator.setPaginator({
|
|
1762
|
+
hasNext: data.page.has_next ? true : false,
|
|
1763
|
+
nextId: data.page.next_id,
|
|
1764
|
+
});
|
|
1765
|
+
return data;
|
|
1766
|
+
};
|
|
1767
|
+
paginator.setCallback(callback.bind(this));
|
|
1768
|
+
return paginator;
|
|
1769
|
+
}
|
|
1770
|
+
|
|
2164
1771
|
/**
|
|
2165
1772
|
* @param {CommunicationPlatformApplicationValidator.GetCommunicationLogsParam} arg
|
|
2166
1773
|
* - Arg object
|
|
@@ -2618,7 +2225,7 @@ class Communication {
|
|
|
2618
2225
|
* @description: Get email providers - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/communication/getEmailProviders/).
|
|
2619
2226
|
*/
|
|
2620
2227
|
async getEmailProviders(
|
|
2621
|
-
{ pageNo, pageSize, sort,
|
|
2228
|
+
{ pageNo, pageSize, sort, requestHeaders } = { requestHeaders: {} },
|
|
2622
2229
|
{ responseHeaders } = { responseHeaders: false }
|
|
2623
2230
|
) {
|
|
2624
2231
|
const {
|
|
@@ -2628,7 +2235,6 @@ class Communication {
|
|
|
2628
2235
|
pageNo,
|
|
2629
2236
|
pageSize,
|
|
2630
2237
|
sort,
|
|
2631
|
-
query,
|
|
2632
2238
|
},
|
|
2633
2239
|
{ abortEarly: false, allowUnknown: true }
|
|
2634
2240
|
);
|
|
@@ -2644,7 +2250,6 @@ class Communication {
|
|
|
2644
2250
|
pageNo,
|
|
2645
2251
|
pageSize,
|
|
2646
2252
|
sort,
|
|
2647
|
-
query,
|
|
2648
2253
|
},
|
|
2649
2254
|
{ abortEarly: false, allowUnknown: false }
|
|
2650
2255
|
);
|
|
@@ -2659,7 +2264,6 @@ class Communication {
|
|
|
2659
2264
|
query_params["page_no"] = pageNo;
|
|
2660
2265
|
query_params["page_size"] = pageSize;
|
|
2661
2266
|
query_params["sort"] = sort;
|
|
2662
|
-
query_params["query"] = query;
|
|
2663
2267
|
|
|
2664
2268
|
const response = await PlatformAPIClient.execute(
|
|
2665
2269
|
this.config,
|
|
@@ -2703,7 +2307,6 @@ class Communication {
|
|
|
2703
2307
|
* @param {string} arg.applicationId - Application id
|
|
2704
2308
|
* @param {number} [arg.pageSize] - Current request items count
|
|
2705
2309
|
* @param {Object} [arg.sort] - To sort based on created_at
|
|
2706
|
-
* @param {Object} [arg.query] - To search based on plain text
|
|
2707
2310
|
* @returns {Paginator<CommunicationPlatformModel.EmailProviders>}
|
|
2708
2311
|
* @summary: Get email providers
|
|
2709
2312
|
* @description: Get email providers
|
|
@@ -2713,7 +2316,6 @@ class Communication {
|
|
|
2713
2316
|
applicationId,
|
|
2714
2317
|
pageSize,
|
|
2715
2318
|
sort,
|
|
2716
|
-
query,
|
|
2717
2319
|
} = {}) {
|
|
2718
2320
|
const paginator = new Paginator();
|
|
2719
2321
|
const callback = async () => {
|
|
@@ -2726,7 +2328,6 @@ class Communication {
|
|
|
2726
2328
|
pageNo: pageNo,
|
|
2727
2329
|
pageSize: pageSize,
|
|
2728
2330
|
sort: sort,
|
|
2729
|
-
query: query,
|
|
2730
2331
|
});
|
|
2731
2332
|
paginator.setPaginator({
|
|
2732
2333
|
hasNext: data.page.has_next ? true : false,
|
|
@@ -2831,7 +2432,7 @@ class Communication {
|
|
|
2831
2432
|
* @description: Email templates are predefined formats linked to various events for delivering messages to users. Use this API to get all email templates. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/communication/getEmailTemplates/).
|
|
2832
2433
|
*/
|
|
2833
2434
|
async getEmailTemplates(
|
|
2834
|
-
{ pageNo, pageSize, sort,
|
|
2435
|
+
{ pageNo, pageSize, sort, requestHeaders } = { requestHeaders: {} },
|
|
2835
2436
|
{ responseHeaders } = { responseHeaders: false }
|
|
2836
2437
|
) {
|
|
2837
2438
|
const {
|
|
@@ -2841,7 +2442,6 @@ class Communication {
|
|
|
2841
2442
|
pageNo,
|
|
2842
2443
|
pageSize,
|
|
2843
2444
|
sort,
|
|
2844
|
-
query,
|
|
2845
2445
|
},
|
|
2846
2446
|
{ abortEarly: false, allowUnknown: true }
|
|
2847
2447
|
);
|
|
@@ -2857,7 +2457,6 @@ class Communication {
|
|
|
2857
2457
|
pageNo,
|
|
2858
2458
|
pageSize,
|
|
2859
2459
|
sort,
|
|
2860
|
-
query,
|
|
2861
2460
|
},
|
|
2862
2461
|
{ abortEarly: false, allowUnknown: false }
|
|
2863
2462
|
);
|
|
@@ -2872,7 +2471,6 @@ class Communication {
|
|
|
2872
2471
|
query_params["page_no"] = pageNo;
|
|
2873
2472
|
query_params["page_size"] = pageSize;
|
|
2874
2473
|
query_params["sort"] = sort;
|
|
2875
|
-
query_params["query"] = query;
|
|
2876
2474
|
|
|
2877
2475
|
const response = await PlatformAPIClient.execute(
|
|
2878
2476
|
this.config,
|
|
@@ -2916,7 +2514,6 @@ class Communication {
|
|
|
2916
2514
|
* @param {string} arg.applicationId - Application id
|
|
2917
2515
|
* @param {number} [arg.pageSize] - Current request items count
|
|
2918
2516
|
* @param {Object} [arg.sort] - To sort based on created_at
|
|
2919
|
-
* @param {Object} [arg.query] - To search based on plain text
|
|
2920
2517
|
* @returns {Paginator<CommunicationPlatformModel.EmailTemplates>}
|
|
2921
2518
|
* @summary: Get email templates
|
|
2922
2519
|
* @description: Email templates are predefined formats linked to various events for delivering messages to users. Use this API to get all email templates.
|
|
@@ -2926,7 +2523,6 @@ class Communication {
|
|
|
2926
2523
|
applicationId,
|
|
2927
2524
|
pageSize,
|
|
2928
2525
|
sort,
|
|
2929
|
-
query,
|
|
2930
2526
|
} = {}) {
|
|
2931
2527
|
const paginator = new Paginator();
|
|
2932
2528
|
const callback = async () => {
|
|
@@ -2939,7 +2535,6 @@ class Communication {
|
|
|
2939
2535
|
pageNo: pageNo,
|
|
2940
2536
|
pageSize: pageSize,
|
|
2941
2537
|
sort: sort,
|
|
2942
|
-
query: query,
|
|
2943
2538
|
});
|
|
2944
2539
|
paginator.setPaginator({
|
|
2945
2540
|
hasNext: data.page.has_next ? true : false,
|
|
@@ -3045,7 +2640,7 @@ class Communication {
|
|
|
3045
2640
|
* @param {string} arg.companyId - Company id
|
|
3046
2641
|
* @param {string} arg.applicationId - Application id
|
|
3047
2642
|
* @param {number} [arg.pageSize] - Current request items count
|
|
3048
|
-
* @param {string} [arg.populate] - Populate
|
|
2643
|
+
* @param {string} [arg.populate] - Populate fields
|
|
3049
2644
|
* @returns {Paginator<CommunicationPlatformModel.EventSubscriptions>}
|
|
3050
2645
|
* @summary: Get event subscriptions
|
|
3051
2646
|
* @description: Get event subscriptions
|
|
@@ -3078,90 +2673,6 @@ class Communication {
|
|
|
3078
2673
|
return paginator;
|
|
3079
2674
|
}
|
|
3080
2675
|
|
|
3081
|
-
/**
|
|
3082
|
-
* @param {CommunicationPlatformApplicationValidator.GetEventSubscriptionsByIdParam} arg
|
|
3083
|
-
* - Arg object
|
|
3084
|
-
*
|
|
3085
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
3086
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
3087
|
-
* @returns {Promise<CommunicationPlatformModel.EventSubscription>} - Success response
|
|
3088
|
-
* @name getEventSubscriptionsById
|
|
3089
|
-
* @summary: Get event subscriptions by id
|
|
3090
|
-
* @description: Get event subscriptions by id - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/communication/getEventSubscriptionsById/).
|
|
3091
|
-
*/
|
|
3092
|
-
async getEventSubscriptionsById(
|
|
3093
|
-
{ id, populate, requestHeaders } = { requestHeaders: {} },
|
|
3094
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
3095
|
-
) {
|
|
3096
|
-
const {
|
|
3097
|
-
error,
|
|
3098
|
-
} = CommunicationPlatformApplicationValidator.getEventSubscriptionsById().validate(
|
|
3099
|
-
{
|
|
3100
|
-
id,
|
|
3101
|
-
populate,
|
|
3102
|
-
},
|
|
3103
|
-
{ abortEarly: false, allowUnknown: true }
|
|
3104
|
-
);
|
|
3105
|
-
if (error) {
|
|
3106
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
3107
|
-
}
|
|
3108
|
-
|
|
3109
|
-
// Showing warrnings if extra unknown parameters are found
|
|
3110
|
-
const {
|
|
3111
|
-
error: warrning,
|
|
3112
|
-
} = CommunicationPlatformApplicationValidator.getEventSubscriptionsById().validate(
|
|
3113
|
-
{
|
|
3114
|
-
id,
|
|
3115
|
-
populate,
|
|
3116
|
-
},
|
|
3117
|
-
{ abortEarly: false, allowUnknown: false }
|
|
3118
|
-
);
|
|
3119
|
-
if (warrning) {
|
|
3120
|
-
Logger({
|
|
3121
|
-
level: "WARN",
|
|
3122
|
-
message: `Parameter Validation warrnings for platform > Communication > getEventSubscriptionsById \n ${warrning}`,
|
|
3123
|
-
});
|
|
3124
|
-
}
|
|
3125
|
-
|
|
3126
|
-
const query_params = {};
|
|
3127
|
-
query_params["populate"] = populate;
|
|
3128
|
-
|
|
3129
|
-
const response = await PlatformAPIClient.execute(
|
|
3130
|
-
this.config,
|
|
3131
|
-
"get",
|
|
3132
|
-
`/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/event/event-subscriptions/${id}`,
|
|
3133
|
-
query_params,
|
|
3134
|
-
undefined,
|
|
3135
|
-
requestHeaders,
|
|
3136
|
-
{ responseHeaders }
|
|
3137
|
-
);
|
|
3138
|
-
|
|
3139
|
-
let responseData = response;
|
|
3140
|
-
if (responseHeaders) {
|
|
3141
|
-
responseData = response[0];
|
|
3142
|
-
}
|
|
3143
|
-
|
|
3144
|
-
const {
|
|
3145
|
-
error: res_error,
|
|
3146
|
-
} = CommunicationPlatformModel.EventSubscription().validate(responseData, {
|
|
3147
|
-
abortEarly: false,
|
|
3148
|
-
allowUnknown: true,
|
|
3149
|
-
});
|
|
3150
|
-
|
|
3151
|
-
if (res_error) {
|
|
3152
|
-
if (this.config.options.strictResponseCheck === true) {
|
|
3153
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
3154
|
-
} else {
|
|
3155
|
-
Logger({
|
|
3156
|
-
level: "WARN",
|
|
3157
|
-
message: `Response Validation Warnings for platform > Communication > getEventSubscriptionsById \n ${res_error}`,
|
|
3158
|
-
});
|
|
3159
|
-
}
|
|
3160
|
-
}
|
|
3161
|
-
|
|
3162
|
-
return response;
|
|
3163
|
-
}
|
|
3164
|
-
|
|
3165
2676
|
/**
|
|
3166
2677
|
* @param {CommunicationPlatformApplicationValidator.GetGlobalProvidersParam} arg
|
|
3167
2678
|
* - Arg object
|
|
@@ -3328,7 +2839,7 @@ class Communication {
|
|
|
3328
2839
|
* @description: Get job logs - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/communication/getJobLogs/).
|
|
3329
2840
|
*/
|
|
3330
2841
|
async getJobLogs(
|
|
3331
|
-
{ pageNo, pageSize, sort,
|
|
2842
|
+
{ pageNo, pageSize, sort, requestHeaders } = { requestHeaders: {} },
|
|
3332
2843
|
{ responseHeaders } = { responseHeaders: false }
|
|
3333
2844
|
) {
|
|
3334
2845
|
const {
|
|
@@ -3338,7 +2849,6 @@ class Communication {
|
|
|
3338
2849
|
pageNo,
|
|
3339
2850
|
pageSize,
|
|
3340
2851
|
sort,
|
|
3341
|
-
query,
|
|
3342
2852
|
},
|
|
3343
2853
|
{ abortEarly: false, allowUnknown: true }
|
|
3344
2854
|
);
|
|
@@ -3354,7 +2864,6 @@ class Communication {
|
|
|
3354
2864
|
pageNo,
|
|
3355
2865
|
pageSize,
|
|
3356
2866
|
sort,
|
|
3357
|
-
query,
|
|
3358
2867
|
},
|
|
3359
2868
|
{ abortEarly: false, allowUnknown: false }
|
|
3360
2869
|
);
|
|
@@ -3369,7 +2878,6 @@ class Communication {
|
|
|
3369
2878
|
query_params["page_no"] = pageNo;
|
|
3370
2879
|
query_params["page_size"] = pageSize;
|
|
3371
2880
|
query_params["sort"] = sort;
|
|
3372
|
-
query_params["query"] = query;
|
|
3373
2881
|
|
|
3374
2882
|
const response = await PlatformAPIClient.execute(
|
|
3375
2883
|
this.config,
|
|
@@ -3413,18 +2921,11 @@ class Communication {
|
|
|
3413
2921
|
* @param {string} arg.applicationId - Application id
|
|
3414
2922
|
* @param {number} [arg.pageSize] - Current request items count
|
|
3415
2923
|
* @param {Object} [arg.sort] - To sort based on created_at
|
|
3416
|
-
* @param {Object} [arg.query] - To search based on plain text
|
|
3417
2924
|
* @returns {Paginator<CommunicationPlatformModel.JobLogs>}
|
|
3418
2925
|
* @summary: Get job logs
|
|
3419
2926
|
* @description: Get job logs
|
|
3420
2927
|
*/
|
|
3421
|
-
getJobLogsPaginator({
|
|
3422
|
-
companyId,
|
|
3423
|
-
applicationId,
|
|
3424
|
-
pageSize,
|
|
3425
|
-
sort,
|
|
3426
|
-
query,
|
|
3427
|
-
} = {}) {
|
|
2928
|
+
getJobLogsPaginator({ companyId, applicationId, pageSize, sort } = {}) {
|
|
3428
2929
|
const paginator = new Paginator();
|
|
3429
2930
|
const callback = async () => {
|
|
3430
2931
|
const pageId = paginator.nextId;
|
|
@@ -3436,7 +2937,6 @@ class Communication {
|
|
|
3436
2937
|
pageNo: pageNo,
|
|
3437
2938
|
pageSize: pageSize,
|
|
3438
2939
|
sort: sort,
|
|
3439
|
-
query: query,
|
|
3440
2940
|
});
|
|
3441
2941
|
paginator.setPaginator({
|
|
3442
2942
|
hasNext: data.page.has_next ? true : false,
|
|
@@ -3458,7 +2958,7 @@ class Communication {
|
|
|
3458
2958
|
* @description: Get jobs - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/communication/getJobs/).
|
|
3459
2959
|
*/
|
|
3460
2960
|
async getJobs(
|
|
3461
|
-
{ pageNo, pageSize, sort,
|
|
2961
|
+
{ pageNo, pageSize, sort, requestHeaders } = { requestHeaders: {} },
|
|
3462
2962
|
{ responseHeaders } = { responseHeaders: false }
|
|
3463
2963
|
) {
|
|
3464
2964
|
const {
|
|
@@ -3468,7 +2968,6 @@ class Communication {
|
|
|
3468
2968
|
pageNo,
|
|
3469
2969
|
pageSize,
|
|
3470
2970
|
sort,
|
|
3471
|
-
query,
|
|
3472
2971
|
},
|
|
3473
2972
|
{ abortEarly: false, allowUnknown: true }
|
|
3474
2973
|
);
|
|
@@ -3484,7 +2983,6 @@ class Communication {
|
|
|
3484
2983
|
pageNo,
|
|
3485
2984
|
pageSize,
|
|
3486
2985
|
sort,
|
|
3487
|
-
query,
|
|
3488
2986
|
},
|
|
3489
2987
|
{ abortEarly: false, allowUnknown: false }
|
|
3490
2988
|
);
|
|
@@ -3499,7 +2997,6 @@ class Communication {
|
|
|
3499
2997
|
query_params["page_no"] = pageNo;
|
|
3500
2998
|
query_params["page_size"] = pageSize;
|
|
3501
2999
|
query_params["sort"] = sort;
|
|
3502
|
-
query_params["query"] = query;
|
|
3503
3000
|
|
|
3504
3001
|
const response = await PlatformAPIClient.execute(
|
|
3505
3002
|
this.config,
|
|
@@ -3543,12 +3040,11 @@ class Communication {
|
|
|
3543
3040
|
* @param {string} arg.applicationId - Application id
|
|
3544
3041
|
* @param {number} [arg.pageSize] - Current request items count
|
|
3545
3042
|
* @param {Object} [arg.sort] - To sort based on created_at
|
|
3546
|
-
* @param {Object} [arg.query] - To search based on plain text
|
|
3547
3043
|
* @returns {Paginator<CommunicationPlatformModel.Jobs>}
|
|
3548
3044
|
* @summary: Get jobs
|
|
3549
3045
|
* @description: Get jobs
|
|
3550
3046
|
*/
|
|
3551
|
-
getJobsPaginator({ companyId, applicationId, pageSize, sort
|
|
3047
|
+
getJobsPaginator({ companyId, applicationId, pageSize, sort } = {}) {
|
|
3552
3048
|
const paginator = new Paginator();
|
|
3553
3049
|
const callback = async () => {
|
|
3554
3050
|
const pageId = paginator.nextId;
|
|
@@ -3560,7 +3056,6 @@ class Communication {
|
|
|
3560
3056
|
pageNo: pageNo,
|
|
3561
3057
|
pageSize: pageSize,
|
|
3562
3058
|
sort: sort,
|
|
3563
|
-
query: query,
|
|
3564
3059
|
});
|
|
3565
3060
|
paginator.setPaginator({
|
|
3566
3061
|
hasNext: data.page.has_next ? true : false,
|
|
@@ -3730,83 +3225,6 @@ class Communication {
|
|
|
3730
3225
|
return response;
|
|
3731
3226
|
}
|
|
3732
3227
|
|
|
3733
|
-
/**
|
|
3734
|
-
* @param {CommunicationPlatformApplicationValidator.GetOtpConfigurationParam} arg
|
|
3735
|
-
* - Arg object
|
|
3736
|
-
*
|
|
3737
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
3738
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
3739
|
-
* @returns {Promise<CommunicationPlatformModel.OtpConfiguration>} - Success response
|
|
3740
|
-
* @name getOtpConfiguration
|
|
3741
|
-
* @summary: Get otp-configuration, if not present in db then return default settings
|
|
3742
|
-
* @description: Get otp-configuration - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/communication/getOtpConfiguration/).
|
|
3743
|
-
*/
|
|
3744
|
-
async getOtpConfiguration(
|
|
3745
|
-
{ requestHeaders } = { requestHeaders: {} },
|
|
3746
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
3747
|
-
) {
|
|
3748
|
-
const {
|
|
3749
|
-
error,
|
|
3750
|
-
} = CommunicationPlatformApplicationValidator.getOtpConfiguration().validate(
|
|
3751
|
-
{},
|
|
3752
|
-
{ abortEarly: false, allowUnknown: true }
|
|
3753
|
-
);
|
|
3754
|
-
if (error) {
|
|
3755
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
3756
|
-
}
|
|
3757
|
-
|
|
3758
|
-
// Showing warrnings if extra unknown parameters are found
|
|
3759
|
-
const {
|
|
3760
|
-
error: warrning,
|
|
3761
|
-
} = CommunicationPlatformApplicationValidator.getOtpConfiguration().validate(
|
|
3762
|
-
{},
|
|
3763
|
-
{ abortEarly: false, allowUnknown: false }
|
|
3764
|
-
);
|
|
3765
|
-
if (warrning) {
|
|
3766
|
-
Logger({
|
|
3767
|
-
level: "WARN",
|
|
3768
|
-
message: `Parameter Validation warrnings for platform > Communication > getOtpConfiguration \n ${warrning}`,
|
|
3769
|
-
});
|
|
3770
|
-
}
|
|
3771
|
-
|
|
3772
|
-
const query_params = {};
|
|
3773
|
-
|
|
3774
|
-
const response = await PlatformAPIClient.execute(
|
|
3775
|
-
this.config,
|
|
3776
|
-
"get",
|
|
3777
|
-
`/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/otp/otp-configuration`,
|
|
3778
|
-
query_params,
|
|
3779
|
-
undefined,
|
|
3780
|
-
requestHeaders,
|
|
3781
|
-
{ responseHeaders }
|
|
3782
|
-
);
|
|
3783
|
-
|
|
3784
|
-
let responseData = response;
|
|
3785
|
-
if (responseHeaders) {
|
|
3786
|
-
responseData = response[0];
|
|
3787
|
-
}
|
|
3788
|
-
|
|
3789
|
-
const {
|
|
3790
|
-
error: res_error,
|
|
3791
|
-
} = CommunicationPlatformModel.OtpConfiguration().validate(responseData, {
|
|
3792
|
-
abortEarly: false,
|
|
3793
|
-
allowUnknown: true,
|
|
3794
|
-
});
|
|
3795
|
-
|
|
3796
|
-
if (res_error) {
|
|
3797
|
-
if (this.config.options.strictResponseCheck === true) {
|
|
3798
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
3799
|
-
} else {
|
|
3800
|
-
Logger({
|
|
3801
|
-
level: "WARN",
|
|
3802
|
-
message: `Response Validation Warnings for platform > Communication > getOtpConfiguration \n ${res_error}`,
|
|
3803
|
-
});
|
|
3804
|
-
}
|
|
3805
|
-
}
|
|
3806
|
-
|
|
3807
|
-
return response;
|
|
3808
|
-
}
|
|
3809
|
-
|
|
3810
3228
|
/**
|
|
3811
3229
|
* @param {CommunicationPlatformApplicationValidator.GetSmsProviderByIdParam} arg
|
|
3812
3230
|
* - Arg object
|
|
@@ -3898,7 +3316,7 @@ class Communication {
|
|
|
3898
3316
|
* @description: Get sms providers - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/communication/getSmsProviders/).
|
|
3899
3317
|
*/
|
|
3900
3318
|
async getSmsProviders(
|
|
3901
|
-
{ pageNo, pageSize, sort,
|
|
3319
|
+
{ pageNo, pageSize, sort, requestHeaders } = { requestHeaders: {} },
|
|
3902
3320
|
{ responseHeaders } = { responseHeaders: false }
|
|
3903
3321
|
) {
|
|
3904
3322
|
const {
|
|
@@ -3908,7 +3326,6 @@ class Communication {
|
|
|
3908
3326
|
pageNo,
|
|
3909
3327
|
pageSize,
|
|
3910
3328
|
sort,
|
|
3911
|
-
query,
|
|
3912
3329
|
},
|
|
3913
3330
|
{ abortEarly: false, allowUnknown: true }
|
|
3914
3331
|
);
|
|
@@ -3924,7 +3341,6 @@ class Communication {
|
|
|
3924
3341
|
pageNo,
|
|
3925
3342
|
pageSize,
|
|
3926
3343
|
sort,
|
|
3927
|
-
query,
|
|
3928
3344
|
},
|
|
3929
3345
|
{ abortEarly: false, allowUnknown: false }
|
|
3930
3346
|
);
|
|
@@ -3939,7 +3355,6 @@ class Communication {
|
|
|
3939
3355
|
query_params["page_no"] = pageNo;
|
|
3940
3356
|
query_params["page_size"] = pageSize;
|
|
3941
3357
|
query_params["sort"] = sort;
|
|
3942
|
-
query_params["query"] = query;
|
|
3943
3358
|
|
|
3944
3359
|
const response = await PlatformAPIClient.execute(
|
|
3945
3360
|
this.config,
|
|
@@ -4068,7 +3483,7 @@ class Communication {
|
|
|
4068
3483
|
* @description: SMS templates are predefined message formats linked to various events for delivering messages to users. Use this API to get all sms templates. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/communication/getSmsTemplates/).
|
|
4069
3484
|
*/
|
|
4070
3485
|
async getSmsTemplates(
|
|
4071
|
-
{ pageNo, pageSize, sort,
|
|
3486
|
+
{ pageNo, pageSize, sort, requestHeaders } = { requestHeaders: {} },
|
|
4072
3487
|
{ responseHeaders } = { responseHeaders: false }
|
|
4073
3488
|
) {
|
|
4074
3489
|
const {
|
|
@@ -4078,7 +3493,6 @@ class Communication {
|
|
|
4078
3493
|
pageNo,
|
|
4079
3494
|
pageSize,
|
|
4080
3495
|
sort,
|
|
4081
|
-
query,
|
|
4082
3496
|
},
|
|
4083
3497
|
{ abortEarly: false, allowUnknown: true }
|
|
4084
3498
|
);
|
|
@@ -4094,7 +3508,6 @@ class Communication {
|
|
|
4094
3508
|
pageNo,
|
|
4095
3509
|
pageSize,
|
|
4096
3510
|
sort,
|
|
4097
|
-
query,
|
|
4098
3511
|
},
|
|
4099
3512
|
{ abortEarly: false, allowUnknown: false }
|
|
4100
3513
|
);
|
|
@@ -4109,7 +3522,6 @@ class Communication {
|
|
|
4109
3522
|
query_params["page_no"] = pageNo;
|
|
4110
3523
|
query_params["page_size"] = pageSize;
|
|
4111
3524
|
query_params["sort"] = sort;
|
|
4112
|
-
query_params["query"] = query;
|
|
4113
3525
|
|
|
4114
3526
|
const response = await PlatformAPIClient.execute(
|
|
4115
3527
|
this.config,
|
|
@@ -4153,18 +3565,11 @@ class Communication {
|
|
|
4153
3565
|
* @param {string} arg.applicationId - Application id
|
|
4154
3566
|
* @param {number} [arg.pageSize] - Current request items count
|
|
4155
3567
|
* @param {Object} [arg.sort] - To sort based on created_at
|
|
4156
|
-
* @param {Object} [arg.query] - To search based on plain text
|
|
4157
3568
|
* @returns {Paginator<CommunicationPlatformModel.SmsTemplates>}
|
|
4158
3569
|
* @summary: Get sms templates
|
|
4159
3570
|
* @description: SMS templates are predefined message formats linked to various events for delivering messages to users. Use this API to get all sms templates.
|
|
4160
3571
|
*/
|
|
4161
|
-
getSmsTemplatesPaginator({
|
|
4162
|
-
companyId,
|
|
4163
|
-
applicationId,
|
|
4164
|
-
pageSize,
|
|
4165
|
-
sort,
|
|
4166
|
-
query,
|
|
4167
|
-
} = {}) {
|
|
3572
|
+
getSmsTemplatesPaginator({ companyId, applicationId, pageSize, sort } = {}) {
|
|
4168
3573
|
const paginator = new Paginator();
|
|
4169
3574
|
const callback = async () => {
|
|
4170
3575
|
const pageId = paginator.nextId;
|
|
@@ -4176,7 +3581,6 @@ class Communication {
|
|
|
4176
3581
|
pageNo: pageNo,
|
|
4177
3582
|
pageSize: pageSize,
|
|
4178
3583
|
sort: sort,
|
|
4179
|
-
query: query,
|
|
4180
3584
|
});
|
|
4181
3585
|
paginator.setPaginator({
|
|
4182
3586
|
hasNext: data.page.has_next ? true : false,
|
|
@@ -4281,7 +3685,7 @@ class Communication {
|
|
|
4281
3685
|
* @description: Email templates are predefined formats linked to various events for delivering messages to users. Use this API to get all subscribed email templates. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/communication/getSubscribedEmailTemplates/).
|
|
4282
3686
|
*/
|
|
4283
3687
|
async getSubscribedEmailTemplates(
|
|
4284
|
-
{ pageNo, pageSize,
|
|
3688
|
+
{ pageNo, pageSize, requestHeaders } = { requestHeaders: {} },
|
|
4285
3689
|
{ responseHeaders } = { responseHeaders: false }
|
|
4286
3690
|
) {
|
|
4287
3691
|
const {
|
|
@@ -4290,7 +3694,6 @@ class Communication {
|
|
|
4290
3694
|
{
|
|
4291
3695
|
pageNo,
|
|
4292
3696
|
pageSize,
|
|
4293
|
-
query,
|
|
4294
3697
|
},
|
|
4295
3698
|
{ abortEarly: false, allowUnknown: true }
|
|
4296
3699
|
);
|
|
@@ -4305,7 +3708,6 @@ class Communication {
|
|
|
4305
3708
|
{
|
|
4306
3709
|
pageNo,
|
|
4307
3710
|
pageSize,
|
|
4308
|
-
query,
|
|
4309
3711
|
},
|
|
4310
3712
|
{ abortEarly: false, allowUnknown: false }
|
|
4311
3713
|
);
|
|
@@ -4319,7 +3721,6 @@ class Communication {
|
|
|
4319
3721
|
const query_params = {};
|
|
4320
3722
|
query_params["page_no"] = pageNo;
|
|
4321
3723
|
query_params["page_size"] = pageSize;
|
|
4322
|
-
query_params["query"] = query;
|
|
4323
3724
|
|
|
4324
3725
|
const response = await PlatformAPIClient.execute(
|
|
4325
3726
|
this.config,
|
|
@@ -4362,7 +3763,6 @@ class Communication {
|
|
|
4362
3763
|
* @param {string} arg.companyId - Company id
|
|
4363
3764
|
* @param {string} arg.applicationId - Application id
|
|
4364
3765
|
* @param {number} [arg.pageSize] - Current request items count
|
|
4365
|
-
* @param {Object} [arg.query] - To search based on plain text
|
|
4366
3766
|
* @returns {Paginator<CommunicationPlatformModel.EmailTemplates>}
|
|
4367
3767
|
* @summary: Get subscribed email templates
|
|
4368
3768
|
* @description: Email templates are predefined formats linked to various events for delivering messages to users. Use this API to get all subscribed email templates.
|
|
@@ -4371,7 +3771,6 @@ class Communication {
|
|
|
4371
3771
|
companyId,
|
|
4372
3772
|
applicationId,
|
|
4373
3773
|
pageSize,
|
|
4374
|
-
query,
|
|
4375
3774
|
} = {}) {
|
|
4376
3775
|
const paginator = new Paginator();
|
|
4377
3776
|
const callback = async () => {
|
|
@@ -4383,7 +3782,6 @@ class Communication {
|
|
|
4383
3782
|
applicationId: applicationId,
|
|
4384
3783
|
pageNo: pageNo,
|
|
4385
3784
|
pageSize: pageSize,
|
|
4386
|
-
query: query,
|
|
4387
3785
|
});
|
|
4388
3786
|
paginator.setPaginator({
|
|
4389
3787
|
hasNext: data.page.has_next ? true : false,
|
|
@@ -4407,7 +3805,7 @@ class Communication {
|
|
|
4407
3805
|
* @description: SMS templates are predefined message formats linked to various events for delivering messages to users. Use this API to get all subscribed sms templates. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/communication/getSubscribedSmsTemplates/).
|
|
4408
3806
|
*/
|
|
4409
3807
|
async getSubscribedSmsTemplates(
|
|
4410
|
-
{ pageNo, pageSize,
|
|
3808
|
+
{ pageNo, pageSize, requestHeaders } = { requestHeaders: {} },
|
|
4411
3809
|
{ responseHeaders } = { responseHeaders: false }
|
|
4412
3810
|
) {
|
|
4413
3811
|
const {
|
|
@@ -4416,7 +3814,6 @@ class Communication {
|
|
|
4416
3814
|
{
|
|
4417
3815
|
pageNo,
|
|
4418
3816
|
pageSize,
|
|
4419
|
-
query,
|
|
4420
3817
|
},
|
|
4421
3818
|
{ abortEarly: false, allowUnknown: true }
|
|
4422
3819
|
);
|
|
@@ -4431,7 +3828,6 @@ class Communication {
|
|
|
4431
3828
|
{
|
|
4432
3829
|
pageNo,
|
|
4433
3830
|
pageSize,
|
|
4434
|
-
query,
|
|
4435
3831
|
},
|
|
4436
3832
|
{ abortEarly: false, allowUnknown: false }
|
|
4437
3833
|
);
|
|
@@ -4445,7 +3841,6 @@ class Communication {
|
|
|
4445
3841
|
const query_params = {};
|
|
4446
3842
|
query_params["page_no"] = pageNo;
|
|
4447
3843
|
query_params["page_size"] = pageSize;
|
|
4448
|
-
query_params["query"] = query;
|
|
4449
3844
|
|
|
4450
3845
|
const response = await PlatformAPIClient.execute(
|
|
4451
3846
|
this.config,
|
|
@@ -4488,7 +3883,6 @@ class Communication {
|
|
|
4488
3883
|
* @param {string} arg.companyId - Company id
|
|
4489
3884
|
* @param {string} arg.applicationId - Application id
|
|
4490
3885
|
* @param {number} [arg.pageSize] - Current request items count
|
|
4491
|
-
* @param {Object} [arg.query] - To search based on plain text
|
|
4492
3886
|
* @returns {Paginator<CommunicationPlatformModel.SmsTemplates>}
|
|
4493
3887
|
* @summary: Get subscribed sms templates
|
|
4494
3888
|
* @description: SMS templates are predefined message formats linked to various events for delivering messages to users. Use this API to get all subscribed sms templates.
|
|
@@ -4497,7 +3891,6 @@ class Communication {
|
|
|
4497
3891
|
companyId,
|
|
4498
3892
|
applicationId,
|
|
4499
3893
|
pageSize,
|
|
4500
|
-
query,
|
|
4501
3894
|
} = {}) {
|
|
4502
3895
|
const paginator = new Paginator();
|
|
4503
3896
|
const callback = async () => {
|
|
@@ -4509,7 +3902,6 @@ class Communication {
|
|
|
4509
3902
|
applicationId: applicationId,
|
|
4510
3903
|
pageNo: pageNo,
|
|
4511
3904
|
pageSize: pageSize,
|
|
4512
|
-
query: query,
|
|
4513
3905
|
});
|
|
4514
3906
|
paginator.setPaginator({
|
|
4515
3907
|
hasNext: data.page.has_next ? true : false,
|
|
@@ -5568,83 +4960,6 @@ class Communication {
|
|
|
5568
4960
|
return response;
|
|
5569
4961
|
}
|
|
5570
4962
|
|
|
5571
|
-
/**
|
|
5572
|
-
* @param {CommunicationPlatformApplicationValidator.UpdateOtpConfigurationParam} arg
|
|
5573
|
-
* - Arg object
|
|
5574
|
-
*
|
|
5575
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
5576
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
5577
|
-
* @returns {Promise<CommunicationPlatformModel.OtpConfiguration>} - Success response
|
|
5578
|
-
* @name updateOtpConfiguration
|
|
5579
|
-
* @summary: Update/insert otp configurations
|
|
5580
|
-
* @description: Update otp-configuration - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/communication/updateOtpConfiguration/).
|
|
5581
|
-
*/
|
|
5582
|
-
async updateOtpConfiguration(
|
|
5583
|
-
{ requestHeaders } = { requestHeaders: {} },
|
|
5584
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
5585
|
-
) {
|
|
5586
|
-
const {
|
|
5587
|
-
error,
|
|
5588
|
-
} = CommunicationPlatformApplicationValidator.updateOtpConfiguration().validate(
|
|
5589
|
-
{},
|
|
5590
|
-
{ abortEarly: false, allowUnknown: true }
|
|
5591
|
-
);
|
|
5592
|
-
if (error) {
|
|
5593
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
5594
|
-
}
|
|
5595
|
-
|
|
5596
|
-
// Showing warrnings if extra unknown parameters are found
|
|
5597
|
-
const {
|
|
5598
|
-
error: warrning,
|
|
5599
|
-
} = CommunicationPlatformApplicationValidator.updateOtpConfiguration().validate(
|
|
5600
|
-
{},
|
|
5601
|
-
{ abortEarly: false, allowUnknown: false }
|
|
5602
|
-
);
|
|
5603
|
-
if (warrning) {
|
|
5604
|
-
Logger({
|
|
5605
|
-
level: "WARN",
|
|
5606
|
-
message: `Parameter Validation warrnings for platform > Communication > updateOtpConfiguration \n ${warrning}`,
|
|
5607
|
-
});
|
|
5608
|
-
}
|
|
5609
|
-
|
|
5610
|
-
const query_params = {};
|
|
5611
|
-
|
|
5612
|
-
const response = await PlatformAPIClient.execute(
|
|
5613
|
-
this.config,
|
|
5614
|
-
"put",
|
|
5615
|
-
`/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/otp/otp-configuration`,
|
|
5616
|
-
query_params,
|
|
5617
|
-
undefined,
|
|
5618
|
-
requestHeaders,
|
|
5619
|
-
{ responseHeaders }
|
|
5620
|
-
);
|
|
5621
|
-
|
|
5622
|
-
let responseData = response;
|
|
5623
|
-
if (responseHeaders) {
|
|
5624
|
-
responseData = response[0];
|
|
5625
|
-
}
|
|
5626
|
-
|
|
5627
|
-
const {
|
|
5628
|
-
error: res_error,
|
|
5629
|
-
} = CommunicationPlatformModel.OtpConfiguration().validate(responseData, {
|
|
5630
|
-
abortEarly: false,
|
|
5631
|
-
allowUnknown: true,
|
|
5632
|
-
});
|
|
5633
|
-
|
|
5634
|
-
if (res_error) {
|
|
5635
|
-
if (this.config.options.strictResponseCheck === true) {
|
|
5636
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
5637
|
-
} else {
|
|
5638
|
-
Logger({
|
|
5639
|
-
level: "WARN",
|
|
5640
|
-
message: `Response Validation Warnings for platform > Communication > updateOtpConfiguration \n ${res_error}`,
|
|
5641
|
-
});
|
|
5642
|
-
}
|
|
5643
|
-
}
|
|
5644
|
-
|
|
5645
|
-
return response;
|
|
5646
|
-
}
|
|
5647
|
-
|
|
5648
4963
|
/**
|
|
5649
4964
|
* @param {CommunicationPlatformApplicationValidator.UpdateSmsProviderByIdParam} arg
|
|
5650
4965
|
* - Arg object
|