@gofynd/fdk-client-javascript 1.4.7 → 1.4.8-beta.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.
Files changed (110) hide show
  1. package/README.md +1 -1
  2. package/package.json +1 -1
  3. package/sdk/application/Cart/CartApplicationClient.d.ts +16 -3
  4. package/sdk/application/Cart/CartApplicationClient.js +118 -13
  5. package/sdk/application/Cart/CartApplicationModel.d.ts +121 -45
  6. package/sdk/application/Cart/CartApplicationModel.js +98 -26
  7. package/sdk/application/Cart/CartApplicationValidator.d.ts +45 -1
  8. package/sdk/application/Cart/CartApplicationValidator.js +26 -0
  9. package/sdk/application/Catalog/CatalogApplicationModel.d.ts +4 -2
  10. package/sdk/application/Catalog/CatalogApplicationModel.js +4 -2
  11. package/sdk/application/Content/ContentApplicationClient.d.ts +1 -1
  12. package/sdk/application/Content/ContentApplicationClient.js +5 -3
  13. package/sdk/application/Content/ContentApplicationModel.d.ts +5 -18
  14. package/sdk/application/Content/ContentApplicationModel.js +4 -20
  15. package/sdk/application/Content/ContentApplicationValidator.d.ts +10 -0
  16. package/sdk/application/Content/ContentApplicationValidator.js +4 -0
  17. package/sdk/application/Lead/LeadApplicationClient.d.ts +0 -27
  18. package/sdk/application/Lead/LeadApplicationClient.js +0 -167
  19. package/sdk/application/Lead/LeadApplicationModel.d.ts +1 -146
  20. package/sdk/application/Lead/LeadApplicationModel.js +0 -126
  21. package/sdk/application/Lead/LeadApplicationValidator.d.ts +1 -25
  22. package/sdk/application/Lead/LeadApplicationValidator.js +0 -24
  23. package/sdk/application/Logistic/LogisticApplicationClient.js +1 -1
  24. package/sdk/application/Logistic/LogisticApplicationModel.d.ts +2 -0
  25. package/sdk/application/Logistic/LogisticApplicationModel.js +2 -0
  26. package/sdk/application/Order/OrderApplicationModel.d.ts +2 -0
  27. package/sdk/application/Order/OrderApplicationModel.js +2 -0
  28. package/sdk/application/Payment/PaymentApplicationModel.d.ts +9 -2
  29. package/sdk/application/Payment/PaymentApplicationModel.js +5 -2
  30. package/sdk/application/Theme/ThemeApplicationModel.d.ts +2 -0
  31. package/sdk/application/Theme/ThemeApplicationModel.js +2 -0
  32. package/sdk/partner/Lead/LeadPartnerClient.d.ts +0 -23
  33. package/sdk/partner/Lead/LeadPartnerClient.js +0 -157
  34. package/sdk/partner/Lead/LeadPartnerModel.d.ts +12 -581
  35. package/sdk/partner/Lead/LeadPartnerModel.js +14 -403
  36. package/sdk/partner/Lead/LeadPartnerValidator.d.ts +0 -2
  37. package/sdk/partner/Lead/LeadPartnerValidator.js +0 -12
  38. package/sdk/partner/Logistics/LogisticsPartnerClient.js +1 -1
  39. package/sdk/partner/Logistics/LogisticsPartnerModel.js +4 -4
  40. package/sdk/partner/Theme/ThemePartnerClient.d.ts +22 -0
  41. package/sdk/partner/Theme/ThemePartnerClient.js +162 -0
  42. package/sdk/partner/Theme/ThemePartnerModel.d.ts +119 -1
  43. package/sdk/partner/Theme/ThemePartnerModel.js +142 -0
  44. package/sdk/partner/Theme/ThemePartnerValidator.d.ts +2 -0
  45. package/sdk/partner/Theme/ThemePartnerValidator.js +14 -0
  46. package/sdk/platform/Billing/BillingPlatformClient.d.ts +304 -43
  47. package/sdk/platform/Billing/BillingPlatformClient.js +2218 -118
  48. package/sdk/platform/Billing/BillingPlatformModel.d.ts +1330 -282
  49. package/sdk/platform/Billing/BillingPlatformModel.js +1808 -590
  50. package/sdk/platform/Billing/BillingPlatformValidator.d.ts +324 -16
  51. package/sdk/platform/Billing/BillingPlatformValidator.js +340 -12
  52. package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +28 -5
  53. package/sdk/platform/Cart/CartPlatformApplicationClient.js +198 -5
  54. package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +81 -1
  55. package/sdk/platform/Cart/CartPlatformApplicationValidator.js +48 -0
  56. package/sdk/platform/Cart/CartPlatformModel.d.ts +214 -40
  57. package/sdk/platform/Cart/CartPlatformModel.js +164 -24
  58. package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +2 -2
  59. package/sdk/platform/Catalog/CatalogPlatformClient.js +18 -2
  60. package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +4 -0
  61. package/sdk/platform/Catalog/CatalogPlatformModel.js +4 -0
  62. package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +28 -0
  63. package/sdk/platform/Catalog/CatalogPlatformValidator.js +12 -0
  64. package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +1 -1
  65. package/sdk/platform/Content/ContentPlatformApplicationClient.js +18 -1
  66. package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +25 -0
  67. package/sdk/platform/Content/ContentPlatformApplicationValidator.js +10 -0
  68. package/sdk/platform/Content/ContentPlatformModel.d.ts +6 -4
  69. package/sdk/platform/Content/ContentPlatformModel.js +6 -4
  70. package/sdk/platform/Finance/FinancePlatformClient.d.ts +49 -28
  71. package/sdk/platform/Finance/FinancePlatformClient.js +181 -28
  72. package/sdk/platform/Finance/FinancePlatformModel.d.ts +350 -127
  73. package/sdk/platform/Finance/FinancePlatformModel.js +378 -108
  74. package/sdk/platform/Finance/FinancePlatformValidator.d.ts +56 -43
  75. package/sdk/platform/Finance/FinancePlatformValidator.js +61 -42
  76. package/sdk/platform/Lead/LeadPlatformApplicationClient.d.ts +0 -47
  77. package/sdk/platform/Lead/LeadPlatformApplicationClient.js +0 -321
  78. package/sdk/platform/Lead/LeadPlatformApplicationValidator.d.ts +1 -46
  79. package/sdk/platform/Lead/LeadPlatformApplicationValidator.js +0 -48
  80. package/sdk/platform/Lead/LeadPlatformClient.d.ts +2 -25
  81. package/sdk/platform/Lead/LeadPlatformClient.js +2 -167
  82. package/sdk/platform/Lead/LeadPlatformModel.d.ts +82 -204
  83. package/sdk/platform/Lead/LeadPlatformModel.js +98 -178
  84. package/sdk/platform/Lead/LeadPlatformValidator.d.ts +1 -25
  85. package/sdk/platform/Lead/LeadPlatformValidator.js +0 -24
  86. package/sdk/platform/Order/OrderPlatformModel.d.ts +108 -15
  87. package/sdk/platform/Order/OrderPlatformModel.js +47 -14
  88. package/sdk/platform/Payment/PaymentPlatformModel.d.ts +12 -0
  89. package/sdk/platform/Payment/PaymentPlatformModel.js +5 -0
  90. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +4 -4
  91. package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +12 -0
  92. package/sdk/platform/Theme/ThemePlatformApplicationClient.js +82 -0
  93. package/sdk/platform/Theme/ThemePlatformApplicationValidator.d.ts +18 -1
  94. package/sdk/platform/Theme/ThemePlatformApplicationValidator.js +14 -0
  95. package/sdk/platform/Theme/ThemePlatformModel.d.ts +67 -1
  96. package/sdk/platform/Theme/ThemePlatformModel.js +78 -0
  97. package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +0 -40
  98. package/sdk/platform/Webhook/WebhookPlatformClient.js +0 -307
  99. package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +112 -164
  100. package/sdk/platform/Webhook/WebhookPlatformModel.js +118 -169
  101. package/sdk/platform/Webhook/WebhookPlatformValidator.d.ts +9 -35
  102. package/sdk/platform/Webhook/WebhookPlatformValidator.js +8 -46
  103. package/sdk/public/Billing/BillingPublicClient.d.ts +24 -2
  104. package/sdk/public/Billing/BillingPublicClient.js +156 -3
  105. package/sdk/public/Billing/BillingPublicModel.d.ts +368 -26
  106. package/sdk/public/Billing/BillingPublicModel.js +317 -18
  107. package/sdk/public/Billing/BillingPublicValidator.d.ts +19 -3
  108. package/sdk/public/Billing/BillingPublicValidator.js +22 -3
  109. package/sdk/public/Webhook/WebhookPublicModel.d.ts +22 -22
  110. package/sdk/public/Webhook/WebhookPublicModel.js +22 -22
@@ -12,18 +12,10 @@ export = LeadApplicationValidator;
12
12
  * @typedef GetCustomFormParam
13
13
  * @property {string} slug - Slug of form whose response is getting submitted
14
14
  */
15
- /**
16
- * @typedef GetParticipantsInsideVideoRoomParam
17
- * @property {string} uniqueName - Unique name of Video Room
18
- */
19
15
  /**
20
16
  * @typedef GetTicketParam
21
17
  * @property {string} id - ID of ticket to be retrieved
22
18
  */
23
- /**
24
- * @typedef GetTokenForVideoRoomParam
25
- * @property {string} uniqueName - Unique name of Video Room
26
- */
27
19
  /**
28
20
  * @typedef SubmitCustomFormParam
29
21
  * @property {string} slug - Slug of form whose response is getting submitted
@@ -36,17 +28,13 @@ declare class LeadApplicationValidator {
36
28
  static createTicket(): CreateTicketParam;
37
29
  /** @returns {GetCustomFormParam} */
38
30
  static getCustomForm(): GetCustomFormParam;
39
- /** @returns {GetParticipantsInsideVideoRoomParam} */
40
- static getParticipantsInsideVideoRoom(): GetParticipantsInsideVideoRoomParam;
41
31
  /** @returns {GetTicketParam} */
42
32
  static getTicket(): GetTicketParam;
43
- /** @returns {GetTokenForVideoRoomParam} */
44
- static getTokenForVideoRoom(): GetTokenForVideoRoomParam;
45
33
  /** @returns {SubmitCustomFormParam} */
46
34
  static submitCustomForm(): SubmitCustomFormParam;
47
35
  }
48
36
  declare namespace LeadApplicationValidator {
49
- export { CreateHistoryParam, CreateTicketParam, GetCustomFormParam, GetParticipantsInsideVideoRoomParam, GetTicketParam, GetTokenForVideoRoomParam, SubmitCustomFormParam };
37
+ export { CreateHistoryParam, CreateTicketParam, GetCustomFormParam, GetTicketParam, SubmitCustomFormParam };
50
38
  }
51
39
  type CreateHistoryParam = {
52
40
  /**
@@ -64,24 +52,12 @@ type GetCustomFormParam = {
64
52
  */
65
53
  slug: string;
66
54
  };
67
- type GetParticipantsInsideVideoRoomParam = {
68
- /**
69
- * - Unique name of Video Room
70
- */
71
- uniqueName: string;
72
- };
73
55
  type GetTicketParam = {
74
56
  /**
75
57
  * - ID of ticket to be retrieved
76
58
  */
77
59
  id: string;
78
60
  };
79
- type GetTokenForVideoRoomParam = {
80
- /**
81
- * - Unique name of Video Room
82
- */
83
- uniqueName: string;
84
- };
85
61
  type SubmitCustomFormParam = {
86
62
  /**
87
63
  * - Slug of form whose response is getting submitted
@@ -18,21 +18,11 @@ const LeadApplicationModel = require("./LeadApplicationModel");
18
18
  * @property {string} slug - Slug of form whose response is getting submitted
19
19
  */
20
20
 
21
- /**
22
- * @typedef GetParticipantsInsideVideoRoomParam
23
- * @property {string} uniqueName - Unique name of Video Room
24
- */
25
-
26
21
  /**
27
22
  * @typedef GetTicketParam
28
23
  * @property {string} id - ID of ticket to be retrieved
29
24
  */
30
25
 
31
- /**
32
- * @typedef GetTokenForVideoRoomParam
33
- * @property {string} uniqueName - Unique name of Video Room
34
- */
35
-
36
26
  /**
37
27
  * @typedef SubmitCustomFormParam
38
28
  * @property {string} slug - Slug of form whose response is getting submitted
@@ -62,13 +52,6 @@ class LeadApplicationValidator {
62
52
  }).required();
63
53
  }
64
54
 
65
- /** @returns {GetParticipantsInsideVideoRoomParam} */
66
- static getParticipantsInsideVideoRoom() {
67
- return Joi.object({
68
- uniqueName: Joi.string().allow("").required(),
69
- }).required();
70
- }
71
-
72
55
  /** @returns {GetTicketParam} */
73
56
  static getTicket() {
74
57
  return Joi.object({
@@ -76,13 +59,6 @@ class LeadApplicationValidator {
76
59
  }).required();
77
60
  }
78
61
 
79
- /** @returns {GetTokenForVideoRoomParam} */
80
- static getTokenForVideoRoom() {
81
- return Joi.object({
82
- uniqueName: Joi.string().allow("").required(),
83
- }).required();
84
- }
85
-
86
62
  /** @returns {SubmitCustomFormParam} */
87
63
  static submitCustomForm() {
88
64
  return Joi.object({
@@ -15,7 +15,7 @@ class Logistic {
15
15
  this._conf = _conf;
16
16
  this._relativeUrls = {
17
17
  getAllCountries: "/service/application/logistics/v1.0/country-list",
18
- getCountries: "/service/application/logistics/v1.0/countries",
18
+ getCountries: "/service/application/logistics/v2.0/countries",
19
19
  getCountry:
20
20
  "/service/application/logistics/v1.0/countries/{country_iso_code}",
21
21
  getLocalities:
@@ -379,6 +379,7 @@ export = LogisticApplicationModel;
379
379
  /**
380
380
  * @typedef ErrorResponse
381
381
  * @property {string} [error]
382
+ * @property {string} [message]
382
383
  */
383
384
  declare class LogisticApplicationModel {
384
385
  }
@@ -852,4 +853,5 @@ type GetLocality = {
852
853
  declare function ErrorResponse(): ErrorResponse;
853
854
  type ErrorResponse = {
854
855
  error?: string;
856
+ message?: string;
855
857
  };
@@ -430,6 +430,7 @@ const Joi = require("joi");
430
430
  /**
431
431
  * @typedef ErrorResponse
432
432
  * @property {string} [error]
433
+ * @property {string} [message]
433
434
  */
434
435
 
435
436
  class LogisticApplicationModel {
@@ -970,6 +971,7 @@ class LogisticApplicationModel {
970
971
  static ErrorResponse() {
971
972
  return Joi.object({
972
973
  error: Joi.string().allow(""),
974
+ message: Joi.string().allow(""),
973
975
  });
974
976
  }
975
977
  }
@@ -341,6 +341,7 @@ export = OrderApplicationModel;
341
341
  * @property {string} [order_id]
342
342
  * @property {Shipments[]} [shipments]
343
343
  * @property {BagsForReorder[]} [bags_for_reorder]
344
+ * @property {Object} [meta]
344
345
  */
345
346
  /**
346
347
  * @typedef OrderStatuses
@@ -952,6 +953,7 @@ type OrderSchema = {
952
953
  order_id?: string;
953
954
  shipments?: Shipments[];
954
955
  bags_for_reorder?: BagsForReorder[];
956
+ meta?: any;
955
957
  };
956
958
  /** @returns {OrderStatuses} */
957
959
  declare function OrderStatuses(): OrderStatuses;
@@ -371,6 +371,7 @@ const Joi = require("joi");
371
371
  * @property {string} [order_id]
372
372
  * @property {Shipments[]} [shipments]
373
373
  * @property {BagsForReorder[]} [bags_for_reorder]
374
+ * @property {Object} [meta]
374
375
  */
375
376
 
376
377
  /**
@@ -1056,6 +1057,7 @@ class OrderApplicationModel {
1056
1057
  bags_for_reorder: Joi.array().items(
1057
1058
  OrderApplicationModel.BagsForReorder()
1058
1059
  ),
1060
+ meta: Joi.object().pattern(/\S/, Joi.any()),
1059
1061
  });
1060
1062
  }
1061
1063
 
@@ -386,8 +386,10 @@ export = PaymentApplicationModel;
386
386
  */
387
387
  /**
388
388
  * @typedef LinkStatus
389
- * @property {boolean} status - Link action status
389
+ * @property {string} status - Link action status
390
390
  * @property {string} message - Message
391
+ * @property {boolean} [is_payment_done] - This key specifies payment done
392
+ * status of payment link.
391
393
  */
392
394
  /**
393
395
  * @typedef ResendOrCancelPaymentResponse
@@ -2136,11 +2138,16 @@ type LinkStatus = {
2136
2138
  /**
2137
2139
  * - Link action status
2138
2140
  */
2139
- status: boolean;
2141
+ status: string;
2140
2142
  /**
2141
2143
  * - Message
2142
2144
  */
2143
2145
  message: string;
2146
+ /**
2147
+ * - This key specifies payment done
2148
+ * status of payment link.
2149
+ */
2150
+ is_payment_done?: boolean;
2144
2151
  };
2145
2152
  /** @returns {ResendOrCancelPaymentResponse} */
2146
2153
  declare function ResendOrCancelPaymentResponse(): ResendOrCancelPaymentResponse;
@@ -429,8 +429,10 @@ const Joi = require("joi");
429
429
 
430
430
  /**
431
431
  * @typedef LinkStatus
432
- * @property {boolean} status - Link action status
432
+ * @property {string} status - Link action status
433
433
  * @property {string} message - Message
434
+ * @property {boolean} [is_payment_done] - This key specifies payment done
435
+ * status of payment link.
434
436
  */
435
437
 
436
438
  /**
@@ -1697,8 +1699,9 @@ class PaymentApplicationModel {
1697
1699
  /** @returns {LinkStatus} */
1698
1700
  static LinkStatus() {
1699
1701
  return Joi.object({
1700
- status: Joi.boolean().required(),
1702
+ status: Joi.string().allow("").required(),
1701
1703
  message: Joi.string().allow("").required(),
1704
+ is_payment_done: Joi.boolean(),
1702
1705
  });
1703
1706
  }
1704
1707
 
@@ -60,6 +60,7 @@ export = ThemeApplicationModel;
60
60
  * @typedef AvailablePageSchemaSections
61
61
  * @property {string} [name]
62
62
  * @property {string} [label]
63
+ * @property {string} [source]
63
64
  * @property {Object} [props]
64
65
  * @property {Object[]} [blocks]
65
66
  * @property {Object} [preset]
@@ -592,6 +593,7 @@ declare function AvailablePageSchemaSections(): AvailablePageSchemaSections;
592
593
  type AvailablePageSchemaSections = {
593
594
  name?: string;
594
595
  label?: string;
596
+ source?: string;
595
597
  props?: any;
596
598
  blocks?: any[];
597
599
  preset?: any;
@@ -70,6 +70,7 @@ const Joi = require("joi");
70
70
  * @typedef AvailablePageSchemaSections
71
71
  * @property {string} [name]
72
72
  * @property {string} [label]
73
+ * @property {string} [source]
73
74
  * @property {Object} [props]
74
75
  * @property {Object[]} [blocks]
75
76
  * @property {Object} [preset]
@@ -683,6 +684,7 @@ class ThemeApplicationModel {
683
684
  return Joi.object({
684
685
  name: Joi.string().allow(""),
685
686
  label: Joi.string().allow(""),
687
+ source: Joi.string().allow(""),
686
688
  props: Joi.any(),
687
689
  blocks: Joi.array().items(Joi.any()),
688
690
  preset: Joi.any(),
@@ -87,29 +87,6 @@ declare class Lead {
87
87
  * @description: Gets history list for specific partner level ticket, this history is seen on ticket detail page, this can be comment, log or rating. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/partner/lead/getTicketHistory/).
88
88
  */
89
89
  getTicketHistory({ id, requestHeaders }?: LeadPartnerValidator.GetTicketHistoryParam, { responseHeaders }?: object): Promise<LeadPartnerModel.TicketHistoryList>;
90
- /**
91
- * @param {LeadPartnerValidator.GetTokenForVideoRoomParam} arg - Arg object.
92
- * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
93
- * @param {import("../PartnerAPIClient").Options} - Options
94
- * @returns {Promise<LeadPartnerModel.GetTokenForVideoRoomResponse>} -
95
- * Success response
96
- * @name getTokenForVideoRoom
97
- * @summary: Get Token to join a specific Video Room using it's unqiue name
98
- * @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. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/partner/lead/getTokenForVideoRoom/).
99
- */
100
- getTokenForVideoRoom({ uniqueName, requestHeaders }?: LeadPartnerValidator.GetTokenForVideoRoomParam, { responseHeaders }?: object): Promise<LeadPartnerModel.GetTokenForVideoRoomResponse>;
101
- /**
102
- * @param {LeadPartnerValidator.GetVideoParticipantsParam} arg - Arg object.
103
- * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
104
- * @param {import("../PartnerAPIClient").Options} - Options
105
- * @returns {Promise<LeadPartnerModel.GetParticipantsInsideVideoRoomResponse>}
106
- * - Success response
107
- *
108
- * @name getVideoParticipants
109
- * @summary: Get participants of a specific Video Room using it's unique name
110
- * @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. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/partner/lead/getVideoParticipants/).
111
- */
112
- getVideoParticipants({ uniqueName, requestHeaders }?: LeadPartnerValidator.GetVideoParticipantsParam, { responseHeaders }?: object): Promise<LeadPartnerModel.GetParticipantsInsideVideoRoomResponse>;
113
90
  /**
114
91
  * @param {LeadPartnerValidator.GetGeneralConfigParam} arg - Arg object.
115
92
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
@@ -552,163 +552,6 @@ class Lead {
552
552
  return response;
553
553
  }
554
554
 
555
- /**
556
- * @param {LeadPartnerValidator.GetTokenForVideoRoomParam} arg - Arg object.
557
- * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
558
- * @param {import("../PartnerAPIClient").Options} - Options
559
- * @returns {Promise<LeadPartnerModel.GetTokenForVideoRoomResponse>} -
560
- * Success response
561
- * @name getTokenForVideoRoom
562
- * @summary: Get Token to join a specific Video Room using it's unqiue name
563
- * @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. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/partner/lead/getTokenForVideoRoom/).
564
- */
565
- async getTokenForVideoRoom(
566
- { uniqueName, requestHeaders } = { requestHeaders: {} },
567
- { responseHeaders } = { responseHeaders: false }
568
- ) {
569
- const { error } = LeadPartnerValidator.getTokenForVideoRoom().validate(
570
- {
571
- uniqueName,
572
- },
573
- { abortEarly: false, allowUnknown: true }
574
- );
575
- if (error) {
576
- return Promise.reject(new FDKClientValidationError(error));
577
- }
578
-
579
- // Showing warrnings if extra unknown parameters are found
580
- const {
581
- error: warrning,
582
- } = LeadPartnerValidator.getTokenForVideoRoom().validate(
583
- {
584
- uniqueName,
585
- },
586
- { abortEarly: false, allowUnknown: false }
587
- );
588
- if (warrning) {
589
- Logger({
590
- level: "WARN",
591
- message: `Parameter Validation warrnings for partner > Lead > getTokenForVideoRoom \n ${warrning}`,
592
- });
593
- }
594
-
595
- const query_params = {};
596
-
597
- const response = await PartnerAPIClient.execute(
598
- this.config,
599
- "get",
600
- `/service/partner/lead/v1.0/organization/${this.config.organizationId}/video/room/${uniqueName}/token`,
601
- query_params,
602
- undefined,
603
- requestHeaders,
604
- { responseHeaders }
605
- );
606
-
607
- let responseData = response;
608
- if (responseHeaders) {
609
- responseData = response[0];
610
- }
611
-
612
- const {
613
- error: res_error,
614
- } = LeadPartnerModel.GetTokenForVideoRoomResponse().validate(responseData, {
615
- abortEarly: false,
616
- allowUnknown: true,
617
- });
618
-
619
- if (res_error) {
620
- if (this.config.options.strictResponseCheck === true) {
621
- return Promise.reject(new FDKResponseValidationError(res_error));
622
- } else {
623
- Logger({
624
- level: "WARN",
625
- message: `Response Validation Warnings for partner > Lead > getTokenForVideoRoom \n ${res_error}`,
626
- });
627
- }
628
- }
629
-
630
- return response;
631
- }
632
-
633
- /**
634
- * @param {LeadPartnerValidator.GetVideoParticipantsParam} arg - Arg object.
635
- * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
636
- * @param {import("../PartnerAPIClient").Options} - Options
637
- * @returns {Promise<LeadPartnerModel.GetParticipantsInsideVideoRoomResponse>}
638
- * - Success response
639
- *
640
- * @name getVideoParticipants
641
- * @summary: Get participants of a specific Video Room using it's unique name
642
- * @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. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/partner/lead/getVideoParticipants/).
643
- */
644
- async getVideoParticipants(
645
- { uniqueName, requestHeaders } = { requestHeaders: {} },
646
- { responseHeaders } = { responseHeaders: false }
647
- ) {
648
- const { error } = LeadPartnerValidator.getVideoParticipants().validate(
649
- {
650
- uniqueName,
651
- },
652
- { abortEarly: false, allowUnknown: true }
653
- );
654
- if (error) {
655
- return Promise.reject(new FDKClientValidationError(error));
656
- }
657
-
658
- // Showing warrnings if extra unknown parameters are found
659
- const {
660
- error: warrning,
661
- } = LeadPartnerValidator.getVideoParticipants().validate(
662
- {
663
- uniqueName,
664
- },
665
- { abortEarly: false, allowUnknown: false }
666
- );
667
- if (warrning) {
668
- Logger({
669
- level: "WARN",
670
- message: `Parameter Validation warrnings for partner > Lead > getVideoParticipants \n ${warrning}`,
671
- });
672
- }
673
-
674
- const query_params = {};
675
-
676
- const response = await PartnerAPIClient.execute(
677
- this.config,
678
- "get",
679
- `/service/partner/lead/v1.0/organization/${this.config.organizationId}/video/room/${uniqueName}/participants`,
680
- query_params,
681
- undefined,
682
- requestHeaders,
683
- { responseHeaders }
684
- );
685
-
686
- let responseData = response;
687
- if (responseHeaders) {
688
- responseData = response[0];
689
- }
690
-
691
- const {
692
- error: res_error,
693
- } = LeadPartnerModel.GetParticipantsInsideVideoRoomResponse().validate(
694
- responseData,
695
- { abortEarly: false, allowUnknown: true }
696
- );
697
-
698
- if (res_error) {
699
- if (this.config.options.strictResponseCheck === true) {
700
- return Promise.reject(new FDKResponseValidationError(res_error));
701
- } else {
702
- Logger({
703
- level: "WARN",
704
- message: `Response Validation Warnings for partner > Lead > getVideoParticipants \n ${res_error}`,
705
- });
706
- }
707
- }
708
-
709
- return response;
710
- }
711
-
712
555
  /**
713
556
  * @param {LeadPartnerValidator.GetGeneralConfigParam} arg - Arg object.
714
557
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`