@gofynd/fdk-client-javascript 1.1.6 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +52 -3
- package/index.js +0 -3
- package/package.json +1 -2
- package/sdk/application/ApplicationAPIClient.d.ts +15 -1
- package/sdk/application/ApplicationAPIClient.js +12 -3
- package/sdk/application/ApplicationClient.d.ts +36 -6
- package/sdk/application/ApplicationClient.js +30 -43
- package/sdk/application/ApplicationConfig.d.ts +92 -12
- package/sdk/application/ApplicationConfig.js +48 -14
- package/sdk/application/Cart/CartApplicationClient.d.ts +200 -357
- package/sdk/application/Cart/CartApplicationClient.js +711 -483
- package/sdk/application/Cart/CartApplicationModel.d.ts +2054 -96
- package/sdk/application/Cart/CartApplicationModel.js +1224 -93
- package/sdk/application/Cart/CartApplicationValidator.d.ts +508 -30
- package/sdk/application/Cart/CartApplicationValidator.js +270 -15
- package/sdk/application/Catalog/CatalogApplicationClient.d.ts +274 -422
- package/sdk/application/Catalog/CatalogApplicationClient.js +865 -630
- package/sdk/application/Catalog/CatalogApplicationModel.d.ts +2320 -117
- package/sdk/application/Catalog/CatalogApplicationModel.js +1566 -172
- package/sdk/application/Catalog/CatalogApplicationValidator.d.ts +798 -31
- package/sdk/application/Catalog/CatalogApplicationValidator.js +318 -3
- package/sdk/application/Common/CommonApplicationClient.d.ts +16 -21
- package/sdk/application/Common/CommonApplicationClient.js +52 -33
- package/sdk/application/Common/CommonApplicationModel.d.ts +368 -19
- package/sdk/application/Common/CommonApplicationModel.js +192 -40
- package/sdk/application/Common/CommonApplicationValidator.d.ts +42 -4
- package/sdk/application/Common/CommonApplicationValidator.js +21 -3
- package/sdk/application/Communication/CommunicationApplicationClient.d.ts +31 -18
- package/sdk/application/Communication/CommunicationApplicationClient.js +86 -47
- package/sdk/application/Communication/CommunicationApplicationModel.d.ts +157 -14
- package/sdk/application/Communication/CommunicationApplicationModel.js +104 -23
- package/sdk/application/Communication/CommunicationApplicationValidator.d.ts +27 -4
- package/sdk/application/Communication/CommunicationApplicationValidator.js +21 -5
- package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +149 -118
- package/sdk/application/Configuration/ConfigurationApplicationClient.js +457 -260
- package/sdk/application/Configuration/ConfigurationApplicationModel.d.ts +2235 -110
- package/sdk/application/Configuration/ConfigurationApplicationModel.js +1113 -193
- package/sdk/application/Configuration/ConfigurationApplicationValidator.d.ts +160 -8
- package/sdk/application/Configuration/ConfigurationApplicationValidator.js +88 -4
- package/sdk/application/Content/ContentApplicationClient.d.ts +149 -139
- package/sdk/application/Content/ContentApplicationClient.js +489 -278
- package/sdk/application/Content/ContentApplicationModel.d.ts +1010 -105
- package/sdk/application/Content/ContentApplicationModel.js +737 -396
- package/sdk/application/Content/ContentApplicationValidator.d.ts +214 -12
- package/sdk/application/Content/ContentApplicationValidator.js +113 -3
- package/sdk/application/FileStorage/FileStorageApplicationClient.d.ts +23 -29
- package/sdk/application/FileStorage/FileStorageApplicationClient.js +74 -47
- package/sdk/application/FileStorage/FileStorageApplicationModel.d.ts +148 -20
- package/sdk/application/FileStorage/FileStorageApplicationModel.js +100 -87
- package/sdk/application/FileStorage/FileStorageApplicationValidator.d.ts +55 -5
- package/sdk/application/FileStorage/FileStorageApplicationValidator.js +33 -6
- package/sdk/application/Lead/LeadApplicationClient.d.ts +57 -53
- package/sdk/application/Lead/LeadApplicationClient.js +188 -103
- package/sdk/application/Lead/LeadApplicationModel.d.ts +686 -54
- package/sdk/application/Lead/LeadApplicationModel.js +330 -244
- package/sdk/application/Lead/LeadApplicationValidator.d.ts +91 -9
- package/sdk/application/Lead/LeadApplicationValidator.js +51 -6
- package/sdk/application/Logistic/LogisticApplicationClient.d.ts +40 -33
- package/sdk/application/Logistic/LogisticApplicationClient.js +131 -73
- package/sdk/application/Logistic/LogisticApplicationModel.d.ts +399 -28
- package/sdk/application/Logistic/LogisticApplicationModel.js +293 -24
- package/sdk/application/Logistic/LogisticApplicationValidator.d.ts +48 -6
- package/sdk/application/Logistic/LogisticApplicationValidator.js +34 -6
- package/sdk/application/Order/OrderApplicationClient.d.ts +93 -133
- package/sdk/application/Order/OrderApplicationClient.js +329 -217
- package/sdk/application/Order/OrderApplicationModel.d.ts +1101 -66
- package/sdk/application/Order/OrderApplicationModel.js +776 -57
- package/sdk/application/Order/OrderApplicationValidator.d.ts +249 -14
- package/sdk/application/Order/OrderApplicationValidator.js +114 -5
- package/sdk/application/Payment/PaymentApplicationClient.d.ts +400 -366
- package/sdk/application/Payment/PaymentApplicationClient.js +1176 -703
- package/sdk/application/Payment/PaymentApplicationModel.d.ts +3125 -99
- package/sdk/application/Payment/PaymentApplicationModel.js +1158 -62
- package/sdk/application/Payment/PaymentApplicationValidator.d.ts +494 -41
- package/sdk/application/Payment/PaymentApplicationValidator.js +297 -25
- package/sdk/application/PosCart/PosCartApplicationClient.d.ts +205 -350
- package/sdk/application/PosCart/PosCartApplicationClient.js +720 -491
- package/sdk/application/PosCart/PosCartApplicationModel.d.ts +1823 -89
- package/sdk/application/PosCart/PosCartApplicationModel.js +1117 -85
- package/sdk/application/PosCart/PosCartApplicationValidator.d.ts +480 -29
- package/sdk/application/PosCart/PosCartApplicationValidator.js +262 -15
- package/sdk/application/Rewards/RewardsApplicationClient.d.ts +58 -47
- package/sdk/application/Rewards/RewardsApplicationClient.js +187 -102
- package/sdk/application/Rewards/RewardsApplicationModel.d.ts +343 -22
- package/sdk/application/Rewards/RewardsApplicationModel.js +230 -15
- package/sdk/application/Rewards/RewardsApplicationValidator.d.ts +70 -7
- package/sdk/application/Rewards/RewardsApplicationValidator.js +45 -6
- package/sdk/application/Share/ShareApplicationClient.d.ts +52 -50
- package/sdk/application/Share/ShareApplicationClient.js +185 -97
- package/sdk/application/Share/ShareApplicationModel.d.ts +198 -15
- package/sdk/application/Share/ShareApplicationModel.js +131 -31
- package/sdk/application/Share/ShareApplicationValidator.d.ts +86 -8
- package/sdk/application/Share/ShareApplicationValidator.js +48 -4
- package/sdk/application/Theme/ThemeApplicationClient.d.ts +30 -27
- package/sdk/application/Theme/ThemeApplicationClient.js +102 -56
- package/sdk/application/Theme/ThemeApplicationModel.d.ts +1291 -48
- package/sdk/application/Theme/ThemeApplicationModel.js +895 -134
- package/sdk/application/Theme/ThemeApplicationValidator.d.ts +49 -5
- package/sdk/application/Theme/ThemeApplicationValidator.js +26 -3
- package/sdk/application/User/UserApplicationClient.d.ts +260 -305
- package/sdk/application/User/UserApplicationClient.js +910 -522
- package/sdk/application/User/UserApplicationModel.d.ts +992 -101
- package/sdk/application/User/UserApplicationModel.js +699 -248
- package/sdk/application/User/UserApplicationValidator.d.ts +457 -33
- package/sdk/application/User/UserApplicationValidator.js +265 -31
- package/sdk/common/AxiosHelper.js +7 -2
- package/sdk/common/FDKError.d.ts +3 -0
- package/sdk/common/FDKError.js +8 -0
- package/sdk/common/Paginator.d.ts +27 -12
- package/sdk/common/Paginator.js +15 -0
- package/sdk/common/RequestSigner.js +0 -1
- package/sdk/common/utils.d.ts +3 -0
- package/sdk/common/utils.js +29 -0
- package/sdk/partner/PartnerAPIClient.d.ts +16 -1
- package/sdk/partner/PartnerAPIClient.js +12 -2
- package/sdk/partner/PartnerClient.d.ts +22 -3
- package/sdk/partner/PartnerClient.js +20 -0
- package/sdk/partner/PartnerConfig.d.ts +40 -14
- package/sdk/partner/PartnerConfig.js +31 -6
- package/sdk/partner/Theme/ThemePartnerClient.d.ts +299 -0
- package/sdk/partner/Theme/ThemePartnerClient.js +768 -0
- package/sdk/partner/Theme/ThemePartnerModel.d.ts +1706 -0
- package/sdk/partner/Theme/ThemePartnerModel.js +1409 -0
- package/sdk/partner/Theme/ThemePartnerValidator.d.ts +22 -0
- package/sdk/partner/Theme/ThemePartnerValidator.js +157 -0
- package/sdk/partner/index.d.ts +3 -1
- package/sdk/partner/index.js +3 -1
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.d.ts +30 -25
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +104 -53
- package/sdk/platform/AuditTrail/AuditTrailPlatformModel.d.ts +190 -17
- package/sdk/platform/AuditTrail/AuditTrailPlatformModel.js +132 -15
- package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.d.ts +52 -5
- package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.js +30 -4
- package/sdk/platform/Billing/BillingPlatformClient.d.ts +133 -97
- package/sdk/platform/Billing/BillingPlatformClient.js +561 -191
- package/sdk/platform/Billing/BillingPlatformModel.d.ts +1071 -68
- package/sdk/platform/Billing/BillingPlatformModel.js +762 -151
- package/sdk/platform/Billing/BillingPlatformValidator.d.ts +175 -12
- package/sdk/platform/Billing/BillingPlatformValidator.js +118 -8
- package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +454 -635
- package/sdk/platform/Cart/CartPlatformApplicationClient.js +1646 -957
- package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +827 -57
- package/sdk/platform/Cart/CartPlatformApplicationValidator.js +492 -34
- package/sdk/platform/Cart/CartPlatformModel.d.ts +3839 -175
- package/sdk/platform/Cart/CartPlatformModel.js +2423 -217
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +528 -638
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +1600 -984
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +1081 -49
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +482 -23
- package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +652 -826
- package/sdk/platform/Catalog/CatalogPlatformClient.js +1979 -1264
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +6869 -326
- package/sdk/platform/Catalog/CatalogPlatformModel.js +4215 -351
- package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +1361 -71
- package/sdk/platform/Catalog/CatalogPlatformValidator.js +624 -30
- package/sdk/platform/Common/CommonPlatformClient.d.ts +16 -21
- package/sdk/platform/Common/CommonPlatformClient.js +50 -33
- package/sdk/platform/Common/CommonPlatformModel.d.ts +423 -19
- package/sdk/platform/Common/CommonPlatformModel.js +214 -40
- package/sdk/platform/Common/CommonPlatformValidator.d.ts +37 -4
- package/sdk/platform/Common/CommonPlatformValidator.js +20 -3
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +731 -303
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +3095 -785
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.d.ts +699 -41
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.js +463 -27
- package/sdk/platform/Communication/CommunicationPlatformClient.d.ts +19 -5
- package/sdk/platform/Communication/CommunicationPlatformClient.js +59 -19
- package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +1708 -102
- package/sdk/platform/Communication/CommunicationPlatformModel.js +1360 -235
- package/sdk/platform/Communication/CommunicationPlatformValidator.d.ts +16 -3
- package/sdk/platform/Communication/CommunicationPlatformValidator.js +11 -3
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +127 -111
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +435 -225
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +882 -43
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +666 -78
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.d.ts +184 -13
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.js +105 -10
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +327 -240
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +922 -438
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.d.ts +297 -22
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.js +191 -17
- package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +184 -178
- package/sdk/platform/Configuration/ConfigurationPlatformClient.js +555 -311
- package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +4337 -188
- package/sdk/platform/Configuration/ConfigurationPlatformModel.js +2178 -248
- package/sdk/platform/Configuration/ConfigurationPlatformValidator.d.ts +332 -19
- package/sdk/platform/Configuration/ConfigurationPlatformValidator.js +153 -10
- package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +605 -578
- package/sdk/platform/Content/ContentPlatformApplicationClient.js +1996 -987
- package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +872 -62
- package/sdk/platform/Content/ContentPlatformApplicationValidator.js +487 -35
- package/sdk/platform/Content/ContentPlatformModel.d.ts +1472 -108
- package/sdk/platform/Content/ContentPlatformModel.js +1085 -204
- package/sdk/platform/Discount/DiscountPlatformClient.d.ts +85 -82
- package/sdk/platform/Discount/DiscountPlatformClient.js +333 -175
- package/sdk/platform/Discount/DiscountPlatformModel.d.ts +281 -15
- package/sdk/platform/Discount/DiscountPlatformModel.js +189 -10
- package/sdk/platform/Discount/DiscountPlatformValidator.d.ts +185 -13
- package/sdk/platform/Discount/DiscountPlatformValidator.js +88 -8
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +109 -52
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +570 -105
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.d.ts +141 -6
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.js +118 -7
- package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +43 -63
- package/sdk/platform/FileStorage/FileStoragePlatformClient.js +153 -135
- package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +426 -20
- package/sdk/platform/FileStorage/FileStoragePlatformModel.js +379 -40
- package/sdk/platform/FileStorage/FileStoragePlatformValidator.d.ts +106 -8
- package/sdk/platform/FileStorage/FileStoragePlatformValidator.js +60 -8
- package/sdk/platform/Finance/FinancePlatformClient.d.ts +260 -129
- package/sdk/platform/Finance/FinancePlatformClient.js +1182 -194
- package/sdk/platform/Finance/FinancePlatformModel.d.ts +1267 -50
- package/sdk/platform/Finance/FinancePlatformModel.js +1252 -38
- package/sdk/platform/Finance/FinancePlatformValidator.d.ts +233 -15
- package/sdk/platform/Finance/FinancePlatformValidator.js +229 -16
- package/sdk/platform/Inventory/InventoryPlatformClient.d.ts +111 -97
- package/sdk/platform/Inventory/InventoryPlatformClient.js +330 -199
- package/sdk/platform/Inventory/InventoryPlatformModel.d.ts +1354 -61
- package/sdk/platform/Inventory/InventoryPlatformModel.js +916 -83
- package/sdk/platform/Inventory/InventoryPlatformValidator.d.ts +168 -12
- package/sdk/platform/Inventory/InventoryPlatformValidator.js +82 -6
- package/sdk/platform/Lead/LeadPlatformApplicationClient.d.ts +100 -106
- package/sdk/platform/Lead/LeadPlatformApplicationClient.js +372 -186
- package/sdk/platform/Lead/LeadPlatformApplicationValidator.d.ts +180 -14
- package/sdk/platform/Lead/LeadPlatformApplicationValidator.js +94 -9
- package/sdk/platform/Lead/LeadPlatformClient.d.ts +89 -104
- package/sdk/platform/Lead/LeadPlatformClient.js +305 -180
- package/sdk/platform/Lead/LeadPlatformModel.d.ts +1045 -54
- package/sdk/platform/Lead/LeadPlatformModel.js +504 -142
- package/sdk/platform/Lead/LeadPlatformValidator.d.ts +173 -12
- package/sdk/platform/Lead/LeadPlatformValidator.js +92 -15
- package/sdk/platform/OAuthClient.js +6 -2
- package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +20 -14
- package/sdk/platform/Order/OrderPlatformApplicationClient.js +58 -29
- package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +26 -4
- package/sdk/platform/Order/OrderPlatformApplicationValidator.js +16 -3
- package/sdk/platform/Order/OrderPlatformClient.d.ts +437 -556
- package/sdk/platform/Order/OrderPlatformClient.js +1500 -760
- package/sdk/platform/Order/OrderPlatformModel.d.ts +5225 -247
- package/sdk/platform/Order/OrderPlatformModel.js +3473 -260
- package/sdk/platform/Order/OrderPlatformValidator.d.ts +859 -37
- package/sdk/platform/Order/OrderPlatformValidator.js +435 -23
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.d.ts +16 -42
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.js +52 -155
- package/sdk/platform/Partner/PartnerPlatformApplicationValidator.d.ts +37 -6
- package/sdk/platform/Partner/PartnerPlatformApplicationValidator.js +19 -17
- package/sdk/platform/Partner/PartnerPlatformModel.d.ts +78 -45
- package/sdk/platform/Partner/PartnerPlatformModel.js +43 -369
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +418 -288
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +1509 -505
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +438 -30
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +312 -19
- package/sdk/platform/Payment/PaymentPlatformClient.d.ts +83 -73
- package/sdk/platform/Payment/PaymentPlatformClient.js +259 -154
- package/sdk/platform/Payment/PaymentPlatformModel.d.ts +3200 -93
- package/sdk/platform/Payment/PaymentPlatformModel.js +1334 -36
- package/sdk/platform/Payment/PaymentPlatformValidator.d.ts +111 -11
- package/sdk/platform/Payment/PaymentPlatformValidator.js +68 -7
- package/sdk/platform/PlatformAPIClient.d.ts +16 -1
- package/sdk/platform/PlatformAPIClient.js +9 -1
- package/sdk/platform/PlatformApplicationClient.d.ts +22 -1798
- package/sdk/platform/PlatformApplicationClient.js +17 -1899
- package/sdk/platform/PlatformClient.d.ts +31 -12581
- package/sdk/platform/PlatformClient.js +30 -15089
- package/sdk/platform/PlatformConfig.d.ts +37 -11
- package/sdk/platform/PlatformConfig.js +32 -6
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.d.ts +96 -92
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +344 -177
- package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.d.ts +149 -12
- package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.js +82 -8
- package/sdk/platform/Rewards/RewardsPlatformModel.d.ts +360 -23
- package/sdk/platform/Rewards/RewardsPlatformModel.js +238 -22
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.d.ts +159 -92
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.js +473 -208
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.d.ts +138 -13
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.js +100 -14
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +166 -178
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +518 -329
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +1408 -96
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +1034 -71
- package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.d.ts +280 -18
- package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.js +134 -11
- package/sdk/platform/Share/SharePlatformApplicationClient.d.ts +41 -66
- package/sdk/platform/Share/SharePlatformApplicationClient.js +149 -116
- package/sdk/platform/Share/SharePlatformApplicationValidator.d.ts +87 -7
- package/sdk/platform/Share/SharePlatformApplicationValidator.js +42 -5
- package/sdk/platform/Share/SharePlatformModel.d.ts +250 -16
- package/sdk/platform/Share/SharePlatformModel.js +167 -19
- package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +229 -193
- package/sdk/platform/Theme/ThemePlatformApplicationClient.js +976 -352
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.d.ts +345 -24
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.js +206 -14
- package/sdk/platform/Theme/ThemePlatformClient.d.ts +37 -0
- package/sdk/platform/Theme/ThemePlatformClient.js +235 -0
- package/sdk/platform/Theme/ThemePlatformModel.d.ts +1527 -48
- package/sdk/platform/Theme/ThemePlatformModel.js +1099 -118
- package/sdk/platform/Theme/ThemePlatformValidator.d.ts +32 -0
- package/sdk/platform/Theme/ThemePlatformValidator.js +38 -0
- package/sdk/platform/User/UserPlatformApplicationClient.d.ts +138 -152
- package/sdk/platform/User/UserPlatformApplicationClient.js +470 -244
- package/sdk/platform/User/UserPlatformApplicationValidator.d.ts +242 -18
- package/sdk/platform/User/UserPlatformApplicationValidator.js +129 -12
- package/sdk/platform/User/UserPlatformModel.d.ts +653 -101
- package/sdk/platform/User/UserPlatformModel.js +467 -424
- package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +153 -49
- package/sdk/platform/Webhook/WebhookPlatformClient.js +896 -88
- package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +632 -16
- package/sdk/platform/Webhook/WebhookPlatformModel.js +502 -54
- package/sdk/platform/Webhook/WebhookPlatformValidator.d.ts +170 -7
- package/sdk/platform/Webhook/WebhookPlatformValidator.js +157 -7
- package/sdk/public/Configuration/ConfigurationPublicClient.d.ts +16 -21
- package/sdk/public/Configuration/ConfigurationPublicClient.js +48 -33
- package/sdk/public/Configuration/ConfigurationPublicModel.d.ts +370 -19
- package/sdk/public/Configuration/ConfigurationPublicModel.js +191 -40
- package/sdk/public/Configuration/ConfigurationPublicValidator.d.ts +42 -4
- package/sdk/public/Configuration/ConfigurationPublicValidator.js +21 -3
- package/sdk/public/Inventory/InventoryPublicClient.d.ts +54 -48
- package/sdk/public/Inventory/InventoryPublicClient.js +161 -98
- package/sdk/public/Inventory/InventoryPublicModel.d.ts +392 -21
- package/sdk/public/Inventory/InventoryPublicModel.js +267 -27
- package/sdk/public/Inventory/InventoryPublicValidator.d.ts +90 -8
- package/sdk/public/Inventory/InventoryPublicValidator.js +44 -4
- package/sdk/public/Partner/PartnerPublicClient.d.ts +22 -0
- package/sdk/public/Partner/PartnerPublicClient.js +110 -0
- package/sdk/public/Partner/PartnerPublicModel.d.ts +240 -0
- package/sdk/public/Partner/PartnerPublicModel.js +280 -0
- package/sdk/public/Partner/PartnerPublicValidator.d.ts +18 -0
- package/sdk/public/Partner/PartnerPublicValidator.js +19 -0
- package/sdk/public/PublicAPIClient.d.ts +14 -1
- package/sdk/public/PublicAPIClient.js +7 -1
- package/sdk/public/PublicClient.d.ts +21 -3
- package/sdk/public/PublicClient.js +20 -0
- package/sdk/public/PublicConfig.d.ts +27 -6
- package/sdk/public/PublicConfig.js +17 -1
- package/sdk/public/Webhook/WebhookPublicClient.d.ts +16 -11
- package/sdk/public/Webhook/WebhookPublicClient.js +48 -27
- package/sdk/public/Webhook/WebhookPublicModel.d.ts +52 -16
- package/sdk/public/Webhook/WebhookPublicModel.js +33 -113
- package/sdk/public/Webhook/WebhookPublicValidator.d.ts +18 -3
- package/sdk/public/Webhook/WebhookPublicValidator.js +14 -4
- package/sdk/public/index.d.ts +1 -0
- package/sdk/public/index.js +2 -0
- package/sdk/application/ApplicationModels.d.ts +0 -3
- package/sdk/application/ApplicationModels.js +0 -20
- package/sdk/platform/Partner/PartnerPlatformClient.d.ts +0 -145
- package/sdk/platform/Partner/PartnerPlatformClient.js +0 -799
- package/sdk/platform/Partner/PartnerPlatformValidator.d.ts +0 -14
- package/sdk/platform/Partner/PartnerPlatformValidator.js +0 -87
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
const PlatformAPIClient = require("../PlatformAPIClient");
|
|
2
2
|
const { FDKClientValidationError } = require("../../common/FDKError");
|
|
3
3
|
const Paginator = require("../../common/Paginator");
|
|
4
|
-
const
|
|
5
|
-
const
|
|
4
|
+
const 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,21 @@ class Rewards {
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
|
-
* @param {
|
|
17
|
-
* @param {
|
|
18
|
-
* @
|
|
16
|
+
* @param {RewardsPlatformApplicationValidator.GetGiveawayByIdParam} arg - Arg object
|
|
17
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
18
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
19
|
+
* @returns {Promise<RewardsPlatformModel.Giveaway>} - Success response
|
|
20
|
+
* @name getGiveawayById
|
|
19
21
|
* @summary: Get giveaway by ID.
|
|
20
|
-
* @description: Retrieve the specific giveaway by giveaway ID. It will show all the details of the requested giveaway.
|
|
22
|
+
* @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
23
|
*/
|
|
22
|
-
async getGiveawayById(
|
|
23
|
-
|
|
24
|
+
async getGiveawayById(
|
|
25
|
+
{ id, requestHeaders } = { requestHeaders: {} },
|
|
26
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
27
|
+
) {
|
|
28
|
+
const {
|
|
29
|
+
error,
|
|
30
|
+
} = RewardsPlatformApplicationValidator.getGiveawayById().validate(
|
|
24
31
|
{
|
|
25
32
|
id,
|
|
26
33
|
},
|
|
@@ -31,7 +38,9 @@ class Rewards {
|
|
|
31
38
|
}
|
|
32
39
|
|
|
33
40
|
// Showing warrnings if extra unknown parameters are found
|
|
34
|
-
const {
|
|
41
|
+
const {
|
|
42
|
+
error: warrning,
|
|
43
|
+
} = RewardsPlatformApplicationValidator.getGiveawayById().validate(
|
|
35
44
|
{
|
|
36
45
|
id,
|
|
37
46
|
},
|
|
@@ -40,9 +49,8 @@ class Rewards {
|
|
|
40
49
|
if (warrning) {
|
|
41
50
|
Logger({
|
|
42
51
|
level: "WARN",
|
|
43
|
-
message:
|
|
52
|
+
message: `Parameter Validation warrnings for platform > Rewards > getGiveawayById \n ${warrning}`,
|
|
44
53
|
});
|
|
45
|
-
Logger({ level: "WARN", message: warrning });
|
|
46
54
|
}
|
|
47
55
|
|
|
48
56
|
const query_params = {};
|
|
@@ -52,10 +60,19 @@ class Rewards {
|
|
|
52
60
|
"get",
|
|
53
61
|
`/service/platform/rewards/v1.0/company/${this.config.companyId}/application/${this.applicationId}/giveaways/${id}`,
|
|
54
62
|
query_params,
|
|
55
|
-
undefined
|
|
63
|
+
undefined,
|
|
64
|
+
requestHeaders,
|
|
65
|
+
{ responseHeaders }
|
|
56
66
|
);
|
|
57
67
|
|
|
58
|
-
|
|
68
|
+
let responseData = response;
|
|
69
|
+
if (responseHeaders) {
|
|
70
|
+
responseData = response[0];
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
const {
|
|
74
|
+
error: res_error,
|
|
75
|
+
} = RewardsPlatformModel.Giveaway().validate(responseData, {
|
|
59
76
|
abortEarly: false,
|
|
60
77
|
allowUnknown: false,
|
|
61
78
|
});
|
|
@@ -63,23 +80,29 @@ class Rewards {
|
|
|
63
80
|
if (res_error) {
|
|
64
81
|
Logger({
|
|
65
82
|
level: "WARN",
|
|
66
|
-
message:
|
|
83
|
+
message: `Response Validation Warnnings for platform > Rewards > getGiveawayById \n ${res_error}`,
|
|
67
84
|
});
|
|
68
|
-
Logger({ level: "WARN", message: res_error });
|
|
69
85
|
}
|
|
70
86
|
|
|
71
87
|
return response;
|
|
72
88
|
}
|
|
73
89
|
|
|
74
90
|
/**
|
|
75
|
-
* @param {
|
|
76
|
-
* @param {
|
|
77
|
-
* @
|
|
91
|
+
* @param {RewardsPlatformApplicationValidator.GetOfferByNameParam} arg - Arg object
|
|
92
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
93
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
94
|
+
* @returns {Promise<RewardsPlatformModel.Offer>} - Success response
|
|
95
|
+
* @name getOfferByName
|
|
78
96
|
* @summary: Fetch a offer by its name
|
|
79
|
-
* @description: Fetch the specific offer details and configuration by the name of the offer.
|
|
97
|
+
* @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
98
|
*/
|
|
81
|
-
async getOfferByName(
|
|
82
|
-
|
|
99
|
+
async getOfferByName(
|
|
100
|
+
{ name, requestHeaders } = { requestHeaders: {} },
|
|
101
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
102
|
+
) {
|
|
103
|
+
const {
|
|
104
|
+
error,
|
|
105
|
+
} = RewardsPlatformApplicationValidator.getOfferByName().validate(
|
|
83
106
|
{ name },
|
|
84
107
|
{ abortEarly: false, allowUnknown: true }
|
|
85
108
|
);
|
|
@@ -88,16 +111,17 @@ class Rewards {
|
|
|
88
111
|
}
|
|
89
112
|
|
|
90
113
|
// Showing warrnings if extra unknown parameters are found
|
|
91
|
-
const {
|
|
114
|
+
const {
|
|
115
|
+
error: warrning,
|
|
116
|
+
} = RewardsPlatformApplicationValidator.getOfferByName().validate(
|
|
92
117
|
{ name },
|
|
93
118
|
{ abortEarly: false, allowUnknown: false }
|
|
94
119
|
);
|
|
95
120
|
if (warrning) {
|
|
96
121
|
Logger({
|
|
97
122
|
level: "WARN",
|
|
98
|
-
message:
|
|
123
|
+
message: `Parameter Validation warrnings for platform > Rewards > getOfferByName \n ${warrning}`,
|
|
99
124
|
});
|
|
100
|
-
Logger({ level: "WARN", message: warrning });
|
|
101
125
|
}
|
|
102
126
|
|
|
103
127
|
const query_params = {};
|
|
@@ -107,10 +131,19 @@ class Rewards {
|
|
|
107
131
|
"get",
|
|
108
132
|
`/service/platform/rewards/v1.0/company/${this.config.companyId}/application/${this.applicationId}/offers/${name}/`,
|
|
109
133
|
query_params,
|
|
110
|
-
undefined
|
|
134
|
+
undefined,
|
|
135
|
+
requestHeaders,
|
|
136
|
+
{ responseHeaders }
|
|
111
137
|
);
|
|
112
138
|
|
|
113
|
-
|
|
139
|
+
let responseData = response;
|
|
140
|
+
if (responseHeaders) {
|
|
141
|
+
responseData = response[0];
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
const {
|
|
145
|
+
error: res_error,
|
|
146
|
+
} = RewardsPlatformModel.Offer().validate(responseData, {
|
|
114
147
|
abortEarly: false,
|
|
115
148
|
allowUnknown: false,
|
|
116
149
|
});
|
|
@@ -118,22 +151,31 @@ class Rewards {
|
|
|
118
151
|
if (res_error) {
|
|
119
152
|
Logger({
|
|
120
153
|
level: "WARN",
|
|
121
|
-
message:
|
|
154
|
+
message: `Response Validation Warnnings for platform > Rewards > getOfferByName \n ${res_error}`,
|
|
122
155
|
});
|
|
123
|
-
Logger({ level: "WARN", message: res_error });
|
|
124
156
|
}
|
|
125
157
|
|
|
126
158
|
return response;
|
|
127
159
|
}
|
|
128
160
|
|
|
129
161
|
/**
|
|
130
|
-
* @param {
|
|
131
|
-
*
|
|
162
|
+
* @param {RewardsPlatformApplicationValidator.GetRewardsConfigurationParam} arg
|
|
163
|
+
* - Arg object
|
|
164
|
+
*
|
|
165
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
166
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
167
|
+
* @returns {Promise<RewardsPlatformModel.ConfigurationRes>} - Success response
|
|
168
|
+
* @name getRewardsConfiguration
|
|
132
169
|
* @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.
|
|
170
|
+
* @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
171
|
*/
|
|
135
|
-
async getRewardsConfiguration(
|
|
136
|
-
|
|
172
|
+
async getRewardsConfiguration(
|
|
173
|
+
{ requestHeaders } = { requestHeaders: {} },
|
|
174
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
175
|
+
) {
|
|
176
|
+
const {
|
|
177
|
+
error,
|
|
178
|
+
} = RewardsPlatformApplicationValidator.getRewardsConfiguration().validate(
|
|
137
179
|
{},
|
|
138
180
|
{ abortEarly: false, allowUnknown: true }
|
|
139
181
|
);
|
|
@@ -144,16 +186,15 @@ class Rewards {
|
|
|
144
186
|
// Showing warrnings if extra unknown parameters are found
|
|
145
187
|
const {
|
|
146
188
|
error: warrning,
|
|
147
|
-
} =
|
|
189
|
+
} = RewardsPlatformApplicationValidator.getRewardsConfiguration().validate(
|
|
148
190
|
{},
|
|
149
191
|
{ abortEarly: false, allowUnknown: false }
|
|
150
192
|
);
|
|
151
193
|
if (warrning) {
|
|
152
194
|
Logger({
|
|
153
195
|
level: "WARN",
|
|
154
|
-
message:
|
|
196
|
+
message: `Parameter Validation warrnings for platform > Rewards > getRewardsConfiguration \n ${warrning}`,
|
|
155
197
|
});
|
|
156
|
-
Logger({ level: "WARN", message: warrning });
|
|
157
198
|
}
|
|
158
199
|
|
|
159
200
|
const query_params = {};
|
|
@@ -163,12 +204,19 @@ class Rewards {
|
|
|
163
204
|
"get",
|
|
164
205
|
`/service/platform/rewards/v1.0/company/${this.config.companyId}/application/${this.applicationId}/configuration/`,
|
|
165
206
|
query_params,
|
|
166
|
-
undefined
|
|
207
|
+
undefined,
|
|
208
|
+
requestHeaders,
|
|
209
|
+
{ responseHeaders }
|
|
167
210
|
);
|
|
168
211
|
|
|
212
|
+
let responseData = response;
|
|
213
|
+
if (responseHeaders) {
|
|
214
|
+
responseData = response[0];
|
|
215
|
+
}
|
|
216
|
+
|
|
169
217
|
const {
|
|
170
218
|
error: res_error,
|
|
171
|
-
} =
|
|
219
|
+
} = RewardsPlatformModel.ConfigurationRes().validate(responseData, {
|
|
172
220
|
abortEarly: false,
|
|
173
221
|
allowUnknown: false,
|
|
174
222
|
});
|
|
@@ -176,23 +224,29 @@ class Rewards {
|
|
|
176
224
|
if (res_error) {
|
|
177
225
|
Logger({
|
|
178
226
|
level: "WARN",
|
|
179
|
-
message:
|
|
227
|
+
message: `Response Validation Warnnings for platform > Rewards > getRewardsConfiguration \n ${res_error}`,
|
|
180
228
|
});
|
|
181
|
-
Logger({ level: "WARN", message: res_error });
|
|
182
229
|
}
|
|
183
230
|
|
|
184
231
|
return response;
|
|
185
232
|
}
|
|
186
233
|
|
|
187
234
|
/**
|
|
188
|
-
* @param {
|
|
189
|
-
* @param {
|
|
190
|
-
* @
|
|
235
|
+
* @param {RewardsPlatformApplicationValidator.GetUserDetailsParam} arg - Arg object
|
|
236
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
237
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
238
|
+
* @returns {Promise<RewardsPlatformModel.UserRes>} - Success response
|
|
239
|
+
* @name getUserDetails
|
|
191
240
|
* @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.
|
|
241
|
+
* @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
242
|
*/
|
|
194
|
-
async getUserDetails(
|
|
195
|
-
|
|
243
|
+
async getUserDetails(
|
|
244
|
+
{ userId, requestHeaders } = { requestHeaders: {} },
|
|
245
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
246
|
+
) {
|
|
247
|
+
const {
|
|
248
|
+
error,
|
|
249
|
+
} = RewardsPlatformApplicationValidator.getUserDetails().validate(
|
|
196
250
|
{ userId },
|
|
197
251
|
{ abortEarly: false, allowUnknown: true }
|
|
198
252
|
);
|
|
@@ -201,16 +255,17 @@ class Rewards {
|
|
|
201
255
|
}
|
|
202
256
|
|
|
203
257
|
// Showing warrnings if extra unknown parameters are found
|
|
204
|
-
const {
|
|
258
|
+
const {
|
|
259
|
+
error: warrning,
|
|
260
|
+
} = RewardsPlatformApplicationValidator.getUserDetails().validate(
|
|
205
261
|
{ userId },
|
|
206
262
|
{ abortEarly: false, allowUnknown: false }
|
|
207
263
|
);
|
|
208
264
|
if (warrning) {
|
|
209
265
|
Logger({
|
|
210
266
|
level: "WARN",
|
|
211
|
-
message:
|
|
267
|
+
message: `Parameter Validation warrnings for platform > Rewards > getUserDetails \n ${warrning}`,
|
|
212
268
|
});
|
|
213
|
-
Logger({ level: "WARN", message: warrning });
|
|
214
269
|
}
|
|
215
270
|
|
|
216
271
|
const query_params = {};
|
|
@@ -220,10 +275,19 @@ class Rewards {
|
|
|
220
275
|
"get",
|
|
221
276
|
`/service/platform/rewards/v1.0/company/${this.config.companyId}/application/${this.applicationId}/users/${userId}/`,
|
|
222
277
|
query_params,
|
|
223
|
-
undefined
|
|
278
|
+
undefined,
|
|
279
|
+
requestHeaders,
|
|
280
|
+
{ responseHeaders }
|
|
224
281
|
);
|
|
225
282
|
|
|
226
|
-
|
|
283
|
+
let responseData = response;
|
|
284
|
+
if (responseHeaders) {
|
|
285
|
+
responseData = response[0];
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
const {
|
|
289
|
+
error: res_error,
|
|
290
|
+
} = RewardsPlatformModel.UserRes().validate(responseData, {
|
|
227
291
|
abortEarly: false,
|
|
228
292
|
allowUnknown: false,
|
|
229
293
|
});
|
|
@@ -231,31 +295,31 @@ class Rewards {
|
|
|
231
295
|
if (res_error) {
|
|
232
296
|
Logger({
|
|
233
297
|
level: "WARN",
|
|
234
|
-
message:
|
|
298
|
+
message: `Response Validation Warnnings for platform > Rewards > getUserDetails \n ${res_error}`,
|
|
235
299
|
});
|
|
236
|
-
Logger({ level: "WARN", message: res_error });
|
|
237
300
|
}
|
|
238
301
|
|
|
239
302
|
return response;
|
|
240
303
|
}
|
|
241
304
|
|
|
242
305
|
/**
|
|
243
|
-
* @param {
|
|
244
|
-
*
|
|
245
|
-
*
|
|
246
|
-
*
|
|
247
|
-
* @param {
|
|
248
|
-
* @returns {Promise<HistoryRes>} - Success response
|
|
306
|
+
* @param {RewardsPlatformApplicationValidator.GetUserPointsHistoryParam} arg
|
|
307
|
+
* - Arg object
|
|
308
|
+
*
|
|
309
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
310
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
311
|
+
* @returns {Promise<RewardsPlatformModel.HistoryRes>} - Success response
|
|
312
|
+
* @name getUserPointsHistory
|
|
249
313
|
* @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.
|
|
314
|
+
* @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
315
|
*/
|
|
252
|
-
async getUserPointsHistory(
|
|
253
|
-
userId,
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
316
|
+
async getUserPointsHistory(
|
|
317
|
+
{ userId, pageId, pageSize, requestHeaders } = { requestHeaders: {} },
|
|
318
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
319
|
+
) {
|
|
320
|
+
const {
|
|
321
|
+
error,
|
|
322
|
+
} = RewardsPlatformApplicationValidator.getUserPointsHistory().validate(
|
|
259
323
|
{
|
|
260
324
|
userId,
|
|
261
325
|
|
|
@@ -271,7 +335,7 @@ class Rewards {
|
|
|
271
335
|
// Showing warrnings if extra unknown parameters are found
|
|
272
336
|
const {
|
|
273
337
|
error: warrning,
|
|
274
|
-
} =
|
|
338
|
+
} = RewardsPlatformApplicationValidator.getUserPointsHistory().validate(
|
|
275
339
|
{
|
|
276
340
|
userId,
|
|
277
341
|
|
|
@@ -283,9 +347,8 @@ class Rewards {
|
|
|
283
347
|
if (warrning) {
|
|
284
348
|
Logger({
|
|
285
349
|
level: "WARN",
|
|
286
|
-
message:
|
|
350
|
+
message: `Parameter Validation warrnings for platform > Rewards > getUserPointsHistory \n ${warrning}`,
|
|
287
351
|
});
|
|
288
|
-
Logger({ level: "WARN", message: warrning });
|
|
289
352
|
}
|
|
290
353
|
|
|
291
354
|
const query_params = {};
|
|
@@ -297,10 +360,19 @@ class Rewards {
|
|
|
297
360
|
"get",
|
|
298
361
|
`/service/platform/rewards/v1.0/company/${this.config.companyId}/application/${this.applicationId}/users/${userId}/points/history/`,
|
|
299
362
|
query_params,
|
|
300
|
-
undefined
|
|
363
|
+
undefined,
|
|
364
|
+
requestHeaders,
|
|
365
|
+
{ responseHeaders }
|
|
301
366
|
);
|
|
302
367
|
|
|
303
|
-
|
|
368
|
+
let responseData = response;
|
|
369
|
+
if (responseHeaders) {
|
|
370
|
+
responseData = response[0];
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
const {
|
|
374
|
+
error: res_error,
|
|
375
|
+
} = RewardsPlatformModel.HistoryRes().validate(responseData, {
|
|
304
376
|
abortEarly: false,
|
|
305
377
|
allowUnknown: false,
|
|
306
378
|
});
|
|
@@ -308,9 +380,8 @@ class Rewards {
|
|
|
308
380
|
if (res_error) {
|
|
309
381
|
Logger({
|
|
310
382
|
level: "WARN",
|
|
311
|
-
message:
|
|
383
|
+
message: `Response Validation Warnnings for platform > Rewards > getUserPointsHistory \n ${res_error}`,
|
|
312
384
|
});
|
|
313
|
-
Logger({ level: "WARN", message: res_error });
|
|
314
385
|
}
|
|
315
386
|
|
|
316
387
|
return response;
|
|
@@ -322,6 +393,7 @@ class Rewards {
|
|
|
322
393
|
* @param {string} arg.companyId - Company id
|
|
323
394
|
* @param {string} arg.applicationId - Application id
|
|
324
395
|
* @param {number} [arg.pageSize] - The number of items to retrieve in each page.
|
|
396
|
+
* @returns {Paginator<RewardsPlatformModel.HistoryRes>}
|
|
325
397
|
* @summary: Get all transactions of reward points
|
|
326
398
|
* @description: Fetches a list of points transactions like giveaway points, signup points, referral points, order earn points, redeem points and expired points.
|
|
327
399
|
*/
|
|
@@ -354,14 +426,21 @@ class Rewards {
|
|
|
354
426
|
}
|
|
355
427
|
|
|
356
428
|
/**
|
|
357
|
-
* @param {
|
|
358
|
-
* @param {
|
|
359
|
-
* @
|
|
429
|
+
* @param {RewardsPlatformApplicationValidator.SaveGiveAwayParam} arg - Arg object
|
|
430
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
431
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
432
|
+
* @returns {Promise<RewardsPlatformModel.Giveaway>} - Success response
|
|
433
|
+
* @name saveGiveAway
|
|
360
434
|
* @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.
|
|
435
|
+
* @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
436
|
*/
|
|
363
|
-
async saveGiveAway(
|
|
364
|
-
|
|
437
|
+
async saveGiveAway(
|
|
438
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
439
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
440
|
+
) {
|
|
441
|
+
const {
|
|
442
|
+
error,
|
|
443
|
+
} = RewardsPlatformApplicationValidator.saveGiveAway().validate(
|
|
365
444
|
{
|
|
366
445
|
body,
|
|
367
446
|
},
|
|
@@ -372,7 +451,9 @@ class Rewards {
|
|
|
372
451
|
}
|
|
373
452
|
|
|
374
453
|
// Showing warrnings if extra unknown parameters are found
|
|
375
|
-
const {
|
|
454
|
+
const {
|
|
455
|
+
error: warrning,
|
|
456
|
+
} = RewardsPlatformApplicationValidator.saveGiveAway().validate(
|
|
376
457
|
{
|
|
377
458
|
body,
|
|
378
459
|
},
|
|
@@ -381,9 +462,8 @@ class Rewards {
|
|
|
381
462
|
if (warrning) {
|
|
382
463
|
Logger({
|
|
383
464
|
level: "WARN",
|
|
384
|
-
message:
|
|
465
|
+
message: `Parameter Validation warrnings for platform > Rewards > saveGiveAway \n ${warrning}`,
|
|
385
466
|
});
|
|
386
|
-
Logger({ level: "WARN", message: warrning });
|
|
387
467
|
}
|
|
388
468
|
|
|
389
469
|
const query_params = {};
|
|
@@ -393,10 +473,19 @@ class Rewards {
|
|
|
393
473
|
"post",
|
|
394
474
|
`/service/platform/rewards/v1.0/company/${this.config.companyId}/application/${this.applicationId}/giveaways`,
|
|
395
475
|
query_params,
|
|
396
|
-
body
|
|
476
|
+
body,
|
|
477
|
+
requestHeaders,
|
|
478
|
+
{ responseHeaders }
|
|
397
479
|
);
|
|
398
480
|
|
|
399
|
-
|
|
481
|
+
let responseData = response;
|
|
482
|
+
if (responseHeaders) {
|
|
483
|
+
responseData = response[0];
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
const {
|
|
487
|
+
error: res_error,
|
|
488
|
+
} = RewardsPlatformModel.Giveaway().validate(responseData, {
|
|
400
489
|
abortEarly: false,
|
|
401
490
|
allowUnknown: false,
|
|
402
491
|
});
|
|
@@ -404,23 +493,31 @@ class Rewards {
|
|
|
404
493
|
if (res_error) {
|
|
405
494
|
Logger({
|
|
406
495
|
level: "WARN",
|
|
407
|
-
message:
|
|
496
|
+
message: `Response Validation Warnnings for platform > Rewards > saveGiveAway \n ${res_error}`,
|
|
408
497
|
});
|
|
409
|
-
Logger({ level: "WARN", message: res_error });
|
|
410
498
|
}
|
|
411
499
|
|
|
412
500
|
return response;
|
|
413
501
|
}
|
|
414
502
|
|
|
415
503
|
/**
|
|
416
|
-
* @param {
|
|
417
|
-
*
|
|
418
|
-
*
|
|
504
|
+
* @param {RewardsPlatformApplicationValidator.SetRewardsConfigurationParam} arg
|
|
505
|
+
* - Arg object
|
|
506
|
+
*
|
|
507
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
508
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
509
|
+
* @returns {Promise<RewardsPlatformModel.SetConfigurationRes>} - Success response
|
|
510
|
+
* @name setRewardsConfiguration
|
|
419
511
|
* @summary: Updates the collection with given android paths.
|
|
420
|
-
* @description: Updates the configuration or inserts new records with the given android paths.
|
|
512
|
+
* @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
513
|
*/
|
|
422
|
-
async setRewardsConfiguration(
|
|
423
|
-
|
|
514
|
+
async setRewardsConfiguration(
|
|
515
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
516
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
517
|
+
) {
|
|
518
|
+
const {
|
|
519
|
+
error,
|
|
520
|
+
} = RewardsPlatformApplicationValidator.setRewardsConfiguration().validate(
|
|
424
521
|
{
|
|
425
522
|
body,
|
|
426
523
|
},
|
|
@@ -433,7 +530,7 @@ class Rewards {
|
|
|
433
530
|
// Showing warrnings if extra unknown parameters are found
|
|
434
531
|
const {
|
|
435
532
|
error: warrning,
|
|
436
|
-
} =
|
|
533
|
+
} = RewardsPlatformApplicationValidator.setRewardsConfiguration().validate(
|
|
437
534
|
{
|
|
438
535
|
body,
|
|
439
536
|
},
|
|
@@ -442,9 +539,8 @@ class Rewards {
|
|
|
442
539
|
if (warrning) {
|
|
443
540
|
Logger({
|
|
444
541
|
level: "WARN",
|
|
445
|
-
message:
|
|
542
|
+
message: `Parameter Validation warrnings for platform > Rewards > setRewardsConfiguration \n ${warrning}`,
|
|
446
543
|
});
|
|
447
|
-
Logger({ level: "WARN", message: warrning });
|
|
448
544
|
}
|
|
449
545
|
|
|
450
546
|
const query_params = {};
|
|
@@ -454,12 +550,19 @@ class Rewards {
|
|
|
454
550
|
"post",
|
|
455
551
|
`/service/platform/rewards/v1.0/company/${this.config.companyId}/application/${this.applicationId}/configuration/`,
|
|
456
552
|
query_params,
|
|
457
|
-
body
|
|
553
|
+
body,
|
|
554
|
+
requestHeaders,
|
|
555
|
+
{ responseHeaders }
|
|
458
556
|
);
|
|
459
557
|
|
|
558
|
+
let responseData = response;
|
|
559
|
+
if (responseHeaders) {
|
|
560
|
+
responseData = response[0];
|
|
561
|
+
}
|
|
562
|
+
|
|
460
563
|
const {
|
|
461
564
|
error: res_error,
|
|
462
|
-
} =
|
|
565
|
+
} = RewardsPlatformModel.SetConfigurationRes().validate(responseData, {
|
|
463
566
|
abortEarly: false,
|
|
464
567
|
allowUnknown: false,
|
|
465
568
|
});
|
|
@@ -467,24 +570,29 @@ class Rewards {
|
|
|
467
570
|
if (res_error) {
|
|
468
571
|
Logger({
|
|
469
572
|
level: "WARN",
|
|
470
|
-
message:
|
|
573
|
+
message: `Response Validation Warnnings for platform > Rewards > setRewardsConfiguration \n ${res_error}`,
|
|
471
574
|
});
|
|
472
|
-
Logger({ level: "WARN", message: res_error });
|
|
473
575
|
}
|
|
474
576
|
|
|
475
577
|
return response;
|
|
476
578
|
}
|
|
477
579
|
|
|
478
580
|
/**
|
|
479
|
-
* @param {
|
|
480
|
-
* @param {
|
|
481
|
-
* @param {
|
|
482
|
-
* @returns {Promise<GiveawayResponse>} - Success response
|
|
581
|
+
* @param {RewardsPlatformApplicationValidator.ShowGiveawaysParam} arg - Arg object
|
|
582
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
583
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
584
|
+
* @returns {Promise<RewardsPlatformModel.GiveawayResponse>} - Success response
|
|
585
|
+
* @name showGiveaways
|
|
483
586
|
* @summary: List of giveaways of the current application.
|
|
484
|
-
* @description: Fetch the detailed compilation of live, completed, and scheduled point-based giveaways created.
|
|
587
|
+
* @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
588
|
*/
|
|
486
|
-
async showGiveaways(
|
|
487
|
-
|
|
589
|
+
async showGiveaways(
|
|
590
|
+
{ pageId, pageSize, requestHeaders } = { requestHeaders: {} },
|
|
591
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
592
|
+
) {
|
|
593
|
+
const {
|
|
594
|
+
error,
|
|
595
|
+
} = RewardsPlatformApplicationValidator.showGiveaways().validate(
|
|
488
596
|
{
|
|
489
597
|
pageId,
|
|
490
598
|
pageSize,
|
|
@@ -496,7 +604,9 @@ class Rewards {
|
|
|
496
604
|
}
|
|
497
605
|
|
|
498
606
|
// Showing warrnings if extra unknown parameters are found
|
|
499
|
-
const {
|
|
607
|
+
const {
|
|
608
|
+
error: warrning,
|
|
609
|
+
} = RewardsPlatformApplicationValidator.showGiveaways().validate(
|
|
500
610
|
{
|
|
501
611
|
pageId,
|
|
502
612
|
pageSize,
|
|
@@ -506,9 +616,8 @@ class Rewards {
|
|
|
506
616
|
if (warrning) {
|
|
507
617
|
Logger({
|
|
508
618
|
level: "WARN",
|
|
509
|
-
message:
|
|
619
|
+
message: `Parameter Validation warrnings for platform > Rewards > showGiveaways \n ${warrning}`,
|
|
510
620
|
});
|
|
511
|
-
Logger({ level: "WARN", message: warrning });
|
|
512
621
|
}
|
|
513
622
|
|
|
514
623
|
const query_params = {};
|
|
@@ -520,12 +629,19 @@ class Rewards {
|
|
|
520
629
|
"get",
|
|
521
630
|
`/service/platform/rewards/v1.0/company/${this.config.companyId}/application/${this.applicationId}/giveaways`,
|
|
522
631
|
query_params,
|
|
523
|
-
undefined
|
|
632
|
+
undefined,
|
|
633
|
+
requestHeaders,
|
|
634
|
+
{ responseHeaders }
|
|
524
635
|
);
|
|
525
636
|
|
|
637
|
+
let responseData = response;
|
|
638
|
+
if (responseHeaders) {
|
|
639
|
+
responseData = response[0];
|
|
640
|
+
}
|
|
641
|
+
|
|
526
642
|
const {
|
|
527
643
|
error: res_error,
|
|
528
|
-
} =
|
|
644
|
+
} = RewardsPlatformModel.GiveawayResponse().validate(responseData, {
|
|
529
645
|
abortEarly: false,
|
|
530
646
|
allowUnknown: false,
|
|
531
647
|
});
|
|
@@ -533,22 +649,27 @@ class Rewards {
|
|
|
533
649
|
if (res_error) {
|
|
534
650
|
Logger({
|
|
535
651
|
level: "WARN",
|
|
536
|
-
message:
|
|
652
|
+
message: `Response Validation Warnnings for platform > Rewards > showGiveaways \n ${res_error}`,
|
|
537
653
|
});
|
|
538
|
-
Logger({ level: "WARN", message: res_error });
|
|
539
654
|
}
|
|
540
655
|
|
|
541
656
|
return response;
|
|
542
657
|
}
|
|
543
658
|
|
|
544
659
|
/**
|
|
545
|
-
* @param {
|
|
546
|
-
* @
|
|
660
|
+
* @param {RewardsPlatformApplicationValidator.ShowOffersParam} arg - Arg object
|
|
661
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
662
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
663
|
+
* @returns {Promise<RewardsPlatformModel.Offer[]>} - Success response
|
|
664
|
+
* @name showOffers
|
|
547
665
|
* @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.
|
|
666
|
+
* @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
667
|
*/
|
|
550
|
-
async showOffers(
|
|
551
|
-
|
|
668
|
+
async showOffers(
|
|
669
|
+
{ requestHeaders } = { requestHeaders: {} },
|
|
670
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
671
|
+
) {
|
|
672
|
+
const { error } = RewardsPlatformApplicationValidator.showOffers().validate(
|
|
552
673
|
{},
|
|
553
674
|
{ abortEarly: false, allowUnknown: true }
|
|
554
675
|
);
|
|
@@ -557,16 +678,17 @@ class Rewards {
|
|
|
557
678
|
}
|
|
558
679
|
|
|
559
680
|
// Showing warrnings if extra unknown parameters are found
|
|
560
|
-
const {
|
|
681
|
+
const {
|
|
682
|
+
error: warrning,
|
|
683
|
+
} = RewardsPlatformApplicationValidator.showOffers().validate(
|
|
561
684
|
{},
|
|
562
685
|
{ abortEarly: false, allowUnknown: false }
|
|
563
686
|
);
|
|
564
687
|
if (warrning) {
|
|
565
688
|
Logger({
|
|
566
689
|
level: "WARN",
|
|
567
|
-
message:
|
|
690
|
+
message: `Parameter Validation warrnings for platform > Rewards > showOffers \n ${warrning}`,
|
|
568
691
|
});
|
|
569
|
-
Logger({ level: "WARN", message: warrning });
|
|
570
692
|
}
|
|
571
693
|
|
|
572
694
|
const query_params = {};
|
|
@@ -576,34 +698,46 @@ class Rewards {
|
|
|
576
698
|
"get",
|
|
577
699
|
`/service/platform/rewards/v1.0/company/${this.config.companyId}/application/${this.applicationId}/offers/`,
|
|
578
700
|
query_params,
|
|
579
|
-
undefined
|
|
701
|
+
undefined,
|
|
702
|
+
requestHeaders,
|
|
703
|
+
{ responseHeaders }
|
|
580
704
|
);
|
|
581
705
|
|
|
706
|
+
let responseData = response;
|
|
707
|
+
if (responseHeaders) {
|
|
708
|
+
responseData = response[0];
|
|
709
|
+
}
|
|
710
|
+
|
|
582
711
|
const { error: res_error } = Joi.array()
|
|
583
|
-
.items(
|
|
584
|
-
.validate(
|
|
712
|
+
.items(RewardsPlatformModel.Offer())
|
|
713
|
+
.validate(responseData, { abortEarly: false, allowUnknown: false });
|
|
585
714
|
|
|
586
715
|
if (res_error) {
|
|
587
716
|
Logger({
|
|
588
717
|
level: "WARN",
|
|
589
|
-
message:
|
|
718
|
+
message: `Response Validation Warnnings for platform > Rewards > showOffers \n ${res_error}`,
|
|
590
719
|
});
|
|
591
|
-
Logger({ level: "WARN", message: res_error });
|
|
592
720
|
}
|
|
593
721
|
|
|
594
722
|
return response;
|
|
595
723
|
}
|
|
596
724
|
|
|
597
725
|
/**
|
|
598
|
-
* @param {
|
|
599
|
-
* @param {
|
|
600
|
-
* @param {
|
|
601
|
-
* @returns {Promise<Giveaway>} - Success response
|
|
726
|
+
* @param {RewardsPlatformApplicationValidator.UpdateGiveAwayParam} arg - Arg object
|
|
727
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
728
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
729
|
+
* @returns {Promise<RewardsPlatformModel.Giveaway>} - Success response
|
|
730
|
+
* @name updateGiveAway
|
|
602
731
|
* @summary: Updates the giveaway by it's ID.
|
|
603
|
-
* @description: Make the necessary updates to the giveaway based on its giveaway ID.
|
|
732
|
+
* @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
733
|
*/
|
|
605
|
-
async updateGiveAway(
|
|
606
|
-
|
|
734
|
+
async updateGiveAway(
|
|
735
|
+
{ id, body, requestHeaders } = { requestHeaders: {} },
|
|
736
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
737
|
+
) {
|
|
738
|
+
const {
|
|
739
|
+
error,
|
|
740
|
+
} = RewardsPlatformApplicationValidator.updateGiveAway().validate(
|
|
607
741
|
{
|
|
608
742
|
id,
|
|
609
743
|
body,
|
|
@@ -615,7 +749,9 @@ class Rewards {
|
|
|
615
749
|
}
|
|
616
750
|
|
|
617
751
|
// Showing warrnings if extra unknown parameters are found
|
|
618
|
-
const {
|
|
752
|
+
const {
|
|
753
|
+
error: warrning,
|
|
754
|
+
} = RewardsPlatformApplicationValidator.updateGiveAway().validate(
|
|
619
755
|
{
|
|
620
756
|
id,
|
|
621
757
|
body,
|
|
@@ -625,9 +761,8 @@ class Rewards {
|
|
|
625
761
|
if (warrning) {
|
|
626
762
|
Logger({
|
|
627
763
|
level: "WARN",
|
|
628
|
-
message:
|
|
764
|
+
message: `Parameter Validation warrnings for platform > Rewards > updateGiveAway \n ${warrning}`,
|
|
629
765
|
});
|
|
630
|
-
Logger({ level: "WARN", message: warrning });
|
|
631
766
|
}
|
|
632
767
|
|
|
633
768
|
const query_params = {};
|
|
@@ -637,10 +772,19 @@ class Rewards {
|
|
|
637
772
|
"put",
|
|
638
773
|
`/service/platform/rewards/v1.0/company/${this.config.companyId}/application/${this.applicationId}/giveaways/${id}`,
|
|
639
774
|
query_params,
|
|
640
|
-
body
|
|
775
|
+
body,
|
|
776
|
+
requestHeaders,
|
|
777
|
+
{ responseHeaders }
|
|
641
778
|
);
|
|
642
779
|
|
|
643
|
-
|
|
780
|
+
let responseData = response;
|
|
781
|
+
if (responseHeaders) {
|
|
782
|
+
responseData = response[0];
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
const {
|
|
786
|
+
error: res_error,
|
|
787
|
+
} = RewardsPlatformModel.Giveaway().validate(responseData, {
|
|
644
788
|
abortEarly: false,
|
|
645
789
|
allowUnknown: false,
|
|
646
790
|
});
|
|
@@ -648,28 +792,31 @@ class Rewards {
|
|
|
648
792
|
if (res_error) {
|
|
649
793
|
Logger({
|
|
650
794
|
level: "WARN",
|
|
651
|
-
message:
|
|
795
|
+
message: `Response Validation Warnnings for platform > Rewards > updateGiveAway \n ${res_error}`,
|
|
652
796
|
});
|
|
653
|
-
Logger({ level: "WARN", message: res_error });
|
|
654
797
|
}
|
|
655
798
|
|
|
656
799
|
return response;
|
|
657
800
|
}
|
|
658
801
|
|
|
659
802
|
/**
|
|
660
|
-
* @param {
|
|
661
|
-
*
|
|
662
|
-
*
|
|
663
|
-
* @
|
|
803
|
+
* @param {RewardsPlatformApplicationValidator.UpdateOfferByNameParam} arg
|
|
804
|
+
* - Arg object
|
|
805
|
+
*
|
|
806
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
807
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
808
|
+
* @returns {Promise<RewardsPlatformModel.Offer>} - Success response
|
|
809
|
+
* @name updateOfferByName
|
|
664
810
|
* @summary: Update offer by name
|
|
665
|
-
* @description: Update the specific offer details and its configuration by offer name.
|
|
811
|
+
* @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
812
|
*/
|
|
667
|
-
async updateOfferByName(
|
|
668
|
-
name,
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
813
|
+
async updateOfferByName(
|
|
814
|
+
{ name, body, requestHeaders } = { requestHeaders: {} },
|
|
815
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
816
|
+
) {
|
|
817
|
+
const {
|
|
818
|
+
error,
|
|
819
|
+
} = RewardsPlatformApplicationValidator.updateOfferByName().validate(
|
|
673
820
|
{
|
|
674
821
|
name,
|
|
675
822
|
|
|
@@ -682,7 +829,9 @@ class Rewards {
|
|
|
682
829
|
}
|
|
683
830
|
|
|
684
831
|
// Showing warrnings if extra unknown parameters are found
|
|
685
|
-
const {
|
|
832
|
+
const {
|
|
833
|
+
error: warrning,
|
|
834
|
+
} = RewardsPlatformApplicationValidator.updateOfferByName().validate(
|
|
686
835
|
{
|
|
687
836
|
name,
|
|
688
837
|
|
|
@@ -693,9 +842,8 @@ class Rewards {
|
|
|
693
842
|
if (warrning) {
|
|
694
843
|
Logger({
|
|
695
844
|
level: "WARN",
|
|
696
|
-
message:
|
|
845
|
+
message: `Parameter Validation warrnings for platform > Rewards > updateOfferByName \n ${warrning}`,
|
|
697
846
|
});
|
|
698
|
-
Logger({ level: "WARN", message: warrning });
|
|
699
847
|
}
|
|
700
848
|
|
|
701
849
|
const query_params = {};
|
|
@@ -705,10 +853,19 @@ class Rewards {
|
|
|
705
853
|
"put",
|
|
706
854
|
`/service/platform/rewards/v1.0/company/${this.config.companyId}/application/${this.applicationId}/offers/${name}/`,
|
|
707
855
|
query_params,
|
|
708
|
-
body
|
|
856
|
+
body,
|
|
857
|
+
requestHeaders,
|
|
858
|
+
{ responseHeaders }
|
|
709
859
|
);
|
|
710
860
|
|
|
711
|
-
|
|
861
|
+
let responseData = response;
|
|
862
|
+
if (responseHeaders) {
|
|
863
|
+
responseData = response[0];
|
|
864
|
+
}
|
|
865
|
+
|
|
866
|
+
const {
|
|
867
|
+
error: res_error,
|
|
868
|
+
} = RewardsPlatformModel.Offer().validate(responseData, {
|
|
712
869
|
abortEarly: false,
|
|
713
870
|
allowUnknown: false,
|
|
714
871
|
});
|
|
@@ -716,28 +873,29 @@ class Rewards {
|
|
|
716
873
|
if (res_error) {
|
|
717
874
|
Logger({
|
|
718
875
|
level: "WARN",
|
|
719
|
-
message:
|
|
876
|
+
message: `Response Validation Warnnings for platform > Rewards > updateOfferByName \n ${res_error}`,
|
|
720
877
|
});
|
|
721
|
-
Logger({ level: "WARN", message: res_error });
|
|
722
878
|
}
|
|
723
879
|
|
|
724
880
|
return response;
|
|
725
881
|
}
|
|
726
882
|
|
|
727
883
|
/**
|
|
728
|
-
* @param {
|
|
729
|
-
* @param {
|
|
730
|
-
* @param {
|
|
731
|
-
* @returns {Promise<AppUser>} - Success response
|
|
884
|
+
* @param {RewardsPlatformApplicationValidator.UpdateUserStatusParam} arg - Arg object
|
|
885
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
886
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
887
|
+
* @returns {Promise<RewardsPlatformModel.AppUser>} - Success response
|
|
888
|
+
* @name updateUserStatus
|
|
732
889
|
* @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.
|
|
890
|
+
* @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
891
|
*/
|
|
735
|
-
async updateUserStatus(
|
|
736
|
-
userId,
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
892
|
+
async updateUserStatus(
|
|
893
|
+
{ userId, body, requestHeaders } = { requestHeaders: {} },
|
|
894
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
895
|
+
) {
|
|
896
|
+
const {
|
|
897
|
+
error,
|
|
898
|
+
} = RewardsPlatformApplicationValidator.updateUserStatus().validate(
|
|
741
899
|
{
|
|
742
900
|
userId,
|
|
743
901
|
|
|
@@ -750,7 +908,9 @@ class Rewards {
|
|
|
750
908
|
}
|
|
751
909
|
|
|
752
910
|
// Showing warrnings if extra unknown parameters are found
|
|
753
|
-
const {
|
|
911
|
+
const {
|
|
912
|
+
error: warrning,
|
|
913
|
+
} = RewardsPlatformApplicationValidator.updateUserStatus().validate(
|
|
754
914
|
{
|
|
755
915
|
userId,
|
|
756
916
|
|
|
@@ -761,9 +921,8 @@ class Rewards {
|
|
|
761
921
|
if (warrning) {
|
|
762
922
|
Logger({
|
|
763
923
|
level: "WARN",
|
|
764
|
-
message:
|
|
924
|
+
message: `Parameter Validation warrnings for platform > Rewards > updateUserStatus \n ${warrning}`,
|
|
765
925
|
});
|
|
766
|
-
Logger({ level: "WARN", message: warrning });
|
|
767
926
|
}
|
|
768
927
|
|
|
769
928
|
const query_params = {};
|
|
@@ -773,10 +932,19 @@ class Rewards {
|
|
|
773
932
|
"patch",
|
|
774
933
|
`/service/platform/rewards/v1.0/company/${this.config.companyId}/application/${this.applicationId}/users/${userId}/`,
|
|
775
934
|
query_params,
|
|
776
|
-
body
|
|
935
|
+
body,
|
|
936
|
+
requestHeaders,
|
|
937
|
+
{ responseHeaders }
|
|
777
938
|
);
|
|
778
939
|
|
|
779
|
-
|
|
940
|
+
let responseData = response;
|
|
941
|
+
if (responseHeaders) {
|
|
942
|
+
responseData = response[0];
|
|
943
|
+
}
|
|
944
|
+
|
|
945
|
+
const {
|
|
946
|
+
error: res_error,
|
|
947
|
+
} = RewardsPlatformModel.AppUser().validate(responseData, {
|
|
780
948
|
abortEarly: false,
|
|
781
949
|
allowUnknown: false,
|
|
782
950
|
});
|
|
@@ -784,9 +952,8 @@ class Rewards {
|
|
|
784
952
|
if (res_error) {
|
|
785
953
|
Logger({
|
|
786
954
|
level: "WARN",
|
|
787
|
-
message:
|
|
955
|
+
message: `Response Validation Warnnings for platform > Rewards > updateUserStatus \n ${res_error}`,
|
|
788
956
|
});
|
|
789
|
-
Logger({ level: "WARN", message: res_error });
|
|
790
957
|
}
|
|
791
958
|
|
|
792
959
|
return response;
|