ssbc/scuttle-tag

Name: scuttle-tag

Owner: Secure Scuttlebutt Consortium

Description: null

Created: 2018-05-21 21:29:48.0

Updated: 2018-05-21 21:29:50.0

Pushed: 2018-05-16 23:51:23.0

Homepage: null

Size: 34

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

scuttle-tag

Tags depject plugin for secure scuttlebutt which uses patchcore.

gives observables and async methods for getting and publishing tags on secure scuttlebutt.

Needs
rts.needs = nest({
bot.async.publish': 'first',
bot.pull.stream': 'first',

Gives
rts.gives = nest({
ag.async': [
'apply',
'create',
'name'

ag.html': [
'edit',
'tag'

ag.obs': [
'tag',
'taggedMessages',
'messageTags',
'messageTagsFrom',
'allTagsFrom',
'allTags'


Message Schema

pe: 'tag',
gged: true | false,
ssage: %msg_id, //the message being tagged
ot: %tag_id, //unless this message is the first message in this tag
anch: %tag_id //ditto

API
tag.async.create({}, cb)

Creates a new tag message and calls cb when done.

tag.async.apply({ tag, message, tagged }, cb)

Creates a new tag message which applies the tag tag to the message message if tagged is true. (TODO: default tagged to true)

tag.async.name({ tag, name }, cb)

Sets the name of a tag and calls cb when done.

tag.html.edit({ msgId }, cb)

Renders html which allows the tags applied to a message msgId to be edited.

tag.html.tag({ tagName, tagId }, handleRemove)

Renders a tag. If the handleRemove function is specified then a remove button will be rendered.

tag.obs.tag(tagId)

Returns a Mutant observable Struct which represents a tag. This struct holds the tagId and tagName.

tag.obs.taggedMessages(author, tagId)

Returns a Mutant observable array of ids of messages. This array is messages that have had the tag tagId applied by author.

tag.obs.messageTags(msgId)

Returns a Mutant observable list of tagIds which have been applied to the message msgId.

tag.obs.messageTagsFrom(msgId, author)

Returns a Mutant observable list of tagIds which have been applied to the message msgId by the specified author.

tag.obs.allTagsFrom(author)

Returns a Mutant observable array of all tag messages published by an user.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.