@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.
- package/lib/{types → cjs}/components/provider/SCAlertMessagesProvider/index.d.ts +0 -0
- package/lib/{types → cjs}/components/provider/SCAlertMessagesProvider/index.d.ts.map +0 -0
- package/lib/cjs/components/provider/SCAlertMessagesProvider/index.js +37 -35
- package/lib/cjs/components/provider/SCAlertMessagesProvider/index.js.map +1 -0
- package/lib/{types → cjs}/components/provider/SCContextProvider/index.d.ts +0 -0
- package/lib/{types → cjs}/components/provider/SCContextProvider/index.d.ts.map +0 -0
- package/lib/cjs/components/provider/SCContextProvider/index.js +74 -81
- package/lib/cjs/components/provider/SCContextProvider/index.js.map +1 -0
- package/lib/{types → cjs}/components/provider/SCLocaleProvider/index.d.ts +0 -0
- package/lib/{types → cjs}/components/provider/SCLocaleProvider/index.d.ts.map +0 -0
- package/lib/cjs/components/provider/SCLocaleProvider/index.js +86 -121
- package/lib/cjs/components/provider/SCLocaleProvider/index.js.map +1 -0
- package/lib/{types → cjs}/components/provider/SCNotificationProvider/index.d.ts +0 -0
- package/lib/{types → cjs}/components/provider/SCNotificationProvider/index.d.ts.map +0 -0
- package/lib/cjs/components/provider/SCNotificationProvider/index.js +41 -41
- package/lib/cjs/components/provider/SCNotificationProvider/index.js.map +1 -0
- package/lib/{types → cjs}/components/provider/SCPreferencesProvider/index.d.ts +0 -0
- package/lib/{types → cjs}/components/provider/SCPreferencesProvider/index.d.ts.map +0 -0
- package/lib/cjs/components/provider/SCPreferencesProvider/index.js +61 -62
- package/lib/cjs/components/provider/SCPreferencesProvider/index.js.map +1 -0
- package/lib/{types → cjs}/components/provider/SCRoutingProvider/index.d.ts +0 -0
- package/lib/{types → cjs}/components/provider/SCRoutingProvider/index.d.ts.map +1 -1
- package/lib/cjs/components/provider/SCRoutingProvider/index.js +104 -111
- package/lib/cjs/components/provider/SCRoutingProvider/index.js.map +1 -0
- package/lib/{types → cjs}/components/provider/SCThemeProvider/index.d.ts +0 -0
- package/lib/{types → cjs}/components/provider/SCThemeProvider/index.d.ts.map +0 -0
- package/lib/cjs/components/provider/SCThemeProvider/index.js +66 -79
- package/lib/cjs/components/provider/SCThemeProvider/index.js.map +1 -0
- package/lib/{types → cjs}/components/provider/SCUserProvider/index.d.ts +0 -0
- package/lib/{types → cjs}/components/provider/SCUserProvider/index.d.ts.map +0 -0
- package/lib/cjs/components/provider/SCUserProvider/index.js +215 -270
- package/lib/cjs/components/provider/SCUserProvider/index.js.map +1 -0
- package/lib/{types → cjs}/components/router/index.d.ts +0 -0
- package/lib/{types → cjs}/components/router/index.d.ts.map +0 -0
- package/lib/cjs/components/router/index.js +48 -49
- package/lib/cjs/components/router/index.js.map +1 -0
- package/lib/{types → cjs}/constants/Actions.d.ts +0 -0
- package/lib/{types → cjs}/constants/Actions.d.ts.map +0 -0
- package/lib/cjs/constants/Actions.js +3 -4
- package/lib/cjs/constants/Actions.js.map +1 -0
- package/lib/{types → cjs}/constants/ContextProviders.d.ts +0 -0
- package/lib/{types → cjs}/constants/ContextProviders.d.ts.map +0 -0
- package/lib/cjs/constants/ContextProviders.js +22 -24
- package/lib/cjs/constants/ContextProviders.js.map +1 -0
- package/lib/{types → cjs}/constants/Device.d.ts +0 -0
- package/lib/{types → cjs}/constants/Device.d.ts.map +0 -0
- package/lib/cjs/constants/Device.js +3 -5
- package/lib/cjs/constants/Device.js.map +1 -0
- package/lib/{types → cjs}/constants/Errors.d.ts +0 -0
- package/lib/{types → cjs}/constants/Errors.d.ts.map +0 -0
- package/lib/cjs/constants/Errors.js +3 -5
- package/lib/cjs/constants/Errors.js.map +1 -0
- package/lib/{types → cjs}/constants/Features.d.ts +0 -0
- package/lib/{types → cjs}/constants/Features.d.ts.map +0 -0
- package/lib/cjs/constants/Features.js +43 -83
- package/lib/cjs/constants/Features.js.map +1 -0
- package/lib/{types → cjs}/constants/Locale.d.ts +0 -0
- package/lib/{types → cjs}/constants/Locale.d.ts.map +0 -0
- package/lib/cjs/constants/Locale.js +10 -17
- package/lib/cjs/constants/Locale.js.map +1 -0
- package/lib/{types → cjs}/constants/Notification.d.ts +0 -0
- package/lib/{types → cjs}/constants/Notification.d.ts.map +0 -0
- package/lib/cjs/constants/Notification.js +44 -53
- package/lib/cjs/constants/Notification.js.map +1 -0
- package/lib/{types → cjs}/constants/Notifications.d.ts +0 -0
- package/lib/{types → cjs}/constants/Notifications.d.ts.map +0 -0
- package/lib/cjs/constants/Notifications.js +11 -25
- package/lib/cjs/constants/Notifications.js.map +1 -0
- package/lib/cjs/constants/Preferences.d.ts +201 -0
- package/lib/cjs/constants/Preferences.d.ts.map +1 -0
- package/lib/cjs/constants/Preferences.js +184 -292
- package/lib/cjs/constants/Preferences.js.map +1 -0
- package/lib/{types → cjs}/constants/Routes.d.ts +0 -0
- package/lib/{types → cjs}/constants/Routes.d.ts.map +0 -0
- package/lib/cjs/constants/Routes.js +38 -59
- package/lib/cjs/constants/Routes.js.map +1 -0
- package/lib/{types → cjs}/constants/Session.d.ts +0 -0
- package/lib/{types → cjs}/constants/Session.d.ts.map +0 -0
- package/lib/cjs/constants/Session.js +12 -21
- package/lib/cjs/constants/Session.js.map +1 -0
- package/lib/{types → cjs}/constants/Theme.d.ts +0 -0
- package/lib/{types → cjs}/constants/Theme.d.ts.map +0 -0
- package/lib/cjs/constants/Theme.js +3 -4
- package/lib/cjs/constants/Theme.js.map +1 -0
- package/lib/cjs/constants/WebSocket.d.ts +4 -0
- package/lib/cjs/constants/WebSocket.d.ts.map +1 -0
- package/lib/cjs/constants/WebSocket.js +6 -9
- package/lib/cjs/constants/WebSocket.js.map +1 -0
- package/lib/{types → cjs}/hooks/useSCAuth.d.ts +0 -0
- package/lib/{types → cjs}/hooks/useSCAuth.d.ts.map +0 -0
- package/lib/cjs/hooks/useSCAuth.js +212 -282
- package/lib/cjs/hooks/useSCAuth.js.map +1 -0
- package/lib/{types → cjs}/hooks/useSCCachingManager.d.ts +0 -0
- package/lib/{types → cjs}/hooks/useSCCachingManager.d.ts.map +0 -0
- package/lib/cjs/hooks/useSCCachingManager.js +37 -51
- package/lib/cjs/hooks/useSCCachingManager.js.map +1 -0
- package/lib/{types → cjs}/hooks/useSCConnectionsManager.d.ts +0 -0
- package/lib/{types → cjs}/hooks/useSCConnectionsManager.d.ts.map +0 -0
- package/lib/cjs/hooks/useSCConnectionsManager.js +190 -254
- package/lib/cjs/hooks/useSCConnectionsManager.js.map +1 -0
- package/lib/{types → cjs}/hooks/useSCFetchAddressingTagList.d.ts +0 -0
- package/lib/{types → cjs}/hooks/useSCFetchAddressingTagList.d.ts.map +0 -0
- package/lib/cjs/hooks/useSCFetchAddressingTagList.js +64 -55
- package/lib/cjs/hooks/useSCFetchAddressingTagList.js.map +1 -0
- package/lib/{types → cjs}/hooks/useSCFetchCategories.d.ts +0 -0
- package/lib/{types → cjs}/hooks/useSCFetchCategories.d.ts.map +0 -0
- package/lib/cjs/hooks/useSCFetchCategories.js +46 -56
- package/lib/cjs/hooks/useSCFetchCategories.js.map +1 -0
- package/lib/{types → cjs}/hooks/useSCFetchCategory.d.ts +0 -0
- package/lib/{types → cjs}/hooks/useSCFetchCategory.d.ts.map +0 -0
- package/lib/cjs/hooks/useSCFetchCategory.js +44 -59
- package/lib/cjs/hooks/useSCFetchCategory.js.map +1 -0
- package/lib/{types → cjs}/hooks/useSCFetchCommentObject.d.ts +0 -0
- package/lib/{types → cjs}/hooks/useSCFetchCommentObject.d.ts.map +0 -0
- package/lib/cjs/hooks/useSCFetchCommentObject.js +44 -59
- package/lib/cjs/hooks/useSCFetchCommentObject.js.map +1 -0
- package/lib/{types → cjs}/hooks/useSCFetchCommentObjects.d.ts +0 -0
- package/lib/{types → cjs}/hooks/useSCFetchCommentObjects.d.ts.map +0 -0
- package/lib/cjs/hooks/useSCFetchCommentObjects.js +157 -254
- package/lib/cjs/hooks/useSCFetchCommentObjects.js.map +1 -0
- package/lib/{types → cjs}/hooks/useSCFetchCustomAdv.d.ts +0 -0
- package/lib/{types → cjs}/hooks/useSCFetchCustomAdv.d.ts.map +0 -0
- package/lib/cjs/hooks/useSCFetchCustomAdv.js +57 -75
- package/lib/cjs/hooks/useSCFetchCustomAdv.js.map +1 -0
- package/lib/{types → cjs}/hooks/useSCFetchFeedObject.d.ts +0 -0
- package/lib/{types → cjs}/hooks/useSCFetchFeedObject.d.ts.map +0 -0
- package/lib/cjs/hooks/useSCFetchFeedObject.js +49 -69
- package/lib/cjs/hooks/useSCFetchFeedObject.js.map +1 -0
- package/lib/{types → cjs}/hooks/useSCFetchIncubator.d.ts +0 -0
- package/lib/{types → cjs}/hooks/useSCFetchIncubator.d.ts.map +0 -0
- package/lib/cjs/hooks/useSCFetchIncubator.js +44 -59
- package/lib/cjs/hooks/useSCFetchIncubator.js.map +1 -0
- package/lib/{types → cjs}/hooks/useSCFetchTag.d.ts +0 -0
- package/lib/{types → cjs}/hooks/useSCFetchTag.d.ts.map +0 -0
- package/lib/cjs/hooks/useSCFetchTag.js +44 -59
- package/lib/cjs/hooks/useSCFetchTag.js.map +1 -0
- package/lib/{types → cjs}/hooks/useSCFetchUser.d.ts +0 -0
- package/lib/{types → cjs}/hooks/useSCFetchUser.d.ts.map +1 -1
- package/lib/cjs/hooks/useSCFetchUser.js +47 -59
- package/lib/cjs/hooks/useSCFetchUser.js.map +1 -0
- package/lib/{types → cjs}/hooks/useSCFollowedCategoriesManager.d.ts +0 -0
- package/lib/{types → cjs}/hooks/useSCFollowedCategoriesManager.d.ts.map +0 -0
- package/lib/cjs/hooks/useSCFollowedCategoriesManager.js +105 -147
- package/lib/cjs/hooks/useSCFollowedCategoriesManager.js.map +1 -0
- package/lib/{types → cjs}/hooks/useSCFollowersManager.d.ts +0 -0
- package/lib/{types → cjs}/hooks/useSCFollowersManager.d.ts.map +0 -0
- package/lib/cjs/hooks/useSCFollowersManager.js +154 -204
- package/lib/cjs/hooks/useSCFollowersManager.js.map +1 -0
- package/lib/{types → cjs}/hooks/useSCMediaClick.d.ts +0 -0
- package/lib/{types → cjs}/hooks/useSCMediaClick.d.ts.map +0 -0
- package/lib/cjs/hooks/useSCMediaClick.js +18 -25
- package/lib/cjs/hooks/useSCMediaClick.js.map +1 -0
- package/lib/{types → cjs}/hooks/useSCSubscribedIncubatorsManager.d.ts +0 -0
- package/lib/{types → cjs}/hooks/useSCSubscribedIncubatorsManager.d.ts.map +0 -0
- package/lib/cjs/hooks/useSCSubscribedIncubatorsManager.js +118 -148
- package/lib/cjs/hooks/useSCSubscribedIncubatorsManager.js.map +1 -0
- package/lib/{types → cjs}/hooks/useSCWebPushMessaging.d.ts +0 -0
- package/lib/{types → cjs}/hooks/useSCWebPushMessaging.d.ts.map +0 -0
- package/lib/cjs/hooks/useSCWebPushMessaging.js +268 -268
- package/lib/cjs/hooks/useSCWebPushMessaging.js.map +1 -0
- package/lib/{types → cjs}/hooks/useSCWebSocket.d.ts +0 -0
- package/lib/{types → cjs}/hooks/useSCWebSocket.d.ts.map +0 -0
- package/lib/cjs/hooks/useSCWebSocket.js +103 -125
- package/lib/cjs/hooks/useSCWebSocket.js.map +1 -0
- package/lib/{types → cjs}/index.d.ts +0 -0
- package/lib/{types → cjs}/index.d.ts.map +0 -0
- package/lib/cjs/index.js +131 -144
- package/lib/cjs/index.js.map +1 -0
- package/lib/cjs/themes/theme.d.ts +9 -0
- package/lib/cjs/themes/theme.d.ts.map +1 -0
- package/lib/cjs/themes/theme.js +132 -143
- package/lib/cjs/themes/theme.js.map +1 -0
- package/lib/{types → cjs}/types/context.d.ts +0 -0
- package/lib/{types → cjs}/types/context.d.ts.map +0 -0
- package/lib/cjs/types/context.js +2 -2
- package/lib/cjs/types/context.js.map +1 -0
- package/lib/{types → cjs}/types/index.d.ts +0 -0
- package/lib/{types → cjs}/types/index.d.ts.map +0 -0
- package/lib/cjs/types/index.js +2 -21
- package/lib/cjs/types/index.js.map +1 -0
- package/lib/{types → cjs}/utils/errors.d.ts +0 -0
- package/lib/{types → cjs}/utils/errors.d.ts.map +0 -0
- package/lib/cjs/utils/errors.js +138 -149
- package/lib/cjs/utils/errors.js.map +1 -0
- package/lib/{types → cjs}/utils/locale.d.ts +0 -0
- package/lib/{types → cjs}/utils/locale.d.ts.map +0 -0
- package/lib/cjs/utils/locale.js +32 -48
- package/lib/cjs/utils/locale.js.map +1 -0
- package/lib/{types → cjs}/utils/user.d.ts +0 -0
- package/lib/{types → cjs}/utils/user.d.ts.map +0 -0
- package/lib/cjs/utils/user.js +25 -40
- package/lib/cjs/utils/user.js.map +1 -0
- package/lib/{types → cjs}/utils/validator.d.ts +0 -0
- package/lib/{types → cjs}/utils/validator.d.ts.map +0 -0
- package/lib/cjs/utils/validator.js +386 -576
- package/lib/cjs/utils/validator.js.map +1 -0
- package/lib/esm/components/provider/SCAlertMessagesProvider/index.d.ts +37 -0
- package/lib/esm/components/provider/SCAlertMessagesProvider/index.d.ts.map +1 -0
- package/lib/esm/components/provider/SCAlertMessagesProvider/index.js +11 -37
- package/lib/esm/components/provider/SCAlertMessagesProvider/index.js.map +1 -0
- package/lib/esm/components/provider/SCContextProvider/index.d.ts +35 -0
- package/lib/esm/components/provider/SCContextProvider/index.d.ts.map +1 -0
- package/lib/esm/components/provider/SCContextProvider/index.js +48 -83
- package/lib/esm/components/provider/SCContextProvider/index.js.map +1 -0
- package/lib/esm/components/provider/SCLocaleProvider/index.d.ts +42 -0
- package/lib/esm/components/provider/SCLocaleProvider/index.d.ts.map +1 -0
- package/lib/esm/components/provider/SCLocaleProvider/index.js +59 -123
- package/lib/esm/components/provider/SCLocaleProvider/index.js.map +1 -0
- package/lib/esm/components/provider/SCNotificationProvider/index.d.ts +37 -0
- package/lib/esm/components/provider/SCNotificationProvider/index.d.ts.map +1 -0
- package/lib/esm/components/provider/SCNotificationProvider/index.js +12 -43
- package/lib/esm/components/provider/SCNotificationProvider/index.js.map +1 -0
- package/lib/esm/components/provider/SCPreferencesProvider/index.d.ts +38 -0
- package/lib/esm/components/provider/SCPreferencesProvider/index.d.ts.map +1 -0
- package/lib/esm/components/provider/SCPreferencesProvider/index.js +35 -64
- package/lib/esm/components/provider/SCPreferencesProvider/index.js.map +1 -0
- package/lib/esm/components/provider/SCRoutingProvider/index.d.ts +39 -0
- package/lib/esm/components/provider/SCRoutingProvider/index.d.ts.map +1 -0
- package/lib/esm/components/provider/SCRoutingProvider/index.js +78 -113
- package/lib/esm/components/provider/SCRoutingProvider/index.js.map +1 -0
- package/lib/esm/components/provider/SCThemeProvider/index.d.ts +49 -0
- package/lib/esm/components/provider/SCThemeProvider/index.d.ts.map +1 -0
- package/lib/esm/components/provider/SCThemeProvider/index.js +36 -81
- package/lib/esm/components/provider/SCThemeProvider/index.js.map +1 -0
- package/lib/esm/components/provider/SCUserProvider/index.d.ts +38 -0
- package/lib/esm/components/provider/SCUserProvider/index.d.ts.map +1 -0
- package/lib/esm/components/provider/SCUserProvider/index.js +186 -272
- package/lib/esm/components/provider/SCUserProvider/index.js.map +1 -0
- package/lib/esm/components/router/index.d.ts +34 -0
- package/lib/esm/components/router/index.d.ts.map +1 -0
- package/lib/esm/components/router/index.js +24 -50
- package/lib/esm/components/router/index.js.map +1 -0
- package/lib/esm/constants/Actions.d.ts +2 -0
- package/lib/esm/constants/Actions.d.ts.map +1 -0
- package/lib/esm/constants/Actions.js +2 -6
- package/lib/esm/constants/Actions.js.map +1 -0
- package/lib/esm/constants/ContextProviders.d.ts +6 -0
- package/lib/esm/constants/ContextProviders.d.ts.map +1 -0
- package/lib/esm/constants/ContextProviders.js +18 -26
- package/lib/esm/constants/ContextProviders.js.map +1 -0
- package/lib/esm/constants/Device.d.ts +6 -0
- package/lib/esm/constants/Device.d.ts.map +1 -0
- package/lib/esm/constants/Device.js +2 -7
- package/lib/esm/constants/Device.js.map +1 -0
- package/lib/esm/constants/Errors.d.ts +5 -0
- package/lib/esm/constants/Errors.d.ts.map +1 -0
- package/lib/esm/constants/Errors.js +2 -7
- package/lib/esm/constants/Errors.js.map +1 -0
- package/lib/esm/constants/Features.d.ts +41 -0
- package/lib/esm/constants/Features.d.ts.map +1 -0
- package/lib/esm/constants/Features.js +41 -84
- package/lib/esm/constants/Features.js.map +1 -0
- package/lib/esm/constants/Locale.d.ts +8 -0
- package/lib/esm/constants/Locale.d.ts.map +1 -0
- package/lib/esm/constants/Locale.js +8 -18
- package/lib/esm/constants/Locale.js.map +1 -0
- package/lib/esm/constants/Notification.d.ts +55 -0
- package/lib/esm/constants/Notification.d.ts.map +1 -0
- package/lib/esm/constants/Notification.js +42 -54
- package/lib/esm/constants/Notification.js.map +1 -0
- package/lib/esm/constants/Notifications.d.ts +11 -0
- package/lib/esm/constants/Notifications.d.ts.map +1 -0
- package/lib/esm/constants/Notifications.js +9 -26
- package/lib/esm/constants/Notifications.js.map +1 -0
- package/lib/esm/constants/Preferences.d.ts +201 -0
- package/lib/esm/constants/Preferences.d.ts.map +1 -0
- package/lib/esm/constants/Preferences.js +181 -296
- package/lib/esm/constants/Preferences.js.map +1 -0
- package/lib/esm/constants/Routes.d.ts +29 -0
- package/lib/esm/constants/Routes.d.ts.map +1 -0
- package/lib/esm/constants/Routes.js +36 -60
- package/lib/esm/constants/Routes.js.map +1 -0
- package/lib/esm/constants/Session.d.ts +10 -0
- package/lib/esm/constants/Session.d.ts.map +1 -0
- package/lib/esm/constants/Session.js +10 -22
- package/lib/esm/constants/Session.js.map +1 -0
- package/lib/esm/constants/Theme.d.ts +2 -0
- package/lib/esm/constants/Theme.d.ts.map +1 -0
- package/lib/esm/constants/Theme.js +2 -6
- package/lib/esm/constants/Theme.js.map +1 -0
- package/lib/esm/constants/WebSocket.d.ts +4 -0
- package/lib/esm/constants/WebSocket.d.ts.map +1 -0
- package/lib/esm/constants/WebSocket.js +4 -10
- package/lib/esm/constants/WebSocket.js.map +1 -0
- package/lib/esm/hooks/useSCAuth.d.ts +56 -0
- package/lib/esm/hooks/useSCAuth.d.ts.map +1 -0
- package/lib/esm/hooks/useSCAuth.js +185 -285
- package/lib/esm/hooks/useSCAuth.js.map +1 -0
- package/lib/esm/hooks/useSCCachingManager.d.ts +19 -0
- package/lib/esm/hooks/useSCCachingManager.d.ts.map +1 -0
- package/lib/esm/hooks/useSCCachingManager.js +36 -53
- package/lib/esm/hooks/useSCCachingManager.js.map +1 -0
- package/lib/esm/hooks/useSCConnectionsManager.d.ts +40 -0
- package/lib/esm/hooks/useSCConnectionsManager.d.ts.map +1 -0
- package/lib/esm/hooks/useSCConnectionsManager.js +186 -256
- package/lib/esm/hooks/useSCConnectionsManager.js.map +1 -0
- package/lib/esm/hooks/useSCFetchAddressingTagList.d.ts +14 -0
- package/lib/esm/hooks/useSCFetchAddressingTagList.d.ts.map +1 -0
- package/lib/esm/hooks/useSCFetchAddressingTagList.js +39 -56
- package/lib/esm/hooks/useSCFetchAddressingTagList.js.map +1 -0
- package/lib/esm/hooks/useSCFetchCategories.d.ts +17 -0
- package/lib/esm/hooks/useSCFetchCategories.d.ts.map +1 -0
- package/lib/esm/hooks/useSCFetchCategories.js +45 -57
- package/lib/esm/hooks/useSCFetchCategories.js.map +1 -0
- package/lib/esm/hooks/useSCFetchCategory.d.ts +19 -0
- package/lib/esm/hooks/useSCFetchCategory.d.ts.map +1 -0
- package/lib/esm/hooks/useSCFetchCategory.js +42 -60
- package/lib/esm/hooks/useSCFetchCategory.js.map +1 -0
- package/lib/esm/hooks/useSCFetchCommentObject.d.ts +19 -0
- package/lib/esm/hooks/useSCFetchCommentObject.d.ts.map +1 -0
- package/lib/esm/hooks/useSCFetchCommentObject.js +42 -60
- package/lib/esm/hooks/useSCFetchCommentObject.js.map +1 -0
- package/lib/esm/hooks/useSCFetchCommentObjects.d.ts +53 -0
- package/lib/esm/hooks/useSCFetchCommentObjects.d.ts.map +1 -0
- package/lib/esm/hooks/useSCFetchCommentObjects.js +153 -257
- package/lib/esm/hooks/useSCFetchCommentObjects.js.map +1 -0
- package/lib/esm/hooks/useSCFetchCustomAdv.d.ts +19 -0
- package/lib/esm/hooks/useSCFetchCustomAdv.d.ts.map +1 -0
- package/lib/esm/hooks/useSCFetchCustomAdv.js +55 -76
- package/lib/esm/hooks/useSCFetchCustomAdv.js.map +1 -0
- package/lib/esm/hooks/useSCFetchFeedObject.d.ts +21 -0
- package/lib/esm/hooks/useSCFetchFeedObject.d.ts.map +1 -0
- package/lib/esm/hooks/useSCFetchFeedObject.js +47 -70
- package/lib/esm/hooks/useSCFetchFeedObject.js.map +1 -0
- package/lib/esm/hooks/useSCFetchIncubator.d.ts +19 -0
- package/lib/esm/hooks/useSCFetchIncubator.d.ts.map +1 -0
- package/lib/esm/hooks/useSCFetchIncubator.js +42 -60
- package/lib/esm/hooks/useSCFetchIncubator.js.map +1 -0
- package/lib/esm/hooks/useSCFetchTag.d.ts +19 -0
- package/lib/esm/hooks/useSCFetchTag.d.ts.map +1 -0
- package/lib/esm/hooks/useSCFetchTag.js +42 -60
- package/lib/esm/hooks/useSCFetchTag.js.map +1 -0
- package/lib/esm/hooks/useSCFetchUser.d.ts +19 -0
- package/lib/esm/hooks/useSCFetchUser.d.ts.map +1 -0
- package/lib/esm/hooks/useSCFetchUser.js +45 -60
- package/lib/esm/hooks/useSCFetchUser.js.map +1 -0
- package/lib/esm/hooks/useSCFollowedCategoriesManager.d.ts +37 -0
- package/lib/esm/hooks/useSCFollowedCategoriesManager.d.ts.map +1 -0
- package/lib/esm/hooks/useSCFollowedCategoriesManager.js +101 -149
- package/lib/esm/hooks/useSCFollowedCategoriesManager.js.map +1 -0
- package/lib/esm/hooks/useSCFollowersManager.d.ts +37 -0
- package/lib/esm/hooks/useSCFollowersManager.d.ts.map +1 -0
- package/lib/esm/hooks/useSCFollowersManager.js +150 -206
- package/lib/esm/hooks/useSCFollowersManager.js.map +1 -0
- package/lib/esm/hooks/useSCMediaClick.d.ts +4 -0
- package/lib/esm/hooks/useSCMediaClick.d.ts.map +1 -0
- package/lib/esm/hooks/useSCMediaClick.js +17 -27
- package/lib/esm/hooks/useSCMediaClick.js.map +1 -0
- package/lib/esm/hooks/useSCSubscribedIncubatorsManager.d.ts +27 -0
- package/lib/esm/hooks/useSCSubscribedIncubatorsManager.d.ts.map +1 -0
- package/lib/esm/hooks/useSCSubscribedIncubatorsManager.js +114 -150
- package/lib/esm/hooks/useSCSubscribedIncubatorsManager.js.map +1 -0
- package/lib/esm/hooks/useSCWebPushMessaging.d.ts +9 -0
- package/lib/esm/hooks/useSCWebPushMessaging.d.ts.map +1 -0
- package/lib/esm/hooks/useSCWebPushMessaging.js +244 -270
- package/lib/esm/hooks/useSCWebPushMessaging.js.map +1 -0
- package/lib/esm/hooks/useSCWebSocket.d.ts +12 -0
- package/lib/esm/hooks/useSCWebSocket.d.ts.map +1 -0
- package/lib/esm/hooks/useSCWebSocket.js +99 -127
- package/lib/esm/hooks/useSCWebSocket.js.map +1 -0
- package/lib/esm/index.d.ts +73 -0
- package/lib/esm/index.d.ts.map +1 -0
- package/lib/esm/index.js +69 -151
- package/lib/esm/index.js.map +1 -0
- package/lib/esm/themes/theme.d.ts +9 -0
- package/lib/esm/themes/theme.d.ts.map +1 -0
- package/lib/esm/themes/theme.js +128 -144
- package/lib/esm/themes/theme.js.map +1 -0
- package/lib/esm/types/context.d.ts +428 -0
- package/lib/esm/types/context.d.ts.map +1 -0
- package/lib/esm/types/context.js +2 -3
- package/lib/esm/types/context.js.map +1 -0
- package/lib/esm/types/index.d.ts +3 -0
- package/lib/esm/types/index.d.ts.map +1 -0
- package/lib/esm/types/index.js +2 -22
- package/lib/esm/types/index.js.map +1 -0
- package/lib/esm/utils/errors.d.ts +98 -0
- package/lib/esm/utils/errors.d.ts.map +1 -0
- package/lib/esm/utils/errors.js +114 -155
- package/lib/esm/utils/errors.js.map +1 -0
- package/lib/esm/utils/locale.d.ts +10 -0
- package/lib/esm/utils/locale.d.ts.map +1 -0
- package/lib/esm/utils/locale.js +27 -50
- package/lib/esm/utils/locale.js.map +1 -0
- package/lib/esm/utils/user.d.ts +41 -0
- package/lib/esm/utils/user.d.ts.map +1 -0
- package/lib/esm/utils/user.js +23 -46
- package/lib/esm/utils/user.js.map +1 -0
- package/lib/esm/utils/validator.d.ts +239 -0
- package/lib/esm/utils/validator.d.ts.map +1 -0
- package/lib/esm/utils/validator.js +352 -588
- package/lib/esm/utils/validator.js.map +1 -0
- package/lib/umd/react-core.js +1 -1
- package/package.json +9 -11
- package/lib/types/tsconfig.build.tsbuildinfo +0 -1
package/lib/cjs/utils/errors.js
CHANGED
|
@@ -1,40 +1,46 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.isFunc = exports.ValidationResult = exports.ValidationWarnings = exports.ValidationError = void 0;
|
|
27
|
+
const Locale_1 = require("../constants/Locale");
|
|
28
|
+
const Session = __importStar(require("../constants/Session"));
|
|
29
|
+
const utils_1 = require("@selfcommunity/utils");
|
|
17
30
|
/**
|
|
18
31
|
* Manage Validation Error
|
|
19
32
|
* Used to check the initial configurations
|
|
20
33
|
*/
|
|
21
34
|
class ValidationError {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
35
|
+
constructor(errorCode, errorData, errorMessage = ValidationError.defaultErrorMessageMap[errorCode]) {
|
|
36
|
+
this.errorCode = null;
|
|
37
|
+
this.errorData = null;
|
|
38
|
+
this.errorMessage = null;
|
|
39
|
+
this.errorCode = errorCode;
|
|
40
|
+
this.errorData = errorData;
|
|
41
|
+
this.errorMessage = errorMessage;
|
|
42
|
+
}
|
|
31
43
|
}
|
|
32
|
-
/**
|
|
33
|
-
* Manage Validation Warnings
|
|
34
|
-
* Used to check the initial configurations
|
|
35
|
-
*/
|
|
36
|
-
|
|
37
|
-
|
|
38
44
|
exports.ValidationError = ValidationError;
|
|
39
45
|
ValidationError.ERROR_INVALID_CONF = 3100;
|
|
40
46
|
ValidationError.ERROR_INVALID_SESSION = 4100;
|
|
@@ -56,141 +62,124 @@ ValidationError.ERROR_INVALID_NOTIFICATIONS_WEB_PUSH_MESSAGING = 4921;
|
|
|
56
62
|
ValidationError.ERROR_INVALID_NOTIFICATIONS_WEB_PUSH_MESSAGING_DISABLE_TOAST_MESSAGE = 4922;
|
|
57
63
|
ValidationError.ERROR_INVALID_NOTIFICATIONS_WEB_PUSH_MESSAGING_APPLICATION_SERVER_KEY = 4923;
|
|
58
64
|
ValidationError.defaultErrorMessageMap = {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
65
|
+
[ValidationError.ERROR_INVALID_CONF]: 'Invalid or missing library configuration. Check the configuration that is passed to the SCContextProvider.',
|
|
66
|
+
[ValidationError.ERROR_INVALID_SESSION]: 'Invalid session format.',
|
|
67
|
+
[ValidationError.ERROR_INVALID_SESSION_TYPE]: `Invalid sessionType. Available options are ${Session.sessionTypes.join(', ')}.`,
|
|
68
|
+
[ValidationError.ERROR_INVALID_SESSION_AUTH_TOKEN]: 'Invalid auth token format',
|
|
69
|
+
[ValidationError.ERROR_INVALID_SESSION_CLIENT_ID]: 'Invalid clientId in the initial configuration.',
|
|
70
|
+
[ValidationError.ERROR_INVALID_SESSION_REFRESH_TOKEN_CALLBACK]: 'Invalid refresh token callback',
|
|
71
|
+
[ValidationError.ERROR_INVALID_PORTAL]: `Invalid portal. Check if the url format is valid.`,
|
|
72
|
+
[ValidationError.ERROR_INVALID_LOCALE]: `Invalid locale. Available options are ${Locale_1.LOCALES.join(', ')}.`,
|
|
73
|
+
[ValidationError.ERROR_INVALID_TRANSLATIONS]: `Invalid locale messages(translations) options.`,
|
|
74
|
+
[ValidationError.ERROR_INVALID_THEME]: 'Invalid theme options.',
|
|
75
|
+
[ValidationError.ERROR_INVALID_ROUTER]: 'Invalid router configuration',
|
|
76
|
+
[ValidationError.ERROR_INVALID_PROVIDERS]: `Invalid providers. Check if the list of providers is valid.`,
|
|
77
|
+
[ValidationError.ERROR_INVALID_HANDLE_ANONYMOUS_ACTION]: 'Invalid handle anonymous action callback',
|
|
78
|
+
[ValidationError.ERROR_INVALID_NOTIFICATIONS]: 'Invalid notifications conf.',
|
|
79
|
+
[ValidationError.ERROR_INVALID_NOTIFICATIONS_WEBSOCKET]: 'Invalid notifications (websocket) option.',
|
|
80
|
+
[ValidationError.ERROR_INVALID_NOTIFICATIONS_WEBSOCKET_DISABLE_TOAST_MESSAGE]: 'Invalid notifications websocket conf: disableToastMessage must be a boolean value.',
|
|
81
|
+
[ValidationError.ERROR_INVALID_NOTIFICATIONS_WEB_PUSH_MESSAGING]: 'Invalid notifications (web push messaging) option.',
|
|
82
|
+
[ValidationError.ERROR_INVALID_NOTIFICATIONS_WEB_PUSH_MESSAGING_DISABLE_TOAST_MESSAGE]: "Invalid notifications web push messaging option. 'disableToastMessage' must be a boolean value.",
|
|
83
|
+
[ValidationError.ERROR_INVALID_NOTIFICATIONS_WEB_PUSH_MESSAGING_APPLICATION_SERVER_KEY]: "Invalid notifications web push messaging option. 'applicationServerKey' must be a string value.",
|
|
78
84
|
};
|
|
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
85
|
/**
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
* of the initial configuration
|
|
86
|
+
* Manage Validation Warnings
|
|
87
|
+
* Used to check the initial configurations
|
|
95
88
|
*/
|
|
96
|
-
|
|
97
|
-
|
|
89
|
+
class ValidationWarnings {
|
|
90
|
+
constructor(warningCode, warningData, warningMessage = ValidationWarnings.defaultErrorMessageMap[warningCode]) {
|
|
91
|
+
this.warningCode = null;
|
|
92
|
+
this.warningData = null;
|
|
93
|
+
this.warningMessage = null;
|
|
94
|
+
this.warningCode = warningCode;
|
|
95
|
+
this.warningData = warningData;
|
|
96
|
+
this.warningMessage = warningMessage;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
98
99
|
exports.ValidationWarnings = ValidationWarnings;
|
|
99
100
|
ValidationWarnings.WARNING_SESSION_REFRESH_TOKEN_CALLBACK_NOT_FOUND = 3100;
|
|
100
101
|
ValidationWarnings.WARNING_LOCALE_FALLBACK = 3300;
|
|
101
102
|
ValidationWarnings.WARNING_ROUTER_FALLBACK = 3500;
|
|
102
103
|
ValidationWarnings.WARNING_HANDLE_ANONYMOUS_ACTION_FALLBACK = 3700;
|
|
103
104
|
ValidationWarnings.defaultErrorMessageMap = {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
105
|
+
[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.",
|
|
106
|
+
[ValidationWarnings.WARNING_LOCALE_FALLBACK]: `The 'locale' is not defined in initial conf, fallback to the default ${Locale_1.DEFAULT_LANGUAGE_UI}.`,
|
|
107
|
+
[ValidationWarnings.WARNING_ROUTER_FALLBACK]: "The 'router' is not defined in initial conf, fallback to the default configurations.",
|
|
108
|
+
[ValidationWarnings.WARNING_HANDLE_ANONYMOUS_ACTION_FALLBACK]: "The 'handleAnonymousAction' is not defined in initial conf, fallback to the default configurations.",
|
|
108
109
|
};
|
|
109
|
-
|
|
110
|
+
/**
|
|
111
|
+
* /**
|
|
112
|
+
* Manage Validation Error/Warnings
|
|
113
|
+
* of the initial configuration
|
|
114
|
+
*/
|
|
110
115
|
class ValidationResult {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
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));
|
|
116
|
+
constructor(scope = '[Report Error]') {
|
|
117
|
+
this.errors = [];
|
|
118
|
+
this.warnings = [];
|
|
119
|
+
this.scope = '';
|
|
120
|
+
this.scope = scope;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Add an error
|
|
124
|
+
* @param errorCode
|
|
125
|
+
* @param errorData
|
|
126
|
+
*/
|
|
127
|
+
addError(errorCode, errorData) {
|
|
128
|
+
this.errors.push(new ValidationError(errorCode, errorData));
|
|
129
|
+
return this.errors;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Add a warning
|
|
133
|
+
* @param errorCode
|
|
134
|
+
* @param errorData
|
|
135
|
+
*/
|
|
136
|
+
addWarnings(warningCode, warningData) {
|
|
137
|
+
this.warnings.push(new ValidationWarnings(warningCode, warningData));
|
|
138
|
+
return this.errors;
|
|
163
139
|
}
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
140
|
+
/**
|
|
141
|
+
* Check if contains errors
|
|
142
|
+
*/
|
|
143
|
+
hasErrors() {
|
|
144
|
+
return this.errors.length > 0;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Check if contains warnings
|
|
148
|
+
*/
|
|
149
|
+
hasWarnings() {
|
|
150
|
+
return this.warnings.length > 0;
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Emit in console all the errors
|
|
154
|
+
*/
|
|
155
|
+
emitErrors() {
|
|
156
|
+
if (this.hasErrors()) {
|
|
157
|
+
this.errors.map((e) => utils_1.Logger.error(this.scope, e.errorMessage));
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Emit in console all the warnings
|
|
162
|
+
*/
|
|
163
|
+
emitWarnings() {
|
|
164
|
+
if (this.hasWarnings()) {
|
|
165
|
+
this.warnings.map((w) => utils_1.Logger.warn(this.scope, w.warningMessage));
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Emit in console errors/warnings
|
|
170
|
+
*/
|
|
171
|
+
emit() {
|
|
172
|
+
this.emitErrors();
|
|
173
|
+
this.emitWarnings();
|
|
173
174
|
}
|
|
174
|
-
}
|
|
175
|
-
/**
|
|
176
|
-
* Emit in console errors/warnings
|
|
177
|
-
*/
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
emit() {
|
|
181
|
-
this.emitErrors();
|
|
182
|
-
this.emitWarnings();
|
|
183
|
-
}
|
|
184
|
-
|
|
185
175
|
}
|
|
176
|
+
exports.ValidationResult = ValidationResult;
|
|
186
177
|
/**
|
|
187
178
|
* Check if v is a func
|
|
188
179
|
* @param v
|
|
189
180
|
*/
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
exports.ValidationResult = ValidationResult;
|
|
193
|
-
|
|
194
181
|
function isFunc(v) {
|
|
195
|
-
|
|
196
|
-
}
|
|
182
|
+
return typeof v === 'function';
|
|
183
|
+
}
|
|
184
|
+
exports.isFunc = isFunc;
|
|
185
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../src/utils/errors.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAAiE;AACjE,8DAAgD;AAChD,gDAA4C;AAE5C;;;GAGG;AACH,MAAa,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;QACjB,iBAAY,GAAG,IAAI,CAAC;QAGlB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;IACnC,CAAC;;AAtDH,0CAuDC;AAtDQ,kCAAkB,GAAG,IAAI,CAAC;AAC1B,qCAAqB,GAAG,IAAI,CAAC;AAC7B,0CAA0B,GAAG,IAAI,CAAC;AAClC,gDAAgC,GAAG,IAAI,CAAC;AACxC,+CAA+B,GAAG,IAAI,CAAC;AACvC,4DAA4C,GAAG,IAAI,CAAC;AACpD,oCAAoB,GAAG,IAAI,CAAC;AAC5B,oCAAoB,GAAG,IAAI,CAAC;AAC5B,0CAA0B,GAAG,IAAI,CAAC;AAClC,mCAAmB,GAAG,IAAI,CAAC;AAC3B,oCAAoB,GAAG,IAAI,CAAC;AAC5B,uCAAuB,GAAG,IAAI,CAAC;AAC/B,qDAAqC,GAAG,IAAI,CAAC;AAC7C,2CAA2B,GAAG,IAAI,CAAC;AACnC,qDAAqC,GAAG,IAAI,CAAC;AAC7C,2EAA2D,GAAG,IAAI,CAAC;AACnE,8DAA8C,G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7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
|
-
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.loadLocaleData = void 0;
|
|
7
|
+
const Locale_1 = require("../constants/Locale");
|
|
8
|
+
const react_i18n_1 = __importDefault(require("@selfcommunity/react-i18n"));
|
|
9
|
+
const react_intl_1 = require("react-intl");
|
|
10
|
+
const utils_1 = require("@selfcommunity/utils");
|
|
11
|
+
const Errors_1 = require("../constants/Errors");
|
|
19
12
|
/**
|
|
20
13
|
* Load Locale Data
|
|
21
14
|
*/
|
|
22
15
|
function loadLocaleData(locale, settings) {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
16
|
+
let _locale = locale;
|
|
17
|
+
let locales = settings.locale && settings.locale.messages ? settings.locale.messages : react_i18n_1.default;
|
|
18
|
+
if (!locales[_locale]) {
|
|
19
|
+
_locale = Locale_1.DEFAULT_LANGUAGE_UI;
|
|
20
|
+
if (settings.messages) {
|
|
21
|
+
utils_1.Logger.warn(Errors_1.SCOPE_SC_CORE, `Locale ${_locale} not found in messages configuration. Fallback to 'en'.`);
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
utils_1.Logger.warn(Errors_1.SCOPE_SC_CORE, `Locale ${_locale} not found in sc-i18n package. Fallback to 'en'.`);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
try {
|
|
28
|
+
return { messages: locales[_locale], locale: _locale };
|
|
33
29
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
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'`);
|
|
30
|
+
catch (e) {
|
|
31
|
+
if (settings.messages) {
|
|
32
|
+
locales = react_i18n_1.default;
|
|
33
|
+
utils_1.Logger.error(Errors_1.SCOPE_SC_CORE, `Configuration Locale.messages doesn't contains ${_locale}. Fallback to 'en' of 'sc-i18n'`);
|
|
34
|
+
}
|
|
35
|
+
return { messages: locales[Locale_1.LOCALE_EN], locale: Locale_1.DEFAULT_LANGUAGE_UI };
|
|
46
36
|
}
|
|
47
|
-
|
|
48
|
-
return {
|
|
49
|
-
messages: locales[_Locale.LOCALE_EN],
|
|
50
|
-
locale: _Locale.DEFAULT_LANGUAGE_UI
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
37
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
38
|
+
exports.loadLocaleData = loadLocaleData;
|
|
39
|
+
exports.default = react_intl_1.createIntl;
|
|
40
|
+
//# sourceMappingURL=locale.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"locale.js","sourceRoot":"","sources":["../../../src/utils/locale.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAmE;AACnE,2EAAmD;AACnD,2CAAsC;AACtC,gDAA4C;AAC5C,gDAAkD;AAElD;;GAEG;AACH,SAAgB,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,oBAAU,CAAC;IAClG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;QACrB,OAAO,GAAG,4BAAmB,CAAC;QAC9B,IAAI,QAAQ,CAAC,QAAQ,EAAE;YACrB,cAAM,CAAC,IAAI,CAAC,sBAAa,EAAE,UAAU,OAAO,yDAAyD,CAAC,CAAC;SACxG;aAAM;YACL,cAAM,CAAC,IAAI,CAAC,sBAAa,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,oBAAU,CAAC;YACrB,cAAM,CAAC,KAAK,CAAC,sBAAa,EAAE,kDAAkD,OAAO,iCAAiC,CAAC,CAAC;SACzH;QACD,OAAO,EAAC,QAAQ,EAAE,OAAO,CAAC,kBAAS,CAAC,EAAE,MAAM,EAAE,4BAAmB,EAAC,CAAC;KACpE;AACH,CAAC;AApBD,wCAoBC;AAED,kBAAe,uBAAU,CAAC"}
|
|
File without changes
|
|
File without changes
|
package/lib/cjs/utils/user.js
CHANGED
|
@@ -1,73 +1,58 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
exports.
|
|
4
|
-
|
|
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
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isBlocked = exports.isStaff = exports.isModerator = exports.isAdmin = exports.getUserRole = exports.MODERATOR_ROLE = exports.ADMIN_ROLE = void 0;
|
|
4
|
+
const types_1 = require("@selfcommunity/types");
|
|
13
5
|
/**
|
|
14
6
|
* Staff Roles
|
|
15
7
|
* @type {string}
|
|
16
8
|
*/
|
|
17
|
-
|
|
18
|
-
exports.
|
|
19
|
-
const MODERATOR_ROLE = 'moderator';
|
|
9
|
+
exports.ADMIN_ROLE = 'admin';
|
|
10
|
+
exports.MODERATOR_ROLE = 'moderator';
|
|
20
11
|
/**
|
|
21
12
|
* Get user role from roles(set)
|
|
22
13
|
* @param user
|
|
23
14
|
* @returns role or null
|
|
24
15
|
*/
|
|
25
|
-
|
|
26
|
-
exports.MODERATOR_ROLE = MODERATOR_ROLE;
|
|
27
|
-
|
|
28
16
|
function getUserRole(user) {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
17
|
+
if (user && user.role) {
|
|
18
|
+
const role = user.role;
|
|
19
|
+
if (role === exports.ADMIN_ROLE) {
|
|
20
|
+
return exports.ADMIN_ROLE;
|
|
21
|
+
}
|
|
22
|
+
else if (role === exports.MODERATOR_ROLE) {
|
|
23
|
+
return exports.MODERATOR_ROLE;
|
|
24
|
+
}
|
|
36
25
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
return null;
|
|
26
|
+
return null;
|
|
40
27
|
}
|
|
28
|
+
exports.getUserRole = getUserRole;
|
|
41
29
|
/**
|
|
42
30
|
* Check if user is admin
|
|
43
31
|
* @param user
|
|
44
32
|
* @returns boolean
|
|
45
33
|
*/
|
|
46
|
-
|
|
47
|
-
|
|
48
34
|
function isAdmin(user) {
|
|
49
|
-
|
|
35
|
+
return getUserRole(user) === exports.ADMIN_ROLE;
|
|
50
36
|
}
|
|
37
|
+
exports.isAdmin = isAdmin;
|
|
51
38
|
/**
|
|
52
39
|
* Check if user is moderator
|
|
53
40
|
* @param user
|
|
54
41
|
* @returns boolean
|
|
55
42
|
*/
|
|
56
|
-
|
|
57
|
-
|
|
58
43
|
function isModerator(user) {
|
|
59
|
-
|
|
44
|
+
return getUserRole(user) === exports.MODERATOR_ROLE;
|
|
60
45
|
}
|
|
46
|
+
exports.isModerator = isModerator;
|
|
61
47
|
/**
|
|
62
48
|
* Check if user is admin or moderator
|
|
63
49
|
* @param user
|
|
64
50
|
* @returns boolean
|
|
65
51
|
*/
|
|
66
|
-
|
|
67
|
-
|
|
68
52
|
function isStaff(user) {
|
|
69
|
-
|
|
53
|
+
return isAdmin(user) || isModerator(user);
|
|
70
54
|
}
|
|
55
|
+
exports.isStaff = isStaff;
|
|
71
56
|
/**
|
|
72
57
|
* Check if user is blocked/banned
|
|
73
58
|
* User status values:
|
|
@@ -76,8 +61,8 @@ function isStaff(user) {
|
|
|
76
61
|
* @param user
|
|
77
62
|
* @returns {*}
|
|
78
63
|
*/
|
|
79
|
-
|
|
80
|
-
|
|
81
64
|
function isBlocked(user) {
|
|
82
|
-
|
|
83
|
-
}
|
|
65
|
+
return user && user.status && user.status === types_1.SCUserStatus.BLOCKED;
|
|
66
|
+
}
|
|
67
|
+
exports.isBlocked = isBlocked;
|
|
68
|
+
//# sourceMappingURL=user.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user.js","sourceRoot":"","sources":["../../../src/utils/user.ts"],"names":[],"mappings":";;;AAAA,gDAA8D;AAE9D;;;GAGG;AACU,QAAA,UAAU,GAAG,OAAO,CAAC;AACrB,QAAA,cAAc,GAAG,WAAW,CAAC;AAE1C;;;;GAIG;AACH,SAAgB,WAAW,CAAC,IAAgB;IAC1C,IAAI,IAAI,IAAI,IAAI,CAAC,IAAI,EAAE;QACrB,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QACvB,IAAI,IAAI,KAAK,kBAAU,EAAE;YACvB,OAAO,kBAAU,CAAC;SACnB;aAAM,IAAI,IAAI,KAAK,sBAAc,EAAE;YAClC,OAAO,sBAAc,CAAC;SACvB;KACF;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAVD,kCAUC;AAED;;;;GAIG;AACH,SAAgB,OAAO,CAAC,IAAgB;IACtC,OAAO,WAAW,CAAC,IAAI,CAAC,KAAK,kBAAU,CAAC;AAC1C,CAAC;AAFD,0BAEC;AAED;;;;GAIG;AACH,SAAgB,WAAW,CAAC,IAAgB;IAC1C,OAAO,WAAW,CAAC,IAAI,CAAC,KAAK,sBAAc,CAAC;AAC9C,CAAC;AAFD,kCAEC;AAED;;;;GAIG;AACH,SAAgB,OAAO,CAAC,IAAgB;IACtC,OAAO,OAAO,CAAC,IAAI,CAAC,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC;AAC5C,CAAC;AAFD,0BAEC;AAED;;;;;;;GAOG;AACH,SAAgB,SAAS,CAAC,IAAgB;IACxC,OAAO,IAAI,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,KAAK,oBAAY,CAAC,OAAO,CAAC;AACrE,CAAC;AAFD,8BAEC"}
|
|
File without changes
|
|
File without changes
|