@gofynd/fdk-client-javascript 1.4.15-beta.1 → 1.4.15-beta.11
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 +3 -4
- 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 +90 -142
- package/sdk/application/Catalog/CatalogApplicationClient.js +187 -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 +6 -11
- package/sdk/application/FileStorage/FileStorageApplicationClient.js +19 -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/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/CartPlatformApplicationClient.d.ts +39 -1
- package/sdk/platform/Cart/CartPlatformApplicationClient.js +247 -1
- package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +33 -1
- package/sdk/platform/Cart/CartPlatformApplicationValidator.js +37 -0
- package/sdk/platform/Cart/CartPlatformModel.d.ts +193 -1
- package/sdk/platform/Cart/CartPlatformModel.js +132 -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/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 LeadApplicationModel = require("./LeadApplicationModel");
|
|
10
|
-
const { Logger } = require("./../../common/Logger");
|
|
11
|
-
const Joi = require("joi");
|
|
9
|
+
const { validateRequiredParams } = require("../../common/Validator");
|
|
12
10
|
|
|
13
11
|
class Lead {
|
|
14
12
|
constructor(_conf) {
|
|
@@ -37,10 +35,9 @@ class Lead {
|
|
|
37
35
|
}
|
|
38
36
|
|
|
39
37
|
/**
|
|
40
|
-
* @param {LeadApplicationValidator.CreateHistoryParam} arg - Arg object.
|
|
41
38
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
42
39
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
43
|
-
* @returns {Promise<
|
|
40
|
+
* @returns {Promise<TicketHistory>} - Success response
|
|
44
41
|
* @name createHistory
|
|
45
42
|
* @summary: Log ticket history
|
|
46
43
|
* @description: Create a history entry for a specific support ticket. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/lead/createHistory/).
|
|
@@ -49,26 +46,13 @@ class Lead {
|
|
|
49
46
|
{ id, body, requestHeaders } = { requestHeaders: {} },
|
|
50
47
|
{ responseHeaders } = { responseHeaders: false }
|
|
51
48
|
) {
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
// Showing warrnings if extra unknown parameters are found
|
|
61
|
-
const {
|
|
62
|
-
error: warrning,
|
|
63
|
-
} = LeadApplicationValidator.createHistory().validate(
|
|
64
|
-
{ id, body },
|
|
65
|
-
{ abortEarly: false, allowUnknown: false }
|
|
66
|
-
);
|
|
67
|
-
if (warrning) {
|
|
68
|
-
Logger({
|
|
69
|
-
level: "WARN",
|
|
70
|
-
message: `Parameter Validation warrnings for application > Lead > createHistory \n ${warrning}`,
|
|
49
|
+
const errors = validateRequiredParams(arguments[0], ["id"]);
|
|
50
|
+
if (errors.length > 0) {
|
|
51
|
+
const error = new FDKClientValidationError({
|
|
52
|
+
message: "Missing required field",
|
|
53
|
+
details: errors,
|
|
71
54
|
});
|
|
55
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
72
56
|
}
|
|
73
57
|
|
|
74
58
|
const query_params = {};
|
|
@@ -93,32 +77,13 @@ class Lead {
|
|
|
93
77
|
responseData = response[0];
|
|
94
78
|
}
|
|
95
79
|
|
|
96
|
-
const {
|
|
97
|
-
error: res_error,
|
|
98
|
-
} = LeadApplicationModel.TicketHistory().validate(responseData, {
|
|
99
|
-
abortEarly: false,
|
|
100
|
-
allowUnknown: true,
|
|
101
|
-
});
|
|
102
|
-
|
|
103
|
-
if (res_error) {
|
|
104
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
105
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
106
|
-
} else {
|
|
107
|
-
Logger({
|
|
108
|
-
level: "WARN",
|
|
109
|
-
message: `Response Validation Warnings for application > Lead > createHistory \n ${res_error}`,
|
|
110
|
-
});
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
|
|
114
80
|
return response;
|
|
115
81
|
}
|
|
116
82
|
|
|
117
83
|
/**
|
|
118
|
-
* @param {LeadApplicationValidator.CreateTicketParam} arg - Arg object.
|
|
119
84
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
120
85
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
121
|
-
* @returns {Promise<
|
|
86
|
+
* @returns {Promise<Ticket>} - Success response
|
|
122
87
|
* @name createTicket
|
|
123
88
|
* @summary: Creates a ticket
|
|
124
89
|
* @description: Create a new customer support ticket for a user query. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/lead/createTicket/).
|
|
@@ -127,28 +92,6 @@ class Lead {
|
|
|
127
92
|
{ body, requestHeaders } = { requestHeaders: {} },
|
|
128
93
|
{ responseHeaders } = { responseHeaders: false }
|
|
129
94
|
) {
|
|
130
|
-
const { error } = LeadApplicationValidator.createTicket().validate(
|
|
131
|
-
{ body },
|
|
132
|
-
{ abortEarly: false, allowUnknown: true }
|
|
133
|
-
);
|
|
134
|
-
if (error) {
|
|
135
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
// Showing warrnings if extra unknown parameters are found
|
|
139
|
-
const {
|
|
140
|
-
error: warrning,
|
|
141
|
-
} = LeadApplicationValidator.createTicket().validate(
|
|
142
|
-
{ body },
|
|
143
|
-
{ abortEarly: false, allowUnknown: false }
|
|
144
|
-
);
|
|
145
|
-
if (warrning) {
|
|
146
|
-
Logger({
|
|
147
|
-
level: "WARN",
|
|
148
|
-
message: `Parameter Validation warrnings for application > Lead > createTicket \n ${warrning}`,
|
|
149
|
-
});
|
|
150
|
-
}
|
|
151
|
-
|
|
152
95
|
const query_params = {};
|
|
153
96
|
|
|
154
97
|
const xHeaders = {};
|
|
@@ -171,32 +114,13 @@ class Lead {
|
|
|
171
114
|
responseData = response[0];
|
|
172
115
|
}
|
|
173
116
|
|
|
174
|
-
const {
|
|
175
|
-
error: res_error,
|
|
176
|
-
} = LeadApplicationModel.Ticket().validate(responseData, {
|
|
177
|
-
abortEarly: false,
|
|
178
|
-
allowUnknown: true,
|
|
179
|
-
});
|
|
180
|
-
|
|
181
|
-
if (res_error) {
|
|
182
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
183
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
184
|
-
} else {
|
|
185
|
-
Logger({
|
|
186
|
-
level: "WARN",
|
|
187
|
-
message: `Response Validation Warnings for application > Lead > createTicket \n ${res_error}`,
|
|
188
|
-
});
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
|
|
192
117
|
return response;
|
|
193
118
|
}
|
|
194
119
|
|
|
195
120
|
/**
|
|
196
|
-
* @param {LeadApplicationValidator.GetCustomFormParam} arg - Arg object.
|
|
197
121
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
198
122
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
199
|
-
* @returns {Promise<
|
|
123
|
+
* @returns {Promise<CustomForm>} - Success response
|
|
200
124
|
* @name getCustomForm
|
|
201
125
|
* @summary: Get custom form
|
|
202
126
|
* @description: Get a customizable form template for data collection. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/lead/getCustomForm/).
|
|
@@ -205,26 +129,13 @@ class Lead {
|
|
|
205
129
|
{ slug, requestHeaders } = { requestHeaders: {} },
|
|
206
130
|
{ responseHeaders } = { responseHeaders: false }
|
|
207
131
|
) {
|
|
208
|
-
const
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
// Showing warrnings if extra unknown parameters are found
|
|
217
|
-
const {
|
|
218
|
-
error: warrning,
|
|
219
|
-
} = LeadApplicationValidator.getCustomForm().validate(
|
|
220
|
-
{ slug },
|
|
221
|
-
{ abortEarly: false, allowUnknown: false }
|
|
222
|
-
);
|
|
223
|
-
if (warrning) {
|
|
224
|
-
Logger({
|
|
225
|
-
level: "WARN",
|
|
226
|
-
message: `Parameter Validation warrnings for application > Lead > getCustomForm \n ${warrning}`,
|
|
132
|
+
const errors = validateRequiredParams(arguments[0], ["slug"]);
|
|
133
|
+
if (errors.length > 0) {
|
|
134
|
+
const error = new FDKClientValidationError({
|
|
135
|
+
message: "Missing required field",
|
|
136
|
+
details: errors,
|
|
227
137
|
});
|
|
138
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
228
139
|
}
|
|
229
140
|
|
|
230
141
|
const query_params = {};
|
|
@@ -249,32 +160,13 @@ class Lead {
|
|
|
249
160
|
responseData = response[0];
|
|
250
161
|
}
|
|
251
162
|
|
|
252
|
-
const {
|
|
253
|
-
error: res_error,
|
|
254
|
-
} = LeadApplicationModel.CustomForm().validate(responseData, {
|
|
255
|
-
abortEarly: false,
|
|
256
|
-
allowUnknown: true,
|
|
257
|
-
});
|
|
258
|
-
|
|
259
|
-
if (res_error) {
|
|
260
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
261
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
262
|
-
} else {
|
|
263
|
-
Logger({
|
|
264
|
-
level: "WARN",
|
|
265
|
-
message: `Response Validation Warnings for application > Lead > getCustomForm \n ${res_error}`,
|
|
266
|
-
});
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
|
|
270
163
|
return response;
|
|
271
164
|
}
|
|
272
165
|
|
|
273
166
|
/**
|
|
274
|
-
* @param {LeadApplicationValidator.GetTicketParam} arg - Arg object.
|
|
275
167
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
276
168
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
277
|
-
* @returns {Promise<
|
|
169
|
+
* @returns {Promise<Ticket>} - Success response
|
|
278
170
|
* @name getTicket
|
|
279
171
|
* @summary: Get a support ticket
|
|
280
172
|
* @description: Get details of a specific customer support ticket. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/lead/getTicket/).
|
|
@@ -283,24 +175,13 @@ class Lead {
|
|
|
283
175
|
{ id, requestHeaders } = { requestHeaders: {} },
|
|
284
176
|
{ responseHeaders } = { responseHeaders: false }
|
|
285
177
|
) {
|
|
286
|
-
const
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
// Showing warrnings if extra unknown parameters are found
|
|
295
|
-
const { error: warrning } = LeadApplicationValidator.getTicket().validate(
|
|
296
|
-
{ id },
|
|
297
|
-
{ abortEarly: false, allowUnknown: false }
|
|
298
|
-
);
|
|
299
|
-
if (warrning) {
|
|
300
|
-
Logger({
|
|
301
|
-
level: "WARN",
|
|
302
|
-
message: `Parameter Validation warrnings for application > Lead > getTicket \n ${warrning}`,
|
|
178
|
+
const errors = validateRequiredParams(arguments[0], ["id"]);
|
|
179
|
+
if (errors.length > 0) {
|
|
180
|
+
const error = new FDKClientValidationError({
|
|
181
|
+
message: "Missing required field",
|
|
182
|
+
details: errors,
|
|
303
183
|
});
|
|
184
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
304
185
|
}
|
|
305
186
|
|
|
306
187
|
const query_params = {};
|
|
@@ -325,33 +206,13 @@ class Lead {
|
|
|
325
206
|
responseData = response[0];
|
|
326
207
|
}
|
|
327
208
|
|
|
328
|
-
const {
|
|
329
|
-
error: res_error,
|
|
330
|
-
} = LeadApplicationModel.Ticket().validate(responseData, {
|
|
331
|
-
abortEarly: false,
|
|
332
|
-
allowUnknown: true,
|
|
333
|
-
});
|
|
334
|
-
|
|
335
|
-
if (res_error) {
|
|
336
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
337
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
338
|
-
} else {
|
|
339
|
-
Logger({
|
|
340
|
-
level: "WARN",
|
|
341
|
-
message: `Response Validation Warnings for application > Lead > getTicket \n ${res_error}`,
|
|
342
|
-
});
|
|
343
|
-
}
|
|
344
|
-
}
|
|
345
|
-
|
|
346
209
|
return response;
|
|
347
210
|
}
|
|
348
211
|
|
|
349
212
|
/**
|
|
350
|
-
* @param {LeadApplicationValidator.SubmitCustomFormParam} arg - Arg object.
|
|
351
213
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
352
214
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
353
|
-
* @returns {Promise<
|
|
354
|
-
* Success response
|
|
215
|
+
* @returns {Promise<SubmitCustomFormResponse>} - Success response
|
|
355
216
|
* @name submitCustomForm
|
|
356
217
|
* @summary: Submits form data
|
|
357
218
|
* @description: Create user-entered data from a custom form for processing. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/lead/submitCustomForm/).
|
|
@@ -360,26 +221,13 @@ class Lead {
|
|
|
360
221
|
{ slug, body, requestHeaders } = { requestHeaders: {} },
|
|
361
222
|
{ responseHeaders } = { responseHeaders: false }
|
|
362
223
|
) {
|
|
363
|
-
const
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
// Showing warrnings if extra unknown parameters are found
|
|
372
|
-
const {
|
|
373
|
-
error: warrning,
|
|
374
|
-
} = LeadApplicationValidator.submitCustomForm().validate(
|
|
375
|
-
{ slug, body },
|
|
376
|
-
{ abortEarly: false, allowUnknown: false }
|
|
377
|
-
);
|
|
378
|
-
if (warrning) {
|
|
379
|
-
Logger({
|
|
380
|
-
level: "WARN",
|
|
381
|
-
message: `Parameter Validation warrnings for application > Lead > submitCustomForm \n ${warrning}`,
|
|
224
|
+
const errors = validateRequiredParams(arguments[0], ["slug"]);
|
|
225
|
+
if (errors.length > 0) {
|
|
226
|
+
const error = new FDKClientValidationError({
|
|
227
|
+
message: "Missing required field",
|
|
228
|
+
details: errors,
|
|
382
229
|
});
|
|
230
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
383
231
|
}
|
|
384
232
|
|
|
385
233
|
const query_params = {};
|
|
@@ -404,24 +252,6 @@ class Lead {
|
|
|
404
252
|
responseData = response[0];
|
|
405
253
|
}
|
|
406
254
|
|
|
407
|
-
const {
|
|
408
|
-
error: res_error,
|
|
409
|
-
} = LeadApplicationModel.SubmitCustomFormResponse().validate(responseData, {
|
|
410
|
-
abortEarly: false,
|
|
411
|
-
allowUnknown: true,
|
|
412
|
-
});
|
|
413
|
-
|
|
414
|
-
if (res_error) {
|
|
415
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
416
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
417
|
-
} else {
|
|
418
|
-
Logger({
|
|
419
|
-
level: "WARN",
|
|
420
|
-
message: `Response Validation Warnings for application > Lead > submitCustomForm \n ${res_error}`,
|
|
421
|
-
});
|
|
422
|
-
}
|
|
423
|
-
}
|
|
424
|
-
|
|
425
255
|
return response;
|
|
426
256
|
}
|
|
427
257
|
}
|
|
@@ -18,119 +18,102 @@ declare class Logistic {
|
|
|
18
18
|
_urls: {};
|
|
19
19
|
updateUrls(urls: any): void;
|
|
20
20
|
/**
|
|
21
|
-
* @param {LogisticApplicationValidator.GetAllCountriesParam} arg - Arg object.
|
|
22
21
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
23
22
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
24
|
-
* @returns {Promise<
|
|
23
|
+
* @returns {Promise<CountryListResponse>} - Success response
|
|
25
24
|
* @name getAllCountries
|
|
26
25
|
* @summary: Get deliverable countries
|
|
27
26
|
* @description: Get a list of countries within the specified delivery zones for that application. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/logistic/getAllCountries/).
|
|
28
27
|
*/
|
|
29
|
-
getAllCountries({ requestHeaders }?:
|
|
28
|
+
getAllCountries({ requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<CountryListResponse>;
|
|
30
29
|
/**
|
|
31
|
-
* @param {LogisticApplicationValidator.GetCountriesParam} arg - Arg object.
|
|
32
30
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
33
31
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
34
|
-
* @returns {Promise<
|
|
32
|
+
* @returns {Promise<GetCountries>} - Success response
|
|
35
33
|
* @name getCountries
|
|
36
34
|
* @summary: Get countries
|
|
37
35
|
* @description: List of supported countries. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/logistic/getCountries/).
|
|
38
36
|
*/
|
|
39
|
-
getCountries({ onboarding, pageNo, pageSize, q, requestHeaders }?:
|
|
37
|
+
getCountries({ onboarding, pageNo, pageSize, q, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<GetCountries>;
|
|
40
38
|
/**
|
|
41
|
-
* @param {LogisticApplicationValidator.GetCountryParam} arg - Arg object.
|
|
42
39
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
43
40
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
44
|
-
* @returns {Promise<
|
|
41
|
+
* @returns {Promise<GetCountry>} - Success response
|
|
45
42
|
* @name getCountry
|
|
46
43
|
* @summary: Get country details
|
|
47
44
|
* @description: Get details about a particular country and its address format customized for different business scenarios. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/logistic/getCountry/).
|
|
48
45
|
*/
|
|
49
|
-
getCountry({ countryIsoCode, requestHeaders }?:
|
|
46
|
+
getCountry({ countryIsoCode, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options, ...args: any[]): Promise<GetCountry>;
|
|
50
47
|
/**
|
|
51
|
-
* @param {LogisticApplicationValidator.GetLocalitiesParam} arg - Arg object.
|
|
52
48
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
53
49
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
54
|
-
* @returns {Promise<
|
|
50
|
+
* @returns {Promise<GetLocalities>} - Success response
|
|
55
51
|
* @name getLocalities
|
|
56
52
|
* @summary: Get localities
|
|
57
53
|
* @description: Get geographical data for a specific type of locality based on the provided filters. For instance, obtain a list of cities for a given country and state. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/logistic/getLocalities/).
|
|
58
54
|
*/
|
|
59
|
-
getLocalities({ localityType, country, state, city, pageNo, pageSize, q, requestHeaders, }?:
|
|
55
|
+
getLocalities({ localityType, country, state, city, pageNo, pageSize, q, requestHeaders, }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options, ...args: any[]): Promise<GetLocalities>;
|
|
60
56
|
/**
|
|
61
|
-
* @param {LogisticApplicationValidator.GetLocalityParam} arg - Arg object.
|
|
62
57
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
63
58
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
64
|
-
* @returns {Promise<
|
|
59
|
+
* @returns {Promise<GetLocality>} - Success response
|
|
65
60
|
* @name getLocality
|
|
66
61
|
* @summary: Get locality detail
|
|
67
62
|
* @description: Get detailed geographical data for a specific locality, such as a pincode. For example, for a pincode value of 400603, the service returns its parent locations, including city, state, and country details. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/logistic/getLocality/).
|
|
68
63
|
*/
|
|
69
|
-
getLocality({ localityType, localityValue, country, state, city, requestHeaders }?:
|
|
64
|
+
getLocality({ localityType, localityValue, country, state, city, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options, ...args: any[]): Promise<GetLocality>;
|
|
70
65
|
/**
|
|
71
|
-
* @param {LogisticApplicationValidator.GetLocationsParam} arg - Arg object.
|
|
72
66
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
73
67
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
74
|
-
* @returns {Promise<
|
|
68
|
+
* @returns {Promise<GetStoreResponse>} - Success response
|
|
75
69
|
* @name getLocations
|
|
76
70
|
* @summary: Get available selling locations
|
|
77
71
|
* @description: Get stores available for the application based on Delivery Zones and Order Orchestration rules. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/logistic/getLocations/).
|
|
78
72
|
*/
|
|
79
|
-
getLocations({ xApplicationId, xApplicationData, country, state, city, pincode, sector, pageNo, pageSize, requestHeaders, }?:
|
|
73
|
+
getLocations({ xApplicationId, xApplicationData, country, state, city, pincode, sector, pageNo, pageSize, requestHeaders, }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<GetStoreResponse>;
|
|
80
74
|
/**
|
|
81
|
-
* @param {LogisticApplicationValidator.GetOptimalLocationsParam} arg - Arg object.
|
|
82
75
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
83
76
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
84
|
-
* @returns {Promise<
|
|
85
|
-
* Success response
|
|
77
|
+
* @returns {Promise<ReAssignStoreResponse>} - Success response
|
|
86
78
|
* @name getOptimalLocations
|
|
87
79
|
* @summary: Get selling locations
|
|
88
80
|
* @description: Get optimal fulfillment centre for customers by analyzing their location, product availability, and inventory levels. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/logistic/getOptimalLocations/).
|
|
89
81
|
*/
|
|
90
|
-
getOptimalLocations({ body, requestHeaders }?:
|
|
82
|
+
getOptimalLocations({ body, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<ReAssignStoreResponse>;
|
|
91
83
|
/**
|
|
92
|
-
* @param {LogisticApplicationValidator.GetPincodeCityParam} arg - Arg object.
|
|
93
84
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
94
85
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
95
|
-
* @returns {Promise<
|
|
86
|
+
* @returns {Promise<PincodeApiResponse>} - Success response
|
|
96
87
|
* @name getPincodeCity
|
|
97
88
|
* @summary: Get pincode details
|
|
98
89
|
* @description: Get details of a specific pincode, such as obtaining its city and state information. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/logistic/getPincodeCity/).
|
|
99
90
|
*/
|
|
100
|
-
getPincodeCity({ pincode, requestHeaders }?:
|
|
91
|
+
getPincodeCity({ pincode, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options, ...args: any[]): Promise<PincodeApiResponse>;
|
|
101
92
|
/**
|
|
102
|
-
* @param {LogisticApplicationValidator.GetPincodeZonesParam} arg - Arg object.
|
|
103
93
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
104
94
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
105
|
-
* @returns {Promise<
|
|
106
|
-
* - Success response
|
|
107
|
-
*
|
|
95
|
+
* @returns {Promise<GetZoneFromPincodeViewResponse>} - Success response
|
|
108
96
|
* @name getPincodeZones
|
|
109
97
|
* @summary: Get zones
|
|
110
98
|
* @description: Get the delivery zone associated with a given pincode. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/logistic/getPincodeZones/).
|
|
111
99
|
*/
|
|
112
|
-
getPincodeZones({ body, requestHeaders }?:
|
|
100
|
+
getPincodeZones({ body, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<GetZoneFromPincodeViewResponse>;
|
|
113
101
|
/**
|
|
114
|
-
* @param {LogisticApplicationValidator.GetTatProductParam} arg - Arg object.
|
|
115
102
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
116
103
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
117
|
-
* @returns {Promise<
|
|
104
|
+
* @returns {Promise<TATViewResponse>} - Success response
|
|
118
105
|
* @name getTatProduct
|
|
119
106
|
* @summary: Get product's turnaround time
|
|
120
107
|
* @description: Get the estimated delivery time frame for a specific product from a designated store. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/logistic/getTatProduct/).
|
|
121
108
|
*/
|
|
122
|
-
getTatProduct({ body, requestHeaders }?:
|
|
109
|
+
getTatProduct({ body, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<TATViewResponse>;
|
|
123
110
|
/**
|
|
124
|
-
* @param {LogisticApplicationValidator.ValidateAddressParam} arg - Arg object.
|
|
125
111
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
126
112
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
127
|
-
* @returns {Promise<
|
|
128
|
-
* Success response
|
|
113
|
+
* @returns {Promise<ValidateAddressRequest>} - Success response
|
|
129
114
|
* @name validateAddress
|
|
130
115
|
* @summary: Validate address
|
|
131
116
|
* @description: Validate addresses using specific templates customized for each country and tailored to various business scenarios. This validation ensures that the data conforms to the information currently stored in the system. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/logistic/validateAddress/).
|
|
132
117
|
*/
|
|
133
|
-
validateAddress({ countryIsoCode, templateName, body, requestHeaders }?:
|
|
118
|
+
validateAddress({ countryIsoCode, templateName, body, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options, ...args: any[]): Promise<ValidateAddressRequest>;
|
|
134
119
|
}
|
|
135
|
-
import LogisticApplicationModel = require("./LogisticApplicationModel");
|
|
136
|
-
import LogisticApplicationValidator = require("./LogisticApplicationValidator");
|