You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
106 lines
2.3 KiB
106 lines
2.3 KiB
|
|
import { EntityStore } from './entities'
|
|
|
|
export enum NotificationType {
|
|
Info = 'info',
|
|
Success = 'success',
|
|
Error = 'error',
|
|
Welcome = 'welcome',
|
|
}
|
|
|
|
export enum RequestKey {
|
|
Authenticate = 'authenticate',
|
|
CreateApp = 'create_app',
|
|
CreateGroup = 'create_group',
|
|
CreateInvitation = 'create_invitation',
|
|
FetchAppAvailability = 'fetch_app_availability',
|
|
FetchApp = 'fetch_app',
|
|
FetchApps = 'fetch_apps',
|
|
FetchGroup = 'fetch_group',
|
|
FetchGroupAvailability = 'fetch_group_availability',
|
|
FetchGroupLogs = 'fetch_group_logs',
|
|
FetchGroupMembers = 'fetch_group_members',
|
|
FetchGroups = 'fetch_groups',
|
|
FetchInvitations = 'fetch_invitations',
|
|
FetchSelfApps = 'fetch_self_apps',
|
|
FetchUserAvailability = 'fetch_user_availability',
|
|
Register = 'register',
|
|
UpdateGroup = 'update_group',
|
|
UpdateSelf = 'update_self',
|
|
}
|
|
|
|
export type FormValue = string | number | boolean
|
|
|
|
export interface FormNotification {
|
|
field?: string
|
|
type: NotificationType
|
|
message: string
|
|
}
|
|
|
|
export interface APIRequest {
|
|
id: RequestKey
|
|
fetching: boolean
|
|
started: number
|
|
succeeded: boolean
|
|
}
|
|
|
|
export interface APIRequestCollection {
|
|
[id: string]: APIRequest
|
|
}
|
|
|
|
export interface Notification {
|
|
id: string
|
|
type: NotificationType
|
|
content: string
|
|
auto: boolean
|
|
}
|
|
|
|
export interface AuthenticationState {
|
|
checked: boolean
|
|
authenticated: boolean
|
|
userId?: string
|
|
}
|
|
|
|
export interface MenuState {
|
|
collapsed: boolean
|
|
}
|
|
|
|
export interface FormField {
|
|
name: string
|
|
apiName?: string
|
|
value?: FormValue
|
|
notification?: FormNotification
|
|
}
|
|
|
|
export interface Form {
|
|
[name: string]: FormField
|
|
}
|
|
|
|
export interface FormsState {
|
|
form: Form
|
|
notification?: FormNotification
|
|
}
|
|
|
|
export interface GroupsState {
|
|
groups: string[]
|
|
continuation?: string
|
|
}
|
|
|
|
export interface RegistrationState {
|
|
step: number
|
|
}
|
|
|
|
export type RequestsState = APIRequestCollection
|
|
export type NotificationsState = Notification[]
|
|
export type EntitiesState = EntityStore
|
|
|
|
export interface AppState {
|
|
authentication: AuthenticationState
|
|
entities: EntitiesState
|
|
forms: FormsState
|
|
groups: GroupsState
|
|
menu: MenuState
|
|
notifications: NotificationsState
|
|
registration: RegistrationState
|
|
requests: RequestsState
|
|
}
|