3.0.0 • Published 5 years ago
@datafire/mercure_local v3.0.0
@datafire/mercure_local
Client library for The Mercure protocol
Installation and Usage
npm install --save @datafire/mercure_locallet mercure_local = require('@datafire/mercure_local').create({
Bearer: "",
Cookie: ""
});
.then(data => {
console.log(data);
});Description
Mercure is a protocol allowing to push data updates to web browsers and other HTTP clients in a convenient, fast, reliable and battery-efficient way.
Actions
.well_known.mercure.get
Subscribe to updates
mercure_local..well_known.mercure.get({
"topic": []
}, context)Input
- input
object- topic required
array: The topic to get updates from, can be a URI template (RFC6570). - Last-Event-ID_query
string: The last received event id, to retrieve missed events. - Last-Event-ID
string: The last received event id, to retrieve missed events, takes precedence over the query parameter.
- topic required
Output
Output schema unknown
.well_known.mercure.post
Publish an update
mercure_local..well_known.mercure.post({}, context)Input
- input
object
Output
Output schema unknown
.well_known.mercure.subscriptions.get
Active subscriptions
mercure_local..well_known.mercure.subscriptions.get(null, context)Input
This action has no parameters
Output
- output Subscriptions
.well_known.mercure.subscriptions.topic.get
Active subscriptions for the given topic
mercure_local..well_known.mercure.subscriptions.topic.get({
"topic": ""
}, context)Input
- input
object- topic required
string
- topic required
Output
- output Subscriptions
.well_known.mercure.subscriptions.topic.subscriber.get
Active subscription for the given topic and subscriber
mercure_local..well_known.mercure.subscriptions.topic.subscriber.get({
"topic": "",
"subscriber": ""
}, context)Input
- input
object- topic required
string - subscriber required
string
- topic required
Output
- output Subscriptions
Definitions
Subscription
- Subscription
object- @context
string - active required
boolean - id required
string - lastEventID
string - payload
object - subscriber required
string - topic required
string - type required
string
- @context
Subscriptions
- Subscriptions
object- @context required
string - id required
string - lastEventID required
string - subscriptions required
array- items Subscription
- type required
string
- @context required
3.0.0
5 years ago