@gofynd/fdk-client-javascript 1.0.1 → 1.0.3
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/documentation/application/CART.md +5934 -4502
- package/documentation/application/CATALOG.md +6338 -7245
- package/documentation/application/COMMON.md +95 -222
- package/documentation/application/COMMUNICATION.md +106 -186
- package/documentation/application/CONFIGURATION.md +903 -1597
- package/documentation/application/CONTENT.md +562 -1270
- package/documentation/application/FILESTORAGE.md +84 -220
- package/documentation/application/LEAD.md +314 -660
- package/documentation/application/LOGISTIC.md +229 -305
- package/documentation/application/ORDER.md +642 -1137
- package/documentation/application/PAYMENT.md +2285 -3031
- package/documentation/application/POSCART.md +6079 -4642
- package/documentation/application/REWARDS.md +94 -248
- package/documentation/application/SHARE.md +152 -250
- package/documentation/application/THEME.md +952 -1235
- package/documentation/application/USER.md +1228 -1765
- package/documentation/platform/ANALYTICS.md +207 -349
- package/documentation/platform/AUDITTRAIL.md +121 -204
- package/documentation/platform/BILLING.md +865 -1376
- package/documentation/platform/CART.md +2814 -3662
- package/documentation/platform/CATALOG.md +15266 -17619
- package/documentation/platform/COMMON.md +95 -222
- package/documentation/platform/COMMUNICATION.md +1632 -2380
- package/documentation/platform/COMPANYPROFILE.md +572 -957
- package/documentation/platform/CONFIGURATION.md +3050 -4073
- package/documentation/platform/CONTENT.md +3509 -4121
- package/documentation/platform/DISCOUNT.md +140 -236
- package/documentation/platform/FILESTORAGE.md +187 -323
- package/documentation/platform/INVENTORY.md +268 -911
- package/documentation/platform/LEAD.md +2195 -2541
- package/documentation/platform/ORDER.md +3750 -5636
- package/documentation/platform/PARTNER.md +9 -36
- package/documentation/platform/PAYMENT.md +903 -1213
- package/documentation/platform/REWARDS.md +183 -347
- package/documentation/platform/SHARE.md +120 -213
- package/documentation/platform/THEME.md +12956 -13239
- package/documentation/platform/USER.md +975 -1120
- package/documentation/platform/WEBHOOK.md +78 -184
- package/documentation/public/CONFIGURATION.md +95 -222
- package/documentation/public/INVENTORY.md +100 -282
- package/documentation/public/WEBHOOK.md +27 -133
- package/package.json +1 -1
- package/sdk/application/ApplicationConfig.js +1 -1
- package/sdk/application/Cart/CartApplicationClient.d.ts +243 -243
- package/sdk/application/Cart/CartApplicationClient.js +1058 -547
- package/sdk/application/Cart/CartApplicationModel.d.ts +64 -63
- package/sdk/application/Cart/CartApplicationModel.js +489 -886
- 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 +1545 -949
- package/sdk/application/Catalog/CatalogApplicationModel.d.ts +90 -90
- package/sdk/application/Catalog/CatalogApplicationModel.js +692 -1258
- 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 +76 -36
- 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 +92 -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 +638 -312
- 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 +581 -213
- package/sdk/application/Content/ContentApplicationModel.d.ts +76 -75
- package/sdk/application/Content/ContentApplicationModel.js +468 -875
- 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 +121 -59
- 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 +230 -96
- 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 +30 -19
- package/sdk/application/Logistic/LogisticApplicationClient.js +196 -47
- 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 -8
- package/sdk/application/Order/OrderApplicationClient.d.ts +86 -86
- package/sdk/application/Order/OrderApplicationClient.js +448 -215
- package/sdk/application/Order/OrderApplicationModel.d.ts +50 -50
- package/sdk/application/Order/OrderApplicationModel.js +357 -661
- 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 +1525 -750
- package/sdk/application/Payment/PaymentApplicationModel.d.ts +72 -72
- package/sdk/application/Payment/PaymentApplicationModel.js +565 -1033
- 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 +1137 -606
- package/sdk/application/PosCart/PosCartApplicationModel.d.ts +61 -60
- package/sdk/application/PosCart/PosCartApplicationModel.js +477 -873
- 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 +253 -113
- 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 +221 -96
- 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 +115 -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 +1201 -543
- 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 +1 -1
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.d.ts +55 -47
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.js +308 -151
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.d.ts +6 -6
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.js +20 -20
- package/sdk/platform/Analytics/AnalyticsPlatformClient.d.ts +8 -4
- package/sdk/platform/Analytics/AnalyticsPlatformClient.js +103 -16
- package/sdk/platform/Analytics/AnalyticsPlatformModel.d.ts +11 -11
- package/sdk/platform/Analytics/AnalyticsPlatformModel.js +95 -178
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.d.ts +16 -12
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +131 -44
- 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 +6 -6
- package/sdk/platform/Billing/BillingPlatformClient.d.ts +68 -56
- package/sdk/platform/Billing/BillingPlatformClient.js +416 -171
- 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 +25 -25
- package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +176 -159
- package/sdk/platform/Cart/CartPlatformApplicationClient.js +837 -500
- package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +11 -11
- package/sdk/platform/Cart/CartPlatformApplicationValidator.js +63 -63
- package/sdk/platform/Cart/CartPlatformModel.d.ts +86 -85
- package/sdk/platform/Cart/CartPlatformModel.js +677 -1211
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +582 -529
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +2642 -1533
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +40 -40
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +175 -175
- package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +708 -590
- package/sdk/platform/Catalog/CatalogPlatformClient.js +3103 -1362
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +293 -284
- package/sdk/platform/Catalog/CatalogPlatformModel.js +2149 -3660
- package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +66 -64
- package/sdk/platform/Catalog/CatalogPlatformValidator.js +235 -216
- package/sdk/platform/Common/CommonPlatformClient.d.ts +14 -12
- package/sdk/platform/Common/CommonPlatformClient.js +80 -37
- 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 +6 -6
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +333 -293
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +1687 -855
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.d.ts +30 -30
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.js +87 -87
- package/sdk/platform/Communication/CommunicationPlatformClient.d.ts +2 -1
- package/sdk/platform/Communication/CommunicationPlatformClient.js +28 -4
- package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +67 -67
- package/sdk/platform/Communication/CommunicationPlatformModel.js +522 -974
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +70 -57
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +463 -182
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +28 -28
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +294 -557
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.d.ts +7 -7
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.js +24 -24
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +175 -137
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +1168 -521
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.d.ts +22 -21
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.js +69 -63
- package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +137 -119
- package/sdk/platform/Configuration/ConfigurationPlatformClient.js +691 -316
- 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 +38 -38
- package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +542 -461
- package/sdk/platform/Content/ContentPlatformApplicationClient.js +2600 -1160
- package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +50 -49
- package/sdk/platform/Content/ContentPlatformApplicationValidator.js +159 -152
- package/sdk/platform/Content/ContentPlatformModel.d.ts +79 -75
- package/sdk/platform/Content/ContentPlatformModel.js +486 -867
- package/sdk/platform/Discount/DiscountPlatformClient.d.ts +72 -61
- package/sdk/platform/Discount/DiscountPlatformClient.js +424 -198
- 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 +29 -29
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +26 -22
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +145 -59
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.d.ts +1 -1
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.js +8 -8
- package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +58 -52
- package/sdk/platform/FileStorage/FileStoragePlatformClient.js +240 -114
- 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 +11 -11
- package/sdk/platform/Inventory/InventoryPlatformClient.d.ts +76 -63
- package/sdk/platform/Inventory/InventoryPlatformClient.js +461 -197
- 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 +28 -28
- package/sdk/platform/Lead/LeadPlatformApplicationClient.d.ts +84 -71
- package/sdk/platform/Lead/LeadPlatformApplicationClient.js +441 -182
- package/sdk/platform/Lead/LeadPlatformApplicationValidator.d.ts +7 -7
- package/sdk/platform/Lead/LeadPlatformApplicationValidator.js +28 -28
- package/sdk/platform/Lead/LeadPlatformClient.d.ts +86 -75
- package/sdk/platform/Lead/LeadPlatformClient.js +434 -212
- 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 +24 -24
- package/sdk/platform/OAuthClient.js +8 -8
- package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +14 -11
- package/sdk/platform/Order/OrderPlatformApplicationClient.js +113 -49
- package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +1 -1
- package/sdk/platform/Order/OrderPlatformApplicationValidator.js +6 -6
- package/sdk/platform/Order/OrderPlatformClient.d.ts +367 -315
- package/sdk/platform/Order/OrderPlatformClient.js +1775 -893
- package/sdk/platform/Order/OrderPlatformModel.d.ts +198 -192
- package/sdk/platform/Order/OrderPlatformModel.js +1591 -2822
- package/sdk/platform/Order/OrderPlatformValidator.d.ts +32 -32
- package/sdk/platform/Order/OrderPlatformValidator.js +160 -155
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.d.ts +4 -2
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.js +52 -8
- package/sdk/platform/Partner/PartnerPlatformModel.js +6 -22
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +65 -54
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +395 -164
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +6 -6
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +23 -23
- package/sdk/platform/Payment/PaymentPlatformClient.d.ts +55 -45
- package/sdk/platform/Payment/PaymentPlatformClient.js +362 -147
- package/sdk/platform/Payment/PaymentPlatformModel.d.ts +27 -27
- package/sdk/platform/Payment/PaymentPlatformModel.js +220 -408
- package/sdk/platform/Payment/PaymentPlatformValidator.d.ts +4 -4
- package/sdk/platform/Payment/PaymentPlatformValidator.js +21 -21
- package/sdk/platform/PlatformApplicationClient.d.ts +1496 -10153
- package/sdk/platform/PlatformApplicationClient.js +1584 -13691
- package/sdk/platform/PlatformClient.d.ts +7918 -7666
- package/sdk/platform/PlatformClient.js +8701 -9926
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.d.ts +91 -78
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +507 -253
- package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.d.ts +8 -8
- package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.js +34 -34
- package/sdk/platform/Rewards/RewardsPlatformModel.d.ts +15 -15
- package/sdk/platform/Rewards/RewardsPlatformModel.js +92 -194
- package/sdk/platform/Share/SharePlatformApplicationClient.d.ts +16 -12
- package/sdk/platform/Share/SharePlatformApplicationClient.js +130 -52
- package/sdk/platform/Share/SharePlatformApplicationValidator.d.ts +1 -1
- package/sdk/platform/Share/SharePlatformApplicationValidator.js +6 -6
- package/sdk/platform/Share/SharePlatformModel.d.ts +8 -8
- package/sdk/platform/Share/SharePlatformModel.js +60 -118
- package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +148 -124
- package/sdk/platform/Theme/ThemePlatformApplicationClient.js +770 -295
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.d.ts +15 -15
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.js +44 -44
- package/sdk/platform/Theme/ThemePlatformModel.d.ts +34 -34
- package/sdk/platform/Theme/ThemePlatformModel.js +190 -336
- package/sdk/platform/User/UserPlatformApplicationClient.d.ts +146 -67
- package/sdk/platform/User/UserPlatformApplicationClient.js +742 -155
- package/sdk/platform/User/UserPlatformApplicationValidator.d.ts +12 -7
- package/sdk/platform/User/UserPlatformApplicationValidator.js +61 -23
- package/sdk/platform/User/UserPlatformModel.d.ts +79 -72
- package/sdk/platform/User/UserPlatformModel.js +440 -689
- package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +35 -29
- package/sdk/platform/Webhook/WebhookPlatformClient.js +218 -91
- 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 +14 -14
- package/sdk/public/Configuration/ConfigurationPublicClient.d.ts +13 -13
- package/sdk/public/Configuration/ConfigurationPublicClient.js +81 -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 +228 -105
- 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 +51 -10
- package/sdk/public/Webhook/WebhookPublicModel.d.ts +7 -7
- package/sdk/public/Webhook/WebhookPublicModel.js +68 -136
- package/tests/application/catalog.spec.js +7 -0
|
@@ -1,177 +1,117 @@
|
|
|
1
1
|
const Joi = require("joi");
|
|
2
2
|
|
|
3
3
|
class ShareModel {
|
|
4
|
-
static
|
|
4
|
+
static Attribution() {
|
|
5
5
|
return Joi.object({
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
svg: Joi.string().allow(""),
|
|
6
|
+
campaign_cookie_expiry: Joi.string().allow(""),
|
|
9
7
|
});
|
|
10
8
|
}
|
|
11
|
-
|
|
12
|
-
static RedirectDevice() {
|
|
9
|
+
static CampaignShortLink() {
|
|
13
10
|
return Joi.object({
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
type: Joi.string().allow(""),
|
|
11
|
+
medium: Joi.string().allow(""),
|
|
12
|
+
source: Joi.string().allow(""),
|
|
17
13
|
});
|
|
18
14
|
}
|
|
19
|
-
|
|
20
|
-
static WebRedirect() {
|
|
15
|
+
static ErrorRes() {
|
|
21
16
|
return Joi.object({
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
type: Joi.string().allow(""),
|
|
17
|
+
message: Joi.string().allow(""),
|
|
25
18
|
});
|
|
26
19
|
}
|
|
27
|
-
|
|
28
|
-
static Redirects() {
|
|
20
|
+
static Page() {
|
|
29
21
|
return Joi.object({
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
22
|
+
current: Joi.number(),
|
|
23
|
+
has_next: Joi.boolean(),
|
|
24
|
+
has_previous: Joi.boolean(),
|
|
25
|
+
item_total: Joi.number(),
|
|
26
|
+
next_id: Joi.string().allow(""),
|
|
27
|
+
size: Joi.number(),
|
|
28
|
+
type: Joi.string().allow("").required(),
|
|
37
29
|
});
|
|
38
30
|
}
|
|
39
|
-
|
|
40
|
-
static CampaignShortLink() {
|
|
31
|
+
static QRCodeResp() {
|
|
41
32
|
return Joi.object({
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
medium: Joi.string().allow(""),
|
|
33
|
+
link: Joi.string().allow(""),
|
|
34
|
+
svg: Joi.string().allow(""),
|
|
45
35
|
});
|
|
46
36
|
}
|
|
47
|
-
|
|
48
|
-
static Attribution() {
|
|
37
|
+
static RedirectDevice() {
|
|
49
38
|
return Joi.object({
|
|
50
|
-
|
|
39
|
+
link: Joi.string().allow(""),
|
|
40
|
+
type: Joi.string().allow(""),
|
|
51
41
|
});
|
|
52
42
|
}
|
|
53
|
-
|
|
54
|
-
static SocialMediaTags() {
|
|
43
|
+
static Redirects() {
|
|
55
44
|
return Joi.object({
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
45
|
+
android: ShareModel.RedirectDevice(),
|
|
46
|
+
force_web: Joi.boolean(),
|
|
47
|
+
ios: ShareModel.RedirectDevice(),
|
|
48
|
+
web: ShareModel.WebRedirect(),
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
static ShortLinkList() {
|
|
52
|
+
return Joi.object({
|
|
53
|
+
items: Joi.array().items(ShareModel.ShortLinkRes()),
|
|
54
|
+
page: ShareModel.Page(),
|
|
61
55
|
});
|
|
62
56
|
}
|
|
63
|
-
|
|
64
57
|
static ShortLinkReq() {
|
|
65
58
|
return Joi.object({
|
|
66
|
-
title: Joi.string().allow("").required(),
|
|
67
|
-
|
|
68
|
-
url: Joi.string().allow("").required(),
|
|
69
|
-
|
|
70
|
-
hash: Joi.string().allow(""),
|
|
71
|
-
|
|
72
59
|
active: Joi.boolean(),
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
60
|
+
attribution: ShareModel.Attribution(),
|
|
61
|
+
campaign: ShareModel.CampaignShortLink(),
|
|
62
|
+
count: Joi.number(),
|
|
76
63
|
enable_tracking: Joi.boolean(),
|
|
77
|
-
|
|
64
|
+
expire_at: Joi.string().allow(""),
|
|
65
|
+
hash: Joi.string().allow(""),
|
|
78
66
|
personalized: Joi.boolean(),
|
|
79
|
-
|
|
80
|
-
campaign: ShareModel.CampaignShortLink(),
|
|
81
|
-
|
|
82
67
|
redirects: ShareModel.Redirects(),
|
|
83
|
-
|
|
84
|
-
attribution: ShareModel.Attribution(),
|
|
85
|
-
|
|
86
68
|
social_media_tags: ShareModel.SocialMediaTags(),
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
static UrlInfo() {
|
|
93
|
-
return Joi.object({
|
|
94
|
-
original: Joi.string().allow(""),
|
|
95
|
-
|
|
96
|
-
short: Joi.string().allow(""),
|
|
97
|
-
|
|
98
|
-
hash: Joi.string().allow(""),
|
|
69
|
+
title: Joi.string().allow("").required(),
|
|
70
|
+
url: Joi.string().allow("").required(),
|
|
99
71
|
});
|
|
100
72
|
}
|
|
101
|
-
|
|
102
73
|
static ShortLinkRes() {
|
|
103
74
|
return Joi.object({
|
|
104
|
-
title: Joi.string().allow(""),
|
|
105
|
-
|
|
106
|
-
url: ShareModel.UrlInfo(),
|
|
107
|
-
|
|
108
|
-
created_by: Joi.string().allow(""),
|
|
109
|
-
|
|
110
|
-
app_redirect: Joi.boolean(),
|
|
111
|
-
|
|
112
|
-
fallback: Joi.string().allow(""),
|
|
113
|
-
|
|
114
|
-
active: Joi.boolean(),
|
|
115
|
-
|
|
116
75
|
_id: Joi.string().allow(""),
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
expire_at: Joi.string().allow(""),
|
|
121
|
-
|
|
76
|
+
active: Joi.boolean(),
|
|
77
|
+
app_redirect: Joi.boolean(),
|
|
122
78
|
application: Joi.string().allow(""),
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
79
|
+
attribution: ShareModel.Attribution(),
|
|
80
|
+
campaign: ShareModel.CampaignShortLink(),
|
|
81
|
+
count: Joi.number(),
|
|
126
82
|
created_at: Joi.string().allow(""),
|
|
127
|
-
|
|
83
|
+
created_by: Joi.string().allow(""),
|
|
84
|
+
enable_tracking: Joi.boolean(),
|
|
85
|
+
expire_at: Joi.string().allow(""),
|
|
86
|
+
fallback: Joi.string().allow(""),
|
|
128
87
|
meta: Joi.any(),
|
|
129
|
-
|
|
130
|
-
updated_at: Joi.string().allow(""),
|
|
131
|
-
|
|
132
88
|
personalized: Joi.boolean(),
|
|
133
|
-
|
|
134
|
-
campaign: ShareModel.CampaignShortLink(),
|
|
135
|
-
|
|
136
89
|
redirects: ShareModel.Redirects(),
|
|
137
|
-
|
|
138
|
-
attribution: ShareModel.Attribution(),
|
|
139
|
-
|
|
140
90
|
social_media_tags: ShareModel.SocialMediaTags(),
|
|
141
|
-
|
|
142
|
-
|
|
91
|
+
title: Joi.string().allow(""),
|
|
92
|
+
updated_at: Joi.string().allow(""),
|
|
93
|
+
url: ShareModel.UrlInfo(),
|
|
94
|
+
user_id: Joi.string().allow(""),
|
|
143
95
|
});
|
|
144
96
|
}
|
|
145
|
-
|
|
146
|
-
static Page() {
|
|
97
|
+
static SocialMediaTags() {
|
|
147
98
|
return Joi.object({
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
has_previous: Joi.boolean(),
|
|
153
|
-
|
|
154
|
-
has_next: Joi.boolean(),
|
|
155
|
-
|
|
156
|
-
current: Joi.number(),
|
|
157
|
-
|
|
158
|
-
type: Joi.string().allow("").required(),
|
|
159
|
-
|
|
160
|
-
size: Joi.number(),
|
|
99
|
+
description: Joi.string().allow(""),
|
|
100
|
+
image: Joi.string().allow(""),
|
|
101
|
+
title: Joi.string().allow(""),
|
|
161
102
|
});
|
|
162
103
|
}
|
|
163
|
-
|
|
164
|
-
static ShortLinkList() {
|
|
104
|
+
static UrlInfo() {
|
|
165
105
|
return Joi.object({
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
106
|
+
hash: Joi.string().allow(""),
|
|
107
|
+
original: Joi.string().allow(""),
|
|
108
|
+
short: Joi.string().allow(""),
|
|
169
109
|
});
|
|
170
110
|
}
|
|
171
|
-
|
|
172
|
-
static ErrorRes() {
|
|
111
|
+
static WebRedirect() {
|
|
173
112
|
return Joi.object({
|
|
174
|
-
|
|
113
|
+
link: Joi.string().allow(""),
|
|
114
|
+
type: Joi.string().allow(""),
|
|
175
115
|
});
|
|
176
116
|
}
|
|
177
117
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export = ShareValidator;
|
|
2
2
|
declare class ShareValidator {
|
|
3
|
+
static createShortLink(): any;
|
|
3
4
|
static getApplicationQRCode(): any;
|
|
4
|
-
static getProductQRCodeBySlug(): any;
|
|
5
5
|
static getCollectionQRCodeBySlug(): any;
|
|
6
|
-
static getUrlQRCode(): any;
|
|
7
|
-
static createShortLink(): any;
|
|
8
|
-
static getShortLinkByHash(): any;
|
|
9
6
|
static getOriginalShortLinkByHash(): any;
|
|
7
|
+
static getProductQRCodeBySlug(): any;
|
|
8
|
+
static getShortLinkByHash(): any;
|
|
9
|
+
static getUrlQRCode(): any;
|
|
10
10
|
}
|
|
@@ -2,31 +2,31 @@ const Joi = require("joi");
|
|
|
2
2
|
|
|
3
3
|
const ShareModel = require("./ShareApplicationModel");
|
|
4
4
|
class ShareValidator {
|
|
5
|
-
static
|
|
6
|
-
return Joi.object({});
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
static getProductQRCodeBySlug() {
|
|
5
|
+
static createShortLink() {
|
|
10
6
|
return Joi.object({
|
|
11
|
-
|
|
7
|
+
body: ShareModel.ShortLinkReq().required(),
|
|
12
8
|
}).required();
|
|
13
9
|
}
|
|
14
10
|
|
|
11
|
+
static getApplicationQRCode() {
|
|
12
|
+
return Joi.object({});
|
|
13
|
+
}
|
|
14
|
+
|
|
15
15
|
static getCollectionQRCodeBySlug() {
|
|
16
16
|
return Joi.object({
|
|
17
17
|
slug: Joi.string().allow("").required(),
|
|
18
18
|
}).required();
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
static
|
|
21
|
+
static getOriginalShortLinkByHash() {
|
|
22
22
|
return Joi.object({
|
|
23
|
-
|
|
23
|
+
hash: Joi.string().allow("").required(),
|
|
24
24
|
}).required();
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
static
|
|
27
|
+
static getProductQRCodeBySlug() {
|
|
28
28
|
return Joi.object({
|
|
29
|
-
|
|
29
|
+
slug: Joi.string().allow("").required(),
|
|
30
30
|
}).required();
|
|
31
31
|
}
|
|
32
32
|
|
|
@@ -36,9 +36,9 @@ class ShareValidator {
|
|
|
36
36
|
}).required();
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
static
|
|
39
|
+
static getUrlQRCode() {
|
|
40
40
|
return Joi.object({
|
|
41
|
-
|
|
41
|
+
url: Joi.string().allow("").required(),
|
|
42
42
|
}).required();
|
|
43
43
|
}
|
|
44
44
|
}
|
|
@@ -4,8 +4,8 @@ declare class Theme {
|
|
|
4
4
|
_conf: any;
|
|
5
5
|
_relativeUrls: {
|
|
6
6
|
getAllPages: string;
|
|
7
|
-
getPage: string;
|
|
8
7
|
getAppliedTheme: string;
|
|
8
|
+
getPage: string;
|
|
9
9
|
getThemeForPreview: string;
|
|
10
10
|
};
|
|
11
11
|
_urls: {};
|
|
@@ -20,6 +20,13 @@ declare class Theme {
|
|
|
20
20
|
getAllPages({ themeId }?: {
|
|
21
21
|
themeId: string;
|
|
22
22
|
}): Promise<AllAvailablePageSchema>;
|
|
23
|
+
/**
|
|
24
|
+
* @param {Object} arg - Arg object.
|
|
25
|
+
* @returns {Promise<ThemesSchema>} - Success response
|
|
26
|
+
* @summary: Get the theme currently applied to an application
|
|
27
|
+
* @description: An application has multiple themes, but only one theme can be applied at a time. Use this API to retrieve the theme currently applied to the application.
|
|
28
|
+
*/
|
|
29
|
+
getAppliedTheme({}?: any): Promise<ThemesSchema>;
|
|
23
30
|
/**
|
|
24
31
|
* @param {Object} arg - Arg object.
|
|
25
32
|
* @param {string} arg.themeId - ID of the theme to be retrieved
|
|
@@ -32,13 +39,6 @@ declare class Theme {
|
|
|
32
39
|
themeId: string;
|
|
33
40
|
pageValue: string;
|
|
34
41
|
}): Promise<AvailablePageSchema>;
|
|
35
|
-
/**
|
|
36
|
-
* @param {Object} arg - Arg object.
|
|
37
|
-
* @returns {Promise<ThemesSchema>} - Success response
|
|
38
|
-
* @summary: Get the theme currently applied to an application
|
|
39
|
-
* @description: An application has multiple themes, but only one theme can be applied at a time. Use this API to retrieve the theme currently applied to the application.
|
|
40
|
-
*/
|
|
41
|
-
getAppliedTheme({}?: any): Promise<ThemesSchema>;
|
|
42
42
|
/**
|
|
43
43
|
* @param {Object} arg - Arg object.
|
|
44
44
|
* @param {string} arg.themeId - ID of the theme to be retrieved
|
|
@@ -3,14 +3,16 @@ const constructUrl = require("../constructUrl");
|
|
|
3
3
|
const Paginator = require("../../common/Paginator");
|
|
4
4
|
const { FDKClientValidationError } = require("../../common/FDKError");
|
|
5
5
|
const ThemeValidator = require("./ThemeApplicationValidator");
|
|
6
|
+
const ThemeModel = require("./ThemeApplicationModel");
|
|
7
|
+
const { Logger } = require("./../../common/Logger");
|
|
6
8
|
|
|
7
9
|
class Theme {
|
|
8
10
|
constructor(_conf) {
|
|
9
11
|
this._conf = _conf;
|
|
10
12
|
this._relativeUrls = {
|
|
11
13
|
getAllPages: "/service/application/theme/v1.0/{theme_id}/page",
|
|
12
|
-
getPage: "/service/application/theme/v1.0/{theme_id}/{page_value}",
|
|
13
14
|
getAppliedTheme: "/service/application/theme/v1.0/applied-theme",
|
|
15
|
+
getPage: "/service/application/theme/v1.0/{theme_id}/{page_value}",
|
|
14
16
|
getThemeForPreview: "/service/application/theme/v1.0/{theme_id}/preview",
|
|
15
17
|
};
|
|
16
18
|
this._urls = Object.entries(this._relativeUrls).reduce(
|
|
@@ -36,7 +38,7 @@ class Theme {
|
|
|
36
38
|
* @summary: Get all pages of a theme
|
|
37
39
|
* @description: Use this API to retrieve all the available pages of a theme by its ID.
|
|
38
40
|
*/
|
|
39
|
-
getAllPages({ themeId } = {}) {
|
|
41
|
+
async getAllPages({ themeId } = {}) {
|
|
40
42
|
const { error } = ThemeValidator.getAllPages().validate(
|
|
41
43
|
{ themeId },
|
|
42
44
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -51,15 +53,18 @@ class Theme {
|
|
|
51
53
|
{ abortEarly: false, allowUnknown: false }
|
|
52
54
|
);
|
|
53
55
|
if (warrning) {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
+
Logger({
|
|
57
|
+
level: "WARN",
|
|
58
|
+
message: "Parameter Validation warrnings for getAllPages",
|
|
59
|
+
});
|
|
60
|
+
Logger({ level: "WARN", message: warrning });
|
|
56
61
|
}
|
|
57
62
|
|
|
58
63
|
const query_params = {};
|
|
59
64
|
|
|
60
65
|
const xHeaders = {};
|
|
61
66
|
|
|
62
|
-
|
|
67
|
+
const response = await APIClient.execute(
|
|
63
68
|
this._conf,
|
|
64
69
|
"get",
|
|
65
70
|
constructUrl({
|
|
@@ -70,19 +75,34 @@ class Theme {
|
|
|
70
75
|
undefined,
|
|
71
76
|
xHeaders
|
|
72
77
|
);
|
|
78
|
+
|
|
79
|
+
const {
|
|
80
|
+
error: res_error,
|
|
81
|
+
} = ThemeModel.AllAvailablePageSchema().validate(response, {
|
|
82
|
+
abortEarly: false,
|
|
83
|
+
allowUnknown: false,
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
if (res_error) {
|
|
87
|
+
Logger({
|
|
88
|
+
level: "WARN",
|
|
89
|
+
message: "Response Validation Warnnings for getAllPages",
|
|
90
|
+
});
|
|
91
|
+
Logger({ level: "WARN", message: res_error });
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
return response;
|
|
73
95
|
}
|
|
74
96
|
|
|
75
97
|
/**
|
|
76
98
|
* @param {Object} arg - Arg object.
|
|
77
|
-
* @
|
|
78
|
-
* @
|
|
79
|
-
* @
|
|
80
|
-
* @summary: Get page of a theme
|
|
81
|
-
* @description: Use this API to retrieve a page of a theme.
|
|
99
|
+
* @returns {Promise<ThemesSchema>} - Success response
|
|
100
|
+
* @summary: Get the theme currently applied to an application
|
|
101
|
+
* @description: An application has multiple themes, but only one theme can be applied at a time. Use this API to retrieve the theme currently applied to the application.
|
|
82
102
|
*/
|
|
83
|
-
|
|
84
|
-
const { error } = ThemeValidator.
|
|
85
|
-
{
|
|
103
|
+
async getAppliedTheme({} = {}) {
|
|
104
|
+
const { error } = ThemeValidator.getAppliedTheme().validate(
|
|
105
|
+
{},
|
|
86
106
|
{ abortEarly: false, allowUnknown: true }
|
|
87
107
|
);
|
|
88
108
|
if (error) {
|
|
@@ -90,41 +110,61 @@ class Theme {
|
|
|
90
110
|
}
|
|
91
111
|
|
|
92
112
|
// Showing warrnings if extra unknown parameters are found
|
|
93
|
-
const { error: warrning } = ThemeValidator.
|
|
94
|
-
{
|
|
113
|
+
const { error: warrning } = ThemeValidator.getAppliedTheme().validate(
|
|
114
|
+
{},
|
|
95
115
|
{ abortEarly: false, allowUnknown: false }
|
|
96
116
|
);
|
|
97
117
|
if (warrning) {
|
|
98
|
-
|
|
99
|
-
|
|
118
|
+
Logger({
|
|
119
|
+
level: "WARN",
|
|
120
|
+
message: "Parameter Validation warrnings for getAppliedTheme",
|
|
121
|
+
});
|
|
122
|
+
Logger({ level: "WARN", message: warrning });
|
|
100
123
|
}
|
|
101
124
|
|
|
102
125
|
const query_params = {};
|
|
103
126
|
|
|
104
127
|
const xHeaders = {};
|
|
105
128
|
|
|
106
|
-
|
|
129
|
+
const response = await APIClient.execute(
|
|
107
130
|
this._conf,
|
|
108
131
|
"get",
|
|
109
132
|
constructUrl({
|
|
110
|
-
url: this._urls["
|
|
111
|
-
params: {
|
|
133
|
+
url: this._urls["getAppliedTheme"],
|
|
134
|
+
params: {},
|
|
112
135
|
}),
|
|
113
136
|
query_params,
|
|
114
137
|
undefined,
|
|
115
138
|
xHeaders
|
|
116
139
|
);
|
|
140
|
+
|
|
141
|
+
const { error: res_error } = ThemeModel.ThemesSchema().validate(response, {
|
|
142
|
+
abortEarly: false,
|
|
143
|
+
allowUnknown: false,
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
if (res_error) {
|
|
147
|
+
Logger({
|
|
148
|
+
level: "WARN",
|
|
149
|
+
message: "Response Validation Warnnings for getAppliedTheme",
|
|
150
|
+
});
|
|
151
|
+
Logger({ level: "WARN", message: res_error });
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
return response;
|
|
117
155
|
}
|
|
118
156
|
|
|
119
157
|
/**
|
|
120
158
|
* @param {Object} arg - Arg object.
|
|
121
|
-
* @
|
|
122
|
-
* @
|
|
123
|
-
* @
|
|
159
|
+
* @param {string} arg.themeId - ID of the theme to be retrieved
|
|
160
|
+
* @param {string} arg.pageValue - Value of the page to be retrieved
|
|
161
|
+
* @returns {Promise<AvailablePageSchema>} - Success response
|
|
162
|
+
* @summary: Get page of a theme
|
|
163
|
+
* @description: Use this API to retrieve a page of a theme.
|
|
124
164
|
*/
|
|
125
|
-
|
|
126
|
-
const { error } = ThemeValidator.
|
|
127
|
-
{},
|
|
165
|
+
async getPage({ themeId, pageValue } = {}) {
|
|
166
|
+
const { error } = ThemeValidator.getPage().validate(
|
|
167
|
+
{ themeId, pageValue },
|
|
128
168
|
{ abortEarly: false, allowUnknown: true }
|
|
129
169
|
);
|
|
130
170
|
if (error) {
|
|
@@ -132,30 +172,50 @@ class Theme {
|
|
|
132
172
|
}
|
|
133
173
|
|
|
134
174
|
// Showing warrnings if extra unknown parameters are found
|
|
135
|
-
const { error: warrning } = ThemeValidator.
|
|
136
|
-
{},
|
|
175
|
+
const { error: warrning } = ThemeValidator.getPage().validate(
|
|
176
|
+
{ themeId, pageValue },
|
|
137
177
|
{ abortEarly: false, allowUnknown: false }
|
|
138
178
|
);
|
|
139
179
|
if (warrning) {
|
|
140
|
-
|
|
141
|
-
|
|
180
|
+
Logger({
|
|
181
|
+
level: "WARN",
|
|
182
|
+
message: "Parameter Validation warrnings for getPage",
|
|
183
|
+
});
|
|
184
|
+
Logger({ level: "WARN", message: warrning });
|
|
142
185
|
}
|
|
143
186
|
|
|
144
187
|
const query_params = {};
|
|
145
188
|
|
|
146
189
|
const xHeaders = {};
|
|
147
190
|
|
|
148
|
-
|
|
191
|
+
const response = await APIClient.execute(
|
|
149
192
|
this._conf,
|
|
150
193
|
"get",
|
|
151
194
|
constructUrl({
|
|
152
|
-
url: this._urls["
|
|
153
|
-
params: {},
|
|
195
|
+
url: this._urls["getPage"],
|
|
196
|
+
params: { themeId, pageValue },
|
|
154
197
|
}),
|
|
155
198
|
query_params,
|
|
156
199
|
undefined,
|
|
157
200
|
xHeaders
|
|
158
201
|
);
|
|
202
|
+
|
|
203
|
+
const {
|
|
204
|
+
error: res_error,
|
|
205
|
+
} = ThemeModel.AvailablePageSchema().validate(response, {
|
|
206
|
+
abortEarly: false,
|
|
207
|
+
allowUnknown: false,
|
|
208
|
+
});
|
|
209
|
+
|
|
210
|
+
if (res_error) {
|
|
211
|
+
Logger({
|
|
212
|
+
level: "WARN",
|
|
213
|
+
message: "Response Validation Warnnings for getPage",
|
|
214
|
+
});
|
|
215
|
+
Logger({ level: "WARN", message: res_error });
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
return response;
|
|
159
219
|
}
|
|
160
220
|
|
|
161
221
|
/**
|
|
@@ -165,7 +225,7 @@ class Theme {
|
|
|
165
225
|
* @summary: Get a theme for a preview
|
|
166
226
|
* @description: A theme can be previewed before applying it. Use this API to retrieve the preview of a theme by its ID.
|
|
167
227
|
*/
|
|
168
|
-
getThemeForPreview({ themeId } = {}) {
|
|
228
|
+
async getThemeForPreview({ themeId } = {}) {
|
|
169
229
|
const { error } = ThemeValidator.getThemeForPreview().validate(
|
|
170
230
|
{ themeId },
|
|
171
231
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -180,15 +240,18 @@ class Theme {
|
|
|
180
240
|
{ abortEarly: false, allowUnknown: false }
|
|
181
241
|
);
|
|
182
242
|
if (warrning) {
|
|
183
|
-
|
|
184
|
-
|
|
243
|
+
Logger({
|
|
244
|
+
level: "WARN",
|
|
245
|
+
message: "Parameter Validation warrnings for getThemeForPreview",
|
|
246
|
+
});
|
|
247
|
+
Logger({ level: "WARN", message: warrning });
|
|
185
248
|
}
|
|
186
249
|
|
|
187
250
|
const query_params = {};
|
|
188
251
|
|
|
189
252
|
const xHeaders = {};
|
|
190
253
|
|
|
191
|
-
|
|
254
|
+
const response = await APIClient.execute(
|
|
192
255
|
this._conf,
|
|
193
256
|
"get",
|
|
194
257
|
constructUrl({
|
|
@@ -199,6 +262,21 @@ class Theme {
|
|
|
199
262
|
undefined,
|
|
200
263
|
xHeaders
|
|
201
264
|
);
|
|
265
|
+
|
|
266
|
+
const { error: res_error } = ThemeModel.ThemesSchema().validate(response, {
|
|
267
|
+
abortEarly: false,
|
|
268
|
+
allowUnknown: false,
|
|
269
|
+
});
|
|
270
|
+
|
|
271
|
+
if (res_error) {
|
|
272
|
+
Logger({
|
|
273
|
+
level: "WARN",
|
|
274
|
+
message: "Response Validation Warnnings for getThemeForPreview",
|
|
275
|
+
});
|
|
276
|
+
Logger({ level: "WARN", message: res_error });
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
return response;
|
|
202
280
|
}
|
|
203
281
|
}
|
|
204
282
|
|