@gofynd/fdk-client-javascript 1.0.0 → 1.0.2
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 +251 -251
- package/documentation/application/CATALOG.md +393 -393
- package/documentation/application/CONTENT.md +15 -1
- package/documentation/application/ORDER.md +268 -268
- package/documentation/application/PAYMENT.md +249 -249
- package/documentation/application/POSCART.md +297 -297
- package/documentation/platform/CART.md +499 -499
- package/documentation/platform/CATALOG.md +3497 -3097
- package/documentation/platform/COMPANYPROFILE.md +207 -207
- package/documentation/platform/CONTENT.md +123 -1
- package/documentation/platform/ORDER.md +1518 -1324
- package/documentation/platform/PARTNER.md +7 -7
- package/documentation/platform/PAYMENT.md +96 -96
- package/index.js +7 -1
- package/package.json +1 -1
- package/sdk/application/ApplicationConfig.js +1 -1
- package/sdk/application/Cart/CartApplicationClient.js +865 -52
- package/sdk/application/Cart/CartApplicationModel.d.ts +7 -7
- package/sdk/application/Cart/CartApplicationModel.js +335 -335
- package/sdk/application/Cart/CartApplicationValidator.js +1 -0
- package/sdk/application/Catalog/CatalogApplicationClient.d.ts +1 -1
- package/sdk/application/Catalog/CatalogApplicationClient.js +1034 -60
- package/sdk/application/Catalog/CatalogApplicationModel.d.ts +19 -19
- package/sdk/application/Catalog/CatalogApplicationModel.js +532 -532
- package/sdk/application/Catalog/CatalogApplicationValidator.js +1 -0
- package/sdk/application/Common/CommonApplicationClient.js +66 -4
- package/sdk/application/Common/CommonApplicationValidator.js +1 -0
- package/sdk/application/Communication/CommunicationApplicationClient.js +108 -6
- package/sdk/application/Communication/CommunicationApplicationValidator.js +1 -0
- package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +1 -1
- package/sdk/application/Configuration/ConfigurationApplicationClient.js +558 -32
- package/sdk/application/Configuration/ConfigurationApplicationValidator.js +1 -0
- package/sdk/application/Content/ContentApplicationClient.js +621 -38
- package/sdk/application/Content/ContentApplicationModel.d.ts +1 -0
- package/sdk/application/Content/ContentApplicationModel.js +11 -1
- package/sdk/application/Content/ContentApplicationValidator.js +1 -0
- package/sdk/application/FileStorage/FileStorageApplicationClient.js +101 -6
- package/sdk/application/FileStorage/FileStorageApplicationValidator.js +1 -0
- package/sdk/application/Lead/LeadApplicationClient.js +229 -14
- package/sdk/application/Lead/LeadApplicationValidator.js +1 -0
- package/sdk/application/Logistic/LogisticApplicationClient.js +134 -8
- package/sdk/application/Logistic/LogisticApplicationValidator.js +1 -0
- package/sdk/application/Order/OrderApplicationClient.d.ts +1 -1
- package/sdk/application/Order/OrderApplicationClient.js +403 -24
- package/sdk/application/Order/OrderApplicationModel.d.ts +20 -20
- package/sdk/application/Order/OrderApplicationModel.js +334 -334
- package/sdk/application/Order/OrderApplicationValidator.js +1 -0
- package/sdk/application/Payment/PaymentApplicationClient.js +1381 -78
- package/sdk/application/Payment/PaymentApplicationModel.d.ts +2 -2
- package/sdk/application/Payment/PaymentApplicationModel.js +350 -350
- package/sdk/application/Payment/PaymentApplicationValidator.js +1 -0
- package/sdk/application/PosCart/PosCartApplicationClient.js +914 -54
- package/sdk/application/PosCart/PosCartApplicationModel.d.ts +15 -15
- package/sdk/application/PosCart/PosCartApplicationModel.js +389 -389
- package/sdk/application/PosCart/PosCartApplicationValidator.js +1 -0
- package/sdk/application/Rewards/RewardsApplicationClient.js +235 -14
- package/sdk/application/Rewards/RewardsApplicationValidator.js +1 -0
- package/sdk/application/Share/ShareApplicationClient.js +226 -14
- package/sdk/application/Share/ShareApplicationValidator.js +1 -0
- package/sdk/application/Theme/ThemeApplicationClient.js +130 -8
- package/sdk/application/Theme/ThemeApplicationValidator.js +1 -0
- package/sdk/application/User/UserApplicationClient.js +1133 -70
- package/sdk/application/User/UserApplicationValidator.js +1 -0
- package/sdk/common/AxiosHelper.js +1 -1
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.d.ts +16 -8
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.js +287 -16
- package/sdk/platform/Analytics/AnalyticsPlatformClient.d.ts +8 -4
- package/sdk/platform/Analytics/AnalyticsPlatformClient.js +153 -8
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.d.ts +8 -4
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +141 -8
- package/sdk/platform/Billing/BillingPlatformClient.d.ts +24 -12
- package/sdk/platform/Billing/BillingPlatformClient.js +429 -24
- package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +34 -17
- package/sdk/platform/Cart/CartPlatformApplicationClient.js +617 -34
- package/sdk/platform/Cart/CartPlatformModel.d.ts +35 -35
- package/sdk/platform/Cart/CartPlatformModel.js +617 -617
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +191 -138
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +2202 -302
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +11 -11
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +45 -45
- package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +344 -226
- package/sdk/platform/Catalog/CatalogPlatformClient.js +3282 -488
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +110 -100
- package/sdk/platform/Catalog/CatalogPlatformModel.js +2073 -1795
- package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +23 -21
- package/sdk/platform/Catalog/CatalogPlatformValidator.js +103 -84
- package/sdk/platform/Common/CommonPlatformClient.d.ts +4 -2
- package/sdk/platform/Common/CommonPlatformClient.js +73 -4
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +80 -40
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +1499 -80
- package/sdk/platform/Communication/CommunicationPlatformClient.d.ts +2 -1
- package/sdk/platform/Communication/CommunicationPlatformClient.js +41 -2
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +27 -14
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +486 -26
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +9 -9
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +274 -274
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +56 -28
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +1022 -56
- package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +36 -18
- package/sdk/platform/Configuration/ConfigurationPlatformClient.js +693 -36
- package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +148 -67
- package/sdk/platform/Content/ContentPlatformApplicationClient.js +2446 -140
- package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +1 -0
- package/sdk/platform/Content/ContentPlatformApplicationValidator.js +7 -0
- package/sdk/platform/Content/ContentPlatformModel.d.ts +4 -0
- package/sdk/platform/Content/ContentPlatformModel.js +43 -1
- package/sdk/platform/Discount/DiscountPlatformClient.d.ts +21 -10
- package/sdk/platform/Discount/DiscountPlatformClient.js +400 -22
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +8 -4
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +148 -8
- package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +12 -6
- package/sdk/platform/FileStorage/FileStoragePlatformClient.js +214 -12
- package/sdk/platform/Inventory/InventoryPlatformClient.d.ts +27 -14
- package/sdk/platform/Inventory/InventoryPlatformClient.js +449 -24
- package/sdk/platform/Lead/LeadPlatformApplicationClient.d.ts +26 -13
- package/sdk/platform/Lead/LeadPlatformApplicationClient.js +447 -26
- package/sdk/platform/Lead/LeadPlatformClient.d.ts +22 -11
- package/sdk/platform/Lead/LeadPlatformClient.js +384 -22
- package/sdk/platform/OAuthClient.js +8 -8
- package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +6 -3
- package/sdk/platform/Order/OrderPlatformApplicationClient.js +125 -6
- package/sdk/platform/Order/OrderPlatformClient.d.ts +108 -47
- package/sdk/platform/Order/OrderPlatformClient.js +1641 -100
- package/sdk/platform/Order/OrderPlatformModel.d.ts +69 -58
- package/sdk/platform/Order/OrderPlatformModel.js +1485 -1493
- package/sdk/platform/Order/OrderPlatformValidator.d.ts +2 -1
- package/sdk/platform/Order/OrderPlatformValidator.js +15 -4
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.d.ts +4 -2
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.js +74 -4
- package/sdk/platform/Partner/PartnerPlatformModel.d.ts +1 -1
- package/sdk/platform/Partner/PartnerPlatformModel.js +8 -8
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +22 -11
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +418 -22
- package/sdk/platform/Payment/PaymentPlatformClient.d.ts +21 -11
- package/sdk/platform/Payment/PaymentPlatformClient.js +374 -20
- package/sdk/platform/Payment/PaymentPlatformModel.js +139 -139
- package/sdk/platform/PlatformApplicationClient.d.ts +2973 -2827
- package/sdk/platform/PlatformApplicationClient.js +3461 -3263
- package/sdk/platform/PlatformClient.d.ts +2973 -2827
- package/sdk/platform/PlatformClient.js +3461 -3263
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.d.ts +26 -13
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +449 -26
- package/sdk/platform/Share/SharePlatformApplicationClient.d.ts +8 -4
- package/sdk/platform/Share/SharePlatformApplicationClient.js +139 -8
- package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +47 -23
- package/sdk/platform/Theme/ThemePlatformApplicationClient.js +816 -48
- package/sdk/platform/User/UserPlatformApplicationClient.d.ts +24 -12
- package/sdk/platform/User/UserPlatformApplicationClient.js +417 -24
- package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +12 -6
- package/sdk/platform/Webhook/WebhookPlatformClient.js +229 -12
- package/sdk/public/Configuration/ConfigurationPublicClient.js +72 -4
- package/sdk/public/Configuration/ConfigurationPublicValidator.js +3 -1
- package/sdk/public/Inventory/InventoryPublicClient.js +210 -12
- package/sdk/public/Inventory/InventoryPublicValidator.js +3 -1
- package/sdk/public/Webhook/WebhookPublicClient.js +74 -4
- package/sdk/public/Webhook/WebhookPublicValidator.js +3 -1
|
@@ -6,12 +6,13 @@ declare class Share {
|
|
|
6
6
|
/**
|
|
7
7
|
* @param {Object} arg - Arg object.
|
|
8
8
|
* @param {ShortLinkReq} arg.body
|
|
9
|
+
* @returns {Promise<ShortLinkRes>} - Success response
|
|
9
10
|
* @summary: Create short link
|
|
10
11
|
* @description: Create short link
|
|
11
12
|
*/
|
|
12
13
|
createShortLink({ body }?: {
|
|
13
14
|
body: ShortLinkReq;
|
|
14
|
-
}): Promise<
|
|
15
|
+
}): Promise<ShortLinkRes>;
|
|
15
16
|
/**
|
|
16
17
|
* @param {Object} arg - Arg object.
|
|
17
18
|
* @param {number} [arg.pageNo] - Current page number
|
|
@@ -19,6 +20,7 @@ declare class Share {
|
|
|
19
20
|
* @param {string} [arg.createdBy] - Short link creator
|
|
20
21
|
* @param {string} [arg.active] - Short link active status
|
|
21
22
|
* @param {string} [arg.q] - Search text for original and short url
|
|
23
|
+
* @returns {Promise<ShortLinkList>} - Success response
|
|
22
24
|
* @summary: Get short links
|
|
23
25
|
* @description: Get short links
|
|
24
26
|
*/
|
|
@@ -28,7 +30,7 @@ declare class Share {
|
|
|
28
30
|
createdBy?: string;
|
|
29
31
|
active?: string;
|
|
30
32
|
q?: string;
|
|
31
|
-
}): Promise<
|
|
33
|
+
}): Promise<ShortLinkList>;
|
|
32
34
|
/**
|
|
33
35
|
* @param {Object} arg - Arg object.
|
|
34
36
|
* @param {string} arg.companyId - Company Id
|
|
@@ -51,22 +53,24 @@ declare class Share {
|
|
|
51
53
|
/**
|
|
52
54
|
* @param {Object} arg - Arg object.
|
|
53
55
|
* @param {string} arg.hash - Hash of short url
|
|
56
|
+
* @returns {Promise<ShortLinkRes>} - Success response
|
|
54
57
|
* @summary: Get short link by hash
|
|
55
58
|
* @description: Get short link by hash
|
|
56
59
|
*/
|
|
57
60
|
getShortLinkByHash({ hash }?: {
|
|
58
61
|
hash: string;
|
|
59
|
-
}): Promise<
|
|
62
|
+
}): Promise<ShortLinkRes>;
|
|
60
63
|
/**
|
|
61
64
|
* @param {Object} arg - Arg object.
|
|
62
65
|
* @param {string} arg.id - Short link document identifier
|
|
63
66
|
* @param {ShortLinkReq} arg.body
|
|
67
|
+
* @returns {Promise<ShortLinkRes>} - Success response
|
|
64
68
|
* @summary: Update short link by id
|
|
65
69
|
* @description: Update short link by id
|
|
66
70
|
*/
|
|
67
71
|
updateShortLinkById({ id, body }?: {
|
|
68
72
|
id: string;
|
|
69
73
|
body: ShortLinkReq;
|
|
70
|
-
}): Promise<
|
|
74
|
+
}): Promise<ShortLinkRes>;
|
|
71
75
|
}
|
|
72
76
|
import Paginator = require("../../common/Paginator");
|
|
@@ -2,6 +2,8 @@ const Paginator = require("../../common/Paginator");
|
|
|
2
2
|
const PlatformAPIClient = require("../PlatformAPIClient");
|
|
3
3
|
const { FDKClientValidationError } = require("../../common/FDKError");
|
|
4
4
|
const ShareValidator = require("./SharePlatformApplicationValidator");
|
|
5
|
+
const ShareModel = require("./SharePlatformModel");
|
|
6
|
+
const { Logger } = require("./../../common/Logger");
|
|
5
7
|
|
|
6
8
|
class Share {
|
|
7
9
|
constructor(config, applicationId) {
|
|
@@ -12,10 +14,11 @@ class Share {
|
|
|
12
14
|
/**
|
|
13
15
|
* @param {Object} arg - Arg object.
|
|
14
16
|
* @param {ShortLinkReq} arg.body
|
|
17
|
+
* @returns {Promise<ShortLinkRes>} - Success response
|
|
15
18
|
* @summary: Create short link
|
|
16
19
|
* @description: Create short link
|
|
17
20
|
*/
|
|
18
|
-
createShortLink({ body } = {}) {
|
|
21
|
+
async createShortLink({ body } = {}) {
|
|
19
22
|
const { error } = ShareValidator.createShortLink().validate(
|
|
20
23
|
{
|
|
21
24
|
body,
|
|
@@ -26,15 +29,45 @@ class Share {
|
|
|
26
29
|
return Promise.reject(new FDKClientValidationError(error));
|
|
27
30
|
}
|
|
28
31
|
|
|
32
|
+
// Showing warrnings if extra unknown parameters are found
|
|
33
|
+
const { error: warrning } = ShareValidator.createShortLink().validate(
|
|
34
|
+
{
|
|
35
|
+
body,
|
|
36
|
+
},
|
|
37
|
+
{ abortEarly: false, allowUnknown: false }
|
|
38
|
+
);
|
|
39
|
+
if (warrning) {
|
|
40
|
+
Logger({
|
|
41
|
+
level: "WARN",
|
|
42
|
+
message: "Parameter Validation warrnings for createShortLink",
|
|
43
|
+
});
|
|
44
|
+
Logger({ level: "WARN", message: warrning });
|
|
45
|
+
}
|
|
46
|
+
|
|
29
47
|
const query_params = {};
|
|
30
48
|
|
|
31
|
-
|
|
49
|
+
const response = await PlatformAPIClient.execute(
|
|
32
50
|
this.config,
|
|
33
51
|
"post",
|
|
34
52
|
`/service/platform/share/v1.0/company/${this.config.companyId}/application/${this.applicationId}/links/short-link/`,
|
|
35
53
|
query_params,
|
|
36
54
|
body
|
|
37
55
|
);
|
|
56
|
+
|
|
57
|
+
const { error: res_error } = ShareModel.ShortLinkRes().validate(response, {
|
|
58
|
+
abortEarly: false,
|
|
59
|
+
allowUnknown: false,
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
if (res_error) {
|
|
63
|
+
Logger({
|
|
64
|
+
level: "WARN",
|
|
65
|
+
message: "Response Validation Warnnings for createShortLink",
|
|
66
|
+
});
|
|
67
|
+
Logger({ level: "WARN", message: res_error });
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
return response;
|
|
38
71
|
}
|
|
39
72
|
|
|
40
73
|
/**
|
|
@@ -44,10 +77,11 @@ class Share {
|
|
|
44
77
|
* @param {string} [arg.createdBy] - Short link creator
|
|
45
78
|
* @param {string} [arg.active] - Short link active status
|
|
46
79
|
* @param {string} [arg.q] - Search text for original and short url
|
|
80
|
+
* @returns {Promise<ShortLinkList>} - Success response
|
|
47
81
|
* @summary: Get short links
|
|
48
82
|
* @description: Get short links
|
|
49
83
|
*/
|
|
50
|
-
getShortLinks({ pageNo, pageSize, createdBy, active, q } = {}) {
|
|
84
|
+
async getShortLinks({ pageNo, pageSize, createdBy, active, q } = {}) {
|
|
51
85
|
const { error } = ShareValidator.getShortLinks().validate(
|
|
52
86
|
{
|
|
53
87
|
pageNo,
|
|
@@ -62,6 +96,25 @@ class Share {
|
|
|
62
96
|
return Promise.reject(new FDKClientValidationError(error));
|
|
63
97
|
}
|
|
64
98
|
|
|
99
|
+
// Showing warrnings if extra unknown parameters are found
|
|
100
|
+
const { error: warrning } = ShareValidator.getShortLinks().validate(
|
|
101
|
+
{
|
|
102
|
+
pageNo,
|
|
103
|
+
pageSize,
|
|
104
|
+
createdBy,
|
|
105
|
+
active,
|
|
106
|
+
q,
|
|
107
|
+
},
|
|
108
|
+
{ abortEarly: false, allowUnknown: false }
|
|
109
|
+
);
|
|
110
|
+
if (warrning) {
|
|
111
|
+
Logger({
|
|
112
|
+
level: "WARN",
|
|
113
|
+
message: "Parameter Validation warrnings for getShortLinks",
|
|
114
|
+
});
|
|
115
|
+
Logger({ level: "WARN", message: warrning });
|
|
116
|
+
}
|
|
117
|
+
|
|
65
118
|
const query_params = {};
|
|
66
119
|
query_params["page_no"] = pageNo;
|
|
67
120
|
query_params["page_size"] = pageSize;
|
|
@@ -69,13 +122,28 @@ class Share {
|
|
|
69
122
|
query_params["active"] = active;
|
|
70
123
|
query_params["q"] = q;
|
|
71
124
|
|
|
72
|
-
|
|
125
|
+
const response = await PlatformAPIClient.execute(
|
|
73
126
|
this.config,
|
|
74
127
|
"get",
|
|
75
128
|
`/service/platform/share/v1.0/company/${this.config.companyId}/application/${this.applicationId}/links/short-link/`,
|
|
76
129
|
query_params,
|
|
77
130
|
undefined
|
|
78
131
|
);
|
|
132
|
+
|
|
133
|
+
const { error: res_error } = ShareModel.ShortLinkList().validate(response, {
|
|
134
|
+
abortEarly: false,
|
|
135
|
+
allowUnknown: false,
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
if (res_error) {
|
|
139
|
+
Logger({
|
|
140
|
+
level: "WARN",
|
|
141
|
+
message: "Response Validation Warnnings for getShortLinks",
|
|
142
|
+
});
|
|
143
|
+
Logger({ level: "WARN", message: res_error });
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
return response;
|
|
79
147
|
}
|
|
80
148
|
|
|
81
149
|
/**
|
|
@@ -124,10 +192,11 @@ class Share {
|
|
|
124
192
|
/**
|
|
125
193
|
* @param {Object} arg - Arg object.
|
|
126
194
|
* @param {string} arg.hash - Hash of short url
|
|
195
|
+
* @returns {Promise<ShortLinkRes>} - Success response
|
|
127
196
|
* @summary: Get short link by hash
|
|
128
197
|
* @description: Get short link by hash
|
|
129
198
|
*/
|
|
130
|
-
getShortLinkByHash({ hash } = {}) {
|
|
199
|
+
async getShortLinkByHash({ hash } = {}) {
|
|
131
200
|
const { error } = ShareValidator.getShortLinkByHash().validate(
|
|
132
201
|
{
|
|
133
202
|
hash,
|
|
@@ -138,25 +207,56 @@ class Share {
|
|
|
138
207
|
return Promise.reject(new FDKClientValidationError(error));
|
|
139
208
|
}
|
|
140
209
|
|
|
210
|
+
// Showing warrnings if extra unknown parameters are found
|
|
211
|
+
const { error: warrning } = ShareValidator.getShortLinkByHash().validate(
|
|
212
|
+
{
|
|
213
|
+
hash,
|
|
214
|
+
},
|
|
215
|
+
{ abortEarly: false, allowUnknown: false }
|
|
216
|
+
);
|
|
217
|
+
if (warrning) {
|
|
218
|
+
Logger({
|
|
219
|
+
level: "WARN",
|
|
220
|
+
message: "Parameter Validation warrnings for getShortLinkByHash",
|
|
221
|
+
});
|
|
222
|
+
Logger({ level: "WARN", message: warrning });
|
|
223
|
+
}
|
|
224
|
+
|
|
141
225
|
const query_params = {};
|
|
142
226
|
|
|
143
|
-
|
|
227
|
+
const response = await PlatformAPIClient.execute(
|
|
144
228
|
this.config,
|
|
145
229
|
"get",
|
|
146
230
|
`/service/platform/share/v1.0/company/${this.config.companyId}/application/${this.applicationId}/links/short-link/${hash}/`,
|
|
147
231
|
query_params,
|
|
148
232
|
undefined
|
|
149
233
|
);
|
|
234
|
+
|
|
235
|
+
const { error: res_error } = ShareModel.ShortLinkRes().validate(response, {
|
|
236
|
+
abortEarly: false,
|
|
237
|
+
allowUnknown: false,
|
|
238
|
+
});
|
|
239
|
+
|
|
240
|
+
if (res_error) {
|
|
241
|
+
Logger({
|
|
242
|
+
level: "WARN",
|
|
243
|
+
message: "Response Validation Warnnings for getShortLinkByHash",
|
|
244
|
+
});
|
|
245
|
+
Logger({ level: "WARN", message: res_error });
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
return response;
|
|
150
249
|
}
|
|
151
250
|
|
|
152
251
|
/**
|
|
153
252
|
* @param {Object} arg - Arg object.
|
|
154
253
|
* @param {string} arg.id - Short link document identifier
|
|
155
254
|
* @param {ShortLinkReq} arg.body
|
|
255
|
+
* @returns {Promise<ShortLinkRes>} - Success response
|
|
156
256
|
* @summary: Update short link by id
|
|
157
257
|
* @description: Update short link by id
|
|
158
258
|
*/
|
|
159
|
-
updateShortLinkById({ id, body } = {}) {
|
|
259
|
+
async updateShortLinkById({ id, body } = {}) {
|
|
160
260
|
const { error } = ShareValidator.updateShortLinkById().validate(
|
|
161
261
|
{
|
|
162
262
|
id,
|
|
@@ -168,15 +268,46 @@ class Share {
|
|
|
168
268
|
return Promise.reject(new FDKClientValidationError(error));
|
|
169
269
|
}
|
|
170
270
|
|
|
271
|
+
// Showing warrnings if extra unknown parameters are found
|
|
272
|
+
const { error: warrning } = ShareValidator.updateShortLinkById().validate(
|
|
273
|
+
{
|
|
274
|
+
id,
|
|
275
|
+
body,
|
|
276
|
+
},
|
|
277
|
+
{ abortEarly: false, allowUnknown: false }
|
|
278
|
+
);
|
|
279
|
+
if (warrning) {
|
|
280
|
+
Logger({
|
|
281
|
+
level: "WARN",
|
|
282
|
+
message: "Parameter Validation warrnings for updateShortLinkById",
|
|
283
|
+
});
|
|
284
|
+
Logger({ level: "WARN", message: warrning });
|
|
285
|
+
}
|
|
286
|
+
|
|
171
287
|
const query_params = {};
|
|
172
288
|
|
|
173
|
-
|
|
289
|
+
const response = await PlatformAPIClient.execute(
|
|
174
290
|
this.config,
|
|
175
291
|
"patch",
|
|
176
292
|
`/service/platform/share/v1.0/company/${this.config.companyId}/application/${this.applicationId}/links/short-link/${id}/`,
|
|
177
293
|
query_params,
|
|
178
294
|
body
|
|
179
295
|
);
|
|
296
|
+
|
|
297
|
+
const { error: res_error } = ShareModel.ShortLinkRes().validate(response, {
|
|
298
|
+
abortEarly: false,
|
|
299
|
+
allowUnknown: false,
|
|
300
|
+
});
|
|
301
|
+
|
|
302
|
+
if (res_error) {
|
|
303
|
+
Logger({
|
|
304
|
+
level: "WARN",
|
|
305
|
+
message: "Response Validation Warnnings for updateShortLinkById",
|
|
306
|
+
});
|
|
307
|
+
Logger({ level: "WARN", message: res_error });
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
return response;
|
|
180
311
|
}
|
|
181
312
|
}
|
|
182
313
|
module.exports = Share;
|
|
@@ -6,50 +6,55 @@ declare class Theme {
|
|
|
6
6
|
/**
|
|
7
7
|
* @param {Object} arg - Arg object.
|
|
8
8
|
* @param {string} arg.themeId - ID of the theme to be retrieved
|
|
9
|
+
* @returns {Promise<AllAvailablePageSchema>} - Success response
|
|
9
10
|
* @summary: Get all pages of a theme
|
|
10
11
|
* @description: Use this API to retrieve all the available pages of a theme by its ID.
|
|
11
12
|
*/
|
|
12
13
|
getAllPages({ themeId }?: {
|
|
13
14
|
themeId: string;
|
|
14
|
-
}): Promise<
|
|
15
|
+
}): Promise<AllAvailablePageSchema>;
|
|
15
16
|
/**
|
|
16
17
|
* @param {Object} arg - Arg object.
|
|
17
18
|
* @param {string} arg.themeId - ID of the theme
|
|
18
19
|
* @param {AvailablePageSchema} arg.body
|
|
20
|
+
* @returns {Promise<AvailablePageSchema>} - Success response
|
|
19
21
|
* @summary: Create a page
|
|
20
22
|
* @description: Use this API to create a page for a theme by its ID.
|
|
21
23
|
*/
|
|
22
24
|
createPage({ themeId, body }?: {
|
|
23
25
|
themeId: string;
|
|
24
26
|
body: AvailablePageSchema;
|
|
25
|
-
}): Promise<
|
|
27
|
+
}): Promise<AvailablePageSchema>;
|
|
26
28
|
/**
|
|
27
29
|
* @param {Object} arg - Arg object.
|
|
28
30
|
* @param {string} arg.themeId - ID of the theme to be retrieved
|
|
29
31
|
* @param {AllAvailablePageSchema} arg.body
|
|
32
|
+
* @returns {Promise<AllAvailablePageSchema>} - Success response
|
|
30
33
|
* @summary: Update multiple pages of a theme
|
|
31
34
|
* @description: Use this API to update multiple pages of a theme by its ID.
|
|
32
35
|
*/
|
|
33
36
|
updateMultiplePages({ themeId, body }?: {
|
|
34
37
|
themeId: string;
|
|
35
38
|
body: AllAvailablePageSchema;
|
|
36
|
-
}): Promise<
|
|
39
|
+
}): Promise<AllAvailablePageSchema>;
|
|
37
40
|
/**
|
|
38
41
|
* @param {Object} arg - Arg object.
|
|
39
42
|
* @param {string} arg.themeId - ID of the theme to be retrieved
|
|
40
43
|
* @param {string} arg.pageValue - Value of the page to be retrieved
|
|
44
|
+
* @returns {Promise<AvailablePageSchema>} - Success response
|
|
41
45
|
* @summary: Get page of a theme
|
|
42
46
|
* @description: Use this API to retrieve a page of a theme.
|
|
43
47
|
*/
|
|
44
48
|
getPage({ themeId, pageValue }?: {
|
|
45
49
|
themeId: string;
|
|
46
50
|
pageValue: string;
|
|
47
|
-
}): Promise<
|
|
51
|
+
}): Promise<AvailablePageSchema>;
|
|
48
52
|
/**
|
|
49
53
|
* @param {Object} arg - Arg object.
|
|
50
54
|
* @param {string} arg.themeId - ID of the theme
|
|
51
55
|
* @param {string} arg.pageValue - Value of the page to be updated
|
|
52
56
|
* @param {AvailablePageSchema} arg.body
|
|
57
|
+
* @returns {Promise<AvailablePageSchema>} - Success response
|
|
53
58
|
* @summary: Updates a page
|
|
54
59
|
* @description: Use this API to update a page for a theme by its ID.
|
|
55
60
|
*/
|
|
@@ -57,178 +62,197 @@ declare class Theme {
|
|
|
57
62
|
themeId: string;
|
|
58
63
|
pageValue: string;
|
|
59
64
|
body: AvailablePageSchema;
|
|
60
|
-
}): Promise<
|
|
65
|
+
}): Promise<AvailablePageSchema>;
|
|
61
66
|
/**
|
|
62
67
|
* @param {Object} arg - Arg object.
|
|
63
68
|
* @param {string} arg.themeId - ID of the theme
|
|
64
69
|
* @param {string} arg.pageValue - Value of the page to be updated
|
|
70
|
+
* @returns {Promise<AvailablePageSchema>} - Success response
|
|
65
71
|
* @summary: Deletes a page
|
|
66
72
|
* @description: Use this API to delete a page for a theme by its ID and page_value.
|
|
67
73
|
*/
|
|
68
74
|
deletePage({ themeId, pageValue }?: {
|
|
69
75
|
themeId: string;
|
|
70
76
|
pageValue: string;
|
|
71
|
-
}): Promise<
|
|
77
|
+
}): Promise<AvailablePageSchema>;
|
|
72
78
|
/**
|
|
73
79
|
* @param {Object} arg - Arg object.
|
|
74
80
|
* @param {number} [arg.pageSize] - The number of items to retrieve in each
|
|
75
81
|
* page. Default value is 10.
|
|
76
82
|
* @param {number} [arg.pageNo] - The page number to navigate through the
|
|
77
83
|
* given set of results. Default value is 1.
|
|
84
|
+
* @returns {Promise<ThemesListingResponseSchema>} - Success response
|
|
78
85
|
* @summary: Get a list of themes from the theme library
|
|
79
86
|
* @description: Theme library is a personalized collection of themes that are chosen and added from the available themes. Use this API to fetch a list of themes from the library along with their configuration details.
|
|
80
87
|
*/
|
|
81
88
|
getThemeLibrary({ pageSize, pageNo }?: {
|
|
82
89
|
pageSize?: number;
|
|
83
90
|
pageNo?: number;
|
|
84
|
-
}): Promise<
|
|
91
|
+
}): Promise<ThemesListingResponseSchema>;
|
|
85
92
|
/**
|
|
86
93
|
* @param {Object} arg - Arg object.
|
|
87
94
|
* @param {AddThemeRequestSchema} arg.body
|
|
95
|
+
* @returns {Promise<ThemesSchema>} - Success response
|
|
88
96
|
* @summary: Add a theme to the theme library
|
|
89
97
|
* @description: Theme library is a personalized collection of themes that are chosen and added from the available themes. Use this API to choose a theme and add it to the theme library.
|
|
90
98
|
*/
|
|
91
99
|
addToThemeLibrary({ body }?: {
|
|
92
100
|
body: AddThemeRequestSchema;
|
|
93
|
-
}): Promise<
|
|
101
|
+
}): Promise<ThemesSchema>;
|
|
94
102
|
/**
|
|
95
103
|
* @param {Object} arg - Arg object.
|
|
96
104
|
* @param {AddThemeRequestSchema} arg.body
|
|
105
|
+
* @returns {Promise<ThemesSchema>} - Success response
|
|
97
106
|
* @summary: Apply a theme
|
|
98
107
|
* @description: Use this API to apply a theme to the website.
|
|
99
108
|
*/
|
|
100
109
|
applyTheme({ body }?: {
|
|
101
110
|
body: AddThemeRequestSchema;
|
|
102
|
-
}): Promise<
|
|
111
|
+
}): Promise<ThemesSchema>;
|
|
103
112
|
/**
|
|
104
113
|
* @param {Object} arg - Arg object.
|
|
105
114
|
* @param {string} arg.themeId - Theme ID
|
|
115
|
+
* @returns {Promise<UpgradableThemeSchema>} - Success response
|
|
106
116
|
* @summary: Checks if theme is upgradable
|
|
107
117
|
* @description: There's always a possibility that new features get added to a theme. Use this API to check if the applied theme has an upgrade available.
|
|
108
118
|
*/
|
|
109
119
|
isUpgradable({ themeId }?: {
|
|
110
120
|
themeId: string;
|
|
111
|
-
}): Promise<
|
|
121
|
+
}): Promise<UpgradableThemeSchema>;
|
|
112
122
|
/**
|
|
113
123
|
* @param {Object} arg - Arg object.
|
|
114
124
|
* @param {string} arg.themeId - ID allotted to the theme.
|
|
125
|
+
* @returns {Promise<ThemesSchema>} - Success response
|
|
115
126
|
* @summary: Upgrade a theme
|
|
116
127
|
* @description: Use this API to upgrade the current theme to its latest version.
|
|
117
128
|
*/
|
|
118
129
|
upgradeTheme({ themeId }?: {
|
|
119
130
|
themeId: string;
|
|
120
|
-
}): Promise<
|
|
131
|
+
}): Promise<ThemesSchema>;
|
|
121
132
|
/**
|
|
122
133
|
* @param {Object} arg - Arg object.
|
|
123
134
|
* @param {number} [arg.pageSize] - The number of items to retrieve in each
|
|
124
135
|
* page. Default value is 10.
|
|
125
136
|
* @param {number} [arg.pageNo] - The page number to navigate through the
|
|
126
137
|
* given set of results. Default value is 1.
|
|
138
|
+
* @returns {Promise<ThemesListingResponseSchema>} - Success response
|
|
127
139
|
* @summary: Get all public themes
|
|
128
140
|
* @description: Use this API to get a list of free themes that you can apply to your website.
|
|
129
141
|
*/
|
|
130
142
|
getPublicThemes({ pageSize, pageNo }?: {
|
|
131
143
|
pageSize?: number;
|
|
132
144
|
pageNo?: number;
|
|
133
|
-
}): Promise<
|
|
145
|
+
}): Promise<ThemesListingResponseSchema>;
|
|
134
146
|
/**
|
|
135
147
|
* @param {Object} arg - Arg object.
|
|
136
148
|
* @param {ThemesSchema} arg.body
|
|
149
|
+
* @returns {Promise<ThemesSchema>} - Success response
|
|
137
150
|
* @summary: Create a new theme
|
|
138
151
|
* @description: Themes improve the look and appearance of a website. Use this API to create a theme.
|
|
139
152
|
*/
|
|
140
153
|
createTheme({ body }?: {
|
|
141
154
|
body: ThemesSchema;
|
|
142
|
-
}): Promise<
|
|
155
|
+
}): Promise<ThemesSchema>;
|
|
143
156
|
/**
|
|
144
157
|
* @param {Object} arg - Arg object.
|
|
158
|
+
* @returns {Promise<ThemesSchema>} - Success response
|
|
145
159
|
* @summary: Get the applied theme
|
|
146
160
|
* @description: Use this API to retrieve the theme that is currently applied to the website along with its details.
|
|
147
161
|
*/
|
|
148
|
-
getAppliedTheme({}?: any): Promise<
|
|
162
|
+
getAppliedTheme({}?: any): Promise<ThemesSchema>;
|
|
149
163
|
/**
|
|
150
164
|
* @param {Object} arg - Arg object.
|
|
165
|
+
* @returns {Promise<FontsSchema>} - Success response
|
|
151
166
|
* @summary: Get all the supported fonts in a theme
|
|
152
167
|
* @description: Font is a collection of characters with a similar design. Use this API to retrieve a list of website fonts.
|
|
153
168
|
*/
|
|
154
|
-
getFonts({}?: any): Promise<
|
|
169
|
+
getFonts({}?: any): Promise<FontsSchema>;
|
|
155
170
|
/**
|
|
156
171
|
* @param {Object} arg - Arg object.
|
|
157
172
|
* @param {string} arg.themeId - ID allotted to the theme.
|
|
173
|
+
* @returns {Promise<ThemesSchema>} - Success response
|
|
158
174
|
* @summary: Gets theme by id
|
|
159
175
|
* @description: Use this API to retrieve the details of a specific theme by using its ID.
|
|
160
176
|
*/
|
|
161
177
|
getThemeById({ themeId }?: {
|
|
162
178
|
themeId: string;
|
|
163
|
-
}): Promise<
|
|
179
|
+
}): Promise<ThemesSchema>;
|
|
164
180
|
/**
|
|
165
181
|
* @param {Object} arg - Arg object.
|
|
166
182
|
* @param {string} arg.themeId - ID allotted to the theme.
|
|
167
183
|
* @param {ThemesSchema} arg.body
|
|
184
|
+
* @returns {Promise<ThemesSchema>} - Success response
|
|
168
185
|
* @summary: Update a theme
|
|
169
186
|
* @description: Use this API to edit an existing theme. You can customize the website font, sections, images, styles, and many more.
|
|
170
187
|
*/
|
|
171
188
|
updateTheme({ themeId, body }?: {
|
|
172
189
|
themeId: string;
|
|
173
190
|
body: ThemesSchema;
|
|
174
|
-
}): Promise<
|
|
191
|
+
}): Promise<ThemesSchema>;
|
|
175
192
|
/**
|
|
176
193
|
* @param {Object} arg - Arg object.
|
|
177
194
|
* @param {string} arg.themeId - ID allotted to the theme.
|
|
195
|
+
* @returns {Promise<ThemesSchema>} - Success response
|
|
178
196
|
* @summary: Delete a theme
|
|
179
197
|
* @description: Use this API to delete a theme from the theme library.
|
|
180
198
|
*/
|
|
181
199
|
deleteTheme({ themeId }?: {
|
|
182
200
|
themeId: string;
|
|
183
|
-
}): Promise<
|
|
201
|
+
}): Promise<ThemesSchema>;
|
|
184
202
|
/**
|
|
185
203
|
* @param {Object} arg - Arg object.
|
|
186
204
|
* @param {string} arg.themeId - ID allotted to the theme.
|
|
205
|
+
* @returns {Promise<ThemesSchema>} - Success response
|
|
187
206
|
* @summary: Get a theme preview
|
|
188
207
|
* @description: A theme can be previewed before applying it. Use this API to retrieve the theme preview by using its ID.
|
|
189
208
|
*/
|
|
190
209
|
getThemeForPreview({ themeId }?: {
|
|
191
210
|
themeId: string;
|
|
192
|
-
}): Promise<
|
|
211
|
+
}): Promise<ThemesSchema>;
|
|
193
212
|
/**
|
|
194
213
|
* @param {Object} arg - Arg object.
|
|
195
214
|
* @param {string} arg.themeId - ID allotted to the theme.
|
|
215
|
+
* @returns {Promise<ThemesSchema>} - Success response
|
|
196
216
|
* @summary: Publish a theme
|
|
197
217
|
* @description: Use this API to publish a theme that is either newly created or edited.
|
|
198
218
|
*/
|
|
199
219
|
publishTheme({ themeId }?: {
|
|
200
220
|
themeId: string;
|
|
201
|
-
}): Promise<
|
|
221
|
+
}): Promise<ThemesSchema>;
|
|
202
222
|
/**
|
|
203
223
|
* @param {Object} arg - Arg object.
|
|
204
224
|
* @param {string} arg.themeId - ID allotted to the theme.
|
|
225
|
+
* @returns {Promise<ThemesSchema>} - Success response
|
|
205
226
|
* @summary: Unpublish a theme
|
|
206
227
|
* @description: Use this API to remove an existing theme from the list of available themes.
|
|
207
228
|
*/
|
|
208
229
|
unpublishTheme({ themeId }?: {
|
|
209
230
|
themeId: string;
|
|
210
|
-
}): Promise<
|
|
231
|
+
}): Promise<ThemesSchema>;
|
|
211
232
|
/**
|
|
212
233
|
* @param {Object} arg - Arg object.
|
|
213
234
|
* @param {string} arg.themeId - ID allotted to the theme.
|
|
235
|
+
* @returns {Promise<ThemesSchema>} - Success response
|
|
214
236
|
* @summary: Archive a theme
|
|
215
237
|
* @description: Use this API to store an existing theme but not delete it so that it can be used in future if required.
|
|
216
238
|
*/
|
|
217
239
|
archiveTheme({ themeId }?: {
|
|
218
240
|
themeId: string;
|
|
219
|
-
}): Promise<
|
|
241
|
+
}): Promise<ThemesSchema>;
|
|
220
242
|
/**
|
|
221
243
|
* @param {Object} arg - Arg object.
|
|
222
244
|
* @param {string} arg.themeId - ID allotted to the theme.
|
|
245
|
+
* @returns {Promise<ThemesSchema>} - Success response
|
|
223
246
|
* @summary: Unarchive a theme
|
|
224
247
|
* @description: Use this API to restore an archived theme and bring it back for editing or publishing.
|
|
225
248
|
*/
|
|
226
249
|
unarchiveTheme({ themeId }?: {
|
|
227
250
|
themeId: string;
|
|
228
|
-
}): Promise<
|
|
251
|
+
}): Promise<ThemesSchema>;
|
|
229
252
|
/**
|
|
230
253
|
* @param {Object} arg - Arg object.
|
|
231
254
|
* @param {string} arg.themeId - ID allotted to the theme.
|
|
255
|
+
* @returns {Promise<any>} - Success response
|
|
232
256
|
* @summary: Fetch last modified timestamp
|
|
233
257
|
* @description: Use this API to fetch Last-Modified timestamp in header metadata.
|
|
234
258
|
*/
|