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.
141 lines
3.2 KiB
141 lines
3.2 KiB
|
|
import { EntityStore } from './entities'
|
|
import { Config } from './config'
|
|
|
|
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',
|
|
CreatePost = 'create-post',
|
|
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',
|
|
FetchInstallations = 'fetch-installations',
|
|
FetchInvitations = 'fetch-invitations',
|
|
FetchPost = 'fetch-post',
|
|
FetchTimeline = 'fetch-timeline',
|
|
FetchUserPosts = 'fetch-user-posts',
|
|
FetchSelfApps = 'fetch-self-apps',
|
|
FetchUser = 'fetch-user',
|
|
FetchUserAvailability = 'fetch-user-availability',
|
|
InstallApp = 'install-app',
|
|
UninstallApp = 'uninstall-app',
|
|
Register = 'register',
|
|
UpdateGroup = 'update-group',
|
|
UpdateSelf = 'update-self',
|
|
}
|
|
|
|
export enum EntityListKey {
|
|
Apps = 'apps',
|
|
CreatedApps = 'created-apps',
|
|
Groups = 'groups',
|
|
GroupMembers = 'group-members',
|
|
Logs = 'logs',
|
|
Invitations = 'invitations',
|
|
Timeline = 'timeline',
|
|
}
|
|
|
|
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 {
|
|
entities: string[]
|
|
continuation?: string
|
|
checked: number
|
|
}
|
|
|
|
export interface FormsState {
|
|
form: Form
|
|
notification?: FormNotification
|
|
}
|
|
|
|
export interface RegistrationState {
|
|
step: number
|
|
}
|
|
|
|
export type ComposerState = {
|
|
installations: string[]
|
|
selected?: string
|
|
error?: string
|
|
height: number
|
|
}
|
|
|
|
export interface EntityListCollection {
|
|
[key: string]: EntityList
|
|
}
|
|
|
|
export type ConfigState = Config
|
|
export type RequestsState = APIRequestCollection
|
|
export type NotificationsState = Notification[]
|
|
export type EntitiesState = EntityStore
|
|
export type EntityListsState = EntityListCollection
|
|
|
|
export interface AppState {
|
|
authentication: AuthenticationState
|
|
composer: ComposerState
|
|
config: ConfigState
|
|
entities: EntitiesState
|
|
forms: FormsState
|
|
lists: EntityListsState
|
|
menu: MenuState
|
|
notifications: NotificationsState
|
|
registration: RegistrationState
|
|
requests: RequestsState
|
|
}
|