@gofynd/fdk-client-javascript 1.0.2 → 1.0.4
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 +31 -2
- package/index.d.ts +4 -4
- package/index.js +9 -10
- package/package.json +14 -14
- package/sdk/APIClient.d.ts +11 -0
- package/sdk/APIClient.js +35 -0
- package/sdk/Client.d.ts +6 -0
- package/sdk/Client.js +17 -0
- package/sdk/Config.d.ts +9 -0
- package/sdk/Config.js +17 -0
- package/sdk/application/Cart/CartApplicationClient.d.ts +243 -243
- package/sdk/application/Cart/CartApplicationClient.js +595 -594
- package/sdk/application/Cart/CartApplicationModel.d.ts +64 -63
- package/sdk/application/Cart/CartApplicationModel.js +490 -885
- package/sdk/application/Cart/CartApplicationValidator.d.ts +17 -17
- package/sdk/application/Cart/CartApplicationValidator.js +98 -98
- package/sdk/application/Catalog/CatalogApplicationClient.d.ts +358 -358
- package/sdk/application/Catalog/CatalogApplicationClient.js +1079 -1078
- package/sdk/application/Catalog/CatalogApplicationModel.d.ts +90 -90
- package/sdk/application/Catalog/CatalogApplicationModel.js +683 -1249
- package/sdk/application/Catalog/CatalogApplicationValidator.d.ts +19 -19
- package/sdk/application/Catalog/CatalogApplicationValidator.js +110 -110
- package/sdk/application/Common/CommonApplicationClient.d.ts +13 -13
- package/sdk/application/Common/CommonApplicationClient.js +43 -42
- package/sdk/application/Common/CommonApplicationModel.d.ts +12 -12
- package/sdk/application/Common/CommonApplicationModel.js +83 -160
- package/sdk/application/Common/CommonApplicationValidator.d.ts +1 -1
- package/sdk/application/Common/CommonApplicationValidator.js +6 -6
- package/sdk/application/Communication/CommunicationApplicationClient.d.ts +11 -11
- package/sdk/application/Communication/CommunicationApplicationClient.js +32 -31
- package/sdk/application/Communication/CommunicationApplicationModel.d.ts +6 -6
- package/sdk/application/Communication/CommunicationApplicationModel.js +38 -83
- package/sdk/application/Communication/CommunicationApplicationValidator.d.ts +1 -1
- package/sdk/application/Communication/CommunicationApplicationValidator.js +4 -4
- package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +116 -116
- package/sdk/application/Configuration/ConfigurationApplicationClient.js +350 -349
- package/sdk/application/Configuration/ConfigurationApplicationModel.d.ts +85 -85
- package/sdk/application/Configuration/ConfigurationApplicationModel.js +480 -851
- package/sdk/application/Configuration/ConfigurationApplicationValidator.d.ts +8 -8
- package/sdk/application/Configuration/ConfigurationApplicationValidator.js +33 -33
- package/sdk/application/Content/ContentApplicationClient.d.ts +67 -67
- package/sdk/application/Content/ContentApplicationClient.js +216 -215
- package/sdk/application/Content/ContentApplicationModel.d.ts +76 -76
- package/sdk/application/Content/ContentApplicationModel.js +468 -884
- package/sdk/application/Content/ContentApplicationValidator.d.ts +5 -5
- package/sdk/application/Content/ContentApplicationValidator.js +24 -24
- package/sdk/application/FileStorage/FileStorageApplicationClient.d.ts +25 -25
- package/sdk/application/FileStorage/FileStorageApplicationClient.js +65 -64
- package/sdk/application/FileStorage/FileStorageApplicationModel.d.ts +13 -13
- package/sdk/application/FileStorage/FileStorageApplicationModel.js +86 -169
- package/sdk/application/FileStorage/FileStorageApplicationValidator.d.ts +1 -1
- package/sdk/application/FileStorage/FileStorageApplicationValidator.js +7 -7
- package/sdk/application/Lead/LeadApplicationClient.d.ts +24 -24
- package/sdk/application/Lead/LeadApplicationClient.js +109 -108
- package/sdk/application/Lead/LeadApplicationModel.d.ts +35 -35
- package/sdk/application/Lead/LeadApplicationModel.js +267 -474
- package/sdk/application/Lead/LeadApplicationValidator.d.ts +2 -2
- package/sdk/application/Lead/LeadApplicationValidator.js +11 -11
- package/sdk/application/Logistic/LogisticApplicationClient.d.ts +31 -22
- package/sdk/application/Logistic/LogisticApplicationClient.js +115 -49
- package/sdk/application/Logistic/LogisticApplicationModel.d.ts +17 -14
- package/sdk/application/Logistic/LogisticApplicationModel.js +133 -201
- package/sdk/application/Logistic/LogisticApplicationValidator.d.ts +3 -2
- package/sdk/application/Logistic/LogisticApplicationValidator.js +14 -9
- package/sdk/application/Order/OrderApplicationClient.d.ts +85 -85
- package/sdk/application/Order/OrderApplicationClient.js +247 -246
- package/sdk/application/Order/OrderApplicationModel.d.ts +50 -50
- package/sdk/application/Order/OrderApplicationModel.js +361 -656
- package/sdk/application/Order/OrderApplicationValidator.d.ts +7 -7
- package/sdk/application/Order/OrderApplicationValidator.js +28 -28
- package/sdk/application/Payment/PaymentApplicationClient.d.ts +318 -318
- package/sdk/application/Payment/PaymentApplicationClient.js +781 -780
- package/sdk/application/Payment/PaymentApplicationModel.d.ts +72 -72
- package/sdk/application/Payment/PaymentApplicationModel.js +570 -1038
- package/sdk/application/Payment/PaymentApplicationValidator.d.ts +28 -28
- package/sdk/application/Payment/PaymentApplicationValidator.js +107 -107
- package/sdk/application/PosCart/PosCartApplicationClient.d.ts +254 -254
- package/sdk/application/PosCart/PosCartApplicationClient.js +646 -645
- package/sdk/application/PosCart/PosCartApplicationModel.d.ts +64 -63
- package/sdk/application/PosCart/PosCartApplicationModel.js +476 -870
- package/sdk/application/PosCart/PosCartApplicationValidator.d.ts +18 -18
- package/sdk/application/PosCart/PosCartApplicationValidator.js +103 -103
- package/sdk/application/Rewards/RewardsApplicationClient.d.ts +27 -27
- package/sdk/application/Rewards/RewardsApplicationClient.js +122 -121
- package/sdk/application/Rewards/RewardsApplicationModel.d.ts +14 -14
- package/sdk/application/Rewards/RewardsApplicationModel.js +96 -191
- package/sdk/application/Rewards/RewardsApplicationValidator.d.ts +3 -3
- package/sdk/application/Rewards/RewardsApplicationValidator.js +12 -12
- package/sdk/application/Share/ShareApplicationClient.d.ts +37 -37
- package/sdk/application/Share/ShareApplicationClient.js +94 -93
- package/sdk/application/Share/ShareApplicationModel.d.ts +8 -8
- package/sdk/application/Share/ShareApplicationModel.js +63 -123
- package/sdk/application/Share/ShareApplicationValidator.d.ts +4 -4
- package/sdk/application/Share/ShareApplicationValidator.js +12 -12
- package/sdk/application/Theme/ThemeApplicationClient.d.ts +8 -8
- package/sdk/application/Theme/ThemeApplicationClient.js +38 -37
- package/sdk/application/Theme/ThemeApplicationModel.d.ts +34 -34
- package/sdk/application/Theme/ThemeApplicationModel.js +190 -336
- package/sdk/application/Theme/ThemeApplicationValidator.d.ts +1 -1
- package/sdk/application/Theme/ThemeApplicationValidator.js +4 -4
- package/sdk/application/User/UserApplicationClient.d.ts +280 -280
- package/sdk/application/User/UserApplicationClient.js +619 -618
- package/sdk/application/User/UserApplicationModel.d.ts +79 -72
- package/sdk/application/User/UserApplicationModel.js +440 -689
- package/sdk/application/User/UserApplicationValidator.d.ts +24 -24
- package/sdk/application/User/UserApplicationValidator.js +89 -89
- package/sdk/common/AxiosHelper.js +18 -7
- package/sdk/constructUrl.d.ts +5 -0
- package/sdk/constructUrl.js +13 -0
- package/sdk/index.d.ts +3 -0
- package/sdk/index.js +5 -0
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.d.ts +51 -51
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.js +182 -180
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.d.ts +6 -6
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.js +21 -21
- package/sdk/platform/Analytics/AnalyticsPlatformClient.js +5 -4
- package/sdk/platform/Analytics/AnalyticsPlatformModel.d.ts +11 -11
- package/sdk/platform/Analytics/AnalyticsPlatformModel.js +95 -178
- package/sdk/platform/Analytics/AnalyticsPlatformValidator.js +1 -0
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.d.ts +10 -10
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +44 -43
- package/sdk/platform/AuditTrail/AuditTrailPlatformModel.d.ts +10 -10
- package/sdk/platform/AuditTrail/AuditTrailPlatformModel.js +50 -89
- package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.d.ts +1 -1
- package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.js +7 -6
- package/sdk/platform/Billing/BillingPlatformClient.d.ts +60 -60
- package/sdk/platform/Billing/BillingPlatformClient.js +184 -183
- package/sdk/platform/Billing/BillingPlatformModel.d.ts +40 -40
- package/sdk/platform/Billing/BillingPlatformModel.js +342 -668
- package/sdk/platform/Billing/BillingPlatformValidator.d.ts +8 -8
- package/sdk/platform/Billing/BillingPlatformValidator.js +26 -25
- package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +192 -165
- package/sdk/platform/Cart/CartPlatformApplicationClient.js +686 -510
- package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +14 -11
- package/sdk/platform/Cart/CartPlatformApplicationValidator.js +77 -61
- package/sdk/platform/Cart/CartPlatformModel.d.ts +84 -83
- package/sdk/platform/Cart/CartPlatformModel.js +676 -1206
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +632 -632
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +1558 -1556
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +40 -40
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +175 -175
- package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +688 -688
- package/sdk/platform/Catalog/CatalogPlatformClient.js +1556 -1559
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +291 -291
- package/sdk/platform/Catalog/CatalogPlatformModel.js +2133 -3910
- package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +66 -66
- package/sdk/platform/Catalog/CatalogPlatformValidator.js +229 -228
- package/sdk/platform/Common/CommonPlatformClient.d.ts +12 -12
- package/sdk/platform/Common/CommonPlatformClient.js +40 -51
- package/sdk/platform/Common/CommonPlatformModel.d.ts +12 -12
- package/sdk/platform/Common/CommonPlatformModel.js +83 -160
- package/sdk/platform/Common/CommonPlatformValidator.d.ts +1 -1
- package/sdk/platform/Common/CommonPlatformValidator.js +7 -6
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +326 -326
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +945 -943
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.d.ts +30 -30
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.js +88 -88
- package/sdk/platform/Communication/CommunicationPlatformClient.js +4 -3
- package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +67 -67
- package/sdk/platform/Communication/CommunicationPlatformModel.js +522 -974
- package/sdk/platform/Communication/CommunicationPlatformValidator.js +1 -0
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +55 -55
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +217 -216
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +27 -27
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +279 -542
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.d.ts +7 -7
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.js +25 -24
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +163 -153
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +617 -552
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.d.ts +22 -21
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.js +70 -64
- package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +125 -125
- package/sdk/platform/Configuration/ConfigurationPlatformClient.js +348 -347
- package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +148 -146
- package/sdk/platform/Configuration/ConfigurationPlatformModel.js +854 -1508
- package/sdk/platform/Configuration/ConfigurationPlatformValidator.d.ts +9 -9
- package/sdk/platform/Configuration/ConfigurationPlatformValidator.js +39 -38
- package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +524 -534
- package/sdk/platform/Content/ContentPlatformApplicationClient.js +1287 -1346
- package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +49 -50
- package/sdk/platform/Content/ContentPlatformApplicationValidator.js +153 -159
- package/sdk/platform/Content/ContentPlatformModel.d.ts +78 -78
- package/sdk/platform/Content/ContentPlatformModel.js +485 -907
- package/sdk/platform/Discount/DiscountPlatformClient.d.ts +65 -65
- package/sdk/platform/Discount/DiscountPlatformClient.js +219 -218
- package/sdk/platform/Discount/DiscountPlatformModel.d.ts +7 -7
- package/sdk/platform/Discount/DiscountPlatformModel.js +60 -121
- package/sdk/platform/Discount/DiscountPlatformValidator.d.ts +6 -6
- package/sdk/platform/Discount/DiscountPlatformValidator.js +30 -29
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +25 -25
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +83 -61
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.d.ts +1 -1
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.js +9 -9
- package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +53 -53
- package/sdk/platform/FileStorage/FileStoragePlatformClient.js +147 -125
- package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +13 -13
- package/sdk/platform/FileStorage/FileStoragePlatformModel.js +86 -169
- package/sdk/platform/FileStorage/FileStoragePlatformValidator.d.ts +3 -3
- package/sdk/platform/FileStorage/FileStoragePlatformValidator.js +12 -11
- package/sdk/platform/Inventory/InventoryPlatformClient.d.ts +63 -63
- package/sdk/platform/Inventory/InventoryPlatformClient.js +231 -230
- package/sdk/platform/Inventory/InventoryPlatformModel.d.ts +30 -30
- package/sdk/platform/Inventory/InventoryPlatformModel.js +497 -964
- package/sdk/platform/Inventory/InventoryPlatformValidator.d.ts +7 -7
- package/sdk/platform/Inventory/InventoryPlatformValidator.js +29 -28
- package/sdk/platform/Lead/LeadPlatformApplicationClient.d.ts +73 -73
- package/sdk/platform/Lead/LeadPlatformApplicationClient.js +203 -201
- package/sdk/platform/Lead/LeadPlatformApplicationValidator.d.ts +7 -7
- package/sdk/platform/Lead/LeadPlatformApplicationValidator.js +29 -29
- package/sdk/platform/Lead/LeadPlatformClient.d.ts +80 -80
- package/sdk/platform/Lead/LeadPlatformClient.js +215 -214
- package/sdk/platform/Lead/LeadPlatformModel.d.ts +35 -35
- package/sdk/platform/Lead/LeadPlatformModel.js +267 -474
- package/sdk/platform/Lead/LeadPlatformValidator.d.ts +6 -6
- package/sdk/platform/Lead/LeadPlatformValidator.js +25 -24
- package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +10 -10
- package/sdk/platform/Order/OrderPlatformApplicationClient.js +68 -66
- package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +1 -1
- package/sdk/platform/Order/OrderPlatformApplicationValidator.js +7 -7
- package/sdk/platform/Order/OrderPlatformClient.d.ts +357 -357
- package/sdk/platform/Order/OrderPlatformClient.js +1046 -1033
- package/sdk/platform/Order/OrderPlatformModel.d.ts +198 -196
- package/sdk/platform/Order/OrderPlatformModel.js +1575 -2861
- package/sdk/platform/Order/OrderPlatformValidator.d.ts +32 -32
- package/sdk/platform/Order/OrderPlatformValidator.js +161 -160
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.js +3 -1
- package/sdk/platform/Partner/PartnerPlatformApplicationValidator.js +1 -1
- package/sdk/platform/Partner/PartnerPlatformModel.d.ts +1 -1
- package/sdk/platform/Partner/PartnerPlatformModel.js +10 -26
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +58 -58
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +178 -178
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +6 -6
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +24 -24
- package/sdk/platform/Payment/PaymentPlatformClient.d.ts +42 -42
- package/sdk/platform/Payment/PaymentPlatformClient.js +156 -155
- package/sdk/platform/Payment/PaymentPlatformModel.d.ts +27 -27
- package/sdk/platform/Payment/PaymentPlatformModel.js +222 -410
- package/sdk/platform/Payment/PaymentPlatformValidator.d.ts +4 -4
- package/sdk/platform/Payment/PaymentPlatformValidator.js +22 -21
- package/sdk/platform/PlatformApplicationClient.d.ts +1496 -10325
- package/sdk/platform/PlatformApplicationClient.js +1584 -13899
- package/sdk/platform/PlatformClient.d.ts +7972 -7888
- package/sdk/platform/PlatformClient.js +8678 -10107
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.d.ts +85 -85
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +299 -280
- package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.d.ts +8 -8
- package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.js +35 -35
- package/sdk/platform/Rewards/RewardsPlatformModel.d.ts +15 -15
- package/sdk/platform/Rewards/RewardsPlatformModel.js +92 -194
- package/sdk/platform/Share/SharePlatformApplicationClient.d.ts +10 -10
- package/sdk/platform/Share/SharePlatformApplicationClient.js +62 -60
- package/sdk/platform/Share/SharePlatformApplicationValidator.d.ts +1 -1
- package/sdk/platform/Share/SharePlatformApplicationValidator.js +7 -7
- package/sdk/platform/Share/SharePlatformModel.d.ts +8 -8
- package/sdk/platform/Share/SharePlatformModel.js +60 -118
- package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +132 -132
- package/sdk/platform/Theme/ThemePlatformApplicationClient.js +314 -312
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.d.ts +15 -15
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.js +45 -45
- package/sdk/platform/Theme/ThemePlatformModel.d.ts +34 -34
- package/sdk/platform/Theme/ThemePlatformModel.js +190 -336
- package/sdk/platform/User/UserPlatformApplicationClient.d.ts +136 -69
- package/sdk/platform/User/UserPlatformApplicationClient.js +507 -166
- package/sdk/platform/User/UserPlatformApplicationValidator.d.ts +12 -7
- package/sdk/platform/User/UserPlatformApplicationValidator.js +62 -24
- package/sdk/platform/User/UserPlatformModel.d.ts +79 -72
- package/sdk/platform/User/UserPlatformModel.js +440 -689
- package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +31 -31
- package/sdk/platform/Webhook/WebhookPlatformClient.js +91 -90
- package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +7 -7
- package/sdk/platform/Webhook/WebhookPlatformModel.js +68 -136
- package/sdk/platform/Webhook/WebhookPlatformValidator.d.ts +3 -3
- package/sdk/platform/Webhook/WebhookPlatformValidator.js +15 -14
- package/sdk/public/Configuration/ConfigurationPublicClient.d.ts +13 -13
- package/sdk/public/Configuration/ConfigurationPublicClient.js +40 -38
- package/sdk/public/Configuration/ConfigurationPublicModel.d.ts +12 -12
- package/sdk/public/Configuration/ConfigurationPublicModel.js +85 -162
- package/sdk/public/Configuration/ConfigurationPublicValidator.d.ts +1 -1
- package/sdk/public/Configuration/ConfigurationPublicValidator.js +6 -6
- package/sdk/public/Inventory/InventoryPublicClient.d.ts +34 -34
- package/sdk/public/Inventory/InventoryPublicClient.js +115 -113
- package/sdk/public/Inventory/InventoryPublicModel.d.ts +10 -10
- package/sdk/public/Inventory/InventoryPublicModel.js +119 -245
- package/sdk/public/Inventory/InventoryPublicValidator.d.ts +3 -3
- package/sdk/public/Inventory/InventoryPublicValidator.js +15 -15
- package/sdk/public/Webhook/WebhookPublicClient.js +2 -0
- package/sdk/public/Webhook/WebhookPublicModel.d.ts +7 -7
- package/sdk/public/Webhook/WebhookPublicModel.js +68 -136
- package/.github/workflows/on_create_release.yml +0 -23
- package/.github/workflows/on_merge_main.yml +0 -38
- package/.github/workflows/on_pull_request.yml +0 -35
- package/.prettierrc +0 -5
- package/documentation/application/CART.md +0 -7339
- package/documentation/application/CATALOG.md +0 -9597
- package/documentation/application/COMMON.md +0 -452
- package/documentation/application/COMMUNICATION.md +0 -467
- package/documentation/application/CONFIGURATION.md +0 -2906
- package/documentation/application/CONTENT.md +0 -3351
- package/documentation/application/FILESTORAGE.md +0 -578
- package/documentation/application/LEAD.md +0 -1895
- package/documentation/application/LOGISTIC.md +0 -765
- package/documentation/application/ORDER.md +0 -3432
- package/documentation/application/PAYMENT.md +0 -5221
- package/documentation/application/POSCART.md +0 -7938
- package/documentation/application/README.md +0 -21
- package/documentation/application/REWARDS.md +0 -708
- package/documentation/application/SHARE.md +0 -733
- package/documentation/application/THEME.md +0 -5800
- package/documentation/application/USER.md +0 -4335
- package/documentation/platform/ANALYTICS.md +0 -1154
- package/documentation/platform/AUDITTRAIL.md +0 -576
- package/documentation/platform/BILLING.md +0 -2400
- package/documentation/platform/CART.md +0 -5559
- package/documentation/platform/CATALOG.md +0 -23261
- package/documentation/platform/COMMON.md +0 -452
- package/documentation/platform/COMMUNICATION.md +0 -5718
- package/documentation/platform/COMPANYPROFILE.md +0 -2031
- package/documentation/platform/CONFIGURATION.md +0 -7339
- package/documentation/platform/CONTENT.md +0 -9098
- package/documentation/platform/DISCOUNT.md +0 -863
- package/documentation/platform/FILESTORAGE.md +0 -1081
- package/documentation/platform/INVENTORY.md +0 -1779
- package/documentation/platform/LEAD.md +0 -4740
- package/documentation/platform/ORDER.md +0 -8486
- package/documentation/platform/PARTNER.md +0 -220
- package/documentation/platform/PAYMENT.md +0 -3448
- package/documentation/platform/README.md +0 -27
- package/documentation/platform/REWARDS.md +0 -1083
- package/documentation/platform/SHARE.md +0 -606
- package/documentation/platform/THEME.md +0 -35729
- package/documentation/platform/USER.md +0 -2319
- package/documentation/platform/WEBHOOK.md +0 -591
- package/documentation/public/CONFIGURATION.md +0 -452
- package/documentation/public/INVENTORY.md +0 -690
- package/documentation/public/WEBHOOK.md +0 -352
- package/jest.config.d.ts +0 -4
- package/jest.config.js +0 -6
- package/tests/application/catalog.spec.js +0 -47
- package/tests/common/action-url.spec.js +0 -35
- package/tests/common/schema/action-url.json +0 -178
- package/tests/common/schema/url-action.json +0 -683
- package/tests/common/url-action.spec.js +0 -48
- package/tests/helpers/cookie.helper.js +0 -31
- package/tests/helpers/oauth.helper.js +0 -43
- package/tests/platform/catalog.spec.js +0 -49
- package/tests/public/location.spec.js +0 -39
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
const Paginator = require("../../common/Paginator");
|
|
2
1
|
const PlatformAPIClient = require("../PlatformAPIClient");
|
|
3
2
|
const { FDKClientValidationError } = require("../../common/FDKError");
|
|
3
|
+
const Paginator = require("../../common/Paginator");
|
|
4
4
|
const ThemeValidator = require("./ThemePlatformApplicationValidator");
|
|
5
5
|
const ThemeModel = require("./ThemePlatformModel");
|
|
6
6
|
const { Logger } = require("./../../common/Logger");
|
|
7
|
+
const Joi = require("joi");
|
|
7
8
|
|
|
8
9
|
class Theme {
|
|
9
10
|
constructor(config, applicationId) {
|
|
@@ -13,15 +14,15 @@ class Theme {
|
|
|
13
14
|
|
|
14
15
|
/**
|
|
15
16
|
* @param {Object} arg - Arg object.
|
|
16
|
-
* @param {
|
|
17
|
-
* @returns {Promise<
|
|
18
|
-
* @summary:
|
|
19
|
-
* @description:
|
|
17
|
+
* @param {AddThemeRequestSchema} arg.body
|
|
18
|
+
* @returns {Promise<ThemesSchema>} - Success response
|
|
19
|
+
* @summary: Add a theme to the theme library
|
|
20
|
+
* @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.
|
|
20
21
|
*/
|
|
21
|
-
async
|
|
22
|
-
const { error } = ThemeValidator.
|
|
22
|
+
async addToThemeLibrary({ body } = {}) {
|
|
23
|
+
const { error } = ThemeValidator.addToThemeLibrary().validate(
|
|
23
24
|
{
|
|
24
|
-
|
|
25
|
+
body,
|
|
25
26
|
},
|
|
26
27
|
{ abortEarly: false, allowUnknown: true }
|
|
27
28
|
);
|
|
@@ -30,16 +31,16 @@ class Theme {
|
|
|
30
31
|
}
|
|
31
32
|
|
|
32
33
|
// Showing warrnings if extra unknown parameters are found
|
|
33
|
-
const { error: warrning } = ThemeValidator.
|
|
34
|
+
const { error: warrning } = ThemeValidator.addToThemeLibrary().validate(
|
|
34
35
|
{
|
|
35
|
-
|
|
36
|
+
body,
|
|
36
37
|
},
|
|
37
38
|
{ abortEarly: false, allowUnknown: false }
|
|
38
39
|
);
|
|
39
40
|
if (warrning) {
|
|
40
41
|
Logger({
|
|
41
42
|
level: "WARN",
|
|
42
|
-
message: "Parameter Validation warrnings for
|
|
43
|
+
message: "Parameter Validation warrnings for addToThemeLibrary",
|
|
43
44
|
});
|
|
44
45
|
Logger({ level: "WARN", message: warrning });
|
|
45
46
|
}
|
|
@@ -48,15 +49,13 @@ class Theme {
|
|
|
48
49
|
|
|
49
50
|
const response = await PlatformAPIClient.execute(
|
|
50
51
|
this.config,
|
|
51
|
-
"
|
|
52
|
-
`/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}
|
|
52
|
+
"post",
|
|
53
|
+
`/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/library`,
|
|
53
54
|
query_params,
|
|
54
|
-
|
|
55
|
+
body
|
|
55
56
|
);
|
|
56
57
|
|
|
57
|
-
const {
|
|
58
|
-
error: res_error,
|
|
59
|
-
} = ThemeModel.AllAvailablePageSchema().validate(response, {
|
|
58
|
+
const { error: res_error } = ThemeModel.ThemesSchema().validate(response, {
|
|
60
59
|
abortEarly: false,
|
|
61
60
|
allowUnknown: false,
|
|
62
61
|
});
|
|
@@ -64,7 +63,7 @@ class Theme {
|
|
|
64
63
|
if (res_error) {
|
|
65
64
|
Logger({
|
|
66
65
|
level: "WARN",
|
|
67
|
-
message: "Response Validation Warnnings for
|
|
66
|
+
message: "Response Validation Warnnings for addToThemeLibrary",
|
|
68
67
|
});
|
|
69
68
|
Logger({ level: "WARN", message: res_error });
|
|
70
69
|
}
|
|
@@ -74,16 +73,14 @@ class Theme {
|
|
|
74
73
|
|
|
75
74
|
/**
|
|
76
75
|
* @param {Object} arg - Arg object.
|
|
77
|
-
* @param {
|
|
78
|
-
* @
|
|
79
|
-
* @
|
|
80
|
-
* @
|
|
81
|
-
* @description: Use this API to create a page for a theme by its ID.
|
|
76
|
+
* @param {AddThemeRequestSchema} arg.body
|
|
77
|
+
* @returns {Promise<ThemesSchema>} - Success response
|
|
78
|
+
* @summary: Apply a theme
|
|
79
|
+
* @description: Use this API to apply a theme to the website.
|
|
82
80
|
*/
|
|
83
|
-
async
|
|
84
|
-
const { error } = ThemeValidator.
|
|
81
|
+
async applyTheme({ body } = {}) {
|
|
82
|
+
const { error } = ThemeValidator.applyTheme().validate(
|
|
85
83
|
{
|
|
86
|
-
themeId,
|
|
87
84
|
body,
|
|
88
85
|
},
|
|
89
86
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -93,9 +90,8 @@ class Theme {
|
|
|
93
90
|
}
|
|
94
91
|
|
|
95
92
|
// Showing warrnings if extra unknown parameters are found
|
|
96
|
-
const { error: warrning } = ThemeValidator.
|
|
93
|
+
const { error: warrning } = ThemeValidator.applyTheme().validate(
|
|
97
94
|
{
|
|
98
|
-
themeId,
|
|
99
95
|
body,
|
|
100
96
|
},
|
|
101
97
|
{ abortEarly: false, allowUnknown: false }
|
|
@@ -103,7 +99,7 @@ class Theme {
|
|
|
103
99
|
if (warrning) {
|
|
104
100
|
Logger({
|
|
105
101
|
level: "WARN",
|
|
106
|
-
message: "Parameter Validation warrnings for
|
|
102
|
+
message: "Parameter Validation warrnings for applyTheme",
|
|
107
103
|
});
|
|
108
104
|
Logger({ level: "WARN", message: warrning });
|
|
109
105
|
}
|
|
@@ -113,14 +109,12 @@ class Theme {
|
|
|
113
109
|
const response = await PlatformAPIClient.execute(
|
|
114
110
|
this.config,
|
|
115
111
|
"post",
|
|
116
|
-
`/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}
|
|
112
|
+
`/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/apply`,
|
|
117
113
|
query_params,
|
|
118
114
|
body
|
|
119
115
|
);
|
|
120
116
|
|
|
121
|
-
const {
|
|
122
|
-
error: res_error,
|
|
123
|
-
} = ThemeModel.AvailablePageSchema().validate(response, {
|
|
117
|
+
const { error: res_error } = ThemeModel.ThemesSchema().validate(response, {
|
|
124
118
|
abortEarly: false,
|
|
125
119
|
allowUnknown: false,
|
|
126
120
|
});
|
|
@@ -128,7 +122,7 @@ class Theme {
|
|
|
128
122
|
if (res_error) {
|
|
129
123
|
Logger({
|
|
130
124
|
level: "WARN",
|
|
131
|
-
message: "Response Validation Warnnings for
|
|
125
|
+
message: "Response Validation Warnnings for applyTheme",
|
|
132
126
|
});
|
|
133
127
|
Logger({ level: "WARN", message: res_error });
|
|
134
128
|
}
|
|
@@ -138,17 +132,15 @@ class Theme {
|
|
|
138
132
|
|
|
139
133
|
/**
|
|
140
134
|
* @param {Object} arg - Arg object.
|
|
141
|
-
* @param {string} arg.themeId - ID
|
|
142
|
-
* @
|
|
143
|
-
* @
|
|
144
|
-
* @
|
|
145
|
-
* @description: Use this API to update multiple pages of a theme by its ID.
|
|
135
|
+
* @param {string} arg.themeId - ID allotted to the theme.
|
|
136
|
+
* @returns {Promise<ThemesSchema>} - Success response
|
|
137
|
+
* @summary: Archive a theme
|
|
138
|
+
* @description: Use this API to store an existing theme but not delete it so that it can be used in future if required.
|
|
146
139
|
*/
|
|
147
|
-
async
|
|
148
|
-
const { error } = ThemeValidator.
|
|
140
|
+
async archiveTheme({ themeId } = {}) {
|
|
141
|
+
const { error } = ThemeValidator.archiveTheme().validate(
|
|
149
142
|
{
|
|
150
143
|
themeId,
|
|
151
|
-
body,
|
|
152
144
|
},
|
|
153
145
|
{ abortEarly: false, allowUnknown: true }
|
|
154
146
|
);
|
|
@@ -157,17 +149,16 @@ class Theme {
|
|
|
157
149
|
}
|
|
158
150
|
|
|
159
151
|
// Showing warrnings if extra unknown parameters are found
|
|
160
|
-
const { error: warrning } = ThemeValidator.
|
|
152
|
+
const { error: warrning } = ThemeValidator.archiveTheme().validate(
|
|
161
153
|
{
|
|
162
154
|
themeId,
|
|
163
|
-
body,
|
|
164
155
|
},
|
|
165
156
|
{ abortEarly: false, allowUnknown: false }
|
|
166
157
|
);
|
|
167
158
|
if (warrning) {
|
|
168
159
|
Logger({
|
|
169
160
|
level: "WARN",
|
|
170
|
-
message: "Parameter Validation warrnings for
|
|
161
|
+
message: "Parameter Validation warrnings for archiveTheme",
|
|
171
162
|
});
|
|
172
163
|
Logger({ level: "WARN", message: warrning });
|
|
173
164
|
}
|
|
@@ -177,14 +168,12 @@ class Theme {
|
|
|
177
168
|
const response = await PlatformAPIClient.execute(
|
|
178
169
|
this.config,
|
|
179
170
|
"put",
|
|
180
|
-
`/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/
|
|
171
|
+
`/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/archive`,
|
|
181
172
|
query_params,
|
|
182
|
-
|
|
173
|
+
undefined
|
|
183
174
|
);
|
|
184
175
|
|
|
185
|
-
const {
|
|
186
|
-
error: res_error,
|
|
187
|
-
} = ThemeModel.AllAvailablePageSchema().validate(response, {
|
|
176
|
+
const { error: res_error } = ThemeModel.ThemesSchema().validate(response, {
|
|
188
177
|
abortEarly: false,
|
|
189
178
|
allowUnknown: false,
|
|
190
179
|
});
|
|
@@ -192,7 +181,7 @@ class Theme {
|
|
|
192
181
|
if (res_error) {
|
|
193
182
|
Logger({
|
|
194
183
|
level: "WARN",
|
|
195
|
-
message: "Response Validation Warnnings for
|
|
184
|
+
message: "Response Validation Warnnings for archiveTheme",
|
|
196
185
|
});
|
|
197
186
|
Logger({ level: "WARN", message: res_error });
|
|
198
187
|
}
|
|
@@ -202,17 +191,17 @@ class Theme {
|
|
|
202
191
|
|
|
203
192
|
/**
|
|
204
193
|
* @param {Object} arg - Arg object.
|
|
205
|
-
* @param {string} arg.themeId - ID of the theme
|
|
206
|
-
* @param {
|
|
194
|
+
* @param {string} arg.themeId - ID of the theme
|
|
195
|
+
* @param {AvailablePageSchema} arg.body
|
|
207
196
|
* @returns {Promise<AvailablePageSchema>} - Success response
|
|
208
|
-
* @summary:
|
|
209
|
-
* @description: Use this API to
|
|
197
|
+
* @summary: Create a page
|
|
198
|
+
* @description: Use this API to create a page for a theme by its ID.
|
|
210
199
|
*/
|
|
211
|
-
async
|
|
212
|
-
const { error } = ThemeValidator.
|
|
200
|
+
async createPage({ themeId, body } = {}) {
|
|
201
|
+
const { error } = ThemeValidator.createPage().validate(
|
|
213
202
|
{
|
|
214
203
|
themeId,
|
|
215
|
-
|
|
204
|
+
body,
|
|
216
205
|
},
|
|
217
206
|
{ abortEarly: false, allowUnknown: true }
|
|
218
207
|
);
|
|
@@ -221,17 +210,17 @@ class Theme {
|
|
|
221
210
|
}
|
|
222
211
|
|
|
223
212
|
// Showing warrnings if extra unknown parameters are found
|
|
224
|
-
const { error: warrning } = ThemeValidator.
|
|
213
|
+
const { error: warrning } = ThemeValidator.createPage().validate(
|
|
225
214
|
{
|
|
226
215
|
themeId,
|
|
227
|
-
|
|
216
|
+
body,
|
|
228
217
|
},
|
|
229
218
|
{ abortEarly: false, allowUnknown: false }
|
|
230
219
|
);
|
|
231
220
|
if (warrning) {
|
|
232
221
|
Logger({
|
|
233
222
|
level: "WARN",
|
|
234
|
-
message: "Parameter Validation warrnings for
|
|
223
|
+
message: "Parameter Validation warrnings for createPage",
|
|
235
224
|
});
|
|
236
225
|
Logger({ level: "WARN", message: warrning });
|
|
237
226
|
}
|
|
@@ -240,10 +229,10 @@ class Theme {
|
|
|
240
229
|
|
|
241
230
|
const response = await PlatformAPIClient.execute(
|
|
242
231
|
this.config,
|
|
243
|
-
"
|
|
244
|
-
`/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}
|
|
232
|
+
"post",
|
|
233
|
+
`/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/page`,
|
|
245
234
|
query_params,
|
|
246
|
-
|
|
235
|
+
body
|
|
247
236
|
);
|
|
248
237
|
|
|
249
238
|
const {
|
|
@@ -256,7 +245,7 @@ class Theme {
|
|
|
256
245
|
if (res_error) {
|
|
257
246
|
Logger({
|
|
258
247
|
level: "WARN",
|
|
259
|
-
message: "Response Validation Warnnings for
|
|
248
|
+
message: "Response Validation Warnnings for createPage",
|
|
260
249
|
});
|
|
261
250
|
Logger({ level: "WARN", message: res_error });
|
|
262
251
|
}
|
|
@@ -266,18 +255,14 @@ class Theme {
|
|
|
266
255
|
|
|
267
256
|
/**
|
|
268
257
|
* @param {Object} arg - Arg object.
|
|
269
|
-
* @param {
|
|
270
|
-
* @
|
|
271
|
-
* @
|
|
272
|
-
* @
|
|
273
|
-
* @summary: Updates a page
|
|
274
|
-
* @description: Use this API to update a page for a theme by its ID.
|
|
258
|
+
* @param {ThemesSchema} arg.body
|
|
259
|
+
* @returns {Promise<ThemesSchema>} - Success response
|
|
260
|
+
* @summary: Create a new theme
|
|
261
|
+
* @description: Themes improve the look and appearance of a website. Use this API to create a theme.
|
|
275
262
|
*/
|
|
276
|
-
async
|
|
277
|
-
const { error } = ThemeValidator.
|
|
263
|
+
async createTheme({ body } = {}) {
|
|
264
|
+
const { error } = ThemeValidator.createTheme().validate(
|
|
278
265
|
{
|
|
279
|
-
themeId,
|
|
280
|
-
pageValue,
|
|
281
266
|
body,
|
|
282
267
|
},
|
|
283
268
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -287,10 +272,8 @@ class Theme {
|
|
|
287
272
|
}
|
|
288
273
|
|
|
289
274
|
// Showing warrnings if extra unknown parameters are found
|
|
290
|
-
const { error: warrning } = ThemeValidator.
|
|
275
|
+
const { error: warrning } = ThemeValidator.createTheme().validate(
|
|
291
276
|
{
|
|
292
|
-
themeId,
|
|
293
|
-
pageValue,
|
|
294
277
|
body,
|
|
295
278
|
},
|
|
296
279
|
{ abortEarly: false, allowUnknown: false }
|
|
@@ -298,7 +281,7 @@ class Theme {
|
|
|
298
281
|
if (warrning) {
|
|
299
282
|
Logger({
|
|
300
283
|
level: "WARN",
|
|
301
|
-
message: "Parameter Validation warrnings for
|
|
284
|
+
message: "Parameter Validation warrnings for createTheme",
|
|
302
285
|
});
|
|
303
286
|
Logger({ level: "WARN", message: warrning });
|
|
304
287
|
}
|
|
@@ -307,15 +290,13 @@ class Theme {
|
|
|
307
290
|
|
|
308
291
|
const response = await PlatformAPIClient.execute(
|
|
309
292
|
this.config,
|
|
310
|
-
"
|
|
311
|
-
`/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}
|
|
293
|
+
"post",
|
|
294
|
+
`/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/`,
|
|
312
295
|
query_params,
|
|
313
296
|
body
|
|
314
297
|
);
|
|
315
298
|
|
|
316
|
-
const {
|
|
317
|
-
error: res_error,
|
|
318
|
-
} = ThemeModel.AvailablePageSchema().validate(response, {
|
|
299
|
+
const { error: res_error } = ThemeModel.ThemesSchema().validate(response, {
|
|
319
300
|
abortEarly: false,
|
|
320
301
|
allowUnknown: false,
|
|
321
302
|
});
|
|
@@ -323,7 +304,7 @@ class Theme {
|
|
|
323
304
|
if (res_error) {
|
|
324
305
|
Logger({
|
|
325
306
|
level: "WARN",
|
|
326
|
-
message: "Response Validation Warnnings for
|
|
307
|
+
message: "Response Validation Warnnings for createTheme",
|
|
327
308
|
});
|
|
328
309
|
Logger({ level: "WARN", message: res_error });
|
|
329
310
|
}
|
|
@@ -397,19 +378,15 @@ class Theme {
|
|
|
397
378
|
|
|
398
379
|
/**
|
|
399
380
|
* @param {Object} arg - Arg object.
|
|
400
|
-
* @param {
|
|
401
|
-
*
|
|
402
|
-
* @
|
|
403
|
-
*
|
|
404
|
-
* @returns {Promise<ThemesListingResponseSchema>} - Success response
|
|
405
|
-
* @summary: Get a list of themes from the theme library
|
|
406
|
-
* @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.
|
|
381
|
+
* @param {string} arg.themeId - ID allotted to the theme.
|
|
382
|
+
* @returns {Promise<ThemesSchema>} - Success response
|
|
383
|
+
* @summary: Delete a theme
|
|
384
|
+
* @description: Use this API to delete a theme from the theme library.
|
|
407
385
|
*/
|
|
408
|
-
async
|
|
409
|
-
const { error } = ThemeValidator.
|
|
386
|
+
async deleteTheme({ themeId } = {}) {
|
|
387
|
+
const { error } = ThemeValidator.deleteTheme().validate(
|
|
410
388
|
{
|
|
411
|
-
|
|
412
|
-
pageNo,
|
|
389
|
+
themeId,
|
|
413
390
|
},
|
|
414
391
|
{ abortEarly: false, allowUnknown: true }
|
|
415
392
|
);
|
|
@@ -418,36 +395,31 @@ class Theme {
|
|
|
418
395
|
}
|
|
419
396
|
|
|
420
397
|
// Showing warrnings if extra unknown parameters are found
|
|
421
|
-
const { error: warrning } = ThemeValidator.
|
|
398
|
+
const { error: warrning } = ThemeValidator.deleteTheme().validate(
|
|
422
399
|
{
|
|
423
|
-
|
|
424
|
-
pageNo,
|
|
400
|
+
themeId,
|
|
425
401
|
},
|
|
426
402
|
{ abortEarly: false, allowUnknown: false }
|
|
427
403
|
);
|
|
428
404
|
if (warrning) {
|
|
429
405
|
Logger({
|
|
430
406
|
level: "WARN",
|
|
431
|
-
message: "Parameter Validation warrnings for
|
|
407
|
+
message: "Parameter Validation warrnings for deleteTheme",
|
|
432
408
|
});
|
|
433
409
|
Logger({ level: "WARN", message: warrning });
|
|
434
410
|
}
|
|
435
411
|
|
|
436
412
|
const query_params = {};
|
|
437
|
-
query_params["page_size"] = pageSize;
|
|
438
|
-
query_params["page_no"] = pageNo;
|
|
439
413
|
|
|
440
414
|
const response = await PlatformAPIClient.execute(
|
|
441
415
|
this.config,
|
|
442
|
-
"
|
|
443
|
-
`/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}
|
|
416
|
+
"delete",
|
|
417
|
+
`/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}`,
|
|
444
418
|
query_params,
|
|
445
419
|
undefined
|
|
446
420
|
);
|
|
447
421
|
|
|
448
|
-
const {
|
|
449
|
-
error: res_error,
|
|
450
|
-
} = ThemeModel.ThemesListingResponseSchema().validate(response, {
|
|
422
|
+
const { error: res_error } = ThemeModel.ThemesSchema().validate(response, {
|
|
451
423
|
abortEarly: false,
|
|
452
424
|
allowUnknown: false,
|
|
453
425
|
});
|
|
@@ -455,7 +427,7 @@ class Theme {
|
|
|
455
427
|
if (res_error) {
|
|
456
428
|
Logger({
|
|
457
429
|
level: "WARN",
|
|
458
|
-
message: "Response Validation Warnnings for
|
|
430
|
+
message: "Response Validation Warnnings for deleteTheme",
|
|
459
431
|
});
|
|
460
432
|
Logger({ level: "WARN", message: res_error });
|
|
461
433
|
}
|
|
@@ -465,15 +437,15 @@ class Theme {
|
|
|
465
437
|
|
|
466
438
|
/**
|
|
467
439
|
* @param {Object} arg - Arg object.
|
|
468
|
-
* @param {
|
|
469
|
-
* @returns {Promise<
|
|
470
|
-
* @summary:
|
|
471
|
-
* @description:
|
|
440
|
+
* @param {string} arg.themeId - ID of the theme to be retrieved
|
|
441
|
+
* @returns {Promise<AllAvailablePageSchema>} - Success response
|
|
442
|
+
* @summary: Get all pages of a theme
|
|
443
|
+
* @description: Use this API to retrieve all the available pages of a theme by its ID.
|
|
472
444
|
*/
|
|
473
|
-
async
|
|
474
|
-
const { error } = ThemeValidator.
|
|
445
|
+
async getAllPages({ themeId } = {}) {
|
|
446
|
+
const { error } = ThemeValidator.getAllPages().validate(
|
|
475
447
|
{
|
|
476
|
-
|
|
448
|
+
themeId,
|
|
477
449
|
},
|
|
478
450
|
{ abortEarly: false, allowUnknown: true }
|
|
479
451
|
);
|
|
@@ -482,16 +454,16 @@ class Theme {
|
|
|
482
454
|
}
|
|
483
455
|
|
|
484
456
|
// Showing warrnings if extra unknown parameters are found
|
|
485
|
-
const { error: warrning } = ThemeValidator.
|
|
457
|
+
const { error: warrning } = ThemeValidator.getAllPages().validate(
|
|
486
458
|
{
|
|
487
|
-
|
|
459
|
+
themeId,
|
|
488
460
|
},
|
|
489
461
|
{ abortEarly: false, allowUnknown: false }
|
|
490
462
|
);
|
|
491
463
|
if (warrning) {
|
|
492
464
|
Logger({
|
|
493
465
|
level: "WARN",
|
|
494
|
-
message: "Parameter Validation warrnings for
|
|
466
|
+
message: "Parameter Validation warrnings for getAllPages",
|
|
495
467
|
});
|
|
496
468
|
Logger({ level: "WARN", message: warrning });
|
|
497
469
|
}
|
|
@@ -500,13 +472,15 @@ class Theme {
|
|
|
500
472
|
|
|
501
473
|
const response = await PlatformAPIClient.execute(
|
|
502
474
|
this.config,
|
|
503
|
-
"
|
|
504
|
-
`/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/
|
|
475
|
+
"get",
|
|
476
|
+
`/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/page`,
|
|
505
477
|
query_params,
|
|
506
|
-
|
|
478
|
+
undefined
|
|
507
479
|
);
|
|
508
480
|
|
|
509
|
-
const {
|
|
481
|
+
const {
|
|
482
|
+
error: res_error,
|
|
483
|
+
} = ThemeModel.AllAvailablePageSchema().validate(response, {
|
|
510
484
|
abortEarly: false,
|
|
511
485
|
allowUnknown: false,
|
|
512
486
|
});
|
|
@@ -514,7 +488,7 @@ class Theme {
|
|
|
514
488
|
if (res_error) {
|
|
515
489
|
Logger({
|
|
516
490
|
level: "WARN",
|
|
517
|
-
message: "Response Validation Warnnings for
|
|
491
|
+
message: "Response Validation Warnnings for getAllPages",
|
|
518
492
|
});
|
|
519
493
|
Logger({ level: "WARN", message: res_error });
|
|
520
494
|
}
|
|
@@ -524,16 +498,13 @@ class Theme {
|
|
|
524
498
|
|
|
525
499
|
/**
|
|
526
500
|
* @param {Object} arg - Arg object.
|
|
527
|
-
* @param {AddThemeRequestSchema} arg.body
|
|
528
501
|
* @returns {Promise<ThemesSchema>} - Success response
|
|
529
|
-
* @summary:
|
|
530
|
-
* @description: Use this API to
|
|
502
|
+
* @summary: Get the applied theme
|
|
503
|
+
* @description: Use this API to retrieve the theme that is currently applied to the website along with its details.
|
|
531
504
|
*/
|
|
532
|
-
async
|
|
533
|
-
const { error } = ThemeValidator.
|
|
534
|
-
{
|
|
535
|
-
body,
|
|
536
|
-
},
|
|
505
|
+
async getAppliedTheme({} = {}) {
|
|
506
|
+
const { error } = ThemeValidator.getAppliedTheme().validate(
|
|
507
|
+
{},
|
|
537
508
|
{ abortEarly: false, allowUnknown: true }
|
|
538
509
|
);
|
|
539
510
|
if (error) {
|
|
@@ -541,16 +512,14 @@ class Theme {
|
|
|
541
512
|
}
|
|
542
513
|
|
|
543
514
|
// Showing warrnings if extra unknown parameters are found
|
|
544
|
-
const { error: warrning } = ThemeValidator.
|
|
545
|
-
{
|
|
546
|
-
body,
|
|
547
|
-
},
|
|
515
|
+
const { error: warrning } = ThemeValidator.getAppliedTheme().validate(
|
|
516
|
+
{},
|
|
548
517
|
{ abortEarly: false, allowUnknown: false }
|
|
549
518
|
);
|
|
550
519
|
if (warrning) {
|
|
551
520
|
Logger({
|
|
552
521
|
level: "WARN",
|
|
553
|
-
message: "Parameter Validation warrnings for
|
|
522
|
+
message: "Parameter Validation warrnings for getAppliedTheme",
|
|
554
523
|
});
|
|
555
524
|
Logger({ level: "WARN", message: warrning });
|
|
556
525
|
}
|
|
@@ -559,10 +528,10 @@ class Theme {
|
|
|
559
528
|
|
|
560
529
|
const response = await PlatformAPIClient.execute(
|
|
561
530
|
this.config,
|
|
562
|
-
"
|
|
563
|
-
`/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}
|
|
531
|
+
"get",
|
|
532
|
+
`/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/`,
|
|
564
533
|
query_params,
|
|
565
|
-
|
|
534
|
+
undefined
|
|
566
535
|
);
|
|
567
536
|
|
|
568
537
|
const { error: res_error } = ThemeModel.ThemesSchema().validate(response, {
|
|
@@ -573,7 +542,7 @@ class Theme {
|
|
|
573
542
|
if (res_error) {
|
|
574
543
|
Logger({
|
|
575
544
|
level: "WARN",
|
|
576
|
-
message: "Response Validation Warnnings for
|
|
545
|
+
message: "Response Validation Warnnings for getAppliedTheme",
|
|
577
546
|
});
|
|
578
547
|
Logger({ level: "WARN", message: res_error });
|
|
579
548
|
}
|
|
@@ -583,16 +552,13 @@ class Theme {
|
|
|
583
552
|
|
|
584
553
|
/**
|
|
585
554
|
* @param {Object} arg - Arg object.
|
|
586
|
-
* @
|
|
587
|
-
* @
|
|
588
|
-
* @
|
|
589
|
-
* @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.
|
|
555
|
+
* @returns {Promise<FontsSchema>} - Success response
|
|
556
|
+
* @summary: Get all the supported fonts in a theme
|
|
557
|
+
* @description: Font is a collection of characters with a similar design. Use this API to retrieve a list of website fonts.
|
|
590
558
|
*/
|
|
591
|
-
async
|
|
592
|
-
const { error } = ThemeValidator.
|
|
593
|
-
{
|
|
594
|
-
themeId,
|
|
595
|
-
},
|
|
559
|
+
async getFonts({} = {}) {
|
|
560
|
+
const { error } = ThemeValidator.getFonts().validate(
|
|
561
|
+
{},
|
|
596
562
|
{ abortEarly: false, allowUnknown: true }
|
|
597
563
|
);
|
|
598
564
|
if (error) {
|
|
@@ -600,16 +566,14 @@ class Theme {
|
|
|
600
566
|
}
|
|
601
567
|
|
|
602
568
|
// Showing warrnings if extra unknown parameters are found
|
|
603
|
-
const { error: warrning } = ThemeValidator.
|
|
604
|
-
{
|
|
605
|
-
themeId,
|
|
606
|
-
},
|
|
569
|
+
const { error: warrning } = ThemeValidator.getFonts().validate(
|
|
570
|
+
{},
|
|
607
571
|
{ abortEarly: false, allowUnknown: false }
|
|
608
572
|
);
|
|
609
573
|
if (warrning) {
|
|
610
574
|
Logger({
|
|
611
575
|
level: "WARN",
|
|
612
|
-
message: "Parameter Validation warrnings for
|
|
576
|
+
message: "Parameter Validation warrnings for getFonts",
|
|
613
577
|
});
|
|
614
578
|
Logger({ level: "WARN", message: warrning });
|
|
615
579
|
}
|
|
@@ -619,14 +583,12 @@ class Theme {
|
|
|
619
583
|
const response = await PlatformAPIClient.execute(
|
|
620
584
|
this.config,
|
|
621
585
|
"get",
|
|
622
|
-
`/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}
|
|
586
|
+
`/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/fonts`,
|
|
623
587
|
query_params,
|
|
624
588
|
undefined
|
|
625
589
|
);
|
|
626
590
|
|
|
627
|
-
const {
|
|
628
|
-
error: res_error,
|
|
629
|
-
} = ThemeModel.UpgradableThemeSchema().validate(response, {
|
|
591
|
+
const { error: res_error } = ThemeModel.FontsSchema().validate(response, {
|
|
630
592
|
abortEarly: false,
|
|
631
593
|
allowUnknown: false,
|
|
632
594
|
});
|
|
@@ -634,7 +596,7 @@ class Theme {
|
|
|
634
596
|
if (res_error) {
|
|
635
597
|
Logger({
|
|
636
598
|
level: "WARN",
|
|
637
|
-
message: "Response Validation Warnnings for
|
|
599
|
+
message: "Response Validation Warnnings for getFonts",
|
|
638
600
|
});
|
|
639
601
|
Logger({ level: "WARN", message: res_error });
|
|
640
602
|
}
|
|
@@ -644,15 +606,17 @@ class Theme {
|
|
|
644
606
|
|
|
645
607
|
/**
|
|
646
608
|
* @param {Object} arg - Arg object.
|
|
647
|
-
* @param {string} arg.themeId - ID
|
|
648
|
-
* @
|
|
649
|
-
* @
|
|
650
|
-
* @
|
|
609
|
+
* @param {string} arg.themeId - ID of the theme to be retrieved
|
|
610
|
+
* @param {string} arg.pageValue - Value of the page to be retrieved
|
|
611
|
+
* @returns {Promise<AvailablePageSchema>} - Success response
|
|
612
|
+
* @summary: Get page of a theme
|
|
613
|
+
* @description: Use this API to retrieve a page of a theme.
|
|
651
614
|
*/
|
|
652
|
-
async
|
|
653
|
-
const { error } = ThemeValidator.
|
|
615
|
+
async getPage({ themeId, pageValue } = {}) {
|
|
616
|
+
const { error } = ThemeValidator.getPage().validate(
|
|
654
617
|
{
|
|
655
618
|
themeId,
|
|
619
|
+
pageValue,
|
|
656
620
|
},
|
|
657
621
|
{ abortEarly: false, allowUnknown: true }
|
|
658
622
|
);
|
|
@@ -661,16 +625,17 @@ class Theme {
|
|
|
661
625
|
}
|
|
662
626
|
|
|
663
627
|
// Showing warrnings if extra unknown parameters are found
|
|
664
|
-
const { error: warrning } = ThemeValidator.
|
|
628
|
+
const { error: warrning } = ThemeValidator.getPage().validate(
|
|
665
629
|
{
|
|
666
630
|
themeId,
|
|
631
|
+
pageValue,
|
|
667
632
|
},
|
|
668
633
|
{ abortEarly: false, allowUnknown: false }
|
|
669
634
|
);
|
|
670
635
|
if (warrning) {
|
|
671
636
|
Logger({
|
|
672
637
|
level: "WARN",
|
|
673
|
-
message: "Parameter Validation warrnings for
|
|
638
|
+
message: "Parameter Validation warrnings for getPage",
|
|
674
639
|
});
|
|
675
640
|
Logger({ level: "WARN", message: warrning });
|
|
676
641
|
}
|
|
@@ -679,13 +644,15 @@ class Theme {
|
|
|
679
644
|
|
|
680
645
|
const response = await PlatformAPIClient.execute(
|
|
681
646
|
this.config,
|
|
682
|
-
"
|
|
683
|
-
`/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}
|
|
647
|
+
"get",
|
|
648
|
+
`/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/${pageValue}`,
|
|
684
649
|
query_params,
|
|
685
650
|
undefined
|
|
686
651
|
);
|
|
687
652
|
|
|
688
|
-
const {
|
|
653
|
+
const {
|
|
654
|
+
error: res_error,
|
|
655
|
+
} = ThemeModel.AvailablePageSchema().validate(response, {
|
|
689
656
|
abortEarly: false,
|
|
690
657
|
allowUnknown: false,
|
|
691
658
|
});
|
|
@@ -693,7 +660,7 @@ class Theme {
|
|
|
693
660
|
if (res_error) {
|
|
694
661
|
Logger({
|
|
695
662
|
level: "WARN",
|
|
696
|
-
message: "Response Validation Warnnings for
|
|
663
|
+
message: "Response Validation Warnnings for getPage",
|
|
697
664
|
});
|
|
698
665
|
Logger({ level: "WARN", message: res_error });
|
|
699
666
|
}
|
|
@@ -771,15 +738,15 @@ class Theme {
|
|
|
771
738
|
|
|
772
739
|
/**
|
|
773
740
|
* @param {Object} arg - Arg object.
|
|
774
|
-
* @param {
|
|
741
|
+
* @param {string} arg.themeId - ID allotted to the theme.
|
|
775
742
|
* @returns {Promise<ThemesSchema>} - Success response
|
|
776
|
-
* @summary:
|
|
777
|
-
* @description:
|
|
743
|
+
* @summary: Gets theme by id
|
|
744
|
+
* @description: Use this API to retrieve the details of a specific theme by using its ID.
|
|
778
745
|
*/
|
|
779
|
-
async
|
|
780
|
-
const { error } = ThemeValidator.
|
|
746
|
+
async getThemeById({ themeId } = {}) {
|
|
747
|
+
const { error } = ThemeValidator.getThemeById().validate(
|
|
781
748
|
{
|
|
782
|
-
|
|
749
|
+
themeId,
|
|
783
750
|
},
|
|
784
751
|
{ abortEarly: false, allowUnknown: true }
|
|
785
752
|
);
|
|
@@ -788,16 +755,16 @@ class Theme {
|
|
|
788
755
|
}
|
|
789
756
|
|
|
790
757
|
// Showing warrnings if extra unknown parameters are found
|
|
791
|
-
const { error: warrning } = ThemeValidator.
|
|
758
|
+
const { error: warrning } = ThemeValidator.getThemeById().validate(
|
|
792
759
|
{
|
|
793
|
-
|
|
760
|
+
themeId,
|
|
794
761
|
},
|
|
795
762
|
{ abortEarly: false, allowUnknown: false }
|
|
796
763
|
);
|
|
797
764
|
if (warrning) {
|
|
798
765
|
Logger({
|
|
799
766
|
level: "WARN",
|
|
800
|
-
message: "Parameter Validation warrnings for
|
|
767
|
+
message: "Parameter Validation warrnings for getThemeById",
|
|
801
768
|
});
|
|
802
769
|
Logger({ level: "WARN", message: warrning });
|
|
803
770
|
}
|
|
@@ -806,10 +773,10 @@ class Theme {
|
|
|
806
773
|
|
|
807
774
|
const response = await PlatformAPIClient.execute(
|
|
808
775
|
this.config,
|
|
809
|
-
"
|
|
810
|
-
`/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}
|
|
776
|
+
"get",
|
|
777
|
+
`/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}`,
|
|
811
778
|
query_params,
|
|
812
|
-
|
|
779
|
+
undefined
|
|
813
780
|
);
|
|
814
781
|
|
|
815
782
|
const { error: res_error } = ThemeModel.ThemesSchema().validate(response, {
|
|
@@ -820,7 +787,7 @@ class Theme {
|
|
|
820
787
|
if (res_error) {
|
|
821
788
|
Logger({
|
|
822
789
|
level: "WARN",
|
|
823
|
-
message: "Response Validation Warnnings for
|
|
790
|
+
message: "Response Validation Warnnings for getThemeById",
|
|
824
791
|
});
|
|
825
792
|
Logger({ level: "WARN", message: res_error });
|
|
826
793
|
}
|
|
@@ -830,13 +797,16 @@ class Theme {
|
|
|
830
797
|
|
|
831
798
|
/**
|
|
832
799
|
* @param {Object} arg - Arg object.
|
|
800
|
+
* @param {string} arg.themeId - ID allotted to the theme.
|
|
833
801
|
* @returns {Promise<ThemesSchema>} - Success response
|
|
834
|
-
* @summary: Get
|
|
835
|
-
* @description:
|
|
802
|
+
* @summary: Get a theme preview
|
|
803
|
+
* @description: A theme can be previewed before applying it. Use this API to retrieve the theme preview by using its ID.
|
|
836
804
|
*/
|
|
837
|
-
async
|
|
838
|
-
const { error } = ThemeValidator.
|
|
839
|
-
{
|
|
805
|
+
async getThemeForPreview({ themeId } = {}) {
|
|
806
|
+
const { error } = ThemeValidator.getThemeForPreview().validate(
|
|
807
|
+
{
|
|
808
|
+
themeId,
|
|
809
|
+
},
|
|
840
810
|
{ abortEarly: false, allowUnknown: true }
|
|
841
811
|
);
|
|
842
812
|
if (error) {
|
|
@@ -844,14 +814,16 @@ class Theme {
|
|
|
844
814
|
}
|
|
845
815
|
|
|
846
816
|
// Showing warrnings if extra unknown parameters are found
|
|
847
|
-
const { error: warrning } = ThemeValidator.
|
|
848
|
-
{
|
|
817
|
+
const { error: warrning } = ThemeValidator.getThemeForPreview().validate(
|
|
818
|
+
{
|
|
819
|
+
themeId,
|
|
820
|
+
},
|
|
849
821
|
{ abortEarly: false, allowUnknown: false }
|
|
850
822
|
);
|
|
851
823
|
if (warrning) {
|
|
852
824
|
Logger({
|
|
853
825
|
level: "WARN",
|
|
854
|
-
message: "Parameter Validation warrnings for
|
|
826
|
+
message: "Parameter Validation warrnings for getThemeForPreview",
|
|
855
827
|
});
|
|
856
828
|
Logger({ level: "WARN", message: warrning });
|
|
857
829
|
}
|
|
@@ -861,7 +833,7 @@ class Theme {
|
|
|
861
833
|
const response = await PlatformAPIClient.execute(
|
|
862
834
|
this.config,
|
|
863
835
|
"get",
|
|
864
|
-
`/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}
|
|
836
|
+
`/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/preview`,
|
|
865
837
|
query_params,
|
|
866
838
|
undefined
|
|
867
839
|
);
|
|
@@ -874,7 +846,7 @@ class Theme {
|
|
|
874
846
|
if (res_error) {
|
|
875
847
|
Logger({
|
|
876
848
|
level: "WARN",
|
|
877
|
-
message: "Response Validation Warnnings for
|
|
849
|
+
message: "Response Validation Warnnings for getThemeForPreview",
|
|
878
850
|
});
|
|
879
851
|
Logger({ level: "WARN", message: res_error });
|
|
880
852
|
}
|
|
@@ -884,13 +856,16 @@ class Theme {
|
|
|
884
856
|
|
|
885
857
|
/**
|
|
886
858
|
* @param {Object} arg - Arg object.
|
|
887
|
-
* @
|
|
888
|
-
* @
|
|
889
|
-
* @
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
859
|
+
* @param {string} arg.themeId - ID allotted to the theme.
|
|
860
|
+
* @returns {Promise<any>} - Success response
|
|
861
|
+
* @summary: Fetch last modified timestamp
|
|
862
|
+
* @description: Use this API to fetch Last-Modified timestamp in header metadata.
|
|
863
|
+
*/
|
|
864
|
+
async getThemeLastModified({ themeId } = {}) {
|
|
865
|
+
const { error } = ThemeValidator.getThemeLastModified().validate(
|
|
866
|
+
{
|
|
867
|
+
themeId,
|
|
868
|
+
},
|
|
894
869
|
{ abortEarly: false, allowUnknown: true }
|
|
895
870
|
);
|
|
896
871
|
if (error) {
|
|
@@ -898,14 +873,16 @@ class Theme {
|
|
|
898
873
|
}
|
|
899
874
|
|
|
900
875
|
// Showing warrnings if extra unknown parameters are found
|
|
901
|
-
const { error: warrning } = ThemeValidator.
|
|
902
|
-
{
|
|
876
|
+
const { error: warrning } = ThemeValidator.getThemeLastModified().validate(
|
|
877
|
+
{
|
|
878
|
+
themeId,
|
|
879
|
+
},
|
|
903
880
|
{ abortEarly: false, allowUnknown: false }
|
|
904
881
|
);
|
|
905
882
|
if (warrning) {
|
|
906
883
|
Logger({
|
|
907
884
|
level: "WARN",
|
|
908
|
-
message: "Parameter Validation warrnings for
|
|
885
|
+
message: "Parameter Validation warrnings for getThemeLastModified",
|
|
909
886
|
});
|
|
910
887
|
Logger({ level: "WARN", message: warrning });
|
|
911
888
|
}
|
|
@@ -914,21 +891,20 @@ class Theme {
|
|
|
914
891
|
|
|
915
892
|
const response = await PlatformAPIClient.execute(
|
|
916
893
|
this.config,
|
|
917
|
-
"
|
|
918
|
-
`/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/
|
|
894
|
+
"head",
|
|
895
|
+
`/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/polling`,
|
|
919
896
|
query_params,
|
|
920
897
|
undefined
|
|
921
898
|
);
|
|
922
899
|
|
|
923
|
-
const { error: res_error } =
|
|
924
|
-
|
|
925
|
-
allowUnknown: false
|
|
926
|
-
});
|
|
900
|
+
const { error: res_error } = Joi.string()
|
|
901
|
+
.allow("")
|
|
902
|
+
.validate(response, { abortEarly: false, allowUnknown: false });
|
|
927
903
|
|
|
928
904
|
if (res_error) {
|
|
929
905
|
Logger({
|
|
930
906
|
level: "WARN",
|
|
931
|
-
message: "Response Validation Warnnings for
|
|
907
|
+
message: "Response Validation Warnnings for getThemeLastModified",
|
|
932
908
|
});
|
|
933
909
|
Logger({ level: "WARN", message: res_error });
|
|
934
910
|
}
|
|
@@ -938,15 +914,19 @@ class Theme {
|
|
|
938
914
|
|
|
939
915
|
/**
|
|
940
916
|
* @param {Object} arg - Arg object.
|
|
941
|
-
* @param {
|
|
942
|
-
*
|
|
943
|
-
* @
|
|
944
|
-
*
|
|
917
|
+
* @param {number} [arg.pageSize] - The number of items to retrieve in each
|
|
918
|
+
* page. Default value is 10.
|
|
919
|
+
* @param {number} [arg.pageNo] - The page number to navigate through the
|
|
920
|
+
* given set of results. Default value is 1.
|
|
921
|
+
* @returns {Promise<ThemesListingResponseSchema>} - Success response
|
|
922
|
+
* @summary: Get a list of themes from the theme library
|
|
923
|
+
* @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.
|
|
945
924
|
*/
|
|
946
|
-
async
|
|
947
|
-
const { error } = ThemeValidator.
|
|
925
|
+
async getThemeLibrary({ pageSize, pageNo } = {}) {
|
|
926
|
+
const { error } = ThemeValidator.getThemeLibrary().validate(
|
|
948
927
|
{
|
|
949
|
-
|
|
928
|
+
pageSize,
|
|
929
|
+
pageNo,
|
|
950
930
|
},
|
|
951
931
|
{ abortEarly: false, allowUnknown: true }
|
|
952
932
|
);
|
|
@@ -955,31 +935,36 @@ class Theme {
|
|
|
955
935
|
}
|
|
956
936
|
|
|
957
937
|
// Showing warrnings if extra unknown parameters are found
|
|
958
|
-
const { error: warrning } = ThemeValidator.
|
|
938
|
+
const { error: warrning } = ThemeValidator.getThemeLibrary().validate(
|
|
959
939
|
{
|
|
960
|
-
|
|
940
|
+
pageSize,
|
|
941
|
+
pageNo,
|
|
961
942
|
},
|
|
962
943
|
{ abortEarly: false, allowUnknown: false }
|
|
963
944
|
);
|
|
964
945
|
if (warrning) {
|
|
965
946
|
Logger({
|
|
966
947
|
level: "WARN",
|
|
967
|
-
message: "Parameter Validation warrnings for
|
|
948
|
+
message: "Parameter Validation warrnings for getThemeLibrary",
|
|
968
949
|
});
|
|
969
950
|
Logger({ level: "WARN", message: warrning });
|
|
970
951
|
}
|
|
971
952
|
|
|
972
953
|
const query_params = {};
|
|
954
|
+
query_params["page_size"] = pageSize;
|
|
955
|
+
query_params["page_no"] = pageNo;
|
|
973
956
|
|
|
974
957
|
const response = await PlatformAPIClient.execute(
|
|
975
958
|
this.config,
|
|
976
959
|
"get",
|
|
977
|
-
`/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}
|
|
960
|
+
`/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/library`,
|
|
978
961
|
query_params,
|
|
979
962
|
undefined
|
|
980
963
|
);
|
|
981
964
|
|
|
982
|
-
const {
|
|
965
|
+
const {
|
|
966
|
+
error: res_error,
|
|
967
|
+
} = ThemeModel.ThemesListingResponseSchema().validate(response, {
|
|
983
968
|
abortEarly: false,
|
|
984
969
|
allowUnknown: false,
|
|
985
970
|
});
|
|
@@ -987,7 +972,7 @@ class Theme {
|
|
|
987
972
|
if (res_error) {
|
|
988
973
|
Logger({
|
|
989
974
|
level: "WARN",
|
|
990
|
-
message: "Response Validation Warnnings for
|
|
975
|
+
message: "Response Validation Warnnings for getThemeLibrary",
|
|
991
976
|
});
|
|
992
977
|
Logger({ level: "WARN", message: res_error });
|
|
993
978
|
}
|
|
@@ -997,17 +982,15 @@ class Theme {
|
|
|
997
982
|
|
|
998
983
|
/**
|
|
999
984
|
* @param {Object} arg - Arg object.
|
|
1000
|
-
* @param {string} arg.themeId - ID
|
|
1001
|
-
* @
|
|
1002
|
-
* @
|
|
1003
|
-
* @
|
|
1004
|
-
* @description: Use this API to edit an existing theme. You can customize the website font, sections, images, styles, and many more.
|
|
985
|
+
* @param {string} arg.themeId - Theme ID
|
|
986
|
+
* @returns {Promise<UpgradableThemeSchema>} - Success response
|
|
987
|
+
* @summary: Checks if theme is upgradable
|
|
988
|
+
* @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.
|
|
1005
989
|
*/
|
|
1006
|
-
async
|
|
1007
|
-
const { error } = ThemeValidator.
|
|
990
|
+
async isUpgradable({ themeId } = {}) {
|
|
991
|
+
const { error } = ThemeValidator.isUpgradable().validate(
|
|
1008
992
|
{
|
|
1009
993
|
themeId,
|
|
1010
|
-
body,
|
|
1011
994
|
},
|
|
1012
995
|
{ abortEarly: false, allowUnknown: true }
|
|
1013
996
|
);
|
|
@@ -1016,17 +999,16 @@ class Theme {
|
|
|
1016
999
|
}
|
|
1017
1000
|
|
|
1018
1001
|
// Showing warrnings if extra unknown parameters are found
|
|
1019
|
-
const { error: warrning } = ThemeValidator.
|
|
1002
|
+
const { error: warrning } = ThemeValidator.isUpgradable().validate(
|
|
1020
1003
|
{
|
|
1021
1004
|
themeId,
|
|
1022
|
-
body,
|
|
1023
1005
|
},
|
|
1024
1006
|
{ abortEarly: false, allowUnknown: false }
|
|
1025
1007
|
);
|
|
1026
1008
|
if (warrning) {
|
|
1027
1009
|
Logger({
|
|
1028
1010
|
level: "WARN",
|
|
1029
|
-
message: "Parameter Validation warrnings for
|
|
1011
|
+
message: "Parameter Validation warrnings for isUpgradable",
|
|
1030
1012
|
});
|
|
1031
1013
|
Logger({ level: "WARN", message: warrning });
|
|
1032
1014
|
}
|
|
@@ -1035,13 +1017,15 @@ class Theme {
|
|
|
1035
1017
|
|
|
1036
1018
|
const response = await PlatformAPIClient.execute(
|
|
1037
1019
|
this.config,
|
|
1038
|
-
"
|
|
1039
|
-
`/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}`,
|
|
1020
|
+
"get",
|
|
1021
|
+
`/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/upgradable`,
|
|
1040
1022
|
query_params,
|
|
1041
|
-
|
|
1023
|
+
undefined
|
|
1042
1024
|
);
|
|
1043
1025
|
|
|
1044
|
-
const {
|
|
1026
|
+
const {
|
|
1027
|
+
error: res_error,
|
|
1028
|
+
} = ThemeModel.UpgradableThemeSchema().validate(response, {
|
|
1045
1029
|
abortEarly: false,
|
|
1046
1030
|
allowUnknown: false,
|
|
1047
1031
|
});
|
|
@@ -1049,7 +1033,7 @@ class Theme {
|
|
|
1049
1033
|
if (res_error) {
|
|
1050
1034
|
Logger({
|
|
1051
1035
|
level: "WARN",
|
|
1052
|
-
message: "Response Validation Warnnings for
|
|
1036
|
+
message: "Response Validation Warnnings for isUpgradable",
|
|
1053
1037
|
});
|
|
1054
1038
|
Logger({ level: "WARN", message: res_error });
|
|
1055
1039
|
}
|
|
@@ -1061,11 +1045,11 @@ class Theme {
|
|
|
1061
1045
|
* @param {Object} arg - Arg object.
|
|
1062
1046
|
* @param {string} arg.themeId - ID allotted to the theme.
|
|
1063
1047
|
* @returns {Promise<ThemesSchema>} - Success response
|
|
1064
|
-
* @summary:
|
|
1065
|
-
* @description: Use this API to
|
|
1048
|
+
* @summary: Publish a theme
|
|
1049
|
+
* @description: Use this API to publish a theme that is either newly created or edited.
|
|
1066
1050
|
*/
|
|
1067
|
-
async
|
|
1068
|
-
const { error } = ThemeValidator.
|
|
1051
|
+
async publishTheme({ themeId } = {}) {
|
|
1052
|
+
const { error } = ThemeValidator.publishTheme().validate(
|
|
1069
1053
|
{
|
|
1070
1054
|
themeId,
|
|
1071
1055
|
},
|
|
@@ -1076,7 +1060,7 @@ class Theme {
|
|
|
1076
1060
|
}
|
|
1077
1061
|
|
|
1078
1062
|
// Showing warrnings if extra unknown parameters are found
|
|
1079
|
-
const { error: warrning } = ThemeValidator.
|
|
1063
|
+
const { error: warrning } = ThemeValidator.publishTheme().validate(
|
|
1080
1064
|
{
|
|
1081
1065
|
themeId,
|
|
1082
1066
|
},
|
|
@@ -1085,7 +1069,7 @@ class Theme {
|
|
|
1085
1069
|
if (warrning) {
|
|
1086
1070
|
Logger({
|
|
1087
1071
|
level: "WARN",
|
|
1088
|
-
message: "Parameter Validation warrnings for
|
|
1072
|
+
message: "Parameter Validation warrnings for publishTheme",
|
|
1089
1073
|
});
|
|
1090
1074
|
Logger({ level: "WARN", message: warrning });
|
|
1091
1075
|
}
|
|
@@ -1094,8 +1078,8 @@ class Theme {
|
|
|
1094
1078
|
|
|
1095
1079
|
const response = await PlatformAPIClient.execute(
|
|
1096
1080
|
this.config,
|
|
1097
|
-
"
|
|
1098
|
-
`/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}`,
|
|
1081
|
+
"put",
|
|
1082
|
+
`/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/publish`,
|
|
1099
1083
|
query_params,
|
|
1100
1084
|
undefined
|
|
1101
1085
|
);
|
|
@@ -1108,7 +1092,7 @@ class Theme {
|
|
|
1108
1092
|
if (res_error) {
|
|
1109
1093
|
Logger({
|
|
1110
1094
|
level: "WARN",
|
|
1111
|
-
message: "Response Validation Warnnings for
|
|
1095
|
+
message: "Response Validation Warnnings for publishTheme",
|
|
1112
1096
|
});
|
|
1113
1097
|
Logger({ level: "WARN", message: res_error });
|
|
1114
1098
|
}
|
|
@@ -1120,11 +1104,11 @@ class Theme {
|
|
|
1120
1104
|
* @param {Object} arg - Arg object.
|
|
1121
1105
|
* @param {string} arg.themeId - ID allotted to the theme.
|
|
1122
1106
|
* @returns {Promise<ThemesSchema>} - Success response
|
|
1123
|
-
* @summary:
|
|
1124
|
-
* @description:
|
|
1107
|
+
* @summary: Unarchive a theme
|
|
1108
|
+
* @description: Use this API to restore an archived theme and bring it back for editing or publishing.
|
|
1125
1109
|
*/
|
|
1126
|
-
async
|
|
1127
|
-
const { error } = ThemeValidator.
|
|
1110
|
+
async unarchiveTheme({ themeId } = {}) {
|
|
1111
|
+
const { error } = ThemeValidator.unarchiveTheme().validate(
|
|
1128
1112
|
{
|
|
1129
1113
|
themeId,
|
|
1130
1114
|
},
|
|
@@ -1135,7 +1119,7 @@ class Theme {
|
|
|
1135
1119
|
}
|
|
1136
1120
|
|
|
1137
1121
|
// Showing warrnings if extra unknown parameters are found
|
|
1138
|
-
const { error: warrning } = ThemeValidator.
|
|
1122
|
+
const { error: warrning } = ThemeValidator.unarchiveTheme().validate(
|
|
1139
1123
|
{
|
|
1140
1124
|
themeId,
|
|
1141
1125
|
},
|
|
@@ -1144,7 +1128,7 @@ class Theme {
|
|
|
1144
1128
|
if (warrning) {
|
|
1145
1129
|
Logger({
|
|
1146
1130
|
level: "WARN",
|
|
1147
|
-
message: "Parameter Validation warrnings for
|
|
1131
|
+
message: "Parameter Validation warrnings for unarchiveTheme",
|
|
1148
1132
|
});
|
|
1149
1133
|
Logger({ level: "WARN", message: warrning });
|
|
1150
1134
|
}
|
|
@@ -1153,8 +1137,8 @@ class Theme {
|
|
|
1153
1137
|
|
|
1154
1138
|
const response = await PlatformAPIClient.execute(
|
|
1155
1139
|
this.config,
|
|
1156
|
-
"
|
|
1157
|
-
`/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/
|
|
1140
|
+
"put",
|
|
1141
|
+
`/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/unarchive`,
|
|
1158
1142
|
query_params,
|
|
1159
1143
|
undefined
|
|
1160
1144
|
);
|
|
@@ -1167,7 +1151,7 @@ class Theme {
|
|
|
1167
1151
|
if (res_error) {
|
|
1168
1152
|
Logger({
|
|
1169
1153
|
level: "WARN",
|
|
1170
|
-
message: "Response Validation Warnnings for
|
|
1154
|
+
message: "Response Validation Warnnings for unarchiveTheme",
|
|
1171
1155
|
});
|
|
1172
1156
|
Logger({ level: "WARN", message: res_error });
|
|
1173
1157
|
}
|
|
@@ -1179,11 +1163,11 @@ class Theme {
|
|
|
1179
1163
|
* @param {Object} arg - Arg object.
|
|
1180
1164
|
* @param {string} arg.themeId - ID allotted to the theme.
|
|
1181
1165
|
* @returns {Promise<ThemesSchema>} - Success response
|
|
1182
|
-
* @summary:
|
|
1183
|
-
* @description: Use this API to
|
|
1166
|
+
* @summary: Unpublish a theme
|
|
1167
|
+
* @description: Use this API to remove an existing theme from the list of available themes.
|
|
1184
1168
|
*/
|
|
1185
|
-
async
|
|
1186
|
-
const { error } = ThemeValidator.
|
|
1169
|
+
async unpublishTheme({ themeId } = {}) {
|
|
1170
|
+
const { error } = ThemeValidator.unpublishTheme().validate(
|
|
1187
1171
|
{
|
|
1188
1172
|
themeId,
|
|
1189
1173
|
},
|
|
@@ -1194,7 +1178,7 @@ class Theme {
|
|
|
1194
1178
|
}
|
|
1195
1179
|
|
|
1196
1180
|
// Showing warrnings if extra unknown parameters are found
|
|
1197
|
-
const { error: warrning } = ThemeValidator.
|
|
1181
|
+
const { error: warrning } = ThemeValidator.unpublishTheme().validate(
|
|
1198
1182
|
{
|
|
1199
1183
|
themeId,
|
|
1200
1184
|
},
|
|
@@ -1203,7 +1187,7 @@ class Theme {
|
|
|
1203
1187
|
if (warrning) {
|
|
1204
1188
|
Logger({
|
|
1205
1189
|
level: "WARN",
|
|
1206
|
-
message: "Parameter Validation warrnings for
|
|
1190
|
+
message: "Parameter Validation warrnings for unpublishTheme",
|
|
1207
1191
|
});
|
|
1208
1192
|
Logger({ level: "WARN", message: warrning });
|
|
1209
1193
|
}
|
|
@@ -1213,7 +1197,7 @@ class Theme {
|
|
|
1213
1197
|
const response = await PlatformAPIClient.execute(
|
|
1214
1198
|
this.config,
|
|
1215
1199
|
"put",
|
|
1216
|
-
`/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/
|
|
1200
|
+
`/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/unpublish`,
|
|
1217
1201
|
query_params,
|
|
1218
1202
|
undefined
|
|
1219
1203
|
);
|
|
@@ -1226,7 +1210,7 @@ class Theme {
|
|
|
1226
1210
|
if (res_error) {
|
|
1227
1211
|
Logger({
|
|
1228
1212
|
level: "WARN",
|
|
1229
|
-
message: "Response Validation Warnnings for
|
|
1213
|
+
message: "Response Validation Warnnings for unpublishTheme",
|
|
1230
1214
|
});
|
|
1231
1215
|
Logger({ level: "WARN", message: res_error });
|
|
1232
1216
|
}
|
|
@@ -1236,15 +1220,17 @@ class Theme {
|
|
|
1236
1220
|
|
|
1237
1221
|
/**
|
|
1238
1222
|
* @param {Object} arg - Arg object.
|
|
1239
|
-
* @param {string} arg.themeId - ID
|
|
1240
|
-
* @
|
|
1241
|
-
* @
|
|
1242
|
-
* @
|
|
1223
|
+
* @param {string} arg.themeId - ID of the theme to be retrieved
|
|
1224
|
+
* @param {AllAvailablePageSchema} arg.body
|
|
1225
|
+
* @returns {Promise<AllAvailablePageSchema>} - Success response
|
|
1226
|
+
* @summary: Update multiple pages of a theme
|
|
1227
|
+
* @description: Use this API to update multiple pages of a theme by its ID.
|
|
1243
1228
|
*/
|
|
1244
|
-
async
|
|
1245
|
-
const { error } = ThemeValidator.
|
|
1229
|
+
async updateMultiplePages({ themeId, body } = {}) {
|
|
1230
|
+
const { error } = ThemeValidator.updateMultiplePages().validate(
|
|
1246
1231
|
{
|
|
1247
1232
|
themeId,
|
|
1233
|
+
body,
|
|
1248
1234
|
},
|
|
1249
1235
|
{ abortEarly: false, allowUnknown: true }
|
|
1250
1236
|
);
|
|
@@ -1253,16 +1239,17 @@ class Theme {
|
|
|
1253
1239
|
}
|
|
1254
1240
|
|
|
1255
1241
|
// Showing warrnings if extra unknown parameters are found
|
|
1256
|
-
const { error: warrning } = ThemeValidator.
|
|
1242
|
+
const { error: warrning } = ThemeValidator.updateMultiplePages().validate(
|
|
1257
1243
|
{
|
|
1258
1244
|
themeId,
|
|
1245
|
+
body,
|
|
1259
1246
|
},
|
|
1260
1247
|
{ abortEarly: false, allowUnknown: false }
|
|
1261
1248
|
);
|
|
1262
1249
|
if (warrning) {
|
|
1263
1250
|
Logger({
|
|
1264
1251
|
level: "WARN",
|
|
1265
|
-
message: "Parameter Validation warrnings for
|
|
1252
|
+
message: "Parameter Validation warrnings for updateMultiplePages",
|
|
1266
1253
|
});
|
|
1267
1254
|
Logger({ level: "WARN", message: warrning });
|
|
1268
1255
|
}
|
|
@@ -1272,12 +1259,14 @@ class Theme {
|
|
|
1272
1259
|
const response = await PlatformAPIClient.execute(
|
|
1273
1260
|
this.config,
|
|
1274
1261
|
"put",
|
|
1275
|
-
`/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/
|
|
1262
|
+
`/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/page`,
|
|
1276
1263
|
query_params,
|
|
1277
|
-
|
|
1264
|
+
body
|
|
1278
1265
|
);
|
|
1279
1266
|
|
|
1280
|
-
const {
|
|
1267
|
+
const {
|
|
1268
|
+
error: res_error,
|
|
1269
|
+
} = ThemeModel.AllAvailablePageSchema().validate(response, {
|
|
1281
1270
|
abortEarly: false,
|
|
1282
1271
|
allowUnknown: false,
|
|
1283
1272
|
});
|
|
@@ -1285,7 +1274,7 @@ class Theme {
|
|
|
1285
1274
|
if (res_error) {
|
|
1286
1275
|
Logger({
|
|
1287
1276
|
level: "WARN",
|
|
1288
|
-
message: "Response Validation Warnnings for
|
|
1277
|
+
message: "Response Validation Warnnings for updateMultiplePages",
|
|
1289
1278
|
});
|
|
1290
1279
|
Logger({ level: "WARN", message: res_error });
|
|
1291
1280
|
}
|
|
@@ -1295,15 +1284,19 @@ class Theme {
|
|
|
1295
1284
|
|
|
1296
1285
|
/**
|
|
1297
1286
|
* @param {Object} arg - Arg object.
|
|
1298
|
-
* @param {string} arg.themeId - ID
|
|
1299
|
-
* @
|
|
1300
|
-
* @
|
|
1301
|
-
* @
|
|
1287
|
+
* @param {string} arg.themeId - ID of the theme
|
|
1288
|
+
* @param {string} arg.pageValue - Value of the page to be updated
|
|
1289
|
+
* @param {AvailablePageSchema} arg.body
|
|
1290
|
+
* @returns {Promise<AvailablePageSchema>} - Success response
|
|
1291
|
+
* @summary: Updates a page
|
|
1292
|
+
* @description: Use this API to update a page for a theme by its ID.
|
|
1302
1293
|
*/
|
|
1303
|
-
async
|
|
1304
|
-
const { error } = ThemeValidator.
|
|
1294
|
+
async updatePage({ themeId, pageValue, body } = {}) {
|
|
1295
|
+
const { error } = ThemeValidator.updatePage().validate(
|
|
1305
1296
|
{
|
|
1306
1297
|
themeId,
|
|
1298
|
+
pageValue,
|
|
1299
|
+
body,
|
|
1307
1300
|
},
|
|
1308
1301
|
{ abortEarly: false, allowUnknown: true }
|
|
1309
1302
|
);
|
|
@@ -1312,16 +1305,18 @@ class Theme {
|
|
|
1312
1305
|
}
|
|
1313
1306
|
|
|
1314
1307
|
// Showing warrnings if extra unknown parameters are found
|
|
1315
|
-
const { error: warrning } = ThemeValidator.
|
|
1308
|
+
const { error: warrning } = ThemeValidator.updatePage().validate(
|
|
1316
1309
|
{
|
|
1317
1310
|
themeId,
|
|
1311
|
+
pageValue,
|
|
1312
|
+
body,
|
|
1318
1313
|
},
|
|
1319
1314
|
{ abortEarly: false, allowUnknown: false }
|
|
1320
1315
|
);
|
|
1321
1316
|
if (warrning) {
|
|
1322
1317
|
Logger({
|
|
1323
1318
|
level: "WARN",
|
|
1324
|
-
message: "Parameter Validation warrnings for
|
|
1319
|
+
message: "Parameter Validation warrnings for updatePage",
|
|
1325
1320
|
});
|
|
1326
1321
|
Logger({ level: "WARN", message: warrning });
|
|
1327
1322
|
}
|
|
@@ -1331,12 +1326,14 @@ class Theme {
|
|
|
1331
1326
|
const response = await PlatformAPIClient.execute(
|
|
1332
1327
|
this.config,
|
|
1333
1328
|
"put",
|
|
1334
|
-
`/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}
|
|
1329
|
+
`/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/${pageValue}`,
|
|
1335
1330
|
query_params,
|
|
1336
|
-
|
|
1331
|
+
body
|
|
1337
1332
|
);
|
|
1338
1333
|
|
|
1339
|
-
const {
|
|
1334
|
+
const {
|
|
1335
|
+
error: res_error,
|
|
1336
|
+
} = ThemeModel.AvailablePageSchema().validate(response, {
|
|
1340
1337
|
abortEarly: false,
|
|
1341
1338
|
allowUnknown: false,
|
|
1342
1339
|
});
|
|
@@ -1344,7 +1341,7 @@ class Theme {
|
|
|
1344
1341
|
if (res_error) {
|
|
1345
1342
|
Logger({
|
|
1346
1343
|
level: "WARN",
|
|
1347
|
-
message: "Response Validation Warnnings for
|
|
1344
|
+
message: "Response Validation Warnnings for updatePage",
|
|
1348
1345
|
});
|
|
1349
1346
|
Logger({ level: "WARN", message: res_error });
|
|
1350
1347
|
}
|
|
@@ -1355,14 +1352,16 @@ class Theme {
|
|
|
1355
1352
|
/**
|
|
1356
1353
|
* @param {Object} arg - Arg object.
|
|
1357
1354
|
* @param {string} arg.themeId - ID allotted to the theme.
|
|
1355
|
+
* @param {ThemesSchema} arg.body
|
|
1358
1356
|
* @returns {Promise<ThemesSchema>} - Success response
|
|
1359
|
-
* @summary:
|
|
1360
|
-
* @description: Use this API to
|
|
1357
|
+
* @summary: Update a theme
|
|
1358
|
+
* @description: Use this API to edit an existing theme. You can customize the website font, sections, images, styles, and many more.
|
|
1361
1359
|
*/
|
|
1362
|
-
async
|
|
1363
|
-
const { error } = ThemeValidator.
|
|
1360
|
+
async updateTheme({ themeId, body } = {}) {
|
|
1361
|
+
const { error } = ThemeValidator.updateTheme().validate(
|
|
1364
1362
|
{
|
|
1365
1363
|
themeId,
|
|
1364
|
+
body,
|
|
1366
1365
|
},
|
|
1367
1366
|
{ abortEarly: false, allowUnknown: true }
|
|
1368
1367
|
);
|
|
@@ -1371,16 +1370,17 @@ class Theme {
|
|
|
1371
1370
|
}
|
|
1372
1371
|
|
|
1373
1372
|
// Showing warrnings if extra unknown parameters are found
|
|
1374
|
-
const { error: warrning } = ThemeValidator.
|
|
1373
|
+
const { error: warrning } = ThemeValidator.updateTheme().validate(
|
|
1375
1374
|
{
|
|
1376
1375
|
themeId,
|
|
1376
|
+
body,
|
|
1377
1377
|
},
|
|
1378
1378
|
{ abortEarly: false, allowUnknown: false }
|
|
1379
1379
|
);
|
|
1380
1380
|
if (warrning) {
|
|
1381
1381
|
Logger({
|
|
1382
1382
|
level: "WARN",
|
|
1383
|
-
message: "Parameter Validation warrnings for
|
|
1383
|
+
message: "Parameter Validation warrnings for updateTheme",
|
|
1384
1384
|
});
|
|
1385
1385
|
Logger({ level: "WARN", message: warrning });
|
|
1386
1386
|
}
|
|
@@ -1390,9 +1390,9 @@ class Theme {
|
|
|
1390
1390
|
const response = await PlatformAPIClient.execute(
|
|
1391
1391
|
this.config,
|
|
1392
1392
|
"put",
|
|
1393
|
-
`/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}
|
|
1393
|
+
`/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}`,
|
|
1394
1394
|
query_params,
|
|
1395
|
-
|
|
1395
|
+
body
|
|
1396
1396
|
);
|
|
1397
1397
|
|
|
1398
1398
|
const { error: res_error } = ThemeModel.ThemesSchema().validate(response, {
|
|
@@ -1403,7 +1403,7 @@ class Theme {
|
|
|
1403
1403
|
if (res_error) {
|
|
1404
1404
|
Logger({
|
|
1405
1405
|
level: "WARN",
|
|
1406
|
-
message: "Response Validation Warnnings for
|
|
1406
|
+
message: "Response Validation Warnnings for updateTheme",
|
|
1407
1407
|
});
|
|
1408
1408
|
Logger({ level: "WARN", message: res_error });
|
|
1409
1409
|
}
|
|
@@ -1414,12 +1414,12 @@ class Theme {
|
|
|
1414
1414
|
/**
|
|
1415
1415
|
* @param {Object} arg - Arg object.
|
|
1416
1416
|
* @param {string} arg.themeId - ID allotted to the theme.
|
|
1417
|
-
* @returns {Promise<
|
|
1418
|
-
* @summary:
|
|
1419
|
-
* @description: Use this API to
|
|
1417
|
+
* @returns {Promise<ThemesSchema>} - Success response
|
|
1418
|
+
* @summary: Upgrade a theme
|
|
1419
|
+
* @description: Use this API to upgrade the current theme to its latest version.
|
|
1420
1420
|
*/
|
|
1421
|
-
async
|
|
1422
|
-
const { error } = ThemeValidator.
|
|
1421
|
+
async upgradeTheme({ themeId } = {}) {
|
|
1422
|
+
const { error } = ThemeValidator.upgradeTheme().validate(
|
|
1423
1423
|
{
|
|
1424
1424
|
themeId,
|
|
1425
1425
|
},
|
|
@@ -1430,7 +1430,7 @@ class Theme {
|
|
|
1430
1430
|
}
|
|
1431
1431
|
|
|
1432
1432
|
// Showing warrnings if extra unknown parameters are found
|
|
1433
|
-
const { error: warrning } = ThemeValidator.
|
|
1433
|
+
const { error: warrning } = ThemeValidator.upgradeTheme().validate(
|
|
1434
1434
|
{
|
|
1435
1435
|
themeId,
|
|
1436
1436
|
},
|
|
@@ -1439,7 +1439,7 @@ class Theme {
|
|
|
1439
1439
|
if (warrning) {
|
|
1440
1440
|
Logger({
|
|
1441
1441
|
level: "WARN",
|
|
1442
|
-
message: "Parameter Validation warrnings for
|
|
1442
|
+
message: "Parameter Validation warrnings for upgradeTheme",
|
|
1443
1443
|
});
|
|
1444
1444
|
Logger({ level: "WARN", message: warrning });
|
|
1445
1445
|
}
|
|
@@ -1448,20 +1448,21 @@ class Theme {
|
|
|
1448
1448
|
|
|
1449
1449
|
const response = await PlatformAPIClient.execute(
|
|
1450
1450
|
this.config,
|
|
1451
|
-
"
|
|
1452
|
-
`/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/
|
|
1451
|
+
"put",
|
|
1452
|
+
`/service/platform/theme/v1.0/company/${this.config.companyId}/application/${this.applicationId}/${themeId}/upgrade`,
|
|
1453
1453
|
query_params,
|
|
1454
1454
|
undefined
|
|
1455
1455
|
);
|
|
1456
1456
|
|
|
1457
|
-
const { error: res_error } =
|
|
1458
|
-
|
|
1459
|
-
|
|
1457
|
+
const { error: res_error } = ThemeModel.ThemesSchema().validate(response, {
|
|
1458
|
+
abortEarly: false,
|
|
1459
|
+
allowUnknown: false,
|
|
1460
|
+
});
|
|
1460
1461
|
|
|
1461
1462
|
if (res_error) {
|
|
1462
1463
|
Logger({
|
|
1463
1464
|
level: "WARN",
|
|
1464
|
-
message: "Response Validation Warnnings for
|
|
1465
|
+
message: "Response Validation Warnnings for upgradeTheme",
|
|
1465
1466
|
});
|
|
1466
1467
|
Logger({ level: "WARN", message: res_error });
|
|
1467
1468
|
}
|
|
@@ -1469,4 +1470,5 @@ class Theme {
|
|
|
1469
1470
|
return response;
|
|
1470
1471
|
}
|
|
1471
1472
|
}
|
|
1473
|
+
|
|
1472
1474
|
module.exports = Theme;
|