Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
WIP

WIP

WIP

WIP

WIP

WIP

remove flow cyclic deps. split teams / search consts

add coverage to packagejson
  • Loading branch information
chrisnojima committed Nov 26, 2017
1 parent 4b147b7 commit 4aff76f
Show file tree
Hide file tree
Showing 68 changed files with 1,441 additions and 1,388 deletions.
5 changes: 3 additions & 2 deletions protocol/bin/flow.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,8 @@ function rpcChannelMapGen(methodName, name, response, requestType, responseType)
}

function rpcPromiseGen(methodName, name, response, requestType, responseType) {
return `\nexport const ${name}RpcPromise = (request: ${requestType}): Promise<${responseType !== 'null' ? `${capitalize(name)}Result` : 'void'}> => new Promise((resolve, reject) => engine()._rpcOutgoing(${methodName}, request, (error, result) => error ? reject(error) : resolve(result)))`
const resultType = responseType !== 'null' ? `${capitalize(name)}Result` : 'void'
return `\nexport const ${name}RpcPromise = (request: ${requestType}): Promise<${resultType}> => new Promise((resolve, reject) => engine()._rpcOutgoing(${methodName}, request, (error: RPCError, result: ${resultType}) => error ? reject(error) : resolve(${resultType === 'void' ? '' : 'result'})))`
}

// Type parsing
Expand Down Expand Up @@ -362,7 +363,7 @@ function write(typeDefs, project) {
// This file is auto-generated by client/protocol/Makefile.
${project.import || ''}
import engine, {EngineChannel} from '../../engine'
import type {Boolean, Bool, Bytes, Double, Int, Int64, Long, String, Uint, Uint64, WaitingHandlerType, RPCErrorHandler, CommonResponseHandler} from '../../engine/types'
import type {Boolean, Bool, Bytes, Double, Int, Int64, Long, String, Uint, Uint64, WaitingHandlerType, RPCErrorHandler, CommonResponseHandler, RPCError} from '../../engine/types'
`
const incomingMap =
`\nexport type IncomingCallMapType = {|` +
Expand Down
138 changes: 69 additions & 69 deletions protocol/js/flow-types-chat.js

Large diffs are not rendered by default.

34 changes: 17 additions & 17 deletions protocol/js/flow-types-gregor.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,72 +4,72 @@
// This file is auto-generated by client/protocol/Makefile.

import engine, {EngineChannel} from '../../engine'
import type {Boolean, Bool, Bytes, Double, Int, Int64, Long, String, Uint, Uint64, WaitingHandlerType, RPCErrorHandler, CommonResponseHandler} from '../../engine/types'
import type {Boolean, Bool, Bytes, Double, Int, Int64, Long, String, Uint, Uint64, WaitingHandlerType, RPCErrorHandler, CommonResponseHandler, RPCError} from '../../engine/types'


export const authAuthenticateSessionTokenRpcChannelMap = (configKeys: Array<string>, request: AuthAuthenticateSessionTokenRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'gregor.1.auth.authenticateSessionToken', request)

export const authAuthenticateSessionTokenRpcPromise = (request: AuthAuthenticateSessionTokenRpcParam): Promise<AuthAuthenticateSessionTokenResult> => new Promise((resolve, reject) => engine()._rpcOutgoing('gregor.1.auth.authenticateSessionToken', request, (error, result) => error ? reject(error) : resolve(result)))
export const authAuthenticateSessionTokenRpcPromise = (request: AuthAuthenticateSessionTokenRpcParam): Promise<AuthAuthenticateSessionTokenResult> => new Promise((resolve, reject) => engine()._rpcOutgoing('gregor.1.auth.authenticateSessionToken', request, (error: RPCError, result: AuthAuthenticateSessionTokenResult) => error ? reject(error) : resolve(result)))

export const authInternalCreateGregorSuperUserSessionTokenRpcChannelMap = (configKeys: Array<string>, request: AuthInternalCreateGregorSuperUserSessionTokenRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'gregor.1.authInternal.createGregorSuperUserSessionToken', request)

export const authInternalCreateGregorSuperUserSessionTokenRpcPromise = (request: AuthInternalCreateGregorSuperUserSessionTokenRpcParam): Promise<AuthInternalCreateGregorSuperUserSessionTokenResult> => new Promise((resolve, reject) => engine()._rpcOutgoing('gregor.1.authInternal.createGregorSuperUserSessionToken', request, (error, result) => error ? reject(error) : resolve(result)))
export const authInternalCreateGregorSuperUserSessionTokenRpcPromise = (request: AuthInternalCreateGregorSuperUserSessionTokenRpcParam): Promise<AuthInternalCreateGregorSuperUserSessionTokenResult> => new Promise((resolve, reject) => engine()._rpcOutgoing('gregor.1.authInternal.createGregorSuperUserSessionToken', request, (error: RPCError, result: AuthInternalCreateGregorSuperUserSessionTokenResult) => error ? reject(error) : resolve(result)))

export const authUpdateRevokeSessionIDsRpcChannelMap = (configKeys: Array<string>, request: AuthUpdateRevokeSessionIDsRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'gregor.1.authUpdate.revokeSessionIDs', request)

export const authUpdateRevokeSessionIDsRpcPromise = (request: AuthUpdateRevokeSessionIDsRpcParam): Promise<void> => new Promise((resolve, reject) => engine()._rpcOutgoing('gregor.1.authUpdate.revokeSessionIDs', request, (error, result) => error ? reject(error) : resolve(result)))
export const authUpdateRevokeSessionIDsRpcPromise = (request: AuthUpdateRevokeSessionIDsRpcParam): Promise<void> => new Promise((resolve, reject) => engine()._rpcOutgoing('gregor.1.authUpdate.revokeSessionIDs', request, (error: RPCError, result: void) => error ? reject(error) : resolve()))

export const incomingConsumeMessageMultiRpcChannelMap = (configKeys: Array<string>, request: IncomingConsumeMessageMultiRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'gregor.1.incoming.consumeMessageMulti', request)

export const incomingConsumeMessageMultiRpcPromise = (request: IncomingConsumeMessageMultiRpcParam): Promise<void> => new Promise((resolve, reject) => engine()._rpcOutgoing('gregor.1.incoming.consumeMessageMulti', request, (error, result) => error ? reject(error) : resolve(result)))
export const incomingConsumeMessageMultiRpcPromise = (request: IncomingConsumeMessageMultiRpcParam): Promise<void> => new Promise((resolve, reject) => engine()._rpcOutgoing('gregor.1.incoming.consumeMessageMulti', request, (error: RPCError, result: void) => error ? reject(error) : resolve()))

export const incomingConsumeMessageRpcChannelMap = (configKeys: Array<string>, request: IncomingConsumeMessageRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'gregor.1.incoming.consumeMessage', request)

export const incomingConsumeMessageRpcPromise = (request: IncomingConsumeMessageRpcParam): Promise<void> => new Promise((resolve, reject) => engine()._rpcOutgoing('gregor.1.incoming.consumeMessage', request, (error, result) => error ? reject(error) : resolve(result)))
export const incomingConsumeMessageRpcPromise = (request: IncomingConsumeMessageRpcParam): Promise<void> => new Promise((resolve, reject) => engine()._rpcOutgoing('gregor.1.incoming.consumeMessage', request, (error: RPCError, result: void) => error ? reject(error) : resolve()))

export const incomingConsumePublishMessageRpcChannelMap = (configKeys: Array<string>, request: IncomingConsumePublishMessageRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'gregor.1.incoming.consumePublishMessage', request)

export const incomingConsumePublishMessageRpcPromise = (request: IncomingConsumePublishMessageRpcParam): Promise<void> => new Promise((resolve, reject) => engine()._rpcOutgoing('gregor.1.incoming.consumePublishMessage', request, (error, result) => error ? reject(error) : resolve(result)))
export const incomingConsumePublishMessageRpcPromise = (request: IncomingConsumePublishMessageRpcParam): Promise<void> => new Promise((resolve, reject) => engine()._rpcOutgoing('gregor.1.incoming.consumePublishMessage', request, (error: RPCError, result: void) => error ? reject(error) : resolve()))

export const incomingDescribeConnectedUsersInternalRpcChannelMap = (configKeys: Array<string>, request: IncomingDescribeConnectedUsersInternalRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'gregor.1.incoming.describeConnectedUsersInternal', request)

export const incomingDescribeConnectedUsersInternalRpcPromise = (request: IncomingDescribeConnectedUsersInternalRpcParam): Promise<IncomingDescribeConnectedUsersInternalResult> => new Promise((resolve, reject) => engine()._rpcOutgoing('gregor.1.incoming.describeConnectedUsersInternal', request, (error, result) => error ? reject(error) : resolve(result)))
export const incomingDescribeConnectedUsersInternalRpcPromise = (request: IncomingDescribeConnectedUsersInternalRpcParam): Promise<IncomingDescribeConnectedUsersInternalResult> => new Promise((resolve, reject) => engine()._rpcOutgoing('gregor.1.incoming.describeConnectedUsersInternal', request, (error: RPCError, result: IncomingDescribeConnectedUsersInternalResult) => error ? reject(error) : resolve(result)))

export const incomingDescribeConnectedUsersRpcChannelMap = (configKeys: Array<string>, request: IncomingDescribeConnectedUsersRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'gregor.1.incoming.describeConnectedUsers', request)

export const incomingDescribeConnectedUsersRpcPromise = (request: IncomingDescribeConnectedUsersRpcParam): Promise<IncomingDescribeConnectedUsersResult> => new Promise((resolve, reject) => engine()._rpcOutgoing('gregor.1.incoming.describeConnectedUsers', request, (error, result) => error ? reject(error) : resolve(result)))
export const incomingDescribeConnectedUsersRpcPromise = (request: IncomingDescribeConnectedUsersRpcParam): Promise<IncomingDescribeConnectedUsersResult> => new Promise((resolve, reject) => engine()._rpcOutgoing('gregor.1.incoming.describeConnectedUsers', request, (error: RPCError, result: IncomingDescribeConnectedUsersResult) => error ? reject(error) : resolve(result)))

export const incomingPingRpcChannelMap = (configKeys: Array<string>, request: IncomingPingRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'gregor.1.incoming.ping', request)

export const incomingPingRpcPromise = (request: IncomingPingRpcParam): Promise<IncomingPingResult> => new Promise((resolve, reject) => engine()._rpcOutgoing('gregor.1.incoming.ping', request, (error, result) => error ? reject(error) : resolve(result)))
export const incomingPingRpcPromise = (request: IncomingPingRpcParam): Promise<IncomingPingResult> => new Promise((resolve, reject) => engine()._rpcOutgoing('gregor.1.incoming.ping', request, (error: RPCError, result: IncomingPingResult) => error ? reject(error) : resolve(result)))

export const incomingStateByCategoryPrefixRpcChannelMap = (configKeys: Array<string>, request: IncomingStateByCategoryPrefixRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'gregor.1.incoming.stateByCategoryPrefix', request)

export const incomingStateByCategoryPrefixRpcPromise = (request: IncomingStateByCategoryPrefixRpcParam): Promise<IncomingStateByCategoryPrefixResult> => new Promise((resolve, reject) => engine()._rpcOutgoing('gregor.1.incoming.stateByCategoryPrefix', request, (error, result) => error ? reject(error) : resolve(result)))
export const incomingStateByCategoryPrefixRpcPromise = (request: IncomingStateByCategoryPrefixRpcParam): Promise<IncomingStateByCategoryPrefixResult> => new Promise((resolve, reject) => engine()._rpcOutgoing('gregor.1.incoming.stateByCategoryPrefix', request, (error: RPCError, result: IncomingStateByCategoryPrefixResult) => error ? reject(error) : resolve(result)))

export const incomingStateRpcChannelMap = (configKeys: Array<string>, request: IncomingStateRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'gregor.1.incoming.state', request)

export const incomingStateRpcPromise = (request: IncomingStateRpcParam): Promise<IncomingStateResult> => new Promise((resolve, reject) => engine()._rpcOutgoing('gregor.1.incoming.state', request, (error, result) => error ? reject(error) : resolve(result)))
export const incomingStateRpcPromise = (request: IncomingStateRpcParam): Promise<IncomingStateResult> => new Promise((resolve, reject) => engine()._rpcOutgoing('gregor.1.incoming.state', request, (error: RPCError, result: IncomingStateResult) => error ? reject(error) : resolve(result)))

export const incomingSyncRpcChannelMap = (configKeys: Array<string>, request: IncomingSyncRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'gregor.1.incoming.sync', request)

export const incomingSyncRpcPromise = (request: IncomingSyncRpcParam): Promise<IncomingSyncResult> => new Promise((resolve, reject) => engine()._rpcOutgoing('gregor.1.incoming.sync', request, (error, result) => error ? reject(error) : resolve(result)))
export const incomingSyncRpcPromise = (request: IncomingSyncRpcParam): Promise<IncomingSyncResult> => new Promise((resolve, reject) => engine()._rpcOutgoing('gregor.1.incoming.sync', request, (error: RPCError, result: IncomingSyncResult) => error ? reject(error) : resolve(result)))

export const incomingVersionRpcChannelMap = (configKeys: Array<string>, request: IncomingVersionRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'gregor.1.incoming.version', request)

export const incomingVersionRpcPromise = (request: IncomingVersionRpcParam): Promise<IncomingVersionResult> => new Promise((resolve, reject) => engine()._rpcOutgoing('gregor.1.incoming.version', request, (error, result) => error ? reject(error) : resolve(result)))
export const incomingVersionRpcPromise = (request: IncomingVersionRpcParam): Promise<IncomingVersionResult> => new Promise((resolve, reject) => engine()._rpcOutgoing('gregor.1.incoming.version', request, (error: RPCError, result: IncomingVersionResult) => error ? reject(error) : resolve(result)))

export const outgoingBroadcastMessageRpcChannelMap = (configKeys: Array<string>, request: OutgoingBroadcastMessageRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'gregor.1.outgoing.broadcastMessage', request)

export const outgoingBroadcastMessageRpcPromise = (request: OutgoingBroadcastMessageRpcParam): Promise<void> => new Promise((resolve, reject) => engine()._rpcOutgoing('gregor.1.outgoing.broadcastMessage', request, (error, result) => error ? reject(error) : resolve(result)))
export const outgoingBroadcastMessageRpcPromise = (request: OutgoingBroadcastMessageRpcParam): Promise<void> => new Promise((resolve, reject) => engine()._rpcOutgoing('gregor.1.outgoing.broadcastMessage', request, (error: RPCError, result: void) => error ? reject(error) : resolve()))

export const remindDeleteRemindersRpcChannelMap = (configKeys: Array<string>, request: RemindDeleteRemindersRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'gregor.1.remind.deleteReminders', request)

export const remindDeleteRemindersRpcPromise = (request: RemindDeleteRemindersRpcParam): Promise<void> => new Promise((resolve, reject) => engine()._rpcOutgoing('gregor.1.remind.deleteReminders', request, (error, result) => error ? reject(error) : resolve(result)))
export const remindDeleteRemindersRpcPromise = (request: RemindDeleteRemindersRpcParam): Promise<void> => new Promise((resolve, reject) => engine()._rpcOutgoing('gregor.1.remind.deleteReminders', request, (error: RPCError, result: void) => error ? reject(error) : resolve()))

export const remindGetRemindersRpcChannelMap = (configKeys: Array<string>, request: RemindGetRemindersRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'gregor.1.remind.getReminders', request)

export const remindGetRemindersRpcPromise = (request: RemindGetRemindersRpcParam): Promise<RemindGetRemindersResult> => new Promise((resolve, reject) => engine()._rpcOutgoing('gregor.1.remind.getReminders', request, (error, result) => error ? reject(error) : resolve(result)))
export const remindGetRemindersRpcPromise = (request: RemindGetRemindersRpcParam): Promise<RemindGetRemindersResult> => new Promise((resolve, reject) => engine()._rpcOutgoing('gregor.1.remind.getReminders', request, (error: RPCError, result: RemindGetRemindersResult) => error ? reject(error) : resolve(result)))

export type AuthAuthenticateSessionTokenRpcParam = {|session: SessionToken,incomingCallMap?: IncomingCallMapType,waitingHandler?: WaitingHandlerType|}

Expand Down
Loading

0 comments on commit 4aff76f

Please sign in to comment.