Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

diffusion

Package Overview
Dependencies
Maintainers
1
Versions
191
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

diffusion - npm Package Compare versions

Comparing version 5.7.4 to 5.7.5

2

package.json
{
"name": "diffusion",
"version": "5.7.4",
"version": "5.7.5",
"description": "Diffusion Javascript UCI client",

@@ -5,0 +5,0 @@ "keywords" : ["diffusion", "reappt", "websockets", "data"],

@@ -29,5 +29,5 @@ var SessionImpl = require('session/session-impl');

*/
version : '5.7.4',
version : '5.7.5',
build : '4_dev#internal',
build : '5_dev#internal',

@@ -131,3 +131,3 @@ /**

/**
* Access {@link Topics}.
* Access {@link module:diffusion/topics}.
*/

@@ -134,0 +134,0 @@ topics : Topics,

@@ -32,3 +32,3 @@ var interface = require('util/interface').interface;

* Once subscribed, <code>value</code> update events may be received for this topic</td>. The specification is a
* {@link Topics.TopicSpecification} instance that contains details about the topic.
* {@link TopicSpecification} instance that contains details about the topic.
* </tr>

@@ -35,0 +35,0 @@ * <tr>

@@ -198,5 +198,5 @@ var interface = require('util/interface').interface;

* When registration is successful, the {@link Result} will
* emit a <code>complete</code> event. This event provides a deregistration
* function that can be called at any point to remove this registered
* action. The deregistration function returns a new
* call the success callback with an object representing the registration
* with the property function deregister that can be called at any point to
* remove this registered action. The deregistration function returns a new
* {@link Result}.

@@ -207,20 +207,21 @@ * <P>

* // Remove all topics under 'foo'
* session.topics.removeWithSession('foo').on({
* complete : function(deregister) {
* session.topics.removeWithSession('foo').then(
* function(registration) {
* // Registration complete
*
* // Deregister this action
* deregister().on('complete', function() {
* // Deregistration complete
* });
* registration.deregister().then(
* function() {
* // Deregistration complete
* },
* function(err) {
* // Failure while deregistering
* }
* );
* },
* error : function(err) {
* function(err) {
* // Could not register
* }
* });
* );
*
* @fires complete
* @fires error
* @fires close
*
* @param {String} topicPath - The path of the topic tree to remove

@@ -227,0 +228,0 @@ * @returns {Result} Registration result.

@@ -162,14 +162,2 @@ var interface = require('util/interface').interface;

/**
* The reason that an unsubscription occurred.
*
* @readonly
* @enum
*/
Topics.UnsubscribeReason = {
REQUESTED : { id : 0, message : "The unsubscription was requested by this client" },
CONTROL : { id : 1, message : "The server or another client unsubscribed this client" },
REMOVED : { id : 2, message : "The topic was removed" }
};
module.exports = Topics;
var implements = require('util/interface').implements;
var DataTypes = require('../../data/datatypes');
var TopicType = require('../../topics/topic-type.js');
var TopicType = require('../../topics/topics').TopicType;

@@ -5,0 +5,0 @@ var BinaryDataTypeImpl = require('data/binary/binary-datatype-impl');

var TypedSubscriptionImpl = require('features/topics/typed-subscription');
var TopicType = require('../../../topics/topic-type.js');
var TopicType = require('../../../topics/topics').TopicType;
var Emitter = require('events/emitter');

@@ -4,0 +4,0 @@

@@ -8,3 +8,3 @@ // Hack to avoid circular dependencies when checking types / deriving values

var MString = require('./string');
var Type = require('../../topics/topic-type');
var Type = require('../../topics/topics').TopicType;

@@ -11,0 +11,0 @@ function createFromSingleValue(value) {

// Utils that make use of MRecordContent
var Type = require('../../topics/topic-type');
var Type = require('../../topics/topics').TopicType;
var util = require('./util-single-value');

@@ -4,0 +4,0 @@ var cutil = require('content/util');

@@ -5,3 +5,3 @@ var NoValueEntry = require('routing/topic-cache-no-value-entry');

var TopicType = require('../../topics/topic-type.js');
var TopicType = require('../../topics/topics').TopicType;

@@ -8,0 +8,0 @@ module.exports = function TopicCache(datatypes) {

// API
var UnsubscribeReason = require('../../../features/topics').UnsubscribeReason;
var UnsubscribeReason = require('../../../topics/topics').UnsubscribeReason;

@@ -4,0 +4,0 @@ // Internal

var Codec = require('io/codec');
var serialiser = require('schema/serialiser');
var BEES = require('serialisers/byte-encoded-enum-serialiser');
var TopicType = require('../../../topics/topic-type');
var TopicType = require('../../../topics/topics').TopicType;

@@ -6,0 +6,0 @@ /**

@@ -1,2 +0,2 @@

var TopicType = require('../../../topics/topic-type.js');
var TopicType = require('../../../topics/topics').TopicType;
var DataTypes = require('data/datatypes');

@@ -3,0 +3,0 @@ var schema = require('schema/schema');

@@ -20,4 +20,2 @@ var encodeAsString = require('v4-stack/credential-tunnel').encodeAsString;

var transportTimeout = 60;
var headers = {

@@ -27,3 +25,2 @@ m : "0",

ca : "8",
tt : transportTimeout,
r : opts.reconnect.timeout,

@@ -30,0 +27,0 @@ v : req.version

@@ -6,3 +6,3 @@ var interface = require('util/interface').interface;

* <P>
* A topic is specified in terms of its {@link TopicType type} and a map of
* A topic is specified in terms of its {@link diffusion.topics.TopicType type} and a map of
* optional property settings which can alter the default behavior of the topic.

@@ -56,3 +56,3 @@ * <P>

*
* @class Topics.TopicSpecification
* @class TopicSpecification
* @since 5.7

@@ -64,3 +64,3 @@ */

*
* @property {TopicType} Topics.TopicSpecification.type
* @property {diffusion.topics.TopicType} TopicSpecification.type
*/

@@ -72,5 +72,5 @@ 'type',

*
* @property {Object} Topics.TopicSpecification.properties
* @property {Object} TopicSpecification.properties
*/
'properties'
]);

@@ -1,19 +0,183 @@

var TopicType = require('./topic-type');
function type(id, stateful, functional) {
return {
id : id,
stateful : stateful,
functional : functional
};
}
/**
* Global topic details and types.
* Global topic-related enums.
* <P>
* Can be accessed via the <code>diffusion</code> namespace.
* Can be accessed via the <code>diffusion.topics</code> namespace.
*
* <h3>
* @module diffusion/topics
*/
var Topics = {};
/**
* Enum containing possible Topic Types.
*
* @example
* // Adding a topic via type
* session.topics.add("foo", diffusion.topics.TopicType.JSON);
* // Get a topic type for adding topics
* var topicType = diffusion.topics.TopicType.JSON;
*
* @namespace Topics
* session.topics.add("foo", topicType);
*
* @readonly
* @enum
*/
module.exports = {
module.exports.TopicType = {
/**
* {@link Topics.TopicType}
* Stateless Topic.
* <P>
* A stateless topic is one that has no data maintained at the server and performs no specific function.
* Such a topic would normally be used simply to act as an organisational node within the topic tree but may
* also be used for sending messages.
*/
TopicType : TopicType
STATELESS : type(1, false, false),
/**
* Single value topic.
* <P>
* This is a stateful topic that maintains its state as a single String value which may optionally be validated and
* constrained by type (e.g {@link Metdata.Integer}, {@link Metadata.Decimal}). The type is defined by a
* {@link Metadata} instance.
*/
SINGLE_VALUE : type(3, true, false),
/**
* Record topic.
* <P>
* This is a stateful topic that maintains its state in record format. The format of the topic content may be one
* or more {@link Metadata.MRecordContent.Record Records} as defined by an item of {@link Metadata.MRecordContent}
* metadata. When such a topic is updated, the metadata is used to interpet the data and make comparisons between
* the current topic state and the update such that a delta of change can be calculated for publishing to subscribed
* clients.
*/
RECORD : type(4, true, false),
/**
* @deprecated
*/
PROTOCOL_BUFFER : type(5, true, false),
/**
* Custom Topic.
* <P>
* A stateful topic that maintains its state via a
* user written Java class deployed at the server.
*/
CUSTOM : type(6, true, false),
/**
* Deprecated
*/
SLAVE : type(7, true, false),
/**
* Deprecated
*/
SERVICE : type(8, false, true),
/**
* Paged String Topic.
* <P>
* A functional topic that maintains its state as a
* list of Strings which individual clients can page through and be
* dynamically notified of changes.
* <P>
* Currently paged topics may only be used by user of the classic API.
*/
PAGED_STRING : type(9, false, true),
/**
* Paged String Topic.
* <P>
* A functional topic that maintains its state as a
* list of Strings which individual clients can page through and be
* dynamically notified of changes.
* <P>
* Currently paged topics may only be used by user of the classic API.
*/
PAGED_RECORD : type(10, false, true),
/**
* Deprecated
*/
TOPIC_NOTIFY : type(11, false, true),
/**
* Routing Topic.
* <P>
* A functional topic that can point to different
* target topics for different clients.
* <P>
* From the point of view of a client subscribing to such a topic this would
* be seen as a normal stateful topic but it has no
* state of its own and cannot be published to.
* <P>
* Such a topic may specify a user written Java class which will be invoked
* to define the mapping of the topic to another data topic when a client
* subscribes. Alternatively the mapping can be delegated to a control
* client using the SubscriptionControl feature.
*/
ROUTING : type(12, false, true),
/**
* Deprecated
*/
CHILD_LIST : type(13, false, true),
/**
* Binary Topic.
* <P>
* This is a stateful topic that handles data in Binary format.
* @since 5.7
*/
BINARY : type(14, true, false),
/**
* JSON (JavaScript Object Notation) Topic.
* <P>
* This is a stateful topic that handles data in JSON representation.
* @since 5.7
*/
JSON : type(15, true, false)
};
function reason(id, message) {
return { id : id, message : message };
}
/**
* Enum containing reasons that an unsubscription occurred.
*
* @example
* // Use UnsubscribeReason to validate unsubscription notifications
* session.subscribe(">foo").on('unsubscribe', function(reason, topic) {
* switch (reason) {
* case diffusion.topics.UnsubscribeReason.REMOVED :
* // Do something if the topic was removed
* default :
* // Do something else if the client was explicitly unsubscribed
* }
* });
*
* @readonly
* @enum
*/
module.exports.UnsubscribeReason = {
/**
* The unsubscription was requested by this client.
*/
REQUESTED : reason(0, "The unsubscription was requested by this client"),
/**
* The server or another client unsubscribed this client.
*/
CONTROL : reason(1, "The server or another client unsubscribed this client"),
/**
* The topic was removed
*/
REMOVED : reason(2, "The topic was removed")
};
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc