neo4j-driver
Advanced tools
Comparing version 1.1.0-M04 to 1.1.0-RC1
/** | ||
* Copyright (c) 2002-2016 "Neo Technology," | ||
* Copyright (c) 2002-2017 "Neo Technology,"," | ||
* Network Engine for Objects in Lund AB [http://neotechnology.com] | ||
@@ -4,0 +4,0 @@ * |
/** | ||
* Copyright (c) 2002-2016 "Neo Technology," | ||
* Copyright (c) 2002-2017 "Neo Technology,"," | ||
* Network Engine for Objects in Lund AB [http://neotechnology.com] | ||
@@ -4,0 +4,0 @@ * |
@@ -15,3 +15,3 @@ 'use strict'; | ||
exports.v1 = v1; /** | ||
* Copyright (c) 2002-2016 "Neo Technology," | ||
* Copyright (c) 2002-2017 "Neo Technology,"," | ||
* Network Engine for Objects in Lund AB [http://neotechnology.com] | ||
@@ -18,0 +18,0 @@ * |
@@ -59,3 +59,3 @@ 'use strict'; | ||
/** | ||
* Copyright (c) 2002-2016 "Neo Technology," | ||
* Copyright (c) 2002-2017 "Neo Technology,"," | ||
* Network Engine for Objects in Lund AB [http://neotechnology.com] | ||
@@ -62,0 +62,0 @@ * |
@@ -27,3 +27,3 @@ 'use strict'; | ||
/** | ||
* Copyright (c) 2002-2016 "Neo Technology," | ||
* Copyright (c) 2002-2017 "Neo Technology,"," | ||
* Network Engine for Objects in Lund AB [http://neotechnology.com] | ||
@@ -30,0 +30,0 @@ * |
@@ -27,3 +27,3 @@ "use strict"; | ||
/** | ||
* Copyright (c) 2002-2016 "Neo Technology," | ||
* Copyright (c) 2002-2017 "Neo Technology,"," | ||
* Network Engine for Objects in Lund AB [http://neotechnology.com] | ||
@@ -30,0 +30,0 @@ * |
@@ -41,3 +41,3 @@ 'use strict'; | ||
/** | ||
* Copyright (c) 2002-2016 "Neo Technology," | ||
* Copyright (c) 2002-2017 "Neo Technology,"," | ||
* Network Engine for Objects in Lund AB [http://neotechnology.com] | ||
@@ -44,0 +44,0 @@ * |
@@ -654,3 +654,3 @@ 'use strict'; | ||
/** | ||
* Copyright (c) 2002-2016 "Neo Technology," | ||
* Copyright (c) 2002-2017 "Neo Technology,"," | ||
* Network Engine for Objects in Lund AB [http://neotechnology.com] | ||
@@ -657,0 +657,0 @@ * |
@@ -43,3 +43,3 @@ "use strict"; | ||
/** | ||
* Copyright (c) 2002-2016 "Neo Technology," | ||
* Copyright (c) 2002-2017 "Neo Technology,"," | ||
* Network Engine for Objects in Lund AB [http://neotechnology.com] | ||
@@ -46,0 +46,0 @@ * |
@@ -26,3 +26,3 @@ "use strict"; | ||
}; /** | ||
* Copyright (c) 2002-2016 "Neo Technology," | ||
* Copyright (c) 2002-2017 "Neo Technology,"," | ||
* Network Engine for Objects in Lund AB [http://neotechnology.com] | ||
@@ -29,0 +29,0 @@ * |
@@ -42,3 +42,3 @@ "use strict"; | ||
/** | ||
* Copyright (c) 2002-2016 "Neo Technology," | ||
* Copyright (c) 2002-2017 "Neo Technology,"," | ||
* Network Engine for Objects in Lund AB [http://neotechnology.com] | ||
@@ -45,0 +45,0 @@ * |
@@ -142,3 +142,3 @@ 'use strict'; | ||
}(); /** | ||
* Copyright (c) 2002-2016 "Neo Technology," | ||
* Copyright (c) 2002-2017 "Neo Technology,"," | ||
* Network Engine for Objects in Lund AB [http://neotechnology.com] | ||
@@ -145,0 +145,0 @@ * |
@@ -41,3 +41,3 @@ 'use strict'; | ||
/** | ||
* Copyright (c) 2002-2016 "Neo Technology," | ||
* Copyright (c) 2002-2017 "Neo Technology,"," | ||
* Network Engine for Objects in Lund AB [http://neotechnology.com] | ||
@@ -44,0 +44,0 @@ * |
@@ -45,3 +45,3 @@ 'use strict'; | ||
/** | ||
* Copyright (c) 2002-2016 "Neo Technology," | ||
* Copyright (c) 2002-2017 "Neo Technology,"," | ||
* Network Engine for Objects in Lund AB [http://neotechnology.com] | ||
@@ -48,0 +48,0 @@ * |
@@ -7,3 +7,3 @@ 'use strict'; | ||
/** | ||
* Copyright (c) 2002-2016 "Neo Technology," | ||
* Copyright (c) 2002-2017 "Neo Technology,"," | ||
* Network Engine for Objects in Lund AB [http://neotechnology.com] | ||
@@ -10,0 +10,0 @@ * |
@@ -7,3 +7,3 @@ "use strict"; | ||
/** | ||
* Copyright (c) 2002-2016 "Neo Technology," | ||
* Copyright (c) 2002-2017 "Neo Technology,"," | ||
* Network Engine for Objects in Lund AB [http://neotechnology.com] | ||
@@ -10,0 +10,0 @@ * |
@@ -24,8 +24,2 @@ "use strict"; | ||
var _log = require("./log"); | ||
var _log2 = _interopRequireDefault(_log); | ||
var _buf = require("./buf"); | ||
var _utf = require("./utf8"); | ||
@@ -43,45 +37,43 @@ | ||
/** | ||
* Copyright (c) 2002-2016 "Neo Technology," | ||
* Network Engine for Objects in Lund AB [http://neotechnology.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 TINY_STRING = 0x80; /** | ||
* Copyright (c) 2002-2017 "Neo Technology,"," | ||
* Network Engine for Objects in Lund AB [http://neotechnology.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 MAX_CHUNK_SIZE = 16383, | ||
TINY_STRING = 0x80, | ||
TINY_LIST = 0x90, | ||
TINY_MAP = 0xA0, | ||
TINY_STRUCT = 0xB0, | ||
NULL = 0xC0, | ||
FLOAT_64 = 0xC1, | ||
FALSE = 0xC2, | ||
TRUE = 0xC3, | ||
INT_8 = 0xC8, | ||
INT_16 = 0xC9, | ||
INT_32 = 0xCA, | ||
INT_64 = 0xCB, | ||
STRING_8 = 0xD0, | ||
STRING_16 = 0xD1, | ||
STRING_32 = 0xD2, | ||
LIST_8 = 0xD4, | ||
LIST_16 = 0xD5, | ||
LIST_32 = 0xD6, | ||
MAP_8 = 0xD8, | ||
MAP_16 = 0xD9, | ||
MAP_32 = 0xDA, | ||
STRUCT_8 = 0xDC, | ||
STRUCT_16 = 0xDD; | ||
var TINY_LIST = 0x90; | ||
var TINY_MAP = 0xA0; | ||
var TINY_STRUCT = 0xB0; | ||
var NULL = 0xC0; | ||
var FLOAT_64 = 0xC1; | ||
var FALSE = 0xC2; | ||
var TRUE = 0xC3; | ||
var INT_8 = 0xC8; | ||
var INT_16 = 0xC9; | ||
var INT_32 = 0xCA; | ||
var INT_64 = 0xCB; | ||
var STRING_8 = 0xD0; | ||
var STRING_16 = 0xD1; | ||
var STRING_32 = 0xD2; | ||
var LIST_8 = 0xD4; | ||
var LIST_16 = 0xD5; | ||
var LIST_32 = 0xD6; | ||
var MAP_8 = 0xD8; | ||
var MAP_16 = 0xD9; | ||
var MAP_32 = 0xDA; | ||
var STRUCT_8 = 0xDC; | ||
var STRUCT_16 = 0xDD; | ||
@@ -166,3 +158,3 @@ /** | ||
}; | ||
} else if (x instanceof _integer2.default) { | ||
} else if ((0, _integer.isInt)(x)) { | ||
return function () { | ||
@@ -169,0 +161,0 @@ return _this.packInteger(x); |
@@ -18,3 +18,3 @@ "use strict"; | ||
/** | ||
* Copyright (c) 2002-2016 "Neo Technology," | ||
* Copyright (c) 2002-2017 "Neo Technology,"," | ||
* Network Engine for Objects in Lund AB [http://neotechnology.com] | ||
@@ -21,0 +21,0 @@ * |
@@ -18,3 +18,3 @@ "use strict"; | ||
/** | ||
* Copyright (c) 2002-2016 "Neo Technology," | ||
* Copyright (c) 2002-2017 "Neo Technology,"," | ||
* Network Engine for Objects in Lund AB [http://neotechnology.com] | ||
@@ -21,0 +21,0 @@ * |
@@ -154,3 +154,3 @@ "use strict"; | ||
}(); /** | ||
* Copyright (c) 2002-2016 "Neo Technology," | ||
* Copyright (c) 2002-2017 "Neo Technology,"," | ||
* Network Engine for Objects in Lund AB [http://neotechnology.com] | ||
@@ -157,0 +157,0 @@ * |
@@ -14,3 +14,3 @@ 'use strict'; | ||
var platformObj = {}; /** | ||
* Copyright (c) 2002-2016 "Neo Technology," | ||
* Copyright (c) 2002-2017 "Neo Technology,"," | ||
* Network Engine for Objects in Lund AB [http://neotechnology.com] | ||
@@ -17,0 +17,0 @@ * |
@@ -7,3 +7,3 @@ "use strict"; | ||
/** | ||
* Copyright (c) 2002-2016 "Neo Technology," | ||
* Copyright (c) 2002-2017 "Neo Technology,"," | ||
* Network Engine for Objects in Lund AB [http://neotechnology.com] | ||
@@ -10,0 +10,0 @@ * |
@@ -47,3 +47,3 @@ "use strict"; | ||
/** | ||
* Copyright (c) 2002-2016 "Neo Technology," | ||
* Copyright (c) 2002-2017 "Neo Technology,"," | ||
* Network Engine for Objects in Lund AB [http://neotechnology.com] | ||
@@ -50,0 +50,0 @@ * |
@@ -93,3 +93,3 @@ 'use strict'; | ||
/** | ||
* Copyright (c) 2002-2016 "Neo Technology," | ||
* Copyright (c) 2002-2017 "Neo Technology,"," | ||
* Network Engine for Objects in Lund AB [http://neotechnology.com] | ||
@@ -96,0 +96,0 @@ * |
@@ -150,3 +150,3 @@ "use strict"; | ||
}(); /** | ||
* Copyright (c) 2002-2016 "Neo Technology," | ||
* Copyright (c) 2002-2017 "Neo Technology,"," | ||
* Network Engine for Objects in Lund AB [http://neotechnology.com] | ||
@@ -153,0 +153,0 @@ * |
@@ -61,3 +61,3 @@ 'use strict'; | ||
/** | ||
* Copyright (c) 2002-2016 "Neo Technology," | ||
* Copyright (c) 2002-2017 "Neo Technology,"," | ||
* Network Engine for Objects in Lund AB [http://neotechnology.com] | ||
@@ -64,0 +64,0 @@ * |
@@ -66,3 +66,3 @@ 'use strict'; | ||
/** | ||
* Copyright (c) 2002-2016 "Neo Technology," | ||
* Copyright (c) 2002-2017 "Neo Technology,"," | ||
* Network Engine for Objects in Lund AB [http://neotechnology.com] | ||
@@ -69,0 +69,0 @@ * |
@@ -51,3 +51,3 @@ 'use strict'; | ||
/** | ||
* Copyright (c) 2002-2016 "Neo Technology," | ||
* Copyright (c) 2002-2017 "Neo Technology,"," | ||
* Network Engine for Objects in Lund AB [http://neotechnology.com] | ||
@@ -76,2 +76,3 @@ * | ||
* @param bookmark optional bookmark | ||
* @param onBookmark callback invoked when new bookmark is produced | ||
*/ | ||
@@ -203,5 +204,3 @@ function Transaction(connectionPromise, onClose, errorTransformer, bookmark, onBookmark) { | ||
var bookmark = meta.bookmark; | ||
if (bookmark) { | ||
this._tx._onBookmark(bookmark); | ||
} | ||
this._tx._onBookmark(bookmark); | ||
} | ||
@@ -208,0 +207,0 @@ }, { |
@@ -7,3 +7,3 @@ "use strict"; | ||
/** | ||
* Copyright (c) 2002-2016 "Neo Technology," | ||
* Copyright (c) 2002-2017 "Neo Technology,"," | ||
* Network Engine for Objects in Lund AB [http://neotechnology.com] | ||
@@ -33,2 +33,2 @@ * | ||
// system to control version names at packaging time. | ||
exports.default = "1.1.0-M04"; | ||
exports.default = "1.1.0-RC1"; |
{ | ||
"name": "neo4j-driver", | ||
"version": "1.1.0-M04", | ||
"version": "1.1.0-RC1", | ||
"description": "Connect to Neo4j 3.1.0 and up from JavaScript", | ||
@@ -19,4 +19,3 @@ "author": "Neo Technology Inc.", | ||
"docs": "esdoc -c esdoc.json", | ||
"versionRelease": "gulp set --version $VERSION && npm version $VERSION --no-git-tag-version", | ||
"publishRelease": "npm-publish-safe-latest next" | ||
"versionRelease": "gulp set --version $VERSION && npm version $VERSION --no-git-tag-version" | ||
}, | ||
@@ -56,3 +55,2 @@ "main": "lib/index.js", | ||
"minimist": "^1.2.0", | ||
"npm-publish-safe-latest": "^1.1.6", | ||
"phantomjs-prebuilt": "^2.1.7 ", | ||
@@ -59,0 +57,0 @@ "run-sequence": "^1.1.4", |
@@ -16,2 +16,3 @@ # Neo4j Driver for Javascript | ||
Stable channel: | ||
```shell | ||
@@ -23,6 +24,21 @@ npm install neo4j-driver | ||
Pre-release channel: | ||
```shell | ||
npm install neo4j-driver@next | ||
``` | ||
Please note that `@next` only points to pre-releases that are not suitable for production use. | ||
To get the latest stable release omit `@next` part altogether or use `@latest` instead. | ||
```javascript | ||
var neo4j = require('neo4j-driver').v1; | ||
``` | ||
Driver instance should be closed when Node.js application exits: | ||
```javascript | ||
driver.close(); | ||
``` | ||
otherwise application shutdown might hang or it might exit with a non-zero exit code. | ||
## Include in web browser | ||
@@ -42,2 +58,10 @@ | ||
It is not required to explicitly close the driver on a web page. Web browser should gracefully close all open | ||
WebSockets when the page is unloaded. However, driver instance should be explicitly closed when it's lifetime | ||
is not the same as the lifetime of the web page: | ||
```javascript | ||
driver.close(); | ||
``` | ||
## Usage examples | ||
@@ -48,4 +72,16 @@ | ||
// Create a driver instance, for the user neo4j with password neo4j. | ||
// It should be enough to have a single driver per database per application. | ||
var driver = neo4j.driver("bolt://localhost", neo4j.auth.basic("neo4j", "neo4j")); | ||
// Register a callback to know if driver creation was successful: | ||
driver.onCompleted = function() { | ||
// proceed with using the driver, it was successfully instantiated | ||
}; | ||
// Register a callback to know if driver creation failed. | ||
// This could happen due to wrong credentials or database unavailability: | ||
driver.onError = function(error) { | ||
console.log('Driver instantiation failed', error); | ||
}; | ||
// Create a session to run Cypher statements in. | ||
@@ -120,4 +156,14 @@ // Note: Always make sure to close sessions when you are done using them! | ||
} | ||
// Close the driver when application exits | ||
driver.close(); | ||
``` | ||
Subscriber API allows following combinations of `onNext`, `onCompleted` and `onError` callback invocations: | ||
* zero or more `onNext` followed by `onCompleted` when operation was successful. `onError` will not be invoked | ||
in this case | ||
* zero or more `onNext` followed by `onError` when operation failed. Callback `onError` might be invoked after | ||
couple `onNext` invocations because records are streamed lazily by the database. `onCompleted` will not be invoked | ||
in this case | ||
## Building | ||
@@ -124,0 +170,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3421040
37
232
46717