Files: 19d40e88fd60bad60f36861b5c35004cf8e1b0f1 / sbot / index.js
1510 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 | var Hops = require('./hops') |
10 | |
11 | exports.name = 'patchwork' |
12 | exports.version = require('../package.json').version |
13 | exports.manifest = { |
14 | channels: 'source', |
15 | subscriptions: 'source', |
16 | roots: 'source', |
17 | latest: 'source', |
18 | linearSearch: 'source', |
19 | progress: 'source', |
20 | recentFeeds: 'source', |
21 | heartbeat: 'source', |
22 | |
23 | getSubscriptions: 'async', |
24 | getChannels: 'async', |
25 | getHops: 'async', |
26 | |
27 | liveBacklinks: { |
28 | subscribe: 'sync', |
29 | unsubscribe: 'sync', |
30 | stream: 'source' |
31 | } |
32 | } |
33 | |
34 | exports.init = function (ssb, config) { |
35 | var progress = Progress(ssb, config) |
36 | var channels = Channels(ssb, config) |
37 | var subscriptions = Subscriptions(ssb, config) |
38 | var roots = Roots(ssb, config) |
39 | var search = Search(ssb, config) |
40 | var recentFeeds = RecentFeeds(ssb, config) |
41 | |
42 | return { |
43 | heartbeat: Heartbeat(ssb, config), |
44 | channels: channels.stream, |
45 | subscriptions: subscriptions.stream, |
46 | roots: roots.read, |
47 | latest: roots.latest, |
48 | progress: progress.stream, |
49 | recentFeeds: recentFeeds.stream, |
50 | linearSearch: search.linear, |
51 | getSubscriptions: subscriptions.get, |
52 | getChannels: channels.get, |
53 | liveBacklinks: LiveBacklinks(ssb, config), |
54 | getHops: Hops(ssb, config) |
55 | } |
56 | } |
57 |
Built with git-ssb-web