@selfcommunity/react-core 0.1.7-alpha.0 → 0.1.8-alpha.0

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 (395) hide show
  1. package/lib/{types → cjs}/components/provider/SCAlertMessagesProvider/index.d.ts +0 -0
  2. package/lib/{types → cjs}/components/provider/SCAlertMessagesProvider/index.d.ts.map +0 -0
  3. package/lib/cjs/components/provider/SCAlertMessagesProvider/index.js +37 -35
  4. package/lib/cjs/components/provider/SCAlertMessagesProvider/index.js.map +1 -0
  5. package/lib/{types → cjs}/components/provider/SCContextProvider/index.d.ts +0 -0
  6. package/lib/{types → cjs}/components/provider/SCContextProvider/index.d.ts.map +0 -0
  7. package/lib/cjs/components/provider/SCContextProvider/index.js +74 -81
  8. package/lib/cjs/components/provider/SCContextProvider/index.js.map +1 -0
  9. package/lib/{types → cjs}/components/provider/SCLocaleProvider/index.d.ts +0 -0
  10. package/lib/{types → cjs}/components/provider/SCLocaleProvider/index.d.ts.map +0 -0
  11. package/lib/cjs/components/provider/SCLocaleProvider/index.js +86 -121
  12. package/lib/cjs/components/provider/SCLocaleProvider/index.js.map +1 -0
  13. package/lib/{types → cjs}/components/provider/SCNotificationProvider/index.d.ts +0 -0
  14. package/lib/{types → cjs}/components/provider/SCNotificationProvider/index.d.ts.map +0 -0
  15. package/lib/cjs/components/provider/SCNotificationProvider/index.js +41 -41
  16. package/lib/cjs/components/provider/SCNotificationProvider/index.js.map +1 -0
  17. package/lib/{types → cjs}/components/provider/SCPreferencesProvider/index.d.ts +0 -0
  18. package/lib/{types → cjs}/components/provider/SCPreferencesProvider/index.d.ts.map +0 -0
  19. package/lib/cjs/components/provider/SCPreferencesProvider/index.js +61 -62
  20. package/lib/cjs/components/provider/SCPreferencesProvider/index.js.map +1 -0
  21. package/lib/{types → cjs}/components/provider/SCRoutingProvider/index.d.ts +0 -0
  22. package/lib/{types → cjs}/components/provider/SCRoutingProvider/index.d.ts.map +1 -1
  23. package/lib/cjs/components/provider/SCRoutingProvider/index.js +104 -111
  24. package/lib/cjs/components/provider/SCRoutingProvider/index.js.map +1 -0
  25. package/lib/{types → cjs}/components/provider/SCThemeProvider/index.d.ts +0 -0
  26. package/lib/{types → cjs}/components/provider/SCThemeProvider/index.d.ts.map +0 -0
  27. package/lib/cjs/components/provider/SCThemeProvider/index.js +66 -79
  28. package/lib/cjs/components/provider/SCThemeProvider/index.js.map +1 -0
  29. package/lib/{types → cjs}/components/provider/SCUserProvider/index.d.ts +0 -0
  30. package/lib/{types → cjs}/components/provider/SCUserProvider/index.d.ts.map +0 -0
  31. package/lib/cjs/components/provider/SCUserProvider/index.js +215 -270
  32. package/lib/cjs/components/provider/SCUserProvider/index.js.map +1 -0
  33. package/lib/{types → cjs}/components/router/index.d.ts +0 -0
  34. package/lib/{types → cjs}/components/router/index.d.ts.map +0 -0
  35. package/lib/cjs/components/router/index.js +48 -49
  36. package/lib/cjs/components/router/index.js.map +1 -0
  37. package/lib/{types → cjs}/constants/Actions.d.ts +0 -0
  38. package/lib/{types → cjs}/constants/Actions.d.ts.map +0 -0
  39. package/lib/cjs/constants/Actions.js +3 -4
  40. package/lib/cjs/constants/Actions.js.map +1 -0
  41. package/lib/{types → cjs}/constants/ContextProviders.d.ts +0 -0
  42. package/lib/{types → cjs}/constants/ContextProviders.d.ts.map +0 -0
  43. package/lib/cjs/constants/ContextProviders.js +22 -24
  44. package/lib/cjs/constants/ContextProviders.js.map +1 -0
  45. package/lib/{types → cjs}/constants/Device.d.ts +0 -0
  46. package/lib/{types → cjs}/constants/Device.d.ts.map +0 -0
  47. package/lib/cjs/constants/Device.js +3 -5
  48. package/lib/cjs/constants/Device.js.map +1 -0
  49. package/lib/{types → cjs}/constants/Errors.d.ts +0 -0
  50. package/lib/{types → cjs}/constants/Errors.d.ts.map +0 -0
  51. package/lib/cjs/constants/Errors.js +3 -5
  52. package/lib/cjs/constants/Errors.js.map +1 -0
  53. package/lib/{types → cjs}/constants/Features.d.ts +0 -0
  54. package/lib/{types → cjs}/constants/Features.d.ts.map +0 -0
  55. package/lib/cjs/constants/Features.js +43 -83
  56. package/lib/cjs/constants/Features.js.map +1 -0
  57. package/lib/{types → cjs}/constants/Locale.d.ts +0 -0
  58. package/lib/{types → cjs}/constants/Locale.d.ts.map +0 -0
  59. package/lib/cjs/constants/Locale.js +10 -17
  60. package/lib/cjs/constants/Locale.js.map +1 -0
  61. package/lib/{types → cjs}/constants/Notification.d.ts +0 -0
  62. package/lib/{types → cjs}/constants/Notification.d.ts.map +0 -0
  63. package/lib/cjs/constants/Notification.js +44 -53
  64. package/lib/cjs/constants/Notification.js.map +1 -0
  65. package/lib/{types → cjs}/constants/Notifications.d.ts +0 -0
  66. package/lib/{types → cjs}/constants/Notifications.d.ts.map +0 -0
  67. package/lib/cjs/constants/Notifications.js +11 -25
  68. package/lib/cjs/constants/Notifications.js.map +1 -0
  69. package/lib/cjs/constants/Preferences.d.ts +201 -0
  70. package/lib/cjs/constants/Preferences.d.ts.map +1 -0
  71. package/lib/cjs/constants/Preferences.js +184 -292
  72. package/lib/cjs/constants/Preferences.js.map +1 -0
  73. package/lib/{types → cjs}/constants/Routes.d.ts +0 -0
  74. package/lib/{types → cjs}/constants/Routes.d.ts.map +0 -0
  75. package/lib/cjs/constants/Routes.js +38 -59
  76. package/lib/cjs/constants/Routes.js.map +1 -0
  77. package/lib/{types → cjs}/constants/Session.d.ts +0 -0
  78. package/lib/{types → cjs}/constants/Session.d.ts.map +0 -0
  79. package/lib/cjs/constants/Session.js +12 -21
  80. package/lib/cjs/constants/Session.js.map +1 -0
  81. package/lib/{types → cjs}/constants/Theme.d.ts +0 -0
  82. package/lib/{types → cjs}/constants/Theme.d.ts.map +0 -0
  83. package/lib/cjs/constants/Theme.js +3 -4
  84. package/lib/cjs/constants/Theme.js.map +1 -0
  85. package/lib/cjs/constants/WebSocket.d.ts +4 -0
  86. package/lib/cjs/constants/WebSocket.d.ts.map +1 -0
  87. package/lib/cjs/constants/WebSocket.js +6 -9
  88. package/lib/cjs/constants/WebSocket.js.map +1 -0
  89. package/lib/{types → cjs}/hooks/useSCAuth.d.ts +0 -0
  90. package/lib/{types → cjs}/hooks/useSCAuth.d.ts.map +0 -0
  91. package/lib/cjs/hooks/useSCAuth.js +212 -282
  92. package/lib/cjs/hooks/useSCAuth.js.map +1 -0
  93. package/lib/{types → cjs}/hooks/useSCCachingManager.d.ts +0 -0
  94. package/lib/{types → cjs}/hooks/useSCCachingManager.d.ts.map +0 -0
  95. package/lib/cjs/hooks/useSCCachingManager.js +37 -51
  96. package/lib/cjs/hooks/useSCCachingManager.js.map +1 -0
  97. package/lib/{types → cjs}/hooks/useSCConnectionsManager.d.ts +0 -0
  98. package/lib/{types → cjs}/hooks/useSCConnectionsManager.d.ts.map +0 -0
  99. package/lib/cjs/hooks/useSCConnectionsManager.js +190 -254
  100. package/lib/cjs/hooks/useSCConnectionsManager.js.map +1 -0
  101. package/lib/{types → cjs}/hooks/useSCFetchAddressingTagList.d.ts +0 -0
  102. package/lib/{types → cjs}/hooks/useSCFetchAddressingTagList.d.ts.map +0 -0
  103. package/lib/cjs/hooks/useSCFetchAddressingTagList.js +64 -55
  104. package/lib/cjs/hooks/useSCFetchAddressingTagList.js.map +1 -0
  105. package/lib/{types → cjs}/hooks/useSCFetchCategories.d.ts +0 -0
  106. package/lib/{types → cjs}/hooks/useSCFetchCategories.d.ts.map +0 -0
  107. package/lib/cjs/hooks/useSCFetchCategories.js +46 -56
  108. package/lib/cjs/hooks/useSCFetchCategories.js.map +1 -0
  109. package/lib/{types → cjs}/hooks/useSCFetchCategory.d.ts +0 -0
  110. package/lib/{types → cjs}/hooks/useSCFetchCategory.d.ts.map +0 -0
  111. package/lib/cjs/hooks/useSCFetchCategory.js +44 -59
  112. package/lib/cjs/hooks/useSCFetchCategory.js.map +1 -0
  113. package/lib/{types → cjs}/hooks/useSCFetchCommentObject.d.ts +0 -0
  114. package/lib/{types → cjs}/hooks/useSCFetchCommentObject.d.ts.map +0 -0
  115. package/lib/cjs/hooks/useSCFetchCommentObject.js +44 -59
  116. package/lib/cjs/hooks/useSCFetchCommentObject.js.map +1 -0
  117. package/lib/{types → cjs}/hooks/useSCFetchCommentObjects.d.ts +0 -0
  118. package/lib/{types → cjs}/hooks/useSCFetchCommentObjects.d.ts.map +0 -0
  119. package/lib/cjs/hooks/useSCFetchCommentObjects.js +157 -254
  120. package/lib/cjs/hooks/useSCFetchCommentObjects.js.map +1 -0
  121. package/lib/{types → cjs}/hooks/useSCFetchCustomAdv.d.ts +0 -0
  122. package/lib/{types → cjs}/hooks/useSCFetchCustomAdv.d.ts.map +0 -0
  123. package/lib/cjs/hooks/useSCFetchCustomAdv.js +57 -75
  124. package/lib/cjs/hooks/useSCFetchCustomAdv.js.map +1 -0
  125. package/lib/{types → cjs}/hooks/useSCFetchFeedObject.d.ts +0 -0
  126. package/lib/{types → cjs}/hooks/useSCFetchFeedObject.d.ts.map +0 -0
  127. package/lib/cjs/hooks/useSCFetchFeedObject.js +49 -69
  128. package/lib/cjs/hooks/useSCFetchFeedObject.js.map +1 -0
  129. package/lib/{types → cjs}/hooks/useSCFetchIncubator.d.ts +0 -0
  130. package/lib/{types → cjs}/hooks/useSCFetchIncubator.d.ts.map +0 -0
  131. package/lib/cjs/hooks/useSCFetchIncubator.js +44 -59
  132. package/lib/cjs/hooks/useSCFetchIncubator.js.map +1 -0
  133. package/lib/{types → cjs}/hooks/useSCFetchTag.d.ts +0 -0
  134. package/lib/{types → cjs}/hooks/useSCFetchTag.d.ts.map +0 -0
  135. package/lib/cjs/hooks/useSCFetchTag.js +44 -59
  136. package/lib/cjs/hooks/useSCFetchTag.js.map +1 -0
  137. package/lib/{types → cjs}/hooks/useSCFetchUser.d.ts +0 -0
  138. package/lib/{types → cjs}/hooks/useSCFetchUser.d.ts.map +1 -1
  139. package/lib/cjs/hooks/useSCFetchUser.js +47 -59
  140. package/lib/cjs/hooks/useSCFetchUser.js.map +1 -0
  141. package/lib/{types → cjs}/hooks/useSCFollowedCategoriesManager.d.ts +0 -0
  142. package/lib/{types → cjs}/hooks/useSCFollowedCategoriesManager.d.ts.map +0 -0
  143. package/lib/cjs/hooks/useSCFollowedCategoriesManager.js +105 -147
  144. package/lib/cjs/hooks/useSCFollowedCategoriesManager.js.map +1 -0
  145. package/lib/{types → cjs}/hooks/useSCFollowersManager.d.ts +0 -0
  146. package/lib/{types → cjs}/hooks/useSCFollowersManager.d.ts.map +0 -0
  147. package/lib/cjs/hooks/useSCFollowersManager.js +154 -204
  148. package/lib/cjs/hooks/useSCFollowersManager.js.map +1 -0
  149. package/lib/{types → cjs}/hooks/useSCMediaClick.d.ts +0 -0
  150. package/lib/{types → cjs}/hooks/useSCMediaClick.d.ts.map +0 -0
  151. package/lib/cjs/hooks/useSCMediaClick.js +18 -25
  152. package/lib/cjs/hooks/useSCMediaClick.js.map +1 -0
  153. package/lib/{types → cjs}/hooks/useSCSubscribedIncubatorsManager.d.ts +0 -0
  154. package/lib/{types → cjs}/hooks/useSCSubscribedIncubatorsManager.d.ts.map +0 -0
  155. package/lib/cjs/hooks/useSCSubscribedIncubatorsManager.js +118 -148
  156. package/lib/cjs/hooks/useSCSubscribedIncubatorsManager.js.map +1 -0
  157. package/lib/{types → cjs}/hooks/useSCWebPushMessaging.d.ts +0 -0
  158. package/lib/{types → cjs}/hooks/useSCWebPushMessaging.d.ts.map +0 -0
  159. package/lib/cjs/hooks/useSCWebPushMessaging.js +268 -268
  160. package/lib/cjs/hooks/useSCWebPushMessaging.js.map +1 -0
  161. package/lib/{types → cjs}/hooks/useSCWebSocket.d.ts +0 -0
  162. package/lib/{types → cjs}/hooks/useSCWebSocket.d.ts.map +0 -0
  163. package/lib/cjs/hooks/useSCWebSocket.js +103 -125
  164. package/lib/cjs/hooks/useSCWebSocket.js.map +1 -0
  165. package/lib/{types → cjs}/index.d.ts +0 -0
  166. package/lib/{types → cjs}/index.d.ts.map +0 -0
  167. package/lib/cjs/index.js +131 -144
  168. package/lib/cjs/index.js.map +1 -0
  169. package/lib/cjs/themes/theme.d.ts +9 -0
  170. package/lib/cjs/themes/theme.d.ts.map +1 -0
  171. package/lib/cjs/themes/theme.js +132 -143
  172. package/lib/cjs/themes/theme.js.map +1 -0
  173. package/lib/{types → cjs}/types/context.d.ts +0 -0
  174. package/lib/{types → cjs}/types/context.d.ts.map +0 -0
  175. package/lib/cjs/types/context.js +2 -2
  176. package/lib/cjs/types/context.js.map +1 -0
  177. package/lib/{types → cjs}/types/index.d.ts +0 -0
  178. package/lib/{types → cjs}/types/index.d.ts.map +0 -0
  179. package/lib/cjs/types/index.js +2 -21
  180. package/lib/cjs/types/index.js.map +1 -0
  181. package/lib/{types → cjs}/utils/errors.d.ts +0 -0
  182. package/lib/{types → cjs}/utils/errors.d.ts.map +0 -0
  183. package/lib/cjs/utils/errors.js +138 -149
  184. package/lib/cjs/utils/errors.js.map +1 -0
  185. package/lib/{types → cjs}/utils/locale.d.ts +0 -0
  186. package/lib/{types → cjs}/utils/locale.d.ts.map +0 -0
  187. package/lib/cjs/utils/locale.js +32 -48
  188. package/lib/cjs/utils/locale.js.map +1 -0
  189. package/lib/{types → cjs}/utils/user.d.ts +0 -0
  190. package/lib/{types → cjs}/utils/user.d.ts.map +0 -0
  191. package/lib/cjs/utils/user.js +25 -40
  192. package/lib/cjs/utils/user.js.map +1 -0
  193. package/lib/{types → cjs}/utils/validator.d.ts +0 -0
  194. package/lib/{types → cjs}/utils/validator.d.ts.map +0 -0
  195. package/lib/cjs/utils/validator.js +386 -576
  196. package/lib/cjs/utils/validator.js.map +1 -0
  197. package/lib/esm/components/provider/SCAlertMessagesProvider/index.d.ts +37 -0
  198. package/lib/esm/components/provider/SCAlertMessagesProvider/index.d.ts.map +1 -0
  199. package/lib/esm/components/provider/SCAlertMessagesProvider/index.js +11 -37
  200. package/lib/esm/components/provider/SCAlertMessagesProvider/index.js.map +1 -0
  201. package/lib/esm/components/provider/SCContextProvider/index.d.ts +35 -0
  202. package/lib/esm/components/provider/SCContextProvider/index.d.ts.map +1 -0
  203. package/lib/esm/components/provider/SCContextProvider/index.js +48 -83
  204. package/lib/esm/components/provider/SCContextProvider/index.js.map +1 -0
  205. package/lib/esm/components/provider/SCLocaleProvider/index.d.ts +42 -0
  206. package/lib/esm/components/provider/SCLocaleProvider/index.d.ts.map +1 -0
  207. package/lib/esm/components/provider/SCLocaleProvider/index.js +59 -123
  208. package/lib/esm/components/provider/SCLocaleProvider/index.js.map +1 -0
  209. package/lib/esm/components/provider/SCNotificationProvider/index.d.ts +37 -0
  210. package/lib/esm/components/provider/SCNotificationProvider/index.d.ts.map +1 -0
  211. package/lib/esm/components/provider/SCNotificationProvider/index.js +12 -43
  212. package/lib/esm/components/provider/SCNotificationProvider/index.js.map +1 -0
  213. package/lib/esm/components/provider/SCPreferencesProvider/index.d.ts +38 -0
  214. package/lib/esm/components/provider/SCPreferencesProvider/index.d.ts.map +1 -0
  215. package/lib/esm/components/provider/SCPreferencesProvider/index.js +35 -64
  216. package/lib/esm/components/provider/SCPreferencesProvider/index.js.map +1 -0
  217. package/lib/esm/components/provider/SCRoutingProvider/index.d.ts +39 -0
  218. package/lib/esm/components/provider/SCRoutingProvider/index.d.ts.map +1 -0
  219. package/lib/esm/components/provider/SCRoutingProvider/index.js +78 -113
  220. package/lib/esm/components/provider/SCRoutingProvider/index.js.map +1 -0
  221. package/lib/esm/components/provider/SCThemeProvider/index.d.ts +49 -0
  222. package/lib/esm/components/provider/SCThemeProvider/index.d.ts.map +1 -0
  223. package/lib/esm/components/provider/SCThemeProvider/index.js +36 -81
  224. package/lib/esm/components/provider/SCThemeProvider/index.js.map +1 -0
  225. package/lib/esm/components/provider/SCUserProvider/index.d.ts +38 -0
  226. package/lib/esm/components/provider/SCUserProvider/index.d.ts.map +1 -0
  227. package/lib/esm/components/provider/SCUserProvider/index.js +186 -272
  228. package/lib/esm/components/provider/SCUserProvider/index.js.map +1 -0
  229. package/lib/esm/components/router/index.d.ts +34 -0
  230. package/lib/esm/components/router/index.d.ts.map +1 -0
  231. package/lib/esm/components/router/index.js +24 -50
  232. package/lib/esm/components/router/index.js.map +1 -0
  233. package/lib/esm/constants/Actions.d.ts +2 -0
  234. package/lib/esm/constants/Actions.d.ts.map +1 -0
  235. package/lib/esm/constants/Actions.js +2 -6
  236. package/lib/esm/constants/Actions.js.map +1 -0
  237. package/lib/esm/constants/ContextProviders.d.ts +6 -0
  238. package/lib/esm/constants/ContextProviders.d.ts.map +1 -0
  239. package/lib/esm/constants/ContextProviders.js +18 -26
  240. package/lib/esm/constants/ContextProviders.js.map +1 -0
  241. package/lib/esm/constants/Device.d.ts +6 -0
  242. package/lib/esm/constants/Device.d.ts.map +1 -0
  243. package/lib/esm/constants/Device.js +2 -7
  244. package/lib/esm/constants/Device.js.map +1 -0
  245. package/lib/esm/constants/Errors.d.ts +5 -0
  246. package/lib/esm/constants/Errors.d.ts.map +1 -0
  247. package/lib/esm/constants/Errors.js +2 -7
  248. package/lib/esm/constants/Errors.js.map +1 -0
  249. package/lib/esm/constants/Features.d.ts +41 -0
  250. package/lib/esm/constants/Features.d.ts.map +1 -0
  251. package/lib/esm/constants/Features.js +41 -84
  252. package/lib/esm/constants/Features.js.map +1 -0
  253. package/lib/esm/constants/Locale.d.ts +8 -0
  254. package/lib/esm/constants/Locale.d.ts.map +1 -0
  255. package/lib/esm/constants/Locale.js +8 -18
  256. package/lib/esm/constants/Locale.js.map +1 -0
  257. package/lib/esm/constants/Notification.d.ts +55 -0
  258. package/lib/esm/constants/Notification.d.ts.map +1 -0
  259. package/lib/esm/constants/Notification.js +42 -54
  260. package/lib/esm/constants/Notification.js.map +1 -0
  261. package/lib/esm/constants/Notifications.d.ts +11 -0
  262. package/lib/esm/constants/Notifications.d.ts.map +1 -0
  263. package/lib/esm/constants/Notifications.js +9 -26
  264. package/lib/esm/constants/Notifications.js.map +1 -0
  265. package/lib/esm/constants/Preferences.d.ts +201 -0
  266. package/lib/esm/constants/Preferences.d.ts.map +1 -0
  267. package/lib/esm/constants/Preferences.js +181 -296
  268. package/lib/esm/constants/Preferences.js.map +1 -0
  269. package/lib/esm/constants/Routes.d.ts +29 -0
  270. package/lib/esm/constants/Routes.d.ts.map +1 -0
  271. package/lib/esm/constants/Routes.js +36 -60
  272. package/lib/esm/constants/Routes.js.map +1 -0
  273. package/lib/esm/constants/Session.d.ts +10 -0
  274. package/lib/esm/constants/Session.d.ts.map +1 -0
  275. package/lib/esm/constants/Session.js +10 -22
  276. package/lib/esm/constants/Session.js.map +1 -0
  277. package/lib/esm/constants/Theme.d.ts +2 -0
  278. package/lib/esm/constants/Theme.d.ts.map +1 -0
  279. package/lib/esm/constants/Theme.js +2 -6
  280. package/lib/esm/constants/Theme.js.map +1 -0
  281. package/lib/esm/constants/WebSocket.d.ts +4 -0
  282. package/lib/esm/constants/WebSocket.d.ts.map +1 -0
  283. package/lib/esm/constants/WebSocket.js +4 -10
  284. package/lib/esm/constants/WebSocket.js.map +1 -0
  285. package/lib/esm/hooks/useSCAuth.d.ts +56 -0
  286. package/lib/esm/hooks/useSCAuth.d.ts.map +1 -0
  287. package/lib/esm/hooks/useSCAuth.js +185 -285
  288. package/lib/esm/hooks/useSCAuth.js.map +1 -0
  289. package/lib/esm/hooks/useSCCachingManager.d.ts +19 -0
  290. package/lib/esm/hooks/useSCCachingManager.d.ts.map +1 -0
  291. package/lib/esm/hooks/useSCCachingManager.js +36 -53
  292. package/lib/esm/hooks/useSCCachingManager.js.map +1 -0
  293. package/lib/esm/hooks/useSCConnectionsManager.d.ts +40 -0
  294. package/lib/esm/hooks/useSCConnectionsManager.d.ts.map +1 -0
  295. package/lib/esm/hooks/useSCConnectionsManager.js +186 -256
  296. package/lib/esm/hooks/useSCConnectionsManager.js.map +1 -0
  297. package/lib/esm/hooks/useSCFetchAddressingTagList.d.ts +14 -0
  298. package/lib/esm/hooks/useSCFetchAddressingTagList.d.ts.map +1 -0
  299. package/lib/esm/hooks/useSCFetchAddressingTagList.js +39 -56
  300. package/lib/esm/hooks/useSCFetchAddressingTagList.js.map +1 -0
  301. package/lib/esm/hooks/useSCFetchCategories.d.ts +17 -0
  302. package/lib/esm/hooks/useSCFetchCategories.d.ts.map +1 -0
  303. package/lib/esm/hooks/useSCFetchCategories.js +45 -57
  304. package/lib/esm/hooks/useSCFetchCategories.js.map +1 -0
  305. package/lib/esm/hooks/useSCFetchCategory.d.ts +19 -0
  306. package/lib/esm/hooks/useSCFetchCategory.d.ts.map +1 -0
  307. package/lib/esm/hooks/useSCFetchCategory.js +42 -60
  308. package/lib/esm/hooks/useSCFetchCategory.js.map +1 -0
  309. package/lib/esm/hooks/useSCFetchCommentObject.d.ts +19 -0
  310. package/lib/esm/hooks/useSCFetchCommentObject.d.ts.map +1 -0
  311. package/lib/esm/hooks/useSCFetchCommentObject.js +42 -60
  312. package/lib/esm/hooks/useSCFetchCommentObject.js.map +1 -0
  313. package/lib/esm/hooks/useSCFetchCommentObjects.d.ts +53 -0
  314. package/lib/esm/hooks/useSCFetchCommentObjects.d.ts.map +1 -0
  315. package/lib/esm/hooks/useSCFetchCommentObjects.js +153 -257
  316. package/lib/esm/hooks/useSCFetchCommentObjects.js.map +1 -0
  317. package/lib/esm/hooks/useSCFetchCustomAdv.d.ts +19 -0
  318. package/lib/esm/hooks/useSCFetchCustomAdv.d.ts.map +1 -0
  319. package/lib/esm/hooks/useSCFetchCustomAdv.js +55 -76
  320. package/lib/esm/hooks/useSCFetchCustomAdv.js.map +1 -0
  321. package/lib/esm/hooks/useSCFetchFeedObject.d.ts +21 -0
  322. package/lib/esm/hooks/useSCFetchFeedObject.d.ts.map +1 -0
  323. package/lib/esm/hooks/useSCFetchFeedObject.js +47 -70
  324. package/lib/esm/hooks/useSCFetchFeedObject.js.map +1 -0
  325. package/lib/esm/hooks/useSCFetchIncubator.d.ts +19 -0
  326. package/lib/esm/hooks/useSCFetchIncubator.d.ts.map +1 -0
  327. package/lib/esm/hooks/useSCFetchIncubator.js +42 -60
  328. package/lib/esm/hooks/useSCFetchIncubator.js.map +1 -0
  329. package/lib/esm/hooks/useSCFetchTag.d.ts +19 -0
  330. package/lib/esm/hooks/useSCFetchTag.d.ts.map +1 -0
  331. package/lib/esm/hooks/useSCFetchTag.js +42 -60
  332. package/lib/esm/hooks/useSCFetchTag.js.map +1 -0
  333. package/lib/esm/hooks/useSCFetchUser.d.ts +19 -0
  334. package/lib/esm/hooks/useSCFetchUser.d.ts.map +1 -0
  335. package/lib/esm/hooks/useSCFetchUser.js +45 -60
  336. package/lib/esm/hooks/useSCFetchUser.js.map +1 -0
  337. package/lib/esm/hooks/useSCFollowedCategoriesManager.d.ts +37 -0
  338. package/lib/esm/hooks/useSCFollowedCategoriesManager.d.ts.map +1 -0
  339. package/lib/esm/hooks/useSCFollowedCategoriesManager.js +101 -149
  340. package/lib/esm/hooks/useSCFollowedCategoriesManager.js.map +1 -0
  341. package/lib/esm/hooks/useSCFollowersManager.d.ts +37 -0
  342. package/lib/esm/hooks/useSCFollowersManager.d.ts.map +1 -0
  343. package/lib/esm/hooks/useSCFollowersManager.js +150 -206
  344. package/lib/esm/hooks/useSCFollowersManager.js.map +1 -0
  345. package/lib/esm/hooks/useSCMediaClick.d.ts +4 -0
  346. package/lib/esm/hooks/useSCMediaClick.d.ts.map +1 -0
  347. package/lib/esm/hooks/useSCMediaClick.js +17 -27
  348. package/lib/esm/hooks/useSCMediaClick.js.map +1 -0
  349. package/lib/esm/hooks/useSCSubscribedIncubatorsManager.d.ts +27 -0
  350. package/lib/esm/hooks/useSCSubscribedIncubatorsManager.d.ts.map +1 -0
  351. package/lib/esm/hooks/useSCSubscribedIncubatorsManager.js +114 -150
  352. package/lib/esm/hooks/useSCSubscribedIncubatorsManager.js.map +1 -0
  353. package/lib/esm/hooks/useSCWebPushMessaging.d.ts +9 -0
  354. package/lib/esm/hooks/useSCWebPushMessaging.d.ts.map +1 -0
  355. package/lib/esm/hooks/useSCWebPushMessaging.js +244 -270
  356. package/lib/esm/hooks/useSCWebPushMessaging.js.map +1 -0
  357. package/lib/esm/hooks/useSCWebSocket.d.ts +12 -0
  358. package/lib/esm/hooks/useSCWebSocket.d.ts.map +1 -0
  359. package/lib/esm/hooks/useSCWebSocket.js +99 -127
  360. package/lib/esm/hooks/useSCWebSocket.js.map +1 -0
  361. package/lib/esm/index.d.ts +73 -0
  362. package/lib/esm/index.d.ts.map +1 -0
  363. package/lib/esm/index.js +69 -151
  364. package/lib/esm/index.js.map +1 -0
  365. package/lib/esm/themes/theme.d.ts +9 -0
  366. package/lib/esm/themes/theme.d.ts.map +1 -0
  367. package/lib/esm/themes/theme.js +128 -144
  368. package/lib/esm/themes/theme.js.map +1 -0
  369. package/lib/esm/types/context.d.ts +428 -0
  370. package/lib/esm/types/context.d.ts.map +1 -0
  371. package/lib/esm/types/context.js +2 -3
  372. package/lib/esm/types/context.js.map +1 -0
  373. package/lib/esm/types/index.d.ts +3 -0
  374. package/lib/esm/types/index.d.ts.map +1 -0
  375. package/lib/esm/types/index.js +2 -22
  376. package/lib/esm/types/index.js.map +1 -0
  377. package/lib/esm/utils/errors.d.ts +98 -0
  378. package/lib/esm/utils/errors.d.ts.map +1 -0
  379. package/lib/esm/utils/errors.js +114 -155
  380. package/lib/esm/utils/errors.js.map +1 -0
  381. package/lib/esm/utils/locale.d.ts +10 -0
  382. package/lib/esm/utils/locale.d.ts.map +1 -0
  383. package/lib/esm/utils/locale.js +27 -50
  384. package/lib/esm/utils/locale.js.map +1 -0
  385. package/lib/esm/utils/user.d.ts +41 -0
  386. package/lib/esm/utils/user.d.ts.map +1 -0
  387. package/lib/esm/utils/user.js +23 -46
  388. package/lib/esm/utils/user.js.map +1 -0
  389. package/lib/esm/utils/validator.d.ts +239 -0
  390. package/lib/esm/utils/validator.d.ts.map +1 -0
  391. package/lib/esm/utils/validator.js +352 -588
  392. package/lib/esm/utils/validator.js.map +1 -0
  393. package/lib/umd/react-core.js +1 -1
  394. package/package.json +9 -11
  395. package/lib/types/tsconfig.build.tsbuildinfo +0 -1
@@ -1,41 +1,20 @@
1
- "use strict";
2
-
3
- exports.__esModule = true;
4
- exports.ValidationWarnings = exports.ValidationResult = exports.ValidationError = void 0;
5
- exports.isFunc = isFunc;
6
-
7
- var _Locale = require("../constants/Locale");
8
-
9
- var Session = _interopRequireWildcard(require("../constants/Session"));
10
-
11
- var _utils = require("@selfcommunity/utils");
12
-
13
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
14
-
15
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
16
-
1
+ import { DEFAULT_LANGUAGE_UI, LOCALES } from '../constants/Locale';
2
+ import * as Session from '../constants/Session';
3
+ import { Logger } from '@selfcommunity/utils';
17
4
  /**
18
5
  * Manage Validation Error
19
6
  * Used to check the initial configurations
20
7
  */
21
- class ValidationError {
22
- constructor(errorCode, errorData, errorMessage = ValidationError.defaultErrorMessageMap[errorCode]) {
23
- this.errorCode = null;
24
- this.errorData = null;
25
- this.errorMessage = null;
26
- this.errorCode = errorCode;
27
- this.errorData = errorData;
28
- this.errorMessage = errorMessage;
29
- }
30
-
8
+ export class ValidationError {
9
+ constructor(errorCode, errorData, errorMessage = ValidationError.defaultErrorMessageMap[errorCode]) {
10
+ this.errorCode = null;
11
+ this.errorData = null;
12
+ this.errorMessage = null;
13
+ this.errorCode = errorCode;
14
+ this.errorData = errorData;
15
+ this.errorMessage = errorMessage;
16
+ }
31
17
  }
32
- /**
33
- * Manage Validation Warnings
34
- * Used to check the initial configurations
35
- */
36
-
37
-
38
- exports.ValidationError = ValidationError;
39
18
  ValidationError.ERROR_INVALID_CONF = 3100;
40
19
  ValidationError.ERROR_INVALID_SESSION = 4100;
41
20
  ValidationError.ERROR_INVALID_SESSION_TYPE = 4101;
@@ -56,141 +35,121 @@ ValidationError.ERROR_INVALID_NOTIFICATIONS_WEB_PUSH_MESSAGING = 4921;
56
35
  ValidationError.ERROR_INVALID_NOTIFICATIONS_WEB_PUSH_MESSAGING_DISABLE_TOAST_MESSAGE = 4922;
57
36
  ValidationError.ERROR_INVALID_NOTIFICATIONS_WEB_PUSH_MESSAGING_APPLICATION_SERVER_KEY = 4923;
58
37
  ValidationError.defaultErrorMessageMap = {
59
- [ValidationError.ERROR_INVALID_CONF]: 'Invalid or missing library configuration. Check the configuration that is passed to the SCContextProvider.',
60
- [ValidationError.ERROR_INVALID_SESSION]: 'Invalid session format.',
61
- [ValidationError.ERROR_INVALID_SESSION_TYPE]: `Invalid sessionType. Available options are ${Session.sessionTypes.join(', ')}.`,
62
- [ValidationError.ERROR_INVALID_SESSION_AUTH_TOKEN]: 'Invalid auth token format',
63
- [ValidationError.ERROR_INVALID_SESSION_CLIENT_ID]: 'Invalid clientId in the initial configuration.',
64
- [ValidationError.ERROR_INVALID_SESSION_REFRESH_TOKEN_CALLBACK]: 'Invalid refresh token callback',
65
- [ValidationError.ERROR_INVALID_PORTAL]: `Invalid portal. Check if the url format is valid.`,
66
- [ValidationError.ERROR_INVALID_LOCALE]: `Invalid locale. Available options are ${_Locale.LOCALES.join(', ')}.`,
67
- [ValidationError.ERROR_INVALID_TRANSLATIONS]: `Invalid locale messages(translations) options.`,
68
- [ValidationError.ERROR_INVALID_THEME]: 'Invalid theme options.',
69
- [ValidationError.ERROR_INVALID_ROUTER]: 'Invalid router configuration',
70
- [ValidationError.ERROR_INVALID_PROVIDERS]: `Invalid providers. Check if the list of providers is valid.`,
71
- [ValidationError.ERROR_INVALID_HANDLE_ANONYMOUS_ACTION]: 'Invalid handle anonymous action callback',
72
- [ValidationError.ERROR_INVALID_NOTIFICATIONS]: 'Invalid notifications conf.',
73
- [ValidationError.ERROR_INVALID_NOTIFICATIONS_WEBSOCKET]: 'Invalid notifications (websocket) option.',
74
- [ValidationError.ERROR_INVALID_NOTIFICATIONS_WEBSOCKET_DISABLE_TOAST_MESSAGE]: 'Invalid notifications websocket conf: disableToastMessage must be a boolean value.',
75
- [ValidationError.ERROR_INVALID_NOTIFICATIONS_WEB_PUSH_MESSAGING]: 'Invalid notifications (web push messaging) option.',
76
- [ValidationError.ERROR_INVALID_NOTIFICATIONS_WEB_PUSH_MESSAGING_DISABLE_TOAST_MESSAGE]: "Invalid notifications web push messaging option. 'disableToastMessage' must be a boolean value.",
77
- [ValidationError.ERROR_INVALID_NOTIFICATIONS_WEB_PUSH_MESSAGING_APPLICATION_SERVER_KEY]: "Invalid notifications web push messaging option. 'applicationServerKey' must be a string value."
38
+ [ValidationError.ERROR_INVALID_CONF]: 'Invalid or missing library configuration. Check the configuration that is passed to the SCContextProvider.',
39
+ [ValidationError.ERROR_INVALID_SESSION]: 'Invalid session format.',
40
+ [ValidationError.ERROR_INVALID_SESSION_TYPE]: `Invalid sessionType. Available options are ${Session.sessionTypes.join(', ')}.`,
41
+ [ValidationError.ERROR_INVALID_SESSION_AUTH_TOKEN]: 'Invalid auth token format',
42
+ [ValidationError.ERROR_INVALID_SESSION_CLIENT_ID]: 'Invalid clientId in the initial configuration.',
43
+ [ValidationError.ERROR_INVALID_SESSION_REFRESH_TOKEN_CALLBACK]: 'Invalid refresh token callback',
44
+ [ValidationError.ERROR_INVALID_PORTAL]: `Invalid portal. Check if the url format is valid.`,
45
+ [ValidationError.ERROR_INVALID_LOCALE]: `Invalid locale. Available options are ${LOCALES.join(', ')}.`,
46
+ [ValidationError.ERROR_INVALID_TRANSLATIONS]: `Invalid locale messages(translations) options.`,
47
+ [ValidationError.ERROR_INVALID_THEME]: 'Invalid theme options.',
48
+ [ValidationError.ERROR_INVALID_ROUTER]: 'Invalid router configuration',
49
+ [ValidationError.ERROR_INVALID_PROVIDERS]: `Invalid providers. Check if the list of providers is valid.`,
50
+ [ValidationError.ERROR_INVALID_HANDLE_ANONYMOUS_ACTION]: 'Invalid handle anonymous action callback',
51
+ [ValidationError.ERROR_INVALID_NOTIFICATIONS]: 'Invalid notifications conf.',
52
+ [ValidationError.ERROR_INVALID_NOTIFICATIONS_WEBSOCKET]: 'Invalid notifications (websocket) option.',
53
+ [ValidationError.ERROR_INVALID_NOTIFICATIONS_WEBSOCKET_DISABLE_TOAST_MESSAGE]: 'Invalid notifications websocket conf: disableToastMessage must be a boolean value.',
54
+ [ValidationError.ERROR_INVALID_NOTIFICATIONS_WEB_PUSH_MESSAGING]: 'Invalid notifications (web push messaging) option.',
55
+ [ValidationError.ERROR_INVALID_NOTIFICATIONS_WEB_PUSH_MESSAGING_DISABLE_TOAST_MESSAGE]: "Invalid notifications web push messaging option. 'disableToastMessage' must be a boolean value.",
56
+ [ValidationError.ERROR_INVALID_NOTIFICATIONS_WEB_PUSH_MESSAGING_APPLICATION_SERVER_KEY]: "Invalid notifications web push messaging option. 'applicationServerKey' must be a string value.",
78
57
  };
79
-
80
- class ValidationWarnings {
81
- constructor(warningCode, warningData, warningMessage = ValidationWarnings.defaultErrorMessageMap[warningCode]) {
82
- this.warningCode = null;
83
- this.warningData = null;
84
- this.warningMessage = null;
85
- this.warningCode = warningCode;
86
- this.warningData = warningData;
87
- this.warningMessage = warningMessage;
88
- }
89
-
90
- }
91
58
  /**
92
- * /**
93
- * Manage Validation Error/Warnings
94
- * of the initial configuration
59
+ * Manage Validation Warnings
60
+ * Used to check the initial configurations
95
61
  */
96
-
97
-
98
- exports.ValidationWarnings = ValidationWarnings;
62
+ export class ValidationWarnings {
63
+ constructor(warningCode, warningData, warningMessage = ValidationWarnings.defaultErrorMessageMap[warningCode]) {
64
+ this.warningCode = null;
65
+ this.warningData = null;
66
+ this.warningMessage = null;
67
+ this.warningCode = warningCode;
68
+ this.warningData = warningData;
69
+ this.warningMessage = warningMessage;
70
+ }
71
+ }
99
72
  ValidationWarnings.WARNING_SESSION_REFRESH_TOKEN_CALLBACK_NOT_FOUND = 3100;
100
73
  ValidationWarnings.WARNING_LOCALE_FALLBACK = 3300;
101
74
  ValidationWarnings.WARNING_ROUTER_FALLBACK = 3500;
102
75
  ValidationWarnings.WARNING_HANDLE_ANONYMOUS_ACTION_FALLBACK = 3700;
103
76
  ValidationWarnings.defaultErrorMessageMap = {
104
- [ValidationWarnings.WARNING_SESSION_REFRESH_TOKEN_CALLBACK_NOT_FOUND]: "The 'handleRefreshToken' is not defined in initial conf. When the token expires it will not be renewed and the user session will be lost.",
105
- [ValidationWarnings.WARNING_LOCALE_FALLBACK]: `The 'locale' is not defined in initial conf, fallback to the default ${_Locale.DEFAULT_LANGUAGE_UI}.`,
106
- [ValidationWarnings.WARNING_ROUTER_FALLBACK]: "The 'router' is not defined in initial conf, fallback to the default configurations.",
107
- [ValidationWarnings.WARNING_HANDLE_ANONYMOUS_ACTION_FALLBACK]: "The 'handleAnonymousAction' is not defined in initial conf, fallback to the default configurations."
77
+ [ValidationWarnings.WARNING_SESSION_REFRESH_TOKEN_CALLBACK_NOT_FOUND]: "The 'handleRefreshToken' is not defined in initial conf. When the token expires it will not be renewed and the user session will be lost.",
78
+ [ValidationWarnings.WARNING_LOCALE_FALLBACK]: `The 'locale' is not defined in initial conf, fallback to the default ${DEFAULT_LANGUAGE_UI}.`,
79
+ [ValidationWarnings.WARNING_ROUTER_FALLBACK]: "The 'router' is not defined in initial conf, fallback to the default configurations.",
80
+ [ValidationWarnings.WARNING_HANDLE_ANONYMOUS_ACTION_FALLBACK]: "The 'handleAnonymousAction' is not defined in initial conf, fallback to the default configurations.",
108
81
  };
109
-
110
- class ValidationResult {
111
- constructor(scope = '[Report Error]') {
112
- this.errors = [];
113
- this.warnings = [];
114
- this.scope = '';
115
- this.scope = scope;
116
- }
117
- /**
118
- * Add an error
119
- * @param errorCode
120
- * @param errorData
121
- */
122
-
123
-
124
- addError(errorCode, errorData) {
125
- this.errors.push(new ValidationError(errorCode, errorData));
126
- return this.errors;
127
- }
128
- /**
129
- * Add a warning
130
- * @param errorCode
131
- * @param errorData
132
- */
133
-
134
-
135
- addWarnings(warningCode, warningData) {
136
- this.warnings.push(new ValidationWarnings(warningCode, warningData));
137
- return this.errors;
138
- }
139
- /**
140
- * Check if contains errors
141
- */
142
-
143
-
144
- hasErrors() {
145
- return this.errors.length > 0;
146
- }
147
- /**
148
- * Check if contains warnings
149
- */
150
-
151
-
152
- hasWarnings() {
153
- return this.warnings.length > 0;
154
- }
155
- /**
156
- * Emit in console all the errors
157
- */
158
-
159
-
160
- emitErrors() {
161
- if (this.hasErrors()) {
162
- this.errors.map(e => _utils.Logger.error(this.scope, e.errorMessage));
82
+ /**
83
+ * /**
84
+ * Manage Validation Error/Warnings
85
+ * of the initial configuration
86
+ */
87
+ export class ValidationResult {
88
+ constructor(scope = '[Report Error]') {
89
+ this.errors = [];
90
+ this.warnings = [];
91
+ this.scope = '';
92
+ this.scope = scope;
93
+ }
94
+ /**
95
+ * Add an error
96
+ * @param errorCode
97
+ * @param errorData
98
+ */
99
+ addError(errorCode, errorData) {
100
+ this.errors.push(new ValidationError(errorCode, errorData));
101
+ return this.errors;
163
102
  }
164
- }
165
- /**
166
- * Emit in console all the warnings
167
- */
168
-
169
-
170
- emitWarnings() {
171
- if (this.hasWarnings()) {
172
- this.warnings.map(w => _utils.Logger.warn(this.scope, w.warningMessage));
103
+ /**
104
+ * Add a warning
105
+ * @param errorCode
106
+ * @param errorData
107
+ */
108
+ addWarnings(warningCode, warningData) {
109
+ this.warnings.push(new ValidationWarnings(warningCode, warningData));
110
+ return this.errors;
111
+ }
112
+ /**
113
+ * Check if contains errors
114
+ */
115
+ hasErrors() {
116
+ return this.errors.length > 0;
117
+ }
118
+ /**
119
+ * Check if contains warnings
120
+ */
121
+ hasWarnings() {
122
+ return this.warnings.length > 0;
123
+ }
124
+ /**
125
+ * Emit in console all the errors
126
+ */
127
+ emitErrors() {
128
+ if (this.hasErrors()) {
129
+ this.errors.map((e) => Logger.error(this.scope, e.errorMessage));
130
+ }
131
+ }
132
+ /**
133
+ * Emit in console all the warnings
134
+ */
135
+ emitWarnings() {
136
+ if (this.hasWarnings()) {
137
+ this.warnings.map((w) => Logger.warn(this.scope, w.warningMessage));
138
+ }
139
+ }
140
+ /**
141
+ * Emit in console errors/warnings
142
+ */
143
+ emit() {
144
+ this.emitErrors();
145
+ this.emitWarnings();
173
146
  }
174
- }
175
- /**
176
- * Emit in console errors/warnings
177
- */
178
-
179
-
180
- emit() {
181
- this.emitErrors();
182
- this.emitWarnings();
183
- }
184
-
185
147
  }
186
148
  /**
187
149
  * Check if v is a func
188
150
  * @param v
189
151
  */
190
-
191
-
192
- exports.ValidationResult = ValidationResult;
193
-
194
- function isFunc(v) {
195
- return typeof v === 'function';
196
- }
152
+ export function isFunc(v) {
153
+ return typeof v === 'function';
154
+ }
155
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../src/utils/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,mBAAmB,EAAE,OAAO,EAAC,MAAM,qBAAqB,CAAC;AACjE,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAC,MAAM,EAAC,MAAM,sBAAsB,CAAC;AAE5C;;;GAGG;AACH,MAAM,OAAO,eAAe;IAkD1B,YAAY,SAAS,EAAE,SAAS,EAAE,YAAY,GAAG,eAAe,CAAC,sBAAsB,CAAC,SAAS,CAAC;QAJlG,cAAS,GAAG,IAAI,CAAC;QACjB,cAAS,GAAG,IAAI,CAAC;Q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AI,CAAC,KAAK,EAAE,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC;SAClE;IACH,CAAC;IAED;;OAEG;IACH,YAAY;QACV,IAAI,IAAI,CAAC,WAAW,EAAE,EAAE;YACtB,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC;SACrE;IACH,CAAC;IAED;;OAEG;IACH,IAAI;QACF,IAAI,CAAC,UAAU,EAAE,CAAC;QAClB,IAAI,CAAC,YAAY,EAAE,CAAC;IACtB,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,UAAU,MAAM,CAAC,CAAC;IACtB,OAAO,OAAO,CAAC,KAAK,UAAU,CAAC;AACjC,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { createIntl } from 'react-intl';
2
+ /**
3
+ * Load Locale Data
4
+ */
5
+ export declare function loadLocaleData(locale: any, settings: any): {
6
+ messages: any;
7
+ locale: any;
8
+ };
9
+ export default createIntl;
10
+ //# sourceMappingURL=locale.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"locale.d.ts","sourceRoot":"","sources":["../../../src/utils/locale.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,UAAU,EAAC,MAAM,YAAY,CAAC;AAItC;;GAEG;AACH,wBAAgB,cAAc,CAAC,MAAM,KAAA,EAAE,QAAQ,KAAA;;;EAoB9C;AAED,eAAe,UAAU,CAAC"}
@@ -1,56 +1,33 @@
1
- "use strict";
2
-
3
- exports.__esModule = true;
4
- exports.default = void 0;
5
- exports.loadLocaleData = loadLocaleData;
6
-
7
- var _Locale = require("../constants/Locale");
8
-
9
- var _reactI18n = _interopRequireDefault(require("@selfcommunity/react-i18n"));
10
-
11
- var _reactIntl = require("react-intl");
12
-
13
- var _utils = require("@selfcommunity/utils");
14
-
15
- var _Errors = require("../constants/Errors");
16
-
17
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
18
-
1
+ import { DEFAULT_LANGUAGE_UI, LOCALE_EN } from '../constants/Locale';
2
+ import localeData from '@selfcommunity/react-i18n';
3
+ import { createIntl } from 'react-intl';
4
+ import { Logger } from '@selfcommunity/utils';
5
+ import { SCOPE_SC_CORE } from '../constants/Errors';
19
6
  /**
20
7
  * Load Locale Data
21
8
  */
22
- function loadLocaleData(locale, settings) {
23
- let _locale = locale;
24
- let locales = settings.locale && settings.locale.messages ? settings.locale.messages : _reactI18n.default;
25
-
26
- if (!locales[_locale]) {
27
- _locale = _Locale.DEFAULT_LANGUAGE_UI;
28
-
29
- if (settings.messages) {
30
- _utils.Logger.warn(_Errors.SCOPE_SC_CORE, `Locale ${_locale} not found in messages configuration. Fallback to 'en'.`);
31
- } else {
32
- _utils.Logger.warn(_Errors.SCOPE_SC_CORE, `Locale ${_locale} not found in sc-i18n package. Fallback to 'en'.`);
9
+ export function loadLocaleData(locale, settings) {
10
+ let _locale = locale;
11
+ let locales = settings.locale && settings.locale.messages ? settings.locale.messages : localeData;
12
+ if (!locales[_locale]) {
13
+ _locale = DEFAULT_LANGUAGE_UI;
14
+ if (settings.messages) {
15
+ Logger.warn(SCOPE_SC_CORE, `Locale ${_locale} not found in messages configuration. Fallback to 'en'.`);
16
+ }
17
+ else {
18
+ Logger.warn(SCOPE_SC_CORE, `Locale ${_locale} not found in sc-i18n package. Fallback to 'en'.`);
19
+ }
33
20
  }
34
- }
35
-
36
- try {
37
- return {
38
- messages: locales[_locale],
39
- locale: _locale
40
- };
41
- } catch (e) {
42
- if (settings.messages) {
43
- locales = _reactI18n.default;
44
-
45
- _utils.Logger.error(_Errors.SCOPE_SC_CORE, `Configuration Locale.messages doesn't contains ${_locale}. Fallback to 'en' of 'sc-i18n'`);
21
+ try {
22
+ return { messages: locales[_locale], locale: _locale };
23
+ }
24
+ catch (e) {
25
+ if (settings.messages) {
26
+ locales = localeData;
27
+ Logger.error(SCOPE_SC_CORE, `Configuration Locale.messages doesn't contains ${_locale}. Fallback to 'en' of 'sc-i18n'`);
28
+ }
29
+ return { messages: locales[LOCALE_EN], locale: DEFAULT_LANGUAGE_UI };
46
30
  }
47
-
48
- return {
49
- messages: locales[_Locale.LOCALE_EN],
50
- locale: _Locale.DEFAULT_LANGUAGE_UI
51
- };
52
- }
53
31
  }
54
-
55
- var _default = _reactIntl.createIntl;
56
- exports.default = _default;
32
+ export default createIntl;
33
+ //# sourceMappingURL=locale.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"locale.js","sourceRoot":"","sources":["../../../src/utils/locale.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,mBAAmB,EAAE,SAAS,EAAC,MAAM,qBAAqB,CAAC;AACnE,OAAO,UAAU,MAAM,2BAA2B,CAAC;AACnD,OAAO,EAAC,UAAU,EAAC,MAAM,YAAY,CAAC;AACtC,OAAO,EAAC,MAAM,EAAC,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAC,aAAa,EAAC,MAAM,qBAAqB,CAAC;AAElD;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,MAAM,EAAE,QAAQ;IAC7C,IAAI,OAAO,GAAG,MAAM,CAAC;IACrB,IAAI,OAAO,GAAG,QAAQ,CAAC,MAAM,IAAI,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC;IAClG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;QACrB,OAAO,GAAG,mBAAmB,CAAC;QAC9B,IAAI,QAAQ,CAAC,QAAQ,EAAE;YACrB,MAAM,CAAC,IAAI,CAAC,aAAa,EAAE,UAAU,OAAO,yDAAyD,CAAC,CAAC;SACxG;aAAM;YACL,MAAM,CAAC,IAAI,CAAC,aAAa,EAAE,UAAU,OAAO,kDAAkD,CAAC,CAAC;SACjG;KACF;IACD,IAAI;QACF,OAAO,EAAC,QAAQ,EAAE,OAAO,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,OAAO,EAAC,CAAC;KACtD;IAAC,OAAO,CAAC,EAAE;QACV,IAAI,QAAQ,CAAC,QAAQ,EAAE;YACrB,OAAO,GAAG,UAAU,CAAC;YACrB,MAAM,CAAC,KAAK,CAAC,aAAa,EAAE,kDAAkD,OAAO,iCAAiC,CAAC,CAAC;SACzH;QACD,OAAO,EAAC,QAAQ,EAAE,OAAO,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,mBAAmB,EAAC,CAAC;KACpE;AACH,CAAC;AAED,eAAe,UAAU,CAAC"}
@@ -0,0 +1,41 @@
1
+ import { SCUserType } from '@selfcommunity/types';
2
+ /**
3
+ * Staff Roles
4
+ * @type {string}
5
+ */
6
+ export declare const ADMIN_ROLE = "admin";
7
+ export declare const MODERATOR_ROLE = "moderator";
8
+ /**
9
+ * Get user role from roles(set)
10
+ * @param user
11
+ * @returns role or null
12
+ */
13
+ export declare function getUserRole(user: SCUserType): string | null;
14
+ /**
15
+ * Check if user is admin
16
+ * @param user
17
+ * @returns boolean
18
+ */
19
+ export declare function isAdmin(user: SCUserType): boolean;
20
+ /**
21
+ * Check if user is moderator
22
+ * @param user
23
+ * @returns boolean
24
+ */
25
+ export declare function isModerator(user: SCUserType): boolean;
26
+ /**
27
+ * Check if user is admin or moderator
28
+ * @param user
29
+ * @returns boolean
30
+ */
31
+ export declare function isStaff(user: SCUserType): boolean;
32
+ /**
33
+ * Check if user is blocked/banned
34
+ * User status values:
35
+ * a (approved), b (blocked), d (deleted; soft deleted),
36
+ * u (unregistered; hard deleted). Default: a.
37
+ * @param user
38
+ * @returns {*}
39
+ */
40
+ export declare function isBlocked(user: SCUserType): boolean;
41
+ //# sourceMappingURL=user.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../../src/utils/user.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,UAAU,EAAC,MAAM,sBAAsB,CAAC;AAE9D;;;GAGG;AACH,eAAO,MAAM,UAAU,UAAU,CAAC;AAClC,eAAO,MAAM,cAAc,cAAc,CAAC;AAE1C;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,GAAG,IAAI,CAU3D;AAED;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,UAAU,WAEvC;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,UAAU,WAE3C;AAED;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,UAAU,WAEvC;AAED;;;;;;;GAOG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,UAAU,WAEzC"}
@@ -1,72 +1,50 @@
1
- "use strict";
2
-
3
- exports.__esModule = true;
4
- exports.MODERATOR_ROLE = exports.ADMIN_ROLE = void 0;
5
- exports.getUserRole = getUserRole;
6
- exports.isAdmin = isAdmin;
7
- exports.isBlocked = isBlocked;
8
- exports.isModerator = isModerator;
9
- exports.isStaff = isStaff;
10
-
11
- var _types = require("@selfcommunity/types");
12
-
1
+ import { SCUserStatus } from '@selfcommunity/types';
13
2
  /**
14
3
  * Staff Roles
15
4
  * @type {string}
16
5
  */
17
- const ADMIN_ROLE = 'admin';
18
- exports.ADMIN_ROLE = ADMIN_ROLE;
19
- const MODERATOR_ROLE = 'moderator';
6
+ export const ADMIN_ROLE = 'admin';
7
+ export const MODERATOR_ROLE = 'moderator';
20
8
  /**
21
9
  * Get user role from roles(set)
22
10
  * @param user
23
11
  * @returns role or null
24
12
  */
25
-
26
- exports.MODERATOR_ROLE = MODERATOR_ROLE;
27
-
28
- function getUserRole(user) {
29
- if (user && user.role) {
30
- const role = user.role;
31
-
32
- if (role === ADMIN_ROLE) {
33
- return ADMIN_ROLE;
34
- } else if (role === MODERATOR_ROLE) {
35
- return MODERATOR_ROLE;
13
+ export function getUserRole(user) {
14
+ if (user && user.role) {
15
+ const role = user.role;
16
+ if (role === ADMIN_ROLE) {
17
+ return ADMIN_ROLE;
18
+ }
19
+ else if (role === MODERATOR_ROLE) {
20
+ return MODERATOR_ROLE;
21
+ }
36
22
  }
37
- }
38
-
39
- return null;
23
+ return null;
40
24
  }
41
25
  /**
42
26
  * Check if user is admin
43
27
  * @param user
44
28
  * @returns boolean
45
29
  */
46
-
47
-
48
- function isAdmin(user) {
49
- return getUserRole(user) === ADMIN_ROLE;
30
+ export function isAdmin(user) {
31
+ return getUserRole(user) === ADMIN_ROLE;
50
32
  }
51
33
  /**
52
34
  * Check if user is moderator
53
35
  * @param user
54
36
  * @returns boolean
55
37
  */
56
-
57
-
58
- function isModerator(user) {
59
- return getUserRole(user) === MODERATOR_ROLE;
38
+ export function isModerator(user) {
39
+ return getUserRole(user) === MODERATOR_ROLE;
60
40
  }
61
41
  /**
62
42
  * Check if user is admin or moderator
63
43
  * @param user
64
44
  * @returns boolean
65
45
  */
66
-
67
-
68
- function isStaff(user) {
69
- return isAdmin(user) || isModerator(user);
46
+ export function isStaff(user) {
47
+ return isAdmin(user) || isModerator(user);
70
48
  }
71
49
  /**
72
50
  * Check if user is blocked/banned
@@ -76,8 +54,7 @@ function isStaff(user) {
76
54
  * @param user
77
55
  * @returns {*}
78
56
  */
79
-
80
-
81
- function isBlocked(user) {
82
- return user && user.status && user.status === _types.SCUserStatus.BLOCKED;
83
- }
57
+ export function isBlocked(user) {
58
+ return user && user.status && user.status === SCUserStatus.BLOCKED;
59
+ }
60
+ //# sourceMappingURL=user.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"user.js","sourceRoot":"","sources":["../../../src/utils/user.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAa,MAAM,sBAAsB,CAAC;AAE9D;;;GAGG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,OAAO,CAAC;AAClC,MAAM,CAAC,MAAM,cAAc,GAAG,WAAW,CAAC;AAE1C;;;;GAIG;AACH,MAAM,UAAU,WAAW,CAAC,IAAgB;IAC1C,IAAI,IAAI,IAAI,IAAI,CAAC,IAAI,EAAE;QACrB,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QACvB,IAAI,IAAI,KAAK,UAAU,EAAE;YACvB,OAAO,UAAU,CAAC;SACnB;aAAM,IAAI,IAAI,KAAK,cAAc,EAAE;YAClC,OAAO,cAAc,CAAC;SACvB;KACF;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,OAAO,CAAC,IAAgB;IACtC,OAAO,WAAW,CAAC,IAAI,CAAC,KAAK,UAAU,CAAC;AAC1C,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,WAAW,CAAC,IAAgB;IAC1C,OAAO,WAAW,CAAC,IAAI,CAAC,KAAK,cAAc,CAAC;AAC9C,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,OAAO,CAAC,IAAgB;IACtC,OAAO,OAAO,CAAC,IAAI,CAAC,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC;AAC5C,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,SAAS,CAAC,IAAgB;IACxC,OAAO,IAAI,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,KAAK,YAAY,CAAC,OAAO,CAAC;AACrE,CAAC"}