@gofynd/fdk-client-javascript 1.2.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +44 -7
- package/package.json +1 -2
- package/sdk/application/ApplicationAPIClient.d.ts +3 -3
- package/sdk/application/ApplicationAPIClient.js +6 -4
- package/sdk/application/ApplicationClient.d.ts +2 -3
- package/sdk/application/ApplicationClient.js +1 -45
- package/sdk/application/ApplicationConfig.d.ts +46 -6
- package/sdk/application/ApplicationConfig.js +15 -16
- package/sdk/application/Cart/CartApplicationClient.d.ts +61 -33
- package/sdk/application/Cart/CartApplicationClient.js +225 -134
- package/sdk/application/Cart/CartApplicationModel.d.ts +4 -4
- package/sdk/application/Cart/CartApplicationModel.js +4 -4
- package/sdk/application/Catalog/CatalogApplicationClient.d.ts +61 -30
- package/sdk/application/Catalog/CatalogApplicationClient.js +234 -146
- package/sdk/application/Catalog/CatalogApplicationModel.d.ts +115 -13
- package/sdk/application/Catalog/CatalogApplicationModel.js +77 -12
- package/sdk/application/Common/CommonApplicationClient.d.ts +5 -3
- package/sdk/application/Common/CommonApplicationClient.js +13 -11
- package/sdk/application/Common/CommonApplicationModel.d.ts +3 -83
- package/sdk/application/Common/CommonApplicationModel.js +2 -58
- package/sdk/application/Communication/CommunicationApplicationClient.d.ts +9 -3
- package/sdk/application/Communication/CommunicationApplicationClient.js +25 -13
- package/sdk/application/Communication/CommunicationApplicationModel.d.ts +1 -34
- package/sdk/application/Communication/CommunicationApplicationModel.js +0 -36
- package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +46 -16
- package/sdk/application/Configuration/ConfigurationApplicationClient.js +144 -68
- package/sdk/application/Configuration/ConfigurationApplicationModel.d.ts +1 -219
- package/sdk/application/Configuration/ConfigurationApplicationModel.js +0 -226
- package/sdk/application/Content/ContentApplicationClient.d.ts +49 -21
- package/sdk/application/Content/ContentApplicationClient.js +159 -80
- package/sdk/application/Content/ContentApplicationModel.d.ts +5 -622
- package/sdk/application/Content/ContentApplicationModel.js +11 -763
- package/sdk/application/FileStorage/FileStorageApplicationClient.d.ts +6 -3
- package/sdk/application/FileStorage/FileStorageApplicationClient.js +20 -14
- package/sdk/application/FileStorage/FileStorageApplicationModel.d.ts +1 -152
- package/sdk/application/FileStorage/FileStorageApplicationModel.js +0 -180
- package/sdk/application/Lead/LeadApplicationClient.d.ts +14 -7
- package/sdk/application/Lead/LeadApplicationClient.js +50 -31
- package/sdk/application/Lead/LeadApplicationModel.d.ts +22 -741
- package/sdk/application/Lead/LeadApplicationModel.js +21 -481
- package/sdk/application/Logistic/LogisticApplicationClient.d.ts +11 -5
- package/sdk/application/Logistic/LogisticApplicationClient.js +41 -20
- package/sdk/application/Order/OrderApplicationClient.d.ts +24 -12
- package/sdk/application/Order/OrderApplicationClient.js +88 -56
- package/sdk/application/Payment/PaymentApplicationClient.d.ts +91 -42
- package/sdk/application/Payment/PaymentApplicationClient.js +293 -194
- package/sdk/application/Payment/PaymentApplicationModel.d.ts +36 -36
- package/sdk/application/Payment/PaymentApplicationModel.js +36 -36
- package/sdk/application/PosCart/PosCartApplicationClient.d.ts +59 -32
- package/sdk/application/PosCart/PosCartApplicationClient.js +214 -130
- package/sdk/application/PosCart/PosCartApplicationModel.d.ts +2 -2
- package/sdk/application/PosCart/PosCartApplicationModel.js +2 -2
- package/sdk/application/Rewards/RewardsApplicationClient.d.ts +16 -7
- package/sdk/application/Rewards/RewardsApplicationClient.js +56 -29
- package/sdk/application/Share/ShareApplicationClient.d.ts +15 -7
- package/sdk/application/Share/ShareApplicationClient.js +51 -31
- package/sdk/application/Share/ShareApplicationModel.d.ts +1 -33
- package/sdk/application/Share/ShareApplicationModel.js +0 -38
- package/sdk/application/Theme/ThemeApplicationClient.d.ts +9 -4
- package/sdk/application/Theme/ThemeApplicationClient.js +35 -18
- package/sdk/application/Theme/ThemeApplicationModel.d.ts +982 -312
- package/sdk/application/Theme/ThemeApplicationModel.js +621 -284
- package/sdk/application/User/UserApplicationClient.d.ts +74 -35
- package/sdk/application/User/UserApplicationClient.js +252 -161
- package/sdk/application/User/UserApplicationModel.d.ts +3 -401
- package/sdk/application/User/UserApplicationModel.js +2 -490
- package/sdk/common/AxiosHelper.js +1 -2
- package/sdk/common/FDKError.d.ts +3 -0
- package/sdk/common/FDKError.js +8 -0
- package/sdk/common/utils.d.ts +3 -0
- package/sdk/common/utils.js +29 -0
- package/sdk/partner/PartnerAPIClient.d.ts +5 -4
- package/sdk/partner/PartnerAPIClient.js +7 -4
- package/sdk/partner/PartnerClient.d.ts +2 -0
- package/sdk/partner/PartnerClient.js +3 -0
- package/sdk/partner/Theme/ThemePartnerClient.d.ts +299 -0
- package/sdk/partner/Theme/ThemePartnerClient.js +768 -0
- package/sdk/partner/Theme/ThemePartnerModel.d.ts +1706 -0
- package/sdk/partner/Theme/ThemePartnerModel.js +1409 -0
- package/sdk/partner/Theme/ThemePartnerValidator.d.ts +22 -0
- package/sdk/partner/Theme/ThemePartnerValidator.js +157 -0
- package/sdk/partner/index.d.ts +3 -1
- package/sdk/partner/index.js +3 -1
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.d.ts +8 -4
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +38 -16
- package/sdk/platform/AuditTrail/AuditTrailPlatformModel.d.ts +1 -13
- package/sdk/platform/AuditTrail/AuditTrailPlatformModel.js +0 -12
- package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.d.ts +10 -0
- package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.js +4 -0
- package/sdk/platform/Billing/BillingPlatformClient.d.ts +59 -14
- package/sdk/platform/Billing/BillingPlatformClient.js +315 -64
- package/sdk/platform/Billing/BillingPlatformModel.d.ts +56 -196
- package/sdk/platform/Billing/BillingPlatformModel.js +63 -217
- package/sdk/platform/Billing/BillingPlatformValidator.d.ts +23 -1
- package/sdk/platform/Billing/BillingPlatformValidator.js +31 -0
- package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +124 -63
- package/sdk/platform/Cart/CartPlatformApplicationClient.js +431 -265
- package/sdk/platform/Cart/CartPlatformModel.d.ts +253 -53
- package/sdk/platform/Cart/CartPlatformModel.js +104 -54
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +120 -53
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +398 -247
- package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +155 -78
- package/sdk/platform/Catalog/CatalogPlatformClient.js +561 -355
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +10 -12
- package/sdk/platform/Catalog/CatalogPlatformModel.js +10 -12
- package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +30 -0
- package/sdk/platform/Catalog/CatalogPlatformValidator.js +13 -0
- package/sdk/platform/Common/CommonPlatformClient.d.ts +5 -3
- package/sdk/platform/Common/CommonPlatformClient.js +13 -11
- package/sdk/platform/Common/CommonPlatformModel.d.ts +39 -64
- package/sdk/platform/Common/CommonPlatformModel.js +23 -57
- package/sdk/platform/Common/CommonPlatformValidator.d.ts +5 -10
- package/sdk/platform/Common/CommonPlatformValidator.js +3 -4
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +370 -120
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +2328 -888
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.d.ts +143 -24
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.js +179 -15
- package/sdk/platform/Communication/CommunicationPlatformClient.d.ts +2 -1
- package/sdk/platform/Communication/CommunicationPlatformClient.js +6 -5
- package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +386 -308
- package/sdk/platform/Communication/CommunicationPlatformModel.js +415 -355
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +38 -13
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +171 -57
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +53 -1
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +54 -0
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.d.ts +5 -1
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.js +7 -0
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +96 -29
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +311 -126
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.d.ts +5 -1
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.js +7 -0
- package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +36 -18
- package/sdk/platform/Configuration/ConfigurationPlatformClient.js +121 -86
- package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +13 -180
- package/sdk/platform/Configuration/ConfigurationPlatformModel.js +5 -113
- package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +162 -70
- package/sdk/platform/Content/ContentPlatformApplicationClient.js +528 -309
- package/sdk/platform/Content/ContentPlatformModel.d.ts +9 -198
- package/sdk/platform/Content/ContentPlatformModel.js +8 -231
- package/sdk/platform/Discount/DiscountPlatformClient.d.ts +48 -11
- package/sdk/platform/Discount/DiscountPlatformClient.js +142 -48
- package/sdk/platform/Discount/DiscountPlatformModel.d.ts +40 -1
- package/sdk/platform/Discount/DiscountPlatformModel.js +27 -0
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +84 -18
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +486 -53
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.d.ts +71 -7
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.js +81 -5
- package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +13 -18
- package/sdk/platform/FileStorage/FileStoragePlatformClient.js +58 -65
- package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +198 -71
- package/sdk/platform/FileStorage/FileStoragePlatformModel.js +212 -64
- package/sdk/platform/FileStorage/FileStoragePlatformValidator.d.ts +18 -10
- package/sdk/platform/FileStorage/FileStoragePlatformValidator.js +11 -6
- package/sdk/platform/Finance/FinancePlatformClient.d.ts +177 -40
- package/sdk/platform/Finance/FinancePlatformClient.js +1028 -132
- package/sdk/platform/Finance/FinancePlatformModel.d.ts +670 -22
- package/sdk/platform/Finance/FinancePlatformModel.js +809 -23
- package/sdk/platform/Finance/FinancePlatformValidator.d.ts +111 -1
- package/sdk/platform/Finance/FinancePlatformValidator.js +134 -0
- package/sdk/platform/Inventory/InventoryPlatformClient.d.ts +24 -12
- package/sdk/platform/Inventory/InventoryPlatformClient.js +94 -52
- package/sdk/platform/Lead/LeadPlatformApplicationClient.d.ts +27 -13
- package/sdk/platform/Lead/LeadPlatformApplicationClient.js +101 -55
- package/sdk/platform/Lead/LeadPlatformClient.d.ts +50 -39
- package/sdk/platform/Lead/LeadPlatformClient.js +171 -112
- package/sdk/platform/Lead/LeadPlatformModel.d.ts +32 -390
- package/sdk/platform/Lead/LeadPlatformModel.js +31 -214
- package/sdk/platform/Lead/LeadPlatformValidator.d.ts +33 -33
- package/sdk/platform/Lead/LeadPlatformValidator.js +23 -23
- package/sdk/platform/OAuthClient.js +6 -2
- package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +4 -2
- package/sdk/platform/Order/OrderPlatformApplicationClient.js +12 -10
- package/sdk/platform/Order/OrderPlatformClient.d.ts +165 -71
- package/sdk/platform/Order/OrderPlatformClient.js +738 -205
- package/sdk/platform/Order/OrderPlatformModel.d.ts +261 -3
- package/sdk/platform/Order/OrderPlatformModel.js +225 -2
- package/sdk/platform/Order/OrderPlatformValidator.d.ts +104 -3
- package/sdk/platform/Order/OrderPlatformValidator.js +85 -2
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.d.ts +4 -22
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.js +12 -159
- package/sdk/platform/Partner/PartnerPlatformApplicationValidator.d.ts +1 -30
- package/sdk/platform/Partner/PartnerPlatformApplicationValidator.js +0 -26
- package/sdk/platform/Partner/PartnerPlatformModel.d.ts +1 -690
- package/sdk/platform/Partner/PartnerPlatformModel.js +0 -809
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +167 -32
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +793 -145
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +91 -1
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +91 -0
- package/sdk/platform/Payment/PaymentPlatformClient.d.ts +20 -10
- package/sdk/platform/Payment/PaymentPlatformClient.js +68 -47
- package/sdk/platform/Payment/PaymentPlatformModel.d.ts +549 -7
- package/sdk/platform/Payment/PaymentPlatformModel.js +305 -6
- package/sdk/platform/PlatformAPIClient.d.ts +3 -3
- package/sdk/platform/PlatformAPIClient.js +2 -2
- package/sdk/platform/PlatformClient.d.ts +2 -2
- package/sdk/platform/PlatformClient.js +4 -4
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.d.ts +28 -12
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +90 -53
- package/sdk/platform/Rewards/RewardsPlatformModel.d.ts +1 -12
- package/sdk/platform/Rewards/RewardsPlatformModel.js +0 -14
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.d.ts +62 -26
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.js +210 -93
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.d.ts +20 -11
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.js +23 -11
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +36 -18
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +142 -78
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +12 -3
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +14 -2
- package/sdk/platform/Share/SharePlatformApplicationClient.d.ts +10 -26
- package/sdk/platform/Share/SharePlatformApplicationClient.js +36 -67
- package/sdk/platform/Share/SharePlatformModel.d.ts +4 -4
- package/sdk/platform/Share/SharePlatformModel.js +4 -4
- package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +127 -57
- package/sdk/platform/Theme/ThemePlatformApplicationClient.js +564 -189
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.d.ts +63 -26
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.js +62 -22
- package/sdk/platform/Theme/ThemePlatformClient.d.ts +37 -0
- package/sdk/platform/Theme/ThemePlatformClient.js +235 -0
- package/sdk/platform/Theme/ThemePlatformModel.d.ts +1167 -261
- package/sdk/platform/Theme/ThemePlatformModel.js +801 -244
- package/sdk/platform/Theme/ThemePlatformValidator.d.ts +32 -0
- package/sdk/platform/Theme/ThemePlatformValidator.js +38 -0
- package/sdk/platform/User/UserPlatformApplicationClient.d.ts +35 -17
- package/sdk/platform/User/UserPlatformApplicationClient.js +132 -73
- package/sdk/platform/User/UserPlatformApplicationValidator.d.ts +7 -0
- package/sdk/platform/User/UserPlatformApplicationValidator.js +3 -0
- package/sdk/platform/User/UserPlatformModel.d.ts +1 -738
- package/sdk/platform/User/UserPlatformModel.js +3 -899
- package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +120 -7
- package/sdk/platform/Webhook/WebhookPlatformClient.js +799 -41
- package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +476 -86
- package/sdk/platform/Webhook/WebhookPlatformModel.js +388 -89
- package/sdk/platform/Webhook/WebhookPlatformValidator.d.ts +96 -9
- package/sdk/platform/Webhook/WebhookPlatformValidator.js +117 -5
- package/sdk/public/Configuration/ConfigurationPublicClient.d.ts +5 -3
- package/sdk/public/Configuration/ConfigurationPublicClient.js +13 -11
- package/sdk/public/Configuration/ConfigurationPublicModel.d.ts +3 -106
- package/sdk/public/Configuration/ConfigurationPublicModel.js +2 -59
- package/sdk/public/Inventory/InventoryPublicClient.d.ts +12 -6
- package/sdk/public/Inventory/InventoryPublicClient.js +42 -27
- package/sdk/public/Partner/PartnerPublicClient.d.ts +22 -0
- package/sdk/public/Partner/PartnerPublicClient.js +110 -0
- package/sdk/public/Partner/PartnerPublicModel.d.ts +240 -0
- package/sdk/public/Partner/PartnerPublicModel.js +280 -0
- package/sdk/public/Partner/PartnerPublicValidator.d.ts +18 -0
- package/sdk/public/Partner/PartnerPublicValidator.js +19 -0
- package/sdk/public/PublicAPIClient.d.ts +14 -1
- package/sdk/public/PublicAPIClient.js +7 -1
- package/sdk/public/PublicClient.d.ts +2 -0
- package/sdk/public/PublicClient.js +4 -0
- package/sdk/public/Webhook/WebhookPublicClient.d.ts +5 -2
- package/sdk/public/Webhook/WebhookPublicClient.js +15 -9
- package/sdk/public/Webhook/WebhookPublicModel.d.ts +1 -191
- package/sdk/public/Webhook/WebhookPublicModel.js +0 -229
- package/sdk/public/index.d.ts +1 -0
- package/sdk/public/index.js +2 -0
- package/sdk/application/ApplicationModels.d.ts +0 -48
- package/sdk/application/ApplicationModels.js +0 -38
- package/sdk/platform/Partner/PartnerPlatformClient.d.ts +0 -106
- package/sdk/platform/Partner/PartnerPlatformClient.js +0 -878
- package/sdk/platform/Partner/PartnerPlatformValidator.d.ts +0 -208
- package/sdk/platform/Partner/PartnerPlatformValidator.js +0 -169
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
export = ThemePlatformApplicationValidator;
|
|
2
|
+
/**
|
|
3
|
+
* @typedef AddThemeToApplicationParam
|
|
4
|
+
* @property {ThemePlatformModel.ThemeReq} body
|
|
5
|
+
*/
|
|
2
6
|
/**
|
|
3
7
|
* @typedef AddToThemeLibraryParam
|
|
4
8
|
* @property {ThemePlatformModel.AddThemeRequestSchema} body
|
|
5
9
|
*/
|
|
6
10
|
/**
|
|
7
11
|
* @typedef ApplyThemeParam
|
|
8
|
-
* @property {
|
|
12
|
+
* @property {string} themeId - The ID of the apply
|
|
9
13
|
*/
|
|
10
14
|
/**
|
|
11
15
|
* @typedef ArchiveThemeParam
|
|
@@ -16,10 +20,6 @@ export = ThemePlatformApplicationValidator;
|
|
|
16
20
|
* @property {string} themeId - ID of the theme
|
|
17
21
|
* @property {ThemePlatformModel.AvailablePageSchema} body
|
|
18
22
|
*/
|
|
19
|
-
/**
|
|
20
|
-
* @typedef CreateThemeParam
|
|
21
|
-
* @property {ThemePlatformModel.ThemesSchema} body
|
|
22
|
-
*/
|
|
23
23
|
/**
|
|
24
24
|
* @typedef DeletePageParam
|
|
25
25
|
* @property {string} themeId - ID of the theme
|
|
@@ -27,12 +27,18 @@ export = ThemePlatformApplicationValidator;
|
|
|
27
27
|
*/
|
|
28
28
|
/**
|
|
29
29
|
* @typedef DeleteThemeParam
|
|
30
|
-
* @property {string} themeId - ID
|
|
30
|
+
* @property {string} themeId - The ID of the theme to be deleted.
|
|
31
|
+
*/
|
|
32
|
+
/**
|
|
33
|
+
* @typedef DuplicateThemeParam
|
|
34
|
+
* @property {string} themeId - The ID of the theme to be duplicated
|
|
31
35
|
*/
|
|
32
36
|
/**
|
|
33
37
|
* @typedef GetAllPagesParam
|
|
34
38
|
* @property {string} themeId - ID of the theme to be retrieved
|
|
35
39
|
*/
|
|
40
|
+
/** @typedef GetApplicationThemesParam */
|
|
41
|
+
/** @typedef GetApplicationThemesCountParam */
|
|
36
42
|
/** @typedef GetAppliedThemeParam */
|
|
37
43
|
/** @typedef GetFontsParam */
|
|
38
44
|
/**
|
|
@@ -49,11 +55,11 @@ export = ThemePlatformApplicationValidator;
|
|
|
49
55
|
*/
|
|
50
56
|
/**
|
|
51
57
|
* @typedef GetThemeByIdParam
|
|
52
|
-
* @property {string} themeId - ID
|
|
58
|
+
* @property {string} themeId - The ID of the theme
|
|
53
59
|
*/
|
|
54
60
|
/**
|
|
55
61
|
* @typedef GetThemeForPreviewParam
|
|
56
|
-
* @property {string} themeId - ID
|
|
62
|
+
* @property {string} themeId - The ID of the theme
|
|
57
63
|
*/
|
|
58
64
|
/**
|
|
59
65
|
* @typedef GetThemeLastModifiedParam
|
|
@@ -68,7 +74,7 @@ export = ThemePlatformApplicationValidator;
|
|
|
68
74
|
*/
|
|
69
75
|
/**
|
|
70
76
|
* @typedef IsUpgradableParam
|
|
71
|
-
* @property {string} themeId -
|
|
77
|
+
* @property {string} themeId - The ID of the theme
|
|
72
78
|
*/
|
|
73
79
|
/**
|
|
74
80
|
* @typedef PublishThemeParam
|
|
@@ -95,14 +101,21 @@ export = ThemePlatformApplicationValidator;
|
|
|
95
101
|
*/
|
|
96
102
|
/**
|
|
97
103
|
* @typedef UpdateThemeParam
|
|
98
|
-
* @property {string} themeId - ID
|
|
99
|
-
* @property {ThemePlatformModel.
|
|
104
|
+
* @property {string} themeId - The ID of the theme.
|
|
105
|
+
* @property {ThemePlatformModel.UpdateThemeRequestBody} body
|
|
106
|
+
*/
|
|
107
|
+
/**
|
|
108
|
+
* @typedef UpdateThemeNameParam
|
|
109
|
+
* @property {string} themeId - The ID of the theme to be updated.
|
|
110
|
+
* @property {ThemePlatformModel.UpdateThemeNameRequestBody} body
|
|
100
111
|
*/
|
|
101
112
|
/**
|
|
102
113
|
* @typedef UpgradeThemeParam
|
|
103
|
-
* @property {string} themeId - ID
|
|
114
|
+
* @property {string} themeId - The ID of the upgrade
|
|
104
115
|
*/
|
|
105
116
|
declare class ThemePlatformApplicationValidator {
|
|
117
|
+
/** @returns {AddThemeToApplicationParam} */
|
|
118
|
+
static addThemeToApplication(): AddThemeToApplicationParam;
|
|
106
119
|
/** @returns {AddToThemeLibraryParam} */
|
|
107
120
|
static addToThemeLibrary(): AddToThemeLibraryParam;
|
|
108
121
|
/** @returns {ApplyThemeParam} */
|
|
@@ -111,14 +124,18 @@ declare class ThemePlatformApplicationValidator {
|
|
|
111
124
|
static archiveTheme(): ArchiveThemeParam;
|
|
112
125
|
/** @returns {CreatePageParam} */
|
|
113
126
|
static createPage(): CreatePageParam;
|
|
114
|
-
/** @returns {CreateThemeParam} */
|
|
115
|
-
static createTheme(): CreateThemeParam;
|
|
116
127
|
/** @returns {DeletePageParam} */
|
|
117
128
|
static deletePage(): DeletePageParam;
|
|
118
129
|
/** @returns {DeleteThemeParam} */
|
|
119
130
|
static deleteTheme(): DeleteThemeParam;
|
|
131
|
+
/** @returns {DuplicateThemeParam} */
|
|
132
|
+
static duplicateTheme(): DuplicateThemeParam;
|
|
120
133
|
/** @returns {GetAllPagesParam} */
|
|
121
134
|
static getAllPages(): GetAllPagesParam;
|
|
135
|
+
/** @returns {GetApplicationThemesParam} */
|
|
136
|
+
static getApplicationThemes(): any;
|
|
137
|
+
/** @returns {GetApplicationThemesCountParam} */
|
|
138
|
+
static getApplicationThemesCount(): any;
|
|
122
139
|
/** @returns {GetAppliedThemeParam} */
|
|
123
140
|
static getAppliedTheme(): any;
|
|
124
141
|
/** @returns {GetFontsParam} */
|
|
@@ -149,17 +166,25 @@ declare class ThemePlatformApplicationValidator {
|
|
|
149
166
|
static updatePage(): UpdatePageParam;
|
|
150
167
|
/** @returns {UpdateThemeParam} */
|
|
151
168
|
static updateTheme(): UpdateThemeParam;
|
|
169
|
+
/** @returns {UpdateThemeNameParam} */
|
|
170
|
+
static updateThemeName(): UpdateThemeNameParam;
|
|
152
171
|
/** @returns {UpgradeThemeParam} */
|
|
153
172
|
static upgradeTheme(): UpgradeThemeParam;
|
|
154
173
|
}
|
|
155
174
|
declare namespace ThemePlatformApplicationValidator {
|
|
156
|
-
export { AddToThemeLibraryParam, ApplyThemeParam, ArchiveThemeParam, CreatePageParam,
|
|
175
|
+
export { AddThemeToApplicationParam, AddToThemeLibraryParam, ApplyThemeParam, ArchiveThemeParam, CreatePageParam, DeletePageParam, DeleteThemeParam, DuplicateThemeParam, GetAllPagesParam, GetApplicationThemesParam, GetApplicationThemesCountParam, GetAppliedThemeParam, GetFontsParam, GetPageParam, GetPublicThemesParam, GetThemeByIdParam, GetThemeForPreviewParam, GetThemeLastModifiedParam, GetThemeLibraryParam, IsUpgradableParam, PublishThemeParam, UnarchiveThemeParam, UnpublishThemeParam, UpdateMultiplePagesParam, UpdatePageParam, UpdateThemeParam, UpdateThemeNameParam, UpgradeThemeParam };
|
|
157
176
|
}
|
|
177
|
+
type AddThemeToApplicationParam = {
|
|
178
|
+
body: ThemePlatformModel.ThemeReq;
|
|
179
|
+
};
|
|
158
180
|
type AddToThemeLibraryParam = {
|
|
159
181
|
body: ThemePlatformModel.AddThemeRequestSchema;
|
|
160
182
|
};
|
|
161
183
|
type ApplyThemeParam = {
|
|
162
|
-
|
|
184
|
+
/**
|
|
185
|
+
* - The ID of the apply
|
|
186
|
+
*/
|
|
187
|
+
themeId: string;
|
|
163
188
|
};
|
|
164
189
|
type ArchiveThemeParam = {
|
|
165
190
|
/**
|
|
@@ -174,9 +199,6 @@ type CreatePageParam = {
|
|
|
174
199
|
themeId: string;
|
|
175
200
|
body: ThemePlatformModel.AvailablePageSchema;
|
|
176
201
|
};
|
|
177
|
-
type CreateThemeParam = {
|
|
178
|
-
body: ThemePlatformModel.ThemesSchema;
|
|
179
|
-
};
|
|
180
202
|
type DeletePageParam = {
|
|
181
203
|
/**
|
|
182
204
|
* - ID of the theme
|
|
@@ -189,7 +211,13 @@ type DeletePageParam = {
|
|
|
189
211
|
};
|
|
190
212
|
type DeleteThemeParam = {
|
|
191
213
|
/**
|
|
192
|
-
* - ID
|
|
214
|
+
* - The ID of the theme to be deleted.
|
|
215
|
+
*/
|
|
216
|
+
themeId: string;
|
|
217
|
+
};
|
|
218
|
+
type DuplicateThemeParam = {
|
|
219
|
+
/**
|
|
220
|
+
* - The ID of the theme to be duplicated
|
|
193
221
|
*/
|
|
194
222
|
themeId: string;
|
|
195
223
|
};
|
|
@@ -223,13 +251,13 @@ type GetPublicThemesParam = {
|
|
|
223
251
|
};
|
|
224
252
|
type GetThemeByIdParam = {
|
|
225
253
|
/**
|
|
226
|
-
* - ID
|
|
254
|
+
* - The ID of the theme
|
|
227
255
|
*/
|
|
228
256
|
themeId: string;
|
|
229
257
|
};
|
|
230
258
|
type GetThemeForPreviewParam = {
|
|
231
259
|
/**
|
|
232
|
-
* - ID
|
|
260
|
+
* - The ID of the theme
|
|
233
261
|
*/
|
|
234
262
|
themeId: string;
|
|
235
263
|
};
|
|
@@ -253,7 +281,7 @@ type GetThemeLibraryParam = {
|
|
|
253
281
|
};
|
|
254
282
|
type IsUpgradableParam = {
|
|
255
283
|
/**
|
|
256
|
-
* -
|
|
284
|
+
* - The ID of the theme
|
|
257
285
|
*/
|
|
258
286
|
themeId: string;
|
|
259
287
|
};
|
|
@@ -295,17 +323,26 @@ type UpdatePageParam = {
|
|
|
295
323
|
};
|
|
296
324
|
type UpdateThemeParam = {
|
|
297
325
|
/**
|
|
298
|
-
* - ID
|
|
326
|
+
* - The ID of the theme.
|
|
327
|
+
*/
|
|
328
|
+
themeId: string;
|
|
329
|
+
body: ThemePlatformModel.UpdateThemeRequestBody;
|
|
330
|
+
};
|
|
331
|
+
type UpdateThemeNameParam = {
|
|
332
|
+
/**
|
|
333
|
+
* - The ID of the theme to be updated.
|
|
299
334
|
*/
|
|
300
335
|
themeId: string;
|
|
301
|
-
body: ThemePlatformModel.
|
|
336
|
+
body: ThemePlatformModel.UpdateThemeNameRequestBody;
|
|
302
337
|
};
|
|
303
338
|
type UpgradeThemeParam = {
|
|
304
339
|
/**
|
|
305
|
-
* - ID
|
|
340
|
+
* - The ID of the upgrade
|
|
306
341
|
*/
|
|
307
342
|
themeId: string;
|
|
308
343
|
};
|
|
344
|
+
type GetApplicationThemesParam = any;
|
|
345
|
+
type GetApplicationThemesCountParam = any;
|
|
309
346
|
type GetAppliedThemeParam = any;
|
|
310
347
|
type GetFontsParam = any;
|
|
311
348
|
import ThemePlatformModel = require("./ThemePlatformModel");
|
|
@@ -2,6 +2,11 @@ const Joi = require("joi");
|
|
|
2
2
|
|
|
3
3
|
const ThemePlatformModel = require("./ThemePlatformModel");
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* @typedef AddThemeToApplicationParam
|
|
7
|
+
* @property {ThemePlatformModel.ThemeReq} body
|
|
8
|
+
*/
|
|
9
|
+
|
|
5
10
|
/**
|
|
6
11
|
* @typedef AddToThemeLibraryParam
|
|
7
12
|
* @property {ThemePlatformModel.AddThemeRequestSchema} body
|
|
@@ -9,7 +14,7 @@ const ThemePlatformModel = require("./ThemePlatformModel");
|
|
|
9
14
|
|
|
10
15
|
/**
|
|
11
16
|
* @typedef ApplyThemeParam
|
|
12
|
-
* @property {
|
|
17
|
+
* @property {string} themeId - The ID of the apply
|
|
13
18
|
*/
|
|
14
19
|
|
|
15
20
|
/**
|
|
@@ -23,11 +28,6 @@ const ThemePlatformModel = require("./ThemePlatformModel");
|
|
|
23
28
|
* @property {ThemePlatformModel.AvailablePageSchema} body
|
|
24
29
|
*/
|
|
25
30
|
|
|
26
|
-
/**
|
|
27
|
-
* @typedef CreateThemeParam
|
|
28
|
-
* @property {ThemePlatformModel.ThemesSchema} body
|
|
29
|
-
*/
|
|
30
|
-
|
|
31
31
|
/**
|
|
32
32
|
* @typedef DeletePageParam
|
|
33
33
|
* @property {string} themeId - ID of the theme
|
|
@@ -36,7 +36,12 @@ const ThemePlatformModel = require("./ThemePlatformModel");
|
|
|
36
36
|
|
|
37
37
|
/**
|
|
38
38
|
* @typedef DeleteThemeParam
|
|
39
|
-
* @property {string} themeId - ID
|
|
39
|
+
* @property {string} themeId - The ID of the theme to be deleted.
|
|
40
|
+
*/
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* @typedef DuplicateThemeParam
|
|
44
|
+
* @property {string} themeId - The ID of the theme to be duplicated
|
|
40
45
|
*/
|
|
41
46
|
|
|
42
47
|
/**
|
|
@@ -44,6 +49,10 @@ const ThemePlatformModel = require("./ThemePlatformModel");
|
|
|
44
49
|
* @property {string} themeId - ID of the theme to be retrieved
|
|
45
50
|
*/
|
|
46
51
|
|
|
52
|
+
/** @typedef GetApplicationThemesParam */
|
|
53
|
+
|
|
54
|
+
/** @typedef GetApplicationThemesCountParam */
|
|
55
|
+
|
|
47
56
|
/** @typedef GetAppliedThemeParam */
|
|
48
57
|
|
|
49
58
|
/** @typedef GetFontsParam */
|
|
@@ -64,12 +73,12 @@ const ThemePlatformModel = require("./ThemePlatformModel");
|
|
|
64
73
|
|
|
65
74
|
/**
|
|
66
75
|
* @typedef GetThemeByIdParam
|
|
67
|
-
* @property {string} themeId - ID
|
|
76
|
+
* @property {string} themeId - The ID of the theme
|
|
68
77
|
*/
|
|
69
78
|
|
|
70
79
|
/**
|
|
71
80
|
* @typedef GetThemeForPreviewParam
|
|
72
|
-
* @property {string} themeId - ID
|
|
81
|
+
* @property {string} themeId - The ID of the theme
|
|
73
82
|
*/
|
|
74
83
|
|
|
75
84
|
/**
|
|
@@ -87,7 +96,7 @@ const ThemePlatformModel = require("./ThemePlatformModel");
|
|
|
87
96
|
|
|
88
97
|
/**
|
|
89
98
|
* @typedef IsUpgradableParam
|
|
90
|
-
* @property {string} themeId -
|
|
99
|
+
* @property {string} themeId - The ID of the theme
|
|
91
100
|
*/
|
|
92
101
|
|
|
93
102
|
/**
|
|
@@ -120,16 +129,29 @@ const ThemePlatformModel = require("./ThemePlatformModel");
|
|
|
120
129
|
|
|
121
130
|
/**
|
|
122
131
|
* @typedef UpdateThemeParam
|
|
123
|
-
* @property {string} themeId - ID
|
|
124
|
-
* @property {ThemePlatformModel.
|
|
132
|
+
* @property {string} themeId - The ID of the theme.
|
|
133
|
+
* @property {ThemePlatformModel.UpdateThemeRequestBody} body
|
|
134
|
+
*/
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* @typedef UpdateThemeNameParam
|
|
138
|
+
* @property {string} themeId - The ID of the theme to be updated.
|
|
139
|
+
* @property {ThemePlatformModel.UpdateThemeNameRequestBody} body
|
|
125
140
|
*/
|
|
126
141
|
|
|
127
142
|
/**
|
|
128
143
|
* @typedef UpgradeThemeParam
|
|
129
|
-
* @property {string} themeId - ID
|
|
144
|
+
* @property {string} themeId - The ID of the upgrade
|
|
130
145
|
*/
|
|
131
146
|
|
|
132
147
|
class ThemePlatformApplicationValidator {
|
|
148
|
+
/** @returns {AddThemeToApplicationParam} */
|
|
149
|
+
static addThemeToApplication() {
|
|
150
|
+
return Joi.object({
|
|
151
|
+
body: ThemePlatformModel.ThemeReq().required(),
|
|
152
|
+
}).required();
|
|
153
|
+
}
|
|
154
|
+
|
|
133
155
|
/** @returns {AddToThemeLibraryParam} */
|
|
134
156
|
static addToThemeLibrary() {
|
|
135
157
|
return Joi.object({
|
|
@@ -140,7 +162,7 @@ class ThemePlatformApplicationValidator {
|
|
|
140
162
|
/** @returns {ApplyThemeParam} */
|
|
141
163
|
static applyTheme() {
|
|
142
164
|
return Joi.object({
|
|
143
|
-
|
|
165
|
+
themeId: Joi.string().allow("").required(),
|
|
144
166
|
}).required();
|
|
145
167
|
}
|
|
146
168
|
|
|
@@ -159,13 +181,6 @@ class ThemePlatformApplicationValidator {
|
|
|
159
181
|
}).required();
|
|
160
182
|
}
|
|
161
183
|
|
|
162
|
-
/** @returns {CreateThemeParam} */
|
|
163
|
-
static createTheme() {
|
|
164
|
-
return Joi.object({
|
|
165
|
-
body: ThemePlatformModel.ThemesSchema().required(),
|
|
166
|
-
}).required();
|
|
167
|
-
}
|
|
168
|
-
|
|
169
184
|
/** @returns {DeletePageParam} */
|
|
170
185
|
static deletePage() {
|
|
171
186
|
return Joi.object({
|
|
@@ -181,6 +196,13 @@ class ThemePlatformApplicationValidator {
|
|
|
181
196
|
}).required();
|
|
182
197
|
}
|
|
183
198
|
|
|
199
|
+
/** @returns {DuplicateThemeParam} */
|
|
200
|
+
static duplicateTheme() {
|
|
201
|
+
return Joi.object({
|
|
202
|
+
themeId: Joi.string().allow("").required(),
|
|
203
|
+
}).required();
|
|
204
|
+
}
|
|
205
|
+
|
|
184
206
|
/** @returns {GetAllPagesParam} */
|
|
185
207
|
static getAllPages() {
|
|
186
208
|
return Joi.object({
|
|
@@ -188,6 +210,16 @@ class ThemePlatformApplicationValidator {
|
|
|
188
210
|
}).required();
|
|
189
211
|
}
|
|
190
212
|
|
|
213
|
+
/** @returns {GetApplicationThemesParam} */
|
|
214
|
+
static getApplicationThemes() {
|
|
215
|
+
return Joi.object({}).required();
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
/** @returns {GetApplicationThemesCountParam} */
|
|
219
|
+
static getApplicationThemesCount() {
|
|
220
|
+
return Joi.object({}).required();
|
|
221
|
+
}
|
|
222
|
+
|
|
191
223
|
/** @returns {GetAppliedThemeParam} */
|
|
192
224
|
static getAppliedTheme() {
|
|
193
225
|
return Joi.object({}).required();
|
|
@@ -292,7 +324,15 @@ class ThemePlatformApplicationValidator {
|
|
|
292
324
|
static updateTheme() {
|
|
293
325
|
return Joi.object({
|
|
294
326
|
themeId: Joi.string().allow("").required(),
|
|
295
|
-
body: ThemePlatformModel.
|
|
327
|
+
body: ThemePlatformModel.UpdateThemeRequestBody().required(),
|
|
328
|
+
}).required();
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
/** @returns {UpdateThemeNameParam} */
|
|
332
|
+
static updateThemeName() {
|
|
333
|
+
return Joi.object({
|
|
334
|
+
themeId: Joi.string().allow("").required(),
|
|
335
|
+
body: ThemePlatformModel.UpdateThemeNameRequestBody().required(),
|
|
296
336
|
}).required();
|
|
297
337
|
}
|
|
298
338
|
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export = Theme;
|
|
2
|
+
declare class Theme {
|
|
3
|
+
constructor(config: any);
|
|
4
|
+
config: any;
|
|
5
|
+
/**
|
|
6
|
+
* @param {ThemePlatformValidator.AddMarketplaceThemeToCompanyParam} arg - Arg object
|
|
7
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
8
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
9
|
+
* @returns {Promise<ThemePlatformModel.CompanyThemeSchema>} - Success response
|
|
10
|
+
* @name addMarketplaceThemeToCompany
|
|
11
|
+
* @summary: Add a theme to a company
|
|
12
|
+
* @description: Add a marketplace theme to a company by providing the theme ID and company ID. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/theme/addMarketplaceThemeToCompany/).
|
|
13
|
+
*/
|
|
14
|
+
addMarketplaceThemeToCompany({ body, requestHeaders }?: ThemePlatformValidator.AddMarketplaceThemeToCompanyParam, { responseHeaders }?: object): Promise<ThemePlatformModel.CompanyThemeSchema>;
|
|
15
|
+
/**
|
|
16
|
+
* @param {ThemePlatformValidator.DeleteCompanyThemeParam} arg - Arg object
|
|
17
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
18
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
19
|
+
* @returns {Promise<ThemePlatformModel.CompanyThemeSchema>} - Success response
|
|
20
|
+
* @name deleteCompanyTheme
|
|
21
|
+
* @summary: Delete a theme
|
|
22
|
+
* @description: Delete a specific theme for a company by providing the company ID and theme ID. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/theme/deleteCompanyTheme/).
|
|
23
|
+
*/
|
|
24
|
+
deleteCompanyTheme({ themeId, requestHeaders }?: ThemePlatformValidator.DeleteCompanyThemeParam, { responseHeaders }?: object): Promise<ThemePlatformModel.CompanyThemeSchema>;
|
|
25
|
+
/**
|
|
26
|
+
* @param {ThemePlatformValidator.GetCompanyLevelThemesParam} arg - Arg object
|
|
27
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
28
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
29
|
+
* @returns {Promise<ThemePlatformModel.CompanyThemeSchema[]>} - Success response
|
|
30
|
+
* @name getCompanyLevelThemes
|
|
31
|
+
* @summary: Get themes for a company
|
|
32
|
+
* @description: Retrieve a list of themes available for a specific company. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/theme/getCompanyLevelThemes/).
|
|
33
|
+
*/
|
|
34
|
+
getCompanyLevelThemes({ requestHeaders }?: any, { responseHeaders }?: object): Promise<ThemePlatformModel.CompanyThemeSchema[]>;
|
|
35
|
+
}
|
|
36
|
+
import ThemePlatformValidator = require("./ThemePlatformValidator");
|
|
37
|
+
import ThemePlatformModel = require("./ThemePlatformModel");
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
const PlatformAPIClient = require("../PlatformAPIClient");
|
|
2
|
+
const { FDKClientValidationError } = require("../../common/FDKError");
|
|
3
|
+
const Paginator = require("../../common/Paginator");
|
|
4
|
+
const ThemePlatformValidator = require("./ThemePlatformValidator");
|
|
5
|
+
const ThemePlatformModel = require("./ThemePlatformModel");
|
|
6
|
+
const { Logger } = require("./../../common/Logger");
|
|
7
|
+
const Joi = require("joi");
|
|
8
|
+
|
|
9
|
+
class Theme {
|
|
10
|
+
constructor(config) {
|
|
11
|
+
this.config = config;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* @param {ThemePlatformValidator.AddMarketplaceThemeToCompanyParam} arg - Arg object
|
|
16
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
17
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
18
|
+
* @returns {Promise<ThemePlatformModel.CompanyThemeSchema>} - Success response
|
|
19
|
+
* @name addMarketplaceThemeToCompany
|
|
20
|
+
* @summary: Add a theme to a company
|
|
21
|
+
* @description: Add a marketplace theme to a company by providing the theme ID and company ID. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/theme/addMarketplaceThemeToCompany/).
|
|
22
|
+
*/
|
|
23
|
+
async addMarketplaceThemeToCompany(
|
|
24
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
25
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
26
|
+
) {
|
|
27
|
+
const {
|
|
28
|
+
error,
|
|
29
|
+
} = ThemePlatformValidator.addMarketplaceThemeToCompany().validate(
|
|
30
|
+
{
|
|
31
|
+
body,
|
|
32
|
+
},
|
|
33
|
+
{ abortEarly: false, allowUnknown: true }
|
|
34
|
+
);
|
|
35
|
+
if (error) {
|
|
36
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// Showing warrnings if extra unknown parameters are found
|
|
40
|
+
const {
|
|
41
|
+
error: warrning,
|
|
42
|
+
} = ThemePlatformValidator.addMarketplaceThemeToCompany().validate(
|
|
43
|
+
{
|
|
44
|
+
body,
|
|
45
|
+
},
|
|
46
|
+
{ abortEarly: false, allowUnknown: false }
|
|
47
|
+
);
|
|
48
|
+
if (warrning) {
|
|
49
|
+
Logger({
|
|
50
|
+
level: "WARN",
|
|
51
|
+
message: `Parameter Validation warrnings for platform > Theme > addMarketplaceThemeToCompany \n ${warrning}`,
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const query_params = {};
|
|
56
|
+
|
|
57
|
+
const xHeaders = {};
|
|
58
|
+
|
|
59
|
+
const response = await PlatformAPIClient.execute(
|
|
60
|
+
this.config,
|
|
61
|
+
"post",
|
|
62
|
+
`/service/platform/theme/v2.0/company/${this.config.companyId}`,
|
|
63
|
+
query_params,
|
|
64
|
+
body,
|
|
65
|
+
{ ...xHeaders, ...requestHeaders },
|
|
66
|
+
{ responseHeaders }
|
|
67
|
+
);
|
|
68
|
+
|
|
69
|
+
let responseData = response;
|
|
70
|
+
if (responseHeaders) {
|
|
71
|
+
responseData = response[0];
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
const {
|
|
75
|
+
error: res_error,
|
|
76
|
+
} = ThemePlatformModel.CompanyThemeSchema().validate(responseData, {
|
|
77
|
+
abortEarly: false,
|
|
78
|
+
allowUnknown: false,
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
if (res_error) {
|
|
82
|
+
Logger({
|
|
83
|
+
level: "WARN",
|
|
84
|
+
message: `Response Validation Warnnings for platform > Theme > addMarketplaceThemeToCompany \n ${res_error}`,
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
return response;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* @param {ThemePlatformValidator.DeleteCompanyThemeParam} arg - Arg object
|
|
93
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
94
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
95
|
+
* @returns {Promise<ThemePlatformModel.CompanyThemeSchema>} - Success response
|
|
96
|
+
* @name deleteCompanyTheme
|
|
97
|
+
* @summary: Delete a theme
|
|
98
|
+
* @description: Delete a specific theme for a company by providing the company ID and theme ID. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/theme/deleteCompanyTheme/).
|
|
99
|
+
*/
|
|
100
|
+
async deleteCompanyTheme(
|
|
101
|
+
{ themeId, requestHeaders } = { requestHeaders: {} },
|
|
102
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
103
|
+
) {
|
|
104
|
+
const { error } = ThemePlatformValidator.deleteCompanyTheme().validate(
|
|
105
|
+
{
|
|
106
|
+
themeId,
|
|
107
|
+
},
|
|
108
|
+
{ abortEarly: false, allowUnknown: true }
|
|
109
|
+
);
|
|
110
|
+
if (error) {
|
|
111
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
// Showing warrnings if extra unknown parameters are found
|
|
115
|
+
const {
|
|
116
|
+
error: warrning,
|
|
117
|
+
} = ThemePlatformValidator.deleteCompanyTheme().validate(
|
|
118
|
+
{
|
|
119
|
+
themeId,
|
|
120
|
+
},
|
|
121
|
+
{ abortEarly: false, allowUnknown: false }
|
|
122
|
+
);
|
|
123
|
+
if (warrning) {
|
|
124
|
+
Logger({
|
|
125
|
+
level: "WARN",
|
|
126
|
+
message: `Parameter Validation warrnings for platform > Theme > deleteCompanyTheme \n ${warrning}`,
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
const query_params = {};
|
|
131
|
+
|
|
132
|
+
const xHeaders = {};
|
|
133
|
+
|
|
134
|
+
const response = await PlatformAPIClient.execute(
|
|
135
|
+
this.config,
|
|
136
|
+
"delete",
|
|
137
|
+
`/service/platform/theme/v2.0/company/${this.config.companyId}/${themeId}`,
|
|
138
|
+
query_params,
|
|
139
|
+
undefined,
|
|
140
|
+
{ ...xHeaders, ...requestHeaders },
|
|
141
|
+
{ responseHeaders }
|
|
142
|
+
);
|
|
143
|
+
|
|
144
|
+
let responseData = response;
|
|
145
|
+
if (responseHeaders) {
|
|
146
|
+
responseData = response[0];
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
const {
|
|
150
|
+
error: res_error,
|
|
151
|
+
} = ThemePlatformModel.CompanyThemeSchema().validate(responseData, {
|
|
152
|
+
abortEarly: false,
|
|
153
|
+
allowUnknown: false,
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
if (res_error) {
|
|
157
|
+
Logger({
|
|
158
|
+
level: "WARN",
|
|
159
|
+
message: `Response Validation Warnnings for platform > Theme > deleteCompanyTheme \n ${res_error}`,
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
return response;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* @param {ThemePlatformValidator.GetCompanyLevelThemesParam} arg - Arg object
|
|
168
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
169
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
170
|
+
* @returns {Promise<ThemePlatformModel.CompanyThemeSchema[]>} - Success response
|
|
171
|
+
* @name getCompanyLevelThemes
|
|
172
|
+
* @summary: Get themes for a company
|
|
173
|
+
* @description: Retrieve a list of themes available for a specific company. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/theme/getCompanyLevelThemes/).
|
|
174
|
+
*/
|
|
175
|
+
async getCompanyLevelThemes(
|
|
176
|
+
{ requestHeaders } = { requestHeaders: {} },
|
|
177
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
178
|
+
) {
|
|
179
|
+
const { error } = ThemePlatformValidator.getCompanyLevelThemes().validate(
|
|
180
|
+
{},
|
|
181
|
+
{ abortEarly: false, allowUnknown: true }
|
|
182
|
+
);
|
|
183
|
+
if (error) {
|
|
184
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
// Showing warrnings if extra unknown parameters are found
|
|
188
|
+
const {
|
|
189
|
+
error: warrning,
|
|
190
|
+
} = ThemePlatformValidator.getCompanyLevelThemes().validate(
|
|
191
|
+
{},
|
|
192
|
+
{ abortEarly: false, allowUnknown: false }
|
|
193
|
+
);
|
|
194
|
+
if (warrning) {
|
|
195
|
+
Logger({
|
|
196
|
+
level: "WARN",
|
|
197
|
+
message: `Parameter Validation warrnings for platform > Theme > getCompanyLevelThemes \n ${warrning}`,
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
const query_params = {};
|
|
202
|
+
|
|
203
|
+
const xHeaders = {};
|
|
204
|
+
|
|
205
|
+
const response = await PlatformAPIClient.execute(
|
|
206
|
+
this.config,
|
|
207
|
+
"get",
|
|
208
|
+
`/service/platform/theme/v2.0/company/${this.config.companyId}/themes`,
|
|
209
|
+
query_params,
|
|
210
|
+
undefined,
|
|
211
|
+
{ ...xHeaders, ...requestHeaders },
|
|
212
|
+
{ responseHeaders }
|
|
213
|
+
);
|
|
214
|
+
|
|
215
|
+
let responseData = response;
|
|
216
|
+
if (responseHeaders) {
|
|
217
|
+
responseData = response[0];
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
const { error: res_error } = Joi.array()
|
|
221
|
+
.items(ThemePlatformModel.CompanyThemeSchema())
|
|
222
|
+
.validate(responseData, { abortEarly: false, allowUnknown: false });
|
|
223
|
+
|
|
224
|
+
if (res_error) {
|
|
225
|
+
Logger({
|
|
226
|
+
level: "WARN",
|
|
227
|
+
message: `Response Validation Warnnings for platform > Theme > getCompanyLevelThemes \n ${res_error}`,
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
return response;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
module.exports = Theme;
|