8.4.0 • Published 9 years ago

phoenix-api v8.4.0

Weekly downloads
1
License
MIT
Repository
github
Last release
9 years ago

Phoenix API v5

The backend logic for Phoenix, accessed through the scuttlebot RPC interface. Adds its functions

var phoenixAPI = require('phoenix-api')

phoenixAPI.manifest    // rpc manifest
phoenixAPI.permissions // rpc permissions

var api = phoenixAPI.init(sbot) // create plugin api instance

pull(api.createEventStream(), pull.drain(function (event))) // event emitting stream
// emits { type: 'mesage', msg: Object }       for each new message
// emits { type: 'notification', msg: Object } for each reply/mention event

api.getIndexCounts(cb) // => { inbox: Number, inboxUnread: Number, adverts: Number }
api.createInboxStream({ gt: [ts], lt: [ts], gte: [ts], lte: [ts], limit: Number })
api.createAdvertStream({ gt: [ts], lt: [ts], gte: [ts], lte: [ts], limit: Number })
api.getRandomAdverts(num, oldest, cb) // get `num` adverts from the `oldest` most recent messages

api.markRead(key, cb)
api.markUnread(key, cb)
api.toggleRead(key, cb)
api.isRead(key, cb)

api.subscribe(key, cb)
api.unsubscribe(key, cb)
api.toggleSubscribed(key, cb)
api.isSubscribed(key, cb)

api.getMyProfile(cb) // gets this user's profile
api.getProfile(id, cb) // gets profile
api.getAllProfiles(cb) // gets all profiles in id->profile map

api.getActionItems(cb) // gets tasks that need the user's attention

api.getNamesById(cb) // gets map of id->names
api.getName(id, cb) // gets name for the given id
api.getIdsByName(cb) // gets map of names->id
8.4.0

9 years ago

8.3.2

9 years ago

8.3.1

9 years ago

8.3.0

9 years ago

8.2.0

9 years ago

8.1.2

9 years ago

8.1.1

9 years ago

8.1.0

9 years ago

8.0.4

9 years ago

8.0.3

9 years ago

8.0.2

9 years ago

8.0.1

9 years ago

8.0.0

9 years ago

7.1.3

9 years ago

7.1.2

9 years ago

7.1.1

9 years ago

7.1.0

9 years ago

7.0.1

9 years ago

7.0.0

9 years ago

6.1.1

9 years ago

6.1.0

9 years ago

6.0.0

9 years ago

5.0.1

9 years ago

5.0.0

9 years ago

4.0.4

9 years ago

4.0.3

9 years ago

4.0.2

9 years ago

4.0.1

9 years ago

4.0.0

9 years ago

3.2.0

9 years ago

3.1.1

9 years ago

3.1.0

9 years ago

3.0.3

9 years ago

3.0.2

9 years ago

3.0.1

9 years ago

3.0.0

9 years ago

2.1.1

9 years ago

2.1.0

9 years ago

2.0.1

9 years ago

2.0.0

9 years ago

1.0.0

9 years ago