@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,997 @@
|
|
|
1
|
+
const Paginator = require("../../common/Paginator");
|
|
2
|
+
const PlatformAPIClient = require("../PlatformAPIClient");
|
|
3
|
+
const { FDKClientValidationError } = require("../../common/FDKError");
|
|
4
|
+
const ThemeValidator = require("./ThemePlatformApplicationValidator");
|
|
5
|
+
|
|
6
|
+
class Theme {
|
|
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.themeId - ID of the theme to be retrieved
|
|
15
|
+
* @summary: Get all pages of a theme
|
|
16
|
+
* @description: Use this API to retrieve all the available pages of a theme by its ID.
|
|
17
|
+
*/
|
|
18
|
+
getAllPages({ themeId } = {}) {
|
|
19
|
+
const { error } = ThemeValidator.getAllPages().validate(
|
|
20
|
+
{
|
|
21
|
+
themeId,
|
|
22
|
+
},
|
|
23
|
+
{ abortEarly: false, allowUnknown: true }
|
|
24
|
+
);
|
|
25
|
+
if (error) {
|
|
26
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// Showing warrnings if extra unknown parameters are found
|
|
30
|
+
const { error: warrning } = ThemeValidator.getAllPages().validate(
|
|
31
|
+
{
|
|
32
|
+
themeId,
|
|
33
|
+
},
|
|
34
|
+
{ abortEarly: false, allowUnknown: false }
|
|
35
|
+
);
|
|
36
|
+
if (warrning) {
|
|
37
|
+
console.log("Parameter Validation warrnings for getAllPages");
|
|
38
|
+
console.log(warrning);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const query_params = {};
|
|
42
|
+
|
|
43
|
+
return PlatformAPIClient.execute(
|
|
44
|
+
this.config,
|
|
45
|
+
"get",
|
|
46
|
+
`/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/page`,
|
|
47
|
+
query_params,
|
|
48
|
+
undefined
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* @param {Object} arg - Arg object.
|
|
54
|
+
* @param {string} arg.themeId - ID of the theme
|
|
55
|
+
* @param {AvailablePageSchema} arg.body
|
|
56
|
+
* @summary: Create a page
|
|
57
|
+
* @description: Use this API to create a page for a theme by its ID.
|
|
58
|
+
*/
|
|
59
|
+
createPage({ themeId, body } = {}) {
|
|
60
|
+
const { error } = ThemeValidator.createPage().validate(
|
|
61
|
+
{
|
|
62
|
+
themeId,
|
|
63
|
+
body,
|
|
64
|
+
},
|
|
65
|
+
{ abortEarly: false, allowUnknown: true }
|
|
66
|
+
);
|
|
67
|
+
if (error) {
|
|
68
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// Showing warrnings if extra unknown parameters are found
|
|
72
|
+
const { error: warrning } = ThemeValidator.createPage().validate(
|
|
73
|
+
{
|
|
74
|
+
themeId,
|
|
75
|
+
body,
|
|
76
|
+
},
|
|
77
|
+
{ abortEarly: false, allowUnknown: false }
|
|
78
|
+
);
|
|
79
|
+
if (warrning) {
|
|
80
|
+
console.log("Parameter Validation warrnings for createPage");
|
|
81
|
+
console.log(warrning);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
const query_params = {};
|
|
85
|
+
|
|
86
|
+
return PlatformAPIClient.execute(
|
|
87
|
+
this.config,
|
|
88
|
+
"post",
|
|
89
|
+
`/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/page`,
|
|
90
|
+
query_params,
|
|
91
|
+
body
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* @param {Object} arg - Arg object.
|
|
97
|
+
* @param {string} arg.themeId - ID of the theme to be retrieved
|
|
98
|
+
* @param {AllAvailablePageSchema} arg.body
|
|
99
|
+
* @summary: Update multiple pages of a theme
|
|
100
|
+
* @description: Use this API to update multiple pages of a theme by its ID.
|
|
101
|
+
*/
|
|
102
|
+
updateMultiplePages({ themeId, body } = {}) {
|
|
103
|
+
const { error } = ThemeValidator.updateMultiplePages().validate(
|
|
104
|
+
{
|
|
105
|
+
themeId,
|
|
106
|
+
body,
|
|
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 } = ThemeValidator.updateMultiplePages().validate(
|
|
116
|
+
{
|
|
117
|
+
themeId,
|
|
118
|
+
body,
|
|
119
|
+
},
|
|
120
|
+
{ abortEarly: false, allowUnknown: false }
|
|
121
|
+
);
|
|
122
|
+
if (warrning) {
|
|
123
|
+
console.log("Parameter Validation warrnings for updateMultiplePages");
|
|
124
|
+
console.log(warrning);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
const query_params = {};
|
|
128
|
+
|
|
129
|
+
return PlatformAPIClient.execute(
|
|
130
|
+
this.config,
|
|
131
|
+
"put",
|
|
132
|
+
`/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/page`,
|
|
133
|
+
query_params,
|
|
134
|
+
body
|
|
135
|
+
);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* @param {Object} arg - Arg object.
|
|
140
|
+
* @param {string} arg.themeId - ID of the theme to be retrieved
|
|
141
|
+
* @param {string} arg.pageValue - Value of the page to be retrieved
|
|
142
|
+
* @summary: Get page of a theme
|
|
143
|
+
* @description: Use this API to retrieve a page of a theme.
|
|
144
|
+
*/
|
|
145
|
+
getPage({ themeId, pageValue } = {}) {
|
|
146
|
+
const { error } = ThemeValidator.getPage().validate(
|
|
147
|
+
{
|
|
148
|
+
themeId,
|
|
149
|
+
pageValue,
|
|
150
|
+
},
|
|
151
|
+
{ abortEarly: false, allowUnknown: true }
|
|
152
|
+
);
|
|
153
|
+
if (error) {
|
|
154
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
// Showing warrnings if extra unknown parameters are found
|
|
158
|
+
const { error: warrning } = ThemeValidator.getPage().validate(
|
|
159
|
+
{
|
|
160
|
+
themeId,
|
|
161
|
+
pageValue,
|
|
162
|
+
},
|
|
163
|
+
{ abortEarly: false, allowUnknown: false }
|
|
164
|
+
);
|
|
165
|
+
if (warrning) {
|
|
166
|
+
console.log("Parameter Validation warrnings for getPage");
|
|
167
|
+
console.log(warrning);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
const query_params = {};
|
|
171
|
+
|
|
172
|
+
return PlatformAPIClient.execute(
|
|
173
|
+
this.config,
|
|
174
|
+
"get",
|
|
175
|
+
`/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/${pageValue}`,
|
|
176
|
+
query_params,
|
|
177
|
+
undefined
|
|
178
|
+
);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* @param {Object} arg - Arg object.
|
|
183
|
+
* @param {string} arg.themeId - ID of the theme
|
|
184
|
+
* @param {string} arg.pageValue - Value of the page to be updated
|
|
185
|
+
* @param {AvailablePageSchema} arg.body
|
|
186
|
+
* @summary: Updates a page
|
|
187
|
+
* @description: Use this API to update a page for a theme by its ID.
|
|
188
|
+
*/
|
|
189
|
+
updatePage({ themeId, pageValue, body } = {}) {
|
|
190
|
+
const { error } = ThemeValidator.updatePage().validate(
|
|
191
|
+
{
|
|
192
|
+
themeId,
|
|
193
|
+
pageValue,
|
|
194
|
+
body,
|
|
195
|
+
},
|
|
196
|
+
{ abortEarly: false, allowUnknown: true }
|
|
197
|
+
);
|
|
198
|
+
if (error) {
|
|
199
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
// Showing warrnings if extra unknown parameters are found
|
|
203
|
+
const { error: warrning } = ThemeValidator.updatePage().validate(
|
|
204
|
+
{
|
|
205
|
+
themeId,
|
|
206
|
+
pageValue,
|
|
207
|
+
body,
|
|
208
|
+
},
|
|
209
|
+
{ abortEarly: false, allowUnknown: false }
|
|
210
|
+
);
|
|
211
|
+
if (warrning) {
|
|
212
|
+
console.log("Parameter Validation warrnings for updatePage");
|
|
213
|
+
console.log(warrning);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
const query_params = {};
|
|
217
|
+
|
|
218
|
+
return PlatformAPIClient.execute(
|
|
219
|
+
this.config,
|
|
220
|
+
"put",
|
|
221
|
+
`/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/${pageValue}`,
|
|
222
|
+
query_params,
|
|
223
|
+
body
|
|
224
|
+
);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* @param {Object} arg - Arg object.
|
|
229
|
+
* @param {string} arg.themeId - ID of the theme
|
|
230
|
+
* @param {string} arg.pageValue - Value of the page to be updated
|
|
231
|
+
* @summary: Deletes a page
|
|
232
|
+
* @description: Use this API to delete a page for a theme by its ID and page_value.
|
|
233
|
+
*/
|
|
234
|
+
deletePage({ themeId, pageValue } = {}) {
|
|
235
|
+
const { error } = ThemeValidator.deletePage().validate(
|
|
236
|
+
{
|
|
237
|
+
themeId,
|
|
238
|
+
pageValue,
|
|
239
|
+
},
|
|
240
|
+
{ abortEarly: false, allowUnknown: true }
|
|
241
|
+
);
|
|
242
|
+
if (error) {
|
|
243
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
// Showing warrnings if extra unknown parameters are found
|
|
247
|
+
const { error: warrning } = ThemeValidator.deletePage().validate(
|
|
248
|
+
{
|
|
249
|
+
themeId,
|
|
250
|
+
pageValue,
|
|
251
|
+
},
|
|
252
|
+
{ abortEarly: false, allowUnknown: false }
|
|
253
|
+
);
|
|
254
|
+
if (warrning) {
|
|
255
|
+
console.log("Parameter Validation warrnings for deletePage");
|
|
256
|
+
console.log(warrning);
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
const query_params = {};
|
|
260
|
+
|
|
261
|
+
return PlatformAPIClient.execute(
|
|
262
|
+
this.config,
|
|
263
|
+
"delete",
|
|
264
|
+
`/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/${pageValue}`,
|
|
265
|
+
query_params,
|
|
266
|
+
undefined
|
|
267
|
+
);
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* @param {Object} arg - Arg object.
|
|
272
|
+
* @param {number} [arg.pageSize] - The number of items to retrieve in each
|
|
273
|
+
* page. Default value is 10.
|
|
274
|
+
* @param {number} [arg.pageNo] - The page number to navigate through the
|
|
275
|
+
* given set of results. Default value is 1.
|
|
276
|
+
* @summary: Get a list of themes from the theme library
|
|
277
|
+
* @description: Theme library is a personalized collection of themes that are chosen and added from the available themes. Use this API to fetch a list of themes from the library along with their configuration details.
|
|
278
|
+
*/
|
|
279
|
+
getThemeLibrary({ pageSize, pageNo } = {}) {
|
|
280
|
+
const { error } = ThemeValidator.getThemeLibrary().validate(
|
|
281
|
+
{
|
|
282
|
+
pageSize,
|
|
283
|
+
pageNo,
|
|
284
|
+
},
|
|
285
|
+
{ abortEarly: false, allowUnknown: true }
|
|
286
|
+
);
|
|
287
|
+
if (error) {
|
|
288
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
// Showing warrnings if extra unknown parameters are found
|
|
292
|
+
const { error: warrning } = ThemeValidator.getThemeLibrary().validate(
|
|
293
|
+
{
|
|
294
|
+
pageSize,
|
|
295
|
+
pageNo,
|
|
296
|
+
},
|
|
297
|
+
{ abortEarly: false, allowUnknown: false }
|
|
298
|
+
);
|
|
299
|
+
if (warrning) {
|
|
300
|
+
console.log("Parameter Validation warrnings for getThemeLibrary");
|
|
301
|
+
console.log(warrning);
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
const query_params = {};
|
|
305
|
+
query_params["page_size"] = pageSize;
|
|
306
|
+
query_params["page_no"] = pageNo;
|
|
307
|
+
|
|
308
|
+
return PlatformAPIClient.execute(
|
|
309
|
+
this.config,
|
|
310
|
+
"get",
|
|
311
|
+
`/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/library`,
|
|
312
|
+
query_params,
|
|
313
|
+
undefined
|
|
314
|
+
);
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
/**
|
|
318
|
+
* @param {Object} arg - Arg object.
|
|
319
|
+
* @param {AddThemeRequestSchema} arg.body
|
|
320
|
+
* @summary: Add a theme to the theme library
|
|
321
|
+
* @description: Theme library is a personalized collection of themes that are chosen and added from the available themes. Use this API to choose a theme and add it to the theme library.
|
|
322
|
+
*/
|
|
323
|
+
addToThemeLibrary({ body } = {}) {
|
|
324
|
+
const { error } = ThemeValidator.addToThemeLibrary().validate(
|
|
325
|
+
{
|
|
326
|
+
body,
|
|
327
|
+
},
|
|
328
|
+
{ abortEarly: false, allowUnknown: true }
|
|
329
|
+
);
|
|
330
|
+
if (error) {
|
|
331
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
// Showing warrnings if extra unknown parameters are found
|
|
335
|
+
const { error: warrning } = ThemeValidator.addToThemeLibrary().validate(
|
|
336
|
+
{
|
|
337
|
+
body,
|
|
338
|
+
},
|
|
339
|
+
{ abortEarly: false, allowUnknown: false }
|
|
340
|
+
);
|
|
341
|
+
if (warrning) {
|
|
342
|
+
console.log("Parameter Validation warrnings for addToThemeLibrary");
|
|
343
|
+
console.log(warrning);
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
const query_params = {};
|
|
347
|
+
|
|
348
|
+
return PlatformAPIClient.execute(
|
|
349
|
+
this.config,
|
|
350
|
+
"post",
|
|
351
|
+
`/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/library`,
|
|
352
|
+
query_params,
|
|
353
|
+
body
|
|
354
|
+
);
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
/**
|
|
358
|
+
* @param {Object} arg - Arg object.
|
|
359
|
+
* @param {AddThemeRequestSchema} arg.body
|
|
360
|
+
* @summary: Apply a theme
|
|
361
|
+
* @description: Use this API to apply a theme to the website.
|
|
362
|
+
*/
|
|
363
|
+
applyTheme({ body } = {}) {
|
|
364
|
+
const { error } = ThemeValidator.applyTheme().validate(
|
|
365
|
+
{
|
|
366
|
+
body,
|
|
367
|
+
},
|
|
368
|
+
{ abortEarly: false, allowUnknown: true }
|
|
369
|
+
);
|
|
370
|
+
if (error) {
|
|
371
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
// Showing warrnings if extra unknown parameters are found
|
|
375
|
+
const { error: warrning } = ThemeValidator.applyTheme().validate(
|
|
376
|
+
{
|
|
377
|
+
body,
|
|
378
|
+
},
|
|
379
|
+
{ abortEarly: false, allowUnknown: false }
|
|
380
|
+
);
|
|
381
|
+
if (warrning) {
|
|
382
|
+
console.log("Parameter Validation warrnings for applyTheme");
|
|
383
|
+
console.log(warrning);
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
const query_params = {};
|
|
387
|
+
|
|
388
|
+
return PlatformAPIClient.execute(
|
|
389
|
+
this.config,
|
|
390
|
+
"post",
|
|
391
|
+
`/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/apply`,
|
|
392
|
+
query_params,
|
|
393
|
+
body
|
|
394
|
+
);
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
/**
|
|
398
|
+
* @param {Object} arg - Arg object.
|
|
399
|
+
* @param {string} arg.themeId - Theme ID
|
|
400
|
+
* @summary: Checks if theme is upgradable
|
|
401
|
+
* @description: There's always a possibility that new features get added to a theme. Use this API to check if the applied theme has an upgrade available.
|
|
402
|
+
*/
|
|
403
|
+
isUpgradable({ themeId } = {}) {
|
|
404
|
+
const { error } = ThemeValidator.isUpgradable().validate(
|
|
405
|
+
{
|
|
406
|
+
themeId,
|
|
407
|
+
},
|
|
408
|
+
{ abortEarly: false, allowUnknown: true }
|
|
409
|
+
);
|
|
410
|
+
if (error) {
|
|
411
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
// Showing warrnings if extra unknown parameters are found
|
|
415
|
+
const { error: warrning } = ThemeValidator.isUpgradable().validate(
|
|
416
|
+
{
|
|
417
|
+
themeId,
|
|
418
|
+
},
|
|
419
|
+
{ abortEarly: false, allowUnknown: false }
|
|
420
|
+
);
|
|
421
|
+
if (warrning) {
|
|
422
|
+
console.log("Parameter Validation warrnings for isUpgradable");
|
|
423
|
+
console.log(warrning);
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
const query_params = {};
|
|
427
|
+
|
|
428
|
+
return PlatformAPIClient.execute(
|
|
429
|
+
this.config,
|
|
430
|
+
"get",
|
|
431
|
+
`/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/upgradable`,
|
|
432
|
+
query_params,
|
|
433
|
+
undefined
|
|
434
|
+
);
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
/**
|
|
438
|
+
* @param {Object} arg - Arg object.
|
|
439
|
+
* @param {string} arg.themeId - ID allotted to the theme.
|
|
440
|
+
* @summary: Upgrade a theme
|
|
441
|
+
* @description: Use this API to upgrade the current theme to its latest version.
|
|
442
|
+
*/
|
|
443
|
+
upgradeTheme({ themeId } = {}) {
|
|
444
|
+
const { error } = ThemeValidator.upgradeTheme().validate(
|
|
445
|
+
{
|
|
446
|
+
themeId,
|
|
447
|
+
},
|
|
448
|
+
{ abortEarly: false, allowUnknown: true }
|
|
449
|
+
);
|
|
450
|
+
if (error) {
|
|
451
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
// Showing warrnings if extra unknown parameters are found
|
|
455
|
+
const { error: warrning } = ThemeValidator.upgradeTheme().validate(
|
|
456
|
+
{
|
|
457
|
+
themeId,
|
|
458
|
+
},
|
|
459
|
+
{ abortEarly: false, allowUnknown: false }
|
|
460
|
+
);
|
|
461
|
+
if (warrning) {
|
|
462
|
+
console.log("Parameter Validation warrnings for upgradeTheme");
|
|
463
|
+
console.log(warrning);
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
const query_params = {};
|
|
467
|
+
|
|
468
|
+
return PlatformAPIClient.execute(
|
|
469
|
+
this.config,
|
|
470
|
+
"put",
|
|
471
|
+
`/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/upgrade`,
|
|
472
|
+
query_params,
|
|
473
|
+
undefined
|
|
474
|
+
);
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
/**
|
|
478
|
+
* @param {Object} arg - Arg object.
|
|
479
|
+
* @param {number} [arg.pageSize] - The number of items to retrieve in each
|
|
480
|
+
* page. Default value is 10.
|
|
481
|
+
* @param {number} [arg.pageNo] - The page number to navigate through the
|
|
482
|
+
* given set of results. Default value is 1.
|
|
483
|
+
* @summary: Get all public themes
|
|
484
|
+
* @description: Use this API to get a list of free themes that you can apply to your website.
|
|
485
|
+
*/
|
|
486
|
+
getPublicThemes({ pageSize, pageNo } = {}) {
|
|
487
|
+
const { error } = ThemeValidator.getPublicThemes().validate(
|
|
488
|
+
{
|
|
489
|
+
pageSize,
|
|
490
|
+
pageNo,
|
|
491
|
+
},
|
|
492
|
+
{ abortEarly: false, allowUnknown: true }
|
|
493
|
+
);
|
|
494
|
+
if (error) {
|
|
495
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
// Showing warrnings if extra unknown parameters are found
|
|
499
|
+
const { error: warrning } = ThemeValidator.getPublicThemes().validate(
|
|
500
|
+
{
|
|
501
|
+
pageSize,
|
|
502
|
+
pageNo,
|
|
503
|
+
},
|
|
504
|
+
{ abortEarly: false, allowUnknown: false }
|
|
505
|
+
);
|
|
506
|
+
if (warrning) {
|
|
507
|
+
console.log("Parameter Validation warrnings for getPublicThemes");
|
|
508
|
+
console.log(warrning);
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
const query_params = {};
|
|
512
|
+
query_params["page_size"] = pageSize;
|
|
513
|
+
query_params["page_no"] = pageNo;
|
|
514
|
+
|
|
515
|
+
return PlatformAPIClient.execute(
|
|
516
|
+
this.config,
|
|
517
|
+
"get",
|
|
518
|
+
`/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/list/public`,
|
|
519
|
+
query_params,
|
|
520
|
+
undefined
|
|
521
|
+
);
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
/**
|
|
525
|
+
* @param {Object} arg - Arg object.
|
|
526
|
+
* @param {ThemesSchema} arg.body
|
|
527
|
+
* @summary: Create a new theme
|
|
528
|
+
* @description: Themes improve the look and appearance of a website. Use this API to create a theme.
|
|
529
|
+
*/
|
|
530
|
+
createTheme({ body } = {}) {
|
|
531
|
+
const { error } = ThemeValidator.createTheme().validate(
|
|
532
|
+
{
|
|
533
|
+
body,
|
|
534
|
+
},
|
|
535
|
+
{ abortEarly: false, allowUnknown: true }
|
|
536
|
+
);
|
|
537
|
+
if (error) {
|
|
538
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
// Showing warrnings if extra unknown parameters are found
|
|
542
|
+
const { error: warrning } = ThemeValidator.createTheme().validate(
|
|
543
|
+
{
|
|
544
|
+
body,
|
|
545
|
+
},
|
|
546
|
+
{ abortEarly: false, allowUnknown: false }
|
|
547
|
+
);
|
|
548
|
+
if (warrning) {
|
|
549
|
+
console.log("Parameter Validation warrnings for createTheme");
|
|
550
|
+
console.log(warrning);
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
const query_params = {};
|
|
554
|
+
|
|
555
|
+
return PlatformAPIClient.execute(
|
|
556
|
+
this.config,
|
|
557
|
+
"post",
|
|
558
|
+
`/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/`,
|
|
559
|
+
query_params,
|
|
560
|
+
body
|
|
561
|
+
);
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
/**
|
|
565
|
+
* @param {Object} arg - Arg object.
|
|
566
|
+
* @summary: Get the applied theme
|
|
567
|
+
* @description: Use this API to retrieve the theme that is currently applied to the website along with its details.
|
|
568
|
+
*/
|
|
569
|
+
getAppliedTheme({} = {}) {
|
|
570
|
+
const { error } = ThemeValidator.getAppliedTheme().validate(
|
|
571
|
+
{},
|
|
572
|
+
{ abortEarly: false, allowUnknown: true }
|
|
573
|
+
);
|
|
574
|
+
if (error) {
|
|
575
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
// Showing warrnings if extra unknown parameters are found
|
|
579
|
+
const { error: warrning } = ThemeValidator.getAppliedTheme().validate(
|
|
580
|
+
{},
|
|
581
|
+
{ abortEarly: false, allowUnknown: false }
|
|
582
|
+
);
|
|
583
|
+
if (warrning) {
|
|
584
|
+
console.log("Parameter Validation warrnings for getAppliedTheme");
|
|
585
|
+
console.log(warrning);
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
const query_params = {};
|
|
589
|
+
|
|
590
|
+
return PlatformAPIClient.execute(
|
|
591
|
+
this.config,
|
|
592
|
+
"get",
|
|
593
|
+
`/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/`,
|
|
594
|
+
query_params,
|
|
595
|
+
undefined
|
|
596
|
+
);
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
/**
|
|
600
|
+
* @param {Object} arg - Arg object.
|
|
601
|
+
* @summary: Get all the supported fonts in a theme
|
|
602
|
+
* @description: Font is a collection of characters with a similar design. Use this API to retrieve a list of website fonts.
|
|
603
|
+
*/
|
|
604
|
+
getFonts({} = {}) {
|
|
605
|
+
const { error } = ThemeValidator.getFonts().validate(
|
|
606
|
+
{},
|
|
607
|
+
{ abortEarly: false, allowUnknown: true }
|
|
608
|
+
);
|
|
609
|
+
if (error) {
|
|
610
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
// Showing warrnings if extra unknown parameters are found
|
|
614
|
+
const { error: warrning } = ThemeValidator.getFonts().validate(
|
|
615
|
+
{},
|
|
616
|
+
{ abortEarly: false, allowUnknown: false }
|
|
617
|
+
);
|
|
618
|
+
if (warrning) {
|
|
619
|
+
console.log("Parameter Validation warrnings for getFonts");
|
|
620
|
+
console.log(warrning);
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
const query_params = {};
|
|
624
|
+
|
|
625
|
+
return PlatformAPIClient.execute(
|
|
626
|
+
this.config,
|
|
627
|
+
"get",
|
|
628
|
+
`/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/fonts`,
|
|
629
|
+
query_params,
|
|
630
|
+
undefined
|
|
631
|
+
);
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
/**
|
|
635
|
+
* @param {Object} arg - Arg object.
|
|
636
|
+
* @param {string} arg.themeId - ID allotted to the theme.
|
|
637
|
+
* @summary: Gets theme by id
|
|
638
|
+
* @description: Use this API to retrieve the details of a specific theme by using its ID.
|
|
639
|
+
*/
|
|
640
|
+
getThemeById({ themeId } = {}) {
|
|
641
|
+
const { error } = ThemeValidator.getThemeById().validate(
|
|
642
|
+
{
|
|
643
|
+
themeId,
|
|
644
|
+
},
|
|
645
|
+
{ abortEarly: false, allowUnknown: true }
|
|
646
|
+
);
|
|
647
|
+
if (error) {
|
|
648
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
// Showing warrnings if extra unknown parameters are found
|
|
652
|
+
const { error: warrning } = ThemeValidator.getThemeById().validate(
|
|
653
|
+
{
|
|
654
|
+
themeId,
|
|
655
|
+
},
|
|
656
|
+
{ abortEarly: false, allowUnknown: false }
|
|
657
|
+
);
|
|
658
|
+
if (warrning) {
|
|
659
|
+
console.log("Parameter Validation warrnings for getThemeById");
|
|
660
|
+
console.log(warrning);
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
const query_params = {};
|
|
664
|
+
|
|
665
|
+
return PlatformAPIClient.execute(
|
|
666
|
+
this.config,
|
|
667
|
+
"get",
|
|
668
|
+
`/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}`,
|
|
669
|
+
query_params,
|
|
670
|
+
undefined
|
|
671
|
+
);
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
/**
|
|
675
|
+
* @param {Object} arg - Arg object.
|
|
676
|
+
* @param {string} arg.themeId - ID allotted to the theme.
|
|
677
|
+
* @param {ThemesSchema} arg.body
|
|
678
|
+
* @summary: Update a theme
|
|
679
|
+
* @description: Use this API to edit an existing theme. You can customize the website font, sections, images, styles, and many more.
|
|
680
|
+
*/
|
|
681
|
+
updateTheme({ themeId, body } = {}) {
|
|
682
|
+
const { error } = ThemeValidator.updateTheme().validate(
|
|
683
|
+
{
|
|
684
|
+
themeId,
|
|
685
|
+
body,
|
|
686
|
+
},
|
|
687
|
+
{ abortEarly: false, allowUnknown: true }
|
|
688
|
+
);
|
|
689
|
+
if (error) {
|
|
690
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
// Showing warrnings if extra unknown parameters are found
|
|
694
|
+
const { error: warrning } = ThemeValidator.updateTheme().validate(
|
|
695
|
+
{
|
|
696
|
+
themeId,
|
|
697
|
+
body,
|
|
698
|
+
},
|
|
699
|
+
{ abortEarly: false, allowUnknown: false }
|
|
700
|
+
);
|
|
701
|
+
if (warrning) {
|
|
702
|
+
console.log("Parameter Validation warrnings for updateTheme");
|
|
703
|
+
console.log(warrning);
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
const query_params = {};
|
|
707
|
+
|
|
708
|
+
return PlatformAPIClient.execute(
|
|
709
|
+
this.config,
|
|
710
|
+
"put",
|
|
711
|
+
`/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}`,
|
|
712
|
+
query_params,
|
|
713
|
+
body
|
|
714
|
+
);
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
/**
|
|
718
|
+
* @param {Object} arg - Arg object.
|
|
719
|
+
* @param {string} arg.themeId - ID allotted to the theme.
|
|
720
|
+
* @summary: Delete a theme
|
|
721
|
+
* @description: Use this API to delete a theme from the theme library.
|
|
722
|
+
*/
|
|
723
|
+
deleteTheme({ themeId } = {}) {
|
|
724
|
+
const { error } = ThemeValidator.deleteTheme().validate(
|
|
725
|
+
{
|
|
726
|
+
themeId,
|
|
727
|
+
},
|
|
728
|
+
{ abortEarly: false, allowUnknown: true }
|
|
729
|
+
);
|
|
730
|
+
if (error) {
|
|
731
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
// Showing warrnings if extra unknown parameters are found
|
|
735
|
+
const { error: warrning } = ThemeValidator.deleteTheme().validate(
|
|
736
|
+
{
|
|
737
|
+
themeId,
|
|
738
|
+
},
|
|
739
|
+
{ abortEarly: false, allowUnknown: false }
|
|
740
|
+
);
|
|
741
|
+
if (warrning) {
|
|
742
|
+
console.log("Parameter Validation warrnings for deleteTheme");
|
|
743
|
+
console.log(warrning);
|
|
744
|
+
}
|
|
745
|
+
|
|
746
|
+
const query_params = {};
|
|
747
|
+
|
|
748
|
+
return PlatformAPIClient.execute(
|
|
749
|
+
this.config,
|
|
750
|
+
"delete",
|
|
751
|
+
`/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}`,
|
|
752
|
+
query_params,
|
|
753
|
+
undefined
|
|
754
|
+
);
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
/**
|
|
758
|
+
* @param {Object} arg - Arg object.
|
|
759
|
+
* @param {string} arg.themeId - ID allotted to the theme.
|
|
760
|
+
* @summary: Get a theme preview
|
|
761
|
+
* @description: A theme can be previewed before applying it. Use this API to retrieve the theme preview by using its ID.
|
|
762
|
+
*/
|
|
763
|
+
getThemeForPreview({ themeId } = {}) {
|
|
764
|
+
const { error } = ThemeValidator.getThemeForPreview().validate(
|
|
765
|
+
{
|
|
766
|
+
themeId,
|
|
767
|
+
},
|
|
768
|
+
{ abortEarly: false, allowUnknown: true }
|
|
769
|
+
);
|
|
770
|
+
if (error) {
|
|
771
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
772
|
+
}
|
|
773
|
+
|
|
774
|
+
// Showing warrnings if extra unknown parameters are found
|
|
775
|
+
const { error: warrning } = ThemeValidator.getThemeForPreview().validate(
|
|
776
|
+
{
|
|
777
|
+
themeId,
|
|
778
|
+
},
|
|
779
|
+
{ abortEarly: false, allowUnknown: false }
|
|
780
|
+
);
|
|
781
|
+
if (warrning) {
|
|
782
|
+
console.log("Parameter Validation warrnings for getThemeForPreview");
|
|
783
|
+
console.log(warrning);
|
|
784
|
+
}
|
|
785
|
+
|
|
786
|
+
const query_params = {};
|
|
787
|
+
|
|
788
|
+
return PlatformAPIClient.execute(
|
|
789
|
+
this.config,
|
|
790
|
+
"get",
|
|
791
|
+
`/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/preview`,
|
|
792
|
+
query_params,
|
|
793
|
+
undefined
|
|
794
|
+
);
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
/**
|
|
798
|
+
* @param {Object} arg - Arg object.
|
|
799
|
+
* @param {string} arg.themeId - ID allotted to the theme.
|
|
800
|
+
* @summary: Publish a theme
|
|
801
|
+
* @description: Use this API to publish a theme that is either newly created or edited.
|
|
802
|
+
*/
|
|
803
|
+
publishTheme({ themeId } = {}) {
|
|
804
|
+
const { error } = ThemeValidator.publishTheme().validate(
|
|
805
|
+
{
|
|
806
|
+
themeId,
|
|
807
|
+
},
|
|
808
|
+
{ abortEarly: false, allowUnknown: true }
|
|
809
|
+
);
|
|
810
|
+
if (error) {
|
|
811
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
812
|
+
}
|
|
813
|
+
|
|
814
|
+
// Showing warrnings if extra unknown parameters are found
|
|
815
|
+
const { error: warrning } = ThemeValidator.publishTheme().validate(
|
|
816
|
+
{
|
|
817
|
+
themeId,
|
|
818
|
+
},
|
|
819
|
+
{ abortEarly: false, allowUnknown: false }
|
|
820
|
+
);
|
|
821
|
+
if (warrning) {
|
|
822
|
+
console.log("Parameter Validation warrnings for publishTheme");
|
|
823
|
+
console.log(warrning);
|
|
824
|
+
}
|
|
825
|
+
|
|
826
|
+
const query_params = {};
|
|
827
|
+
|
|
828
|
+
return PlatformAPIClient.execute(
|
|
829
|
+
this.config,
|
|
830
|
+
"put",
|
|
831
|
+
`/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/publish`,
|
|
832
|
+
query_params,
|
|
833
|
+
undefined
|
|
834
|
+
);
|
|
835
|
+
}
|
|
836
|
+
|
|
837
|
+
/**
|
|
838
|
+
* @param {Object} arg - Arg object.
|
|
839
|
+
* @param {string} arg.themeId - ID allotted to the theme.
|
|
840
|
+
* @summary: Unpublish a theme
|
|
841
|
+
* @description: Use this API to remove an existing theme from the list of available themes.
|
|
842
|
+
*/
|
|
843
|
+
unpublishTheme({ themeId } = {}) {
|
|
844
|
+
const { error } = ThemeValidator.unpublishTheme().validate(
|
|
845
|
+
{
|
|
846
|
+
themeId,
|
|
847
|
+
},
|
|
848
|
+
{ abortEarly: false, allowUnknown: true }
|
|
849
|
+
);
|
|
850
|
+
if (error) {
|
|
851
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
852
|
+
}
|
|
853
|
+
|
|
854
|
+
// Showing warrnings if extra unknown parameters are found
|
|
855
|
+
const { error: warrning } = ThemeValidator.unpublishTheme().validate(
|
|
856
|
+
{
|
|
857
|
+
themeId,
|
|
858
|
+
},
|
|
859
|
+
{ abortEarly: false, allowUnknown: false }
|
|
860
|
+
);
|
|
861
|
+
if (warrning) {
|
|
862
|
+
console.log("Parameter Validation warrnings for unpublishTheme");
|
|
863
|
+
console.log(warrning);
|
|
864
|
+
}
|
|
865
|
+
|
|
866
|
+
const query_params = {};
|
|
867
|
+
|
|
868
|
+
return PlatformAPIClient.execute(
|
|
869
|
+
this.config,
|
|
870
|
+
"put",
|
|
871
|
+
`/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/unpublish`,
|
|
872
|
+
query_params,
|
|
873
|
+
undefined
|
|
874
|
+
);
|
|
875
|
+
}
|
|
876
|
+
|
|
877
|
+
/**
|
|
878
|
+
* @param {Object} arg - Arg object.
|
|
879
|
+
* @param {string} arg.themeId - ID allotted to the theme.
|
|
880
|
+
* @summary: Archive a theme
|
|
881
|
+
* @description: Use this API to store an existing theme but not delete it so that it can be used in future if required.
|
|
882
|
+
*/
|
|
883
|
+
archiveTheme({ themeId } = {}) {
|
|
884
|
+
const { error } = ThemeValidator.archiveTheme().validate(
|
|
885
|
+
{
|
|
886
|
+
themeId,
|
|
887
|
+
},
|
|
888
|
+
{ abortEarly: false, allowUnknown: true }
|
|
889
|
+
);
|
|
890
|
+
if (error) {
|
|
891
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
892
|
+
}
|
|
893
|
+
|
|
894
|
+
// Showing warrnings if extra unknown parameters are found
|
|
895
|
+
const { error: warrning } = ThemeValidator.archiveTheme().validate(
|
|
896
|
+
{
|
|
897
|
+
themeId,
|
|
898
|
+
},
|
|
899
|
+
{ abortEarly: false, allowUnknown: false }
|
|
900
|
+
);
|
|
901
|
+
if (warrning) {
|
|
902
|
+
console.log("Parameter Validation warrnings for archiveTheme");
|
|
903
|
+
console.log(warrning);
|
|
904
|
+
}
|
|
905
|
+
|
|
906
|
+
const query_params = {};
|
|
907
|
+
|
|
908
|
+
return PlatformAPIClient.execute(
|
|
909
|
+
this.config,
|
|
910
|
+
"put",
|
|
911
|
+
`/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/archive`,
|
|
912
|
+
query_params,
|
|
913
|
+
undefined
|
|
914
|
+
);
|
|
915
|
+
}
|
|
916
|
+
|
|
917
|
+
/**
|
|
918
|
+
* @param {Object} arg - Arg object.
|
|
919
|
+
* @param {string} arg.themeId - ID allotted to the theme.
|
|
920
|
+
* @summary: Unarchive a theme
|
|
921
|
+
* @description: Use this API to restore an archived theme and bring it back for editing or publishing.
|
|
922
|
+
*/
|
|
923
|
+
unarchiveTheme({ themeId } = {}) {
|
|
924
|
+
const { error } = ThemeValidator.unarchiveTheme().validate(
|
|
925
|
+
{
|
|
926
|
+
themeId,
|
|
927
|
+
},
|
|
928
|
+
{ abortEarly: false, allowUnknown: true }
|
|
929
|
+
);
|
|
930
|
+
if (error) {
|
|
931
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
932
|
+
}
|
|
933
|
+
|
|
934
|
+
// Showing warrnings if extra unknown parameters are found
|
|
935
|
+
const { error: warrning } = ThemeValidator.unarchiveTheme().validate(
|
|
936
|
+
{
|
|
937
|
+
themeId,
|
|
938
|
+
},
|
|
939
|
+
{ abortEarly: false, allowUnknown: false }
|
|
940
|
+
);
|
|
941
|
+
if (warrning) {
|
|
942
|
+
console.log("Parameter Validation warrnings for unarchiveTheme");
|
|
943
|
+
console.log(warrning);
|
|
944
|
+
}
|
|
945
|
+
|
|
946
|
+
const query_params = {};
|
|
947
|
+
|
|
948
|
+
return PlatformAPIClient.execute(
|
|
949
|
+
this.config,
|
|
950
|
+
"put",
|
|
951
|
+
`/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/unarchive`,
|
|
952
|
+
query_params,
|
|
953
|
+
undefined
|
|
954
|
+
);
|
|
955
|
+
}
|
|
956
|
+
|
|
957
|
+
/**
|
|
958
|
+
* @param {Object} arg - Arg object.
|
|
959
|
+
* @param {string} arg.themeId - ID allotted to the theme.
|
|
960
|
+
* @summary: Fetch last modified timestamp
|
|
961
|
+
* @description: Use this API to fetch Last-Modified timestamp in header metadata.
|
|
962
|
+
*/
|
|
963
|
+
getThemeLastModified({ themeId } = {}) {
|
|
964
|
+
const { error } = ThemeValidator.getThemeLastModified().validate(
|
|
965
|
+
{
|
|
966
|
+
themeId,
|
|
967
|
+
},
|
|
968
|
+
{ abortEarly: false, allowUnknown: true }
|
|
969
|
+
);
|
|
970
|
+
if (error) {
|
|
971
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
972
|
+
}
|
|
973
|
+
|
|
974
|
+
// Showing warrnings if extra unknown parameters are found
|
|
975
|
+
const { error: warrning } = ThemeValidator.getThemeLastModified().validate(
|
|
976
|
+
{
|
|
977
|
+
themeId,
|
|
978
|
+
},
|
|
979
|
+
{ abortEarly: false, allowUnknown: false }
|
|
980
|
+
);
|
|
981
|
+
if (warrning) {
|
|
982
|
+
console.log("Parameter Validation warrnings for getThemeLastModified");
|
|
983
|
+
console.log(warrning);
|
|
984
|
+
}
|
|
985
|
+
|
|
986
|
+
const query_params = {};
|
|
987
|
+
|
|
988
|
+
return PlatformAPIClient.execute(
|
|
989
|
+
this.config,
|
|
990
|
+
"head",
|
|
991
|
+
`/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/polling`,
|
|
992
|
+
query_params,
|
|
993
|
+
undefined
|
|
994
|
+
);
|
|
995
|
+
}
|
|
996
|
+
}
|
|
997
|
+
module.exports = Theme;
|