Files: 5bd646e5318c724c8523f74e3cbcb3712bfbb20f / sbot / index.js
1427 bytesRaw
1 | var Channels = require('./channels') |
2 | var Heartbeat = require('./heartbeat') |
3 | var Subscriptions = require('./subscriptions') |
4 | var Roots = require('./roots') |
5 | var Progress = require('./progress') |
6 | var Search = require('./search') |
7 | var RecentFeeds = require('./recent-feeds') |
8 | var LiveBacklinks = require('./live-backlinks') |
9 | |
10 | exports.name = 'patchwork' |
11 | exports.version = require('../package.json').version |
12 | exports.manifest = { |
13 | channels: 'source', |
14 | subscriptions: 'source', |
15 | roots: 'source', |
16 | latest: 'source', |
17 | linearSearch: 'source', |
18 | progress: 'source', |
19 | recentFeeds: 'source', |
20 | getSubscriptions: 'async', |
21 | getChannels: 'async', |
22 | heartbeat: 'source', |
23 | liveBacklinks: { |
24 | subscribe: 'sync', |
25 | unsubscribe: 'sync', |
26 | stream: 'source' |
27 | } |
28 | } |
29 | |
30 | exports.init = function (ssb, config) { |
31 | var progress = Progress(ssb, config) |
32 | var channels = Channels(ssb, config) |
33 | var subscriptions = Subscriptions(ssb, config) |
34 | var roots = Roots(ssb, config) |
35 | var search = Search(ssb, config) |
36 | var recentFeeds = RecentFeeds(ssb, config) |
37 | |
38 | return { |
39 | heartbeat: Heartbeat(ssb, config), |
40 | channels: channels.stream, |
41 | subscriptions: subscriptions.stream, |
42 | roots: roots.read, |
43 | latest: roots.latest, |
44 | progress: progress.stream, |
45 | recentFeeds: recentFeeds.stream, |
46 | linearSearch: search.linear, |
47 | getSubscriptions: subscriptions.get, |
48 | getChannels: channels.get, |
49 | liveBacklinks: LiveBacklinks(ssb, config) |
50 | } |
51 | } |
52 |
Built with git-ssb-web