mirror of
https://codeberg.org/timelimit/timelimit-server.git
synced 2026-08-31 19:03:45 +02:00
Compare commits
16
Commits
2020-09-16
...
2020-11-09
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8b596ccc69 | ||
|
|
35924c176c | ||
|
|
6d25dd484a | ||
|
|
6eb40d159c | ||
|
|
946381226f | ||
|
|
a767a94430 | ||
|
|
ba3bb50113 | ||
|
|
b4fd177afe | ||
|
|
b17bc42a1e | ||
|
|
8ebeadad5a | ||
|
|
8d65c5d777 | ||
|
|
d68b425e0e | ||
|
|
abc2102da5 | ||
|
|
62f4e368a6 | ||
|
|
32d35dda22 | ||
|
|
d5ddca0032 |
+6
-3
@@ -14,8 +14,8 @@ Use this to get the server status.
|
||||
## Response
|
||||
|
||||
This returns a JSON object with ``websocketClients`` (of the type number,
|
||||
the number of clients connected using the websocket) and the map ``counters``
|
||||
which maps values to numbers. You should not make any assumptions about the counter names
|
||||
the number of clients connected using the websocket) and the maps ``counters`` and ``maxValues``
|
||||
which map values to numbers. You should not make any assumptions about the key names
|
||||
and their availability.
|
||||
|
||||
### example response
|
||||
@@ -25,13 +25,16 @@ and their availability.
|
||||
"websocketClients": 3,
|
||||
"counters": {
|
||||
"testCounter": 1
|
||||
},
|
||||
"maxValues": {
|
||||
"testMax": 3
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## POST /admin/reset-counters
|
||||
|
||||
Use this to reset the counters included in the server status.
|
||||
Use this to reset the counters and maxValues included in the server status.
|
||||
|
||||
Although this uses POST, it does not take any request body
|
||||
|
||||
|
||||
@@ -64,6 +64,9 @@ On success: object with ``deviceAuthToken`` (string) and ``ownDeviceId`` (string
|
||||
|
||||
## POST /parent/can-recover-password
|
||||
|
||||
**Depreacted:** The caller should know by itself if the mail address belongs to the user.
|
||||
``/recover-parent-password`` will report a failure if it does not.
|
||||
|
||||
Use this to check if the parent password can be recovered. This checks that the
|
||||
mail auth token matches the mail address of the parent user.
|
||||
|
||||
|
||||
@@ -7,37 +7,7 @@
|
||||
"actions": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"encodedAction": {
|
||||
"type": "string"
|
||||
},
|
||||
"sequenceNumber": {
|
||||
"type": "number"
|
||||
},
|
||||
"integrity": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"enum": [
|
||||
"appLogic",
|
||||
"child",
|
||||
"parent"
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
"userId": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"encodedAction",
|
||||
"integrity",
|
||||
"sequenceNumber",
|
||||
"type",
|
||||
"userId"
|
||||
]
|
||||
"$ref": "#/definitions/ClientPushChangesRequestAction"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -46,6 +16,42 @@
|
||||
"actions",
|
||||
"deviceAuthToken"
|
||||
],
|
||||
"definitions": {
|
||||
"ClientPushChangesRequestAction": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"encodedAction": {
|
||||
"type": "string"
|
||||
},
|
||||
"sequenceNumber": {
|
||||
"type": "number"
|
||||
},
|
||||
"integrity": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"enum": [
|
||||
"appLogic",
|
||||
"child",
|
||||
"parent"
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
"userId": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"encodedAction",
|
||||
"integrity",
|
||||
"sequenceNumber",
|
||||
"type",
|
||||
"userId"
|
||||
],
|
||||
"title": "ClientPushChangesRequestAction"
|
||||
}
|
||||
},
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"title": "ClientPushChangesRequest",
|
||||
"$id": "https://timelimit.io/ClientPushChangesRequest"
|
||||
|
||||
+58
-55
@@ -33,28 +33,30 @@
|
||||
- [CategoryDataStatus](./clientpullchangesrequest-definitions-categorydatastatus.md) – `https://timelimit.io/ClientPullChangesRequest#/definitions/CategoryDataStatus`
|
||||
- [ClientDataStatus](./clientpullchangesrequest-properties-clientdatastatus.md) – `https://timelimit.io/ClientPullChangesRequest#/properties/status`
|
||||
- [ClientDataStatus](./clientpullchangesrequest-definitions-clientdatastatus.md) – `https://timelimit.io/ClientPullChangesRequest#/definitions/ClientDataStatus`
|
||||
- [NewDeviceInfo](./registerchilddevicerequest-definitions-newdeviceinfo.md) – `https://timelimit.io/RegisterChildDeviceRequest#/definitions/NewDeviceInfo`
|
||||
- [NewDeviceInfo](./registerchilddevicerequest-properties-newdeviceinfo.md) – `https://timelimit.io/RegisterChildDeviceRequest#/properties/childDevice`
|
||||
- [ClientPushChangesRequestAction](./clientpushchangesrequest-properties-actions-clientpushchangesrequestaction.md) – `https://timelimit.io/ClientPushChangesRequest#/properties/actions/items`
|
||||
- [ClientPushChangesRequestAction](./clientpushchangesrequest-definitions-clientpushchangesrequestaction.md) – `https://timelimit.io/ClientPushChangesRequest#/definitions/ClientPushChangesRequestAction`
|
||||
- [NewDeviceInfo](./signintofamilyrequest-definitions-newdeviceinfo.md) – `https://timelimit.io/SignIntoFamilyRequest#/definitions/NewDeviceInfo`
|
||||
- [NewDeviceInfo](./signintofamilyrequest-properties-newdeviceinfo.md) – `https://timelimit.io/SignIntoFamilyRequest#/properties/parentDevice`
|
||||
- [NewDeviceInfo](./registerchilddevicerequest-definitions-newdeviceinfo.md) – `https://timelimit.io/RegisterChildDeviceRequest#/definitions/NewDeviceInfo`
|
||||
- [NewDeviceInfo](./registerchilddevicerequest-properties-newdeviceinfo.md) – `https://timelimit.io/RegisterChildDeviceRequest#/properties/childDevice`
|
||||
- [NewDeviceInfo](./createfamilybymailtokenrequest-definitions-newdeviceinfo.md) – `https://timelimit.io/CreateFamilyByMailTokenRequest#/definitions/NewDeviceInfo`
|
||||
- [NewDeviceInfo](./createfamilybymailtokenrequest-properties-newdeviceinfo.md) – `https://timelimit.io/CreateFamilyByMailTokenRequest#/properties/parentDevice`
|
||||
- [ParentPassword](./serializedparentaction-definitions-serializedadduseraction-properties-parentpassword.md) – `https://timelimit.io/SerializedParentAction#/definitions/SerializedAddUserAction/properties/password`
|
||||
- [ParentPassword](./createfamilybymailtokenrequest-properties-parentpassword.md) – `https://timelimit.io/CreateFamilyByMailTokenRequest#/properties/parentPassword`
|
||||
- [ParentPassword](./recoverparentpasswordrequest-definitions-parentpassword.md) – `https://timelimit.io/RecoverParentPasswordRequest#/definitions/ParentPassword`
|
||||
- [ParentPassword](./createfamilybymailtokenrequest-definitions-parentpassword.md) – `https://timelimit.io/CreateFamilyByMailTokenRequest#/definitions/ParentPassword`
|
||||
- [ParentPassword](./serializedchildaction-definitions-serializedchildchangepasswordaction-properties-parentpassword.md) – `https://timelimit.io/SerializedChildAction#/definitions/SerializedChildChangePasswordAction/properties/password`
|
||||
- [ParentPassword](./serializedparentaction-definitions-serializedsetchildpasswordaction-properties-parentpassword.md) – `https://timelimit.io/SerializedParentAction#/definitions/SerializedSetChildPasswordAction/properties/newPassword`
|
||||
- [ParentPassword](./serializedchildaction-definitions-serializedchildchangepasswordaction-properties-parentpassword.md) – `https://timelimit.io/SerializedChildAction#/definitions/SerializedChildChangePasswordAction/properties/password`
|
||||
- [ParentPassword](./serializedparentaction-definitions-parentpassword.md) – `https://timelimit.io/SerializedParentAction#/definitions/ParentPassword`
|
||||
- [ParentPassword](./recoverparentpasswordrequest-properties-parentpassword.md) – `https://timelimit.io/RecoverParentPasswordRequest#/properties/password`
|
||||
- [ParentPassword](./createfamilybymailtokenrequest-definitions-parentpassword.md) – `https://timelimit.io/CreateFamilyByMailTokenRequest#/definitions/ParentPassword`
|
||||
- [ParentPassword](./serializedchildaction-definitions-serializedchildchangepasswordaction-properties-parentpassword.md) – `https://timelimit.io/SerializedChildAction#/definitions/SerializedChildChangePasswordAction/properties/password`
|
||||
- [ParentPassword](./recoverparentpasswordrequest-definitions-parentpassword.md) – `https://timelimit.io/RecoverParentPasswordRequest#/definitions/ParentPassword`
|
||||
- [ParentPassword](./createfamilybymailtokenrequest-properties-parentpassword.md) – `https://timelimit.io/CreateFamilyByMailTokenRequest#/properties/parentPassword`
|
||||
- [ParentPassword](./serializedchildaction-definitions-parentpassword.md) – `https://timelimit.io/SerializedChildAction#/definitions/ParentPassword`
|
||||
- [ParentPassword](./recoverparentpasswordrequest-properties-parentpassword.md) – `https://timelimit.io/RecoverParentPasswordRequest#/properties/password`
|
||||
- [ParentPassword](./serializedparentaction-definitions-serializedsetchildpasswordaction-properties-parentpassword.md) – `https://timelimit.io/SerializedParentAction#/definitions/SerializedSetChildPasswordAction/properties/newPassword`
|
||||
- [ParentPassword](./serializedparentaction-definitions-serializedadduseraction-properties-parentpassword.md) – `https://timelimit.io/SerializedParentAction#/definitions/SerializedAddUserAction/properties/password`
|
||||
- [SerialiezdTriedDisablingDeviceAdminAction](./serializedapplogicaction-anyof-serialiezdtrieddisablingdeviceadminaction.md) – `https://timelimit.io/SerializedAppLogicAction#/anyOf/6`
|
||||
- [SerialiezdTriedDisablingDeviceAdminAction](./serializedapplogicaction-definitions-serialiezdtrieddisablingdeviceadminaction.md) – `https://timelimit.io/SerializedAppLogicAction#/definitions/SerialiezdTriedDisablingDeviceAdminAction`
|
||||
- [SerialiezdTriedDisablingDeviceAdminAction](./serializedapplogicaction-anyof-serialiezdtrieddisablingdeviceadminaction.md) – `https://timelimit.io/SerializedAppLogicAction#/anyOf/6`
|
||||
- [SerialiizedUpdateNetworkTimeVerificationAction](./serializedparentaction-definitions-serialiizedupdatenetworktimeverificationaction.md) – `https://timelimit.io/SerializedParentAction#/definitions/SerialiizedUpdateNetworkTimeVerificationAction`
|
||||
- [SerialiizedUpdateNetworkTimeVerificationAction](./serializedparentaction-anyof-serialiizedupdatenetworktimeverificationaction.md) – `https://timelimit.io/SerializedParentAction#/anyOf/37`
|
||||
- [SerialiizedUpdateNetworkTimeVerificationAction](./serializedparentaction-anyof-serialiizedupdatenetworktimeverificationaction.md) – `https://timelimit.io/SerializedParentAction#/anyOf/38`
|
||||
- [SerializeResetCategoryNetworkIdsAction](./serializedparentaction-anyof-serializeresetcategorynetworkidsaction.md) – `https://timelimit.io/SerializedParentAction#/anyOf/13`
|
||||
- [SerializeResetCategoryNetworkIdsAction](./serializedparentaction-definitions-serializeresetcategorynetworkidsaction.md) – `https://timelimit.io/SerializedParentAction#/definitions/SerializeResetCategoryNetworkIdsAction`
|
||||
- [SerializedAddCategoryAppsAction](./serializedparentaction-anyof-serializedaddcategoryappsaction.md) – `https://timelimit.io/SerializedParentAction#/anyOf/0`
|
||||
@@ -63,18 +65,18 @@
|
||||
- [SerializedAddCategoryNetworkIdAction](./serializedparentaction-definitions-serializedaddcategorynetworkidaction.md) – `https://timelimit.io/SerializedParentAction#/definitions/SerializedAddCategoryNetworkIdAction`
|
||||
- [SerializedAddInstalledAppsAction](./serializedapplogicaction-definitions-serializedaddinstalledappsaction.md) – `https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedAddInstalledAppsAction`
|
||||
- [SerializedAddInstalledAppsAction](./serializedapplogicaction-anyof-serializedaddinstalledappsaction.md) – `https://timelimit.io/SerializedAppLogicAction#/anyOf/0`
|
||||
- [SerializedAddUsedTimeAction](./serializedapplogicaction-definitions-serializedaddusedtimeaction.md) – `https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedAddUsedTimeAction`
|
||||
- [SerializedAddUsedTimeAction](./serializedapplogicaction-anyof-serializedaddusedtimeaction.md) – `https://timelimit.io/SerializedAppLogicAction#/anyOf/1`
|
||||
- [SerializedAddUsedTimeActionVersion2](./serializedapplogicaction-definitions-serializedaddusedtimeactionversion2.md) – `https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedAddUsedTimeActionVersion2`
|
||||
- [SerializedAddUsedTimeAction](./serializedapplogicaction-definitions-serializedaddusedtimeaction.md) – `https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedAddUsedTimeAction`
|
||||
- [SerializedAddUsedTimeActionVersion2](./serializedapplogicaction-anyof-serializedaddusedtimeactionversion2.md) – `https://timelimit.io/SerializedAppLogicAction#/anyOf/2`
|
||||
- [SerializedAddUserAction](./serializedparentaction-definitions-serializedadduseraction.md) – `https://timelimit.io/SerializedParentAction#/definitions/SerializedAddUserAction`
|
||||
- [SerializedAddUsedTimeActionVersion2](./serializedapplogicaction-definitions-serializedaddusedtimeactionversion2.md) – `https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedAddUsedTimeActionVersion2`
|
||||
- [SerializedAddUserAction](./serializedparentaction-anyof-serializedadduseraction.md) – `https://timelimit.io/SerializedParentAction#/anyOf/2`
|
||||
- [SerializedAppActivityItem](./serverdatastatus-definitions-serverinstalledappsdata-properties-activities-serializedappactivityitem.md) – `https://timelimit.io/ServerDataStatus#/definitions/ServerInstalledAppsData/properties/activities/items`
|
||||
- [SerializedAppActivityItem](./serializedapplogicaction-definitions-serializedappactivityitem.md) – `https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedAppActivityItem`
|
||||
- [SerializedAppActivityItem](./serializedapplogicaction-definitions-serializedupdateappactivitiesaction-properties-updatedoradded-serializedappactivityitem.md) – `https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedUpdateAppActivitiesAction/properties/updatedOrAdded/items`
|
||||
- [SerializedAddUserAction](./serializedparentaction-definitions-serializedadduseraction.md) – `https://timelimit.io/SerializedParentAction#/definitions/SerializedAddUserAction`
|
||||
- [SerializedAppActivityItem](./serverdatastatus-definitions-serverinstalledappsdata-properties-activities-serializedappactivityitem.md) – `https://timelimit.io/ServerDataStatus#/definitions/ServerInstalledAppsData/properties/activities/items`
|
||||
- [SerializedAppActivityItem](./serverdatastatus-definitions-serializedappactivityitem.md) – `https://timelimit.io/ServerDataStatus#/definitions/SerializedAppActivityItem`
|
||||
- [SerializedAppActivityItem](./serializedapplogicaction-definitions-serializedupdateappactivitiesaction-properties-updatedoradded-serializedappactivityitem.md) – `https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedUpdateAppActivitiesAction/properties/updatedOrAdded/items`
|
||||
- [SerializedAppActivityItem](./serializedapplogicaction-definitions-serializedappactivityitem.md) – `https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedAppActivityItem`
|
||||
- [SerializedAppActivityItem](./serializedapplogicaction-definitions-serializedupdateappactivitiesaction-properties-updatedoradded-serializedappactivityitem.md) – `https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedUpdateAppActivitiesAction/properties/updatedOrAdded/items`
|
||||
- [SerializedAppActivityItem](./serverdatastatus-definitions-serverinstalledappsdata-properties-activities-serializedappactivityitem.md) – `https://timelimit.io/ServerDataStatus#/definitions/ServerInstalledAppsData/properties/activities/items`
|
||||
- [SerializedChangeParentPasswordAction](./serializedparentaction-definitions-serializedchangeparentpasswordaction.md) – `https://timelimit.io/SerializedParentAction#/definitions/SerializedChangeParentPasswordAction`
|
||||
- [SerializedChangeParentPasswordAction](./serializedparentaction-anyof-serializedchangeparentpasswordaction.md) – `https://timelimit.io/SerializedParentAction#/anyOf/3`
|
||||
- [SerializedChildChangePasswordAction](./serializedchildaction-definitions-serializedchildchangepasswordaction.md) – `https://timelimit.io/SerializedChildAction#/definitions/SerializedChildChangePasswordAction`
|
||||
@@ -83,54 +85,54 @@
|
||||
- [SerializedChildSignInAction](./serializedchildaction-anyof-serializedchildsigninaction.md) – `https://timelimit.io/SerializedChildAction#/anyOf/1`
|
||||
- [SerializedCreateCategoryAction](./serializedparentaction-definitions-serializedcreatecategoryaction.md) – `https://timelimit.io/SerializedParentAction#/definitions/SerializedCreateCategoryAction`
|
||||
- [SerializedCreateCategoryAction](./serializedparentaction-anyof-serializedcreatecategoryaction.md) – `https://timelimit.io/SerializedParentAction#/anyOf/4`
|
||||
- [SerializedCreateTimelimtRuleAction](./serializedparentaction-definitions-serializedcreatetimelimtruleaction.md) – `https://timelimit.io/SerializedParentAction#/definitions/SerializedCreateTimelimtRuleAction`
|
||||
- [SerializedCreateTimelimtRuleAction](./serializedparentaction-anyof-serializedcreatetimelimtruleaction.md) – `https://timelimit.io/SerializedParentAction#/anyOf/5`
|
||||
- [SerializedDeleteCategoryAction](./serializedparentaction-definitions-serializeddeletecategoryaction.md) – `https://timelimit.io/SerializedParentAction#/definitions/SerializedDeleteCategoryAction`
|
||||
- [SerializedCreateTimelimtRuleAction](./serializedparentaction-definitions-serializedcreatetimelimtruleaction.md) – `https://timelimit.io/SerializedParentAction#/definitions/SerializedCreateTimelimtRuleAction`
|
||||
- [SerializedDeleteCategoryAction](./serializedparentaction-anyof-serializeddeletecategoryaction.md) – `https://timelimit.io/SerializedParentAction#/anyOf/6`
|
||||
- [SerializedDeleteCategoryAction](./serializedparentaction-definitions-serializeddeletecategoryaction.md) – `https://timelimit.io/SerializedParentAction#/definitions/SerializedDeleteCategoryAction`
|
||||
- [SerializedDeleteTimeLimitRuleAction](./serializedparentaction-anyof-serializeddeletetimelimitruleaction.md) – `https://timelimit.io/SerializedParentAction#/anyOf/7`
|
||||
- [SerializedDeleteTimeLimitRuleAction](./serializedparentaction-definitions-serializeddeletetimelimitruleaction.md) – `https://timelimit.io/SerializedParentAction#/definitions/SerializedDeleteTimeLimitRuleAction`
|
||||
- [SerializedForceSyncAction](./serializedapplogicaction-definitions-serializedforcesyncaction.md) – `https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedForceSyncAction`
|
||||
- [SerializedForceSyncAction](./serializedapplogicaction-anyof-serializedforcesyncaction.md) – `https://timelimit.io/SerializedAppLogicAction#/anyOf/3`
|
||||
- [SerializedIgnoreManipulationAction](./serializedparentaction-anyof-serializedignoremanipulationaction.md) – `https://timelimit.io/SerializedParentAction#/anyOf/8`
|
||||
- [SerializedIgnoreManipulationAction](./serializedparentaction-definitions-serializedignoremanipulationaction.md) – `https://timelimit.io/SerializedParentAction#/definitions/SerializedIgnoreManipulationAction`
|
||||
- [SerializedIncrementCategoryExtraTimeAction](./serializedparentaction-anyof-serializedincrementcategoryextratimeaction.md) – `https://timelimit.io/SerializedParentAction#/anyOf/9`
|
||||
- [SerializedIgnoreManipulationAction](./serializedparentaction-anyof-serializedignoremanipulationaction.md) – `https://timelimit.io/SerializedParentAction#/anyOf/8`
|
||||
- [SerializedIncrementCategoryExtraTimeAction](./serializedparentaction-definitions-serializedincrementcategoryextratimeaction.md) – `https://timelimit.io/SerializedParentAction#/definitions/SerializedIncrementCategoryExtraTimeAction`
|
||||
- [SerializedInstalledApp](./serializedapplogicaction-definitions-serializedaddinstalledappsaction-properties-apps-serializedinstalledapp.md) – `https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedAddInstalledAppsAction/properties/apps/items`
|
||||
- [SerializedInstalledApp](./serverdatastatus-definitions-serverinstalledappsdata-properties-apps-serializedinstalledapp.md) – `https://timelimit.io/ServerDataStatus#/definitions/ServerInstalledAppsData/properties/apps/items`
|
||||
- [SerializedInstalledApp](./serializedapplogicaction-definitions-serializedinstalledapp.md) – `https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedInstalledApp`
|
||||
- [SerializedInstalledApp](./serializedapplogicaction-definitions-serializedaddinstalledappsaction-properties-apps-serializedinstalledapp.md) – `https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedAddInstalledAppsAction/properties/apps/items`
|
||||
- [SerializedInstalledApp](./serverdatastatus-definitions-serverinstalledappsdata-properties-apps-serializedinstalledapp.md) – `https://timelimit.io/ServerDataStatus#/definitions/ServerInstalledAppsData/properties/apps/items`
|
||||
- [SerializedIncrementCategoryExtraTimeAction](./serializedparentaction-anyof-serializedincrementcategoryextratimeaction.md) – `https://timelimit.io/SerializedParentAction#/anyOf/9`
|
||||
- [SerializedInstalledApp](./serverdatastatus-definitions-serializedinstalledapp.md) – `https://timelimit.io/ServerDataStatus#/definitions/SerializedInstalledApp`
|
||||
- [SerializedRemoveCategoryAppsAction](./serializedparentaction-definitions-serializedremovecategoryappsaction.md) – `https://timelimit.io/SerializedParentAction#/definitions/SerializedRemoveCategoryAppsAction`
|
||||
- [SerializedInstalledApp](./serverdatastatus-definitions-serverinstalledappsdata-properties-apps-serializedinstalledapp.md) – `https://timelimit.io/ServerDataStatus#/definitions/ServerInstalledAppsData/properties/apps/items`
|
||||
- [SerializedInstalledApp](./serializedapplogicaction-definitions-serializedaddinstalledappsaction-properties-apps-serializedinstalledapp.md) – `https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedAddInstalledAppsAction/properties/apps/items`
|
||||
- [SerializedInstalledApp](./serializedapplogicaction-definitions-serializedinstalledapp.md) – `https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedInstalledApp`
|
||||
- [SerializedInstalledApp](./serverdatastatus-definitions-serverinstalledappsdata-properties-apps-serializedinstalledapp.md) – `https://timelimit.io/ServerDataStatus#/definitions/ServerInstalledAppsData/properties/apps/items`
|
||||
- [SerializedInstalledApp](./serializedapplogicaction-definitions-serializedaddinstalledappsaction-properties-apps-serializedinstalledapp.md) – `https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedAddInstalledAppsAction/properties/apps/items`
|
||||
- [SerializedRemoveCategoryAppsAction](./serializedparentaction-anyof-serializedremovecategoryappsaction.md) – `https://timelimit.io/SerializedParentAction#/anyOf/10`
|
||||
- [SerializedRemoveCategoryAppsAction](./serializedparentaction-definitions-serializedremovecategoryappsaction.md) – `https://timelimit.io/SerializedParentAction#/definitions/SerializedRemoveCategoryAppsAction`
|
||||
- [SerializedRemoveInstalledAppsAction](./serializedapplogicaction-definitions-serializedremoveinstalledappsaction.md) – `https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedRemoveInstalledAppsAction`
|
||||
- [SerializedRemoveInstalledAppsAction](./serializedapplogicaction-anyof-serializedremoveinstalledappsaction.md) – `https://timelimit.io/SerializedAppLogicAction#/anyOf/4`
|
||||
- [SerializedRemoveUserAction](./serializedparentaction-definitions-serializedremoveuseraction.md) – `https://timelimit.io/SerializedParentAction#/definitions/SerializedRemoveUserAction`
|
||||
- [SerializedRemoveUserAction](./serializedparentaction-anyof-serializedremoveuseraction.md) – `https://timelimit.io/SerializedParentAction#/anyOf/11`
|
||||
- [SerializedRemoveUserAction](./serializedparentaction-definitions-serializedremoveuseraction.md) – `https://timelimit.io/SerializedParentAction#/definitions/SerializedRemoveUserAction`
|
||||
- [SerializedRenameChildAction](./serializedparentaction-definitions-serializedrenamechildaction.md) – `https://timelimit.io/SerializedParentAction#/definitions/SerializedRenameChildAction`
|
||||
- [SerializedRenameChildAction](./serializedparentaction-anyof-serializedrenamechildaction.md) – `https://timelimit.io/SerializedParentAction#/anyOf/12`
|
||||
- [SerializedResetParentBlockedTimesAction](./serializedparentaction-anyof-serializedresetparentblockedtimesaction.md) – `https://timelimit.io/SerializedParentAction#/anyOf/14`
|
||||
- [SerializedResetParentBlockedTimesAction](./serializedparentaction-definitions-serializedresetparentblockedtimesaction.md) – `https://timelimit.io/SerializedParentAction#/definitions/SerializedResetParentBlockedTimesAction`
|
||||
- [SerializedSetCategoryExtraTimeAction](./serializedparentaction-anyof-serializedsetcategoryextratimeaction.md) – `https://timelimit.io/SerializedParentAction#/anyOf/15`
|
||||
- [SerializedSetCategoryExtraTimeAction](./serializedparentaction-definitions-serializedsetcategoryextratimeaction.md) – `https://timelimit.io/SerializedParentAction#/definitions/SerializedSetCategoryExtraTimeAction`
|
||||
- [SerializedSetCategoryForUnassignedAppsAction](./serializedparentaction-anyof-serializedsetcategoryforunassignedappsaction.md) – `https://timelimit.io/SerializedParentAction#/anyOf/16`
|
||||
- [SerializedSetCategoryExtraTimeAction](./serializedparentaction-anyof-serializedsetcategoryextratimeaction.md) – `https://timelimit.io/SerializedParentAction#/anyOf/15`
|
||||
- [SerializedSetCategoryForUnassignedAppsAction](./serializedparentaction-definitions-serializedsetcategoryforunassignedappsaction.md) – `https://timelimit.io/SerializedParentAction#/definitions/SerializedSetCategoryForUnassignedAppsAction`
|
||||
- [SerializedSetCategoryForUnassignedAppsAction](./serializedparentaction-anyof-serializedsetcategoryforunassignedappsaction.md) – `https://timelimit.io/SerializedParentAction#/anyOf/16`
|
||||
- [SerializedSetChildPasswordAction](./serializedparentaction-definitions-serializedsetchildpasswordaction.md) – `https://timelimit.io/SerializedParentAction#/definitions/SerializedSetChildPasswordAction`
|
||||
- [SerializedSetChildPasswordAction](./serializedparentaction-anyof-serializedsetchildpasswordaction.md) – `https://timelimit.io/SerializedParentAction#/anyOf/17`
|
||||
- [SerializedSetConsiderRebootManipulationAction](./serializedparentaction-definitions-serializedsetconsiderrebootmanipulationaction.md) – `https://timelimit.io/SerializedParentAction#/definitions/SerializedSetConsiderRebootManipulationAction`
|
||||
- [SerializedSetConsiderRebootManipulationAction](./serializedparentaction-anyof-serializedsetconsiderrebootmanipulationaction.md) – `https://timelimit.io/SerializedParentAction#/anyOf/18`
|
||||
- [SerializedSetDeviceDefaultUserAction](./serializedparentaction-definitions-serializedsetdevicedefaultuseraction.md) – `https://timelimit.io/SerializedParentAction#/definitions/SerializedSetDeviceDefaultUserAction`
|
||||
- [SerializedSetDeviceDefaultUserAction](./serializedparentaction-anyof-serializedsetdevicedefaultuseraction.md) – `https://timelimit.io/SerializedParentAction#/anyOf/19`
|
||||
- [SerializedSetDeviceDefaultUserAction](./serializedparentaction-definitions-serializedsetdevicedefaultuseraction.md) – `https://timelimit.io/SerializedParentAction#/definitions/SerializedSetDeviceDefaultUserAction`
|
||||
- [SerializedSetDeviceDefaultUserTimeoutAction](./serializedparentaction-definitions-serializedsetdevicedefaultusertimeoutaction.md) – `https://timelimit.io/SerializedParentAction#/definitions/SerializedSetDeviceDefaultUserTimeoutAction`
|
||||
- [SerializedSetDeviceDefaultUserTimeoutAction](./serializedparentaction-anyof-serializedsetdevicedefaultusertimeoutaction.md) – `https://timelimit.io/SerializedParentAction#/anyOf/20`
|
||||
- [SerializedSetDeviceUserAction](./serializedparentaction-anyof-serializedsetdeviceuseraction.md) – `https://timelimit.io/SerializedParentAction#/anyOf/21`
|
||||
- [SerializedSetDeviceUserAction](./serializedparentaction-definitions-serializedsetdeviceuseraction.md) – `https://timelimit.io/SerializedParentAction#/definitions/SerializedSetDeviceUserAction`
|
||||
- [SerializedSetDeviceUserAction](./serializedparentaction-anyof-serializedsetdeviceuseraction.md) – `https://timelimit.io/SerializedParentAction#/anyOf/21`
|
||||
- [SerializedSetKeepSignedInAction](./serializedparentaction-definitions-serializedsetkeepsignedinaction.md) – `https://timelimit.io/SerializedParentAction#/definitions/SerializedSetKeepSignedInAction`
|
||||
- [SerializedSetKeepSignedInAction](./serializedparentaction-anyof-serializedsetkeepsignedinaction.md) – `https://timelimit.io/SerializedParentAction#/anyOf/22`
|
||||
- [SerializedSetParentCategoryAction](./serializedparentaction-anyof-serializedsetparentcategoryaction.md) – `https://timelimit.io/SerializedParentAction#/anyOf/23`
|
||||
- [SerializedSetParentCategoryAction](./serializedparentaction-definitions-serializedsetparentcategoryaction.md) – `https://timelimit.io/SerializedParentAction#/definitions/SerializedSetParentCategoryAction`
|
||||
- [SerializedSetRelaxPrimaryDeviceAction](./serializedparentaction-definitions-serializedsetrelaxprimarydeviceaction.md) – `https://timelimit.io/SerializedParentAction#/definitions/SerializedSetRelaxPrimaryDeviceAction`
|
||||
- [SerializedSetRelaxPrimaryDeviceAction](./serializedparentaction-anyof-serializedsetrelaxprimarydeviceaction.md) – `https://timelimit.io/SerializedParentAction#/anyOf/24`
|
||||
- [SerializedSetRelaxPrimaryDeviceAction](./serializedparentaction-definitions-serializedsetrelaxprimarydeviceaction.md) – `https://timelimit.io/SerializedParentAction#/definitions/SerializedSetRelaxPrimaryDeviceAction`
|
||||
- [SerializedSetSendDeviceConnected](./serializedparentaction-definitions-serializedsetsenddeviceconnected.md) – `https://timelimit.io/SerializedParentAction#/definitions/SerializedSetSendDeviceConnected`
|
||||
- [SerializedSetSendDeviceConnected](./serializedparentaction-anyof-serializedsetsenddeviceconnected.md) – `https://timelimit.io/SerializedParentAction#/anyOf/25`
|
||||
- [SerializedSetUserDisableLimitsUntilAction](./serializedparentaction-definitions-serializedsetuserdisablelimitsuntilaction.md) – `https://timelimit.io/SerializedParentAction#/definitions/SerializedSetUserDisableLimitsUntilAction`
|
||||
@@ -140,77 +142,78 @@
|
||||
- [SerializedSignOutAtDeviceAction](./serializedapplogicaction-definitions-serializedsignoutatdeviceaction.md) – `https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedSignOutAtDeviceAction`
|
||||
- [SerializedSignOutAtDeviceAction](./serializedapplogicaction-anyof-serializedsignoutatdeviceaction.md) – `https://timelimit.io/SerializedAppLogicAction#/anyOf/5`
|
||||
- [SerializedTimeLimitRule](./serializedparentaction-definitions-serializedcreatetimelimtruleaction-properties-serializedtimelimitrule.md) – `https://timelimit.io/SerializedParentAction#/definitions/SerializedCreateTimelimtRuleAction/properties/rule`
|
||||
- [SerializedTimeLimitRule](./serializedparentaction-definitions-serializedtimelimitrule.md) – `https://timelimit.io/SerializedParentAction#/definitions/SerializedTimeLimitRule`
|
||||
- [SerializedTimeLimitRule](./serializedparentaction-definitions-serializedcreatetimelimtruleaction-properties-serializedtimelimitrule.md) – `https://timelimit.io/SerializedParentAction#/definitions/SerializedCreateTimelimtRuleAction/properties/rule`
|
||||
- [SerializedUpdateAppActivitiesAction](./serializedapplogicaction-anyof-serializedupdateappactivitiesaction.md) – `https://timelimit.io/SerializedAppLogicAction#/anyOf/7`
|
||||
- [SerializedTimeLimitRule](./serializedparentaction-definitions-serializedtimelimitrule.md) – `https://timelimit.io/SerializedParentAction#/definitions/SerializedTimeLimitRule`
|
||||
- [SerializedUpdatCategoryDisableLimitsAction](./serializedparentaction-anyof-serializedupdatcategorydisablelimitsaction.md) – `https://timelimit.io/SerializedParentAction#/anyOf/31`
|
||||
- [SerializedUpdatCategoryDisableLimitsAction](./serializedparentaction-definitions-serializedupdatcategorydisablelimitsaction.md) – `https://timelimit.io/SerializedParentAction#/definitions/SerializedUpdatCategoryDisableLimitsAction`
|
||||
- [SerializedUpdateAppActivitiesAction](./serializedapplogicaction-definitions-serializedupdateappactivitiesaction.md) – `https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedUpdateAppActivitiesAction`
|
||||
- [SerializedUpdateAppActivitiesAction](./serializedapplogicaction-anyof-serializedupdateappactivitiesaction.md) – `https://timelimit.io/SerializedAppLogicAction#/anyOf/7`
|
||||
- [SerializedUpdateCategoryBatteryLimitAction](./serializedparentaction-definitions-serializedupdatecategorybatterylimitaction.md) – `https://timelimit.io/SerializedParentAction#/definitions/SerializedUpdateCategoryBatteryLimitAction`
|
||||
- [SerializedUpdateCategoryBatteryLimitAction](./serializedparentaction-anyof-serializedupdatecategorybatterylimitaction.md) – `https://timelimit.io/SerializedParentAction#/anyOf/28`
|
||||
- [SerializedUpdateCategoryBlockAllNotificationsAction](./serializedparentaction-definitions-serializedupdatecategoryblockallnotificationsaction.md) – `https://timelimit.io/SerializedParentAction#/definitions/SerializedUpdateCategoryBlockAllNotificationsAction`
|
||||
- [SerializedUpdateCategoryBlockAllNotificationsAction](./serializedparentaction-anyof-serializedupdatecategoryblockallnotificationsaction.md) – `https://timelimit.io/SerializedParentAction#/anyOf/29`
|
||||
- [SerializedUpdateCategoryBlockedTimesAction](./serializedparentaction-definitions-serializedupdatecategoryblockedtimesaction.md) – `https://timelimit.io/SerializedParentAction#/definitions/SerializedUpdateCategoryBlockedTimesAction`
|
||||
- [SerializedUpdateCategoryBlockedTimesAction](./serializedparentaction-anyof-serializedupdatecategoryblockedtimesaction.md) – `https://timelimit.io/SerializedParentAction#/anyOf/30`
|
||||
- [SerializedUpdateCategoryBlockedTimesAction](./serializedparentaction-definitions-serializedupdatecategoryblockedtimesaction.md) – `https://timelimit.io/SerializedParentAction#/definitions/SerializedUpdateCategoryBlockedTimesAction`
|
||||
- [SerializedUpdateCategorySortingAction](./serializedparentaction-definitions-serializedupdatecategorysortingaction.md) – `https://timelimit.io/SerializedParentAction#/definitions/SerializedUpdateCategorySortingAction`
|
||||
- [SerializedUpdateCategorySortingAction](./serializedparentaction-anyof-serializedupdatecategorysortingaction.md) – `https://timelimit.io/SerializedParentAction#/anyOf/31`
|
||||
- [SerializedUpdateCategorySortingAction](./serializedparentaction-anyof-serializedupdatecategorysortingaction.md) – `https://timelimit.io/SerializedParentAction#/anyOf/32`
|
||||
- [SerializedUpdateCategoryTemporarilyBlockedAction](./serializedparentaction-definitions-serializedupdatecategorytemporarilyblockedaction.md) – `https://timelimit.io/SerializedParentAction#/definitions/SerializedUpdateCategoryTemporarilyBlockedAction`
|
||||
- [SerializedUpdateCategoryTemporarilyBlockedAction](./serializedparentaction-anyof-serializedupdatecategorytemporarilyblockedaction.md) – `https://timelimit.io/SerializedParentAction#/anyOf/32`
|
||||
- [SerializedUpdateCategoryTemporarilyBlockedAction](./serializedparentaction-anyof-serializedupdatecategorytemporarilyblockedaction.md) – `https://timelimit.io/SerializedParentAction#/anyOf/33`
|
||||
- [SerializedUpdateCategoryTimeWarningsAction](./serializedparentaction-anyof-serializedupdatecategorytimewarningsaction.md) – `https://timelimit.io/SerializedParentAction#/anyOf/34`
|
||||
- [SerializedUpdateCategoryTimeWarningsAction](./serializedparentaction-definitions-serializedupdatecategorytimewarningsaction.md) – `https://timelimit.io/SerializedParentAction#/definitions/SerializedUpdateCategoryTimeWarningsAction`
|
||||
- [SerializedUpdateCategoryTimeWarningsAction](./serializedparentaction-anyof-serializedupdatecategorytimewarningsaction.md) – `https://timelimit.io/SerializedParentAction#/anyOf/33`
|
||||
- [SerializedUpdateCategoryTitleAction](./serializedparentaction-anyof-serializedupdatecategorytitleaction.md) – `https://timelimit.io/SerializedParentAction#/anyOf/34`
|
||||
- [SerializedUpdateCategoryTitleAction](./serializedparentaction-definitions-serializedupdatecategorytitleaction.md) – `https://timelimit.io/SerializedParentAction#/definitions/SerializedUpdateCategoryTitleAction`
|
||||
- [SerializedUpdateDeviceNameAction](./serializedparentaction-anyof-serializedupdatedevicenameaction.md) – `https://timelimit.io/SerializedParentAction#/anyOf/35`
|
||||
- [SerializedUpdateCategoryTitleAction](./serializedparentaction-anyof-serializedupdatecategorytitleaction.md) – `https://timelimit.io/SerializedParentAction#/anyOf/35`
|
||||
- [SerializedUpdateDeviceNameAction](./serializedparentaction-anyof-serializedupdatedevicenameaction.md) – `https://timelimit.io/SerializedParentAction#/anyOf/36`
|
||||
- [SerializedUpdateDeviceNameAction](./serializedparentaction-definitions-serializedupdatedevicenameaction.md) – `https://timelimit.io/SerializedParentAction#/definitions/SerializedUpdateDeviceNameAction`
|
||||
- [SerializedUpdateDeviceStatusAction](./serializedapplogicaction-anyof-serializedupdatedevicestatusaction.md) – `https://timelimit.io/SerializedAppLogicAction#/anyOf/8`
|
||||
- [SerializedUpdateDeviceStatusAction](./serializedapplogicaction-definitions-serializedupdatedevicestatusaction.md) – `https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedUpdateDeviceStatusAction`
|
||||
- [SerializedUpdateDeviceStatusAction](./serializedapplogicaction-anyof-serializedupdatedevicestatusaction.md) – `https://timelimit.io/SerializedAppLogicAction#/anyOf/8`
|
||||
- [SerializedUpdateEnableActivityLevelBlockingAction](./serializedparentaction-anyof-serializedupdateenableactivitylevelblockingaction.md) – `https://timelimit.io/SerializedParentAction#/anyOf/37`
|
||||
- [SerializedUpdateEnableActivityLevelBlockingAction](./serializedparentaction-definitions-serializedupdateenableactivitylevelblockingaction.md) – `https://timelimit.io/SerializedParentAction#/definitions/SerializedUpdateEnableActivityLevelBlockingAction`
|
||||
- [SerializedUpdateEnableActivityLevelBlockingAction](./serializedparentaction-anyof-serializedupdateenableactivitylevelblockingaction.md) – `https://timelimit.io/SerializedParentAction#/anyOf/36`
|
||||
- [SerializedUpdateParentBlockedTimesAction](./serializedparentaction-anyof-serializedupdateparentblockedtimesaction.md) – `https://timelimit.io/SerializedParentAction#/anyOf/38`
|
||||
- [SerializedUpdateParentBlockedTimesAction](./serializedparentaction-definitions-serializedupdateparentblockedtimesaction.md) – `https://timelimit.io/SerializedParentAction#/definitions/SerializedUpdateParentBlockedTimesAction`
|
||||
- [SerializedUpdateParentBlockedTimesAction](./serializedparentaction-anyof-serializedupdateparentblockedtimesaction.md) – `https://timelimit.io/SerializedParentAction#/anyOf/39`
|
||||
- [SerializedUpdateParentNotificationFlagsAction](./serializedparentaction-anyof-serializedupdateparentnotificationflagsaction.md) – `https://timelimit.io/SerializedParentAction#/anyOf/40`
|
||||
- [SerializedUpdateParentNotificationFlagsAction](./serializedparentaction-definitions-serializedupdateparentnotificationflagsaction.md) – `https://timelimit.io/SerializedParentAction#/definitions/SerializedUpdateParentNotificationFlagsAction`
|
||||
- [SerializedUpdateParentNotificationFlagsAction](./serializedparentaction-anyof-serializedupdateparentnotificationflagsaction.md) – `https://timelimit.io/SerializedParentAction#/anyOf/39`
|
||||
- [SerializedUpdateTimelimitRuleAction](./serializedparentaction-definitions-serializedupdatetimelimitruleaction.md) – `https://timelimit.io/SerializedParentAction#/definitions/SerializedUpdateTimelimitRuleAction`
|
||||
- [SerializedUpdateTimelimitRuleAction](./serializedparentaction-anyof-serializedupdatetimelimitruleaction.md) – `https://timelimit.io/SerializedParentAction#/anyOf/40`
|
||||
- [SerializedUpdateTimelimitRuleAction](./serializedparentaction-anyof-serializedupdatetimelimitruleaction.md) – `https://timelimit.io/SerializedParentAction#/anyOf/41`
|
||||
- [SerializedUpdateUserFlagsAction](./serializedparentaction-anyof-serializedupdateuserflagsaction.md) – `https://timelimit.io/SerializedParentAction#/anyOf/42`
|
||||
- [SerializedUpdateUserFlagsAction](./serializedparentaction-definitions-serializedupdateuserflagsaction.md) – `https://timelimit.io/SerializedParentAction#/definitions/SerializedUpdateUserFlagsAction`
|
||||
- [SerializedUpdateUserFlagsAction](./serializedparentaction-anyof-serializedupdateuserflagsaction.md) – `https://timelimit.io/SerializedParentAction#/anyOf/41`
|
||||
- [SerializedUpdateUserLimitLoginCategory](./serializedparentaction-anyof-serializedupdateuserlimitlogincategory.md) – `https://timelimit.io/SerializedParentAction#/anyOf/42`
|
||||
- [SerializedUpdateUserLimitLoginCategory](./serializedparentaction-definitions-serializedupdateuserlimitlogincategory.md) – `https://timelimit.io/SerializedParentAction#/definitions/SerializedUpdateUserLimitLoginCategory`
|
||||
- [SerializedUpdateUserLimitLoginCategory](./serializedparentaction-anyof-serializedupdateuserlimitlogincategory.md) – `https://timelimit.io/SerializedParentAction#/anyOf/43`
|
||||
- [ServerCategoryNetworkId](./serverdatastatus-definitions-serverupdatedcategorybasedata-properties-networks-servercategorynetworkid.md) – `https://timelimit.io/ServerDataStatus#/definitions/ServerUpdatedCategoryBaseData/properties/networks/items`
|
||||
- [ServerCategoryNetworkId](./serverdatastatus-definitions-serverupdatedcategorybasedata-properties-networks-servercategorynetworkid.md) – `https://timelimit.io/ServerDataStatus#/definitions/ServerUpdatedCategoryBaseData/properties/networks/items`
|
||||
- [ServerCategoryNetworkId](./serverdatastatus-definitions-servercategorynetworkid.md) – `https://timelimit.io/ServerDataStatus#/definitions/ServerCategoryNetworkId`
|
||||
- [ServerCategoryNetworkId](./serverdatastatus-definitions-serverupdatedcategorybasedata-properties-networks-servercategorynetworkid.md) – `https://timelimit.io/ServerDataStatus#/definitions/ServerUpdatedCategoryBaseData/properties/networks/items`
|
||||
- [ServerCategoryNetworkId](./serverdatastatus-definitions-serverupdatedcategorybasedata-properties-networks-servercategorynetworkid.md) – `https://timelimit.io/ServerDataStatus#/definitions/ServerUpdatedCategoryBaseData/properties/networks/items`
|
||||
- [ServerDeviceData](./serverdatastatus-definitions-serverdevicelist-properties-data-serverdevicedata.md) – `https://timelimit.io/ServerDataStatus#/definitions/ServerDeviceList/properties/data/items`
|
||||
- [ServerDeviceData](./serverdatastatus-definitions-serverdevicedata.md) – `https://timelimit.io/ServerDataStatus#/definitions/ServerDeviceData`
|
||||
- [ServerDeviceData](./serverdatastatus-definitions-serverdevicelist-properties-data-serverdevicedata.md) – `https://timelimit.io/ServerDataStatus#/definitions/ServerDeviceList/properties/data/items`
|
||||
- [ServerDeviceList](./serverdatastatus-properties-serverdevicelist.md) – `https://timelimit.io/ServerDataStatus#/properties/devices`
|
||||
- [ServerDeviceList](./serverdatastatus-definitions-serverdevicelist.md) – `https://timelimit.io/ServerDataStatus#/definitions/ServerDeviceList`
|
||||
- [ServerInstalledAppsData](./serverdatastatus-properties-apps-serverinstalledappsdata.md) – `https://timelimit.io/ServerDataStatus#/properties/apps/items`
|
||||
- [ServerInstalledAppsData](./serverdatastatus-definitions-serverinstalledappsdata.md) – `https://timelimit.io/ServerDataStatus#/definitions/ServerInstalledAppsData`
|
||||
- [ServerInstalledAppsData](./serverdatastatus-properties-apps-serverinstalledappsdata.md) – `https://timelimit.io/ServerDataStatus#/properties/apps/items`
|
||||
- [ServerSessionDurationItem](./serverdatastatus-definitions-serverupdatedcategoryusedtimes-properties-sessiondurations-serversessiondurationitem.md) – `https://timelimit.io/ServerDataStatus#/definitions/ServerUpdatedCategoryUsedTimes/properties/sessionDurations/items`
|
||||
- [ServerSessionDurationItem](./serverdatastatus-definitions-serversessiondurationitem.md) – `https://timelimit.io/ServerDataStatus#/definitions/ServerSessionDurationItem`
|
||||
- [ServerSessionDurationItem](./serverdatastatus-definitions-serverupdatedcategoryusedtimes-properties-sessiondurations-serversessiondurationitem.md) – `https://timelimit.io/ServerDataStatus#/definitions/ServerUpdatedCategoryUsedTimes/properties/sessionDurations/items`
|
||||
- [ServerTimeLimitRule](./serverdatastatus-definitions-servertimelimitrule.md) – `https://timelimit.io/ServerDataStatus#/definitions/ServerTimeLimitRule`
|
||||
- [ServerTimeLimitRule](./serverdatastatus-definitions-serverupdatedtimelimitrules-properties-rules-servertimelimitrule.md) – `https://timelimit.io/ServerDataStatus#/definitions/ServerUpdatedTimeLimitRules/properties/rules/items`
|
||||
- [ServerTimeLimitRule](./serverdatastatus-definitions-servertimelimitrule.md) – `https://timelimit.io/ServerDataStatus#/definitions/ServerTimeLimitRule`
|
||||
- [ServerTimeLimitRule](./serverdatastatus-definitions-serverupdatedtimelimitrules-properties-rules-servertimelimitrule.md) – `https://timelimit.io/ServerDataStatus#/definitions/ServerUpdatedTimeLimitRules/properties/rules/items`
|
||||
- [ServerUpdatedCategoryAssignedApps](./serverdatastatus-definitions-serverupdatedcategoryassignedapps.md) – `https://timelimit.io/ServerDataStatus#/definitions/ServerUpdatedCategoryAssignedApps`
|
||||
- [ServerUpdatedCategoryAssignedApps](./serverdatastatus-properties-categoryapp-serverupdatedcategoryassignedapps.md) – `https://timelimit.io/ServerDataStatus#/properties/categoryApp/items`
|
||||
- [ServerUpdatedCategoryBaseData](./serverdatastatus-properties-categorybase-serverupdatedcategorybasedata.md) – `https://timelimit.io/ServerDataStatus#/properties/categoryBase/items`
|
||||
- [ServerUpdatedCategoryBaseData](./serverdatastatus-definitions-serverupdatedcategorybasedata.md) – `https://timelimit.io/ServerDataStatus#/definitions/ServerUpdatedCategoryBaseData`
|
||||
- [ServerUpdatedCategoryUsedTimes](./serverdatastatus-definitions-serverupdatedcategoryusedtimes.md) – `https://timelimit.io/ServerDataStatus#/definitions/ServerUpdatedCategoryUsedTimes`
|
||||
- [ServerUpdatedCategoryUsedTimes](./serverdatastatus-properties-usedtimes-serverupdatedcategoryusedtimes.md) – `https://timelimit.io/ServerDataStatus#/properties/usedTimes/items`
|
||||
- [ServerUpdatedTimeLimitRules](./serverdatastatus-definitions-serverupdatedtimelimitrules.md) – `https://timelimit.io/ServerDataStatus#/definitions/ServerUpdatedTimeLimitRules`
|
||||
- [ServerUpdatedCategoryUsedTimes](./serverdatastatus-definitions-serverupdatedcategoryusedtimes.md) – `https://timelimit.io/ServerDataStatus#/definitions/ServerUpdatedCategoryUsedTimes`
|
||||
- [ServerUpdatedTimeLimitRules](./serverdatastatus-properties-rules-serverupdatedtimelimitrules.md) – `https://timelimit.io/ServerDataStatus#/properties/rules/items`
|
||||
- [ServerUpdatedTimeLimitRules](./serverdatastatus-definitions-serverupdatedtimelimitrules.md) – `https://timelimit.io/ServerDataStatus#/definitions/ServerUpdatedTimeLimitRules`
|
||||
- [ServerUsedTimeItem](./serverdatastatus-definitions-serverusedtimeitem.md) – `https://timelimit.io/ServerDataStatus#/definitions/ServerUsedTimeItem`
|
||||
- [ServerUsedTimeItem](./serverdatastatus-definitions-serverupdatedcategoryusedtimes-properties-times-serverusedtimeitem.md) – `https://timelimit.io/ServerDataStatus#/definitions/ServerUpdatedCategoryUsedTimes/properties/times/items`
|
||||
- [ServerUsedTimeItem](./serverdatastatus-definitions-serverupdatedcategoryusedtimes-properties-times-serverusedtimeitem.md) – `https://timelimit.io/ServerDataStatus#/definitions/ServerUpdatedCategoryUsedTimes/properties/times/items`
|
||||
- [ServerUserEntry](./serverdatastatus-definitions-serveruserentry.md) – `https://timelimit.io/ServerDataStatus#/definitions/ServerUserEntry`
|
||||
- [ServerUserEntry](./serverdatastatus-definitions-serveruserlist-properties-data-serveruserentry.md) – `https://timelimit.io/ServerDataStatus#/definitions/ServerUserList/properties/data/items`
|
||||
- [ServerUserEntry](./serverdatastatus-definitions-serveruserentry.md) – `https://timelimit.io/ServerDataStatus#/definitions/ServerUserEntry`
|
||||
- [ServerUserEntry](./serverdatastatus-definitions-serveruserlist-properties-data-serveruserentry.md) – `https://timelimit.io/ServerDataStatus#/definitions/ServerUserList/properties/data/items`
|
||||
- [ServerUserList](./serverdatastatus-properties-serveruserlist.md) – `https://timelimit.io/ServerDataStatus#/properties/users`
|
||||
- [ServerUserList](./serverdatastatus-definitions-serveruserlist.md) – `https://timelimit.io/ServerDataStatus#/definitions/ServerUserList`
|
||||
- [Untitled object in ClientPullChangesRequest](./clientpullchangesrequest-definitions-clientdatastatus-properties-apps.md) – `https://timelimit.io/ClientPullChangesRequest#/definitions/ClientDataStatus/properties/apps`
|
||||
- [Untitled object in ClientPullChangesRequest](./clientpullchangesrequest-definitions-clientdatastatus-properties-categories.md) – `https://timelimit.io/ClientPullChangesRequest#/definitions/ClientDataStatus/properties/categories`
|
||||
- [Untitled object in ClientPullChangesRequest](./clientpullchangesrequest-definitions-clientdatastatus-properties-apps.md) – `https://timelimit.io/ClientPullChangesRequest#/definitions/ClientDataStatus/properties/apps`
|
||||
- [Untitled object in ClientPullChangesRequest](./clientpullchangesrequest-definitions-clientdatastatus-properties-apps.md) – `https://timelimit.io/ClientPullChangesRequest#/definitions/ClientDataStatus/properties/apps`
|
||||
- [Untitled object in ClientPullChangesRequest](./clientpullchangesrequest-definitions-clientdatastatus-properties-categories.md) – `https://timelimit.io/ClientPullChangesRequest#/definitions/ClientDataStatus/properties/categories`
|
||||
- [Untitled object in ClientPushChangesRequest](./clientpushchangesrequest-properties-actions-items.md) – `https://timelimit.io/ClientPushChangesRequest#/properties/actions/items`
|
||||
- [Untitled object in SerializedAppLogicAction](./serializedapplogicaction-definitions-serializedaddusedtimeactionversion2-properties-i-items.md) – `https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedAddUsedTimeActionVersion2/properties/i/items`
|
||||
- [Untitled object in SerializedAppLogicAction](./serializedapplogicaction-definitions-serializedaddusedtimeactionversion2-properties-i-items.md) – `https://timelimit.io/SerializedAppLogicAction#/definitions/SerializedAddUsedTimeActionVersion2/properties/i/items`
|
||||
|
||||
|
||||
@@ -93,6 +93,9 @@
|
||||
{
|
||||
"$ref": "#/definitions/SerializedUpdateCategoryBlockedTimesAction"
|
||||
},
|
||||
{
|
||||
"$ref": "#/definitions/SerializedUpdatCategoryDisableLimitsAction"
|
||||
},
|
||||
{
|
||||
"$ref": "#/definitions/SerializedUpdateCategorySortingAction"
|
||||
},
|
||||
@@ -997,6 +1000,30 @@
|
||||
],
|
||||
"title": "SerializedUpdateCategoryBlockedTimesAction"
|
||||
},
|
||||
"SerializedUpdatCategoryDisableLimitsAction": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"UPDATE_CATEGORY_DISABLE_LIMITS"
|
||||
]
|
||||
},
|
||||
"categoryId": {
|
||||
"type": "string"
|
||||
},
|
||||
"endTime": {
|
||||
"type": "number"
|
||||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"categoryId",
|
||||
"endTime",
|
||||
"type"
|
||||
],
|
||||
"title": "SerializedUpdatCategoryDisableLimitsAction"
|
||||
},
|
||||
"SerializedUpdateCategorySortingAction": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
||||
@@ -376,6 +376,9 @@
|
||||
"items": {
|
||||
"$ref": "#/definitions/ServerCategoryNetworkId"
|
||||
}
|
||||
},
|
||||
"dlu": {
|
||||
"type": "number"
|
||||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
@@ -384,6 +387,7 @@
|
||||
"blockedTimes",
|
||||
"categoryId",
|
||||
"childId",
|
||||
"dlu",
|
||||
"extraTime",
|
||||
"extraTimeDay",
|
||||
"mblCharging",
|
||||
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
# Untitled string in ClientPushChangesRequest Schema
|
||||
|
||||
```txt
|
||||
https://timelimit.io/ClientPushChangesRequest#/definitions/ClientPushChangesRequestAction/properties/encodedAction
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
| Abstract | Extensible | Status | Identifiable | Custom Properties | Additional Properties | Access Restrictions | Defined In |
|
||||
| :------------------ | ---------- | -------------- | ----------------------- | :---------------- | --------------------- | ------------------- | ----------------------------------------------------------------------------------------------------- |
|
||||
| Can be instantiated | No | Unknown status | Unknown identifiability | Forbidden | Allowed | none | [ClientPushChangesRequest.schema.json\*](ClientPushChangesRequest.schema.json "open original schema") |
|
||||
|
||||
## encodedAction Type
|
||||
|
||||
`string`
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
# Untitled string in ClientPushChangesRequest Schema
|
||||
|
||||
```txt
|
||||
https://timelimit.io/ClientPushChangesRequest#/definitions/ClientPushChangesRequestAction/properties/integrity
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
| Abstract | Extensible | Status | Identifiable | Custom Properties | Additional Properties | Access Restrictions | Defined In |
|
||||
| :------------------ | ---------- | -------------- | ----------------------- | :---------------- | --------------------- | ------------------- | ----------------------------------------------------------------------------------------------------- |
|
||||
| Can be instantiated | No | Unknown status | Unknown identifiability | Forbidden | Allowed | none | [ClientPushChangesRequest.schema.json\*](ClientPushChangesRequest.schema.json "open original schema") |
|
||||
|
||||
## integrity Type
|
||||
|
||||
`string`
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
# Untitled number in ClientPushChangesRequest Schema
|
||||
|
||||
```txt
|
||||
https://timelimit.io/ClientPushChangesRequest#/definitions/ClientPushChangesRequestAction/properties/sequenceNumber
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
| Abstract | Extensible | Status | Identifiable | Custom Properties | Additional Properties | Access Restrictions | Defined In |
|
||||
| :------------------ | ---------- | -------------- | ----------------------- | :---------------- | --------------------- | ------------------- | ----------------------------------------------------------------------------------------------------- |
|
||||
| Can be instantiated | No | Unknown status | Unknown identifiability | Forbidden | Allowed | none | [ClientPushChangesRequest.schema.json\*](ClientPushChangesRequest.schema.json "open original schema") |
|
||||
|
||||
## sequenceNumber Type
|
||||
|
||||
`number`
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
# Untitled string in ClientPushChangesRequest Schema
|
||||
|
||||
```txt
|
||||
https://timelimit.io/ClientPushChangesRequest#/definitions/ClientPushChangesRequestAction/properties/type
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
| Abstract | Extensible | Status | Identifiable | Custom Properties | Additional Properties | Access Restrictions | Defined In |
|
||||
| :------------------ | ---------- | -------------- | ----------------------- | :---------------- | --------------------- | ------------------- | ----------------------------------------------------------------------------------------------------- |
|
||||
| Can be instantiated | No | Unknown status | Unknown identifiability | Forbidden | Allowed | none | [ClientPushChangesRequest.schema.json\*](ClientPushChangesRequest.schema.json "open original schema") |
|
||||
|
||||
## type Type
|
||||
|
||||
`string`
|
||||
|
||||
## type Constraints
|
||||
|
||||
**enum**: the value of this property must be equal to one of the following values:
|
||||
|
||||
| Value | Explanation |
|
||||
| :----------- | ----------- |
|
||||
| `"appLogic"` | |
|
||||
| `"child"` | |
|
||||
| `"parent"` | |
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
# Untitled string in ClientPushChangesRequest Schema
|
||||
|
||||
```txt
|
||||
https://timelimit.io/ClientPushChangesRequest#/definitions/ClientPushChangesRequestAction/properties/userId
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
| Abstract | Extensible | Status | Identifiable | Custom Properties | Additional Properties | Access Restrictions | Defined In |
|
||||
| :------------------ | ---------- | -------------- | ----------------------- | :---------------- | --------------------- | ------------------- | ----------------------------------------------------------------------------------------------------- |
|
||||
| Can be instantiated | No | Unknown status | Unknown identifiability | Forbidden | Allowed | none | [ClientPushChangesRequest.schema.json\*](ClientPushChangesRequest.schema.json "open original schema") |
|
||||
|
||||
## userId Type
|
||||
|
||||
`string`
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
# Untitled undefined type in ClientPushChangesRequest Schema
|
||||
|
||||
```txt
|
||||
https://timelimit.io/ClientPushChangesRequest#/definitions/ClientPushChangesRequestAction/properties
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
| Abstract | Extensible | Status | Identifiable | Custom Properties | Additional Properties | Access Restrictions | Defined In |
|
||||
| :------------------ | ---------- | -------------- | ----------------------- | :---------------- | --------------------- | ------------------- | ----------------------------------------------------------------------------------------------------- |
|
||||
| Can be instantiated | No | Unknown status | Unknown identifiability | Forbidden | Allowed | none | [ClientPushChangesRequest.schema.json\*](ClientPushChangesRequest.schema.json "open original schema") |
|
||||
|
||||
## properties Type
|
||||
|
||||
unknown
|
||||
@@ -0,0 +1,116 @@
|
||||
# ClientPushChangesRequestAction Schema
|
||||
|
||||
```txt
|
||||
https://timelimit.io/ClientPushChangesRequest#/definitions/ClientPushChangesRequestAction
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
| Abstract | Extensible | Status | Identifiable | Custom Properties | Additional Properties | Access Restrictions | Defined In |
|
||||
| :------------------ | ---------- | -------------- | ------------ | :---------------- | --------------------- | ------------------- | ----------------------------------------------------------------------------------------------------- |
|
||||
| Can be instantiated | No | Unknown status | No | Forbidden | Forbidden | none | [ClientPushChangesRequest.schema.json\*](ClientPushChangesRequest.schema.json "open original schema") |
|
||||
|
||||
## ClientPushChangesRequestAction Type
|
||||
|
||||
`object` ([ClientPushChangesRequestAction](clientpushchangesrequest-definitions-clientpushchangesrequestaction.md))
|
||||
|
||||
# ClientPushChangesRequestAction Properties
|
||||
|
||||
| Property | Type | Required | Nullable | Defined by |
|
||||
| :-------------------------------- | -------- | -------- | -------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| [encodedAction](#encodedAction) | `string` | Required | cannot be null | [ClientPushChangesRequest](clientpushchangesrequest-definitions-clientpushchangesrequestaction-properties-encodedaction.md "https://timelimit.io/ClientPushChangesRequest#/definitions/ClientPushChangesRequestAction/properties/encodedAction") |
|
||||
| [sequenceNumber](#sequenceNumber) | `number` | Required | cannot be null | [ClientPushChangesRequest](clientpushchangesrequest-definitions-clientpushchangesrequestaction-properties-sequencenumber.md "https://timelimit.io/ClientPushChangesRequest#/definitions/ClientPushChangesRequestAction/properties/sequenceNumber") |
|
||||
| [integrity](#integrity) | `string` | Required | cannot be null | [ClientPushChangesRequest](clientpushchangesrequest-definitions-clientpushchangesrequestaction-properties-integrity.md "https://timelimit.io/ClientPushChangesRequest#/definitions/ClientPushChangesRequestAction/properties/integrity") |
|
||||
| [type](#type) | `string` | Required | cannot be null | [ClientPushChangesRequest](clientpushchangesrequest-definitions-clientpushchangesrequestaction-properties-type.md "https://timelimit.io/ClientPushChangesRequest#/definitions/ClientPushChangesRequestAction/properties/type") |
|
||||
| [userId](#userId) | `string` | Required | cannot be null | [ClientPushChangesRequest](clientpushchangesrequest-definitions-clientpushchangesrequestaction-properties-userid.md "https://timelimit.io/ClientPushChangesRequest#/definitions/ClientPushChangesRequestAction/properties/userId") |
|
||||
|
||||
## encodedAction
|
||||
|
||||
|
||||
|
||||
|
||||
`encodedAction`
|
||||
|
||||
- is required
|
||||
- Type: `string`
|
||||
- cannot be null
|
||||
- defined in: [ClientPushChangesRequest](clientpushchangesrequest-definitions-clientpushchangesrequestaction-properties-encodedaction.md "https://timelimit.io/ClientPushChangesRequest#/definitions/ClientPushChangesRequestAction/properties/encodedAction")
|
||||
|
||||
### encodedAction Type
|
||||
|
||||
`string`
|
||||
|
||||
## sequenceNumber
|
||||
|
||||
|
||||
|
||||
|
||||
`sequenceNumber`
|
||||
|
||||
- is required
|
||||
- Type: `number`
|
||||
- cannot be null
|
||||
- defined in: [ClientPushChangesRequest](clientpushchangesrequest-definitions-clientpushchangesrequestaction-properties-sequencenumber.md "https://timelimit.io/ClientPushChangesRequest#/definitions/ClientPushChangesRequestAction/properties/sequenceNumber")
|
||||
|
||||
### sequenceNumber Type
|
||||
|
||||
`number`
|
||||
|
||||
## integrity
|
||||
|
||||
|
||||
|
||||
|
||||
`integrity`
|
||||
|
||||
- is required
|
||||
- Type: `string`
|
||||
- cannot be null
|
||||
- defined in: [ClientPushChangesRequest](clientpushchangesrequest-definitions-clientpushchangesrequestaction-properties-integrity.md "https://timelimit.io/ClientPushChangesRequest#/definitions/ClientPushChangesRequestAction/properties/integrity")
|
||||
|
||||
### integrity Type
|
||||
|
||||
`string`
|
||||
|
||||
## type
|
||||
|
||||
|
||||
|
||||
|
||||
`type`
|
||||
|
||||
- is required
|
||||
- Type: `string`
|
||||
- cannot be null
|
||||
- defined in: [ClientPushChangesRequest](clientpushchangesrequest-definitions-clientpushchangesrequestaction-properties-type.md "https://timelimit.io/ClientPushChangesRequest#/definitions/ClientPushChangesRequestAction/properties/type")
|
||||
|
||||
### type Type
|
||||
|
||||
`string`
|
||||
|
||||
### type Constraints
|
||||
|
||||
**enum**: the value of this property must be equal to one of the following values:
|
||||
|
||||
| Value | Explanation |
|
||||
| :----------- | ----------- |
|
||||
| `"appLogic"` | |
|
||||
| `"child"` | |
|
||||
| `"parent"` | |
|
||||
|
||||
## userId
|
||||
|
||||
|
||||
|
||||
|
||||
`userId`
|
||||
|
||||
- is required
|
||||
- Type: `string`
|
||||
- cannot be null
|
||||
- defined in: [ClientPushChangesRequest](clientpushchangesrequest-definitions-clientpushchangesrequestaction-properties-userid.md "https://timelimit.io/ClientPushChangesRequest#/definitions/ClientPushChangesRequestAction/properties/userId")
|
||||
|
||||
### userId Type
|
||||
|
||||
`string`
|
||||
@@ -0,0 +1,16 @@
|
||||
# Untitled undefined type in ClientPushChangesRequest Schema
|
||||
|
||||
```txt
|
||||
https://timelimit.io/ClientPushChangesRequest#/definitions
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
| Abstract | Extensible | Status | Identifiable | Custom Properties | Additional Properties | Access Restrictions | Defined In |
|
||||
| :------------------ | ---------- | -------------- | ----------------------- | :---------------- | --------------------- | ------------------- | ----------------------------------------------------------------------------------------------------- |
|
||||
| Can be instantiated | No | Unknown status | Unknown identifiability | Forbidden | Allowed | none | [ClientPushChangesRequest.schema.json\*](ClientPushChangesRequest.schema.json "open original schema") |
|
||||
|
||||
## definitions Type
|
||||
|
||||
unknown
|
||||
@@ -13,4 +13,4 @@ https://timelimit.io/ClientPushChangesRequest#/properties/actions
|
||||
|
||||
## actions Type
|
||||
|
||||
`object[]` ([Details](clientpushchangesrequest-properties-actions-items.md))
|
||||
`object[]` ([ClientPushChangesRequestAction](clientpushchangesrequest-definitions-clientpushchangesrequestaction.md))
|
||||
|
||||
@@ -9,12 +9,120 @@ https://timelimit.io/ClientPushChangesRequest
|
||||
|
||||
| Abstract | Extensible | Status | Identifiable | Custom Properties | Additional Properties | Access Restrictions | Defined In |
|
||||
| :------------------ | ---------- | -------------- | ------------ | :---------------- | --------------------- | ------------------- | --------------------------------------------------------------------------------------------------- |
|
||||
| Can be instantiated | No | Unknown status | No | Forbidden | Forbidden | none | [ClientPushChangesRequest.schema.json](ClientPushChangesRequest.schema.json "open original schema") |
|
||||
| Can be instantiated | Yes | Unknown status | No | Forbidden | Forbidden | none | [ClientPushChangesRequest.schema.json](ClientPushChangesRequest.schema.json "open original schema") |
|
||||
|
||||
## ClientPushChangesRequest Type
|
||||
|
||||
`object` ([ClientPushChangesRequest](clientpushchangesrequest.md))
|
||||
|
||||
# ClientPushChangesRequest Definitions
|
||||
|
||||
## Definitions group ClientPushChangesRequestAction
|
||||
|
||||
Reference this group by using
|
||||
|
||||
```json
|
||||
{"$ref":"https://timelimit.io/ClientPushChangesRequest#/definitions/ClientPushChangesRequestAction"}
|
||||
```
|
||||
|
||||
| Property | Type | Required | Nullable | Defined by |
|
||||
| :-------------------------------- | -------- | -------- | -------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| [encodedAction](#encodedAction) | `string` | Required | cannot be null | [ClientPushChangesRequest](clientpushchangesrequest-definitions-clientpushchangesrequestaction-properties-encodedaction.md "https://timelimit.io/ClientPushChangesRequest#/definitions/ClientPushChangesRequestAction/properties/encodedAction") |
|
||||
| [sequenceNumber](#sequenceNumber) | `number` | Required | cannot be null | [ClientPushChangesRequest](clientpushchangesrequest-definitions-clientpushchangesrequestaction-properties-sequencenumber.md "https://timelimit.io/ClientPushChangesRequest#/definitions/ClientPushChangesRequestAction/properties/sequenceNumber") |
|
||||
| [integrity](#integrity) | `string` | Required | cannot be null | [ClientPushChangesRequest](clientpushchangesrequest-definitions-clientpushchangesrequestaction-properties-integrity.md "https://timelimit.io/ClientPushChangesRequest#/definitions/ClientPushChangesRequestAction/properties/integrity") |
|
||||
| [type](#type) | `string` | Required | cannot be null | [ClientPushChangesRequest](clientpushchangesrequest-definitions-clientpushchangesrequestaction-properties-type.md "https://timelimit.io/ClientPushChangesRequest#/definitions/ClientPushChangesRequestAction/properties/type") |
|
||||
| [userId](#userId) | `string` | Required | cannot be null | [ClientPushChangesRequest](clientpushchangesrequest-definitions-clientpushchangesrequestaction-properties-userid.md "https://timelimit.io/ClientPushChangesRequest#/definitions/ClientPushChangesRequestAction/properties/userId") |
|
||||
|
||||
### encodedAction
|
||||
|
||||
|
||||
|
||||
|
||||
`encodedAction`
|
||||
|
||||
- is required
|
||||
- Type: `string`
|
||||
- cannot be null
|
||||
- defined in: [ClientPushChangesRequest](clientpushchangesrequest-definitions-clientpushchangesrequestaction-properties-encodedaction.md "https://timelimit.io/ClientPushChangesRequest#/definitions/ClientPushChangesRequestAction/properties/encodedAction")
|
||||
|
||||
#### encodedAction Type
|
||||
|
||||
`string`
|
||||
|
||||
### sequenceNumber
|
||||
|
||||
|
||||
|
||||
|
||||
`sequenceNumber`
|
||||
|
||||
- is required
|
||||
- Type: `number`
|
||||
- cannot be null
|
||||
- defined in: [ClientPushChangesRequest](clientpushchangesrequest-definitions-clientpushchangesrequestaction-properties-sequencenumber.md "https://timelimit.io/ClientPushChangesRequest#/definitions/ClientPushChangesRequestAction/properties/sequenceNumber")
|
||||
|
||||
#### sequenceNumber Type
|
||||
|
||||
`number`
|
||||
|
||||
### integrity
|
||||
|
||||
|
||||
|
||||
|
||||
`integrity`
|
||||
|
||||
- is required
|
||||
- Type: `string`
|
||||
- cannot be null
|
||||
- defined in: [ClientPushChangesRequest](clientpushchangesrequest-definitions-clientpushchangesrequestaction-properties-integrity.md "https://timelimit.io/ClientPushChangesRequest#/definitions/ClientPushChangesRequestAction/properties/integrity")
|
||||
|
||||
#### integrity Type
|
||||
|
||||
`string`
|
||||
|
||||
### type
|
||||
|
||||
|
||||
|
||||
|
||||
`type`
|
||||
|
||||
- is required
|
||||
- Type: `string`
|
||||
- cannot be null
|
||||
- defined in: [ClientPushChangesRequest](clientpushchangesrequest-definitions-clientpushchangesrequestaction-properties-type.md "https://timelimit.io/ClientPushChangesRequest#/definitions/ClientPushChangesRequestAction/properties/type")
|
||||
|
||||
#### type Type
|
||||
|
||||
`string`
|
||||
|
||||
#### type Constraints
|
||||
|
||||
**enum**: the value of this property must be equal to one of the following values:
|
||||
|
||||
| Value | Explanation |
|
||||
| :----------- | ----------- |
|
||||
| `"appLogic"` | |
|
||||
| `"child"` | |
|
||||
| `"parent"` | |
|
||||
|
||||
### userId
|
||||
|
||||
|
||||
|
||||
|
||||
`userId`
|
||||
|
||||
- is required
|
||||
- Type: `string`
|
||||
- cannot be null
|
||||
- defined in: [ClientPushChangesRequest](clientpushchangesrequest-definitions-clientpushchangesrequestaction-properties-userid.md "https://timelimit.io/ClientPushChangesRequest#/definitions/ClientPushChangesRequestAction/properties/userId")
|
||||
|
||||
#### userId Type
|
||||
|
||||
`string`
|
||||
|
||||
# ClientPushChangesRequest Properties
|
||||
|
||||
| Property | Type | Required | Nullable | Defined by |
|
||||
@@ -46,10 +154,10 @@ https://timelimit.io/ClientPushChangesRequest
|
||||
`actions`
|
||||
|
||||
- is required
|
||||
- Type: `object[]` ([Details](clientpushchangesrequest-properties-actions-items.md))
|
||||
- Type: `object[]` ([ClientPushChangesRequestAction](clientpushchangesrequest-definitions-clientpushchangesrequestaction.md))
|
||||
- cannot be null
|
||||
- defined in: [ClientPushChangesRequest](clientpushchangesrequest-properties-actions.md "https://timelimit.io/ClientPushChangesRequest#/properties/actions")
|
||||
|
||||
### actions Type
|
||||
|
||||
`object[]` ([Details](clientpushchangesrequest-properties-actions-items.md))
|
||||
`object[]` ([ClientPushChangesRequestAction](clientpushchangesrequest-definitions-clientpushchangesrequestaction.md))
|
||||
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
# Untitled string in SerializedParentAction Schema
|
||||
|
||||
```txt
|
||||
https://timelimit.io/SerializedParentAction#/definitions/SerializedUpdatCategoryDisableLimitsAction/properties/categoryId
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
| Abstract | Extensible | Status | Identifiable | Custom Properties | Additional Properties | Access Restrictions | Defined In |
|
||||
| :------------------ | ---------- | -------------- | ----------------------- | :---------------- | --------------------- | ------------------- | ------------------------------------------------------------------------------------------------- |
|
||||
| Can be instantiated | No | Unknown status | Unknown identifiability | Forbidden | Allowed | none | [SerializedParentAction.schema.json\*](SerializedParentAction.schema.json "open original schema") |
|
||||
|
||||
## categoryId Type
|
||||
|
||||
`string`
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
# Untitled number in SerializedParentAction Schema
|
||||
|
||||
```txt
|
||||
https://timelimit.io/SerializedParentAction#/definitions/SerializedUpdatCategoryDisableLimitsAction/properties/endTime
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
| Abstract | Extensible | Status | Identifiable | Custom Properties | Additional Properties | Access Restrictions | Defined In |
|
||||
| :------------------ | ---------- | -------------- | ----------------------- | :---------------- | --------------------- | ------------------- | ------------------------------------------------------------------------------------------------- |
|
||||
| Can be instantiated | No | Unknown status | Unknown identifiability | Forbidden | Allowed | none | [SerializedParentAction.schema.json\*](SerializedParentAction.schema.json "open original schema") |
|
||||
|
||||
## endTime Type
|
||||
|
||||
`number`
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
# Untitled string in SerializedParentAction Schema
|
||||
|
||||
```txt
|
||||
https://timelimit.io/SerializedParentAction#/definitions/SerializedUpdatCategoryDisableLimitsAction/properties/type
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
| Abstract | Extensible | Status | Identifiable | Custom Properties | Additional Properties | Access Restrictions | Defined In |
|
||||
| :------------------ | ---------- | -------------- | ----------------------- | :---------------- | --------------------- | ------------------- | ------------------------------------------------------------------------------------------------- |
|
||||
| Can be instantiated | No | Unknown status | Unknown identifiability | Forbidden | Allowed | none | [SerializedParentAction.schema.json\*](SerializedParentAction.schema.json "open original schema") |
|
||||
|
||||
## type Type
|
||||
|
||||
`string`
|
||||
|
||||
## type Constraints
|
||||
|
||||
**enum**: the value of this property must be equal to one of the following values:
|
||||
|
||||
| Value | Explanation |
|
||||
| :--------------------------------- | ----------- |
|
||||
| `"UPDATE_CATEGORY_DISABLE_LIMITS"` | |
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
# Untitled undefined type in SerializedParentAction Schema
|
||||
|
||||
```txt
|
||||
https://timelimit.io/SerializedParentAction#/definitions/SerializedUpdatCategoryDisableLimitsAction/properties
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
| Abstract | Extensible | Status | Identifiable | Custom Properties | Additional Properties | Access Restrictions | Defined In |
|
||||
| :------------------ | ---------- | -------------- | ----------------------- | :---------------- | --------------------- | ------------------- | ------------------------------------------------------------------------------------------------- |
|
||||
| Can be instantiated | No | Unknown status | Unknown identifiability | Forbidden | Allowed | none | [SerializedParentAction.schema.json\*](SerializedParentAction.schema.json "open original schema") |
|
||||
|
||||
## properties Type
|
||||
|
||||
unknown
|
||||
+80
@@ -0,0 +1,80 @@
|
||||
# SerializedUpdatCategoryDisableLimitsAction Schema
|
||||
|
||||
```txt
|
||||
https://timelimit.io/SerializedParentAction#/definitions/SerializedUpdatCategoryDisableLimitsAction
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
| Abstract | Extensible | Status | Identifiable | Custom Properties | Additional Properties | Access Restrictions | Defined In |
|
||||
| :------------------ | ---------- | -------------- | ------------ | :---------------- | --------------------- | ------------------- | ------------------------------------------------------------------------------------------------- |
|
||||
| Can be instantiated | No | Unknown status | No | Forbidden | Forbidden | none | [SerializedParentAction.schema.json\*](SerializedParentAction.schema.json "open original schema") |
|
||||
|
||||
## SerializedUpdatCategoryDisableLimitsAction Type
|
||||
|
||||
`object` ([SerializedUpdatCategoryDisableLimitsAction](serializedparentaction-definitions-serializedupdatcategorydisablelimitsaction.md))
|
||||
|
||||
# SerializedUpdatCategoryDisableLimitsAction Properties
|
||||
|
||||
| Property | Type | Required | Nullable | Defined by |
|
||||
| :------------------------ | -------- | -------- | -------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| [type](#type) | `string` | Required | cannot be null | [SerializedParentAction](serializedparentaction-definitions-serializedupdatcategorydisablelimitsaction-properties-type.md "https://timelimit.io/SerializedParentAction#/definitions/SerializedUpdatCategoryDisableLimitsAction/properties/type") |
|
||||
| [categoryId](#categoryId) | `string` | Required | cannot be null | [SerializedParentAction](serializedparentaction-definitions-serializedupdatcategorydisablelimitsaction-properties-categoryid.md "https://timelimit.io/SerializedParentAction#/definitions/SerializedUpdatCategoryDisableLimitsAction/properties/categoryId") |
|
||||
| [endTime](#endTime) | `number` | Required | cannot be null | [SerializedParentAction](serializedparentaction-definitions-serializedupdatcategorydisablelimitsaction-properties-endtime.md "https://timelimit.io/SerializedParentAction#/definitions/SerializedUpdatCategoryDisableLimitsAction/properties/endTime") |
|
||||
|
||||
## type
|
||||
|
||||
|
||||
|
||||
|
||||
`type`
|
||||
|
||||
- is required
|
||||
- Type: `string`
|
||||
- cannot be null
|
||||
- defined in: [SerializedParentAction](serializedparentaction-definitions-serializedupdatcategorydisablelimitsaction-properties-type.md "https://timelimit.io/SerializedParentAction#/definitions/SerializedUpdatCategoryDisableLimitsAction/properties/type")
|
||||
|
||||
### type Type
|
||||
|
||||
`string`
|
||||
|
||||
### type Constraints
|
||||
|
||||
**enum**: the value of this property must be equal to one of the following values:
|
||||
|
||||
| Value | Explanation |
|
||||
| :--------------------------------- | ----------- |
|
||||
| `"UPDATE_CATEGORY_DISABLE_LIMITS"` | |
|
||||
|
||||
## categoryId
|
||||
|
||||
|
||||
|
||||
|
||||
`categoryId`
|
||||
|
||||
- is required
|
||||
- Type: `string`
|
||||
- cannot be null
|
||||
- defined in: [SerializedParentAction](serializedparentaction-definitions-serializedupdatcategorydisablelimitsaction-properties-categoryid.md "https://timelimit.io/SerializedParentAction#/definitions/SerializedUpdatCategoryDisableLimitsAction/properties/categoryId")
|
||||
|
||||
### categoryId Type
|
||||
|
||||
`string`
|
||||
|
||||
## endTime
|
||||
|
||||
|
||||
|
||||
|
||||
`endTime`
|
||||
|
||||
- is required
|
||||
- Type: `number`
|
||||
- cannot be null
|
||||
- defined in: [SerializedParentAction](serializedparentaction-definitions-serializedupdatcategorydisablelimitsaction-properties-endtime.md "https://timelimit.io/SerializedParentAction#/definitions/SerializedUpdatCategoryDisableLimitsAction/properties/endTime")
|
||||
|
||||
### endTime Type
|
||||
|
||||
`number`
|
||||
@@ -48,6 +48,7 @@ any of
|
||||
- [SerializedUpdateCategoryBatteryLimitAction](serializedparentaction-definitions-serializedupdatecategorybatterylimitaction.md "check type definition")
|
||||
- [SerializedUpdateCategoryBlockAllNotificationsAction](serializedparentaction-definitions-serializedupdatecategoryblockallnotificationsaction.md "check type definition")
|
||||
- [SerializedUpdateCategoryBlockedTimesAction](serializedparentaction-definitions-serializedupdatecategoryblockedtimesaction.md "check type definition")
|
||||
- [SerializedUpdatCategoryDisableLimitsAction](serializedparentaction-definitions-serializedupdatcategorydisablelimitsaction.md "check type definition")
|
||||
- [SerializedUpdateCategorySortingAction](serializedparentaction-definitions-serializedupdatecategorysortingaction.md "check type definition")
|
||||
- [SerializedUpdateCategoryTemporarilyBlockedAction](serializedparentaction-definitions-serializedupdatecategorytemporarilyblockedaction.md "check type definition")
|
||||
- [SerializedUpdateCategoryTimeWarningsAction](serializedparentaction-definitions-serializedupdatecategorytimewarningsaction.md "check type definition")
|
||||
@@ -2723,6 +2724,76 @@ Reference this group by using
|
||||
|
||||
`string`
|
||||
|
||||
## Definitions group SerializedUpdatCategoryDisableLimitsAction
|
||||
|
||||
Reference this group by using
|
||||
|
||||
```json
|
||||
{"$ref":"https://timelimit.io/SerializedParentAction#/definitions/SerializedUpdatCategoryDisableLimitsAction"}
|
||||
```
|
||||
|
||||
| Property | Type | Required | Nullable | Defined by |
|
||||
| :------------------------ | -------- | -------- | -------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| [type](#type) | `string` | Required | cannot be null | [SerializedParentAction](serializedparentaction-definitions-serializedupdatcategorydisablelimitsaction-properties-type.md "https://timelimit.io/SerializedParentAction#/definitions/SerializedUpdatCategoryDisableLimitsAction/properties/type") |
|
||||
| [categoryId](#categoryId) | `string` | Required | cannot be null | [SerializedParentAction](serializedparentaction-definitions-serializedupdatcategorydisablelimitsaction-properties-categoryid.md "https://timelimit.io/SerializedParentAction#/definitions/SerializedUpdatCategoryDisableLimitsAction/properties/categoryId") |
|
||||
| [endTime](#endTime) | `number` | Required | cannot be null | [SerializedParentAction](serializedparentaction-definitions-serializedupdatcategorydisablelimitsaction-properties-endtime.md "https://timelimit.io/SerializedParentAction#/definitions/SerializedUpdatCategoryDisableLimitsAction/properties/endTime") |
|
||||
|
||||
### type
|
||||
|
||||
|
||||
|
||||
|
||||
`type`
|
||||
|
||||
- is required
|
||||
- Type: `string`
|
||||
- cannot be null
|
||||
- defined in: [SerializedParentAction](serializedparentaction-definitions-serializedupdatcategorydisablelimitsaction-properties-type.md "https://timelimit.io/SerializedParentAction#/definitions/SerializedUpdatCategoryDisableLimitsAction/properties/type")
|
||||
|
||||
#### type Type
|
||||
|
||||
`string`
|
||||
|
||||
#### type Constraints
|
||||
|
||||
**enum**: the value of this property must be equal to one of the following values:
|
||||
|
||||
| Value | Explanation |
|
||||
| :--------------------------------- | ----------- |
|
||||
| `"UPDATE_CATEGORY_DISABLE_LIMITS"` | |
|
||||
|
||||
### categoryId
|
||||
|
||||
|
||||
|
||||
|
||||
`categoryId`
|
||||
|
||||
- is required
|
||||
- Type: `string`
|
||||
- cannot be null
|
||||
- defined in: [SerializedParentAction](serializedparentaction-definitions-serializedupdatcategorydisablelimitsaction-properties-categoryid.md "https://timelimit.io/SerializedParentAction#/definitions/SerializedUpdatCategoryDisableLimitsAction/properties/categoryId")
|
||||
|
||||
#### categoryId Type
|
||||
|
||||
`string`
|
||||
|
||||
### endTime
|
||||
|
||||
|
||||
|
||||
|
||||
`endTime`
|
||||
|
||||
- is required
|
||||
- Type: `number`
|
||||
- cannot be null
|
||||
- defined in: [SerializedParentAction](serializedparentaction-definitions-serializedupdatcategorydisablelimitsaction-properties-endtime.md "https://timelimit.io/SerializedParentAction#/definitions/SerializedUpdatCategoryDisableLimitsAction/properties/endTime")
|
||||
|
||||
#### endTime Type
|
||||
|
||||
`number`
|
||||
|
||||
## Definitions group SerializedUpdateCategorySortingAction
|
||||
|
||||
Reference this group by using
|
||||
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
# Untitled number in ServerDataStatus Schema
|
||||
|
||||
```txt
|
||||
https://timelimit.io/ServerDataStatus#/definitions/ServerUpdatedCategoryBaseData/properties/dlu
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
| 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") |
|
||||
|
||||
## dlu Type
|
||||
|
||||
`number`
|
||||
@@ -35,6 +35,7 @@ https://timelimit.io/ServerDataStatus#/definitions/ServerUpdatedCategoryBaseData
|
||||
| [mblMobile](#mblMobile) | `number` | Required | cannot be null | [ServerDataStatus](serverdatastatus-definitions-serverupdatedcategorybasedata-properties-mblmobile.md "https://timelimit.io/ServerDataStatus#/definitions/ServerUpdatedCategoryBaseData/properties/mblMobile") |
|
||||
| [sort](#sort) | `number` | Required | cannot be null | [ServerDataStatus](serverdatastatus-definitions-serverupdatedcategorybasedata-properties-sort.md "https://timelimit.io/ServerDataStatus#/definitions/ServerUpdatedCategoryBaseData/properties/sort") |
|
||||
| [networks](#networks) | `array` | Required | cannot be null | [ServerDataStatus](serverdatastatus-definitions-serverupdatedcategorybasedata-properties-networks.md "https://timelimit.io/ServerDataStatus#/definitions/ServerUpdatedCategoryBaseData/properties/networks") |
|
||||
| [dlu](#dlu) | `number` | Required | cannot be null | [ServerDataStatus](serverdatastatus-definitions-serverupdatedcategorybasedata-properties-dlu.md "https://timelimit.io/ServerDataStatus#/definitions/ServerUpdatedCategoryBaseData/properties/dlu") |
|
||||
|
||||
## categoryId
|
||||
|
||||
@@ -291,3 +292,19 @@ https://timelimit.io/ServerDataStatus#/definitions/ServerUpdatedCategoryBaseData
|
||||
### networks Type
|
||||
|
||||
`object[]` ([ServerCategoryNetworkId](serverdatastatus-definitions-servercategorynetworkid.md))
|
||||
|
||||
## dlu
|
||||
|
||||
|
||||
|
||||
|
||||
`dlu`
|
||||
|
||||
- is required
|
||||
- Type: `number`
|
||||
- cannot be null
|
||||
- defined in: [ServerDataStatus](serverdatastatus-definitions-serverupdatedcategorybasedata-properties-dlu.md "https://timelimit.io/ServerDataStatus#/definitions/ServerUpdatedCategoryBaseData/properties/dlu")
|
||||
|
||||
### dlu Type
|
||||
|
||||
`number`
|
||||
|
||||
@@ -975,6 +975,7 @@ Reference this group by using
|
||||
| [mblMobile](#mblMobile) | `number` | Required | cannot be null | [ServerDataStatus](serverdatastatus-definitions-serverupdatedcategorybasedata-properties-mblmobile.md "https://timelimit.io/ServerDataStatus#/definitions/ServerUpdatedCategoryBaseData/properties/mblMobile") |
|
||||
| [sort](#sort) | `number` | Required | cannot be null | [ServerDataStatus](serverdatastatus-definitions-serverupdatedcategorybasedata-properties-sort.md "https://timelimit.io/ServerDataStatus#/definitions/ServerUpdatedCategoryBaseData/properties/sort") |
|
||||
| [networks](#networks) | `array` | Required | cannot be null | [ServerDataStatus](serverdatastatus-definitions-serverupdatedcategorybasedata-properties-networks.md "https://timelimit.io/ServerDataStatus#/definitions/ServerUpdatedCategoryBaseData/properties/networks") |
|
||||
| [dlu](#dlu) | `number` | Required | cannot be null | [ServerDataStatus](serverdatastatus-definitions-serverupdatedcategorybasedata-properties-dlu.md "https://timelimit.io/ServerDataStatus#/definitions/ServerUpdatedCategoryBaseData/properties/dlu") |
|
||||
|
||||
### categoryId
|
||||
|
||||
@@ -1232,6 +1233,22 @@ Reference this group by using
|
||||
|
||||
`object[]` ([ServerCategoryNetworkId](serverdatastatus-definitions-servercategorynetworkid.md))
|
||||
|
||||
### dlu
|
||||
|
||||
|
||||
|
||||
|
||||
`dlu`
|
||||
|
||||
- is required
|
||||
- Type: `number`
|
||||
- cannot be null
|
||||
- defined in: [ServerDataStatus](serverdatastatus-definitions-serverupdatedcategorybasedata-properties-dlu.md "https://timelimit.io/ServerDataStatus#/definitions/ServerUpdatedCategoryBaseData/properties/dlu")
|
||||
|
||||
#### dlu Type
|
||||
|
||||
`number`
|
||||
|
||||
## Definitions group ServerCategoryNetworkId
|
||||
|
||||
Reference this group by using
|
||||
|
||||
@@ -13,18 +13,6 @@
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.ReadMsgBody {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.ExternalClass {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.ExternalClass * {
|
||||
line-height: 100%;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
@@ -53,18 +41,6 @@
|
||||
margin: 13px 0;
|
||||
}
|
||||
</style>
|
||||
<!--[if !mso]><!-->
|
||||
<style type="text/css">
|
||||
@media only screen and (max-width:480px) {
|
||||
@-ms-viewport {
|
||||
width: 320px;
|
||||
}
|
||||
@viewport {
|
||||
width: 320px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<!--<![endif]-->
|
||||
<!--[if mso]>
|
||||
<xml>
|
||||
<o:OfficeDocumentSettings>
|
||||
@@ -75,9 +51,11 @@
|
||||
<![endif]-->
|
||||
<!--[if lte mso 11]>
|
||||
<style type="text/css">
|
||||
.outlook-group-fix { width:100% !important; }
|
||||
.mj-outlook-group-fix { width:100% !important; }
|
||||
</style>
|
||||
<![endif]-->
|
||||
<!--[if !mso]><!-->
|
||||
<!--<![endif]-->
|
||||
<style type="text/css">
|
||||
@media only screen and (min-width:480px) {
|
||||
.mj-column-per-100 {
|
||||
@@ -99,11 +77,11 @@
|
||||
<tr>
|
||||
<td style="line-height:0px;font-size:0px;mso-line-height-rule:exactly;">
|
||||
<![endif]-->
|
||||
<div style="background:#009688;background-color:#009688;Margin:0px auto;max-width:600px;">
|
||||
<div style="background:#009688;background-color:#009688;margin:0px auto;max-width:600px;">
|
||||
<table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="background:#009688;background-color:#009688;width:100%;">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="direction:ltr;font-size:0px;padding:20px 0;text-align:center;vertical-align:top;">
|
||||
<td style="direction:ltr;font-size:0px;padding:20px 0;text-align:center;">
|
||||
<!--[if mso | IE]>
|
||||
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
||||
|
||||
@@ -113,11 +91,11 @@
|
||||
class="" style="vertical-align:top;width:600px;"
|
||||
>
|
||||
<![endif]-->
|
||||
<div class="mj-column-per-100 outlook-group-fix" style="font-size:13px;text-align:left;direction:ltr;display:inline-block;vertical-align:top;width:100%;">
|
||||
<div class="mj-column-per-100 mj-outlook-group-fix" style="font-size:0px;text-align:left;direction:ltr;display:inline-block;vertical-align:top;width:100%;">
|
||||
<table border="0" cellpadding="0" cellspacing="0" role="presentation" style="vertical-align:top;" width="100%">
|
||||
<tr>
|
||||
<td align="left" style="font-size:0px;padding:10px 25px;word-break:break-word;">
|
||||
<div style="font-family:Ubuntu, Helvetica, Arial, sans-serif;font-size:20px;line-height:1;text-align:left;color:#ffffff;"> TimeLimit </div>
|
||||
<div style="font-family:Ubuntu, Helvetica, Arial, sans-serif;font-size:20px;line-height:1;text-align:left;color:#ffffff;">TimeLimit</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -145,11 +123,11 @@
|
||||
<tr>
|
||||
<td style="line-height:0px;font-size:0px;mso-line-height-rule:exactly;">
|
||||
<![endif]-->
|
||||
<div style="Margin:0px auto;max-width:600px;">
|
||||
<div style="margin:0px auto;max-width:600px;">
|
||||
<table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="width:100%;">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="direction:ltr;font-size:0px;padding:20px 0;text-align:center;vertical-align:top;">
|
||||
<td style="direction:ltr;font-size:0px;padding:20px 0;text-align:center;">
|
||||
<!--[if mso | IE]>
|
||||
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
||||
|
||||
@@ -159,15 +137,17 @@
|
||||
class="" style="vertical-align:top;width:600px;"
|
||||
>
|
||||
<![endif]-->
|
||||
<div class="mj-column-per-100 outlook-group-fix" style="font-size:13px;text-align:left;direction:ltr;display:inline-block;vertical-align:top;width:100%;">
|
||||
<div class="mj-column-per-100 mj-outlook-group-fix" style="font-size:0px;text-align:left;direction:ltr;display:inline-block;vertical-align:top;width:100%;">
|
||||
<table border="0" cellpadding="0" cellspacing="0" role="presentation" style="vertical-align:top;" width="100%">
|
||||
<tr>
|
||||
<td align="left" style="font-size:0px;padding:10px 25px;word-break:break-word;">
|
||||
<div style="font-family:Ubuntu, Helvetica, Arial, sans-serif;font-size:13px;line-height:1;text-align:left;color:#000000;">
|
||||
<p> TimeLimit wurde von dem Gerät
|
||||
<%= deviceName %> entfernt. </p>
|
||||
<p> TimeLimit wurde vom Gerät
|
||||
<%= deviceName %> entfernt. Ein Zurücksetzen der App, wonach diese immer noch "da", aber nicht eingerichtet ist, zählt auch als Entfernen. In jedem Fall wurde diese Aktion durch den Benutzer des Gerätes durchgeführt - in der Voreinstellung kann
|
||||
TimeLimit jederzeit, auch durch das Kind, entfernt werden. Technisch bedingt wird nicht jede Entfernung erkannt, sodass nicht in jedem Fall diese Benachrichtigung kommt. </p>
|
||||
<p> TimeLimit was removed from
|
||||
<%= deviceName %>. </p>
|
||||
<%= deviceName %>. A reset of the App, after which it is still "there", but not set up, is considered a removal, too. In any case, this was done by the user of the device. Remember that by default, it is always possible to remove TimeLimit, for
|
||||
parents and children. For technical reasons, not every removal can be detected, so that you will not always get this notifications. </p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -196,11 +176,11 @@
|
||||
<tr>
|
||||
<td style="line-height:0px;font-size:0px;mso-line-height-rule:exactly;">
|
||||
<![endif]-->
|
||||
<div style="Margin:0px auto;max-width:600px;">
|
||||
<div style="margin:0px auto;max-width:600px;">
|
||||
<table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="width:100%;">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="direction:ltr;font-size:0px;padding:20px 0;text-align:center;vertical-align:top;">
|
||||
<td style="direction:ltr;font-size:0px;padding:20px 0;text-align:center;">
|
||||
<!--[if mso | IE]>
|
||||
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
||||
|
||||
@@ -210,14 +190,14 @@
|
||||
class="" style="vertical-align:top;width:600px;"
|
||||
>
|
||||
<![endif]-->
|
||||
<div class="mj-column-per-100 outlook-group-fix" style="font-size:13px;text-align:left;direction:ltr;display:inline-block;vertical-align:top;width:100%;">
|
||||
<div class="mj-column-per-100 mj-outlook-group-fix" style="font-size:0px;text-align:left;direction:ltr;display:inline-block;vertical-align:top;width:100%;">
|
||||
<table border="0" cellpadding="0" cellspacing="0" role="presentation" style="vertical-align:top;" width="100%">
|
||||
<tr>
|
||||
<td style="font-size:0px;padding:10px 25px;word-break:break-word;">
|
||||
<p style="border-top:dashed 1px lightgrey;font-size:1;margin:0px auto;width:100%;"> </p>
|
||||
<p style="border-top:dashed 1px lightgrey;font-size:1px;margin:0px auto;width:100%;"> </p>
|
||||
<!--[if mso | IE]>
|
||||
<table
|
||||
align="center" border="0" cellpadding="0" cellspacing="0" style="border-top:dashed 1px lightgrey;font-size:1;margin:0px auto;width:550px;" role="presentation" width="550px"
|
||||
align="center" border="0" cellpadding="0" cellspacing="0" style="border-top:dashed 1px lightgrey;font-size:1px;margin:0px auto;width:550px;" role="presentation" width="550px"
|
||||
>
|
||||
<tr>
|
||||
<td style="height:0;line-height:0;">
|
||||
@@ -253,11 +233,11 @@
|
||||
<tr>
|
||||
<td style="line-height:0px;font-size:0px;mso-line-height-rule:exactly;">
|
||||
<![endif]-->
|
||||
<div style="Margin:0px auto;max-width:600px;">
|
||||
<div style="margin:0px auto;max-width:600px;">
|
||||
<table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="width:100%;">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="direction:ltr;font-size:0px;padding:20px 0;text-align:center;vertical-align:top;">
|
||||
<td style="direction:ltr;font-size:0px;padding:20px 0;text-align:center;">
|
||||
<!--[if mso | IE]>
|
||||
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
||||
|
||||
@@ -267,7 +247,7 @@
|
||||
class="" style="vertical-align:top;width:600px;"
|
||||
>
|
||||
<![endif]-->
|
||||
<div class="mj-column-per-100 outlook-group-fix" style="font-size:13px;text-align:left;direction:ltr;display:inline-block;vertical-align:top;width:100%;">
|
||||
<div class="mj-column-per-100 mj-outlook-group-fix" style="font-size:0px;text-align:left;direction:ltr;display:inline-block;vertical-align:top;width:100%;">
|
||||
<table border="0" cellpadding="0" cellspacing="0" role="presentation" style="vertical-align:top;" width="100%">
|
||||
<tr>
|
||||
<td align="left" style="font-size:0px;padding:10px 25px;word-break:break-word;">
|
||||
|
||||
@@ -9,11 +9,20 @@
|
||||
<mj-column>
|
||||
<mj-text>
|
||||
<p>
|
||||
TimeLimit wurde von dem Gerät <%= deviceName %> entfernt.
|
||||
TimeLimit wurde vom Gerät <%= deviceName %> entfernt. Ein Zurücksetzen der
|
||||
App, wonach diese immer noch "da", aber nicht eingerichtet ist, zählt auch als Entfernen.
|
||||
In jedem Fall wurde diese Aktion durch den Benutzer des Gerätes durchgeführt -
|
||||
in der Voreinstellung kann TimeLimit jederzeit, auch durch das Kind, entfernt werden.
|
||||
Technisch bedingt wird nicht jede Entfernung erkannt, sodass nicht in jedem Fall diese
|
||||
Benachrichtigung kommt.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
TimeLimit was removed from <%= deviceName %>.
|
||||
TimeLimit was removed from <%= deviceName %>. A reset of the App, after which it is
|
||||
still "there", but not set up, is considered a removal, too. In any case, this was
|
||||
done by the user of the device. Remember that by default, it is always possible
|
||||
to remove TimeLimit, for parents and children. For technical reasons, not every
|
||||
removal can be detected, so that you will not always get this notifications.
|
||||
</p>
|
||||
</mj-text>
|
||||
</mj-column>
|
||||
|
||||
@@ -1,6 +1,15 @@
|
||||
TimeLimit wurde von dem Gerät <%= deviceName %> entfernt.
|
||||
TimeLimit wurde vom Gerät <%= deviceName %> entfernt. Ein Zurücksetzen der
|
||||
App, wonach diese immer noch "da", aber nicht eingerichtet ist, zählt auch als Entfernen.
|
||||
In jedem Fall wurde diese Aktion durch den Benutzer des Gerätes durchgeführt -
|
||||
in der Voreinstellung kann TimeLimit jederzeit, auch durch das Kind, entfernt werden.
|
||||
Technisch bedingt wird nicht jede Entfernung erkannt, sodass nicht in jedem Fall diese
|
||||
Benachrichtigung kommt.
|
||||
|
||||
TimeLimit was removed from <%= deviceName %>.
|
||||
TimeLimit was removed from <%= deviceName %>. A reset of the App, after which it is
|
||||
still "there", but not set up, is considered a removal, too. In any case, this was
|
||||
done by the user of the device. Remember that by default, it is always possible
|
||||
to remove TimeLimit, for parents and children. For technical reasons, not every
|
||||
removal can be detected, so that you will not always get this notifications.
|
||||
|
||||
----------------------
|
||||
|
||||
|
||||
Generated
+17
-23
@@ -1851,7 +1851,6 @@
|
||||
"version": "7.1.6",
|
||||
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz",
|
||||
"integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"fs.realpath": "1.0.0",
|
||||
"inflight": "1.0.6",
|
||||
@@ -2818,9 +2817,20 @@
|
||||
"npm-packlist": "1.4.1",
|
||||
"npmlog": "4.1.2",
|
||||
"rc": "1.2.8",
|
||||
"rimraf": "2.6.3",
|
||||
"rimraf": "2.7.1",
|
||||
"semver": "5.5.0",
|
||||
"tar": "4.4.8"
|
||||
},
|
||||
"dependencies": {
|
||||
"rimraf": {
|
||||
"version": "2.7.1",
|
||||
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz",
|
||||
"integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==",
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"glob": "7.1.6"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"nodemailer": {
|
||||
@@ -3559,28 +3569,12 @@
|
||||
}
|
||||
},
|
||||
"rimraf": {
|
||||
"version": "2.6.3",
|
||||
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz",
|
||||
"integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==",
|
||||
"optional": true,
|
||||
"version": "3.0.2",
|
||||
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz",
|
||||
"integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"glob": "7.1.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"glob": {
|
||||
"version": "7.1.3",
|
||||
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz",
|
||||
"integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==",
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"fs.realpath": "1.0.0",
|
||||
"inflight": "1.0.6",
|
||||
"inherits": "2.0.3",
|
||||
"minimatch": "3.0.4",
|
||||
"once": "1.4.0",
|
||||
"path-is-absolute": "1.0.1"
|
||||
}
|
||||
}
|
||||
"glob": "7.1.6"
|
||||
}
|
||||
},
|
||||
"safe-buffer": {
|
||||
|
||||
+3
-1
@@ -8,7 +8,8 @@
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"lint": "tslint --project .",
|
||||
"lint:fix": "tslint --project . --fix",
|
||||
"build": "npm run build:json && npm run build:ts && npm run lint && npm run build:doc",
|
||||
"build": "npm run build:clean && npm run build:json && npm run build:ts && npm run lint && npm run build:doc",
|
||||
"build:clean": "rimraf build",
|
||||
"build:json": "node ./scripts/build-schemas.js",
|
||||
"build:ts": "tsc",
|
||||
"build:doc": "npm run build:doc:json",
|
||||
@@ -39,6 +40,7 @@
|
||||
"@types/socket.io": "^2.1.4",
|
||||
"@types/tokgen": "^1.0.0",
|
||||
"@types/umzug": "^2.2.3",
|
||||
"rimraf": "^3.0.2",
|
||||
"tslint": "^6.1.3",
|
||||
"tslint-config-standard": "^9.0.0",
|
||||
"typescript": "^3.8.3",
|
||||
|
||||
@@ -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,10 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { assertNonEmptyListWithoutDuplicates } from '../util/list'
|
||||
import { assertIdWithinFamily } from '../util/token'
|
||||
import { ParentAction } from './basetypes'
|
||||
import { assertIdWithinFamily, assertNonEmptyListWithoutDuplicates } from './meta/util'
|
||||
|
||||
const actionType = 'AddCategoryApps'
|
||||
|
||||
export class AddCategoryAppsAction extends ParentAction {
|
||||
readonly categoryId: string
|
||||
@@ -26,19 +27,13 @@ export class AddCategoryAppsAction extends ParentAction {
|
||||
constructor ({ categoryId, packageNames }: {categoryId: string, packageNames: Array<string>}) {
|
||||
super()
|
||||
|
||||
assertIdWithinFamily(categoryId)
|
||||
assertNonEmptyListWithoutDuplicates(packageNames)
|
||||
assertIdWithinFamily({ actionType, field: 'categoryId', value: categoryId })
|
||||
assertNonEmptyListWithoutDuplicates({ actionType, field: 'packageNames', list: packageNames })
|
||||
|
||||
this.categoryId = categoryId
|
||||
this.packageNames = packageNames
|
||||
}
|
||||
|
||||
serialize = (): SerializedAddCategoryAppsAction => ({
|
||||
type: 'ADD_CATEGORY_APPS',
|
||||
categoryId: this.categoryId,
|
||||
packageNames: this.packageNames
|
||||
})
|
||||
|
||||
static parse = ({ categoryId, packageNames }: SerializedAddCategoryAppsAction) => (
|
||||
new AddCategoryAppsAction({ categoryId, packageNames })
|
||||
)
|
||||
|
||||
@@ -16,9 +16,11 @@
|
||||
*/
|
||||
|
||||
import { anonymizedNetworkIdLength } from '../database/categorynetworkid'
|
||||
import { assertIsHexString } from '../util/hexstring'
|
||||
import { assertIdWithinFamily } from '../util/token'
|
||||
import { ParentAction } from './basetypes'
|
||||
import { InvalidActionParameterException } from './meta/exception'
|
||||
import { assertHexString, assertIdWithinFamily } from './meta/util'
|
||||
|
||||
const actionType = 'AddCategoryNetworkIdAction'
|
||||
|
||||
export class AddCategoryNetworkIdAction extends ParentAction {
|
||||
readonly categoryId: string
|
||||
@@ -32,23 +34,22 @@ export class AddCategoryNetworkIdAction extends ParentAction {
|
||||
}) {
|
||||
super()
|
||||
|
||||
assertIdWithinFamily(categoryId)
|
||||
assertIdWithinFamily(itemId)
|
||||
assertIsHexString(hashedNetworkId)
|
||||
if (hashedNetworkId.length !== anonymizedNetworkIdLength) throw new Error('wrong network id length')
|
||||
assertIdWithinFamily({ actionType, field: 'categoryId', value: categoryId })
|
||||
assertIdWithinFamily({ actionType, field: 'itemId', value: itemId })
|
||||
assertHexString({ actionType, field: 'hashedNetworkId', value: hashedNetworkId })
|
||||
|
||||
if (hashedNetworkId.length !== anonymizedNetworkIdLength) {
|
||||
throw new InvalidActionParameterException({
|
||||
actionType,
|
||||
staticMessage: 'wrong network id length'
|
||||
})
|
||||
}
|
||||
|
||||
this.categoryId = categoryId
|
||||
this.itemId = itemId
|
||||
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
|
||||
@@ -16,8 +16,10 @@
|
||||
*/
|
||||
|
||||
import { InstalledApp, SerializedInstalledApp } from '../model/installedapp'
|
||||
import { assertNonEmptyListWithoutDuplicates } from '../util/list'
|
||||
import { AppLogicAction } from './basetypes'
|
||||
import { assertNonEmptyListWithoutDuplicates } from './meta/util'
|
||||
|
||||
const actionType = 'AddInstalledAppsAction'
|
||||
|
||||
export class AddInstalledAppsAction extends AppLogicAction {
|
||||
readonly apps: Array<InstalledApp>
|
||||
@@ -25,16 +27,11 @@ export class AddInstalledAppsAction extends AppLogicAction {
|
||||
constructor ({ apps }: {apps: Array<InstalledApp>}) {
|
||||
super()
|
||||
|
||||
assertNonEmptyListWithoutDuplicates(apps.map((app) => app.packageName))
|
||||
assertNonEmptyListWithoutDuplicates({ actionType, field: 'apps', list: apps.map((app) => app.packageName) })
|
||||
|
||||
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))
|
||||
|
||||
+21
-14
@@ -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,8 +15,11 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { assertIdWithinFamily } from '../util/token'
|
||||
import { AppLogicAction } from './basetypes'
|
||||
import { InvalidActionParameterException } from './meta/exception'
|
||||
import { assertIdWithinFamily } from './meta/util'
|
||||
|
||||
const actionType = 'AddUsedTimeAction'
|
||||
|
||||
export class AddUsedTimeAction extends AppLogicAction {
|
||||
readonly categoryId: string
|
||||
@@ -32,18 +35,30 @@ export class AddUsedTimeAction extends AppLogicAction {
|
||||
}) {
|
||||
super()
|
||||
|
||||
assertIdWithinFamily(categoryId)
|
||||
assertIdWithinFamily({ actionType, field: 'categoryId', value: categoryId })
|
||||
|
||||
if (dayOfEpoch < 0 || (!Number.isSafeInteger(dayOfEpoch))) {
|
||||
throw new Error('illegal dayOfEpoch')
|
||||
throw new InvalidActionParameterException({
|
||||
actionType,
|
||||
staticMessage: 'invalid dayOfEpoch',
|
||||
dynamicMessage: 'invalid dayOfEpoch: ' + dayOfEpoch
|
||||
})
|
||||
}
|
||||
|
||||
if (timeToAdd < 0 || (!Number.isSafeInteger(timeToAdd))) {
|
||||
throw new Error('illegal timeToAdd')
|
||||
throw new InvalidActionParameterException({
|
||||
actionType,
|
||||
staticMessage: 'illegal timeToAdd',
|
||||
dynamicMessage: 'illegal timeToAdd: ' + timeToAdd
|
||||
})
|
||||
}
|
||||
|
||||
if (extraTimeToSubtract < 0 || (!Number.isSafeInteger(extraTimeToSubtract))) {
|
||||
throw new Error('illegal extra time to subtract')
|
||||
throw new InvalidActionParameterException({
|
||||
actionType,
|
||||
staticMessage: 'illegal extra time to subtract',
|
||||
dynamicMessage: 'illegal extra time to subtract: ' + extraTimeToSubtract
|
||||
})
|
||||
}
|
||||
|
||||
this.categoryId = categoryId
|
||||
@@ -52,14 +67,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,
|
||||
|
||||
+48
-52
@@ -15,10 +15,12 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { uniq } from 'lodash'
|
||||
import { MinuteOfDay } from '../util/minuteofday'
|
||||
import { assertIdWithinFamily } from '../util/token'
|
||||
import { AppLogicAction } from './basetypes'
|
||||
import { InvalidActionParameterException } from './meta/exception'
|
||||
import { assertIdWithinFamily, assertListWithoutDuplicates, assertSafeInteger, throwOutOfRange } from './meta/util'
|
||||
|
||||
const actionType = 'AddUsedTimeActionVersion2'
|
||||
|
||||
export class AddUsedTimeActionVersion2 extends AppLogicAction {
|
||||
readonly dayOfEpoch: number
|
||||
@@ -44,46 +46,54 @@ export class AddUsedTimeActionVersion2 extends AppLogicAction {
|
||||
}) {
|
||||
super()
|
||||
|
||||
if (dayOfEpoch < 0 || (!Number.isSafeInteger(dayOfEpoch))) {
|
||||
throw new Error('illegal dayOfEpoch')
|
||||
assertSafeInteger({ actionType, field: 'dayOfEpoch', value: dayOfEpoch })
|
||||
|
||||
if (dayOfEpoch < 0) {
|
||||
throwOutOfRange({ actionType, field: 'dayOfEpoch', value: dayOfEpoch })
|
||||
}
|
||||
|
||||
if (trustedTimestamp < 0 || (!Number.isSafeInteger(trustedTimestamp))) {
|
||||
throw new Error('illegal trustedTimestamp')
|
||||
assertSafeInteger({ actionType, field: 'trustedTimestamp', value: trustedTimestamp })
|
||||
|
||||
if (trustedTimestamp < 0) {
|
||||
throwOutOfRange({ actionType, field: 'trustedTimestamp', value: trustedTimestamp })
|
||||
}
|
||||
|
||||
if (items.length === 0) {
|
||||
throw new Error('missing items')
|
||||
throw new InvalidActionParameterException({ actionType, staticMessage: 'no items' })
|
||||
}
|
||||
|
||||
if (items.length !== uniq(items.map((item) => item.categoryId)).length) {
|
||||
throw new Error('duplicate category ids')
|
||||
}
|
||||
assertListWithoutDuplicates({
|
||||
actionType,
|
||||
field: 'categoryIds',
|
||||
list: items.map((item) => item.categoryId)
|
||||
})
|
||||
|
||||
items.forEach((item) => {
|
||||
assertIdWithinFamily(item.categoryId)
|
||||
assertIdWithinFamily({ actionType, field: 'categoryId', value: item.categoryId })
|
||||
|
||||
if (item.timeToAdd < 0 || (!Number.isSafeInteger(item.timeToAdd))) {
|
||||
throw new Error('illegal timeToAdd')
|
||||
assertSafeInteger({ actionType, field: 'timeToAdd', value: item.timeToAdd })
|
||||
|
||||
if (item.timeToAdd < 0) {
|
||||
throwOutOfRange({ actionType, field: 'timeToAdd', value: item.timeToAdd })
|
||||
}
|
||||
|
||||
if (item.extraTimeToSubtract < 0 || (!Number.isSafeInteger(item.extraTimeToSubtract))) {
|
||||
throw new Error('illegal extra time to subtract')
|
||||
assertSafeInteger({ actionType, field: 'extraTimeToSubtract', value: item.extraTimeToSubtract })
|
||||
|
||||
if (item.extraTimeToSubtract < 0) {
|
||||
throwOutOfRange({ actionType, field: 'extraTimeToSubtract', value: item.extraTimeToSubtract })
|
||||
}
|
||||
|
||||
if (
|
||||
uniq(item.additionalCountingSlots.map((item) => JSON.stringify(item.serialize()))).length !==
|
||||
item.additionalCountingSlots.length
|
||||
) {
|
||||
throw new Error()
|
||||
}
|
||||
assertListWithoutDuplicates({
|
||||
actionType,
|
||||
field: 'additionalCountingSlots',
|
||||
list: item.additionalCountingSlots.map((item) => JSON.stringify(item.serialize()))
|
||||
})
|
||||
|
||||
if (
|
||||
uniq(item.sessionDurationLimits.map((item) => JSON.stringify(item.serialize()))).length !==
|
||||
item.sessionDurationLimits.length
|
||||
) {
|
||||
throw new Error()
|
||||
}
|
||||
assertListWithoutDuplicates({
|
||||
actionType,
|
||||
field: 'sessionDurationLimits',
|
||||
list: item.sessionDurationLimits.map((item) => JSON.stringify(item.serialize()))
|
||||
})
|
||||
})
|
||||
|
||||
this.dayOfEpoch = dayOfEpoch
|
||||
@@ -91,17 +101,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,
|
||||
@@ -122,16 +121,15 @@ class AddUsedTimeActionItemAdditionalCountingSlot {
|
||||
readonly end: number
|
||||
|
||||
constructor ({ start, end }: { start: number, end: number }) {
|
||||
if ((!Number.isSafeInteger(start)) || (!Number.isSafeInteger(end))) {
|
||||
throw new Error()
|
||||
}
|
||||
assertSafeInteger({ actionType, field: 'start', value: start })
|
||||
assertSafeInteger({ actionType, field: 'end', value: end })
|
||||
|
||||
if (start < MinuteOfDay.MIN || end > MinuteOfDay.MAX || start > end) {
|
||||
throw new Error()
|
||||
throw new InvalidActionParameterException({ actionType, staticMessage: 'start or end out of range' })
|
||||
}
|
||||
|
||||
if (start === MinuteOfDay.MIN && end === MinuteOfDay.MAX) {
|
||||
throw new Error()
|
||||
throw new InvalidActionParameterException({ actionType, staticMessage: 'couting slot can not fill the whole day' })
|
||||
}
|
||||
|
||||
this.start = start
|
||||
@@ -150,19 +148,17 @@ class AddUsedTimeActionItemSessionDurationLimitSlot {
|
||||
readonly pause: number
|
||||
|
||||
constructor ({ start, end, duration, pause }: { start: number, end: number, duration: number, pause: number }) {
|
||||
if (
|
||||
(!Number.isSafeInteger(start)) || (!Number.isSafeInteger(end)) ||
|
||||
(!Number.isSafeInteger(duration)) || (!Number.isSafeInteger(pause))
|
||||
) {
|
||||
throw new Error()
|
||||
}
|
||||
assertSafeInteger({ actionType, field: 'start', value: start })
|
||||
assertSafeInteger({ actionType, field: 'end', value: end })
|
||||
assertSafeInteger({ actionType, field: 'duration', value: duration })
|
||||
assertSafeInteger({ actionType, field: 'pause', value: pause })
|
||||
|
||||
if (start < MinuteOfDay.MIN || end > MinuteOfDay.MAX || start > end) {
|
||||
throw new Error()
|
||||
throw new InvalidActionParameterException({ actionType, staticMessage: 'start or end out of range' })
|
||||
}
|
||||
|
||||
if (duration <= 0 || pause <= 0) {
|
||||
throw new Error()
|
||||
throw new InvalidActionParameterException({ actionType, staticMessage: 'duration and pause must not be zero or smaller' })
|
||||
}
|
||||
|
||||
this.start = start
|
||||
@@ -171,7 +167,7 @@ class AddUsedTimeActionItemSessionDurationLimitSlot {
|
||||
this.pause = pause
|
||||
}
|
||||
|
||||
serialize = () => [ this.start, this.end ]
|
||||
serialize = () => [ this.start, this.end, this.duration, this.pause ]
|
||||
|
||||
static parse = ([ start, end, duration, pause ]: [number, number, number, number]) => new AddUsedTimeActionItemSessionDurationLimitSlot({ start, end, duration, pause })
|
||||
}
|
||||
|
||||
+21
-15
@@ -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,12 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { assertParentPasswordValid, ParentPassword } from '../api/schema'
|
||||
import { assertIdWithinFamily } from '../util/token'
|
||||
import { assertParentPasswordValid, ParentPassword, ParentPasswordValidationException } from '../api/schema'
|
||||
import { ParentAction } from './basetypes'
|
||||
import { InvalidActionParameterException } from './meta/exception'
|
||||
import { assertIdWithinFamily } from './meta/util'
|
||||
|
||||
const actionType = 'AddUserAction'
|
||||
|
||||
export class AddUserAction extends ParentAction {
|
||||
readonly userId: string
|
||||
@@ -35,7 +38,7 @@ export class AddUserAction extends ParentAction {
|
||||
}) {
|
||||
super()
|
||||
|
||||
assertIdWithinFamily(userId)
|
||||
assertIdWithinFamily({ actionType, field: 'userId', value: userId })
|
||||
|
||||
this.userId = userId
|
||||
this.name = name
|
||||
@@ -45,24 +48,27 @@ export class AddUserAction extends ParentAction {
|
||||
|
||||
if (userType === 'parent') {
|
||||
if (!password) {
|
||||
throw new Error('parent users must have got an password')
|
||||
throw new InvalidActionParameterException({
|
||||
actionType,
|
||||
staticMessage: 'parent users must have got an password'
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
if (password) {
|
||||
assertParentPasswordValid(password)
|
||||
try {
|
||||
assertParentPasswordValid(password)
|
||||
} catch (ex) {
|
||||
if (ex instanceof ParentPasswordValidationException) {
|
||||
throw new InvalidActionParameterException({
|
||||
actionType,
|
||||
staticMessage: 'invalid password data'
|
||||
})
|
||||
} else throw ex
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
@@ -16,9 +16,11 @@
|
||||
*/
|
||||
|
||||
import { createDecipheriv, createHash } from 'crypto'
|
||||
import { assertIsHexString } from '../util/hexstring'
|
||||
import { assertIdWithinFamily } from '../util/token'
|
||||
import { ParentAction } from './basetypes'
|
||||
import { InvalidActionParameterException } from './meta/exception'
|
||||
import { assertHexString, assertIdWithinFamily } from './meta/util'
|
||||
|
||||
const actionType = 'ChangeParentPasswordAction'
|
||||
|
||||
export class ChangeParentPasswordAction extends ParentAction {
|
||||
readonly parentUserId: string
|
||||
@@ -36,7 +38,7 @@ export class ChangeParentPasswordAction extends ParentAction {
|
||||
}) {
|
||||
super()
|
||||
|
||||
assertIdWithinFamily(parentUserId)
|
||||
assertIdWithinFamily({ actionType, field: 'parentUserId', value: parentUserId })
|
||||
|
||||
if (
|
||||
(!parentUserId) ||
|
||||
@@ -45,15 +47,25 @@ export class ChangeParentPasswordAction extends ParentAction {
|
||||
(!newPasswordSecondHashEncrypted) ||
|
||||
(!integrity)
|
||||
) {
|
||||
throw new Error('missing required parameter for change parent password')
|
||||
throw new InvalidActionParameterException({
|
||||
actionType,
|
||||
staticMessage: 'missing required parameter for change parent password'
|
||||
})
|
||||
}
|
||||
|
||||
if (integrity.length !== 128) {
|
||||
throw new Error('wrong length of integrity data')
|
||||
throw new InvalidActionParameterException({
|
||||
actionType,
|
||||
staticMessage: 'wrong length of integrity data'
|
||||
})
|
||||
}
|
||||
|
||||
assertIsHexString(newPasswordSecondHashEncrypted)
|
||||
assertIsHexString(integrity)
|
||||
assertHexString({ actionType, field: 'newPasswordSecondHashEncrypted', value: newPasswordSecondHashEncrypted })
|
||||
assertHexString({ actionType, field: 'integrity', value: integrity })
|
||||
|
||||
if (newPasswordSecondHashEncrypted.length <= 70) {
|
||||
throw new InvalidActionParameterException({ actionType, staticMessage: 'wrong length of the new password' })
|
||||
}
|
||||
|
||||
this.parentUserId = parentUserId
|
||||
this.newPasswordFirstHash = newPasswordFirstHash
|
||||
@@ -62,15 +74,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,
|
||||
@@ -91,15 +94,11 @@ export class ChangeParentPasswordAction extends ParentAction {
|
||||
const expected = createHash('sha512').update(integrityData).digest('hex')
|
||||
|
||||
if (expected !== this.integrity) {
|
||||
throw new Error('invalid integrity for change parent password action')
|
||||
throw new InvalidChangeParentPasswordIntegrityException()
|
||||
}
|
||||
}
|
||||
|
||||
decryptSecondHash ({ oldPasswordSecondHash }: {oldPasswordSecondHash: string}) {
|
||||
if (this.newPasswordSecondHashEncrypted.length <= 70) {
|
||||
throw new Error('wrong length of the new password')
|
||||
}
|
||||
|
||||
decryptSecondHash ({ oldPasswordSecondHash }: { oldPasswordSecondHash: string }) {
|
||||
const ivHex = this.newPasswordSecondHashEncrypted.substring(0, 32)
|
||||
const salt = this.newPasswordSecondHashEncrypted.substring(32, 64)
|
||||
const encryptedData = this.newPasswordSecondHashEncrypted.substring(64)
|
||||
@@ -124,3 +123,7 @@ export interface SerializedChangeParentPasswordAction {
|
||||
secondHashEncrypted: string
|
||||
integrity: string
|
||||
}
|
||||
|
||||
export class InvalidChangeParentPasswordIntegrityException extends Error {
|
||||
constructor () { super('invalid integrity for change parent password 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
|
||||
@@ -15,8 +15,11 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { assertParentPasswordValid, ParentPassword } from '../api/schema'
|
||||
import { assertParentPasswordValid, ParentPassword, ParentPasswordValidationException } from '../api/schema'
|
||||
import { ChildAction } from './basetypes'
|
||||
import { InvalidActionParameterException } from './meta/exception'
|
||||
|
||||
const actionType = 'ChildChangePasswordAction'
|
||||
|
||||
export class ChildChangePasswordAction extends ChildAction {
|
||||
readonly password: ParentPassword
|
||||
@@ -26,16 +29,20 @@ export class ChildChangePasswordAction extends ChildAction {
|
||||
}) {
|
||||
super()
|
||||
|
||||
assertParentPasswordValid(password)
|
||||
try {
|
||||
assertParentPasswordValid(password)
|
||||
} catch (ex) {
|
||||
if (ex instanceof ParentPasswordValidationException) {
|
||||
throw new InvalidActionParameterException({
|
||||
actionType,
|
||||
staticMessage: 'invalid password'
|
||||
})
|
||||
} else throw ex
|
||||
}
|
||||
|
||||
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,11 +22,7 @@ export class ChildSignInAction extends ChildAction {
|
||||
super()
|
||||
}
|
||||
|
||||
serialize = (): SerializedChildSignInAction => ({
|
||||
type: 'CHILD_SIGN_IN'
|
||||
})
|
||||
|
||||
static parse = (action: SerializedChildSignInAction) => (
|
||||
static parse = (_: 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
|
||||
@@ -15,8 +15,10 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { assertIdWithinFamily } from '../util/token'
|
||||
import { ParentAction } from './basetypes'
|
||||
import { assertIdWithinFamily } from './meta/util'
|
||||
|
||||
const actionType = 'CreateCategoryAction'
|
||||
|
||||
export class CreateCategoryAction extends ParentAction {
|
||||
readonly categoryId: string
|
||||
@@ -26,21 +28,14 @@ export class CreateCategoryAction extends ParentAction {
|
||||
constructor ({ categoryId, childId, title }: {categoryId: string, childId: string, title: string}) {
|
||||
super()
|
||||
|
||||
assertIdWithinFamily(categoryId)
|
||||
assertIdWithinFamily(childId)
|
||||
assertIdWithinFamily({ actionType, field: 'categoryId', value: categoryId })
|
||||
assertIdWithinFamily({ actionType, field: 'childId', value: childId })
|
||||
|
||||
this.categoryId = categoryId
|
||||
this.childId = childId
|
||||
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
|
||||
@@ -15,8 +15,11 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { SerializedTimeLimitRule, TimelimitRule } from '../model/timelimitrule'
|
||||
import { ParseTimeLimitRuleException, SerializedTimeLimitRule, TimelimitRule } from '../model/timelimitrule'
|
||||
import { ParentAction } from './basetypes'
|
||||
import { InvalidActionParameterException } from './meta/exception'
|
||||
|
||||
const actionType = 'CreateTimeLimitRuleAction'
|
||||
|
||||
export class CreateTimeLimitRuleAction extends ParentAction {
|
||||
rule: TimelimitRule
|
||||
@@ -27,16 +30,21 @@ 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)
|
||||
})
|
||||
)
|
||||
static parse = ({ rule }: SerializedCreateTimelimtRuleAction) => {
|
||||
try {
|
||||
return new CreateTimeLimitRuleAction({
|
||||
rule: TimelimitRule.parse(rule)
|
||||
})
|
||||
} catch (ex) {
|
||||
if (ex instanceof ParseTimeLimitRuleException) {
|
||||
throw new InvalidActionParameterException({
|
||||
actionType,
|
||||
staticMessage: 'invalid time limit rule',
|
||||
dynamicMessage: 'invalid time limit rule: ' + ex.toString()
|
||||
})
|
||||
} else throw ex
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export interface SerializedCreateTimelimtRuleAction {
|
||||
|
||||
@@ -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,25 +15,22 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { assertIdWithinFamily } from '../util/token'
|
||||
import { ParentAction } from './basetypes'
|
||||
import { assertIdWithinFamily } from './meta/util'
|
||||
|
||||
const actionType = 'DeleteCategoryAction'
|
||||
|
||||
export class DeleteCategoryAction extends ParentAction {
|
||||
readonly categoryId: string
|
||||
|
||||
constructor ({ categoryId }: {categoryId: string}) {
|
||||
constructor ({ categoryId }: { categoryId: string }) {
|
||||
super()
|
||||
|
||||
assertIdWithinFamily(categoryId)
|
||||
assertIdWithinFamily({ actionType, field: 'categoryId', value: categoryId })
|
||||
|
||||
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
|
||||
@@ -15,8 +15,10 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { assertIdWithinFamily } from '../util/token'
|
||||
import { ParentAction } from './basetypes'
|
||||
import { assertIdWithinFamily } from './meta/util'
|
||||
|
||||
const actionType = 'DeleteTimeLimitRuleAction'
|
||||
|
||||
export class DeleteTimeLimitRuleAction extends ParentAction {
|
||||
readonly ruleId: string
|
||||
@@ -24,16 +26,11 @@ export class DeleteTimeLimitRuleAction extends ParentAction {
|
||||
constructor ({ ruleId }: {ruleId: string}) {
|
||||
super()
|
||||
|
||||
assertIdWithinFamily(ruleId)
|
||||
assertIdWithinFamily({ actionType, field: 'ruleId', value: ruleId })
|
||||
|
||||
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
|
||||
@@ -16,8 +16,10 @@
|
||||
*/
|
||||
|
||||
import { DeviceHadManipulationFlags } from '../database/device'
|
||||
import { assertIdWithinFamily } from '../util/token'
|
||||
import { ParentAction } from './basetypes'
|
||||
import { assertIdWithinFamily, assertSafeInteger, throwOutOfRange } from './meta/util'
|
||||
|
||||
const actionType = 'IgnoreManipulationAction'
|
||||
|
||||
export class IgnoreManipulationAction extends ParentAction {
|
||||
readonly deviceId: string
|
||||
@@ -51,13 +53,14 @@ export class IgnoreManipulationAction extends ParentAction {
|
||||
}) {
|
||||
super()
|
||||
|
||||
assertIdWithinFamily(deviceId)
|
||||
assertIdWithinFamily({ actionType, field: 'deviceId', value: deviceId })
|
||||
|
||||
assertSafeInteger({ actionType, field: 'ignoreHadManipulationFlags', value: ignoreHadManipulationFlags })
|
||||
|
||||
if (
|
||||
(!Number.isSafeInteger(ignoreHadManipulationFlags)) ||
|
||||
ignoreHadManipulationFlags < 0 || ignoreHadManipulationFlags > DeviceHadManipulationFlags.ALL
|
||||
) {
|
||||
throw new Error('invalid ignoreHadManipulationFlags')
|
||||
throwOutOfRange({ actionType, field: 'ignoreHadManipulationFlags', value: ignoreHadManipulationFlags })
|
||||
}
|
||||
|
||||
this.deviceId = deviceId
|
||||
@@ -73,20 +76,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,
|
||||
|
||||
@@ -15,8 +15,10 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { assertIdWithinFamily } from '../util/token'
|
||||
import { ParentAction } from './basetypes'
|
||||
import { assertIdWithinFamily, assertSafeInteger, throwOutOfRange } from './meta/util'
|
||||
|
||||
const actionType = 'IncrementCategoryExtraTimeAction'
|
||||
|
||||
export class IncrementCategoryExtraTimeAction extends ParentAction {
|
||||
readonly categoryId: string
|
||||
@@ -26,14 +28,18 @@ export class IncrementCategoryExtraTimeAction extends ParentAction {
|
||||
constructor ({ categoryId, addedExtraTime, day }: {categoryId: string, addedExtraTime: number, day: number}) {
|
||||
super()
|
||||
|
||||
assertIdWithinFamily(categoryId)
|
||||
assertIdWithinFamily({ actionType, field: 'categoryId', value: categoryId })
|
||||
|
||||
if (addedExtraTime <= 0 || (!Number.isSafeInteger(addedExtraTime))) {
|
||||
throw new Error('must add some extra time with IncrementCategoryExtraTimeAction')
|
||||
assertSafeInteger({ actionType, field: 'addedExtraTime', value: addedExtraTime })
|
||||
|
||||
if (addedExtraTime < 0) {
|
||||
throwOutOfRange({ actionType, field: 'addedExtraTime', value: addedExtraTime })
|
||||
}
|
||||
|
||||
if (day < -1 || (!Number.isSafeInteger(day))) {
|
||||
throw Error('day must be valid')
|
||||
assertSafeInteger({ actionType, field: 'day', value: day })
|
||||
|
||||
if (day < -1) {
|
||||
throwOutOfRange({ actionType, field: 'day', value: day })
|
||||
}
|
||||
|
||||
this.categoryId = categoryId
|
||||
@@ -41,13 +47,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 })
|
||||
)
|
||||
|
||||
@@ -58,6 +58,7 @@ export { UpdateAppActivitiesAction } from './updateappactivities'
|
||||
export { UpdateCategoryBatteryLimitAction } from './updatecategorybatterylimit'
|
||||
export { UpdateCategoryBlockAllNotificationsAction } from './updatecategoryblockallnotifications'
|
||||
export { UpdateCategoryBlockedTimesAction } from './updatecategoryblockedtimes'
|
||||
export { UpdateCategoryDisableLimitsAction } from './updatecategorydisablelimits'
|
||||
export { UpdateCategorySortingAction } from './updatecategorysorting'
|
||||
export { UpdateCategoryTemporarilyBlockedAction } from './updatecategorytemporarilyblocked'
|
||||
export { UpdateCategoryTimeWarningsAction } from './updatecategorytimewarnings'
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* server component for the TimeLimit App
|
||||
* 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
|
||||
* 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 { StaticMessageException } from '../../exception'
|
||||
|
||||
export class InvalidActionParameterException extends StaticMessageException {
|
||||
constructor ({ actionType, staticMessage, dynamicMessage }: {
|
||||
actionType: string
|
||||
staticMessage: string
|
||||
dynamicMessage?: string
|
||||
}) {
|
||||
super({
|
||||
staticMessage: 'invalid action paramters:' + actionType + ':' + staticMessage,
|
||||
dynamicMessage: dynamicMessage ? 'invalid action paramters:' + actionType + ':' + dynamicMessage : undefined
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export class UnknownActionTypeException extends InvalidActionParameterException {
|
||||
constructor ({ group }: { group: string }) {
|
||||
super({
|
||||
actionType: group,
|
||||
staticMessage: 'unknown action type'
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
/*
|
||||
* server component for the TimeLimit App
|
||||
* 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
|
||||
* 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 { checkIfHexString } from '../../util/hexstring'
|
||||
import { hasDuplicates } from '../../util/list'
|
||||
import { isIdWithinFamily } from '../../util/token'
|
||||
import { InvalidActionParameterException } from './exception'
|
||||
|
||||
export const assertIdWithinFamily = ({ value, actionType, field }: {
|
||||
value: string
|
||||
actionType: string
|
||||
field: string
|
||||
}) => {
|
||||
if (!isIdWithinFamily(value)) {
|
||||
throw new InvalidActionParameterException({
|
||||
actionType,
|
||||
staticMessage: 'invalid id within family for ' + field,
|
||||
dynamicMessage: 'invalid id within family for ' + field + ': ' + value
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export const assertHexString = ({ value, actionType, field }: {
|
||||
value: string
|
||||
actionType: string
|
||||
field: string
|
||||
}) => {
|
||||
if (!checkIfHexString(value)) {
|
||||
throw new InvalidActionParameterException({
|
||||
actionType,
|
||||
staticMessage: 'invalid hex string for ' + field,
|
||||
dynamicMessage: 'invalid hex string for ' + field + ': ' + value
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export const assertSafeInteger = ({ value, actionType, field }: {
|
||||
value: number
|
||||
actionType: string
|
||||
field: string
|
||||
}) => {
|
||||
if (!Number.isSafeInteger(value)) {
|
||||
throw new InvalidActionParameterException({
|
||||
actionType,
|
||||
staticMessage: 'require number for ' + field,
|
||||
dynamicMessage: 'require number for ' + field + ': ' + value
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export const throwOutOfRange = ({ value, actionType, field }: {
|
||||
value: number
|
||||
actionType: string
|
||||
field: string
|
||||
}) => {
|
||||
throw new InvalidActionParameterException({
|
||||
actionType,
|
||||
staticMessage: field + ' out of range',
|
||||
dynamicMessage: field + ' out of range: ' + value
|
||||
})
|
||||
}
|
||||
|
||||
export function assertNonEmptyListWithoutDuplicates ({ list, actionType, field }: {
|
||||
list: Array<string>
|
||||
actionType: string
|
||||
field: string
|
||||
}) {
|
||||
assertListWithoutDuplicates({ list, actionType, field })
|
||||
|
||||
if (hasDuplicates(list)) {
|
||||
throw new InvalidActionParameterException({
|
||||
actionType,
|
||||
staticMessage: 'empty list for ' + field
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export function assertListWithoutDuplicates ({ list, actionType, field }: {
|
||||
list: Array<string>
|
||||
actionType: string
|
||||
field: string
|
||||
}) {
|
||||
if (hasDuplicates(list)) {
|
||||
throw new InvalidActionParameterException({
|
||||
actionType,
|
||||
staticMessage: 'list has duplicates for ' + field,
|
||||
dynamicMessage: 'list has duplicates for ' + field + ': ' + list.join(';')
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -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,10 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { assertNonEmptyListWithoutDuplicates } from '../util/list'
|
||||
import { assertIdWithinFamily } from '../util/token'
|
||||
import { ParentAction } from './basetypes'
|
||||
import { assertIdWithinFamily, assertNonEmptyListWithoutDuplicates } from './meta/util'
|
||||
|
||||
const actionType = 'RemoveCategoryAppsAction'
|
||||
|
||||
export class RemoveCategoryAppsAction extends ParentAction {
|
||||
readonly categoryId: string
|
||||
@@ -26,19 +27,13 @@ export class RemoveCategoryAppsAction extends ParentAction {
|
||||
constructor ({ categoryId, packageNames }: {categoryId: string, packageNames: Array<string>}) {
|
||||
super()
|
||||
|
||||
assertIdWithinFamily(categoryId)
|
||||
assertNonEmptyListWithoutDuplicates(packageNames)
|
||||
assertIdWithinFamily({ actionType, field: 'categoryId', value: categoryId })
|
||||
assertNonEmptyListWithoutDuplicates({ actionType, field: 'packageNames', list: packageNames })
|
||||
|
||||
this.categoryId = categoryId
|
||||
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
|
||||
@@ -15,8 +15,10 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { assertNonEmptyListWithoutDuplicates } from '../util/list'
|
||||
import { AppLogicAction } from './basetypes'
|
||||
import { assertNonEmptyListWithoutDuplicates } from './meta/util'
|
||||
|
||||
const actionType = 'RemoveInstalledAppsAction'
|
||||
|
||||
export class RemoveInstalledAppsAction extends AppLogicAction {
|
||||
readonly packageNames: Array<string>
|
||||
@@ -24,16 +26,11 @@ export class RemoveInstalledAppsAction extends AppLogicAction {
|
||||
constructor ({ packageNames }: {packageNames: Array<string>}) {
|
||||
super()
|
||||
|
||||
assertNonEmptyListWithoutDuplicates(packageNames)
|
||||
assertNonEmptyListWithoutDuplicates({ actionType, field: 'packageNames', list: packageNames })
|
||||
|
||||
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
|
||||
@@ -15,8 +15,10 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { assertIdWithinFamily } from '../util/token'
|
||||
import { ParentAction } from './basetypes'
|
||||
import { assertIdWithinFamily } from './meta/util'
|
||||
|
||||
const actionType = 'RemoveUserAction'
|
||||
|
||||
export class RemoveUserAction extends ParentAction {
|
||||
readonly userId: string
|
||||
@@ -31,18 +33,12 @@ export class RemoveUserAction extends ParentAction {
|
||||
}) {
|
||||
super()
|
||||
|
||||
assertIdWithinFamily(userId)
|
||||
assertIdWithinFamily({ actionType, field: 'userId', value: userId })
|
||||
|
||||
this.userId = userId
|
||||
this.authentication = authentication
|
||||
}
|
||||
|
||||
serialize = (): SerializedRemoveUserAction => ({
|
||||
type: 'REMOVE_USER',
|
||||
userId: this.userId,
|
||||
authentication: this.authentication
|
||||
})
|
||||
|
||||
static parse = ({ userId, authentication }: SerializedRemoveUserAction) => (
|
||||
new RemoveUserAction({ userId, authentication })
|
||||
)
|
||||
|
||||
+10
-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
|
||||
@@ -15,8 +15,11 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { assertIdWithinFamily } from '../util/token'
|
||||
import { ParentAction } from './basetypes'
|
||||
import { InvalidActionParameterException } from './meta/exception'
|
||||
import { assertIdWithinFamily } from './meta/util'
|
||||
|
||||
const actionType = 'RenameChildAction'
|
||||
|
||||
export class RenameChildAction extends ParentAction {
|
||||
readonly childId: string
|
||||
@@ -28,22 +31,19 @@ export class RenameChildAction extends ParentAction {
|
||||
}) {
|
||||
super()
|
||||
|
||||
assertIdWithinFamily(childId)
|
||||
assertIdWithinFamily({ actionType, field: 'childId', value: childId })
|
||||
|
||||
if (newName === '') {
|
||||
throw new Error('new name must not be empty')
|
||||
throw new InvalidActionParameterException({
|
||||
actionType,
|
||||
staticMessage: 'new name must not be empty'
|
||||
})
|
||||
}
|
||||
|
||||
this.childId = childId
|
||||
this.newName = newName
|
||||
}
|
||||
|
||||
serialize = (): SerializedRenameChildAction => ({
|
||||
type: 'RENAME_CHILD',
|
||||
childId: this.childId,
|
||||
newName: this.newName
|
||||
})
|
||||
|
||||
static parse = ({ childId, newName }: SerializedRenameChildAction) => (
|
||||
new RenameChildAction({ childId, newName })
|
||||
)
|
||||
|
||||
@@ -15,8 +15,10 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { assertIdWithinFamily } from '../util/token'
|
||||
import { ParentAction } from './basetypes'
|
||||
import { assertIdWithinFamily } from './meta/util'
|
||||
|
||||
const actionType = 'ResetCategoryNetworkIdsAction'
|
||||
|
||||
export class ResetCategoryNetworkIdsAction extends ParentAction {
|
||||
readonly categoryId: string
|
||||
@@ -26,16 +28,11 @@ export class ResetCategoryNetworkIdsAction extends ParentAction {
|
||||
}) {
|
||||
super()
|
||||
|
||||
assertIdWithinFamily(categoryId)
|
||||
assertIdWithinFamily({ actionType, field: 'categoryId', value: categoryId })
|
||||
|
||||
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
|
||||
@@ -15,8 +15,10 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { assertIdWithinFamily } from '../util/token'
|
||||
import { ParentAction } from './basetypes'
|
||||
import { assertIdWithinFamily } from './meta/util'
|
||||
|
||||
const actionType = 'ResetParentBlockedTimesAction'
|
||||
|
||||
export class ResetParentBlockedTimesAction extends ParentAction {
|
||||
readonly parentId: string
|
||||
@@ -26,16 +28,11 @@ export class ResetParentBlockedTimesAction extends ParentAction {
|
||||
}) {
|
||||
super()
|
||||
|
||||
assertIdWithinFamily(parentId)
|
||||
assertIdWithinFamily({ actionType, field: 'parentId', value: parentId })
|
||||
|
||||
this.parentId = parentId
|
||||
}
|
||||
|
||||
serialize = (): SerializedResetParentBlockedTimesAction => ({
|
||||
type: 'RESET_PARENT_BLOCKED_TIMES',
|
||||
parentId: this.parentId
|
||||
})
|
||||
|
||||
static parse = ({ parentId }: SerializedResetParentBlockedTimesAction) => (
|
||||
new ResetParentBlockedTimesAction({
|
||||
parentId
|
||||
|
||||
@@ -20,6 +20,7 @@ import { AddUsedTimeAction, SerializedAddUsedTimeAction } from '../addusedtime'
|
||||
import { AddUsedTimeActionVersion2, SerializedAddUsedTimeActionVersion2 } from '../addusedtime2'
|
||||
import { AppLogicAction } from '../basetypes'
|
||||
import { ForceSyncAction, SerializedForceSyncAction } from '../forcesync'
|
||||
import { UnknownActionTypeException } from '../meta/exception'
|
||||
import { RemoveInstalledAppsAction, SerializedRemoveInstalledAppsAction } from '../removeinstalledapps'
|
||||
import { SerializedSignOutAtDeviceAction, SignOutAtDeviceAction } from '../signoutatdevice'
|
||||
import { SerialiezdTriedDisablingDeviceAdminAction, TriedDisablingDeviceAdminAction } from '../trieddisablingdeviceadmin'
|
||||
@@ -57,6 +58,6 @@ export const parseAppLogicAction = (serialized: SerializedAppLogicAction): AppLo
|
||||
} else if (serialized.type === 'UPDATE_DEVICE_STATUS') {
|
||||
return UpdateDeviceStatusAction.parse(serialized)
|
||||
} else {
|
||||
throw new Error('illegal state: unsupported type at parseAppLogicAction')
|
||||
throw new UnknownActionTypeException({ group: 'app logic' })
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
@@ -17,6 +17,7 @@
|
||||
|
||||
import { ChildChangePasswordAction, SerializedChildChangePasswordAction } from '../childchangepassword'
|
||||
import { ChildSignInAction, SerializedChildSignInAction } from '../childsignin'
|
||||
import { UnknownActionTypeException } from '../meta/exception'
|
||||
|
||||
export type SerializedChildAction = SerializedChildChangePasswordAction | SerializedChildSignInAction
|
||||
|
||||
@@ -26,6 +27,6 @@ export const parseChildAction = (serialized: SerializedChildAction) => {
|
||||
} else if (serialized.type === 'CHILD_SIGN_IN') {
|
||||
return ChildSignInAction.parse(serialized)
|
||||
} else {
|
||||
throw new Error('illegal state: unsupported type at parseChildAction')
|
||||
throw new UnknownActionTypeException({ group: 'child' })
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ import { DeleteCategoryAction, SerializedDeleteCategoryAction } from '../deletec
|
||||
import { DeleteTimeLimitRuleAction, SerializedDeleteTimeLimitRuleAction } from '../deletetimelimitrule'
|
||||
import { IgnoreManipulationAction, SerializedIgnoreManipulationAction } from '../ignoremanipulation'
|
||||
import { IncrementCategoryExtraTimeAction, SerializedIncrementCategoryExtraTimeAction } from '../incrementcategoryextratime'
|
||||
import { UnknownActionTypeException } from '../meta/exception'
|
||||
import { RemoveCategoryAppsAction, SerializedRemoveCategoryAppsAction } from '../removecategoryapps'
|
||||
import { RemoveUserAction, SerializedRemoveUserAction } from '../removeuser'
|
||||
import { RenameChildAction, SerializedRenameChildAction } from '../renamechild'
|
||||
@@ -47,6 +48,7 @@ import { SerializedSetUserTimezoneAction, SetUserTimezoneAction } from '../setus
|
||||
import { SerializedUpdateCategoryBatteryLimitAction, UpdateCategoryBatteryLimitAction } from '../updatecategorybatterylimit'
|
||||
import { SerializedUpdateCategoryBlockAllNotificationsAction, UpdateCategoryBlockAllNotificationsAction } from '../updatecategoryblockallnotifications'
|
||||
import { SerializedUpdateCategoryBlockedTimesAction, UpdateCategoryBlockedTimesAction } from '../updatecategoryblockedtimes'
|
||||
import { SerializedUpdatCategoryDisableLimitsAction, UpdateCategoryDisableLimitsAction } from '../updatecategorydisablelimits'
|
||||
import { SerializedUpdateCategorySortingAction, UpdateCategorySortingAction } from '../updatecategorysorting'
|
||||
import { SerializedUpdateCategoryTemporarilyBlockedAction, UpdateCategoryTemporarilyBlockedAction } from '../updatecategorytemporarilyblocked'
|
||||
import { SerializedUpdateCategoryTimeWarningsAction, UpdateCategoryTimeWarningsAction } from '../updatecategorytimewarnings'
|
||||
@@ -92,6 +94,7 @@ export type SerializedParentAction =
|
||||
SerializedUpdateCategoryBatteryLimitAction |
|
||||
SerializedUpdateCategoryBlockAllNotificationsAction |
|
||||
SerializedUpdateCategoryBlockedTimesAction |
|
||||
SerializedUpdatCategoryDisableLimitsAction |
|
||||
SerializedUpdateCategorySortingAction |
|
||||
SerializedUpdateCategoryTemporarilyBlockedAction |
|
||||
SerializedUpdateCategoryTimeWarningsAction |
|
||||
@@ -168,6 +171,8 @@ export const parseParentAction = (action: SerializedParentAction): ParentAction
|
||||
return UpdateCategoryBlockAllNotificationsAction.parse(action)
|
||||
} else if (action.type === 'UPDATE_CATEGORY_BLOCKED_TIMES') {
|
||||
return UpdateCategoryBlockedTimesAction.parse(action)
|
||||
} else if (action.type === 'UPDATE_CATEGORY_DISABLE_LIMITS') {
|
||||
return UpdateCategoryDisableLimitsAction.parse(action)
|
||||
} else if (action.type === 'UPDATE_CATEGORY_SORTING') {
|
||||
return UpdateCategorySortingAction.parse(action)
|
||||
} else if (action.type === 'UPDATE_CATEGORY_TIME_WARNINGS') {
|
||||
@@ -193,6 +198,6 @@ export const parseParentAction = (action: SerializedParentAction): ParentAction
|
||||
} else if (action.type === 'UPDATE_USER_LIMIT_LOGIN_CATEGORY') {
|
||||
return UpdateUserLimitLoginCategory.parse(action)
|
||||
} else {
|
||||
throw new Error('illegal state: invalid type for action at parseParentAction')
|
||||
throw new UnknownActionTypeException({ group: 'parent' })
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,8 +15,10 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { assertIdWithinFamily } from '../util/token'
|
||||
import { ParentAction } from './basetypes'
|
||||
import { assertIdWithinFamily, assertSafeInteger, throwOutOfRange } from './meta/util'
|
||||
|
||||
const actionType = 'SetCategoryExtraTimeAction'
|
||||
|
||||
export class SetCategoryExtraTimeAction extends ParentAction {
|
||||
readonly categoryId: string
|
||||
@@ -26,14 +28,18 @@ export class SetCategoryExtraTimeAction extends ParentAction {
|
||||
constructor ({ categoryId, newExtraTime, day }: {categoryId: string, newExtraTime: number, day: number}) {
|
||||
super()
|
||||
|
||||
assertIdWithinFamily(categoryId)
|
||||
assertIdWithinFamily({ actionType, field: 'categoryId', value: categoryId })
|
||||
|
||||
if (newExtraTime < 0 || (!Number.isSafeInteger(newExtraTime))) {
|
||||
throw Error('newExtraTime must be >= 0')
|
||||
assertSafeInteger({ actionType, field: 'newExtraTime', value: newExtraTime })
|
||||
|
||||
if (newExtraTime < 0) {
|
||||
throwOutOfRange({ actionType, field: 'newExtraTime', value: newExtraTime })
|
||||
}
|
||||
|
||||
if (day < -1 || (!Number.isSafeInteger(day))) {
|
||||
throw Error('day must be valid')
|
||||
assertSafeInteger({ actionType, field: 'day', value: day })
|
||||
|
||||
if (day < -1) {
|
||||
throwOutOfRange({ actionType, field: 'day', value: day })
|
||||
}
|
||||
|
||||
this.categoryId = categoryId
|
||||
@@ -41,13 +47,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
|
||||
@@ -15,8 +15,10 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { assertIdWithinFamily } from '../util/token'
|
||||
import { ParentAction } from './basetypes'
|
||||
import { assertIdWithinFamily } from './meta/util'
|
||||
|
||||
const actionType = 'SetCategoryForUnassignedAppsAction'
|
||||
|
||||
export class SetCategoryForUnassignedAppsAction extends ParentAction {
|
||||
readonly childId: string
|
||||
@@ -28,22 +30,16 @@ export class SetCategoryForUnassignedAppsAction extends ParentAction {
|
||||
}) {
|
||||
super()
|
||||
|
||||
assertIdWithinFamily(childId)
|
||||
assertIdWithinFamily({ actionType, field: 'childId', value: childId })
|
||||
|
||||
if (categoryId !== '') {
|
||||
assertIdWithinFamily(categoryId)
|
||||
assertIdWithinFamily({ actionType, field: 'categoryId', value: categoryId })
|
||||
}
|
||||
|
||||
this.childId = childId
|
||||
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
|
||||
@@ -15,9 +15,12 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { assertParentPasswordValid, ParentPassword } from '../api/schema'
|
||||
import { assertIdWithinFamily } from '../util/token'
|
||||
import { assertParentPasswordValid, ParentPassword, ParentPasswordValidationException } from '../api/schema'
|
||||
import { ParentAction } from './basetypes'
|
||||
import { InvalidActionParameterException } from './meta/exception'
|
||||
import { assertIdWithinFamily } from './meta/util'
|
||||
|
||||
const actionType = 'SetChildPasswordAction'
|
||||
|
||||
export class SetChildPasswordAction extends ParentAction {
|
||||
readonly childUserId: string
|
||||
@@ -29,19 +32,23 @@ export class SetChildPasswordAction extends ParentAction {
|
||||
}) {
|
||||
super()
|
||||
|
||||
assertIdWithinFamily(childUserId)
|
||||
assertParentPasswordValid(newPassword)
|
||||
assertIdWithinFamily({ actionType, field: 'childUserId', value: childUserId })
|
||||
|
||||
try {
|
||||
assertParentPasswordValid(newPassword)
|
||||
} catch (ex) {
|
||||
if (ex instanceof ParentPasswordValidationException) {
|
||||
throw new InvalidActionParameterException({
|
||||
actionType,
|
||||
staticMessage: 'invalid parent password'
|
||||
})
|
||||
} else throw ex
|
||||
}
|
||||
|
||||
this.childUserId = childUserId
|
||||
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
|
||||
@@ -15,8 +15,10 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { assertIdWithinFamily } from '../util/token'
|
||||
import { ParentAction } from './basetypes'
|
||||
import { assertIdWithinFamily } from './meta/util'
|
||||
|
||||
const actionType = 'SetConsiderRebootManipulationAction'
|
||||
|
||||
export class SetConsiderRebootManipulationAction extends ParentAction {
|
||||
readonly deviceId: string
|
||||
@@ -25,18 +27,12 @@ export class SetConsiderRebootManipulationAction extends ParentAction {
|
||||
constructor ({ deviceId, enable }: {deviceId: string, enable: boolean}) {
|
||||
super()
|
||||
|
||||
assertIdWithinFamily(deviceId)
|
||||
assertIdWithinFamily({ actionType, field: 'deviceId', value: deviceId })
|
||||
|
||||
this.deviceId = deviceId
|
||||
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
|
||||
@@ -15,8 +15,10 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { assertIdWithinFamily } from '../util/token'
|
||||
import { ParentAction } from './basetypes'
|
||||
import { assertIdWithinFamily } from './meta/util'
|
||||
|
||||
const actionType = 'SetDeviceDefaultUserAction'
|
||||
|
||||
export class SetDeviceDefaultUserAction extends ParentAction {
|
||||
readonly deviceId: string
|
||||
@@ -28,22 +30,16 @@ export class SetDeviceDefaultUserAction extends ParentAction {
|
||||
}) {
|
||||
super()
|
||||
|
||||
assertIdWithinFamily(deviceId)
|
||||
assertIdWithinFamily({ actionType, field: 'deviceId', value: deviceId })
|
||||
|
||||
if (defaultUserId !== '') {
|
||||
assertIdWithinFamily(defaultUserId)
|
||||
assertIdWithinFamily({ actionType, field: 'defaultUserId', value: defaultUserId })
|
||||
}
|
||||
|
||||
this.deviceId = deviceId
|
||||
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
|
||||
@@ -15,8 +15,11 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { assertIdWithinFamily } from '../util/token'
|
||||
import { ParentAction } from './basetypes'
|
||||
import { InvalidActionParameterException } from './meta/exception'
|
||||
import { assertIdWithinFamily, assertSafeInteger } from './meta/util'
|
||||
|
||||
const actionType = 'SetDeviceDefaultUserTimeoutAction'
|
||||
|
||||
export class SetDeviceDefaultUserTimeoutAction extends ParentAction {
|
||||
readonly deviceId: string
|
||||
@@ -28,22 +31,21 @@ export class SetDeviceDefaultUserTimeoutAction extends ParentAction {
|
||||
}) {
|
||||
super()
|
||||
|
||||
assertIdWithinFamily(deviceId)
|
||||
assertIdWithinFamily({ actionType, field: 'deviceId', value: deviceId })
|
||||
assertSafeInteger({ actionType, field: 'timeout', value: timeout })
|
||||
|
||||
if ((!Number.isInteger(timeout)) || (timeout < 0)) {
|
||||
throw new Error('timeout must be a non-negative integer')
|
||||
if (timeout < 0) {
|
||||
throw new InvalidActionParameterException({
|
||||
actionType,
|
||||
staticMessage: 'timeout must be a non-negative integer',
|
||||
dynamicMessage: 'timeout must be a non-negative integer, was ' + timeout
|
||||
})
|
||||
}
|
||||
|
||||
this.deviceId = deviceId
|
||||
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
|
||||
@@ -15,8 +15,10 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { assertIdWithinFamily } from '../util/token'
|
||||
import { ParentAction } from './basetypes'
|
||||
import { assertIdWithinFamily } from './meta/util'
|
||||
|
||||
const actionType = 'SetDeviceUserAction'
|
||||
|
||||
export class SetDeviceUserAction extends ParentAction {
|
||||
readonly deviceId: string
|
||||
@@ -28,22 +30,16 @@ export class SetDeviceUserAction extends ParentAction {
|
||||
}) {
|
||||
super()
|
||||
|
||||
assertIdWithinFamily(deviceId)
|
||||
assertIdWithinFamily({ actionType, field: 'deviceId', value: deviceId })
|
||||
|
||||
if (userId !== '') {
|
||||
assertIdWithinFamily(userId)
|
||||
assertIdWithinFamily({ actionType, field: 'userId', value: userId })
|
||||
}
|
||||
|
||||
this.deviceId = deviceId
|
||||
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
|
||||
@@ -15,8 +15,10 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { assertIdWithinFamily } from '../util/token'
|
||||
import { ParentAction } from './basetypes'
|
||||
import { assertIdWithinFamily } from './meta/util'
|
||||
|
||||
const actionType = 'SetKeepSignedInAction'
|
||||
|
||||
export class SetKeepSignedInAction extends ParentAction {
|
||||
readonly deviceId: string
|
||||
@@ -28,18 +30,12 @@ export class SetKeepSignedInAction extends ParentAction {
|
||||
}) {
|
||||
super()
|
||||
|
||||
assertIdWithinFamily(deviceId)
|
||||
assertIdWithinFamily({ actionType, field: 'deviceId', value: deviceId })
|
||||
|
||||
this.deviceId = deviceId
|
||||
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
|
||||
@@ -15,8 +15,10 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { assertIdWithinFamily } from '../util/token'
|
||||
import { ParentAction } from './basetypes'
|
||||
import { assertIdWithinFamily } from './meta/util'
|
||||
|
||||
const actionType = 'SetParentCategoryAction'
|
||||
|
||||
export class SetParentCategoryAction extends ParentAction {
|
||||
readonly categoryId: string
|
||||
@@ -28,22 +30,16 @@ export class SetParentCategoryAction extends ParentAction {
|
||||
}) {
|
||||
super()
|
||||
|
||||
assertIdWithinFamily(categoryId)
|
||||
assertIdWithinFamily({ actionType, field: 'categoryId', value: categoryId })
|
||||
|
||||
if (parentCategory !== '') {
|
||||
assertIdWithinFamily(parentCategory)
|
||||
assertIdWithinFamily({ actionType, field: 'parentCategory', value: parentCategory })
|
||||
}
|
||||
|
||||
this.categoryId = categoryId
|
||||
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
|
||||
@@ -15,8 +15,10 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { assertIdWithinFamily } from '../util/token'
|
||||
import { ParentAction } from './basetypes'
|
||||
import { assertIdWithinFamily } from './meta/util'
|
||||
|
||||
const actionType = 'SetRelaxPrimaryDeviceAction'
|
||||
|
||||
export class SetRelaxPrimaryDeviceAction extends ParentAction {
|
||||
readonly userId: string
|
||||
@@ -28,18 +30,12 @@ export class SetRelaxPrimaryDeviceAction extends ParentAction {
|
||||
}) {
|
||||
super()
|
||||
|
||||
assertIdWithinFamily(userId)
|
||||
assertIdWithinFamily({ actionType, field: 'userId', value: userId })
|
||||
|
||||
this.userId = userId
|
||||
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
|
||||
@@ -15,8 +15,10 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { assertIdWithinFamily } from '../util/token'
|
||||
import { ParentAction } from './basetypes'
|
||||
import { assertIdWithinFamily } from './meta/util'
|
||||
|
||||
const actionType = 'SetSendDeviceConnected'
|
||||
|
||||
export class SetSendDeviceConnected extends ParentAction {
|
||||
readonly deviceId: string
|
||||
@@ -28,18 +30,12 @@ export class SetSendDeviceConnected extends ParentAction {
|
||||
}) {
|
||||
super()
|
||||
|
||||
assertIdWithinFamily(deviceId)
|
||||
assertIdWithinFamily({ actionType, field: 'deviceId', value: deviceId })
|
||||
|
||||
this.deviceId = deviceId
|
||||
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
|
||||
@@ -15,8 +15,11 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { assertIdWithinFamily } from '../util/token'
|
||||
import { ParentAction } from './basetypes'
|
||||
import { InvalidActionParameterException } from './meta/exception'
|
||||
import { assertIdWithinFamily, assertSafeInteger } from './meta/util'
|
||||
|
||||
const actionType = 'SetUserDisableLimitsUntilAction'
|
||||
|
||||
export class SetUserDisableLimitsUntilAction extends ParentAction {
|
||||
readonly childId: string
|
||||
@@ -28,22 +31,21 @@ export class SetUserDisableLimitsUntilAction extends ParentAction {
|
||||
}) {
|
||||
super()
|
||||
|
||||
assertIdWithinFamily(childId)
|
||||
assertIdWithinFamily({ actionType, field: 'childId', value: childId })
|
||||
assertSafeInteger({ actionType, field: 'timestamp', value: timestamp })
|
||||
|
||||
if (timestamp < 0 || (!Number.isSafeInteger(timestamp))) {
|
||||
throw new Error('timestamp for set user disabe limits until must be >= 0')
|
||||
if (timestamp < 0) {
|
||||
throw new InvalidActionParameterException({
|
||||
actionType,
|
||||
staticMessage: 'timestamp for set user disabe limits until must be >= 0',
|
||||
dynamicMessage: 'timestamp for set user disabe limits until must be >= 0, but was ' + timestamp
|
||||
})
|
||||
}
|
||||
|
||||
this.childId = childId
|
||||
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
|
||||
@@ -15,8 +15,10 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { assertIdWithinFamily } from '../util/token'
|
||||
import { ParentAction } from './basetypes'
|
||||
import { assertIdWithinFamily } from './meta/util'
|
||||
|
||||
const actionType = 'SetUserTimezoneAction'
|
||||
|
||||
export class SetUserTimezoneAction extends ParentAction {
|
||||
readonly userId: string
|
||||
@@ -28,18 +30,12 @@ export class SetUserTimezoneAction extends ParentAction {
|
||||
}) {
|
||||
super()
|
||||
|
||||
assertIdWithinFamily(userId)
|
||||
assertIdWithinFamily({ actionType, field: 'userId', value: userId })
|
||||
|
||||
this.userId = userId
|
||||
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,11 +24,7 @@ export class SignOutAtDeviceAction extends AppLogicAction {
|
||||
super()
|
||||
}
|
||||
|
||||
serialize = (): SerializedSignOutAtDeviceAction => ({
|
||||
type: 'SIGN_OUT_AT_DEVICE'
|
||||
})
|
||||
|
||||
static parse = (action: SerializedSignOutAtDeviceAction) => SignOutAtDeviceAction.instance
|
||||
static parse = (_: SerializedSignOutAtDeviceAction) => SignOutAtDeviceAction.instance
|
||||
}
|
||||
|
||||
export interface SerializedSignOutAtDeviceAction {
|
||||
|
||||
@@ -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
|
||||
@@ -15,9 +15,14 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { AppActivityItem, RemovedAppActivityItem, SerializedAppActivityItem, SerializedRemovedAppActivityItem } from '../model/appactivity'
|
||||
import { assertListWithoutDuplicates } from '../util/list'
|
||||
import {
|
||||
AppActivityItem, IncompleteAppActivityItemException, RemovedAppActivityItem, SerializedAppActivityItem, SerializedRemovedAppActivityItem
|
||||
} from '../model/appactivity'
|
||||
import { AppLogicAction } from './basetypes'
|
||||
import { InvalidActionParameterException } from './meta/exception'
|
||||
import { assertListWithoutDuplicates } from './meta/util'
|
||||
|
||||
const actionType = 'UpdateAppActivitiesAction'
|
||||
|
||||
export class UpdateAppActivitiesAction extends AppLogicAction {
|
||||
readonly removed: Array<RemovedAppActivityItem>
|
||||
@@ -29,29 +34,44 @@ export class UpdateAppActivitiesAction extends AppLogicAction {
|
||||
}) {
|
||||
super()
|
||||
|
||||
assertListWithoutDuplicates(removed.map((item) => item.packageName + ':' + item.activityName))
|
||||
assertListWithoutDuplicates(updatedOrAdded.map((item) => item.packageName + ':' + item.activityName))
|
||||
assertListWithoutDuplicates({
|
||||
actionType,
|
||||
field: 'removed',
|
||||
list: removed.map((item) => item.packageName + ':' + item.activityName)
|
||||
})
|
||||
|
||||
assertListWithoutDuplicates({
|
||||
actionType,
|
||||
field: 'updatedOrAdded',
|
||||
list: updatedOrAdded.map((item) => item.packageName + ':' + item.activityName)
|
||||
})
|
||||
|
||||
if (removed.length === 0 && updatedOrAdded.length === 0) {
|
||||
throw new Error('UpdateAppActivitiesAction is empty')
|
||||
throw new InvalidActionParameterException({
|
||||
actionType,
|
||||
staticMessage: 'UpdateAppActivitiesAction is empty'
|
||||
})
|
||||
}
|
||||
|
||||
this.removed = removed
|
||||
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)),
|
||||
updatedOrAdded: updatedOrAdded.map((item) => AppActivityItem.parse(item))
|
||||
})
|
||||
)
|
||||
static parse = ({ removed, updatedOrAdded }: SerializedUpdateAppActivitiesAction) => {
|
||||
try {
|
||||
return new UpdateAppActivitiesAction({
|
||||
removed: removed.map((item) => RemovedAppActivityItem.parse(item)),
|
||||
updatedOrAdded: updatedOrAdded.map((item) => AppActivityItem.parse(item))
|
||||
})
|
||||
} catch (ex) {
|
||||
if (ex instanceof IncompleteAppActivityItemException) {
|
||||
throw new InvalidActionParameterException({
|
||||
actionType,
|
||||
staticMessage: 'invalid app activity item'
|
||||
})
|
||||
} else throw ex
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export interface SerializedUpdateAppActivitiesAction {
|
||||
|
||||
@@ -15,8 +15,10 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { assertIdWithinFamily } from '../util/token'
|
||||
import { ParentAction } from './basetypes'
|
||||
import { assertIdWithinFamily, assertSafeInteger, throwOutOfRange } from './meta/util'
|
||||
|
||||
const actionType = 'UpdateCategoryBatteryLimitAction'
|
||||
|
||||
export class UpdateCategoryBatteryLimitAction extends ParentAction {
|
||||
readonly categoryId: string
|
||||
@@ -30,17 +32,21 @@ export class UpdateCategoryBatteryLimitAction extends ParentAction {
|
||||
}) {
|
||||
super()
|
||||
|
||||
assertIdWithinFamily(categoryId)
|
||||
assertIdWithinFamily({ actionType, field: 'categoryId', value: categoryId })
|
||||
|
||||
if (chargeLimit !== undefined) {
|
||||
if ((!Number.isSafeInteger(chargeLimit)) || chargeLimit < 0 || chargeLimit > 100) {
|
||||
throw new Error('charge limit out of range')
|
||||
assertSafeInteger({ actionType, field: 'chargeLimit', value: chargeLimit })
|
||||
|
||||
if (chargeLimit < 0 || chargeLimit > 100) {
|
||||
throwOutOfRange({ actionType, field: 'chargeLimit', value: chargeLimit })
|
||||
}
|
||||
}
|
||||
|
||||
if (mobileLimit !== undefined) {
|
||||
if ((!Number.isSafeInteger(mobileLimit)) || mobileLimit < 0 || mobileLimit > 100) {
|
||||
throw new Error('mobile limit out of range')
|
||||
assertSafeInteger({ actionType, field: 'mobileLimit', value: mobileLimit })
|
||||
|
||||
if (mobileLimit < 0 || mobileLimit > 100) {
|
||||
throwOutOfRange({ actionType, field: 'mobileLimit', value: mobileLimit })
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,13 +55,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 })
|
||||
)
|
||||
|
||||
@@ -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,8 +15,10 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { assertIdWithinFamily } from '../util/token'
|
||||
import { ParentAction } from './basetypes'
|
||||
import { assertIdWithinFamily } from './meta/util'
|
||||
|
||||
const actionType = 'UpdateCategoryBlockAllNotificationsAction'
|
||||
|
||||
export class UpdateCategoryBlockAllNotificationsAction extends ParentAction {
|
||||
readonly categoryId: string
|
||||
@@ -25,18 +27,12 @@ export class UpdateCategoryBlockAllNotificationsAction extends ParentAction {
|
||||
constructor ({ categoryId, blocked }: {categoryId: string, blocked: boolean}) {
|
||||
super()
|
||||
|
||||
assertIdWithinFamily(categoryId)
|
||||
assertIdWithinFamily({ actionType, field: 'categoryId', value: categoryId })
|
||||
|
||||
this.categoryId = categoryId
|
||||
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 })
|
||||
)
|
||||
|
||||
@@ -15,12 +15,15 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { validateBitmask } from '../util/bitmask'
|
||||
import { assertIdWithinFamily } from '../util/token'
|
||||
import { BitmapValidationException, validateBitmask } from '../util/bitmask'
|
||||
import { ParentAction } from './basetypes'
|
||||
import { InvalidActionParameterException } from './meta/exception'
|
||||
import { assertIdWithinFamily } from './meta/util'
|
||||
|
||||
export const blockedTimesBitmaskLength = 60 * 24 * 7 /* number of minutes per week */
|
||||
|
||||
const actionType = 'UpdateCategoryBlockedTimesAction'
|
||||
|
||||
export class UpdateCategoryBlockedTimesAction extends ParentAction {
|
||||
readonly categoryId: string
|
||||
readonly blockedTimes: string
|
||||
@@ -31,19 +34,23 @@ export class UpdateCategoryBlockedTimesAction extends ParentAction {
|
||||
}) {
|
||||
super()
|
||||
|
||||
assertIdWithinFamily(categoryId)
|
||||
validateBitmask(blockedTimes, blockedTimesBitmaskLength)
|
||||
assertIdWithinFamily({ actionType, field: 'categoryId', value: categoryId })
|
||||
|
||||
try {
|
||||
validateBitmask(blockedTimes, blockedTimesBitmaskLength)
|
||||
} catch (ex) {
|
||||
if (ex instanceof BitmapValidationException) {
|
||||
throw new InvalidActionParameterException({
|
||||
actionType,
|
||||
staticMessage: 'invalid bitmask'
|
||||
})
|
||||
} else throw ex
|
||||
}
|
||||
|
||||
this.categoryId = categoryId
|
||||
this.blockedTimes = blockedTimes
|
||||
}
|
||||
|
||||
serialize = (): SerializedUpdateCategoryBlockedTimesAction => ({
|
||||
type: 'UPDATE_CATEGORY_BLOCKED_TIMES',
|
||||
categoryId: this.categoryId,
|
||||
times: this.blockedTimes
|
||||
})
|
||||
|
||||
static parse = ({ categoryId, times }: SerializedUpdateCategoryBlockedTimesAction) => (
|
||||
new UpdateCategoryBlockedTimesAction({
|
||||
categoryId,
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
* server component for the TimeLimit App
|
||||
* 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
|
||||
* 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 { ParentAction } from './basetypes'
|
||||
import { InvalidActionParameterException } from './meta/exception'
|
||||
import { assertIdWithinFamily, assertSafeInteger } from './meta/util'
|
||||
|
||||
const actionType = 'UpdateCategoryDisableLimitsAction'
|
||||
|
||||
export class UpdateCategoryDisableLimitsAction extends ParentAction {
|
||||
readonly categoryId: string
|
||||
readonly endTime: number
|
||||
|
||||
constructor ({ categoryId, endTime }: {
|
||||
categoryId: string
|
||||
endTime: number
|
||||
}) {
|
||||
super()
|
||||
|
||||
assertIdWithinFamily({ actionType, field: 'categoryId', value: categoryId })
|
||||
assertSafeInteger({ actionType, field: 'endTime', value: endTime })
|
||||
|
||||
if (endTime < 0) {
|
||||
throw new InvalidActionParameterException({
|
||||
actionType,
|
||||
staticMessage: 'endTime must not be smaller than zero'
|
||||
})
|
||||
}
|
||||
|
||||
this.categoryId = categoryId
|
||||
this.endTime = endTime
|
||||
}
|
||||
|
||||
static parse = ({ categoryId, endTime }: SerializedUpdatCategoryDisableLimitsAction) => (
|
||||
new UpdateCategoryDisableLimitsAction({ categoryId, endTime })
|
||||
)
|
||||
}
|
||||
|
||||
export interface SerializedUpdatCategoryDisableLimitsAction {
|
||||
type: 'UPDATE_CATEGORY_DISABLE_LIMITS'
|
||||
categoryId: string
|
||||
endTime: number
|
||||
}
|
||||
@@ -15,9 +15,10 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { uniq } from 'lodash'
|
||||
import { assertIdWithinFamily } from '../util/token'
|
||||
import { ParentAction } from './basetypes'
|
||||
import { assertIdWithinFamily, assertNonEmptyListWithoutDuplicates } from './meta/util'
|
||||
|
||||
const actionType = 'UpdateCategorySortingAction'
|
||||
|
||||
export class UpdateCategorySortingAction extends ParentAction {
|
||||
readonly categoryIds: Array<string>
|
||||
@@ -27,24 +28,17 @@ export class UpdateCategorySortingAction extends ParentAction {
|
||||
}) {
|
||||
super()
|
||||
|
||||
if (categoryIds.length === 0) {
|
||||
throw new Error('empty category sorting list')
|
||||
}
|
||||
assertNonEmptyListWithoutDuplicates({ actionType, field: 'categoryIds', list: categoryIds })
|
||||
|
||||
if (uniq(categoryIds).length !== categoryIds.length) {
|
||||
throw new Error('category sorting list has duplicates')
|
||||
}
|
||||
|
||||
categoryIds.forEach((categoryId) => assertIdWithinFamily(categoryId))
|
||||
categoryIds.forEach((categoryId) => assertIdWithinFamily({
|
||||
actionType,
|
||||
field: 'categoryIds',
|
||||
value: categoryId
|
||||
}))
|
||||
|
||||
this.categoryIds = categoryIds
|
||||
}
|
||||
|
||||
serialize = (): SerializedUpdateCategorySortingAction => ({
|
||||
type: 'UPDATE_CATEGORY_SORTING',
|
||||
categoryIds: this.categoryIds
|
||||
})
|
||||
|
||||
static parse = ({ categoryIds }: SerializedUpdateCategorySortingAction) => (
|
||||
new UpdateCategorySortingAction({ categoryIds })
|
||||
)
|
||||
|
||||
@@ -15,8 +15,11 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { assertIdWithinFamily } from '../util/token'
|
||||
import { ParentAction } from './basetypes'
|
||||
import { InvalidActionParameterException } from './meta/exception'
|
||||
import { assertIdWithinFamily, assertSafeInteger } from './meta/util'
|
||||
|
||||
const actionType = 'UpdateCategoryTemporarilyBlockedAction'
|
||||
|
||||
export class UpdateCategoryTemporarilyBlockedAction extends ParentAction {
|
||||
readonly categoryId: string
|
||||
@@ -30,15 +33,16 @@ export class UpdateCategoryTemporarilyBlockedAction extends ParentAction {
|
||||
}) {
|
||||
super()
|
||||
|
||||
assertIdWithinFamily(categoryId)
|
||||
assertIdWithinFamily({ actionType, field: 'categoryId', value: categoryId })
|
||||
|
||||
if (endTime !== undefined) {
|
||||
if (!Number.isSafeInteger(endTime)) {
|
||||
throw new Error()
|
||||
}
|
||||
assertSafeInteger({ actionType, field: 'endTime', value: endTime })
|
||||
|
||||
if (!blocked) {
|
||||
throw new Error()
|
||||
throw new InvalidActionParameterException({
|
||||
actionType,
|
||||
staticMessage: 'can not set a end time when disabling blocking'
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,13 +51,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
|
||||
@@ -16,8 +16,10 @@
|
||||
*/
|
||||
|
||||
import { allowedTimeWarningFlags } from '../database/category'
|
||||
import { assertIdWithinFamily } from '../util/token'
|
||||
import { ParentAction } from './basetypes'
|
||||
import { assertIdWithinFamily, assertSafeInteger, throwOutOfRange } from './meta/util'
|
||||
|
||||
const actionType = 'UpdateCategoryTimeWarningsAction'
|
||||
|
||||
export class UpdateCategoryTimeWarningsAction extends ParentAction {
|
||||
readonly categoryId: string
|
||||
@@ -31,10 +33,11 @@ export class UpdateCategoryTimeWarningsAction extends ParentAction {
|
||||
}) {
|
||||
super()
|
||||
|
||||
assertIdWithinFamily(categoryId)
|
||||
assertIdWithinFamily({ actionType, field: 'categoryId', value: categoryId })
|
||||
assertSafeInteger({ actionType, field: 'flags', value: flags })
|
||||
|
||||
if ((flags & allowedTimeWarningFlags) !== flags) {
|
||||
throw new Error('illegal flags')
|
||||
throwOutOfRange({ actionType, field: 'flags', value: flags })
|
||||
}
|
||||
|
||||
this.categoryId = categoryId
|
||||
@@ -42,13 +45,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
|
||||
@@ -15,8 +15,10 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { assertIdWithinFamily } from '../util/token'
|
||||
import { ParentAction } from './basetypes'
|
||||
import { assertIdWithinFamily } from './meta/util'
|
||||
|
||||
const actionType = 'UpdateCategoryTitleAction'
|
||||
|
||||
export class UpdateCategoryTitleAction extends ParentAction {
|
||||
readonly categoryId: string
|
||||
@@ -25,18 +27,12 @@ export class UpdateCategoryTitleAction extends ParentAction {
|
||||
constructor ({ categoryId, newTitle }: {categoryId: string, newTitle: string}) {
|
||||
super()
|
||||
|
||||
assertIdWithinFamily(categoryId)
|
||||
assertIdWithinFamily({ actionType, field: 'categoryId', value: categoryId })
|
||||
|
||||
this.categoryId = categoryId
|
||||
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
|
||||
@@ -15,8 +15,11 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { assertIdWithinFamily } from '../util/token'
|
||||
import { ParentAction } from './basetypes'
|
||||
import { InvalidActionParameterException } from './meta/exception'
|
||||
import { assertIdWithinFamily } from './meta/util'
|
||||
|
||||
const actionType = 'UpdateDeviceNameAction'
|
||||
|
||||
export class UpdateDeviceNameAction extends ParentAction {
|
||||
readonly deviceId: string
|
||||
@@ -31,19 +34,16 @@ export class UpdateDeviceNameAction extends ParentAction {
|
||||
this.deviceId = deviceId
|
||||
this.name = name
|
||||
|
||||
assertIdWithinFamily(deviceId)
|
||||
assertIdWithinFamily({ actionType, field: 'deviceId', value: deviceId })
|
||||
|
||||
if (name.trim().length === 0) {
|
||||
throw new Error('new device name must not be blank')
|
||||
throw new InvalidActionParameterException({
|
||||
actionType,
|
||||
staticMessage: 'new device name must not be blank'
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
@@ -19,6 +19,9 @@ import { NewPermissionStatus } from '../model/newpermissionstatus'
|
||||
import { ProtectionLevel } from '../model/protectionlevel'
|
||||
import { RuntimePermissionStatus } from '../model/runtimepermissionstatus'
|
||||
import { AppLogicAction } from './basetypes'
|
||||
import { assertSafeInteger, throwOutOfRange } from './meta/util'
|
||||
|
||||
const actionType = 'UpdateDeviceStatusAction'
|
||||
|
||||
export class UpdateDeviceStatusAction extends AppLogicAction {
|
||||
readonly newProtetionLevel?: ProtectionLevel
|
||||
@@ -52,8 +55,10 @@ export class UpdateDeviceStatusAction extends AppLogicAction {
|
||||
super()
|
||||
|
||||
if (newAppVersion !== undefined) {
|
||||
if (!Number.isSafeInteger(newAppVersion) || (newAppVersion < 0)) {
|
||||
throw new Error('invalid new ap version')
|
||||
assertSafeInteger({ actionType, field: 'newAppVersion', value: newAppVersion })
|
||||
|
||||
if (newAppVersion < 0) {
|
||||
throwOutOfRange({ actionType, field: 'newAppVersion', value: newAppVersion })
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,18 +72,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
|
||||
@@ -15,8 +15,10 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { assertIdWithinFamily } from '../util/token'
|
||||
import { ParentAction } from './basetypes'
|
||||
import { assertIdWithinFamily } from './meta/util'
|
||||
|
||||
const actionType = 'UpdateEnableActivityLevelBlockingAction'
|
||||
|
||||
export class UpdateEnableActivityLevelBlockingAction extends ParentAction {
|
||||
readonly deviceId: string
|
||||
@@ -25,18 +27,12 @@ export class UpdateEnableActivityLevelBlockingAction extends ParentAction {
|
||||
constructor ({ deviceId, enable }: {deviceId: string, enable: boolean}) {
|
||||
super()
|
||||
|
||||
assertIdWithinFamily(deviceId)
|
||||
assertIdWithinFamily({ actionType, field: 'deviceId', value: deviceId })
|
||||
|
||||
this.deviceId = deviceId
|
||||
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
|
||||
@@ -15,8 +15,10 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { assertIdWithinFamily } from '../util/token'
|
||||
import { ParentAction } from './basetypes'
|
||||
import { assertIdWithinFamily } from './meta/util'
|
||||
|
||||
const actionType = 'UpdateNetworkTimeVerificationAction'
|
||||
|
||||
export class UpdateNetworkTimeVerificationAction extends ParentAction {
|
||||
readonly deviceId: string
|
||||
@@ -28,18 +30,12 @@ export class UpdateNetworkTimeVerificationAction extends ParentAction {
|
||||
}) {
|
||||
super()
|
||||
|
||||
assertIdWithinFamily(deviceId)
|
||||
assertIdWithinFamily({ actionType, field: 'deviceId', value: deviceId })
|
||||
|
||||
this.deviceId = deviceId
|
||||
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
|
||||
@@ -15,9 +15,12 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { validateAndParseBitmask } from '../util/bitmask'
|
||||
import { assertIdWithinFamily } from '../util/token'
|
||||
import { BitmapValidationException, validateAndParseBitmask } from '../util/bitmask'
|
||||
import { ParentAction } from './basetypes'
|
||||
import { InvalidActionParameterException } from './meta/exception'
|
||||
import { assertIdWithinFamily } from './meta/util'
|
||||
|
||||
const actionType = 'UpdateParentBlockedTimesAction'
|
||||
|
||||
export class UpdateParentBlockedTimesAction extends ParentAction {
|
||||
readonly parentId: string
|
||||
@@ -29,9 +32,9 @@ export class UpdateParentBlockedTimesAction extends ParentAction {
|
||||
}) {
|
||||
super()
|
||||
|
||||
assertIdWithinFamily(parentId)
|
||||
assertIdWithinFamily({ actionType, field: 'parentId', value: parentId })
|
||||
|
||||
{
|
||||
try {
|
||||
const parsedBlockedTimes = validateAndParseBitmask(blockedTimes, 60 * 24 * 7 /* number of minutes per week */)
|
||||
|
||||
for (let day = 0; day < 7; day++) {
|
||||
@@ -44,21 +47,25 @@ export class UpdateParentBlockedTimesAction extends ParentAction {
|
||||
}
|
||||
|
||||
if (blockedMinutes > 60 * 18 /* 18 hours */) {
|
||||
throw new Error('too much blocked minutes per day')
|
||||
throw new InvalidActionParameterException({
|
||||
actionType,
|
||||
staticMessage: 'too much blocked minutes per day'
|
||||
})
|
||||
}
|
||||
}
|
||||
} catch (ex) {
|
||||
if (ex instanceof BitmapValidationException) {
|
||||
throw new InvalidActionParameterException({
|
||||
actionType,
|
||||
staticMessage: 'invalid bitmask'
|
||||
})
|
||||
} else throw ex
|
||||
}
|
||||
|
||||
this.parentId = parentId
|
||||
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
|
||||
@@ -15,8 +15,10 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { assertIdWithinFamily } from '../util/token'
|
||||
import { ParentAction } from './basetypes'
|
||||
import { assertIdWithinFamily, assertSafeInteger, throwOutOfRange } from './meta/util'
|
||||
|
||||
const actionType = 'UpdateParentNotificationFlagsAction'
|
||||
|
||||
export class UpdateParentNotificationFlagsAction extends ParentAction {
|
||||
readonly parentId: string
|
||||
@@ -30,14 +32,12 @@ export class UpdateParentNotificationFlagsAction extends ParentAction {
|
||||
}) {
|
||||
super()
|
||||
|
||||
assertIdWithinFamily(parentId)
|
||||
assertIdWithinFamily({ actionType, field: 'parentId', value: parentId })
|
||||
|
||||
if (!Number.isSafeInteger(flags)) {
|
||||
throw new Error('flags must be an integer')
|
||||
}
|
||||
assertSafeInteger({ actionType, field: 'flags', value: flags })
|
||||
|
||||
if (flags < 0 || flags > 1) {
|
||||
throw new Error('flags are out of the valid range')
|
||||
throwOutOfRange({ actionType, field: 'flags', value: flags })
|
||||
}
|
||||
|
||||
this.parentId = parentId
|
||||
@@ -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 })
|
||||
)
|
||||
|
||||
@@ -16,8 +16,11 @@
|
||||
*/
|
||||
|
||||
import { MinuteOfDay } from '../util/minuteofday'
|
||||
import { assertIdWithinFamily } from '../util/token'
|
||||
import { ParentAction } from './basetypes'
|
||||
import { InvalidActionParameterException } from './meta/exception'
|
||||
import { assertIdWithinFamily, assertSafeInteger, throwOutOfRange } from './meta/util'
|
||||
|
||||
const actionType = 'UpdateTimelimitRuleAction'
|
||||
|
||||
export class UpdateTimelimitRuleAction extends ParentAction {
|
||||
readonly ruleId: string
|
||||
@@ -53,50 +56,40 @@ export class UpdateTimelimitRuleAction extends ParentAction {
|
||||
this.sessionDurationMilliseconds = sessionDurationMilliseconds
|
||||
this.sessionPauseMilliseconds = sessionPauseMilliseconds
|
||||
|
||||
assertIdWithinFamily(ruleId)
|
||||
assertIdWithinFamily({ actionType, field: 'ruleId', value: ruleId })
|
||||
|
||||
if (maximumTimeInMillis < 0 || (!Number.isSafeInteger(maximumTimeInMillis))) {
|
||||
throw new Error('maximumTimeInMillis must be >= 0')
|
||||
assertSafeInteger({ actionType, field: 'maximumTimeInMillis', value: maximumTimeInMillis })
|
||||
|
||||
if (maximumTimeInMillis < 0) {
|
||||
throwOutOfRange({ actionType, field: 'maximumTimeInMillis', value: maximumTimeInMillis })
|
||||
}
|
||||
|
||||
if (!(
|
||||
Number.isSafeInteger(dayMask) ||
|
||||
dayMask < 0 ||
|
||||
dayMask > (1 | 2 | 4 | 8 | 16 | 32 | 64)
|
||||
)) {
|
||||
throw new Error('invalid day mask')
|
||||
assertSafeInteger({ actionType, field: 'dayMask', value: dayMask })
|
||||
|
||||
if (dayMask < 0 || dayMask > (1 | 2 | 4 | 8 | 16 | 32 | 64)) {
|
||||
throwOutOfRange({ actionType, field: 'dayMask', value: dayMask })
|
||||
}
|
||||
|
||||
if (
|
||||
(!Number.isSafeInteger(start)) ||
|
||||
(!Number.isSafeInteger(end)) ||
|
||||
(!Number.isSafeInteger(sessionDurationMilliseconds)) ||
|
||||
(!Number.isSafeInteger(sessionPauseMilliseconds))
|
||||
) {
|
||||
throw new Error()
|
||||
}
|
||||
assertSafeInteger({ actionType, field: 'start', value: start })
|
||||
assertSafeInteger({ actionType, field: 'end', value: end })
|
||||
assertSafeInteger({ actionType, field: 'sessionDurationMilliseconds', value: sessionDurationMilliseconds })
|
||||
assertSafeInteger({ actionType, field: 'sessionPauseMilliseconds', value: sessionPauseMilliseconds })
|
||||
|
||||
if (start < MinuteOfDay.MIN || end > MinuteOfDay.MAX || start > end) {
|
||||
throw new Error()
|
||||
throw new InvalidActionParameterException({
|
||||
actionType,
|
||||
staticMessage: 'time slot out of range'
|
||||
})
|
||||
}
|
||||
|
||||
if (sessionDurationMilliseconds < 0 || sessionPauseMilliseconds < 0) {
|
||||
throw new Error()
|
||||
throw new InvalidActionParameterException({
|
||||
actionType,
|
||||
staticMessage: 'session duration lesser than zero'
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
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,
|
||||
|
||||
@@ -16,8 +16,11 @@
|
||||
*/
|
||||
|
||||
import { UserFlags } from '../model/userflags'
|
||||
import { assertIdWithinFamily } from '../util/token'
|
||||
import { ParentAction } from './basetypes'
|
||||
import { InvalidActionParameterException } from './meta/exception'
|
||||
import { assertIdWithinFamily, assertSafeInteger } from './meta/util'
|
||||
|
||||
const actionType = 'UpdateUserFlagsAction'
|
||||
|
||||
export class UpdateUserFlagsAction extends ParentAction {
|
||||
readonly userId: string
|
||||
@@ -31,14 +34,16 @@ export class UpdateUserFlagsAction extends ParentAction {
|
||||
}) {
|
||||
super()
|
||||
|
||||
assertIdWithinFamily(userId)
|
||||
|
||||
if ((!Number.isSafeInteger(modifiedBits)) || (!Number.isSafeInteger(newValues))) {
|
||||
throw new Error('flags must be an integer')
|
||||
}
|
||||
assertIdWithinFamily({ actionType, field: 'userId', value: userId })
|
||||
assertSafeInteger({ actionType, field: 'modifiedBits', value: modifiedBits })
|
||||
assertSafeInteger({ actionType, field: 'newValues', value: newValues })
|
||||
|
||||
if ((modifiedBits | UserFlags.ALL_FLAGS) !== UserFlags.ALL_FLAGS || (modifiedBits | newValues) !== modifiedBits) {
|
||||
throw new Error('flags are out of the valid range')
|
||||
throw new InvalidActionParameterException({
|
||||
actionType,
|
||||
staticMessage: 'flags are out of the valid range',
|
||||
dynamicMessage: 'flags are out of the valid range: ' + modifiedBits + ', ' + newValues
|
||||
})
|
||||
}
|
||||
|
||||
this.userId = userId
|
||||
@@ -46,13 +51,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,
|
||||
|
||||
@@ -15,8 +15,10 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { assertIdWithinFamily } from '../util/token'
|
||||
import { ParentAction } from './basetypes'
|
||||
import { assertIdWithinFamily } from './meta/util'
|
||||
|
||||
const actionType = 'UpdateUserLimitLoginCategory'
|
||||
|
||||
export class UpdateUserLimitLoginCategory extends ParentAction {
|
||||
readonly userId: string
|
||||
@@ -28,22 +30,16 @@ export class UpdateUserLimitLoginCategory extends ParentAction {
|
||||
}) {
|
||||
super()
|
||||
|
||||
assertIdWithinFamily(userId)
|
||||
assertIdWithinFamily({ actionType, field: 'userId', value: userId })
|
||||
|
||||
if (categoryId !== undefined) {
|
||||
assertIdWithinFamily(categoryId)
|
||||
assertIdWithinFamily({ actionType, field: 'categoryId', value: categoryId })
|
||||
}
|
||||
|
||||
this.userId = userId
|
||||
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,
|
||||
|
||||
+27
-20
@@ -34,9 +34,12 @@ export const createAdminRouter = ({ database, websocket, eventHandler }: {
|
||||
|
||||
router.get('/status', async (_, res, next) => {
|
||||
try {
|
||||
const { counters, maxValues } = await eventHandler.getValues()
|
||||
|
||||
res.json({
|
||||
websocketClients: websocket.countConnections(),
|
||||
counters: await eventHandler.getCounters()
|
||||
counters,
|
||||
maxValues
|
||||
})
|
||||
} catch (ex) {
|
||||
next(ex)
|
||||
@@ -45,7 +48,7 @@ export const createAdminRouter = ({ database, websocket, eventHandler }: {
|
||||
|
||||
router.post('/reset-counters', async (_, res, next) => {
|
||||
try {
|
||||
await eventHandler.resetCounters()
|
||||
await eventHandler.reset()
|
||||
|
||||
res.json({ ok: true })
|
||||
} catch (ex) {
|
||||
@@ -96,27 +99,31 @@ export const createAdminRouter = ({ database, websocket, eventHandler }: {
|
||||
throw new BadRequest()
|
||||
}
|
||||
|
||||
const userEntryUnsafe = await database.user.findOne({
|
||||
where: {
|
||||
mail
|
||||
},
|
||||
attributes: ['familyId']
|
||||
})
|
||||
await database.transaction(async (transaction) => {
|
||||
const userEntryUnsafe = await database.user.findOne({
|
||||
where: {
|
||||
mail
|
||||
},
|
||||
attributes: ['familyId'],
|
||||
transaction
|
||||
})
|
||||
|
||||
if (!userEntryUnsafe) {
|
||||
throw new Conflict('no user with specified mail address')
|
||||
}
|
||||
if (!userEntryUnsafe) {
|
||||
throw new Conflict('no user with specified mail address')
|
||||
}
|
||||
|
||||
const userEntry = {
|
||||
familyId: userEntryUnsafe.familyId
|
||||
}
|
||||
const userEntry = {
|
||||
familyId: userEntryUnsafe.familyId
|
||||
}
|
||||
|
||||
await addPurchase({
|
||||
database,
|
||||
familyId: userEntry.familyId,
|
||||
type,
|
||||
transactionId: 'manual-' + type + '-' + generatePurchaseId(),
|
||||
websocket
|
||||
await addPurchase({
|
||||
database,
|
||||
familyId: userEntry.familyId,
|
||||
type,
|
||||
transactionId: 'manual-' + type + '-' + generatePurchaseId(),
|
||||
websocket,
|
||||
transaction
|
||||
})
|
||||
})
|
||||
|
||||
res.json({ ok: true })
|
||||
|
||||
+35
-22
@@ -19,7 +19,7 @@ import { json } from 'body-parser'
|
||||
import { Router } from 'express'
|
||||
import { BadRequest, Forbidden, Unauthorized } from 'http-errors'
|
||||
import { config } from '../config'
|
||||
import { Database } from '../database'
|
||||
import { Database, Transaction } from '../database'
|
||||
import { removeDevice } from '../function/device/remove-device'
|
||||
import { canRecoverPassword } from '../function/parent/can-recover-password'
|
||||
import { createAddDeviceToken } from '../function/parent/create-add-device-token'
|
||||
@@ -46,7 +46,9 @@ export const createParentRouter = ({ database, websocket }: {database: Database,
|
||||
}
|
||||
|
||||
const { mailAuthToken } = req.body
|
||||
const { status, mail } = await getStatusByMailToken({ database, mailAuthToken })
|
||||
const { status, mail } = await database.transaction(async (transaction) => {
|
||||
return getStatusByMailToken({ database, mailAuthToken, transaction })
|
||||
})
|
||||
|
||||
res.json({
|
||||
status,
|
||||
@@ -148,15 +150,17 @@ export const createParentRouter = ({ database, websocket }: {database: Database,
|
||||
}
|
||||
})
|
||||
|
||||
async function assertAuthValidAndReturnDeviceEntry ({ deviceAuthToken, parentId, secondPasswordHash }: {
|
||||
async function assertAuthValidAndReturnDeviceEntry ({ deviceAuthToken, parentId, secondPasswordHash, transaction }: {
|
||||
deviceAuthToken: string
|
||||
parentId: string
|
||||
secondPasswordHash: string
|
||||
transaction: Transaction
|
||||
}) {
|
||||
const deviceEntry = await database.device.findOne({
|
||||
where: {
|
||||
deviceAuthToken: deviceAuthToken
|
||||
}
|
||||
},
|
||||
transaction
|
||||
})
|
||||
|
||||
if (!deviceEntry) {
|
||||
@@ -173,7 +177,8 @@ export const createParentRouter = ({ database, websocket }: {database: Database,
|
||||
familyId: deviceEntry.familyId,
|
||||
type: 'parent',
|
||||
userId: deviceEntry.currentUserId
|
||||
}
|
||||
},
|
||||
transaction
|
||||
})
|
||||
|
||||
if (!parentEntry) {
|
||||
@@ -186,7 +191,8 @@ export const createParentRouter = ({ database, websocket }: {database: Database,
|
||||
type: 'parent',
|
||||
userId: parentId,
|
||||
secondPasswordHash: secondPasswordHash
|
||||
}
|
||||
},
|
||||
transaction
|
||||
})
|
||||
|
||||
if (!parentEntry) {
|
||||
@@ -203,13 +209,16 @@ export const createParentRouter = ({ database, websocket }: {database: Database,
|
||||
throw new BadRequest()
|
||||
}
|
||||
|
||||
const deviceEntry = await assertAuthValidAndReturnDeviceEntry({
|
||||
deviceAuthToken: req.body.deviceAuthToken,
|
||||
parentId: req.body.parentId,
|
||||
secondPasswordHash: req.body.parentPasswordSecondHash
|
||||
})
|
||||
const { token, deviceId } = await database.transaction(async (transaction) => {
|
||||
const deviceEntry = await assertAuthValidAndReturnDeviceEntry({
|
||||
deviceAuthToken: req.body.deviceAuthToken,
|
||||
parentId: req.body.parentId,
|
||||
secondPasswordHash: req.body.parentPasswordSecondHash,
|
||||
transaction
|
||||
})
|
||||
|
||||
const { token, deviceId } = await createAddDeviceToken({ familyId: deviceEntry.familyId, database })
|
||||
return createAddDeviceToken({ familyId: deviceEntry.familyId, database, transaction })
|
||||
})
|
||||
|
||||
res.json({ token, deviceId })
|
||||
} catch (ex) {
|
||||
@@ -244,17 +253,21 @@ export const createParentRouter = ({ database, websocket }: {database: Database,
|
||||
throw new BadRequest()
|
||||
}
|
||||
|
||||
const deviceEntry = await assertAuthValidAndReturnDeviceEntry({
|
||||
deviceAuthToken: req.body.deviceAuthToken,
|
||||
parentId: req.body.parentUserId,
|
||||
secondPasswordHash: req.body.parentPasswordSecondHash
|
||||
})
|
||||
await database.transaction(async (transaction) => {
|
||||
const deviceEntry = await assertAuthValidAndReturnDeviceEntry({
|
||||
deviceAuthToken: req.body.deviceAuthToken,
|
||||
parentId: req.body.parentUserId,
|
||||
secondPasswordHash: req.body.parentPasswordSecondHash,
|
||||
transaction
|
||||
})
|
||||
|
||||
await removeDevice({
|
||||
database,
|
||||
familyId: deviceEntry.familyId,
|
||||
deviceId: req.body.deviceId,
|
||||
websocket
|
||||
await removeDevice({
|
||||
database,
|
||||
familyId: deviceEntry.familyId,
|
||||
deviceId: req.body.deviceId,
|
||||
websocket,
|
||||
transaction
|
||||
})
|
||||
})
|
||||
|
||||
res.json({ ok: true })
|
||||
|
||||
+53
-46
@@ -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
|
||||
@@ -47,12 +47,15 @@ export const createPurchaseRouter = ({ database, websocket }: {
|
||||
throw new BadRequest()
|
||||
}
|
||||
|
||||
const familyEntry = await requireFamilyEntry({
|
||||
database,
|
||||
deviceAuthToken: req.body.deviceAuthToken
|
||||
})
|
||||
const result: boolean = await database.transaction(async (transaction) => {
|
||||
const familyEntry = await requireFamilyEntry({
|
||||
database,
|
||||
deviceAuthToken: req.body.deviceAuthToken,
|
||||
transaction
|
||||
})
|
||||
|
||||
const result = canDoNextPurchase({ fullVersionUntil: parseInt(familyEntry.fullVersionUntil, 10) })
|
||||
return canDoNextPurchase({ fullVersionUntil: parseInt(familyEntry.fullVersionUntil, 10) })
|
||||
})
|
||||
|
||||
res.json({
|
||||
canDoPurchase: result ? 'yes' : 'no due to old purchase',
|
||||
@@ -69,56 +72,60 @@ export const createPurchaseRouter = ({ database, websocket }: {
|
||||
throw new BadRequest()
|
||||
}
|
||||
|
||||
const deviceEntryUnsafe = await database.device.findOne({
|
||||
where: {
|
||||
deviceAuthToken: req.body.deviceAuthToken
|
||||
},
|
||||
attributes: ['familyId']
|
||||
})
|
||||
await database.transaction(async (transaction) => {
|
||||
const deviceEntryUnsafe = await database.device.findOne({
|
||||
where: {
|
||||
deviceAuthToken: req.body.deviceAuthToken
|
||||
},
|
||||
attributes: ['familyId'],
|
||||
transaction
|
||||
})
|
||||
|
||||
if (!deviceEntryUnsafe) {
|
||||
throw new Unauthorized()
|
||||
}
|
||||
if (!deviceEntryUnsafe) {
|
||||
throw new Unauthorized()
|
||||
}
|
||||
|
||||
const deviceEntry = {
|
||||
familyId: deviceEntryUnsafe.familyId
|
||||
}
|
||||
const deviceEntry = {
|
||||
familyId: deviceEntryUnsafe.familyId
|
||||
}
|
||||
|
||||
if (!isGooglePlayPurchaseSignatureValid({
|
||||
receipt: req.body.receipt,
|
||||
signature: req.body.signature
|
||||
})) {
|
||||
throw new Conflict()
|
||||
}
|
||||
if (!isGooglePlayPurchaseSignatureValid({
|
||||
receipt: req.body.receipt,
|
||||
signature: req.body.signature
|
||||
})) {
|
||||
throw new Conflict()
|
||||
}
|
||||
|
||||
const receipt = JSON.parse(req.body.receipt)
|
||||
const receipt = JSON.parse(req.body.receipt)
|
||||
|
||||
if (typeof receipt !== 'object') {
|
||||
throw new Conflict()
|
||||
}
|
||||
if (typeof receipt !== 'object') {
|
||||
throw new Conflict()
|
||||
}
|
||||
|
||||
let type: 'month' | 'year'
|
||||
let type: 'month' | 'year'
|
||||
|
||||
if (receipt.productId === 'premium_year_2018') {
|
||||
type = 'year'
|
||||
} else if (receipt.productId === 'premium_month_2018') {
|
||||
type = 'month'
|
||||
} else {
|
||||
throw new Conflict()
|
||||
}
|
||||
if (receipt.productId === 'premium_year_2018') {
|
||||
type = 'year'
|
||||
} else if (receipt.productId === 'premium_month_2018') {
|
||||
type = 'month'
|
||||
} else {
|
||||
throw new Conflict()
|
||||
}
|
||||
|
||||
const orderId = receipt.orderId
|
||||
const orderId = receipt.orderId
|
||||
|
||||
if (typeof orderId !== 'string') {
|
||||
throw new Conflict()
|
||||
}
|
||||
if (typeof orderId !== 'string') {
|
||||
throw new Conflict()
|
||||
}
|
||||
|
||||
await addPurchase({
|
||||
database,
|
||||
familyId: deviceEntry.familyId,
|
||||
type,
|
||||
transactionId: orderId,
|
||||
websocket
|
||||
await addPurchase({
|
||||
database,
|
||||
familyId: deviceEntry.familyId,
|
||||
type,
|
||||
transactionId: orderId,
|
||||
websocket,
|
||||
transaction
|
||||
})
|
||||
})
|
||||
|
||||
res.json({ ok: true })
|
||||
|
||||
+13
-9
@@ -20,13 +20,15 @@ import { optionalPasswordRegex, optionalSaltRegex } from '../util/password'
|
||||
|
||||
export interface ClientPushChangesRequest {
|
||||
deviceAuthToken: string
|
||||
actions: Array<{
|
||||
encodedAction: string
|
||||
sequenceNumber: number
|
||||
integrity: string
|
||||
type: 'appLogic' | 'parent' | 'child'
|
||||
userId: string
|
||||
}>
|
||||
actions: Array<ClientPushChangesRequestAction>
|
||||
}
|
||||
|
||||
export interface ClientPushChangesRequestAction {
|
||||
encodedAction: string
|
||||
sequenceNumber: number
|
||||
integrity: string
|
||||
type: 'appLogic' | 'parent' | 'child'
|
||||
userId: string
|
||||
}
|
||||
|
||||
export interface ClientPullChangesRequest {
|
||||
@@ -50,14 +52,16 @@ export interface ParentPassword {
|
||||
|
||||
export const assertParentPasswordValid = (password: ParentPassword) => {
|
||||
if (password.hash === '' || password.secondHash === '' || password.secondSalt === '') {
|
||||
throw new Error('missing fields at parent password')
|
||||
throw new ParentPasswordValidationException('missing fields at parent password')
|
||||
}
|
||||
|
||||
if (!(optionalPasswordRegex.test(password.hash) && optionalPasswordRegex.test(password.secondHash) && optionalSaltRegex.test(password.secondSalt))) {
|
||||
throw new Error('invalid parent password')
|
||||
throw new ParentPasswordValidationException('invalid parent password')
|
||||
}
|
||||
}
|
||||
|
||||
export class ParentPasswordValidationException extends Error {}
|
||||
|
||||
export interface CreateFamilyByMailTokenRequest {
|
||||
mailAuthToken: string
|
||||
parentPassword: ParentPassword
|
||||
|
||||
+22
-17
@@ -85,7 +85,7 @@ export const createSyncRouter = ({ database, websocket, connectedDevicesManager,
|
||||
throw new BadRequest()
|
||||
}
|
||||
|
||||
await database.transaction(async (transaction) => {
|
||||
const serverStatus = await database.transaction(async (transaction) => {
|
||||
const deviceEntryUnsafe = await database.device.findOne({
|
||||
where: {
|
||||
deviceAuthToken: body.deviceAuthToken
|
||||
@@ -112,23 +112,23 @@ export const createSyncRouter = ({ database, websocket, connectedDevicesManager,
|
||||
})
|
||||
}
|
||||
|
||||
const serverStatus = await generateServerDataStatus({
|
||||
return generateServerDataStatus({
|
||||
database,
|
||||
familyId,
|
||||
clientStatus: body.status,
|
||||
transaction
|
||||
})
|
||||
|
||||
if (serverStatus.devices) { eventHandler.countEvent('pullStatusRequest devices') }
|
||||
if (serverStatus.apps) { eventHandler.countEvent('pullStatusRequest apps') }
|
||||
if (serverStatus.categoryBase) { eventHandler.countEvent('pullStatusRequest categoryBase') }
|
||||
if (serverStatus.categoryApp) { eventHandler.countEvent('pullStatusRequest categoryApp') }
|
||||
if (serverStatus.usedTimes) { eventHandler.countEvent('pullStatusRequest usedTimes') }
|
||||
if (serverStatus.rules) { eventHandler.countEvent('pullStatusRequest rules') }
|
||||
if (serverStatus.users) { eventHandler.countEvent('pullStatusRequest users') }
|
||||
|
||||
res.json(serverStatus)
|
||||
})
|
||||
|
||||
if (serverStatus.devices) { eventHandler.countEvent('pullStatusRequest devices') }
|
||||
if (serverStatus.apps) { eventHandler.countEvent('pullStatusRequest apps') }
|
||||
if (serverStatus.categoryBase) { eventHandler.countEvent('pullStatusRequest categoryBase') }
|
||||
if (serverStatus.categoryApp) { eventHandler.countEvent('pullStatusRequest categoryApp') }
|
||||
if (serverStatus.usedTimes) { eventHandler.countEvent('pullStatusRequest usedTimes') }
|
||||
if (serverStatus.rules) { eventHandler.countEvent('pullStatusRequest rules') }
|
||||
if (serverStatus.users) { eventHandler.countEvent('pullStatusRequest users') }
|
||||
|
||||
res.json(serverStatus)
|
||||
} catch (ex) {
|
||||
next(ex)
|
||||
}
|
||||
@@ -158,14 +158,19 @@ export const createSyncRouter = ({ database, websocket, connectedDevicesManager,
|
||||
throw new BadRequest()
|
||||
}
|
||||
|
||||
const removedEntry = await database.oldDevice.findOne({
|
||||
where: {
|
||||
deviceAuthToken: req.body.deviceAuthToken
|
||||
}
|
||||
const isDeviceRemoved: boolean = await database.transaction(async (transaction) => {
|
||||
const removedEntry = await database.oldDevice.findOne({
|
||||
where: {
|
||||
deviceAuthToken: req.body.deviceAuthToken
|
||||
},
|
||||
transaction
|
||||
})
|
||||
|
||||
return !!removedEntry
|
||||
})
|
||||
|
||||
res.json({
|
||||
isDeviceRemoved: !!removedEntry
|
||||
isDeviceRemoved
|
||||
})
|
||||
} catch (ex) {
|
||||
next(ex)
|
||||
|
||||
+65
-31
@@ -4,6 +4,39 @@ const Ajv = require('ajv')
|
||||
const ajv = new Ajv()
|
||||
|
||||
const definitions = {
|
||||
"ClientPushChangesRequestAction": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"encodedAction": {
|
||||
"type": "string"
|
||||
},
|
||||
"sequenceNumber": {
|
||||
"type": "number"
|
||||
},
|
||||
"integrity": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"enum": [
|
||||
"appLogic",
|
||||
"child",
|
||||
"parent"
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
"userId": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"encodedAction",
|
||||
"integrity",
|
||||
"sequenceNumber",
|
||||
"type",
|
||||
"userId"
|
||||
]
|
||||
},
|
||||
"ClientDataStatus": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -906,6 +939,29 @@ const definitions = {
|
||||
"type"
|
||||
]
|
||||
},
|
||||
"SerializedUpdatCategoryDisableLimitsAction": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"UPDATE_CATEGORY_DISABLE_LIMITS"
|
||||
]
|
||||
},
|
||||
"categoryId": {
|
||||
"type": "string"
|
||||
},
|
||||
"endTime": {
|
||||
"type": "number"
|
||||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"categoryId",
|
||||
"endTime",
|
||||
"type"
|
||||
]
|
||||
},
|
||||
"SerializedUpdateCategorySortingAction": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -1902,6 +1958,9 @@ const definitions = {
|
||||
"items": {
|
||||
"$ref": "#/definitions/ServerCategoryNetworkId"
|
||||
}
|
||||
},
|
||||
"dlu": {
|
||||
"type": "number"
|
||||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
@@ -1910,6 +1969,7 @@ const definitions = {
|
||||
"blockedTimes",
|
||||
"categoryId",
|
||||
"childId",
|
||||
"dlu",
|
||||
"extraTime",
|
||||
"extraTimeDay",
|
||||
"mblCharging",
|
||||
@@ -2219,37 +2279,7 @@ export const isClientPushChangesRequest: (value: object) => value is ClientPushC
|
||||
"actions": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"encodedAction": {
|
||||
"type": "string"
|
||||
},
|
||||
"sequenceNumber": {
|
||||
"type": "number"
|
||||
},
|
||||
"integrity": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"enum": [
|
||||
"appLogic",
|
||||
"child",
|
||||
"parent"
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
"userId": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"encodedAction",
|
||||
"integrity",
|
||||
"sequenceNumber",
|
||||
"type",
|
||||
"userId"
|
||||
]
|
||||
"$ref": "#/definitions/ClientPushChangesRequestAction"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -2258,6 +2288,7 @@ export const isClientPushChangesRequest: (value: object) => value is ClientPushC
|
||||
"actions",
|
||||
"deviceAuthToken"
|
||||
],
|
||||
"definitions": definitions,
|
||||
"$schema": "http://json-schema.org/draft-07/schema#"
|
||||
})
|
||||
export const isClientPullChangesRequest: (value: object) => value is ClientPullChangesRequest = ajv.compile({
|
||||
@@ -2501,6 +2532,9 @@ export const isSerializedParentAction: (value: object) => value is SerializedPar
|
||||
{
|
||||
"$ref": "#/definitions/SerializedUpdateCategoryBlockedTimesAction"
|
||||
},
|
||||
{
|
||||
"$ref": "#/definitions/SerializedUpdatCategoryDisableLimitsAction"
|
||||
},
|
||||
{
|
||||
"$ref": "#/definitions/SerializedUpdateCategorySortingAction"
|
||||
},
|
||||
|
||||
+3
-1
@@ -29,7 +29,7 @@ function parseYesNo (value: string) {
|
||||
} else if (value === 'no') {
|
||||
return false
|
||||
} else {
|
||||
throw new Error('invalid value "' + value + '", expected "yes" or "no"')
|
||||
throw new ParseYesNoException('invalid value "' + value + '", expected "yes" or "no"')
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,3 +39,5 @@ export const config: Config = {
|
||||
pingInterval: parseInt(process.env.PING_INTERVAL_SEC || '25', 10) * 1000,
|
||||
alwaysPro: process.env.ALWAYS_PRO ? parseYesNo(process.env.ALWAYS_PRO) : false
|
||||
}
|
||||
|
||||
class ParseYesNoException extends Error {}
|
||||
|
||||
@@ -34,6 +34,8 @@ export type AppModelStatic = typeof Sequelize.Model & {
|
||||
new (values?: object, options?: Sequelize.BuildOptions): AppModel;
|
||||
}
|
||||
|
||||
export const maxPackageNameLength = 255
|
||||
|
||||
export const attributes: SequelizeAttributes<AppAttributes> = {
|
||||
familyId: {
|
||||
...familyIdColumn,
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user