mirror of
https://codeberg.org/timelimit/timelimit-server.git
synced 2026-08-31 19:03:45 +02:00
Remove unused serialization functions
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* server component for the TimeLimit App
|
||||
* Copyright (C) 2019 Jonas Lochmann
|
||||
* Copyright (C) 2019 - 2020 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
|
||||
@@ -33,12 +33,6 @@ export class AddCategoryAppsAction extends ParentAction {
|
||||
this.packageNames = packageNames
|
||||
}
|
||||
|
||||
serialize = (): SerializedAddCategoryAppsAction => ({
|
||||
type: 'ADD_CATEGORY_APPS',
|
||||
categoryId: this.categoryId,
|
||||
packageNames: this.packageNames
|
||||
})
|
||||
|
||||
static parse = ({ categoryId, packageNames }: SerializedAddCategoryAppsAction) => (
|
||||
new AddCategoryAppsAction({ categoryId, packageNames })
|
||||
)
|
||||
|
||||
@@ -42,13 +42,6 @@ export class AddCategoryNetworkIdAction extends ParentAction {
|
||||
this.hashedNetworkId = hashedNetworkId
|
||||
}
|
||||
|
||||
serialize = (): SerializedAddCategoryNetworkIdAction => ({
|
||||
type: 'ADD_CATEGORY_NETWORK_ID',
|
||||
categoryId: this.categoryId,
|
||||
itemId: this.itemId,
|
||||
hashedNetworkId: this.hashedNetworkId
|
||||
})
|
||||
|
||||
static parse = ({ categoryId, itemId, hashedNetworkId }: SerializedAddCategoryNetworkIdAction) => (
|
||||
new AddCategoryNetworkIdAction({
|
||||
categoryId,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* server component for the TimeLimit App
|
||||
* Copyright (C) 2019 Jonas Lochmann
|
||||
* Copyright (C) 2019 - 2020 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
|
||||
@@ -30,11 +30,6 @@ export class AddInstalledAppsAction extends AppLogicAction {
|
||||
this.apps = apps
|
||||
}
|
||||
|
||||
serialize = (): SerializedAddInstalledAppsAction => ({
|
||||
type: 'ADD_INSTALLED_APPS',
|
||||
apps: this.apps.map((app) => app.serialize())
|
||||
})
|
||||
|
||||
static parse = ({ apps }: SerializedAddInstalledAppsAction) => (
|
||||
new AddInstalledAppsAction({
|
||||
apps: apps.map((app) => InstalledApp.parse(app))
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* server component for the TimeLimit App
|
||||
* Copyright (C) 2019 Jonas Lochmann
|
||||
* Copyright (C) 2019 - 2020 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
|
||||
@@ -52,14 +52,6 @@ export class AddUsedTimeAction extends AppLogicAction {
|
||||
this.extraTimeToSubtract = extraTimeToSubtract
|
||||
}
|
||||
|
||||
serialize = (): SerializedAddUsedTimeAction => ({
|
||||
type: 'ADD_USED_TIME',
|
||||
categoryId: this.categoryId,
|
||||
day: this.dayOfEpoch,
|
||||
timeToAdd: this.timeToAdd,
|
||||
extraTimeToSubtract: this.extraTimeToSubtract
|
||||
})
|
||||
|
||||
static parse = ({ categoryId, day, timeToAdd, extraTimeToSubtract }: SerializedAddUsedTimeAction) => (
|
||||
new AddUsedTimeAction({
|
||||
categoryId,
|
||||
|
||||
@@ -91,17 +91,6 @@ export class AddUsedTimeActionVersion2 extends AppLogicAction {
|
||||
this.trustedTimestamp = trustedTimestamp
|
||||
}
|
||||
|
||||
serialize = (): SerializedAddUsedTimeActionVersion2 => ({
|
||||
type: 'ADD_USED_TIME_V2',
|
||||
d: this.dayOfEpoch,
|
||||
i: this.items.map((item) => ({
|
||||
categoryId: item.categoryId,
|
||||
tta: item.timeToAdd,
|
||||
etts: item.extraTimeToSubtract
|
||||
})),
|
||||
t: this.trustedTimestamp
|
||||
})
|
||||
|
||||
static parse = ({ d, i, t }: SerializedAddUsedTimeActionVersion2) => (
|
||||
new AddUsedTimeActionVersion2({
|
||||
dayOfEpoch: d,
|
||||
|
||||
+1
-10
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* server component for the TimeLimit App
|
||||
* Copyright (C) 2019 Jonas Lochmann
|
||||
* Copyright (C) 2019 - 2020 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
|
||||
@@ -54,15 +54,6 @@ export class AddUserAction extends ParentAction {
|
||||
}
|
||||
}
|
||||
|
||||
serialize = (): SerializedAddUserAction => ({
|
||||
type: 'ADD_USER',
|
||||
name: this.name,
|
||||
userType: this.userType,
|
||||
userId: this.userId,
|
||||
password: this.password,
|
||||
timeZone: this.timeZone
|
||||
})
|
||||
|
||||
static parse = ({ name, userId, userType, password, timeZone }: SerializedAddUserAction) => (
|
||||
new AddUserAction({
|
||||
name,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* server component for the TimeLimit App
|
||||
* Copyright (C) 2019 Jonas Lochmann
|
||||
* Copyright (C) 2019 - 2020 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
|
||||
@@ -15,9 +15,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
export abstract class Action {
|
||||
abstract serialize: () => object
|
||||
}
|
||||
export abstract class Action {}
|
||||
|
||||
export abstract class AppLogicAction extends Action {}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* server component for the TimeLimit App
|
||||
* Copyright (C) 2019 Jonas Lochmann
|
||||
* Copyright (C) 2019 - 2020 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
|
||||
@@ -62,15 +62,6 @@ export class ChangeParentPasswordAction extends ParentAction {
|
||||
this.integrity = integrity
|
||||
}
|
||||
|
||||
serialize = (): SerializedChangeParentPasswordAction => ({
|
||||
type: 'CHANGE_PARENT_PASSWORD',
|
||||
userId: this.parentUserId,
|
||||
hash: this.newPasswordFirstHash,
|
||||
secondSalt: this.newPasswordSecondSalt,
|
||||
secondHashEncrypted: this.newPasswordSecondHashEncrypted,
|
||||
integrity: this.integrity
|
||||
})
|
||||
|
||||
static parse = ({ userId, hash, secondSalt, secondHashEncrypted, integrity }: SerializedChangeParentPasswordAction) => (
|
||||
new ChangeParentPasswordAction({
|
||||
parentUserId: userId,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* server component for the TimeLimit App
|
||||
* Copyright (C) 2019 Jonas Lochmann
|
||||
* Copyright (C) 2019 - 2020 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
|
||||
@@ -31,11 +31,6 @@ export class ChildChangePasswordAction extends ChildAction {
|
||||
this.password = password
|
||||
}
|
||||
|
||||
serialize = (): SerializedChildChangePasswordAction => ({
|
||||
type: 'CHILD_CHANGE_PASSWORD',
|
||||
password: this.password
|
||||
})
|
||||
|
||||
static parse = ({ password }: SerializedChildChangePasswordAction) => (
|
||||
new ChildChangePasswordAction({ password })
|
||||
)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* server component for the TimeLimit App
|
||||
* Copyright (C) 2019 Jonas Lochmann
|
||||
* Copyright (C) 2019 - 2020 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
|
||||
@@ -22,10 +22,6 @@ export class ChildSignInAction extends ChildAction {
|
||||
super()
|
||||
}
|
||||
|
||||
serialize = (): SerializedChildSignInAction => ({
|
||||
type: 'CHILD_SIGN_IN'
|
||||
})
|
||||
|
||||
static parse = (action: SerializedChildSignInAction) => (
|
||||
new ChildSignInAction()
|
||||
)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* server component for the TimeLimit App
|
||||
* Copyright (C) 2019 Jonas Lochmann
|
||||
* Copyright (C) 2019 - 2020 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
|
||||
@@ -34,13 +34,6 @@ export class CreateCategoryAction extends ParentAction {
|
||||
this.title = title
|
||||
}
|
||||
|
||||
serialize = (): SerializedCreateCategoryAction => ({
|
||||
type: 'CREATE_CATEGORY',
|
||||
childId: this.childId,
|
||||
categoryId: this.categoryId,
|
||||
title: this.title
|
||||
})
|
||||
|
||||
static parse = ({ childId, categoryId, title }: SerializedCreateCategoryAction) => (
|
||||
new CreateCategoryAction({ childId, categoryId, title })
|
||||
)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* server component for the TimeLimit App
|
||||
* Copyright (C) 2019 Jonas Lochmann
|
||||
* Copyright (C) 2019 - 2020 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
|
||||
@@ -27,11 +27,6 @@ export class CreateTimeLimitRuleAction extends ParentAction {
|
||||
this.rule = rule
|
||||
}
|
||||
|
||||
serialize = (): SerializedCreateTimelimtRuleAction => ({
|
||||
type: 'CREATE_TIMELIMIT_RULE',
|
||||
rule: this.rule.serialize()
|
||||
})
|
||||
|
||||
static parse = ({ rule }: SerializedCreateTimelimtRuleAction) => (
|
||||
new CreateTimeLimitRuleAction({
|
||||
rule: TimelimitRule.parse(rule)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* server component for the TimeLimit App
|
||||
* Copyright (C) 2019 Jonas Lochmann
|
||||
* Copyright (C) 2019 - 2020 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
|
||||
@@ -29,11 +29,6 @@ export class DeleteCategoryAction extends ParentAction {
|
||||
this.categoryId = categoryId
|
||||
}
|
||||
|
||||
serialize = (): SerializedDeleteCategoryAction => ({
|
||||
type: 'DELETE_CATEGORY',
|
||||
categoryId: this.categoryId
|
||||
})
|
||||
|
||||
static parse = ({ categoryId }: SerializedDeleteCategoryAction) => (
|
||||
new DeleteCategoryAction({ categoryId })
|
||||
)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* server component for the TimeLimit App
|
||||
* Copyright (C) 2019 Jonas Lochmann
|
||||
* Copyright (C) 2019 - 2020 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
|
||||
@@ -29,11 +29,6 @@ export class DeleteTimeLimitRuleAction extends ParentAction {
|
||||
this.ruleId = ruleId
|
||||
}
|
||||
|
||||
serialize = (): SerializedDeleteTimeLimitRuleAction => ({
|
||||
type: 'DELETE_TIMELIMIT_RULE',
|
||||
ruleId: this.ruleId
|
||||
})
|
||||
|
||||
static parse = ({ ruleId }: SerializedDeleteTimeLimitRuleAction) => (
|
||||
new DeleteTimeLimitRuleAction({ ruleId })
|
||||
)
|
||||
|
||||
@@ -24,10 +24,6 @@ export class ForceSyncAction extends AppLogicAction {
|
||||
super()
|
||||
}
|
||||
|
||||
serialize = (): SerializedForceSyncAction => ({
|
||||
type: 'FORCE_SYNC'
|
||||
})
|
||||
|
||||
static parse = (_: SerializedForceSyncAction) => ForceSyncAction.instance
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* server component for the TimeLimit App
|
||||
* Copyright (C) 2019 Jonas Lochmann
|
||||
* Copyright (C) 2019 - 2020 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
|
||||
@@ -73,20 +73,6 @@ export class IgnoreManipulationAction extends ParentAction {
|
||||
this.ignoreHadManipulationFlags = ignoreHadManipulationFlags
|
||||
}
|
||||
|
||||
serialize = (): SerializedIgnoreManipulationAction => ({
|
||||
type: 'IGNORE_MANIPULATION',
|
||||
deviceId: this.deviceId,
|
||||
admin: this.ignoreDeviceAdminManipulation,
|
||||
adminA: this.ignoreDeviceAdminManipulationAttempt,
|
||||
downgrade: this.ignoreAppDowngrade,
|
||||
notification: this.ignoreNotificationAccessManipulation,
|
||||
overlay: this.ignoreOverlayPermissionManipulation,
|
||||
accessibilityService: this.ignoreAccessibilityServiceManipulation,
|
||||
usageStats: this.ignoreUsageStatsAccessManipulation,
|
||||
hadManipulation: this.ignoreHadManipulation,
|
||||
ignoreHadManipulationFlags: this.ignoreHadManipulationFlags
|
||||
})
|
||||
|
||||
static parse = ({ deviceId, admin, adminA, downgrade, notification, usageStats, overlay, accessibilityService, reboot, hadManipulation, ignoreHadManipulationFlags }: SerializedIgnoreManipulationAction) => (
|
||||
new IgnoreManipulationAction({
|
||||
deviceId,
|
||||
|
||||
@@ -41,13 +41,6 @@ export class IncrementCategoryExtraTimeAction extends ParentAction {
|
||||
this.day = day
|
||||
}
|
||||
|
||||
serialize = (): SerializedIncrementCategoryExtraTimeAction => ({
|
||||
type: 'INCREMENT_CATEGORY_EXTRATIME',
|
||||
categoryId: this.categoryId,
|
||||
addedExtraTime: this.addedExtraTime,
|
||||
day: this.day
|
||||
})
|
||||
|
||||
static parse = ({ categoryId, addedExtraTime, day }: SerializedIncrementCategoryExtraTimeAction) => (
|
||||
new IncrementCategoryExtraTimeAction({ categoryId, addedExtraTime, day: day ?? -1 })
|
||||
)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* server component for the TimeLimit App
|
||||
* Copyright (C) 2019 Jonas Lochmann
|
||||
* Copyright (C) 2019 - 2020 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
|
||||
@@ -33,12 +33,6 @@ export class RemoveCategoryAppsAction extends ParentAction {
|
||||
this.packageNames = packageNames
|
||||
}
|
||||
|
||||
serialize = (): SerializedRemoveCategoryAppsAction => ({
|
||||
type: 'REMOVE_CATEGORY_APPS',
|
||||
categoryId: this.categoryId,
|
||||
packageNames: this.packageNames
|
||||
})
|
||||
|
||||
static parse = ({ categoryId, packageNames }: SerializedRemoveCategoryAppsAction) => (
|
||||
new RemoveCategoryAppsAction({ categoryId, packageNames })
|
||||
)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* server component for the TimeLimit App
|
||||
* Copyright (C) 2019 Jonas Lochmann
|
||||
* Copyright (C) 2019 - 2020 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
|
||||
@@ -29,11 +29,6 @@ export class RemoveInstalledAppsAction extends AppLogicAction {
|
||||
this.packageNames = packageNames
|
||||
}
|
||||
|
||||
serialize = (): SerializedRemoveInstalledAppsAction => ({
|
||||
type: 'REMOVE_INSTALLED_APPS',
|
||||
packageNames: this.packageNames
|
||||
})
|
||||
|
||||
static parse = ({ packageNames }: SerializedRemoveInstalledAppsAction) => (
|
||||
new RemoveInstalledAppsAction({ packageNames })
|
||||
)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* server component for the TimeLimit App
|
||||
* Copyright (C) 2019 Jonas Lochmann
|
||||
* Copyright (C) 2019 - 2020 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
|
||||
@@ -37,12 +37,6 @@ export class RemoveUserAction extends ParentAction {
|
||||
this.authentication = authentication
|
||||
}
|
||||
|
||||
serialize = (): SerializedRemoveUserAction => ({
|
||||
type: 'REMOVE_USER',
|
||||
userId: this.userId,
|
||||
authentication: this.authentication
|
||||
})
|
||||
|
||||
static parse = ({ userId, authentication }: SerializedRemoveUserAction) => (
|
||||
new RemoveUserAction({ userId, authentication })
|
||||
)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* server component for the TimeLimit App
|
||||
* Copyright (C) 2019 Jonas Lochmann
|
||||
* Copyright (C) 2019 - 2020 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
|
||||
@@ -38,12 +38,6 @@ export class RenameChildAction extends ParentAction {
|
||||
this.newName = newName
|
||||
}
|
||||
|
||||
serialize = (): SerializedRenameChildAction => ({
|
||||
type: 'RENAME_CHILD',
|
||||
childId: this.childId,
|
||||
newName: this.newName
|
||||
})
|
||||
|
||||
static parse = ({ childId, newName }: SerializedRenameChildAction) => (
|
||||
new RenameChildAction({ childId, newName })
|
||||
)
|
||||
|
||||
@@ -31,11 +31,6 @@ export class ResetCategoryNetworkIdsAction extends ParentAction {
|
||||
this.categoryId = categoryId
|
||||
}
|
||||
|
||||
serialize = (): SerializeResetCategoryNetworkIdsAction => ({
|
||||
type: 'RESET_CATEGORY_NETWORK_IDS',
|
||||
categoryId: this.categoryId
|
||||
})
|
||||
|
||||
static parse = ({ categoryId }: SerializeResetCategoryNetworkIdsAction) => (
|
||||
new ResetCategoryNetworkIdsAction({
|
||||
categoryId
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* server component for the TimeLimit App
|
||||
* Copyright (C) 2019 Jonas Lochmann
|
||||
* Copyright (C) 2019 - 2020 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
|
||||
@@ -31,11 +31,6 @@ export class ResetParentBlockedTimesAction extends ParentAction {
|
||||
this.parentId = parentId
|
||||
}
|
||||
|
||||
serialize = (): SerializedResetParentBlockedTimesAction => ({
|
||||
type: 'RESET_PARENT_BLOCKED_TIMES',
|
||||
parentId: this.parentId
|
||||
})
|
||||
|
||||
static parse = ({ parentId }: SerializedResetParentBlockedTimesAction) => (
|
||||
new ResetParentBlockedTimesAction({
|
||||
parentId
|
||||
|
||||
@@ -41,13 +41,6 @@ export class SetCategoryExtraTimeAction extends ParentAction {
|
||||
this.day = day
|
||||
}
|
||||
|
||||
serialize = (): SerializedSetCategoryExtraTimeAction => ({
|
||||
type: 'SET_CATEGORY_EXTRA_TIME',
|
||||
categoryId: this.categoryId,
|
||||
newExtraTime: this.newExtraTime,
|
||||
day: this.day
|
||||
})
|
||||
|
||||
static parse = ({ categoryId, newExtraTime, day }: SerializedSetCategoryExtraTimeAction) => (
|
||||
new SetCategoryExtraTimeAction({ categoryId, newExtraTime, day: day ?? -1 })
|
||||
)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* server component for the TimeLimit App
|
||||
* Copyright (C) 2019 Jonas Lochmann
|
||||
* Copyright (C) 2019 - 2020 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
|
||||
@@ -38,12 +38,6 @@ export class SetCategoryForUnassignedAppsAction extends ParentAction {
|
||||
this.categoryId = categoryId
|
||||
}
|
||||
|
||||
serialize = (): SerializedSetCategoryForUnassignedAppsAction => ({
|
||||
type: 'SET_CATEGORY_FOR_UNASSIGNED_APPS',
|
||||
childId: this.childId,
|
||||
categoryId: this.categoryId
|
||||
})
|
||||
|
||||
static parse = ({ childId, categoryId }: SerializedSetCategoryForUnassignedAppsAction) => (
|
||||
new SetCategoryForUnassignedAppsAction({ childId, categoryId })
|
||||
)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* server component for the TimeLimit App
|
||||
* Copyright (C) 2019 Jonas Lochmann
|
||||
* Copyright (C) 2019 - 2020 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
|
||||
@@ -36,12 +36,6 @@ export class SetChildPasswordAction extends ParentAction {
|
||||
this.newPassword = newPassword
|
||||
}
|
||||
|
||||
serialize = (): SerializedSetChildPasswordAction => ({
|
||||
type: 'SET_CHILD_PASSWORD',
|
||||
childId: this.childUserId,
|
||||
newPassword: this.newPassword
|
||||
})
|
||||
|
||||
static parse = ({ childId, newPassword }: SerializedSetChildPasswordAction) => (
|
||||
new SetChildPasswordAction({
|
||||
childUserId: childId,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* server component for the TimeLimit App
|
||||
* Copyright (C) 2019 Jonas Lochmann
|
||||
* Copyright (C) 2019 - 2020 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
|
||||
@@ -31,12 +31,6 @@ export class SetConsiderRebootManipulationAction extends ParentAction {
|
||||
this.enable = enable
|
||||
}
|
||||
|
||||
serialize = (): SerializedSetConsiderRebootManipulationAction => ({
|
||||
type: 'SET_CONSIDER_REBOOT_MANIPULATION',
|
||||
deviceId: this.deviceId,
|
||||
enable: this.enable
|
||||
})
|
||||
|
||||
static parse = ({ deviceId, enable }: SerializedSetConsiderRebootManipulationAction) => (
|
||||
new SetConsiderRebootManipulationAction({ deviceId, enable })
|
||||
)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* server component for the TimeLimit App
|
||||
* Copyright (C) 2019 Jonas Lochmann
|
||||
* Copyright (C) 2019 - 2020 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
|
||||
@@ -38,12 +38,6 @@ export class SetDeviceDefaultUserAction extends ParentAction {
|
||||
this.defaultUserId = defaultUserId
|
||||
}
|
||||
|
||||
serialize = (): SerializedSetDeviceDefaultUserAction => ({
|
||||
type: 'SET_DEVICE_DEFAULT_USER',
|
||||
deviceId: this.deviceId,
|
||||
defaultUserId: this.defaultUserId
|
||||
})
|
||||
|
||||
static parse = ({ deviceId, defaultUserId }: SerializedSetDeviceDefaultUserAction) => (
|
||||
new SetDeviceDefaultUserAction({ deviceId, defaultUserId })
|
||||
)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* server component for the TimeLimit App
|
||||
* Copyright (C) 2019 Jonas Lochmann
|
||||
* Copyright (C) 2019 - 2020 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
|
||||
@@ -38,12 +38,6 @@ export class SetDeviceDefaultUserTimeoutAction extends ParentAction {
|
||||
this.timeout = timeout
|
||||
}
|
||||
|
||||
serialize = (): SerializedSetDeviceDefaultUserTimeoutAction => ({
|
||||
type: 'SET_DEVICE_DEFAULT_USER_TIMEOUT',
|
||||
deviceId: this.deviceId,
|
||||
timeout: this.timeout
|
||||
})
|
||||
|
||||
static parse = ({ deviceId, timeout }: SerializedSetDeviceDefaultUserTimeoutAction) => (
|
||||
new SetDeviceDefaultUserTimeoutAction({ deviceId, timeout })
|
||||
)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* server component for the TimeLimit App
|
||||
* Copyright (C) 2019 Jonas Lochmann
|
||||
* Copyright (C) 2019 - 2020 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
|
||||
@@ -38,12 +38,6 @@ export class SetDeviceUserAction extends ParentAction {
|
||||
this.userId = userId
|
||||
}
|
||||
|
||||
serialize = (): SerializedSetDeviceUserAction => ({
|
||||
type: 'SET_DEVICE_USER',
|
||||
deviceId: this.deviceId,
|
||||
userId: this.userId
|
||||
})
|
||||
|
||||
static parse = ({ deviceId, userId }: SerializedSetDeviceUserAction) => (
|
||||
new SetDeviceUserAction({ deviceId, userId })
|
||||
)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* server component for the TimeLimit App
|
||||
* Copyright (C) 2019 Jonas Lochmann
|
||||
* Copyright (C) 2019 - 2020 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
|
||||
@@ -34,12 +34,6 @@ export class SetKeepSignedInAction extends ParentAction {
|
||||
this.keepSignedIn = keepSignedIn
|
||||
}
|
||||
|
||||
serialize = (): SerializedSetKeepSignedInAction => ({
|
||||
type: 'SET_KEEP_SIGNED_IN',
|
||||
deviceId: this.deviceId,
|
||||
keepSignedIn: this.keepSignedIn
|
||||
})
|
||||
|
||||
static parse = ({ deviceId, keepSignedIn }: SerializedSetKeepSignedInAction) => (
|
||||
new SetKeepSignedInAction({
|
||||
deviceId,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* server component for the TimeLimit App
|
||||
* Copyright (C) 2019 Jonas Lochmann
|
||||
* Copyright (C) 2019 - 2020 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
|
||||
@@ -38,12 +38,6 @@ export class SetParentCategoryAction extends ParentAction {
|
||||
this.parentCategory = parentCategory
|
||||
}
|
||||
|
||||
serialize = (): SerializedSetParentCategoryAction => ({
|
||||
type: 'SET_PARENT_CATEGORY',
|
||||
categoryId: this.categoryId,
|
||||
parentCategory: this.parentCategory
|
||||
})
|
||||
|
||||
static parse = ({ categoryId, parentCategory }: SerializedSetParentCategoryAction) => (
|
||||
new SetParentCategoryAction({
|
||||
categoryId,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* server component for the TimeLimit App
|
||||
* Copyright (C) 2019 Jonas Lochmann
|
||||
* Copyright (C) 2019 - 2020 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
|
||||
@@ -34,12 +34,6 @@ export class SetRelaxPrimaryDeviceAction extends ParentAction {
|
||||
this.relax = relax
|
||||
}
|
||||
|
||||
serialize = (): SerializedSetRelaxPrimaryDeviceAction => ({
|
||||
type: 'SET_RELAX_PRIMARY_DEVICE',
|
||||
userId: this.userId,
|
||||
relax: this.relax
|
||||
})
|
||||
|
||||
static parse = ({ userId, relax }: SerializedSetRelaxPrimaryDeviceAction) => (
|
||||
new SetRelaxPrimaryDeviceAction({ userId, relax })
|
||||
)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* server component for the TimeLimit App
|
||||
* Copyright (C) 2019 Jonas Lochmann
|
||||
* Copyright (C) 2019 - 2020 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
|
||||
@@ -34,12 +34,6 @@ export class SetSendDeviceConnected extends ParentAction {
|
||||
this.enable = enable
|
||||
}
|
||||
|
||||
serialize = (): SerializedSetSendDeviceConnected => ({
|
||||
type: 'SET_SEND_DEVICE_CONNECTED',
|
||||
deviceId: this.deviceId,
|
||||
enable: this.enable
|
||||
})
|
||||
|
||||
static parse = ({ deviceId, enable }: SerializedSetSendDeviceConnected) => (
|
||||
new SetSendDeviceConnected({
|
||||
deviceId,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* server component for the TimeLimit App
|
||||
* Copyright (C) 2019 Jonas Lochmann
|
||||
* Copyright (C) 2019 - 2020 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
|
||||
@@ -38,12 +38,6 @@ export class SetUserDisableLimitsUntilAction extends ParentAction {
|
||||
this.timestamp = timestamp
|
||||
}
|
||||
|
||||
serialize = (): SerializedSetUserDisableLimitsUntilAction => ({
|
||||
type: 'SET_USER_DISABLE_LIMITS_UNTIL',
|
||||
childId: this.childId,
|
||||
time: this.timestamp
|
||||
})
|
||||
|
||||
static parse = ({ childId, time }: SerializedSetUserDisableLimitsUntilAction) => (
|
||||
new SetUserDisableLimitsUntilAction({
|
||||
childId,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* server component for the TimeLimit App
|
||||
* Copyright (C) 2019 Jonas Lochmann
|
||||
* Copyright (C) 2019 - 2020 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
|
||||
@@ -34,12 +34,6 @@ export class SetUserTimezoneAction extends ParentAction {
|
||||
this.timezone = timezone
|
||||
}
|
||||
|
||||
serialize = (): SerializedSetUserTimezoneAction => ({
|
||||
type: 'SET_USER_TIMEZONE',
|
||||
userId: this.userId,
|
||||
timezone: this.timezone
|
||||
})
|
||||
|
||||
static parse = ({ userId, timezone }: SerializedSetUserTimezoneAction) => (
|
||||
new SetUserTimezoneAction({ userId, timezone })
|
||||
)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* server component for the TimeLimit App
|
||||
* Copyright (C) 2019 Jonas Lochmann
|
||||
* Copyright (C) 2019 - 2020 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
|
||||
@@ -24,10 +24,6 @@ export class SignOutAtDeviceAction extends AppLogicAction {
|
||||
super()
|
||||
}
|
||||
|
||||
serialize = (): SerializedSignOutAtDeviceAction => ({
|
||||
type: 'SIGN_OUT_AT_DEVICE'
|
||||
})
|
||||
|
||||
static parse = (action: SerializedSignOutAtDeviceAction) => SignOutAtDeviceAction.instance
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* server component for the TimeLimit App
|
||||
* Copyright (C) 2019 Jonas Lochmann
|
||||
* Copyright (C) 2019 - 2020 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
|
||||
@@ -21,10 +21,6 @@ export class TriedDisablingDeviceAdminAction extends AppLogicAction {
|
||||
constructor () {
|
||||
super()
|
||||
}
|
||||
|
||||
serialize = (): SerialiezdTriedDisablingDeviceAdminAction => ({
|
||||
type: 'TRIED_DISABLING_DEVICE_ADMIN'
|
||||
})
|
||||
}
|
||||
|
||||
export interface SerialiezdTriedDisablingDeviceAdminAction {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* server component for the TimeLimit App
|
||||
* Copyright (C) 2019 Jonas Lochmann
|
||||
* Copyright (C) 2019 - 2020 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
|
||||
@@ -40,12 +40,6 @@ export class UpdateAppActivitiesAction extends AppLogicAction {
|
||||
this.updatedOrAdded = updatedOrAdded
|
||||
}
|
||||
|
||||
serialize = (): SerializedUpdateAppActivitiesAction => ({
|
||||
type: 'UPDATE_APP_ACTIVITIES',
|
||||
removed: this.removed.map((item) => item.serialize()),
|
||||
updatedOrAdded: this.updatedOrAdded.map((item) => item.serialize())
|
||||
})
|
||||
|
||||
static parse = ({ removed, updatedOrAdded }: SerializedUpdateAppActivitiesAction) => (
|
||||
new UpdateAppActivitiesAction({
|
||||
removed: removed.map((item) => RemovedAppActivityItem.parse(item)),
|
||||
|
||||
@@ -49,13 +49,6 @@ export class UpdateCategoryBatteryLimitAction extends ParentAction {
|
||||
this.mobileLimit = mobileLimit
|
||||
}
|
||||
|
||||
serialize = (): SerializedUpdateCategoryBatteryLimitAction => ({
|
||||
type: 'UPDATE_CATEGORY_BATTERY_LIMIT',
|
||||
categoryId: this.categoryId,
|
||||
mobileLimit: this.mobileLimit,
|
||||
chargeLimit: this.chargeLimit
|
||||
})
|
||||
|
||||
static parse = ({ categoryId, chargeLimit, mobileLimit }: SerializedUpdateCategoryBatteryLimitAction) => (
|
||||
new UpdateCategoryBatteryLimitAction({ categoryId, chargeLimit, mobileLimit })
|
||||
)
|
||||
|
||||
@@ -31,12 +31,6 @@ export class UpdateCategoryBlockAllNotificationsAction extends ParentAction {
|
||||
this.blocked = blocked
|
||||
}
|
||||
|
||||
serialize = (): SerializedUpdateCategoryBlockAllNotificationsAction => ({
|
||||
type: 'UPDATE_CATEGORY_BLOCK_ALL_NOTIFICATIONS',
|
||||
categoryId: this.categoryId,
|
||||
blocked: this.blocked
|
||||
})
|
||||
|
||||
static parse = ({ categoryId, blocked }: SerializedUpdateCategoryBlockAllNotificationsAction) => (
|
||||
new UpdateCategoryBlockAllNotificationsAction({ categoryId, blocked })
|
||||
)
|
||||
|
||||
@@ -38,12 +38,6 @@ export class UpdateCategoryBlockedTimesAction extends ParentAction {
|
||||
this.blockedTimes = blockedTimes
|
||||
}
|
||||
|
||||
serialize = (): SerializedUpdateCategoryBlockedTimesAction => ({
|
||||
type: 'UPDATE_CATEGORY_BLOCKED_TIMES',
|
||||
categoryId: this.categoryId,
|
||||
times: this.blockedTimes
|
||||
})
|
||||
|
||||
static parse = ({ categoryId, times }: SerializedUpdateCategoryBlockedTimesAction) => (
|
||||
new UpdateCategoryBlockedTimesAction({
|
||||
categoryId,
|
||||
|
||||
@@ -40,11 +40,6 @@ export class UpdateCategorySortingAction extends ParentAction {
|
||||
this.categoryIds = categoryIds
|
||||
}
|
||||
|
||||
serialize = (): SerializedUpdateCategorySortingAction => ({
|
||||
type: 'UPDATE_CATEGORY_SORTING',
|
||||
categoryIds: this.categoryIds
|
||||
})
|
||||
|
||||
static parse = ({ categoryIds }: SerializedUpdateCategorySortingAction) => (
|
||||
new UpdateCategorySortingAction({ categoryIds })
|
||||
)
|
||||
|
||||
@@ -47,13 +47,6 @@ export class UpdateCategoryTemporarilyBlockedAction extends ParentAction {
|
||||
this.endTime = endTime
|
||||
}
|
||||
|
||||
serialize = (): SerializedUpdateCategoryTemporarilyBlockedAction => ({
|
||||
type: 'UPDATE_CATEGORY_TEMPORARILY_BLOCKED',
|
||||
categoryId: this.categoryId,
|
||||
blocked: this.blocked,
|
||||
endTime: this.endTime
|
||||
})
|
||||
|
||||
static parse = ({ categoryId, blocked, endTime }: SerializedUpdateCategoryTemporarilyBlockedAction) => (
|
||||
new UpdateCategoryTemporarilyBlockedAction({ categoryId, blocked, endTime })
|
||||
)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* server component for the TimeLimit App
|
||||
* Copyright (C) 2019 Jonas Lochmann
|
||||
* Copyright (C) 2019 - 2020 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
|
||||
@@ -42,13 +42,6 @@ export class UpdateCategoryTimeWarningsAction extends ParentAction {
|
||||
this.flags = flags
|
||||
}
|
||||
|
||||
serialize = (): SerializedUpdateCategoryTimeWarningsAction => ({
|
||||
type: 'UPDATE_CATEGORY_TIME_WARNINGS',
|
||||
categoryId: this.categoryId,
|
||||
enable: this.enable,
|
||||
flags: this.flags
|
||||
})
|
||||
|
||||
static parse = ({ categoryId, enable, flags }: SerializedUpdateCategoryTimeWarningsAction) => (
|
||||
new UpdateCategoryTimeWarningsAction({ categoryId, enable, flags })
|
||||
)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* server component for the TimeLimit App
|
||||
* Copyright (C) 2019 Jonas Lochmann
|
||||
* Copyright (C) 2019 - 2020 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
|
||||
@@ -31,12 +31,6 @@ export class UpdateCategoryTitleAction extends ParentAction {
|
||||
this.newTitle = newTitle
|
||||
}
|
||||
|
||||
serialize = (): SerializedUpdateCategoryTitleAction => ({
|
||||
type: 'UPDATE_CATEGORY_TITLE',
|
||||
categoryId: this.categoryId,
|
||||
newTitle: this.newTitle
|
||||
})
|
||||
|
||||
static parse = ({ categoryId, newTitle }: SerializedUpdateCategoryTitleAction) => (
|
||||
new UpdateCategoryTitleAction({ categoryId, newTitle })
|
||||
)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* server component for the TimeLimit App
|
||||
* Copyright (C) 2019 Jonas Lochmann
|
||||
* Copyright (C) 2019 - 2020 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
|
||||
@@ -38,12 +38,6 @@ export class UpdateDeviceNameAction extends ParentAction {
|
||||
}
|
||||
}
|
||||
|
||||
serialize = (): SerializedUpdateDeviceNameAction => ({
|
||||
type: 'UPDATE_DEVICE_NAME',
|
||||
deviceId: this.deviceId,
|
||||
name: this.name
|
||||
})
|
||||
|
||||
static parse = ({ deviceId, name }: SerializedUpdateDeviceNameAction) => (
|
||||
new UpdateDeviceNameAction({ deviceId, name })
|
||||
)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* server component for the TimeLimit App
|
||||
* Copyright (C) 2019 Jonas Lochmann
|
||||
* Copyright (C) 2019 - 2020 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
|
||||
@@ -67,18 +67,6 @@ export class UpdateDeviceStatusAction extends AppLogicAction {
|
||||
this.isQOrLaterNow = isQOrLaterNow
|
||||
}
|
||||
|
||||
serialize = (): SerializedUpdateDeviceStatusAction => ({
|
||||
type: 'UPDATE_DEVICE_STATUS',
|
||||
protectionLevel: this.newProtetionLevel,
|
||||
usageStats: this.newUsageStatsPermissionStatus,
|
||||
notificationAccess: this.newNotificationAccessPermission,
|
||||
overlayPermission: this.newOverlayPermission,
|
||||
accessibilityServiceEnabled: this.newAccessibilityServiceEnabled,
|
||||
appVersion: this.newAppVersion,
|
||||
didReboot: this.didReboot,
|
||||
isQOrLaterNow: this.isQOrLaterNow
|
||||
})
|
||||
|
||||
static parse = ({ protectionLevel, usageStats, notificationAccess, overlayPermission, accessibilityServiceEnabled, appVersion, didReboot, isQOrLaterNow }: SerializedUpdateDeviceStatusAction) => (
|
||||
new UpdateDeviceStatusAction({
|
||||
newProtetionLevel: protectionLevel,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* server component for the TimeLimit App
|
||||
* Copyright (C) 2019 Jonas Lochmann
|
||||
* Copyright (C) 2019 - 2020 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
|
||||
@@ -31,12 +31,6 @@ export class UpdateEnableActivityLevelBlockingAction extends ParentAction {
|
||||
this.enable = enable
|
||||
}
|
||||
|
||||
serialize = (): SerializedUpdateEnableActivityLevelBlockingAction => ({
|
||||
type: 'UPDATE_ENABLE_ACTIVITY_LEVEL_BLOCKING',
|
||||
deviceId: this.deviceId,
|
||||
enable: this.enable
|
||||
})
|
||||
|
||||
static parse = ({ deviceId, enable }: SerializedUpdateEnableActivityLevelBlockingAction) => (
|
||||
new UpdateEnableActivityLevelBlockingAction({ deviceId, enable })
|
||||
)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* server component for the TimeLimit App
|
||||
* Copyright (C) 2019 Jonas Lochmann
|
||||
* Copyright (C) 2019 - 2020 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
|
||||
@@ -34,12 +34,6 @@ export class UpdateNetworkTimeVerificationAction extends ParentAction {
|
||||
this.mode = mode
|
||||
}
|
||||
|
||||
serialize = (): SerialiizedUpdateNetworkTimeVerificationAction => ({
|
||||
type: 'UPDATE_NETWORK_TIME_VERIFICATION',
|
||||
deviceId: this.deviceId,
|
||||
mode: this.mode
|
||||
})
|
||||
|
||||
static parse = ({ deviceId, mode }: SerialiizedUpdateNetworkTimeVerificationAction) => (
|
||||
new UpdateNetworkTimeVerificationAction({
|
||||
deviceId,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* server component for the TimeLimit App
|
||||
* Copyright (C) 2019 Jonas Lochmann
|
||||
* Copyright (C) 2019 - 2020 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
|
||||
@@ -53,12 +53,6 @@ export class UpdateParentBlockedTimesAction extends ParentAction {
|
||||
this.blockedTimes = blockedTimes
|
||||
}
|
||||
|
||||
serialize = (): SerializedUpdateParentBlockedTimesAction => ({
|
||||
type: 'UPDATE_PARENT_BLOCKED_TIMES',
|
||||
parentId: this.parentId,
|
||||
times: this.blockedTimes
|
||||
})
|
||||
|
||||
static parse = ({ parentId, times }: SerializedUpdateParentBlockedTimesAction) => (
|
||||
new UpdateParentBlockedTimesAction({
|
||||
parentId,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* server component for the TimeLimit App
|
||||
* Copyright (C) 2019 Jonas Lochmann
|
||||
* Copyright (C) 2019 - 2020 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
|
||||
@@ -45,13 +45,6 @@ export class UpdateParentNotificationFlagsAction extends ParentAction {
|
||||
this.set = set
|
||||
}
|
||||
|
||||
serialize = (): SerializedUpdateParentNotificationFlagsAction => ({
|
||||
type: 'UPDATE_PARENT_NOTIFICATION_FLAGS',
|
||||
parentId: this.parentId,
|
||||
flags: this.flags,
|
||||
set: this.set
|
||||
})
|
||||
|
||||
static parse = ({ parentId, flags, set }: SerializedUpdateParentNotificationFlagsAction) => (
|
||||
new UpdateParentNotificationFlagsAction({ parentId, flags, set })
|
||||
)
|
||||
|
||||
@@ -85,18 +85,6 @@ export class UpdateTimelimitRuleAction extends ParentAction {
|
||||
}
|
||||
}
|
||||
|
||||
serialize = (): SerializedUpdateTimelimitRuleAction => ({
|
||||
type: 'UPDATE_TIMELIMIT_RULE',
|
||||
ruleId: this.ruleId,
|
||||
time: this.maximumTimeInMillis,
|
||||
days: this.dayMask,
|
||||
extraTime: this.applyToExtraTimeUsage,
|
||||
start: this.start,
|
||||
end: this.end,
|
||||
pause: this.sessionPauseMilliseconds,
|
||||
dur: this.sessionDurationMilliseconds
|
||||
})
|
||||
|
||||
static parse = ({ ruleId, time, days, extraTime, start, end, dur, pause }: SerializedUpdateTimelimitRuleAction) => (
|
||||
new UpdateTimelimitRuleAction({
|
||||
ruleId,
|
||||
|
||||
@@ -46,13 +46,6 @@ export class UpdateUserFlagsAction extends ParentAction {
|
||||
this.newValues = newValues
|
||||
}
|
||||
|
||||
serialize = (): SerializedUpdateUserFlagsAction => ({
|
||||
type: 'UPDATE_USER_FLAGS',
|
||||
userId: this.userId,
|
||||
modified: this.modifiedBits,
|
||||
values: this.newValues
|
||||
})
|
||||
|
||||
static parse = ({ userId, modified, values }: SerializedUpdateUserFlagsAction) => (
|
||||
new UpdateUserFlagsAction({
|
||||
userId,
|
||||
|
||||
@@ -38,12 +38,6 @@ export class UpdateUserLimitLoginCategory extends ParentAction {
|
||||
this.categoryId = categoryId
|
||||
}
|
||||
|
||||
serialize = (): SerializedUpdateUserLimitLoginCategory => ({
|
||||
type: 'UPDATE_USER_LIMIT_LOGIN_CATEGORY',
|
||||
userId: this.userId,
|
||||
categoryId: this.categoryId
|
||||
})
|
||||
|
||||
static parse = ({ userId, categoryId }: SerializedUpdateUserLimitLoginCategory) => (
|
||||
new UpdateUserLimitLoginCategory({
|
||||
userId,
|
||||
|
||||
Reference in New Issue
Block a user