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