neo4j-driver 4.3.6 → 4.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/lib/driver.js CHANGED
@@ -72,6 +72,7 @@ var Driver = /*#__PURE__*/function (_CoreDriver) {
72
72
  * @param {string|string[]} param.bookmarks - The initial reference or references to some previous transactions. Value is optional and
73
73
  * absence indicates that the bookmarks do not exist or are unknown.
74
74
  * @param {string} param.database - The database this session will operate on.
75
+ * @param {string} param.impersonatedUser - The name of the user which should be impersonated for the duration of the session.
75
76
  * @returns {RxSession} new reactive session.
76
77
  */
77
78
  function rxSession() {
@@ -81,13 +82,15 @@ var Driver = /*#__PURE__*/function (_CoreDriver) {
81
82
  bookmarks = _ref.bookmarks,
82
83
  _ref$database = _ref.database,
83
84
  database = _ref$database === void 0 ? '' : _ref$database,
84
- fetchSize = _ref.fetchSize;
85
+ fetchSize = _ref.fetchSize,
86
+ impersonatedUser = _ref.impersonatedUser;
85
87
 
86
88
  return new _sessionRx["default"]({
87
89
  session: this._newSession({
88
90
  defaultAccessMode: defaultAccessMode,
89
91
  bookmarks: bookmarks,
90
92
  database: database,
93
+ impersonatedUser: impersonatedUser,
91
94
  reactive: true,
92
95
  fetchSize: validateFetchSizeValue(fetchSize, this._config.fetchSize)
93
96
  }),
package/lib/index.js CHANGED
@@ -72,7 +72,13 @@ Object.defineProperty(exports, "isTime", {
72
72
  return _neo4jDriverCore.isTime;
73
73
  }
74
74
  });
75
- exports["default"] = exports.temporal = exports.spatial = exports.session = exports.types = exports.logging = exports.auth = exports.integer = void 0;
75
+ Object.defineProperty(exports, "auth", {
76
+ enumerable: true,
77
+ get: function get() {
78
+ return _neo4jDriverCore.auth;
79
+ }
80
+ });
81
+ exports["default"] = exports.temporal = exports.spatial = exports.session = exports.types = exports.logging = exports.integer = void 0;
76
82
 
77
83
  var _driver = require("./driver");
78
84
 
@@ -337,65 +343,7 @@ function driver(url, authToken) {
337
343
  }
338
344
  }
339
345
  }
340
- /**
341
- * @property {function(username: string, password: string, realm: ?string)} basic the function to create a
342
- * basic authentication token.
343
- * @property {function(base64EncodedTicket: string)} kerberos the function to create a Kerberos authentication token.
344
- * Accepts a single string argument - base64 encoded Kerberos ticket.
345
- * @property {function(principal: string, credentials: string, realm: string, scheme: string, parameters: ?object)} custom
346
- * the function to create a custom authentication token.
347
- */
348
-
349
-
350
- var auth = {
351
- basic: function basic(username, password) {
352
- var realm = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;
353
346
 
354
- if (realm) {
355
- return {
356
- scheme: 'basic',
357
- principal: username,
358
- credentials: password,
359
- realm: realm
360
- };
361
- } else {
362
- return {
363
- scheme: 'basic',
364
- principal: username,
365
- credentials: password
366
- };
367
- }
368
- },
369
- kerberos: function kerberos(base64EncodedTicket) {
370
- return {
371
- scheme: 'kerberos',
372
- principal: '',
373
- // This empty string is required for backwards compatibility.
374
- credentials: base64EncodedTicket
375
- };
376
- },
377
- custom: function custom(principal, credentials, realm, scheme) {
378
- var parameters = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : undefined;
379
-
380
- if (parameters) {
381
- return {
382
- scheme: scheme,
383
- principal: principal,
384
- credentials: credentials,
385
- realm: realm,
386
- parameters: parameters
387
- };
388
- } else {
389
- return {
390
- scheme: scheme,
391
- principal: principal,
392
- credentials: credentials,
393
- realm: realm
394
- };
395
- }
396
- }
397
- };
398
- exports.auth = auth;
399
347
  var USER_AGENT = 'neo4j-javascript/' + _version["default"];
400
348
  /**
401
349
  * Object containing predefined logging configurations. These are expected to be used as values of the driver config's `logging` property.
@@ -504,7 +452,7 @@ var forExport = {
504
452
  isDateTime: _neo4jDriverCore.isDateTime,
505
453
  integer: integer,
506
454
  Neo4jError: _neo4jDriverCore.Neo4jError,
507
- auth: auth,
455
+ auth: _neo4jDriverCore.auth,
508
456
  logging: logging,
509
457
  types: types,
510
458
  session: session,
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 = '4.3.6';
34
+ var _default = '0.0.0-dev';
35
35
  exports["default"] = _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "neo4j-driver",
3
- "version": "4.3.6",
3
+ "version": "4.4.0",
4
4
  "description": "Connect to Neo4j 3.5.0 and up from JavaScript",
5
5
  "author": "Neo4j",
6
6
  "license": "Apache-2.0",
@@ -12,15 +12,20 @@
12
12
  "lint": "eslint --fix --ext .js ./",
13
13
  "format": "prettier-eslint '**/*.js' '**/*.json' '**/*.md' '**/*.ts' '**/*.html' --write",
14
14
  "test": "gulp test",
15
+ "test::unit": "gulp test-nodejs-unit && gulp run-ts-declaration-tests",
16
+ "test::browser": "gulp test-browser",
17
+ "test::integration": "gulp test-nodejs-integration",
18
+ "test::stress": "gulp run-stress-tests-without-jasmine",
15
19
  "build": "gulp all",
16
20
  "start-neo4j": "gulp start-neo4j",
17
21
  "stop-neo4j": "gulp stop-neo4j",
18
22
  "run-stress-tests": "gulp run-stress-tests-without-jasmine",
19
23
  "run-ts-declaration-tests": "gulp run-ts-declaration-tests",
20
- "predocs": "cd core && npm run docs",
21
24
  "docs": "esdoc -c esdoc.json",
22
25
  "versionRelease": "gulp set --x $VERSION && npm version $VERSION --no-git-tag-version",
23
- "browser": "gulp browser && gulp test-browser"
26
+ "browser": "gulp browser && gulp test-browser",
27
+ "prepare": "npm run build",
28
+ "clean": "rm -fr node_modules lib build"
24
29
  },
25
30
  "husky": {
26
31
  "hooks": {
@@ -46,7 +51,7 @@
46
51
  "@babel/preset-env": "^7.5.5",
47
52
  "@babel/register": "^7.5.5",
48
53
  "@istanbuljs/nyc-config-babel": "^2.1.1",
49
- "async": "^3.2.0",
54
+ "async": "^3.2.1",
50
55
  "babel-eslint": "^10.0.3",
51
56
  "babel-plugin-istanbul": "^5.2.0",
52
57
  "babelify": "^10.0.0",
@@ -57,7 +62,7 @@
57
62
  "esdoc-standard-plugin": "^1.0.0",
58
63
  "eslint": "^6.8.0",
59
64
  "eslint-config-standard": "^14.1.1",
60
- "eslint-plugin-import": "^2.23.3",
65
+ "eslint-plugin-import": "^2.25.2",
61
66
  "eslint-plugin-jasmine": "^2.10.1",
62
67
  "eslint-plugin-node": "^9.2.0",
63
68
  "eslint-plugin-promise": "^4.2.1",
@@ -99,15 +104,16 @@
99
104
  "run-sequence": "^2.2.1",
100
105
  "semver": "^6.3.0",
101
106
  "tmp": "0.1.0",
102
- "typescript": "^3.9.7",
107
+ "typescript": "^3.9.10",
103
108
  "vinyl-buffer": "^1.0.1",
104
109
  "vinyl-source-stream": "^2.0.0",
105
110
  "webpack": "^4.44.2"
106
111
  },
107
112
  "dependencies": {
108
113
  "@babel/runtime": "^7.5.5",
109
- "neo4j-driver-bolt-connection": "^4.3.6",
110
- "neo4j-driver-core": "^4.3.6",
114
+ "neo4j-driver-bolt-connection": "^4.4.0",
115
+ "neo4j-driver-core": "^4.4.0",
111
116
  "rxjs": "^6.6.3"
112
- }
117
+ },
118
+ "gitHead": "473235e64579ecd32e46510de9a8d9b8b83c63e6"
113
119
  }
package/types/index.d.ts CHANGED
@@ -80,6 +80,8 @@ declare const auth: {
80
80
 
81
81
  kerberos: (base64EncodedTicket: string) => AuthToken
82
82
 
83
+ bearer: (base64EncodedToken: string) => AuthToken
84
+
83
85
  custom: (
84
86
  principal: string,
85
87
  credentials: string,
package/CONTRIBUTING.md DELETED
@@ -1,60 +0,0 @@
1
- # Contributing to the Neo4j Ecosystem
2
-
3
- At [Neo4j](http://neo4j.com/), we develop our software in the open at GitHub.
4
- This provides transparency for you, our users, and allows you to fork the software to make your own additions and enhancements.
5
- We also provide areas specifically for community contributions, in particular the [neo4j-contrib](https://github.com/neo4j-contrib) space.
6
-
7
- There's an active [Neo4j Online Community](https://community.neo4j.com/) where we work directly with the community.
8
- If you're not already a member, sign up!
9
-
10
- We love our community and wouldn't be where we are without you.
11
-
12
- ## Need to raise an issue?
13
-
14
- Where you raise an issue depends largely on the nature of the problem.
15
-
16
- Firstly, if you are an Enterprise customer, you might want to head over to our [Customer Support Portal](http://support.neo4j.com/).
17
-
18
- There are plenty of public channels available too, though.
19
- If you simply want to get started or have a question on how to use a particular feature, ask a question in [Neo4j Online Community](https://community.neo4j.com/).
20
- If you think you might have hit a bug in our software (it happens occasionally!) or you have specific feature request then use the issue feature on the relevant GitHub repository.
21
- Check first though as someone else may have already raised something similar.
22
-
23
- [StackOverflow](http://stackoverflow.com/questions/tagged/neo4j) also hosts a ton of questions and might already have a discussion around your problem.
24
- Make sure you have a look there too.
25
-
26
- Include as much information as you can in any request you make:
27
-
28
- - Which versions of our products are you using?
29
- - Which language (and which version of that language) are you developing with?
30
- - What operating system are you on?
31
- - Are you working with a cluster or on a single machine?
32
- - What code are you running?
33
- - What errors are you seeing?
34
- - What solutions have you tried already?
35
-
36
- ## Want to contribute?
37
-
38
- If you want to contribute a pull request, we have a little bit of process you'll need to follow:
39
-
40
- - Do all your work in a personal fork of the original repository
41
- - [Rebase](https://github.com/edx/edx-platform/wiki/How-to-Rebase-a-Pull-Request), don't merge (we prefer to keep our history clean)
42
- - Create a branch (with a useful name) for your contribution
43
- - Make sure you're familiar with the appropriate coding style (this varies by language so ask if you're in doubt)
44
- - Include unit tests if appropriate (obviously not necessary for documentation changes)
45
- - Take a moment to read and sign our [CLA](http://neo4j.com/developer/cla)
46
-
47
- We can't guarantee that we'll accept pull requests and may ask you to make some changes before they go in.
48
- Occasionally, we might also have logistical, commercial, or legal reasons why we can't accept your work but we'll try to find an alternative way for you to contribute in that case.
49
- Remember that many community members have become regular contributors and some are now even Neo employees!
50
-
51
- ## Got an idea for a new project?
52
-
53
- If you have an idea for a new tool or library, start by talking to other people in the community.
54
- Chances are that someone has a similar idea or may have already started working on it.
55
- The best software comes from getting like minds together to solve a problem.
56
- And we'll do our best to help you promote and co-ordinate your Neo ecosystem projects.
57
-
58
- ## Further reading
59
-
60
- If you want to find out more about how you can contribute, head over to our website for [more information](http://neo4j.com/developer/contributing-code/).
package/ISSUE_TEMPLATE.md DELETED
@@ -1,53 +0,0 @@
1
- ## Guidelines
2
-
3
- Firstly, if you are an Enterprise customer, you might want to head over to our [Customer Support Portal](http://support.neo4j.com/).
4
-
5
- If you think you might have **hit a bug** in our software (it happens occasionally!) or you have specific **feature request** then use the issue feature on the relevant GitHub repository.
6
- Check first though as someone else may have already raised something similar.
7
-
8
- If you simply want to get started or have a question on how to use a particular feature, ask a question in [Neo4j Online Community](https://community.neo4j.com/) instead.
9
- [StackOverflow](http://stackoverflow.com/questions/tagged/neo4j) also hosts a ton of questions and might already have a discussion around your problem.
10
- Make sure you have a look there too.
11
-
12
- If you want to make a feature request, please prefix your issue title with `[Feature Request]` so that it is clear to us.
13
- If you have a bug report however, please continue reading.
14
- To help us understand your issue, please specify important details, primarily:
15
-
16
- - Neo4j version: Community/Enterprise X.Y.Z
17
- - Neo4j Mode: Single instance/HA cluster with X members/Casual cluster with X core Y read-replica
18
- - Driver version: X lanaguage driver X.Y.Z (If you use some other library that wraps around this driver, you might want to raise an issue there first)
19
- - Operating system: (for example Windows 10/Ubuntu 16.10 on AWS)
20
- - **Steps to reproduce**
21
- - Expected behavior
22
- - Actual behavior
23
-
24
- Additionally, include (as appropriate) log-files, stacktraces, and other debug output.
25
- Always check the server logs to see if there is any stacktrace related to the driver error too.
26
- Aslo add any solutions you've tried to solve the problem yourself.
27
-
28
- ## Example bug report
29
-
30
- I got connection reset by peer errors.
31
-
32
- **Neo4j Version:** 3.4.10 Community
33
- **Neo4j Mode**: Single instance
34
- **Driver version**: JS driver 1.7.1
35
- **Operating System:** Ubuntu 16.10 on AWS
36
-
37
- ### Steps to reproduce
38
-
39
- 1. Start Neo4j on a AWS instance
40
- 2. Run a query with the driver
41
- 3. Put the driver idle for 2h
42
- 4. Run another query
43
-
44
- ### Expected behavior
45
-
46
- The second query shall run successfully
47
-
48
- ### Actual behavior
49
-
50
- The client failed to run the second query with a `connection reset by peer` stacktrace.
51
- _attach the stacktrace_
52
- Meanwhile, in the server log, I found this stacktrace that happened at the same time when the driver failed.
53
- _attach the stacktrace_
package/TOOLS.md DELETED
@@ -1,55 +0,0 @@
1
- # List of tools used throughout the project
2
-
3
- ### npm
4
-
5
- Used for dependency management
6
-
7
- #### Common commands
8
-
9
- `NEOCTRL_ARGS="-e 4.1" npm test`
10
-
11
- `NEOCTRL_ARGS="-e 4.1" npm run start-neo4j`
12
-
13
- `NEOCTRL_ARGS="-e 4.1" npm run stop-neo4j`
14
-
15
- ### gulp
16
-
17
- Used for build system
18
-
19
- The following commands run tests directly from the source tree compared to `npm test` which runs them in a sandboxed environment.
20
-
21
- `NEOCTRL_ARGS="-e 4.1" gulp test-nodejs-unit`
22
-
23
- `NEOCTRL_ARGS="-e 4.1" gulp test-nodejs-integration`
24
-
25
- `NEOCTRL_ARGS="-e 4.1" gulp test-nodejs-stub`
26
-
27
- ### jasmine
28
-
29
- Used as the testing and assertion framework
30
-
31
- `jasmine --filter="#unit Test"` for more fine-grained test filtering. This only applies to node environment tests.
32
-
33
- ### karma
34
-
35
- Used for running tests in real browsers
36
-
37
- `gulp test-browser`
38
-
39
- ### istanbul & nyc
40
-
41
- Used for code coverage
42
-
43
- `nyc jasmine --filter="#unit"` cover unit tests
44
-
45
- ### eslint
46
-
47
- For linting
48
-
49
- ### prettier-eslint
50
-
51
- For code styling
52
-
53
- ### husky
54
-
55
- For github pre-commit hooks for code styling