Files
timelimit-server/src/api/validator.ts
T

1855 lines
38 KiB
TypeScript

// tslint:disable
import { ClientPushChangesRequest, ClientPullChangesRequest, SignInWithGoogleRequest, 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"
}
},
"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"
]
},
"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"
}
},
"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"
}
},
"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"
}
},
"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"
]
},
"SerializedSetCategoryExtraTimeAction": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"SET_CATEGORY_EXTRA_TIME"
]
},
"categoryId": {
"type": "string"
},
"newExtraTime": {
"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"
]
},
"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"
]
},
"SerializedUpdateCategoryTemporarilyBlockedAction": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"UPDATE_CATEGORY_TEMPORARILY_BLOCKED"
]
},
"categoryId": {
"type": "string"
},
"blocked": {
"type": "boolean"
}
},
"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"
]
},
"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"
}
},
"additionalProperties": false,
"required": [
"days",
"extraTime",
"ruleId",
"time",
"type"
]
},
"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"
]
},
"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"
]
}
}
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 isSignInWithGoogleRequest: (value: object) => value is SignInWithGoogleRequest = ajv.compile({
"type": "object",
"properties": {
"googleAuthToken": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"googleAuthToken"
],
"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/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/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/SerializedUpdateCategoryBlockAllNotificationsAction"
},
{
"$ref": "#/definitions/SerializedUpdateCategoryBlockedTimesAction"
},
{
"$ref": "#/definitions/SerializedUpdateCategoryTemporarilyBlockedAction"
},
{
"$ref": "#/definitions/SerializedUpdateCategoryTimeWarningsAction"
},
{
"$ref": "#/definitions/SerializedUpdateCategoryTitleAction"
},
{
"$ref": "#/definitions/SerializedUpdateDeviceNameAction"
},
{
"$ref": "#/definitions/SerializedUpdateEnableActivityLevelBlockingAction"
},
{
"$ref": "#/definitions/SerialiizedUpdateNetworkTimeVerificationAction"
},
{
"$ref": "#/definitions/SerializedUpdateParentNotificationFlagsAction"
},
{
"$ref": "#/definitions/SerializedUpdateTimelimitRuleAction"
}
],
"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/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#"
})