feedhenry / fh-sync

Node.js implementation of the FeedHenry Data Synchronisation Server. To be used in conjunction with the FeedHenry Data Synchronisation Client.
http://feedhenry.org
Apache License 2.0
5 stars 17 forks source link

Missing api methods. #16

Closed wtrocki closed 7 years ago

wtrocki commented 7 years ago

Top level sync api seems to be missing 2 methods. After investigation I found that there are mounted in top level instead of on api. See bellow:

{
    sync: [Function],
    syncRecords: [Function],
    setClients: [Function: setClients],
    api: {
        init: [Function: init],
        start: { },
        stop: [Function: stop],
        stopAll: [Function: stopAll],
        setConfig: [Function: setConfig],
        globalInterceptRequest: [Function: globalInterceptRequest],
        globalInterceptResponse: [Function: globalInterceptResponse],
        interceptRequest: [Function: interceptRequest],
        interceptResponse: [Function: interceptResponse],
        listCollisions: [Function],
        removeCollision: [Function],
        callHandler: [Function: callHandler],
        getStats: [Function: getStats],
        setRecordHashFn: [Function: setRecordHashFn],
        setGlobalHashFn: [Function: setGlobalHashFn],
        connect: [Function: connect],
        invoke: [Function: invoke],
        toJSON: [Function: toJSON],
        getEventEmitter: [Function: getEventEmitter],
        setEventEmitter: [Function: setEventEmitter],
        globalHandleList: [Function],
        globalHandleCreate: [Function],
        globalHandleRead: [Function],
        globalHandleUpdate: [Function],
        globalHandleDelete: [Function],
        globalHandleCollision: [Function],
        globalListCollisions: [Function],
        globalRemoveCollision: [Function],
        handleList: [Function],
        handleCreate: [Function],
        handleRead: [Function],
        handleUpdate: [Function],
        handleDelete: [Function],
        handleCollision: [Function]
    },
    listCollisions: [Function],
    removeCollision: [Function]
}

Should we remove this 2 methods from top level? listCollisions: [Function], removeCollision: [Function]

ping @aidenkeating @wei-lee @david-martin

Additionally I would like to expose sync.api object as root so we can drop api from sync.api: https://github.com/feedhenry/fh-mbaas-api/blob/master/lib/api.js#L50

ping @austincunningham @damienomurchu

wtrocki commented 7 years ago

Metods were duplicated. Removed api prefix.