@gofynd/fdk-client-javascript 1.4.15-beta.2 → 1.4.15-beta.4
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 +27 -1203
- package/sdk/application/Catalog/CatalogApplicationClient.d.ts +80 -142
- package/sdk/application/Catalog/CatalogApplicationClient.js +40 -1344
- package/sdk/application/Common/CommonApplicationClient.d.ts +4 -8
- package/sdk/application/Common/CommonApplicationClient.js +2 -92
- package/sdk/application/Communication/CommunicationApplicationClient.d.ts +6 -19
- package/sdk/application/Communication/CommunicationApplicationClient.js +3 -148
- package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +32 -73
- package/sdk/application/Configuration/ConfigurationApplicationClient.js +16 -727
- package/sdk/application/Content/ContentApplicationClient.d.ts +46 -78
- package/sdk/application/Content/ContentApplicationClient.js +23 -941
- package/sdk/application/FileStorage/FileStorageApplicationClient.d.ts +6 -11
- package/sdk/application/FileStorage/FileStorageApplicationClient.js +4 -134
- package/sdk/application/Lead/LeadApplicationClient.d.ts +10 -18
- package/sdk/application/Lead/LeadApplicationClient.js +5 -217
- package/sdk/application/Logistic/LogisticApplicationClient.d.ts +22 -39
- package/sdk/application/Logistic/LogisticApplicationClient.js +11 -496
- package/sdk/application/Order/OrderApplicationClient.d.ts +22 -42
- package/sdk/application/Order/OrderApplicationClient.js +11 -505
- package/sdk/application/Payment/PaymentApplicationClient.d.ts +92 -212
- package/sdk/application/Payment/PaymentApplicationClient.js +46 -2106
- package/sdk/application/Rewards/RewardsApplicationClient.d.ts +14 -28
- package/sdk/application/Rewards/RewardsApplicationClient.js +7 -311
- package/sdk/application/Share/ShareApplicationClient.d.ts +14 -24
- package/sdk/application/Share/ShareApplicationClient.js +7 -309
- package/sdk/application/Theme/ThemeApplicationClient.d.ts +8 -14
- package/sdk/application/Theme/ThemeApplicationClient.js +4 -174
- package/sdk/application/User/UserApplicationClient.d.ts +85 -136
- package/sdk/application/User/UserApplicationClient.js +42 -1818
- package/sdk/application/Webhook/WebhookApplicationClient.d.ts +2 -5
- package/sdk/application/Webhook/WebhookApplicationClient.js +1 -50
- package/sdk/application/index.d.ts +0 -18
- package/sdk/application/index.js +0 -33
- package/sdk/partner/OAuthClient.js +1 -0
- package/sdk/platform/Cart/CartPlatformModel.d.ts +7 -0
- package/sdk/platform/Cart/CartPlatformModel.js +3 -0
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +0 -7
- package/sdk/platform/Catalog/CatalogPlatformModel.js +0 -3
- package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +7 -0
- package/sdk/platform/Configuration/ConfigurationPlatformModel.js +3 -0
- package/sdk/public/Configuration/ConfigurationPublicClient.js +4 -2
- package/sdk/public/Content/ContentPublicClient.js +4 -2
- package/sdk/public/Partner/PartnerPublicClient.js +4 -2
- package/sdk/public/Webhook/WebhookPublicClient.js +4 -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,6 @@
|
|
|
1
1
|
const ApplicationAPIClient = require("../ApplicationAPIClient");
|
|
2
|
-
const {
|
|
3
|
-
FDKClientValidationError,
|
|
4
|
-
FDKResponseValidationError,
|
|
5
|
-
} = require("../../common/FDKError");
|
|
6
2
|
const constructUrl = require("../constructUrl");
|
|
7
3
|
const Paginator = require("../../common/Paginator");
|
|
8
|
-
const ThemeApplicationValidator = require("./ThemeApplicationValidator");
|
|
9
|
-
const ThemeApplicationModel = require("./ThemeApplicationModel");
|
|
10
|
-
const { Logger } = require("./../../common/Logger");
|
|
11
|
-
const Joi = require("joi");
|
|
12
4
|
|
|
13
5
|
class Theme {
|
|
14
6
|
constructor(_conf) {
|
|
@@ -36,10 +28,9 @@ class Theme {
|
|
|
36
28
|
}
|
|
37
29
|
|
|
38
30
|
/**
|
|
39
|
-
* @param {ThemeApplicationValidator.GetAllPagesParam} arg - Arg object.
|
|
40
31
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
41
32
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
42
|
-
* @returns {Promise<
|
|
33
|
+
* @returns {Promise<AllAvailablePageSchema>} - Success response
|
|
43
34
|
* @name getAllPages
|
|
44
35
|
* @summary: List pages
|
|
45
36
|
* @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/).
|
|
@@ -48,28 +39,6 @@ class Theme {
|
|
|
48
39
|
{ themeId, requestHeaders } = { requestHeaders: {} },
|
|
49
40
|
{ responseHeaders } = { responseHeaders: false }
|
|
50
41
|
) {
|
|
51
|
-
const { error } = ThemeApplicationValidator.getAllPages().validate(
|
|
52
|
-
{ themeId },
|
|
53
|
-
{ abortEarly: false, allowUnknown: true }
|
|
54
|
-
);
|
|
55
|
-
if (error) {
|
|
56
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
// Showing warrnings if extra unknown parameters are found
|
|
60
|
-
const {
|
|
61
|
-
error: warrning,
|
|
62
|
-
} = ThemeApplicationValidator.getAllPages().validate(
|
|
63
|
-
{ themeId },
|
|
64
|
-
{ abortEarly: false, allowUnknown: false }
|
|
65
|
-
);
|
|
66
|
-
if (warrning) {
|
|
67
|
-
Logger({
|
|
68
|
-
level: "WARN",
|
|
69
|
-
message: `Parameter Validation warrnings for application > Theme > getAllPages \n ${warrning}`,
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
|
|
73
42
|
const query_params = {};
|
|
74
43
|
|
|
75
44
|
const xHeaders = {};
|
|
@@ -92,32 +61,13 @@ class Theme {
|
|
|
92
61
|
responseData = response[0];
|
|
93
62
|
}
|
|
94
63
|
|
|
95
|
-
const {
|
|
96
|
-
error: res_error,
|
|
97
|
-
} = ThemeApplicationModel.AllAvailablePageSchema().validate(responseData, {
|
|
98
|
-
abortEarly: false,
|
|
99
|
-
allowUnknown: true,
|
|
100
|
-
});
|
|
101
|
-
|
|
102
|
-
if (res_error) {
|
|
103
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
104
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
105
|
-
} else {
|
|
106
|
-
Logger({
|
|
107
|
-
level: "WARN",
|
|
108
|
-
message: `Response Validation Warnings for application > Theme > getAllPages \n ${res_error}`,
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
|
|
113
64
|
return response;
|
|
114
65
|
}
|
|
115
66
|
|
|
116
67
|
/**
|
|
117
|
-
* @param {ThemeApplicationValidator.GetAppliedThemeParam} arg - Arg object.
|
|
118
68
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
119
69
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
120
|
-
* @returns {Promise<
|
|
70
|
+
* @returns {Promise<ThemesSchema>} - Success response
|
|
121
71
|
* @name getAppliedTheme
|
|
122
72
|
* @summary: Get applied theme
|
|
123
73
|
* @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/).
|
|
@@ -126,28 +76,6 @@ class Theme {
|
|
|
126
76
|
{ requestHeaders } = { requestHeaders: {} },
|
|
127
77
|
{ responseHeaders } = { responseHeaders: false }
|
|
128
78
|
) {
|
|
129
|
-
const { error } = ThemeApplicationValidator.getAppliedTheme().validate(
|
|
130
|
-
{},
|
|
131
|
-
{ abortEarly: false, allowUnknown: true }
|
|
132
|
-
);
|
|
133
|
-
if (error) {
|
|
134
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
// Showing warrnings if extra unknown parameters are found
|
|
138
|
-
const {
|
|
139
|
-
error: warrning,
|
|
140
|
-
} = ThemeApplicationValidator.getAppliedTheme().validate(
|
|
141
|
-
{},
|
|
142
|
-
{ abortEarly: false, allowUnknown: false }
|
|
143
|
-
);
|
|
144
|
-
if (warrning) {
|
|
145
|
-
Logger({
|
|
146
|
-
level: "WARN",
|
|
147
|
-
message: `Parameter Validation warrnings for application > Theme > getAppliedTheme \n ${warrning}`,
|
|
148
|
-
});
|
|
149
|
-
}
|
|
150
|
-
|
|
151
79
|
const query_params = {};
|
|
152
80
|
|
|
153
81
|
const xHeaders = {};
|
|
@@ -170,32 +98,13 @@ class Theme {
|
|
|
170
98
|
responseData = response[0];
|
|
171
99
|
}
|
|
172
100
|
|
|
173
|
-
const {
|
|
174
|
-
error: res_error,
|
|
175
|
-
} = ThemeApplicationModel.ThemesSchema().validate(responseData, {
|
|
176
|
-
abortEarly: false,
|
|
177
|
-
allowUnknown: true,
|
|
178
|
-
});
|
|
179
|
-
|
|
180
|
-
if (res_error) {
|
|
181
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
182
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
183
|
-
} else {
|
|
184
|
-
Logger({
|
|
185
|
-
level: "WARN",
|
|
186
|
-
message: `Response Validation Warnings for application > Theme > getAppliedTheme \n ${res_error}`,
|
|
187
|
-
});
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
|
|
191
101
|
return response;
|
|
192
102
|
}
|
|
193
103
|
|
|
194
104
|
/**
|
|
195
|
-
* @param {ThemeApplicationValidator.GetPageParam} arg - Arg object.
|
|
196
105
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
197
106
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
198
|
-
* @returns {Promise<
|
|
107
|
+
* @returns {Promise<AvailablePageSchema>} - Success response
|
|
199
108
|
* @name getPage
|
|
200
109
|
* @summary: Get theme page
|
|
201
110
|
* @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/).
|
|
@@ -211,26 +120,6 @@ class Theme {
|
|
|
211
120
|
} = { requestHeaders: {} },
|
|
212
121
|
{ responseHeaders } = { responseHeaders: false }
|
|
213
122
|
) {
|
|
214
|
-
const { error } = ThemeApplicationValidator.getPage().validate(
|
|
215
|
-
{ themeId, pageValue, filters, sectionPreviewHash, company },
|
|
216
|
-
{ abortEarly: false, allowUnknown: true }
|
|
217
|
-
);
|
|
218
|
-
if (error) {
|
|
219
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
// Showing warrnings if extra unknown parameters are found
|
|
223
|
-
const { error: warrning } = ThemeApplicationValidator.getPage().validate(
|
|
224
|
-
{ themeId, pageValue, filters, sectionPreviewHash, company },
|
|
225
|
-
{ abortEarly: false, allowUnknown: false }
|
|
226
|
-
);
|
|
227
|
-
if (warrning) {
|
|
228
|
-
Logger({
|
|
229
|
-
level: "WARN",
|
|
230
|
-
message: `Parameter Validation warrnings for application > Theme > getPage \n ${warrning}`,
|
|
231
|
-
});
|
|
232
|
-
}
|
|
233
|
-
|
|
234
123
|
const query_params = {};
|
|
235
124
|
query_params["filters"] = filters;
|
|
236
125
|
query_params["section_preview_hash"] = sectionPreviewHash;
|
|
@@ -256,32 +145,13 @@ class Theme {
|
|
|
256
145
|
responseData = response[0];
|
|
257
146
|
}
|
|
258
147
|
|
|
259
|
-
const {
|
|
260
|
-
error: res_error,
|
|
261
|
-
} = ThemeApplicationModel.AvailablePageSchema().validate(responseData, {
|
|
262
|
-
abortEarly: false,
|
|
263
|
-
allowUnknown: true,
|
|
264
|
-
});
|
|
265
|
-
|
|
266
|
-
if (res_error) {
|
|
267
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
268
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
269
|
-
} else {
|
|
270
|
-
Logger({
|
|
271
|
-
level: "WARN",
|
|
272
|
-
message: `Response Validation Warnings for application > Theme > getPage \n ${res_error}`,
|
|
273
|
-
});
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
|
|
277
148
|
return response;
|
|
278
149
|
}
|
|
279
150
|
|
|
280
151
|
/**
|
|
281
|
-
* @param {ThemeApplicationValidator.GetThemeForPreviewParam} arg - Arg object.
|
|
282
152
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
283
153
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
284
|
-
* @returns {Promise<
|
|
154
|
+
* @returns {Promise<ThemesSchema>} - Success response
|
|
285
155
|
* @name getThemeForPreview
|
|
286
156
|
* @summary: Get theme for preview
|
|
287
157
|
* @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/).
|
|
@@ -290,28 +160,6 @@ class Theme {
|
|
|
290
160
|
{ themeId, requestHeaders } = { requestHeaders: {} },
|
|
291
161
|
{ responseHeaders } = { responseHeaders: false }
|
|
292
162
|
) {
|
|
293
|
-
const { error } = ThemeApplicationValidator.getThemeForPreview().validate(
|
|
294
|
-
{ themeId },
|
|
295
|
-
{ abortEarly: false, allowUnknown: true }
|
|
296
|
-
);
|
|
297
|
-
if (error) {
|
|
298
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
// Showing warrnings if extra unknown parameters are found
|
|
302
|
-
const {
|
|
303
|
-
error: warrning,
|
|
304
|
-
} = ThemeApplicationValidator.getThemeForPreview().validate(
|
|
305
|
-
{ themeId },
|
|
306
|
-
{ abortEarly: false, allowUnknown: false }
|
|
307
|
-
);
|
|
308
|
-
if (warrning) {
|
|
309
|
-
Logger({
|
|
310
|
-
level: "WARN",
|
|
311
|
-
message: `Parameter Validation warrnings for application > Theme > getThemeForPreview \n ${warrning}`,
|
|
312
|
-
});
|
|
313
|
-
}
|
|
314
|
-
|
|
315
163
|
const query_params = {};
|
|
316
164
|
|
|
317
165
|
const xHeaders = {};
|
|
@@ -334,24 +182,6 @@ class Theme {
|
|
|
334
182
|
responseData = response[0];
|
|
335
183
|
}
|
|
336
184
|
|
|
337
|
-
const {
|
|
338
|
-
error: res_error,
|
|
339
|
-
} = ThemeApplicationModel.ThemesSchema().validate(responseData, {
|
|
340
|
-
abortEarly: false,
|
|
341
|
-
allowUnknown: true,
|
|
342
|
-
});
|
|
343
|
-
|
|
344
|
-
if (res_error) {
|
|
345
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
346
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
347
|
-
} else {
|
|
348
|
-
Logger({
|
|
349
|
-
level: "WARN",
|
|
350
|
-
message: `Response Validation Warnings for application > Theme > getThemeForPreview \n ${res_error}`,
|
|
351
|
-
});
|
|
352
|
-
}
|
|
353
|
-
}
|
|
354
|
-
|
|
355
185
|
return response;
|
|
356
186
|
}
|
|
357
187
|
}
|