@gofynd/fdk-client-javascript 0.1.37 → 1.0.1
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 +24 -0
- package/application.d.ts +2 -1
- package/application.js +2 -1
- package/documentation/application/CART.md +315 -289
- package/documentation/application/CATALOG.md +438 -415
- package/documentation/application/FILESTORAGE.md +2 -0
- package/documentation/application/LEAD.md +18 -18
- package/documentation/application/LOGISTIC.md +45 -45
- package/documentation/application/ORDER.md +277 -277
- package/documentation/application/PAYMENT.md +251 -251
- package/documentation/application/POSCART.md +318 -292
- package/documentation/application/REWARDS.md +1 -0
- package/documentation/application/USER.md +19 -14
- package/documentation/platform/CART.md +465 -462
- package/documentation/platform/CATALOG.md +2792 -2711
- package/documentation/platform/COMPANYPROFILE.md +200 -362
- package/documentation/platform/DISCOUNT.md +86 -0
- package/documentation/platform/FILESTORAGE.md +2 -0
- package/documentation/platform/LEAD.md +60 -60
- package/documentation/platform/ORDER.md +1451 -1654
- package/documentation/platform/PAYMENT.md +94 -94
- package/documentation/platform/REWARDS.md +145 -0
- package/documentation/platform/USER.md +24 -14
- package/index.d.ts +4 -1
- package/index.js +13 -4
- package/package.json +9 -9
- package/platform.d.ts +2 -1
- package/platform.js +3 -2
- package/public.d.ts +1 -0
- package/public.js +3 -2
- package/sdk/application/ApplicationAPIClient.js +3 -1
- package/sdk/application/ApplicationClient.d.ts +16 -16
- package/sdk/application/ApplicationClient.js +32 -16
- package/sdk/application/ApplicationConfig.js +3 -2
- package/sdk/application/ApplicationModels.d.ts +0 -832
- package/sdk/application/ApplicationModels.js +3 -10574
- package/sdk/application/{client → Cart}/CartApplicationClient.d.ts +9 -3
- package/sdk/application/{client → Cart}/CartApplicationClient.js +316 -8
- package/sdk/application/Cart/CartApplicationModel.d.ts +81 -0
- package/sdk/application/Cart/CartApplicationModel.js +1136 -0
- package/sdk/application/{models/CartValidator.js → Cart/CartApplicationValidator.js} +17 -12
- package/sdk/application/{client → Catalog}/CatalogApplicationClient.d.ts +8 -5
- package/sdk/application/{client → Catalog}/CatalogApplicationClient.js +389 -8
- package/sdk/application/Catalog/CatalogApplicationModel.d.ts +117 -0
- package/sdk/application/Catalog/CatalogApplicationModel.js +1606 -0
- package/sdk/application/{models/CatalogValidator.js → Catalog/CatalogApplicationValidator.js} +4 -1
- package/sdk/application/{client → Common}/CommonApplicationClient.js +24 -2
- package/sdk/application/Common/CommonApplicationModel.d.ts +20 -0
- package/sdk/application/Common/CommonApplicationModel.js +228 -0
- package/sdk/{platform/models/CommonValidator.js → application/Common/CommonApplicationValidator.js} +3 -1
- package/sdk/application/{client → Communication}/CommunicationApplicationClient.js +43 -2
- package/sdk/application/Communication/CommunicationApplicationModel.d.ts +15 -0
- package/sdk/application/Communication/CommunicationApplicationModel.js +144 -0
- package/sdk/application/{models/CommunicationValidator.js → Communication/CommunicationApplicationValidator.js} +5 -3
- package/sdk/application/{client → Configuration}/ConfigurationApplicationClient.js +202 -2
- package/sdk/application/Configuration/ConfigurationApplicationModel.d.ts +111 -0
- package/sdk/application/Configuration/ConfigurationApplicationModel.js +1182 -0
- package/sdk/application/{models/ConfigurationValidator.js → Configuration/ConfigurationApplicationValidator.js} +4 -2
- package/sdk/application/{client → Content}/ContentApplicationClient.js +217 -2
- package/sdk/application/Content/ContentApplicationModel.d.ts +105 -0
- package/sdk/application/Content/ContentApplicationModel.js +1349 -0
- package/sdk/application/{models/ContentValidator.js → Content/ContentApplicationValidator.js} +3 -1
- package/sdk/application/{client → FileStorage}/FileStorageApplicationClient.js +35 -2
- package/sdk/application/FileStorage/FileStorageApplicationModel.d.ts +21 -0
- package/sdk/application/FileStorage/FileStorageApplicationModel.js +244 -0
- package/sdk/application/{models/FileStorageValidator.js → FileStorage/FileStorageApplicationValidator.js} +6 -4
- package/sdk/application/{client → Lead}/LeadApplicationClient.js +83 -2
- package/sdk/application/Lead/LeadApplicationModel.d.ts +55 -0
- package/sdk/application/Lead/LeadApplicationModel.js +690 -0
- package/sdk/application/{models/LeadValidator.js → Lead/LeadApplicationValidator.js} +6 -4
- package/sdk/application/{client → Logistic}/LogisticApplicationClient.js +46 -2
- package/sdk/application/Logistic/LogisticApplicationModel.d.ts +26 -0
- package/sdk/application/Logistic/LogisticApplicationModel.js +286 -0
- package/sdk/application/{models/LogisticValidator.js → Logistic/LogisticApplicationValidator.js} +5 -3
- package/sdk/application/{client → Order}/OrderApplicationClient.js +148 -2
- package/sdk/application/Order/OrderApplicationModel.d.ts +67 -0
- package/sdk/application/Order/OrderApplicationModel.js +872 -0
- package/sdk/application/{models/OrderValidator.js → Order/OrderApplicationValidator.js} +5 -3
- package/sdk/application/{client → Payment}/PaymentApplicationClient.js +530 -2
- package/sdk/application/Payment/PaymentApplicationModel.d.ts +96 -0
- package/sdk/application/Payment/PaymentApplicationModel.js +1318 -0
- package/sdk/application/{models/PaymentValidator.js → Payment/PaymentApplicationValidator.js} +25 -23
- package/sdk/application/{client → PosCart}/PosCartApplicationClient.d.ts +9 -3
- package/sdk/application/{client → PosCart}/PosCartApplicationClient.js +343 -8
- package/sdk/application/PosCart/PosCartApplicationModel.d.ts +79 -0
- package/sdk/application/PosCart/PosCartApplicationModel.js +1132 -0
- package/sdk/application/{models/PosCartValidator.js → PosCart/PosCartApplicationValidator.js} +18 -13
- package/sdk/application/{client → Rewards}/RewardsApplicationClient.js +83 -2
- package/sdk/application/Rewards/RewardsApplicationModel.d.ts +23 -0
- package/sdk/application/Rewards/RewardsApplicationModel.js +276 -0
- package/sdk/application/{models/RewardsValidator.js → Rewards/RewardsApplicationValidator.js} +6 -4
- package/sdk/application/{client → Share}/ShareApplicationClient.js +89 -2
- package/sdk/application/Share/ShareApplicationModel.d.ts +16 -0
- package/sdk/application/Share/ShareApplicationModel.js +178 -0
- package/sdk/application/{models/ShareValidator.js → Share/ShareApplicationValidator.js} +4 -2
- package/sdk/application/{client → Theme}/ThemeApplicationClient.js +46 -2
- package/sdk/application/Theme/ThemeApplicationModel.d.ts +49 -0
- package/sdk/application/Theme/ThemeApplicationModel.js +486 -0
- package/sdk/application/{models/ThemeValidator.js → Theme/ThemeApplicationValidator.js} +3 -1
- package/sdk/application/{client → User}/UserApplicationClient.js +407 -2
- package/sdk/application/User/UserApplicationModel.d.ts +95 -0
- package/sdk/application/User/UserApplicationModel.js +998 -0
- package/sdk/application/{models/UserValidator.js → User/UserApplicationValidator.js} +31 -29
- package/sdk/application/index.d.ts +18 -0
- package/sdk/application/index.js +33 -0
- package/sdk/common/AxiosHelper.js +23 -10
- package/sdk/common/Logger.d.ts +2 -0
- package/sdk/common/Logger.js +6 -0
- package/sdk/common/curlHelper.d.ts +2 -0
- package/sdk/common/curlHelper.js +95 -0
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.d.ts +101 -0
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.js +399 -0
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.d.ts +11 -0
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.js +56 -0
- package/sdk/platform/{client → Analytics}/AnalyticsPlatformClient.js +60 -2
- package/sdk/platform/Analytics/AnalyticsPlatformModel.d.ts +23 -0
- package/sdk/platform/Analytics/AnalyticsPlatformModel.js +252 -0
- package/sdk/platform/{models/AnalyticsValidator.js → Analytics/AnalyticsPlatformValidator.js} +5 -4
- package/sdk/platform/{client → AuditTrail}/AuditTrailPlatformClient.js +48 -2
- package/sdk/platform/AuditTrail/AuditTrailPlatformModel.d.ts +18 -0
- package/sdk/platform/AuditTrail/AuditTrailPlatformModel.js +144 -0
- package/sdk/platform/{models/AuditTrailValidator.js → AuditTrail/AuditTrailPlatformValidator.js} +3 -2
- package/sdk/platform/{client → Billing}/BillingPlatformClient.js +162 -2
- package/sdk/platform/Billing/BillingPlatformModel.d.ts +65 -0
- package/sdk/platform/Billing/BillingPlatformModel.js +906 -0
- package/sdk/platform/{models/BillingValidator.js → Billing/BillingPlatformValidator.js} +6 -5
- package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +293 -0
- package/sdk/platform/Cart/CartPlatformApplicationClient.js +1001 -0
- package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +20 -0
- package/sdk/platform/Cart/CartPlatformApplicationValidator.js +138 -0
- package/sdk/platform/Cart/CartPlatformModel.d.ts +104 -0
- package/sdk/platform/Cart/CartPlatformModel.js +1516 -0
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +856 -0
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +2927 -0
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +56 -0
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +389 -0
- package/sdk/platform/{client → Catalog}/CatalogPlatformClient.js +1402 -349
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +317 -0
- package/sdk/platform/Catalog/CatalogPlatformModel.js +4702 -0
- package/sdk/platform/{models/CatalogValidator.js → Catalog/CatalogPlatformValidator.js} +92 -91
- package/sdk/platform/{client → Common}/CommonPlatformClient.js +28 -2
- package/sdk/platform/Common/CommonPlatformModel.d.ts +20 -0
- package/sdk/platform/Common/CommonPlatformModel.js +228 -0
- package/sdk/{application/models/CommonValidator.js → platform/Common/CommonPlatformValidator.js} +2 -1
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +611 -0
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +2243 -0
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.d.ts +43 -0
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.js +277 -0
- package/sdk/platform/{client → Communication}/CommunicationPlatformClient.js +17 -2
- package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +102 -0
- package/sdk/platform/Communication/CommunicationPlatformModel.js +1312 -0
- package/sdk/platform/{models/CommunicationValidator.js → Communication/CommunicationPlatformValidator.js} +2 -1
- package/sdk/platform/{client → CompanyProfile}/CompanyProfilePlatformClient.d.ts +0 -9
- package/sdk/platform/{client → CompanyProfile}/CompanyProfilePlatformClient.js +176 -28
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +44 -0
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +706 -0
- package/sdk/platform/{models/CompanyProfileValidator.d.ts → CompanyProfile/CompanyProfilePlatformValidator.d.ts} +0 -1
- package/sdk/platform/{models/CompanyProfileValidator.js → CompanyProfile/CompanyProfilePlatformValidator.js} +9 -14
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +309 -0
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +1322 -0
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.d.ts +31 -0
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.js +164 -0
- package/sdk/platform/{client → Configuration}/ConfigurationPlatformClient.js +284 -2
- package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +185 -0
- package/sdk/platform/Configuration/ConfigurationPlatformModel.js +2072 -0
- package/sdk/platform/{models/ConfigurationValidator.js → Configuration/ConfigurationPlatformValidator.js} +9 -8
- package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +781 -0
- package/sdk/platform/Content/ContentPlatformApplicationClient.js +3074 -0
- package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +71 -0
- package/sdk/platform/Content/ContentPlatformApplicationValidator.js +422 -0
- package/sdk/platform/Content/ContentPlatformModel.d.ts +105 -0
- package/sdk/platform/Content/ContentPlatformModel.js +1349 -0
- package/sdk/platform/{client → Discount}/DiscountPlatformClient.d.ts +11 -0
- package/sdk/platform/{client → Discount}/DiscountPlatformClient.js +187 -2
- package/sdk/platform/Discount/DiscountPlatformModel.d.ts +15 -0
- package/sdk/platform/Discount/DiscountPlatformModel.js +176 -0
- package/sdk/platform/{models/DiscountValidator.d.ts → Discount/DiscountPlatformValidator.d.ts} +1 -0
- package/sdk/platform/{models/DiscountValidator.js → Discount/DiscountPlatformValidator.js} +13 -5
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +114 -0
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +301 -0
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.d.ts +7 -0
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.js +38 -0
- package/sdk/platform/{client → FileStorage}/FileStoragePlatformClient.js +78 -2
- package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +21 -0
- package/sdk/platform/FileStorage/FileStoragePlatformModel.js +244 -0
- package/sdk/platform/{models/FileStorageValidator.js → FileStorage/FileStoragePlatformValidator.js} +6 -5
- package/sdk/platform/{client → Inventory}/InventoryPlatformClient.js +163 -2
- package/sdk/platform/Inventory/InventoryPlatformModel.d.ts +62 -0
- package/sdk/platform/Inventory/InventoryPlatformModel.js +1178 -0
- package/sdk/platform/{models/InventoryValidator.js → Inventory/InventoryPlatformValidator.js} +5 -4
- package/sdk/platform/Lead/LeadPlatformApplicationClient.d.ts +138 -0
- package/sdk/platform/Lead/LeadPlatformApplicationClient.js +559 -0
- package/sdk/platform/Lead/LeadPlatformApplicationValidator.d.ts +16 -0
- package/sdk/platform/Lead/LeadPlatformApplicationValidator.js +90 -0
- package/sdk/platform/{client → Lead}/LeadPlatformClient.js +142 -2
- package/sdk/platform/Lead/LeadPlatformModel.d.ts +55 -0
- package/sdk/platform/Lead/LeadPlatformModel.js +690 -0
- package/sdk/platform/{models/LeadValidator.js → Lead/LeadPlatformValidator.js} +7 -6
- package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +59 -0
- package/sdk/platform/Order/OrderPlatformApplicationClient.js +207 -0
- package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +6 -0
- package/sdk/platform/Order/OrderPlatformApplicationValidator.js +37 -0
- package/sdk/platform/{client → Order}/OrderPlatformClient.d.ts +24 -55
- package/sdk/platform/{client → Order}/OrderPlatformClient.js +693 -146
- package/sdk/platform/Order/OrderPlatformModel.d.ts +222 -0
- package/sdk/platform/Order/OrderPlatformModel.js +3466 -0
- package/sdk/platform/{models/OrderValidator.d.ts → Order/OrderPlatformValidator.d.ts} +2 -3
- package/sdk/platform/{models/OrderValidator.js → Order/OrderPlatformValidator.js} +32 -48
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.d.ts +30 -0
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.js +100 -0
- package/sdk/platform/Partner/PartnerPlatformApplicationValidator.d.ts +5 -0
- package/sdk/platform/Partner/PartnerPlatformApplicationValidator.js +20 -0
- package/sdk/platform/Partner/PartnerPlatformModel.d.ts +7 -0
- package/sdk/platform/Partner/PartnerPlatformModel.js +54 -0
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +108 -0
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +498 -0
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +14 -0
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +73 -0
- package/sdk/platform/{client → Payment}/PaymentPlatformClient.js +141 -2
- package/sdk/platform/Payment/PaymentPlatformModel.d.ts +44 -0
- package/sdk/platform/Payment/PaymentPlatformModel.js +552 -0
- package/sdk/platform/{models/PaymentValidator.js → Payment/PaymentPlatformValidator.js} +6 -5
- package/sdk/platform/PlatformAPIClient.js +2 -1
- package/sdk/platform/PlatformApplicationClient.d.ts +2824 -18486
- package/sdk/platform/PlatformApplicationClient.js +3772 -13928
- package/sdk/platform/PlatformClient.d.ts +2824 -2881
- package/sdk/platform/PlatformClient.js +3710 -3145
- package/sdk/platform/PlatformConfig.js +2 -1
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.d.ts +150 -0
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +597 -0
- package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.d.ts +16 -0
- package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.js +91 -0
- package/sdk/platform/Rewards/RewardsPlatformModel.d.ts +24 -0
- package/sdk/platform/Rewards/RewardsPlatformModel.js +294 -0
- package/sdk/platform/Share/SharePlatformApplicationClient.d.ts +72 -0
- package/sdk/platform/Share/SharePlatformApplicationClient.js +235 -0
- package/sdk/platform/Share/SharePlatformApplicationValidator.d.ts +7 -0
- package/sdk/platform/Share/SharePlatformApplicationValidator.js +35 -0
- package/sdk/platform/Share/SharePlatformModel.d.ts +15 -0
- package/sdk/platform/Share/SharePlatformModel.js +170 -0
- package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +238 -0
- package/sdk/platform/Theme/ThemePlatformApplicationClient.js +997 -0
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.d.ts +27 -0
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.js +155 -0
- package/sdk/platform/Theme/ThemePlatformModel.d.ts +49 -0
- package/sdk/platform/Theme/ThemePlatformModel.js +486 -0
- package/sdk/platform/User/UserPlatformApplicationClient.d.ts +121 -0
- package/sdk/platform/User/UserPlatformApplicationClient.js +506 -0
- package/sdk/platform/User/UserPlatformApplicationValidator.d.ts +15 -0
- package/sdk/platform/User/UserPlatformApplicationValidator.js +79 -0
- package/sdk/platform/User/UserPlatformModel.d.ts +95 -0
- package/sdk/platform/User/UserPlatformModel.js +998 -0
- package/sdk/platform/{client → Webhook}/WebhookPlatformClient.js +92 -2
- package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +17 -0
- package/sdk/platform/Webhook/WebhookPlatformModel.js +208 -0
- package/sdk/platform/{models/WebhookValidator.js → Webhook/WebhookPlatformValidator.js} +4 -3
- package/sdk/platform/index.d.ts +24 -0
- package/sdk/platform/index.js +45 -0
- package/sdk/public/{client → Configuration}/ConfigurationPublicClient.js +26 -1
- package/sdk/public/Configuration/ConfigurationPublicModel.d.ts +20 -0
- package/sdk/public/Configuration/ConfigurationPublicModel.js +230 -0
- package/sdk/public/{models/ConfigurationValidator.js → Configuration/ConfigurationPublicValidator.js} +3 -1
- package/sdk/public/{client → Inventory}/InventoryPublicClient.js +76 -1
- package/sdk/public/Inventory/InventoryPublicModel.d.ts +22 -0
- package/sdk/public/Inventory/InventoryPublicModel.js +334 -0
- package/sdk/public/{models/InventoryValidator.js → Inventory/InventoryPublicValidator.js} +4 -2
- package/sdk/public/PublicClient.d.ts +3 -3
- package/sdk/public/PublicClient.js +8 -3
- package/sdk/public/{client → Webhook}/WebhookPublicClient.js +30 -1
- package/sdk/public/Webhook/WebhookPublicModel.d.ts +17 -0
- package/sdk/public/Webhook/WebhookPublicModel.js +208 -0
- package/sdk/public/{models/WebhookValidator.js → Webhook/WebhookPublicValidator.js} +4 -2
- package/sdk/public/index.d.ts +5 -0
- package/sdk/public/index.js +7 -0
- package/sdk/platform/PlatformApplicationModels.d.ts +0 -328
- package/sdk/platform/PlatformApplicationModels.js +0 -22658
- package/sdk/platform/PlatformModels.d.ts +0 -1477
- package/sdk/platform/PlatformModels.js +0 -20646
- package/sdk/platform/models/CartValidator.d.ts +0 -0
- package/sdk/platform/models/CartValidator.js +0 -0
- package/sdk/platform/models/ContentValidator.d.ts +0 -0
- package/sdk/platform/models/ContentValidator.js +0 -0
- package/sdk/platform/models/PartnerValidator.d.ts +0 -0
- package/sdk/platform/models/PartnerValidator.js +0 -0
- package/sdk/platform/models/RewardsValidator.d.ts +0 -0
- package/sdk/platform/models/RewardsValidator.js +0 -0
- package/sdk/platform/models/ShareValidator.d.ts +0 -0
- package/sdk/platform/models/ShareValidator.js +0 -0
- package/sdk/platform/models/ThemeValidator.d.ts +0 -0
- package/sdk/platform/models/ThemeValidator.js +0 -0
- package/sdk/platform/models/UserValidator.d.ts +0 -0
- package/sdk/platform/models/UserValidator.js +0 -0
- package/sdk/public/PublicModels.d.ts +0 -50
- package/sdk/public/PublicModels.js +0 -712
- package/sdk/application/{models/CartValidator.d.ts → Cart/CartApplicationValidator.d.ts} +0 -0
- package/sdk/application/{models/CatalogValidator.d.ts → Catalog/CatalogApplicationValidator.d.ts} +0 -0
- package/sdk/application/{client → Common}/CommonApplicationClient.d.ts +0 -0
- package/sdk/application/{models/CommonValidator.d.ts → Common/CommonApplicationValidator.d.ts} +0 -0
- package/sdk/application/{client → Communication}/CommunicationApplicationClient.d.ts +0 -0
- package/sdk/application/{models/CommunicationValidator.d.ts → Communication/CommunicationApplicationValidator.d.ts} +0 -0
- package/sdk/application/{client → Configuration}/ConfigurationApplicationClient.d.ts +0 -0
- package/sdk/application/{models/ConfigurationValidator.d.ts → Configuration/ConfigurationApplicationValidator.d.ts} +0 -0
- package/sdk/application/{client → Content}/ContentApplicationClient.d.ts +0 -0
- package/sdk/application/{models/ContentValidator.d.ts → Content/ContentApplicationValidator.d.ts} +0 -0
- package/sdk/application/{client → FileStorage}/FileStorageApplicationClient.d.ts +0 -0
- package/sdk/application/{models/FileStorageValidator.d.ts → FileStorage/FileStorageApplicationValidator.d.ts} +0 -0
- package/sdk/application/{client → Lead}/LeadApplicationClient.d.ts +0 -0
- package/sdk/application/{models/LeadValidator.d.ts → Lead/LeadApplicationValidator.d.ts} +0 -0
- package/sdk/application/{client → Logistic}/LogisticApplicationClient.d.ts +0 -0
- package/sdk/application/{models/LogisticValidator.d.ts → Logistic/LogisticApplicationValidator.d.ts} +0 -0
- package/sdk/application/{client → Order}/OrderApplicationClient.d.ts +0 -0
- package/sdk/application/{models/OrderValidator.d.ts → Order/OrderApplicationValidator.d.ts} +0 -0
- package/sdk/application/{client → Payment}/PaymentApplicationClient.d.ts +0 -0
- package/sdk/application/{models/PaymentValidator.d.ts → Payment/PaymentApplicationValidator.d.ts} +0 -0
- package/sdk/application/{models/PosCartValidator.d.ts → PosCart/PosCartApplicationValidator.d.ts} +0 -0
- package/sdk/application/{client → Rewards}/RewardsApplicationClient.d.ts +0 -0
- package/sdk/application/{models/RewardsValidator.d.ts → Rewards/RewardsApplicationValidator.d.ts} +0 -0
- package/sdk/application/{client → Share}/ShareApplicationClient.d.ts +0 -0
- package/sdk/application/{models/ShareValidator.d.ts → Share/ShareApplicationValidator.d.ts} +0 -0
- package/sdk/application/{client → Theme}/ThemeApplicationClient.d.ts +0 -0
- package/sdk/application/{models/ThemeValidator.d.ts → Theme/ThemeApplicationValidator.d.ts} +0 -0
- package/sdk/application/{client → User}/UserApplicationClient.d.ts +0 -0
- package/sdk/application/{models/UserValidator.d.ts → User/UserApplicationValidator.d.ts} +0 -0
- package/sdk/platform/{client → Analytics}/AnalyticsPlatformClient.d.ts +0 -0
- package/sdk/platform/{models/AnalyticsValidator.d.ts → Analytics/AnalyticsPlatformValidator.d.ts} +0 -0
- package/sdk/platform/{client → AuditTrail}/AuditTrailPlatformClient.d.ts +0 -0
- package/sdk/platform/{models/AuditTrailValidator.d.ts → AuditTrail/AuditTrailPlatformValidator.d.ts} +0 -0
- package/sdk/platform/{client → Billing}/BillingPlatformClient.d.ts +0 -0
- package/sdk/platform/{models/BillingValidator.d.ts → Billing/BillingPlatformValidator.d.ts} +0 -0
- package/sdk/platform/{client → Catalog}/CatalogPlatformClient.d.ts +149 -149
- package/sdk/platform/{models/CatalogValidator.d.ts → Catalog/CatalogPlatformValidator.d.ts} +21 -21
- /package/sdk/platform/{client → Common}/CommonPlatformClient.d.ts +0 -0
- /package/sdk/platform/{models/CommonValidator.d.ts → Common/CommonPlatformValidator.d.ts} +0 -0
- /package/sdk/platform/{client → Communication}/CommunicationPlatformClient.d.ts +0 -0
- /package/sdk/platform/{models/CommunicationValidator.d.ts → Communication/CommunicationPlatformValidator.d.ts} +0 -0
- /package/sdk/platform/{client → Configuration}/ConfigurationPlatformClient.d.ts +0 -0
- /package/sdk/platform/{models/ConfigurationValidator.d.ts → Configuration/ConfigurationPlatformValidator.d.ts} +0 -0
- /package/sdk/platform/{client → FileStorage}/FileStoragePlatformClient.d.ts +0 -0
- /package/sdk/platform/{models/FileStorageValidator.d.ts → FileStorage/FileStoragePlatformValidator.d.ts} +0 -0
- /package/sdk/platform/{client → Inventory}/InventoryPlatformClient.d.ts +0 -0
- /package/sdk/platform/{models/InventoryValidator.d.ts → Inventory/InventoryPlatformValidator.d.ts} +0 -0
- /package/sdk/platform/{client → Lead}/LeadPlatformClient.d.ts +0 -0
- /package/sdk/platform/{models/LeadValidator.d.ts → Lead/LeadPlatformValidator.d.ts} +0 -0
- /package/sdk/platform/{client → Payment}/PaymentPlatformClient.d.ts +0 -0
- /package/sdk/platform/{models/PaymentValidator.d.ts → Payment/PaymentPlatformValidator.d.ts} +0 -0
- /package/sdk/platform/{client → Webhook}/WebhookPlatformClient.d.ts +0 -0
- /package/sdk/platform/{models/WebhookValidator.d.ts → Webhook/WebhookPlatformValidator.d.ts} +0 -0
- /package/sdk/public/{client → Configuration}/ConfigurationPublicClient.d.ts +0 -0
- /package/sdk/public/{models/ConfigurationValidator.d.ts → Configuration/ConfigurationPublicValidator.d.ts} +0 -0
- /package/sdk/public/{client → Inventory}/InventoryPublicClient.d.ts +0 -0
- /package/sdk/public/{models/InventoryValidator.d.ts → Inventory/InventoryPublicValidator.d.ts} +0 -0
- /package/sdk/public/{client → Webhook}/WebhookPublicClient.d.ts +0 -0
- /package/sdk/public/{models/WebhookValidator.d.ts → Webhook/WebhookPublicValidator.d.ts} +0 -0
|
@@ -0,0 +1,597 @@
|
|
|
1
|
+
const Paginator = require("../../common/Paginator");
|
|
2
|
+
const PlatformAPIClient = require("../PlatformAPIClient");
|
|
3
|
+
const { FDKClientValidationError } = require("../../common/FDKError");
|
|
4
|
+
const RewardsValidator = require("./RewardsPlatformApplicationValidator");
|
|
5
|
+
|
|
6
|
+
class Rewards {
|
|
7
|
+
constructor(config, applicationId) {
|
|
8
|
+
this.config = config;
|
|
9
|
+
this.applicationId = applicationId;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @param {Object} arg - Arg object.
|
|
14
|
+
* @param {string} arg.pageId - Pagination page id
|
|
15
|
+
* @param {number} arg.pageSize - Pagination page size
|
|
16
|
+
* @summary: List of giveaways of the current application.
|
|
17
|
+
* @description: List of giveaways of the current application.
|
|
18
|
+
*/
|
|
19
|
+
showGiveaways({ pageId, pageSize } = {}) {
|
|
20
|
+
const { error } = RewardsValidator.showGiveaways().validate(
|
|
21
|
+
{
|
|
22
|
+
pageId,
|
|
23
|
+
pageSize,
|
|
24
|
+
},
|
|
25
|
+
{ abortEarly: false, allowUnknown: true }
|
|
26
|
+
);
|
|
27
|
+
if (error) {
|
|
28
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// Showing warrnings if extra unknown parameters are found
|
|
32
|
+
const { error: warrning } = RewardsValidator.showGiveaways().validate(
|
|
33
|
+
{
|
|
34
|
+
pageId,
|
|
35
|
+
pageSize,
|
|
36
|
+
},
|
|
37
|
+
{ abortEarly: false, allowUnknown: false }
|
|
38
|
+
);
|
|
39
|
+
if (warrning) {
|
|
40
|
+
console.log("Parameter Validation warrnings for showGiveaways");
|
|
41
|
+
console.log(warrning);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const query_params = {};
|
|
45
|
+
query_params["page_id"] = pageId;
|
|
46
|
+
query_params["page_size"] = pageSize;
|
|
47
|
+
|
|
48
|
+
return PlatformAPIClient.execute(
|
|
49
|
+
this.config,
|
|
50
|
+
"get",
|
|
51
|
+
`/service/platform/rewards/v1.0/company/${this.config.companyId}/application/${this.applicationId}/giveaways`,
|
|
52
|
+
query_params,
|
|
53
|
+
undefined
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* @param {Object} arg - Arg object.
|
|
59
|
+
* @param {Giveaway} arg.body
|
|
60
|
+
* @summary: List of giveaways of the current application.
|
|
61
|
+
* @description: Adds a new giveaway.
|
|
62
|
+
*/
|
|
63
|
+
saveGiveAway({ body } = {}) {
|
|
64
|
+
const { error } = RewardsValidator.saveGiveAway().validate(
|
|
65
|
+
{
|
|
66
|
+
body,
|
|
67
|
+
},
|
|
68
|
+
{ abortEarly: false, allowUnknown: true }
|
|
69
|
+
);
|
|
70
|
+
if (error) {
|
|
71
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// Showing warrnings if extra unknown parameters are found
|
|
75
|
+
const { error: warrning } = RewardsValidator.saveGiveAway().validate(
|
|
76
|
+
{
|
|
77
|
+
body,
|
|
78
|
+
},
|
|
79
|
+
{ abortEarly: false, allowUnknown: false }
|
|
80
|
+
);
|
|
81
|
+
if (warrning) {
|
|
82
|
+
console.log("Parameter Validation warrnings for saveGiveAway");
|
|
83
|
+
console.log(warrning);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
const query_params = {};
|
|
87
|
+
|
|
88
|
+
return PlatformAPIClient.execute(
|
|
89
|
+
this.config,
|
|
90
|
+
"post",
|
|
91
|
+
`/service/platform/rewards/v1.0/company/${this.config.companyId}/application/${this.applicationId}/giveaways`,
|
|
92
|
+
query_params,
|
|
93
|
+
body
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* @param {Object} arg - Arg object.
|
|
99
|
+
* @param {string} arg.id - Giveaway ID
|
|
100
|
+
* @summary: Get giveaway by ID.
|
|
101
|
+
* @description: Get giveaway by ID.
|
|
102
|
+
*/
|
|
103
|
+
getGiveawayById({ id } = {}) {
|
|
104
|
+
const { error } = RewardsValidator.getGiveawayById().validate(
|
|
105
|
+
{
|
|
106
|
+
id,
|
|
107
|
+
},
|
|
108
|
+
{ abortEarly: false, allowUnknown: true }
|
|
109
|
+
);
|
|
110
|
+
if (error) {
|
|
111
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
// Showing warrnings if extra unknown parameters are found
|
|
115
|
+
const { error: warrning } = RewardsValidator.getGiveawayById().validate(
|
|
116
|
+
{
|
|
117
|
+
id,
|
|
118
|
+
},
|
|
119
|
+
{ abortEarly: false, allowUnknown: false }
|
|
120
|
+
);
|
|
121
|
+
if (warrning) {
|
|
122
|
+
console.log("Parameter Validation warrnings for getGiveawayById");
|
|
123
|
+
console.log(warrning);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
const query_params = {};
|
|
127
|
+
|
|
128
|
+
return PlatformAPIClient.execute(
|
|
129
|
+
this.config,
|
|
130
|
+
"get",
|
|
131
|
+
`/service/platform/rewards/v1.0/company/${this.config.companyId}/application/${this.applicationId}/giveaways/${id}`,
|
|
132
|
+
query_params,
|
|
133
|
+
undefined
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* @param {Object} arg - Arg object.
|
|
139
|
+
* @param {string} arg.id - Giveaway ID
|
|
140
|
+
* @param {Giveaway} arg.body
|
|
141
|
+
* @summary: Updates the giveaway by it's ID.
|
|
142
|
+
* @description: Updates the giveaway by it's ID.
|
|
143
|
+
*/
|
|
144
|
+
updateGiveAway({ id, body } = {}) {
|
|
145
|
+
const { error } = RewardsValidator.updateGiveAway().validate(
|
|
146
|
+
{
|
|
147
|
+
id,
|
|
148
|
+
body,
|
|
149
|
+
},
|
|
150
|
+
{ abortEarly: false, allowUnknown: true }
|
|
151
|
+
);
|
|
152
|
+
if (error) {
|
|
153
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
// Showing warrnings if extra unknown parameters are found
|
|
157
|
+
const { error: warrning } = RewardsValidator.updateGiveAway().validate(
|
|
158
|
+
{
|
|
159
|
+
id,
|
|
160
|
+
body,
|
|
161
|
+
},
|
|
162
|
+
{ abortEarly: false, allowUnknown: false }
|
|
163
|
+
);
|
|
164
|
+
if (warrning) {
|
|
165
|
+
console.log("Parameter Validation warrnings for updateGiveAway");
|
|
166
|
+
console.log(warrning);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
const query_params = {};
|
|
170
|
+
|
|
171
|
+
return PlatformAPIClient.execute(
|
|
172
|
+
this.config,
|
|
173
|
+
"put",
|
|
174
|
+
`/service/platform/rewards/v1.0/company/${this.config.companyId}/application/${this.applicationId}/giveaways/${id}`,
|
|
175
|
+
query_params,
|
|
176
|
+
body
|
|
177
|
+
);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* @param {Object} arg - Arg object.
|
|
182
|
+
* @param {string} arg.audienceId - Audience id
|
|
183
|
+
* @summary: Get the Giveaway audience status
|
|
184
|
+
* @description: Get giveaway audience status
|
|
185
|
+
*/
|
|
186
|
+
getGiveawayAudienceStatus({ audienceId } = {}) {
|
|
187
|
+
const { error } = RewardsValidator.getGiveawayAudienceStatus().validate(
|
|
188
|
+
{
|
|
189
|
+
audienceId,
|
|
190
|
+
},
|
|
191
|
+
{ abortEarly: false, allowUnknown: true }
|
|
192
|
+
);
|
|
193
|
+
if (error) {
|
|
194
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
// Showing warrnings if extra unknown parameters are found
|
|
198
|
+
const {
|
|
199
|
+
error: warrning,
|
|
200
|
+
} = RewardsValidator.getGiveawayAudienceStatus().validate(
|
|
201
|
+
{
|
|
202
|
+
audienceId,
|
|
203
|
+
},
|
|
204
|
+
{ abortEarly: false, allowUnknown: false }
|
|
205
|
+
);
|
|
206
|
+
if (warrning) {
|
|
207
|
+
console.log(
|
|
208
|
+
"Parameter Validation warrnings for getGiveawayAudienceStatus"
|
|
209
|
+
);
|
|
210
|
+
console.log(warrning);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
const query_params = {};
|
|
214
|
+
|
|
215
|
+
return PlatformAPIClient.execute(
|
|
216
|
+
this.config,
|
|
217
|
+
"get",
|
|
218
|
+
`/service/platform/rewards/v1.0/company/${this.config.companyId}/application/${this.applicationId}/giveaways/audience/${audienceId}/status`,
|
|
219
|
+
query_params,
|
|
220
|
+
undefined
|
|
221
|
+
);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* @param {Object} arg - Arg object.
|
|
226
|
+
* @summary: List of offers of the current application.
|
|
227
|
+
* @description: List of offers of the current application.
|
|
228
|
+
*/
|
|
229
|
+
showOffers({} = {}) {
|
|
230
|
+
const { error } = RewardsValidator.showOffers().validate(
|
|
231
|
+
{},
|
|
232
|
+
{ abortEarly: false, allowUnknown: true }
|
|
233
|
+
);
|
|
234
|
+
if (error) {
|
|
235
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
// Showing warrnings if extra unknown parameters are found
|
|
239
|
+
const { error: warrning } = RewardsValidator.showOffers().validate(
|
|
240
|
+
{},
|
|
241
|
+
{ abortEarly: false, allowUnknown: false }
|
|
242
|
+
);
|
|
243
|
+
if (warrning) {
|
|
244
|
+
console.log("Parameter Validation warrnings for showOffers");
|
|
245
|
+
console.log(warrning);
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
const query_params = {};
|
|
249
|
+
|
|
250
|
+
return PlatformAPIClient.execute(
|
|
251
|
+
this.config,
|
|
252
|
+
"get",
|
|
253
|
+
`/service/platform/rewards/v1.0/company/${this.config.companyId}/application/${this.applicationId}/offers/`,
|
|
254
|
+
query_params,
|
|
255
|
+
undefined
|
|
256
|
+
);
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* @param {Object} arg - Arg object.
|
|
261
|
+
* @param {string} arg.name - The name given to the offer.
|
|
262
|
+
* @param {string} arg.cookie - User's session cookie. This cookie is set in
|
|
263
|
+
* browser cookie when logged-in to fynd's authentication system i.e.
|
|
264
|
+
* `Grimlock` or by using grimlock-backend SDK for backend implementation.
|
|
265
|
+
* @summary: Get offer by name
|
|
266
|
+
* @description: Use this API to get the offer details and configuration by entering the name of the offer.
|
|
267
|
+
*/
|
|
268
|
+
getOfferByName({ name, cookie } = {}) {
|
|
269
|
+
const { error } = RewardsValidator.getOfferByName().validate(
|
|
270
|
+
{
|
|
271
|
+
name,
|
|
272
|
+
cookie,
|
|
273
|
+
},
|
|
274
|
+
{ abortEarly: false, allowUnknown: true }
|
|
275
|
+
);
|
|
276
|
+
if (error) {
|
|
277
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
// Showing warrnings if extra unknown parameters are found
|
|
281
|
+
const { error: warrning } = RewardsValidator.getOfferByName().validate(
|
|
282
|
+
{
|
|
283
|
+
name,
|
|
284
|
+
cookie,
|
|
285
|
+
},
|
|
286
|
+
{ abortEarly: false, allowUnknown: false }
|
|
287
|
+
);
|
|
288
|
+
if (warrning) {
|
|
289
|
+
console.log("Parameter Validation warrnings for getOfferByName");
|
|
290
|
+
console.log(warrning);
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
const query_params = {};
|
|
294
|
+
|
|
295
|
+
return PlatformAPIClient.execute(
|
|
296
|
+
this.config,
|
|
297
|
+
"get",
|
|
298
|
+
`/service/platform/rewards/v1.0/company/${this.config.companyId}/application/${this.applicationId}/offers/${name}/`,
|
|
299
|
+
query_params,
|
|
300
|
+
undefined
|
|
301
|
+
);
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* @param {Object} arg - Arg object.
|
|
306
|
+
* @param {string} arg.name - The name given to the offer.
|
|
307
|
+
* @param {Offer} arg.body
|
|
308
|
+
* @summary: Update offer by name
|
|
309
|
+
* @description: Use this API to update the offer details
|
|
310
|
+
*/
|
|
311
|
+
updateOfferByName({ name, body } = {}) {
|
|
312
|
+
const { error } = RewardsValidator.updateOfferByName().validate(
|
|
313
|
+
{
|
|
314
|
+
name,
|
|
315
|
+
body,
|
|
316
|
+
},
|
|
317
|
+
{ abortEarly: false, allowUnknown: true }
|
|
318
|
+
);
|
|
319
|
+
if (error) {
|
|
320
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
// Showing warrnings if extra unknown parameters are found
|
|
324
|
+
const { error: warrning } = RewardsValidator.updateOfferByName().validate(
|
|
325
|
+
{
|
|
326
|
+
name,
|
|
327
|
+
body,
|
|
328
|
+
},
|
|
329
|
+
{ abortEarly: false, allowUnknown: false }
|
|
330
|
+
);
|
|
331
|
+
if (warrning) {
|
|
332
|
+
console.log("Parameter Validation warrnings for updateOfferByName");
|
|
333
|
+
console.log(warrning);
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
const query_params = {};
|
|
337
|
+
|
|
338
|
+
return PlatformAPIClient.execute(
|
|
339
|
+
this.config,
|
|
340
|
+
"put",
|
|
341
|
+
`/service/platform/rewards/v1.0/company/${this.config.companyId}/application/${this.applicationId}/offers/${name}/`,
|
|
342
|
+
query_params,
|
|
343
|
+
body
|
|
344
|
+
);
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
/**
|
|
348
|
+
* @param {Object} arg - Arg object.
|
|
349
|
+
* @param {string} arg.userId - User id
|
|
350
|
+
* @param {AppUser} arg.body
|
|
351
|
+
* @summary: Update user status
|
|
352
|
+
* @description: Use this API to update the user status active/archive
|
|
353
|
+
*/
|
|
354
|
+
updateUserStatus({ userId, body } = {}) {
|
|
355
|
+
const { error } = RewardsValidator.updateUserStatus().validate(
|
|
356
|
+
{
|
|
357
|
+
userId,
|
|
358
|
+
body,
|
|
359
|
+
},
|
|
360
|
+
{ abortEarly: false, allowUnknown: true }
|
|
361
|
+
);
|
|
362
|
+
if (error) {
|
|
363
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
// Showing warrnings if extra unknown parameters are found
|
|
367
|
+
const { error: warrning } = RewardsValidator.updateUserStatus().validate(
|
|
368
|
+
{
|
|
369
|
+
userId,
|
|
370
|
+
body,
|
|
371
|
+
},
|
|
372
|
+
{ abortEarly: false, allowUnknown: false }
|
|
373
|
+
);
|
|
374
|
+
if (warrning) {
|
|
375
|
+
console.log("Parameter Validation warrnings for updateUserStatus");
|
|
376
|
+
console.log(warrning);
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
const query_params = {};
|
|
380
|
+
|
|
381
|
+
return PlatformAPIClient.execute(
|
|
382
|
+
this.config,
|
|
383
|
+
"patch",
|
|
384
|
+
`/service/platform/rewards/v1.0/company/${this.config.companyId}/application/${this.applicationId}/users/${userId}/`,
|
|
385
|
+
query_params,
|
|
386
|
+
body
|
|
387
|
+
);
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
/**
|
|
391
|
+
* @param {Object} arg - Arg object.
|
|
392
|
+
* @param {string} arg.userId - User id
|
|
393
|
+
* @summary: Get user reward details
|
|
394
|
+
* @description: Use this API to get the user reward details
|
|
395
|
+
*/
|
|
396
|
+
user({ userId } = {}) {
|
|
397
|
+
const { error } = RewardsValidator.user().validate(
|
|
398
|
+
{
|
|
399
|
+
userId,
|
|
400
|
+
},
|
|
401
|
+
{ abortEarly: false, allowUnknown: true }
|
|
402
|
+
);
|
|
403
|
+
if (error) {
|
|
404
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
// Showing warrnings if extra unknown parameters are found
|
|
408
|
+
const { error: warrning } = RewardsValidator.user().validate(
|
|
409
|
+
{
|
|
410
|
+
userId,
|
|
411
|
+
},
|
|
412
|
+
{ abortEarly: false, allowUnknown: false }
|
|
413
|
+
);
|
|
414
|
+
if (warrning) {
|
|
415
|
+
console.log("Parameter Validation warrnings for user");
|
|
416
|
+
console.log(warrning);
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
const query_params = {};
|
|
420
|
+
|
|
421
|
+
return PlatformAPIClient.execute(
|
|
422
|
+
this.config,
|
|
423
|
+
"get",
|
|
424
|
+
`/service/platform/rewards/v1.0/company/${this.config.companyId}/application/${this.applicationId}/users/${userId}/`,
|
|
425
|
+
query_params,
|
|
426
|
+
undefined
|
|
427
|
+
);
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
/**
|
|
431
|
+
* @param {Object} arg - Arg object.
|
|
432
|
+
* @param {string} arg.userId - User id
|
|
433
|
+
* @param {string} [arg.pageId] - PageID is the ID of the requested page.
|
|
434
|
+
* For first request it should be kept empty.
|
|
435
|
+
* @param {number} [arg.pageSize] - The number of items to retrieve in each page.
|
|
436
|
+
* @summary: Get all transactions of reward points
|
|
437
|
+
* @description: Use this API to get a list of points transactions.
|
|
438
|
+
*/
|
|
439
|
+
getUserPointsHistory({ userId, pageId, pageSize } = {}) {
|
|
440
|
+
const { error } = RewardsValidator.getUserPointsHistory().validate(
|
|
441
|
+
{
|
|
442
|
+
userId,
|
|
443
|
+
pageId,
|
|
444
|
+
pageSize,
|
|
445
|
+
},
|
|
446
|
+
{ abortEarly: false, allowUnknown: true }
|
|
447
|
+
);
|
|
448
|
+
if (error) {
|
|
449
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
// Showing warrnings if extra unknown parameters are found
|
|
453
|
+
const {
|
|
454
|
+
error: warrning,
|
|
455
|
+
} = RewardsValidator.getUserPointsHistory().validate(
|
|
456
|
+
{
|
|
457
|
+
userId,
|
|
458
|
+
pageId,
|
|
459
|
+
pageSize,
|
|
460
|
+
},
|
|
461
|
+
{ abortEarly: false, allowUnknown: false }
|
|
462
|
+
);
|
|
463
|
+
if (warrning) {
|
|
464
|
+
console.log("Parameter Validation warrnings for getUserPointsHistory");
|
|
465
|
+
console.log(warrning);
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
const query_params = {};
|
|
469
|
+
query_params["page_id"] = pageId;
|
|
470
|
+
query_params["page_size"] = pageSize;
|
|
471
|
+
|
|
472
|
+
return PlatformAPIClient.execute(
|
|
473
|
+
this.config,
|
|
474
|
+
"get",
|
|
475
|
+
`/service/platform/rewards/v1.0/company/${this.config.companyId}/application/${this.applicationId}/users/${userId}/points/history/`,
|
|
476
|
+
query_params,
|
|
477
|
+
undefined
|
|
478
|
+
);
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
/**
|
|
482
|
+
* @param {Object} arg - Arg object.
|
|
483
|
+
* @param {string} arg.userId - User id
|
|
484
|
+
* @param {string} arg.companyId - Company id
|
|
485
|
+
* @param {string} arg.applicationId - Application id
|
|
486
|
+
* @param {number} [arg.pageSize] - The number of items to retrieve in each page.
|
|
487
|
+
* @summary: Get all transactions of reward points
|
|
488
|
+
* @description: Use this API to get a list of points transactions.
|
|
489
|
+
*/
|
|
490
|
+
getUserPointsHistoryPaginator({
|
|
491
|
+
userId,
|
|
492
|
+
companyId,
|
|
493
|
+
applicationId,
|
|
494
|
+
pageSize,
|
|
495
|
+
} = {}) {
|
|
496
|
+
const paginator = new Paginator();
|
|
497
|
+
const callback = async () => {
|
|
498
|
+
const pageId = paginator.nextId;
|
|
499
|
+
const pageNo = paginator.pageNo;
|
|
500
|
+
const pageType = "cursor";
|
|
501
|
+
const data = await this.getUserPointsHistory({
|
|
502
|
+
userId: userId,
|
|
503
|
+
companyId: companyId,
|
|
504
|
+
applicationId: applicationId,
|
|
505
|
+
pageId: pageId,
|
|
506
|
+
pageSize: pageSize,
|
|
507
|
+
});
|
|
508
|
+
paginator.setPaginator({
|
|
509
|
+
hasNext: data.page.has_next ? true : false,
|
|
510
|
+
nextId: data.page.next_id,
|
|
511
|
+
});
|
|
512
|
+
return data;
|
|
513
|
+
};
|
|
514
|
+
paginator.setCallback(callback.bind(this));
|
|
515
|
+
return paginator;
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
/**
|
|
519
|
+
* @param {Object} arg - Arg object.
|
|
520
|
+
* @summary: Get all valid android paths
|
|
521
|
+
* @description: Use this API to get a list of valid android paths required by the Rewards INIT API to validate a fradualent device.
|
|
522
|
+
*/
|
|
523
|
+
getRewardsConfiguration({} = {}) {
|
|
524
|
+
const { error } = RewardsValidator.getRewardsConfiguration().validate(
|
|
525
|
+
{},
|
|
526
|
+
{ abortEarly: false, allowUnknown: true }
|
|
527
|
+
);
|
|
528
|
+
if (error) {
|
|
529
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
// Showing warrnings if extra unknown parameters are found
|
|
533
|
+
const {
|
|
534
|
+
error: warrning,
|
|
535
|
+
} = RewardsValidator.getRewardsConfiguration().validate(
|
|
536
|
+
{},
|
|
537
|
+
{ abortEarly: false, allowUnknown: false }
|
|
538
|
+
);
|
|
539
|
+
if (warrning) {
|
|
540
|
+
console.log("Parameter Validation warrnings for getRewardsConfiguration");
|
|
541
|
+
console.log(warrning);
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
const query_params = {};
|
|
545
|
+
|
|
546
|
+
return PlatformAPIClient.execute(
|
|
547
|
+
this.config,
|
|
548
|
+
"get",
|
|
549
|
+
`/service/platform/rewards/v1.0/company/${this.config.companyId}/application/${this.applicationId}/configuration/`,
|
|
550
|
+
query_params,
|
|
551
|
+
undefined
|
|
552
|
+
);
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
/**
|
|
556
|
+
* @param {Object} arg - Arg object.
|
|
557
|
+
* @param {ConfigurationRequest} arg.body
|
|
558
|
+
* @summary: Updates the collection with given android paths.
|
|
559
|
+
* @description: Updates the configuration or inserts new records.
|
|
560
|
+
*/
|
|
561
|
+
setRewardsConfiguration({ body } = {}) {
|
|
562
|
+
const { error } = RewardsValidator.setRewardsConfiguration().validate(
|
|
563
|
+
{
|
|
564
|
+
body,
|
|
565
|
+
},
|
|
566
|
+
{ abortEarly: false, allowUnknown: true }
|
|
567
|
+
);
|
|
568
|
+
if (error) {
|
|
569
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
// Showing warrnings if extra unknown parameters are found
|
|
573
|
+
const {
|
|
574
|
+
error: warrning,
|
|
575
|
+
} = RewardsValidator.setRewardsConfiguration().validate(
|
|
576
|
+
{
|
|
577
|
+
body,
|
|
578
|
+
},
|
|
579
|
+
{ abortEarly: false, allowUnknown: false }
|
|
580
|
+
);
|
|
581
|
+
if (warrning) {
|
|
582
|
+
console.log("Parameter Validation warrnings for setRewardsConfiguration");
|
|
583
|
+
console.log(warrning);
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
const query_params = {};
|
|
587
|
+
|
|
588
|
+
return PlatformAPIClient.execute(
|
|
589
|
+
this.config,
|
|
590
|
+
"post",
|
|
591
|
+
`/service/platform/rewards/v1.0/company/${this.config.companyId}/application/${this.applicationId}/configuration/`,
|
|
592
|
+
query_params,
|
|
593
|
+
body
|
|
594
|
+
);
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
module.exports = Rewards;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export = RewardsValidator;
|
|
2
|
+
declare class RewardsValidator {
|
|
3
|
+
static showGiveaways(): any;
|
|
4
|
+
static saveGiveAway(): any;
|
|
5
|
+
static getGiveawayById(): any;
|
|
6
|
+
static updateGiveAway(): any;
|
|
7
|
+
static getGiveawayAudienceStatus(): any;
|
|
8
|
+
static showOffers(): any;
|
|
9
|
+
static getOfferByName(): any;
|
|
10
|
+
static updateOfferByName(): any;
|
|
11
|
+
static updateUserStatus(): any;
|
|
12
|
+
static user(): any;
|
|
13
|
+
static getUserPointsHistory(): any;
|
|
14
|
+
static getRewardsConfiguration(): any;
|
|
15
|
+
static setRewardsConfiguration(): any;
|
|
16
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
const Joi = require("joi");
|
|
2
|
+
const RewardsModel = require("./RewardsPlatformModel");
|
|
3
|
+
|
|
4
|
+
class RewardsValidator {
|
|
5
|
+
static showGiveaways() {
|
|
6
|
+
return Joi.object({
|
|
7
|
+
pageId: Joi.string().allow("").required(),
|
|
8
|
+
pageSize: Joi.number().required(),
|
|
9
|
+
}).required();
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
static saveGiveAway() {
|
|
13
|
+
return Joi.object({
|
|
14
|
+
body: RewardsModel.Giveaway().required(),
|
|
15
|
+
}).required();
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
static getGiveawayById() {
|
|
19
|
+
return Joi.object({
|
|
20
|
+
id: Joi.string().allow("").required(),
|
|
21
|
+
}).required();
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
static updateGiveAway() {
|
|
25
|
+
return Joi.object({
|
|
26
|
+
id: Joi.string().allow("").required(),
|
|
27
|
+
body: RewardsModel.Giveaway().required(),
|
|
28
|
+
}).required();
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
static getGiveawayAudienceStatus() {
|
|
32
|
+
return Joi.object({
|
|
33
|
+
audienceId: Joi.string().allow("").required(),
|
|
34
|
+
}).required();
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
static showOffers() {
|
|
38
|
+
return Joi.object({}).required();
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
static getOfferByName() {
|
|
42
|
+
return Joi.object({
|
|
43
|
+
name: Joi.string().allow("").required(),
|
|
44
|
+
|
|
45
|
+
cookie: Joi.string().allow("").required(),
|
|
46
|
+
}).required();
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
static updateOfferByName() {
|
|
50
|
+
return Joi.object({
|
|
51
|
+
name: Joi.string().allow("").required(),
|
|
52
|
+
|
|
53
|
+
body: RewardsModel.Offer().required(),
|
|
54
|
+
}).required();
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
static updateUserStatus() {
|
|
58
|
+
return Joi.object({
|
|
59
|
+
userId: Joi.string().allow("").required(),
|
|
60
|
+
|
|
61
|
+
body: RewardsModel.AppUser().required(),
|
|
62
|
+
}).required();
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
static user() {
|
|
66
|
+
return Joi.object({
|
|
67
|
+
userId: Joi.string().allow("").required(),
|
|
68
|
+
}).required();
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
static getUserPointsHistory() {
|
|
72
|
+
return Joi.object({
|
|
73
|
+
userId: Joi.string().allow("").required(),
|
|
74
|
+
|
|
75
|
+
pageId: Joi.string().allow(""),
|
|
76
|
+
pageSize: Joi.number(),
|
|
77
|
+
}).required();
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
static getRewardsConfiguration() {
|
|
81
|
+
return Joi.object({}).required();
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
static setRewardsConfiguration() {
|
|
85
|
+
return Joi.object({
|
|
86
|
+
body: RewardsModel.ConfigurationRequest().required(),
|
|
87
|
+
}).required();
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
module.exports = RewardsValidator;
|