Streams Class
Static methods for the Streams model
Item Index
Methods
- define static
- fetch static
- fetchOne static
- getObservers static
- getParticipants static
- iconUrl static
- isStream static
- listen static
- messageHandler static
Properties
- _messageHandlers
- _streams
- ACCESS_SOURCES
- ADMIN_LEVEL
- ADMIN_LEVEL.invite
- ADMIN_LEVEL.manage
- ADMIN_LEVEL.max
- ADMIN_LEVEL.none
- ADMIN_LEVEL.own
- ADMIN_LEVEL.tell
- clients
- clients
- READ_LEVEL
- READ_LEVEL.content
- READ_LEVEL.max
- READ_LEVEL.messages
- READ_LEVEL.none
- READ_LEVEL.participants
- READ_LEVEL.relations
- READ_LEVEL.see
- socketServer
- WRITE_LEVEL
- WRITE_LEVEL.close
- WRITE_LEVEL.closePending
- WRITE_LEVEL.edit
- WRITE_LEVEL.join
- WRITE_LEVEL.max
- WRITE_LEVEL.messages
- WRITE_LEVEL.none
- WRITE_LEVEL.postPending
- WRITE_LEVEL.relate
- WRITE_LEVEL.relations
- WRITE_LEVEL.suggest
- WRITE_LEVEL.vote
Methods
define
-
type
-
ctor
-
methods
Call this function to set a constructor for a stream type
fetch
-
asUserId
-
publisherId
-
streamName
-
callback=null
-
[fields='*']
-
[options={}]
Retrieve stream with calculated access rights
Parameters:
-
asUserId
StringThe user id to calculate access rights
-
publisherId
StringThe publisher Id
-
streamName
String | Array | Db.RangeThe name of the stream, or an array of names, or a Db.Range
-
callback=null
FunctionCallback receives (err, streams) as parameters
-
[fields='*']
String optionalComma delimited list of fields to retrieve in the stream. Must include at least "publisherId" and "name". since make up the primary key of the stream table. You can skip this argument if you want.
-
[options={}]
Object optionalProvide additional query options like 'limit', 'offset', 'orderBy', 'where' etc.
fetchOne
-
asUserId
-
publisherId
-
streamName
-
[callback=null]
-
[fields='*']
-
[options={}]
Retrieve stream with calculated access rights
Parameters:
-
asUserId
StringThe user id to calculate access rights
-
publisherId
StringThe publisher Id
-
streamName
StringThe name of the stream
-
[callback=null]
Function optionalCallback receives the (err, stream) as parameters
-
[fields='*']
String optionalComma delimited list of fields to retrieve in the stream. Must include at least "publisherId" and "name". since make up the primary key of the stream table. You can skip this argument if you want.
-
[options={}]
Object optionalProvide additional query options like 'limit', 'offset', 'orderBy', 'where' etc.
getObservers
-
publisherId
-
streamName
-
[callback=null]
Retrieve socket.io clients registered to observe the stream by sending "Streams/join" events through the socket.
getParticipants
-
publisherId
-
streamName
-
[callback=null]
Retrieve stream participants
iconUrl
-
icon
-
[size=40]
Calculate the url of a stream's icon
Parameters:
Returns:
the url
isStream
-
testing
Use this to check whether variable is a Q.Streams.Stream object
Parameters:
-
testing
Mixed
Returns:
listen
-
options={}
Start internal listener for Streams plugin. Accepts messages such as
"Streams/Stream/join",
"Streams/Stream/leave",
"Streams/Stream/create",
"Streams/Stream/remove",
"Streams/Message/post",
"Streams/Message/postMessages",
"Streams/Stream/invite"
Parameters:
-
options={}
ObjectSo far no options are implemented.
Returns:
Whether the server has started
Properties
ADMIN_LEVEL.invite
Integer
final
Able to create invitations for others, granting access and permissions up to what they themselves have
Default: 20
ADMIN_LEVEL.manage
Integer
final
Can approve posts, and give people any adminLevel < 'manage'
Default: 30
ADMIN_LEVEL.max
Integer
final
Max admin level
Default: 40
ADMIN_LEVEL.none
Integer
final
Cannot do anything related to admin / users
Default: 0
ADMIN_LEVEL.own
Integer
final
Can give people any adminLevel <= 'own'
Default: 40
ADMIN_LEVEL.tell
Integer
final
Can prove things about the stream's content or participants
Default: 10
READ_LEVEL.content
Integer
final
Can see the stream's content
Default: 20
READ_LEVEL.max
Integer
final
Max read level
Default: 40
READ_LEVEL.messages
Integer
final
Can play stream in a player
Default: 40
READ_LEVEL.none
Integer
final
Can't see the stream
Default: 0
READ_LEVEL.participants
Integer
final
Can see participants in the stream
Default: 30
READ_LEVEL.relations
Integer
final
Can see relations to other streams
Default: 25
READ_LEVEL.see
Integer
final
Can see icon and title
Default: 10
socketServer
SocketNamespace
private
WRITE_LEVEL.close
Integer
final
Don't delete, just prevent any new changes to stream however, joining and leaving is still ok
Default: 40
WRITE_LEVEL.closePending
Integer
final
Can post a message requesting to close the stream
Default: 35
WRITE_LEVEL.edit
Integer
final
Can post messages to edit stream content immediately
Default: 30
WRITE_LEVEL.join
Integer
final
Can become a participant, chat, and leave
Default: 10
WRITE_LEVEL.max
Integer
final
Max write level
Default: 40
WRITE_LEVEL.messages
Integer
final
Can post messages which appear immediately
Default: 20
WRITE_LEVEL.none
Integer
final
Cannot affect stream or participants list
Default: 0
WRITE_LEVEL.postPending
Integer
final
Can post messages, but manager must approve
Default: 15
WRITE_LEVEL.relate
Integer
final
Can post messages relating other streams to this one
Default: 23
WRITE_LEVEL.relations
Integer
final
Can update properties of relations directly
Default: 25
WRITE_LEVEL.suggest
Integer
final
Can post messages requesting edits of stream
Default: 28
WRITE_LEVEL.vote
Integer
final
Can vote for a relation message posted to the stream.
Default: 13