@gofynd/fdk-client-javascript 1.4.7 → 1.4.8-beta.3
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 +1 -1
- package/package.json +1 -1
- package/sdk/application/Cart/CartApplicationClient.d.ts +16 -3
- package/sdk/application/Cart/CartApplicationClient.js +118 -13
- package/sdk/application/Cart/CartApplicationModel.d.ts +121 -45
- package/sdk/application/Cart/CartApplicationModel.js +98 -26
- package/sdk/application/Cart/CartApplicationValidator.d.ts +45 -1
- package/sdk/application/Cart/CartApplicationValidator.js +26 -0
- package/sdk/application/Catalog/CatalogApplicationModel.d.ts +4 -2
- package/sdk/application/Catalog/CatalogApplicationModel.js +4 -2
- package/sdk/application/Content/ContentApplicationClient.d.ts +1 -1
- package/sdk/application/Content/ContentApplicationClient.js +5 -3
- package/sdk/application/Content/ContentApplicationModel.d.ts +7 -18
- package/sdk/application/Content/ContentApplicationModel.js +6 -20
- package/sdk/application/Content/ContentApplicationValidator.d.ts +10 -0
- package/sdk/application/Content/ContentApplicationValidator.js +4 -0
- package/sdk/application/Lead/LeadApplicationClient.d.ts +0 -27
- package/sdk/application/Lead/LeadApplicationClient.js +0 -167
- package/sdk/application/Lead/LeadApplicationModel.d.ts +1 -146
- package/sdk/application/Lead/LeadApplicationModel.js +0 -126
- package/sdk/application/Lead/LeadApplicationValidator.d.ts +1 -25
- package/sdk/application/Lead/LeadApplicationValidator.js +0 -24
- package/sdk/application/Logistic/LogisticApplicationClient.js +1 -1
- package/sdk/application/Logistic/LogisticApplicationModel.d.ts +2 -0
- package/sdk/application/Logistic/LogisticApplicationModel.js +2 -0
- package/sdk/application/Order/OrderApplicationModel.d.ts +4 -0
- package/sdk/application/Order/OrderApplicationModel.js +4 -0
- package/sdk/application/Payment/PaymentApplicationModel.d.ts +9 -2
- package/sdk/application/Payment/PaymentApplicationModel.js +5 -2
- package/sdk/application/Theme/ThemeApplicationModel.d.ts +2 -0
- package/sdk/application/Theme/ThemeApplicationModel.js +2 -0
- package/sdk/partner/Lead/LeadPartnerClient.d.ts +0 -23
- package/sdk/partner/Lead/LeadPartnerClient.js +0 -157
- package/sdk/partner/Lead/LeadPartnerModel.d.ts +12 -581
- package/sdk/partner/Lead/LeadPartnerModel.js +14 -403
- package/sdk/partner/Lead/LeadPartnerValidator.d.ts +0 -2
- package/sdk/partner/Lead/LeadPartnerValidator.js +0 -12
- package/sdk/partner/Logistics/LogisticsPartnerClient.js +1 -1
- package/sdk/partner/Logistics/LogisticsPartnerModel.d.ts +47 -1
- package/sdk/partner/Logistics/LogisticsPartnerModel.js +56 -4
- package/sdk/partner/Logistics/LogisticsPartnerValidator.js +2 -2
- package/sdk/partner/Theme/ThemePartnerClient.d.ts +22 -0
- package/sdk/partner/Theme/ThemePartnerClient.js +162 -0
- package/sdk/partner/Theme/ThemePartnerModel.d.ts +119 -1
- package/sdk/partner/Theme/ThemePartnerModel.js +142 -0
- package/sdk/partner/Theme/ThemePartnerValidator.d.ts +2 -0
- package/sdk/partner/Theme/ThemePartnerValidator.js +14 -0
- package/sdk/platform/Billing/BillingPlatformClient.d.ts +304 -43
- package/sdk/platform/Billing/BillingPlatformClient.js +2218 -118
- package/sdk/platform/Billing/BillingPlatformModel.d.ts +1330 -282
- package/sdk/platform/Billing/BillingPlatformModel.js +1808 -590
- package/sdk/platform/Billing/BillingPlatformValidator.d.ts +324 -16
- package/sdk/platform/Billing/BillingPlatformValidator.js +340 -12
- package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +28 -5
- package/sdk/platform/Cart/CartPlatformApplicationClient.js +198 -5
- package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +81 -1
- package/sdk/platform/Cart/CartPlatformApplicationValidator.js +48 -0
- package/sdk/platform/Cart/CartPlatformModel.d.ts +214 -40
- package/sdk/platform/Cart/CartPlatformModel.js +164 -24
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +1 -1
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +20 -0
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +37 -0
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +16 -0
- package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +2 -2
- package/sdk/platform/Catalog/CatalogPlatformClient.js +18 -2
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +4 -0
- package/sdk/platform/Catalog/CatalogPlatformModel.js +4 -0
- package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +28 -0
- package/sdk/platform/Catalog/CatalogPlatformValidator.js +12 -0
- package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +1 -1
- package/sdk/platform/Content/ContentPlatformApplicationClient.js +18 -1
- package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +25 -0
- package/sdk/platform/Content/ContentPlatformApplicationValidator.js +10 -0
- package/sdk/platform/Content/ContentPlatformModel.d.ts +8 -4
- package/sdk/platform/Content/ContentPlatformModel.js +8 -4
- package/sdk/platform/Finance/FinancePlatformClient.d.ts +49 -28
- package/sdk/platform/Finance/FinancePlatformClient.js +181 -28
- package/sdk/platform/Finance/FinancePlatformModel.d.ts +369 -129
- package/sdk/platform/Finance/FinancePlatformModel.js +404 -110
- package/sdk/platform/Finance/FinancePlatformValidator.d.ts +56 -43
- package/sdk/platform/Finance/FinancePlatformValidator.js +61 -42
- package/sdk/platform/Lead/LeadPlatformApplicationClient.d.ts +0 -47
- package/sdk/platform/Lead/LeadPlatformApplicationClient.js +0 -321
- package/sdk/platform/Lead/LeadPlatformApplicationValidator.d.ts +1 -46
- package/sdk/platform/Lead/LeadPlatformApplicationValidator.js +0 -48
- package/sdk/platform/Lead/LeadPlatformClient.d.ts +2 -25
- package/sdk/platform/Lead/LeadPlatformClient.js +2 -167
- package/sdk/platform/Lead/LeadPlatformModel.d.ts +82 -204
- package/sdk/platform/Lead/LeadPlatformModel.js +98 -178
- package/sdk/platform/Lead/LeadPlatformValidator.d.ts +1 -25
- package/sdk/platform/Lead/LeadPlatformValidator.js +0 -24
- package/sdk/platform/Order/OrderPlatformModel.d.ts +126 -15
- package/sdk/platform/Order/OrderPlatformModel.js +55 -14
- package/sdk/platform/Payment/PaymentPlatformModel.d.ts +12 -0
- package/sdk/platform/Payment/PaymentPlatformModel.js +5 -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 +20 -1
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +26 -4
- package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.d.ts +4 -4
- package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.js +4 -4
- package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +12 -0
- package/sdk/platform/Theme/ThemePlatformApplicationClient.js +82 -0
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.d.ts +18 -1
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.js +14 -0
- package/sdk/platform/Theme/ThemePlatformModel.d.ts +67 -1
- package/sdk/platform/Theme/ThemePlatformModel.js +78 -0
- package/sdk/platform/User/UserPlatformModel.d.ts +0 -2
- package/sdk/platform/User/UserPlatformModel.js +0 -2
- package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +0 -40
- package/sdk/platform/Webhook/WebhookPlatformClient.js +0 -307
- package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +94 -146
- package/sdk/platform/Webhook/WebhookPlatformModel.js +100 -151
- package/sdk/platform/Webhook/WebhookPlatformValidator.d.ts +9 -35
- package/sdk/platform/Webhook/WebhookPlatformValidator.js +8 -46
- package/sdk/public/Billing/BillingPublicClient.d.ts +24 -2
- package/sdk/public/Billing/BillingPublicClient.js +156 -3
- package/sdk/public/Billing/BillingPublicModel.d.ts +368 -26
- package/sdk/public/Billing/BillingPublicModel.js +317 -18
- package/sdk/public/Billing/BillingPublicValidator.d.ts +19 -3
- package/sdk/public/Billing/BillingPublicValidator.js +22 -3
- package/sdk/public/Webhook/WebhookPublicModel.d.ts +22 -22
- package/sdk/public/Webhook/WebhookPublicModel.js +22 -22
|
@@ -101,6 +101,7 @@ const Joi = require("joi");
|
|
|
101
101
|
* @typedef BlogGetResponse
|
|
102
102
|
* @property {BlogSchema[]} [items]
|
|
103
103
|
* @property {Page} [page]
|
|
104
|
+
* @property {string[]} [filters]
|
|
104
105
|
*/
|
|
105
106
|
|
|
106
107
|
/**
|
|
@@ -138,9 +139,9 @@ const Joi = require("joi");
|
|
|
138
139
|
* @property {string[]} [tags]
|
|
139
140
|
* @property {string} [publish_date]
|
|
140
141
|
* @property {SEO} [seo]
|
|
141
|
-
* @property {CronSchedule} [_schedule]
|
|
142
142
|
* @property {string} [title]
|
|
143
143
|
* @property {DateMeta} [date_meta]
|
|
144
|
+
* @property {string} [summary]
|
|
144
145
|
*/
|
|
145
146
|
|
|
146
147
|
/**
|
|
@@ -443,14 +444,6 @@ const Joi = require("joi");
|
|
|
443
444
|
* @property {string} [id]
|
|
444
445
|
*/
|
|
445
446
|
|
|
446
|
-
/**
|
|
447
|
-
* @typedef CronSchedule
|
|
448
|
-
* @property {string} [cron]
|
|
449
|
-
* @property {string} [start]
|
|
450
|
-
* @property {string} [end]
|
|
451
|
-
* @property {number} [duration]
|
|
452
|
-
*/
|
|
453
|
-
|
|
454
447
|
/**
|
|
455
448
|
* @typedef SlideshowGetResponse
|
|
456
449
|
* @property {SlideshowSchema[]} [items]
|
|
@@ -487,6 +480,7 @@ const Joi = require("joi");
|
|
|
487
480
|
* @property {string} [key]
|
|
488
481
|
* @property {string} [code]
|
|
489
482
|
* @property {string} [number]
|
|
483
|
+
* @property {string} [phone_type]
|
|
490
484
|
*/
|
|
491
485
|
|
|
492
486
|
/**
|
|
@@ -791,6 +785,7 @@ class ContentApplicationModel {
|
|
|
791
785
|
return Joi.object({
|
|
792
786
|
items: Joi.array().items(ContentApplicationModel.BlogSchema()),
|
|
793
787
|
page: ContentApplicationModel.Page(),
|
|
788
|
+
filters: Joi.array().items(Joi.string().allow("")),
|
|
794
789
|
});
|
|
795
790
|
}
|
|
796
791
|
|
|
@@ -836,9 +831,9 @@ class ContentApplicationModel {
|
|
|
836
831
|
tags: Joi.array().items(Joi.string().allow("")),
|
|
837
832
|
publish_date: Joi.string().allow(""),
|
|
838
833
|
seo: ContentApplicationModel.SEO(),
|
|
839
|
-
_schedule: ContentApplicationModel.CronSchedule(),
|
|
840
834
|
title: Joi.string().allow(""),
|
|
841
835
|
date_meta: ContentApplicationModel.DateMeta(),
|
|
836
|
+
summary: Joi.string().allow(""),
|
|
842
837
|
});
|
|
843
838
|
}
|
|
844
839
|
|
|
@@ -1214,16 +1209,6 @@ class ContentApplicationModel {
|
|
|
1214
1209
|
});
|
|
1215
1210
|
}
|
|
1216
1211
|
|
|
1217
|
-
/** @returns {CronSchedule} */
|
|
1218
|
-
static CronSchedule() {
|
|
1219
|
-
return Joi.object({
|
|
1220
|
-
cron: Joi.string().allow(""),
|
|
1221
|
-
start: Joi.string().allow(""),
|
|
1222
|
-
end: Joi.string().allow(""),
|
|
1223
|
-
duration: Joi.number(),
|
|
1224
|
-
});
|
|
1225
|
-
}
|
|
1226
|
-
|
|
1227
1212
|
/** @returns {SlideshowGetResponse} */
|
|
1228
1213
|
static SlideshowGetResponse() {
|
|
1229
1214
|
return Joi.object({
|
|
@@ -1267,6 +1252,7 @@ class ContentApplicationModel {
|
|
|
1267
1252
|
key: Joi.string().allow(""),
|
|
1268
1253
|
code: Joi.string().allow(""),
|
|
1269
1254
|
number: Joi.string().allow(""),
|
|
1255
|
+
phone_type: Joi.string().allow(""),
|
|
1270
1256
|
});
|
|
1271
1257
|
}
|
|
1272
1258
|
|
|
@@ -12,6 +12,8 @@ export = ContentApplicationValidator;
|
|
|
12
12
|
* @property {number} [pageNo] - The page number to navigate through the given
|
|
13
13
|
* set of results. Default value is 1.
|
|
14
14
|
* @property {number} [pageSize] - The number of items to retrieve in each page.
|
|
15
|
+
* @property {string} [tags] - Blogs retrieve based on the list of tags passed.
|
|
16
|
+
* @property {string} [search] - Blogs retrieve based on the title.
|
|
15
17
|
*/
|
|
16
18
|
/**
|
|
17
19
|
* @typedef GetCustomFieldsParam
|
|
@@ -156,6 +158,14 @@ type GetBlogsParam = {
|
|
|
156
158
|
* - The number of items to retrieve in each page.
|
|
157
159
|
*/
|
|
158
160
|
pageSize?: number;
|
|
161
|
+
/**
|
|
162
|
+
* - Blogs retrieve based on the list of tags passed.
|
|
163
|
+
*/
|
|
164
|
+
tags?: string;
|
|
165
|
+
/**
|
|
166
|
+
* - Blogs retrieve based on the title.
|
|
167
|
+
*/
|
|
168
|
+
search?: string;
|
|
159
169
|
};
|
|
160
170
|
type GetCustomFieldsParam = {
|
|
161
171
|
resource: string;
|
|
@@ -17,6 +17,8 @@ const ContentApplicationModel = require("./ContentApplicationModel");
|
|
|
17
17
|
* @property {number} [pageNo] - The page number to navigate through the given
|
|
18
18
|
* set of results. Default value is 1.
|
|
19
19
|
* @property {number} [pageSize] - The number of items to retrieve in each page.
|
|
20
|
+
* @property {string} [tags] - Blogs retrieve based on the list of tags passed.
|
|
21
|
+
* @property {string} [search] - Blogs retrieve based on the title.
|
|
20
22
|
*/
|
|
21
23
|
|
|
22
24
|
/**
|
|
@@ -129,6 +131,8 @@ class ContentApplicationValidator {
|
|
|
129
131
|
return Joi.object({
|
|
130
132
|
pageNo: Joi.number(),
|
|
131
133
|
pageSize: Joi.number(),
|
|
134
|
+
tags: Joi.string().allow(""),
|
|
135
|
+
search: Joi.string().allow(""),
|
|
132
136
|
});
|
|
133
137
|
}
|
|
134
138
|
|
|
@@ -6,9 +6,7 @@ declare class Lead {
|
|
|
6
6
|
createHistory: string;
|
|
7
7
|
createTicket: string;
|
|
8
8
|
getCustomForm: string;
|
|
9
|
-
getParticipantsInsideVideoRoom: string;
|
|
10
9
|
getTicket: string;
|
|
11
|
-
getTokenForVideoRoom: string;
|
|
12
10
|
submitCustomForm: string;
|
|
13
11
|
};
|
|
14
12
|
_urls: {};
|
|
@@ -43,20 +41,6 @@ declare class Lead {
|
|
|
43
41
|
* @description: Get a customizable form template for data collection. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/lead/getCustomForm/).
|
|
44
42
|
*/
|
|
45
43
|
getCustomForm({ slug, requestHeaders }?: LeadApplicationValidator.GetCustomFormParam, { responseHeaders }?: object): Promise<LeadApplicationModel.CustomForm>;
|
|
46
|
-
/**
|
|
47
|
-
* @param {LeadApplicationValidator.GetParticipantsInsideVideoRoomParam} arg
|
|
48
|
-
* - Arg object.
|
|
49
|
-
*
|
|
50
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
51
|
-
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
52
|
-
* @returns {Promise<LeadApplicationModel.GetParticipantsInsideVideoRoomResponse>}
|
|
53
|
-
* - Success response
|
|
54
|
-
*
|
|
55
|
-
* @name getParticipantsInsideVideoRoom
|
|
56
|
-
* @summary: List video room participants
|
|
57
|
-
* @description: Gets the current participants inside a specific video room. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/lead/getParticipantsInsideVideoRoom/).
|
|
58
|
-
*/
|
|
59
|
-
getParticipantsInsideVideoRoom({ uniqueName, requestHeaders }?: LeadApplicationValidator.GetParticipantsInsideVideoRoomParam, { responseHeaders }?: object): Promise<LeadApplicationModel.GetParticipantsInsideVideoRoomResponse>;
|
|
60
44
|
/**
|
|
61
45
|
* @param {LeadApplicationValidator.GetTicketParam} arg - Arg object.
|
|
62
46
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
@@ -67,17 +51,6 @@ declare class Lead {
|
|
|
67
51
|
* @description: Get details of a specific customer support ticket. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/lead/getTicket/).
|
|
68
52
|
*/
|
|
69
53
|
getTicket({ id, requestHeaders }?: LeadApplicationValidator.GetTicketParam, { responseHeaders }?: object): Promise<LeadApplicationModel.Ticket>;
|
|
70
|
-
/**
|
|
71
|
-
* @param {LeadApplicationValidator.GetTokenForVideoRoomParam} arg - Arg object.
|
|
72
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
73
|
-
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
74
|
-
* @returns {Promise<LeadApplicationModel.GetTokenForVideoRoomResponse>} -
|
|
75
|
-
* Success response
|
|
76
|
-
* @name getTokenForVideoRoom
|
|
77
|
-
* @summary: Get video room token
|
|
78
|
-
* @description: Get a secure token for accessing a video chat room. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/lead/getTokenForVideoRoom/).
|
|
79
|
-
*/
|
|
80
|
-
getTokenForVideoRoom({ uniqueName, requestHeaders }?: LeadApplicationValidator.GetTokenForVideoRoomParam, { responseHeaders }?: object): Promise<LeadApplicationModel.GetTokenForVideoRoomResponse>;
|
|
81
54
|
/**
|
|
82
55
|
* @param {LeadApplicationValidator.SubmitCustomFormParam} arg - Arg object.
|
|
83
56
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
@@ -17,11 +17,7 @@ class Lead {
|
|
|
17
17
|
createHistory: "/service/application/lead/v1.0/ticket/{id}/history",
|
|
18
18
|
createTicket: "/service/application/lead/v1.0/ticket/",
|
|
19
19
|
getCustomForm: "/service/application/lead/v1.0/form/{slug}",
|
|
20
|
-
getParticipantsInsideVideoRoom:
|
|
21
|
-
"/service/application/lead/v1.0/video/room/{unique_name}/participants",
|
|
22
20
|
getTicket: "/service/application/lead/v1.0/ticket/{id}",
|
|
23
|
-
getTokenForVideoRoom:
|
|
24
|
-
"/service/application/lead/v1.0/video/room/{unique_name}/token",
|
|
25
21
|
submitCustomForm: "/service/application/lead/v1.0/form/{slug}/submit",
|
|
26
22
|
};
|
|
27
23
|
this._urls = Object.entries(this._relativeUrls).reduce(
|
|
@@ -274,90 +270,6 @@ class Lead {
|
|
|
274
270
|
return response;
|
|
275
271
|
}
|
|
276
272
|
|
|
277
|
-
/**
|
|
278
|
-
* @param {LeadApplicationValidator.GetParticipantsInsideVideoRoomParam} arg
|
|
279
|
-
* - Arg object.
|
|
280
|
-
*
|
|
281
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
282
|
-
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
283
|
-
* @returns {Promise<LeadApplicationModel.GetParticipantsInsideVideoRoomResponse>}
|
|
284
|
-
* - Success response
|
|
285
|
-
*
|
|
286
|
-
* @name getParticipantsInsideVideoRoom
|
|
287
|
-
* @summary: List video room participants
|
|
288
|
-
* @description: Gets the current participants inside a specific video room. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/lead/getParticipantsInsideVideoRoom/).
|
|
289
|
-
*/
|
|
290
|
-
async getParticipantsInsideVideoRoom(
|
|
291
|
-
{ uniqueName, requestHeaders } = { requestHeaders: {} },
|
|
292
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
293
|
-
) {
|
|
294
|
-
const {
|
|
295
|
-
error,
|
|
296
|
-
} = LeadApplicationValidator.getParticipantsInsideVideoRoom().validate(
|
|
297
|
-
{ uniqueName },
|
|
298
|
-
{ abortEarly: false, allowUnknown: true }
|
|
299
|
-
);
|
|
300
|
-
if (error) {
|
|
301
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
// Showing warrnings if extra unknown parameters are found
|
|
305
|
-
const {
|
|
306
|
-
error: warrning,
|
|
307
|
-
} = LeadApplicationValidator.getParticipantsInsideVideoRoom().validate(
|
|
308
|
-
{ uniqueName },
|
|
309
|
-
{ abortEarly: false, allowUnknown: false }
|
|
310
|
-
);
|
|
311
|
-
if (warrning) {
|
|
312
|
-
Logger({
|
|
313
|
-
level: "WARN",
|
|
314
|
-
message: `Parameter Validation warrnings for application > Lead > getParticipantsInsideVideoRoom \n ${warrning}`,
|
|
315
|
-
});
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
const query_params = {};
|
|
319
|
-
|
|
320
|
-
const xHeaders = {};
|
|
321
|
-
|
|
322
|
-
const response = await ApplicationAPIClient.execute(
|
|
323
|
-
this._conf,
|
|
324
|
-
"get",
|
|
325
|
-
constructUrl({
|
|
326
|
-
url: this._urls["getParticipantsInsideVideoRoom"],
|
|
327
|
-
params: { uniqueName },
|
|
328
|
-
}),
|
|
329
|
-
query_params,
|
|
330
|
-
undefined,
|
|
331
|
-
{ ...xHeaders, ...requestHeaders },
|
|
332
|
-
{ responseHeaders }
|
|
333
|
-
);
|
|
334
|
-
|
|
335
|
-
let responseData = response;
|
|
336
|
-
if (responseHeaders) {
|
|
337
|
-
responseData = response[0];
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
const {
|
|
341
|
-
error: res_error,
|
|
342
|
-
} = LeadApplicationModel.GetParticipantsInsideVideoRoomResponse().validate(
|
|
343
|
-
responseData,
|
|
344
|
-
{ abortEarly: false, allowUnknown: true }
|
|
345
|
-
);
|
|
346
|
-
|
|
347
|
-
if (res_error) {
|
|
348
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
349
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
350
|
-
} else {
|
|
351
|
-
Logger({
|
|
352
|
-
level: "WARN",
|
|
353
|
-
message: `Response Validation Warnings for application > Lead > getParticipantsInsideVideoRoom \n ${res_error}`,
|
|
354
|
-
});
|
|
355
|
-
}
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
return response;
|
|
359
|
-
}
|
|
360
|
-
|
|
361
273
|
/**
|
|
362
274
|
* @param {LeadApplicationValidator.GetTicketParam} arg - Arg object.
|
|
363
275
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
@@ -434,85 +346,6 @@ class Lead {
|
|
|
434
346
|
return response;
|
|
435
347
|
}
|
|
436
348
|
|
|
437
|
-
/**
|
|
438
|
-
* @param {LeadApplicationValidator.GetTokenForVideoRoomParam} arg - Arg object.
|
|
439
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
440
|
-
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
441
|
-
* @returns {Promise<LeadApplicationModel.GetTokenForVideoRoomResponse>} -
|
|
442
|
-
* Success response
|
|
443
|
-
* @name getTokenForVideoRoom
|
|
444
|
-
* @summary: Get video room token
|
|
445
|
-
* @description: Get a secure token for accessing a video chat room. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/lead/getTokenForVideoRoom/).
|
|
446
|
-
*/
|
|
447
|
-
async getTokenForVideoRoom(
|
|
448
|
-
{ uniqueName, requestHeaders } = { requestHeaders: {} },
|
|
449
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
450
|
-
) {
|
|
451
|
-
const { error } = LeadApplicationValidator.getTokenForVideoRoom().validate(
|
|
452
|
-
{ uniqueName },
|
|
453
|
-
{ abortEarly: false, allowUnknown: true }
|
|
454
|
-
);
|
|
455
|
-
if (error) {
|
|
456
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
457
|
-
}
|
|
458
|
-
|
|
459
|
-
// Showing warrnings if extra unknown parameters are found
|
|
460
|
-
const {
|
|
461
|
-
error: warrning,
|
|
462
|
-
} = LeadApplicationValidator.getTokenForVideoRoom().validate(
|
|
463
|
-
{ uniqueName },
|
|
464
|
-
{ abortEarly: false, allowUnknown: false }
|
|
465
|
-
);
|
|
466
|
-
if (warrning) {
|
|
467
|
-
Logger({
|
|
468
|
-
level: "WARN",
|
|
469
|
-
message: `Parameter Validation warrnings for application > Lead > getTokenForVideoRoom \n ${warrning}`,
|
|
470
|
-
});
|
|
471
|
-
}
|
|
472
|
-
|
|
473
|
-
const query_params = {};
|
|
474
|
-
|
|
475
|
-
const xHeaders = {};
|
|
476
|
-
|
|
477
|
-
const response = await ApplicationAPIClient.execute(
|
|
478
|
-
this._conf,
|
|
479
|
-
"get",
|
|
480
|
-
constructUrl({
|
|
481
|
-
url: this._urls["getTokenForVideoRoom"],
|
|
482
|
-
params: { uniqueName },
|
|
483
|
-
}),
|
|
484
|
-
query_params,
|
|
485
|
-
undefined,
|
|
486
|
-
{ ...xHeaders, ...requestHeaders },
|
|
487
|
-
{ responseHeaders }
|
|
488
|
-
);
|
|
489
|
-
|
|
490
|
-
let responseData = response;
|
|
491
|
-
if (responseHeaders) {
|
|
492
|
-
responseData = response[0];
|
|
493
|
-
}
|
|
494
|
-
|
|
495
|
-
const {
|
|
496
|
-
error: res_error,
|
|
497
|
-
} = LeadApplicationModel.GetTokenForVideoRoomResponse().validate(
|
|
498
|
-
responseData,
|
|
499
|
-
{ abortEarly: false, allowUnknown: true }
|
|
500
|
-
);
|
|
501
|
-
|
|
502
|
-
if (res_error) {
|
|
503
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
504
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
505
|
-
} else {
|
|
506
|
-
Logger({
|
|
507
|
-
level: "WARN",
|
|
508
|
-
message: `Response Validation Warnings for application > Lead > getTokenForVideoRoom \n ${res_error}`,
|
|
509
|
-
});
|
|
510
|
-
}
|
|
511
|
-
}
|
|
512
|
-
|
|
513
|
-
return response;
|
|
514
|
-
}
|
|
515
|
-
|
|
516
349
|
/**
|
|
517
350
|
* @param {LeadApplicationValidator.SubmitCustomFormParam} arg - Arg object.
|
|
518
351
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
@@ -9,41 +9,6 @@ export = LeadApplicationModel;
|
|
|
9
9
|
* @property {Object[]} response - Form response
|
|
10
10
|
* @property {TicketAsset[]} [attachments] - List of all attachments related to the form
|
|
11
11
|
*/
|
|
12
|
-
/**
|
|
13
|
-
* @typedef GetTokenForVideoRoomResponse
|
|
14
|
-
* @property {string} access_token - Access token to be used for video room
|
|
15
|
-
*/
|
|
16
|
-
/**
|
|
17
|
-
* @typedef GetParticipantsInsideVideoRoomResponse
|
|
18
|
-
* @property {Participant[]} participants - List of participants of the video room
|
|
19
|
-
*/
|
|
20
|
-
/**
|
|
21
|
-
* @typedef Participant
|
|
22
|
-
* @property {UserSchema} [user]
|
|
23
|
-
* @property {string} [identity] - Unique identifier of participant
|
|
24
|
-
* @property {string} [status] - Status of participant
|
|
25
|
-
*/
|
|
26
|
-
/**
|
|
27
|
-
* @typedef UserSchema
|
|
28
|
-
* @property {string} [application_id]
|
|
29
|
-
* @property {string} [user_id]
|
|
30
|
-
* @property {string} [first_name]
|
|
31
|
-
* @property {Object} [meta]
|
|
32
|
-
* @property {string} [last_name]
|
|
33
|
-
* @property {PhoneNumber[]} [phone_numbers]
|
|
34
|
-
* @property {Email[]} [emails]
|
|
35
|
-
* @property {string} [gender]
|
|
36
|
-
* @property {string} [dob]
|
|
37
|
-
* @property {boolean} [active]
|
|
38
|
-
* @property {string} [profile_pic_url]
|
|
39
|
-
* @property {string} [username]
|
|
40
|
-
* @property {string} [account_type]
|
|
41
|
-
* @property {string} [_id]
|
|
42
|
-
* @property {string} [created_at]
|
|
43
|
-
* @property {string} [updated_at]
|
|
44
|
-
* @property {string} [external_id]
|
|
45
|
-
* @property {string} [rr_id]
|
|
46
|
-
*/
|
|
47
12
|
/**
|
|
48
13
|
* @typedef SubmitCustomFormResponse
|
|
49
14
|
* @property {string} message - Success message for form submission
|
|
@@ -173,21 +138,6 @@ export = LeadApplicationModel;
|
|
|
173
138
|
* @property {string} [updated_at] - Time when the ticket was last updated
|
|
174
139
|
* @property {string} [created_at] - Time when the ticket was created
|
|
175
140
|
*/
|
|
176
|
-
/**
|
|
177
|
-
* @typedef PhoneNumber
|
|
178
|
-
* @property {string} [phone] - Phone number
|
|
179
|
-
* @property {number} [country_code] - Country code
|
|
180
|
-
* @property {boolean} [active] - Is the phone number active
|
|
181
|
-
* @property {boolean} [primary] - Is it a primary phone number
|
|
182
|
-
* @property {boolean} [verified] - Is the phone number verified
|
|
183
|
-
*/
|
|
184
|
-
/**
|
|
185
|
-
* @typedef Email
|
|
186
|
-
* @property {string} [email] - Email address
|
|
187
|
-
* @property {boolean} [active] - Is the email active
|
|
188
|
-
* @property {boolean} [primary] - Is it a primary email
|
|
189
|
-
* @property {boolean} [verified] - Is the email verified
|
|
190
|
-
*/
|
|
191
141
|
/** @typedef {"low" | "medium" | "high" | "urgent"} PriorityEnum */
|
|
192
142
|
/** @typedef {"rating" | "log" | "comment" | "thread"} HistoryTypeEnum */
|
|
193
143
|
/**
|
|
@@ -205,7 +155,7 @@ export = LeadApplicationModel;
|
|
|
205
155
|
declare class LeadApplicationModel {
|
|
206
156
|
}
|
|
207
157
|
declare namespace LeadApplicationModel {
|
|
208
|
-
export { TicketHistoryPayload, CustomFormSubmissionPayload,
|
|
158
|
+
export { TicketHistoryPayload, CustomFormSubmissionPayload, SubmitCustomFormResponse, TicketContext, CreatedOn, TicketAsset, TicketContent, AddTicketPayload, Priority, Status, SubmitButton, PollForAssignment, CustomForm, FeedbackForm, TicketCategory, TicketHistory, Ticket, PriorityEnum, HistoryTypeEnum, TicketAssetTypeEnum, TicketSourceEnum };
|
|
209
159
|
}
|
|
210
160
|
/** @returns {TicketHistoryPayload} */
|
|
211
161
|
declare function TicketHistoryPayload(): TicketHistoryPayload;
|
|
@@ -228,57 +178,6 @@ type CustomFormSubmissionPayload = {
|
|
|
228
178
|
*/
|
|
229
179
|
attachments?: TicketAsset[];
|
|
230
180
|
};
|
|
231
|
-
/** @returns {GetTokenForVideoRoomResponse} */
|
|
232
|
-
declare function GetTokenForVideoRoomResponse(): GetTokenForVideoRoomResponse;
|
|
233
|
-
type GetTokenForVideoRoomResponse = {
|
|
234
|
-
/**
|
|
235
|
-
* - Access token to be used for video room
|
|
236
|
-
*/
|
|
237
|
-
access_token: string;
|
|
238
|
-
};
|
|
239
|
-
/** @returns {GetParticipantsInsideVideoRoomResponse} */
|
|
240
|
-
declare function GetParticipantsInsideVideoRoomResponse(): GetParticipantsInsideVideoRoomResponse;
|
|
241
|
-
type GetParticipantsInsideVideoRoomResponse = {
|
|
242
|
-
/**
|
|
243
|
-
* - List of participants of the video room
|
|
244
|
-
*/
|
|
245
|
-
participants: Participant[];
|
|
246
|
-
};
|
|
247
|
-
/** @returns {Participant} */
|
|
248
|
-
declare function Participant(): Participant;
|
|
249
|
-
type Participant = {
|
|
250
|
-
user?: UserSchema;
|
|
251
|
-
/**
|
|
252
|
-
* - Unique identifier of participant
|
|
253
|
-
*/
|
|
254
|
-
identity?: string;
|
|
255
|
-
/**
|
|
256
|
-
* - Status of participant
|
|
257
|
-
*/
|
|
258
|
-
status?: string;
|
|
259
|
-
};
|
|
260
|
-
/** @returns {UserSchema} */
|
|
261
|
-
declare function UserSchema(): UserSchema;
|
|
262
|
-
type UserSchema = {
|
|
263
|
-
application_id?: string;
|
|
264
|
-
user_id?: string;
|
|
265
|
-
first_name?: string;
|
|
266
|
-
meta?: any;
|
|
267
|
-
last_name?: string;
|
|
268
|
-
phone_numbers?: PhoneNumber[];
|
|
269
|
-
emails?: Email[];
|
|
270
|
-
gender?: string;
|
|
271
|
-
dob?: string;
|
|
272
|
-
active?: boolean;
|
|
273
|
-
profile_pic_url?: string;
|
|
274
|
-
username?: string;
|
|
275
|
-
account_type?: string;
|
|
276
|
-
_id?: string;
|
|
277
|
-
created_at?: string;
|
|
278
|
-
updated_at?: string;
|
|
279
|
-
external_id?: string;
|
|
280
|
-
rr_id?: string;
|
|
281
|
-
};
|
|
282
181
|
/** @returns {SubmitCustomFormResponse} */
|
|
283
182
|
declare function SubmitCustomFormResponse(): SubmitCustomFormResponse;
|
|
284
183
|
type SubmitCustomFormResponse = {
|
|
@@ -600,50 +499,6 @@ type Ticket = {
|
|
|
600
499
|
*/
|
|
601
500
|
created_at?: string;
|
|
602
501
|
};
|
|
603
|
-
/** @returns {PhoneNumber} */
|
|
604
|
-
declare function PhoneNumber(): PhoneNumber;
|
|
605
|
-
type PhoneNumber = {
|
|
606
|
-
/**
|
|
607
|
-
* - Phone number
|
|
608
|
-
*/
|
|
609
|
-
phone?: string;
|
|
610
|
-
/**
|
|
611
|
-
* - Country code
|
|
612
|
-
*/
|
|
613
|
-
country_code?: number;
|
|
614
|
-
/**
|
|
615
|
-
* - Is the phone number active
|
|
616
|
-
*/
|
|
617
|
-
active?: boolean;
|
|
618
|
-
/**
|
|
619
|
-
* - Is it a primary phone number
|
|
620
|
-
*/
|
|
621
|
-
primary?: boolean;
|
|
622
|
-
/**
|
|
623
|
-
* - Is the phone number verified
|
|
624
|
-
*/
|
|
625
|
-
verified?: boolean;
|
|
626
|
-
};
|
|
627
|
-
/** @returns {Email} */
|
|
628
|
-
declare function Email(): Email;
|
|
629
|
-
type Email = {
|
|
630
|
-
/**
|
|
631
|
-
* - Email address
|
|
632
|
-
*/
|
|
633
|
-
email?: string;
|
|
634
|
-
/**
|
|
635
|
-
* - Is the email active
|
|
636
|
-
*/
|
|
637
|
-
active?: boolean;
|
|
638
|
-
/**
|
|
639
|
-
* - Is it a primary email
|
|
640
|
-
*/
|
|
641
|
-
primary?: boolean;
|
|
642
|
-
/**
|
|
643
|
-
* - Is the email verified
|
|
644
|
-
*/
|
|
645
|
-
verified?: boolean;
|
|
646
|
-
};
|
|
647
502
|
/**
|
|
648
503
|
* Enum: PriorityEnum Used By: Lead
|
|
649
504
|
*
|
|
@@ -12,45 +12,6 @@ const Joi = require("joi");
|
|
|
12
12
|
* @property {TicketAsset[]} [attachments] - List of all attachments related to the form
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
/**
|
|
16
|
-
* @typedef GetTokenForVideoRoomResponse
|
|
17
|
-
* @property {string} access_token - Access token to be used for video room
|
|
18
|
-
*/
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* @typedef GetParticipantsInsideVideoRoomResponse
|
|
22
|
-
* @property {Participant[]} participants - List of participants of the video room
|
|
23
|
-
*/
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* @typedef Participant
|
|
27
|
-
* @property {UserSchema} [user]
|
|
28
|
-
* @property {string} [identity] - Unique identifier of participant
|
|
29
|
-
* @property {string} [status] - Status of participant
|
|
30
|
-
*/
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* @typedef UserSchema
|
|
34
|
-
* @property {string} [application_id]
|
|
35
|
-
* @property {string} [user_id]
|
|
36
|
-
* @property {string} [first_name]
|
|
37
|
-
* @property {Object} [meta]
|
|
38
|
-
* @property {string} [last_name]
|
|
39
|
-
* @property {PhoneNumber[]} [phone_numbers]
|
|
40
|
-
* @property {Email[]} [emails]
|
|
41
|
-
* @property {string} [gender]
|
|
42
|
-
* @property {string} [dob]
|
|
43
|
-
* @property {boolean} [active]
|
|
44
|
-
* @property {string} [profile_pic_url]
|
|
45
|
-
* @property {string} [username]
|
|
46
|
-
* @property {string} [account_type]
|
|
47
|
-
* @property {string} [_id]
|
|
48
|
-
* @property {string} [created_at]
|
|
49
|
-
* @property {string} [updated_at]
|
|
50
|
-
* @property {string} [external_id]
|
|
51
|
-
* @property {string} [rr_id]
|
|
52
|
-
*/
|
|
53
|
-
|
|
54
15
|
/**
|
|
55
16
|
* @typedef SubmitCustomFormResponse
|
|
56
17
|
* @property {string} message - Success message for form submission
|
|
@@ -195,23 +156,6 @@ const Joi = require("joi");
|
|
|
195
156
|
* @property {string} [created_at] - Time when the ticket was created
|
|
196
157
|
*/
|
|
197
158
|
|
|
198
|
-
/**
|
|
199
|
-
* @typedef PhoneNumber
|
|
200
|
-
* @property {string} [phone] - Phone number
|
|
201
|
-
* @property {number} [country_code] - Country code
|
|
202
|
-
* @property {boolean} [active] - Is the phone number active
|
|
203
|
-
* @property {boolean} [primary] - Is it a primary phone number
|
|
204
|
-
* @property {boolean} [verified] - Is the phone number verified
|
|
205
|
-
*/
|
|
206
|
-
|
|
207
|
-
/**
|
|
208
|
-
* @typedef Email
|
|
209
|
-
* @property {string} [email] - Email address
|
|
210
|
-
* @property {boolean} [active] - Is the email active
|
|
211
|
-
* @property {boolean} [primary] - Is it a primary email
|
|
212
|
-
* @property {boolean} [verified] - Is the email verified
|
|
213
|
-
*/
|
|
214
|
-
|
|
215
159
|
/** @typedef {"low" | "medium" | "high" | "urgent"} PriorityEnum */
|
|
216
160
|
|
|
217
161
|
/** @typedef {"rating" | "log" | "comment" | "thread"} HistoryTypeEnum */
|
|
@@ -247,55 +191,6 @@ class LeadApplicationModel {
|
|
|
247
191
|
});
|
|
248
192
|
}
|
|
249
193
|
|
|
250
|
-
/** @returns {GetTokenForVideoRoomResponse} */
|
|
251
|
-
static GetTokenForVideoRoomResponse() {
|
|
252
|
-
return Joi.object({
|
|
253
|
-
access_token: Joi.string().allow("").required(),
|
|
254
|
-
});
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
/** @returns {GetParticipantsInsideVideoRoomResponse} */
|
|
258
|
-
static GetParticipantsInsideVideoRoomResponse() {
|
|
259
|
-
return Joi.object({
|
|
260
|
-
participants: Joi.array()
|
|
261
|
-
.items(LeadApplicationModel.Participant())
|
|
262
|
-
.required(),
|
|
263
|
-
});
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
/** @returns {Participant} */
|
|
267
|
-
static Participant() {
|
|
268
|
-
return Joi.object({
|
|
269
|
-
user: LeadApplicationModel.UserSchema(),
|
|
270
|
-
identity: Joi.string().allow(""),
|
|
271
|
-
status: Joi.string().allow(""),
|
|
272
|
-
});
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
/** @returns {UserSchema} */
|
|
276
|
-
static UserSchema() {
|
|
277
|
-
return Joi.object({
|
|
278
|
-
application_id: Joi.string().allow(""),
|
|
279
|
-
user_id: Joi.string().allow(""),
|
|
280
|
-
first_name: Joi.string().allow(""),
|
|
281
|
-
meta: Joi.any(),
|
|
282
|
-
last_name: Joi.string().allow(""),
|
|
283
|
-
phone_numbers: Joi.array().items(LeadApplicationModel.PhoneNumber()),
|
|
284
|
-
emails: Joi.array().items(LeadApplicationModel.Email()),
|
|
285
|
-
gender: Joi.string().allow(""),
|
|
286
|
-
dob: Joi.string().allow(""),
|
|
287
|
-
active: Joi.boolean(),
|
|
288
|
-
profile_pic_url: Joi.string().allow(""),
|
|
289
|
-
username: Joi.string().allow(""),
|
|
290
|
-
account_type: Joi.string().allow(""),
|
|
291
|
-
_id: Joi.string().allow(""),
|
|
292
|
-
created_at: Joi.string().allow(""),
|
|
293
|
-
updated_at: Joi.string().allow(""),
|
|
294
|
-
external_id: Joi.string().allow(""),
|
|
295
|
-
rr_id: Joi.string().allow(""),
|
|
296
|
-
});
|
|
297
|
-
}
|
|
298
|
-
|
|
299
194
|
/** @returns {SubmitCustomFormResponse} */
|
|
300
195
|
static SubmitCustomFormResponse() {
|
|
301
196
|
return Joi.object({
|
|
@@ -465,27 +360,6 @@ class LeadApplicationModel {
|
|
|
465
360
|
});
|
|
466
361
|
}
|
|
467
362
|
|
|
468
|
-
/** @returns {PhoneNumber} */
|
|
469
|
-
static PhoneNumber() {
|
|
470
|
-
return Joi.object({
|
|
471
|
-
phone: Joi.string().allow(""),
|
|
472
|
-
country_code: Joi.number(),
|
|
473
|
-
active: Joi.boolean(),
|
|
474
|
-
primary: Joi.boolean(),
|
|
475
|
-
verified: Joi.boolean(),
|
|
476
|
-
});
|
|
477
|
-
}
|
|
478
|
-
|
|
479
|
-
/** @returns {Email} */
|
|
480
|
-
static Email() {
|
|
481
|
-
return Joi.object({
|
|
482
|
-
email: Joi.string().allow(""),
|
|
483
|
-
active: Joi.boolean(),
|
|
484
|
-
primary: Joi.boolean(),
|
|
485
|
-
verified: Joi.boolean(),
|
|
486
|
-
});
|
|
487
|
-
}
|
|
488
|
-
|
|
489
363
|
/**
|
|
490
364
|
* Enum: PriorityEnum Used By: Lead
|
|
491
365
|
*
|