[ABANDONED] React/Redux front end for the Flexor social network.
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.
 
 

129 lines
2.7 KiB

import { EntityStore } from './entities'
export interface Config {
apiUrl: string
blobUrl: string
}
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',
InstallApp = 'install_app',
UninstallApp = 'uninstall_app',
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 EntityList {
items: string[]
continuation?: string
}
export interface FormsState {
form: Form
notification?: FormNotification
}
export interface GroupsAdminState {
invitations: EntityList
logs: EntityList
}
export type GroupsState = EntityList & {
admin: GroupsAdminState
}
export interface RegistrationState {
step: number
}
export type AppsState = EntityList & {
created: EntityList
}
export type ConfigState = Config
export type RequestsState = APIRequestCollection
export type NotificationsState = Notification[]
export type EntitiesState = EntityStore
export interface AppState {
authentication: AuthenticationState
apps: AppsState
config: ConfigState
entities: EntitiesState
forms: FormsState
groups: GroupsState
menu: MenuState
notifications: NotificationsState
registration: RegistrationState
requests: RequestsState
}