diff --git a/keyserver/src/responders/user-responders.js b/keyserver/src/responders/user-responders.js --- a/keyserver/src/responders/user-responders.js +++ b/keyserver/src/responders/user-responders.js @@ -33,6 +33,7 @@ authActionSources, recoveryFromDataHandlerActionSources, recoveryFromReduxActionSources, + deviceTokenUpdateRequestInputValidator, } from 'lib/types/account-types.js'; import { type ClientAvatar, @@ -45,7 +46,6 @@ SignedIdentityKeysBlob, } from 'lib/types/crypto-types.js'; import type { - DeviceType, DeviceTokenUpdateRequest, PlatformDetails, } from 'lib/types/device-types'; @@ -214,16 +214,6 @@ return result; } -type OldDeviceTokenUpdateRequest = { - +deviceType?: ?DeviceType, - +deviceToken: string, -}; -const deviceTokenUpdateRequestInputValidator = - tShape({ - deviceType: t.maybe(t.enums.of(['ios', 'android'])), - deviceToken: t.String, - }); - export const registerRequestInputValidator: TInterface = tShape({ username: t.String, diff --git a/lib/types/account-types.js b/lib/types/account-types.js --- a/lib/types/account-types.js +++ b/lib/types/account-types.js @@ -3,7 +3,7 @@ import t, { type TInterface } from 'tcomb'; import type { SignedIdentityKeysBlob } from './crypto-types.js'; -import type { PlatformDetails } from './device-types.js'; +import type { PlatformDetails, DeviceType } from './device-types.js'; import type { CalendarQuery, CalendarResult, @@ -52,9 +52,16 @@ }; export type DeviceTokenUpdateRequest = { + +deviceType?: ?DeviceType, +deviceToken: string, }; +export const deviceTokenUpdateRequestInputValidator: TInterface = + tShape({ + deviceType: t.maybe(t.enums.of(['ios', 'android'])), + deviceToken: t.String, + }); + type DeviceTokenUpdateInput = { +[keyserverID: string]: DeviceTokenUpdateRequest, }; diff --git a/lib/types/device-types.js b/lib/types/device-types.js --- a/lib/types/device-types.js +++ b/lib/types/device-types.js @@ -35,7 +35,7 @@ export type DeviceTokenUpdateRequest = { +deviceToken: ?string, - +deviceType?: DeviceType, + +deviceType?: ?DeviceType, +platformDetails?: PlatformDetails, };