diff --git a/lib/types/tunnelbroker/message-receive-confirmation-types.js b/lib/types/tunnelbroker/message-receive-confirmation-types.js --- a/lib/types/tunnelbroker/message-receive-confirmation-types.js +++ b/lib/types/tunnelbroker/message-receive-confirmation-types.js @@ -1,17 +1,6 @@ // @flow -import type { TInterface } from 'tcomb'; -import t from 'tcomb'; - -import { tShape, tString } from '../../utils/validation-utils.js'; - export type MessageReceiveConfirmation = { +type: 'MessageReceiveConfirmation', +messageIDs: $ReadOnlyArray, }; - -export const messageReceiveConfirmationValidator: TInterface = - tShape({ - type: tString('MessageReceiveConfirmation'), - messageIDs: t.list(t.String), - }); diff --git a/lib/types/tunnelbroker/message-to-device-request-types.js b/lib/types/tunnelbroker/message-to-device-request-types.js --- a/lib/types/tunnelbroker/message-to-device-request-types.js +++ b/lib/types/tunnelbroker/message-to-device-request-types.js @@ -1,21 +1,8 @@ // @flow -import type { TInterface } from 'tcomb'; -import t from 'tcomb'; - -import { tShape, tString } from '../../utils/validation-utils.js'; - export type MessageToDeviceRequest = { +type: 'MessageToDeviceRequest', +clientMessageID: string, +deviceID: string, +payload: string, }; - -export const messageToDeviceRequestValidator: TInterface = - tShape({ - type: tString('MessageToDeviceRequest'), - clientMessageID: t.String, - deviceID: t.String, - payload: t.String, - }); diff --git a/lib/types/tunnelbroker/message-to-tunnelbroker-request-types.js b/lib/types/tunnelbroker/message-to-tunnelbroker-request-types.js --- a/lib/types/tunnelbroker/message-to-tunnelbroker-request-types.js +++ b/lib/types/tunnelbroker/message-to-tunnelbroker-request-types.js @@ -1,19 +1,7 @@ // @flow -import type { TInterface } from 'tcomb'; -import t from 'tcomb'; - -import { tShape, tString } from '../../utils/validation-utils.js'; - export type MessageToTunnelbrokerRequest = { +type: 'MessageToTunnelbrokerRequest', +clientMessageID: string, +payload: string, }; - -export const messageToTunnelbrokerRequestValidator: TInterface = - tShape({ - type: tString('MessageToTunnelbrokerRequest'), - clientMessageID: t.String, - payload: t.String, - }); diff --git a/lib/types/tunnelbroker/session-types.js b/lib/types/tunnelbroker/session-types.js --- a/lib/types/tunnelbroker/session-types.js +++ b/lib/types/tunnelbroker/session-types.js @@ -1,10 +1,5 @@ // @flow -import type { TInterface } from 'tcomb'; -import t from 'tcomb'; - -import { tShape, tString, tUserID } from '../../utils/validation-utils.js'; - export type TunnelbrokerDeviceTypes = 'mobile' | 'web' | 'keyserver'; export type ConnectionInitializationMessage = { @@ -29,24 +24,3 @@ export type TunnelbrokerInitializationMessage = | ConnectionInitializationMessage | AnonymousInitializationMessage; - -export const connectionInitializationMessageValidator: TInterface = - tShape({ - type: tString('ConnectionInitializationMessage'), - deviceID: t.String, - accessToken: t.String, - userID: tUserID, - notifyToken: t.maybe(t.String), - deviceType: t.enums.of(['mobile', 'web', 'keyserver']), - deviceAppVersion: t.maybe(t.String), - deviceOS: t.maybe(t.String), - }); - -export const anonymousInitializationMessageValidator: TInterface = - tShape({ - type: tString('AnonymousInitializationMessage'), - deviceID: t.String, - deviceType: t.enums.of(['mobile', 'web', 'keyserver']), - deviceAppVersion: t.maybe(t.String), - deviceOS: t.maybe(t.String), - });