@gofynd/fdk-client-javascript 1.0.1 → 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 +414 -414
- package/documentation/application/CONTENT.md +15 -1
- package/documentation/application/ORDER.md +290 -290
- package/documentation/application/PAYMENT.md +255 -255
- package/documentation/application/POSCART.md +297 -297
- package/documentation/platform/CART.md +499 -499
- package/documentation/platform/CATALOG.md +3088 -2702
- package/documentation/platform/COMPANYPROFILE.md +201 -201
- package/documentation/platform/CONTENT.md +123 -1
- package/documentation/platform/ORDER.md +1233 -1158
- package/documentation/platform/PARTNER.md +7 -7
- package/documentation/platform/PAYMENT.md +83 -83
- package/package.json +1 -1
- package/sdk/application/ApplicationConfig.js +1 -1
- package/sdk/application/Cart/CartApplicationClient.js +619 -108
- package/sdk/application/Cart/CartApplicationModel.d.ts +7 -7
- package/sdk/application/Cart/CartApplicationModel.js +335 -335
- package/sdk/application/Catalog/CatalogApplicationClient.d.ts +1 -1
- package/sdk/application/Catalog/CatalogApplicationClient.js +730 -134
- package/sdk/application/Catalog/CatalogApplicationModel.d.ts +21 -21
- package/sdk/application/Catalog/CatalogApplicationModel.js +547 -547
- package/sdk/application/Common/CommonApplicationClient.js +48 -8
- package/sdk/application/Communication/CommunicationApplicationClient.js +75 -14
- package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +1 -1
- package/sdk/application/Configuration/ConfigurationApplicationClient.js +392 -66
- package/sdk/application/Content/ContentApplicationClient.js +444 -76
- package/sdk/application/Content/ContentApplicationModel.d.ts +1 -0
- package/sdk/application/Content/ContentApplicationModel.js +11 -1
- package/sdk/application/FileStorage/FileStorageApplicationClient.js +74 -12
- package/sdk/application/Lead/LeadApplicationClient.js +164 -30
- package/sdk/application/Logistic/LogisticApplicationClient.js +98 -16
- package/sdk/application/Order/OrderApplicationClient.d.ts +1 -1
- package/sdk/application/Order/OrderApplicationClient.js +287 -54
- package/sdk/application/Order/OrderApplicationModel.d.ts +19 -19
- package/sdk/application/Order/OrderApplicationModel.js +357 -357
- package/sdk/application/Payment/PaymentApplicationClient.js +961 -186
- package/sdk/application/Payment/PaymentApplicationModel.d.ts +3 -3
- package/sdk/application/Payment/PaymentApplicationModel.js +352 -352
- package/sdk/application/PosCart/PosCartApplicationClient.js +645 -114
- package/sdk/application/PosCart/PosCartApplicationModel.d.ts +15 -15
- package/sdk/application/PosCart/PosCartApplicationModel.js +389 -389
- package/sdk/application/Rewards/RewardsApplicationClient.js +168 -28
- package/sdk/application/Share/ShareApplicationClient.js +157 -32
- package/sdk/application/Theme/ThemeApplicationClient.js +94 -16
- package/sdk/application/User/UserApplicationClient.js +806 -148
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.d.ts +16 -8
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.js +191 -34
- package/sdk/platform/Analytics/AnalyticsPlatformClient.d.ts +8 -4
- package/sdk/platform/Analytics/AnalyticsPlatformClient.js +103 -16
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.d.ts +8 -4
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +103 -16
- package/sdk/platform/Billing/BillingPlatformClient.d.ts +24 -12
- package/sdk/platform/Billing/BillingPlatformClient.js +299 -54
- package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +34 -17
- package/sdk/platform/Cart/CartPlatformApplicationClient.js +409 -72
- package/sdk/platform/Cart/CartPlatformModel.d.ts +35 -35
- package/sdk/platform/Cart/CartPlatformModel.js +617 -617
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +167 -114
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +1562 -453
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +8 -8
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +39 -39
- package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +314 -196
- package/sdk/platform/Catalog/CatalogPlatformClient.js +2459 -718
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +103 -94
- package/sdk/platform/Catalog/CatalogPlatformModel.js +2063 -1797
- package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +17 -15
- package/sdk/platform/Catalog/CatalogPlatformValidator.js +95 -76
- package/sdk/platform/Common/CommonPlatformClient.d.ts +4 -2
- package/sdk/platform/Common/CommonPlatformClient.js +51 -8
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +80 -40
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +1000 -168
- package/sdk/platform/Communication/CommunicationPlatformClient.d.ts +2 -1
- package/sdk/platform/Communication/CommunicationPlatformClient.js +28 -4
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +27 -14
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +335 -54
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +10 -10
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +278 -278
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +56 -28
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +702 -118
- package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +36 -18
- package/sdk/platform/Configuration/ConfigurationPlatformClient.js +457 -82
- package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +148 -67
- package/sdk/platform/Content/ContentPlatformApplicationClient.js +1724 -284
- 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 +270 -44
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +8 -4
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +102 -16
- package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +12 -6
- package/sdk/platform/FileStorage/FileStoragePlatformClient.js +150 -24
- package/sdk/platform/Inventory/InventoryPlatformClient.d.ts +27 -14
- package/sdk/platform/Inventory/InventoryPlatformClient.js +316 -52
- package/sdk/platform/Lead/LeadPlatformApplicationClient.d.ts +26 -13
- package/sdk/platform/Lead/LeadPlatformApplicationClient.js +311 -52
- package/sdk/platform/Lead/LeadPlatformClient.d.ts +22 -11
- package/sdk/platform/Lead/LeadPlatformClient.js +266 -44
- package/sdk/platform/OAuthClient.js +8 -8
- package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +6 -3
- package/sdk/platform/Order/OrderPlatformApplicationClient.js +78 -14
- package/sdk/platform/Order/OrderPlatformClient.d.ts +95 -43
- package/sdk/platform/Order/OrderPlatformClient.js +1062 -180
- package/sdk/platform/Order/OrderPlatformModel.d.ts +64 -60
- package/sdk/platform/Order/OrderPlatformModel.js +1481 -1425
- package/sdk/platform/Order/OrderPlatformValidator.js +5 -0
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.d.ts +4 -2
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.js +52 -8
- 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 +287 -56
- package/sdk/platform/Payment/PaymentPlatformClient.d.ts +21 -11
- package/sdk/platform/Payment/PaymentPlatformClient.js +263 -48
- package/sdk/platform/Payment/PaymentPlatformModel.js +122 -122
- package/sdk/platform/PlatformApplicationClient.d.ts +2959 -2787
- package/sdk/platform/PlatformApplicationClient.js +3420 -3212
- package/sdk/platform/PlatformClient.d.ts +2959 -2787
- package/sdk/platform/PlatformClient.js +3420 -3212
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.d.ts +26 -13
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +308 -54
- package/sdk/platform/Share/SharePlatformApplicationClient.d.ts +8 -4
- package/sdk/platform/Share/SharePlatformApplicationClient.js +94 -16
- package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +47 -23
- package/sdk/platform/Theme/ThemePlatformApplicationClient.js +571 -96
- package/sdk/platform/User/UserPlatformApplicationClient.d.ts +24 -12
- package/sdk/platform/User/UserPlatformApplicationClient.js +296 -48
- package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +12 -6
- package/sdk/platform/Webhook/WebhookPlatformClient.js +157 -30
- package/sdk/public/Configuration/ConfigurationPublicClient.js +51 -8
- package/sdk/public/Inventory/InventoryPublicClient.js +149 -26
- package/sdk/public/Webhook/WebhookPublicClient.js +51 -10
|
@@ -45,7 +45,15 @@ class ContentModel {
|
|
|
45
45
|
|
|
46
46
|
created_at: Joi.string().allow(""),
|
|
47
47
|
|
|
48
|
-
__source: ContentModel.
|
|
48
|
+
__source: ContentModel.PathSourceSchema(),
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
static PathSourceSchema() {
|
|
53
|
+
return Joi.object({
|
|
54
|
+
type: Joi.string().allow(""),
|
|
55
|
+
|
|
56
|
+
id: Joi.string().allow(""),
|
|
49
57
|
});
|
|
50
58
|
}
|
|
51
59
|
|
|
@@ -65,6 +73,8 @@ class ContentModel {
|
|
|
65
73
|
|
|
66
74
|
sitemap_enabled: Joi.boolean(),
|
|
67
75
|
|
|
76
|
+
cannonical_enabled: Joi.boolean(),
|
|
77
|
+
|
|
68
78
|
custom_meta_tags: Joi.array().items(Joi.any()),
|
|
69
79
|
|
|
70
80
|
details: ContentModel.Detail(),
|
|
@@ -3,6 +3,8 @@ const constructUrl = require("../constructUrl");
|
|
|
3
3
|
const Paginator = require("../../common/Paginator");
|
|
4
4
|
const { FDKClientValidationError } = require("../../common/FDKError");
|
|
5
5
|
const FileStorageValidator = require("./FileStorageApplicationValidator");
|
|
6
|
+
const FileStorageModel = require("./FileStorageApplicationModel");
|
|
7
|
+
const { Logger } = require("./../../common/Logger");
|
|
6
8
|
const axios = require("axios");
|
|
7
9
|
|
|
8
10
|
class FileStorage {
|
|
@@ -56,7 +58,7 @@ class FileStorage {
|
|
|
56
58
|
* After successfully upload, call the `completeUpload` API to finish the upload process.
|
|
57
59
|
* This operation will return the URL of the uploaded file.
|
|
58
60
|
*/
|
|
59
|
-
startUpload({ namespace, body } = {}) {
|
|
61
|
+
async startUpload({ namespace, body } = {}) {
|
|
60
62
|
const { error } = FileStorageValidator.startUpload().validate(
|
|
61
63
|
{ namespace, body },
|
|
62
64
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -71,15 +73,18 @@ class FileStorage {
|
|
|
71
73
|
{ abortEarly: false, allowUnknown: false }
|
|
72
74
|
);
|
|
73
75
|
if (warrning) {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
+
Logger({
|
|
77
|
+
level: "WARN",
|
|
78
|
+
message: "Parameter Validation warrnings for startUpload",
|
|
79
|
+
});
|
|
80
|
+
Logger({ level: "WARN", message: warrning });
|
|
76
81
|
}
|
|
77
82
|
|
|
78
83
|
const query_params = {};
|
|
79
84
|
|
|
80
85
|
const xHeaders = {};
|
|
81
86
|
|
|
82
|
-
|
|
87
|
+
const response = await APIClient.execute(
|
|
83
88
|
this._conf,
|
|
84
89
|
"post",
|
|
85
90
|
constructUrl({
|
|
@@ -90,6 +95,23 @@ class FileStorage {
|
|
|
90
95
|
body,
|
|
91
96
|
xHeaders
|
|
92
97
|
);
|
|
98
|
+
|
|
99
|
+
const {
|
|
100
|
+
error: res_error,
|
|
101
|
+
} = FileStorageModel.StartResponse().validate(response, {
|
|
102
|
+
abortEarly: false,
|
|
103
|
+
allowUnknown: false,
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
if (res_error) {
|
|
107
|
+
Logger({
|
|
108
|
+
level: "WARN",
|
|
109
|
+
message: "Response Validation Warnnings for startUpload",
|
|
110
|
+
});
|
|
111
|
+
Logger({ level: "WARN", message: res_error });
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
return response;
|
|
93
115
|
}
|
|
94
116
|
|
|
95
117
|
/**
|
|
@@ -117,7 +139,7 @@ class FileStorage {
|
|
|
117
139
|
* After successfully upload, call the `completeUpload` API to finish the upload process.
|
|
118
140
|
* This operation will return the URL of the uploaded file.
|
|
119
141
|
*/
|
|
120
|
-
completeUpload({ namespace, body } = {}) {
|
|
142
|
+
async completeUpload({ namespace, body } = {}) {
|
|
121
143
|
const { error } = FileStorageValidator.completeUpload().validate(
|
|
122
144
|
{ namespace, body },
|
|
123
145
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -132,15 +154,18 @@ class FileStorage {
|
|
|
132
154
|
{ abortEarly: false, allowUnknown: false }
|
|
133
155
|
);
|
|
134
156
|
if (warrning) {
|
|
135
|
-
|
|
136
|
-
|
|
157
|
+
Logger({
|
|
158
|
+
level: "WARN",
|
|
159
|
+
message: "Parameter Validation warrnings for completeUpload",
|
|
160
|
+
});
|
|
161
|
+
Logger({ level: "WARN", message: warrning });
|
|
137
162
|
}
|
|
138
163
|
|
|
139
164
|
const query_params = {};
|
|
140
165
|
|
|
141
166
|
const xHeaders = {};
|
|
142
167
|
|
|
143
|
-
|
|
168
|
+
const response = await APIClient.execute(
|
|
144
169
|
this._conf,
|
|
145
170
|
"post",
|
|
146
171
|
constructUrl({
|
|
@@ -151,6 +176,23 @@ class FileStorage {
|
|
|
151
176
|
body,
|
|
152
177
|
xHeaders
|
|
153
178
|
);
|
|
179
|
+
|
|
180
|
+
const {
|
|
181
|
+
error: res_error,
|
|
182
|
+
} = FileStorageModel.CompleteResponse().validate(response, {
|
|
183
|
+
abortEarly: false,
|
|
184
|
+
allowUnknown: false,
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
if (res_error) {
|
|
188
|
+
Logger({
|
|
189
|
+
level: "WARN",
|
|
190
|
+
message: "Response Validation Warnnings for completeUpload",
|
|
191
|
+
});
|
|
192
|
+
Logger({ level: "WARN", message: res_error });
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
return response;
|
|
154
196
|
}
|
|
155
197
|
|
|
156
198
|
/**
|
|
@@ -160,7 +202,7 @@ class FileStorage {
|
|
|
160
202
|
* @summary: Explain here
|
|
161
203
|
* @description: Describe here
|
|
162
204
|
*/
|
|
163
|
-
signUrls({ body } = {}) {
|
|
205
|
+
async signUrls({ body } = {}) {
|
|
164
206
|
const { error } = FileStorageValidator.signUrls().validate(
|
|
165
207
|
{ body },
|
|
166
208
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -175,15 +217,18 @@ class FileStorage {
|
|
|
175
217
|
{ abortEarly: false, allowUnknown: false }
|
|
176
218
|
);
|
|
177
219
|
if (warrning) {
|
|
178
|
-
|
|
179
|
-
|
|
220
|
+
Logger({
|
|
221
|
+
level: "WARN",
|
|
222
|
+
message: "Parameter Validation warrnings for signUrls",
|
|
223
|
+
});
|
|
224
|
+
Logger({ level: "WARN", message: warrning });
|
|
180
225
|
}
|
|
181
226
|
|
|
182
227
|
const query_params = {};
|
|
183
228
|
|
|
184
229
|
const xHeaders = {};
|
|
185
230
|
|
|
186
|
-
|
|
231
|
+
const response = await APIClient.execute(
|
|
187
232
|
this._conf,
|
|
188
233
|
"post",
|
|
189
234
|
constructUrl({
|
|
@@ -194,6 +239,23 @@ class FileStorage {
|
|
|
194
239
|
body,
|
|
195
240
|
xHeaders
|
|
196
241
|
);
|
|
242
|
+
|
|
243
|
+
const {
|
|
244
|
+
error: res_error,
|
|
245
|
+
} = FileStorageModel.SignUrlResponse().validate(response, {
|
|
246
|
+
abortEarly: false,
|
|
247
|
+
allowUnknown: false,
|
|
248
|
+
});
|
|
249
|
+
|
|
250
|
+
if (res_error) {
|
|
251
|
+
Logger({
|
|
252
|
+
level: "WARN",
|
|
253
|
+
message: "Response Validation Warnnings for signUrls",
|
|
254
|
+
});
|
|
255
|
+
Logger({ level: "WARN", message: res_error });
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
return response;
|
|
197
259
|
}
|
|
198
260
|
}
|
|
199
261
|
|
|
@@ -3,6 +3,8 @@ const constructUrl = require("../constructUrl");
|
|
|
3
3
|
const Paginator = require("../../common/Paginator");
|
|
4
4
|
const { FDKClientValidationError } = require("../../common/FDKError");
|
|
5
5
|
const LeadValidator = require("./LeadApplicationValidator");
|
|
6
|
+
const LeadModel = require("./LeadApplicationModel");
|
|
7
|
+
const { Logger } = require("./../../common/Logger");
|
|
6
8
|
|
|
7
9
|
class Lead {
|
|
8
10
|
constructor(_conf) {
|
|
@@ -41,7 +43,7 @@ class Lead {
|
|
|
41
43
|
* @summary: Get Ticket with the specific id
|
|
42
44
|
* @description: Get Ticket with the specific id, this is used to view the ticket details
|
|
43
45
|
*/
|
|
44
|
-
getTicket({ id } = {}) {
|
|
46
|
+
async getTicket({ id } = {}) {
|
|
45
47
|
const { error } = LeadValidator.getTicket().validate(
|
|
46
48
|
{ id },
|
|
47
49
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -56,15 +58,18 @@ class Lead {
|
|
|
56
58
|
{ abortEarly: false, allowUnknown: false }
|
|
57
59
|
);
|
|
58
60
|
if (warrning) {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
+
Logger({
|
|
62
|
+
level: "WARN",
|
|
63
|
+
message: "Parameter Validation warrnings for getTicket",
|
|
64
|
+
});
|
|
65
|
+
Logger({ level: "WARN", message: warrning });
|
|
61
66
|
}
|
|
62
67
|
|
|
63
68
|
const query_params = {};
|
|
64
69
|
|
|
65
70
|
const xHeaders = {};
|
|
66
71
|
|
|
67
|
-
|
|
72
|
+
const response = await APIClient.execute(
|
|
68
73
|
this._conf,
|
|
69
74
|
"get",
|
|
70
75
|
constructUrl({
|
|
@@ -75,6 +80,21 @@ class Lead {
|
|
|
75
80
|
undefined,
|
|
76
81
|
xHeaders
|
|
77
82
|
);
|
|
83
|
+
|
|
84
|
+
const { error: res_error } = LeadModel.Ticket().validate(response, {
|
|
85
|
+
abortEarly: false,
|
|
86
|
+
allowUnknown: false,
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
if (res_error) {
|
|
90
|
+
Logger({
|
|
91
|
+
level: "WARN",
|
|
92
|
+
message: "Response Validation Warnnings for getTicket",
|
|
93
|
+
});
|
|
94
|
+
Logger({ level: "WARN", message: res_error });
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
return response;
|
|
78
98
|
}
|
|
79
99
|
|
|
80
100
|
/**
|
|
@@ -85,7 +105,7 @@ class Lead {
|
|
|
85
105
|
* @summary: Create history for specific Ticket
|
|
86
106
|
* @description: Create history for specific Ticket, this history is seen on ticket detail page, this can be comment, log or rating.
|
|
87
107
|
*/
|
|
88
|
-
createHistory({ id, body } = {}) {
|
|
108
|
+
async createHistory({ id, body } = {}) {
|
|
89
109
|
const { error } = LeadValidator.createHistory().validate(
|
|
90
110
|
{ id, body },
|
|
91
111
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -100,15 +120,18 @@ class Lead {
|
|
|
100
120
|
{ abortEarly: false, allowUnknown: false }
|
|
101
121
|
);
|
|
102
122
|
if (warrning) {
|
|
103
|
-
|
|
104
|
-
|
|
123
|
+
Logger({
|
|
124
|
+
level: "WARN",
|
|
125
|
+
message: "Parameter Validation warrnings for createHistory",
|
|
126
|
+
});
|
|
127
|
+
Logger({ level: "WARN", message: warrning });
|
|
105
128
|
}
|
|
106
129
|
|
|
107
130
|
const query_params = {};
|
|
108
131
|
|
|
109
132
|
const xHeaders = {};
|
|
110
133
|
|
|
111
|
-
|
|
134
|
+
const response = await APIClient.execute(
|
|
112
135
|
this._conf,
|
|
113
136
|
"post",
|
|
114
137
|
constructUrl({
|
|
@@ -119,6 +142,21 @@ class Lead {
|
|
|
119
142
|
body,
|
|
120
143
|
xHeaders
|
|
121
144
|
);
|
|
145
|
+
|
|
146
|
+
const { error: res_error } = LeadModel.TicketHistory().validate(response, {
|
|
147
|
+
abortEarly: false,
|
|
148
|
+
allowUnknown: false,
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
if (res_error) {
|
|
152
|
+
Logger({
|
|
153
|
+
level: "WARN",
|
|
154
|
+
message: "Response Validation Warnnings for createHistory",
|
|
155
|
+
});
|
|
156
|
+
Logger({ level: "WARN", message: res_error });
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
return response;
|
|
122
160
|
}
|
|
123
161
|
|
|
124
162
|
/**
|
|
@@ -128,7 +166,7 @@ class Lead {
|
|
|
128
166
|
* @summary: Create Ticket
|
|
129
167
|
* @description: This is used to Create Ticket.
|
|
130
168
|
*/
|
|
131
|
-
createTicket({ body } = {}) {
|
|
169
|
+
async createTicket({ body } = {}) {
|
|
132
170
|
const { error } = LeadValidator.createTicket().validate(
|
|
133
171
|
{ body },
|
|
134
172
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -143,15 +181,18 @@ class Lead {
|
|
|
143
181
|
{ abortEarly: false, allowUnknown: false }
|
|
144
182
|
);
|
|
145
183
|
if (warrning) {
|
|
146
|
-
|
|
147
|
-
|
|
184
|
+
Logger({
|
|
185
|
+
level: "WARN",
|
|
186
|
+
message: "Parameter Validation warrnings for createTicket",
|
|
187
|
+
});
|
|
188
|
+
Logger({ level: "WARN", message: warrning });
|
|
148
189
|
}
|
|
149
190
|
|
|
150
191
|
const query_params = {};
|
|
151
192
|
|
|
152
193
|
const xHeaders = {};
|
|
153
194
|
|
|
154
|
-
|
|
195
|
+
const response = await APIClient.execute(
|
|
155
196
|
this._conf,
|
|
156
197
|
"post",
|
|
157
198
|
constructUrl({
|
|
@@ -162,6 +203,21 @@ class Lead {
|
|
|
162
203
|
body,
|
|
163
204
|
xHeaders
|
|
164
205
|
);
|
|
206
|
+
|
|
207
|
+
const { error: res_error } = LeadModel.Ticket().validate(response, {
|
|
208
|
+
abortEarly: false,
|
|
209
|
+
allowUnknown: false,
|
|
210
|
+
});
|
|
211
|
+
|
|
212
|
+
if (res_error) {
|
|
213
|
+
Logger({
|
|
214
|
+
level: "WARN",
|
|
215
|
+
message: "Response Validation Warnnings for createTicket",
|
|
216
|
+
});
|
|
217
|
+
Logger({ level: "WARN", message: res_error });
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
return response;
|
|
165
221
|
}
|
|
166
222
|
|
|
167
223
|
/**
|
|
@@ -171,7 +227,7 @@ class Lead {
|
|
|
171
227
|
* @summary: Get specific Custom Form using it's slug
|
|
172
228
|
* @description: Get specific Custom Form using it's slug, this is used to view the form.
|
|
173
229
|
*/
|
|
174
|
-
getCustomForm({ slug } = {}) {
|
|
230
|
+
async getCustomForm({ slug } = {}) {
|
|
175
231
|
const { error } = LeadValidator.getCustomForm().validate(
|
|
176
232
|
{ slug },
|
|
177
233
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -186,15 +242,18 @@ class Lead {
|
|
|
186
242
|
{ abortEarly: false, allowUnknown: false }
|
|
187
243
|
);
|
|
188
244
|
if (warrning) {
|
|
189
|
-
|
|
190
|
-
|
|
245
|
+
Logger({
|
|
246
|
+
level: "WARN",
|
|
247
|
+
message: "Parameter Validation warrnings for getCustomForm",
|
|
248
|
+
});
|
|
249
|
+
Logger({ level: "WARN", message: warrning });
|
|
191
250
|
}
|
|
192
251
|
|
|
193
252
|
const query_params = {};
|
|
194
253
|
|
|
195
254
|
const xHeaders = {};
|
|
196
255
|
|
|
197
|
-
|
|
256
|
+
const response = await APIClient.execute(
|
|
198
257
|
this._conf,
|
|
199
258
|
"get",
|
|
200
259
|
constructUrl({
|
|
@@ -205,6 +264,21 @@ class Lead {
|
|
|
205
264
|
undefined,
|
|
206
265
|
xHeaders
|
|
207
266
|
);
|
|
267
|
+
|
|
268
|
+
const { error: res_error } = LeadModel.CustomForm().validate(response, {
|
|
269
|
+
abortEarly: false,
|
|
270
|
+
allowUnknown: false,
|
|
271
|
+
});
|
|
272
|
+
|
|
273
|
+
if (res_error) {
|
|
274
|
+
Logger({
|
|
275
|
+
level: "WARN",
|
|
276
|
+
message: "Response Validation Warnnings for getCustomForm",
|
|
277
|
+
});
|
|
278
|
+
Logger({ level: "WARN", message: res_error });
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
return response;
|
|
208
282
|
}
|
|
209
283
|
|
|
210
284
|
/**
|
|
@@ -215,7 +289,7 @@ class Lead {
|
|
|
215
289
|
* @summary: Submit Response for a specific Custom Form using it's slug
|
|
216
290
|
* @description: Submit Response for a specific Custom Form using it's slug, this response is then used to create a ticket on behalf of the user.
|
|
217
291
|
*/
|
|
218
|
-
submitCustomForm({ slug, body } = {}) {
|
|
292
|
+
async submitCustomForm({ slug, body } = {}) {
|
|
219
293
|
const { error } = LeadValidator.submitCustomForm().validate(
|
|
220
294
|
{ slug, body },
|
|
221
295
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -230,15 +304,18 @@ class Lead {
|
|
|
230
304
|
{ abortEarly: false, allowUnknown: false }
|
|
231
305
|
);
|
|
232
306
|
if (warrning) {
|
|
233
|
-
|
|
234
|
-
|
|
307
|
+
Logger({
|
|
308
|
+
level: "WARN",
|
|
309
|
+
message: "Parameter Validation warrnings for submitCustomForm",
|
|
310
|
+
});
|
|
311
|
+
Logger({ level: "WARN", message: warrning });
|
|
235
312
|
}
|
|
236
313
|
|
|
237
314
|
const query_params = {};
|
|
238
315
|
|
|
239
316
|
const xHeaders = {};
|
|
240
317
|
|
|
241
|
-
|
|
318
|
+
const response = await APIClient.execute(
|
|
242
319
|
this._conf,
|
|
243
320
|
"post",
|
|
244
321
|
constructUrl({
|
|
@@ -249,6 +326,23 @@ class Lead {
|
|
|
249
326
|
body,
|
|
250
327
|
xHeaders
|
|
251
328
|
);
|
|
329
|
+
|
|
330
|
+
const {
|
|
331
|
+
error: res_error,
|
|
332
|
+
} = LeadModel.SubmitCustomFormResponse().validate(response, {
|
|
333
|
+
abortEarly: false,
|
|
334
|
+
allowUnknown: false,
|
|
335
|
+
});
|
|
336
|
+
|
|
337
|
+
if (res_error) {
|
|
338
|
+
Logger({
|
|
339
|
+
level: "WARN",
|
|
340
|
+
message: "Response Validation Warnnings for submitCustomForm",
|
|
341
|
+
});
|
|
342
|
+
Logger({ level: "WARN", message: res_error });
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
return response;
|
|
252
346
|
}
|
|
253
347
|
|
|
254
348
|
/**
|
|
@@ -258,7 +352,7 @@ class Lead {
|
|
|
258
352
|
* @summary: Get participants of a specific Video Room using it's unique name
|
|
259
353
|
* @description: Get participants of a specific Video Room using it's unique name, this can be used to check if people are already there in the room and also to show their names.
|
|
260
354
|
*/
|
|
261
|
-
getParticipantsInsideVideoRoom({ uniqueName } = {}) {
|
|
355
|
+
async getParticipantsInsideVideoRoom({ uniqueName } = {}) {
|
|
262
356
|
const { error } = LeadValidator.getParticipantsInsideVideoRoom().validate(
|
|
263
357
|
{ uniqueName },
|
|
264
358
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -275,17 +369,19 @@ class Lead {
|
|
|
275
369
|
{ abortEarly: false, allowUnknown: false }
|
|
276
370
|
);
|
|
277
371
|
if (warrning) {
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
372
|
+
Logger({
|
|
373
|
+
level: "WARN",
|
|
374
|
+
message:
|
|
375
|
+
"Parameter Validation warrnings for getParticipantsInsideVideoRoom",
|
|
376
|
+
});
|
|
377
|
+
Logger({ level: "WARN", message: warrning });
|
|
282
378
|
}
|
|
283
379
|
|
|
284
380
|
const query_params = {};
|
|
285
381
|
|
|
286
382
|
const xHeaders = {};
|
|
287
383
|
|
|
288
|
-
|
|
384
|
+
const response = await APIClient.execute(
|
|
289
385
|
this._conf,
|
|
290
386
|
"get",
|
|
291
387
|
constructUrl({
|
|
@@ -296,6 +392,24 @@ class Lead {
|
|
|
296
392
|
undefined,
|
|
297
393
|
xHeaders
|
|
298
394
|
);
|
|
395
|
+
|
|
396
|
+
const {
|
|
397
|
+
error: res_error,
|
|
398
|
+
} = LeadModel.GetParticipantsInsideVideoRoomResponse().validate(response, {
|
|
399
|
+
abortEarly: false,
|
|
400
|
+
allowUnknown: false,
|
|
401
|
+
});
|
|
402
|
+
|
|
403
|
+
if (res_error) {
|
|
404
|
+
Logger({
|
|
405
|
+
level: "WARN",
|
|
406
|
+
message:
|
|
407
|
+
"Response Validation Warnnings for getParticipantsInsideVideoRoom",
|
|
408
|
+
});
|
|
409
|
+
Logger({ level: "WARN", message: res_error });
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
return response;
|
|
299
413
|
}
|
|
300
414
|
|
|
301
415
|
/**
|
|
@@ -305,7 +419,7 @@ class Lead {
|
|
|
305
419
|
* @summary: Get Token to join a specific Video Room using it's unqiue name
|
|
306
420
|
* @description: Get Token to join a specific Video Room using it's unqiue name, this Token is your ticket to Room and also creates your identity there.
|
|
307
421
|
*/
|
|
308
|
-
getTokenForVideoRoom({ uniqueName } = {}) {
|
|
422
|
+
async getTokenForVideoRoom({ uniqueName } = {}) {
|
|
309
423
|
const { error } = LeadValidator.getTokenForVideoRoom().validate(
|
|
310
424
|
{ uniqueName },
|
|
311
425
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -320,15 +434,18 @@ class Lead {
|
|
|
320
434
|
{ abortEarly: false, allowUnknown: false }
|
|
321
435
|
);
|
|
322
436
|
if (warrning) {
|
|
323
|
-
|
|
324
|
-
|
|
437
|
+
Logger({
|
|
438
|
+
level: "WARN",
|
|
439
|
+
message: "Parameter Validation warrnings for getTokenForVideoRoom",
|
|
440
|
+
});
|
|
441
|
+
Logger({ level: "WARN", message: warrning });
|
|
325
442
|
}
|
|
326
443
|
|
|
327
444
|
const query_params = {};
|
|
328
445
|
|
|
329
446
|
const xHeaders = {};
|
|
330
447
|
|
|
331
|
-
|
|
448
|
+
const response = await APIClient.execute(
|
|
332
449
|
this._conf,
|
|
333
450
|
"get",
|
|
334
451
|
constructUrl({
|
|
@@ -339,6 +456,23 @@ class Lead {
|
|
|
339
456
|
undefined,
|
|
340
457
|
xHeaders
|
|
341
458
|
);
|
|
459
|
+
|
|
460
|
+
const {
|
|
461
|
+
error: res_error,
|
|
462
|
+
} = LeadModel.GetTokenForVideoRoomResponse().validate(response, {
|
|
463
|
+
abortEarly: false,
|
|
464
|
+
allowUnknown: false,
|
|
465
|
+
});
|
|
466
|
+
|
|
467
|
+
if (res_error) {
|
|
468
|
+
Logger({
|
|
469
|
+
level: "WARN",
|
|
470
|
+
message: "Response Validation Warnnings for getTokenForVideoRoom",
|
|
471
|
+
});
|
|
472
|
+
Logger({ level: "WARN", message: res_error });
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
return response;
|
|
342
476
|
}
|
|
343
477
|
}
|
|
344
478
|
|