neo4j-driver 6.0.0-alpha01 → 6.0.1
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/.eslintignore +1 -1
- package/README.md +9 -9
- package/examples/node.js +2 -2
- package/jest.browser.config.ts +8 -0
- package/jest.config.ts +201 -0
- package/jest.integration.config.ts +5 -0
- package/lib/browser/neo4j-web.esm.js +2200 -727
- package/lib/browser/neo4j-web.esm.min.js +1 -1
- package/lib/browser/neo4j-web.js +2200 -727
- package/lib/browser/neo4j-web.min.js +1 -1
- package/lib/docs.js +2 -2
- package/lib/index.js +29 -9
- package/lib/internal/retry-logic-rx.js +1 -1
- package/lib/result-rx.js +2 -2
- package/lib/session-rx.js +0 -40
- package/lib/version.js +1 -1
- package/package.json +26 -16
- package/tsconfig.json +3 -2
- package/types/index.d.ts +33 -3
- package/types/session-rx.d.ts +0 -15
package/.eslintignore
CHANGED
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
This is the official Neo4j driver for JavaScript.
|
|
4
4
|
|
|
5
|
-
Starting with
|
|
5
|
+
Starting with 6.0, the Neo4j Drivers is no longer on a monthly release cadence. Minor version releases will happen when there are sufficient new features or improvements to warrant them. This is to reduce the required work of users updating their driver.
|
|
6
6
|
|
|
7
7
|
As a policy, patch versions will not be released except on rare occasions. Bug fixes and updates will go into the latest minor version and users should upgrade to that. Driver upgrades within a major version will never contain breaking API changes.
|
|
8
8
|
|
|
@@ -11,12 +11,12 @@ See also: https://neo4j.com/developer/kb/neo4j-supported-versions/
|
|
|
11
11
|
Resources to get you started:
|
|
12
12
|
|
|
13
13
|
- [API Documentation](https://neo4j.com/docs/api/javascript-driver/current/)
|
|
14
|
-
- [Neo4j Manual](https://neo4j.com/docs/)
|
|
15
|
-
- [Neo4j
|
|
14
|
+
- [Neo4j Driver Manual](https://neo4j.com/docs/javascript-manual/current/)
|
|
15
|
+
- [Neo4j Cypher Cheatsheet](http://neo4j.com/docs/cypher-cheat-sheet/)
|
|
16
16
|
|
|
17
|
-
## What's New in
|
|
17
|
+
## What's New in 6.x
|
|
18
18
|
|
|
19
|
-
- [Changelog](https://github.com/neo4j/neo4j-javascript-driver/wiki/
|
|
19
|
+
- [Changelog](https://github.com/neo4j/neo4j-javascript-driver/wiki/6.x-changelog)
|
|
20
20
|
|
|
21
21
|
## Including the Driver
|
|
22
22
|
|
|
@@ -276,7 +276,7 @@ neo4j.driver('neo4j://localhost', neo4j.auth.basic('neo4j', 'password'), {
|
|
|
276
276
|
// It is possible to execute read transactions that will benefit from automatic
|
|
277
277
|
// retries on both single instance ('bolt' URI scheme) and Causal Cluster
|
|
278
278
|
// ('neo4j' URI scheme) and will get automatic load balancing in cluster deployments
|
|
279
|
-
var readTxResultPromise = session.
|
|
279
|
+
var readTxResultPromise = session.executeRead(txc => {
|
|
280
280
|
// used transaction will be committed automatically, no need for explicit commit/rollback
|
|
281
281
|
|
|
282
282
|
var result = txc.run('MATCH (person:Person) RETURN person.name AS name')
|
|
@@ -300,7 +300,7 @@ readTxResultPromise
|
|
|
300
300
|
|
|
301
301
|
```javascript
|
|
302
302
|
rxSession
|
|
303
|
-
.
|
|
303
|
+
.executeRead(txc =>
|
|
304
304
|
txc
|
|
305
305
|
.run('MATCH (person:Person) RETURN person.name AS name')
|
|
306
306
|
.records()
|
|
@@ -318,7 +318,7 @@ rxSession
|
|
|
318
318
|
```javascript
|
|
319
319
|
// It is possible to execute write transactions that will benefit from automatic retries
|
|
320
320
|
// on both single instance ('bolt' URI scheme) and Causal Cluster ('neo4j' URI scheme)
|
|
321
|
-
var writeTxResultPromise = session.
|
|
321
|
+
var writeTxResultPromise = session.executeWrite(async txc => {
|
|
322
322
|
// used transaction will be committed automatically, no need for explicit commit/rollback
|
|
323
323
|
|
|
324
324
|
var result = await txc.run(
|
|
@@ -344,7 +344,7 @@ writeTxResultPromise
|
|
|
344
344
|
|
|
345
345
|
```javascript
|
|
346
346
|
rxSession
|
|
347
|
-
.
|
|
347
|
+
.executeWrite(txc =>
|
|
348
348
|
txc
|
|
349
349
|
.run("MERGE (alice:Person {name: 'James'}) RETURN alice.name AS name")
|
|
350
350
|
.records()
|
package/examples/node.js
CHANGED
|
@@ -47,7 +47,7 @@ streamResult.subscribe({
|
|
|
47
47
|
const summary = streamResult.summarize()
|
|
48
48
|
// Print number of nodes created
|
|
49
49
|
console.log('')
|
|
50
|
-
console.log(summary.
|
|
50
|
+
console.log(summary.counters.nodesCreated())
|
|
51
51
|
streamSession.close()
|
|
52
52
|
},
|
|
53
53
|
onError: function (error) {
|
|
@@ -68,7 +68,7 @@ promiseResult
|
|
|
68
68
|
const summary = promiseResult.summarize()
|
|
69
69
|
// Print number of nodes created
|
|
70
70
|
console.log('')
|
|
71
|
-
console.log(summary.
|
|
71
|
+
console.log(summary.counters.nodesCreated())
|
|
72
72
|
})
|
|
73
73
|
.catch(function (error) {
|
|
74
74
|
console.log(error)
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import jestConfig from './jest.integration.config'
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
...jestConfig,
|
|
5
|
+
resolver: '<rootDir>/test/browser.resolver.js',
|
|
6
|
+
testEnvironment: '<rootDir>/test/browser.environment.js',
|
|
7
|
+
testPathIgnorePatterns: ['<rootDir>/test/examples.test.js', '<rootDir>/test/bolt-v3.test.js', '<rootDir>/test/stress.test.js']
|
|
8
|
+
}
|
package/jest.config.ts
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* For a detailed explanation regarding each configuration property and type check, visit:
|
|
3
|
+
* https://jestjs.io/docs/en/configuration.html
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
// All imported modules in your tests should be mocked automatically
|
|
8
|
+
// automock: false,
|
|
9
|
+
|
|
10
|
+
// Stop running tests after `n` failures
|
|
11
|
+
// bail: 0,
|
|
12
|
+
|
|
13
|
+
// The directory where Jest should store its cached dependency information
|
|
14
|
+
// cacheDirectory: "/private/var/folders/rw/l5gg5jxn1w59kt7r5wz6jn580000gn/T/jest_dx",
|
|
15
|
+
|
|
16
|
+
// Automatically clear mock calls and instances between every test
|
|
17
|
+
clearMocks: true,
|
|
18
|
+
|
|
19
|
+
// Indicates whether the coverage information should be collected while executing the test
|
|
20
|
+
collectCoverage: true,
|
|
21
|
+
|
|
22
|
+
// An array of glob patterns indicating a set of files for which coverage information should be collected
|
|
23
|
+
// collectCoverageFrom: undefined,
|
|
24
|
+
|
|
25
|
+
// The directory where Jest should output its coverage files
|
|
26
|
+
coverageDirectory: 'coverage',
|
|
27
|
+
|
|
28
|
+
// An array of regexp pattern strings used to skip coverage collection
|
|
29
|
+
// coveragePathIgnorePatterns: [
|
|
30
|
+
// "/node_modules/"
|
|
31
|
+
// ],
|
|
32
|
+
|
|
33
|
+
// Indicates which provider should be used to instrument code for coverage
|
|
34
|
+
coverageProvider: 'v8',
|
|
35
|
+
|
|
36
|
+
// A list of reporter names that Jest uses when writing coverage reports
|
|
37
|
+
// coverageReporters: [
|
|
38
|
+
// "json",
|
|
39
|
+
// "text",
|
|
40
|
+
// "lcov",
|
|
41
|
+
// "clover"
|
|
42
|
+
// ],
|
|
43
|
+
|
|
44
|
+
// An object that configures minimum threshold enforcement for coverage results
|
|
45
|
+
// coverageThreshold: undefined,
|
|
46
|
+
|
|
47
|
+
// A path to a custom dependency extractor
|
|
48
|
+
// dependencyExtractor: undefined,
|
|
49
|
+
|
|
50
|
+
// Make calling deprecated APIs throw helpful error messages
|
|
51
|
+
// errorOnDeprecated: false,
|
|
52
|
+
|
|
53
|
+
// Force coverage collection from ignored files using an array of glob patterns
|
|
54
|
+
// forceCoverageMatch: [],
|
|
55
|
+
|
|
56
|
+
// A path to a module which exports an async function that is triggered once before all test suites
|
|
57
|
+
// globalSetup: undefined,
|
|
58
|
+
|
|
59
|
+
// A path to a module which exports an async function that is triggered once after all test suites
|
|
60
|
+
// globalTeardown: undefined,
|
|
61
|
+
|
|
62
|
+
// A set of global variables that need to be available in all test environments
|
|
63
|
+
// globals: {},
|
|
64
|
+
|
|
65
|
+
// The maximum amount of workers used to run your tests. Can be specified as % or a number. E.g. maxWorkers: 10% will use 10% of your CPU amount + 1 as the maximum worker number. maxWorkers: 2 will use a maximum of 2 workers.
|
|
66
|
+
// maxWorkers: "50%",
|
|
67
|
+
|
|
68
|
+
// An array of directory names to be searched recursively up from the requiring module's location
|
|
69
|
+
moduleDirectories: [
|
|
70
|
+
'node_modules'
|
|
71
|
+
],
|
|
72
|
+
|
|
73
|
+
// An array of file extensions your modules use
|
|
74
|
+
moduleFileExtensions: [
|
|
75
|
+
'js',
|
|
76
|
+
'json',
|
|
77
|
+
'jsx',
|
|
78
|
+
'ts',
|
|
79
|
+
'tsx',
|
|
80
|
+
'node'
|
|
81
|
+
],
|
|
82
|
+
|
|
83
|
+
globals: {
|
|
84
|
+
extensionsToTreatAsEsm: ['.ts', '.js'],
|
|
85
|
+
'ts-jest': {
|
|
86
|
+
useESM: true
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
|
|
90
|
+
// A map from regular expressions to module names or to arrays of module names that allow to stub out resources with a single module
|
|
91
|
+
// moduleNameMapper: {},
|
|
92
|
+
|
|
93
|
+
// An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader
|
|
94
|
+
// modulePathIgnorePatterns: [],
|
|
95
|
+
|
|
96
|
+
// Activates notifications for test results
|
|
97
|
+
// notify: false,
|
|
98
|
+
|
|
99
|
+
// An enum that specifies notification mode. Requires { notify: true }
|
|
100
|
+
// notifyMode: "failure-change",
|
|
101
|
+
|
|
102
|
+
// A preset that is used as a base for Jest's configuration
|
|
103
|
+
preset: 'ts-jest',
|
|
104
|
+
|
|
105
|
+
// Run tests from one or more projects
|
|
106
|
+
// projects: undefined,
|
|
107
|
+
|
|
108
|
+
// Use this configuration option to add custom reporters to Jest
|
|
109
|
+
// reporters: undefined,
|
|
110
|
+
|
|
111
|
+
// Automatically reset mock state between every test
|
|
112
|
+
// resetMocks: false,
|
|
113
|
+
|
|
114
|
+
// Reset the module registry before running each individual test
|
|
115
|
+
// resetModules: false,
|
|
116
|
+
|
|
117
|
+
// A path to a custom resolver
|
|
118
|
+
// resolver: undefined,
|
|
119
|
+
|
|
120
|
+
// Automatically restore mock state between every test
|
|
121
|
+
// restoreMocks: false,
|
|
122
|
+
|
|
123
|
+
// The root directory that Jest should scan for tests and modules within
|
|
124
|
+
// rootDir: undefined,
|
|
125
|
+
|
|
126
|
+
// A list of paths to directories that Jest should use to search for files in
|
|
127
|
+
// roots: [
|
|
128
|
+
// "<rootDir>"
|
|
129
|
+
// ],
|
|
130
|
+
|
|
131
|
+
// Allows you to use a custom runner instead of Jest's default test runner
|
|
132
|
+
// runner: "jest-runner",
|
|
133
|
+
|
|
134
|
+
// The paths to modules that run some code to configure or set up the testing environment before each test
|
|
135
|
+
// setupFiles: [],
|
|
136
|
+
|
|
137
|
+
// A list of paths to modules that run some code to configure or set up the testing framework before each test
|
|
138
|
+
// setupFilesAfterEnv: [],
|
|
139
|
+
|
|
140
|
+
// The number of seconds after which a test is considered as slow and reported as such in the results.
|
|
141
|
+
// slowTestThreshold: 5,
|
|
142
|
+
|
|
143
|
+
// A list of paths to snapshot serializer modules Jest should use for snapshot testing
|
|
144
|
+
// snapshotSerializers: [],
|
|
145
|
+
|
|
146
|
+
// The test environment that will be used for testing
|
|
147
|
+
testEnvironment: 'node',
|
|
148
|
+
|
|
149
|
+
// Options that will be passed to the testEnvironment
|
|
150
|
+
// testEnvironmentOptions: {},
|
|
151
|
+
|
|
152
|
+
// Adds a location field to test results
|
|
153
|
+
// testLocationInResults: false,
|
|
154
|
+
|
|
155
|
+
// The glob patterns Jest uses to detect test files
|
|
156
|
+
testMatch: [
|
|
157
|
+
'**/test/unit/?(*.)+(spec|test).[tj]s?(x)'
|
|
158
|
+
],
|
|
159
|
+
|
|
160
|
+
// An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
|
|
161
|
+
// testPathIgnorePatterns: [
|
|
162
|
+
// "/node_modules/"
|
|
163
|
+
// ],
|
|
164
|
+
|
|
165
|
+
// The regexp pattern or array of patterns that Jest uses to detect test files
|
|
166
|
+
// testRegex: [],
|
|
167
|
+
|
|
168
|
+
// This option allows the use of a custom results processor
|
|
169
|
+
// testResultsProcessor: undefined,
|
|
170
|
+
|
|
171
|
+
// This option allows use of a custom test runner
|
|
172
|
+
// testRunner: "jasmine2",
|
|
173
|
+
|
|
174
|
+
// This option sets the URL for the jsdom environment. It is reflected in properties such as location.href
|
|
175
|
+
// testURL: "http://localhost",
|
|
176
|
+
|
|
177
|
+
// Setting this value to "fake" allows the use of fake timers for functions such as "setTimeout"
|
|
178
|
+
// timers: "real",
|
|
179
|
+
|
|
180
|
+
// A map from regular expressions to paths to transformers
|
|
181
|
+
transform: {
|
|
182
|
+
'[\\s\\S]*': 'ts-jest'
|
|
183
|
+
},
|
|
184
|
+
// An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation
|
|
185
|
+
transformIgnorePatterns: [
|
|
186
|
+
'/node_modules/',
|
|
187
|
+
'\\.pnp\\.[^\\/]+$'
|
|
188
|
+
]
|
|
189
|
+
|
|
190
|
+
// An array of regexp pattern strings that are matched against all modules before the module loader will automatically return a mock for them
|
|
191
|
+
// unmockedModulePathPatterns: undefined,
|
|
192
|
+
|
|
193
|
+
// Indicates whether each individual test should be reported during the run
|
|
194
|
+
// verbose: undefined,
|
|
195
|
+
|
|
196
|
+
// An array of regexp patterns that are matched against all source file paths before re-running tests in watch mode
|
|
197
|
+
// watchPathIgnorePatterns: [],
|
|
198
|
+
|
|
199
|
+
// Whether to use watchman for file crawling
|
|
200
|
+
// watchman: true,
|
|
201
|
+
}
|