neo4j-driver 4.4.8 → 5.0.0-beta01
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/README.md +4 -4
- package/lib/browser/neo4j-web.js +14325 -12402
- package/lib/browser/neo4j-web.min.js +1 -1
- package/lib/driver.js +6 -9
- package/lib/index.js +171 -82
- package/lib/internal/retry-logic-rx.js +11 -8
- package/lib/internal/server-version.js +1 -1
- package/lib/result-rx.js +371 -34
- package/lib/session-rx.js +92 -11
- package/lib/transaction-managed-rx.js +86 -0
- package/lib/transaction-rx.js +11 -0
- package/lib/version.js +1 -1
- package/package.json +32 -58
- package/tsconfig.json +3 -1
- package/types/driver.d.ts +3 -14
- package/types/index.d.ts +32 -3
- package/types/query-runner.d.ts +1 -1
- package/types/result-rx.d.ts +9 -3
- package/types/session-rx.d.ts +25 -9
- package/types/transaction-managed-rx.d.ts +26 -0
- package/types/transaction-rx.d.ts +6 -4
- package/.eslintrc.json +0 -21
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = void 0;
|
|
9
|
+
|
|
10
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
+
|
|
12
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
13
|
+
|
|
14
|
+
var _resultRx = _interopRequireDefault(require("./result-rx"));
|
|
15
|
+
|
|
16
|
+
var _transactionRx = _interopRequireDefault(require("./transaction-rx"));
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Copyright (c) "Neo4j"
|
|
20
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
21
|
+
*
|
|
22
|
+
* This file is part of Neo4j.
|
|
23
|
+
*
|
|
24
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
25
|
+
* you may not use this file except in compliance with the License.
|
|
26
|
+
* You may obtain a copy of the License at
|
|
27
|
+
*
|
|
28
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
29
|
+
*
|
|
30
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
31
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
32
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
33
|
+
* See the License for the specific language governing permissions and
|
|
34
|
+
* limitations under the License.
|
|
35
|
+
*/
|
|
36
|
+
// eslint-disable-next-line no-unused-vars
|
|
37
|
+
// eslint-disable-next-line no-unused-vars
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Represents a rx transaction that is managed by the transaction executor.
|
|
41
|
+
*
|
|
42
|
+
* @public
|
|
43
|
+
*/
|
|
44
|
+
var RxManagedTransaction = /*#__PURE__*/function () {
|
|
45
|
+
/**
|
|
46
|
+
* @private
|
|
47
|
+
*/
|
|
48
|
+
function RxManagedTransaction(_ref) {
|
|
49
|
+
var run = _ref.run;
|
|
50
|
+
(0, _classCallCheck2["default"])(this, RxManagedTransaction);
|
|
51
|
+
this._run = run;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* @private
|
|
55
|
+
* @param {RxTransaction} txc - The transaction to be wrapped
|
|
56
|
+
* @returns {RxManagedTransaction} The managed transaction
|
|
57
|
+
*/
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
(0, _createClass2["default"])(RxManagedTransaction, [{
|
|
61
|
+
key: "run",
|
|
62
|
+
value:
|
|
63
|
+
/**
|
|
64
|
+
* Creates a reactive result that will execute the query in this transaction, with the provided parameters.
|
|
65
|
+
*
|
|
66
|
+
* @public
|
|
67
|
+
* @param {string} query - Query to be executed.
|
|
68
|
+
* @param {Object} parameters - Parameter values to use in query execution.
|
|
69
|
+
* @returns {RxResult} - A reactive result
|
|
70
|
+
*/
|
|
71
|
+
function run(query, parameters) {
|
|
72
|
+
return this._run(query, parameters);
|
|
73
|
+
}
|
|
74
|
+
}], [{
|
|
75
|
+
key: "fromTransaction",
|
|
76
|
+
value: function fromTransaction(txc) {
|
|
77
|
+
return new RxManagedTransaction({
|
|
78
|
+
run: txc.run.bind(txc)
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
}]);
|
|
82
|
+
return RxManagedTransaction;
|
|
83
|
+
}();
|
|
84
|
+
|
|
85
|
+
var _default = RxManagedTransaction;
|
|
86
|
+
exports["default"] = _default;
|
package/lib/transaction-rx.js
CHANGED
|
@@ -35,6 +35,7 @@ var _neo4jDriverCore = _interopRequireDefault(require("neo4j-driver-core"));
|
|
|
35
35
|
* See the License for the specific language governing permissions and
|
|
36
36
|
* limitations under the License.
|
|
37
37
|
*/
|
|
38
|
+
// eslint-disable-next-line no-unused-vars
|
|
38
39
|
|
|
39
40
|
/**
|
|
40
41
|
* A reactive transaction, which provides the same functionality as {@link Transaction} but through a Reactive API.
|
|
@@ -115,6 +116,16 @@ var RxTransaction = /*#__PURE__*/function () {
|
|
|
115
116
|
});
|
|
116
117
|
});
|
|
117
118
|
}
|
|
119
|
+
/**
|
|
120
|
+
* Check if this transaction is active, which means commit and rollback did not happen.
|
|
121
|
+
* @return {boolean} `true` when not committed and not rolled back, `false` otherwise.
|
|
122
|
+
*/
|
|
123
|
+
|
|
124
|
+
}, {
|
|
125
|
+
key: "isOpen",
|
|
126
|
+
value: function isOpen() {
|
|
127
|
+
return this._txc.isOpen();
|
|
128
|
+
}
|
|
118
129
|
/**
|
|
119
130
|
* Closes the transaction
|
|
120
131
|
*
|
package/lib/version.js
CHANGED
|
@@ -31,5 +31,5 @@ exports["default"] = void 0;
|
|
|
31
31
|
// This is set up this way to keep the version in the code in
|
|
32
32
|
// sync with the npm package version, and to allow the build
|
|
33
33
|
// system to control version names at packaging time.
|
|
34
|
-
var _default = '
|
|
34
|
+
var _default = '5.0.0-beta01';
|
|
35
35
|
exports["default"] = _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "neo4j-driver",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0-beta01",
|
|
4
4
|
"description": "Connect to Neo4j 3.5.0 and up from JavaScript",
|
|
5
5
|
"author": "Neo4j",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
},
|
|
11
11
|
"scripts": {
|
|
12
12
|
"lint": "eslint --fix --ext .js ./",
|
|
13
|
-
"format": "prettier-eslint '**/*.js' '**/*.json' '**/*.md' '**/*.ts' '**/*.html' --write",
|
|
14
13
|
"test": "gulp test",
|
|
15
14
|
"test::unit": "gulp test-nodejs-unit && gulp run-ts-declaration-tests",
|
|
16
15
|
"test::browser": "gulp test-browser",
|
|
@@ -27,17 +26,6 @@
|
|
|
27
26
|
"prepare": "npm run build",
|
|
28
27
|
"clean": "rm -fr node_modules lib build"
|
|
29
28
|
},
|
|
30
|
-
"husky": {
|
|
31
|
-
"hooks": {
|
|
32
|
-
"pre-commit": "lint-staged"
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
"lint-staged": {
|
|
36
|
-
"*.{js,json,ts,md,html}": [
|
|
37
|
-
"prettier-eslint --write",
|
|
38
|
-
"git add"
|
|
39
|
-
]
|
|
40
|
-
},
|
|
41
29
|
"main": "lib/index.js",
|
|
42
30
|
"browser": {
|
|
43
31
|
"./lib/internal/node/index.js": "./lib/internal/browser/index.js"
|
|
@@ -46,33 +34,26 @@
|
|
|
46
34
|
"jsdelivr": "lib/browser/neo4j-web.js",
|
|
47
35
|
"types": "types/index.d.ts",
|
|
48
36
|
"devDependencies": {
|
|
49
|
-
"@babel/core": "^7.
|
|
50
|
-
"@babel/
|
|
51
|
-
"@babel/
|
|
52
|
-
"@babel/
|
|
53
|
-
"@
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"babel-plugin-istanbul": "^
|
|
37
|
+
"@babel/core": "^7.17.8",
|
|
38
|
+
"@babel/eslint-parser": "^7.17.0",
|
|
39
|
+
"@babel/plugin-transform-runtime": "^7.17.0",
|
|
40
|
+
"@babel/preset-env": "^7.16.11",
|
|
41
|
+
"@babel/register": "^7.17.7",
|
|
42
|
+
"@istanbuljs/nyc-config-babel": "^3.0.0",
|
|
43
|
+
"async": "^3.2.3",
|
|
44
|
+
"babel-plugin-istanbul": "^6.1.1",
|
|
57
45
|
"babelify": "^10.0.0",
|
|
58
|
-
"browserify": "^
|
|
46
|
+
"browserify": "^17.0.0",
|
|
59
47
|
"browserify-transform-tools": "^1.7.0",
|
|
60
48
|
"esdoc": "^1.1.0",
|
|
61
49
|
"esdoc-importpath-plugin": "^1.0.2",
|
|
62
50
|
"esdoc-standard-plugin": "^1.0.0",
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"eslint-plugin-import": "^2.25.2",
|
|
66
|
-
"eslint-plugin-jasmine": "^2.10.1",
|
|
67
|
-
"eslint-plugin-node": "^9.2.0",
|
|
68
|
-
"eslint-plugin-promise": "^4.2.1",
|
|
69
|
-
"eslint-plugin-standard": "^4.0.1",
|
|
70
|
-
"fancy-log": "^1.3.3",
|
|
71
|
-
"fs-extra": "^8.1.0",
|
|
51
|
+
"fancy-log": "^2.0.0",
|
|
52
|
+
"fs-extra": "^10.0.1",
|
|
72
53
|
"gulp": "^4.0.2",
|
|
73
54
|
"gulp-babel": "^8.0.0",
|
|
74
55
|
"gulp-batch": "^1.0.5",
|
|
75
|
-
"gulp-decompress": "^
|
|
56
|
+
"gulp-decompress": "^3.0.0",
|
|
76
57
|
"gulp-download": "^0.0.1",
|
|
77
58
|
"gulp-file": "^0.4.0",
|
|
78
59
|
"gulp-install": "^1.1.0",
|
|
@@ -81,39 +62,32 @@
|
|
|
81
62
|
"gulp-typescript": "^5.0.1",
|
|
82
63
|
"gulp-uglify": "^3.0.2",
|
|
83
64
|
"gulp-watch": "^5.0.1",
|
|
84
|
-
"husky": "^3.1.0",
|
|
85
65
|
"istanbul": "^0.4.5",
|
|
86
|
-
"jasmine-spec-reporter": "^
|
|
87
|
-
"karma": "^
|
|
88
|
-
"karma-browserify": "^
|
|
89
|
-
"karma-chrome-launcher": "^3.1.
|
|
66
|
+
"jasmine-spec-reporter": "^7.0.0",
|
|
67
|
+
"karma": "^6.3.17",
|
|
68
|
+
"karma-browserify": "^8.1.0",
|
|
69
|
+
"karma-chrome-launcher": "^3.1.1",
|
|
90
70
|
"karma-edge-launcher": "^0.4.2",
|
|
91
|
-
"karma-firefox-launcher": "^1.
|
|
71
|
+
"karma-firefox-launcher": "^2.1.2",
|
|
92
72
|
"karma-ie-launcher": "^1.0.0",
|
|
93
|
-
"karma-jasmine": "^
|
|
73
|
+
"karma-jasmine": "^4.0.2",
|
|
94
74
|
"karma-source-map-support": "^1.4.0",
|
|
95
|
-
"karma-spec-reporter": "^0.0.
|
|
96
|
-
"
|
|
97
|
-
"
|
|
98
|
-
"
|
|
99
|
-
"
|
|
100
|
-
"
|
|
101
|
-
"
|
|
102
|
-
"prettier-eslint": "^9.0.2",
|
|
103
|
-
"prettier-eslint-cli": "^5.0.0",
|
|
104
|
-
"run-sequence": "^2.2.1",
|
|
105
|
-
"semver": "^6.3.0",
|
|
106
|
-
"tmp": "0.1.0",
|
|
107
|
-
"typescript": "^3.9.10",
|
|
75
|
+
"karma-spec-reporter": "^0.0.33",
|
|
76
|
+
"lolex": "^6.0.0",
|
|
77
|
+
"minimist": "^1.2.6",
|
|
78
|
+
"nyc": "^15.1.0",
|
|
79
|
+
"semver": "^7.3.5",
|
|
80
|
+
"tmp": "0.2.1",
|
|
81
|
+
"typescript": "^4.6.3",
|
|
108
82
|
"vinyl-buffer": "^1.0.1",
|
|
109
83
|
"vinyl-source-stream": "^2.0.0",
|
|
110
|
-
"webpack": "^
|
|
84
|
+
"webpack": "^5.70.0"
|
|
111
85
|
},
|
|
112
86
|
"dependencies": {
|
|
113
|
-
"@babel/runtime": "^7.
|
|
114
|
-
"neo4j-driver-bolt-connection": "^
|
|
115
|
-
"neo4j-driver-core": "^
|
|
116
|
-
"rxjs": "^
|
|
87
|
+
"@babel/runtime": "^7.17.8",
|
|
88
|
+
"neo4j-driver-bolt-connection": "^5.0.0-beta01",
|
|
89
|
+
"neo4j-driver-core": "^5.0.0-beta01",
|
|
90
|
+
"rxjs": "^7.5.5"
|
|
117
91
|
},
|
|
118
|
-
"gitHead": "
|
|
92
|
+
"gitHead": "5de1012246d52452b4cfef304ea34f2ff1d7a88e"
|
|
119
93
|
}
|
package/tsconfig.json
CHANGED
package/types/driver.d.ts
CHANGED
|
@@ -19,10 +19,9 @@
|
|
|
19
19
|
|
|
20
20
|
import RxSession from './session-rx'
|
|
21
21
|
import {
|
|
22
|
-
ServerInfo,
|
|
23
|
-
Session,
|
|
24
22
|
Driver as CoreDriver,
|
|
25
|
-
types
|
|
23
|
+
types,
|
|
24
|
+
SessionConfig
|
|
26
25
|
} from 'neo4j-driver-core'
|
|
27
26
|
|
|
28
27
|
declare type AuthToken = types.AuthToken
|
|
@@ -36,17 +35,7 @@ declare const READ: SessionMode
|
|
|
36
35
|
declare const WRITE: SessionMode
|
|
37
36
|
|
|
38
37
|
declare interface Driver extends CoreDriver {
|
|
39
|
-
rxSession(
|
|
40
|
-
defaultAccessMode,
|
|
41
|
-
bookmarks,
|
|
42
|
-
database,
|
|
43
|
-
fetchSize
|
|
44
|
-
}?: {
|
|
45
|
-
defaultAccessMode?: SessionMode
|
|
46
|
-
bookmarks?: string | string[]
|
|
47
|
-
fetchSize?: number
|
|
48
|
-
database?: string
|
|
49
|
-
}): RxSession
|
|
38
|
+
rxSession: (sessionParams?: SessionConfig) => RxSession
|
|
50
39
|
}
|
|
51
40
|
|
|
52
41
|
export {
|
package/types/index.d.ts
CHANGED
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
|
|
20
20
|
import {
|
|
21
21
|
Neo4jError,
|
|
22
|
+
isRetriableError,
|
|
22
23
|
error,
|
|
23
24
|
Integer,
|
|
24
25
|
inSafeRange,
|
|
@@ -57,8 +58,13 @@ import {
|
|
|
57
58
|
ResultObserver,
|
|
58
59
|
QueryResult,
|
|
59
60
|
Transaction,
|
|
61
|
+
ManagedTransaction,
|
|
60
62
|
Session,
|
|
61
|
-
ConnectionProvider
|
|
63
|
+
ConnectionProvider,
|
|
64
|
+
BookmarkManager,
|
|
65
|
+
bookmarkManager,
|
|
66
|
+
BookmarkManagerConfig,
|
|
67
|
+
SessionConfig
|
|
62
68
|
} from 'neo4j-driver-core'
|
|
63
69
|
import {
|
|
64
70
|
AuthToken,
|
|
@@ -72,6 +78,7 @@ import {
|
|
|
72
78
|
} from './driver'
|
|
73
79
|
import RxSession from './session-rx'
|
|
74
80
|
import RxTransaction from './transaction-rx'
|
|
81
|
+
import RxManagedTransaction from './transaction-managed-rx'
|
|
75
82
|
import RxResult from './result-rx'
|
|
76
83
|
import { Parameters } from './query-runner'
|
|
77
84
|
|
|
@@ -91,12 +98,17 @@ declare const auth: {
|
|
|
91
98
|
) => AuthToken
|
|
92
99
|
}
|
|
93
100
|
|
|
94
|
-
declare function driver(
|
|
101
|
+
declare function driver (
|
|
95
102
|
url: string,
|
|
96
103
|
authToken?: AuthToken,
|
|
97
104
|
config?: Config
|
|
98
105
|
): Driver
|
|
99
106
|
|
|
107
|
+
declare function hasReachableServer (
|
|
108
|
+
url: string,
|
|
109
|
+
config?: Pick<Config, 'logging'>
|
|
110
|
+
): Promise<true>
|
|
111
|
+
|
|
100
112
|
declare const types: {
|
|
101
113
|
Node: typeof Node
|
|
102
114
|
Relationship: typeof Relationship
|
|
@@ -116,6 +128,7 @@ declare const types: {
|
|
|
116
128
|
Integer: typeof Integer
|
|
117
129
|
RxSession: RxSession
|
|
118
130
|
RxTransaction: RxTransaction
|
|
131
|
+
RxManagedTransaction: RxManagedTransaction
|
|
119
132
|
RxResult: RxResult
|
|
120
133
|
}
|
|
121
134
|
|
|
@@ -154,6 +167,7 @@ declare const temporal: {
|
|
|
154
167
|
|
|
155
168
|
declare const forExport: {
|
|
156
169
|
driver: typeof driver
|
|
170
|
+
hasReachableServer: typeof hasReachableServer
|
|
157
171
|
int: typeof int
|
|
158
172
|
isInt: typeof isInt
|
|
159
173
|
integer: typeof integer
|
|
@@ -170,6 +184,7 @@ declare const forExport: {
|
|
|
170
184
|
TrustStrategy: TrustStrategy
|
|
171
185
|
SessionMode: SessionMode
|
|
172
186
|
Neo4jError: Neo4jError
|
|
187
|
+
isRetriableError: typeof isRetriableError
|
|
173
188
|
Node: Node
|
|
174
189
|
Relationship: Relationship
|
|
175
190
|
UnboundRelationship: UnboundRelationship
|
|
@@ -189,6 +204,7 @@ declare const forExport: {
|
|
|
189
204
|
NotificationPosition: NotificationPosition
|
|
190
205
|
Session: Session
|
|
191
206
|
Transaction: Transaction
|
|
207
|
+
ManagedTransaction: ManagedTransaction
|
|
192
208
|
Point: Point
|
|
193
209
|
isPoint: typeof isPoint
|
|
194
210
|
Duration: Duration
|
|
@@ -199,6 +215,7 @@ declare const forExport: {
|
|
|
199
215
|
DateTime: DateTime
|
|
200
216
|
RxSession: RxSession
|
|
201
217
|
RxTransaction: RxTransaction
|
|
218
|
+
RxManagedTransaction: RxManagedTransaction
|
|
202
219
|
RxResult: RxResult
|
|
203
220
|
ConnectionProvider: ConnectionProvider
|
|
204
221
|
isDuration: typeof isDuration
|
|
@@ -207,10 +224,12 @@ declare const forExport: {
|
|
|
207
224
|
isDate: typeof isDate
|
|
208
225
|
isLocalDateTime: typeof isLocalDateTime
|
|
209
226
|
isDateTime: typeof isDateTime
|
|
227
|
+
bookmarkManager: typeof bookmarkManager
|
|
210
228
|
}
|
|
211
229
|
|
|
212
230
|
export {
|
|
213
231
|
driver,
|
|
232
|
+
hasReachableServer,
|
|
214
233
|
int,
|
|
215
234
|
isInt,
|
|
216
235
|
integer,
|
|
@@ -227,6 +246,7 @@ export {
|
|
|
227
246
|
TrustStrategy,
|
|
228
247
|
SessionMode,
|
|
229
248
|
Neo4jError,
|
|
249
|
+
isRetriableError,
|
|
230
250
|
Node,
|
|
231
251
|
Relationship,
|
|
232
252
|
UnboundRelationship,
|
|
@@ -246,6 +266,7 @@ export {
|
|
|
246
266
|
NotificationPosition,
|
|
247
267
|
Session,
|
|
248
268
|
Transaction,
|
|
269
|
+
ManagedTransaction,
|
|
249
270
|
Point,
|
|
250
271
|
isPoint,
|
|
251
272
|
Duration,
|
|
@@ -256,6 +277,7 @@ export {
|
|
|
256
277
|
DateTime,
|
|
257
278
|
RxSession,
|
|
258
279
|
RxTransaction,
|
|
280
|
+
RxManagedTransaction,
|
|
259
281
|
RxResult,
|
|
260
282
|
ConnectionProvider,
|
|
261
283
|
isDuration,
|
|
@@ -263,7 +285,14 @@ export {
|
|
|
263
285
|
isTime,
|
|
264
286
|
isDate,
|
|
265
287
|
isLocalDateTime,
|
|
266
|
-
isDateTime
|
|
288
|
+
isDateTime,
|
|
289
|
+
bookmarkManager
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
export type {
|
|
293
|
+
BookmarkManager,
|
|
294
|
+
BookmarkManagerConfig,
|
|
295
|
+
SessionConfig
|
|
267
296
|
}
|
|
268
297
|
|
|
269
298
|
export default forExport
|
package/types/query-runner.d.ts
CHANGED
|
@@ -21,7 +21,7 @@ import { Result, types } from 'neo4j-driver-core'
|
|
|
21
21
|
|
|
22
22
|
declare type Parameters = types.Parameters
|
|
23
23
|
declare interface QueryRunner {
|
|
24
|
-
run(query: string, parameters?: Parameters)
|
|
24
|
+
run: (query: string, parameters?: Parameters) => Result
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
export { Parameters }
|
package/types/result-rx.d.ts
CHANGED
|
@@ -20,11 +20,17 @@ import { Observable } from 'rxjs'
|
|
|
20
20
|
import { Record, ResultSummary } from 'neo4j-driver-core'
|
|
21
21
|
|
|
22
22
|
declare interface RxResult {
|
|
23
|
-
keys()
|
|
23
|
+
keys: () => Observable<string[]>
|
|
24
24
|
|
|
25
|
-
records()
|
|
25
|
+
records: () => Observable<Record>
|
|
26
26
|
|
|
27
|
-
consume()
|
|
27
|
+
consume: () => Observable<ResultSummary>
|
|
28
|
+
|
|
29
|
+
pause: () => void
|
|
30
|
+
|
|
31
|
+
resume: () => Promise<void>
|
|
32
|
+
|
|
33
|
+
push: () => Promise<void>
|
|
28
34
|
}
|
|
29
35
|
|
|
30
36
|
export default RxResult
|
package/types/session-rx.d.ts
CHANGED
|
@@ -25,27 +25,43 @@ import { Observable } from 'rxjs'
|
|
|
25
25
|
declare type RxTransactionWork<T> = (tx: RxTransaction) => Observable<T>
|
|
26
26
|
|
|
27
27
|
declare interface RxSession {
|
|
28
|
-
run(
|
|
28
|
+
run: (
|
|
29
29
|
query: string,
|
|
30
30
|
parameters?: Parameters,
|
|
31
31
|
config?: TransactionConfig
|
|
32
|
-
)
|
|
32
|
+
) => RxResult
|
|
33
33
|
|
|
34
|
-
beginTransaction(config?: TransactionConfig)
|
|
34
|
+
beginTransaction: (config?: TransactionConfig) => Observable<RxTransaction>
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
lastBookmarks: () => string[]
|
|
37
|
+
lastBookmark: () => string[]
|
|
38
|
+
/**
|
|
39
|
+
* @deprecated This method will be removed in version 6.0. Please, use {@link RxSession#executeRead} instead.
|
|
40
|
+
*/
|
|
41
|
+
readTransaction: <T>(
|
|
42
|
+
work: RxTransactionWork<T>,
|
|
43
|
+
config?: TransactionConfig
|
|
44
|
+
) => Observable<T>
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* @deprecated This method will be removed in version 6.0. Please, use {@link RxSession#executeWrite} instead.
|
|
48
|
+
*/
|
|
49
|
+
writeTransaction: <T>(
|
|
50
|
+
work: RxTransactionWork<T>,
|
|
51
|
+
config?: TransactionConfig
|
|
52
|
+
) => Observable<T>
|
|
37
53
|
|
|
38
|
-
|
|
54
|
+
executeRead: <T>(
|
|
39
55
|
work: RxTransactionWork<T>,
|
|
40
56
|
config?: TransactionConfig
|
|
41
|
-
)
|
|
57
|
+
) => Observable<T>
|
|
42
58
|
|
|
43
|
-
|
|
59
|
+
executeWrite: <T>(
|
|
44
60
|
work: RxTransactionWork<T>,
|
|
45
61
|
config?: TransactionConfig
|
|
46
|
-
)
|
|
62
|
+
) => Observable<T>
|
|
47
63
|
|
|
48
|
-
close()
|
|
64
|
+
close: () => Observable<any>
|
|
49
65
|
}
|
|
50
66
|
|
|
51
67
|
export default RxSession
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) "Neo4j"
|
|
3
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
4
|
+
*
|
|
5
|
+
* This file is part of Neo4j.
|
|
6
|
+
*
|
|
7
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
* you may not use this file except in compliance with the License.
|
|
9
|
+
* You may obtain a copy of the License at
|
|
10
|
+
*
|
|
11
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
*
|
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
* See the License for the specific language governing permissions and
|
|
17
|
+
* limitations under the License.
|
|
18
|
+
*/
|
|
19
|
+
import { Parameters } from './query-runner'
|
|
20
|
+
import RxResult from './result-rx'
|
|
21
|
+
|
|
22
|
+
declare interface RxManagedTransaction {
|
|
23
|
+
run: (query: string, parameters?: Parameters) => RxResult
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export default RxManagedTransaction
|
|
@@ -21,13 +21,15 @@ import { Parameters } from './query-runner'
|
|
|
21
21
|
import RxResult from './result-rx'
|
|
22
22
|
|
|
23
23
|
declare interface RxTransaction {
|
|
24
|
-
run(query: string, parameters?: Parameters)
|
|
24
|
+
run: (query: string, parameters?: Parameters) => RxResult
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
isOpen: () => boolean
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
commit: () => Observable<any>
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
rollback: () => Observable<any>
|
|
31
|
+
|
|
32
|
+
close: () => Observable<any>
|
|
31
33
|
}
|
|
32
34
|
|
|
33
35
|
export default RxTransaction
|
package/.eslintrc.json
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"parser": "babel-eslint",
|
|
3
|
-
"env": {
|
|
4
|
-
"browser": true,
|
|
5
|
-
"es6": true,
|
|
6
|
-
"node": true,
|
|
7
|
-
"jasmine": true,
|
|
8
|
-
"jest": true
|
|
9
|
-
},
|
|
10
|
-
"extends": "standard",
|
|
11
|
-
"globals": {
|
|
12
|
-
"Atomics": "readonly",
|
|
13
|
-
"SharedArrayBuffer": "readonly"
|
|
14
|
-
},
|
|
15
|
-
"parserOptions": {
|
|
16
|
-
"ecmaVersion": 6,
|
|
17
|
-
"sourceType": "module"
|
|
18
|
-
},
|
|
19
|
-
"rules": {},
|
|
20
|
-
"plugins": ["jasmine"]
|
|
21
|
-
}
|