@gofynd/fdk-client-javascript 1.3.11-beta.6 → 1.3.11-beta.8

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 (229) hide show
  1. package/README.md +1 -1
  2. package/package.json +1 -1
  3. package/sdk/application/Cart/CartApplicationClient.d.ts +1 -1
  4. package/sdk/application/Cart/CartApplicationClient.js +5 -3
  5. package/sdk/application/Cart/CartApplicationModel.d.ts +107 -1
  6. package/sdk/application/Cart/CartApplicationModel.js +74 -0
  7. package/sdk/application/Cart/CartApplicationValidator.d.ts +4 -0
  8. package/sdk/application/Cart/CartApplicationValidator.js +4 -0
  9. package/sdk/application/Catalog/CatalogApplicationClient.d.ts +3 -6
  10. package/sdk/application/Catalog/CatalogApplicationClient.js +7 -20
  11. package/sdk/application/Catalog/CatalogApplicationModel.d.ts +2 -2
  12. package/sdk/application/Catalog/CatalogApplicationModel.js +2 -2
  13. package/sdk/application/Catalog/CatalogApplicationValidator.d.ts +0 -14
  14. package/sdk/application/Catalog/CatalogApplicationValidator.js +0 -6
  15. package/sdk/application/Configuration/ConfigurationApplicationModel.d.ts +183 -49
  16. package/sdk/application/Configuration/ConfigurationApplicationModel.js +173 -31
  17. package/sdk/application/Content/ContentApplicationClient.d.ts +36 -0
  18. package/sdk/application/Content/ContentApplicationClient.js +246 -0
  19. package/sdk/application/Content/ContentApplicationModel.d.ts +208 -1
  20. package/sdk/application/Content/ContentApplicationModel.js +252 -0
  21. package/sdk/application/Content/ContentApplicationValidator.d.ts +40 -1
  22. package/sdk/application/Content/ContentApplicationValidator.js +41 -0
  23. package/sdk/application/Logistic/LogisticApplicationClient.d.ts +67 -0
  24. package/sdk/application/Logistic/LogisticApplicationClient.js +547 -0
  25. package/sdk/application/Logistic/LogisticApplicationModel.d.ts +456 -1
  26. package/sdk/application/Logistic/LogisticApplicationModel.js +488 -0
  27. package/sdk/application/Logistic/LogisticApplicationValidator.d.ts +211 -1
  28. package/sdk/application/Logistic/LogisticApplicationValidator.js +131 -0
  29. package/sdk/application/Order/OrderApplicationClient.d.ts +3 -3
  30. package/sdk/application/Order/OrderApplicationClient.js +32 -8
  31. package/sdk/application/Order/OrderApplicationModel.d.ts +6 -0
  32. package/sdk/application/Order/OrderApplicationModel.js +6 -0
  33. package/sdk/application/Order/OrderApplicationValidator.d.ts +20 -0
  34. package/sdk/application/Order/OrderApplicationValidator.js +8 -0
  35. package/sdk/application/Payment/PaymentApplicationClient.d.ts +46 -2
  36. package/sdk/application/Payment/PaymentApplicationClient.js +341 -10
  37. package/sdk/application/Payment/PaymentApplicationModel.d.ts +493 -186
  38. package/sdk/application/Payment/PaymentApplicationModel.js +341 -70
  39. package/sdk/application/Payment/PaymentApplicationValidator.d.ts +59 -14
  40. package/sdk/application/Payment/PaymentApplicationValidator.js +64 -10
  41. package/sdk/application/PosCart/PosCartApplicationModel.d.ts +34 -1
  42. package/sdk/application/PosCart/PosCartApplicationModel.js +24 -0
  43. package/sdk/application/Theme/ThemeApplicationClient.d.ts +1 -1
  44. package/sdk/application/Theme/ThemeApplicationClient.js +7 -3
  45. package/sdk/application/Theme/ThemeApplicationModel.d.ts +222 -36
  46. package/sdk/application/Theme/ThemeApplicationModel.js +322 -26
  47. package/sdk/application/Theme/ThemeApplicationValidator.d.ts +10 -0
  48. package/sdk/application/Theme/ThemeApplicationValidator.js +4 -0
  49. package/sdk/application/User/UserApplicationClient.d.ts +33 -0
  50. package/sdk/application/User/UserApplicationClient.js +239 -0
  51. package/sdk/application/User/UserApplicationModel.d.ts +28 -13
  52. package/sdk/application/User/UserApplicationModel.js +36 -12
  53. package/sdk/application/User/UserApplicationValidator.d.ts +34 -1
  54. package/sdk/application/User/UserApplicationValidator.js +36 -0
  55. package/sdk/partner/Lead/LeadPartnerClient.d.ts +125 -0
  56. package/sdk/partner/Lead/LeadPartnerClient.js +785 -0
  57. package/sdk/partner/Lead/LeadPartnerModel.d.ts +1127 -0
  58. package/sdk/partner/Lead/LeadPartnerModel.js +896 -0
  59. package/sdk/partner/Lead/LeadPartnerValidator.d.ts +12 -0
  60. package/sdk/partner/Lead/LeadPartnerValidator.js +67 -0
  61. package/sdk/partner/Logistics/LogisticsPartnerClient.d.ts +155 -0
  62. package/sdk/partner/Logistics/LogisticsPartnerClient.js +1195 -0
  63. package/sdk/partner/Logistics/LogisticsPartnerModel.d.ts +372 -0
  64. package/sdk/partner/Logistics/LogisticsPartnerModel.js +442 -0
  65. package/sdk/partner/Logistics/LogisticsPartnerValidator.d.ts +16 -0
  66. package/sdk/partner/Logistics/LogisticsPartnerValidator.js +123 -0
  67. package/sdk/partner/PartnerClient.d.ts +6 -0
  68. package/sdk/partner/PartnerClient.js +9 -0
  69. package/sdk/partner/Theme/ThemePartnerClient.d.ts +10 -0
  70. package/sdk/partner/Theme/ThemePartnerClient.js +80 -0
  71. package/sdk/partner/Theme/ThemePartnerModel.d.ts +100 -43
  72. package/sdk/partner/Theme/ThemePartnerModel.js +74 -30
  73. package/sdk/partner/Theme/ThemePartnerValidator.d.ts +1 -0
  74. package/sdk/partner/Theme/ThemePartnerValidator.js +9 -0
  75. package/sdk/partner/Webhook/WebhookPartnerClient.d.ts +99 -0
  76. package/sdk/partner/Webhook/WebhookPartnerClient.js +753 -0
  77. package/sdk/partner/Webhook/WebhookPartnerModel.d.ts +566 -0
  78. package/sdk/partner/Webhook/WebhookPartnerModel.js +583 -0
  79. package/sdk/partner/Webhook/WebhookPartnerValidator.d.ts +12 -0
  80. package/sdk/partner/Webhook/WebhookPartnerValidator.js +74 -0
  81. package/sdk/partner/index.d.ts +3 -0
  82. package/sdk/partner/index.js +6 -0
  83. package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +2 -2
  84. package/sdk/platform/Billing/BillingPlatformClient.d.ts +11 -1
  85. package/sdk/platform/Billing/BillingPlatformClient.js +110 -3
  86. package/sdk/platform/Billing/BillingPlatformModel.d.ts +67 -1
  87. package/sdk/platform/Billing/BillingPlatformModel.js +78 -0
  88. package/sdk/platform/Billing/BillingPlatformValidator.d.ts +43 -4
  89. package/sdk/platform/Billing/BillingPlatformValidator.js +29 -2
  90. package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +1 -1
  91. package/sdk/platform/Cart/CartPlatformApplicationClient.js +7 -1
  92. package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +4 -0
  93. package/sdk/platform/Cart/CartPlatformApplicationValidator.js +4 -0
  94. package/sdk/platform/Cart/CartPlatformModel.d.ts +100 -5
  95. package/sdk/platform/Cart/CartPlatformModel.js +71 -4
  96. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +15 -11
  97. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +52 -21
  98. package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +27 -0
  99. package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +11 -0
  100. package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +26 -4
  101. package/sdk/platform/Catalog/CatalogPlatformClient.js +173 -7
  102. package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +304 -1
  103. package/sdk/platform/Catalog/CatalogPlatformModel.js +335 -0
  104. package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +31 -3
  105. package/sdk/platform/Catalog/CatalogPlatformValidator.js +27 -2
  106. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +138 -36
  107. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +739 -57
  108. package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.d.ts +128 -3
  109. package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.js +111 -1
  110. package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +150 -1
  111. package/sdk/platform/Communication/CommunicationPlatformModel.js +172 -0
  112. package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +8 -2
  113. package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +32 -4
  114. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +38 -9
  115. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +42 -8
  116. package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.d.ts +14 -0
  117. package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.js +6 -0
  118. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +8 -8
  119. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +4 -4
  120. package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +371 -132
  121. package/sdk/platform/Configuration/ConfigurationPlatformModel.js +288 -77
  122. package/sdk/platform/Configuration/ConfigurationPlatformValidator.d.ts +2 -2
  123. package/sdk/platform/Configuration/ConfigurationPlatformValidator.js +2 -2
  124. package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +391 -0
  125. package/sdk/platform/Content/ContentPlatformApplicationClient.js +3630 -1059
  126. package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +342 -1
  127. package/sdk/platform/Content/ContentPlatformApplicationValidator.js +401 -0
  128. package/sdk/platform/Content/ContentPlatformClient.d.ts +277 -0
  129. package/sdk/platform/Content/ContentPlatformClient.js +2000 -0
  130. package/sdk/platform/Content/ContentPlatformModel.d.ts +1094 -1
  131. package/sdk/platform/Content/ContentPlatformModel.js +1356 -46
  132. package/sdk/platform/Content/ContentPlatformValidator.d.ts +238 -0
  133. package/sdk/platform/Content/ContentPlatformValidator.js +310 -0
  134. package/sdk/platform/Discount/DiscountPlatformClient.d.ts +2 -2
  135. package/sdk/platform/Discount/DiscountPlatformClient.js +2 -2
  136. package/sdk/platform/Discount/DiscountPlatformModel.d.ts +96 -13
  137. package/sdk/platform/Discount/DiscountPlatformModel.js +104 -12
  138. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +16 -6
  139. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +117 -8
  140. package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.d.ts +55 -4
  141. package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.js +39 -2
  142. package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +16 -5
  143. package/sdk/platform/FileStorage/FileStoragePlatformModel.js +18 -4
  144. package/sdk/platform/Finance/FinancePlatformClient.d.ts +33 -0
  145. package/sdk/platform/Finance/FinancePlatformClient.js +240 -0
  146. package/sdk/platform/Finance/FinancePlatformModel.d.ts +151 -5
  147. package/sdk/platform/Finance/FinancePlatformModel.js +190 -4
  148. package/sdk/platform/Finance/FinancePlatformValidator.d.ts +38 -1
  149. package/sdk/platform/Finance/FinancePlatformValidator.js +38 -0
  150. package/sdk/platform/Lead/LeadPlatformApplicationClient.d.ts +38 -28
  151. package/sdk/platform/Lead/LeadPlatformApplicationClient.js +137 -56
  152. package/sdk/platform/Lead/LeadPlatformApplicationValidator.d.ts +41 -29
  153. package/sdk/platform/Lead/LeadPlatformApplicationValidator.js +33 -21
  154. package/sdk/platform/Lead/LeadPlatformModel.d.ts +12 -3
  155. package/sdk/platform/Lead/LeadPlatformModel.js +16 -2
  156. package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +23 -1
  157. package/sdk/platform/Order/OrderPlatformApplicationClient.js +178 -1
  158. package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +39 -1
  159. package/sdk/platform/Order/OrderPlatformApplicationValidator.js +32 -0
  160. package/sdk/platform/Order/OrderPlatformClient.d.ts +202 -31
  161. package/sdk/platform/Order/OrderPlatformClient.js +2010 -586
  162. package/sdk/platform/Order/OrderPlatformModel.d.ts +1030 -468
  163. package/sdk/platform/Order/OrderPlatformModel.js +1176 -523
  164. package/sdk/platform/Order/OrderPlatformValidator.d.ts +318 -35
  165. package/sdk/platform/Order/OrderPlatformValidator.js +292 -29
  166. package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +119 -13
  167. package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +749 -39
  168. package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +143 -7
  169. package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +133 -6
  170. package/sdk/platform/Payment/PaymentPlatformClient.d.ts +1 -1
  171. package/sdk/platform/Payment/PaymentPlatformClient.js +1 -1
  172. package/sdk/platform/Payment/PaymentPlatformModel.d.ts +996 -134
  173. package/sdk/platform/Payment/PaymentPlatformModel.js +721 -58
  174. package/sdk/platform/PlatformApplicationClient.d.ts +2 -2
  175. package/sdk/platform/PlatformApplicationClient.js +4 -4
  176. package/sdk/platform/PlatformClient.d.ts +4 -2
  177. package/sdk/platform/PlatformClient.js +8 -4
  178. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.d.ts +142 -66
  179. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.js +645 -147
  180. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.d.ts +131 -63
  181. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.js +126 -47
  182. package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +217 -105
  183. package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +1136 -347
  184. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +912 -313
  185. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +1071 -355
  186. package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.d.ts +382 -133
  187. package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.js +266 -102
  188. package/sdk/platform/Theme/ThemePlatformClient.d.ts +11 -1
  189. package/sdk/platform/Theme/ThemePlatformClient.js +87 -3
  190. package/sdk/platform/Theme/ThemePlatformModel.d.ts +333 -47
  191. package/sdk/platform/Theme/ThemePlatformModel.js +395 -35
  192. package/sdk/platform/Theme/ThemePlatformValidator.d.ts +28 -4
  193. package/sdk/platform/Theme/ThemePlatformValidator.js +21 -2
  194. package/sdk/platform/User/UserPlatformApplicationClient.d.ts +116 -1
  195. package/sdk/platform/User/UserPlatformApplicationClient.js +931 -85
  196. package/sdk/platform/User/UserPlatformApplicationValidator.d.ts +224 -7
  197. package/sdk/platform/User/UserPlatformApplicationValidator.js +173 -5
  198. package/sdk/platform/User/UserPlatformModel.d.ts +344 -7
  199. package/sdk/platform/User/UserPlatformModel.js +256 -5
  200. package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +47 -39
  201. package/sdk/platform/Webhook/WebhookPlatformClient.js +63 -61
  202. package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +264 -156
  203. package/sdk/platform/Webhook/WebhookPlatformModel.js +276 -153
  204. package/sdk/platform/Webhook/WebhookPlatformValidator.d.ts +7 -10
  205. package/sdk/platform/Webhook/WebhookPlatformValidator.js +6 -6
  206. package/sdk/platform/index.d.ts +1 -1
  207. package/sdk/platform/index.js +2 -2
  208. package/sdk/public/Billing/BillingPublicClient.d.ts +23 -0
  209. package/sdk/public/Billing/BillingPublicClient.js +116 -0
  210. package/sdk/public/Billing/BillingPublicModel.d.ts +92 -0
  211. package/sdk/public/Billing/BillingPublicModel.js +96 -0
  212. package/sdk/public/Billing/BillingPublicValidator.d.ts +18 -0
  213. package/sdk/public/Billing/BillingPublicValidator.js +19 -0
  214. package/sdk/public/Content/ContentPublicClient.d.ts +22 -0
  215. package/sdk/public/Content/ContentPublicClient.js +114 -0
  216. package/sdk/public/Content/ContentPublicModel.d.ts +53 -0
  217. package/sdk/public/Content/ContentPublicModel.js +60 -0
  218. package/sdk/public/Content/ContentPublicValidator.d.ts +18 -0
  219. package/sdk/public/Content/ContentPublicValidator.js +19 -0
  220. package/sdk/public/PublicClient.d.ts +4 -0
  221. package/sdk/public/PublicClient.js +8 -0
  222. package/sdk/public/Webhook/WebhookPublicClient.d.ts +33 -0
  223. package/sdk/public/Webhook/WebhookPublicClient.js +242 -0
  224. package/sdk/public/Webhook/WebhookPublicModel.d.ts +147 -1
  225. package/sdk/public/Webhook/WebhookPublicModel.js +177 -1
  226. package/sdk/public/Webhook/WebhookPublicValidator.d.ts +23 -1
  227. package/sdk/public/Webhook/WebhookPublicValidator.js +31 -0
  228. package/sdk/public/index.d.ts +2 -0
  229. package/sdk/public/index.js +4 -0
@@ -245,6 +245,88 @@ class User {
245
245
  return response;
246
246
  }
247
247
 
248
+ /**
249
+ * @param {UserPlatformApplicationValidator.CreateUserAttributeDefinitionParam} arg
250
+ * - Arg object
251
+ *
252
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
253
+ * @param {import("../PlatformAPIClient").Options} - Options
254
+ * @returns {Promise<UserPlatformModel.UserAttributeDefinitionResponse>} -
255
+ * Success response
256
+ * @name createUserAttributeDefinition
257
+ * @summary: Create a User Attribute Definition
258
+ * @description: Use this API to areate a new User Attribute Definition - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/user/createUserAttributeDefinition/).
259
+ */
260
+ async createUserAttributeDefinition(
261
+ { body, requestHeaders } = { requestHeaders: {} },
262
+ { responseHeaders } = { responseHeaders: false }
263
+ ) {
264
+ const {
265
+ error,
266
+ } = UserPlatformApplicationValidator.createUserAttributeDefinition().validate(
267
+ {
268
+ body,
269
+ },
270
+ { abortEarly: false, allowUnknown: true }
271
+ );
272
+ if (error) {
273
+ return Promise.reject(new FDKClientValidationError(error));
274
+ }
275
+
276
+ // Showing warrnings if extra unknown parameters are found
277
+ const {
278
+ error: warrning,
279
+ } = UserPlatformApplicationValidator.createUserAttributeDefinition().validate(
280
+ {
281
+ body,
282
+ },
283
+ { abortEarly: false, allowUnknown: false }
284
+ );
285
+ if (warrning) {
286
+ Logger({
287
+ level: "WARN",
288
+ message: `Parameter Validation warrnings for platform > User > createUserAttributeDefinition \n ${warrning}`,
289
+ });
290
+ }
291
+
292
+ const query_params = {};
293
+
294
+ const response = await PlatformAPIClient.execute(
295
+ this.config,
296
+ "post",
297
+ `/service/platform/user/v1.0/company/${this.config.companyId}/application/${this.applicationId}/user_attribute/definition`,
298
+ query_params,
299
+ body,
300
+ requestHeaders,
301
+ { responseHeaders }
302
+ );
303
+
304
+ let responseData = response;
305
+ if (responseHeaders) {
306
+ responseData = response[0];
307
+ }
308
+
309
+ const {
310
+ error: res_error,
311
+ } = UserPlatformModel.UserAttributeDefinitionResponse().validate(
312
+ responseData,
313
+ { abortEarly: false, allowUnknown: true }
314
+ );
315
+
316
+ if (res_error) {
317
+ if (this.config.options.strictResponseCheck === true) {
318
+ return Promise.reject(new FDKResponseValidationError(res_error));
319
+ } else {
320
+ Logger({
321
+ level: "WARN",
322
+ message: `Response Validation Warnings for platform > User > createUserAttributeDefinition \n ${res_error}`,
323
+ });
324
+ }
325
+ }
326
+
327
+ return response;
328
+ }
329
+
248
330
  /**
249
331
  * @param {UserPlatformApplicationValidator.CreateUserGroupParam} arg - Arg object
250
332
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
@@ -482,7 +564,558 @@ class User {
482
564
  } else {
483
565
  Logger({
484
566
  level: "WARN",
485
- message: `Response Validation Warnings for platform > User > deleteActiveSessions \n ${res_error}`,
567
+ message: `Response Validation Warnings for platform > User > deleteActiveSessions \n ${res_error}`,
568
+ });
569
+ }
570
+ }
571
+
572
+ return response;
573
+ }
574
+
575
+ /**
576
+ * @param {UserPlatformApplicationValidator.DeleteSessionParam} arg - Arg object
577
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
578
+ * @param {import("../PlatformAPIClient").Options} - Options
579
+ * @returns {Promise<UserPlatformModel.SessionDeleteResponseSchema>} -
580
+ * Success response
581
+ * @name deleteSession
582
+ * @summary: Delete a session for a user
583
+ * @description: Use this API to Delete a session of customers who have registered in the application. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/user/deleteSession/).
584
+ */
585
+ async deleteSession(
586
+ { id, sessionId, reason, requestHeaders } = { requestHeaders: {} },
587
+ { responseHeaders } = { responseHeaders: false }
588
+ ) {
589
+ const { error } = UserPlatformApplicationValidator.deleteSession().validate(
590
+ {
591
+ id,
592
+ sessionId,
593
+ reason,
594
+ },
595
+ { abortEarly: false, allowUnknown: true }
596
+ );
597
+ if (error) {
598
+ return Promise.reject(new FDKClientValidationError(error));
599
+ }
600
+
601
+ // Showing warrnings if extra unknown parameters are found
602
+ const {
603
+ error: warrning,
604
+ } = UserPlatformApplicationValidator.deleteSession().validate(
605
+ {
606
+ id,
607
+ sessionId,
608
+ reason,
609
+ },
610
+ { abortEarly: false, allowUnknown: false }
611
+ );
612
+ if (warrning) {
613
+ Logger({
614
+ level: "WARN",
615
+ message: `Parameter Validation warrnings for platform > User > deleteSession \n ${warrning}`,
616
+ });
617
+ }
618
+
619
+ const query_params = {};
620
+ query_params["id"] = id;
621
+ query_params["session_id"] = sessionId;
622
+ query_params["reason"] = reason;
623
+
624
+ const response = await PlatformAPIClient.execute(
625
+ this.config,
626
+ "delete",
627
+ `/service/platform/user/v1.0/company/${this.config.companyId}/application/${this.applicationId}/customers/session`,
628
+ query_params,
629
+ undefined,
630
+ requestHeaders,
631
+ { responseHeaders }
632
+ );
633
+
634
+ let responseData = response;
635
+ if (responseHeaders) {
636
+ responseData = response[0];
637
+ }
638
+
639
+ const {
640
+ error: res_error,
641
+ } = UserPlatformModel.SessionDeleteResponseSchema().validate(responseData, {
642
+ abortEarly: false,
643
+ allowUnknown: true,
644
+ });
645
+
646
+ if (res_error) {
647
+ if (this.config.options.strictResponseCheck === true) {
648
+ return Promise.reject(new FDKResponseValidationError(res_error));
649
+ } else {
650
+ Logger({
651
+ level: "WARN",
652
+ message: `Response Validation Warnings for platform > User > deleteSession \n ${res_error}`,
653
+ });
654
+ }
655
+ }
656
+
657
+ return response;
658
+ }
659
+
660
+ /**
661
+ * @param {UserPlatformApplicationValidator.DeleteUserAttributeParam} arg - Arg object
662
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
663
+ * @param {import("../PlatformAPIClient").Options} - Options
664
+ * @returns {Promise<UserPlatformModel.SuccessMessageResponse>} - Success response
665
+ * @name deleteUserAttribute
666
+ * @summary: delete User Attribute
667
+ * @description: delete User Attribute - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/user/deleteUserAttribute/).
668
+ */
669
+ async deleteUserAttribute(
670
+ { attributeDefId, userId, requestHeaders } = { requestHeaders: {} },
671
+ { responseHeaders } = { responseHeaders: false }
672
+ ) {
673
+ const {
674
+ error,
675
+ } = UserPlatformApplicationValidator.deleteUserAttribute().validate(
676
+ { attributeDefId, userId },
677
+ { abortEarly: false, allowUnknown: true }
678
+ );
679
+ if (error) {
680
+ return Promise.reject(new FDKClientValidationError(error));
681
+ }
682
+
683
+ // Showing warrnings if extra unknown parameters are found
684
+ const {
685
+ error: warrning,
686
+ } = UserPlatformApplicationValidator.deleteUserAttribute().validate(
687
+ { attributeDefId, userId },
688
+ { abortEarly: false, allowUnknown: false }
689
+ );
690
+ if (warrning) {
691
+ Logger({
692
+ level: "WARN",
693
+ message: `Parameter Validation warrnings for platform > User > deleteUserAttribute \n ${warrning}`,
694
+ });
695
+ }
696
+
697
+ const query_params = {};
698
+
699
+ const response = await PlatformAPIClient.execute(
700
+ this.config,
701
+ "delete",
702
+ `/service/platform/user/v1.0/company/${this.config.companyId}/application/${this.applicationId}/user_attribute/definition/${attributeDefId}/user/${userId}`,
703
+ query_params,
704
+ undefined,
705
+ requestHeaders,
706
+ { responseHeaders }
707
+ );
708
+
709
+ let responseData = response;
710
+ if (responseHeaders) {
711
+ responseData = response[0];
712
+ }
713
+
714
+ const {
715
+ error: res_error,
716
+ } = UserPlatformModel.SuccessMessageResponse().validate(responseData, {
717
+ abortEarly: false,
718
+ allowUnknown: true,
719
+ });
720
+
721
+ if (res_error) {
722
+ if (this.config.options.strictResponseCheck === true) {
723
+ return Promise.reject(new FDKResponseValidationError(res_error));
724
+ } else {
725
+ Logger({
726
+ level: "WARN",
727
+ message: `Response Validation Warnings for platform > User > deleteUserAttribute \n ${res_error}`,
728
+ });
729
+ }
730
+ }
731
+
732
+ return response;
733
+ }
734
+
735
+ /**
736
+ * @param {UserPlatformApplicationValidator.DeleteUserAttributeDefinitionByIdParam} arg
737
+ * - Arg object
738
+ *
739
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
740
+ * @param {import("../PlatformAPIClient").Options} - Options
741
+ * @returns {Promise<UserPlatformModel.SuccessMessageResponse>} - Success response
742
+ * @name deleteUserAttributeDefinitionById
743
+ * @summary: Delete User Attribute Definition
744
+ * @description: Delete a user attribute definition by its unique identifier. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/user/deleteUserAttributeDefinitionById/).
745
+ */
746
+ async deleteUserAttributeDefinitionById(
747
+ { attributeDefId, requestHeaders } = { requestHeaders: {} },
748
+ { responseHeaders } = { responseHeaders: false }
749
+ ) {
750
+ const {
751
+ error,
752
+ } = UserPlatformApplicationValidator.deleteUserAttributeDefinitionById().validate(
753
+ { attributeDefId },
754
+ { abortEarly: false, allowUnknown: true }
755
+ );
756
+ if (error) {
757
+ return Promise.reject(new FDKClientValidationError(error));
758
+ }
759
+
760
+ // Showing warrnings if extra unknown parameters are found
761
+ const {
762
+ error: warrning,
763
+ } = UserPlatformApplicationValidator.deleteUserAttributeDefinitionById().validate(
764
+ { attributeDefId },
765
+ { abortEarly: false, allowUnknown: false }
766
+ );
767
+ if (warrning) {
768
+ Logger({
769
+ level: "WARN",
770
+ message: `Parameter Validation warrnings for platform > User > deleteUserAttributeDefinitionById \n ${warrning}`,
771
+ });
772
+ }
773
+
774
+ const query_params = {};
775
+
776
+ const response = await PlatformAPIClient.execute(
777
+ this.config,
778
+ "delete",
779
+ `/service/platform/user/v1.0/company/${this.config.companyId}/application/${this.applicationId}/user_attribute/definition/${attributeDefId}`,
780
+ query_params,
781
+ undefined,
782
+ requestHeaders,
783
+ { responseHeaders }
784
+ );
785
+
786
+ let responseData = response;
787
+ if (responseHeaders) {
788
+ responseData = response[0];
789
+ }
790
+
791
+ const {
792
+ error: res_error,
793
+ } = UserPlatformModel.SuccessMessageResponse().validate(responseData, {
794
+ abortEarly: false,
795
+ allowUnknown: true,
796
+ });
797
+
798
+ if (res_error) {
799
+ if (this.config.options.strictResponseCheck === true) {
800
+ return Promise.reject(new FDKResponseValidationError(res_error));
801
+ } else {
802
+ Logger({
803
+ level: "WARN",
804
+ message: `Response Validation Warnings for platform > User > deleteUserAttributeDefinitionById \n ${res_error}`,
805
+ });
806
+ }
807
+ }
808
+
809
+ return response;
810
+ }
811
+
812
+ /**
813
+ * @param {UserPlatformApplicationValidator.GetActiveSessionsParam} arg - Arg object
814
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
815
+ * @param {import("../PlatformAPIClient").Options} - Options
816
+ * @returns {Promise<UserPlatformModel.SessionListResponseSchema>} - Success response
817
+ * @name getActiveSessions
818
+ * @summary: Get a list of all session with info for a user
819
+ * @description: Use this API to retrieve a list of session with info of customers who have registered in the application. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/user/getActiveSessions/).
820
+ */
821
+ async getActiveSessions(
822
+ { id, requestHeaders } = { requestHeaders: {} },
823
+ { responseHeaders } = { responseHeaders: false }
824
+ ) {
825
+ const {
826
+ error,
827
+ } = UserPlatformApplicationValidator.getActiveSessions().validate(
828
+ {
829
+ id,
830
+ },
831
+ { abortEarly: false, allowUnknown: true }
832
+ );
833
+ if (error) {
834
+ return Promise.reject(new FDKClientValidationError(error));
835
+ }
836
+
837
+ // Showing warrnings if extra unknown parameters are found
838
+ const {
839
+ error: warrning,
840
+ } = UserPlatformApplicationValidator.getActiveSessions().validate(
841
+ {
842
+ id,
843
+ },
844
+ { abortEarly: false, allowUnknown: false }
845
+ );
846
+ if (warrning) {
847
+ Logger({
848
+ level: "WARN",
849
+ message: `Parameter Validation warrnings for platform > User > getActiveSessions \n ${warrning}`,
850
+ });
851
+ }
852
+
853
+ const query_params = {};
854
+ query_params["id"] = id;
855
+
856
+ const response = await PlatformAPIClient.execute(
857
+ this.config,
858
+ "get",
859
+ `/service/platform/user/v1.0/company/${this.config.companyId}/application/${this.applicationId}/customers/sessions`,
860
+ query_params,
861
+ undefined,
862
+ requestHeaders,
863
+ { responseHeaders }
864
+ );
865
+
866
+ let responseData = response;
867
+ if (responseHeaders) {
868
+ responseData = response[0];
869
+ }
870
+
871
+ const {
872
+ error: res_error,
873
+ } = UserPlatformModel.SessionListResponseSchema().validate(responseData, {
874
+ abortEarly: false,
875
+ allowUnknown: true,
876
+ });
877
+
878
+ if (res_error) {
879
+ if (this.config.options.strictResponseCheck === true) {
880
+ return Promise.reject(new FDKResponseValidationError(res_error));
881
+ } else {
882
+ Logger({
883
+ level: "WARN",
884
+ message: `Response Validation Warnings for platform > User > getActiveSessions \n ${res_error}`,
885
+ });
886
+ }
887
+ }
888
+
889
+ return response;
890
+ }
891
+
892
+ /**
893
+ * @param {UserPlatformApplicationValidator.GetCustomersParam} arg - Arg object
894
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
895
+ * @param {import("../PlatformAPIClient").Options} - Options
896
+ * @returns {Promise<UserPlatformModel.CustomerListResponseSchema>} - Success response
897
+ * @name getCustomers
898
+ * @summary: Get a list of customers
899
+ * @description: Use this API to retrieve a list of customers who have registered in the application. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/user/getCustomers/).
900
+ */
901
+ async getCustomers(
902
+ { q, pageSize, pageNo, requestHeaders } = { requestHeaders: {} },
903
+ { responseHeaders } = { responseHeaders: false }
904
+ ) {
905
+ const { error } = UserPlatformApplicationValidator.getCustomers().validate(
906
+ {
907
+ q,
908
+ pageSize,
909
+ pageNo,
910
+ },
911
+ { abortEarly: false, allowUnknown: true }
912
+ );
913
+ if (error) {
914
+ return Promise.reject(new FDKClientValidationError(error));
915
+ }
916
+
917
+ // Showing warrnings if extra unknown parameters are found
918
+ const {
919
+ error: warrning,
920
+ } = UserPlatformApplicationValidator.getCustomers().validate(
921
+ {
922
+ q,
923
+ pageSize,
924
+ pageNo,
925
+ },
926
+ { abortEarly: false, allowUnknown: false }
927
+ );
928
+ if (warrning) {
929
+ Logger({
930
+ level: "WARN",
931
+ message: `Parameter Validation warrnings for platform > User > getCustomers \n ${warrning}`,
932
+ });
933
+ }
934
+
935
+ const query_params = {};
936
+ query_params["q"] = q;
937
+ query_params["page_size"] = pageSize;
938
+ query_params["page_no"] = pageNo;
939
+
940
+ const response = await PlatformAPIClient.execute(
941
+ this.config,
942
+ "get",
943
+ `/service/platform/user/v1.0/company/${this.config.companyId}/application/${this.applicationId}/customers/list`,
944
+ query_params,
945
+ undefined,
946
+ requestHeaders,
947
+ { responseHeaders }
948
+ );
949
+
950
+ let responseData = response;
951
+ if (responseHeaders) {
952
+ responseData = response[0];
953
+ }
954
+
955
+ const {
956
+ error: res_error,
957
+ } = UserPlatformModel.CustomerListResponseSchema().validate(responseData, {
958
+ abortEarly: false,
959
+ allowUnknown: true,
960
+ });
961
+
962
+ if (res_error) {
963
+ if (this.config.options.strictResponseCheck === true) {
964
+ return Promise.reject(new FDKResponseValidationError(res_error));
965
+ } else {
966
+ Logger({
967
+ level: "WARN",
968
+ message: `Response Validation Warnings for platform > User > getCustomers \n ${res_error}`,
969
+ });
970
+ }
971
+ }
972
+
973
+ return response;
974
+ }
975
+
976
+ /**
977
+ * @param {UserPlatformApplicationValidator.GetPlatformConfigParam} arg - Arg object
978
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
979
+ * @param {import("../PlatformAPIClient").Options} - Options
980
+ * @returns {Promise<UserPlatformModel.PlatformSchema>} - Success response
981
+ * @name getPlatformConfig
982
+ * @summary: Get platform configurations
983
+ * @description: Use this API to get all the platform configurations such as mobile image, desktop image, social logins, and all other text. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/user/getPlatformConfig/).
984
+ */
985
+ async getPlatformConfig(
986
+ { requestHeaders } = { requestHeaders: {} },
987
+ { responseHeaders } = { responseHeaders: false }
988
+ ) {
989
+ const {
990
+ error,
991
+ } = UserPlatformApplicationValidator.getPlatformConfig().validate(
992
+ {},
993
+ { abortEarly: false, allowUnknown: true }
994
+ );
995
+ if (error) {
996
+ return Promise.reject(new FDKClientValidationError(error));
997
+ }
998
+
999
+ // Showing warrnings if extra unknown parameters are found
1000
+ const {
1001
+ error: warrning,
1002
+ } = UserPlatformApplicationValidator.getPlatformConfig().validate(
1003
+ {},
1004
+ { abortEarly: false, allowUnknown: false }
1005
+ );
1006
+ if (warrning) {
1007
+ Logger({
1008
+ level: "WARN",
1009
+ message: `Parameter Validation warrnings for platform > User > getPlatformConfig \n ${warrning}`,
1010
+ });
1011
+ }
1012
+
1013
+ const query_params = {};
1014
+
1015
+ const response = await PlatformAPIClient.execute(
1016
+ this.config,
1017
+ "get",
1018
+ `/service/platform/user/v1.0/company/${this.config.companyId}/application/${this.applicationId}/platform/config`,
1019
+ query_params,
1020
+ undefined,
1021
+ requestHeaders,
1022
+ { responseHeaders }
1023
+ );
1024
+
1025
+ let responseData = response;
1026
+ if (responseHeaders) {
1027
+ responseData = response[0];
1028
+ }
1029
+
1030
+ const {
1031
+ error: res_error,
1032
+ } = UserPlatformModel.PlatformSchema().validate(responseData, {
1033
+ abortEarly: false,
1034
+ allowUnknown: true,
1035
+ });
1036
+
1037
+ if (res_error) {
1038
+ if (this.config.options.strictResponseCheck === true) {
1039
+ return Promise.reject(new FDKResponseValidationError(res_error));
1040
+ } else {
1041
+ Logger({
1042
+ level: "WARN",
1043
+ message: `Response Validation Warnings for platform > User > getPlatformConfig \n ${res_error}`,
1044
+ });
1045
+ }
1046
+ }
1047
+
1048
+ return response;
1049
+ }
1050
+
1051
+ /**
1052
+ * @param {UserPlatformApplicationValidator.GetUserAttributeParam} arg - Arg object
1053
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1054
+ * @param {import("../PlatformAPIClient").Options} - Options
1055
+ * @returns {Promise<UserPlatformModel.UserAttributeResponse>} - Success response
1056
+ * @name getUserAttribute
1057
+ * @summary: get User Attribute
1058
+ * @description: get User Attribute - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/user/getUserAttribute/).
1059
+ */
1060
+ async getUserAttribute(
1061
+ { attributeDefId, userId, requestHeaders } = { requestHeaders: {} },
1062
+ { responseHeaders } = { responseHeaders: false }
1063
+ ) {
1064
+ const {
1065
+ error,
1066
+ } = UserPlatformApplicationValidator.getUserAttribute().validate(
1067
+ { attributeDefId, userId },
1068
+ { abortEarly: false, allowUnknown: true }
1069
+ );
1070
+ if (error) {
1071
+ return Promise.reject(new FDKClientValidationError(error));
1072
+ }
1073
+
1074
+ // Showing warrnings if extra unknown parameters are found
1075
+ const {
1076
+ error: warrning,
1077
+ } = UserPlatformApplicationValidator.getUserAttribute().validate(
1078
+ { attributeDefId, userId },
1079
+ { abortEarly: false, allowUnknown: false }
1080
+ );
1081
+ if (warrning) {
1082
+ Logger({
1083
+ level: "WARN",
1084
+ message: `Parameter Validation warrnings for platform > User > getUserAttribute \n ${warrning}`,
1085
+ });
1086
+ }
1087
+
1088
+ const query_params = {};
1089
+
1090
+ const response = await PlatformAPIClient.execute(
1091
+ this.config,
1092
+ "get",
1093
+ `/service/platform/user/v1.0/company/${this.config.companyId}/application/${this.applicationId}/user_attribute/definition/${attributeDefId}/user/${userId}`,
1094
+ query_params,
1095
+ undefined,
1096
+ requestHeaders,
1097
+ { responseHeaders }
1098
+ );
1099
+
1100
+ let responseData = response;
1101
+ if (responseHeaders) {
1102
+ responseData = response[0];
1103
+ }
1104
+
1105
+ const {
1106
+ error: res_error,
1107
+ } = UserPlatformModel.UserAttributeResponse().validate(responseData, {
1108
+ abortEarly: false,
1109
+ allowUnknown: true,
1110
+ });
1111
+
1112
+ if (res_error) {
1113
+ if (this.config.options.strictResponseCheck === true) {
1114
+ return Promise.reject(new FDKResponseValidationError(res_error));
1115
+ } else {
1116
+ Logger({
1117
+ level: "WARN",
1118
+ message: `Response Validation Warnings for platform > User > getUserAttribute \n ${res_error}`,
486
1119
  });
487
1120
  }
488
1121
  }
@@ -491,25 +1124,24 @@ class User {
491
1124
  }
492
1125
 
493
1126
  /**
494
- * @param {UserPlatformApplicationValidator.DeleteSessionParam} arg - Arg object
1127
+ * @param {UserPlatformApplicationValidator.GetUserAttributeByIdParam} arg
1128
+ * - Arg object
1129
+ *
495
1130
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
496
1131
  * @param {import("../PlatformAPIClient").Options} - Options
497
- * @returns {Promise<UserPlatformModel.SessionDeleteResponseSchema>} -
498
- * Success response
499
- * @name deleteSession
500
- * @summary: Delete a session for a user
501
- * @description: Use this API to Delete a session of customers who have registered in the application. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/user/deleteSession/).
1132
+ * @returns {Promise<UserPlatformModel.UserAttributeResponse>} - Success response
1133
+ * @name getUserAttributeById
1134
+ * @summary: Get User Attribute
1135
+ * @description: Get User Attribute details by id - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/user/getUserAttributeById/).
502
1136
  */
503
- async deleteSession(
504
- { id, sessionId, reason, requestHeaders } = { requestHeaders: {} },
1137
+ async getUserAttributeById(
1138
+ { attributeId, requestHeaders } = { requestHeaders: {} },
505
1139
  { responseHeaders } = { responseHeaders: false }
506
1140
  ) {
507
- const { error } = UserPlatformApplicationValidator.deleteSession().validate(
508
- {
509
- id,
510
- sessionId,
511
- reason,
512
- },
1141
+ const {
1142
+ error,
1143
+ } = UserPlatformApplicationValidator.getUserAttributeById().validate(
1144
+ { attributeId },
513
1145
  { abortEarly: false, allowUnknown: true }
514
1146
  );
515
1147
  if (error) {
@@ -519,30 +1151,23 @@ class User {
519
1151
  // Showing warrnings if extra unknown parameters are found
520
1152
  const {
521
1153
  error: warrning,
522
- } = UserPlatformApplicationValidator.deleteSession().validate(
523
- {
524
- id,
525
- sessionId,
526
- reason,
527
- },
1154
+ } = UserPlatformApplicationValidator.getUserAttributeById().validate(
1155
+ { attributeId },
528
1156
  { abortEarly: false, allowUnknown: false }
529
1157
  );
530
1158
  if (warrning) {
531
1159
  Logger({
532
1160
  level: "WARN",
533
- message: `Parameter Validation warrnings for platform > User > deleteSession \n ${warrning}`,
1161
+ message: `Parameter Validation warrnings for platform > User > getUserAttributeById \n ${warrning}`,
534
1162
  });
535
1163
  }
536
1164
 
537
1165
  const query_params = {};
538
- query_params["id"] = id;
539
- query_params["session_id"] = sessionId;
540
- query_params["reason"] = reason;
541
1166
 
542
1167
  const response = await PlatformAPIClient.execute(
543
1168
  this.config,
544
- "delete",
545
- `/service/platform/user/v1.0/company/${this.config.companyId}/application/${this.applicationId}/customers/session`,
1169
+ "get",
1170
+ `/service/platform/user/v1.0/company/${this.config.companyId}/application/${this.applicationId}/user_attribute/attribute/${attributeId}`,
546
1171
  query_params,
547
1172
  undefined,
548
1173
  requestHeaders,
@@ -556,7 +1181,7 @@ class User {
556
1181
 
557
1182
  const {
558
1183
  error: res_error,
559
- } = UserPlatformModel.SessionDeleteResponseSchema().validate(responseData, {
1184
+ } = UserPlatformModel.UserAttributeResponse().validate(responseData, {
560
1185
  abortEarly: false,
561
1186
  allowUnknown: true,
562
1187
  });
@@ -567,7 +1192,7 @@ class User {
567
1192
  } else {
568
1193
  Logger({
569
1194
  level: "WARN",
570
- message: `Response Validation Warnings for platform > User > deleteSession \n ${res_error}`,
1195
+ message: `Response Validation Warnings for platform > User > getUserAttributeById \n ${res_error}`,
571
1196
  });
572
1197
  }
573
1198
  }
@@ -576,24 +1201,24 @@ class User {
576
1201
  }
577
1202
 
578
1203
  /**
579
- * @param {UserPlatformApplicationValidator.GetActiveSessionsParam} arg - Arg object
1204
+ * @param {UserPlatformApplicationValidator.GetUserAttributeDefinitionByIdParam} arg
1205
+ * - Arg object
1206
+ *
580
1207
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
581
1208
  * @param {import("../PlatformAPIClient").Options} - Options
582
- * @returns {Promise<UserPlatformModel.SessionListResponseSchema>} - Success response
583
- * @name getActiveSessions
584
- * @summary: Get a list of all session with info for a user
585
- * @description: Use this API to retrieve a list of session with info of customers who have registered in the application. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/user/getActiveSessions/).
1209
+ * @returns {Promise<UserPlatformModel.UserAttributeDefinition>} - Success response
1210
+ * @name getUserAttributeDefinitionById
1211
+ * @summary: Get User Attribute Definition
1212
+ * @description: Get a user attribute definition by its unique identifier. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/user/getUserAttributeDefinitionById/).
586
1213
  */
587
- async getActiveSessions(
588
- { id, requestHeaders } = { requestHeaders: {} },
1214
+ async getUserAttributeDefinitionById(
1215
+ { attributeDefId, requestHeaders } = { requestHeaders: {} },
589
1216
  { responseHeaders } = { responseHeaders: false }
590
1217
  ) {
591
1218
  const {
592
1219
  error,
593
- } = UserPlatformApplicationValidator.getActiveSessions().validate(
594
- {
595
- id,
596
- },
1220
+ } = UserPlatformApplicationValidator.getUserAttributeDefinitionById().validate(
1221
+ { attributeDefId },
597
1222
  { abortEarly: false, allowUnknown: true }
598
1223
  );
599
1224
  if (error) {
@@ -603,26 +1228,23 @@ class User {
603
1228
  // Showing warrnings if extra unknown parameters are found
604
1229
  const {
605
1230
  error: warrning,
606
- } = UserPlatformApplicationValidator.getActiveSessions().validate(
607
- {
608
- id,
609
- },
1231
+ } = UserPlatformApplicationValidator.getUserAttributeDefinitionById().validate(
1232
+ { attributeDefId },
610
1233
  { abortEarly: false, allowUnknown: false }
611
1234
  );
612
1235
  if (warrning) {
613
1236
  Logger({
614
1237
  level: "WARN",
615
- message: `Parameter Validation warrnings for platform > User > getActiveSessions \n ${warrning}`,
1238
+ message: `Parameter Validation warrnings for platform > User > getUserAttributeDefinitionById \n ${warrning}`,
616
1239
  });
617
1240
  }
618
1241
 
619
1242
  const query_params = {};
620
- query_params["id"] = id;
621
1243
 
622
1244
  const response = await PlatformAPIClient.execute(
623
1245
  this.config,
624
1246
  "get",
625
- `/service/platform/user/v1.0/company/${this.config.companyId}/application/${this.applicationId}/customers/sessions`,
1247
+ `/service/platform/user/v1.0/company/${this.config.companyId}/application/${this.applicationId}/user_attribute/definition/${attributeDefId}`,
626
1248
  query_params,
627
1249
  undefined,
628
1250
  requestHeaders,
@@ -636,7 +1258,7 @@ class User {
636
1258
 
637
1259
  const {
638
1260
  error: res_error,
639
- } = UserPlatformModel.SessionListResponseSchema().validate(responseData, {
1261
+ } = UserPlatformModel.UserAttributeDefinition().validate(responseData, {
640
1262
  abortEarly: false,
641
1263
  allowUnknown: true,
642
1264
  });
@@ -647,7 +1269,7 @@ class User {
647
1269
  } else {
648
1270
  Logger({
649
1271
  level: "WARN",
650
- message: `Response Validation Warnings for platform > User > getActiveSessions \n ${res_error}`,
1272
+ message: `Response Validation Warnings for platform > User > getUserAttributeDefinitionById \n ${res_error}`,
651
1273
  });
652
1274
  }
653
1275
  }
@@ -656,21 +1278,46 @@ class User {
656
1278
  }
657
1279
 
658
1280
  /**
659
- * @param {UserPlatformApplicationValidator.GetCustomersParam} arg - Arg object
1281
+ * @param {UserPlatformApplicationValidator.GetUserAttributeDefinitionsParam} arg
1282
+ * - Arg object
1283
+ *
660
1284
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
661
1285
  * @param {import("../PlatformAPIClient").Options} - Options
662
- * @returns {Promise<UserPlatformModel.CustomerListResponseSchema>} - Success response
663
- * @name getCustomers
664
- * @summary: Get a list of customers
665
- * @description: Use this API to retrieve a list of customers who have registered in the application. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/user/getCustomers/).
1286
+ * @returns {Promise<Object>} - Success response
1287
+ * @name getUserAttributeDefinitions
1288
+ * @summary: Get User Attribute Definitions
1289
+ * @description: Retrieve user attribute definitions. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/user/getUserAttributeDefinitions/).
666
1290
  */
667
- async getCustomers(
668
- { q, pageSize, pageNo, requestHeaders } = { requestHeaders: {} },
1291
+ async getUserAttributeDefinitions(
1292
+ {
1293
+ excludingIds,
1294
+ slug,
1295
+ type,
1296
+ customerEditable,
1297
+ encrypted,
1298
+ pinned,
1299
+ pinOrder,
1300
+ isLocked,
1301
+ name,
1302
+ pageSize,
1303
+ pageNo,
1304
+ requestHeaders,
1305
+ } = { requestHeaders: {} },
669
1306
  { responseHeaders } = { responseHeaders: false }
670
1307
  ) {
671
- const { error } = UserPlatformApplicationValidator.getCustomers().validate(
1308
+ const {
1309
+ error,
1310
+ } = UserPlatformApplicationValidator.getUserAttributeDefinitions().validate(
672
1311
  {
673
- q,
1312
+ excludingIds,
1313
+ slug,
1314
+ type,
1315
+ customerEditable,
1316
+ encrypted,
1317
+ pinned,
1318
+ pinOrder,
1319
+ isLocked,
1320
+ name,
674
1321
  pageSize,
675
1322
  pageNo,
676
1323
  },
@@ -683,9 +1330,17 @@ class User {
683
1330
  // Showing warrnings if extra unknown parameters are found
684
1331
  const {
685
1332
  error: warrning,
686
- } = UserPlatformApplicationValidator.getCustomers().validate(
1333
+ } = UserPlatformApplicationValidator.getUserAttributeDefinitions().validate(
687
1334
  {
688
- q,
1335
+ excludingIds,
1336
+ slug,
1337
+ type,
1338
+ customerEditable,
1339
+ encrypted,
1340
+ pinned,
1341
+ pinOrder,
1342
+ isLocked,
1343
+ name,
689
1344
  pageSize,
690
1345
  pageNo,
691
1346
  },
@@ -694,19 +1349,27 @@ class User {
694
1349
  if (warrning) {
695
1350
  Logger({
696
1351
  level: "WARN",
697
- message: `Parameter Validation warrnings for platform > User > getCustomers \n ${warrning}`,
1352
+ message: `Parameter Validation warrnings for platform > User > getUserAttributeDefinitions \n ${warrning}`,
698
1353
  });
699
1354
  }
700
1355
 
701
1356
  const query_params = {};
702
- query_params["q"] = q;
1357
+ query_params["excluding_ids"] = excludingIds;
1358
+ query_params["slug"] = slug;
1359
+ query_params["type"] = type;
1360
+ query_params["customer_editable"] = customerEditable;
1361
+ query_params["encrypted"] = encrypted;
1362
+ query_params["pinned"] = pinned;
1363
+ query_params["pin_order"] = pinOrder;
1364
+ query_params["is_locked"] = isLocked;
1365
+ query_params["name"] = name;
703
1366
  query_params["page_size"] = pageSize;
704
1367
  query_params["page_no"] = pageNo;
705
1368
 
706
1369
  const response = await PlatformAPIClient.execute(
707
1370
  this.config,
708
1371
  "get",
709
- `/service/platform/user/v1.0/company/${this.config.companyId}/application/${this.applicationId}/customers/list`,
1372
+ `/service/platform/user/v1.0/company/${this.config.companyId}/application/${this.applicationId}/user_attribute/definition`,
710
1373
  query_params,
711
1374
  undefined,
712
1375
  requestHeaders,
@@ -718,9 +1381,7 @@ class User {
718
1381
  responseData = response[0];
719
1382
  }
720
1383
 
721
- const {
722
- error: res_error,
723
- } = UserPlatformModel.CustomerListResponseSchema().validate(responseData, {
1384
+ const { error: res_error } = Joi.any().validate(responseData, {
724
1385
  abortEarly: false,
725
1386
  allowUnknown: true,
726
1387
  });
@@ -731,7 +1392,7 @@ class User {
731
1392
  } else {
732
1393
  Logger({
733
1394
  level: "WARN",
734
- message: `Response Validation Warnings for platform > User > getCustomers \n ${res_error}`,
1395
+ message: `Response Validation Warnings for platform > User > getUserAttributeDefinitions \n ${res_error}`,
735
1396
  });
736
1397
  }
737
1398
  }
@@ -740,22 +1401,29 @@ class User {
740
1401
  }
741
1402
 
742
1403
  /**
743
- * @param {UserPlatformApplicationValidator.GetPlatformConfigParam} arg - Arg object
1404
+ * @param {UserPlatformApplicationValidator.GetUserAttributesForUserParam} arg
1405
+ * - Arg object
1406
+ *
744
1407
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
745
1408
  * @param {import("../PlatformAPIClient").Options} - Options
746
- * @returns {Promise<UserPlatformModel.PlatformSchema>} - Success response
747
- * @name getPlatformConfig
748
- * @summary: Get platform configurations
749
- * @description: Use this API to get all the platform configurations such as mobile image, desktop image, social logins, and all other text. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/user/getPlatformConfig/).
1409
+ * @returns {Promise<Object>} - Success response
1410
+ * @name getUserAttributesForUser
1411
+ * @summary: Get User Attributes for user
1412
+ * @description: Get all user attributes for user - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/user/getUserAttributesForUser/).
750
1413
  */
751
- async getPlatformConfig(
752
- { requestHeaders } = { requestHeaders: {} },
1414
+ async getUserAttributesForUser(
1415
+ { userId, pageSize, pageNo, requestHeaders } = { requestHeaders: {} },
753
1416
  { responseHeaders } = { responseHeaders: false }
754
1417
  ) {
755
1418
  const {
756
1419
  error,
757
- } = UserPlatformApplicationValidator.getPlatformConfig().validate(
758
- {},
1420
+ } = UserPlatformApplicationValidator.getUserAttributesForUser().validate(
1421
+ {
1422
+ userId,
1423
+
1424
+ pageSize,
1425
+ pageNo,
1426
+ },
759
1427
  { abortEarly: false, allowUnknown: true }
760
1428
  );
761
1429
  if (error) {
@@ -765,23 +1433,30 @@ class User {
765
1433
  // Showing warrnings if extra unknown parameters are found
766
1434
  const {
767
1435
  error: warrning,
768
- } = UserPlatformApplicationValidator.getPlatformConfig().validate(
769
- {},
1436
+ } = UserPlatformApplicationValidator.getUserAttributesForUser().validate(
1437
+ {
1438
+ userId,
1439
+
1440
+ pageSize,
1441
+ pageNo,
1442
+ },
770
1443
  { abortEarly: false, allowUnknown: false }
771
1444
  );
772
1445
  if (warrning) {
773
1446
  Logger({
774
1447
  level: "WARN",
775
- message: `Parameter Validation warrnings for platform > User > getPlatformConfig \n ${warrning}`,
1448
+ message: `Parameter Validation warrnings for platform > User > getUserAttributesForUser \n ${warrning}`,
776
1449
  });
777
1450
  }
778
1451
 
779
1452
  const query_params = {};
1453
+ query_params["page_size"] = pageSize;
1454
+ query_params["page_no"] = pageNo;
780
1455
 
781
1456
  const response = await PlatformAPIClient.execute(
782
1457
  this.config,
783
1458
  "get",
784
- `/service/platform/user/v1.0/company/${this.config.companyId}/application/${this.applicationId}/platform/config`,
1459
+ `/service/platform/user/v1.0/company/${this.config.companyId}/application/${this.applicationId}/user_attribute/user/${userId}`,
785
1460
  query_params,
786
1461
  undefined,
787
1462
  requestHeaders,
@@ -793,9 +1468,7 @@ class User {
793
1468
  responseData = response[0];
794
1469
  }
795
1470
 
796
- const {
797
- error: res_error,
798
- } = UserPlatformModel.PlatformSchema().validate(responseData, {
1471
+ const { error: res_error } = Joi.any().validate(responseData, {
799
1472
  abortEarly: false,
800
1473
  allowUnknown: true,
801
1474
  });
@@ -806,7 +1479,7 @@ class User {
806
1479
  } else {
807
1480
  Logger({
808
1481
  level: "WARN",
809
- message: `Response Validation Warnings for platform > User > getPlatformConfig \n ${res_error}`,
1482
+ message: `Response Validation Warnings for platform > User > getUserAttributesForUser \n ${res_error}`,
810
1483
  });
811
1484
  }
812
1485
  }
@@ -904,7 +1577,7 @@ class User {
904
1577
  * @description: Use this API to get User Groups mathing criteria passed in query - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/user/getUserGroups/).
905
1578
  */
906
1579
  async getUserGroups(
907
- { pageNo, pageSize, name, status, groupUid, requestHeaders } = {
1580
+ { pageNo, pageSize, name, type, status, groupUid, requestHeaders } = {
908
1581
  requestHeaders: {},
909
1582
  },
910
1583
  { responseHeaders } = { responseHeaders: false }
@@ -914,6 +1587,7 @@ class User {
914
1587
  pageNo,
915
1588
  pageSize,
916
1589
  name,
1590
+ type,
917
1591
  status,
918
1592
  groupUid,
919
1593
  },
@@ -931,6 +1605,7 @@ class User {
931
1605
  pageNo,
932
1606
  pageSize,
933
1607
  name,
1608
+ type,
934
1609
  status,
935
1610
  groupUid,
936
1611
  },
@@ -947,6 +1622,7 @@ class User {
947
1622
  query_params["page_no"] = pageNo;
948
1623
  query_params["page_size"] = pageSize;
949
1624
  query_params["name"] = name;
1625
+ query_params["type"] = type;
950
1626
  query_params["status"] = status;
951
1627
  query_params["group_uid"] = groupUid;
952
1628
 
@@ -1304,6 +1980,176 @@ class User {
1304
1980
  return response;
1305
1981
  }
1306
1982
 
1983
+ /**
1984
+ * @param {UserPlatformApplicationValidator.UpdateUserAttributeParam} arg - Arg object
1985
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1986
+ * @param {import("../PlatformAPIClient").Options} - Options
1987
+ * @returns {Promise<UserPlatformModel.UserAttributeResponse>} - Success response
1988
+ * @name updateUserAttribute
1989
+ * @summary: Update Or Create User Attribute
1990
+ * @description: Update Or Create User Attribute - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/user/updateUserAttribute/).
1991
+ */
1992
+ async updateUserAttribute(
1993
+ { attributeDefId, userId, body, requestHeaders } = { requestHeaders: {} },
1994
+ { responseHeaders } = { responseHeaders: false }
1995
+ ) {
1996
+ const {
1997
+ error,
1998
+ } = UserPlatformApplicationValidator.updateUserAttribute().validate(
1999
+ {
2000
+ attributeDefId,
2001
+ userId,
2002
+
2003
+ body,
2004
+ },
2005
+ { abortEarly: false, allowUnknown: true }
2006
+ );
2007
+ if (error) {
2008
+ return Promise.reject(new FDKClientValidationError(error));
2009
+ }
2010
+
2011
+ // Showing warrnings if extra unknown parameters are found
2012
+ const {
2013
+ error: warrning,
2014
+ } = UserPlatformApplicationValidator.updateUserAttribute().validate(
2015
+ {
2016
+ attributeDefId,
2017
+ userId,
2018
+
2019
+ body,
2020
+ },
2021
+ { abortEarly: false, allowUnknown: false }
2022
+ );
2023
+ if (warrning) {
2024
+ Logger({
2025
+ level: "WARN",
2026
+ message: `Parameter Validation warrnings for platform > User > updateUserAttribute \n ${warrning}`,
2027
+ });
2028
+ }
2029
+
2030
+ const query_params = {};
2031
+
2032
+ const response = await PlatformAPIClient.execute(
2033
+ this.config,
2034
+ "put",
2035
+ `/service/platform/user/v1.0/company/${this.config.companyId}/application/${this.applicationId}/user_attribute/definition/${attributeDefId}/user/${userId}`,
2036
+ query_params,
2037
+ body,
2038
+ requestHeaders,
2039
+ { responseHeaders }
2040
+ );
2041
+
2042
+ let responseData = response;
2043
+ if (responseHeaders) {
2044
+ responseData = response[0];
2045
+ }
2046
+
2047
+ const {
2048
+ error: res_error,
2049
+ } = UserPlatformModel.UserAttributeResponse().validate(responseData, {
2050
+ abortEarly: false,
2051
+ allowUnknown: true,
2052
+ });
2053
+
2054
+ if (res_error) {
2055
+ if (this.config.options.strictResponseCheck === true) {
2056
+ return Promise.reject(new FDKResponseValidationError(res_error));
2057
+ } else {
2058
+ Logger({
2059
+ level: "WARN",
2060
+ message: `Response Validation Warnings for platform > User > updateUserAttribute \n ${res_error}`,
2061
+ });
2062
+ }
2063
+ }
2064
+
2065
+ return response;
2066
+ }
2067
+
2068
+ /**
2069
+ * @param {UserPlatformApplicationValidator.UpdateUserAttributeDefinitionParam} arg
2070
+ * - Arg object
2071
+ *
2072
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
2073
+ * @param {import("../PlatformAPIClient").Options} - Options
2074
+ * @returns {Promise<UserPlatformModel.UserAttributeDefinition>} - Success response
2075
+ * @name updateUserAttributeDefinition
2076
+ * @summary: Update User Attribute Definition
2077
+ * @description: Update an existing user attribute definition. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/user/updateUserAttributeDefinition/).
2078
+ */
2079
+ async updateUserAttributeDefinition(
2080
+ { attributeDefId, body, requestHeaders } = { requestHeaders: {} },
2081
+ { responseHeaders } = { responseHeaders: false }
2082
+ ) {
2083
+ const {
2084
+ error,
2085
+ } = UserPlatformApplicationValidator.updateUserAttributeDefinition().validate(
2086
+ {
2087
+ attributeDefId,
2088
+
2089
+ body,
2090
+ },
2091
+ { abortEarly: false, allowUnknown: true }
2092
+ );
2093
+ if (error) {
2094
+ return Promise.reject(new FDKClientValidationError(error));
2095
+ }
2096
+
2097
+ // Showing warrnings if extra unknown parameters are found
2098
+ const {
2099
+ error: warrning,
2100
+ } = UserPlatformApplicationValidator.updateUserAttributeDefinition().validate(
2101
+ {
2102
+ attributeDefId,
2103
+
2104
+ body,
2105
+ },
2106
+ { abortEarly: false, allowUnknown: false }
2107
+ );
2108
+ if (warrning) {
2109
+ Logger({
2110
+ level: "WARN",
2111
+ message: `Parameter Validation warrnings for platform > User > updateUserAttributeDefinition \n ${warrning}`,
2112
+ });
2113
+ }
2114
+
2115
+ const query_params = {};
2116
+
2117
+ const response = await PlatformAPIClient.execute(
2118
+ this.config,
2119
+ "put",
2120
+ `/service/platform/user/v1.0/company/${this.config.companyId}/application/${this.applicationId}/user_attribute/definition/${attributeDefId}`,
2121
+ query_params,
2122
+ body,
2123
+ requestHeaders,
2124
+ { responseHeaders }
2125
+ );
2126
+
2127
+ let responseData = response;
2128
+ if (responseHeaders) {
2129
+ responseData = response[0];
2130
+ }
2131
+
2132
+ const {
2133
+ error: res_error,
2134
+ } = UserPlatformModel.UserAttributeDefinition().validate(responseData, {
2135
+ abortEarly: false,
2136
+ allowUnknown: true,
2137
+ });
2138
+
2139
+ if (res_error) {
2140
+ if (this.config.options.strictResponseCheck === true) {
2141
+ return Promise.reject(new FDKResponseValidationError(res_error));
2142
+ } else {
2143
+ Logger({
2144
+ level: "WARN",
2145
+ message: `Response Validation Warnings for platform > User > updateUserAttributeDefinition \n ${res_error}`,
2146
+ });
2147
+ }
2148
+ }
2149
+
2150
+ return response;
2151
+ }
2152
+
1307
2153
  /**
1308
2154
  * @param {UserPlatformApplicationValidator.UpdateUserGroupParam} arg - Arg object
1309
2155
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`