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 5.3.0 to 5.4.0-alpha01

lib/browser/neo4j-web.esm.js

4

lib/docs.js

@@ -19,3 +19,2 @@ /**

*/
/**

@@ -38,3 +37,2 @@ * Configuration object containing settings for explicit and auto-commit transactions.

* transactions and is equivalent to `dbms.setTXMetaData` procedure.
*/
"use strict";
*/
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = exports.WRITE = exports.READ = exports.Driver = void 0;
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
var _neo4jDriverCore = require("neo4j-driver-core");
var _sessionRx = _interopRequireDefault(require("./session-rx"));
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
var FETCH_ALL = _neo4jDriverCore.internal.constants.FETCH_ALL;
var READ = _neo4jDriverCore.driver.READ,
WRITE = _neo4jDriverCore.driver.WRITE;
/**
* Copyright (c) "Neo4j"
* Neo4j Sweden AB [http://neo4j.com]
*
* This file is part of Neo4j.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.WRITE = exports.READ = exports.Driver = void 0;
var neo4j_driver_core_1 = require("neo4j-driver-core");
var session_rx_1 = __importDefault(require("./session-rx"));
var FETCH_ALL = neo4j_driver_core_1.internal.constants.FETCH_ALL;
var READ = neo4j_driver_core_1.driver.READ, WRITE = neo4j_driver_core_1.driver.WRITE;
exports.READ = READ;
exports.WRITE = WRITE;
/**
* A driver maintains one or more {@link Session}s with a remote

@@ -41,19 +56,7 @@ * Neo4j instance. Through the {@link Session}s you can send queries

*/
exports.WRITE = WRITE;
exports.READ = READ;
var Driver = /*#__PURE__*/function (_CoreDriver) {
(0, _inherits2["default"])(Driver, _CoreDriver);
var _super = _createSuper(Driver);
function Driver() {
(0, _classCallCheck2["default"])(this, Driver);
return _super.apply(this, arguments);
}
(0, _createClass2["default"])(Driver, [{
key: "rxSession",
value:
var Driver = /** @class */ (function (_super) {
__extends(Driver, _super);
function Driver() {
return _super !== null && _super.apply(this, arguments) || this;
}
/**

@@ -74,49 +77,35 @@ * Acquire a reactive session to communicate with the database. The session will

*/
function rxSession() {
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
_ref$defaultAccessMod = _ref.defaultAccessMode,
defaultAccessMode = _ref$defaultAccessMod === void 0 ? WRITE : _ref$defaultAccessMod,
bookmarks = _ref.bookmarks,
_ref$database = _ref.database,
database = _ref$database === void 0 ? '' : _ref$database,
fetchSize = _ref.fetchSize,
impersonatedUser = _ref.impersonatedUser,
bookmarkManager = _ref.bookmarkManager;
return new _sessionRx["default"]({
session: this._newSession({
defaultAccessMode: defaultAccessMode,
bookmarkOrBookmarks: bookmarks,
database: database,
impersonatedUser: impersonatedUser,
reactive: false,
fetchSize: validateFetchSizeValue(fetchSize, this._config.fetchSize),
bookmarkManager: bookmarkManager
}),
config: this._config
});
}
}]);
return Driver;
}(_neo4jDriverCore.Driver);
Driver.prototype.rxSession = function (_a) {
var _b = _a === void 0 ? {} : _a, _c = _b.defaultAccessMode, defaultAccessMode = _c === void 0 ? WRITE : _c, bookmarks = _b.bookmarks, _d = _b.database, database = _d === void 0 ? '' : _d, fetchSize = _b.fetchSize, impersonatedUser = _b.impersonatedUser, bookmarkManager = _b.bookmarkManager;
return new session_rx_1.default({
session: this._newSession({
defaultAccessMode: defaultAccessMode,
bookmarkOrBookmarks: bookmarks,
database: database,
impersonatedUser: impersonatedUser,
reactive: false,
fetchSize: validateFetchSizeValue(fetchSize, this._config.fetchSize),
bookmarkManager: bookmarkManager
}),
config: this._config
});
};
return Driver;
}(neo4j_driver_core_1.Driver));
exports.Driver = Driver;
/**
* @private
*/
exports.Driver = Driver;
function validateFetchSizeValue(rawValue, defaultWhenAbsent) {
var fetchSize = parseInt(rawValue, 10);
if (fetchSize > 0 || fetchSize === FETCH_ALL) {
return fetchSize;
} else if (fetchSize === 0 || fetchSize < 0) {
throw new Error("The fetch size can only be a positive value or ".concat(FETCH_ALL, " for ALL. However fetchSize = ").concat(fetchSize));
} else {
return defaultWhenAbsent;
}
var fetchSize = parseInt(rawValue, 10);
if (fetchSize > 0 || fetchSize === FETCH_ALL) {
return fetchSize;
}
else if (fetchSize === 0 || fetchSize < 0) {
throw new Error("The fetch size can only be a positive value or ".concat(FETCH_ALL, " for ALL. However fetchSize = ").concat(fetchSize));
}
else {
return defaultWhenAbsent;
}
}
var _default = Driver;
exports["default"] = _default;
exports.default = Driver;
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "Date", {
enumerable: true,
get: function get() {
return _neo4jDriverCore.Date;
}
});
Object.defineProperty(exports, "DateTime", {
enumerable: true,
get: function get() {
return _neo4jDriverCore.DateTime;
}
});
Object.defineProperty(exports, "Driver", {
enumerable: true,
get: function get() {
return _driver.Driver;
}
});
Object.defineProperty(exports, "Duration", {
enumerable: true,
get: function get() {
return _neo4jDriverCore.Duration;
}
});
Object.defineProperty(exports, "Integer", {
enumerable: true,
get: function get() {
return _neo4jDriverCore.Integer;
}
});
Object.defineProperty(exports, "LocalDateTime", {
enumerable: true,
get: function get() {
return _neo4jDriverCore.LocalDateTime;
}
});
Object.defineProperty(exports, "LocalTime", {
enumerable: true,
get: function get() {
return _neo4jDriverCore.LocalTime;
}
});
Object.defineProperty(exports, "ManagedTransaction", {
enumerable: true,
get: function get() {
return _neo4jDriverCore.ManagedTransaction;
}
});
Object.defineProperty(exports, "Neo4jError", {
enumerable: true,
get: function get() {
return _neo4jDriverCore.Neo4jError;
}
});
Object.defineProperty(exports, "Node", {
enumerable: true,
get: function get() {
return _neo4jDriverCore.Node;
}
});
Object.defineProperty(exports, "Notification", {
enumerable: true,
get: function get() {
return _neo4jDriverCore.Notification;
}
});
Object.defineProperty(exports, "Path", {
enumerable: true,
get: function get() {
return _neo4jDriverCore.Path;
}
});
Object.defineProperty(exports, "PathSegment", {
enumerable: true,
get: function get() {
return _neo4jDriverCore.PathSegment;
}
});
Object.defineProperty(exports, "Plan", {
enumerable: true,
get: function get() {
return _neo4jDriverCore.Plan;
}
});
Object.defineProperty(exports, "Point", {
enumerable: true,
get: function get() {
return _neo4jDriverCore.Point;
}
});
Object.defineProperty(exports, "ProfiledPlan", {
enumerable: true,
get: function get() {
return _neo4jDriverCore.ProfiledPlan;
}
});
Object.defineProperty(exports, "QueryStatistics", {
enumerable: true,
get: function get() {
return _neo4jDriverCore.QueryStatistics;
}
});
Object.defineProperty(exports, "Record", {
enumerable: true,
get: function get() {
return _neo4jDriverCore.Record;
}
});
Object.defineProperty(exports, "Relationship", {
enumerable: true,
get: function get() {
return _neo4jDriverCore.Relationship;
}
});
Object.defineProperty(exports, "Result", {
enumerable: true,
get: function get() {
return _neo4jDriverCore.Result;
}
});
Object.defineProperty(exports, "ResultSummary", {
enumerable: true,
get: function get() {
return _neo4jDriverCore.ResultSummary;
}
});
Object.defineProperty(exports, "RxManagedTransaction", {
enumerable: true,
get: function get() {
return _transactionManagedRx["default"];
}
});
Object.defineProperty(exports, "RxResult", {
enumerable: true,
get: function get() {
return _resultRx["default"];
}
});
Object.defineProperty(exports, "RxSession", {
enumerable: true,
get: function get() {
return _sessionRx["default"];
}
});
Object.defineProperty(exports, "RxTransaction", {
enumerable: true,
get: function get() {
return _transactionRx["default"];
}
});
Object.defineProperty(exports, "ServerInfo", {
enumerable: true,
get: function get() {
return _neo4jDriverCore.ServerInfo;
}
});
Object.defineProperty(exports, "Session", {
enumerable: true,
get: function get() {
return _neo4jDriverCore.Session;
}
});
Object.defineProperty(exports, "Time", {
enumerable: true,
get: function get() {
return _neo4jDriverCore.Time;
}
});
Object.defineProperty(exports, "Transaction", {
enumerable: true,
get: function get() {
return _neo4jDriverCore.Transaction;
}
});
Object.defineProperty(exports, "UnboundRelationship", {
enumerable: true,
get: function get() {
return _neo4jDriverCore.UnboundRelationship;
}
});
Object.defineProperty(exports, "auth", {
enumerable: true,
get: function get() {
return _neo4jDriverCore.auth;
}
});
Object.defineProperty(exports, "bookmarkManager", {
enumerable: true,
get: function get() {
return _neo4jDriverCore.bookmarkManager;
}
});
exports["default"] = void 0;
exports.driver = driver;
Object.defineProperty(exports, "error", {
enumerable: true,
get: function get() {
return _neo4jDriverCore.error;
}
});
exports.hasReachableServer = hasReachableServer;
Object.defineProperty(exports, "int", {
enumerable: true,
get: function get() {
return _neo4jDriverCore["int"];
}
});
exports.integer = void 0;
Object.defineProperty(exports, "isDate", {
enumerable: true,
get: function get() {
return _neo4jDriverCore.isDate;
}
});
Object.defineProperty(exports, "isDateTime", {
enumerable: true,
get: function get() {
return _neo4jDriverCore.isDateTime;
}
});
Object.defineProperty(exports, "isDuration", {
enumerable: true,
get: function get() {
return _neo4jDriverCore.isDuration;
}
});
Object.defineProperty(exports, "isInt", {
enumerable: true,
get: function get() {
return _neo4jDriverCore.isInt;
}
});
Object.defineProperty(exports, "isLocalDateTime", {
enumerable: true,
get: function get() {
return _neo4jDriverCore.isLocalDateTime;
}
});
Object.defineProperty(exports, "isLocalTime", {
enumerable: true,
get: function get() {
return _neo4jDriverCore.isLocalTime;
}
});
Object.defineProperty(exports, "isPoint", {
enumerable: true,
get: function get() {
return _neo4jDriverCore.isPoint;
}
});
Object.defineProperty(exports, "isRetryableError", {
enumerable: true,
get: function get() {
return _neo4jDriverCore.isRetryableError;
}
});
Object.defineProperty(exports, "isTime", {
enumerable: true,
get: function get() {
return _neo4jDriverCore.isTime;
}
});
exports.types = exports.temporal = exports.spatial = exports.session = exports.logging = void 0;
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
var _driver = require("./driver");
var _version = _interopRequireDefault(require("./version"));
var _neo4jDriverCore = require("neo4j-driver-core");
var _neo4jDriverBoltConnection = require("neo4j-driver-bolt-connection");
var _sessionRx = _interopRequireDefault(require("./session-rx"));
var _transactionRx = _interopRequireDefault(require("./transaction-rx"));
var _transactionManagedRx = _interopRequireDefault(require("./transaction-managed-rx"));
var _resultRx = _interopRequireDefault(require("./result-rx"));
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (g && (g = 0, op[0] && (_ = 0)), _) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Integer = exports.Point = exports.PathSegment = exports.Path = exports.UnboundRelationship = exports.Relationship = exports.Node = exports.Record = exports.ServerInfo = exports.Notification = exports.QueryStatistics = exports.ProfiledPlan = exports.Plan = exports.ResultSummary = exports.RxResult = exports.RxManagedTransaction = exports.RxTransaction = exports.RxSession = exports.Result = exports.ManagedTransaction = exports.Transaction = exports.Session = exports.Driver = exports.temporal = exports.spatial = exports.graph = exports.error = exports.session = exports.types = exports.logging = exports.auth = exports.isRetryableError = exports.Neo4jError = exports.integer = exports.isUnboundRelationship = exports.isRelationship = exports.isPathSegment = exports.isPath = exports.isNode = exports.isDateTime = exports.isLocalDateTime = exports.isDate = exports.isTime = exports.isLocalTime = exports.isDuration = exports.isPoint = exports.isInt = exports.int = exports.hasReachableServer = exports.driver = void 0;
exports.bookmarkManager = exports.DateTime = exports.LocalDateTime = exports.Date = exports.Time = exports.LocalTime = exports.Duration = void 0;
/**

@@ -310,8 +62,59 @@ * Copyright (c) "Neo4j"

*/
var _internal$util = _neo4jDriverCore.internal.util,
ENCRYPTION_ON = _internal$util.ENCRYPTION_ON,
assertString = _internal$util.assertString,
isEmptyObjectOrNull = _internal$util.isEmptyObjectOrNull,
ServerAddress = _neo4jDriverCore.internal.serverAddress.ServerAddress,
urlUtil = _neo4jDriverCore.internal.urlUtil;
var driver_1 = require("./driver");
Object.defineProperty(exports, "Driver", { enumerable: true, get: function () { return driver_1.Driver; } });
var version_1 = __importDefault(require("./version"));
var neo4j_driver_core_1 = require("neo4j-driver-core");
Object.defineProperty(exports, "Neo4jError", { enumerable: true, get: function () { return neo4j_driver_core_1.Neo4jError; } });
Object.defineProperty(exports, "isRetryableError", { enumerable: true, get: function () { return neo4j_driver_core_1.isRetryableError; } });
Object.defineProperty(exports, "error", { enumerable: true, get: function () { return neo4j_driver_core_1.error; } });
Object.defineProperty(exports, "Integer", { enumerable: true, get: function () { return neo4j_driver_core_1.Integer; } });
Object.defineProperty(exports, "int", { enumerable: true, get: function () { return neo4j_driver_core_1.int; } });
Object.defineProperty(exports, "isInt", { enumerable: true, get: function () { return neo4j_driver_core_1.isInt; } });
Object.defineProperty(exports, "isPoint", { enumerable: true, get: function () { return neo4j_driver_core_1.isPoint; } });
Object.defineProperty(exports, "Point", { enumerable: true, get: function () { return neo4j_driver_core_1.Point; } });
Object.defineProperty(exports, "Date", { enumerable: true, get: function () { return neo4j_driver_core_1.Date; } });
Object.defineProperty(exports, "DateTime", { enumerable: true, get: function () { return neo4j_driver_core_1.DateTime; } });
Object.defineProperty(exports, "Duration", { enumerable: true, get: function () { return neo4j_driver_core_1.Duration; } });
Object.defineProperty(exports, "isDate", { enumerable: true, get: function () { return neo4j_driver_core_1.isDate; } });
Object.defineProperty(exports, "isDateTime", { enumerable: true, get: function () { return neo4j_driver_core_1.isDateTime; } });
Object.defineProperty(exports, "isDuration", { enumerable: true, get: function () { return neo4j_driver_core_1.isDuration; } });
Object.defineProperty(exports, "isLocalDateTime", { enumerable: true, get: function () { return neo4j_driver_core_1.isLocalDateTime; } });
Object.defineProperty(exports, "isLocalTime", { enumerable: true, get: function () { return neo4j_driver_core_1.isLocalTime; } });
Object.defineProperty(exports, "isNode", { enumerable: true, get: function () { return neo4j_driver_core_1.isNode; } });
Object.defineProperty(exports, "isPath", { enumerable: true, get: function () { return neo4j_driver_core_1.isPath; } });
Object.defineProperty(exports, "isPathSegment", { enumerable: true, get: function () { return neo4j_driver_core_1.isPathSegment; } });
Object.defineProperty(exports, "isRelationship", { enumerable: true, get: function () { return neo4j_driver_core_1.isRelationship; } });
Object.defineProperty(exports, "isTime", { enumerable: true, get: function () { return neo4j_driver_core_1.isTime; } });
Object.defineProperty(exports, "isUnboundRelationship", { enumerable: true, get: function () { return neo4j_driver_core_1.isUnboundRelationship; } });
Object.defineProperty(exports, "LocalDateTime", { enumerable: true, get: function () { return neo4j_driver_core_1.LocalDateTime; } });
Object.defineProperty(exports, "LocalTime", { enumerable: true, get: function () { return neo4j_driver_core_1.LocalTime; } });
Object.defineProperty(exports, "Time", { enumerable: true, get: function () { return neo4j_driver_core_1.Time; } });
Object.defineProperty(exports, "Node", { enumerable: true, get: function () { return neo4j_driver_core_1.Node; } });
Object.defineProperty(exports, "Path", { enumerable: true, get: function () { return neo4j_driver_core_1.Path; } });
Object.defineProperty(exports, "PathSegment", { enumerable: true, get: function () { return neo4j_driver_core_1.PathSegment; } });
Object.defineProperty(exports, "Relationship", { enumerable: true, get: function () { return neo4j_driver_core_1.Relationship; } });
Object.defineProperty(exports, "UnboundRelationship", { enumerable: true, get: function () { return neo4j_driver_core_1.UnboundRelationship; } });
Object.defineProperty(exports, "Record", { enumerable: true, get: function () { return neo4j_driver_core_1.Record; } });
Object.defineProperty(exports, "ResultSummary", { enumerable: true, get: function () { return neo4j_driver_core_1.ResultSummary; } });
Object.defineProperty(exports, "Plan", { enumerable: true, get: function () { return neo4j_driver_core_1.Plan; } });
Object.defineProperty(exports, "ProfiledPlan", { enumerable: true, get: function () { return neo4j_driver_core_1.ProfiledPlan; } });
Object.defineProperty(exports, "QueryStatistics", { enumerable: true, get: function () { return neo4j_driver_core_1.QueryStatistics; } });
Object.defineProperty(exports, "Notification", { enumerable: true, get: function () { return neo4j_driver_core_1.Notification; } });
Object.defineProperty(exports, "ServerInfo", { enumerable: true, get: function () { return neo4j_driver_core_1.ServerInfo; } });
Object.defineProperty(exports, "Result", { enumerable: true, get: function () { return neo4j_driver_core_1.Result; } });
Object.defineProperty(exports, "auth", { enumerable: true, get: function () { return neo4j_driver_core_1.auth; } });
Object.defineProperty(exports, "Session", { enumerable: true, get: function () { return neo4j_driver_core_1.Session; } });
Object.defineProperty(exports, "Transaction", { enumerable: true, get: function () { return neo4j_driver_core_1.Transaction; } });
Object.defineProperty(exports, "ManagedTransaction", { enumerable: true, get: function () { return neo4j_driver_core_1.ManagedTransaction; } });
Object.defineProperty(exports, "bookmarkManager", { enumerable: true, get: function () { return neo4j_driver_core_1.bookmarkManager; } });
var neo4j_driver_bolt_connection_1 = require("neo4j-driver-bolt-connection");
var session_rx_1 = __importDefault(require("./session-rx"));
exports.RxSession = session_rx_1.default;
var transaction_rx_1 = __importDefault(require("./transaction-rx"));
exports.RxTransaction = transaction_rx_1.default;
var transaction_managed_rx_1 = __importDefault(require("./transaction-managed-rx"));
exports.RxManagedTransaction = transaction_managed_rx_1.default;
var result_rx_1 = __importDefault(require("./result-rx"));
exports.RxResult = result_rx_1.default;
var _a = neo4j_driver_core_1.internal.util, ENCRYPTION_ON = _a.ENCRYPTION_ON, assertString = _a.assertString, isEmptyObjectOrNull = _a.isEmptyObjectOrNull, ServerAddress = neo4j_driver_core_1.internal.serverAddress.ServerAddress, urlUtil = neo4j_driver_core_1.internal.urlUtil;
/**

@@ -447,102 +250,91 @@ * Construct a new Neo4j Driver. This is your main entry point for this

*/
function driver(url, authToken) {
var config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
assertString(url, 'Bolt URL');
var parsedUrl = urlUtil.parseDatabaseUrl(url); // Determine entryption/trust options from the URL.
var routing = false;
var encrypted = false;
var trust;
switch (parsedUrl.scheme) {
case 'bolt':
break;
case 'bolt+s':
encrypted = true;
trust = 'TRUST_SYSTEM_CA_SIGNED_CERTIFICATES';
break;
case 'bolt+ssc':
encrypted = true;
trust = 'TRUST_ALL_CERTIFICATES';
break;
case 'neo4j':
routing = true;
break;
case 'neo4j+s':
encrypted = true;
trust = 'TRUST_SYSTEM_CA_SIGNED_CERTIFICATES';
routing = true;
break;
case 'neo4j+ssc':
encrypted = true;
trust = 'TRUST_ALL_CERTIFICATES';
routing = true;
break;
default:
throw new Error("Unknown scheme: ".concat(parsedUrl.scheme));
} // Encryption enabled on URL, propagate trust to the config.
if (encrypted) {
// Check for configuration conflict between URL and config.
if ('encrypted' in config || 'trust' in config) {
throw new Error('Encryption/trust can only be configured either through URL or config, not both');
function driver(url, authToken, config) {
if (config === void 0) { config = {}; }
assertString(url, 'Bolt URL');
var parsedUrl = urlUtil.parseDatabaseUrl(url);
// Determine entryption/trust options from the URL.
var routing = false;
var encrypted = false;
var trust;
switch (parsedUrl.scheme) {
case 'bolt':
break;
case 'bolt+s':
encrypted = true;
trust = 'TRUST_SYSTEM_CA_SIGNED_CERTIFICATES';
break;
case 'bolt+ssc':
encrypted = true;
trust = 'TRUST_ALL_CERTIFICATES';
break;
case 'neo4j':
routing = true;
break;
case 'neo4j+s':
encrypted = true;
trust = 'TRUST_SYSTEM_CA_SIGNED_CERTIFICATES';
routing = true;
break;
case 'neo4j+ssc':
encrypted = true;
trust = 'TRUST_ALL_CERTIFICATES';
routing = true;
break;
default:
throw new Error("Unknown scheme: ".concat(parsedUrl.scheme));
}
config.encrypted = ENCRYPTION_ON;
config.trust = trust;
} // Sanitize authority token. Nicer error from server when a scheme is set.
authToken = authToken || {};
authToken.scheme = authToken.scheme || 'none'; // Use default user agent or user agent specified by user.
config.userAgent = config.userAgent || USER_AGENT;
var address = ServerAddress.fromUrl(parsedUrl.hostAndPort);
var meta = {
address: address,
typename: routing ? 'Routing' : 'Direct',
routing: routing
};
return new _driver.Driver(meta, config, createConnectionProviderFunction());
function createConnectionProviderFunction() {
if (routing) {
return function (id, config, log, hostNameResolver) {
return new _neo4jDriverBoltConnection.RoutingConnectionProvider({
id: id,
config: config,
log: log,
hostNameResolver: hostNameResolver,
authToken: authToken,
address: address,
userAgent: config.userAgent,
routingContext: parsedUrl.query
});
};
} else {
if (!isEmptyObjectOrNull(parsedUrl.query)) {
throw new Error("Parameters are not supported with none routed scheme. Given URL: '".concat(url, "'"));
}
return function (id, config, log) {
return new _neo4jDriverBoltConnection.DirectConnectionProvider({
id: id,
config: config,
log: log,
authToken: authToken,
address: address,
userAgent: config.userAgent
});
};
// Encryption enabled on URL, propagate trust to the config.
if (encrypted) {
// Check for configuration conflict between URL and config.
if ('encrypted' in config || 'trust' in config) {
throw new Error('Encryption/trust can only be configured either through URL or config, not both');
}
config.encrypted = ENCRYPTION_ON;
config.trust = trust;
}
}
// Sanitize authority token. Nicer error from server when a scheme is set.
authToken = authToken || {};
authToken.scheme = authToken.scheme || 'none';
// Use default user agent or user agent specified by user.
config.userAgent = config.userAgent || USER_AGENT;
var address = ServerAddress.fromUrl(parsedUrl.hostAndPort);
var meta = {
address: address,
typename: routing ? 'Routing' : 'Direct',
routing: routing
};
return new driver_1.Driver(meta, config, createConnectionProviderFunction());
function createConnectionProviderFunction() {
if (routing) {
return function (id, config, log, hostNameResolver) {
return new neo4j_driver_bolt_connection_1.RoutingConnectionProvider({
id: id,
config: config,
log: log,
hostNameResolver: hostNameResolver,
authToken: authToken,
address: address,
userAgent: config.userAgent,
routingContext: parsedUrl.query
});
};
}
else {
if (!isEmptyObjectOrNull(parsedUrl.query)) {
throw new Error("Parameters are not supported with none routed scheme. Given URL: '".concat(url, "'"));
}
return function (id, config, log) {
return new neo4j_driver_bolt_connection_1.DirectConnectionProvider({
id: id,
config: config,
log: log,
authToken: authToken,
address: address,
userAgent: config.userAgent
});
};
}
}
}
exports.driver = driver;
/**

@@ -558,46 +350,27 @@ * Verifies if the driver can reach a server at the given url.

*/
function hasReachableServer(_x, _x2) {
return _hasReachableServer.apply(this, arguments);
function hasReachableServer(url, config) {
return __awaiter(this, void 0, void 0, function () {
var nonLoggedDriver;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
nonLoggedDriver = driver(url, { scheme: 'none', principal: '', credentials: '' }, config);
_a.label = 1;
case 1:
_a.trys.push([1, , 3, 5]);
return [4 /*yield*/, nonLoggedDriver.getNegotiatedProtocolVersion()];
case 2:
_a.sent();
return [2 /*return*/, true];
case 3: return [4 /*yield*/, nonLoggedDriver.close()];
case 4:
_a.sent();
return [7 /*endfinally*/];
case 5: return [2 /*return*/];
}
});
});
}
function _hasReachableServer() {
_hasReachableServer = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(url, config) {
var nonLoggedDriver;
return _regenerator["default"].wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
nonLoggedDriver = driver(url, {
scheme: 'none',
principal: '',
credentials: ''
}, config);
_context.prev = 1;
_context.next = 4;
return nonLoggedDriver.getNegotiatedProtocolVersion();
case 4:
return _context.abrupt("return", true);
case 5:
_context.prev = 5;
_context.next = 8;
return nonLoggedDriver.close();
case 8:
return _context.finish(5);
case 9:
case "end":
return _context.stop();
}
}
}, _callee, null, [[1,, 5, 9]]);
}));
return _hasReachableServer.apply(this, arguments);
}
var USER_AGENT = 'neo4j-javascript/' + _version["default"];
exports.hasReachableServer = hasReachableServer;
var USER_AGENT = 'neo4j-javascript/' + version_1.default;
/**

@@ -608,145 +381,144 @@ * Object containing predefined logging configurations. These are expected to be used as values of the driver config's `logging` property.

*/
var logging = {
console: function (_console) {
function console(_x3) {
return _console.apply(this, arguments);
console: function (level) {
return {
level: level,
logger: function (level, message) {
return console.log("".concat(global.Date.now(), " ").concat(level.toUpperCase(), " ").concat(message));
}
};
}
console.toString = function () {
return _console.toString();
};
return console;
}(function (level) {
return {
level: level,
logger: function logger(level, message) {
return console.log("".concat(global.Date.now(), " ").concat(level.toUpperCase(), " ").concat(message));
}
};
})
};
exports.logging = logging;
/**
* Object containing constructors for all neo4j types.
*/
exports.logging = logging;
var types = {
Node: _neo4jDriverCore.Node,
Relationship: _neo4jDriverCore.Relationship,
UnboundRelationship: _neo4jDriverCore.UnboundRelationship,
PathSegment: _neo4jDriverCore.PathSegment,
Path: _neo4jDriverCore.Path,
Result: _neo4jDriverCore.Result,
ResultSummary: _neo4jDriverCore.ResultSummary,
Record: _neo4jDriverCore.Record,
Point: _neo4jDriverCore.Point,
Date: _neo4jDriverCore.Date,
DateTime: _neo4jDriverCore.DateTime,
Duration: _neo4jDriverCore.Duration,
LocalDateTime: _neo4jDriverCore.LocalDateTime,
LocalTime: _neo4jDriverCore.LocalTime,
Time: _neo4jDriverCore.Time,
Integer: _neo4jDriverCore.Integer
Node: neo4j_driver_core_1.Node,
Relationship: neo4j_driver_core_1.Relationship,
UnboundRelationship: neo4j_driver_core_1.UnboundRelationship,
PathSegment: neo4j_driver_core_1.PathSegment,
Path: neo4j_driver_core_1.Path,
Result: neo4j_driver_core_1.Result,
ResultSummary: neo4j_driver_core_1.ResultSummary,
Record: neo4j_driver_core_1.Record,
Point: neo4j_driver_core_1.Point,
Date: neo4j_driver_core_1.Date,
DateTime: neo4j_driver_core_1.DateTime,
Duration: neo4j_driver_core_1.Duration,
LocalDateTime: neo4j_driver_core_1.LocalDateTime,
LocalTime: neo4j_driver_core_1.LocalTime,
Time: neo4j_driver_core_1.Time,
Integer: neo4j_driver_core_1.Integer
};
exports.types = types;
/**
* Object containing string constants representing session access modes.
*/
exports.types = types;
var session = {
READ: _driver.READ,
WRITE: _driver.WRITE
READ: driver_1.READ,
WRITE: driver_1.WRITE
};
exports.session = session;
/**
* Object containing functions to work with {@link Integer} objects.
*/
exports.session = session;
var integer = {
toNumber: _neo4jDriverCore.toNumber,
toString: _neo4jDriverCore.toString,
inSafeRange: _neo4jDriverCore.inSafeRange
toNumber: neo4j_driver_core_1.toNumber,
toString: neo4j_driver_core_1.toString,
inSafeRange: neo4j_driver_core_1.inSafeRange
};
exports.integer = integer;
/**
* Object containing functions to work with spatial types, like {@link Point}.
*/
exports.integer = integer;
var spatial = {
isPoint: _neo4jDriverCore.isPoint
isPoint: neo4j_driver_core_1.isPoint
};
exports.spatial = spatial;
/**
* Object containing functions to work with temporal types, like {@link Time} or {@link Duration}.
*/
exports.spatial = spatial;
var temporal = {
isDuration: _neo4jDriverCore.isDuration,
isLocalTime: _neo4jDriverCore.isLocalTime,
isTime: _neo4jDriverCore.isTime,
isDate: _neo4jDriverCore.isDate,
isLocalDateTime: _neo4jDriverCore.isLocalDateTime,
isDateTime: _neo4jDriverCore.isDateTime
isDuration: neo4j_driver_core_1.isDuration,
isLocalTime: neo4j_driver_core_1.isLocalTime,
isTime: neo4j_driver_core_1.isTime,
isDate: neo4j_driver_core_1.isDate,
isLocalDateTime: neo4j_driver_core_1.isLocalDateTime,
isDateTime: neo4j_driver_core_1.isDateTime
};
exports.temporal = temporal;
/**
* Object containing functions to work with graph types, like {@link Node} or {@link Relationship}.
*/
var graph = {
isNode: neo4j_driver_core_1.isNode,
isPath: neo4j_driver_core_1.isPath,
isPathSegment: neo4j_driver_core_1.isPathSegment,
isRelationship: neo4j_driver_core_1.isRelationship,
isUnboundRelationship: neo4j_driver_core_1.isUnboundRelationship
};
exports.graph = graph;
/**
* @private
*/
exports.temporal = temporal;
var forExport = {
driver: driver,
hasReachableServer: hasReachableServer,
"int": _neo4jDriverCore["int"],
isInt: _neo4jDriverCore.isInt,
isPoint: _neo4jDriverCore.isPoint,
isDuration: _neo4jDriverCore.isDuration,
isLocalTime: _neo4jDriverCore.isLocalTime,
isTime: _neo4jDriverCore.isTime,
isDate: _neo4jDriverCore.isDate,
isLocalDateTime: _neo4jDriverCore.isLocalDateTime,
isDateTime: _neo4jDriverCore.isDateTime,
integer: integer,
Neo4jError: _neo4jDriverCore.Neo4jError,
isRetryableError: _neo4jDriverCore.isRetryableError,
auth: _neo4jDriverCore.auth,
logging: logging,
types: types,
session: session,
error: _neo4jDriverCore.error,
spatial: spatial,
temporal: temporal,
Driver: _driver.Driver,
Session: _neo4jDriverCore.Session,
Transaction: _neo4jDriverCore.Transaction,
ManagedTransaction: _neo4jDriverCore.ManagedTransaction,
Result: _neo4jDriverCore.Result,
RxSession: _sessionRx["default"],
RxTransaction: _transactionRx["default"],
RxManagedTransaction: _transactionManagedRx["default"],
RxResult: _resultRx["default"],
ResultSummary: _neo4jDriverCore.ResultSummary,
Plan: _neo4jDriverCore.Plan,
ProfiledPlan: _neo4jDriverCore.ProfiledPlan,
QueryStatistics: _neo4jDriverCore.QueryStatistics,
Notification: _neo4jDriverCore.Notification,
ServerInfo: _neo4jDriverCore.ServerInfo,
Record: _neo4jDriverCore.Record,
Node: _neo4jDriverCore.Node,
Relationship: _neo4jDriverCore.Relationship,
UnboundRelationship: _neo4jDriverCore.UnboundRelationship,
Path: _neo4jDriverCore.Path,
PathSegment: _neo4jDriverCore.PathSegment,
Point: _neo4jDriverCore.Point,
Integer: _neo4jDriverCore.Integer,
Duration: _neo4jDriverCore.Duration,
LocalTime: _neo4jDriverCore.LocalTime,
Time: _neo4jDriverCore.Time,
Date: _neo4jDriverCore.Date,
LocalDateTime: _neo4jDriverCore.LocalDateTime,
DateTime: _neo4jDriverCore.DateTime,
bookmarkManager: _neo4jDriverCore.bookmarkManager
driver: driver,
hasReachableServer: hasReachableServer,
int: neo4j_driver_core_1.int,
isInt: neo4j_driver_core_1.isInt,
isPoint: neo4j_driver_core_1.isPoint,
isDuration: neo4j_driver_core_1.isDuration,
isLocalTime: neo4j_driver_core_1.isLocalTime,
isTime: neo4j_driver_core_1.isTime,
isDate: neo4j_driver_core_1.isDate,
isLocalDateTime: neo4j_driver_core_1.isLocalDateTime,
isDateTime: neo4j_driver_core_1.isDateTime,
isNode: neo4j_driver_core_1.isNode,
isPath: neo4j_driver_core_1.isPath,
isPathSegment: neo4j_driver_core_1.isPathSegment,
isRelationship: neo4j_driver_core_1.isRelationship,
isUnboundRelationship: neo4j_driver_core_1.isUnboundRelationship,
integer: integer,
Neo4jError: neo4j_driver_core_1.Neo4jError,
isRetryableError: neo4j_driver_core_1.isRetryableError,
auth: neo4j_driver_core_1.auth,
logging: logging,
types: types,
session: session,
error: neo4j_driver_core_1.error,
graph: graph,
spatial: spatial,
temporal: temporal,
Driver: driver_1.Driver,
Session: neo4j_driver_core_1.Session,
Transaction: neo4j_driver_core_1.Transaction,
ManagedTransaction: neo4j_driver_core_1.ManagedTransaction,
Result: neo4j_driver_core_1.Result,
RxSession: session_rx_1.default,
RxTransaction: transaction_rx_1.default,
RxManagedTransaction: transaction_managed_rx_1.default,
RxResult: result_rx_1.default,
ResultSummary: neo4j_driver_core_1.ResultSummary,
Plan: neo4j_driver_core_1.Plan,
ProfiledPlan: neo4j_driver_core_1.ProfiledPlan,
QueryStatistics: neo4j_driver_core_1.QueryStatistics,
Notification: neo4j_driver_core_1.Notification,
ServerInfo: neo4j_driver_core_1.ServerInfo,
Record: neo4j_driver_core_1.Record,
Node: neo4j_driver_core_1.Node,
Relationship: neo4j_driver_core_1.Relationship,
UnboundRelationship: neo4j_driver_core_1.UnboundRelationship,
Path: neo4j_driver_core_1.Path,
PathSegment: neo4j_driver_core_1.PathSegment,
Point: neo4j_driver_core_1.Point,
Integer: neo4j_driver_core_1.Integer,
Duration: neo4j_driver_core_1.Duration,
LocalTime: neo4j_driver_core_1.LocalTime,
Time: neo4j_driver_core_1.Time,
Date: neo4j_driver_core_1.Date,
LocalDateTime: neo4j_driver_core_1.LocalDateTime,
DateTime: neo4j_driver_core_1.DateTime,
bookmarkManager: neo4j_driver_core_1.bookmarkManager
};
var _default = forExport;
exports["default"] = _default;
exports.default = forExport;
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
var _neo4jDriverCore = require("neo4j-driver-core");
var _rxjs = require("rxjs");
var _operators = require("rxjs/operators");
/**

@@ -38,103 +20,73 @@ * Copyright (c) "Neo4j"

*/
Object.defineProperty(exports, "__esModule", { value: true });
var neo4j_driver_core_1 = require("neo4j-driver-core");
// eslint-disable-next-line no-unused-vars
var Logger = _neo4jDriverCore.internal.logger.Logger;
var SERVICE_UNAVAILABLE = _neo4jDriverCore.error.SERVICE_UNAVAILABLE;
var rxjs_1 = require("rxjs");
var operators_1 = require("rxjs/operators");
var
// eslint-disable-next-line no-unused-vars
Logger = neo4j_driver_core_1.internal.logger.Logger;
var SERVICE_UNAVAILABLE = neo4j_driver_core_1.error.SERVICE_UNAVAILABLE;
var DEFAULT_MAX_RETRY_TIME_MS = 30 * 1000; // 30 seconds
var DEFAULT_INITIAL_RETRY_DELAY_MS = 1000; // 1 seconds
var DEFAULT_RETRY_DELAY_MULTIPLIER = 2.0;
var DEFAULT_RETRY_DELAY_JITTER_FACTOR = 0.2;
var RxRetryLogic = /*#__PURE__*/function () {
/**
*
* @param {Object} args
* @param {Logger} args.logger
*/
function RxRetryLogic() {
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
_ref$maxRetryTimeout = _ref.maxRetryTimeout,
maxRetryTimeout = _ref$maxRetryTimeout === void 0 ? DEFAULT_MAX_RETRY_TIME_MS : _ref$maxRetryTimeout,
_ref$initialDelay = _ref.initialDelay,
initialDelay = _ref$initialDelay === void 0 ? DEFAULT_INITIAL_RETRY_DELAY_MS : _ref$initialDelay,
_ref$delayMultiplier = _ref.delayMultiplier,
delayMultiplier = _ref$delayMultiplier === void 0 ? DEFAULT_RETRY_DELAY_MULTIPLIER : _ref$delayMultiplier,
_ref$delayJitter = _ref.delayJitter,
delayJitter = _ref$delayJitter === void 0 ? DEFAULT_RETRY_DELAY_JITTER_FACTOR : _ref$delayJitter,
_ref$logger = _ref.logger,
logger = _ref$logger === void 0 ? null : _ref$logger;
(0, _classCallCheck2["default"])(this, RxRetryLogic);
this._maxRetryTimeout = valueOrDefault(maxRetryTimeout, DEFAULT_MAX_RETRY_TIME_MS);
this._initialDelay = valueOrDefault(initialDelay, DEFAULT_INITIAL_RETRY_DELAY_MS);
this._delayMultiplier = valueOrDefault(delayMultiplier, DEFAULT_RETRY_DELAY_MULTIPLIER);
this._delayJitter = valueOrDefault(delayJitter, DEFAULT_RETRY_DELAY_JITTER_FACTOR);
this._logger = logger;
}
/**
*
* @param {Observable<Any>} work
*/
(0, _createClass2["default"])(RxRetryLogic, [{
key: "retry",
value: function retry(work) {
var _this = this;
return work.pipe((0, _operators.retryWhen)(function (failedWork) {
var handledExceptions = [];
var startTime = Date.now();
var retryCount = 1;
var delayDuration = _this._initialDelay;
return failedWork.pipe((0, _operators.mergeMap)(function (err) {
if (!(0, _neo4jDriverCore.isRetriableError)(err)) {
return (0, _rxjs.throwError)(function () {
return err;
});
}
handledExceptions.push(err);
if (retryCount >= 2 && Date.now() - startTime >= _this._maxRetryTimeout) {
var _error = (0, _neo4jDriverCore.newError)("Failed after retried for ".concat(retryCount, " times in ").concat(_this._maxRetryTimeout, " ms. Make sure that your database is online and retry again."), SERVICE_UNAVAILABLE);
_error.seenErrors = handledExceptions;
return (0, _rxjs.throwError)(function () {
return _error;
});
}
var nextDelayDuration = _this._computeNextDelay(delayDuration);
delayDuration = delayDuration * _this._delayMultiplier;
retryCount++;
if (_this._logger) {
_this._logger.warn("Transaction failed and will be retried in ".concat(nextDelayDuration));
}
return (0, _rxjs.of)(1).pipe((0, _operators.delay)(nextDelayDuration));
var RxRetryLogic = /** @class */ (function () {
/**
*
* @param {Object} args
* @param {Logger} args.logger
*/
function RxRetryLogic(_a) {
var _b = _a === void 0 ? {} : _a, _c = _b.maxRetryTimeout, maxRetryTimeout = _c === void 0 ? DEFAULT_MAX_RETRY_TIME_MS : _c, _d = _b.initialDelay, initialDelay = _d === void 0 ? DEFAULT_INITIAL_RETRY_DELAY_MS : _d, _e = _b.delayMultiplier, delayMultiplier = _e === void 0 ? DEFAULT_RETRY_DELAY_MULTIPLIER : _e, _f = _b.delayJitter, delayJitter = _f === void 0 ? DEFAULT_RETRY_DELAY_JITTER_FACTOR : _f, _g = _b.logger, logger = _g === void 0 ? null : _g;
this._maxRetryTimeout = valueOrDefault(maxRetryTimeout, DEFAULT_MAX_RETRY_TIME_MS);
this._initialDelay = valueOrDefault(initialDelay, DEFAULT_INITIAL_RETRY_DELAY_MS);
this._delayMultiplier = valueOrDefault(delayMultiplier, DEFAULT_RETRY_DELAY_MULTIPLIER);
this._delayJitter = valueOrDefault(delayJitter, DEFAULT_RETRY_DELAY_JITTER_FACTOR);
this._logger = logger;
}
/**
*
* @param {Observable<Any>} work
*/
RxRetryLogic.prototype.retry = function (work) {
var _this = this;
return work.pipe((0, operators_1.retryWhen)(function (failedWork) {
var handledExceptions = [];
var startTime = Date.now();
var retryCount = 1;
var delayDuration = _this._initialDelay;
return failedWork.pipe((0, operators_1.mergeMap)(function (err) {
if (!(0, neo4j_driver_core_1.isRetriableError)(err)) {
return (0, rxjs_1.throwError)(function () { return err; });
}
handledExceptions.push(err);
if (retryCount >= 2 &&
Date.now() - startTime >= _this._maxRetryTimeout) {
var error_1 = (0, neo4j_driver_core_1.newError)("Failed after retried for ".concat(retryCount, " times in ").concat(_this._maxRetryTimeout, " ms. Make sure that your database is online and retry again."), SERVICE_UNAVAILABLE);
error_1.seenErrors = handledExceptions;
return (0, rxjs_1.throwError)(function () { return error_1; });
}
var nextDelayDuration = _this._computeNextDelay(delayDuration);
delayDuration = delayDuration * _this._delayMultiplier;
retryCount++;
if (_this._logger) {
_this._logger.warn("Transaction failed and will be retried in ".concat(nextDelayDuration));
}
return (0, rxjs_1.of)(1).pipe((0, operators_1.delay)(nextDelayDuration));
}));
}));
}));
};
RxRetryLogic.prototype._computeNextDelay = function (delay) {
var jitter = delay * this._delayJitter;
return delay - jitter + 2 * jitter * Math.random();
};
return RxRetryLogic;
}());
exports.default = RxRetryLogic;
function valueOrDefault(value, defaultValue) {
if (value || value === 0) {
return value;
}
}, {
key: "_computeNextDelay",
value: function _computeNextDelay(delay) {
var jitter = delay * this._delayJitter;
return delay - jitter + 2 * jitter * Math.random();
}
}]);
return RxRetryLogic;
}();
exports["default"] = RxRetryLogic;
function valueOrDefault(value, defaultValue) {
if (value || value === 0) {
return value;
}
return defaultValue;
return defaultValue;
}
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.VERSION_IN_DEV = exports.VERSION_4_0_0 = exports.VERSION_3_5_0 = exports.VERSION_3_4_0 = exports.VERSION_3_2_0 = exports.ServerVersion = void 0;
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
var _neo4jDriverCore = require("neo4j-driver-core");
/**

@@ -34,70 +20,37 @@ * Copyright (c) "Neo4j"

*/
var assertString = _neo4jDriverCore.internal.util.assertString;
Object.defineProperty(exports, "__esModule", { value: true });
exports.VERSION_IN_DEV = exports.VERSION_4_0_0 = exports.VERSION_3_5_0 = exports.VERSION_3_4_0 = exports.VERSION_3_2_0 = exports.ServerVersion = void 0;
var neo4j_driver_core_1 = require("neo4j-driver-core");
var assertString = neo4j_driver_core_1.internal.util.assertString;
var SERVER_VERSION_REGEX = /^(Neo4j\/)?(\d+)\.(\d+)(?:\.)?(\d*)(\.|-|\+)?([0-9A-Za-z-.]*)?$/;
var NEO4J_IN_DEV_VERSION_STRING = 'Neo4j/dev';
var ServerVersion = /*#__PURE__*/function () {
/**
* @constructor
* @param {number} major the major version number.
* @param {number} minor the minor version number.
* @param {number} patch the patch version number.
* @param {string} [originalVersionString] the original version string
*/
function ServerVersion(major, minor, patch, originalVersionString) {
(0, _classCallCheck2["default"])(this, ServerVersion);
this.major = major;
this.minor = minor;
this.patch = patch;
this._originalVersionString = originalVersionString;
}
/**
* Fetch server version using the given driver.
* @param {Driver} driver the driver to use.
* @return {Promise<ServerVersion>} promise resolved with a {@link ServerVersion} object or rejected with error.
*/
(0, _createClass2["default"])(ServerVersion, [{
key: "compareTo",
value:
var ServerVersion = /** @class */ (function () {
/**
* Compare this version to the given one.
* @param {ServerVersion} other the version to compare with.
* @return {number} value 0 if this version is the same as the given one, value less then 0 when this version
* was released earlier than the given one and value greater then 0 when this version was released after
* than the given one.
* @constructor
* @param {number} major the major version number.
* @param {number} minor the minor version number.
* @param {number} patch the patch version number.
* @param {string} [originalVersionString] the original version string
*/
function compareTo(other) {
var result = compareInts(this.major, other.major);
if (result === 0) {
result = compareInts(this.minor, other.minor);
if (result === 0) {
result = compareInts(this.patch, other.patch);
}
}
return result;
function ServerVersion(major, minor, patch, originalVersionString) {
this.major = major;
this.minor = minor;
this.patch = patch;
this._originalVersionString = originalVersionString;
}
}, {
key: "toString",
value: function toString() {
if (this._originalVersionString) {
return this._originalVersionString;
}
return "".concat(this.major, ".").concat(this.minor, ".").concat(this.patch);
}
}], [{
key: "fromDriver",
value: function fromDriver(driver) {
var session = driver.session();
return session.run('RETURN 1').then(function (result) {
return session.close().then(function () {
return ServerVersion.fromString(result.summary.server.version);
/**
* Fetch server version using the given driver.
* @param {Driver} driver the driver to use.
* @return {Promise<ServerVersion>} promise resolved with a {@link ServerVersion} object or rejected with error.
*/
ServerVersion.fromDriver = function (driver) {
var session = driver.session();
return session
.run('RETURN 1')
.then(function (result) {
return session
.close()
.then(function () { return ServerVersion.fromString(result.summary.server.version); });
});
});
}
};
/**

@@ -109,47 +62,55 @@ * Parse given string to a {@link ServerVersion} object.

*/
}, {
key: "fromString",
value: function fromString(versionStr) {
if (!versionStr) {
return new ServerVersion(3, 0, 0);
}
assertString(versionStr, 'Neo4j version string');
if (versionStr.toLowerCase() === NEO4J_IN_DEV_VERSION_STRING.toLowerCase()) {
return VERSION_IN_DEV;
}
var version = versionStr.match(SERVER_VERSION_REGEX);
if (!version) {
throw new Error("Unparsable Neo4j version: ".concat(versionStr));
}
var major = parseIntStrict(version[2]);
var minor = parseIntStrict(version[3]);
var patch = parseIntStrict(version[4] || 0);
return new ServerVersion(major, minor, patch, versionStr);
}
}]);
return ServerVersion;
}();
ServerVersion.fromString = function (versionStr) {
if (!versionStr) {
return new ServerVersion(3, 0, 0);
}
assertString(versionStr, 'Neo4j version string');
if (versionStr.toLowerCase() === NEO4J_IN_DEV_VERSION_STRING.toLowerCase()) {
return VERSION_IN_DEV;
}
var version = versionStr.match(SERVER_VERSION_REGEX);
if (!version) {
throw new Error("Unparsable Neo4j version: ".concat(versionStr));
}
var major = parseIntStrict(version[2]);
var minor = parseIntStrict(version[3]);
var patch = parseIntStrict(version[4] || 0);
return new ServerVersion(major, minor, patch, versionStr);
};
/**
* Compare this version to the given one.
* @param {ServerVersion} other the version to compare with.
* @return {number} value 0 if this version is the same as the given one, value less then 0 when this version
* was released earlier than the given one and value greater then 0 when this version was released after
* than the given one.
*/
ServerVersion.prototype.compareTo = function (other) {
var result = compareInts(this.major, other.major);
if (result === 0) {
result = compareInts(this.minor, other.minor);
if (result === 0) {
result = compareInts(this.patch, other.patch);
}
}
return result;
};
ServerVersion.prototype.toString = function () {
if (this._originalVersionString) {
return this._originalVersionString;
}
return "".concat(this.major, ".").concat(this.minor, ".").concat(this.patch);
};
return ServerVersion;
}());
exports.ServerVersion = ServerVersion;
function parseIntStrict(str, name) {
var value = parseInt(str, 10);
if (!value && value !== 0) {
throw new Error("Unparsable number ".concat(name, ": '").concat(str, "'"));
}
return value;
var value = parseInt(str, 10);
if (!value && value !== 0) {
throw new Error("Unparsable number ".concat(name, ": '").concat(str, "'"));
}
return value;
}
function compareInts(x, y) {
return x < y ? -1 : x === y ? 0 : 1;
return x < y ? -1 : x === y ? 0 : 1;
}
var VERSION_3_2_0 = ServerVersion.fromString('Neo4j/3.2.0');

@@ -156,0 +117,0 @@ exports.VERSION_3_2_0 = VERSION_3_2_0;

"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
var _neo4jDriverCore = require("neo4j-driver-core");
var _rxjs = require("rxjs");
var _operators = require("rxjs/operators");
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (g && (g = 0, op[0] && (_ = 0)), _) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
};
Object.defineProperty(exports, "__esModule", { value: true });
/**

@@ -42,8 +57,10 @@ * Copyright (c) "Neo4j"

*/
/* eslint-disable-next-line no-unused-vars */
var neo4j_driver_core_1 = require("neo4j-driver-core");
var rxjs_1 = require("rxjs");
var operators_1 = require("rxjs/operators");
var States = {
READY: 0,
STREAMING: 1,
COMPLETED: 2
READY: 0,
STREAMING: 1,
COMPLETED: 2
};

@@ -53,40 +70,32 @@ /**

*/
var RxResult = /*#__PURE__*/function () {
/**
* @constructor
* @protected
* @param {Observable<Result>} result - An observable of single Result instance to relay requests.
* @param {number} state - The streaming state
*/
function RxResult(result, state) {
(0, _classCallCheck2["default"])(this, RxResult);
var replayedResult = result.pipe((0, _operators.publishReplay)(1), (0, _operators.refCount)());
this._result = replayedResult;
this._keys = replayedResult.pipe((0, _operators.mergeMap)(function (r) {
return (0, _rxjs.from)(r.keys());
}), (0, _operators.publishReplay)(1), (0, _operators.refCount)());
this._records = undefined;
this._controls = new StreamControl();
this._summary = new _rxjs.ReplaySubject();
this._state = state || States.READY;
}
/**
* Returns an observable that exposes a single item containing field names
* returned by the executing query.
*
* Errors raised by actual query execution can surface on the returned
* observable stream.
*
* @public
* @returns {Observable<string[]>} - An observable stream (with exactly one element) of field names.
*/
(0, _createClass2["default"])(RxResult, [{
key: "keys",
value: function keys() {
return this._keys;
var RxResult = /** @class */ (function () {
/**
* @constructor
* @protected
* @param {Observable<Result>} result - An observable of single Result instance to relay requests.
* @param {number} state - The streaming state
*/
function RxResult(result, state) {
var replayedResult = result.pipe((0, operators_1.publishReplay)(1), (0, operators_1.refCount)());
this._result = replayedResult;
this._keys = replayedResult.pipe((0, operators_1.mergeMap)(function (r) { return (0, rxjs_1.from)(r.keys()); }), (0, operators_1.publishReplay)(1), (0, operators_1.refCount)());
this._records = undefined;
this._controls = new StreamControl();
this._summary = new rxjs_1.ReplaySubject();
this._state = state || States.READY;
}
/**
* Returns an observable that exposes a single item containing field names
* returned by the executing query.
*
* Errors raised by actual query execution can surface on the returned
* observable stream.
*
* @public
* @returns {Observable<string[]>} - An observable stream (with exactly one element) of field names.
*/
RxResult.prototype.keys = function () {
return this._keys;
};
/**
* Returns an observable that exposes each record returned by the executing query.

@@ -99,23 +108,12 @@ *

*/
}, {
key: "records",
value: function records() {
var _this = this;
var result = this._result.pipe((0, _operators.mergeMap)(function (result) {
return new _rxjs.Observable(function (recordsObserver) {
return _this._startStreaming({
result: result,
recordsObserver: recordsObserver
});
});
}));
result.push = function () {
return _this._push();
};
return result;
}
RxResult.prototype.records = function () {
var _this = this;
var result = this._result.pipe((0, operators_1.mergeMap)(function (result) {
return new rxjs_1.Observable(function (recordsObserver) {
return _this._startStreaming({ result: result, recordsObserver: recordsObserver });
});
}));
result.push = function () { return _this._push(); };
return result;
};
/**

@@ -130,17 +128,10 @@ * Returns an observable that exposes a single item of {@link ResultSummary} that is generated by

*/
}, {
key: "consume",
value: function consume() {
var _this2 = this;
return this._result.pipe((0, _operators.mergeMap)(function (result) {
return new _rxjs.Observable(function (summaryObserver) {
return _this2._startStreaming({
result: result,
summaryObserver: summaryObserver
});
});
}));
}
RxResult.prototype.consume = function () {
var _this = this;
return this._result.pipe((0, operators_1.mergeMap)(function (result) {
return new rxjs_1.Observable(function (summaryObserver) {
return _this._startStreaming({ result: result, summaryObserver: summaryObserver });
});
}));
};
/**

@@ -153,8 +144,5 @@ * Pauses the automatic streaming of records.

*/
}, {
key: "pause",
value: function pause() {
this._controls.pause();
}
RxResult.prototype.pause = function () {
this._controls.pause();
};
/**

@@ -169,8 +157,5 @@ * Resumes the automatic streaming of records.

*/
}, {
key: "resume",
value: function resume() {
return this._controls.resume();
}
RxResult.prototype.resume = function () {
return this._controls.resume();
};
/**

@@ -186,52 +171,35 @@ * Pushes the next record to the stream.

*/
}, {
key: "push",
value: function push() {
return this._controls.push();
}
}, {
key: "_startStreaming",
value: function _startStreaming() {
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
result = _ref.result,
_ref$recordsObserver = _ref.recordsObserver,
recordsObserver = _ref$recordsObserver === void 0 ? null : _ref$recordsObserver,
_ref$summaryObserver = _ref.summaryObserver,
summaryObserver = _ref$summaryObserver === void 0 ? null : _ref$summaryObserver;
var subscriptions = [];
if (summaryObserver) {
subscriptions.push(this._summary.subscribe(summaryObserver));
}
if (this._state < States.STREAMING) {
this._state = States.STREAMING;
this._setupRecordsStream(result);
if (recordsObserver) {
subscriptions.push(this._records.subscribe(recordsObserver));
} else {
result._cancel();
RxResult.prototype.push = function () {
return this._controls.push();
};
RxResult.prototype._startStreaming = function (_a) {
var _b = _a === void 0 ? {} : _a, result = _b.result, _c = _b.recordsObserver, recordsObserver = _c === void 0 ? null : _c, _d = _b.summaryObserver, summaryObserver = _d === void 0 ? null : _d;
var subscriptions = [];
if (summaryObserver) {
subscriptions.push(this._summary.subscribe(summaryObserver));
}
subscriptions.push({
unsubscribe: function unsubscribe() {
if (result._cancel) {
result._cancel();
if (this._state < States.STREAMING) {
this._state = States.STREAMING;
this._setupRecordsStream(result);
if (recordsObserver) {
subscriptions.push(this._records.subscribe(recordsObserver));
}
}
});
} else if (recordsObserver) {
recordsObserver.error((0, _neo4jDriverCore.newError)('Streaming has already started/consumed with a previous records or summary subscription.'));
}
return function () {
subscriptions.forEach(function (s) {
return s.unsubscribe();
});
};
}
else {
result._cancel();
}
subscriptions.push({
unsubscribe: function () {
if (result._cancel) {
result._cancel();
}
}
});
}
else if (recordsObserver) {
recordsObserver.error((0, neo4j_driver_core_1.newError)('Streaming has already started/consumed with a previous records or summary subscription.'));
}
return function () {
subscriptions.forEach(function (s) { return s.unsubscribe(); });
};
};
/**

@@ -246,283 +214,174 @@ * Create a {@link Observable} for the current {@link RxResult}

*/
}, {
key: "_toObservable",
value: function _toObservable() {
var _this3 = this;
function wrap(result) {
return new _rxjs.Observable(function (observer) {
observer.next(result);
observer.complete();
RxResult.prototype._toObservable = function () {
var _this = this;
function wrap(result) {
return new rxjs_1.Observable(function (observer) {
observer.next(result);
observer.complete();
});
}
return new rxjs_1.Observable(function (observer) {
_this._result.subscribe({
complete: function () { return observer.complete(); },
next: function (result) { return observer.next(new RxResult(wrap(result)), _this._state); },
error: function (e) { return observer.error(e); }
});
});
}
return new _rxjs.Observable(function (observer) {
_this3._result.subscribe({
complete: function complete() {
return observer.complete();
},
next: function next(result) {
return observer.next(new RxResult(wrap(result)), _this3._state);
},
error: function error(e) {
return observer.error(e);
}
};
RxResult.prototype._setupRecordsStream = function (result) {
var _this = this;
if (this._records) {
return this._records;
}
this._records = createFullyControlledSubject(result[Symbol.asyncIterator](), {
complete: function () { return __awaiter(_this, void 0, void 0, function () {
var _a, _b;
return __generator(this, function (_c) {
switch (_c.label) {
case 0:
this._state = States.COMPLETED;
_b = (_a = this._summary).next;
return [4 /*yield*/, result.summary()];
case 1:
_b.apply(_a, [_c.sent()]);
this._summary.complete();
return [2 /*return*/];
}
});
}); },
error: function (error) {
_this._state = States.COMPLETED;
_this._summary.error(error);
}
}, this._controls);
return this._records;
};
return RxResult;
}());
exports.default = RxResult;
function createFullyControlledSubject(iterator, completeObserver, streamControl) {
var _this = this;
if (streamControl === void 0) { streamControl = new StreamControl(); }
var subject = new rxjs_1.Subject();
var pushNextValue = function (result) { return __awaiter(_this, void 0, void 0, function () {
var _a, done, value, error_1;
return __generator(this, function (_b) {
switch (_b.label) {
case 0:
_b.trys.push([0, 2, 3, 4]);
streamControl.pushing = true;
return [4 /*yield*/, result];
case 1:
_a = _b.sent(), done = _a.done, value = _a.value;
if (done) {
subject.complete();
completeObserver.complete();
}
else {
subject.next(value);
if (!streamControl.paused) {
pushNextValue(iterator.next())
.catch(function () { });
}
}
return [3 /*break*/, 4];
case 2:
error_1 = _b.sent();
subject.error(error_1);
completeObserver.error(error_1);
return [3 /*break*/, 4];
case 3:
streamControl.pushing = false;
return [7 /*endfinally*/];
case 4: return [2 /*return*/];
}
});
});
}
}, {
key: "_setupRecordsStream",
value: function _setupRecordsStream(result) {
var _this4 = this;
if (this._records) {
return this._records;
}
this._records = createFullyControlledSubject(result[Symbol.asyncIterator](), {
complete: function () {
var _complete = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
return _regenerator["default"].wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
_this4._state = States.COMPLETED;
_context.t0 = _this4._summary;
_context.next = 4;
return result.summary();
case 4:
_context.t1 = _context.sent;
_context.t0.next.call(_context.t0, _context.t1);
_this4._summary.complete();
case 7:
case "end":
return _context.stop();
}); };
function push(value) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, pushNextValue(iterator.next(value))];
case 1:
_a.sent();
return [2 /*return*/];
}
}
}, _callee);
}));
function complete() {
return _complete.apply(this, arguments);
}
return complete;
}(),
error: function error(_error) {
_this4._state = States.COMPLETED;
_this4._summary.error(_error);
}
}, this._controls);
return this._records;
});
});
}
}]);
return RxResult;
}();
exports["default"] = RxResult;
function createFullyControlledSubject(iterator, completeObserver) {
var streamControl = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : new StreamControl();
var subject = new _rxjs.Subject();
var pushNextValue = /*#__PURE__*/function () {
var _ref2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(result) {
var _yield$result, done, value;
return _regenerator["default"].wrap(function _callee2$(_context2) {
while (1) {
switch (_context2.prev = _context2.next) {
case 0:
_context2.prev = 0;
streamControl.pushing = true;
_context2.next = 4;
return result;
case 4:
_yield$result = _context2.sent;
done = _yield$result.done;
value = _yield$result.value;
if (done) {
subject.complete();
completeObserver.complete();
} else {
subject.next(value);
if (!streamControl.paused) {
pushNextValue(iterator.next())["catch"](function () {});
}
}
_context2.next = 14;
break;
case 10:
_context2.prev = 10;
_context2.t0 = _context2["catch"](0);
subject.error(_context2.t0);
completeObserver.error(_context2.t0);
case 14:
_context2.prev = 14;
streamControl.pushing = false;
return _context2.finish(14);
case 17:
case "end":
return _context2.stop();
}
}
}, _callee2, null, [[0, 10, 14, 17]]);
}));
return function pushNextValue(_x) {
return _ref2.apply(this, arguments);
};
}();
function push(_x2) {
return _push.apply(this, arguments);
}
function _push() {
_push = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(value) {
return _regenerator["default"].wrap(function _callee3$(_context3) {
while (1) {
switch (_context3.prev = _context3.next) {
case 0:
_context3.next = 2;
return pushNextValue(iterator.next(value));
case 2:
case "end":
return _context3.stop();
}
}
}, _callee3);
}));
return _push.apply(this, arguments);
}
streamControl.pusher = push;
push();
return subject;
streamControl.pusher = push;
push();
return subject;
}
var StreamControl = /*#__PURE__*/function () {
function StreamControl() {
var push = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4() {
return _regenerator["default"].wrap(function _callee4$(_context4) {
while (1) {
switch (_context4.prev = _context4.next) {
case 0:
case "end":
return _context4.stop();
}
}
}, _callee4);
}));
(0, _classCallCheck2["default"])(this, StreamControl);
this._paused = false;
this._pushing = false;
this._push = push;
}
(0, _createClass2["default"])(StreamControl, [{
key: "pause",
value: function pause() {
this._paused = true;
var StreamControl = /** @class */ (function () {
function StreamControl(push) {
if (push === void 0) { push = function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
return [2 /*return*/];
}); }); }; }
var _this = this;
this._paused = false;
this._pushing = false;
this._push = push;
}
}, {
key: "paused",
get: function get() {
return this._paused;
}
}, {
key: "pushing",
get: function get() {
return this._pushing;
},
set: function set(pushing) {
this._pushing = pushing;
}
}, {
key: "resume",
value: function () {
var _resume = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5() {
var wasPaused;
return _regenerator["default"].wrap(function _callee5$(_context5) {
while (1) {
switch (_context5.prev = _context5.next) {
case 0:
wasPaused = this._paused;
this._paused = false;
if (!(wasPaused && !this._pushing)) {
_context5.next = 5;
break;
StreamControl.prototype.pause = function () {
this._paused = true;
};
Object.defineProperty(StreamControl.prototype, "paused", {
get: function () {
return this._paused;
},
enumerable: false,
configurable: true
});
Object.defineProperty(StreamControl.prototype, "pushing", {
get: function () {
return this._pushing;
},
set: function (pushing) {
this._pushing = pushing;
},
enumerable: false,
configurable: true
});
StreamControl.prototype.resume = function () {
return __awaiter(this, void 0, void 0, function () {
var wasPaused;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
wasPaused = this._paused;
this._paused = false;
if (!(wasPaused && !this._pushing)) return [3 /*break*/, 2];
return [4 /*yield*/, this._push()];
case 1:
_a.sent();
_a.label = 2;
case 2: return [2 /*return*/];
}
_context5.next = 5;
return this._push();
case 5:
case "end":
return _context5.stop();
}
}
}, _callee5, this);
}));
function resume() {
return _resume.apply(this, arguments);
}
return resume;
}()
}, {
key: "push",
value: function () {
var _push2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6() {
return _regenerator["default"].wrap(function _callee6$(_context6) {
while (1) {
switch (_context6.prev = _context6.next) {
case 0:
this.pause();
_context6.next = 3;
return this._push();
case 3:
return _context6.abrupt("return", _context6.sent);
case 4:
case "end":
return _context6.stop();
}
}
}, _callee6, this);
}));
function push() {
return _push2.apply(this, arguments);
}
return push;
}()
}, {
key: "pusher",
get: function get() {
return this._push;
},
set: function set(push) {
this._push = push;
}
}]);
return StreamControl;
}();
});
});
};
StreamControl.prototype.push = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
this.pause();
return [4 /*yield*/, this._push()];
case 1: return [2 /*return*/, _a.sent()];
}
});
});
};
Object.defineProperty(StreamControl.prototype, "pusher", {
get: function () {
return this._push;
},
set: function (push) {
this._push = push;
},
enumerable: false,
configurable: true
});
return StreamControl;
}());
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
var _rxjs = require("rxjs");
var _operators = require("rxjs/operators");
var _resultRx = _interopRequireDefault(require("./result-rx"));
var _neo4jDriverCore = require("neo4j-driver-core");
var _transactionRx = _interopRequireDefault(require("./transaction-rx"));
var _transactionManagedRx = _interopRequireDefault(require("./transaction-managed-rx"));
var _retryLogicRx = _interopRequireDefault(require("./internal/retry-logic-rx"));
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
/**

@@ -46,57 +24,51 @@ * Copyright (c) "Neo4j"

*/
var rxjs_1 = require("rxjs");
var operators_1 = require("rxjs/operators");
var result_rx_1 = __importDefault(require("./result-rx"));
// eslint-disable-next-line no-unused-vars
var _internal$constants = _neo4jDriverCore.internal.constants,
ACCESS_MODE_READ = _internal$constants.ACCESS_MODE_READ,
ACCESS_MODE_WRITE = _internal$constants.ACCESS_MODE_WRITE,
TxConfig = _neo4jDriverCore.internal.txConfig.TxConfig;
var neo4j_driver_core_1 = require("neo4j-driver-core");
var transaction_rx_1 = __importDefault(require("./transaction-rx"));
var transaction_managed_rx_1 = __importDefault(require("./transaction-managed-rx"));
var retry_logic_rx_1 = __importDefault(require("./internal/retry-logic-rx"));
var _a = neo4j_driver_core_1.internal.constants, ACCESS_MODE_READ = _a.ACCESS_MODE_READ, ACCESS_MODE_WRITE = _a.ACCESS_MODE_WRITE, TxConfig = neo4j_driver_core_1.internal.txConfig.TxConfig;
/**
* A Reactive session, which provides the same functionality as {@link Session} but through a Reactive API.
*/
var RxSession = /*#__PURE__*/function () {
/**
* Constructs a reactive session with given default session instance and provided driver configuration.
*
* @protected
* @param {Object} param - Object parameter
* @param {Session} param.session - The underlying session instance to relay requests
*/
function RxSession() {
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
session = _ref.session,
config = _ref.config;
(0, _classCallCheck2["default"])(this, RxSession);
this._session = session;
this._retryLogic = _createRetryLogic(config);
}
/**
* Creates a reactive result that will execute the query with the provided parameters and the provided
* transaction configuration that applies to the underlying auto-commit transaction.
*
* @public
* @param {string} query - Query to be executed.
* @param {Object} parameters - Parameter values to use in query execution.
* @param {TransactionConfig} transactionConfig - Configuration for the new auto-commit transaction.
* @returns {RxResult} - A reactive result
*/
(0, _createClass2["default"])(RxSession, [{
key: "run",
value: function run(query, parameters, transactionConfig) {
var _this = this;
return new _resultRx["default"](new _rxjs.Observable(function (observer) {
try {
observer.next(_this._session.run(query, parameters, transactionConfig));
observer.complete();
} catch (err) {
observer.error(err);
}
return function () {};
}));
var RxSession = /** @class */ (function () {
/**
* Constructs a reactive session with given default session instance and provided driver configuration.
*
* @protected
* @param {Object} param - Object parameter
* @param {Session} param.session - The underlying session instance to relay requests
*/
function RxSession(_a) {
var _b = _a === void 0 ? {} : _a, session = _b.session, config = _b.config;
this._session = session;
this._retryLogic = _createRetryLogic(config);
}
/**
* Creates a reactive result that will execute the query with the provided parameters and the provided
* transaction configuration that applies to the underlying auto-commit transaction.
*
* @public
* @param {string} query - Query to be executed.
* @param {Object} parameters - Parameter values to use in query execution.
* @param {TransactionConfig} transactionConfig - Configuration for the new auto-commit transaction.
* @returns {RxResult} - A reactive result
*/
RxSession.prototype.run = function (query, parameters, transactionConfig) {
var _this = this;
return new result_rx_1.default(new rxjs_1.Observable(function (observer) {
try {
observer.next(_this._session.run(query, parameters, transactionConfig));
observer.complete();
}
catch (err) {
observer.error(err);
}
return function () { };
}));
};
/**
* Starts a new explicit transaction with the provided transaction configuration.

@@ -108,8 +80,5 @@ *

*/
}, {
key: "beginTransaction",
value: function beginTransaction(transactionConfig) {
return this._beginTransaction(this._session._mode, transactionConfig);
}
RxSession.prototype.beginTransaction = function (transactionConfig) {
return this._beginTransaction(this._session._mode, transactionConfig);
};
/**

@@ -124,8 +93,5 @@ * Executes the provided unit of work in a {@link READ} reactive transaction which is created with the provided

*/
}, {
key: "readTransaction",
value: function readTransaction(work, transactionConfig) {
return this._runTransaction(ACCESS_MODE_READ, work, transactionConfig);
}
RxSession.prototype.readTransaction = function (work, transactionConfig) {
return this._runTransaction(ACCESS_MODE_READ, work, transactionConfig);
};
/**

@@ -140,8 +106,5 @@ * Executes the provided unit of work in a {@link WRITE} reactive transaction which is created with the provided

*/
}, {
key: "writeTransaction",
value: function writeTransaction(work, transactionConfig) {
return this._runTransaction(ACCESS_MODE_WRITE, work, transactionConfig);
}
RxSession.prototype.writeTransaction = function (work, transactionConfig) {
return this._runTransaction(ACCESS_MODE_WRITE, work, transactionConfig);
};
/**

@@ -155,8 +118,5 @@ * Executes the provided unit of work in a {@link READ} reactive transaction which is created with the provided

*/
}, {
key: "executeRead",
value: function executeRead(work, transactionConfig) {
return this._executeInTransaction(ACCESS_MODE_READ, work, transactionConfig);
}
RxSession.prototype.executeRead = function (work, transactionConfig) {
return this._executeInTransaction(ACCESS_MODE_READ, work, transactionConfig);
};
/**

@@ -170,8 +130,5 @@ * Executes the provided unit of work in a {@link WRITE} reactive transaction which is created with the provided

*/
}, {
key: "executeWrite",
value: function executeWrite(work, transactionConfig) {
return this._executeInTransaction(ACCESS_MODE_WRITE, work, transactionConfig);
}
RxSession.prototype.executeWrite = function (work, transactionConfig) {
return this._executeInTransaction(ACCESS_MODE_WRITE, work, transactionConfig);
};
/**

@@ -183,14 +140,8 @@ * @private

*/
}, {
key: "_executeInTransaction",
value: function _executeInTransaction(accessMode, work, transactionConfig) {
var wrapper = function wrapper(txc) {
return new _transactionManagedRx["default"]({
run: txc.run.bind(txc)
});
};
return this._runTransaction(accessMode, work, transactionConfig, wrapper);
}
RxSession.prototype._executeInTransaction = function (accessMode, work, transactionConfig) {
var wrapper = function (txc) { return new transaction_managed_rx_1.default({
run: txc.run.bind(txc)
}); };
return this._runTransaction(accessMode, work, transactionConfig, wrapper);
};
/**

@@ -202,16 +153,13 @@ * Closes this reactive session.

*/
}, {
key: "close",
value: function close() {
var _this2 = this;
return new _rxjs.Observable(function (observer) {
_this2._session.close().then(function () {
observer.complete();
})["catch"](function (err) {
return observer.error(err);
RxSession.prototype.close = function () {
var _this = this;
return new rxjs_1.Observable(function (observer) {
_this._session
.close()
.then(function () {
observer.complete();
})
.catch(function (err) { return observer.error(err); });
});
});
}
};
/**

@@ -230,8 +178,5 @@ * Returns the bookmarks received following the last successfully completed query, which is executed

*/
}, {
key: "lastBookmark",
value: function lastBookmark() {
return this.lastBookmarks();
}
RxSession.prototype.lastBookmark = function () {
return this.lastBookmarks();
};
/**

@@ -248,81 +193,57 @@ * Returns the bookmarks received following the last successfully completed query, which is executed

*/
}, {
key: "lastBookmarks",
value: function lastBookmarks() {
return this._session.lastBookmarks();
}
RxSession.prototype.lastBookmarks = function () {
return this._session.lastBookmarks();
};
/**
* @private
*/
}, {
key: "_beginTransaction",
value: function _beginTransaction(accessMode, transactionConfig) {
var _this3 = this;
var txConfig = TxConfig.empty();
if (transactionConfig) {
txConfig = new TxConfig(transactionConfig);
}
return new _rxjs.Observable(function (observer) {
try {
_this3._session._beginTransaction(accessMode, txConfig).then(function (tx) {
observer.next(new _transactionRx["default"](tx));
observer.complete();
})["catch"](function (err) {
return observer.error(err);
});
} catch (err) {
observer.error(err);
RxSession.prototype._beginTransaction = function (accessMode, transactionConfig) {
var _this = this;
var txConfig = TxConfig.empty();
if (transactionConfig) {
txConfig = new TxConfig(transactionConfig);
}
return function () {};
});
}
return new rxjs_1.Observable(function (observer) {
try {
_this._session._beginTransaction(accessMode, txConfig)
.then(function (tx) {
observer.next(new transaction_rx_1.default(tx));
observer.complete();
})
.catch(function (err) { return observer.error(err); });
}
catch (err) {
observer.error(err);
}
return function () { };
});
};
/**
* @private
*/
}, {
key: "_runTransaction",
value: function _runTransaction(accessMode, work, transactionConfig) {
var transactionWrapper = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : function (tx) {
return tx;
};
var txConfig = TxConfig.empty();
if (transactionConfig) {
txConfig = new TxConfig(transactionConfig);
}
return this._retryLogic.retry(this._beginTransaction(accessMode, txConfig).pipe((0, _operators.mergeMap)(function (txc) {
return (0, _rxjs.defer)(function () {
try {
return work(transactionWrapper(txc));
} catch (err) {
return (0, _rxjs.throwError)(function () {
return err;
});
}
}).pipe((0, _operators.catchError)(function (err) {
return txc.rollback().pipe((0, _operators.concatWith)((0, _rxjs.throwError)(function () {
return err;
})));
}), (0, _operators.concatWith)(txc.commit()));
})));
}
}]);
return RxSession;
}();
exports["default"] = RxSession;
RxSession.prototype._runTransaction = function (accessMode, work, transactionConfig, transactionWrapper) {
if (transactionWrapper === void 0) { transactionWrapper = function (tx) { return tx; }; }
var txConfig = TxConfig.empty();
if (transactionConfig) {
txConfig = new TxConfig(transactionConfig);
}
return this._retryLogic.retry(this._beginTransaction(accessMode, txConfig).pipe((0, operators_1.mergeMap)(function (txc) {
return (0, rxjs_1.defer)(function () {
try {
return work(transactionWrapper(txc));
}
catch (err) {
return (0, rxjs_1.throwError)(function () { return err; });
}
}).pipe((0, operators_1.catchError)(function (err) { return txc.rollback().pipe((0, operators_1.concatWith)((0, rxjs_1.throwError)(function () { return err; }))); }), (0, operators_1.concatWith)(txc.commit()));
})));
};
return RxSession;
}());
exports.default = RxSession;
function _createRetryLogic(config) {
var maxRetryTimeout = config && config.maxTransactionRetryTime ? config.maxTransactionRetryTime : null;
return new _retryLogicRx["default"]({
maxRetryTimeout: maxRetryTimeout
});
var maxRetryTimeout = config && config.maxTransactionRetryTime
? config.maxTransactionRetryTime
: null;
return new retry_logic_rx_1.default({ maxRetryTimeout: maxRetryTimeout });
}
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
var _resultRx = _interopRequireDefault(require("./result-rx"));
var _transactionRx = _interopRequireDefault(require("./transaction-rx"));
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
/**

@@ -37,4 +25,5 @@ * Copyright (c) "Neo4j"

// eslint-disable-next-line no-unused-vars
var result_rx_1 = __importDefault(require("./result-rx"));
// eslint-disable-next-line no-unused-vars
var transaction_rx_1 = __importDefault(require("./transaction-rx"));
/**

@@ -45,22 +34,21 @@ * Represents a rx transaction that is managed by the transaction executor.

*/
var RxManagedTransaction = /*#__PURE__*/function () {
/**
* @private
*/
function RxManagedTransaction(_ref) {
var run = _ref.run;
(0, _classCallCheck2["default"])(this, RxManagedTransaction);
this._run = run;
}
/**
* @private
* @param {RxTransaction} txc - The transaction to be wrapped
* @returns {RxManagedTransaction} The managed transaction
*/
(0, _createClass2["default"])(RxManagedTransaction, [{
key: "run",
value:
var RxManagedTransaction = /** @class */ (function () {
/**
* @private
*/
function RxManagedTransaction(_a) {
var run = _a.run;
this._run = run;
}
/**
* @private
* @param {RxTransaction} txc - The transaction to be wrapped
* @returns {RxManagedTransaction} The managed transaction
*/
RxManagedTransaction.fromTransaction = function (txc) {
return new RxManagedTransaction({
run: txc.run.bind(txc)
});
};
/**
* Creates a reactive result that will execute the query in this transaction, with the provided parameters.

@@ -73,17 +61,7 @@ *

*/
function run(query, parameters) {
return this._run(query, parameters);
}
}], [{
key: "fromTransaction",
value: function fromTransaction(txc) {
return new RxManagedTransaction({
run: txc.run.bind(txc)
});
}
}]);
return RxManagedTransaction;
}();
var _default = RxManagedTransaction;
exports["default"] = _default;
RxManagedTransaction.prototype.run = function (query, parameters) {
return this._run(query, parameters);
};
return RxManagedTransaction;
}());
exports.default = RxManagedTransaction;
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
var _rxjs = require("rxjs");
var _resultRx = _interopRequireDefault(require("./result-rx"));
var _neo4jDriverCore = _interopRequireDefault(require("neo4j-driver-core"));
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
/**

@@ -38,44 +24,40 @@ * Copyright (c) "Neo4j"

*/
var rxjs_1 = require("rxjs");
var result_rx_1 = __importDefault(require("./result-rx"));
// eslint-disable-next-line no-unused-vars
var neo4j_driver_core_1 = __importDefault(require("neo4j-driver-core"));
/**
* A reactive transaction, which provides the same functionality as {@link Transaction} but through a Reactive API.
*/
var RxTransaction = /*#__PURE__*/function () {
/**
* @constructor
* @protected
* @param {Transaction} txc - The underlying transaction instance to relay requests
*/
function RxTransaction(txc) {
(0, _classCallCheck2["default"])(this, RxTransaction);
this._txc = txc;
}
/**
* Creates a reactive result that will execute the query in this transaction, with the provided parameters.
*
* @public
* @param {string} query - Query to be executed.
* @param {Object} parameters - Parameter values to use in query execution.
* @returns {RxResult} - A reactive result
*/
(0, _createClass2["default"])(RxTransaction, [{
key: "run",
value: function run(query, parameters) {
var _this = this;
return new _resultRx["default"](new _rxjs.Observable(function (observer) {
try {
observer.next(_this._txc.run(query, parameters));
observer.complete();
} catch (err) {
observer.error(err);
}
return function () {};
}));
var RxTransaction = /** @class */ (function () {
/**
* @constructor
* @protected
* @param {Transaction} txc - The underlying transaction instance to relay requests
*/
function RxTransaction(txc) {
this._txc = txc;
}
/**
* Creates a reactive result that will execute the query in this transaction, with the provided parameters.
*
* @public
* @param {string} query - Query to be executed.
* @param {Object} parameters - Parameter values to use in query execution.
* @returns {RxResult} - A reactive result
*/
RxTransaction.prototype.run = function (query, parameters) {
var _this = this;
return new result_rx_1.default(new rxjs_1.Observable(function (observer) {
try {
observer.next(_this._txc.run(query, parameters));
observer.complete();
}
catch (err) {
observer.error(err);
}
return function () { };
}));
};
/**
* Commits the transaction.

@@ -86,16 +68,13 @@ *

*/
}, {
key: "commit",
value: function commit() {
var _this2 = this;
return new _rxjs.Observable(function (observer) {
_this2._txc.commit().then(function () {
observer.complete();
})["catch"](function (err) {
return observer.error(err);
RxTransaction.prototype.commit = function () {
var _this = this;
return new rxjs_1.Observable(function (observer) {
_this._txc
.commit()
.then(function () {
observer.complete();
})
.catch(function (err) { return observer.error(err); });
});
});
}
};
/**

@@ -107,16 +86,13 @@ * Rolls back the transaction.

*/
}, {
key: "rollback",
value: function rollback() {
var _this3 = this;
return new _rxjs.Observable(function (observer) {
_this3._txc.rollback().then(function () {
observer.complete();
})["catch"](function (err) {
return observer.error(err);
RxTransaction.prototype.rollback = function () {
var _this = this;
return new rxjs_1.Observable(function (observer) {
_this._txc
.rollback()
.then(function () {
observer.complete();
})
.catch(function (err) { return observer.error(err); });
});
});
}
};
/**

@@ -126,8 +102,5 @@ * Check if this transaction is active, which means commit and rollback did not happen.

*/
}, {
key: "isOpen",
value: function isOpen() {
return this._txc.isOpen();
}
RxTransaction.prototype.isOpen = function () {
return this._txc.isOpen();
};
/**

@@ -140,20 +113,15 @@ * Closes the transaction

*/
}, {
key: "close",
value: function close() {
var _this4 = this;
return new _rxjs.Observable(function (observer) {
_this4._txc.close().then(function () {
observer.complete();
})["catch"](function (err) {
return observer.error(err);
RxTransaction.prototype.close = function () {
var _this = this;
return new rxjs_1.Observable(function (observer) {
_this._txc
.close()
.then(function () {
observer.complete();
})
.catch(function (err) { return observer.error(err); });
});
});
}
}]);
return RxTransaction;
}();
exports["default"] = RxTransaction;
};
return RxTransaction;
}());
exports.default = RxTransaction;
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
/**

@@ -26,2 +20,3 @@ * Copyright (c) "Neo4j"

*/
Object.defineProperty(exports, "__esModule", { value: true });
// DO NOT CHANGE THE VERSION BELOW HERE

@@ -35,3 +30,2 @@ // This is set by the build system at release time, using

// system to control version names at packaging time.
var _default = '5.3.0';
exports["default"] = _default;
exports.default = '5.4.0-alpha01';
{
"name": "neo4j-driver",
"version": "5.3.0",
"version": "5.4.0-alpha01",
"description": "Connect to Neo4j 3.5.0 and up from JavaScript",

@@ -37,13 +37,9 @@ "author": "Neo4j",

"devDependencies": {
"@babel/core": "^7.17.8",
"@babel/eslint-parser": "^7.17.0",
"@babel/plugin-transform-runtime": "^7.17.0",
"@babel/preset-env": "^7.16.11",
"@babel/register": "^7.17.7",
"@istanbuljs/nyc-config-babel": "^3.0.0",
"async": "^3.2.3",
"babel-plugin-istanbul": "^6.1.1",
"babelify": "^10.0.0",
"browserify": "^17.0.0",
"browserify-transform-tools": "^1.7.0",
"@babel/core": "^7.20.7",
"@babel/plugin-transform-runtime": "^7.19.6",
"@babel/register": "^7.18.9",
"@rollup/plugin-commonjs": "^21.1.0",
"@rollup/plugin-node-resolve": "^13.3.0",
"@types/jasmine": "^4.3.1",
"async": "^3.2.4",
"esdoc": "^1.1.0",

@@ -53,5 +49,4 @@ "esdoc-importpath-plugin": "^1.0.2",

"fancy-log": "^2.0.0",
"fs-extra": "^10.0.1",
"fs-extra": "^10.1.0",
"gulp": "^4.0.2",
"gulp-babel": "^8.0.0",
"gulp-batch": "^1.0.5",

@@ -63,10 +58,8 @@ "gulp-decompress": "^3.0.0",

"gulp-jasmine": "^4.0.0",
"gulp-replace": "^1.1.3",
"gulp-replace": "^1.1.4",
"gulp-typescript": "^5.0.1",
"gulp-uglify": "^3.0.2",
"gulp-watch": "^5.0.1",
"istanbul": "^0.4.5",
"jasmine-spec-reporter": "^7.0.0",
"karma": "^6.3.17",
"karma-browserify": "^8.1.0",
"karma": "^6.4.1",
"karma-chrome-launcher": "^3.1.1",

@@ -78,20 +71,21 @@ "karma-edge-launcher": "^0.4.2",

"karma-source-map-support": "^1.4.0",
"karma-spec-reporter": "^0.0.33",
"karma-spec-reporter": "^0.0.36",
"karma-typescript": "^5.5.3",
"karma-typescript-es6-transform": "^5.5.3",
"lolex": "^6.0.0",
"minimist": "^1.2.6",
"nyc": "^15.1.0",
"semver": "^7.3.5",
"minimist": "^1.2.7",
"rollup": "^2.77.4-1",
"rollup-plugin-polyfill-node": "^0.11.0",
"semver": "^7.3.8",
"tmp": "0.2.1",
"typescript": "^4.6.3",
"typescript": "^4.9.4",
"vinyl-buffer": "^1.0.1",
"vinyl-source-stream": "^2.0.0",
"webpack": "^5.70.0"
"webpack": "^5.75.0"
},
"dependencies": {
"@babel/runtime": "^7.17.8",
"neo4j-driver-bolt-connection": "^5.3.0",
"neo4j-driver-core": "^5.3.0",
"rxjs": "^7.5.5"
"neo4j-driver-bolt-connection": "^5.4.0-alpha01",
"neo4j-driver-core": "^5.4.0-alpha01",
"rxjs": "^7.8.0"
},
"gitHead": "ffe5492b7614ec13e1f1eea91ba56b958ef25b3d"
"gitHead": "2cec905cf151ac5363d3a24fbd09cc6b486c5bb3"
}

@@ -81,2 +81,23 @@ # Neo4j Driver for JavaScript

From `5.4.0`, this version is also exported as ECMA Script Module.
It can be imported from a module using the following statements:
```javascript
// Direct reference
import neo4j from 'lib/browser/neo4j-web.esm.min.js'
// unpkg CDN non-minified , version X.Y.Z where X.Y.Z >= 5.4.0
import neo4j from 'https://unpkg.com/browse/neo4j-driver@X.Y.Z/lib/browser/neo4j-web.esm.js'
// unpkg CDN minified for production use, version X.Y.Z where X.Y.Z >= 5.4.0
import neo4j from 'https://unpkg.com/browse/neo4j-driver@X.Y.Z/lib/browser/neo4j-web.esm.min.js'
// jsDelivr CDN non-minified, version X.Y.Z where X.Y.Z >= 5.4.0
import neo4j from 'https://cdn.jsdelivr.net/npm/neo4j-driver@X.Y.Z/lib/browser/neo4j-web.esm.js'
// jsDelivr CDN minified for production use, version X.Y.Z where X.Y.Z >= 5.4.0
import neo4j from 'https://cdn.jsdelivr.net/npm/neo4j-driver@X.Y.Z/lib/browser/neo4j-web.esm.min.js'
```
It is not required to explicitly close the driver on a web page. Web browser should gracefully close all open

@@ -83,0 +104,0 @@ WebSockets when the page is unloaded. However, driver instance should be explicitly closed when it's lifetime

{
"spec_dir": "test",
"spec_files": ["**/*.test.js", "!**/browser/*.js"],
"helpers": ["../node_modules/@babel/register/lib/node.js"],
"stopSpecOnExpectationFailure": false,
"random": true
}

@@ -37,3 +37,3 @@ /**

declare interface Driver extends CoreDriver {
declare class Driver extends CoreDriver {
rxSession: (sessionParams?: SessionConfig) => RxSession

@@ -40,0 +40,0 @@ }

@@ -41,2 +41,7 @@ /**

isTime,
isNode,
isPath,
isPathSegment,
isRelationship,
isUnboundRelationship,
LocalDateTime,

@@ -64,3 +69,2 @@ LocalTime,

Session,
ConnectionProvider,
BookmarkManager,

@@ -131,6 +135,6 @@ bookmarkManager,

Integer: typeof Integer
RxSession: RxSession
RxTransaction: RxTransaction
RxManagedTransaction: RxManagedTransaction
RxResult: RxResult
RxSession: typeof RxSession
RxTransaction: typeof RxTransaction
RxManagedTransaction: typeof RxManagedTransaction
RxResult: typeof RxResult
}

@@ -162,2 +166,10 @@

declare const graph: {
isNode: typeof isNode
isPath: typeof isPath
isPathSegment: typeof isPathSegment
isRelationship: typeof isRelationship
isUnboundRelationship: typeof isUnboundRelationship
}
/*

@@ -182,5 +194,6 @@ Both default and non-default exports declare all visible types so that they can be used in client code like this:

error: typeof error
graph: typeof graph
spatial: typeof spatial
temporal: typeof temporal
Driver: Driver
Driver: typeof Driver
AuthToken: AuthToken

@@ -191,37 +204,36 @@ Config: Config

SessionMode: SessionMode
Neo4jError: Neo4jError
Neo4jError: typeof Neo4jError
isRetriableError: typeof isRetriableError
Node: Node
Relationship: Relationship
UnboundRelationship: UnboundRelationship
PathSegment: PathSegment
Path: Path
Integer: Integer
Record: Record
Result: Result
Node: typeof Node
Relationship: typeof Relationship
UnboundRelationship: typeof UnboundRelationship
PathSegment: typeof PathSegment
Path: typeof Path
Integer: typeof Integer
Record: typeof Record
Result: typeof Result
QueryResult: QueryResult
ResultObserver: ResultObserver
ResultSummary: ResultSummary
Plan: Plan
ProfiledPlan: ProfiledPlan
QueryStatistic: QueryStatistics
Notification: Notification
ServerInfo: ServerInfo
ResultSummary: typeof ResultSummary
Plan: typeof Plan
ProfiledPlan: typeof ProfiledPlan
QueryStatistics: typeof QueryStatistics
Notification: typeof Notification
ServerInfo: typeof ServerInfo
NotificationPosition: NotificationPosition
Session: Session
Transaction: Transaction
ManagedTransaction: ManagedTransaction
Point: Point
Session: typeof Session
Transaction: typeof Transaction
ManagedTransaction: typeof ManagedTransaction
Point: typeof Point
isPoint: typeof isPoint
Duration: Duration
LocalTime: LocalTime
Time: Time
Date: Date
LocalDateTime: LocalDateTime
DateTime: DateTime
RxSession: RxSession
RxTransaction: RxTransaction
RxManagedTransaction: RxManagedTransaction
RxResult: RxResult
ConnectionProvider: ConnectionProvider
Duration: typeof Duration
LocalTime: typeof LocalTime
Time: typeof Time
Date: typeof Date
LocalDateTime: typeof LocalDateTime
DateTime: typeof DateTime
RxSession: typeof RxSession
RxTransaction: typeof RxTransaction
RxManagedTransaction: typeof RxManagedTransaction
RxResult: typeof RxResult
isDuration: typeof isDuration

@@ -233,2 +245,7 @@ isLocalTime: typeof isLocalTime

isDateTime: typeof isDateTime
isNode: typeof isNode
isPath: typeof isPath
isPathSegment: typeof isPathSegment
isRelationship: typeof isRelationship
isUnboundRelationship: typeof isUnboundRelationship
bookmarkManager: typeof bookmarkManager

@@ -247,2 +264,3 @@ }

error,
graph,
spatial,

@@ -290,3 +308,2 @@ temporal,

RxResult,
ConnectionProvider,
isDuration,

@@ -298,2 +315,7 @@ isLocalTime,

isDateTime,
isNode,
isPath,
isPathSegment,
isRelationship,
isUnboundRelationship,
bookmarkManager

@@ -300,0 +322,0 @@ }

@@ -22,3 +22,3 @@ /**

declare interface RxResult {
declare class RxResult {
keys: () => Observable<string[]>

@@ -25,0 +25,0 @@

@@ -27,3 +27,3 @@ /**

declare interface RxSession {
declare class RxSession {
run: (

@@ -30,0 +30,0 @@ query: string,

@@ -22,3 +22,3 @@ /**

declare interface RxManagedTransaction {
declare class RxManagedTransaction {
run: (query: string, parameters?: Parameters) => RxResult

@@ -25,0 +25,0 @@ }

@@ -23,3 +23,3 @@ /**

declare interface RxTransaction {
declare class RxTransaction {
run: (query: string, parameters?: Parameters) => RxResult

@@ -26,0 +26,0 @@

Sorry, the diff of this file is not supported yet

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