var Channels = require('./channels') var Heartbeat = require('./heartbeat') var Subscriptions = require('./subscriptions') var Roots = require('./roots') var Progress = require('./progress') var Search = require('./search') var RecentFeeds = require('./recent-feeds') var LiveBacklinks = require('./live-backlinks') var Hops = require('./hops') exports.name = 'patchwork' exports.version = require('../package.json').version exports.manifest = { channels: 'source', subscriptions: 'source', roots: 'source', latest: 'source', linearSearch: 'source', progress: 'source', recentFeeds: 'source', heartbeat: 'source', getSubscriptions: 'async', getChannels: 'async', getHops: 'async', liveBacklinks: { subscribe: 'sync', unsubscribe: 'sync', stream: 'source' } } exports.init = function (ssb, config) { var progress = Progress(ssb, config) var channels = Channels(ssb, config) var subscriptions = Subscriptions(ssb, config) var roots = Roots(ssb, config) var search = Search(ssb, config) var recentFeeds = RecentFeeds(ssb, config) return { heartbeat: Heartbeat(ssb, config), channels: channels.stream, subscriptions: subscriptions.stream, roots: roots.read, latest: roots.latest, progress: progress.stream, recentFeeds: recentFeeds.stream, linearSearch: search.linear, getSubscriptions: subscriptions.get, getChannels: channels.get, liveBacklinks: LiveBacklinks(ssb, config), getHops: Hops(ssb, config) } }