neo4j-driver 5.3.0 → 5.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.babelrc +1 -8
- package/README.md +21 -0
- package/lib/browser/neo4j-web.esm.js +31294 -0
- package/lib/browser/neo4j-web.esm.min.js +1 -0
- package/lib/browser/neo4j-web.js +31301 -32537
- package/lib/browser/neo4j-web.min.js +1 -1
- package/lib/docs.js +1 -3
- package/lib/driver.js +78 -89
- package/lib/index.js +319 -547
- package/lib/internal/retry-logic-rx.js +64 -112
- package/lib/internal/server-version.js +77 -116
- package/lib/result-rx.js +292 -433
- package/lib/session-rx.js +128 -207
- package/lib/transaction-managed-rx.js +30 -52
- package/lib/transaction-rx.js +72 -104
- package/lib/version.js +2 -8
- package/package.json +24 -30
- package/spec/support/jasmine.json +0 -1
- package/types/driver.d.ts +1 -1
- package/types/index.d.ts +59 -37
- package/types/result-rx.d.ts +1 -1
- package/types/session-rx.d.ts +1 -1
- package/types/transaction-managed-rx.d.ts +1 -1
- package/types/transaction-rx.d.ts +1 -1
- package/.nycrc +0 -4
- package/support/inject-browser-transform.js +0 -20
package/lib/docs.js
CHANGED
|
@@ -16,7 +16,6 @@
|
|
|
16
16
|
* See the License for the specific language governing permissions and
|
|
17
17
|
* limitations under the License.
|
|
18
18
|
*/
|
|
19
|
-
|
|
20
19
|
/**
|
|
21
20
|
* Configuration object containing settings for explicit and auto-commit transactions.
|
|
22
21
|
* <p>
|
|
@@ -34,5 +33,4 @@
|
|
|
34
33
|
* @property {Object} metadata - the transaction metadata. Specified metadata will be attached to the executing transaction and visible in the output of
|
|
35
34
|
* `dbms.listQueries` and `dbms.listTransactions` procedures. It will also get logged to the `query.log`. This functionality makes it easier to tag
|
|
36
35
|
* transactions and is equivalent to `dbms.setTXMetaData` procedure.
|
|
37
|
-
*/
|
|
38
|
-
"use strict";
|
|
36
|
+
*/
|
package/lib/driver.js
CHANGED
|
@@ -1,33 +1,48 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
var
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
function
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) "Neo4j"
|
|
4
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
5
|
+
*
|
|
6
|
+
* This file is part of Neo4j.
|
|
7
|
+
*
|
|
8
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
9
|
+
* you may not use this file except in compliance with the License.
|
|
10
|
+
* You may obtain a copy of the License at
|
|
11
|
+
*
|
|
12
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
13
|
+
*
|
|
14
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
15
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
16
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
17
|
+
* See the License for the specific language governing permissions and
|
|
18
|
+
* limitations under the License.
|
|
19
|
+
*/
|
|
20
|
+
var __extends = (this && this.__extends) || (function () {
|
|
21
|
+
var extendStatics = function (d, b) {
|
|
22
|
+
extendStatics = Object.setPrototypeOf ||
|
|
23
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
24
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
25
|
+
return extendStatics(d, b);
|
|
26
|
+
};
|
|
27
|
+
return function (d, b) {
|
|
28
|
+
if (typeof b !== "function" && b !== null)
|
|
29
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
30
|
+
extendStatics(d, b);
|
|
31
|
+
function __() { this.constructor = d; }
|
|
32
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.WRITE = exports.READ = exports.Driver = void 0;
|
|
40
|
+
var neo4j_driver_core_1 = require("neo4j-driver-core");
|
|
41
|
+
var session_rx_1 = __importDefault(require("./session-rx"));
|
|
42
|
+
var FETCH_ALL = neo4j_driver_core_1.internal.constants.FETCH_ALL;
|
|
43
|
+
var READ = neo4j_driver_core_1.driver.READ, WRITE = neo4j_driver_core_1.driver.WRITE;
|
|
44
|
+
exports.READ = READ;
|
|
45
|
+
exports.WRITE = WRITE;
|
|
31
46
|
/**
|
|
32
47
|
* A driver maintains one or more {@link Session}s with a remote
|
|
33
48
|
* Neo4j instance. Through the {@link Session}s you can send queries
|
|
@@ -38,23 +53,11 @@ var READ = _neo4jDriverCore.driver.READ,
|
|
|
38
53
|
*
|
|
39
54
|
* @access public
|
|
40
55
|
*/
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
(0, _inherits2["default"])(Driver, _CoreDriver);
|
|
47
|
-
|
|
48
|
-
var _super = _createSuper(Driver);
|
|
49
|
-
|
|
50
|
-
function Driver() {
|
|
51
|
-
(0, _classCallCheck2["default"])(this, Driver);
|
|
52
|
-
return _super.apply(this, arguments);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
(0, _createClass2["default"])(Driver, [{
|
|
56
|
-
key: "rxSession",
|
|
57
|
-
value:
|
|
56
|
+
var Driver = /** @class */ (function (_super) {
|
|
57
|
+
__extends(Driver, _super);
|
|
58
|
+
function Driver() {
|
|
59
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
60
|
+
}
|
|
58
61
|
/**
|
|
59
62
|
* Acquire a reactive session to communicate with the database. The session will
|
|
60
63
|
* borrow connections from the underlying connection pool as required and
|
|
@@ -70,51 +73,37 @@ var Driver = /*#__PURE__*/function (_CoreDriver) {
|
|
|
70
73
|
* @param {SessionConfig} config
|
|
71
74
|
* @returns {RxSession} new reactive session.
|
|
72
75
|
*/
|
|
73
|
-
function
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
fetchSize: validateFetchSizeValue(fetchSize, this._config.fetchSize),
|
|
92
|
-
bookmarkManager: bookmarkManager
|
|
93
|
-
}),
|
|
94
|
-
config: this._config
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
}]);
|
|
98
|
-
return Driver;
|
|
99
|
-
}(_neo4jDriverCore.Driver);
|
|
76
|
+
Driver.prototype.rxSession = function (_a) {
|
|
77
|
+
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;
|
|
78
|
+
return new session_rx_1.default({
|
|
79
|
+
session: this._newSession({
|
|
80
|
+
defaultAccessMode: defaultAccessMode,
|
|
81
|
+
bookmarkOrBookmarks: bookmarks,
|
|
82
|
+
database: database,
|
|
83
|
+
impersonatedUser: impersonatedUser,
|
|
84
|
+
reactive: false,
|
|
85
|
+
fetchSize: validateFetchSizeValue(fetchSize, this._config.fetchSize),
|
|
86
|
+
bookmarkManager: bookmarkManager
|
|
87
|
+
}),
|
|
88
|
+
config: this._config
|
|
89
|
+
});
|
|
90
|
+
};
|
|
91
|
+
return Driver;
|
|
92
|
+
}(neo4j_driver_core_1.Driver));
|
|
93
|
+
exports.Driver = Driver;
|
|
100
94
|
/**
|
|
101
95
|
* @private
|
|
102
96
|
*/
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
exports.Driver = Driver;
|
|
106
|
-
|
|
107
97
|
function validateFetchSizeValue(rawValue, defaultWhenAbsent) {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
98
|
+
var fetchSize = parseInt(rawValue, 10);
|
|
99
|
+
if (fetchSize > 0 || fetchSize === FETCH_ALL) {
|
|
100
|
+
return fetchSize;
|
|
101
|
+
}
|
|
102
|
+
else if (fetchSize === 0 || fetchSize < 0) {
|
|
103
|
+
throw new Error("The fetch size can only be a positive value or ".concat(FETCH_ALL, " for ALL. However fetchSize = ").concat(fetchSize));
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
return defaultWhenAbsent;
|
|
107
|
+
}
|
|
117
108
|
}
|
|
118
|
-
|
|
119
|
-
var _default = Driver;
|
|
120
|
-
exports["default"] = _default;
|
|
109
|
+
exports.default = Driver;
|