@gofynd/fdk-client-javascript 1.4.15-beta.1 → 1.4.15-beta.10
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 +2 -2
- package/application.d.ts +1 -2
- package/application.js +2 -3
- package/index.d.ts +1 -2
- package/index.js +7 -1
- package/package.json +2 -3
- package/sdk/application/ApplicationClient.js +0 -18
- package/sdk/application/Cart/CartApplicationClient.d.ts +55 -90
- package/sdk/application/Cart/CartApplicationClient.js +60 -1185
- package/sdk/application/Catalog/CatalogApplicationClient.d.ts +80 -142
- package/sdk/application/Catalog/CatalogApplicationClient.js +148 -1293
- package/sdk/application/Common/CommonApplicationClient.d.ts +4 -8
- package/sdk/application/Common/CommonApplicationClient.js +5 -89
- package/sdk/application/Communication/CommunicationApplicationClient.d.ts +6 -19
- package/sdk/application/Communication/CommunicationApplicationClient.js +6 -145
- package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +32 -73
- package/sdk/application/Configuration/ConfigurationApplicationClient.js +31 -718
- package/sdk/application/Content/ContentApplicationClient.d.ts +46 -78
- package/sdk/application/Content/ContentApplicationClient.js +77 -914
- package/sdk/application/FileStorage/FileStorageApplicationClient.d.ts +9 -12
- package/sdk/application/FileStorage/FileStorageApplicationClient.js +22 -125
- package/sdk/application/Lead/LeadApplicationClient.d.ts +10 -18
- package/sdk/application/Lead/LeadApplicationClient.js +32 -202
- package/sdk/application/Logistic/LogisticApplicationClient.d.ts +22 -39
- package/sdk/application/Logistic/LogisticApplicationClient.js +50 -478
- package/sdk/application/Order/OrderApplicationClient.d.ts +22 -42
- package/sdk/application/Order/OrderApplicationClient.js +86 -472
- package/sdk/application/Payment/PaymentApplicationClient.d.ts +92 -212
- package/sdk/application/Payment/PaymentApplicationClient.js +57 -2102
- package/sdk/application/Rewards/RewardsApplicationClient.d.ts +14 -28
- package/sdk/application/Rewards/RewardsApplicationClient.js +16 -305
- package/sdk/application/Share/ShareApplicationClient.d.ts +14 -24
- package/sdk/application/Share/ShareApplicationClient.js +34 -294
- package/sdk/application/Theme/ThemeApplicationClient.d.ts +8 -14
- package/sdk/application/Theme/ThemeApplicationClient.js +28 -162
- package/sdk/application/User/UserApplicationClient.d.ts +85 -136
- package/sdk/application/User/UserApplicationClient.js +45 -1815
- package/sdk/application/Webhook/WebhookApplicationClient.d.ts +2 -5
- package/sdk/application/Webhook/WebhookApplicationClient.js +4 -47
- package/sdk/application/index.d.ts +0 -18
- package/sdk/application/index.js +0 -33
- package/sdk/common/Utility.d.ts +1 -1
- package/sdk/common/Utility.js +10 -7
- package/sdk/common/Validator.d.ts +1 -0
- package/sdk/common/Validator.js +20 -0
- package/sdk/common/utils.d.ts +0 -1
- package/sdk/common/utils.js +0 -14
- package/sdk/partner/FileStorage/FileStoragePartnerModel.d.ts +2 -0
- package/sdk/partner/FileStorage/FileStoragePartnerModel.js +2 -0
- package/sdk/partner/OAuthClient.js +1 -0
- package/sdk/partner/Theme/ThemePartnerModel.d.ts +3 -40
- package/sdk/partner/Theme/ThemePartnerModel.js +2 -24
- package/sdk/platform/Cart/CartPlatformModel.d.ts +28 -0
- package/sdk/platform/Cart/CartPlatformModel.js +12 -0
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +0 -7
- package/sdk/platform/Catalog/CatalogPlatformModel.js +1 -4
- package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +14 -0
- package/sdk/platform/Configuration/ConfigurationPlatformModel.js +6 -0
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +3 -1
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +3 -0
- package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +3 -1
- package/sdk/platform/FileStorage/FileStoragePlatformClient.js +3 -0
- package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +16 -1
- package/sdk/platform/FileStorage/FileStoragePlatformModel.js +20 -0
- package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +0 -10
- package/sdk/platform/Order/OrderPlatformApplicationClient.js +0 -92
- package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +1 -28
- package/sdk/platform/Order/OrderPlatformApplicationValidator.js +0 -18
- package/sdk/platform/Order/OrderPlatformClient.d.ts +10 -0
- package/sdk/platform/Order/OrderPlatformClient.js +99 -0
- package/sdk/platform/Order/OrderPlatformModel.d.ts +7 -0
- package/sdk/platform/Order/OrderPlatformModel.js +3 -0
- package/sdk/platform/Order/OrderPlatformValidator.d.ts +33 -1
- package/sdk/platform/Order/OrderPlatformValidator.js +20 -0
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +1 -1
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +4 -4
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +56 -19
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +42 -18
- package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.d.ts +3 -3
- package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.js +2 -2
- package/sdk/platform/Theme/ThemePlatformModel.d.ts +3 -40
- package/sdk/platform/Theme/ThemePlatformModel.js +2 -24
- package/sdk/public/Configuration/ConfigurationPublicClient.js +5 -2
- package/sdk/public/Content/ContentPublicClient.d.ts +1 -1
- package/sdk/public/Content/ContentPublicClient.js +14 -2
- package/sdk/public/Partner/PartnerPublicClient.d.ts +1 -1
- package/sdk/public/Partner/PartnerPublicClient.js +14 -2
- package/sdk/public/Webhook/WebhookPublicClient.js +5 -2
- package/sdk/application/Cart/CartApplicationModel.d.ts +0 -3994
- package/sdk/application/Cart/CartApplicationModel.js +0 -2497
- package/sdk/application/Cart/CartApplicationValidator.d.ts +0 -769
- package/sdk/application/Cart/CartApplicationValidator.js +0 -530
- package/sdk/application/Catalog/CatalogApplicationModel.d.ts +0 -3857
- package/sdk/application/Catalog/CatalogApplicationModel.js +0 -2629
- package/sdk/application/Catalog/CatalogApplicationValidator.d.ts +0 -791
- package/sdk/application/Catalog/CatalogApplicationValidator.js +0 -551
- package/sdk/application/Common/CommonApplicationModel.d.ts +0 -449
- package/sdk/application/Common/CommonApplicationModel.js +0 -308
- package/sdk/application/Common/CommonApplicationValidator.d.ts +0 -46
- package/sdk/application/Common/CommonApplicationValidator.js +0 -38
- package/sdk/application/Communication/CommunicationApplicationModel.d.ts +0 -293
- package/sdk/application/Communication/CommunicationApplicationModel.js +0 -201
- package/sdk/application/Communication/CommunicationApplicationValidator.d.ts +0 -29
- package/sdk/application/Communication/CommunicationApplicationValidator.js +0 -38
- package/sdk/application/Configuration/ConfigurationApplicationModel.d.ts +0 -2556
- package/sdk/application/Configuration/ConfigurationApplicationModel.js +0 -1887
- package/sdk/application/Configuration/ConfigurationApplicationValidator.d.ts +0 -179
- package/sdk/application/Configuration/ConfigurationApplicationValidator.js +0 -176
- package/sdk/application/Content/ContentApplicationModel.d.ts +0 -2133
- package/sdk/application/Content/ContentApplicationModel.js +0 -1589
- package/sdk/application/Content/ContentApplicationValidator.d.ts +0 -284
- package/sdk/application/Content/ContentApplicationValidator.js +0 -264
- package/sdk/application/FileStorage/FileStorageApplicationModel.d.ts +0 -272
- package/sdk/application/FileStorage/FileStorageApplicationModel.js +0 -190
- package/sdk/application/FileStorage/FileStorageApplicationValidator.d.ts +0 -56
- package/sdk/application/FileStorage/FileStorageApplicationValidator.js +0 -53
- package/sdk/application/Lead/LeadApplicationModel.d.ts +0 -590
- package/sdk/application/Lead/LeadApplicationModel.js +0 -480
- package/sdk/application/Lead/LeadApplicationValidator.d.ts +0 -68
- package/sdk/application/Lead/LeadApplicationValidator.js +0 -71
- package/sdk/application/Logistic/LogisticApplicationModel.d.ts +0 -1675
- package/sdk/application/Logistic/LogisticApplicationModel.js +0 -1121
- package/sdk/application/Logistic/LogisticApplicationValidator.d.ts +0 -254
- package/sdk/application/Logistic/LogisticApplicationValidator.js +0 -190
- package/sdk/application/Order/OrderApplicationModel.d.ts +0 -2296
- package/sdk/application/Order/OrderApplicationModel.js +0 -1471
- package/sdk/application/Order/OrderApplicationValidator.d.ts +0 -265
- package/sdk/application/Order/OrderApplicationValidator.js +0 -197
- package/sdk/application/Payment/PaymentApplicationModel.d.ts +0 -4058
- package/sdk/application/Payment/PaymentApplicationModel.js +0 -2630
- package/sdk/application/Payment/PaymentApplicationValidator.d.ts +0 -576
- package/sdk/application/Payment/PaymentApplicationValidator.js +0 -594
- package/sdk/application/Rewards/RewardsApplicationModel.d.ts +0 -365
- package/sdk/application/Rewards/RewardsApplicationModel.js +0 -396
- package/sdk/application/Rewards/RewardsApplicationValidator.d.ts +0 -73
- package/sdk/application/Rewards/RewardsApplicationValidator.js +0 -84
- package/sdk/application/Share/ShareApplicationModel.d.ts +0 -339
- package/sdk/application/Share/ShareApplicationModel.js +0 -234
- package/sdk/application/Share/ShareApplicationValidator.d.ts +0 -90
- package/sdk/application/Share/ShareApplicationValidator.js +0 -91
- package/sdk/application/Theme/ThemeApplicationModel.d.ts +0 -1713
- package/sdk/application/Theme/ThemeApplicationModel.js +0 -1426
- package/sdk/application/Theme/ThemeApplicationValidator.d.ts +0 -66
- package/sdk/application/Theme/ThemeApplicationValidator.js +0 -58
- package/sdk/application/User/UserApplicationModel.d.ts +0 -1943
- package/sdk/application/User/UserApplicationModel.js +0 -1382
- package/sdk/application/User/UserApplicationValidator.d.ts +0 -560
- package/sdk/application/User/UserApplicationValidator.js +0 -573
- package/sdk/application/Webhook/WebhookApplicationModel.d.ts +0 -52
- package/sdk/application/Webhook/WebhookApplicationModel.js +0 -46
- package/sdk/application/Webhook/WebhookApplicationValidator.d.ts +0 -16
- package/sdk/application/Webhook/WebhookApplicationValidator.js +0 -19
- package/sdk/common/Clickstream.d.ts +0 -1
- package/sdk/common/Clickstream.js +0 -464
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
const ApplicationAPIClient = require("../ApplicationAPIClient");
|
|
2
1
|
const {
|
|
3
2
|
FDKClientValidationError,
|
|
4
3
|
FDKResponseValidationError,
|
|
5
4
|
} = require("../../common/FDKError");
|
|
5
|
+
|
|
6
|
+
const ApplicationAPIClient = require("../ApplicationAPIClient");
|
|
6
7
|
const constructUrl = require("../constructUrl");
|
|
7
8
|
const Paginator = require("../../common/Paginator");
|
|
8
|
-
const
|
|
9
|
-
const ShareApplicationModel = require("./ShareApplicationModel");
|
|
10
|
-
const { Logger } = require("./../../common/Logger");
|
|
11
|
-
const Joi = require("joi");
|
|
9
|
+
const { validateRequiredParams } = require("../../common/Validator");
|
|
12
10
|
|
|
13
11
|
class Share {
|
|
14
12
|
constructor(_conf) {
|
|
@@ -43,10 +41,9 @@ class Share {
|
|
|
43
41
|
}
|
|
44
42
|
|
|
45
43
|
/**
|
|
46
|
-
* @param {ShareApplicationValidator.CreateShortLinkParam} arg - Arg object.
|
|
47
44
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
48
45
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
49
|
-
* @returns {Promise<
|
|
46
|
+
* @returns {Promise<ShortLinkRes>} - Success response
|
|
50
47
|
* @name createShortLink
|
|
51
48
|
* @summary: Shorten URL
|
|
52
49
|
* @description: Creates a shortened version of a given URL for easier sharing. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/share/createShortLink/).
|
|
@@ -55,28 +52,6 @@ class Share {
|
|
|
55
52
|
{ body, requestHeaders } = { requestHeaders: {} },
|
|
56
53
|
{ responseHeaders } = { responseHeaders: false }
|
|
57
54
|
) {
|
|
58
|
-
const { error } = ShareApplicationValidator.createShortLink().validate(
|
|
59
|
-
{ body },
|
|
60
|
-
{ abortEarly: false, allowUnknown: true }
|
|
61
|
-
);
|
|
62
|
-
if (error) {
|
|
63
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
// Showing warrnings if extra unknown parameters are found
|
|
67
|
-
const {
|
|
68
|
-
error: warrning,
|
|
69
|
-
} = ShareApplicationValidator.createShortLink().validate(
|
|
70
|
-
{ body },
|
|
71
|
-
{ abortEarly: false, allowUnknown: false }
|
|
72
|
-
);
|
|
73
|
-
if (warrning) {
|
|
74
|
-
Logger({
|
|
75
|
-
level: "WARN",
|
|
76
|
-
message: `Parameter Validation warrnings for application > Share > createShortLink \n ${warrning}`,
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
|
|
80
55
|
const query_params = {};
|
|
81
56
|
|
|
82
57
|
const xHeaders = {};
|
|
@@ -99,32 +74,13 @@ class Share {
|
|
|
99
74
|
responseData = response[0];
|
|
100
75
|
}
|
|
101
76
|
|
|
102
|
-
const {
|
|
103
|
-
error: res_error,
|
|
104
|
-
} = ShareApplicationModel.ShortLinkRes().validate(responseData, {
|
|
105
|
-
abortEarly: false,
|
|
106
|
-
allowUnknown: true,
|
|
107
|
-
});
|
|
108
|
-
|
|
109
|
-
if (res_error) {
|
|
110
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
111
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
112
|
-
} else {
|
|
113
|
-
Logger({
|
|
114
|
-
level: "WARN",
|
|
115
|
-
message: `Response Validation Warnings for application > Share > createShortLink \n ${res_error}`,
|
|
116
|
-
});
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
|
|
120
77
|
return response;
|
|
121
78
|
}
|
|
122
79
|
|
|
123
80
|
/**
|
|
124
|
-
* @param {ShareApplicationValidator.GetApplicationQRCodeParam} arg - Arg object.
|
|
125
81
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
126
82
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
127
|
-
* @returns {Promise<
|
|
83
|
+
* @returns {Promise<QRCodeResp>} - Success response
|
|
128
84
|
* @name getApplicationQRCode
|
|
129
85
|
* @summary: App QR code
|
|
130
86
|
* @description: Generates a QR code for the application for easy sharing. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/share/getApplicationQRCode/).
|
|
@@ -133,28 +89,6 @@ class Share {
|
|
|
133
89
|
{ requestHeaders } = { requestHeaders: {} },
|
|
134
90
|
{ responseHeaders } = { responseHeaders: false }
|
|
135
91
|
) {
|
|
136
|
-
const { error } = ShareApplicationValidator.getApplicationQRCode().validate(
|
|
137
|
-
{},
|
|
138
|
-
{ abortEarly: false, allowUnknown: true }
|
|
139
|
-
);
|
|
140
|
-
if (error) {
|
|
141
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
// Showing warrnings if extra unknown parameters are found
|
|
145
|
-
const {
|
|
146
|
-
error: warrning,
|
|
147
|
-
} = ShareApplicationValidator.getApplicationQRCode().validate(
|
|
148
|
-
{},
|
|
149
|
-
{ abortEarly: false, allowUnknown: false }
|
|
150
|
-
);
|
|
151
|
-
if (warrning) {
|
|
152
|
-
Logger({
|
|
153
|
-
level: "WARN",
|
|
154
|
-
message: `Parameter Validation warrnings for application > Share > getApplicationQRCode \n ${warrning}`,
|
|
155
|
-
});
|
|
156
|
-
}
|
|
157
|
-
|
|
158
92
|
const query_params = {};
|
|
159
93
|
|
|
160
94
|
const xHeaders = {};
|
|
@@ -177,32 +111,13 @@ class Share {
|
|
|
177
111
|
responseData = response[0];
|
|
178
112
|
}
|
|
179
113
|
|
|
180
|
-
const {
|
|
181
|
-
error: res_error,
|
|
182
|
-
} = ShareApplicationModel.QRCodeResp().validate(responseData, {
|
|
183
|
-
abortEarly: false,
|
|
184
|
-
allowUnknown: true,
|
|
185
|
-
});
|
|
186
|
-
|
|
187
|
-
if (res_error) {
|
|
188
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
189
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
190
|
-
} else {
|
|
191
|
-
Logger({
|
|
192
|
-
level: "WARN",
|
|
193
|
-
message: `Response Validation Warnings for application > Share > getApplicationQRCode \n ${res_error}`,
|
|
194
|
-
});
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
|
|
198
114
|
return response;
|
|
199
115
|
}
|
|
200
116
|
|
|
201
117
|
/**
|
|
202
|
-
* @param {ShareApplicationValidator.GetCollectionQRCodeBySlugParam} arg - Arg object.
|
|
203
118
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
204
119
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
205
|
-
* @returns {Promise<
|
|
120
|
+
* @returns {Promise<QRCodeResp>} - Success response
|
|
206
121
|
* @name getCollectionQRCodeBySlug
|
|
207
122
|
* @summary: Collection QR code
|
|
208
123
|
* @description: Generates a QR code for a specific product collection using its slug. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/share/getCollectionQRCodeBySlug/).
|
|
@@ -211,28 +126,13 @@ class Share {
|
|
|
211
126
|
{ slug, requestHeaders } = { requestHeaders: {} },
|
|
212
127
|
{ responseHeaders } = { responseHeaders: false }
|
|
213
128
|
) {
|
|
214
|
-
const
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
);
|
|
220
|
-
if (error) {
|
|
221
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
// Showing warrnings if extra unknown parameters are found
|
|
225
|
-
const {
|
|
226
|
-
error: warrning,
|
|
227
|
-
} = ShareApplicationValidator.getCollectionQRCodeBySlug().validate(
|
|
228
|
-
{ slug },
|
|
229
|
-
{ abortEarly: false, allowUnknown: false }
|
|
230
|
-
);
|
|
231
|
-
if (warrning) {
|
|
232
|
-
Logger({
|
|
233
|
-
level: "WARN",
|
|
234
|
-
message: `Parameter Validation warrnings for application > Share > getCollectionQRCodeBySlug \n ${warrning}`,
|
|
129
|
+
const errors = validateRequiredParams(arguments[0], ["slug"]);
|
|
130
|
+
if (errors.length > 0) {
|
|
131
|
+
const error = new FDKClientValidationError({
|
|
132
|
+
message: "Missing required field",
|
|
133
|
+
details: errors,
|
|
235
134
|
});
|
|
135
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
236
136
|
}
|
|
237
137
|
|
|
238
138
|
const query_params = {};
|
|
@@ -257,33 +157,13 @@ class Share {
|
|
|
257
157
|
responseData = response[0];
|
|
258
158
|
}
|
|
259
159
|
|
|
260
|
-
const {
|
|
261
|
-
error: res_error,
|
|
262
|
-
} = ShareApplicationModel.QRCodeResp().validate(responseData, {
|
|
263
|
-
abortEarly: false,
|
|
264
|
-
allowUnknown: true,
|
|
265
|
-
});
|
|
266
|
-
|
|
267
|
-
if (res_error) {
|
|
268
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
269
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
270
|
-
} else {
|
|
271
|
-
Logger({
|
|
272
|
-
level: "WARN",
|
|
273
|
-
message: `Response Validation Warnings for application > Share > getCollectionQRCodeBySlug \n ${res_error}`,
|
|
274
|
-
});
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
|
|
278
160
|
return response;
|
|
279
161
|
}
|
|
280
162
|
|
|
281
163
|
/**
|
|
282
|
-
* @param {ShareApplicationValidator.GetOriginalShortLinkByHashParam} arg -
|
|
283
|
-
* Arg object.
|
|
284
164
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
285
165
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
286
|
-
* @returns {Promise<
|
|
166
|
+
* @returns {Promise<ShortLinkRes>} - Success response
|
|
287
167
|
* @name getOriginalShortLinkByHash
|
|
288
168
|
* @summary: Original URL
|
|
289
169
|
* @description: Retrieve the original link from a short-link by using a hash value. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/share/getOriginalShortLinkByHash/).
|
|
@@ -292,28 +172,13 @@ class Share {
|
|
|
292
172
|
{ hash, requestHeaders } = { requestHeaders: {} },
|
|
293
173
|
{ responseHeaders } = { responseHeaders: false }
|
|
294
174
|
) {
|
|
295
|
-
const
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
);
|
|
301
|
-
if (error) {
|
|
302
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
// Showing warrnings if extra unknown parameters are found
|
|
306
|
-
const {
|
|
307
|
-
error: warrning,
|
|
308
|
-
} = ShareApplicationValidator.getOriginalShortLinkByHash().validate(
|
|
309
|
-
{ hash },
|
|
310
|
-
{ abortEarly: false, allowUnknown: false }
|
|
311
|
-
);
|
|
312
|
-
if (warrning) {
|
|
313
|
-
Logger({
|
|
314
|
-
level: "WARN",
|
|
315
|
-
message: `Parameter Validation warrnings for application > Share > getOriginalShortLinkByHash \n ${warrning}`,
|
|
175
|
+
const errors = validateRequiredParams(arguments[0], ["hash"]);
|
|
176
|
+
if (errors.length > 0) {
|
|
177
|
+
const error = new FDKClientValidationError({
|
|
178
|
+
message: "Missing required field",
|
|
179
|
+
details: errors,
|
|
316
180
|
});
|
|
181
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
317
182
|
}
|
|
318
183
|
|
|
319
184
|
const query_params = {};
|
|
@@ -338,32 +203,13 @@ class Share {
|
|
|
338
203
|
responseData = response[0];
|
|
339
204
|
}
|
|
340
205
|
|
|
341
|
-
const {
|
|
342
|
-
error: res_error,
|
|
343
|
-
} = ShareApplicationModel.ShortLinkRes().validate(responseData, {
|
|
344
|
-
abortEarly: false,
|
|
345
|
-
allowUnknown: true,
|
|
346
|
-
});
|
|
347
|
-
|
|
348
|
-
if (res_error) {
|
|
349
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
350
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
351
|
-
} else {
|
|
352
|
-
Logger({
|
|
353
|
-
level: "WARN",
|
|
354
|
-
message: `Response Validation Warnings for application > Share > getOriginalShortLinkByHash \n ${res_error}`,
|
|
355
|
-
});
|
|
356
|
-
}
|
|
357
|
-
}
|
|
358
|
-
|
|
359
206
|
return response;
|
|
360
207
|
}
|
|
361
208
|
|
|
362
209
|
/**
|
|
363
|
-
* @param {ShareApplicationValidator.GetProductQRCodeBySlugParam} arg - Arg object.
|
|
364
210
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
365
211
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
366
|
-
* @returns {Promise<
|
|
212
|
+
* @returns {Promise<QRCodeResp>} - Success response
|
|
367
213
|
* @name getProductQRCodeBySlug
|
|
368
214
|
* @summary: Product QR code
|
|
369
215
|
* @description: Creates a QR code for a specific product identified by its slug. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/share/getProductQRCodeBySlug/).
|
|
@@ -372,28 +218,13 @@ class Share {
|
|
|
372
218
|
{ slug, requestHeaders } = { requestHeaders: {} },
|
|
373
219
|
{ responseHeaders } = { responseHeaders: false }
|
|
374
220
|
) {
|
|
375
|
-
const
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
);
|
|
381
|
-
if (error) {
|
|
382
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
383
|
-
}
|
|
384
|
-
|
|
385
|
-
// Showing warrnings if extra unknown parameters are found
|
|
386
|
-
const {
|
|
387
|
-
error: warrning,
|
|
388
|
-
} = ShareApplicationValidator.getProductQRCodeBySlug().validate(
|
|
389
|
-
{ slug },
|
|
390
|
-
{ abortEarly: false, allowUnknown: false }
|
|
391
|
-
);
|
|
392
|
-
if (warrning) {
|
|
393
|
-
Logger({
|
|
394
|
-
level: "WARN",
|
|
395
|
-
message: `Parameter Validation warrnings for application > Share > getProductQRCodeBySlug \n ${warrning}`,
|
|
221
|
+
const errors = validateRequiredParams(arguments[0], ["slug"]);
|
|
222
|
+
if (errors.length > 0) {
|
|
223
|
+
const error = new FDKClientValidationError({
|
|
224
|
+
message: "Missing required field",
|
|
225
|
+
details: errors,
|
|
396
226
|
});
|
|
227
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
397
228
|
}
|
|
398
229
|
|
|
399
230
|
const query_params = {};
|
|
@@ -418,32 +249,13 @@ class Share {
|
|
|
418
249
|
responseData = response[0];
|
|
419
250
|
}
|
|
420
251
|
|
|
421
|
-
const {
|
|
422
|
-
error: res_error,
|
|
423
|
-
} = ShareApplicationModel.QRCodeResp().validate(responseData, {
|
|
424
|
-
abortEarly: false,
|
|
425
|
-
allowUnknown: true,
|
|
426
|
-
});
|
|
427
|
-
|
|
428
|
-
if (res_error) {
|
|
429
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
430
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
431
|
-
} else {
|
|
432
|
-
Logger({
|
|
433
|
-
level: "WARN",
|
|
434
|
-
message: `Response Validation Warnings for application > Share > getProductQRCodeBySlug \n ${res_error}`,
|
|
435
|
-
});
|
|
436
|
-
}
|
|
437
|
-
}
|
|
438
|
-
|
|
439
252
|
return response;
|
|
440
253
|
}
|
|
441
254
|
|
|
442
255
|
/**
|
|
443
|
-
* @param {ShareApplicationValidator.GetShortLinkByHashParam} arg - Arg object.
|
|
444
256
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
445
257
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
446
|
-
* @returns {Promise<
|
|
258
|
+
* @returns {Promise<ShortLinkRes>} - Success response
|
|
447
259
|
* @name getShortLinkByHash
|
|
448
260
|
* @summary: Get short link
|
|
449
261
|
* @description: Retrieves a previously created short link using its hash identifier. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/share/getShortLinkByHash/).
|
|
@@ -452,26 +264,13 @@ class Share {
|
|
|
452
264
|
{ hash, requestHeaders } = { requestHeaders: {} },
|
|
453
265
|
{ responseHeaders } = { responseHeaders: false }
|
|
454
266
|
) {
|
|
455
|
-
const
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
461
|
-
}
|
|
462
|
-
|
|
463
|
-
// Showing warrnings if extra unknown parameters are found
|
|
464
|
-
const {
|
|
465
|
-
error: warrning,
|
|
466
|
-
} = ShareApplicationValidator.getShortLinkByHash().validate(
|
|
467
|
-
{ hash },
|
|
468
|
-
{ abortEarly: false, allowUnknown: false }
|
|
469
|
-
);
|
|
470
|
-
if (warrning) {
|
|
471
|
-
Logger({
|
|
472
|
-
level: "WARN",
|
|
473
|
-
message: `Parameter Validation warrnings for application > Share > getShortLinkByHash \n ${warrning}`,
|
|
267
|
+
const errors = validateRequiredParams(arguments[0], ["hash"]);
|
|
268
|
+
if (errors.length > 0) {
|
|
269
|
+
const error = new FDKClientValidationError({
|
|
270
|
+
message: "Missing required field",
|
|
271
|
+
details: errors,
|
|
474
272
|
});
|
|
273
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
475
274
|
}
|
|
476
275
|
|
|
477
276
|
const query_params = {};
|
|
@@ -496,32 +295,13 @@ class Share {
|
|
|
496
295
|
responseData = response[0];
|
|
497
296
|
}
|
|
498
297
|
|
|
499
|
-
const {
|
|
500
|
-
error: res_error,
|
|
501
|
-
} = ShareApplicationModel.ShortLinkRes().validate(responseData, {
|
|
502
|
-
abortEarly: false,
|
|
503
|
-
allowUnknown: true,
|
|
504
|
-
});
|
|
505
|
-
|
|
506
|
-
if (res_error) {
|
|
507
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
508
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
509
|
-
} else {
|
|
510
|
-
Logger({
|
|
511
|
-
level: "WARN",
|
|
512
|
-
message: `Response Validation Warnings for application > Share > getShortLinkByHash \n ${res_error}`,
|
|
513
|
-
});
|
|
514
|
-
}
|
|
515
|
-
}
|
|
516
|
-
|
|
517
298
|
return response;
|
|
518
299
|
}
|
|
519
300
|
|
|
520
301
|
/**
|
|
521
|
-
* @param {ShareApplicationValidator.GetUrlQRCodeParam} arg - Arg object.
|
|
522
302
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
523
303
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
524
|
-
* @returns {Promise<
|
|
304
|
+
* @returns {Promise<QRCodeResp>} - Success response
|
|
525
305
|
* @name getUrlQRCode
|
|
526
306
|
* @summary: URL to QR code
|
|
527
307
|
* @description: Converts a given URL into a scannable QR code. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/share/getUrlQRCode/).
|
|
@@ -530,28 +310,6 @@ class Share {
|
|
|
530
310
|
{ url, requestHeaders } = { requestHeaders: {} },
|
|
531
311
|
{ responseHeaders } = { responseHeaders: false }
|
|
532
312
|
) {
|
|
533
|
-
const { error } = ShareApplicationValidator.getUrlQRCode().validate(
|
|
534
|
-
{ url },
|
|
535
|
-
{ abortEarly: false, allowUnknown: true }
|
|
536
|
-
);
|
|
537
|
-
if (error) {
|
|
538
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
539
|
-
}
|
|
540
|
-
|
|
541
|
-
// Showing warrnings if extra unknown parameters are found
|
|
542
|
-
const {
|
|
543
|
-
error: warrning,
|
|
544
|
-
} = ShareApplicationValidator.getUrlQRCode().validate(
|
|
545
|
-
{ url },
|
|
546
|
-
{ abortEarly: false, allowUnknown: false }
|
|
547
|
-
);
|
|
548
|
-
if (warrning) {
|
|
549
|
-
Logger({
|
|
550
|
-
level: "WARN",
|
|
551
|
-
message: `Parameter Validation warrnings for application > Share > getUrlQRCode \n ${warrning}`,
|
|
552
|
-
});
|
|
553
|
-
}
|
|
554
|
-
|
|
555
313
|
const query_params = {};
|
|
556
314
|
query_params["url"] = url;
|
|
557
315
|
|
|
@@ -575,24 +333,6 @@ class Share {
|
|
|
575
333
|
responseData = response[0];
|
|
576
334
|
}
|
|
577
335
|
|
|
578
|
-
const {
|
|
579
|
-
error: res_error,
|
|
580
|
-
} = ShareApplicationModel.QRCodeResp().validate(responseData, {
|
|
581
|
-
abortEarly: false,
|
|
582
|
-
allowUnknown: true,
|
|
583
|
-
});
|
|
584
|
-
|
|
585
|
-
if (res_error) {
|
|
586
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
587
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
588
|
-
} else {
|
|
589
|
-
Logger({
|
|
590
|
-
level: "WARN",
|
|
591
|
-
message: `Response Validation Warnings for application > Share > getUrlQRCode \n ${res_error}`,
|
|
592
|
-
});
|
|
593
|
-
}
|
|
594
|
-
}
|
|
595
|
-
|
|
596
336
|
return response;
|
|
597
337
|
}
|
|
598
338
|
}
|
|
@@ -11,45 +11,39 @@ declare class Theme {
|
|
|
11
11
|
_urls: {};
|
|
12
12
|
updateUrls(urls: any): void;
|
|
13
13
|
/**
|
|
14
|
-
* @param {ThemeApplicationValidator.GetAllPagesParam} arg - Arg object.
|
|
15
14
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
16
15
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
17
|
-
* @returns {Promise<
|
|
16
|
+
* @returns {Promise<AllAvailablePageSchema>} - Success response
|
|
18
17
|
* @name getAllPages
|
|
19
18
|
* @summary: List pages
|
|
20
19
|
* @description: Get all page level configs, sections and seo data of a theme. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/theme/getAllPages/).
|
|
21
20
|
*/
|
|
22
|
-
getAllPages({ themeId, requestHeaders }?:
|
|
21
|
+
getAllPages({ themeId, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options, ...args: any[]): Promise<AllAvailablePageSchema>;
|
|
23
22
|
/**
|
|
24
|
-
* @param {ThemeApplicationValidator.GetAppliedThemeParam} arg - Arg object.
|
|
25
23
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
26
24
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
27
|
-
* @returns {Promise<
|
|
25
|
+
* @returns {Promise<ThemesSchema>} - Success response
|
|
28
26
|
* @name getAppliedTheme
|
|
29
27
|
* @summary: Get applied theme
|
|
30
28
|
* @description: Gets the theme configuration and template details of a theme applied to the application. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/theme/getAppliedTheme/).
|
|
31
29
|
*/
|
|
32
|
-
getAppliedTheme({ requestHeaders }?:
|
|
30
|
+
getAppliedTheme({ requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<ThemesSchema>;
|
|
33
31
|
/**
|
|
34
|
-
* @param {ThemeApplicationValidator.GetPageParam} arg - Arg object.
|
|
35
32
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
36
33
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
37
|
-
* @returns {Promise<
|
|
34
|
+
* @returns {Promise<AvailablePageSchema>} - Success response
|
|
38
35
|
* @name getPage
|
|
39
36
|
* @summary: Get theme page
|
|
40
37
|
* @description: Get page level configurations, applied sections and seo data of a page by `page_value` received from list pages api. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/theme/getPage/).
|
|
41
38
|
*/
|
|
42
|
-
getPage({ themeId, pageValue, filters, sectionPreviewHash, company, requestHeaders, }?:
|
|
39
|
+
getPage({ themeId, pageValue, filters, sectionPreviewHash, company, requestHeaders, }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options, ...args: any[]): Promise<AvailablePageSchema>;
|
|
43
40
|
/**
|
|
44
|
-
* @param {ThemeApplicationValidator.GetThemeForPreviewParam} arg - Arg object.
|
|
45
41
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
46
42
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
47
|
-
* @returns {Promise<
|
|
43
|
+
* @returns {Promise<ThemesSchema>} - Success response
|
|
48
44
|
* @name getThemeForPreview
|
|
49
45
|
* @summary: Get theme for preview
|
|
50
46
|
* @description: Gets the theme configuration and template details of a theme by theme id. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/theme/getThemeForPreview/).
|
|
51
47
|
*/
|
|
52
|
-
getThemeForPreview({ themeId, requestHeaders }?:
|
|
48
|
+
getThemeForPreview({ themeId, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options, ...args: any[]): Promise<ThemesSchema>;
|
|
53
49
|
}
|
|
54
|
-
import ThemeApplicationValidator = require("./ThemeApplicationValidator");
|
|
55
|
-
import ThemeApplicationModel = require("./ThemeApplicationModel");
|