Socket
Socket
Sign inDemoInstall

neo4j-driver

Package Overview
Dependencies
Maintainers
2
Versions
162
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

neo4j-driver - npm Package Compare versions

Comparing version 1.3.0-beta01 to 1.3.0

6

lib/v1/driver.js

@@ -74,4 +74,4 @@ 'use strict';

/**
* A driver maintains one or more {@link Session sessions} with a remote
* Neo4j instance. Through the {@link Session sessions} you can send statements
* A driver maintains one or more {@link Session}s with a remote
* Neo4j instance. Through the {@link Session}s you can send statements
* and retrieve results from the database.

@@ -165,3 +165,3 @@ *

* This comes with some responsibility - make sure you always call
* {@link Session#close()} when you are done using a session, and likewise,
* {@link close} when you are done using a session, and likewise,
* make sure you don't close your session before you are done using it. Once

@@ -168,0 +168,0 @@ * it is returned to the pool, the session will be reset to a clean state and

@@ -48,4 +48,13 @@ 'use strict';

/**
* @type {string}
*/
var SERVICE_UNAVAILABLE = 'ServiceUnavailable';
/**
* @type {string}
*/
var SESSION_EXPIRED = 'SessionExpired';
/**
* @type {string}
*/
var PROTOCOL_ERROR = 'ProtocolError';

@@ -52,0 +61,0 @@

@@ -52,3 +52,3 @@ "use strict";

* @param {Integer} identity - Unique identity
* @param {Array} labels - Array for all labels
* @param {Array<string>} labels - Array for all labels
* @param {Object} properties - Map with node properties

@@ -215,3 +215,3 @@ */

* @param {Node} end - end node
* @param {Array} segments - Array of Segments
* @param {Array<PathSegment>} segments - Array of Segments
*/

@@ -218,0 +218,0 @@ function Path(start, end, segments) {

@@ -306,3 +306,3 @@ 'use strict';

* @param err an error object, forwarded to all current and future subscribers
* @private
* @protected
*/

@@ -331,2 +331,8 @@

if (this._isBroken) {
// ignore all incoming messages when this connection is broken. all previously pending observers failed
// with the fatal error. all future observers will fail with same fatal error.
return;
}
var payload = msg.fields[0];

@@ -344,3 +350,3 @@

} finally {
this._currentObserver = this._pendingObservers.shift();
this._updateCurrentObserver();
}

@@ -354,3 +360,3 @@ break;

} finally {
this._currentObserver = this._pendingObservers.shift();
this._updateCurrentObserver();
// Things are now broken. Pending observers will get FAILURE messages routed until

@@ -382,3 +388,3 @@ // We are done handling this failure.

} finally {
this._currentObserver = this._pendingObservers.shift();
this._updateCurrentObserver();
}

@@ -541,2 +547,13 @@ break;

/*
* Pop next pending observer form the list of observers and make it current observer.
* @protected
*/
}, {
key: '_updateCurrentObserver',
value: function _updateCurrentObserver() {
this._currentObserver = this._pendingObservers.shift();
}
/**

@@ -613,3 +630,4 @@ * Synchronize - flush all queued outgoing messages and route their responses

/**
* Wrap the given observer to track connection's initialization state.
* Wrap the given observer to track connection's initialization state. Connection is closed by the server if
* processing of INIT message fails so returned observer will handle initialization failure as a fatal error.
* @param {StreamObserver} observer the observer used for INIT message.

@@ -637,4 +655,10 @@ * @return {StreamObserver} updated observer.

}
if (observer && observer.onError) {
observer.onError(error);
_this10._connection._updateCurrentObserver(); // make sure this same observer will not be called again
try {
if (observer && observer.onError) {
observer.onError(error);
}
} finally {
_this10._connection._handleFatalError(error);
}

@@ -641,0 +665,0 @@ },

@@ -60,2 +60,3 @@ 'use strict';

var PROCEDURE_NOT_FOUND_CODE = 'Neo.ClientError.Procedure.ProcedureNotFound';
var UNAUTHORIZED_CODE = 'Neo.ClientError.Security.Unauthorized';

@@ -88,6 +89,10 @@ var RoutingUtil = function () {

throw (0, _error.newError)('Server ' + routerAddress + ' could not perform routing. ' + 'Make sure you are connecting to a causal cluster', _error.SERVICE_UNAVAILABLE);
} else if (error.code === UNAUTHORIZED_CODE) {
// auth error is a sign of a configuration issue, rediscovery should not proceed
throw error;
} else {
// return nothing when failed to connect because code higher in the callstack is still able to retry with a
// different session towards a different router
return null;
}
// return nothing when failed to connect because code higher in the callstack is still able to retry with a
// different session towards a different router
return null;
});

@@ -94,0 +99,0 @@ }

@@ -92,3 +92,3 @@ "use strict";

*
* @param visitor
* @param {function(value: Object, key: string, record: Record)} visitor the function to apply to each field.
*/

@@ -95,0 +95,0 @@

@@ -154,3 +154,3 @@ 'use strict';

/**
* Get statistical information for a {Result}.
* Get statistical information for a {@link Result}.
* @access public

@@ -157,0 +157,0 @@ */

@@ -41,2 +41,3 @@ 'use strict';

* A driver that supports routing in a core-edge cluster.
* @private
*/

@@ -43,0 +44,0 @@ /**

@@ -169,3 +169,3 @@ 'use strict';

* @param {string} bookmark - a reference to a previous transaction. DEPRECATED: This parameter is deprecated in
* favour of {@link Driver#session(string)} that accepts an initial bookmark. Session will ensure that all nested
* favour of {@link Driver#session} that accepts an initial bookmark. Session will ensure that all nested
* transactions are chained with bookmarks to guarantee causal consistency.

@@ -207,3 +207,3 @@ * @returns {Transaction} - New Transaction

*
* @return a reference to a previous transac'tion
* @return a reference to a previous transaction
*/

@@ -218,3 +218,3 @@

/**
* Execute given unit of work in a {@link Driver#READ} transaction.
* Execute given unit of work in a {@link READ} transaction.
*

@@ -239,3 +239,3 @@ * Transaction will automatically be committed unless the given function throws or returns a rejected promise.

/**
* Execute given unit of work in a {@link Driver#WRITE} transaction.
* Execute given unit of work in a {@link WRITE} transaction.
*

@@ -242,0 +242,0 @@ * Transaction will automatically be committed unless the given function throws or returns a rejected promise.

@@ -111,3 +111,3 @@ 'use strict';

* Run Cypher statement
* Could be called with a statement object i.e.: {statement: "MATCH ...", parameters: {param: 1}}
* Could be called with a statement object i.e.: <code>{statement: "MATCH ...", parameters: {param: 1}}</code>
* or with the statement and parameters as separate arguments.

@@ -274,3 +274,3 @@ * @param {mixed} statement - Cypher statement to execute

return newRunResult(observer, statement, parameters, function () {
return _newRunResult(observer, statement, parameters, function () {
return observer.serverMeta();

@@ -288,11 +288,11 @@ });

});
return { result: newDummyResult(observer, "COMMIT", {}), state: _states.FAILED };
return { result: _newDummyResult(observer, "COMMIT", {}), state: _states.FAILED };
},
rollback: function rollback(connectionHolder, observer) {
observer.onError({ error: "Cannot rollback transaction, because previous statements in the " + "transaction has failed and the transaction has already been rolled back." });
return { result: newDummyResult(observer, "ROLLBACK", {}), state: _states.FAILED };
return { result: _newDummyResult(observer, "ROLLBACK", {}), state: _states.FAILED };
},
run: function run(connectionHolder, observer, statement, parameters) {
observer.onError({ error: "Cannot run statement, because previous statements in the " + "transaction has failed and the transaction has already been rolled back." });
return newDummyResult(observer, statement, parameters);
return _newDummyResult(observer, statement, parameters);
}

@@ -307,11 +307,11 @@ },

});
return { result: newDummyResult(observer, "COMMIT", {}), state: _states.SUCCEEDED };
return { result: _newDummyResult(observer, "COMMIT", {}), state: _states.SUCCEEDED };
},
rollback: function rollback(connectionHolder, observer) {
observer.onError({ error: "Cannot rollback transaction, because transaction has already been successfully closed." });
return { result: newDummyResult(observer, "ROLLBACK", {}), state: _states.SUCCEEDED };
return { result: _newDummyResult(observer, "ROLLBACK", {}), state: _states.SUCCEEDED };
},
run: function run(connectionHolder, observer, statement, parameters) {
observer.onError({ error: "Cannot run statement, because transaction has already been successfully closed." });
return newDummyResult(observer, statement, parameters);
return _newDummyResult(observer, statement, parameters);
}

@@ -326,11 +326,11 @@ },

});
return { result: newDummyResult(observer, "COMMIT", {}), state: _states.ROLLED_BACK };
return { result: _newDummyResult(observer, "COMMIT", {}), state: _states.ROLLED_BACK };
},
rollback: function rollback(connectionHolder, observer) {
observer.onError({ error: "Cannot rollback transaction, because transaction has already been rolled back." });
return { result: newDummyResult(observer, "ROLLBACK", {}), state: _states.ROLLED_BACK };
return { result: _newDummyResult(observer, "ROLLBACK", {}), state: _states.ROLLED_BACK };
},
run: function run(connectionHolder, observer, statement, parameters) {
observer.onError({ error: "Cannot run statement, because transaction has already been rolled back." });
return newDummyResult(observer, statement, parameters);
return _newDummyResult(observer, statement, parameters);
}

@@ -365,4 +365,5 @@ }

* @return {Result} new result.
* @private
*/
function newRunResult(observer, statement, parameters, metadataSupplier) {
function _newRunResult(observer, statement, parameters, metadataSupplier) {
return new _result2.default(observer, statement, parameters, metadataSupplier, _connectionHolder.EMPTY_CONNECTION_HOLDER);

@@ -379,4 +380,5 @@ }

* @return {Result} new result.
* @private
*/
function newDummyResult(observer, statement, parameters) {
function _newDummyResult(observer, statement, parameters) {
return new _result2.default(observer, statement, parameters, emptyMetadataSupplier, _connectionHolder.EMPTY_CONNECTION_HOLDER);

@@ -383,0 +385,0 @@ }

@@ -32,2 +32,2 @@ "use strict";

// system to control version names at packaging time.
exports.default = "1.3.0-beta01";
exports.default = "1.3.0";
{
"name": "neo4j-driver",
"version": "1.3.0-beta01",
"version": "1.3.0",
"description": "Connect to Neo4j 3.1.0 and up from JavaScript",

@@ -5,0 +5,0 @@ "author": "Neo Technology Inc.",

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

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