mirror of
https://codeberg.org/timelimit/timelimit-server.git
synced 2025-10-03 09:49:32 +02:00
Add platformLevel and platformType
This commit is contained in:
parent
376a2cc624
commit
8ec0781859
18 changed files with 375 additions and 11 deletions
|
@ -545,6 +545,12 @@
|
||||||
},
|
},
|
||||||
"addedManipulationFlags": {
|
"addedManipulationFlags": {
|
||||||
"type": "number"
|
"type": "number"
|
||||||
|
},
|
||||||
|
"platformType": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"platformLevel": {
|
||||||
|
"type": "number"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"additionalProperties": false,
|
"additionalProperties": false,
|
||||||
|
|
|
@ -212,6 +212,12 @@
|
||||||
},
|
},
|
||||||
"pk": {
|
"pk": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
|
},
|
||||||
|
"pType": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"pLevel": {
|
||||||
|
"type": "number"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"additionalProperties": false,
|
"additionalProperties": false,
|
||||||
|
@ -240,6 +246,7 @@
|
||||||
"model",
|
"model",
|
||||||
"name",
|
"name",
|
||||||
"networkTime",
|
"networkTime",
|
||||||
|
"pLevel",
|
||||||
"qOrLater",
|
"qOrLater",
|
||||||
"reboot",
|
"reboot",
|
||||||
"rebootIsManipulation",
|
"rebootIsManipulation",
|
||||||
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
# Untitled number in SerializedAppLogicAction Schema
|
||||||
|
|
||||||
|
```txt
|
||||||
|
https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedUpdateDeviceStatusAction/properties/platformLevel
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
| Abstract | Extensible | Status | Identifiable | Custom Properties | Additional Properties | Access Restrictions | Defined In |
|
||||||
|
| :------------------ | :--------- | :------------- | :---------------------- | :---------------- | :-------------------- | :------------------ | :---------------------------------------------------------------------------------------------------- |
|
||||||
|
| Can be instantiated | No | Unknown status | Unknown identifiability | Forbidden | Allowed | none | [SerializedAppLogicAction.schema.json\*](SerializedAppLogicAction.schema.json "open original schema") |
|
||||||
|
|
||||||
|
## platformLevel Type
|
||||||
|
|
||||||
|
`number`
|
|
@ -0,0 +1,15 @@
|
||||||
|
# Untitled string in SerializedAppLogicAction Schema
|
||||||
|
|
||||||
|
```txt
|
||||||
|
https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedUpdateDeviceStatusAction/properties/platformType
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
| Abstract | Extensible | Status | Identifiable | Custom Properties | Additional Properties | Access Restrictions | Defined In |
|
||||||
|
| :------------------ | :--------- | :------------- | :---------------------- | :---------------- | :-------------------- | :------------------ | :---------------------------------------------------------------------------------------------------- |
|
||||||
|
| Can be instantiated | No | Unknown status | Unknown identifiability | Forbidden | Allowed | none | [SerializedAppLogicAction.schema.json\*](SerializedAppLogicAction.schema.json "open original schema") |
|
||||||
|
|
||||||
|
## platformType Type
|
||||||
|
|
||||||
|
`string`
|
|
@ -28,6 +28,8 @@ https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedUpdateDevic
|
||||||
| [didReboot](#didreboot) | `boolean` | Optional | cannot be null | [SerializedAppLogicAction](serializedapplogicaction-definitions-serializedupdatedevicestatusaction-properties-didreboot.md "https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedUpdateDeviceStatusAction/properties/didReboot") |
|
| [didReboot](#didreboot) | `boolean` | Optional | cannot be null | [SerializedAppLogicAction](serializedapplogicaction-definitions-serializedupdatedevicestatusaction-properties-didreboot.md "https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedUpdateDeviceStatusAction/properties/didReboot") |
|
||||||
| [isQOrLaterNow](#isqorlaternow) | `boolean` | Optional | cannot be null | [SerializedAppLogicAction](serializedapplogicaction-definitions-serializedupdatedevicestatusaction-properties-isqorlaternow.md "https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedUpdateDeviceStatusAction/properties/isQOrLaterNow") |
|
| [isQOrLaterNow](#isqorlaternow) | `boolean` | Optional | cannot be null | [SerializedAppLogicAction](serializedapplogicaction-definitions-serializedupdatedevicestatusaction-properties-isqorlaternow.md "https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedUpdateDeviceStatusAction/properties/isQOrLaterNow") |
|
||||||
| [addedManipulationFlags](#addedmanipulationflags) | `number` | Optional | cannot be null | [SerializedAppLogicAction](serializedapplogicaction-definitions-serializedupdatedevicestatusaction-properties-addedmanipulationflags.md "https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedUpdateDeviceStatusAction/properties/addedManipulationFlags") |
|
| [addedManipulationFlags](#addedmanipulationflags) | `number` | Optional | cannot be null | [SerializedAppLogicAction](serializedapplogicaction-definitions-serializedupdatedevicestatusaction-properties-addedmanipulationflags.md "https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedUpdateDeviceStatusAction/properties/addedManipulationFlags") |
|
||||||
|
| [platformType](#platformtype) | `string` | Optional | cannot be null | [SerializedAppLogicAction](serializedapplogicaction-definitions-serializedupdatedevicestatusaction-properties-platformtype.md "https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedUpdateDeviceStatusAction/properties/platformType") |
|
||||||
|
| [platformLevel](#platformlevel) | `number` | Optional | cannot be null | [SerializedAppLogicAction](serializedapplogicaction-definitions-serializedupdatedevicestatusaction-properties-platformlevel.md "https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedUpdateDeviceStatusAction/properties/platformLevel") |
|
||||||
|
|
||||||
## type
|
## type
|
||||||
|
|
||||||
|
@ -257,3 +259,39 @@ https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedUpdateDevic
|
||||||
### addedManipulationFlags Type
|
### addedManipulationFlags Type
|
||||||
|
|
||||||
`number`
|
`number`
|
||||||
|
|
||||||
|
## platformType
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
`platformType`
|
||||||
|
|
||||||
|
* is optional
|
||||||
|
|
||||||
|
* Type: `string`
|
||||||
|
|
||||||
|
* cannot be null
|
||||||
|
|
||||||
|
* defined in: [SerializedAppLogicAction](serializedapplogicaction-definitions-serializedupdatedevicestatusaction-properties-platformtype.md "https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedUpdateDeviceStatusAction/properties/platformType")
|
||||||
|
|
||||||
|
### platformType Type
|
||||||
|
|
||||||
|
`string`
|
||||||
|
|
||||||
|
## platformLevel
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
`platformLevel`
|
||||||
|
|
||||||
|
* is optional
|
||||||
|
|
||||||
|
* Type: `number`
|
||||||
|
|
||||||
|
* cannot be null
|
||||||
|
|
||||||
|
* defined in: [SerializedAppLogicAction](serializedapplogicaction-definitions-serializedupdatedevicestatusaction-properties-platformlevel.md "https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedUpdateDeviceStatusAction/properties/platformLevel")
|
||||||
|
|
||||||
|
### platformLevel Type
|
||||||
|
|
||||||
|
`number`
|
||||||
|
|
|
@ -1240,6 +1240,8 @@ Reference this group by using
|
||||||
| [didReboot](#didreboot) | `boolean` | Optional | cannot be null | [SerializedAppLogicAction](serializedapplogicaction-definitions-serializedupdatedevicestatusaction-properties-didreboot.md "https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedUpdateDeviceStatusAction/properties/didReboot") |
|
| [didReboot](#didreboot) | `boolean` | Optional | cannot be null | [SerializedAppLogicAction](serializedapplogicaction-definitions-serializedupdatedevicestatusaction-properties-didreboot.md "https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedUpdateDeviceStatusAction/properties/didReboot") |
|
||||||
| [isQOrLaterNow](#isqorlaternow) | `boolean` | Optional | cannot be null | [SerializedAppLogicAction](serializedapplogicaction-definitions-serializedupdatedevicestatusaction-properties-isqorlaternow.md "https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedUpdateDeviceStatusAction/properties/isQOrLaterNow") |
|
| [isQOrLaterNow](#isqorlaternow) | `boolean` | Optional | cannot be null | [SerializedAppLogicAction](serializedapplogicaction-definitions-serializedupdatedevicestatusaction-properties-isqorlaternow.md "https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedUpdateDeviceStatusAction/properties/isQOrLaterNow") |
|
||||||
| [addedManipulationFlags](#addedmanipulationflags) | `number` | Optional | cannot be null | [SerializedAppLogicAction](serializedapplogicaction-definitions-serializedupdatedevicestatusaction-properties-addedmanipulationflags.md "https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedUpdateDeviceStatusAction/properties/addedManipulationFlags") |
|
| [addedManipulationFlags](#addedmanipulationflags) | `number` | Optional | cannot be null | [SerializedAppLogicAction](serializedapplogicaction-definitions-serializedupdatedevicestatusaction-properties-addedmanipulationflags.md "https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedUpdateDeviceStatusAction/properties/addedManipulationFlags") |
|
||||||
|
| [platformType](#platformtype) | `string` | Optional | cannot be null | [SerializedAppLogicAction](serializedapplogicaction-definitions-serializedupdatedevicestatusaction-properties-platformtype.md "https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedUpdateDeviceStatusAction/properties/platformType") |
|
||||||
|
| [platformLevel](#platformlevel) | `number` | Optional | cannot be null | [SerializedAppLogicAction](serializedapplogicaction-definitions-serializedupdatedevicestatusaction-properties-platformlevel.md "https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedUpdateDeviceStatusAction/properties/platformLevel") |
|
||||||
|
|
||||||
### type
|
### type
|
||||||
|
|
||||||
|
@ -1470,6 +1472,42 @@ Reference this group by using
|
||||||
|
|
||||||
`number`
|
`number`
|
||||||
|
|
||||||
|
### platformType
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
`platformType`
|
||||||
|
|
||||||
|
* is optional
|
||||||
|
|
||||||
|
* Type: `string`
|
||||||
|
|
||||||
|
* cannot be null
|
||||||
|
|
||||||
|
* defined in: [SerializedAppLogicAction](serializedapplogicaction-definitions-serializedupdatedevicestatusaction-properties-platformtype.md "https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedUpdateDeviceStatusAction/properties/platformType")
|
||||||
|
|
||||||
|
#### platformType Type
|
||||||
|
|
||||||
|
`string`
|
||||||
|
|
||||||
|
### platformLevel
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
`platformLevel`
|
||||||
|
|
||||||
|
* is optional
|
||||||
|
|
||||||
|
* Type: `number`
|
||||||
|
|
||||||
|
* cannot be null
|
||||||
|
|
||||||
|
* defined in: [SerializedAppLogicAction](serializedapplogicaction-definitions-serializedupdatedevicestatusaction-properties-platformlevel.md "https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedUpdateDeviceStatusAction/properties/platformLevel")
|
||||||
|
|
||||||
|
#### platformLevel Type
|
||||||
|
|
||||||
|
`number`
|
||||||
|
|
||||||
## Definitions group SerializedUploadDevicePublicKeyAction
|
## Definitions group SerializedUploadDevicePublicKeyAction
|
||||||
|
|
||||||
Reference this group by using
|
Reference this group by using
|
||||||
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
# Untitled number in ServerDataStatus Schema
|
||||||
|
|
||||||
|
```txt
|
||||||
|
https://timelimit.io/ServerDataStatus#/definitions/ServerDeviceData/properties/pLevel
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
| Abstract | Extensible | Status | Identifiable | Custom Properties | Additional Properties | Access Restrictions | Defined In |
|
||||||
|
| :------------------ | :--------- | :------------- | :---------------------- | :---------------- | :-------------------- | :------------------ | :------------------------------------------------------------------------------------ |
|
||||||
|
| Can be instantiated | No | Unknown status | Unknown identifiability | Forbidden | Allowed | none | [ServerDataStatus.schema.json\*](ServerDataStatus.schema.json "open original schema") |
|
||||||
|
|
||||||
|
## pLevel Type
|
||||||
|
|
||||||
|
`number`
|
|
@ -0,0 +1,15 @@
|
||||||
|
# Untitled string in ServerDataStatus Schema
|
||||||
|
|
||||||
|
```txt
|
||||||
|
https://timelimit.io/ServerDataStatus#/definitions/ServerDeviceData/properties/pType
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
| Abstract | Extensible | Status | Identifiable | Custom Properties | Additional Properties | Access Restrictions | Defined In |
|
||||||
|
| :------------------ | :--------- | :------------- | :---------------------- | :---------------- | :-------------------- | :------------------ | :------------------------------------------------------------------------------------ |
|
||||||
|
| Can be instantiated | No | Unknown status | Unknown identifiability | Forbidden | Allowed | none | [ServerDataStatus.schema.json\*](ServerDataStatus.schema.json "open original schema") |
|
||||||
|
|
||||||
|
## pType Type
|
||||||
|
|
||||||
|
`string`
|
|
@ -50,6 +50,8 @@ https://timelimit.io/ServerDataStatus#/definitions/ServerDeviceData
|
||||||
| [qOrLater](#qorlater) | `boolean` | Required | cannot be null | [ServerDataStatus](serverdatastatus-definitions-serverdevicedata-properties-qorlater.md "https://timelimit.io/ServerDataStatus#/definitions/ServerDeviceData/properties/qOrLater") |
|
| [qOrLater](#qorlater) | `boolean` | Required | cannot be null | [ServerDataStatus](serverdatastatus-definitions-serverdevicedata-properties-qorlater.md "https://timelimit.io/ServerDataStatus#/definitions/ServerDeviceData/properties/qOrLater") |
|
||||||
| [mFlags](#mflags) | `number` | Required | cannot be null | [ServerDataStatus](serverdatastatus-definitions-serverdevicedata-properties-mflags.md "https://timelimit.io/ServerDataStatus#/definitions/ServerDeviceData/properties/mFlags") |
|
| [mFlags](#mflags) | `number` | Required | cannot be null | [ServerDataStatus](serverdatastatus-definitions-serverdevicedata-properties-mflags.md "https://timelimit.io/ServerDataStatus#/definitions/ServerDeviceData/properties/mFlags") |
|
||||||
| [pk](#pk) | `string` | Optional | cannot be null | [ServerDataStatus](serverdatastatus-definitions-serverdevicedata-properties-pk.md "https://timelimit.io/ServerDataStatus#/definitions/ServerDeviceData/properties/pk") |
|
| [pk](#pk) | `string` | Optional | cannot be null | [ServerDataStatus](serverdatastatus-definitions-serverdevicedata-properties-pk.md "https://timelimit.io/ServerDataStatus#/definitions/ServerDeviceData/properties/pk") |
|
||||||
|
| [pType](#ptype) | `string` | Optional | cannot be null | [ServerDataStatus](serverdatastatus-definitions-serverdevicedata-properties-ptype.md "https://timelimit.io/ServerDataStatus#/definitions/ServerDeviceData/properties/pType") |
|
||||||
|
| [pLevel](#plevel) | `number` | Required | cannot be null | [ServerDataStatus](serverdatastatus-definitions-serverdevicedata-properties-plevel.md "https://timelimit.io/ServerDataStatus#/definitions/ServerDeviceData/properties/pLevel") |
|
||||||
|
|
||||||
## deviceId
|
## deviceId
|
||||||
|
|
||||||
|
@ -718,3 +720,39 @@ https://timelimit.io/ServerDataStatus#/definitions/ServerDeviceData
|
||||||
### pk Type
|
### pk Type
|
||||||
|
|
||||||
`string`
|
`string`
|
||||||
|
|
||||||
|
## pType
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
`pType`
|
||||||
|
|
||||||
|
* is optional
|
||||||
|
|
||||||
|
* Type: `string`
|
||||||
|
|
||||||
|
* cannot be null
|
||||||
|
|
||||||
|
* defined in: [ServerDataStatus](serverdatastatus-definitions-serverdevicedata-properties-ptype.md "https://timelimit.io/ServerDataStatus#/definitions/ServerDeviceData/properties/pType")
|
||||||
|
|
||||||
|
### pType Type
|
||||||
|
|
||||||
|
`string`
|
||||||
|
|
||||||
|
## pLevel
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
`pLevel`
|
||||||
|
|
||||||
|
* is required
|
||||||
|
|
||||||
|
* Type: `number`
|
||||||
|
|
||||||
|
* cannot be null
|
||||||
|
|
||||||
|
* defined in: [ServerDataStatus](serverdatastatus-definitions-serverdevicedata-properties-plevel.md "https://timelimit.io/ServerDataStatus#/definitions/ServerDeviceData/properties/pLevel")
|
||||||
|
|
||||||
|
### pLevel Type
|
||||||
|
|
||||||
|
`number`
|
||||||
|
|
|
@ -435,6 +435,8 @@ Reference this group by using
|
||||||
| [qOrLater](#qorlater) | `boolean` | Required | cannot be null | [ServerDataStatus](serverdatastatus-definitions-serverdevicedata-properties-qorlater.md "https://timelimit.io/ServerDataStatus#/definitions/ServerDeviceData/properties/qOrLater") |
|
| [qOrLater](#qorlater) | `boolean` | Required | cannot be null | [ServerDataStatus](serverdatastatus-definitions-serverdevicedata-properties-qorlater.md "https://timelimit.io/ServerDataStatus#/definitions/ServerDeviceData/properties/qOrLater") |
|
||||||
| [mFlags](#mflags) | `number` | Required | cannot be null | [ServerDataStatus](serverdatastatus-definitions-serverdevicedata-properties-mflags.md "https://timelimit.io/ServerDataStatus#/definitions/ServerDeviceData/properties/mFlags") |
|
| [mFlags](#mflags) | `number` | Required | cannot be null | [ServerDataStatus](serverdatastatus-definitions-serverdevicedata-properties-mflags.md "https://timelimit.io/ServerDataStatus#/definitions/ServerDeviceData/properties/mFlags") |
|
||||||
| [pk](#pk) | `string` | Optional | cannot be null | [ServerDataStatus](serverdatastatus-definitions-serverdevicedata-properties-pk.md "https://timelimit.io/ServerDataStatus#/definitions/ServerDeviceData/properties/pk") |
|
| [pk](#pk) | `string` | Optional | cannot be null | [ServerDataStatus](serverdatastatus-definitions-serverdevicedata-properties-pk.md "https://timelimit.io/ServerDataStatus#/definitions/ServerDeviceData/properties/pk") |
|
||||||
|
| [pType](#ptype) | `string` | Optional | cannot be null | [ServerDataStatus](serverdatastatus-definitions-serverdevicedata-properties-ptype.md "https://timelimit.io/ServerDataStatus#/definitions/ServerDeviceData/properties/pType") |
|
||||||
|
| [pLevel](#plevel) | `number` | Required | cannot be null | [ServerDataStatus](serverdatastatus-definitions-serverdevicedata-properties-plevel.md "https://timelimit.io/ServerDataStatus#/definitions/ServerDeviceData/properties/pLevel") |
|
||||||
|
|
||||||
### deviceId
|
### deviceId
|
||||||
|
|
||||||
|
@ -1104,6 +1106,42 @@ Reference this group by using
|
||||||
|
|
||||||
`string`
|
`string`
|
||||||
|
|
||||||
|
### pType
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
`pType`
|
||||||
|
|
||||||
|
* is optional
|
||||||
|
|
||||||
|
* Type: `string`
|
||||||
|
|
||||||
|
* cannot be null
|
||||||
|
|
||||||
|
* defined in: [ServerDataStatus](serverdatastatus-definitions-serverdevicedata-properties-ptype.md "https://timelimit.io/ServerDataStatus#/definitions/ServerDeviceData/properties/pType")
|
||||||
|
|
||||||
|
#### pType Type
|
||||||
|
|
||||||
|
`string`
|
||||||
|
|
||||||
|
### pLevel
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
`pLevel`
|
||||||
|
|
||||||
|
* is required
|
||||||
|
|
||||||
|
* Type: `number`
|
||||||
|
|
||||||
|
* cannot be null
|
||||||
|
|
||||||
|
* defined in: [ServerDataStatus](serverdatastatus-definitions-serverdevicedata-properties-plevel.md "https://timelimit.io/ServerDataStatus#/definitions/ServerDeviceData/properties/pLevel")
|
||||||
|
|
||||||
|
#### pLevel Type
|
||||||
|
|
||||||
|
`number`
|
||||||
|
|
||||||
## Definitions group ProtectionLevel
|
## Definitions group ProtectionLevel
|
||||||
|
|
||||||
Reference this group by using
|
Reference this group by using
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* server component for the TimeLimit App
|
* server component for the TimeLimit App
|
||||||
* Copyright (C) 2019 - 2022 Jonas Lochmann
|
* Copyright (C) 2019 - 2023 Jonas Lochmann
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Affero General Public License as
|
* it under the terms of the GNU Affero General Public License as
|
||||||
|
@ -15,6 +15,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import { minPlatformLevel, maxPlatformLevel, minPlatformTypeLength, maxPlatformTypeLength } from '../database/device'
|
||||||
import { NewPermissionStatus } from '../model/newpermissionstatus'
|
import { NewPermissionStatus } from '../model/newpermissionstatus'
|
||||||
import { ProtectionLevel } from '../model/protectionlevel'
|
import { ProtectionLevel } from '../model/protectionlevel'
|
||||||
import { RuntimePermissionStatus } from '../model/runtimepermissionstatus'
|
import { RuntimePermissionStatus } from '../model/runtimepermissionstatus'
|
||||||
|
@ -33,6 +34,8 @@ export class UpdateDeviceStatusAction extends AppLogicAction {
|
||||||
readonly didReboot: boolean
|
readonly didReboot: boolean
|
||||||
readonly isQOrLaterNow: boolean
|
readonly isQOrLaterNow: boolean
|
||||||
readonly addedManipulationFlags: number
|
readonly addedManipulationFlags: number
|
||||||
|
readonly platformType?: string
|
||||||
|
readonly platformLevel?: number
|
||||||
|
|
||||||
constructor ({
|
constructor ({
|
||||||
newProtetionLevel,
|
newProtetionLevel,
|
||||||
|
@ -43,7 +46,9 @@ export class UpdateDeviceStatusAction extends AppLogicAction {
|
||||||
newAppVersion,
|
newAppVersion,
|
||||||
didReboot,
|
didReboot,
|
||||||
isQOrLaterNow,
|
isQOrLaterNow,
|
||||||
addedManipulationFlags
|
addedManipulationFlags,
|
||||||
|
platformType,
|
||||||
|
platformLevel
|
||||||
}: {
|
}: {
|
||||||
newProtetionLevel?: ProtectionLevel
|
newProtetionLevel?: ProtectionLevel
|
||||||
newUsageStatsPermissionStatus?: RuntimePermissionStatus
|
newUsageStatsPermissionStatus?: RuntimePermissionStatus
|
||||||
|
@ -54,6 +59,8 @@ export class UpdateDeviceStatusAction extends AppLogicAction {
|
||||||
didReboot: boolean
|
didReboot: boolean
|
||||||
isQOrLaterNow: boolean
|
isQOrLaterNow: boolean
|
||||||
addedManipulationFlags: number
|
addedManipulationFlags: number
|
||||||
|
platformType?: string
|
||||||
|
platformLevel?: number
|
||||||
}) {
|
}) {
|
||||||
super()
|
super()
|
||||||
|
|
||||||
|
@ -67,6 +74,20 @@ export class UpdateDeviceStatusAction extends AppLogicAction {
|
||||||
|
|
||||||
assertSafeInteger({ actionType, field: 'addedManipulationFlags', value: addedManipulationFlags })
|
assertSafeInteger({ actionType, field: 'addedManipulationFlags', value: addedManipulationFlags })
|
||||||
|
|
||||||
|
if (platformType !== undefined) {
|
||||||
|
if (platformType.length < minPlatformTypeLength || platformType.length > maxPlatformTypeLength) {
|
||||||
|
throwOutOfRange({ actionType, field: 'platformType.length', value: platformType.length })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (platformLevel !== undefined) {
|
||||||
|
assertSafeInteger({ actionType, field: 'platformLevel', value: platformLevel })
|
||||||
|
|
||||||
|
if (platformLevel < minPlatformLevel || platformLevel > maxPlatformLevel) {
|
||||||
|
throwOutOfRange({ actionType, field: 'platformLevel', value: platformLevel })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
this.newProtetionLevel = newProtetionLevel
|
this.newProtetionLevel = newProtetionLevel
|
||||||
this.newUsageStatsPermissionStatus = newUsageStatsPermissionStatus
|
this.newUsageStatsPermissionStatus = newUsageStatsPermissionStatus
|
||||||
this.newNotificationAccessPermission = newNotificationAccessPermission
|
this.newNotificationAccessPermission = newNotificationAccessPermission
|
||||||
|
@ -76,6 +97,8 @@ export class UpdateDeviceStatusAction extends AppLogicAction {
|
||||||
this.didReboot = didReboot
|
this.didReboot = didReboot
|
||||||
this.isQOrLaterNow = isQOrLaterNow
|
this.isQOrLaterNow = isQOrLaterNow
|
||||||
this.addedManipulationFlags = addedManipulationFlags
|
this.addedManipulationFlags = addedManipulationFlags
|
||||||
|
this.platformType = platformType
|
||||||
|
this.platformLevel = platformLevel
|
||||||
}
|
}
|
||||||
|
|
||||||
static parse = ({
|
static parse = ({
|
||||||
|
@ -87,7 +110,9 @@ export class UpdateDeviceStatusAction extends AppLogicAction {
|
||||||
appVersion,
|
appVersion,
|
||||||
didReboot,
|
didReboot,
|
||||||
isQOrLaterNow,
|
isQOrLaterNow,
|
||||||
addedManipulationFlags
|
addedManipulationFlags,
|
||||||
|
platformType,
|
||||||
|
platformLevel
|
||||||
}: SerializedUpdateDeviceStatusAction) => (
|
}: SerializedUpdateDeviceStatusAction) => (
|
||||||
new UpdateDeviceStatusAction({
|
new UpdateDeviceStatusAction({
|
||||||
newProtetionLevel: protectionLevel,
|
newProtetionLevel: protectionLevel,
|
||||||
|
@ -98,7 +123,9 @@ export class UpdateDeviceStatusAction extends AppLogicAction {
|
||||||
newAppVersion: appVersion,
|
newAppVersion: appVersion,
|
||||||
didReboot: !!didReboot,
|
didReboot: !!didReboot,
|
||||||
isQOrLaterNow: !!isQOrLaterNow,
|
isQOrLaterNow: !!isQOrLaterNow,
|
||||||
addedManipulationFlags: addedManipulationFlags || 0
|
addedManipulationFlags: addedManipulationFlags || 0,
|
||||||
|
platformType: platformType,
|
||||||
|
platformLevel: platformLevel
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -114,4 +141,6 @@ export interface SerializedUpdateDeviceStatusAction {
|
||||||
didReboot?: boolean
|
didReboot?: boolean
|
||||||
isQOrLaterNow?: boolean
|
isQOrLaterNow?: boolean
|
||||||
addedManipulationFlags?: number
|
addedManipulationFlags?: number
|
||||||
|
platformType?: string
|
||||||
|
platformLevel?: number
|
||||||
}
|
}
|
||||||
|
|
|
@ -1982,6 +1982,12 @@ const definitions = {
|
||||||
},
|
},
|
||||||
"addedManipulationFlags": {
|
"addedManipulationFlags": {
|
||||||
"type": "number"
|
"type": "number"
|
||||||
|
},
|
||||||
|
"platformType": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"platformLevel": {
|
||||||
|
"type": "number"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"additionalProperties": false,
|
"additionalProperties": false,
|
||||||
|
@ -2164,6 +2170,12 @@ const definitions = {
|
||||||
},
|
},
|
||||||
"pk": {
|
"pk": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
|
},
|
||||||
|
"pType": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"pLevel": {
|
||||||
|
"type": "number"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"additionalProperties": false,
|
"additionalProperties": false,
|
||||||
|
@ -2192,6 +2204,7 @@ const definitions = {
|
||||||
"model",
|
"model",
|
||||||
"name",
|
"name",
|
||||||
"networkTime",
|
"networkTime",
|
||||||
|
"pLevel",
|
||||||
"qOrLater",
|
"qOrLater",
|
||||||
"reboot",
|
"reboot",
|
||||||
"rebootIsManipulation",
|
"rebootIsManipulation",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* server component for the TimeLimit App
|
* server component for the TimeLimit App
|
||||||
* Copyright (C) 2019 - 2022 Jonas Lochmann
|
* Copyright (C) 2019 - 2023 Jonas Lochmann
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Affero General Public License as
|
* it under the terms of the GNU Affero General Public License as
|
||||||
|
@ -37,6 +37,12 @@ export const DeviceManipulationFlags = {
|
||||||
ALL: 1
|
ALL: 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const minPlatformTypeLength = 1
|
||||||
|
export const maxPlatformTypeLength = 8
|
||||||
|
|
||||||
|
export const minPlatformLevel = 0
|
||||||
|
export const maxPlatformLevel = 128
|
||||||
|
|
||||||
export interface DeviceAttributesVersion1 {
|
export interface DeviceAttributesVersion1 {
|
||||||
familyId: string
|
familyId: string
|
||||||
deviceId: string
|
deviceId: string
|
||||||
|
@ -119,11 +125,17 @@ export interface DeviceAttributesVersion14 {
|
||||||
nextKeyReplySequenceNumber: string
|
nextKeyReplySequenceNumber: string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface DeviceAttributesVersion15 {
|
||||||
|
platformType: string | null
|
||||||
|
platformLevel: number
|
||||||
|
}
|
||||||
|
|
||||||
export type DeviceAttributes = DeviceAttributesVersion1 & DeviceAttributesVersion2 &
|
export type DeviceAttributes = DeviceAttributesVersion1 & DeviceAttributesVersion2 &
|
||||||
DeviceAttributesVersion3 & DeviceAttributesVersion4 & DeviceAttributesVersion5 &
|
DeviceAttributesVersion3 & DeviceAttributesVersion4 & DeviceAttributesVersion5 &
|
||||||
DeviceAttributesVersion6 & DeviceAttributesVersion7 & DeviceAttributesVersion8 &
|
DeviceAttributesVersion6 & DeviceAttributesVersion7 & DeviceAttributesVersion8 &
|
||||||
DeviceAttributesVersion9 & DeviceAttributesVersion10 & DeviceAttributesVersion11 &
|
DeviceAttributesVersion9 & DeviceAttributesVersion10 & DeviceAttributesVersion11 &
|
||||||
DeviceAttributesVersion12 & DeviceAttributesVersion13 & DeviceAttributesVersion14
|
DeviceAttributesVersion12 & DeviceAttributesVersion13 & DeviceAttributesVersion14 &
|
||||||
|
DeviceAttributesVersion15
|
||||||
|
|
||||||
export type DeviceModel = Sequelize.Model<DeviceAttributes> & DeviceAttributes
|
export type DeviceModel = Sequelize.Model<DeviceAttributes> & DeviceAttributes
|
||||||
export type DeviceModelStatic = typeof Sequelize.Model & {
|
export type DeviceModelStatic = typeof Sequelize.Model & {
|
||||||
|
@ -305,6 +317,26 @@ export const attributesVersion14: SequelizeAttributes<DeviceAttributesVersion14>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const attributesVersion15: SequelizeAttributes<DeviceAttributesVersion15> = {
|
||||||
|
platformType: {
|
||||||
|
type: Sequelize.STRING(maxPlatformTypeLength),
|
||||||
|
allowNull: true,
|
||||||
|
defaultValue: null,
|
||||||
|
validate: {
|
||||||
|
len: [minPlatformTypeLength, maxPlatformTypeLength]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
platformLevel: {
|
||||||
|
type: Sequelize.INTEGER,
|
||||||
|
allowNull: false,
|
||||||
|
defaultValue: minPlatformLevel,
|
||||||
|
validate: {
|
||||||
|
min: minPlatformLevel,
|
||||||
|
max: maxPlatformLevel
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export const attributes: SequelizeAttributes<DeviceAttributes> = {
|
export const attributes: SequelizeAttributes<DeviceAttributes> = {
|
||||||
...attributesVersion1,
|
...attributesVersion1,
|
||||||
...attributesVersion2,
|
...attributesVersion2,
|
||||||
|
@ -319,7 +351,8 @@ export const attributes: SequelizeAttributes<DeviceAttributes> = {
|
||||||
...attributesVersion11,
|
...attributesVersion11,
|
||||||
...attributesVersion12,
|
...attributesVersion12,
|
||||||
...attributesVersion13,
|
...attributesVersion13,
|
||||||
...attributesVersion14
|
...attributesVersion14,
|
||||||
|
...attributesVersion15
|
||||||
}
|
}
|
||||||
|
|
||||||
export const createDeviceModel = (sequelize: Sequelize.Sequelize): DeviceModelStatic => sequelize.define('Device', attributes) as DeviceModelStatic
|
export const createDeviceModel = (sequelize: Sequelize.Sequelize): DeviceModelStatic => sequelize.define('Device', attributes) as DeviceModelStatic
|
||||||
|
|
|
@ -0,0 +1,46 @@
|
||||||
|
/*
|
||||||
|
* server component for the TimeLimit App
|
||||||
|
* Copyright (C) 2019 - 2023 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
|
||||||
|
* published by the Free Software Foundation, version 3 of the License.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU Affero General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { QueryInterface, Sequelize, Transaction } from 'sequelize'
|
||||||
|
import { attributesVersion15 as deviceAttributes } from '../../device'
|
||||||
|
|
||||||
|
export async function up (queryInterface: QueryInterface, sequelize: Sequelize) {
|
||||||
|
await sequelize.transaction({
|
||||||
|
type: Transaction.TYPES.EXCLUSIVE
|
||||||
|
}, async (transaction) => {
|
||||||
|
await queryInterface.addColumn('Devices', 'platformType', {
|
||||||
|
...deviceAttributes.platformType
|
||||||
|
}, {
|
||||||
|
transaction
|
||||||
|
})
|
||||||
|
|
||||||
|
await queryInterface.addColumn('Devices', 'platformLevel', {
|
||||||
|
...deviceAttributes.platformLevel
|
||||||
|
}, {
|
||||||
|
transaction
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function down (queryInterface: QueryInterface, sequelize: Sequelize) {
|
||||||
|
await sequelize.transaction({
|
||||||
|
type: Transaction.TYPES.EXCLUSIVE
|
||||||
|
}, async (transaction) => {
|
||||||
|
await queryInterface.removeColumn('Devices', 'platformLevel', { transaction })
|
||||||
|
await queryInterface.removeColumn('Devices', 'platformType', { transaction })
|
||||||
|
})
|
||||||
|
}
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* server component for the TimeLimit App
|
* server component for the TimeLimit App
|
||||||
* Copyright (C) 2019 - 2022 Jonas Lochmann
|
* Copyright (C) 2019 - 2023 Jonas Lochmann
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Affero General Public License as
|
* it under the terms of the GNU Affero General Public License as
|
||||||
|
@ -66,5 +66,7 @@ export const prepareDeviceEntry = ({ familyId, userId, deviceAuthToken, deviceId
|
||||||
isQorLater: false,
|
isQorLater: false,
|
||||||
manipulationFlags: 0,
|
manipulationFlags: 0,
|
||||||
publicKey: null,
|
publicKey: null,
|
||||||
nextKeyReplySequenceNumber: '1'
|
nextKeyReplySequenceNumber: '1',
|
||||||
|
platformType: null,
|
||||||
|
platformLevel: 0
|
||||||
})
|
})
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* server component for the TimeLimit App
|
* server component for the TimeLimit App
|
||||||
* Copyright (C) 2019 - 2022 Jonas Lochmann
|
* Copyright (C) 2019 - 2023 Jonas Lochmann
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Affero General Public License as
|
* it under the terms of the GNU Affero General Public License as
|
||||||
|
@ -155,6 +155,18 @@ export async function dispatchUpdateDeviceStatus ({ deviceId, action, cache }: {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (action.platformType !== undefined) {
|
||||||
|
if (action.platformType !== deviceEntry.platformType) {
|
||||||
|
deviceEntry.platformType = action.platformType
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (action.platformLevel !== undefined) {
|
||||||
|
if (action.platformLevel !== deviceEntry.platformLevel) {
|
||||||
|
deviceEntry.platformLevel = action.platformLevel
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
const effectiveManipulationFlags = action.addedManipulationFlags & DeviceManipulationFlags.ALL
|
const effectiveManipulationFlags = action.addedManipulationFlags & DeviceManipulationFlags.ALL
|
||||||
|
|
||||||
|
|
|
@ -66,7 +66,9 @@ export async function getDeviceList ({ database, transaction, familyEntry }: {
|
||||||
activityLevelBlocking: item.activityLevelBlocking,
|
activityLevelBlocking: item.activityLevelBlocking,
|
||||||
qOrLater: item.isQorLater,
|
qOrLater: item.isQorLater,
|
||||||
mFlags: item.manipulationFlags,
|
mFlags: item.manipulationFlags,
|
||||||
pk: item.publicKey ? item.publicKey.toString('base64') : undefined
|
pk: item.publicKey ? item.publicKey.toString('base64') : undefined,
|
||||||
|
pType: item.platformType || undefined,
|
||||||
|
pLevel: item.platformLevel
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -103,6 +103,8 @@ export interface ServerDeviceData {
|
||||||
qOrLater: boolean
|
qOrLater: boolean
|
||||||
mFlags: number // manipulation flags
|
mFlags: number // manipulation flags
|
||||||
pk?: string // public key
|
pk?: string // public key
|
||||||
|
pType?: string
|
||||||
|
pLevel: number
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ServerUpdatedCategoryBaseData {
|
export interface ServerUpdatedCategoryBaseData {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue