Index

src/modules/session/actions/session.actions.ts

changeLanguage
Default value : createAction(`[${starkSessionStoreKey}] Change Language`, props<{ languageId: string }>())

Triggered when the StarkSessionService setCurrentLanguage() method is called, just before changing the current session's language.

Parameter:

  • languageId - The target language to change to.
changeLanguageFailure
Default value : createAction(`[${starkSessionStoreKey}] Change Language Failure`, props<{ error: any }>())

Triggered when the change of the current session's language failed.

Parameter:

  • error - The error that caused the language change to fail.
changeLanguageSuccess
Default value : createAction(`[${starkSessionStoreKey}] Change Language Success`, props<{ languageId: string }>())

Triggered when the current session's language has been successfully changed by calling the StarkSessionService setCurrentLanguage() method.

Parameter:

  • languageId - The target language that was successfully changed to.
destroySession
Default value : createAction(`[${starkSessionStoreKey}] Destroy Session`)

Triggered before the process to destroy the user's session starts right after the HTTP logout call has been sent.

This action is dispatched whenever the user is going to be logged out due to:

  1. Manually clicking in the App Logout component (provided by the StarkUI package)
  2. Calling the StarkSessionService logout() method.
  3. Closing the browser tab.
  4. Being inactive for a certain period of time reaching the idle timeout defined by the application's StarkApplicationConfig sessionTimeout.
destroySessionSuccess
Default value : createAction(`[${starkSessionStoreKey}] Destroy Session Success`)

Triggered when the destruction of the user's session has finished successfully. This action is the last action to be dispatched when the user is logged out (either manually by himself or automatically due to inactivity).

initializeSession
Default value : createAction(`[${starkSessionStoreKey}] Initialize Session`, props<{ user: StarkUser }>())

Triggered by the StarkSessionService login() method before the process to initialize the session for the given user starts.

Parameter:

  • user - The user whose session will be initialized.
initializeSessionSuccess
Default value : createAction(`[${starkSessionStoreKey}] Initialize Session Success`)

Triggered when the initialization of the user's session has finished successfully.

sessionLogout
Default value : createAction(`[${starkSessionStoreKey}] Session Logout`)

Triggered when the user is about to be logged out and the HTTP logout call to be sent. This action is called before the process to destroy the user's session starts.

This action is dispatched by the StarkSessionService logout() method or in case the browser tab was closed and is dispatched before the destroySession action.

sessionTimeoutCountdownFinish
Default value : createAction(`[${starkSessionStoreKey}] Session Timeout Countdown Finish`)

Triggered when the countdown to automatically destroy the user's session has finished. In this case the user will be automatically logged out.

sessionTimeoutCountdownStart
Default value : createAction( `[${starkSessionStoreKey}] Session Timeout Countdown Start`, props<{ countdown: number }>() )

Triggered when the countdown to automatically destroy the user's session due to inactivity starts.

The countdown is defined in the application's StarkApplicationConfig sessionTimeoutWarningPeriod.

By default is set to 15 seconds.

Parameter:

  • countdown - The countdown until the session will be automatically destroyed.
sessionTimeoutCountdownStop
Default value : createAction(`[${starkSessionStoreKey}] Session Timeout Countdown Stop`)

Triggered when the countdown to automatically destroy the user's session due to inactivity stops.

This countdown stops automatically when the user is active again and no longer idle.

userActivityTrackingPause
Default value : createAction(`[${starkSessionStoreKey}] User Activity Tracking Pause`)

Triggered by the StarkSessionService pauseUserActivityTracking() method when the user activity tracking is paused (automatically done by the StarkSessionService).

userActivityTrackingResume
Default value : createAction(`[${starkSessionStoreKey}] User Activity Tracking Resume`)

Triggered by the StarkSessionService resumeUserActivityTracking() method when the user activity tracking is resumed (automatically done by the StarkSessionService).

src/common/translations/common-translations.ts

commonCoreTranslations
Type : object[]
Default value : []

Common translations for features available in Stark-Core package

src/modules/session/components/app-container.component.ts

componentName
Type : string
Default value : "stark-app-container"

Name of the component

src/modules/user/repository/user.repository.ts

DEFAULT_USER_PROFILE_RESOURCE_PATH
Type : string
Default value : "security/userprofile"

The resource path to be used for the User profile fetching if no other resource path is specified.

src/modules/user/actions/user.actions.ts

fetchUserProfile
Default value : createAction(`[${starkUserStoreKey}] Get User`)

Triggered when the fetchUserProfile() method is called, just before performing the HTTP to the REST API.

fetchUserProfileFailure
Default value : createAction( `[${starkUserStoreKey}] Fetch User Profile Failure`, props<{ error: StarkHttpErrorWrapper | Error }>() )

Triggered when the user profile has been successfully fetched from the REST API.

Parameter:

  • error - The error that caused the user fetching to fail.
fetchUserProfileSuccess
Default value : createAction(`[${starkUserStoreKey}] Fetch User Profile Success`, props<{ user: StarkUser }>())

Triggered when the user profile has been successfully fetched from the REST API.

Parameter:

  • user - The user fetched from the REST API
getAllUsers
Default value : createAction(`[${starkUserStoreKey}] Get All Users`)

Triggered when the getAllUsers() method is called. The getAllUsers() method should only be used in development.

getAllUsersFailure
Default value : createAction(`[${starkUserStoreKey}] Get All Users Failure`, props<{ message: string }>())

Triggered when there are no users defined in the mock data.

Parameter:

  • message - The message describing all the users failure.
getAllUsersSuccess
Default value : createAction(`[${starkUserStoreKey}] Get All Users Success`, props<{ users: StarkUser[] }>())

Triggered when the fetchUserProfile() method is called, just before performing the HTTP to the REST API.

Parameter:

  • users - The users retrieved from the the mock data.
starkUserStoreKey
Type : string
Default value : "StarkUser"

Key defined to find the service in a store

src/modules/logging/actions/logging.actions.ts

flushLogMessages
Default value : createAction(`[${starkLoggingStoreKey}] Flush Log`, props<{ numberOfMessagesToFlush: number }>())

Persists the log messages in the redux store to the back-end

Parameter:

  • numberOfMessagesToFlush - The number of messages to flush
logMessage
Default value : createAction(`[${starkLoggingStoreKey}] Log Message`, props<{ message: StarkLogMessage }>())

Store a debug/info/warning/error message

Parameter:

  • message - The message to log
setLoggingApplicationId
Default value : createAction( `[${starkLoggingStoreKey}] Set Logging Application Id`, props<{ applicationId: string }>() )

Add the Application Name to the logging object

Parameter:

  • applicationId - The id of the application

src/modules/logging/reducers/logging.reducer.ts

INITIAL_LOGGING_STATE
Type : Readonly<StarkLogging>
Default value : { uuid: "", applicationId: "", messages: [] }

Defines the initial state of the reducer

reducer
Default value : createReducer<StarkLogging, StarkLoggingActions.Types>( INITIAL_LOGGING_STATE, on(StarkLoggingActions.logMessage, (state, action) => ({ ...state, messages: [...state.messages, action.message] })), on(StarkLoggingActions.flushLogMessages, (state, action) => { const numberOfMessagesToFlush: number = action.numberOfMessagesToFlush; const numberOfMessages: number = state.messages.length; const messages: StarkLogMessage[] = state.messages.slice(numberOfMessagesToFlush, numberOfMessages); return { ...state, messages: [...messages] }; }), on(StarkLoggingActions.setLoggingApplicationId, (state, action) => ({ ...state, applicationId: action.applicationId })) )

Definition of the reducer using createReducer method.

src/modules/session/reducers/session.reducer.ts

INITIAL_SESSION_STATE
Type : StarkSession
Default value : new StarkSessionImpl()

Defines the initial state of the reducer

reducer
Default value : createReducer<StarkSession, StarkSessionActions.Types>( INITIAL_SESSION_STATE, on(StarkSessionActions.changeLanguageSuccess, (state, action) => ({ ...state, currentLanguage: action.languageId })), on(StarkSessionActions.initializeSession, (state, action) => ({ ...state, user: action.user })), on(StarkSessionActions.destroySession, (state) => ({ ...state, user: undefined })) )

Definition of the reducer using createReducer method.

src/modules/settings/reducers/settings.reducer.ts

INITIAL_SETTINGS_STATE
Type : StarkSettings
Default value : new StarkSettings()

Defines the initial state of the reducer

reducer
Default value : createReducer<StarkSettings, StarkSettingsActions.Types>( INITIAL_SETTINGS_STATE, on(StarkSettingsActions.setPreferredLanguage, (state, action) => ({ ...state, preferredLanguage: action.language })) )

Definition of the reducer using createReducer method.

src/modules/routing/actions/routing.actions.ts

navigate
Default value : createAction( `[${starkRoutingStoreKey}] Navigate`, props<{ currentState: string; newState: string; params?: RawParams; options?: TransitionOptions }>() )

Triggered when the StarkRoutingService navigateTo() method is called, just before starting the navigation.

Parameters:

  • currentState - Name of the current state before the navigation starts.
  • newState - Name of the state to be navigated to.
  • params - State params object to be passed to the navigated state.
  • options - Transition options object to change the behavior of the transition.
navigateFailure
Default value : createAction( `[${starkRoutingStoreKey}] Navigate Failure`, props<{ currentState: string; newState: string; params?: RawParams; error: string }>() )

Triggered when a navigation failed.

This action is dispatched for any navigation, including those navigations triggered not by the StarkRoutingService navigateTo() method but by any other mean such as menu links or by direct usage of the router library API.

Parameters:

  • currentState - Name of the current state before the navigation started.
  • newState - Name of the state tried to be navigated to.
  • params - State params object passed to the navigated state.
  • error - The error describing the reason of the navigation failure.
navigateRejection
Default value : createAction( `[${starkRoutingStoreKey}] Navigate Rejection`, props<{ currentState: string; newState: string; params: RawParams; reason: string }>() )

Triggered when a navigation was intentionally rejected with a known rejection reason added via the StarkRoutingService addKnownNavigationRejectionCause() method.

The custom logic to intentionally reject a transition can be normally be injected via a transition Hook by calling the StarkRoutingService addTransitionHook() method.

Parameters:

  • currentState - Name of the current state before the navigation started.
  • newState - Name of the state tried to be navigated to.
  • params - State params object passed to the navigated state.
  • reason - The reason describing why the navigation was rejected. This is normally a reason already known by the developer.
navigateSuccess
Default value : createAction( `[${starkRoutingStoreKey}] Navigate Success`, props<{ previousState: string; currentState: string; params?: RawParams }>() )

Triggered when a navigation has succeeded and finished.

This action is dispatched for any navigation, including those navigations triggered not by the StarkRoutingService navigateTo() method but by any other mean such as StarkRoutingService navigateToPrevious(), StarkRoutingService navigateToHome(), StarkRoutingService reload(), routing directives for menu links or by direct usage of the router library API.

Parameters:

  • previousState - Name of the initial state where the navigation was started.
  • currentState - Name of the state that was navigated to.
  • params - State params object that was passed to the navigated state.
navigationHistoryLimitReached
Default value : createAction(`[${starkRoutingStoreKey}] Navigation History Limit Reached`)

Triggered when the StarkRoutingService navigateToPrevious() method is called and there are no more previous states in the history to navigate to.

This action is just triggered in case the reload was done by calling the StarkRoutingService reload() method.

reload
Default value : createAction(`[${starkRoutingStoreKey}] Reload`, props<{ state: string }>())

Triggered when the StarkRoutingService reload() method is called, just before starting the state reloading.

Parameter:

  • state - Name of the state to be reloaded.
reloadFailure
Default value : createAction(`[${starkRoutingStoreKey}] Reload Failure`, props<{ state: string; params: RawParams }>())

Triggered when a reload succeeded and finished.

This action is dispatched for any navigation, including those navigations triggered not by the StarkRoutingService navigateTo() method but by any other mean such as menu links or by direct usage of the router library API.

Parameters:

  • state - Name of the state that was reloaded.
  • params - State params object passed to the reloaded state.
reloadSuccess
Default value : createAction(`[${starkRoutingStoreKey}] Reload Success`, props<{ state: string; params: RawParams }>())

Triggered when a reload succeeded and finished.

This action is dispatched for any navigation, including those navigations triggered not by the StarkRoutingService navigateTo() method but by any other mean such as menu links or by direct usage of the router library API.

Parameters:

  • state - Name of the state that was reloaded.
  • params - State params object passed to the reloaded state.
starkRoutingStoreKey
Type : string
Default value : "StarkRouting"

Key defined to find the service in a store

src/modules/settings/actions/settings.actions.ts

persistPreferredLanguage
Default value : createAction( `[${starkSettingsStoreKey}] Persist Preferred Language`, props<{ language: string }>() )

Action that requires to persist the given language locally so that the language remains the same when the user comes back

Parameter:

  • language - The language to persist
persistPreferredLanguageFailure
Default value : createAction( `[${starkSettingsStoreKey}] Persist Preferred Language Failure`, props<{ error: any }>() )

Action that notifies the application that the preferred language could not be persisted.

Parameter:

  • error - The reason why the preferred language could not be persisted
persistPreferredLanguageSuccess
Default value : createAction(`[${starkSettingsStoreKey}] Persist Preferred Language Success`)

Action that notifies the application that the preferred language was successfully persisted.

setPreferredLanguage
Default value : createAction(`[${starkSettingsStoreKey}] Set Preferred Language`, props<{ language: string }>())

Action that notifies the application that the preferred language should be changed.

Parameter:

  • language - The new preferred language

src/modules/logging/reducers/index.ts

selectStarkLogging
Default value : createSelector( createFeatureSelector<StarkLoggingState>(starkLoggingStoreKey), (state: StarkLoggingState) => state.logging )

NGRX Selector for the StarkLoggingModule's state

starkLoggingReducers
Type : ActionReducerMap<StarkLoggingState, StarkLoggingActions.Types>
Default value : { /** * Reducer assigned to the state's `logging` property */ logging: loggingReducer }

Reducers assigned to each property of the StarkLoggingModule's state

src/modules/session/reducers/index.ts

selectStarkSession
Default value : createSelector( createFeatureSelector<StarkSessionState>(starkSessionStoreKey), (state: StarkSessionState) => state.session )

NGRX Selector for the StarkSessionModule's state

starkSessionReducers
Type : ActionReducerMap<StarkSessionState, StarkSessionActions.Types>
Default value : { /** * Reducer assigned to the state's `session` property */ session: sessionReducer }

Reducers assigned to each property of the StarkSessionModule's state

src/modules/settings/reducers/index.ts

selectStarkSettings
Default value : createSelector( createFeatureSelector<StarkSettingsState>(starkSettingsStoreKey), (state: StarkSettingsState) => state.settings )

NGRX Selector for the StarkSettingsModule's state

starkSettingsReducers
Type : ActionReducerMap<StarkSettingsState, StarkSettingsActions.Types>
Default value : { /** * Reducer assigned to the state's `settings` property */ settings: settingsReducer }

Reducers assigned to each property of the StarkSettingsModule's state

src/modules/session/routes.ts

SESSION_STATES
Type : Ng2StateDeclaration[]
Default value : [ { name: starkAppInitStateName, // parent state for any initialization state (used to show/hide the main app component) abstract: true, resolve: [ { token: "targetRoute", deps: [Location, Transition, STARK_ROUTING_SERVICE], resolveFn: resolveTargetRoute }, { token: "targetState", deps: ["targetRoute"], resolveFn: resolveTargetState }, { token: "targetStateParams", deps: ["targetRoute"], resolveFn: resolveTargetStateParams } ] }, { name: starkAppExitStateName, // parent state for any exit state (used to show/hide the main app component) abstract: true } ]

States defined by StarkSessionModule

src/configuration/entities/application/app-config.entity.intf.ts

STARK_APP_CONFIG
Type : InjectionToken<StarkApplicationConfig>
Default value : new InjectionToken<StarkApplicationConfig>("STARK_APP_CONFIG")

://v12.angular.io/api/core/InjectionToken|InjectionTokenhttps used to provide the StarkApplicationConfig

src/configuration/entities/metadata/application-metadata.entity.intf.ts

STARK_APP_METADATA
Type : InjectionToken<StarkApplicationMetadata>
Default value : new InjectionToken<StarkApplicationMetadata>( "STARK_APP_METADATA" )

://v12.angular.io/api/core/InjectionToken|InjectionTokenhttps used to provide the StarkApplicationMetadata

src/util/http.util.ts

STARK_HTTP_PARAM_ENCODER
Type : HttpParameterCodec
Default value : new StarkHttpParameterCodec()

An instance of the StarkHttpParameterCodec which is internally used by the StarkHttpUtil convertStarkQueryParamsIntoHttpParams method.

See ://github.com/NationalBankBelgium/stark/issues/1130https

src/modules/http/services/http.service.intf.ts

STARK_HTTP_SERVICE
Type : InjectionToken<StarkHttpService<any>>
Default value : new InjectionToken<StarkHttpService<any>>(starkHttpServiceName)

://v12.angular.io/api/core/InjectionToken|InjectionTokenhttps used to provide the StarkHttpService

src/modules/logging/services/logging.service.intf.ts

STARK_LOGGING_SERVICE
Type : InjectionToken<StarkLoggingService>
Default value : new InjectionToken<StarkLoggingService>(starkLoggingServiceName)

://v12.angular.io/api/core/InjectionToken|InjectionTokenhttps used to provide the StarkLoggingService

src/configuration/entities/mock-data/mock-data.entity.intf.ts

STARK_MOCK_DATA
Type : InjectionToken<StarkMockData>
Default value : new InjectionToken<StarkMockData>("STARK_MOCK_DATA")

://v12.angular.io/api/core/InjectionToken|InjectionTokenhttps used to provide the StarkMockData

src/modules/routing/services/routing.service.intf.ts

STARK_ROUTING_SERVICE
Type : InjectionToken<StarkRoutingService>
Default value : new InjectionToken<StarkRoutingService>(starkRoutingServiceName)

://v12.angular.io/api/core/InjectionToken|InjectionTokenhttps used to provide the StarkRoutingService

src/modules/session/entities/session-config.entity.intf.ts

STARK_SESSION_CONFIG
Type : InjectionToken<StarkSessionConfig>
Default value : new InjectionToken<StarkSessionConfig>("StarkSessionConfig")

://v12.angular.io/api/core/InjectionToken|InjectionTokenhttps used to provide the StarkSessionConfig

src/modules/session/services/session.service.intf.ts

STARK_SESSION_SERVICE
Type : InjectionToken<StarkSessionService>
Default value : new InjectionToken<StarkSessionService>(starkSessionServiceName)

://v12.angular.io/api/core/InjectionToken|InjectionTokenhttps used to provide the StarkSessionService

src/modules/settings/services/settings.service.intf.ts

STARK_SETTINGS_SERVICE
Type : InjectionToken<StarkSettingsService>
Default value : new InjectionToken<StarkSettingsService>( starkSettingsServiceName )

://v12.angular.io/api/core/InjectionToken|InjectionTokenhttps used to provide the StarkSettingsService

src/modules/user/entities/user-module-config.entity.intf.ts

STARK_USER_PROFILE_RESOURCE_PATH
Default value : new InjectionToken<StarkUserModuleConfig["userProfileResourcePath"]>( "StarkUserProfileResourcePath" )

://v12.angular.io/api/core/InjectionToken|InjectionTokenhttps used to provide the StarkUserModuleConfig userProfileResourcePath

src/modules/user/repository/user.repository.intf.ts

STARK_USER_REPOSITORY
Type : InjectionToken<StarkUserRepository>
Default value : new InjectionToken<StarkUserRepository>(starkUserRepositoryName)

://v12.angular.io/api/core/InjectionToken|InjectionTokenhttps used to provide the StarkUserRepository

starkUserRepositoryName
Type : string
Default value : "StarkUserRepository"

Name of the User Repository, in case injection is needed

src/modules/user/services/user.service.intf.ts

STARK_USER_SERVICE
Type : InjectionToken<StarkUserService>
Default value : new InjectionToken<StarkUserService>(starkUserServiceName)

://v12.angular.io/api/core/InjectionToken|InjectionTokenhttps used to provide the StarkUserService

src/modules/xsrf/services/xsrf-config.intf.ts

STARK_XSRF_CONFIG
Type : InjectionToken<StarkXSRFConfig>
Default value : new InjectionToken<StarkXSRFConfig>("StarkXSRFConfig")

://v12.angular.io/api/core/InjectionToken|InjectionTokenhttps used to provide the StarkXSRFConfig

src/modules/xsrf/services/xsrf.service.intf.ts

STARK_XSRF_SERVICE
Type : InjectionToken<StarkXSRFService>
Default value : new InjectionToken<StarkXSRFService>(starkXSRFServiceName)

://v12.angular.io/api/core/InjectionToken|InjectionTokenhttps used to provide the StarkXSRFService

src/modules/session/constants/session-states.ts

starkAppExitStateName
Type : string
Default value : "starkAppExit"

Name of the exit states of the application

starkAppInitStateName
Type : string
Default value : "starkAppInit"

Name of the initialization states of the application

starkLoginStateName
Type : miscellaneous
Default value : starkAppInitStateName + ".starkLogin"

Name of the login state of the application

starkLoginStateUrl
Type : string
Default value : "/starkLogin"

URL of the login state of the application

starkPreloadingStateName
Type : string
Default value : starkAppInitStateName + ".starkPreloading"

Name of the Preloading state of the application

starkPreloadingStateUrl
Type : string
Default value : "/starkPreloading"

URL of the Preloading state of the application

starkSessionExpiredStateName
Type : string
Default value : starkAppExitStateName + ".starkSessionExpired"

Name of the SessionExpired state of the application

starkSessionExpiredStateUrl
Type : string
Default value : "/starkSessionExpired"

URL of the SessionExpired state of the application

starkSessionLogoutStateName
Type : string
Default value : starkAppExitStateName + ".starkSessionLogout"

Name of the SessionLogout state of the application

starkSessionLogoutStateUrl
Type : string
Default value : "/starkSessionLogout"

URL of the SessionLogout state of the application

src/validation/decorators/array-is-valid/array-is-valid.validator.decorator.ts

starkArrayIsValidValidatorName
Type : string
Default value : "starkArrayIsValid"

Name of the validator, in case injection is needed.

src/modules/logging/constants/logging-store-key.ts

starkLoggingStoreKey
Type : string
Default value : "StarkLogging"

The store key will allow the application to find the reducer in the store

src/validation/decorators/map-is-valid/map-is-valid.validator.decorator.ts

starkMapIsValidValidatorName
Type : string
Default value : "starkMapIsValid"

Name of the validator, in case injection is needed.

src/validation/validators/map-not-empty/map-not-empty.validator.fn.ts

starkMapNotEmptyValidatorName
Type : string
Default value : "starkMapNotEmpty"

Name of the starkMapNotEmpty validator.

src/modules/session/constants/session-store-key.ts

starkSessionStoreKey
Type : string
Default value : "StarkSession"

Key defined to find the service in a store

src/modules/settings/constants/settings-store-key.ts

starkSettingsStoreKey
Type : string
Default value : "StarkSettings"

Key defined to find the service in a store

src/serialization/string-map.ts

stringMap
Type : Function
Default value : (targetType: any): ISerializable => ({ Serialize: (map: Map<string, any>): object => { const obj: object = {}; map.forEach((value: any, key: string) => { obj[key] = Serialize(value); }); return obj; }, Deserialize: (json: any): Map<string, any> => { const map: Map<string, any> = new Map<string, unknown>(); for (const key of Object.keys(json)) { map.set(key, Deserialize(json[key], targetType)); } return map; } })

Solution proposed by @weichx for Maps having string keys in this way the custom behavior for handling ES6 Maps is defined once instead of doing it every time a Map is used.

See:

  • ://github.com/weichx/cerialize/issues/32https
  • ://github.com/weichx/cerialize/issues/33https

src/modules/error-handling/actions/error-handling.actions.ts

unhandledError
Default value : createAction("[StarkErrorHandling] Unhandled Error", props<{ error: any }>())

Action that requires to display an error message as a toast notification

Parameter:

  • error - The error to display

results matching ""

    No results matching ""