@gofynd/fdk-client-javascript 1.2.0 → 1.3.1-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +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 +6 -4
- package/sdk/application/Cart/CartApplicationModel.js +6 -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 +90 -7
- package/sdk/platform/Webhook/WebhookPlatformValidator.js +113 -3
- 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
package/sdk/common/utils.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
const { FDKException } = require("./FDKError");
|
|
2
|
+
|
|
1
3
|
const SLUG_DELIMETER = ":::";
|
|
2
4
|
const transformRequestOptions = (params) => {
|
|
3
5
|
let options = "";
|
|
@@ -153,6 +155,30 @@ const NAV_TYPE = {
|
|
|
153
155
|
POPUP: "popup",
|
|
154
156
|
};
|
|
155
157
|
|
|
158
|
+
const isBrowser = () => {
|
|
159
|
+
return (
|
|
160
|
+
typeof window !== "undefined" && typeof window.document !== "undefined"
|
|
161
|
+
);
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
const isNode = () => {
|
|
165
|
+
return (
|
|
166
|
+
typeof process !== "undefined" &&
|
|
167
|
+
process.versions != null &&
|
|
168
|
+
process.versions.node != null
|
|
169
|
+
);
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
const convertStringToBase64 = (string) => {
|
|
173
|
+
if (isNode()) {
|
|
174
|
+
return Buffer.from(string, "utf-8").toString("base64");
|
|
175
|
+
} else if (isBrowser()) {
|
|
176
|
+
return window.btoa(string);
|
|
177
|
+
} else {
|
|
178
|
+
throw FDKException("Base64 conversion error: Unsupported environment");
|
|
179
|
+
}
|
|
180
|
+
};
|
|
181
|
+
|
|
156
182
|
module.exports = {
|
|
157
183
|
transformRequestOptions,
|
|
158
184
|
getParamsFromItem,
|
|
@@ -161,5 +187,8 @@ module.exports = {
|
|
|
161
187
|
generateUrlWithParams,
|
|
162
188
|
findBestMatchingLink,
|
|
163
189
|
validURL,
|
|
190
|
+
convertStringToBase64,
|
|
191
|
+
isBrowser,
|
|
192
|
+
isNode,
|
|
164
193
|
NAV_TYPE,
|
|
165
194
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export = APIClient;
|
|
2
2
|
/**
|
|
3
3
|
* @typedef {Object} Options
|
|
4
|
-
* @property {boolean}
|
|
4
|
+
* @property {boolean} responseHeaders - Whether response headers are returned or not.
|
|
5
5
|
*/
|
|
6
6
|
declare class APIClient {
|
|
7
7
|
/**
|
|
@@ -10,9 +10,10 @@ declare class APIClient {
|
|
|
10
10
|
* @param {string} url
|
|
11
11
|
* @param {object} query
|
|
12
12
|
* @param {object} body
|
|
13
|
+
* @param {object} xHeaders
|
|
13
14
|
* @param {Options} options
|
|
14
15
|
*/
|
|
15
|
-
static execute(conf: object, method: string, url: string, query: object, body: object, options: Options): Promise<any>;
|
|
16
|
+
static execute(conf: object, method: string, url: string, query: object, body: object, xHeaders: object, options: Options): Promise<any>;
|
|
16
17
|
get(url: any, config: any): Promise<any>;
|
|
17
18
|
}
|
|
18
19
|
declare namespace APIClient {
|
|
@@ -20,7 +21,7 @@ declare namespace APIClient {
|
|
|
20
21
|
}
|
|
21
22
|
type Options = {
|
|
22
23
|
/**
|
|
23
|
-
* - Whether headers are returned or not.
|
|
24
|
+
* - Whether response headers are returned or not.
|
|
24
25
|
*/
|
|
25
|
-
|
|
26
|
+
responseHeaders: boolean;
|
|
26
27
|
};
|
|
@@ -2,7 +2,7 @@ const { fdkAxios } = require("../common/AxiosHelper");
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* @typedef {Object} Options
|
|
5
|
-
* @property {boolean}
|
|
5
|
+
* @property {boolean} responseHeaders - Whether response headers are returned or not.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
class APIClient {
|
|
@@ -12,9 +12,10 @@ class APIClient {
|
|
|
12
12
|
* @param {string} url
|
|
13
13
|
* @param {object} query
|
|
14
14
|
* @param {object} body
|
|
15
|
+
* @param {object} xHeaders
|
|
15
16
|
* @param {Options} options
|
|
16
17
|
*/
|
|
17
|
-
static async execute(conf, method, url, query, body, options) {
|
|
18
|
+
static async execute(conf, method, url, query, body, xHeaders, options) {
|
|
18
19
|
const token = await conf.oauthClient.getNewAccessToken();
|
|
19
20
|
|
|
20
21
|
const extraHeaders = conf.extraHeaders.reduce((acc, curr) => {
|
|
@@ -22,7 +23,7 @@ class APIClient {
|
|
|
22
23
|
return acc;
|
|
23
24
|
}, {});
|
|
24
25
|
|
|
25
|
-
|
|
26
|
+
let rawRequest = {
|
|
26
27
|
baseURL: conf.domain,
|
|
27
28
|
method: method,
|
|
28
29
|
url: url,
|
|
@@ -31,9 +32,11 @@ class APIClient {
|
|
|
31
32
|
headers: {
|
|
32
33
|
Authorization: "Bearer " + token,
|
|
33
34
|
...extraHeaders,
|
|
35
|
+
...xHeaders,
|
|
34
36
|
},
|
|
35
|
-
|
|
37
|
+
responseHeaders: options.responseHeaders,
|
|
36
38
|
};
|
|
39
|
+
rawRequest = JSON.parse(JSON.stringify(rawRequest));
|
|
37
40
|
|
|
38
41
|
return fdkAxios.request(rawRequest);
|
|
39
42
|
}
|
|
@@ -13,6 +13,7 @@ declare class PartnerClient {
|
|
|
13
13
|
*/
|
|
14
14
|
constructor(config: import("./PartnerConfig"));
|
|
15
15
|
config: import("./PartnerConfig");
|
|
16
|
+
theme: Theme;
|
|
16
17
|
/**
|
|
17
18
|
* Sets the extra headers for the partner client.
|
|
18
19
|
*
|
|
@@ -21,3 +22,4 @@ declare class PartnerClient {
|
|
|
21
22
|
*/
|
|
22
23
|
setExtraHeaders(header: object): void;
|
|
23
24
|
}
|
|
25
|
+
import Theme = require("./Theme/ThemePartnerClient");
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
const Theme = require("./Theme/ThemePartnerClient");
|
|
2
|
+
|
|
1
3
|
const { FDKClientValidationError } = require("../common/FDKError");
|
|
2
4
|
|
|
3
5
|
/**
|
|
@@ -14,6 +16,7 @@ class PartnerClient {
|
|
|
14
16
|
*/
|
|
15
17
|
constructor(config) {
|
|
16
18
|
this.config = config;
|
|
19
|
+
this.theme = new Theme(config);
|
|
17
20
|
}
|
|
18
21
|
|
|
19
22
|
/**
|
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
export = Theme;
|
|
2
|
+
declare class Theme {
|
|
3
|
+
constructor(config: any);
|
|
4
|
+
config: any;
|
|
5
|
+
/**
|
|
6
|
+
* @param {Object} arg - Arg object.
|
|
7
|
+
* @param {number} arg.companyId - Company ID
|
|
8
|
+
* @param {string} arg.applicationId - Application ID
|
|
9
|
+
* @param {string} arg.themeId - ID of the theme to be retrieved
|
|
10
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
11
|
+
* @param {import("../PartnerAPIClient").Options} - Options
|
|
12
|
+
* @summary: Get all pages of a theme
|
|
13
|
+
* @description: Use this API to retrieve all the available pages of a theme by its ID.
|
|
14
|
+
*/
|
|
15
|
+
getAllPages({ companyId, applicationId, themeId, requestHeaders }?: {
|
|
16
|
+
companyId: number;
|
|
17
|
+
applicationId: string;
|
|
18
|
+
themeId: string;
|
|
19
|
+
requestHeaders?: object;
|
|
20
|
+
}, { responseHeaders }?: import("../PartnerAPIClient").Options): Promise<any>;
|
|
21
|
+
/**
|
|
22
|
+
* @param {Object} arg - Arg object.
|
|
23
|
+
* @param {number} arg.companyId - Company ID
|
|
24
|
+
* @param {string} arg.applicationId - Application ID
|
|
25
|
+
* @param {string} arg.themeId - ID of the theme
|
|
26
|
+
* @param {AvailablePageSchema} arg.body
|
|
27
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
28
|
+
* @param {import("../PartnerAPIClient").Options} - Options
|
|
29
|
+
* @summary: Create a page
|
|
30
|
+
* @description: Use this API to create a page for a theme by its ID.
|
|
31
|
+
*/
|
|
32
|
+
createPage({ companyId, applicationId, themeId, body, requestHeaders }?: {
|
|
33
|
+
companyId: number;
|
|
34
|
+
applicationId: string;
|
|
35
|
+
themeId: string;
|
|
36
|
+
body: AvailablePageSchema;
|
|
37
|
+
requestHeaders?: object;
|
|
38
|
+
}, { responseHeaders }?: import("../PartnerAPIClient").Options): Promise<any>;
|
|
39
|
+
/**
|
|
40
|
+
* @param {Object} arg - Arg object.
|
|
41
|
+
* @param {number} arg.companyId - Company ID
|
|
42
|
+
* @param {string} arg.applicationId - Application ID
|
|
43
|
+
* @param {string} arg.themeId - ID of the theme to be retrieved
|
|
44
|
+
* @param {AllAvailablePageSchema} arg.body
|
|
45
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
46
|
+
* @param {import("../PartnerAPIClient").Options} - Options
|
|
47
|
+
* @summary: Update multiple pages of a theme
|
|
48
|
+
* @description: Use this API to update multiple pages of a theme by its ID.
|
|
49
|
+
*/
|
|
50
|
+
updateMultiplePages({ companyId, applicationId, themeId, body, requestHeaders }?: {
|
|
51
|
+
companyId: number;
|
|
52
|
+
applicationId: string;
|
|
53
|
+
themeId: string;
|
|
54
|
+
body: AllAvailablePageSchema;
|
|
55
|
+
requestHeaders?: object;
|
|
56
|
+
}, { responseHeaders }?: import("../PartnerAPIClient").Options): Promise<any>;
|
|
57
|
+
/**
|
|
58
|
+
* @param {Object} arg - Arg object.
|
|
59
|
+
* @param {number} arg.companyId - Company ID
|
|
60
|
+
* @param {string} arg.applicationId - Application ID
|
|
61
|
+
* @param {string} arg.themeId - ID of the theme to be retrieved
|
|
62
|
+
* @param {string} arg.pageValue - Value of the page to be retrieved
|
|
63
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
64
|
+
* @param {import("../PartnerAPIClient").Options} - Options
|
|
65
|
+
* @summary: Get page of a theme
|
|
66
|
+
* @description: Use this API to retrieve a page of a theme.
|
|
67
|
+
*/
|
|
68
|
+
getPage({ companyId, applicationId, themeId, pageValue, requestHeaders }?: {
|
|
69
|
+
companyId: number;
|
|
70
|
+
applicationId: string;
|
|
71
|
+
themeId: string;
|
|
72
|
+
pageValue: string;
|
|
73
|
+
requestHeaders?: object;
|
|
74
|
+
}, { responseHeaders }?: import("../PartnerAPIClient").Options): Promise<any>;
|
|
75
|
+
/**
|
|
76
|
+
* @param {Object} arg - Arg object.
|
|
77
|
+
* @param {number} arg.companyId - Company ID
|
|
78
|
+
* @param {string} arg.applicationId - Application ID
|
|
79
|
+
* @param {string} arg.themeId - ID of the theme
|
|
80
|
+
* @param {string} arg.pageValue - Value of the page to be updated
|
|
81
|
+
* @param {AvailablePageSchema} arg.body
|
|
82
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
83
|
+
* @param {import("../PartnerAPIClient").Options} - Options
|
|
84
|
+
* @summary: Updates a page
|
|
85
|
+
* @description: Use this API to update a page for a theme by its ID.
|
|
86
|
+
*/
|
|
87
|
+
updatePage({ companyId, applicationId, themeId, pageValue, body, requestHeaders }?: {
|
|
88
|
+
companyId: number;
|
|
89
|
+
applicationId: string;
|
|
90
|
+
themeId: string;
|
|
91
|
+
pageValue: string;
|
|
92
|
+
body: AvailablePageSchema;
|
|
93
|
+
requestHeaders?: object;
|
|
94
|
+
}, { responseHeaders }?: import("../PartnerAPIClient").Options): Promise<any>;
|
|
95
|
+
/**
|
|
96
|
+
* @param {Object} arg - Arg object.
|
|
97
|
+
* @param {number} arg.companyId - Company ID
|
|
98
|
+
* @param {string} arg.applicationId - Application ID
|
|
99
|
+
* @param {string} arg.themeId - ID of the theme
|
|
100
|
+
* @param {string} arg.pageValue - Value of the page to be updated
|
|
101
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
102
|
+
* @param {import("../PartnerAPIClient").Options} - Options
|
|
103
|
+
* @summary: Deletes a page
|
|
104
|
+
* @description: Use this API to delete a page for a theme by its ID and page_value.
|
|
105
|
+
*/
|
|
106
|
+
deletePage({ companyId, applicationId, themeId, pageValue, requestHeaders }?: {
|
|
107
|
+
companyId: number;
|
|
108
|
+
applicationId: string;
|
|
109
|
+
themeId: string;
|
|
110
|
+
pageValue: string;
|
|
111
|
+
requestHeaders?: object;
|
|
112
|
+
}, { responseHeaders }?: import("../PartnerAPIClient").Options): Promise<any>;
|
|
113
|
+
/**
|
|
114
|
+
* @param {Object} arg - Arg object.
|
|
115
|
+
* @param {number} arg.companyId - The ID of the company
|
|
116
|
+
* @param {string} arg.applicationId - The ID of the application
|
|
117
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
118
|
+
* @param {import("../PartnerAPIClient").Options} - Options
|
|
119
|
+
* @summary: Get all the themes for a specific application
|
|
120
|
+
* @description: Use this API to get list of theme
|
|
121
|
+
*/
|
|
122
|
+
getApplicationThemes({ companyId, applicationId, requestHeaders }?: {
|
|
123
|
+
companyId: number;
|
|
124
|
+
applicationId: string;
|
|
125
|
+
requestHeaders?: object;
|
|
126
|
+
}, { responseHeaders }?: import("../PartnerAPIClient").Options): Promise<any>;
|
|
127
|
+
/**
|
|
128
|
+
* @param {Object} arg - Arg object.
|
|
129
|
+
* @param {number} arg.companyId - The ID of the company
|
|
130
|
+
* @param {string} arg.applicationId - The ID of the application
|
|
131
|
+
* @param {string} arg.themeId - The ID of the theme
|
|
132
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
133
|
+
* @param {import("../PartnerAPIClient").Options} - Options
|
|
134
|
+
* @summary: Get Theme By Theme Id
|
|
135
|
+
* @description: Use this API to get theme details
|
|
136
|
+
*/
|
|
137
|
+
getThemeById({ companyId, applicationId, themeId, requestHeaders }?: {
|
|
138
|
+
companyId: number;
|
|
139
|
+
applicationId: string;
|
|
140
|
+
themeId: string;
|
|
141
|
+
requestHeaders?: object;
|
|
142
|
+
}, { responseHeaders }?: import("../PartnerAPIClient").Options): Promise<any>;
|
|
143
|
+
/**
|
|
144
|
+
* @param {Object} arg - Arg object.
|
|
145
|
+
* @param {number} arg.companyId - The ID of the company.
|
|
146
|
+
* @param {string} arg.applicationId - The ID of the application.
|
|
147
|
+
* @param {string} arg.themeId - The ID of the theme.
|
|
148
|
+
* @param {UpdateThemeRequestBody} arg.body
|
|
149
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
150
|
+
* @param {import("../PartnerAPIClient").Options} - Options
|
|
151
|
+
* @summary: Update theme for a specific company and application
|
|
152
|
+
* @description: Update theme for a specific company and application
|
|
153
|
+
*/
|
|
154
|
+
updateTheme({ companyId, applicationId, themeId, body, requestHeaders }?: {
|
|
155
|
+
companyId: number;
|
|
156
|
+
applicationId: string;
|
|
157
|
+
themeId: string;
|
|
158
|
+
body: UpdateThemeRequestBody;
|
|
159
|
+
requestHeaders?: object;
|
|
160
|
+
}, { responseHeaders }?: import("../PartnerAPIClient").Options): Promise<any>;
|
|
161
|
+
/**
|
|
162
|
+
* @param {Object} arg - Arg object.
|
|
163
|
+
* @param {number} arg.companyId - The ID of the company.
|
|
164
|
+
* @param {string} arg.applicationId - The ID of the application.
|
|
165
|
+
* @param {string} arg.themeId - The ID of the theme to be deleted.
|
|
166
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
167
|
+
* @param {import("../PartnerAPIClient").Options} - Options
|
|
168
|
+
* @summary: Delete a theme
|
|
169
|
+
* @description: This endpoint is used to delete a theme from the specified company and application.
|
|
170
|
+
*/
|
|
171
|
+
deleteTheme({ companyId, applicationId, themeId, requestHeaders }?: {
|
|
172
|
+
companyId: number;
|
|
173
|
+
applicationId: string;
|
|
174
|
+
themeId: string;
|
|
175
|
+
requestHeaders?: object;
|
|
176
|
+
}, { responseHeaders }?: import("../PartnerAPIClient").Options): Promise<any>;
|
|
177
|
+
/**
|
|
178
|
+
* @param {Object} arg - Arg object.
|
|
179
|
+
* @param {string} [arg.status] - The status of the theme
|
|
180
|
+
* @param {number} [arg.pageSize] - Number of themes per page
|
|
181
|
+
* @param {number} [arg.pageNo] - Page number to retrieve
|
|
182
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
183
|
+
* @param {import("../PartnerAPIClient").Options} - Options
|
|
184
|
+
* @summary: Get organization's themes
|
|
185
|
+
* @description: Get organization's themes
|
|
186
|
+
*/
|
|
187
|
+
getOrganizationThemes({ status, pageSize, pageNo, requestHeaders }?: {
|
|
188
|
+
status?: string;
|
|
189
|
+
pageSize?: number;
|
|
190
|
+
pageNo?: number;
|
|
191
|
+
requestHeaders?: object;
|
|
192
|
+
}, { responseHeaders }?: import("../PartnerAPIClient").Options): Promise<any>;
|
|
193
|
+
/**
|
|
194
|
+
* @param {Object} arg - Arg object.
|
|
195
|
+
* @param {string} arg.themeId - The ID of the theme
|
|
196
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
197
|
+
* @param {import("../PartnerAPIClient").Options} - Options
|
|
198
|
+
* @summary: Get theme details for an organization
|
|
199
|
+
* @description: Fetches the theme details for a specific organization and theme ID
|
|
200
|
+
*/
|
|
201
|
+
getOrganizationThemeDetails({ themeId, requestHeaders }?: {
|
|
202
|
+
themeId: string;
|
|
203
|
+
requestHeaders?: object;
|
|
204
|
+
}, { responseHeaders }?: import("../PartnerAPIClient").Options): Promise<any>;
|
|
205
|
+
/**
|
|
206
|
+
* @param {Object} arg - Arg object.
|
|
207
|
+
* @param {string} arg.themeId - The ID of the theme
|
|
208
|
+
* @param {MarketplaceTheme} arg.body
|
|
209
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
210
|
+
* @param {import("../PartnerAPIClient").Options} - Options
|
|
211
|
+
* @summary: Update theme draft/submitted
|
|
212
|
+
* @description: Update theme draft/submitted
|
|
213
|
+
*/
|
|
214
|
+
updateDraftTheme({ themeId, body, requestHeaders }?: {
|
|
215
|
+
themeId: string;
|
|
216
|
+
body: MarketplaceTheme;
|
|
217
|
+
requestHeaders?: object;
|
|
218
|
+
}, { responseHeaders }?: import("../PartnerAPIClient").Options): Promise<any>;
|
|
219
|
+
/**
|
|
220
|
+
* @param {Object} arg - Arg object.
|
|
221
|
+
* @param {string} arg.themeId - The ID of the theme
|
|
222
|
+
* @param {MarketplaceTheme} arg.body
|
|
223
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
224
|
+
* @param {import("../PartnerAPIClient").Options} - Options
|
|
225
|
+
* @summary: Submit a theme
|
|
226
|
+
* @description: Use this api to Submit a theme
|
|
227
|
+
*/
|
|
228
|
+
submitOrganizationTheme({ themeId, body, requestHeaders }?: {
|
|
229
|
+
themeId: string;
|
|
230
|
+
body: MarketplaceTheme;
|
|
231
|
+
requestHeaders?: object;
|
|
232
|
+
}, { responseHeaders }?: import("../PartnerAPIClient").Options): Promise<any>;
|
|
233
|
+
/**
|
|
234
|
+
* @param {Object} arg - Arg object.
|
|
235
|
+
* @param {string} arg.themeId - The ID of the theme
|
|
236
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
237
|
+
* @param {import("../PartnerAPIClient").Options} - Options
|
|
238
|
+
* @summary: Delete a theme
|
|
239
|
+
* @description: This endpoint allows you to delete a theme by providing the organization and theme IDs.
|
|
240
|
+
*/
|
|
241
|
+
deleteOrganizationTheme({ themeId, requestHeaders }?: {
|
|
242
|
+
themeId: string;
|
|
243
|
+
requestHeaders?: object;
|
|
244
|
+
}, { responseHeaders }?: import("../PartnerAPIClient").Options): Promise<any>;
|
|
245
|
+
/**
|
|
246
|
+
* @param {Object} arg - Arg object.
|
|
247
|
+
* @param {string} arg.slugName - Slug of theme
|
|
248
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
249
|
+
* @param {import("../PartnerAPIClient").Options} - Options
|
|
250
|
+
* @summary: Get latest version of specified theme
|
|
251
|
+
* @description: Use this api to get latest version of specified theme
|
|
252
|
+
*/
|
|
253
|
+
getLatestVersionOfThemeBySlug({ slugName, requestHeaders }?: {
|
|
254
|
+
slugName: string;
|
|
255
|
+
requestHeaders?: object;
|
|
256
|
+
}, { responseHeaders }?: import("../PartnerAPIClient").Options): Promise<any>;
|
|
257
|
+
/**
|
|
258
|
+
* @param {Object} arg - Arg object.
|
|
259
|
+
* @param {string} [arg.slug] - The slug of the theme.
|
|
260
|
+
* @param {MarketplaceTheme} arg.body
|
|
261
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
262
|
+
* @param {import("../PartnerAPIClient").Options} - Options
|
|
263
|
+
* @summary: Create a new theme for the organization
|
|
264
|
+
* @description: Use this api to create a new theme for the organization
|
|
265
|
+
*/
|
|
266
|
+
createNewThemeInOrganization({ body, slug, requestHeaders }?: {
|
|
267
|
+
slug?: string;
|
|
268
|
+
body: MarketplaceTheme;
|
|
269
|
+
requestHeaders?: object;
|
|
270
|
+
}, { responseHeaders }?: import("../PartnerAPIClient").Options): Promise<any>;
|
|
271
|
+
/**
|
|
272
|
+
* @param {Object} arg - Arg object.
|
|
273
|
+
* @param {string} arg.themeId - The ID of the theme
|
|
274
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
275
|
+
* @param {import("../PartnerAPIClient").Options} - Options
|
|
276
|
+
* @summary: Get theme rejection reasons
|
|
277
|
+
* @description: Use this api to get theme rejection reasons
|
|
278
|
+
*/
|
|
279
|
+
getThemeRejectionReasons({ themeId, requestHeaders }?: {
|
|
280
|
+
themeId: string;
|
|
281
|
+
requestHeaders?: object;
|
|
282
|
+
}, { responseHeaders }?: import("../PartnerAPIClient").Options): Promise<any>;
|
|
283
|
+
/**
|
|
284
|
+
* @param {Object} arg - Arg object.
|
|
285
|
+
* @param {string} arg.themeSlug - The slug of the theme.
|
|
286
|
+
* @param {number} [arg.pageSize] - The number of items to return per page.
|
|
287
|
+
* @param {number} [arg.pageNo] - The page number to return.
|
|
288
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
289
|
+
* @param {import("../PartnerAPIClient").Options} - Options
|
|
290
|
+
* @summary: Get theme versions
|
|
291
|
+
* @description: Retrieve a list of theme versions for a specific theme in an organization.
|
|
292
|
+
*/
|
|
293
|
+
getThemeVersions({ themeSlug, pageSize, pageNo, requestHeaders }?: {
|
|
294
|
+
themeSlug: string;
|
|
295
|
+
pageSize?: number;
|
|
296
|
+
pageNo?: number;
|
|
297
|
+
requestHeaders?: object;
|
|
298
|
+
}, { responseHeaders }?: import("../PartnerAPIClient").Options): Promise<any>;
|
|
299
|
+
}
|