diff --git a/lib/types/validators/user-validators.js b/lib/types/validators/user-validators.js index c396acc7b..240d57788 100644 --- a/lib/types/validators/user-validators.js +++ b/lib/types/validators/user-validators.js @@ -1,87 +1,87 @@ // @flow import t, { type TInterface, type TUnion, type TEnums } from 'tcomb'; import { policyTypeValidator } from '../../facts/policies.js'; import { mixedRawThreadInfoValidator } from '../../permissions/minimally-encoded-raw-thread-info-validators.js'; -import { tShape, tID } from '../../utils/validation-utils.js'; +import { tShape, tID, tUserID } from '../../utils/validation-utils.js'; import type { LogOutResponse, RegisterResponse, ServerLogInResponse, ClaimUsernameResponse, } from '../account-types.js'; import { type ClientAvatar, clientAvatarValidator, type UpdateUserAvatarResponse, } from '../avatar-types.js'; import { rawEntryInfoValidator } from '../entry-types.js'; import { rawMessageInfoValidator, messageTruncationStatusesValidator, } from '../message-types.js'; import { type SubscriptionUpdateResponse, threadSubscriptionValidator, } from '../subscription-types.js'; import { createUpdatesResultValidator } from '../update-types.js'; import { loggedOutUserInfoValidator, loggedInUserInfoValidator, userInfoValidator, } from '../user-types.js'; export const registerResponseValidator: TInterface = tShape({ - id: t.String, + id: tUserID, rawMessageInfos: t.list(rawMessageInfoValidator), currentUserInfo: loggedInUserInfoValidator, cookieChange: tShape({ threadInfos: t.dict(tID, mixedRawThreadInfoValidator), userInfos: t.list(userInfoValidator), }), }); export const logOutResponseValidator: TInterface = tShape({ currentUserInfo: loggedOutUserInfoValidator, }); export const logInResponseValidator: TInterface = tShape({ currentUserInfo: loggedInUserInfoValidator, rawMessageInfos: t.list(rawMessageInfoValidator), truncationStatuses: messageTruncationStatusesValidator, userInfos: t.list(userInfoValidator), rawEntryInfos: t.maybe(t.list(rawEntryInfoValidator)), serverTime: t.Number, cookieChange: tShape({ threadInfos: t.dict(tID, mixedRawThreadInfoValidator), userInfos: t.list(userInfoValidator), }), notAcknowledgedPolicies: t.maybe(t.list(policyTypeValidator)), }); export const subscriptionUpdateResponseValidator: TInterface = tShape({ threadSubscription: threadSubscriptionValidator, }); export const updateUserAvatarResponseValidator: TInterface = tShape({ updates: createUpdatesResultValidator, }); export const updateUserAvatarResponderValidator: TUnion< ?ClientAvatar | UpdateUserAvatarResponse, > = t.union([ t.maybe(clientAvatarValidator), updateUserAvatarResponseValidator, ]); export const claimUsernameResponseValidator: TInterface = tShape({ message: t.String, signature: t.String, });