timelimit-server/src/api/validator.ts
2020-09-14 02:00:00 +02:00

2782 lines
56 KiB
TypeScript

// tslint:disable
import { ClientPushChangesRequest, ClientPullChangesRequest, MailAuthTokenRequestBody, CreateFamilyByMailTokenRequest, SignIntoFamilyRequest, RecoverParentPasswordRequest, CanRecoverPasswordRequest, RegisterChildDeviceRequest, SerializedParentAction, SerializedAppLogicAction, SerializedChildAction, CreateRegisterDeviceTokenRequest, CanDoPurchaseRequest, FinishPurchaseByGooglePlayRequest, LinkParentMailAddressRequest, UpdatePrimaryDeviceRequest, RemoveDeviceRequest, RequestWithAuthToken, SendMailLoginCodeRequest, SignInByMailCodeRequest } from './schema'
const Ajv = require('ajv')
const ajv = new Ajv()
const definitions = {
"ClientDataStatus": {
"type": "object",
"properties": {
"devices": {
"type": "string"
},
"apps": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"categories": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/CategoryDataStatus"
}
},
"users": {
"type": "string"
},
"clientLevel": {
"type": "number"
}
},
"additionalProperties": false,
"required": [
"apps",
"categories",
"devices",
"users"
]
},
"CategoryDataStatus": {
"type": "object",
"properties": {
"base": {
"type": "string"
},
"apps": {
"type": "string"
},
"rules": {
"type": "string"
},
"usedTime": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"apps",
"base",
"rules",
"usedTime"
]
},
"ParentPassword": {
"type": "object",
"properties": {
"hash": {
"type": "string"
},
"secondHash": {
"type": "string"
},
"secondSalt": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"hash",
"secondHash",
"secondSalt"
]
},
"NewDeviceInfo": {
"type": "object",
"properties": {
"model": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"model"
]
},
"SerializedAddCategoryAppsAction": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"ADD_CATEGORY_APPS"
]
},
"categoryId": {
"type": "string"
},
"packageNames": {
"type": "array",
"items": {
"type": "string"
}
}
},
"additionalProperties": false,
"required": [
"categoryId",
"packageNames",
"type"
]
},
"SerializedAddCategoryNetworkIdAction": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"ADD_CATEGORY_NETWORK_ID"
]
},
"categoryId": {
"type": "string"
},
"itemId": {
"type": "string"
},
"hashedNetworkId": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"categoryId",
"hashedNetworkId",
"itemId",
"type"
]
},
"SerializedAddUserAction": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"ADD_USER"
]
},
"name": {
"type": "string"
},
"userType": {
"enum": [
"child",
"parent"
],
"type": "string"
},
"userId": {
"type": "string"
},
"password": {
"$ref": "#/definitions/ParentPassword"
},
"timeZone": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"name",
"timeZone",
"type",
"userId",
"userType"
]
},
"SerializedChangeParentPasswordAction": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"CHANGE_PARENT_PASSWORD"
]
},
"userId": {
"type": "string"
},
"hash": {
"type": "string"
},
"secondSalt": {
"type": "string"
},
"secondHashEncrypted": {
"type": "string"
},
"integrity": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"hash",
"integrity",
"secondHashEncrypted",
"secondSalt",
"type",
"userId"
]
},
"SerializedCreateCategoryAction": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"CREATE_CATEGORY"
]
},
"childId": {
"type": "string"
},
"categoryId": {
"type": "string"
},
"title": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"categoryId",
"childId",
"title",
"type"
]
},
"SerializedCreateTimelimtRuleAction": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"CREATE_TIMELIMIT_RULE"
]
},
"rule": {
"$ref": "#/definitions/SerializedTimeLimitRule"
}
},
"additionalProperties": false,
"required": [
"rule",
"type"
]
},
"SerializedTimeLimitRule": {
"type": "object",
"properties": {
"ruleId": {
"type": "string"
},
"categoryId": {
"type": "string"
},
"time": {
"type": "number"
},
"days": {
"type": "number"
},
"extraTime": {
"type": "boolean"
},
"start": {
"type": "number"
},
"end": {
"type": "number"
},
"dur": {
"type": "number"
},
"pause": {
"type": "number"
}
},
"additionalProperties": false,
"required": [
"categoryId",
"days",
"extraTime",
"ruleId",
"time"
]
},
"SerializedDeleteCategoryAction": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"DELETE_CATEGORY"
]
},
"categoryId": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"categoryId",
"type"
]
},
"SerializedDeleteTimeLimitRuleAction": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"DELETE_TIMELIMIT_RULE"
]
},
"ruleId": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"ruleId",
"type"
]
},
"SerializedIgnoreManipulationAction": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"IGNORE_MANIPULATION"
]
},
"deviceId": {
"type": "string"
},
"admin": {
"type": "boolean"
},
"adminA": {
"type": "boolean"
},
"downgrade": {
"type": "boolean"
},
"notification": {
"type": "boolean"
},
"usageStats": {
"type": "boolean"
},
"hadManipulation": {
"type": "boolean"
},
"reboot": {
"type": "boolean"
},
"overlay": {
"type": "boolean"
},
"accessibilityService": {
"type": "boolean"
},
"ignoreHadManipulationFlags": {
"type": "number"
}
},
"additionalProperties": false,
"required": [
"admin",
"adminA",
"deviceId",
"downgrade",
"hadManipulation",
"notification",
"type",
"usageStats"
]
},
"SerializedIncrementCategoryExtraTimeAction": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"INCREMENT_CATEGORY_EXTRATIME"
]
},
"categoryId": {
"type": "string"
},
"addedExtraTime": {
"type": "number"
},
"day": {
"type": "number"
}
},
"additionalProperties": false,
"required": [
"addedExtraTime",
"categoryId",
"type"
]
},
"SerializedRemoveCategoryAppsAction": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"REMOVE_CATEGORY_APPS"
]
},
"categoryId": {
"type": "string"
},
"packageNames": {
"type": "array",
"items": {
"type": "string"
}
}
},
"additionalProperties": false,
"required": [
"categoryId",
"packageNames",
"type"
]
},
"SerializedRemoveUserAction": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"REMOVE_USER"
]
},
"userId": {
"type": "string"
},
"authentication": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"type",
"userId"
]
},
"SerializedRenameChildAction": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"RENAME_CHILD"
]
},
"childId": {
"type": "string"
},
"newName": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"childId",
"newName",
"type"
]
},
"SerializeResetCategoryNetworkIdsAction": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"RESET_CATEGORY_NETWORK_IDS"
]
},
"categoryId": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"categoryId",
"type"
]
},
"SerializedResetParentBlockedTimesAction": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"RESET_PARENT_BLOCKED_TIMES"
]
},
"parentId": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"parentId",
"type"
]
},
"SerializedSetCategoryExtraTimeAction": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"SET_CATEGORY_EXTRA_TIME"
]
},
"categoryId": {
"type": "string"
},
"newExtraTime": {
"type": "number"
},
"day": {
"type": "number"
}
},
"additionalProperties": false,
"required": [
"categoryId",
"newExtraTime",
"type"
]
},
"SerializedSetCategoryForUnassignedAppsAction": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"SET_CATEGORY_FOR_UNASSIGNED_APPS"
]
},
"childId": {
"type": "string"
},
"categoryId": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"categoryId",
"childId",
"type"
]
},
"SerializedSetChildPasswordAction": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"SET_CHILD_PASSWORD"
]
},
"childId": {
"type": "string"
},
"newPassword": {
"$ref": "#/definitions/ParentPassword"
}
},
"additionalProperties": false,
"required": [
"childId",
"newPassword",
"type"
]
},
"SerializedSetConsiderRebootManipulationAction": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"SET_CONSIDER_REBOOT_MANIPULATION"
]
},
"deviceId": {
"type": "string"
},
"enable": {
"type": "boolean"
}
},
"additionalProperties": false,
"required": [
"deviceId",
"enable",
"type"
]
},
"SerializedSetDeviceDefaultUserAction": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"SET_DEVICE_DEFAULT_USER"
]
},
"deviceId": {
"type": "string"
},
"defaultUserId": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"defaultUserId",
"deviceId",
"type"
]
},
"SerializedSetDeviceDefaultUserTimeoutAction": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"SET_DEVICE_DEFAULT_USER_TIMEOUT"
]
},
"deviceId": {
"type": "string"
},
"timeout": {
"type": "number"
}
},
"additionalProperties": false,
"required": [
"deviceId",
"timeout",
"type"
]
},
"SerializedSetDeviceUserAction": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"SET_DEVICE_USER"
]
},
"deviceId": {
"type": "string"
},
"userId": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"deviceId",
"type",
"userId"
]
},
"SerializedSetKeepSignedInAction": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"SET_KEEP_SIGNED_IN"
]
},
"deviceId": {
"type": "string"
},
"keepSignedIn": {
"type": "boolean"
}
},
"additionalProperties": false,
"required": [
"deviceId",
"keepSignedIn",
"type"
]
},
"SerializedSetParentCategoryAction": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"SET_PARENT_CATEGORY"
]
},
"categoryId": {
"type": "string"
},
"parentCategory": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"categoryId",
"parentCategory",
"type"
]
},
"SerializedSetRelaxPrimaryDeviceAction": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"SET_RELAX_PRIMARY_DEVICE"
]
},
"userId": {
"type": "string"
},
"relax": {
"type": "boolean"
}
},
"additionalProperties": false,
"required": [
"relax",
"type",
"userId"
]
},
"SerializedSetSendDeviceConnected": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"SET_SEND_DEVICE_CONNECTED"
]
},
"deviceId": {
"type": "string"
},
"enable": {
"type": "boolean"
}
},
"additionalProperties": false,
"required": [
"deviceId",
"enable",
"type"
]
},
"SerializedSetUserDisableLimitsUntilAction": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"SET_USER_DISABLE_LIMITS_UNTIL"
]
},
"childId": {
"type": "string"
},
"time": {
"type": "number"
}
},
"additionalProperties": false,
"required": [
"childId",
"time",
"type"
]
},
"SerializedSetUserTimezoneAction": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"SET_USER_TIMEZONE"
]
},
"userId": {
"type": "string"
},
"timezone": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"timezone",
"type",
"userId"
]
},
"SerializedUpdateCategoryBatteryLimitAction": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"UPDATE_CATEGORY_BATTERY_LIMIT"
]
},
"categoryId": {
"type": "string"
},
"chargeLimit": {
"type": "number"
},
"mobileLimit": {
"type": "number"
}
},
"additionalProperties": false,
"required": [
"categoryId",
"type"
]
},
"SerializedUpdateCategoryBlockAllNotificationsAction": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"UPDATE_CATEGORY_BLOCK_ALL_NOTIFICATIONS"
]
},
"categoryId": {
"type": "string"
},
"blocked": {
"type": "boolean"
}
},
"additionalProperties": false,
"required": [
"blocked",
"categoryId",
"type"
]
},
"SerializedUpdateCategoryBlockedTimesAction": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"UPDATE_CATEGORY_BLOCKED_TIMES"
]
},
"categoryId": {
"type": "string"
},
"times": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"categoryId",
"times",
"type"
]
},
"SerializedUpdateCategorySortingAction": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"UPDATE_CATEGORY_SORTING"
]
},
"categoryIds": {
"type": "array",
"items": {
"type": "string"
}
}
},
"additionalProperties": false,
"required": [
"categoryIds",
"type"
]
},
"SerializedUpdateCategoryTemporarilyBlockedAction": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"UPDATE_CATEGORY_TEMPORARILY_BLOCKED"
]
},
"categoryId": {
"type": "string"
},
"blocked": {
"type": "boolean"
},
"endTime": {
"type": "number"
}
},
"additionalProperties": false,
"required": [
"blocked",
"categoryId",
"type"
]
},
"SerializedUpdateCategoryTimeWarningsAction": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"UPDATE_CATEGORY_TIME_WARNINGS"
]
},
"categoryId": {
"type": "string"
},
"enable": {
"type": "boolean"
},
"flags": {
"type": "number"
}
},
"additionalProperties": false,
"required": [
"categoryId",
"enable",
"flags",
"type"
]
},
"SerializedUpdateCategoryTitleAction": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"UPDATE_CATEGORY_TITLE"
]
},
"categoryId": {
"type": "string"
},
"newTitle": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"categoryId",
"newTitle",
"type"
]
},
"SerializedUpdateDeviceNameAction": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"UPDATE_DEVICE_NAME"
]
},
"deviceId": {
"type": "string"
},
"name": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"deviceId",
"name",
"type"
]
},
"SerializedUpdateEnableActivityLevelBlockingAction": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"UPDATE_ENABLE_ACTIVITY_LEVEL_BLOCKING"
]
},
"deviceId": {
"type": "string"
},
"enable": {
"type": "boolean"
}
},
"additionalProperties": false,
"required": [
"deviceId",
"enable",
"type"
]
},
"SerialiizedUpdateNetworkTimeVerificationAction": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"UPDATE_NETWORK_TIME_VERIFICATION"
]
},
"deviceId": {
"type": "string"
},
"mode": {
"enum": [
"disabled",
"enabled",
"if possible"
],
"type": "string"
}
},
"additionalProperties": false,
"required": [
"deviceId",
"mode",
"type"
]
},
"SerializedUpdateParentBlockedTimesAction": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"UPDATE_PARENT_BLOCKED_TIMES"
]
},
"parentId": {
"type": "string"
},
"times": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"parentId",
"times",
"type"
]
},
"SerializedUpdateParentNotificationFlagsAction": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"UPDATE_PARENT_NOTIFICATION_FLAGS"
]
},
"parentId": {
"type": "string"
},
"flags": {
"type": "number"
},
"set": {
"type": "boolean"
}
},
"additionalProperties": false,
"required": [
"flags",
"parentId",
"set",
"type"
]
},
"SerializedUpdateTimelimitRuleAction": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"UPDATE_TIMELIMIT_RULE"
]
},
"ruleId": {
"type": "string"
},
"time": {
"type": "number"
},
"days": {
"type": "number"
},
"extraTime": {
"type": "boolean"
},
"start": {
"type": "number"
},
"end": {
"type": "number"
},
"dur": {
"type": "number"
},
"pause": {
"type": "number"
}
},
"additionalProperties": false,
"required": [
"days",
"extraTime",
"ruleId",
"time",
"type"
]
},
"SerializedUpdateUserFlagsAction": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"UPDATE_USER_FLAGS"
]
},
"userId": {
"type": "string"
},
"modified": {
"type": "number"
},
"values": {
"type": "number"
}
},
"additionalProperties": false,
"required": [
"modified",
"type",
"userId",
"values"
]
},
"SerializedUpdateUserLimitLoginCategory": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"UPDATE_USER_LIMIT_LOGIN_CATEGORY"
]
},
"userId": {
"type": "string"
},
"categoryId": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"type",
"userId"
]
},
"SerializedAddInstalledAppsAction": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"ADD_INSTALLED_APPS"
]
},
"apps": {
"type": "array",
"items": {
"$ref": "#/definitions/SerializedInstalledApp"
}
}
},
"additionalProperties": false,
"required": [
"apps",
"type"
]
},
"SerializedInstalledApp": {
"type": "object",
"properties": {
"packageName": {
"type": "string"
},
"title": {
"type": "string"
},
"isLaunchable": {
"type": "boolean"
},
"recommendation": {
"$ref": "#/definitions/AppRecommendation"
}
},
"additionalProperties": false,
"required": [
"isLaunchable",
"packageName",
"recommendation",
"title"
]
},
"AppRecommendation": {
"enum": [
"blacklist",
"none",
"whitelist"
],
"type": "string"
},
"SerializedAddUsedTimeAction": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"ADD_USED_TIME"
]
},
"categoryId": {
"type": "string"
},
"day": {
"type": "number"
},
"timeToAdd": {
"type": "number"
},
"extraTimeToSubtract": {
"type": "number"
}
},
"additionalProperties": false,
"required": [
"categoryId",
"day",
"extraTimeToSubtract",
"timeToAdd",
"type"
]
},
"SerializedAddUsedTimeActionVersion2": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"ADD_USED_TIME_V2"
]
},
"d": {
"type": "number"
},
"i": {
"type": "array",
"items": {
"type": "object",
"properties": {
"categoryId": {
"type": "string"
},
"tta": {
"type": "number"
},
"etts": {
"type": "number"
},
"as": {
"type": "array",
"items": {
"type": "array",
"items": [
{
"type": "number"
},
{
"type": "number"
}
],
"minItems": 2,
"additionalItems": {
"anyOf": [
{
"type": "number"
},
{
"type": "number"
}
]
}
}
},
"sdl": {
"type": "array",
"items": {
"type": "array",
"items": [
{
"type": "number"
},
{
"type": "number"
},
{
"type": "number"
},
{
"type": "number"
}
],
"minItems": 4,
"additionalItems": {
"anyOf": [
{
"type": "number"
},
{
"type": "number"
},
{
"type": "number"
},
{
"type": "number"
}
]
}
}
}
},
"additionalProperties": false,
"required": [
"categoryId",
"etts",
"tta"
]
}
},
"t": {
"type": "number"
}
},
"additionalProperties": false,
"required": [
"d",
"i",
"type"
]
},
"SerializedForceSyncAction": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"FORCE_SYNC"
]
}
},
"additionalProperties": false,
"required": [
"type"
]
},
"SerializedRemoveInstalledAppsAction": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"REMOVE_INSTALLED_APPS"
]
},
"packageNames": {
"type": "array",
"items": {
"type": "string"
}
}
},
"additionalProperties": false,
"required": [
"packageNames",
"type"
]
},
"SerializedSignOutAtDeviceAction": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"SIGN_OUT_AT_DEVICE"
]
}
},
"additionalProperties": false,
"required": [
"type"
]
},
"SerialiezdTriedDisablingDeviceAdminAction": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"TRIED_DISABLING_DEVICE_ADMIN"
]
}
},
"additionalProperties": false,
"required": [
"type"
]
},
"SerializedUpdateAppActivitiesAction": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"UPDATE_APP_ACTIVITIES"
]
},
"removed": {
"type": "array",
"items": {
"type": "array",
"items": [
{
"type": "string"
},
{
"type": "string"
}
],
"minItems": 2,
"additionalItems": {
"anyOf": [
{
"type": "string"
},
{
"type": "string"
}
]
}
}
},
"updatedOrAdded": {
"type": "array",
"items": {
"$ref": "#/definitions/SerializedAppActivityItem"
}
}
},
"additionalProperties": false,
"required": [
"removed",
"type",
"updatedOrAdded"
]
},
"SerializedAppActivityItem": {
"type": "object",
"properties": {
"p": {
"type": "string"
},
"c": {
"type": "string"
},
"t": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"c",
"p",
"t"
]
},
"SerializedUpdateDeviceStatusAction": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"UPDATE_DEVICE_STATUS"
]
},
"protectionLevel": {
"enum": [
"device owner",
"none",
"password device admin",
"simple device admin"
],
"type": "string"
},
"usageStats": {
"enum": [
"granted",
"not granted",
"not required"
],
"type": "string"
},
"notificationAccess": {
"enum": [
"granted",
"not granted",
"not supported"
],
"type": "string"
},
"overlayPermission": {
"enum": [
"granted",
"not granted",
"not required"
],
"type": "string"
},
"accessibilityServiceEnabled": {
"type": "boolean"
},
"appVersion": {
"type": "number"
},
"didReboot": {
"type": "boolean"
},
"isQOrLaterNow": {
"type": "boolean"
}
},
"additionalProperties": false,
"required": [
"type"
]
},
"SerializedChildChangePasswordAction": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"CHILD_CHANGE_PASSWORD"
]
},
"password": {
"$ref": "#/definitions/ParentPassword"
}
},
"additionalProperties": false,
"required": [
"password",
"type"
]
},
"SerializedChildSignInAction": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"CHILD_SIGN_IN"
]
}
},
"additionalProperties": false,
"required": [
"type"
]
},
"ServerDeviceList": {
"type": "object",
"properties": {
"version": {
"type": "string"
},
"data": {
"type": "array",
"items": {
"$ref": "#/definitions/ServerDeviceData"
}
}
},
"additionalProperties": false,
"required": [
"data",
"version"
]
},
"ServerDeviceData": {
"type": "object",
"properties": {
"deviceId": {
"type": "string"
},
"name": {
"type": "string"
},
"model": {
"type": "string"
},
"addedAt": {
"type": "number"
},
"currentUserId": {
"type": "string"
},
"networkTime": {
"enum": [
"disabled",
"enabled",
"if possible"
],
"type": "string"
},
"cProtectionLevel": {
"$ref": "#/definitions/ProtectionLevel"
},
"hProtectionLevel": {
"$ref": "#/definitions/ProtectionLevel"
},
"cUsageStats": {
"$ref": "#/definitions/RuntimePermissionStatus"
},
"hUsageStats": {
"$ref": "#/definitions/RuntimePermissionStatus"
},
"cNotificationAccess": {
"$ref": "#/definitions/NewPermissionStatus"
},
"hNotificationAccess": {
"$ref": "#/definitions/NewPermissionStatus"
},
"cAppVersion": {
"type": "number"
},
"hAppVersion": {
"type": "number"
},
"tDisablingAdmin": {
"type": "boolean"
},
"reboot": {
"type": "boolean"
},
"hadManipulation": {
"type": "boolean"
},
"hadManipulationFlags": {
"type": "number"
},
"reportUninstall": {
"type": "boolean"
},
"isUserKeptSignedIn": {
"type": "boolean"
},
"showDeviceConnected": {
"type": "boolean"
},
"defUser": {
"type": "string"
},
"defUserTimeout": {
"type": "number"
},
"rebootIsManipulation": {
"type": "boolean"
},
"cOverlay": {
"$ref": "#/definitions/RuntimePermissionStatus"
},
"hOverlay": {
"$ref": "#/definitions/RuntimePermissionStatus"
},
"asEnabled": {
"type": "boolean"
},
"wasAsEnabled": {
"type": "boolean"
},
"activityLevelBlocking": {
"type": "boolean"
},
"qOrLater": {
"type": "boolean"
}
},
"additionalProperties": false,
"required": [
"activityLevelBlocking",
"addedAt",
"asEnabled",
"cAppVersion",
"cNotificationAccess",
"cOverlay",
"cProtectionLevel",
"cUsageStats",
"currentUserId",
"defUser",
"defUserTimeout",
"deviceId",
"hAppVersion",
"hNotificationAccess",
"hOverlay",
"hProtectionLevel",
"hUsageStats",
"hadManipulation",
"hadManipulationFlags",
"isUserKeptSignedIn",
"model",
"name",
"networkTime",
"qOrLater",
"reboot",
"rebootIsManipulation",
"reportUninstall",
"showDeviceConnected",
"tDisablingAdmin",
"wasAsEnabled"
]
},
"ProtectionLevel": {
"enum": [
"device owner",
"none",
"password device admin",
"simple device admin"
],
"type": "string"
},
"RuntimePermissionStatus": {
"enum": [
"granted",
"not granted",
"not required"
],
"type": "string"
},
"NewPermissionStatus": {
"enum": [
"granted",
"not granted",
"not supported"
],
"type": "string"
},
"ServerInstalledAppsData": {
"type": "object",
"properties": {
"deviceId": {
"type": "string"
},
"version": {
"type": "string"
},
"apps": {
"type": "array",
"items": {
"$ref": "#/definitions/SerializedInstalledApp"
}
},
"activities": {
"type": "array",
"items": {
"$ref": "#/definitions/SerializedAppActivityItem"
}
}
},
"additionalProperties": false,
"required": [
"activities",
"apps",
"deviceId",
"version"
]
},
"ServerUpdatedCategoryBaseData": {
"type": "object",
"properties": {
"categoryId": {
"type": "string"
},
"childId": {
"type": "string"
},
"title": {
"type": "string"
},
"blockedTimes": {
"type": "string"
},
"extraTime": {
"type": "number"
},
"extraTimeDay": {
"type": "number"
},
"tempBlocked": {
"type": "boolean"
},
"tempBlockTime": {
"type": "number"
},
"version": {
"type": "string"
},
"parentCategoryId": {
"type": "string"
},
"blockAllNotifications": {
"type": "boolean"
},
"timeWarnings": {
"type": "number"
},
"mblCharging": {
"type": "number"
},
"mblMobile": {
"type": "number"
},
"sort": {
"type": "number"
},
"networks": {
"type": "array",
"items": {
"$ref": "#/definitions/ServerCategoryNetworkId"
}
}
},
"additionalProperties": false,
"required": [
"blockAllNotifications",
"blockedTimes",
"categoryId",
"childId",
"extraTime",
"extraTimeDay",
"mblCharging",
"mblMobile",
"networks",
"parentCategoryId",
"sort",
"tempBlockTime",
"tempBlocked",
"timeWarnings",
"title",
"version"
]
},
"ServerCategoryNetworkId": {
"type": "object",
"properties": {
"itemId": {
"type": "string"
},
"hashedNetworkId": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"hashedNetworkId",
"itemId"
]
},
"ServerUpdatedCategoryAssignedApps": {
"type": "object",
"properties": {
"categoryId": {
"type": "string"
},
"apps": {
"type": "array",
"items": {
"type": "string"
}
},
"version": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"apps",
"categoryId",
"version"
]
},
"ServerUpdatedCategoryUsedTimes": {
"type": "object",
"properties": {
"categoryId": {
"type": "string"
},
"times": {
"type": "array",
"items": {
"$ref": "#/definitions/ServerUsedTimeItem"
}
},
"sessionDurations": {
"type": "array",
"items": {
"$ref": "#/definitions/ServerSessionDurationItem"
}
},
"version": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"categoryId",
"sessionDurations",
"times",
"version"
]
},
"ServerUsedTimeItem": {
"type": "object",
"properties": {
"day": {
"type": "number"
},
"time": {
"type": "number"
},
"start": {
"type": "number"
},
"end": {
"type": "number"
}
},
"additionalProperties": false,
"required": [
"day",
"end",
"start",
"time"
]
},
"ServerSessionDurationItem": {
"type": "object",
"properties": {
"md": {
"description": "the maximum duration of a session (maxSessionDuration)",
"type": "number"
},
"spd": {
"description": "the pause duration after a session (sessionPauseDuration)",
"type": "number"
},
"sm": {
"description": "the start minute of the day of the session/ the rule\nwhich created this session (startMinuteOfDay)",
"type": "number"
},
"em": {
"description": "the end minute of the day of the session/ the rule\nwhich created this session (endMinuteOfDay)",
"type": "number"
},
"l": {
"description": "the timestamp of the last usage of this session (lastUsage)",
"type": "number"
},
"d": {
"description": "the duration of the last/ current session (lastSessionDuration)",
"type": "number"
}
},
"additionalProperties": false,
"required": [
"d",
"em",
"l",
"md",
"sm",
"spd"
]
},
"ServerUpdatedTimeLimitRules": {
"type": "object",
"properties": {
"categoryId": {
"type": "string"
},
"version": {
"type": "string"
},
"rules": {
"type": "array",
"items": {
"$ref": "#/definitions/ServerTimeLimitRule"
}
}
},
"additionalProperties": false,
"required": [
"categoryId",
"rules",
"version"
]
},
"ServerTimeLimitRule": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"extraTime": {
"type": "boolean"
},
"dayMask": {
"type": "number"
},
"maxTime": {
"type": "number"
},
"start": {
"type": "number"
},
"end": {
"type": "number"
},
"session": {
"type": "number"
},
"pause": {
"type": "number"
}
},
"additionalProperties": false,
"required": [
"dayMask",
"end",
"extraTime",
"id",
"maxTime",
"pause",
"session",
"start"
]
},
"ServerUserList": {
"type": "object",
"properties": {
"version": {
"type": "string"
},
"data": {
"type": "array",
"items": {
"$ref": "#/definitions/ServerUserEntry"
}
}
},
"additionalProperties": false,
"required": [
"data",
"version"
]
},
"ServerUserEntry": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"password": {
"type": "string"
},
"secondPasswordSalt": {
"type": "string"
},
"type": {
"enum": [
"child",
"parent"
],
"type": "string"
},
"timeZone": {
"type": "string"
},
"disableLimitsUntil": {
"type": "number"
},
"mail": {
"type": "string"
},
"currentDevice": {
"type": "string"
},
"categoryForNotAssignedApps": {
"type": "string"
},
"relaxPrimaryDevice": {
"type": "boolean"
},
"mailNotificationFlags": {
"type": "number"
},
"blockedTimes": {
"type": "string"
},
"flags": {
"type": "number"
},
"llc": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"blockedTimes",
"categoryForNotAssignedApps",
"currentDevice",
"disableLimitsUntil",
"flags",
"id",
"mail",
"mailNotificationFlags",
"name",
"password",
"relaxPrimaryDevice",
"secondPasswordSalt",
"timeZone",
"type"
]
}
}
export const isClientPushChangesRequest: (value: object) => value is ClientPushChangesRequest = ajv.compile({
"type": "object",
"properties": {
"deviceAuthToken": {
"type": "string"
},
"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"
]
}
}
},
"additionalProperties": false,
"required": [
"actions",
"deviceAuthToken"
],
"$schema": "http://json-schema.org/draft-07/schema#"
})
export const isClientPullChangesRequest: (value: object) => value is ClientPullChangesRequest = ajv.compile({
"type": "object",
"properties": {
"deviceAuthToken": {
"type": "string"
},
"status": {
"$ref": "#/definitions/ClientDataStatus"
}
},
"additionalProperties": false,
"required": [
"deviceAuthToken",
"status"
],
"definitions": definitions,
"$schema": "http://json-schema.org/draft-07/schema#"
})
export const isMailAuthTokenRequestBody: (value: object) => value is MailAuthTokenRequestBody = ajv.compile({
"type": "object",
"properties": {
"mailAuthToken": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"mailAuthToken"
],
"definitions": definitions,
"$schema": "http://json-schema.org/draft-07/schema#"
})
export const isCreateFamilyByMailTokenRequest: (value: object) => value is CreateFamilyByMailTokenRequest = ajv.compile({
"type": "object",
"properties": {
"mailAuthToken": {
"type": "string"
},
"parentPassword": {
"$ref": "#/definitions/ParentPassword"
},
"parentDevice": {
"$ref": "#/definitions/NewDeviceInfo"
},
"deviceName": {
"type": "string"
},
"timeZone": {
"type": "string"
},
"parentName": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"deviceName",
"mailAuthToken",
"parentDevice",
"parentName",
"parentPassword",
"timeZone"
],
"definitions": definitions,
"$schema": "http://json-schema.org/draft-07/schema#"
})
export const isSignIntoFamilyRequest: (value: object) => value is SignIntoFamilyRequest = ajv.compile({
"type": "object",
"properties": {
"mailAuthToken": {
"type": "string"
},
"parentDevice": {
"$ref": "#/definitions/NewDeviceInfo"
},
"deviceName": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"deviceName",
"mailAuthToken",
"parentDevice"
],
"definitions": definitions,
"$schema": "http://json-schema.org/draft-07/schema#"
})
export const isRecoverParentPasswordRequest: (value: object) => value is RecoverParentPasswordRequest = ajv.compile({
"type": "object",
"properties": {
"mailAuthToken": {
"type": "string"
},
"password": {
"$ref": "#/definitions/ParentPassword"
}
},
"additionalProperties": false,
"required": [
"mailAuthToken",
"password"
],
"definitions": definitions,
"$schema": "http://json-schema.org/draft-07/schema#"
})
export const isCanRecoverPasswordRequest: (value: object) => value is CanRecoverPasswordRequest = ajv.compile({
"type": "object",
"properties": {
"mailAuthToken": {
"type": "string"
},
"parentUserId": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"mailAuthToken",
"parentUserId"
],
"definitions": definitions,
"$schema": "http://json-schema.org/draft-07/schema#"
})
export const isRegisterChildDeviceRequest: (value: object) => value is RegisterChildDeviceRequest = ajv.compile({
"type": "object",
"properties": {
"registerToken": {
"type": "string"
},
"childDevice": {
"$ref": "#/definitions/NewDeviceInfo"
},
"deviceName": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"childDevice",
"deviceName",
"registerToken"
],
"definitions": definitions,
"$schema": "http://json-schema.org/draft-07/schema#"
})
export const isSerializedParentAction: (value: object) => value is SerializedParentAction = ajv.compile({
"anyOf": [
{
"$ref": "#/definitions/SerializedAddCategoryAppsAction"
},
{
"$ref": "#/definitions/SerializedAddCategoryNetworkIdAction"
},
{
"$ref": "#/definitions/SerializedAddUserAction"
},
{
"$ref": "#/definitions/SerializedChangeParentPasswordAction"
},
{
"$ref": "#/definitions/SerializedCreateCategoryAction"
},
{
"$ref": "#/definitions/SerializedCreateTimelimtRuleAction"
},
{
"$ref": "#/definitions/SerializedDeleteCategoryAction"
},
{
"$ref": "#/definitions/SerializedDeleteTimeLimitRuleAction"
},
{
"$ref": "#/definitions/SerializedIgnoreManipulationAction"
},
{
"$ref": "#/definitions/SerializedIncrementCategoryExtraTimeAction"
},
{
"$ref": "#/definitions/SerializedRemoveCategoryAppsAction"
},
{
"$ref": "#/definitions/SerializedRemoveUserAction"
},
{
"$ref": "#/definitions/SerializedRenameChildAction"
},
{
"$ref": "#/definitions/SerializeResetCategoryNetworkIdsAction"
},
{
"$ref": "#/definitions/SerializedResetParentBlockedTimesAction"
},
{
"$ref": "#/definitions/SerializedSetCategoryExtraTimeAction"
},
{
"$ref": "#/definitions/SerializedSetCategoryForUnassignedAppsAction"
},
{
"$ref": "#/definitions/SerializedSetChildPasswordAction"
},
{
"$ref": "#/definitions/SerializedSetConsiderRebootManipulationAction"
},
{
"$ref": "#/definitions/SerializedSetDeviceDefaultUserAction"
},
{
"$ref": "#/definitions/SerializedSetDeviceDefaultUserTimeoutAction"
},
{
"$ref": "#/definitions/SerializedSetDeviceUserAction"
},
{
"$ref": "#/definitions/SerializedSetKeepSignedInAction"
},
{
"$ref": "#/definitions/SerializedSetParentCategoryAction"
},
{
"$ref": "#/definitions/SerializedSetRelaxPrimaryDeviceAction"
},
{
"$ref": "#/definitions/SerializedSetSendDeviceConnected"
},
{
"$ref": "#/definitions/SerializedSetUserDisableLimitsUntilAction"
},
{
"$ref": "#/definitions/SerializedSetUserTimezoneAction"
},
{
"$ref": "#/definitions/SerializedUpdateCategoryBatteryLimitAction"
},
{
"$ref": "#/definitions/SerializedUpdateCategoryBlockAllNotificationsAction"
},
{
"$ref": "#/definitions/SerializedUpdateCategoryBlockedTimesAction"
},
{
"$ref": "#/definitions/SerializedUpdateCategorySortingAction"
},
{
"$ref": "#/definitions/SerializedUpdateCategoryTemporarilyBlockedAction"
},
{
"$ref": "#/definitions/SerializedUpdateCategoryTimeWarningsAction"
},
{
"$ref": "#/definitions/SerializedUpdateCategoryTitleAction"
},
{
"$ref": "#/definitions/SerializedUpdateDeviceNameAction"
},
{
"$ref": "#/definitions/SerializedUpdateEnableActivityLevelBlockingAction"
},
{
"$ref": "#/definitions/SerialiizedUpdateNetworkTimeVerificationAction"
},
{
"$ref": "#/definitions/SerializedUpdateParentBlockedTimesAction"
},
{
"$ref": "#/definitions/SerializedUpdateParentNotificationFlagsAction"
},
{
"$ref": "#/definitions/SerializedUpdateTimelimitRuleAction"
},
{
"$ref": "#/definitions/SerializedUpdateUserFlagsAction"
},
{
"$ref": "#/definitions/SerializedUpdateUserLimitLoginCategory"
}
],
"definitions": definitions,
"$schema": "http://json-schema.org/draft-07/schema#"
})
export const isSerializedAppLogicAction: (value: object) => value is SerializedAppLogicAction = ajv.compile({
"anyOf": [
{
"$ref": "#/definitions/SerializedAddInstalledAppsAction"
},
{
"$ref": "#/definitions/SerializedAddUsedTimeAction"
},
{
"$ref": "#/definitions/SerializedAddUsedTimeActionVersion2"
},
{
"$ref": "#/definitions/SerializedForceSyncAction"
},
{
"$ref": "#/definitions/SerializedRemoveInstalledAppsAction"
},
{
"$ref": "#/definitions/SerializedSignOutAtDeviceAction"
},
{
"$ref": "#/definitions/SerialiezdTriedDisablingDeviceAdminAction"
},
{
"$ref": "#/definitions/SerializedUpdateAppActivitiesAction"
},
{
"$ref": "#/definitions/SerializedUpdateDeviceStatusAction"
}
],
"definitions": definitions,
"$schema": "http://json-schema.org/draft-07/schema#"
})
export const isSerializedChildAction: (value: object) => value is SerializedChildAction = ajv.compile({
"anyOf": [
{
"$ref": "#/definitions/SerializedChildChangePasswordAction"
},
{
"$ref": "#/definitions/SerializedChildSignInAction"
}
],
"definitions": definitions,
"$schema": "http://json-schema.org/draft-07/schema#"
})
export const isCreateRegisterDeviceTokenRequest: (value: object) => value is CreateRegisterDeviceTokenRequest = ajv.compile({
"type": "object",
"properties": {
"deviceAuthToken": {
"type": "string"
},
"parentId": {
"type": "string"
},
"parentPasswordSecondHash": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"deviceAuthToken",
"parentId",
"parentPasswordSecondHash"
],
"definitions": definitions,
"$schema": "http://json-schema.org/draft-07/schema#"
})
export const isCanDoPurchaseRequest: (value: object) => value is CanDoPurchaseRequest = ajv.compile({
"type": "object",
"properties": {
"type": {
"enum": [
"any",
"googleplay"
],
"type": "string"
},
"deviceAuthToken": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"deviceAuthToken",
"type"
],
"definitions": definitions,
"$schema": "http://json-schema.org/draft-07/schema#"
})
export const isFinishPurchaseByGooglePlayRequest: (value: object) => value is FinishPurchaseByGooglePlayRequest = ajv.compile({
"type": "object",
"properties": {
"deviceAuthToken": {
"type": "string"
},
"receipt": {
"type": "string"
},
"signature": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"deviceAuthToken",
"receipt",
"signature"
],
"definitions": definitions,
"$schema": "http://json-schema.org/draft-07/schema#"
})
export const isLinkParentMailAddressRequest: (value: object) => value is LinkParentMailAddressRequest = ajv.compile({
"type": "object",
"properties": {
"mailAuthToken": {
"type": "string"
},
"deviceAuthToken": {
"type": "string"
},
"parentUserId": {
"type": "string"
},
"parentPasswordSecondHash": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"deviceAuthToken",
"mailAuthToken",
"parentPasswordSecondHash",
"parentUserId"
],
"definitions": definitions,
"$schema": "http://json-schema.org/draft-07/schema#"
})
export const isUpdatePrimaryDeviceRequest: (value: object) => value is UpdatePrimaryDeviceRequest = ajv.compile({
"type": "object",
"properties": {
"action": {
"enum": [
"set this device",
"unset this device"
],
"type": "string"
},
"currentUserId": {
"type": "string"
},
"authToken": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"action",
"authToken",
"currentUserId"
],
"definitions": definitions,
"$schema": "http://json-schema.org/draft-07/schema#"
})
export const isRemoveDeviceRequest: (value: object) => value is RemoveDeviceRequest = ajv.compile({
"type": "object",
"properties": {
"deviceAuthToken": {
"type": "string"
},
"parentUserId": {
"type": "string"
},
"parentPasswordSecondHash": {
"type": "string"
},
"deviceId": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"deviceAuthToken",
"deviceId",
"parentPasswordSecondHash",
"parentUserId"
],
"definitions": definitions,
"$schema": "http://json-schema.org/draft-07/schema#"
})
export const isRequestWithAuthToken: (value: object) => value is RequestWithAuthToken = ajv.compile({
"type": "object",
"properties": {
"deviceAuthToken": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"deviceAuthToken"
],
"definitions": definitions,
"$schema": "http://json-schema.org/draft-07/schema#"
})
export const isSendMailLoginCodeRequest: (value: object) => value is SendMailLoginCodeRequest = ajv.compile({
"type": "object",
"properties": {
"mail": {
"type": "string"
},
"locale": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"locale",
"mail"
],
"definitions": definitions,
"$schema": "http://json-schema.org/draft-07/schema#"
})
export const isSignInByMailCodeRequest: (value: object) => value is SignInByMailCodeRequest = ajv.compile({
"type": "object",
"properties": {
"mailLoginToken": {
"type": "string"
},
"receivedCode": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"mailLoginToken",
"receivedCode"
],
"definitions": definitions,
"$schema": "http://json-schema.org/draft-07/schema#"
})