diff --git a/lib/types/tunnelbroker/message-receive-confirmation-types.js b/lib/types/tunnelbroker/message-receive-confirmation-types.js index db7c32ab9..6a2d72cbe 100644 --- 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 index 9302e1aad..e28f977fb 100644 --- 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 index 48008f568..23857c374 100644 --- 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 index 434441e0e..37e86075e 100644 --- a/lib/types/tunnelbroker/session-types.js +++ b/lib/types/tunnelbroker/session-types.js @@ -1,52 +1,26 @@ // @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 = { +type: 'ConnectionInitializationMessage', +deviceID: string, +accessToken: string, +userID: string, +notifyToken?: ?string, +deviceType: TunnelbrokerDeviceTypes, +deviceAppVersion?: ?string, +deviceOS?: ?string, }; export type AnonymousInitializationMessage = { +type: 'AnonymousInitializationMessage', +deviceID: string, +deviceType: TunnelbrokerDeviceTypes, +deviceAppVersion?: ?string, +deviceOS?: ?string, }; 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), - });