Files: 6be75bf8038ec9c4d1cdba801434c1ef4db7c753 / sbot / index.js
1429 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 | heartbeat: 'source', |
21 | |
22 | getSubscriptions: 'async', |
23 | getChannels: 'async', |
24 | |
25 | liveBacklinks: { |
26 | subscribe: 'sync', |
27 | unsubscribe: 'sync', |
28 | stream: 'source' |
29 | } |
30 | } |
31 | |
32 | exports.init = function (ssb, config) { |
33 | var progress = Progress(ssb, config) |
34 | var channels = Channels(ssb, config) |
35 | var subscriptions = Subscriptions(ssb, config) |
36 | var roots = Roots(ssb, config) |
37 | var search = Search(ssb, config) |
38 | var recentFeeds = RecentFeeds(ssb, config) |
39 | |
40 | return { |
41 | heartbeat: Heartbeat(ssb, config), |
42 | channels: channels.stream, |
43 | subscriptions: subscriptions.stream, |
44 | roots: roots.read, |
45 | latest: roots.latest, |
46 | progress: progress.stream, |
47 | recentFeeds: recentFeeds.stream, |
48 | linearSearch: search.linear, |
49 | getSubscriptions: subscriptions.get, |
50 | getChannels: channels.get, |
51 | liveBacklinks: LiveBacklinks(ssb, config) |
52 | } |
53 | } |
54 |
Built with git-ssb-web