git ssb


1+

Piet / patch-gatherings



Branch:

Piet Geursen committed Update apiLatest: 37f20bf on 4/26/2017, 10:42:15 AM
📄.gitignore
📄README.md
📁gathering
📄index.js
📄package.json
📄test.js
📁util

!!! WIP !!!

patchcore gatherings depject plugin for secure scuttlebutt

gives pull-stream sources and async methods for finding and publishing gatherings on secure scuttlebutt

Needs

exports.needs = nest({
  'sbot.pull.messagesByType': 'first',
  'sbot.pull.links': 'first',
})

Gives

exports.gives = nest({
  'gatherings.pull': [
    'find'
  ],
  'gatherings.async': [
    'create',
    'title',
    'description',
    'contributors',
    'startDateTime',
    'endDateTime',
    'location',
    'hosts',
    'attendees',
    'images',
  ]
  'gatherings.html': [
    'attendees'
    'contributors'
    'create'
    'description'
    'endDateTime'
    'hosts'
    'images'
    'layout: [
      'default' 
      'summary' 
    ]
    'location'
    'render'
    'startDateTime'
    'thumbnail' //TODO
    'title'
  ],
  'gatherings.obs': [
    'gathering'
  ],
})

How gathering messages work

A gathering message is extremely simple. It is little more than intent to have a gathering. Location, time, description etc are all about messages that link to the gathering message. Hopefully we can reuse these about messages to add metadata on completely different things. Examples could be publishing a location message about a pub or a photo.

API

gatherings.pull.find(opts={}, cb)

Returns a new pull-stream of gatherings. Valid opts keys include

gatherings.async.create(opts={}, cb)

Creates a new gathering message and calls cb when done.

gatherings.async.title(opts={}, cb)

Sets the title of the gathering and calls cb when done. Valid opts keys include

gatherings.async.startDateTime(opts={}, cb)

Sets the utc start dateTime of the gathering and calls cb when done. Valid opts keys include

gatherings.async.endDateTime(opts={}, cb)

Sets the utc end dateTime of the gathering and calls cb when done. Valid opts keys include

gatherings.async.location(opts={}, cb)

Sets the physical location of the gathering and calls cb when done. Valid opts keys include

gatherings.async.description(opts={}, cb)

Sets the physical location of the gathering and calls cb when done. Valid opts keys include

gatherings.async.hosts(opts={}, cb)

Adds or removes hosts of the gathering and calls cb when done. Valid opts keys include

eg:

gatherings.async.hosts({
  gathering: '',
  hosts: [
    {id: ''},  //adds the host 
    {id: '', remove: true}, // removes the host 
  ]
}, err => console.log(err))

gatherings.async.images(opts={}, cb)

Adds or removes images of the gathering and calls cb when done. Valid opts keys include

gatherings.async.attendees(opts={}, cb)

Adds or removes attendees of the gathering and calls cb when done. Valid opts keys include

eg:

gatherings.async.attendees({
  gathering: '',
  attendees: [
    {id: ''},  //adds the attendee
    {id: '', remove: true}, // removes the attendee 
  ]
}, err => console.log(err))

gatherings.async.contributors(opts={}, cb)

Adds or removes contributors of the gathering and calls cb when done. Valid opts keys include

eg:

gatherings.async.contributors({
  gathering: '',
  contributors: [
    {id: ''},  //adds the contributor
    {id: '', remove: true}, // removes the contributor 
  ]
}, err => console.log(err))

Install

With npm installed, run

$ npm install sbot-gatherings

Prior art

Acknowledgments

sbot-gatherings was inspired by..

See Also

License

ISC


Built with git-ssb-web