@selfcommunity/react-core 0.6.7-alpha.1 → 0.6.7-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -74,6 +74,7 @@ function SCRoutingProvider({ children = null }) {
74
74
  [Routes_1.USER_NOTIFICATIONS_ROUTE_NAME]: normalizeUrl(scPreferencesContext.preferences[SCPreferences.CONFIGURATIONS_URL_TEMPLATE_NOTIFICATIONS].value),
75
75
  [Routes_1.USER_PRIVATE_MESSAGES_ROUTE_NAME]: normalizeUrl(scPreferencesContext.preferences[SCPreferences.CONFIGURATIONS_URL_TEMPLATE_USER_PRIVATE_MESSAGES].value),
76
76
  [Routes_1.INCUBATOR_ROUTE_NAME]: normalizeUrl(scPreferencesContext.preferences[SCPreferences.CONFIGURATIONS_URL_TEMPLATE_INCUBATOR].value),
77
+ [Routes_1.LIVESTREAM_ROUTE_NAME]: normalizeUrl(scPreferencesContext.preferences[SCPreferences.CONFIGURATIONS_URL_TEMPLATE_LIVE_STREAM].value),
77
78
  };
78
79
  }
79
80
  return {};
@@ -23,6 +23,9 @@ export declare const getEventObjectCacheKey: (id: any) => string;
23
23
  /** EVENTS OBJECT **/
24
24
  export declare const EVENTS_OBJECT_CACHE_PREFIX_KEY = "_evts_";
25
25
  export declare const getEventsObjectCacheKey: () => string;
26
+ /** EVENT OBJECT **/
27
+ export declare const LIVESTREAM_OBJECT_CACHE_PREFIX_KEY = "_liveStream_";
28
+ export declare const getLiveStreamObjectCacheKey: (id: any) => string;
26
29
  /** GROUP OBJECT **/
27
30
  export declare const GROUP_OBJECT_CACHE_PREFIX_KEY = "_grp_";
28
31
  export declare const getGroupObjectCacheKey: (id: any) => string;
@@ -69,6 +72,7 @@ export declare const USER_OTHER_EVENTS_STATE_CACHE_PREFIX_KEY = "_uOtherEvents_"
69
72
  export declare const USER_PARTECIPANTS_EVENTS_STATE_CACHE_PREFIX_KEY = "_uPartecipantsEvents_";
70
73
  export declare const USER_INVITED_EVENTS_STATE_CACHE_PREFIX_KEY = "_uInvitedEvents_";
71
74
  export declare const USER_REQUESTS_EVENTS_STATE_CACHE_PREFIX_KEY = "_uRequestsEvents_";
75
+ export declare const USER_LIVE_STREAM_CACHE_PREFIX_KEY = "_uUserLives_";
72
76
  export declare const EVENT_MEDIA_STATE_CACHE_PREFIX_KEY = "_eMedia_";
73
77
  export declare const USER_CONNECTIONS_TOOLS_STATE_CACHE_PREFIX_KEY = "_uConWidget_";
74
78
  export declare const USER_CONNECTIONS_REQUESTS_TOOLS_STATE_CACHE_PREFIX_KEY = "_uConReqWidget_";
@@ -3,8 +3,8 @@
3
3
  * Cache prefixes
4
4
  */
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.USER_INVITED_EVENTS_STATE_CACHE_PREFIX_KEY = exports.USER_PARTECIPANTS_EVENTS_STATE_CACHE_PREFIX_KEY = exports.USER_OTHER_EVENTS_STATE_CACHE_PREFIX_KEY = exports.USER_EVENTS_STATE_CACHE_PREFIX_KEY = exports.USER_FOLLOWED_TOOLS_STATE_CACHE_PREFIX_KEY = exports.USER_FOLLOWERS_TOOLS_STATE_CACHE_PREFIX_KEY = exports.CATEGORIES_POPULAR_TOOLS_STATE_CACHE_PREFIX_KEY = exports.CATEGORIES_SUGGESTION_TOOLS_STATE_CACHE_PREFIX_KEY = exports.CATEGORIES_FOLLOWED_TOOLS_STATE_CACHE_PREFIX_KEY = exports.CATEGORIES_LIST_TOOLS_STATE_CACHE_PREFIX_KEY = exports.getPmSnippetObjectCacheKey = exports.PM_SNIPPET_OBJECT_CACHE_PREFIX_KEY = exports.getPmSnippetsObjectCacheKey = exports.PM_SNIPPETS_OBJECT_CACHE_PREFIX_KEY = exports.getAdvObjectCacheKey = exports.ADV_OBJECT_CACHE_PREFIX_KEY = exports.getFeedSPCacheKey = exports.FEED_CACHE_SP_KEY = exports.getVirtualizedScrollStateCacheKey = exports.VIRTUALIZED_SCROLL_STATE_CACHE_PREFIX_KEY = exports.getStateFeedCacheKey = exports.FEED_STATE_CACHE_PREFIX_KEY = exports.getFeedCacheKey = exports.FEED_CACHE_PREFIX_KEY = exports.getBroadcastMessagesObjectCacheKey = exports.BROADCAST_MESSAGES_OBJECT_CACHE_PREFIX_KEY = exports.getContributorsCachePrefixKeys = exports.getContributorsCacheKey = exports.CONTRIBUTORS_CACHE_PREFIX_KEY = exports.getIncubatorObjectCacheKey = exports.INCUBATOR_OBJECT_CACHE_PREFIX_KEY = exports.getGroupsObjectCacheKey = exports.GROUPS_OBJECT_CACHE_PREFIX_KEY = exports.getGroupObjectCacheKey = exports.GROUP_OBJECT_CACHE_PREFIX_KEY = exports.getEventsObjectCacheKey = exports.EVENTS_OBJECT_CACHE_PREFIX_KEY = exports.getEventObjectCacheKey = exports.EVENT_OBJECT_CACHE_PREFIX_KEY = exports.getCategoryObjectCacheKey = exports.CATEGORY_OBJECT_CACHE_PREFIX_KEY = exports.getCategoriesObjectCacheKey = exports.CATEGORIES_OBJECT_CACHE_PREFIX_KEY = exports.getCommentObjectsCachePrefixKeys = exports.getCommentObjectsCacheKey = exports.COMMENT_OBJECTS_CACHE_PREFIX_KEY = exports.getCommentObjectCacheKey = exports.COMMENT_OBJECT_CACHE_PREFIX_KEY = exports.getFeedObjectCacheKey = exports.FEED_OBJECT_CACHE_PREFIX_KEY = void 0;
7
- exports.getWidgetStateCacheKey = exports.GROUPS_SUBSCRIBED_TOOLS_STATE_CACHE_PREFIX_KEY = exports.GROUPS_LIST_TOOLS_STATE_CACHE_PREFIX_KEY = exports.GROUP_REQUESTS_TOOLS_STATE_CACHE_PREFIX_KEY = exports.GROUP_MEMBERS_TOOLS_STATE_CACHE_PREFIX_KEY = exports.POLL_SUGGESTION_TOOLS_STATE_CACHE_PREFIX_KEY = exports.INCUBATOR_SUGGESTION_TOOLS_STATE_CACHE_PREFIX_KEY = exports.INCUBATOR_LIST_TOOLS_STATE_CACHE_PREFIX_KEY = exports.PEOPLE_SUGGESTION_TOOLS_STATE_CACHE_PREFIX_KEY = exports.TRENDING_PEOPLE_TOOLS_STATE_CACHE_PREFIX_KEY = exports.RELATED_FEED_TOOLS_STATE_CACHE_PREFIX_KEY = exports.TRENDING_FEED_TOOLS_STATE_CACHE_PREFIX_KEY = exports.USER_CONNECTIONS_REQUESTS_SENT_TOOLS_STATE_CACHE_PREFIX_KEY = exports.USER_CONNECTIONS_REQUESTS_TOOLS_STATE_CACHE_PREFIX_KEY = exports.USER_CONNECTIONS_TOOLS_STATE_CACHE_PREFIX_KEY = exports.EVENT_MEDIA_STATE_CACHE_PREFIX_KEY = exports.USER_REQUESTS_EVENTS_STATE_CACHE_PREFIX_KEY = void 0;
6
+ exports.USER_OTHER_EVENTS_STATE_CACHE_PREFIX_KEY = exports.USER_EVENTS_STATE_CACHE_PREFIX_KEY = exports.USER_FOLLOWED_TOOLS_STATE_CACHE_PREFIX_KEY = exports.USER_FOLLOWERS_TOOLS_STATE_CACHE_PREFIX_KEY = exports.CATEGORIES_POPULAR_TOOLS_STATE_CACHE_PREFIX_KEY = exports.CATEGORIES_SUGGESTION_TOOLS_STATE_CACHE_PREFIX_KEY = exports.CATEGORIES_FOLLOWED_TOOLS_STATE_CACHE_PREFIX_KEY = exports.CATEGORIES_LIST_TOOLS_STATE_CACHE_PREFIX_KEY = exports.getPmSnippetObjectCacheKey = exports.PM_SNIPPET_OBJECT_CACHE_PREFIX_KEY = exports.getPmSnippetsObjectCacheKey = exports.PM_SNIPPETS_OBJECT_CACHE_PREFIX_KEY = exports.getAdvObjectCacheKey = exports.ADV_OBJECT_CACHE_PREFIX_KEY = exports.getFeedSPCacheKey = exports.FEED_CACHE_SP_KEY = exports.getVirtualizedScrollStateCacheKey = exports.VIRTUALIZED_SCROLL_STATE_CACHE_PREFIX_KEY = exports.getStateFeedCacheKey = exports.FEED_STATE_CACHE_PREFIX_KEY = exports.getFeedCacheKey = exports.FEED_CACHE_PREFIX_KEY = exports.getBroadcastMessagesObjectCacheKey = exports.BROADCAST_MESSAGES_OBJECT_CACHE_PREFIX_KEY = exports.getContributorsCachePrefixKeys = exports.getContributorsCacheKey = exports.CONTRIBUTORS_CACHE_PREFIX_KEY = exports.getIncubatorObjectCacheKey = exports.INCUBATOR_OBJECT_CACHE_PREFIX_KEY = exports.getGroupsObjectCacheKey = exports.GROUPS_OBJECT_CACHE_PREFIX_KEY = exports.getGroupObjectCacheKey = exports.GROUP_OBJECT_CACHE_PREFIX_KEY = exports.getLiveStreamObjectCacheKey = exports.LIVESTREAM_OBJECT_CACHE_PREFIX_KEY = exports.getEventsObjectCacheKey = exports.EVENTS_OBJECT_CACHE_PREFIX_KEY = exports.getEventObjectCacheKey = exports.EVENT_OBJECT_CACHE_PREFIX_KEY = exports.getCategoryObjectCacheKey = exports.CATEGORY_OBJECT_CACHE_PREFIX_KEY = exports.getCategoriesObjectCacheKey = exports.CATEGORIES_OBJECT_CACHE_PREFIX_KEY = exports.getCommentObjectsCachePrefixKeys = exports.getCommentObjectsCacheKey = exports.COMMENT_OBJECTS_CACHE_PREFIX_KEY = exports.getCommentObjectCacheKey = exports.COMMENT_OBJECT_CACHE_PREFIX_KEY = exports.getFeedObjectCacheKey = exports.FEED_OBJECT_CACHE_PREFIX_KEY = void 0;
7
+ exports.getWidgetStateCacheKey = exports.GROUPS_SUBSCRIBED_TOOLS_STATE_CACHE_PREFIX_KEY = exports.GROUPS_LIST_TOOLS_STATE_CACHE_PREFIX_KEY = exports.GROUP_REQUESTS_TOOLS_STATE_CACHE_PREFIX_KEY = exports.GROUP_MEMBERS_TOOLS_STATE_CACHE_PREFIX_KEY = exports.POLL_SUGGESTION_TOOLS_STATE_CACHE_PREFIX_KEY = exports.INCUBATOR_SUGGESTION_TOOLS_STATE_CACHE_PREFIX_KEY = exports.INCUBATOR_LIST_TOOLS_STATE_CACHE_PREFIX_KEY = exports.PEOPLE_SUGGESTION_TOOLS_STATE_CACHE_PREFIX_KEY = exports.TRENDING_PEOPLE_TOOLS_STATE_CACHE_PREFIX_KEY = exports.RELATED_FEED_TOOLS_STATE_CACHE_PREFIX_KEY = exports.TRENDING_FEED_TOOLS_STATE_CACHE_PREFIX_KEY = exports.USER_CONNECTIONS_REQUESTS_SENT_TOOLS_STATE_CACHE_PREFIX_KEY = exports.USER_CONNECTIONS_REQUESTS_TOOLS_STATE_CACHE_PREFIX_KEY = exports.USER_CONNECTIONS_TOOLS_STATE_CACHE_PREFIX_KEY = exports.EVENT_MEDIA_STATE_CACHE_PREFIX_KEY = exports.USER_LIVE_STREAM_CACHE_PREFIX_KEY = exports.USER_REQUESTS_EVENTS_STATE_CACHE_PREFIX_KEY = exports.USER_INVITED_EVENTS_STATE_CACHE_PREFIX_KEY = exports.USER_PARTECIPANTS_EVENTS_STATE_CACHE_PREFIX_KEY = void 0;
8
8
  /** FEED OBJECT **/
9
9
  exports.FEED_OBJECT_CACHE_PREFIX_KEY = '_fo_';
10
10
  const getFeedObjectCacheKey = (id, type) => `${exports.FEED_OBJECT_CACHE_PREFIX_KEY}${type}_${id}`;
@@ -35,6 +35,10 @@ exports.getEventObjectCacheKey = getEventObjectCacheKey;
35
35
  exports.EVENTS_OBJECT_CACHE_PREFIX_KEY = '_evts_';
36
36
  const getEventsObjectCacheKey = () => `${exports.EVENTS_OBJECT_CACHE_PREFIX_KEY}`;
37
37
  exports.getEventsObjectCacheKey = getEventsObjectCacheKey;
38
+ /** EVENT OBJECT **/
39
+ exports.LIVESTREAM_OBJECT_CACHE_PREFIX_KEY = '_liveStream_';
40
+ const getLiveStreamObjectCacheKey = (id) => `${exports.LIVESTREAM_OBJECT_CACHE_PREFIX_KEY}${id}`;
41
+ exports.getLiveStreamObjectCacheKey = getLiveStreamObjectCacheKey;
38
42
  /** GROUP OBJECT **/
39
43
  exports.GROUP_OBJECT_CACHE_PREFIX_KEY = '_grp_';
40
44
  const getGroupObjectCacheKey = (id) => `${exports.GROUP_OBJECT_CACHE_PREFIX_KEY}${id}`;
@@ -98,6 +102,7 @@ exports.USER_OTHER_EVENTS_STATE_CACHE_PREFIX_KEY = '_uOtherEvents_';
98
102
  exports.USER_PARTECIPANTS_EVENTS_STATE_CACHE_PREFIX_KEY = '_uPartecipantsEvents_';
99
103
  exports.USER_INVITED_EVENTS_STATE_CACHE_PREFIX_KEY = '_uInvitedEvents_';
100
104
  exports.USER_REQUESTS_EVENTS_STATE_CACHE_PREFIX_KEY = '_uRequestsEvents_';
105
+ exports.USER_LIVE_STREAM_CACHE_PREFIX_KEY = '_uUserLives_';
101
106
  exports.EVENT_MEDIA_STATE_CACHE_PREFIX_KEY = '_eMedia_';
102
107
  exports.USER_CONNECTIONS_TOOLS_STATE_CACHE_PREFIX_KEY = '_uConWidget_';
103
108
  exports.USER_CONNECTIONS_REQUESTS_TOOLS_STATE_CACHE_PREFIX_KEY = '_uConReqWidget_';
@@ -21,6 +21,7 @@ export declare const SCNotificationMapping: {
21
21
  16: SCNotificationTypologyType;
22
22
  37: SCNotificationTypologyType;
23
23
  105: SCNotificationTypologyType;
24
+ 26: SCNotificationTypologyType;
24
25
  50: SCNotificationTypologyType;
25
26
  51: SCNotificationTypologyType;
26
27
  52: SCNotificationTypologyType;
@@ -24,6 +24,7 @@ exports.SCNotificationMapping = {
24
24
  16: types_1.SCNotificationTypologyType.FOLLOW,
25
25
  37: types_1.SCNotificationTypologyType.PRIVATE_MESSAGE,
26
26
  105: types_1.SCNotificationTypologyType.DELETE_PRIVATE_MESSAGE,
27
+ 26: types_1.SCNotificationTypologyType.LIVE_STREAM_STARTED,
27
28
  50: types_1.SCNotificationTypologyType.DELETED_FOR_ADVERTISING,
28
29
  51: types_1.SCNotificationTypologyType.DELETED_FOR_AGGRESSIVE,
29
30
  52: types_1.SCNotificationTypologyType.DELETED_FOR_VULGAR,
@@ -50,7 +51,7 @@ exports.SCNotificationMapping = {
50
51
  31: types_1.SCNotificationTypologyType.USER_INVITED_TO_JOIN_GROUP,
51
52
  32: types_1.SCNotificationTypologyType.USER_REQUESTED_TO_JOIN_GROUP,
52
53
  33: types_1.SCNotificationTypologyType.USER_ACCEPTED_TO_JOIN_GROUP,
53
- 34: types_1.SCNotificationTypologyType.USER_ADDED_TO_GROUP
54
+ 34: types_1.SCNotificationTypologyType.USER_ADDED_TO_GROUP,
54
55
  };
55
56
  /**
56
57
  * Silent Snippet Notifications
@@ -117,6 +117,7 @@ export declare const CONFIGURATIONS_URL_TEMPLATE_USER_PROFILE_SETTINGS: string;
117
117
  export declare const CONFIGURATIONS_URL_TEMPLATE_NOTIFICATIONS: string;
118
118
  export declare const CONFIGURATIONS_URL_TEMPLATE_USER_PRIVATE_MESSAGES: string;
119
119
  export declare const CONFIGURATIONS_URL_TEMPLATE_INCUBATOR: string;
120
+ export declare const CONFIGURATIONS_URL_TEMPLATE_LIVE_STREAM: string;
120
121
  export declare const CONFIGURATIONS_APP_URL: string;
121
122
  export declare const CONFIGURATIONS_USER_METADATA_DEFINITIONS: string;
122
123
  export declare const CONFIGURATIONS_TAG_MANAGER_CONTAINER_ID: string;
@@ -136,6 +137,9 @@ export declare const CONFIGURATIONS_EVENTS_VISIBILITY_ENABLED: string;
136
137
  export declare const CONFIGURATIONS_EVENTS_PRIVATE_ENABLED: string;
137
138
  export declare const CONFIGURATIONS_ONBOARDING_ENABLED: string;
138
139
  export declare const CONFIGURATIONS_ONBOARDING_HIDDEN: string;
140
+ export declare const CONFIGURATIONS_LIVE_STREAM_ENABLED: string;
141
+ export declare const CONFIGURATIONS_LIVE_STREAM_ONLY_STAFF_ENABLED: string;
142
+ export declare const CONFIGURATIONS_SUBSCRIPTION_TIER: string;
139
143
  /**
140
144
  * PROVIDERS
141
145
  */
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ADDONS_SHARE_POST_ON_FACEBOOK_ENABLED = exports.ADDONS_POST_GEOLOCATION_ENABLED = exports.ADDONS_REGISTRATION_WIZARD = exports.ADDONS_POLLS_ENABLED = exports.ADDONS_LOYALTY_POINTS_COLLECTION = exports.ADDONS_INCUBATOR_SUBSCRIBERS = exports.ADDONS_INCUBATOR_ENABLED = exports.ADDONS_CLOSED_COMMUNITY = exports.ADDONS_AFFINITY_ENABLED = exports.POINTS_DAILY_VISIT = exports.POINTS_APP_USED = exports.POINTS_SOCIAL_SHARE = exports.POINTS_CONNECTION_OR_FOLLOWER = exports.POINTS_RECEIVE_VOTE = exports.POINTS_MAKE_COMMENT = exports.POINTS_MAKE_POST = exports.POINTS_MAKE_DISCUSSION = exports.LOYALTY_PRIZE_C_IMAGE = exports.LOYALTY_PRIZE_B_IMAGE = exports.LOYALTY_PRIZE_A_IMAGE = exports.STAFF_STAFF_BADGE_LABEL = exports.STAFF_STAFF_BADGE_ICON = exports.IMAGES_ERRORPAGES_IMAGE = exports.IMAGES_ERROR_503 = exports.IMAGES_ERROR_404 = exports.IMAGES_USER_DEFAULT_COVER = exports.IMAGES_APP_ICON = exports.COVERS_VISIBILITY = exports.COVERS_COVER_4_HP_M1920 = exports.COVERS_COVER_3_HP_M1920 = exports.COVERS_COVER_2_HP_M1920 = exports.COVERS_COVER_1_HP_M1920 = exports.COLORS_COLORFONTSECONDARY = exports.COLORS_COLORFONT = exports.COLORS_NAVBARBACK = exports.COLORS_COLORSECONDARY = exports.COLORS_COLORPRIMARY = exports.COLORS_COLORBACK = exports.LOGO_NAVBAR_LOGO_MOBILE = exports.LOGO_NAVBAR_LOGO = exports.STYLE_FONT_FAMILY = exports.TEXT_ERROR_PAGES_SUBTITLE = exports.TEXT_ERROR_PAGES_TITLE = exports.TEXT_APPLICATION_COPYRIGHT = exports.TEXT_APPLICATION_SLOGAN2 = exports.TEXT_APPLICATION_SLOGAN1 = exports.TEXT_APPLICATION_NAME = exports.DEFAULT_GLOBAL_PREFERENCES_OPTION = exports.GLOBAL_PREFERENCES_OPTION = exports.PREFERENCES_OPTION = void 0;
4
- exports.CONFIGURATIONS_ONBOARDING_ENABLED = exports.CONFIGURATIONS_EVENTS_PRIVATE_ENABLED = exports.CONFIGURATIONS_EVENTS_VISIBILITY_ENABLED = exports.CONFIGURATIONS_EVENTS_ONLY_STAFF_ENABLED = exports.CONFIGURATIONS_EVENTS_ENABLED = exports.CONFIGURATIONS_GROUPS_PRIVATE_ENABLED = exports.CONFIGURATIONS_GROUPS_VISIBILITY_ENABLED = exports.CONFIGURATIONS_GROUPS_ONLY_STAFF_ENABLED = exports.CONFIGURATIONS_GROUPS_ENABLED = exports.CONFIGURATIONS_CUSTOM_NAVBAR_ITEM_IMAGE = exports.CONFIGURATIONS_CUSTOM_NAVBAR_ITEM_URL = exports.CONFIGURATIONS_CUSTOM_NAVBAR_ITEM_TEXT = exports.CONFIGURATIONS_CUSTOM_NAVBAR_ITEM_ENABLED = exports.CONFIGURATIONS_GDPR_SIGNUP_ACCEPT_HTML = exports.CONFIGURATIONS_GDPR_COOKIE_CONSENT_EXTERNAL_HTML = exports.CONFIGURATIONS_TAG_MANAGER_CONTAINER_ID = exports.CONFIGURATIONS_USER_METADATA_DEFINITIONS = exports.CONFIGURATIONS_APP_URL = exports.CONFIGURATIONS_URL_TEMPLATE_INCUBATOR = exports.CONFIGURATIONS_URL_TEMPLATE_USER_PRIVATE_MESSAGES = exports.CONFIGURATIONS_URL_TEMPLATE_NOTIFICATIONS = exports.CONFIGURATIONS_URL_TEMPLATE_USER_PROFILE_SETTINGS = exports.CONFIGURATIONS_URL_TEMPLATE_USER_PROFILE = exports.CONFIGURATIONS_URL_TEMPLATE_CATEGORIES_LIST = exports.CONFIGURATIONS_URL_TEMPLATE_CATEGORY = exports.CONFIGURATIONS_URL_TEMPLATE_COMMENT = exports.CONFIGURATIONS_URL_TEMPLATE_STATUS = exports.CONFIGURATIONS_URL_TEMPLATE_DISCUSSION = exports.CONFIGURATIONS_URL_TEMPLATE_POST = exports.CONFIGURATIONS_URL_TEMPLATE_VERIFY_EMAIL = exports.CONFIGURATIONS_URL_TEMPLATE_PASSWORD_RECOVER = exports.CONFIGURATIONS_URL_TEMPLATE_EMAIL_UNSUBSCRIBE = exports.CONFIGURATIONS_URL_TEMPLATE_EMAIL_SETTINGS = exports.CONFIGURATIONS_STATUS_TYPE_ENABLED = exports.CONFIGURATIONS_DISCUSSION_TYPE_ENABLED = exports.CONFIGURATIONS_POST_TYPE_ENABLED = exports.CONFIGURATIONS_USERS_APPROVAL_ENABLED = exports.CONFIGURATIONS_CONTENT_AVAILABILITY = exports.CONFIGURATIONS_STREAM_QUALITY = exports.CONFIGURATIONS_POST_ONLY_STAFF_ENABLED = exports.CONFIGURATIONS_PEOPLE_SEARCH_ENABLED = exports.CONFIGURATIONS_MANUAL_CATEGORIES_ORDER_ENABLED = exports.CONFIGURATIONS_HOME_STREAM_ORDER_BY = exports.CONFIGURATIONS_EXPLORE_STREAM_ORDER_BY = exports.CONFIGURATIONS_EXPLORE_STREAM_ENABLED = exports.CONFIGURATIONS_FOLLOW_ENABLED = exports.ADVERTISING_CUSTOM_ADV_ONLY_FOR_ANONYMOUS_USERS_ENABLED = exports.ADVERTISING_CUSTOM_ADV_ENABLED = exports.ADDONS_SHARE_POST_ON_LINKEDIN_ENABLED = exports.ADDONS_SHARE_POST_ON_TWITTER_ENABLED = void 0;
5
- exports.DATA_TYPES = exports.getPreference = exports.getPreferenceName = exports.getPreferenceSection = exports.WEBMASTER_META_DESCRIPTION = exports.WEBMASTER_META_TITLE_HOME_NOT_LOGGED = exports.WEBMASTER_META_ROBOTS = exports.PROVIDERS_WEB_PUSH_ENABLED = exports.PROVIDERS_WEB_PUSH_PUBLIC_KEY = exports.PROVIDERS_GOOGLE_APP_SECRET = exports.PROVIDERS_GOOGLE_APP_KEY = exports.PROVIDERS_GOOGLE_SIGNIN_ENABLED = exports.PROVIDERS_GOOGLE_GEOCODING_API_KEY = exports.PROVIDERS_TWITTER_APP_SECRET = exports.PROVIDERS_TWITTER_APP_KEY = exports.PROVIDERS_TWITTER_SIGNIN_ENABLED = exports.PROVIDERS_LINKEDIN_APP_SECRET = exports.PROVIDERS_LINKEDIN_APP_KEY = exports.PROVIDERS_LINKEDIN_SIGNIN_ENABLED = exports.PROVIDERS_FACEBOOK_APP_SECRET = exports.PROVIDERS_FACEBOOK_APP_KEY = exports.PROVIDERS_FACEBOOK_SIGNIN_ENABLED = exports.PROVIDERS_APP_URL_ON_GOOGLE_PLAY = exports.PROVIDERS_APP_URL_ON_APP_STORE = exports.CONFIGURATIONS_ONBOARDING_HIDDEN = void 0;
4
+ exports.CONFIGURATIONS_EVENTS_PRIVATE_ENABLED = exports.CONFIGURATIONS_EVENTS_VISIBILITY_ENABLED = exports.CONFIGURATIONS_EVENTS_ONLY_STAFF_ENABLED = exports.CONFIGURATIONS_EVENTS_ENABLED = exports.CONFIGURATIONS_GROUPS_PRIVATE_ENABLED = exports.CONFIGURATIONS_GROUPS_VISIBILITY_ENABLED = exports.CONFIGURATIONS_GROUPS_ONLY_STAFF_ENABLED = exports.CONFIGURATIONS_GROUPS_ENABLED = exports.CONFIGURATIONS_CUSTOM_NAVBAR_ITEM_IMAGE = exports.CONFIGURATIONS_CUSTOM_NAVBAR_ITEM_URL = exports.CONFIGURATIONS_CUSTOM_NAVBAR_ITEM_TEXT = exports.CONFIGURATIONS_CUSTOM_NAVBAR_ITEM_ENABLED = exports.CONFIGURATIONS_GDPR_SIGNUP_ACCEPT_HTML = exports.CONFIGURATIONS_GDPR_COOKIE_CONSENT_EXTERNAL_HTML = exports.CONFIGURATIONS_TAG_MANAGER_CONTAINER_ID = exports.CONFIGURATIONS_USER_METADATA_DEFINITIONS = exports.CONFIGURATIONS_APP_URL = exports.CONFIGURATIONS_URL_TEMPLATE_LIVE_STREAM = exports.CONFIGURATIONS_URL_TEMPLATE_INCUBATOR = exports.CONFIGURATIONS_URL_TEMPLATE_USER_PRIVATE_MESSAGES = exports.CONFIGURATIONS_URL_TEMPLATE_NOTIFICATIONS = exports.CONFIGURATIONS_URL_TEMPLATE_USER_PROFILE_SETTINGS = exports.CONFIGURATIONS_URL_TEMPLATE_USER_PROFILE = exports.CONFIGURATIONS_URL_TEMPLATE_CATEGORIES_LIST = exports.CONFIGURATIONS_URL_TEMPLATE_CATEGORY = exports.CONFIGURATIONS_URL_TEMPLATE_COMMENT = exports.CONFIGURATIONS_URL_TEMPLATE_STATUS = exports.CONFIGURATIONS_URL_TEMPLATE_DISCUSSION = exports.CONFIGURATIONS_URL_TEMPLATE_POST = exports.CONFIGURATIONS_URL_TEMPLATE_VERIFY_EMAIL = exports.CONFIGURATIONS_URL_TEMPLATE_PASSWORD_RECOVER = exports.CONFIGURATIONS_URL_TEMPLATE_EMAIL_UNSUBSCRIBE = exports.CONFIGURATIONS_URL_TEMPLATE_EMAIL_SETTINGS = exports.CONFIGURATIONS_STATUS_TYPE_ENABLED = exports.CONFIGURATIONS_DISCUSSION_TYPE_ENABLED = exports.CONFIGURATIONS_POST_TYPE_ENABLED = exports.CONFIGURATIONS_USERS_APPROVAL_ENABLED = exports.CONFIGURATIONS_CONTENT_AVAILABILITY = exports.CONFIGURATIONS_STREAM_QUALITY = exports.CONFIGURATIONS_POST_ONLY_STAFF_ENABLED = exports.CONFIGURATIONS_PEOPLE_SEARCH_ENABLED = exports.CONFIGURATIONS_MANUAL_CATEGORIES_ORDER_ENABLED = exports.CONFIGURATIONS_HOME_STREAM_ORDER_BY = exports.CONFIGURATIONS_EXPLORE_STREAM_ORDER_BY = exports.CONFIGURATIONS_EXPLORE_STREAM_ENABLED = exports.CONFIGURATIONS_FOLLOW_ENABLED = exports.ADVERTISING_CUSTOM_ADV_ONLY_FOR_ANONYMOUS_USERS_ENABLED = exports.ADVERTISING_CUSTOM_ADV_ENABLED = exports.ADDONS_SHARE_POST_ON_LINKEDIN_ENABLED = exports.ADDONS_SHARE_POST_ON_TWITTER_ENABLED = void 0;
5
+ exports.DATA_TYPES = exports.getPreference = exports.getPreferenceName = exports.getPreferenceSection = exports.WEBMASTER_META_DESCRIPTION = exports.WEBMASTER_META_TITLE_HOME_NOT_LOGGED = exports.WEBMASTER_META_ROBOTS = exports.PROVIDERS_WEB_PUSH_ENABLED = exports.PROVIDERS_WEB_PUSH_PUBLIC_KEY = exports.PROVIDERS_GOOGLE_APP_SECRET = exports.PROVIDERS_GOOGLE_APP_KEY = exports.PROVIDERS_GOOGLE_SIGNIN_ENABLED = exports.PROVIDERS_GOOGLE_GEOCODING_API_KEY = exports.PROVIDERS_TWITTER_APP_SECRET = exports.PROVIDERS_TWITTER_APP_KEY = exports.PROVIDERS_TWITTER_SIGNIN_ENABLED = exports.PROVIDERS_LINKEDIN_APP_SECRET = exports.PROVIDERS_LINKEDIN_APP_KEY = exports.PROVIDERS_LINKEDIN_SIGNIN_ENABLED = exports.PROVIDERS_FACEBOOK_APP_SECRET = exports.PROVIDERS_FACEBOOK_APP_KEY = exports.PROVIDERS_FACEBOOK_SIGNIN_ENABLED = exports.PROVIDERS_APP_URL_ON_GOOGLE_PLAY = exports.PROVIDERS_APP_URL_ON_APP_STORE = exports.CONFIGURATIONS_SUBSCRIPTION_TIER = exports.CONFIGURATIONS_LIVE_STREAM_ONLY_STAFF_ENABLED = exports.CONFIGURATIONS_LIVE_STREAM_ENABLED = exports.CONFIGURATIONS_ONBOARDING_HIDDEN = exports.CONFIGURATIONS_ONBOARDING_ENABLED = void 0;
6
6
  const types_1 = require("@selfcommunity/types");
7
7
  /**
8
8
  * DEFAULT CONF VALIDATION OPTION
@@ -123,6 +123,7 @@ exports.CONFIGURATIONS_URL_TEMPLATE_USER_PROFILE_SETTINGS = `${types_1.SCPrefere
123
123
  exports.CONFIGURATIONS_URL_TEMPLATE_NOTIFICATIONS = `${types_1.SCPreferenceSection.CONFIGURATIONS}.${types_1.SCPreferenceName.URL_TEMPLATE_NOTIFICATIONS}`;
124
124
  exports.CONFIGURATIONS_URL_TEMPLATE_USER_PRIVATE_MESSAGES = `${types_1.SCPreferenceSection.CONFIGURATIONS}.${types_1.SCPreferenceName.URL_TEMPLATE_USER_PRIVATE_MESSAGES}`;
125
125
  exports.CONFIGURATIONS_URL_TEMPLATE_INCUBATOR = `${types_1.SCPreferenceSection.CONFIGURATIONS}.${types_1.SCPreferenceName.URL_TEMPLATE_INCUBATOR}`;
126
+ exports.CONFIGURATIONS_URL_TEMPLATE_LIVE_STREAM = `${types_1.SCPreferenceSection.CONFIGURATIONS}.${types_1.SCPreferenceName.URL_TEMPLATE_LIVE_STREAM}`;
126
127
  exports.CONFIGURATIONS_APP_URL = `${types_1.SCPreferenceSection.CONFIGURATIONS}.${types_1.SCPreferenceName.APP_URL}`;
127
128
  exports.CONFIGURATIONS_USER_METADATA_DEFINITIONS = `${types_1.SCPreferenceSection.CONFIGURATIONS}.${types_1.SCPreferenceName.USER_METADATA_DEFINITIONS}`;
128
129
  exports.CONFIGURATIONS_TAG_MANAGER_CONTAINER_ID = `${types_1.SCPreferenceSection.CONFIGURATIONS}.${types_1.SCPreferenceName.TAG_MANAGER_CONTAINER_ID}`;
@@ -142,6 +143,9 @@ exports.CONFIGURATIONS_EVENTS_VISIBILITY_ENABLED = `${types_1.SCPreferenceSectio
142
143
  exports.CONFIGURATIONS_EVENTS_PRIVATE_ENABLED = `${types_1.SCPreferenceSection.CONFIGURATIONS}.${types_1.SCPreferenceName.EVENTS_PRIVATE_ENABLED}`;
143
144
  exports.CONFIGURATIONS_ONBOARDING_ENABLED = `${types_1.SCPreferenceSection.CONFIGURATIONS}.${types_1.SCPreferenceName.ONBOARDING_ENABLED}`;
144
145
  exports.CONFIGURATIONS_ONBOARDING_HIDDEN = `${types_1.SCPreferenceSection.CONFIGURATIONS}.${types_1.SCPreferenceName.ONBOARDING_HIDDEN}`;
146
+ exports.CONFIGURATIONS_LIVE_STREAM_ENABLED = `${types_1.SCPreferenceSection.CONFIGURATIONS}.${types_1.SCPreferenceName.LIVE_STREAM_ENABLED}`;
147
+ exports.CONFIGURATIONS_LIVE_STREAM_ONLY_STAFF_ENABLED = `${types_1.SCPreferenceSection.CONFIGURATIONS}.${types_1.SCPreferenceName.LIVE_STREAM_ONLY_STAFF_ENABLED}`;
148
+ exports.CONFIGURATIONS_SUBSCRIPTION_TIER = `${types_1.SCPreferenceSection.CONFIGURATIONS}.${types_1.SCPreferenceName.SUBSCRIPTION_TIER}`;
145
149
  /**
146
150
  * PROVIDERS
147
151
  */
@@ -272,6 +276,7 @@ exports.DATA_TYPES = {
272
276
  [exports.CONFIGURATIONS_URL_TEMPLATE_NOTIFICATIONS]: stringType,
273
277
  [exports.CONFIGURATIONS_URL_TEMPLATE_USER_PRIVATE_MESSAGES]: stringType,
274
278
  [exports.CONFIGURATIONS_URL_TEMPLATE_INCUBATOR]: stringType,
279
+ [exports.CONFIGURATIONS_URL_TEMPLATE_LIVE_STREAM]: stringType,
275
280
  [exports.CONFIGURATIONS_APP_URL]: stringType,
276
281
  [exports.CONFIGURATIONS_USER_METADATA_DEFINITIONS]: stringType,
277
282
  [exports.CONFIGURATIONS_TAG_MANAGER_CONTAINER_ID]: stringType,
@@ -291,6 +296,9 @@ exports.DATA_TYPES = {
291
296
  [exports.CONFIGURATIONS_EVENTS_PRIVATE_ENABLED]: booleanType,
292
297
  [exports.CONFIGURATIONS_ONBOARDING_ENABLED]: booleanType,
293
298
  [exports.CONFIGURATIONS_ONBOARDING_HIDDEN]: booleanType,
299
+ [exports.CONFIGURATIONS_LIVE_STREAM_ENABLED]: booleanType,
300
+ [exports.CONFIGURATIONS_LIVE_STREAM_ONLY_STAFF_ENABLED]: booleanType,
301
+ [exports.CONFIGURATIONS_SUBSCRIPTION_TIER]: stringType,
294
302
  [exports.PROVIDERS_APP_URL_ON_APP_STORE]: stringType,
295
303
  [exports.PROVIDERS_APP_URL_ON_GOOGLE_PLAY]: stringType,
296
304
  [exports.PROVIDERS_FACEBOOK_SIGNIN_ENABLED]: stringType,
@@ -41,6 +41,7 @@ export declare const EVENTS_ROUTE_NAME = "events";
41
41
  export declare const EVENTS_SUGGESTED_ROUTE_NAME = "events_suggested";
42
42
  export declare const EVENTS_SUBSCRIBED_ROUTE_NAME = "events_subscribed";
43
43
  export declare const EVENTS_HIGHLIGHT_ROUTE_NAME = "events_highlight";
44
+ export declare const LIVESTREAM_ROUTE_NAME = "live";
44
45
  /**
45
46
  * Default Routes
46
47
  * @type {{[p: string]: string, '[POST_ROUTE_NAME]': string, '[INCUBATOR_ROUTE_NAME]': string, '[LOYALTY_ROUTE_NAME]': string, '[USER_NOTIFICATION_ROUTE_NAME]': string, '[USER_PRIVATE_MESSAGES_ROUTE_NAME]': string, '[COMMENT_ROUTE_NAME]': string, '[DISCUSSION_ROUTE_NAME]': string, '[CATEGORIES_ROUTE_NAME]': string, '[USER_PROFILE_ROUTE_NAME]': string, '[CATEGORY_ROUTE_NAME]': string, '[USER_PROFILE_SETTINGS_ROUTE_NAME]': string, '[STATUS_ROUTE_NAME]': string}}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.defaultRoutes = exports.EVENTS_HIGHLIGHT_ROUTE_NAME = exports.EVENTS_SUBSCRIBED_ROUTE_NAME = exports.EVENTS_SUGGESTED_ROUTE_NAME = exports.EVENTS_ROUTE_NAME = exports.EVENT_ROUTE_NAME = exports.GROUPS_SUBSCRIBED_ROUTE_NAME = exports.GROUPS_ROUTE_NAME = exports.GROUP_MESSAGES_ROUTE_NAME = exports.GROUP_MEMBERS_ROUTE_NAME = exports.GROUP_ROUTE_NAME = exports.LEGAL_PAGES_ROUTE_NAME = exports.CUSTOM_PAGES_ROUTE_NAME = exports.RECOVER_ROUTE_NAME = exports.SIGNUP_ROUTE_NAME = exports.SIGNIN_ROUTE_NAME = exports.INCUBATOR_ROUTE_NAME = exports.LOYALTY_ROUTE_NAME = exports.USER_PROFILE_FOLLOWED_DISCUSSIONS_ROUTE_NAME = exports.USER_PROFILE_FOLLOWED_POSTS_ROUTE_NAME = exports.USER_PROFILE_CATEGORIES_ROUTE_NAME = exports.USER_PROFILE_CONNECTIONS_REQUESTS_SENT_ROUTE_NAME = exports.USER_PROFILE_CONNECTIONS_REQUESTS_ROUTE_NAME = exports.USER_PROFILE_CONNECTIONS_ROUTE_NAME = exports.USER_PROFILE_FOLLOWERS_ROUTE_NAME = exports.USER_PROFILE_FOLLOWINGS_ROUTE_NAME = exports.USER_PRIVATE_MESSAGES_ROUTE_NAME = exports.USER_NOTIFICATIONS_ROUTE_NAME = exports.USER_PROFILE_SETTINGS_ROUTE_NAME = exports.USER_PROFILE_ROUTE_NAME = exports.CATEGORIES_LIST_ROUTE_NAME = exports.CATEGORY_TRENDING_FEED_ROUTE_NAME = exports.CATEGORY_ROUTE_NAME = exports.COMMENT_ROUTE_NAME = exports.STATUS_ROUTE_NAME = exports.DISCUSSION_ROUTE_NAME = exports.POST_ROUTE_NAME = exports.EXPLORE_ROUTE_NAME = exports.HOME_ROUTE_NAME = exports.ROUTER_OPTION = exports.PORTAL_OPTION = void 0;
3
+ exports.defaultRoutes = exports.LIVESTREAM_ROUTE_NAME = exports.EVENTS_HIGHLIGHT_ROUTE_NAME = exports.EVENTS_SUBSCRIBED_ROUTE_NAME = exports.EVENTS_SUGGESTED_ROUTE_NAME = exports.EVENTS_ROUTE_NAME = exports.EVENT_ROUTE_NAME = exports.GROUPS_SUBSCRIBED_ROUTE_NAME = exports.GROUPS_ROUTE_NAME = exports.GROUP_MESSAGES_ROUTE_NAME = exports.GROUP_MEMBERS_ROUTE_NAME = exports.GROUP_ROUTE_NAME = exports.LEGAL_PAGES_ROUTE_NAME = exports.CUSTOM_PAGES_ROUTE_NAME = exports.RECOVER_ROUTE_NAME = exports.SIGNUP_ROUTE_NAME = exports.SIGNIN_ROUTE_NAME = exports.INCUBATOR_ROUTE_NAME = exports.LOYALTY_ROUTE_NAME = exports.USER_PROFILE_FOLLOWED_DISCUSSIONS_ROUTE_NAME = exports.USER_PROFILE_FOLLOWED_POSTS_ROUTE_NAME = exports.USER_PROFILE_CATEGORIES_ROUTE_NAME = exports.USER_PROFILE_CONNECTIONS_REQUESTS_SENT_ROUTE_NAME = exports.USER_PROFILE_CONNECTIONS_REQUESTS_ROUTE_NAME = exports.USER_PROFILE_CONNECTIONS_ROUTE_NAME = exports.USER_PROFILE_FOLLOWERS_ROUTE_NAME = exports.USER_PROFILE_FOLLOWINGS_ROUTE_NAME = exports.USER_PRIVATE_MESSAGES_ROUTE_NAME = exports.USER_NOTIFICATIONS_ROUTE_NAME = exports.USER_PROFILE_SETTINGS_ROUTE_NAME = exports.USER_PROFILE_ROUTE_NAME = exports.CATEGORIES_LIST_ROUTE_NAME = exports.CATEGORY_TRENDING_FEED_ROUTE_NAME = exports.CATEGORY_ROUTE_NAME = exports.COMMENT_ROUTE_NAME = exports.STATUS_ROUTE_NAME = exports.DISCUSSION_ROUTE_NAME = exports.POST_ROUTE_NAME = exports.EXPLORE_ROUTE_NAME = exports.HOME_ROUTE_NAME = exports.ROUTER_OPTION = exports.PORTAL_OPTION = void 0;
4
4
  exports.PORTAL_OPTION = 'portal';
5
5
  exports.ROUTER_OPTION = 'router';
6
6
  /**
@@ -44,6 +44,7 @@ exports.EVENTS_ROUTE_NAME = 'events';
44
44
  exports.EVENTS_SUGGESTED_ROUTE_NAME = 'events_suggested';
45
45
  exports.EVENTS_SUBSCRIBED_ROUTE_NAME = 'events_subscribed';
46
46
  exports.EVENTS_HIGHLIGHT_ROUTE_NAME = 'events_highlight';
47
+ exports.LIVESTREAM_ROUTE_NAME = 'live';
47
48
  /**
48
49
  * Default Routes
49
50
  * @type {{[p: string]: string, '[POST_ROUTE_NAME]': string, '[INCUBATOR_ROUTE_NAME]': string, '[LOYALTY_ROUTE_NAME]': string, '[USER_NOTIFICATION_ROUTE_NAME]': string, '[USER_PRIVATE_MESSAGES_ROUTE_NAME]': string, '[COMMENT_ROUTE_NAME]': string, '[DISCUSSION_ROUTE_NAME]': string, '[CATEGORIES_ROUTE_NAME]': string, '[USER_PROFILE_ROUTE_NAME]': string, '[CATEGORY_ROUTE_NAME]': string, '[USER_PROFILE_SETTINGS_ROUTE_NAME]': string, '[STATUS_ROUTE_NAME]': string}}
@@ -87,4 +88,5 @@ exports.defaultRoutes = {
87
88
  [exports.EVENT_ROUTE_NAME]: '/event/:id/:slug/',
88
89
  [exports.EVENTS_SUBSCRIBED_ROUTE_NAME]: '/events/subscribed/',
89
90
  [exports.EVENTS_HIGHLIGHT_ROUTE_NAME]: '/events/highlight/',
91
+ [exports.LIVESTREAM_ROUTE_NAME]: '/live/:slug/',
90
92
  };
@@ -0,0 +1,20 @@
1
+ import { SCLiveStreamType } from '@selfcommunity/types';
2
+ import { CacheStrategies } from '@selfcommunity/utils';
3
+ /**
4
+ :::info
5
+ This custom hook is used to fetch an liveStream object.
6
+ :::
7
+ * @param object
8
+ * @param object.id
9
+ * @param object.liveStream
10
+ * @param object.cacheStrategy
11
+ */
12
+ export default function useSCFetchLiveStream({ id, liveStream, cacheStrategy, }: {
13
+ id?: number | string;
14
+ liveStream?: SCLiveStreamType;
15
+ cacheStrategy?: CacheStrategies;
16
+ }): {
17
+ scLiveStream: SCLiveStreamType;
18
+ setSCLiveStream: (e: SCLiveStreamType) => void;
19
+ error: string;
20
+ };
@@ -0,0 +1,76 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const api_services_1 = require("@selfcommunity/api-services");
4
+ const utils_1 = require("@selfcommunity/utils");
5
+ const react_1 = require("react");
6
+ const use_deep_compare_effect_1 = require("use-deep-compare-effect");
7
+ const SCUserProvider_1 = require("../components/provider/SCUserProvider");
8
+ const Cache_1 = require("../constants/Cache");
9
+ const Errors_1 = require("../constants/Errors");
10
+ /**
11
+ :::info
12
+ This custom hook is used to fetch an liveStream object.
13
+ :::
14
+ * @param object
15
+ * @param object.id
16
+ * @param object.liveStream
17
+ * @param object.cacheStrategy
18
+ */
19
+ function useSCFetchLiveStream({ id = null, liveStream = null, cacheStrategy = utils_1.CacheStrategies.CACHE_FIRST, }) {
20
+ const __eventId = liveStream ? liveStream.id : id;
21
+ // CONTEXT
22
+ const scUserContext = (0, SCUserProvider_1.useSCUser)();
23
+ const authUserId = scUserContext.user ? scUserContext.user.id : null;
24
+ // CACHE
25
+ const __liveStreamCacheKey = (0, Cache_1.getLiveStreamObjectCacheKey)(__eventId);
26
+ const __liveStream = authUserId ? liveStream : (0, utils_1.objectWithoutProperties)(liveStream, ['subscription_status']);
27
+ const [scLiveStream, setScLiveStream] = (0, react_1.useState)(cacheStrategy !== utils_1.CacheStrategies.NETWORK_ONLY ? utils_1.LRUCache.get(__liveStreamCacheKey, __liveStream) : null);
28
+ const [error, setError] = (0, react_1.useState)(null);
29
+ /**
30
+ * Memoized setSCLiveStream (auto-subscription if need it)
31
+ */
32
+ const setSCLiveStream = (0, react_1.useMemo)(() => (e) => {
33
+ setScLiveStream(e);
34
+ utils_1.LRUCache.set(__liveStreamCacheKey, e);
35
+ }, [authUserId, setScLiveStream]);
36
+ /**
37
+ * Memoized fetchTag
38
+ */
39
+ const fetchLiveStream = (0, react_1.useMemo)(() => (id) => {
40
+ return api_services_1.http
41
+ .request({
42
+ url: api_services_1.Endpoints.GetLiveStreamInfo.url({ id }),
43
+ method: api_services_1.Endpoints.GetLiveStreamInfo.method,
44
+ })
45
+ .then((res) => {
46
+ if (res.status >= 300) {
47
+ return Promise.reject(res);
48
+ }
49
+ return Promise.resolve(res.data);
50
+ });
51
+ }, []);
52
+ /**
53
+ * If id attempt to get the liveStream by id
54
+ */
55
+ (0, react_1.useEffect)(() => {
56
+ if (id !== null && id !== undefined && !liveStream) {
57
+ fetchLiveStream(id)
58
+ .then((e) => {
59
+ setSCLiveStream(e);
60
+ })
61
+ .catch((err) => {
62
+ utils_1.LRUCache.delete(__liveStreamCacheKey);
63
+ setError(`LiveStream with id ${id} not found`);
64
+ utils_1.Logger.error(Errors_1.SCOPE_SC_CORE, `LiveStream with id ${id} not found`);
65
+ utils_1.Logger.error(Errors_1.SCOPE_SC_CORE, err.message);
66
+ });
67
+ }
68
+ }, [id, liveStream, authUserId]);
69
+ (0, use_deep_compare_effect_1.useDeepCompareEffectNoCheck)(() => {
70
+ if (liveStream) {
71
+ setSCLiveStream(liveStream);
72
+ }
73
+ }, [liveStream, authUserId]);
74
+ return { scLiveStream, setSCLiveStream, error };
75
+ }
76
+ exports.default = useSCFetchLiveStream;
@@ -64,6 +64,7 @@ import useSCFetchGroup from './hooks/useSCFetchGroup';
64
64
  import useSCFetchGroups from './hooks/useSCFetchGroups';
65
65
  import useSCFetchEvent from './hooks/useSCFetchEvent';
66
66
  import useSCFetchEvents from './hooks/useSCFetchEvents';
67
+ import useSCFetchLiveStream from './hooks/useSCFetchLiveStream';
67
68
  import useSCGoogleApiLoader from './hooks/useSCGoogleApiLoader';
68
69
  /**
69
70
  * Routing component
@@ -87,4 +88,4 @@ import * as Preferences from './constants/Preferences';
87
88
  /**
88
89
  * List all exports
89
90
  */
90
- export { SCUserContextType, SCFollowedCategoriesManagerType, SCContextProviderType, SCContextType, SCSettingsType, SCSessionType, SCSettingsManagerType, SCFollowedManagerType, SCFollowersManagerType, SCConnectionsManagerType, SCSubscribedIncubatorsManagerType, SCLocaleType, SCNotificationContextType, SCPreferencesContextType, SCThemeContextType, SCRoutingContextType, SCLocaleContextType, SCAlertMessagesContextType, SCThemeAvatarVariableType, SCThemeCategoryIconVariableType, SCThemeCategoryVariableType, SCThemeVariablesType, SCThemeType, SCSubscribedGroupsManagerType, SCSubscribedEventsManagerType, SCContext, SCUserContext, SCThemeContext, SCRoutingContext, SCLocaleContext, SCPreferencesContext, useSCContext, SCContextProvider, SCUserProvider, useSCUser, useSCPreferences, SCThemeProvider, useSCTheme, withSCTheme, getTheme, SCRoutingProvider, useSCRouting, SCLocaleProvider, useSCLocale, withSCLocale, SCPreferencesProvider, SCPreferences, SCFeatures, SCNotification, SCNotificationProvider, SCNotificationContext, useSCNotification, SCAlertMessagesProvider, SCAlertMessagesContext, useSCAlertMessages, Link, SCRoutes, SCCache, UserUtils, getEventStatus, Locale, Preferences, useSCFetchUser, useSCFetchUserProviders, useSCFetchVote, useSCFetchFeedObject, useSCFetchCommentObject, useSCFetchCommentObjects, useSCFetchCustomAdv, useSCFetchTag, useSCFetchAddressingTagList, useSCFetchCategory, useSCFetchCategories, useSCFetchIncubator, useSCMediaClick, useSCFetchContributors, useSCFetchFeed, useIsComponentMountedRef, usePreviousValue, useIsomorphicLayoutEffect, useEffectOnce, useNoInitialEffect, usePageVisibility, useSCFetchPrivateMessageSnippets, useSCFetchBroadcastMessages, useSCFetchUserBlockedBy, useSCUserIsBlocked, useSCFetchGroup, useSCFetchGroups, useSCFetchEvent, useSCFetchEvents, useSCGoogleApiLoader, };
91
+ export { SCUserContextType, SCFollowedCategoriesManagerType, SCContextProviderType, SCContextType, SCSettingsType, SCSessionType, SCSettingsManagerType, SCFollowedManagerType, SCFollowersManagerType, SCConnectionsManagerType, SCSubscribedIncubatorsManagerType, SCLocaleType, SCNotificationContextType, SCPreferencesContextType, SCThemeContextType, SCRoutingContextType, SCLocaleContextType, SCAlertMessagesContextType, SCThemeAvatarVariableType, SCThemeCategoryIconVariableType, SCThemeCategoryVariableType, SCThemeVariablesType, SCThemeType, SCSubscribedGroupsManagerType, SCSubscribedEventsManagerType, SCContext, SCUserContext, SCThemeContext, SCRoutingContext, SCLocaleContext, SCPreferencesContext, useSCContext, SCContextProvider, SCUserProvider, useSCUser, useSCPreferences, SCThemeProvider, useSCTheme, withSCTheme, getTheme, SCRoutingProvider, useSCRouting, SCLocaleProvider, useSCLocale, withSCLocale, SCPreferencesProvider, SCPreferences, SCFeatures, SCNotification, SCNotificationProvider, SCNotificationContext, useSCNotification, SCAlertMessagesProvider, SCAlertMessagesContext, useSCAlertMessages, Link, SCRoutes, SCCache, UserUtils, getEventStatus, Locale, Preferences, useSCFetchUser, useSCFetchUserProviders, useSCFetchVote, useSCFetchFeedObject, useSCFetchCommentObject, useSCFetchCommentObjects, useSCFetchCustomAdv, useSCFetchTag, useSCFetchAddressingTagList, useSCFetchCategory, useSCFetchCategories, useSCFetchIncubator, useSCMediaClick, useSCFetchContributors, useSCFetchFeed, useIsComponentMountedRef, usePreviousValue, useIsomorphicLayoutEffect, useEffectOnce, useNoInitialEffect, usePageVisibility, useSCFetchPrivateMessageSnippets, useSCFetchBroadcastMessages, useSCFetchUserBlockedBy, useSCUserIsBlocked, useSCFetchGroup, useSCFetchGroups, useSCFetchEvent, useSCFetchEvents, useSCFetchLiveStream, useSCGoogleApiLoader, };
package/lib/cjs/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useSCMediaClick = exports.useSCFetchIncubator = exports.useSCFetchCategories = exports.useSCFetchCategory = exports.useSCFetchAddressingTagList = exports.useSCFetchTag = exports.useSCFetchCustomAdv = exports.useSCFetchCommentObjects = exports.useSCFetchCommentObject = exports.useSCFetchFeedObject = exports.useSCFetchVote = exports.useSCFetchUserProviders = exports.useSCFetchUser = exports.Preferences = exports.Locale = exports.getEventStatus = exports.UserUtils = exports.SCCache = exports.SCRoutes = exports.Link = exports.useSCAlertMessages = exports.SCAlertMessagesContext = exports.SCAlertMessagesProvider = exports.useSCNotification = exports.SCNotificationContext = exports.SCNotificationProvider = exports.SCNotification = exports.SCFeatures = exports.SCPreferences = exports.SCPreferencesProvider = exports.withSCLocale = exports.useSCLocale = exports.SCLocaleProvider = exports.useSCRouting = exports.SCRoutingProvider = exports.getTheme = exports.withSCTheme = exports.useSCTheme = exports.SCThemeProvider = exports.useSCPreferences = exports.useSCUser = exports.SCUserProvider = exports.SCContextProvider = exports.useSCContext = exports.SCPreferencesContext = exports.SCLocaleContext = exports.SCRoutingContext = exports.SCThemeContext = exports.SCUserContext = exports.SCContext = void 0;
4
- exports.useSCGoogleApiLoader = exports.useSCFetchEvents = exports.useSCFetchEvent = exports.useSCFetchGroups = exports.useSCFetchGroup = exports.useSCUserIsBlocked = exports.useSCFetchUserBlockedBy = exports.useSCFetchBroadcastMessages = exports.useSCFetchPrivateMessageSnippets = exports.usePageVisibility = exports.useNoInitialEffect = exports.useEffectOnce = exports.useIsomorphicLayoutEffect = exports.usePreviousValue = exports.useIsComponentMountedRef = exports.useSCFetchFeed = exports.useSCFetchContributors = void 0;
4
+ exports.useSCGoogleApiLoader = exports.useSCFetchLiveStream = exports.useSCFetchEvents = exports.useSCFetchEvent = exports.useSCFetchGroups = exports.useSCFetchGroup = exports.useSCUserIsBlocked = exports.useSCFetchUserBlockedBy = exports.useSCFetchBroadcastMessages = exports.useSCFetchPrivateMessageSnippets = exports.usePageVisibility = exports.useNoInitialEffect = exports.useEffectOnce = exports.useIsomorphicLayoutEffect = exports.usePreviousValue = exports.useIsComponentMountedRef = exports.useSCFetchFeed = exports.useSCFetchContributors = void 0;
5
5
  const tslib_1 = require("tslib");
6
6
  /**
7
7
  * ContextProvider component
@@ -118,6 +118,8 @@ const useSCFetchEvent_1 = tslib_1.__importDefault(require("./hooks/useSCFetchEve
118
118
  exports.useSCFetchEvent = useSCFetchEvent_1.default;
119
119
  const useSCFetchEvents_1 = tslib_1.__importDefault(require("./hooks/useSCFetchEvents"));
120
120
  exports.useSCFetchEvents = useSCFetchEvents_1.default;
121
+ const useSCFetchLiveStream_1 = tslib_1.__importDefault(require("./hooks/useSCFetchLiveStream"));
122
+ exports.useSCFetchLiveStream = useSCFetchLiveStream_1.default;
121
123
  const useSCGoogleApiLoader_1 = tslib_1.__importDefault(require("./hooks/useSCGoogleApiLoader"));
122
124
  exports.useSCGoogleApiLoader = useSCGoogleApiLoader_1.default;
123
125
  /**
@@ -3,7 +3,7 @@ import { createContext, useContext, useMemo } from 'react';
3
3
  import { useSCContext } from '../SCContextProvider';
4
4
  import { SCPreferencesContext } from '../SCPreferencesProvider';
5
5
  import * as SCPreferences from '../../../constants/Preferences';
6
- import { CATEGORIES_LIST_ROUTE_NAME, CATEGORY_ROUTE_NAME, COMMENT_ROUTE_NAME, DISCUSSION_ROUTE_NAME, INCUBATOR_ROUTE_NAME, POST_ROUTE_NAME, STATUS_ROUTE_NAME, USER_NOTIFICATIONS_ROUTE_NAME, USER_PRIVATE_MESSAGES_ROUTE_NAME, USER_PROFILE_ROUTE_NAME, USER_PROFILE_SETTINGS_ROUTE_NAME, defaultRoutes, } from '../../../constants/Routes';
6
+ import { CATEGORIES_LIST_ROUTE_NAME, CATEGORY_ROUTE_NAME, COMMENT_ROUTE_NAME, DISCUSSION_ROUTE_NAME, INCUBATOR_ROUTE_NAME, POST_ROUTE_NAME, STATUS_ROUTE_NAME, USER_NOTIFICATIONS_ROUTE_NAME, USER_PRIVATE_MESSAGES_ROUTE_NAME, USER_PROFILE_ROUTE_NAME, USER_PROFILE_SETTINGS_ROUTE_NAME, defaultRoutes, LIVESTREAM_ROUTE_NAME, } from '../../../constants/Routes';
7
7
  /**
8
8
  * Creates Global Context
9
9
  *
@@ -70,6 +70,7 @@ export default function SCRoutingProvider({ children = null }) {
70
70
  [USER_NOTIFICATIONS_ROUTE_NAME]: normalizeUrl(scPreferencesContext.preferences[SCPreferences.CONFIGURATIONS_URL_TEMPLATE_NOTIFICATIONS].value),
71
71
  [USER_PRIVATE_MESSAGES_ROUTE_NAME]: normalizeUrl(scPreferencesContext.preferences[SCPreferences.CONFIGURATIONS_URL_TEMPLATE_USER_PRIVATE_MESSAGES].value),
72
72
  [INCUBATOR_ROUTE_NAME]: normalizeUrl(scPreferencesContext.preferences[SCPreferences.CONFIGURATIONS_URL_TEMPLATE_INCUBATOR].value),
73
+ [LIVESTREAM_ROUTE_NAME]: normalizeUrl(scPreferencesContext.preferences[SCPreferences.CONFIGURATIONS_URL_TEMPLATE_LIVE_STREAM].value),
73
74
  };
74
75
  }
75
76
  return {};
@@ -23,6 +23,9 @@ export declare const getEventObjectCacheKey: (id: any) => string;
23
23
  /** EVENTS OBJECT **/
24
24
  export declare const EVENTS_OBJECT_CACHE_PREFIX_KEY = "_evts_";
25
25
  export declare const getEventsObjectCacheKey: () => string;
26
+ /** EVENT OBJECT **/
27
+ export declare const LIVESTREAM_OBJECT_CACHE_PREFIX_KEY = "_liveStream_";
28
+ export declare const getLiveStreamObjectCacheKey: (id: any) => string;
26
29
  /** GROUP OBJECT **/
27
30
  export declare const GROUP_OBJECT_CACHE_PREFIX_KEY = "_grp_";
28
31
  export declare const getGroupObjectCacheKey: (id: any) => string;
@@ -69,6 +72,7 @@ export declare const USER_OTHER_EVENTS_STATE_CACHE_PREFIX_KEY = "_uOtherEvents_"
69
72
  export declare const USER_PARTECIPANTS_EVENTS_STATE_CACHE_PREFIX_KEY = "_uPartecipantsEvents_";
70
73
  export declare const USER_INVITED_EVENTS_STATE_CACHE_PREFIX_KEY = "_uInvitedEvents_";
71
74
  export declare const USER_REQUESTS_EVENTS_STATE_CACHE_PREFIX_KEY = "_uRequestsEvents_";
75
+ export declare const USER_LIVE_STREAM_CACHE_PREFIX_KEY = "_uUserLives_";
72
76
  export declare const EVENT_MEDIA_STATE_CACHE_PREFIX_KEY = "_eMedia_";
73
77
  export declare const USER_CONNECTIONS_TOOLS_STATE_CACHE_PREFIX_KEY = "_uConWidget_";
74
78
  export declare const USER_CONNECTIONS_REQUESTS_TOOLS_STATE_CACHE_PREFIX_KEY = "_uConReqWidget_";
@@ -23,6 +23,9 @@ export const getEventObjectCacheKey = (id) => `${EVENT_OBJECT_CACHE_PREFIX_KEY}$
23
23
  /** EVENTS OBJECT **/
24
24
  export const EVENTS_OBJECT_CACHE_PREFIX_KEY = '_evts_';
25
25
  export const getEventsObjectCacheKey = () => `${EVENTS_OBJECT_CACHE_PREFIX_KEY}`;
26
+ /** EVENT OBJECT **/
27
+ export const LIVESTREAM_OBJECT_CACHE_PREFIX_KEY = '_liveStream_';
28
+ export const getLiveStreamObjectCacheKey = (id) => `${LIVESTREAM_OBJECT_CACHE_PREFIX_KEY}${id}`;
26
29
  /** GROUP OBJECT **/
27
30
  export const GROUP_OBJECT_CACHE_PREFIX_KEY = '_grp_';
28
31
  export const getGroupObjectCacheKey = (id) => `${GROUP_OBJECT_CACHE_PREFIX_KEY}${id}`;
@@ -73,6 +76,7 @@ export const USER_OTHER_EVENTS_STATE_CACHE_PREFIX_KEY = '_uOtherEvents_';
73
76
  export const USER_PARTECIPANTS_EVENTS_STATE_CACHE_PREFIX_KEY = '_uPartecipantsEvents_';
74
77
  export const USER_INVITED_EVENTS_STATE_CACHE_PREFIX_KEY = '_uInvitedEvents_';
75
78
  export const USER_REQUESTS_EVENTS_STATE_CACHE_PREFIX_KEY = '_uRequestsEvents_';
79
+ export const USER_LIVE_STREAM_CACHE_PREFIX_KEY = '_uUserLives_';
76
80
  export const EVENT_MEDIA_STATE_CACHE_PREFIX_KEY = '_eMedia_';
77
81
  export const USER_CONNECTIONS_TOOLS_STATE_CACHE_PREFIX_KEY = '_uConWidget_';
78
82
  export const USER_CONNECTIONS_REQUESTS_TOOLS_STATE_CACHE_PREFIX_KEY = '_uConReqWidget_';
@@ -21,6 +21,7 @@ export declare const SCNotificationMapping: {
21
21
  16: SCNotificationTypologyType;
22
22
  37: SCNotificationTypologyType;
23
23
  105: SCNotificationTypologyType;
24
+ 26: SCNotificationTypologyType;
24
25
  50: SCNotificationTypologyType;
25
26
  51: SCNotificationTypologyType;
26
27
  52: SCNotificationTypologyType;
@@ -21,6 +21,7 @@ export const SCNotificationMapping = {
21
21
  16: SCNotificationTypologyType.FOLLOW,
22
22
  37: SCNotificationTypologyType.PRIVATE_MESSAGE,
23
23
  105: SCNotificationTypologyType.DELETE_PRIVATE_MESSAGE,
24
+ 26: SCNotificationTypologyType.LIVE_STREAM_STARTED,
24
25
  50: SCNotificationTypologyType.DELETED_FOR_ADVERTISING,
25
26
  51: SCNotificationTypologyType.DELETED_FOR_AGGRESSIVE,
26
27
  52: SCNotificationTypologyType.DELETED_FOR_VULGAR,
@@ -47,7 +48,7 @@ export const SCNotificationMapping = {
47
48
  31: SCNotificationTypologyType.USER_INVITED_TO_JOIN_GROUP,
48
49
  32: SCNotificationTypologyType.USER_REQUESTED_TO_JOIN_GROUP,
49
50
  33: SCNotificationTypologyType.USER_ACCEPTED_TO_JOIN_GROUP,
50
- 34: SCNotificationTypologyType.USER_ADDED_TO_GROUP
51
+ 34: SCNotificationTypologyType.USER_ADDED_TO_GROUP,
51
52
  };
52
53
  /**
53
54
  * Silent Snippet Notifications
@@ -117,6 +117,7 @@ export declare const CONFIGURATIONS_URL_TEMPLATE_USER_PROFILE_SETTINGS: string;
117
117
  export declare const CONFIGURATIONS_URL_TEMPLATE_NOTIFICATIONS: string;
118
118
  export declare const CONFIGURATIONS_URL_TEMPLATE_USER_PRIVATE_MESSAGES: string;
119
119
  export declare const CONFIGURATIONS_URL_TEMPLATE_INCUBATOR: string;
120
+ export declare const CONFIGURATIONS_URL_TEMPLATE_LIVE_STREAM: string;
120
121
  export declare const CONFIGURATIONS_APP_URL: string;
121
122
  export declare const CONFIGURATIONS_USER_METADATA_DEFINITIONS: string;
122
123
  export declare const CONFIGURATIONS_TAG_MANAGER_CONTAINER_ID: string;
@@ -136,6 +137,9 @@ export declare const CONFIGURATIONS_EVENTS_VISIBILITY_ENABLED: string;
136
137
  export declare const CONFIGURATIONS_EVENTS_PRIVATE_ENABLED: string;
137
138
  export declare const CONFIGURATIONS_ONBOARDING_ENABLED: string;
138
139
  export declare const CONFIGURATIONS_ONBOARDING_HIDDEN: string;
140
+ export declare const CONFIGURATIONS_LIVE_STREAM_ENABLED: string;
141
+ export declare const CONFIGURATIONS_LIVE_STREAM_ONLY_STAFF_ENABLED: string;
142
+ export declare const CONFIGURATIONS_SUBSCRIPTION_TIER: string;
139
143
  /**
140
144
  * PROVIDERS
141
145
  */
@@ -118,6 +118,7 @@ export const CONFIGURATIONS_URL_TEMPLATE_USER_PROFILE_SETTINGS = `${SCPreference
118
118
  export const CONFIGURATIONS_URL_TEMPLATE_NOTIFICATIONS = `${SCPreferenceSection.CONFIGURATIONS}.${SCPreferenceName.URL_TEMPLATE_NOTIFICATIONS}`;
119
119
  export const CONFIGURATIONS_URL_TEMPLATE_USER_PRIVATE_MESSAGES = `${SCPreferenceSection.CONFIGURATIONS}.${SCPreferenceName.URL_TEMPLATE_USER_PRIVATE_MESSAGES}`;
120
120
  export const CONFIGURATIONS_URL_TEMPLATE_INCUBATOR = `${SCPreferenceSection.CONFIGURATIONS}.${SCPreferenceName.URL_TEMPLATE_INCUBATOR}`;
121
+ export const CONFIGURATIONS_URL_TEMPLATE_LIVE_STREAM = `${SCPreferenceSection.CONFIGURATIONS}.${SCPreferenceName.URL_TEMPLATE_LIVE_STREAM}`;
121
122
  export const CONFIGURATIONS_APP_URL = `${SCPreferenceSection.CONFIGURATIONS}.${SCPreferenceName.APP_URL}`;
122
123
  export const CONFIGURATIONS_USER_METADATA_DEFINITIONS = `${SCPreferenceSection.CONFIGURATIONS}.${SCPreferenceName.USER_METADATA_DEFINITIONS}`;
123
124
  export const CONFIGURATIONS_TAG_MANAGER_CONTAINER_ID = `${SCPreferenceSection.CONFIGURATIONS}.${SCPreferenceName.TAG_MANAGER_CONTAINER_ID}`;
@@ -137,6 +138,9 @@ export const CONFIGURATIONS_EVENTS_VISIBILITY_ENABLED = `${SCPreferenceSection.C
137
138
  export const CONFIGURATIONS_EVENTS_PRIVATE_ENABLED = `${SCPreferenceSection.CONFIGURATIONS}.${SCPreferenceName.EVENTS_PRIVATE_ENABLED}`;
138
139
  export const CONFIGURATIONS_ONBOARDING_ENABLED = `${SCPreferenceSection.CONFIGURATIONS}.${SCPreferenceName.ONBOARDING_ENABLED}`;
139
140
  export const CONFIGURATIONS_ONBOARDING_HIDDEN = `${SCPreferenceSection.CONFIGURATIONS}.${SCPreferenceName.ONBOARDING_HIDDEN}`;
141
+ export const CONFIGURATIONS_LIVE_STREAM_ENABLED = `${SCPreferenceSection.CONFIGURATIONS}.${SCPreferenceName.LIVE_STREAM_ENABLED}`;
142
+ export const CONFIGURATIONS_LIVE_STREAM_ONLY_STAFF_ENABLED = `${SCPreferenceSection.CONFIGURATIONS}.${SCPreferenceName.LIVE_STREAM_ONLY_STAFF_ENABLED}`;
143
+ export const CONFIGURATIONS_SUBSCRIPTION_TIER = `${SCPreferenceSection.CONFIGURATIONS}.${SCPreferenceName.SUBSCRIPTION_TIER}`;
140
144
  /**
141
145
  * PROVIDERS
142
146
  */
@@ -264,6 +268,7 @@ export const DATA_TYPES = {
264
268
  [CONFIGURATIONS_URL_TEMPLATE_NOTIFICATIONS]: stringType,
265
269
  [CONFIGURATIONS_URL_TEMPLATE_USER_PRIVATE_MESSAGES]: stringType,
266
270
  [CONFIGURATIONS_URL_TEMPLATE_INCUBATOR]: stringType,
271
+ [CONFIGURATIONS_URL_TEMPLATE_LIVE_STREAM]: stringType,
267
272
  [CONFIGURATIONS_APP_URL]: stringType,
268
273
  [CONFIGURATIONS_USER_METADATA_DEFINITIONS]: stringType,
269
274
  [CONFIGURATIONS_TAG_MANAGER_CONTAINER_ID]: stringType,
@@ -283,6 +288,9 @@ export const DATA_TYPES = {
283
288
  [CONFIGURATIONS_EVENTS_PRIVATE_ENABLED]: booleanType,
284
289
  [CONFIGURATIONS_ONBOARDING_ENABLED]: booleanType,
285
290
  [CONFIGURATIONS_ONBOARDING_HIDDEN]: booleanType,
291
+ [CONFIGURATIONS_LIVE_STREAM_ENABLED]: booleanType,
292
+ [CONFIGURATIONS_LIVE_STREAM_ONLY_STAFF_ENABLED]: booleanType,
293
+ [CONFIGURATIONS_SUBSCRIPTION_TIER]: stringType,
286
294
  [PROVIDERS_APP_URL_ON_APP_STORE]: stringType,
287
295
  [PROVIDERS_APP_URL_ON_GOOGLE_PLAY]: stringType,
288
296
  [PROVIDERS_FACEBOOK_SIGNIN_ENABLED]: stringType,
@@ -41,6 +41,7 @@ export declare const EVENTS_ROUTE_NAME = "events";
41
41
  export declare const EVENTS_SUGGESTED_ROUTE_NAME = "events_suggested";
42
42
  export declare const EVENTS_SUBSCRIBED_ROUTE_NAME = "events_subscribed";
43
43
  export declare const EVENTS_HIGHLIGHT_ROUTE_NAME = "events_highlight";
44
+ export declare const LIVESTREAM_ROUTE_NAME = "live";
44
45
  /**
45
46
  * Default Routes
46
47
  * @type {{[p: string]: string, '[POST_ROUTE_NAME]': string, '[INCUBATOR_ROUTE_NAME]': string, '[LOYALTY_ROUTE_NAME]': string, '[USER_NOTIFICATION_ROUTE_NAME]': string, '[USER_PRIVATE_MESSAGES_ROUTE_NAME]': string, '[COMMENT_ROUTE_NAME]': string, '[DISCUSSION_ROUTE_NAME]': string, '[CATEGORIES_ROUTE_NAME]': string, '[USER_PROFILE_ROUTE_NAME]': string, '[CATEGORY_ROUTE_NAME]': string, '[USER_PROFILE_SETTINGS_ROUTE_NAME]': string, '[STATUS_ROUTE_NAME]': string}}
@@ -41,6 +41,7 @@ export const EVENTS_ROUTE_NAME = 'events';
41
41
  export const EVENTS_SUGGESTED_ROUTE_NAME = 'events_suggested';
42
42
  export const EVENTS_SUBSCRIBED_ROUTE_NAME = 'events_subscribed';
43
43
  export const EVENTS_HIGHLIGHT_ROUTE_NAME = 'events_highlight';
44
+ export const LIVESTREAM_ROUTE_NAME = 'live';
44
45
  /**
45
46
  * Default Routes
46
47
  * @type {{[p: string]: string, '[POST_ROUTE_NAME]': string, '[INCUBATOR_ROUTE_NAME]': string, '[LOYALTY_ROUTE_NAME]': string, '[USER_NOTIFICATION_ROUTE_NAME]': string, '[USER_PRIVATE_MESSAGES_ROUTE_NAME]': string, '[COMMENT_ROUTE_NAME]': string, '[DISCUSSION_ROUTE_NAME]': string, '[CATEGORIES_ROUTE_NAME]': string, '[USER_PROFILE_ROUTE_NAME]': string, '[CATEGORY_ROUTE_NAME]': string, '[USER_PROFILE_SETTINGS_ROUTE_NAME]': string, '[STATUS_ROUTE_NAME]': string}}
@@ -84,4 +85,5 @@ export const defaultRoutes = {
84
85
  [EVENT_ROUTE_NAME]: '/event/:id/:slug/',
85
86
  [EVENTS_SUBSCRIBED_ROUTE_NAME]: '/events/subscribed/',
86
87
  [EVENTS_HIGHLIGHT_ROUTE_NAME]: '/events/highlight/',
88
+ [LIVESTREAM_ROUTE_NAME]: '/live/:slug/',
87
89
  };
@@ -0,0 +1,20 @@
1
+ import { SCLiveStreamType } from '@selfcommunity/types';
2
+ import { CacheStrategies } from '@selfcommunity/utils';
3
+ /**
4
+ :::info
5
+ This custom hook is used to fetch an liveStream object.
6
+ :::
7
+ * @param object
8
+ * @param object.id
9
+ * @param object.liveStream
10
+ * @param object.cacheStrategy
11
+ */
12
+ export default function useSCFetchLiveStream({ id, liveStream, cacheStrategy, }: {
13
+ id?: number | string;
14
+ liveStream?: SCLiveStreamType;
15
+ cacheStrategy?: CacheStrategies;
16
+ }): {
17
+ scLiveStream: SCLiveStreamType;
18
+ setSCLiveStream: (e: SCLiveStreamType) => void;
19
+ error: string;
20
+ };
@@ -0,0 +1,73 @@
1
+ import { Endpoints, http } from '@selfcommunity/api-services';
2
+ import { CacheStrategies, Logger, LRUCache, objectWithoutProperties } from '@selfcommunity/utils';
3
+ import { useEffect, useMemo, useState } from 'react';
4
+ import { useDeepCompareEffectNoCheck } from 'use-deep-compare-effect';
5
+ import { useSCUser } from '../components/provider/SCUserProvider';
6
+ import { getLiveStreamObjectCacheKey } from '../constants/Cache';
7
+ import { SCOPE_SC_CORE } from '../constants/Errors';
8
+ /**
9
+ :::info
10
+ This custom hook is used to fetch an liveStream object.
11
+ :::
12
+ * @param object
13
+ * @param object.id
14
+ * @param object.liveStream
15
+ * @param object.cacheStrategy
16
+ */
17
+ export default function useSCFetchLiveStream({ id = null, liveStream = null, cacheStrategy = CacheStrategies.CACHE_FIRST, }) {
18
+ const __eventId = liveStream ? liveStream.id : id;
19
+ // CONTEXT
20
+ const scUserContext = useSCUser();
21
+ const authUserId = scUserContext.user ? scUserContext.user.id : null;
22
+ // CACHE
23
+ const __liveStreamCacheKey = getLiveStreamObjectCacheKey(__eventId);
24
+ const __liveStream = authUserId ? liveStream : objectWithoutProperties(liveStream, ['subscription_status']);
25
+ const [scLiveStream, setScLiveStream] = useState(cacheStrategy !== CacheStrategies.NETWORK_ONLY ? LRUCache.get(__liveStreamCacheKey, __liveStream) : null);
26
+ const [error, setError] = useState(null);
27
+ /**
28
+ * Memoized setSCLiveStream (auto-subscription if need it)
29
+ */
30
+ const setSCLiveStream = useMemo(() => (e) => {
31
+ setScLiveStream(e);
32
+ LRUCache.set(__liveStreamCacheKey, e);
33
+ }, [authUserId, setScLiveStream]);
34
+ /**
35
+ * Memoized fetchTag
36
+ */
37
+ const fetchLiveStream = useMemo(() => (id) => {
38
+ return http
39
+ .request({
40
+ url: Endpoints.GetLiveStreamInfo.url({ id }),
41
+ method: Endpoints.GetLiveStreamInfo.method,
42
+ })
43
+ .then((res) => {
44
+ if (res.status >= 300) {
45
+ return Promise.reject(res);
46
+ }
47
+ return Promise.resolve(res.data);
48
+ });
49
+ }, []);
50
+ /**
51
+ * If id attempt to get the liveStream by id
52
+ */
53
+ useEffect(() => {
54
+ if (id !== null && id !== undefined && !liveStream) {
55
+ fetchLiveStream(id)
56
+ .then((e) => {
57
+ setSCLiveStream(e);
58
+ })
59
+ .catch((err) => {
60
+ LRUCache.delete(__liveStreamCacheKey);
61
+ setError(`LiveStream with id ${id} not found`);
62
+ Logger.error(SCOPE_SC_CORE, `LiveStream with id ${id} not found`);
63
+ Logger.error(SCOPE_SC_CORE, err.message);
64
+ });
65
+ }
66
+ }, [id, liveStream, authUserId]);
67
+ useDeepCompareEffectNoCheck(() => {
68
+ if (liveStream) {
69
+ setSCLiveStream(liveStream);
70
+ }
71
+ }, [liveStream, authUserId]);
72
+ return { scLiveStream, setSCLiveStream, error };
73
+ }