@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 RewardsPlatformApplicationValidator = require("./RewardsPlatformApplicationValidator");
|
|
5
|
+
const RewardsPlatformModel = require("./RewardsPlatformModel");
|
|
6
6
|
const { Logger } = require("./../../common/Logger");
|
|
7
7
|
const Joi = require("joi");
|
|
8
8
|
|
|
@@ -13,14 +13,17 @@ class Rewards {
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
|
-
* @param {
|
|
17
|
-
* @param {
|
|
18
|
-
* @returns {Promise<Giveaway>} - Success response
|
|
16
|
+
* @param {RewardsPlatformApplicationValidator.GetGiveawayByIdParam} arg - Arg object
|
|
17
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
18
|
+
* @returns {Promise<RewardsPlatformModel.Giveaway>} - Success response
|
|
19
|
+
* @name getGiveawayById
|
|
19
20
|
* @summary: Get giveaway by ID.
|
|
20
|
-
* @description: Retrieve the specific giveaway by giveaway ID. It will show all the details of the requested giveaway.
|
|
21
|
+
* @description: Retrieve the specific giveaway by giveaway ID. It will show all the details of the requested giveaway. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/rewards/getGiveawayById/).
|
|
21
22
|
*/
|
|
22
|
-
async getGiveawayById({ id } = {}) {
|
|
23
|
-
const {
|
|
23
|
+
async getGiveawayById({ id } = {}, { headers } = { headers: false }) {
|
|
24
|
+
const {
|
|
25
|
+
error,
|
|
26
|
+
} = RewardsPlatformApplicationValidator.getGiveawayById().validate(
|
|
24
27
|
{
|
|
25
28
|
id,
|
|
26
29
|
},
|
|
@@ -31,7 +34,9 @@ class Rewards {
|
|
|
31
34
|
}
|
|
32
35
|
|
|
33
36
|
// Showing warrnings if extra unknown parameters are found
|
|
34
|
-
const {
|
|
37
|
+
const {
|
|
38
|
+
error: warrning,
|
|
39
|
+
} = RewardsPlatformApplicationValidator.getGiveawayById().validate(
|
|
35
40
|
{
|
|
36
41
|
id,
|
|
37
42
|
},
|
|
@@ -40,9 +45,8 @@ class Rewards {
|
|
|
40
45
|
if (warrning) {
|
|
41
46
|
Logger({
|
|
42
47
|
level: "WARN",
|
|
43
|
-
message:
|
|
48
|
+
message: `Parameter Validation warrnings for platform > Rewards > getGiveawayById \n ${warrning}`,
|
|
44
49
|
});
|
|
45
|
-
Logger({ level: "WARN", message: warrning });
|
|
46
50
|
}
|
|
47
51
|
|
|
48
52
|
const query_params = {};
|
|
@@ -52,10 +56,19 @@ class Rewards {
|
|
|
52
56
|
"get",
|
|
53
57
|
`/service/platform/rewards/v1.0/company/${this.config.companyId}/application/${this.applicationId}/giveaways/${id}`,
|
|
54
58
|
query_params,
|
|
55
|
-
undefined
|
|
59
|
+
undefined,
|
|
60
|
+
undefined,
|
|
61
|
+
{ headers }
|
|
56
62
|
);
|
|
57
63
|
|
|
58
|
-
|
|
64
|
+
let responseData = response;
|
|
65
|
+
if (headers) {
|
|
66
|
+
responseData = response[0];
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const {
|
|
70
|
+
error: res_error,
|
|
71
|
+
} = RewardsPlatformModel.Giveaway().validate(responseData, {
|
|
59
72
|
abortEarly: false,
|
|
60
73
|
allowUnknown: false,
|
|
61
74
|
});
|
|
@@ -63,23 +76,25 @@ class Rewards {
|
|
|
63
76
|
if (res_error) {
|
|
64
77
|
Logger({
|
|
65
78
|
level: "WARN",
|
|
66
|
-
message:
|
|
79
|
+
message: `Response Validation Warnnings for platform > Rewards > getGiveawayById \n ${res_error}`,
|
|
67
80
|
});
|
|
68
|
-
Logger({ level: "WARN", message: res_error });
|
|
69
81
|
}
|
|
70
82
|
|
|
71
83
|
return response;
|
|
72
84
|
}
|
|
73
85
|
|
|
74
86
|
/**
|
|
75
|
-
* @param {
|
|
76
|
-
* @param {
|
|
77
|
-
* @returns {Promise<Offer>} - Success response
|
|
87
|
+
* @param {RewardsPlatformApplicationValidator.GetOfferByNameParam} arg - Arg object
|
|
88
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
89
|
+
* @returns {Promise<RewardsPlatformModel.Offer>} - Success response
|
|
90
|
+
* @name getOfferByName
|
|
78
91
|
* @summary: Fetch a offer by its name
|
|
79
|
-
* @description: Fetch the specific offer details and configuration by the name of the offer.
|
|
92
|
+
* @description: Fetch the specific offer details and configuration by the name of the offer. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/rewards/getOfferByName/).
|
|
80
93
|
*/
|
|
81
|
-
async getOfferByName({ name } = {}) {
|
|
82
|
-
const {
|
|
94
|
+
async getOfferByName({ name } = {}, { headers } = { headers: false }) {
|
|
95
|
+
const {
|
|
96
|
+
error,
|
|
97
|
+
} = RewardsPlatformApplicationValidator.getOfferByName().validate(
|
|
83
98
|
{ name },
|
|
84
99
|
{ abortEarly: false, allowUnknown: true }
|
|
85
100
|
);
|
|
@@ -88,16 +103,17 @@ class Rewards {
|
|
|
88
103
|
}
|
|
89
104
|
|
|
90
105
|
// Showing warrnings if extra unknown parameters are found
|
|
91
|
-
const {
|
|
106
|
+
const {
|
|
107
|
+
error: warrning,
|
|
108
|
+
} = RewardsPlatformApplicationValidator.getOfferByName().validate(
|
|
92
109
|
{ name },
|
|
93
110
|
{ abortEarly: false, allowUnknown: false }
|
|
94
111
|
);
|
|
95
112
|
if (warrning) {
|
|
96
113
|
Logger({
|
|
97
114
|
level: "WARN",
|
|
98
|
-
message:
|
|
115
|
+
message: `Parameter Validation warrnings for platform > Rewards > getOfferByName \n ${warrning}`,
|
|
99
116
|
});
|
|
100
|
-
Logger({ level: "WARN", message: warrning });
|
|
101
117
|
}
|
|
102
118
|
|
|
103
119
|
const query_params = {};
|
|
@@ -107,10 +123,19 @@ class Rewards {
|
|
|
107
123
|
"get",
|
|
108
124
|
`/service/platform/rewards/v1.0/company/${this.config.companyId}/application/${this.applicationId}/offers/${name}/`,
|
|
109
125
|
query_params,
|
|
110
|
-
undefined
|
|
126
|
+
undefined,
|
|
127
|
+
undefined,
|
|
128
|
+
{ headers }
|
|
111
129
|
);
|
|
112
130
|
|
|
113
|
-
|
|
131
|
+
let responseData = response;
|
|
132
|
+
if (headers) {
|
|
133
|
+
responseData = response[0];
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
const {
|
|
137
|
+
error: res_error,
|
|
138
|
+
} = RewardsPlatformModel.Offer().validate(responseData, {
|
|
114
139
|
abortEarly: false,
|
|
115
140
|
allowUnknown: false,
|
|
116
141
|
});
|
|
@@ -118,22 +143,24 @@ class Rewards {
|
|
|
118
143
|
if (res_error) {
|
|
119
144
|
Logger({
|
|
120
145
|
level: "WARN",
|
|
121
|
-
message:
|
|
146
|
+
message: `Response Validation Warnnings for platform > Rewards > getOfferByName \n ${res_error}`,
|
|
122
147
|
});
|
|
123
|
-
Logger({ level: "WARN", message: res_error });
|
|
124
148
|
}
|
|
125
149
|
|
|
126
150
|
return response;
|
|
127
151
|
}
|
|
128
152
|
|
|
129
153
|
/**
|
|
130
|
-
* @param {
|
|
131
|
-
* @returns {Promise<ConfigurationRes>} - Success response
|
|
154
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
155
|
+
* @returns {Promise<RewardsPlatformModel.ConfigurationRes>} - Success response
|
|
156
|
+
* @name getRewardsConfiguration
|
|
132
157
|
* @summary: Get all valid android paths
|
|
133
|
-
* @description: Use this API to get a list of valid android paths required by the Rewards INIT API to validate a fraudulent device.
|
|
158
|
+
* @description: Use this API to get a list of valid android paths required by the Rewards INIT API to validate a fraudulent device. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/rewards/getRewardsConfiguration/).
|
|
134
159
|
*/
|
|
135
|
-
async getRewardsConfiguration({} = {}) {
|
|
136
|
-
const {
|
|
160
|
+
async getRewardsConfiguration({ headers } = { headers: false }) {
|
|
161
|
+
const {
|
|
162
|
+
error,
|
|
163
|
+
} = RewardsPlatformApplicationValidator.getRewardsConfiguration().validate(
|
|
137
164
|
{},
|
|
138
165
|
{ abortEarly: false, allowUnknown: true }
|
|
139
166
|
);
|
|
@@ -144,16 +171,15 @@ class Rewards {
|
|
|
144
171
|
// Showing warrnings if extra unknown parameters are found
|
|
145
172
|
const {
|
|
146
173
|
error: warrning,
|
|
147
|
-
} =
|
|
174
|
+
} = RewardsPlatformApplicationValidator.getRewardsConfiguration().validate(
|
|
148
175
|
{},
|
|
149
176
|
{ abortEarly: false, allowUnknown: false }
|
|
150
177
|
);
|
|
151
178
|
if (warrning) {
|
|
152
179
|
Logger({
|
|
153
180
|
level: "WARN",
|
|
154
|
-
message:
|
|
181
|
+
message: `Parameter Validation warrnings for platform > Rewards > getRewardsConfiguration \n ${warrning}`,
|
|
155
182
|
});
|
|
156
|
-
Logger({ level: "WARN", message: warrning });
|
|
157
183
|
}
|
|
158
184
|
|
|
159
185
|
const query_params = {};
|
|
@@ -163,12 +189,19 @@ class Rewards {
|
|
|
163
189
|
"get",
|
|
164
190
|
`/service/platform/rewards/v1.0/company/${this.config.companyId}/application/${this.applicationId}/configuration/`,
|
|
165
191
|
query_params,
|
|
166
|
-
undefined
|
|
192
|
+
undefined,
|
|
193
|
+
undefined,
|
|
194
|
+
{ headers }
|
|
167
195
|
);
|
|
168
196
|
|
|
197
|
+
let responseData = response;
|
|
198
|
+
if (headers) {
|
|
199
|
+
responseData = response[0];
|
|
200
|
+
}
|
|
201
|
+
|
|
169
202
|
const {
|
|
170
203
|
error: res_error,
|
|
171
|
-
} =
|
|
204
|
+
} = RewardsPlatformModel.ConfigurationRes().validate(responseData, {
|
|
172
205
|
abortEarly: false,
|
|
173
206
|
allowUnknown: false,
|
|
174
207
|
});
|
|
@@ -176,23 +209,25 @@ class Rewards {
|
|
|
176
209
|
if (res_error) {
|
|
177
210
|
Logger({
|
|
178
211
|
level: "WARN",
|
|
179
|
-
message:
|
|
212
|
+
message: `Response Validation Warnnings for platform > Rewards > getRewardsConfiguration \n ${res_error}`,
|
|
180
213
|
});
|
|
181
|
-
Logger({ level: "WARN", message: res_error });
|
|
182
214
|
}
|
|
183
215
|
|
|
184
216
|
return response;
|
|
185
217
|
}
|
|
186
218
|
|
|
187
219
|
/**
|
|
188
|
-
* @param {
|
|
189
|
-
* @param {
|
|
190
|
-
* @returns {Promise<UserRes>} - Success response
|
|
220
|
+
* @param {RewardsPlatformApplicationValidator.GetUserDetailsParam} arg - Arg object
|
|
221
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
222
|
+
* @returns {Promise<RewardsPlatformModel.UserRes>} - Success response
|
|
223
|
+
* @name getUserDetails
|
|
191
224
|
* @summary: Get user reward details
|
|
192
|
-
* @description: Fetches the user details and the user reward details with their current reward points for the specific user.
|
|
225
|
+
* @description: Fetches the user details and the user reward details with their current reward points for the specific user. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/rewards/getUserDetails/).
|
|
193
226
|
*/
|
|
194
|
-
async getUserDetails({ userId } = {}) {
|
|
195
|
-
const {
|
|
227
|
+
async getUserDetails({ userId } = {}, { headers } = { headers: false }) {
|
|
228
|
+
const {
|
|
229
|
+
error,
|
|
230
|
+
} = RewardsPlatformApplicationValidator.getUserDetails().validate(
|
|
196
231
|
{ userId },
|
|
197
232
|
{ abortEarly: false, allowUnknown: true }
|
|
198
233
|
);
|
|
@@ -201,16 +236,17 @@ class Rewards {
|
|
|
201
236
|
}
|
|
202
237
|
|
|
203
238
|
// Showing warrnings if extra unknown parameters are found
|
|
204
|
-
const {
|
|
239
|
+
const {
|
|
240
|
+
error: warrning,
|
|
241
|
+
} = RewardsPlatformApplicationValidator.getUserDetails().validate(
|
|
205
242
|
{ userId },
|
|
206
243
|
{ abortEarly: false, allowUnknown: false }
|
|
207
244
|
);
|
|
208
245
|
if (warrning) {
|
|
209
246
|
Logger({
|
|
210
247
|
level: "WARN",
|
|
211
|
-
message:
|
|
248
|
+
message: `Parameter Validation warrnings for platform > Rewards > getUserDetails \n ${warrning}`,
|
|
212
249
|
});
|
|
213
|
-
Logger({ level: "WARN", message: warrning });
|
|
214
250
|
}
|
|
215
251
|
|
|
216
252
|
const query_params = {};
|
|
@@ -220,10 +256,19 @@ class Rewards {
|
|
|
220
256
|
"get",
|
|
221
257
|
`/service/platform/rewards/v1.0/company/${this.config.companyId}/application/${this.applicationId}/users/${userId}/`,
|
|
222
258
|
query_params,
|
|
223
|
-
undefined
|
|
259
|
+
undefined,
|
|
260
|
+
undefined,
|
|
261
|
+
{ headers }
|
|
224
262
|
);
|
|
225
263
|
|
|
226
|
-
|
|
264
|
+
let responseData = response;
|
|
265
|
+
if (headers) {
|
|
266
|
+
responseData = response[0];
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
const {
|
|
270
|
+
error: res_error,
|
|
271
|
+
} = RewardsPlatformModel.UserRes().validate(responseData, {
|
|
227
272
|
abortEarly: false,
|
|
228
273
|
allowUnknown: false,
|
|
229
274
|
});
|
|
@@ -231,31 +276,30 @@ class Rewards {
|
|
|
231
276
|
if (res_error) {
|
|
232
277
|
Logger({
|
|
233
278
|
level: "WARN",
|
|
234
|
-
message:
|
|
279
|
+
message: `Response Validation Warnnings for platform > Rewards > getUserDetails \n ${res_error}`,
|
|
235
280
|
});
|
|
236
|
-
Logger({ level: "WARN", message: res_error });
|
|
237
281
|
}
|
|
238
282
|
|
|
239
283
|
return response;
|
|
240
284
|
}
|
|
241
285
|
|
|
242
286
|
/**
|
|
243
|
-
* @param {
|
|
244
|
-
*
|
|
245
|
-
*
|
|
246
|
-
*
|
|
247
|
-
* @
|
|
248
|
-
* @
|
|
287
|
+
* @param {RewardsPlatformApplicationValidator.GetUserPointsHistoryParam} arg
|
|
288
|
+
* - Arg object
|
|
289
|
+
*
|
|
290
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
291
|
+
* @returns {Promise<RewardsPlatformModel.HistoryRes>} - Success response
|
|
292
|
+
* @name getUserPointsHistory
|
|
249
293
|
* @summary: Get all transactions of reward points
|
|
250
|
-
* @description: Fetches a list of points transactions like giveaway points, signup points, referral points, order earn points, redeem points and expired points.
|
|
294
|
+
* @description: Fetches a list of points transactions like giveaway points, signup points, referral points, order earn points, redeem points and expired points. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/rewards/getUserPointsHistory/).
|
|
251
295
|
*/
|
|
252
|
-
async getUserPointsHistory(
|
|
253
|
-
userId,
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
296
|
+
async getUserPointsHistory(
|
|
297
|
+
{ userId, pageId, pageSize } = {},
|
|
298
|
+
{ headers } = { headers: false }
|
|
299
|
+
) {
|
|
300
|
+
const {
|
|
301
|
+
error,
|
|
302
|
+
} = RewardsPlatformApplicationValidator.getUserPointsHistory().validate(
|
|
259
303
|
{
|
|
260
304
|
userId,
|
|
261
305
|
|
|
@@ -271,7 +315,7 @@ class Rewards {
|
|
|
271
315
|
// Showing warrnings if extra unknown parameters are found
|
|
272
316
|
const {
|
|
273
317
|
error: warrning,
|
|
274
|
-
} =
|
|
318
|
+
} = RewardsPlatformApplicationValidator.getUserPointsHistory().validate(
|
|
275
319
|
{
|
|
276
320
|
userId,
|
|
277
321
|
|
|
@@ -283,9 +327,8 @@ class Rewards {
|
|
|
283
327
|
if (warrning) {
|
|
284
328
|
Logger({
|
|
285
329
|
level: "WARN",
|
|
286
|
-
message:
|
|
330
|
+
message: `Parameter Validation warrnings for platform > Rewards > getUserPointsHistory \n ${warrning}`,
|
|
287
331
|
});
|
|
288
|
-
Logger({ level: "WARN", message: warrning });
|
|
289
332
|
}
|
|
290
333
|
|
|
291
334
|
const query_params = {};
|
|
@@ -297,10 +340,19 @@ class Rewards {
|
|
|
297
340
|
"get",
|
|
298
341
|
`/service/platform/rewards/v1.0/company/${this.config.companyId}/application/${this.applicationId}/users/${userId}/points/history/`,
|
|
299
342
|
query_params,
|
|
300
|
-
undefined
|
|
343
|
+
undefined,
|
|
344
|
+
undefined,
|
|
345
|
+
{ headers }
|
|
301
346
|
);
|
|
302
347
|
|
|
303
|
-
|
|
348
|
+
let responseData = response;
|
|
349
|
+
if (headers) {
|
|
350
|
+
responseData = response[0];
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
const {
|
|
354
|
+
error: res_error,
|
|
355
|
+
} = RewardsPlatformModel.HistoryRes().validate(responseData, {
|
|
304
356
|
abortEarly: false,
|
|
305
357
|
allowUnknown: false,
|
|
306
358
|
});
|
|
@@ -308,9 +360,8 @@ class Rewards {
|
|
|
308
360
|
if (res_error) {
|
|
309
361
|
Logger({
|
|
310
362
|
level: "WARN",
|
|
311
|
-
message:
|
|
363
|
+
message: `Response Validation Warnnings for platform > Rewards > getUserPointsHistory \n ${res_error}`,
|
|
312
364
|
});
|
|
313
|
-
Logger({ level: "WARN", message: res_error });
|
|
314
365
|
}
|
|
315
366
|
|
|
316
367
|
return response;
|
|
@@ -322,6 +373,7 @@ class Rewards {
|
|
|
322
373
|
* @param {string} arg.companyId - Company id
|
|
323
374
|
* @param {string} arg.applicationId - Application id
|
|
324
375
|
* @param {number} [arg.pageSize] - The number of items to retrieve in each page.
|
|
376
|
+
* @returns {Paginator<RewardsPlatformModel.HistoryRes>}
|
|
325
377
|
* @summary: Get all transactions of reward points
|
|
326
378
|
* @description: Fetches a list of points transactions like giveaway points, signup points, referral points, order earn points, redeem points and expired points.
|
|
327
379
|
*/
|
|
@@ -354,14 +406,17 @@ class Rewards {
|
|
|
354
406
|
}
|
|
355
407
|
|
|
356
408
|
/**
|
|
357
|
-
* @param {
|
|
358
|
-
* @param {
|
|
359
|
-
* @returns {Promise<Giveaway>} - Success response
|
|
409
|
+
* @param {RewardsPlatformApplicationValidator.SaveGiveAwayParam} arg - Arg object
|
|
410
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
411
|
+
* @returns {Promise<RewardsPlatformModel.Giveaway>} - Success response
|
|
412
|
+
* @name saveGiveAway
|
|
360
413
|
* @summary: List of giveaways of the current application.
|
|
361
|
-
* @description: Creates a new giveaway in the current application, specifying the target audience, points allocation, as well as the name and display name of the giveaway.
|
|
414
|
+
* @description: Creates a new giveaway in the current application, specifying the target audience, points allocation, as well as the name and display name of the giveaway. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/rewards/saveGiveAway/).
|
|
362
415
|
*/
|
|
363
|
-
async saveGiveAway({ body } = {}) {
|
|
364
|
-
const {
|
|
416
|
+
async saveGiveAway({ body } = {}, { headers } = { headers: false }) {
|
|
417
|
+
const {
|
|
418
|
+
error,
|
|
419
|
+
} = RewardsPlatformApplicationValidator.saveGiveAway().validate(
|
|
365
420
|
{
|
|
366
421
|
body,
|
|
367
422
|
},
|
|
@@ -372,7 +427,9 @@ class Rewards {
|
|
|
372
427
|
}
|
|
373
428
|
|
|
374
429
|
// Showing warrnings if extra unknown parameters are found
|
|
375
|
-
const {
|
|
430
|
+
const {
|
|
431
|
+
error: warrning,
|
|
432
|
+
} = RewardsPlatformApplicationValidator.saveGiveAway().validate(
|
|
376
433
|
{
|
|
377
434
|
body,
|
|
378
435
|
},
|
|
@@ -381,9 +438,8 @@ class Rewards {
|
|
|
381
438
|
if (warrning) {
|
|
382
439
|
Logger({
|
|
383
440
|
level: "WARN",
|
|
384
|
-
message:
|
|
441
|
+
message: `Parameter Validation warrnings for platform > Rewards > saveGiveAway \n ${warrning}`,
|
|
385
442
|
});
|
|
386
|
-
Logger({ level: "WARN", message: warrning });
|
|
387
443
|
}
|
|
388
444
|
|
|
389
445
|
const query_params = {};
|
|
@@ -393,10 +449,19 @@ class Rewards {
|
|
|
393
449
|
"post",
|
|
394
450
|
`/service/platform/rewards/v1.0/company/${this.config.companyId}/application/${this.applicationId}/giveaways`,
|
|
395
451
|
query_params,
|
|
396
|
-
body
|
|
452
|
+
body,
|
|
453
|
+
undefined,
|
|
454
|
+
{ headers }
|
|
397
455
|
);
|
|
398
456
|
|
|
399
|
-
|
|
457
|
+
let responseData = response;
|
|
458
|
+
if (headers) {
|
|
459
|
+
responseData = response[0];
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
const {
|
|
463
|
+
error: res_error,
|
|
464
|
+
} = RewardsPlatformModel.Giveaway().validate(responseData, {
|
|
400
465
|
abortEarly: false,
|
|
401
466
|
allowUnknown: false,
|
|
402
467
|
});
|
|
@@ -404,23 +469,30 @@ class Rewards {
|
|
|
404
469
|
if (res_error) {
|
|
405
470
|
Logger({
|
|
406
471
|
level: "WARN",
|
|
407
|
-
message:
|
|
472
|
+
message: `Response Validation Warnnings for platform > Rewards > saveGiveAway \n ${res_error}`,
|
|
408
473
|
});
|
|
409
|
-
Logger({ level: "WARN", message: res_error });
|
|
410
474
|
}
|
|
411
475
|
|
|
412
476
|
return response;
|
|
413
477
|
}
|
|
414
478
|
|
|
415
479
|
/**
|
|
416
|
-
* @param {
|
|
417
|
-
*
|
|
418
|
-
*
|
|
480
|
+
* @param {RewardsPlatformApplicationValidator.SetRewardsConfigurationParam} arg
|
|
481
|
+
* - Arg object
|
|
482
|
+
*
|
|
483
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
484
|
+
* @returns {Promise<RewardsPlatformModel.SetConfigurationRes>} - Success response
|
|
485
|
+
* @name setRewardsConfiguration
|
|
419
486
|
* @summary: Updates the collection with given android paths.
|
|
420
|
-
* @description: Updates the configuration or inserts new records with the given android paths.
|
|
487
|
+
* @description: Updates the configuration or inserts new records with the given android paths. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/rewards/setRewardsConfiguration/).
|
|
421
488
|
*/
|
|
422
|
-
async setRewardsConfiguration(
|
|
423
|
-
|
|
489
|
+
async setRewardsConfiguration(
|
|
490
|
+
{ body } = {},
|
|
491
|
+
{ headers } = { headers: false }
|
|
492
|
+
) {
|
|
493
|
+
const {
|
|
494
|
+
error,
|
|
495
|
+
} = RewardsPlatformApplicationValidator.setRewardsConfiguration().validate(
|
|
424
496
|
{
|
|
425
497
|
body,
|
|
426
498
|
},
|
|
@@ -433,7 +505,7 @@ class Rewards {
|
|
|
433
505
|
// Showing warrnings if extra unknown parameters are found
|
|
434
506
|
const {
|
|
435
507
|
error: warrning,
|
|
436
|
-
} =
|
|
508
|
+
} = RewardsPlatformApplicationValidator.setRewardsConfiguration().validate(
|
|
437
509
|
{
|
|
438
510
|
body,
|
|
439
511
|
},
|
|
@@ -442,9 +514,8 @@ class Rewards {
|
|
|
442
514
|
if (warrning) {
|
|
443
515
|
Logger({
|
|
444
516
|
level: "WARN",
|
|
445
|
-
message:
|
|
517
|
+
message: `Parameter Validation warrnings for platform > Rewards > setRewardsConfiguration \n ${warrning}`,
|
|
446
518
|
});
|
|
447
|
-
Logger({ level: "WARN", message: warrning });
|
|
448
519
|
}
|
|
449
520
|
|
|
450
521
|
const query_params = {};
|
|
@@ -454,12 +525,19 @@ class Rewards {
|
|
|
454
525
|
"post",
|
|
455
526
|
`/service/platform/rewards/v1.0/company/${this.config.companyId}/application/${this.applicationId}/configuration/`,
|
|
456
527
|
query_params,
|
|
457
|
-
body
|
|
528
|
+
body,
|
|
529
|
+
undefined,
|
|
530
|
+
{ headers }
|
|
458
531
|
);
|
|
459
532
|
|
|
533
|
+
let responseData = response;
|
|
534
|
+
if (headers) {
|
|
535
|
+
responseData = response[0];
|
|
536
|
+
}
|
|
537
|
+
|
|
460
538
|
const {
|
|
461
539
|
error: res_error,
|
|
462
|
-
} =
|
|
540
|
+
} = RewardsPlatformModel.SetConfigurationRes().validate(responseData, {
|
|
463
541
|
abortEarly: false,
|
|
464
542
|
allowUnknown: false,
|
|
465
543
|
});
|
|
@@ -467,24 +545,28 @@ class Rewards {
|
|
|
467
545
|
if (res_error) {
|
|
468
546
|
Logger({
|
|
469
547
|
level: "WARN",
|
|
470
|
-
message:
|
|
548
|
+
message: `Response Validation Warnnings for platform > Rewards > setRewardsConfiguration \n ${res_error}`,
|
|
471
549
|
});
|
|
472
|
-
Logger({ level: "WARN", message: res_error });
|
|
473
550
|
}
|
|
474
551
|
|
|
475
552
|
return response;
|
|
476
553
|
}
|
|
477
554
|
|
|
478
555
|
/**
|
|
479
|
-
* @param {
|
|
480
|
-
* @param {
|
|
481
|
-
* @
|
|
482
|
-
* @
|
|
556
|
+
* @param {RewardsPlatformApplicationValidator.ShowGiveawaysParam} arg - Arg object
|
|
557
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
558
|
+
* @returns {Promise<RewardsPlatformModel.GiveawayResponse>} - Success response
|
|
559
|
+
* @name showGiveaways
|
|
483
560
|
* @summary: List of giveaways of the current application.
|
|
484
|
-
* @description: Fetch the detailed compilation of live, completed, and scheduled point-based giveaways created.
|
|
561
|
+
* @description: Fetch the detailed compilation of live, completed, and scheduled point-based giveaways created. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/rewards/showGiveaways/).
|
|
485
562
|
*/
|
|
486
|
-
async showGiveaways(
|
|
487
|
-
|
|
563
|
+
async showGiveaways(
|
|
564
|
+
{ pageId, pageSize } = {},
|
|
565
|
+
{ headers } = { headers: false }
|
|
566
|
+
) {
|
|
567
|
+
const {
|
|
568
|
+
error,
|
|
569
|
+
} = RewardsPlatformApplicationValidator.showGiveaways().validate(
|
|
488
570
|
{
|
|
489
571
|
pageId,
|
|
490
572
|
pageSize,
|
|
@@ -496,7 +578,9 @@ class Rewards {
|
|
|
496
578
|
}
|
|
497
579
|
|
|
498
580
|
// Showing warrnings if extra unknown parameters are found
|
|
499
|
-
const {
|
|
581
|
+
const {
|
|
582
|
+
error: warrning,
|
|
583
|
+
} = RewardsPlatformApplicationValidator.showGiveaways().validate(
|
|
500
584
|
{
|
|
501
585
|
pageId,
|
|
502
586
|
pageSize,
|
|
@@ -506,9 +590,8 @@ class Rewards {
|
|
|
506
590
|
if (warrning) {
|
|
507
591
|
Logger({
|
|
508
592
|
level: "WARN",
|
|
509
|
-
message:
|
|
593
|
+
message: `Parameter Validation warrnings for platform > Rewards > showGiveaways \n ${warrning}`,
|
|
510
594
|
});
|
|
511
|
-
Logger({ level: "WARN", message: warrning });
|
|
512
595
|
}
|
|
513
596
|
|
|
514
597
|
const query_params = {};
|
|
@@ -520,12 +603,19 @@ class Rewards {
|
|
|
520
603
|
"get",
|
|
521
604
|
`/service/platform/rewards/v1.0/company/${this.config.companyId}/application/${this.applicationId}/giveaways`,
|
|
522
605
|
query_params,
|
|
523
|
-
undefined
|
|
606
|
+
undefined,
|
|
607
|
+
undefined,
|
|
608
|
+
{ headers }
|
|
524
609
|
);
|
|
525
610
|
|
|
611
|
+
let responseData = response;
|
|
612
|
+
if (headers) {
|
|
613
|
+
responseData = response[0];
|
|
614
|
+
}
|
|
615
|
+
|
|
526
616
|
const {
|
|
527
617
|
error: res_error,
|
|
528
|
-
} =
|
|
618
|
+
} = RewardsPlatformModel.GiveawayResponse().validate(responseData, {
|
|
529
619
|
abortEarly: false,
|
|
530
620
|
allowUnknown: false,
|
|
531
621
|
});
|
|
@@ -533,22 +623,22 @@ class Rewards {
|
|
|
533
623
|
if (res_error) {
|
|
534
624
|
Logger({
|
|
535
625
|
level: "WARN",
|
|
536
|
-
message:
|
|
626
|
+
message: `Response Validation Warnnings for platform > Rewards > showGiveaways \n ${res_error}`,
|
|
537
627
|
});
|
|
538
|
-
Logger({ level: "WARN", message: res_error });
|
|
539
628
|
}
|
|
540
629
|
|
|
541
630
|
return response;
|
|
542
631
|
}
|
|
543
632
|
|
|
544
633
|
/**
|
|
545
|
-
* @param {
|
|
546
|
-
* @returns {Promise<Offer[]>} - Success response
|
|
634
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
635
|
+
* @returns {Promise<RewardsPlatformModel.Offer[]>} - Success response
|
|
636
|
+
* @name showOffers
|
|
547
637
|
* @summary: List of offers of the current application.
|
|
548
|
-
* @description: Retrieve the list of offers within the current application, including order_discount, order, sign_up, and referral, along with their respective details.
|
|
638
|
+
* @description: Retrieve the list of offers within the current application, including order_discount, order, sign_up, and referral, along with their respective details. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/rewards/showOffers/).
|
|
549
639
|
*/
|
|
550
|
-
async showOffers({} = {}) {
|
|
551
|
-
const { error } =
|
|
640
|
+
async showOffers({ headers } = { headers: false }) {
|
|
641
|
+
const { error } = RewardsPlatformApplicationValidator.showOffers().validate(
|
|
552
642
|
{},
|
|
553
643
|
{ abortEarly: false, allowUnknown: true }
|
|
554
644
|
);
|
|
@@ -557,16 +647,17 @@ class Rewards {
|
|
|
557
647
|
}
|
|
558
648
|
|
|
559
649
|
// Showing warrnings if extra unknown parameters are found
|
|
560
|
-
const {
|
|
650
|
+
const {
|
|
651
|
+
error: warrning,
|
|
652
|
+
} = RewardsPlatformApplicationValidator.showOffers().validate(
|
|
561
653
|
{},
|
|
562
654
|
{ abortEarly: false, allowUnknown: false }
|
|
563
655
|
);
|
|
564
656
|
if (warrning) {
|
|
565
657
|
Logger({
|
|
566
658
|
level: "WARN",
|
|
567
|
-
message:
|
|
659
|
+
message: `Parameter Validation warrnings for platform > Rewards > showOffers \n ${warrning}`,
|
|
568
660
|
});
|
|
569
|
-
Logger({ level: "WARN", message: warrning });
|
|
570
661
|
}
|
|
571
662
|
|
|
572
663
|
const query_params = {};
|
|
@@ -576,34 +667,42 @@ class Rewards {
|
|
|
576
667
|
"get",
|
|
577
668
|
`/service/platform/rewards/v1.0/company/${this.config.companyId}/application/${this.applicationId}/offers/`,
|
|
578
669
|
query_params,
|
|
579
|
-
undefined
|
|
670
|
+
undefined,
|
|
671
|
+
undefined,
|
|
672
|
+
{ headers }
|
|
580
673
|
);
|
|
581
674
|
|
|
675
|
+
let responseData = response;
|
|
676
|
+
if (headers) {
|
|
677
|
+
responseData = response[0];
|
|
678
|
+
}
|
|
679
|
+
|
|
582
680
|
const { error: res_error } = Joi.array()
|
|
583
|
-
.items(
|
|
584
|
-
.validate(
|
|
681
|
+
.items(RewardsPlatformModel.Offer())
|
|
682
|
+
.validate(responseData, { abortEarly: false, allowUnknown: false });
|
|
585
683
|
|
|
586
684
|
if (res_error) {
|
|
587
685
|
Logger({
|
|
588
686
|
level: "WARN",
|
|
589
|
-
message:
|
|
687
|
+
message: `Response Validation Warnnings for platform > Rewards > showOffers \n ${res_error}`,
|
|
590
688
|
});
|
|
591
|
-
Logger({ level: "WARN", message: res_error });
|
|
592
689
|
}
|
|
593
690
|
|
|
594
691
|
return response;
|
|
595
692
|
}
|
|
596
693
|
|
|
597
694
|
/**
|
|
598
|
-
* @param {
|
|
599
|
-
* @param {
|
|
600
|
-
* @
|
|
601
|
-
* @
|
|
695
|
+
* @param {RewardsPlatformApplicationValidator.UpdateGiveAwayParam} arg - Arg object
|
|
696
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
697
|
+
* @returns {Promise<RewardsPlatformModel.Giveaway>} - Success response
|
|
698
|
+
* @name updateGiveAway
|
|
602
699
|
* @summary: Updates the giveaway by it's ID.
|
|
603
|
-
* @description: Make the necessary updates to the giveaway based on its giveaway ID.
|
|
700
|
+
* @description: Make the necessary updates to the giveaway based on its giveaway ID. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/rewards/updateGiveAway/).
|
|
604
701
|
*/
|
|
605
|
-
async updateGiveAway({ id, body } = {}) {
|
|
606
|
-
const {
|
|
702
|
+
async updateGiveAway({ id, body } = {}, { headers } = { headers: false }) {
|
|
703
|
+
const {
|
|
704
|
+
error,
|
|
705
|
+
} = RewardsPlatformApplicationValidator.updateGiveAway().validate(
|
|
607
706
|
{
|
|
608
707
|
id,
|
|
609
708
|
body,
|
|
@@ -615,7 +714,9 @@ class Rewards {
|
|
|
615
714
|
}
|
|
616
715
|
|
|
617
716
|
// Showing warrnings if extra unknown parameters are found
|
|
618
|
-
const {
|
|
717
|
+
const {
|
|
718
|
+
error: warrning,
|
|
719
|
+
} = RewardsPlatformApplicationValidator.updateGiveAway().validate(
|
|
619
720
|
{
|
|
620
721
|
id,
|
|
621
722
|
body,
|
|
@@ -625,9 +726,8 @@ class Rewards {
|
|
|
625
726
|
if (warrning) {
|
|
626
727
|
Logger({
|
|
627
728
|
level: "WARN",
|
|
628
|
-
message:
|
|
729
|
+
message: `Parameter Validation warrnings for platform > Rewards > updateGiveAway \n ${warrning}`,
|
|
629
730
|
});
|
|
630
|
-
Logger({ level: "WARN", message: warrning });
|
|
631
731
|
}
|
|
632
732
|
|
|
633
733
|
const query_params = {};
|
|
@@ -637,10 +737,19 @@ class Rewards {
|
|
|
637
737
|
"put",
|
|
638
738
|
`/service/platform/rewards/v1.0/company/${this.config.companyId}/application/${this.applicationId}/giveaways/${id}`,
|
|
639
739
|
query_params,
|
|
640
|
-
body
|
|
740
|
+
body,
|
|
741
|
+
undefined,
|
|
742
|
+
{ headers }
|
|
641
743
|
);
|
|
642
744
|
|
|
643
|
-
|
|
745
|
+
let responseData = response;
|
|
746
|
+
if (headers) {
|
|
747
|
+
responseData = response[0];
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
const {
|
|
751
|
+
error: res_error,
|
|
752
|
+
} = RewardsPlatformModel.Giveaway().validate(responseData, {
|
|
644
753
|
abortEarly: false,
|
|
645
754
|
allowUnknown: false,
|
|
646
755
|
});
|
|
@@ -648,28 +757,30 @@ class Rewards {
|
|
|
648
757
|
if (res_error) {
|
|
649
758
|
Logger({
|
|
650
759
|
level: "WARN",
|
|
651
|
-
message:
|
|
760
|
+
message: `Response Validation Warnnings for platform > Rewards > updateGiveAway \n ${res_error}`,
|
|
652
761
|
});
|
|
653
|
-
Logger({ level: "WARN", message: res_error });
|
|
654
762
|
}
|
|
655
763
|
|
|
656
764
|
return response;
|
|
657
765
|
}
|
|
658
766
|
|
|
659
767
|
/**
|
|
660
|
-
* @param {
|
|
661
|
-
*
|
|
662
|
-
*
|
|
663
|
-
* @
|
|
768
|
+
* @param {RewardsPlatformApplicationValidator.UpdateOfferByNameParam} arg
|
|
769
|
+
* - Arg object
|
|
770
|
+
*
|
|
771
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
772
|
+
* @returns {Promise<RewardsPlatformModel.Offer>} - Success response
|
|
773
|
+
* @name updateOfferByName
|
|
664
774
|
* @summary: Update offer by name
|
|
665
|
-
* @description: Update the specific offer details and its configuration by offer name.
|
|
775
|
+
* @description: Update the specific offer details and its configuration by offer name. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/rewards/updateOfferByName/).
|
|
666
776
|
*/
|
|
667
|
-
async updateOfferByName(
|
|
668
|
-
name,
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
777
|
+
async updateOfferByName(
|
|
778
|
+
{ name, body } = {},
|
|
779
|
+
{ headers } = { headers: false }
|
|
780
|
+
) {
|
|
781
|
+
const {
|
|
782
|
+
error,
|
|
783
|
+
} = RewardsPlatformApplicationValidator.updateOfferByName().validate(
|
|
673
784
|
{
|
|
674
785
|
name,
|
|
675
786
|
|
|
@@ -682,7 +793,9 @@ class Rewards {
|
|
|
682
793
|
}
|
|
683
794
|
|
|
684
795
|
// Showing warrnings if extra unknown parameters are found
|
|
685
|
-
const {
|
|
796
|
+
const {
|
|
797
|
+
error: warrning,
|
|
798
|
+
} = RewardsPlatformApplicationValidator.updateOfferByName().validate(
|
|
686
799
|
{
|
|
687
800
|
name,
|
|
688
801
|
|
|
@@ -693,9 +806,8 @@ class Rewards {
|
|
|
693
806
|
if (warrning) {
|
|
694
807
|
Logger({
|
|
695
808
|
level: "WARN",
|
|
696
|
-
message:
|
|
809
|
+
message: `Parameter Validation warrnings for platform > Rewards > updateOfferByName \n ${warrning}`,
|
|
697
810
|
});
|
|
698
|
-
Logger({ level: "WARN", message: warrning });
|
|
699
811
|
}
|
|
700
812
|
|
|
701
813
|
const query_params = {};
|
|
@@ -705,10 +817,19 @@ class Rewards {
|
|
|
705
817
|
"put",
|
|
706
818
|
`/service/platform/rewards/v1.0/company/${this.config.companyId}/application/${this.applicationId}/offers/${name}/`,
|
|
707
819
|
query_params,
|
|
708
|
-
body
|
|
820
|
+
body,
|
|
821
|
+
undefined,
|
|
822
|
+
{ headers }
|
|
709
823
|
);
|
|
710
824
|
|
|
711
|
-
|
|
825
|
+
let responseData = response;
|
|
826
|
+
if (headers) {
|
|
827
|
+
responseData = response[0];
|
|
828
|
+
}
|
|
829
|
+
|
|
830
|
+
const {
|
|
831
|
+
error: res_error,
|
|
832
|
+
} = RewardsPlatformModel.Offer().validate(responseData, {
|
|
712
833
|
abortEarly: false,
|
|
713
834
|
allowUnknown: false,
|
|
714
835
|
});
|
|
@@ -716,28 +837,28 @@ class Rewards {
|
|
|
716
837
|
if (res_error) {
|
|
717
838
|
Logger({
|
|
718
839
|
level: "WARN",
|
|
719
|
-
message:
|
|
840
|
+
message: `Response Validation Warnnings for platform > Rewards > updateOfferByName \n ${res_error}`,
|
|
720
841
|
});
|
|
721
|
-
Logger({ level: "WARN", message: res_error });
|
|
722
842
|
}
|
|
723
843
|
|
|
724
844
|
return response;
|
|
725
845
|
}
|
|
726
846
|
|
|
727
847
|
/**
|
|
728
|
-
* @param {
|
|
729
|
-
* @param {
|
|
730
|
-
* @
|
|
731
|
-
* @
|
|
848
|
+
* @param {RewardsPlatformApplicationValidator.UpdateUserStatusParam} arg - Arg object
|
|
849
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
850
|
+
* @returns {Promise<RewardsPlatformModel.AppUser>} - Success response
|
|
851
|
+
* @name updateUserStatus
|
|
732
852
|
* @summary: Update user status
|
|
733
|
-
* @description: Update the user status by marking them as a block or unblock. It can be done by changing the active flag in request body.
|
|
853
|
+
* @description: Update the user status by marking them as a block or unblock. It can be done by changing the active flag in request body. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/rewards/updateUserStatus/).
|
|
734
854
|
*/
|
|
735
|
-
async updateUserStatus(
|
|
736
|
-
userId,
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
855
|
+
async updateUserStatus(
|
|
856
|
+
{ userId, body } = {},
|
|
857
|
+
{ headers } = { headers: false }
|
|
858
|
+
) {
|
|
859
|
+
const {
|
|
860
|
+
error,
|
|
861
|
+
} = RewardsPlatformApplicationValidator.updateUserStatus().validate(
|
|
741
862
|
{
|
|
742
863
|
userId,
|
|
743
864
|
|
|
@@ -750,7 +871,9 @@ class Rewards {
|
|
|
750
871
|
}
|
|
751
872
|
|
|
752
873
|
// Showing warrnings if extra unknown parameters are found
|
|
753
|
-
const {
|
|
874
|
+
const {
|
|
875
|
+
error: warrning,
|
|
876
|
+
} = RewardsPlatformApplicationValidator.updateUserStatus().validate(
|
|
754
877
|
{
|
|
755
878
|
userId,
|
|
756
879
|
|
|
@@ -761,9 +884,8 @@ class Rewards {
|
|
|
761
884
|
if (warrning) {
|
|
762
885
|
Logger({
|
|
763
886
|
level: "WARN",
|
|
764
|
-
message:
|
|
887
|
+
message: `Parameter Validation warrnings for platform > Rewards > updateUserStatus \n ${warrning}`,
|
|
765
888
|
});
|
|
766
|
-
Logger({ level: "WARN", message: warrning });
|
|
767
889
|
}
|
|
768
890
|
|
|
769
891
|
const query_params = {};
|
|
@@ -773,10 +895,19 @@ class Rewards {
|
|
|
773
895
|
"patch",
|
|
774
896
|
`/service/platform/rewards/v1.0/company/${this.config.companyId}/application/${this.applicationId}/users/${userId}/`,
|
|
775
897
|
query_params,
|
|
776
|
-
body
|
|
898
|
+
body,
|
|
899
|
+
undefined,
|
|
900
|
+
{ headers }
|
|
777
901
|
);
|
|
778
902
|
|
|
779
|
-
|
|
903
|
+
let responseData = response;
|
|
904
|
+
if (headers) {
|
|
905
|
+
responseData = response[0];
|
|
906
|
+
}
|
|
907
|
+
|
|
908
|
+
const {
|
|
909
|
+
error: res_error,
|
|
910
|
+
} = RewardsPlatformModel.AppUser().validate(responseData, {
|
|
780
911
|
abortEarly: false,
|
|
781
912
|
allowUnknown: false,
|
|
782
913
|
});
|
|
@@ -784,9 +915,8 @@ class Rewards {
|
|
|
784
915
|
if (res_error) {
|
|
785
916
|
Logger({
|
|
786
917
|
level: "WARN",
|
|
787
|
-
message:
|
|
918
|
+
message: `Response Validation Warnnings for platform > Rewards > updateUserStatus \n ${res_error}`,
|
|
788
919
|
});
|
|
789
|
-
Logger({ level: "WARN", message: res_error });
|
|
790
920
|
}
|
|
791
921
|
|
|
792
922
|
return response;
|