mirror of
https://codeberg.org/timelimit/timelimit-server.git
synced 2026-08-31 19:03:45 +02:00
Add basically support for encrypted app list syncing
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* server component for the TimeLimit App
|
||||
* Copyright (C) 2019 - 2020 Jonas Lochmann
|
||||
* Copyright (C) 2019 - 2022 Jonas Lochmann
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
@@ -20,13 +20,18 @@ import {
|
||||
AddUsedTimeAction,
|
||||
AddUsedTimeActionVersion2,
|
||||
AppLogicAction,
|
||||
FinishKeyRequestAction,
|
||||
ForceSyncAction,
|
||||
MarkTaskPendingAction,
|
||||
ReplyToKeyRequestAction,
|
||||
RemoveInstalledAppsAction,
|
||||
SendKeyRequestAction,
|
||||
SignOutAtDeviceAction,
|
||||
TriedDisablingDeviceAdminAction,
|
||||
UpdateAppActivitiesAction,
|
||||
UpdateDeviceStatusAction
|
||||
UpdateDeviceStatusAction,
|
||||
UpdateInstalledAppsAction,
|
||||
UploadDevicePublicKeyAction
|
||||
} from '../../../../action'
|
||||
import { EventHandler } from '../../../../monitoring/eventhandler'
|
||||
import { Cache } from '../cache'
|
||||
@@ -34,13 +39,18 @@ import { ActionObjectTypeNotHandledException } from '../exception/illegal-state'
|
||||
import { dispatchAddInstalledApps } from './addinstalledapps'
|
||||
import { dispatchAddUsedTime } from './addusedtime'
|
||||
import { dispatchAddUsedTimeVersion2 } from './addusedtime2'
|
||||
import { dispatchFinishKeyRequestAction } from './finishkeyrequest'
|
||||
import { dispatchForceSyncAction } from './forcesync'
|
||||
import { dispatchMarkTaskPendingAction } from './marktaskpendingaction'
|
||||
import { dispatchReplyToKeyRequestAction } from './replytokeyrequest'
|
||||
import { dispatchRemoveInstalledApps } from './removeinstalledapps'
|
||||
import { dispatchSendKeyRequestAction } from './sendkeyrequest'
|
||||
import { dispatchSignOutAtDevice } from './signoutatdevice'
|
||||
import { dispatchTriedDisablingDeviceAdmin } from './trieddisablingdeviceadmin'
|
||||
import { dispatchUpdateAppActivities } from './updateappactivities'
|
||||
import { dispatchUpdateDeviceStatus } from './updatedevicestatus'
|
||||
import { dispatchUpdateInstalledApps } from './updateinstalledapps'
|
||||
import { dispatchUploadDevicePublicKeyAction } from './uploaddevicepublickey'
|
||||
|
||||
export const dispatchAppLogicAction = async ({ action, deviceId, cache, eventHandler }: {
|
||||
action: AppLogicAction
|
||||
@@ -54,12 +64,18 @@ export const dispatchAppLogicAction = async ({ action, deviceId, cache, eventHan
|
||||
await dispatchAddUsedTime({ deviceId, action, cache })
|
||||
} else if (action instanceof AddUsedTimeActionVersion2) {
|
||||
await dispatchAddUsedTimeVersion2({ deviceId, action, cache, eventHandler })
|
||||
} else if (action instanceof FinishKeyRequestAction) {
|
||||
await dispatchFinishKeyRequestAction({ deviceId, action, cache })
|
||||
} else if (action instanceof ForceSyncAction) {
|
||||
await dispatchForceSyncAction({ deviceId, action, cache })
|
||||
} else if (action instanceof MarkTaskPendingAction) {
|
||||
await dispatchMarkTaskPendingAction({ deviceId, action, cache })
|
||||
} else if (action instanceof ReplyToKeyRequestAction) {
|
||||
await dispatchReplyToKeyRequestAction({ deviceId, action, cache, eventHandler })
|
||||
} else if (action instanceof RemoveInstalledAppsAction) {
|
||||
await dispatchRemoveInstalledApps({ deviceId, action, cache })
|
||||
} else if (action instanceof SendKeyRequestAction) {
|
||||
await dispatchSendKeyRequestAction({ deviceId, action, cache })
|
||||
} else if (action instanceof SignOutAtDeviceAction) {
|
||||
await dispatchSignOutAtDevice({ deviceId, action, cache })
|
||||
} else if (action instanceof UpdateDeviceStatusAction) {
|
||||
@@ -68,6 +84,10 @@ export const dispatchAppLogicAction = async ({ action, deviceId, cache, eventHan
|
||||
await dispatchUpdateAppActivities({ deviceId, action, cache })
|
||||
} else if (action instanceof TriedDisablingDeviceAdminAction) {
|
||||
await dispatchTriedDisablingDeviceAdmin({ deviceId, action, cache })
|
||||
} else if (action instanceof UpdateInstalledAppsAction) {
|
||||
await dispatchUpdateInstalledApps({ deviceId, action, cache })
|
||||
} else if (action instanceof UploadDevicePublicKeyAction) {
|
||||
await dispatchUploadDevicePublicKeyAction({ deviceId, action, cache, eventHandler })
|
||||
} else {
|
||||
throw new ActionObjectTypeNotHandledException()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user